Posts

Showing posts from May, 2015

java - File issues with threading in tomcat -

java - File issues with threading in tomcat - i have tomcat server , have controller writes in file, info coming in request. uncertainty whether multiple threads within server can write same file @ same time , cause issues? my requirement requests appends info same file. not using threading end. my code follows: file file = new file(filename); seek { if(!file.exists()) { file.createnewfile(); } inputstream inputstream = request.getinputstream(); filewriter filewriter = new filewriter(filename,true); bufferedwriter bufferwriter = new bufferedwriter(filewriter); bufferwriter.write(ioutils.tostring(inputstream)); bufferwriter.flush(); bufferwriter.close(); } there standard solution such issue. you have create singleton class, shared between threads. this singleton have blockingqueue (e.g. linkedblockingqueue ) in threads set messages writing single file. this singleton self thread , within run() meth...

assembly - Alignment in VLD1 -

assembly - Alignment in VLD1 - i have question arm neon vld1 instruction's alignment. how alignment in next code work? data .req r0 vld1.16 {d16, d17, d18, d19}, [data, :128]! does starting address of read instruction shifts info + positive integer, such smallest multiple of 16(16 bytes = 128 bits) no less data, or info changes smallest multiple of 16 no less data? it hint cpu. thing read usefulness of such hint blog post on arm's site claiming makes loading faster, doesn't how or why however. because cpu can issue wider loads. you can specify alignment pointer passed in rn, using optional : parameter, speeds memory accesses. if provide hint must create sure data aligned 16 bytes otherwise you'll hardware exception. this hardware behavior described in vld1 description in arm arm as if conditionpassed() encodingspecificoperations(); checkadvsimdenabled(); nullcheckifthumbee(n); address = r[n]; i...

linux - What is wrong with my find command usage? -

linux - What is wrong with my find command usage? - i'm trying find files name matches c++ file extensions exclude directories matching pattern this: find /home/palchan/code -name "*.[cchh]" -o -name "*.cpp" -o -name "*.hpp" -a ! -name "*pattern*" and still gives me output files like: /home/palchan/code/libfox/pattern/hdr/fox/redfox.h which has pattern in it? here example: > ls -r . .: libfox ./libfox: redfox.c redfox.h pattern ./libfox/pattern: redfox.c redfox.h and run: > find . \( -name "*.[hc]" -a ! -name "*pattern*" \) ./libfox/pattern/redfox.c ./libfox/pattern/redfox.h ./libfox/redfox.c ./libfox/redfox.h the next should work: find /home/palchan/code \( -name "*pattern*" \) -prune -o -type f \( -name "*.[cchh]" -o -name "*.cpp" -o -name "*.hpp" \) -print from man find : class="lang-none prettyprint-override">...

javascript - Multi-color SVG polyline -

javascript - Multi-color SVG polyline - i'm using leaflet draw map info in svg format on top of map javascript. have set of thousands of coordinates, in i'm drawing leaflet path (extends l.browser.svg). i'd color code line 3rd variable (since map, say, altitude, bluish beingness low , reddish beingness high, or that). i'm new svg, seems can set stroke-color entire path. e.g. have -- line 1 color (conceptual code stripped downwards simplicity): // create svg grouping , path element this._container = this._createelement('g'); this._path = this._createelement('path'); // set stoke color -- wish create dynamic per segment! this._path.setattribute('stroke', '#00000'); // not real code, simplified...generate lots of coordinates polyline var mypath = "m" + p.x + "," + p.y + " l"; points.each(function(item, index){ poly += item.x + "," + item.y + " "; ...

javascript - Select and animate all divs with a class but ignore all children with same class -

javascript - Select and animate all divs with a class but ignore all children with same class - i'm hoping there's simple solution this, can't see @ minute. i'm attempting select divs class myclass, ignore children of said class including have class myclass. example: <div class="myclass"> //select <div class="myclass"> //don't <div class="myclass"></div> //don't etc </div> </div> <div class="myclass"></div> <div class="myclass"> <div class="myclass"></div> </div> <div class="myclass"></div> i know odd situation, it's come need slide map controls across google map when sliding in side-div (so not cover them). classes need altered named 'gmnoprint' , if children not ignored elements within parent moved double required amount each level of nesting. my current solution ...

c# - Is the string ctor the fastest way to convert an IEnumerable to string -

c# - Is the string ctor the fastest way to convert an IEnumerable<char> to string - i've edited question incorporate valid points raised in comments. i musing on my reply previous question , started wonder, this, return new string(charsequence.toarray()); the best way convert ienumerable<char> string . did little search , found question asked here. reply asserts that, string.concat(charsequence) is improve choice. next reply question, stringbuilder enumeration approach suggested, var sb = new stringbuilder(); foreach (var c in chars) { sb.append(c); } homecoming sb.tostring(); while may little unwieldy include completeness. decided should little test, code used @ bottom. when built in release mode, optimizations, , run command line without debugger attached results this. 1000000 iterations of "concat" took 1597ms. 1000000 iterations of "new string" took 869ms. 1000000 iterations of "sb...

Cloning an Android Application -

Cloning an Android Application - i made application android, need create copies of same application. i'll have alter bundle name, , other generated files (/ bin) new name of application. the divergence between 2 applications (the original , copied), in add-on mentioned, strings , styles files. is there simple way this? (maybe creating library, not know how this) thanks! i'm not sure difficulty in case. you'd create re-create of project folder , import eclipse existing project. in android manifest modify bundle name, , strings.xml modified new values (as styles xml files). android

excel vba - Delete Rows & Maintain Input Range -

excel vba - Delete Rows & Maintain Input Range - i wonder whether may able help me please. for few weeks i've been trying find solution whereby users can following: delete rows , without data, shift rows containing info aso sit down 1 under another, whilst maintaining defined 'input range' i've set next script clears cell contents , hence doesn't alter 'input range'. sub delrow() dim msg sheets("input").protect "handsoff", userinterfaceonly:=true application.enablecancelkey = xldisabled application.enableevents = false msg = msgbox("are sure want delete row?", vbyesno) if msg = vbno exit sub selection application.intersect(.parent.range("a:s"), .entirerow).interior.colorindex = xlnone application.intersect(.parent.range("t:ae"), .entirerow).interior.colorindex = 42 selection.sp...

apache - mod_rewrite, i want to rewrite: index.php?page=contact to contact -

apache - mod_rewrite, i want to rewrite: index.php?page=contact to contact - i want people using site see site.com/contact in browser address bar in place of site.com/index.php?page=contact. i'm new mod_rewrite, , far, came rule. the code have right is: rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?page=$1 how accomplish this? edit: problem url of contact page still says: site.com/index.php?page=contact. the lastly part, rewriterule, should this: rewriterule ^(contact)/?$ index.php?page=$1 that means if user types, "mysite.com/contact" they're beingness served "mysite.com/index.php?page=contact". the parentheses create capture group, translates $1 . each consecutive parentheses, capture grouping variable increments - $2 , $3 , , on. apache mod-rewrite url-rewriting

css - overflow-x html issue -

css - overflow-x html issue - im having little issue iframe i'm using on website. reason can't iframe not show horizontal scroll bar @ bottom. here's code: <center> <iframe height="1330" width="100%" src="http://sentinelgaming.spreadshirt.com/" name="spreadshop" itemscope itemtype="http://www.sentinelgaming.net/store" id="spreadshop" frameborder="0" scrollbar="no" ></iframe> </center> <style> #spreadshop { overflow-x: hidden; } </style> heres page can @ see i'm talking about: http://www.sentinelgaming.net/store in short, don't think possible hide overflow of iframe. believe main reason security. thought should not able hide parts of loaded source beingness shown. i've made small example showing how overflow-property beingness ignored. <iframe src="http://cnn.com"></iframe"> iframe { w...

shell - MongoDB db collection linking -

shell - MongoDB db collection linking - suppose have 2 collection in mongodb students: {_id: 1, name: "sa", teachers:[1,2,3]} {_id: 2, name: "sb", teachers:[1,3]} teachers: {_id:1, name: "ta"} {_id:2, name: "tb"} {_id:3, name: "tc"} now want query in students collection through teachers name. this: db.students.find({'teachers.name':"ta"}).count() i have read somewhere possible link collection or embed it. there way it? what have tried? have tried db.students.ensureindex({'teachers':1}) not work. think should not work. going out of clue how it? duplicate: know there lot of post has similar title, yet confused! have looked how relational models done mongodb? i unsure why think ensureindex here. there no way "link" collections, mongodb non-relational database. there no way query can defined querying 2 collections separately using sub selects @ moment. the main pro...

c - Determining where string equality comparison fails -

c - Determining where string equality comparison fails - given these strings char * foo = "the name of game"; char * boo = "the name of rose" i want determine address of first mismatched character, in order extract mutual header ("the name of the "). i know hand-coded loop trivial, i'm curious if there's variant of strcmp() or other library function automatically me? , reply different in c++? nope. no such standard string.h function exists. c c-strings

Kohana ORM Check if user exists and returning messages to View? -

Kohana ORM Check if user exists and returning messages to View? - i'm using kohana 3.3 in project , i'm trying user registration , login working. using orm's auth , kostache managing layout/templates. how i: check if username exists? if homecoming error_msg.mustache message "user exists" check if username , email valid according model rules? if not homecoming error message error_msg.mustache indicating validation failed in controller have: class controller_user extends controller { public function action_signup() { $renderer = kostache_layout::factory(); $this->response->body($renderer->render(new view_frontend_user, 'frontend/signup')); } public function action_createuser() { seek { $user = orm::factory('user'); $user->username = $this->request->post('username'); $user->password = $this->request->post('password...

iphone - NSMutableArray Doesn't remember location of objects -

iphone - NSMutableArray Doesn't remember location of objects - i created nsmutablearray category. want move objects in array, when moved in table view. category: - (void)moveobjectfromindex:(nsuinteger)from toindex:(nsuinteger)to { if (to != from) { id obj = [self objectatindex:from]; [self removeobjectatindex:from]; if (to >= [self count]) { [self addobject:obj]; } else { [self insertobject:obj atindex:to]; } } } and in view controller, call: - (void)tableview:(uitableview *)table moverowatindexpath:(nsindexpath *)sourceindexpath toindexpath:(nsindexpath *)destinationindexpath { [self.tablearray moveobjectfromindex:[sourceindexpath row] toindex:[destinationindexpath row]]; [self.ammotable reloaddata]; } but array seems not moving objects within around. reason this? followed tutorial. , should work, if can tell problem please delight me on reason. bunch! edit i have tried code below unfortunately doesnt work: - (vo...

html - jQuery: Hiding hidden elements -

html - jQuery: Hiding hidden elements - maybe odd question - i have designed simple slideshow. part of slideshow includes text appears when hover on slideshow div. when mouseout of slideshow div, text should disappear - , on slide displayed. upon rotation, 1 finds slides hidden text still showing (presumably because 1 cannot hide element parent hidden). so... is there anyway me hide these kid elements while parent hidden? here code, can provide more. $("#banner").hoverintent(function(){ $(".bannercontrols, .bannerblurb").show('slow'); cleartimeout(timer); },function(){ $(".bannercontrols, .bannerblurb").hide('slow'); timer = settimeout(function(){ beginrotation(); },slidetime); }); thanks help. html below - quite long, gives thought of set - various parts written in before hand, , hidden/shown needed. <div id="banner" style="position:relative; width:595px; height:254px; background-col...

x86 - assembly determine input logic -

x86 - assembly determine input logic - can help me how can start programme in assembly language? task write programme inquire user input (just single letter, number, or special character) , programme determine whether user's input letter, number, or special character. thoughts? please help! not asking exact code here want larn how it. im planning figure out step step help appreciated. give thanks much! assuming user input in al ... cmp al, 'a' jb not_upper cmp al, 'z' ja not_upper ; arrange print "uppercase" or "alpha" or "letter" not_upper: cmp al, 'a' jb not_lower cmp al, 'z' ja not_lower ; arrange print "lowercase" or whatever not_lower: cmp al, '0' ; etc... faster way create lookup table , utilize input index - eliminates conditional jumps. improve naive way first program... assembly x86 tasm

javascript - How to get JSON array from file with getJSON? -

javascript - How to get JSON array from file with getJSON? - how array json of json file javascript , jquery i triyng next code, doesnt work: var questions = []; function getarray(){ $.getjson('questions.json', function (json) { (var key in json) { if (json.hasownproperty(key)) { var item = json[key]; questions.push({ category: item.category }); } } homecoming questions; }) } this json file called: questions.json { "biology":{ "category":{ "cell":{ "question1":{ "que1":"what cell?" }, "option1":{ "op1":"the cell basic structural , functional unit", "op2":"is fictional supervillain in dragon ball" }, "answer1...

html5 canvas - EaselJS: Changing a Shape Objects Dimensions -

html5 canvas - EaselJS: Changing a Shape Objects Dimensions - total noob question. i've been abusing google , reason, have surprisingly not been able find regarding this...? sense i'm missing here. :p i have resize() function modifies canvas dimensions size of window. in minimal illustration (which uses jquery), have variable references shape object. according documents, shape object not include width & height property. efficient way of resizing shape object? removing/redrawing dynamically? this have: var stage; var bgcolor; $(document).ready(function(){ init(); }); function init() { stage = new createjs.stage("canvasstage"); bgcolor = new createjs.shape(); bgcolor.graphics.beginfill("#000000").drawrect(0,0, stage.canvas.width, stage.canvas.width); stage.addchild(bgcolor); ...

Some questions on using the canvas in Java to draw shapes and paths for Android? -

Some questions on using the canvas in Java to draw shapes and paths for Android? - how find coordinates of screen? know e.g. phone have 960 x 540 resolution, in emulators of edges not filled if draw shape resolution. there way around this? for colour of rectangle, seen there 2 rectangles, , 2 of them have same colour despite giving 2 separate colours drawpaint. setting new variable e.g. drawpaint2 returns errors. how alter colour of both? how utilize path function in canvas. e.g. draw triangle? have included effort in code doesn't display triangle. public class drawview extends view implements ontouchlistener { private paint backgroundpaint = new paint(); private paint drawpaint = new paint(); private paint circlepaint = new paint(); private paint textpaint = new paint(); private paint path = new paint(); private float sx, sy; public drawview(context context) { super(context); setfocusable(true); ...

python - Django Lettuce Running Tests Twice in Parallel -

python - Django Lettuce Running Tests Twice in Parallel - i'm trying output step definitions lettuce. when run test, see flash output second, before beingness overwritten appears same tests. can see steps beingness called twice in output. 1 dark (almost black) colored, time it's greenish or red. output highlighted below. this causing me headache because debugging info showing in other test thats running, not one. i'm having hard time articulating this, think screen capture helps illustrate point: should see each step called once, isn't case right now. any help appreciated. feature feature: navigation persion looking info on specific machine in order view date machine inventory should able navigate individual machine background: given next users exist: | username | first_name | last_name | password | | johndoe | john | doe | testpass | , next machines exist: | msnbr | machine_name | brand_nam...

How to prevent duplicate records in a mapping table in MVC3? -

How to prevent duplicate records in a mapping table in MVC3? - i have next tables: client (pkey = clientid) user (pkey = userid) userclient (fkeys = clientid, userid) when seek add together record (mapping) in userclient table such user-client pair should unique, allows duplicate records. i want prevent that. meaning, when trying add together existing user-client pair should throw client side validation. how can prevent entry of duplicate record in mapping table in mvc3? it sounds want uniquly identify columns. yu can accomplish help of candidate key in sql server, not supported in entity framework. entity framework: alternate solution using non primary unique keys in association duplicates record rdbms

Running Python CGI Scripts from Javascript and JQuery Mobile UI -

Running Python CGI Scripts from Javascript and JQuery Mobile UI - the workflow i'm trying accomplish follows. there jquery mobile ui bunch of range slider elements. each 1 controlling different function. when user moves , releases 1 of these sliders, jquery event should triggered makes ajax phone call (i don't care if uses json, xml, post, etc - fastest best) the ajax phone call contains info slider moved, , new value (ex: id=slider1, value=215) the ajax executes python script in cgi bin reads id , value , controls hardware connected raspberry pi via serial (the raspberry pi running webserver). i have jquery ui bunch of sliders. each slider code looks this: <div data-role="fieldcontain"> <fieldset data-role="controlgroup"> <div class="rgbw_label"><label for="red_slider"> red: </label></div> <input type="range" id="red_slider...

Facebook API - return friends list (PHP arrays) -

Facebook API - return friends list (PHP arrays) - im trying homecoming friend list of user using facebook app without using php sdk. have managed homecoming users name, gender, etc. without using auth code. im trying homecoming list of names users friends, ive managed far print array, cant seem print name laid out differently users name, gender, etc. managed echo doing: $user->name but when seek friends list doesnt work , doesnt echo @ all, wondering if knew how go doing this? using print_r following: array( [0] => array ( [name] => friend's name [id] => x ) [1] => array ( [name] => friend's name [id] => x ) [2] =>....) until of friends have been listed. { "name": "name", "hometown": { "id": "hometown_id", "name": "hometown" }, "id": "friend_id" } above construction of array of each, think potential issue n...

c - Analyzing IEEE 754 bit patterns -

c - Analyzing IEEE 754 bit patterns - i'm working on assignment i'm stuck. reason can't outcome: byte order: little-endian > ffffffff 0xffffffff signbit 1, expbits 255, fractbits 0x007fffff qnan > 3 0x00000003 signbit 0, expbits 0, fractbits 0x00000003 denormalized: exp = -126 > deadbeef 0xdeadbeef signbit 1, expbits 189, fractbits 0x002dbeef normalized: exp = 62 > deadbeef 0xdeadbeef signbit 1, expbits 189, fractbits 0x002dbeef normalized: exp = 62 > 0 0x00000000 signbit 0, expbits 0, fractbits 0x00000000 +zero i have tried solve problem can't figure out went wrong. next code effort project. sense i'm nearing end can't finish.. here code: #include <stdio.h> #include <stdlib.h> static char *studentname = "name"; // study whether machine big or little endian void bigorsmallendian() { int num = 1; if(*(char *)&num == 1) { printf("\nbyte order: little-endian\n\n...

android - Where do you put an AsyncTask that would load data on a ListFragment? -

android - Where do you put an AsyncTask that would load data on a ListFragment? - so question states, set asynctask load info onto listfragment? my mainactivity have 3 fragments. 1 listfragment contain categories. middle 1 fragment contain info retrieved selecting categories. , lastly 1 listfragment show ones user have selected. each of 3 fragments have own xml files , own .java files. main activity cml file define 3 fragments through fragment tags. works fine when not loading info on first list fragment. when start loading info remote server through http request fails. using asynctask accomplish it. here java file menucategory.java package com.thesis.menubook; import java.util.arraylist; import java.util.hashmap; import java.util.list; import org.apache.http.namevaluepair;import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.annotation.targetapi; import android.app.listfragment; import android.app.progressdi...

android parse json after optimize php json_encode -

android parse json after optimize php json_encode - there arrays in arrays: array ( [0] => array ( [0] => v1 [1] => v2 [2] => v3 ) [1] => array ( [0] => v1 [1] => v2 [3] => v3 ) [2] => array ( [0] => v1 [1] => v2 [10] => v3 ) [4] => array ( [0] => v1 [1] => v2 [3] => v3 ) ) after json_encode on andorid following: { «0»: [ «v1», «v2», «v3» ], «1»: { «0»:«v1», «1»:«v2», «3»:«v3», }, «2»: { «0»:«v1», «1»:«v2», «10»:«v3» }, «4»: { «0»:«v1», «1»:«v2», «3»:«v2» } } jsonarray jlist = jb.getjsonarray(response); //exception not array is there way parse array[array[]] on android? this happens because have non-contiguous indices. if "renumber" array $a = array_values($a); you have array ( [0] => array ( [0] => v1 [1] => v2 [2] => v3 ) [1] => array ( [0] => v1 [1] => v2 [3] => v3 ) [2] => array ( [0] => v1 [1] => v2 [10] => v3 ...

python - How to set multiple validators to a field in web2py? -

python - How to set multiple validators to a field in web2py? - i wanna set multiple validators filed sample. 1 of them work well. why? db.aetitles.hospital_id.requires = is_not_empty() db.aetitles.hospital_id.requires = is_in_db(db, db.hospitals.id, '%(title)s') i tried , right: db.aetitles.hospital_id.requires = [is_not_empty(), is_in_db(db, db.hospitals.id, '%(title)s')] python web2py

Import library dependencies in flash (actionscript 3) -

Import library dependencies in flash (actionscript 3) - i developing quiz application practice purpose, using flash cs5. at top of as3, have : import flash.net.urlrequest; import flash.net.urlloader; i utilize load xml file. i wonder, should import library, because it'll compile delete lines? thanks. you placing code in frame script, works pseudo import flash.*.* scope. import statements not impact performance or file size , simply intrinsic help compiler understand mean when referring urlloader . as side note, highly suggest not placing code in frame actions , using document class object and/or external .as files. actionscript-3 flash-cs5

How to add APC adapter to cache classmaps in Zend framework 2 -

How to add APC adapter to cache classmaps in Zend framework 2 - i need cache classmaps of each of modules in zend framework 2 application using apc in opcode cache . there work around . afaik in application.config.php 'module_map_cache_enabled' => true, // key used create class map cache file name. 'module_map_cache_key' => 'test', // path in cache merged configuration. 'cache_dir' => 'path/to/data/cache', by doing zend cache using file scheme cache need utilize apc opcode cache how can achive . i know utilize apc in zend framework 1 @ bootstrap.php . but not finding documentation in official site . thanks in advance responding post the generated file will cached apc opcode cache if have opcode cache enabled. can check looking @ apc statistics page. place file temporarely on server , watch system cache entries tab. module map , config cache back upwards files , no cache ad...

Onclick on Google map marker but not when panning the map -

Onclick on Google map marker but not when panning the map - i'm using (javascript): google.maps.event.adddomlistener(new_marker, 'click', function(e) { alert("hi"); }); but don't want trigger when user moves map, , happened while clicking on marker. clear: want code run when user clicked on marker, without moving map. how can that? google-maps-api-3

tomcat - GCM error sending messages at server -

tomcat - GCM error sending messages at server - i next error when trying send message gcm demo server. code same supplied @ developer.android.com/google/gcm/demo.html , it's run on tomcat. device gets registered on server , shows "1 device(s) registered!". next error when "send message" button pressed. (i have placed api key received https://code.google.com/apis/console/ in "api.key" file.) apache tomcat/7.0.35 - error study http status 500 - http status code: 401 type exception report message http status code: 401 description server encountered internal error prevented fulfilling request. exception com.google.android.gcm.server.invalidrequestexception: http status code: 401 com.google.android.gcm.server.sender.sendnoretry(sender.java:177) com.google.android.gcm.server.sender.send(sender.java:121) com.google.android.gcm.demo.server.sendallmessagesservlet.dopost(sendallmessagesservlet.java:82) javax.servlet.http.httpservlet.se...

where is RabbitMQ internal API reference for plugin development -

where is RabbitMQ internal API reference for plugin development - i developing custom rabbitmq plugin, cannot find anywhere internal api reference (in erlang of course) solely internal rabbitmq. documented somewhere ? notice not erlang client api looking for, internal api reference utilize within rabbitmq plugins. as example: want identify listening port within plugling without @ config file. assume config file loaded internally in rabbitmq , accessible internal api such rabbitmq:getenv("port"), etc.. not specific problem, need know whole internal api reference is rabbitmq

Strings and indexes in C++ -

Strings and indexes in C++ - i learning c++ , doing online challenges. however, seems of "normal" challenges stuck. i'm not sure if i'm lacking of knowledge, or overthinking it. anyway, appreciate if help me. i trying challenge: input number "n" example, , have input "n" strings afterwards. then have find smallest amount of prefixes each string typen , create sure not repeating. for example, string "stackoverflow" has many prefixes: s,st,sta,stac,stack,stacko,stackov,stackove,stackover,stackoverf,stackoverfl,stackoverflo,stackoverflow. all these prefixes of stackoverflow. so, if have string "standup", have type stackoverflow - stac because there sta in standup already, stan standup. thanks in advance. simplest version can think of; sort list of words in alphabetical order. append re-create of sec lastly word list. for each word in list, unique prefix number of letters makes unique compared next word...

sql server 2008 - SQL Query for all Records at Least 30 days old -

sql server 2008 - SQL Query for all Records at Least 30 days old - i trying track user info when users log in application. trying pull query (below) users have not logged in past 30 days or more. however, pulling in users have logged in quite recently. help? select usernm [userid], max(eventdt) [last log-in date] dbo.usreventlog abs(datediff([day], eventdt, getdate())) > 30 , (usernm not 'user1') , (usernm not 'user2') , (usernm not 'user3') , (usernm not 'user4') grouping usernm btw, using recent record of activity lastly log in date , have little list of users should absolutely not included in results. try this: select usernm [userid], max(eventdt) [last log-in date] dbo.usreventlog eventdt < getdate() - 30 , (usernm not 'user1') , (usernm not 'user2') , (usernm not 'user3') , (usernm not 'user4') grouping usernm, eventdt sql-server-2008 datediff teamsite interw...

Can HTML link be updated by javascript using function window? -

Can HTML link be updated by javascript using function window? - i have doubts page: i browsing on page: http://www.mercadolivre.com.br/ the search button ("buscar") this: <form id="formsearch" class="ch-form ch-header-form" action="http://www.mercadolivre.com.br/jm/search" method="get" role="search"> <input type="text" class="search" maxlength="60" name="as_word" autocomplete="off" id="query" tabindex="1" autofocus> <input id="btnsearch" type="submit" value="buscar" id="menu:buscad" class="ch-btn ch-btn-small ch-btn-search" accesskey="b" tabindex="2"> so, submit button redirect to: "http://www.mercadolivre.com.br/jm/search" but page doesn't exist, , when click on link on browser, page redirects "http://lista.mercadolivre.com.br/". ...

php - How can I delete a property from a parent object in an extended class? -

php - How can I delete a property from a parent object in an extended class? - i attempting write "listener" on variable in class cannot modify. extending class in question, unsetting properties want hear to, , using __set intercept writes variable. @ point compare previous version , study if there changes. class { var $variable; ... } class b extends { var $new_variable function __construct() { parent::__construct(); unset($this->variable); } function __set($thing, $data) { if ($thing == 'variable') { // study alter // set $new_variable can utilize __get on } } public function __get($var) { if (isset($this->$var)) { // normal. homecoming $this->$var; } elseif ($var == 'variable' && isset($this->new_variable)) { homecoming $this->new_variable; } } ... } this wo...

Shopify If in collection then display this -

Shopify If in collection then display this - i trying write simple if statement, struggle shopify's system. essentially want this: {% if collection.product == 'discontinued' %} product discontinued. {% endif %} if it's in collection, display text/html. otherwise wouldn't display anything. in product.liquid template. any ideas? this ended working: {% c in product.collections %} {% if c.handle == "discontinued" %} product discontinued {% endif %} {% endfor %} shopify

jquery snap draggable to wrapper -

jquery snap draggable to wrapper - i drag horizontally larger-than-browser div want snap wrapper when reaching end left , right. can not "containment" dragging not working when dragged div larger containment: $( "#dragable" ).draggable({ cursor: "e-resize", axis: "x", containment: "document" }); http://jsfiddle.net/xbvyt/320/ for reason remove "containment" dragged div going out of browser window: $( "#dragable" ).draggable({ cursor: "e-resize", axis: "x" }); http://jsfiddle.net/xbvyt/325/ any help much appreciated. by controlling drag event, can prevent draggable moving out of margins: see jsfiddle here options drag event function: $( "#dragable" ).draggable({ cursor: "e-resize" , axis: "x" , drag: function(event, ui) { var $container = $(this).closest(".wrap"); var container_left = $container.posi...

java - Using a JScrollPane -

java - Using a JScrollPane - my programme needs able display info on screen unknown number of objects. i using netbeans gui creator have no thought of how have info these objects displayed within jscrollpane you're question vague. don't provide info "how" might display these objects. start having read through how utilize scroll panes. you should have @ how utilize lists , how utilize tables, provide different ways of showing data. basically, need supply "view" scroll. base of operations component, onto other components added. java swing jscrollpane

Prevent login screen on screen rotation android -

Prevent login screen on screen rotation android - i have application in login screen shows whenever activity goes onpause state. generally, when screen orientation changes, activity goes onpause state, somehow prevented login screen when device rotated. see code below, protected void onpause() { super.onpause(); windowmanager mwindowmanager = (windowmanager) getsystemservice(window_service); mdisplay = mwindowmanager.getdefaultdisplay(); morientation = mdisplay.getrotation(); if(morientation == 1 || morientation == 2 || morientation == 3 || morientation == 0) { inapp = true; } if (!inapp) { savedstate.setstate(this, "homeactivity"); intent intent = new intent(homeactivity.this, loginactivity.class); startactivity(intent); } } but problem when press home button , comes application, login screen not showing instead straight resuming activity, because mdisplay.getrotation() reads screen curren...

ruby on rails - JQuery UI accordion Header not rendering properly -

ruby on rails - JQuery UI accordion Header not rendering properly - i using jquery ui accordion widget. used h4 header markup. when rendering, downwards arrow in header rendering on top of title text. take look: please help me this. my mark this: <div class="sections"> <h4>title1</h4> <div class="section"> <!-- stuff --> </div> . . . </div> and coffeescript activate it: $( ".sections" ).accordion({ header: "h4",collapsible: true }) add these lines @ lastly of css file. .ui-accordion .ui-accordion-icons { padding-left: 35px !important; } jquery ruby-on-rails jquery-ui

ios - What is the difference between NSLayoutAttributeBaseline and NSLayoutAttributeBottom? -

ios - What is the difference between NSLayoutAttributeBaseline and NSLayoutAttributeBottom? - the apple docs usefully state nslayoutattributebaseline aligns "the object’s baseline". what's baseline? how different bottom? baseline applies views such uilabel. baseline position bottom of uppercase letters appear. other views (if not others) baseline , bottom same. ios objective-c layout constraints

Android list with multiple list item layouts -

Android list with multiple list item layouts - based on few tutorials, tried simple android app shows list strings. problem when tried introduce new layout list items. so have: listitem1 -> layout1 listitem2 -> layout2 listitem3 -> layout1 etc when tried adding new layout, items became "scrambled" when scrolling. example, display item1, item2, item3, item4... , , when scrolling downwards , coming back, list be: item40, item3, item20, item1 etc here's code have: (the activity_main.xml file has linearlayout > listview) protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); items = new arraylist<string>(); (int = 0; < 50; i++){ items.add(i%2==0 ? "true" : "false"); } listview listview = (listview) findviewbyid(r.id.listviewid); listview.setadapter(new listitemadapter(this, android.r.layout.simple_li...

Spring web-flow and JSF templating -

Spring web-flow and JSF templating - i want create pages consist of "header" , "content". create common.xhtml <ui:insert name="header"> <ui:include src="commonheader.xhtml" /> </ui:insert> <ui:insert name="content"> <ui:include src="commoncontent.xhtml" /> </ui:insert> then create 2 pages (create_user_page.xhtml , search_page.xhtml) must have same "header" different "content" <ui:composition template="common.xhtml"> <ui:define name="content"> <h1>content creating...</h1> <ui:include src="create.xhtml"/> </ui:define> </ui:composition> and <ui:composition template="common.xhtml"> <ui:define name="content"> <h1>content searching...</h1> ...

VHDL bit rotation function syntax error? -

VHDL bit rotation function syntax error? - i doing school work i'm making own rolling/shifting function. below code wrote, when seek compile syntax error on rownum<=rol(rowcount,1); library ieee; utilize ieee.std_logic_1164.all; utilize ieee.numeric_std.all; architecture main of proj function "rol" (a: std_logic_vector; n : natural) homecoming std_logic_vector begin homecoming std_logic_vector(unsigned(a) rol n); end function; signal rownum : std_logic_vector(2 downto 0); signal rowcount : std_logic_vector(2 downto 0); begin process begin wait until rising_edge(i_clock); **rownum<=rol(rowcount,1);** end process; end architecture main; there couple of things need addressed here. firstly, need entity statement: entity proj port( i_clock : in std_logic ); end proj; this declares signals inputs , outputs entity. in case, it's clock. can add together rownum , rowcount inputs , outputs needed. your f...

performance - A better performing way retrieving select attributes Collections of Large Objects in Java -

performance - A better performing way retrieving select attributes Collections of Large Objects in Java - is there method can iterate collection , only retrieve subset of attributes without loading/unloading each of total object cache? 'cos seems waste load/unload whole (possibly big) object when need attribute(s), if objects big. might cause unnecessary cache conflicts when loading such unnecessary data, right? when meant 'load cache' mean 'process' object via processor. there objects of ex: 10 attributes. in iterating loop utilize 1 of those. in such scenario, think waste load other 9 attributes processor memory. isn't there solution extract attributes without loading total object? also, google's guava solve problem internally? thank you! it's not first place look, it's not impossible you're running cache sharing problems. if you're convinced (from realistic profiling or analysis of hardware counters) bottleneck worth ...