Posts

Showing posts from May, 2010

wolfram mathematica - Unusual Solve[] behavior delay -

for project involved computing bond lengths spectroscopic data, used solve[] solve simple equation unknown. began noticing "unusual" behavior when changed input. specifically, when changed number , solve'd, result answer previously. executing code again, however, gives correct answer; it's there's delay of 1 execution. here's example: b = (11.09 + del)*2.998*10^10; c = h*1000*n*10^20/(8 \[pi]^2); h = 6.62618*10^-34; n = 6.02204*10^23; del = 0; solve[c/b == 0.97959253 r^2, r] executing gives {{r -> -1.24567}, {r -> 1.24567}} however, when change del = 0 del = 10 in above block, same answer when execute! when execute block second time, correct answer: {{r -> -0.903299}, {r -> 0.903299}} then, changing del = 10 del = 0 , executing gives: {{r -> -0.903299}, {r -> 0.903299}} and can imagine, executing block second time gives correct answer {{r -> -1.24567}, {r -> 1.24567}} there nothing special 0 , 10, 2 nu

textinput - Javascript: How to use same button for different text input? -

suppose have 2 input elements 1 button. want button function 1 input element @ time according 1 being focused don't know how capture focusing status of each element. please consider example: <head> <script type="text/javascript"> var id_box = document.createelement('input'); id_box.id = 'id_box'; id_box.type = 'text'; div.appendchild(id_box); var weight_box = document.createelement('input'); weight_box.id = 'weight_box'; weight_box.type = 'text'; div.appendchild(weight_box); function showletter() { if (id_box being focused){ document.getelementbyid('id_box').value = 'abc'; } if (weight_box being focused){ document.getelementbyid('weight_box').value = 'abc'; } } </script> </head> <body> <button onclick="showletter()">abc</button> </body> any idea? thank much. if input has focus ,

.net - Will LINQ to SQL Pick Up Trigger Changes/Errors? -

i'm not knowledgeable scope of sql operations , how relate linq sql. if have trigger updates field in record after inserted, happens when insert new record using linq sql? given order of operations: create new "myobject" instance. assign myobject properties. insert record using linq sql. sql insert trigger updates property of record new value. would step 5 be: "myobject" holds updated value. or "myobject" holds original value assigned it. and question given same steps 1-3: 4.. sql trigger throws error , rolls insert, similar this example. would step 5 be: linq sql throws sql exception. or ??? answers: 2 , 1 but it's worth testing because exception may depend on connection string params.

encryption - Standard approaches on security deployments -

i have following question: in security deployments standard practice, if revocation checks made certificates reason @ specific moment not possible determine status of target certificate? e.g. because network down or ocsp down etc (any reason not give conclusive indication of status of certificate). @ first, thought certificate should considered rejected (and example drop session). on other hand though, if valid user , denied access resources, due unrelated issues (such network problems) not @ all. not sure, happen here, depend per security environment, or there standard approach handle this? any input highly welcome. some systems cache revocation lists and/or revocation verification results fixed or configurable duration. request user decision. both (i.e.: request user decision if cached result indicates certificate not yet revoked).

osx - Where does couchdb store admin user data on MacOSX? -

i'm looking remove traces of couchdbx mac, , install couchdb source. reason, though, newly installed couchdb seems still using (older) admin user/login data. where data stored/how remove it? you'll want check ~/library/application support/couchbaseserver empty well.

javascript - Has anyone implemented a wiki in NodeJS? -

i'm looking pure javascript, open-sourced, wiki implementation, preferably 1 using nodejs. might find it? i'd suggest jingo nice design (with sane typography), use of git backing datastore, format compatibility markdown format used github ( gollum ), , fact it's actively developed. as of jan 2017, matterwiki actively developed. wiki.js being actively developed. it's using git datastore, has markdown editor, search engine , assets management. tiddlywiki can generate static html . npmjs , github reveal 2 other relatively popular , active projects: openkb , hazel . wikipedia shows same js wiki engines , plus grokla , closed source. wikimatrix lists 7 wiki engines powered javascript . old answer: https://github.com/gjritter/nodewiki (no updates since 2010).

Requesting help troubleshooting PowerShell/MySQL connectivity -

i'm having trouble getting powershell talk mysql. frustrating part had been working stopped. have searched around , unfortunately of find "do these steps , works" there apparently getting in way in environment. here information i'm running into: * windows 7 * powershell 2 * wamp running mysql 5 (mysql running , can run queries phpmyadmin) * scripts used able run error out "cannot find type [mysql.data.mysqlclient.mysqlconnection]" * using sqlpsx (http://sqlpsx.codeplex.com/) connect before , i've reinstalled that * have rebooted multiple times try clear things out * running scripts administrator * downloaded connector/net 6.3.6 again , reinstalled i have no idea happened make stop working. have searched try resolved no luck , don't know else search for. if has ideas on can or diagnostics can run troubleshoot situation appreciate hearing them. thanks. update perplexingly enough rebooted again today , powershell talking mysql again.

list - Prolog file manipulation problem -

i use swi prolog , code this. read data predicate file , arity count can change. how can generalize it. example, if data(a1,b1,c1) writes in file, how can find solution? have idea? > basla:-consult('test.pl'), > answer(l1,l2,l3,l4,l5), > list_to_set(l1, x), > > write(x). > answer(l1,l2,l3,l4,l5):- > findall(first, data(first,_,_,_,_),l1), > findall(second, data(_,second,_,_,_),l2), > findall(third, data(_,_,third,_,_),l3). if arity of predicate seems change, it's better make arity 1 , give list argument. findall queries can extended call nth1 or nth0 .

java - Given a number n and two integers p1,p2 determine if the bits in position p1 and p2 are the same or not. Positions p1,p2 and 1 based -

i've been doing little code quizes catch on coding after graduating 1 got stump. here's question: given number n , 2 integers p1,p2 determine if bits in position p1 , p2 same or not. positions p1,p2 , 1 based. example 22,3,2 true because it's 0001 0110 because 2 , 3 position same. i solved 1 way convert decimal binary , string , check if bits in positions same, feel there's easier way bit manipulation i'm not it. thinking if shift bits first position , compare them answer ran problem when shift them shift left since overflow. you shift interesting bits least significant position , mask off other bits & . assuming p1 , p2 zero-based indexes counting least significant bit: bool same_bits = (((n >> p1) & 1) == ((n >> p2) & 1))

ruby on rails - collection_select set option value of :include_blank to zero -

in rails app, have drop down box retrieve groups group table , display them using collection_select tag. when user selects 'none', want pass '0' option value. currently, empty string passed. is there way include option value = 0 'none'? <%= f.collection_select :sub_group, group.all, :group_id, :group_id, :include_blank => 'none' %> many many suggestion provided if use options_for_select in combination select_tag can achieve using this: options_for_select( [['none', '0']].concat( group.all.collect { |g| [g.group_id.to_s, g.group_id.to_s] } ) ) in order keep views uncluttered, might want generalize , move helper method reasonable name.

Logic for hovering in jQuery dependent on where mouse hovers -

i'm trying figure out how write in jquery conditional statement on user hovers mouse. i've got logic hover function. when user hovers on list item "z", element (a div class "box") on page performs function (namely animates). on hover "out" part of equation (hovering out of list item "z"), need write conditional statement along these lines: when hovering out of list item "z", if user moves mouse on div ".box", run function a if user not move mouse on div ".box", run function b hopefully that's clear enough. i'm trying determine user hovers next , perform function accordingly. if have html this: <ul id="somelist"> <li>some list item 1</li> <li>some list item 1</li> <li>some list item 1</li> </ul> you can achieve desired functionality this: $("ul#somelist > li").mouseover(function(){ // n

css - table alignment issue html -

<table width="100%" border="0"> <table width="600" align="center" bgcolor="#ffffff"> <tr> <td width="600" colspan="120">banner image</td> </tr> <tr> <td width="400" colspan="80"></td> <td width="10" colspan="2" bgcolor="yellow"></td> <td width="190" colspan="38"></td> </tr> </table> </table> the alignment messed 2nd row. how can resolved? looks there lot of issues here. first off, isn't valid html. second table tag can't go have it. need like: <table width="100%" border="0"> <tr><td> <table width="600" align="center" bgcolor="#ffffff"> <tr> <td width="600&q

scorm - AICC Course Web Page Content Package -

i need sample aicc package test lms aicc api refered open source lms called ilias. can find aicc course package either it's free or needs paid? please advise. thanks. aicc.org has sample courses can use test aicc implementation.

android - xml parsing for showing marker on google map -

i want show marker of diffrent color on google map according " type " in xml..means want diffrentiate marker acccording " type " in xml sir how parsing showing marker of diffrent color in google map , when click of marker shows baloon in "gallery name" wrriten..... url http://site4demo.com/artealdiaonline/output.php?lat=-34.6394879&lng=-58.3617837kkj your xml file not small. recommend use sax parser purpose. don't need these information in in-memory objects guess because want make markers on map. dom, whole xml tree kept in memory. i'm trying avoid on phones time due limited memory resources. so can use sax parser (here easy example: sax ) , react on row elements creating new marker in map.

flex - Camera.names not working in flash builder burrito -

im using camera class in mobile application , used camera.names fill list , tried pass selected value getcamera() method not working.here s code private function init():void { if (camera.names.length == 0) { lab.text = "no camera attached"; list.enabled = false; textarea.enabled = false; } } protected function list_changehandler(event:indexchangeevent):void { var tlist:list = evt.currenttarget list; var cameraname:string = tlist.selectedindex.tostring(); camera = camera.getcamera(cameraname); vid=new video(); vid.attachcamera(camera); uic.addelement(vid ivisualelement); textarea.text = objectutil.tostring(camera); } <s:list id="list" dataprovider="{camera.names arraycollection}" width="200"

assembly - "enter" vs "push ebp; mov ebp, esp; sub esp, imm" and "leave" vs "mov esp, ebp; pop ebp" -

what difference between enter and push ebp mov ebp, esp sub esp, imm instructions? there performence difference? if so, faster , why compilers use latter? similarily leave and mov esp, ebp pop ebp instructions. there performance difference, enter . on modern processors decodes 10 20 µops, while 3 instruction sequence 4 6, depending on architecture. details consult agner fog's instruction tables. additionally enter instruction has quite high latency, example 8 clocks on core2, compared 3 clocks dependency chain of 3 instruction sequence. furthermore 3 instruction sequence may spread out compiler scheduling purposes, depending on surrounding code of course, allow more parallel execution of instructions.

algorithm - How to find N longest lines in a text file and print them to stdout? -

the first line contains value of number 'n' followed multiple lines. solve in order of n^2 algorithm. can suggest better one? you can use minimum-heap , in o(n*(log(n))): heap = new min-heap(n) foreach line in text: if length(line) > heap.min(): heap.pop() heap.insert(line) foreach line in heap: print stdout: line. it done in o(n) using select(n) (which selects nth number) followed partition around nth number (which arranges size larger or equal nth number 1 side of it). = select(lines, n) partition(lines, i) size(lines): print stdout: lines[i]

sql - mysql query with OR optimization -

can following query optimized? indexes can created? select column_a table_b join table_a table_b.id_b = table_a.id_a or table_b.id_b = table_a.id_b; your query should be: select column_a table_b join table_a on table_b.id_b in (table_a.id_a, table_a.id_b) if don't provide on criteria join, mysql accepts being cross join -- result cartesian product (that's bad, unless that's want). if knew table column_a came from, might suggest different approach query... index following: table_b.id_b table_a.id_a table_a.id_b the 2 columns in table_a covering index, rather separate ones.

how to get the albums and photos and recent activities from the facebook. using sdk -

i using facebook.php downloaded http://github.com/facebook/php-sdk when try photo of facebook user. query returning empty array. code is $uid=100000602578898; $friends = $facebook->api(array( 'method' => 'fql.query', 'query' => 'select pid photo owner ='.$uid)); print_r($friends); result : array() i want how display photo , ablums of facebook in own website. http://flavors.me/websolusionz . in site, when logined in site display facebook photos , albums . go above link , click "my facebook " link

android - Google Maps does not work -

i working on android 2.2 project. project needs display google map user. select build target android 2.2 , google maps classes don't includes in it. how solve problem? i got [2011-05-11 10:52:54 - chapter 8 5] re-installation failed due different application signatures. [2011-05-11 10:52:54 - chapter 8 5] must perform full uninstall of application. warning: remove application data! [2011-05-11 10:52:54 - chapter 8 5] please execute 'adb uninstall com.paad.whereami' in shell. [2011-05-11 10:52:54 - chapter 8 5] launch canceled! when try run tutorial on google maps on google apis 3.0 use google api 2.2 . for uninstalling application command line, either add android-sdk path in $path variable or go platform-tools folder in android sdk installation. thee give command.

Is Boost.Preprocessor a set of macros for cpp or a separate proccessor? -

i'm having difficult time getting exact answer. p.s. there roundup/tutorial location? boost.preprocessor set of macros utilises standard c++ preprocessor provide more advanced functionality. not separate preprocessor.

database - How do i integrate the contents of one table into another in mysql? -

i have site runs on word press. changed hosts had database restore new host. noticed of tables haven't been restored properly. want know if there way in can restore specific tables without overwriting data. (just insert has been missed). complete newbie in matter. searched solution here couldn't make out because have no programming knowledge. please help. make backup file of tables , restore backup file on new server. however noticed of tables haven't been restored properly. does give error? how restoring tables?

asp.net - Internationalise silverlight app -

can make multilingual silverlight app without resource files? because m website m using google translate api, there problem in silverlight translation. thanks!!! this question has wealth of resources regarding calling google translate .net . the main 1 google api dotnet has silverlight 3 version of google translate api. if none of fit bill you'll need improve question describe actual problem.

Tab key not working in asp.net -

i have set tab index of each control not working. mean tab index in not working have use follow code <asp:dropdownlist id="ddlsuppliername" runat="server" cssclass="form-element-normal" tabindex="1"> </asp:dropdownlist>

iphone - OSStatus error - 12780 when invoking insertTimeRange:ofTrack:atTime:error: of AVMutableCompositionTrack for the second time -

first of have love forum, helped me many time. have problem , couldn't find answer anywhere first question here. my problem this: i have video represented avplayeritem, user can edit video start time using cutbefore button cuts video left of slider the method responsible cutting video following: - (void)cutbeforeaction { avmutablecomposition *composition = [avmutablecomposition composition]; // audio , video tracks of video avmutablecompositiontrack *compositionvideotrack = [composition addmutabletrackwithmediatype:avmediatypevideo preferredtrackid:kcmpersistenttrackid_invalid]; avmutablecompositiontrack *compositionaudiotrack = [composition addmutabletrackwithmediatype:avmediatypeaudio preferredtrackid:kcmpersistenttrackid_invalid]; // calculate new duration cmtime currstarttime = _player.currentitem.currenttime; cmtime endtime = _player.currentitem.duration; cmtimerange range = cmtimerangefromtimetotime(currstarttime, endtime); // insert new duration tracks nser

loops - SAS: Return to previous observation in SAS Data Step possible? -

i asked question on runsubmit too, since sas q&a community seems bit scattered. if not appreciated, please let me know. is possible in data step return previous/certain observation , go there further through data set? to add question in case still not clear, small example: data set 'work.test' : name | number john | 1 jack | 2 jane | 3 jade | 4 ronn | 5 dick | 6 sofy | 7 sady | 8 ruth | 9 data step: data _null_; set work.test; file ...\test.txt; put name; if number = 5 , counter=3 do; counter = counter+1; *return obs number = 3* aka *set obs pointer obs nr=3*; end; run; *the question part return obs number = 1 , not [and first time] , added not generate , endless loop.* additional info: seems still not 100% clear want do, added bit original sample data set , example. remember should bit generic , not fixed code. conditions might vary later on. mai

javascript - Display DIV only if user has been Idle for X amount of time -

i display helpful div shows user how accomplish on particular page, only if user has been idle period of time, say, 30seconds. what mean "idle" is: not clicking links not right clicking anywhere exceptions: exclude following conditions user idle rule: user has scrolled or down/left or right user has pressed mouse button on empty area on site/ or on element has no source/link example, image no hyperlink. and, pressing keyboard buttons can done? or can detect when particullar event occurs? any thoughts/suggestions/resources appreciated. thank you fairly basic... var trigger = 30000 $.(function(){ setinterval('displayinf()',trigger ); $('body').bind('click dblclick keypress mousemove scroll', function(){ cleardisplayinf(); }); }); function displayinf() { $('body').append('<div>your notification div</div>'); } function cleardisplayinf() { trigger = clearinterval(trigg

jquery - Update 2 exact same images source using javascript -

possible duplicate: update 2 exact same images source using javascript i using php captcha called cryptographer captchan.fr site i need use 2 captcha on same page have problem generated when click refresh first 1 refreshes, refresh code looks this. document.images.captcha.src='cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1; i tried code works first 1 anyway document.getelementbyid('captcha').src='cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1; now wanted added name="captcha" image not work reason can me fix it? document.getelementsbyname('captcha').src='cryptographp.html?cfg=0&&+math.round(math.random(0)*1000)+1; i have jquery attached page if thats easier. i tried remove id , use class still nothing $('.captcha').src='cryptographp.html?cfg=0&&'+math.round(math.random(0)*1000)+1; because saying undefined reference. you&#

c++ - How to manage code to display animation only once? -

i making program animate ball on field goes like, void display() { /* code draw field */ loop:1 5 loop:1 6 /* here comes code animate ball on field */ } i want whenever user press "right_arrow" whole scene rotated by angle problem:whenever user presses "right_arrow" key rotate scene angle display whole animation again...but want animation displayed once(after maximazing window) , user can rotate whole scene angle without displaying animation on pressing "right_arrow" key how should in code? again problem lies in mistake animation in display function. extended example wrote yesterday bit; after starting program, animation play 5 seconds, stop. pressing [r] resets animation (thus starts again), pressing [+] / [-] rotates scene around y axis. http://homepages.physik.uni-muenchen.de/~wolfgang.draxinger/stuff/sinsphere_rot.c edit: commenting /* ansi-c - don't try compile c++ compiler, fail! */ #include <gl/glut.h> #incl

prestashop - How to remove the /en/ url in the website -

how remove /en/ url in website by default site showing above. please check following url http://www.plrebooksstore.com it goes http://www.plrebooksstore.com/en/ please me out honney. in prestashop, country code appears if have more 1 language. if en option, disabling rest let store without code.

c++ - Is any way to show text line at the top of QTableView exist? -

Image
i need on picture below can't find way using qt 4.3.3... i don't think there build-in function . best way go subclass qtableview , override draw function draw text when there no elements show .use slot int rowcountchanged(int,int) to find out when row count zero.

load next xml element on click via ajax and jquery -

i need able cycle through xml file using click function. when page loads want 1 xml element load , using click function load next. kind of content slider loads each 1 when requested. i'm using display tube video title. here's code... $(document).ready(function(){ $.ajax({ type: "get", url: "video.xml", datatype: "xml", success: function(xml) { $(xml).find('video').each(function(){ var title = $(this).find('title').text(); var embed = $(this).find('embed').text(); $('<div class="video"></div>').html('<iframe width="300" height="200" src="http://www.youtube.com/embed/'+embed+' frameborder="0"></iframe><h2>'+title+'</h2>').appendto('#video_block'); }); } }); }); here xml code: <video> <title>title 1 here</title

Custom Map iPhone -

i trying figure out how create custom map following: http://itunes.apple.com/us/app/mall-book-california/id342584415?mt=8 http://www.macworld.com/appguide/app.html?id=541350&expand=false i don't know start from, use uiwebview or mapkit? appreciated. what did in our app use uiimageview on uiscrollview . need take screenshot of object map on google-map , precisely draw overlay on it. need take top left coordinate , bottom right coordinate of screenshot took map. put overlay image inside imageview, image view on scrollview, , scale coordinate system on scrollview coordinates took map. can precisely plot poi-s on overlay. note: first thing did overlaid g-map custom image view slow when scrolled, don't try it. luck coding. [edit] take large screenshot of area on google map http://www.metacafe.com/watch/1073912/google_maps_hack_how_to_save_large_maps/

java - Collating/Managing data to populate "live activity feeds" in web app -

i have of abstract question regarding managing live feeds/polling on web sites. i creating web app (built on java/spring/hibernate) , on user's home page want live feed of latest activity members of there team, , trying work out best way handle query on server side. the brute force way load current users list of team mates, , iterate through each of team mates, loading latest conversations/file uploads/etc, , merging activity in single list sorted timestamp , returning (lets sake of example return top 10 latest activity feed). however, seems un-performant, operation need done regularly (depending on polling interval). i have considered making potential activities (conversations/status updates/uploads) extending activity class , having direct sql/jpql query in dao selects latest activity set of users returned, concerned might bypass caching , continued access db reduce performance. has handled type of problem before? 1 know approach is? thanks! this old 1 no

android - Java OO MVC problem -

i have "highscoremodel", "highscorecontroller", "highscoreview" everything works between model<->controller but, how data view? i have public model[] in controller can access view. wondering if right way it. generally, view observer of model. when model changes, notifies view renders accordingly.

panel - double buffered in c# -

possible duplicates: how double buffer panel in c#? c# panel drawing graphics , scrolling i draw bitmap on panel, use zooming on same panel. while zooming panel continuously flickering. why not panel have doublebuffered property? code: graphics g = graphics.fromhwnd(panel.handle); if (newimage == true) { g.clear(systemcolors.control); newimage = false; } g.drawimage(bmp, hoffset, voffset); g.dispose(); add code inside constructor this.setstyle(controlstyles.allpaintinginwmpaint |controlstyles.userpaint |controlstyles.doublebuffer, true);

c# - WCF accessible via HTTP request with querystrings as parameters -

i create wcf can invoked via http request , takes parameters in url. like: http://someservice.svc/fetcheverything?user=xxx&category=clothes the service should return json in response. would thankful advice. take @ wcf data services. allows expose entity framework model (or part thereof) using rest interface, or more precisely, odata interface (= rest + atompub + query support). have @ http://msdn.microsoft.com/en-us/library/cc668794.aspx .

sql server 2008 - SQL Group by Year -

this query. select convert(varchar, cast(date datetime), 3) shoptransfer group year (date) i want group year part of date (varchar) column, following error: column 'shoptransfer.date' invalid in select list because not contained in either aggregate function or group clause. how group year part of date column? how about: select datepart(yyyy, [date]) [year] shoptransfer group datepart(yyyy, [date]) or: select count(*) qty, datepart(yyyy, [date]) [year] shoptransfer group datepart(yyyy, [date]) order [year] this based on op's command: "i want group year part of date (varchar) column"

Drupal: Hide and Show cck fields in nodes -

it possiblle hide cck fields , show other cck field when choose combobox opcion in node? for example: combobox opcions: 1 field, 2 fields if select 1 field, form has text field if select 2 fields, form has text area , imagefield you can use conditional fields module . after installing module, can use such: in content type, add select box , in allowed values area add "1 field" , "2 fields" create text field, should see fieldset titled "conditional fields settings", open , choose "1 field" do similar process create textarea , imagefield choose "2 fields" in conditional fields settings. now when creating content type, when changing value of select box show different fields on form. more information: example screenshots documentation conditional fields

javascript - Is there a difference between /\s/g and /\s+/g? -

when have string contains space characters: var str = ' b c d ef '; and want remove spaces string (we want this: 'abcdef' ). both this: str.replace(/\s/g, '') and this: str.replace(/\s+/g, '') will return correct result. does mean + superfluous in situation? there difference between 2 regular expressions in situation (as in, in way produce different results)? update: performance comparison - /\s+/g faster. see here: http://jsperf.com/s-vs-s in first regex, each space character being replaced, character character, empty string. in second regex, each contiguous string of space characters being replaced empty string because of + . however, how 0 multiplied else 0, seems if both methods strip spaces in same way. if change replacement string '#' , difference becomes clearer: var str = ' b c d ef '; console.log(str.replace(/\s/g, '#')); // ##a#b##c###d#ef# console.log(str.replace(/

android - App installation on the external storage. What will happen with the database? -

my application uses sql database. happen location of database, if declare android:installlocation="preferexternal" in androidmanifest? stored on external database? if no, how should handle in application? (ideally, if user moved application, should move database) to answer other question. if want bring have database on external storage use sqlitedatabase.opendatabase method path of database paramters. check following links. ive found examples take @ them. this one! is possible move internal db sdcard? heres example. http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ u might want use documentation reference.. luck! http://developer.android.com/reference/android/database/sqlite/sqlitedatabase.html#opendatabase(java.lang.string , android.database.sqlite.sqlitedatabase.cursorfactory, int, android.database.databaseerrorhandler)

Compact Framework 3.5 image Gradient not smooth -

why doesn't compact framework 3.5 render images gradient right on windows mobile? if image contained 32 bits or 24 bits of color , device lcd supports 16 bits (which case) see degradation on image quality while displaying it.

mediaelement.js - different sources for iphone via 3G and WIFI -

what best way load different source file on 3g connection on wifi? thanx if resources mean video or audio streams consider providing http streaming resources server. way frameworks choose best current connection, , update source if connection status changes. read more here: http://developer.apple.com/resources/http-streaming/

sql server - joining an ASP.NET dataset to a database table -

i'm getting list of review items web service dictates should output database. the webservice return data set following columns [local_item_id] | [remote_item_transaction_id] | [remote_item_type] and local reviews database table looks this [id] | [title] | [review_description] | [created_date] | [rating] i need above data stored proc , join table using [id] = [local_item_id] table following output asp.net repeater... [id] | [remote_item_transaction_id] | [remote_item_type] | [title] | [review_description] | [created_date] | [rating] i assume straight forward way of doing somehow passing dataset stored proc , parsing temp table can join reviews table. each repeater item output link below transaction id reported reporting server. <asp:repeater id="reviewitemsrepeater" runat="server"> <itemtemplate> <div><asp:hyperlink id="myhyperlink" runat="server" navigateurl='<%#"~/showreview.aspx?review

How to assign or initialize a Java array to Javascript array, without using JSP? -

i working in play framework , need use java array inside javascript. i tried following - var jsarray = ${javaarray}; where javaarray array in java controller, being rendered html view. but, not working. can please me on this? don't forget you're not passing variables... you're writing javascript code so, have make array rendering nicely javascript var jsarray = [%{javaarray.eachwithindex{it,idx-> }% ${it}${(idx<javaarray.size()-1)?",":""} %{ } }%] use fits template engine. have iterate through array prints out values on view ps : i've used groovy notation...

ruby on rails 3 - Why is bundler doing this? -

i have engineyard deployment failing due gems not being found in vendor/cache. @ happens when run "bundle": updating .gem files in vendor/cache * rspec-core-2.6.0.rc6.gem * rspec-expectations-2.6.0.rc6.gem * rspec-mocks-2.6.0.rc6.gem * rspec-2.6.0.rc6.gem * rspec-rails-2.6.0.rc6.gem removing outdated .gem files vendor/cache * rspec-2.6.0.rc6.gem * rspec-core-2.6.0.rc6.gem * rspec-expectations-2.6.0.rc6.gem * rspec-mocks-2.6.0.rc6.gem * rspec-rails-2.6.0.rc6.gem bundle complete! use `bundle show [gemname]` see bundled gem installed. these gems causing problem deployment. first says it's updating them, says it's deleting them. how fix this? i don't know answer question, able fix removing requirement specific release-candidate version gem gemfile, then: gem cleanup bundle update bundle that fixed it.

c# - join list with linq-to-sql query -

i have list of myobject looks this: public class myobject{ public int fruitid {get;set;} public string fruitname {get;set;} } list<myobject> thelist = new list<myobject>(); this list populated linq-to-sql query. i'm looking create join between list , table contains fruitid foreign key. the table harvesttimes looks this: fruitid | harvestdatetime | ripefactor 3 | 3/4/2011 | 2 3 | 4/5/2011 | 4 3 | 5/5/2011 | 3 4 | 3/21/2011 | 2 4 | 4/10/2011 | 2 4 | 5/10/2011 | 2 this have far: var thequery = (from list in thelist join fruit in mydc.harvesttimes on list.fruitid equals fruit.fruitid .... select new myobject{... }).tolist(); i'm have trouble clause. how fruit ripefactor 2. instance, fruit 3 has ripefactor of 2 has 4 , whereas fruit4 has 2

c# - How can I programatically get keyboard focus on a WPF TreeViewItem? -

i'm trying programatically set keyboard focus tree view item (under conditions). i've tried 2 methods of setting focus, both of obtain focus on treeviewitem , lose keyboard focus. the tree view bound view model: <treeview name="solutionsmodel" treeviewitem.selected="solutionsmodel_selected" itemssource="{binding items, mode=oneway}" /> i'm trying set focus via treeviewitem selected routed event: private void solutionsmodel_selected(object sender, routedeventargs e) { if (solutionsmodel.selecteditem != null && solutionsmodel.selecteditem solutionviewmodel) { if (e.originalsource != null && e.originalsource treeviewitem) { focusmanager.setfocusedelement(solutionsmodel, e.originalsource treeviewitem); } } } i'm trying set focus on treeviewitem in controltemplate : <style d:iscontrolpart="true" targettype="{x:type treeviewitem}&

asp.net - asp:ImageButton with PostBackUrl responds after the second click -

i have asp:imagebutton postbackurl same button (code behind) , have click twice in order fire internal code. need know how can solve issue 1 click. please see code bellow. <asp:imagebutton id="imgbutton" runat="server" imageurl="~/images/compose.gif" onclick="imgbutton_click"/> code behind: protected void imgbutton_click(object sender, imageclickeventargs e) { this.imgbutton.postbackurl = "http://www.externalsite.com/entry.aspx"; //the internal code goes here... (this responds after second click). } you setting postbackurl property on first click, not posting it. on second click posts url because property has been set on first click. either set postbackurl property in markup or response.redirect in button click event.

c# - How do i define starting position of listbox? -

i want define listbox rows start @ 1, not default 0. how do ? if determined it, make method private int listindex(int index){ return index - 1; } and use listindex anywhere index list, others pointed out, should shift mindset deal 0 based indexes, standard in programming situations.

java - Is it a good practice to override implementation of ServletContextListener? -

i have developed web service using jax-ws , in web.xml had servlet context listener registered. <listener> <listener-class>com.sun.xml.ws.transport.http.servlet.wsservletcontextlistener</listener-class> </listener> but, have specific function done when web service , when web service down. way think of, create servletcontextlistener , and add in web.xml . but override 1 specified (as shown above <listener> tag). my worry in case wsservletcontextlistener might implementing servletcontextlistener methods , must doing specific work in it. i tried extend wsservletcontextlistener class final cannot. way can take wsservletcontextlistener instance member listener class , wrap methods provided it. practice? make own listener , declare in new <listener>..</listener> tag. 2 listeners should invoked in order specified in web.xml.

Mysql Escape function; Generate Update Query by using Select Query -

hello have development server , production server on both same databases. table products edited on both servers on different columns development: id model image production: price , out_of_stock i don't want use php this. so have created following query development server select concat( "update `products` set `products_id` = ", products_id, ",`products_model` = '", replace( products_model, "'", "\'" ) , "',`products_image` = '", products_image, "' `products`.`products_id` = ", products_id, ";" ) `products` this query return me query production sever update `products` set `products_id` = 60,`products_model` = 'ct'257',`products_image` = 'ct_black01.jpg' `products`.`products_id` = 60; update `products` set `products_id` = 59,`products_model` = 'ct"255',`products_image` = 'ct_black01.jpg' `products`.`products_id` = 59; update `products` s

java - Error with Jboss while deploying a jsp/servlet web app "com.sun.faces.config.ConfigureListener" Error -

i working on jsp/servlets. web app deployed on jboss 6. i using java 1.6, eclipse , maven2. not refer jsf anywhere in code. my project doesnot have jsf involved anywhere, when try deploy webapp war error says : 21:55:44,448 info [org.jboss.web.tomcat.service.deployers.tomcatdeployment] deploy, ctxpath=/ultimatesms-1 21:55:44,493 error [org.apache.catalina.core.containerbase.[jboss.web].[localhost].[/ultimatesms-1]] error configuring application listener of class com.sun.faces.config.configurelistener: java.lang.classnotfoundexception: com.sun.faces.config.configurelistener here pom , web.xml pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>ultimatesms</groupid> <artifactid>ult