Posts

Showing posts from August, 2012

javascript - Different browser's behaving in different way for same script -

i facing strange behavior of different browser.i have fallowing condition in javascript working fine in mozilla , chrome not in ie. if(svalue.indexof('<br>')!=-1){ // } when changed code in fallowing way , it's working fine in ie not in mozilla , chrome. if(svalue.indexof('<br>')!=-1){ // } anybody knows why it's happening this?. in advance!!!! i hazard guess getting browser serialize dom html value svalue . html case insensitive, browsers free use whatever case tag names. the solution string.tolowercase()

performance - Implementing registers in a C virtual machine -

i've written virtual machine in c hobby project. virtual machine executes code that's similar intel syntax x86 assembly. problem registers virtual machine uses registers in name. in vm code, registers used x86 registers, machine stores them in system memory. there no performance improvements using registers on system memory in vm code. (i thought locality alone increase performance somewhat, in practice, nothing has changed.) when interpreting program, virtual machine stores arguments instructions pointers. allows virtual instruction take memory address, constant value, virtual register, or argument. since hardware registers don't have addresses, can't think of way store vm registers in hardware registers. using register keyword on virtual register type doesn't work, because have pointer virtual register use argument. there way make these virtual registers perform more native counterparts? i'm comfortable delving assembly if necessary. i'm aware ji...

devexpress - How to change the hierarchy display style of a XtraTreeView? -

i have xtratreeview control i've upgraded 9.2 10.2. hierarchy used displayed in 'classic way' - ie. + expand, - collapse, in picture: http://documentation.devexpress.com/helpresource.ashx?help=windowsforms&document=img1103.jpg however, in 10.2, they've changed + has been replaced > (like play button on remote) expand , v collapse. way revert it? you should change treelist's lookandfeel property resolve problem. example: lookandfeel.usedefaultlookandfeel = false; lookandfeel.skinname = "caramel";

objective c - Incompatible Object Model Version -

can explain what's going on here? have file saved new version of application - yet if close application , double click document file, gives me error: the document “main” not opened. managed object model version used open persistent store incompatible 1 used create persistent store. now, have checked google , appears common, however, tried advise of deleting files in application support folder (it's folder doesn't exist reason) , cleaned targets xcode (build > clean targets) no luck. weirdest part is, when accept error , take @ application loaded, it's old version. can find mystery version of application , how fix it??! just who's having issues - having issues installing application correctly (when testing app store submission), , when looking @ installer logs, showed app in weird locations on computer. delete , reinstall (or don't, if debugging xcode) , problem solved.

c# - Creating a popup position indicator on WPF Slider control -

i styling wpf slider controls in application, , want them behave when user dragging 'thumb', popup appears above thumb (and follows thumb dragged), , popup displays live update of new slider value. how can in xaml no c#? thanks you can style thumb display popup when dragged start it's not finished horizontaloffset not bound ( sample how that ): <style x:key="horizontalsliderthumbstyle" targettype="{x:type thumb}"> <setter property="focusable" value="false"/> <setter property="overridesdefaultstyle" value="true"/> <setter property="height" value="22"/> <setter property="width" value="11"/> <setter property="foreground" value="gray"/> <setter property="template"> <setter.value> <controltemplate targettype...

c# 4.0 - Does google maps API provide elevation details for buildings? -

i final year computer science undergraduate student india. want create wpf application displays 3d buildings in latest google maps 5 android. basis of final year project. have questions before start working on this. should make desktop or web based, or should use web store metadata , render data in desktop software? for 3d display of buildings in map area, wpf enough or need knowledge of xna , direct x too? will violate google maps tos if use google maps api? (i want google maps not provide in india) using bing maps better option? is feasible read building elevations , rendering them using above mentioned maps apis? elevation data available through google maps api terrain , not individual buildings? i have 3 months complete project , have given details of technologies intend work with. will need in-depth knowledge of more technologies this? excuse me if missed detail. posting cellphone using opera mobile. it's time have android client stackoverflow. 1) ent...

ruby - Route Handlers Inside a Class -

i have sinatra app setup of logic performed inside of various classes, , post / get routes instantiate classes , call methods. i'm thinking whether putting post / get route handlers inside of classes better structure. in case, i'd know if possible. instance: class example def say_hello "hello" end '/hello' @message = say_hello end end without modification above, sinatra there no method say_hello on sinatraapplication object. you need inherit sinatra::base : require "sinatra/base" class example < sinatra::base def say_hello "hello" end "/hello" say_hello end end you can run app example.run! . if need more separation between parts of application, make sinatra app. put shared functionality in model classes , helpers, , run apps rack. module hellohelpers def say_hello "hello" end end class hello < sinatra::base helpers hellohelpers ...

java - How do I write hql query with cast? -

i need combine 2 tables using hql, both having common column, table1 common column integer , table2 common column string for example, select a.id id,a.name name,b.address address personal a,home b a.id=b.studid here a.id integer while b.stduid string , data of both columns same. how can result of query using hql query? hql supports cast (if underlying database supports it), can use it: select a.id id,a.name name,b.address address personal a,home b cast(a.id string) = b.studid see also: 16.10. expressions

oop - .NET Application Architecture - Which is the optimal assembly for this class? -

i have .net web application have taken over, had in past suffered business logic being in code behind pages , tied ui. i have spent time refactoring, in particular moving data access code dedicated data access project "company.dataaccess" (for example). other logical portions of code have own assemblies too. what i'm not comfortable with, placement of objects need shared across assemblies: for example - in project "company.clientdataimport", have classes containing business logic import of client data. one particular piece of functionality comprises code, client import format can mapped our default import format. so, have class "dataimportfieldmappinginfo" within "company.clientdataimport" assembly: public class dataimportfieldmappinginfo { int companyfieldname { get; set; } int clientfieldname { get; set; } } these mappings stored in database, @ point, need populate co...

java - Splitting number and grabbing -

if have: int money; money = 378; now how many banknotes , coins out this.. sweden has these banknotes: 500, 100, 50, 20 , coins 10, 5, 1 so output wish above money value: 3x100 , 1x50 , 1x20, 1x5, 3x1 how can this? think how in real life. you'd probably start off highest denomination bank note, use many of possible (decreasing amount still go), move next highest, etc. so example, start off 378. how many 500s can use? none. still have 378... how many 100s can use? 3, leaving 78 go. how many 50s can use? 1, leaving 28 go etc. you'll want sort of collection representing bank notes (and coins) available, , keep track of how money still have represent. think how want represent result too.

Popup in Safari OSX opens different size than Safari on Windows -

i have code window.open(null, "window", "status = 0, height = " + wizard_height - 50 + ", width = " + wizard_width - 50 + ", resizable = 0"); for reason in windows safari opens ok, in mac (osx) opens in full screen! how can be? thank you instead of "status = 0, height = " + wizard_height - 50 + ", width = " + wizard_width - 50 use "status = 0, height = " + (wizard_height - 50) + ", width = " + (wizard_width - 50) apparently javascript engine of latest safari on os x thinks "status = 0, height = " + wizard_height - 50 as ("status = 0, height = " + wizard_height) - 50 and makes "nan", can see evaluating string in safari's debug console. by way, know safari has debug console, right? go preferences, choose detail tab, , check "show developer menu" toolbox. can open web inspector, javascript console, etc.

c++ - assignment operator for classes having a non copyable boost::mutex -

i reading here old boost thread faq there guideline implement copy-construction , assignment operator classes having boost::mutex non-copyable object member. i fine copy constructor have doubt on assignment operator. still valid instruction below? // old boost thread const counter & operator=( const counter& other ){ if (this == &other) return *this; boost::mutex::scoped_lock lock1(&m_mutex < &other.m_mutex ? m_mutex : other.m_mutex); boost::mutex::scoped_lock lock2(&m_mutex > &other.m_mutex ? m_mutex : other.m_mutex); m_value = other.m_value; return *this; } should not updated to: // new boost thread const counter& operator=(const counter& other){ if (this == &other) return *this; boost::unique_lock<boost::mutex> l1(m_mutex, boost::defer_lock); boost::unique_lock<boost::...

How can I find unused functions in a PHP project -

how can find unused functions in php project? are there features or apis built php allow me analyse codebase - example reflection , token_get_all() ? are these apis feature rich enough me not have rely on third party tool perform type of analysis? you can try sebastian bergmann's dead code detector: phpdcd dead code detector (dcd) php code. scans php project declared functions , methods , reports being "dead code" not called @ least once. source: https://github.com/sebastianbergmann/phpdcd note it's static code analyzer, might give false positives methods called dynamically, e.g. cannot detect $foo = 'fn'; $foo(); you can install via pear: pear install phpunit/phpdcd-beta after can use following options: usage: phpdcd [switches] <directory|file> ... --recursive report code dead if called dead code. --exclude <dir> exclude <dir> code analysis. --suffixes <suffix> comma-separated list of file suffixes...

grid - Show large set of data with sorting and filtering in a Sharepoint web part -

i'd create sharepoint web part show large set of data odbc source (in first instance sql server 2008 database) ability sort , filter data, possibly progressive fetching. what advice on technology used? report viewer web part: think it's kinda cool not enable progressive fetching of data custom web part custom gridview control embedded custom web part vendor grid control embedded (telerik, devexpress, etc) vendor sharepoint grid control (exists?) any other option available? thanks in advance thoughts mauro take sharepoint out of equation. if regular asp.net application, how it? have described, custom web part custom asp.net custom control can placed on page @ run time. sounds sharepoint wrapper web part no interaction necessary sharepoint data or api. if in asp.net application use ssrs this, use report viewer web part. otherwise can use gridview, repeater, listview, third party control, etc display entity framework, ado.net, linq sql, etc data acce...

How to get a list of invitations to games with Facebook's Graph Api? -

the list displayed in tab: "game requests" or "app requests". how list json format? as far i'm concerned can specific application, i.e. check if user has requests application. couldn't find return user's requests. you can try either https://graph.facebook.com/user_id/apprequests?access_token=... or https://graph.facebook.com/user_id/platformrequests?access_token=... latter 1 must called app secret signed session .

depth first search - Java: Solving 15 Puzzle using Fitness functions -

i working on project solve 15 puzzle using fitness functions. there 3 kinds of fitness functions can used, fitness function1= 1 - (number of misplaced tiles/total number of tiles); fitness function2= 1- (sum of distances of misplaced tiles goal position/64) fitness function3= (fitness 2+ fitness 1 )/2 the solver meant search possible moves improves fitness function value until whole puzzle board solved (where fitness function=1). stocked while trying generate moves because solver print unsuccessful search routes along actual route e.g. w,s,w,n,s,n,s,n,s,n,s,n,s,n,s,n,s,n ( in reverse order) , means nwsw. solver searches , forth several times , prints unwanted routes. want exclude visited locations in recursion , print valid moves , not unsuccessful moves. code available below: <pre><code> enter code here package definitions; public class puzzle { public treenode boardstree; public boolean searching; public int lastpos; puzzle(board b) { boardstree = new ...

regex - Adding http:// to all links without a protocol -

i use vb.net , add http:// links doesn't start http://, https://, ftp:// , on. "i want add http here <a href=""www.google.com"" target=""_blank"">google</a>, not here <a href=""http://www.google.com"" target=""_blank"">google</a>." it easy when had links, can't find solution entire string containing multiple links. guess regex way go, wouldn't know start. i can find regex myself, it's parsing , prepending i'm having problems with. give me example regex.replace() in c# or vb.net? any appreciated! quote rfc 1738: "scheme names consist of sequence of characters. lower case letters "a"--"z", digits, , characters plus ("+"), period ("."), , hyphen ("-") allowed. resiliency, programs interpreting urls should treat upper case letters equivalent lower case in scheme names (e.g., allow...

what is the deal with Facebook API error: Could not parse into a date or time -

im getting group wall posts , fine in end of json response , im getting paging object when take previous value , try http request it: https://graph.facebook.com/175923872448029/feed?access_token=**********13c0fd29b9-557002013|n-ogz6q2sndng1i3les0v9u-tdw&limit=25&since=2011-01-25t1100253a3400253a2100252b0000 im getting error : { "error": { "type": "invalidargumentexception", "message": "could not parse '2011-01-25t1100253a3400253a2100252b0000' date or time." } } what wrong date ? when open https://graph.facebook.com/175923872448029/feed in browser you'll notice paging link consists of utf numeric codes have decoded prior using them [edit]. however, when requested same object using php sdk got encoded url works fine. the reason behaviour explained, believe, in post . in summary, have check returned string looks , decode adequately before proceed.

Add a UIView to a UIViewController with Xib -

here trying do: i have aviewcontroller , it's xib, add uiview half screen connect view b-uiview , b-uiview has own xib design. in other words have view controller it's view becomes "mainview" add other views come own xibs. hierarchy: 1 viewcontroller uiview (xib) 2.b-uiview (has own xib) 3.c-uiview (has own xib) so possible if how? many in advance! yes, can , it's not difficult @ all! in fact, it's pretty common way design in interface builder. can load custom xib file programmatically using loadnibnamed . example: [[nsbundle mainbundle] loadnibnamed:@"tvcell" owner:self options:nil]; apple's docs talk in "table view programming guide ios". although example creating custom table cell, same rules apply view. have close @ section entitled loading custom table-view cells nib files . one thing don't in example load top level view. loadnibnamed returns array, top level view you're af...

asp.net - Drag & Drop Gridview Rows -

i have requirement client can able drag , drop , change position of rows in gridview. i think may able accomplish jquery's sortable plugin: http://jqueryui.com/demos/sortable/ since grid renders table element, should able target way: http://devblog.foliotek.com/2009/07/23/make-table-rows-sortable-using-jquery-ui-sortable/ hth.

.net - Command bound in a datatemplate executing in all ViewModels instances -

i have problem commands , datatemplates in wpf , don't know if it's bug or normal behavior. i have customcontrol containing listview. control used in several views (instances of usercontrol). datatemplate of listview contained in control is: <datatemplate x:key="standardcontentdisplaydatatemplate"> <grid d:designwidth="193.333" d:designheight="128.036" margin="25"> <button style="{binding itembuttonstyle, relativesource={relativesource ancestortype={x:type control:contentdisplay}}}" margin="0" verticalcontentalignment="stretch" horizontalcontentalignment="center" command="{binding datacontext.itemtouchcommand, relativesource={relativesource ancestortype={x:type control:contentdisplay}}}" commandparameter="{binding id}" background="{binding hexadecimalcolor, fallbackv...

php - Drupal 6 Programmatically adding an image to a FileField -

how programmatically add image file field? have url/filepath of image wish upload. have tried following: $newnode->field_profile_image[0]['value'] = 'http://www.mysite.com/default.gif'; but not seem work. i have tried: $newnode->field_profile_image[0]['value'] = 'sites/default/files/default.gif'; the file not need external webiste. happy have anywhere on site in question. you're going have use hook_nodeapi set correctly. you're going want modify under "insert" operation. make sure resave node after you've added required fields. drupal wants map image entry in file table, setting url not work. first off, if it's remote file, can use function listed in brightcove module on line 176, brightcove_remote_image , grab image , move local directory. once remote image moved place, need save files table , configure node's property. i've done in method: ////// in nodeapi ///// case "inser...

javascript - Location.Hash does not update in Chrome -

i trying store state of page in hash. works in ie , ff in chrome not seem anything $(document).ready(function() { window.onbeforeunload = savepagestate; }); function savepagestate() { var currenttab = _tabbing.getcurrenttab(); var mapstate = _mapadapter.getmapstate(); window.location.hash = 'reload=' + currenttab + '&maptype=' + mapstate.maptype.getname() + '&lat=' + mapstate.latitude + '&long=' + mapstate.longitude + '&zoom=' + mapstate.zoomlevel; return; } is there quirk in chrome prevents me updating hash? there better way go saving pages state? button needs saved. i'd recomend use jquery bbq plugin , manages hash you. $.bbq.pushstate({ reload: currenttab, maptype: mapstate.maptype.getname(), lat: mapstate.latitude, long: mapstate.longitude, zoom: mapstate.zoomlevel }); bbq handles merging hash, not overwrite other param...

c# - TreeList devexpress icons -

i use difference class datasource in treelist. show different icon node according property value of type difference. here code: treelist1_getstateimage(object sender, devexpress.xtratreelist.getstateimageeventargs e) { treelistcolumn tlcolumn = treelist1.columns["differencetype"]; differencetypeenum differencetype = (differencetypeenum)e.node.getvalue(tlcolumn); switch (differencetype) { case differencetypeenum.added: e.nodeimageindex = 0; break; case differencetypeenum.deleted: e.nodeimageindex = 1; break; case differencetypeenum.modified: e.nodeimageindex = 2; break; default: throw new exception("difference not specified type"); } i have same icons when selected , when not selected , thats all, nothiung else, each time click on node nodeimageindex changed 0, when nod...

linq - How to use Google Search in VB.NET Application? -

i wanted develop vb.net application uses google search , search results such urls etc. my initial plan use google's atom custom search api , use linq parse data need get. found out using custom search api, searches site/s defined when creating custom search engine. in order achieve goal application, need search results when searching in google search , not specific site. need results in format can parse such result using google's atom custom search api. here questions: 1) can use google custom search search results such google search shows? or or custom site? 2) there way request google search , retrieve results in format can work with? if point me right track appreciated. suggestions welcome. thank in advance. you may find helpful code , further information @ http://code.google.com/intl/de-de/apis/customsearch/v1/overview.html the custom search api made javascript, convert code vb.net

Apply gradient to stack panel Background color/Images in silverlight -

if use in stack panel can give color background stack panel using lineargradient can't add other element on it. any idea how can this? thanx probably easiest best way apply gradient stackpanel contain within border: <border> <border.background> ... gradient goes here ... </border.background> <stackpanel> .. content goes here ... </stackpanel> </border>

c# - Can I pass a .net Object via querystring? -

i stucked @ condition , need share values between pages. want share value codebehind via little or no javascript. have question here on , using js. still did'nt got result approach asking. so want know can pass .net object in query string. can unbox on other end conveniently. update or there javascript approach, passing windows modal dialog. or that. what doing what doing on parent page load. extracting properties class has values fetched db. , put in session["mysession"] . thing this. session["mysession"] = myclass.mystatus list<int>; now on 1 event checkbox click event client side, opening popup. , on page load, extracting list , filling checkbox list on child page. now here user can modify selection , close page. close done via button called save , on iterating through checked items , again sending in session["mysession"]. but problem here , when ever again click on radio button view updated values , displays previous one...

html - XML2HTML tools? -

i need transform xml file html. options have? there python tool it? added on mac, found xsltproc , , run follows xsltproc xslt.xml hello.xml generally speaking, xslt various xml translations. i'm sure can find python library it.

increase item max size in memcached? -

i using memcached on centos server , project large , has objects more 1mb need save memcached , , can't ! because max_item_size 1mb , anyway edit ? thank you you can change limit edit configuration file [/etc/memcached.conf] adding: # increase limit -i 128m or if have trouble config run command line directly memcached -i 128m

c# - Delete list item with BindingNavigator, not correct item -

i use bindingnavigator delete items products list, via datagridview. (the methodcall main.deleteproduct() calls repository delete database). i need improve code of ..deleteitem_click event. when click on cell/or row, , delete button (bindingnavigator), never deletes row. deletes row below, or if it's last row, row above, , if 1 row, null cast. shouldn't bindingsource.current same item currentrow of datagridview? also, way i'm casting current item using bindingsource way? appretiate better code suggestion if have. cheers! public partial class form1 : form { private mainbl main = new mainbl(); private list<product> products = new list<product> private void form1_load(object sender, eventargs e) { bsproducts.datasource = products; // bindingsource bnproducts.bindingsource = bsproducts; // bindingnavigator datagridview1.datasource = bsproducts; // } private void bindingnavigatord...

segmentation fault - Video playback from Android internal storage eventually hangs/crashes -

i'm having issue playing mp4 video involves video freezing @ random consistent point during playback (random in seems differ device device, consistent in seems same place on given device). video in question downloaded device remote url , saved internal device storage. since native videoview class doesn't support video playback internal storage, i've created modified version of videoview new method accepts file descriptor pointing video file in question. class has been modified set media player's data source file descriptor. results in video being played internal device storage, albeit freezing issue described above. judging logcat output pasted below, there seems issue mediaserver crashing, possibly involving segfault. i've seen stack traces of similar crashes elsewhere on 'net seem related camera usage rather video playback. i've tested on 3 different handsets, 2 running android 2.2.1 , third running android 2.1. can indicate me might causing issue , ...

Did Microsoft change the way to pass string as parameter in ASP.NET MVC 3? -

i have simple question. previously, when wanted call controller method 1 parameter, calling /controllername/method/parameter , whatever type parameter was. now, did same thing integer value without problems, string didn't work. going nuts or microsoft changed this? the default route you'll find in global.aspx.cs still following: routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = "" } // parameter defaults ); so "parameter" {id} in example above, presumably number ids tend be. know routes, they're fun! linkage: http://www.asp.net/mvc/tutorials/asp-net-mvc-routing-overview-cs

javascript - How do I count how many checkboxes are selected on a page with jQuery -

i want count how many checkboxes on page selected using jquery. i've written following code: var numberofcheckboxesselected = 0; $(':checkbox').each(function(checkbox) { if (checkbox.attr('checked')) numberofcheckboxesselected++; }); however, code errors out message "object doesn't support property or method" on third line. how count how many checkboxes selected on page? jquery supports :checked pseudo-selector. var n = $("input:checked").length; this work radio buttons checkboxes. if want checkboxes, have radio buttons on page: var n = $("input:checkbox:checked").length;

Window C/C++ Crypto API Examples and tips -

i'm asking question because i've spent best part of day trawling through msdn docs , other opaque sources simple straightforward guidelines on how started windows c/c++ crypto api. what i'd see example code, typical include paths, linking guidelines, etc, useful really. know imprecise question reckon imprecise answers better none @ all. i'll ball rolling own meager findings... here's bunch of examples i've found.... example c program: listing certificates in store example c program: using cryptacquirecontext example c program: enumerating csp providers , provider types example c code opening certificate stores example c program: sending , receiving signed , encrypted message example c program: signing hash , verifying hash signature msdn has these examples scattered around docs this website provides overview of concepts along cross-platform examples

vb.net - Exiting a .NET Windows Forms application from the command line -

i have written windows application, can take in command line arguments , can run command line scheduled task. works fine, trying give user feedback on console if launch thee. i have used information described in console output windows forms application , have got output on command line, when application finishes not drop command prompt unless hit enter. sits there waiting. what missing? console.writeline("press enter exit") console.readline() before program ends.

Entity Framework ObjectSet in Powershell -

i've created dll in visual studio holds entity framework objectcontext . i'm trying access various objectset s powershell. i'm doing because have xml files i'm pulling web service , i'd use powershell's xml features (automatic property generation, non-fatal $null evaluation) map incoming xml values entities instead of having use c# xml classes. powershell script data loader. i able create , instantiate objectcontext fine. can see properties using $myobjectcontext | get-member -membertype property . however, i'm having trouble understanding when items returned queries objectset. i know in linq-to-entities, there lazy loading , objects loaded when collection enumerated. i've tried calling extenion methods explicity, looks powershell doesn't provide lambda expression support. here's question. how know when queries going explicitly enumerated? example, here's 1 of properties (defined objectset <vehicletype > vehicletypes {...

.net - Moving app.config file to a custom location -

my application service application, , needs load set of configuration user can change. using system.configuration classes set app.config file, , going give user option of editing file change configuration. can move file custom directory, c:\settings\app.config? or forced reside in app directory? thank you take @ link: how read app.config custom location, i.e. database in .net this answer in particular: what using: system.configuration.configurationmanager.openexeconfiguration(string exepath) should let open arbitrary app.config file.

ios - UIImageView CurlUp transition below a toolbar -

Image
i working on implementation of slideshow control in ipad application. manage different kinds of transitions between images, particularly uiviewanimationoptiontransitioncurlup . viewcontroller's xib composed of 2 superposed uiimageviews , uitoolbar on 2 uiimageviews in order give user play/pause control. here how looks : i today face problem when curlup transition occurs between 2 uiimageviews , see uitoolbar (which on 2 other views) animate : here how transition code looks : if ([slideshow.images count] <= 1) { return; } currentimageindex = ((currentimageindex + 1) >= [slideshow.images count]) ? 0 : currentimageindex + 1; //imagestackview contains 2 uiimageviews bound iboutlets xib uiimageview *loadingimageview = [imageviewstack objectatindex:1]; loadingimageview.image = [slideshow.images objectatindex:currentimageindex]; uiimageview *currentimageview = [imageviewstack objectatindex:0]; [uiview transitionfromview:currentimageview tovie...

c# - 1001 An Error has occurred. Silverlight Application -

i have encountered '1001 error has occurred.' @ runtime in silverlight application on of client machines. happens when handling keydown event of datagrid. event gets fired , able identify key pressed, while getting sellecteditem value runtime error occurs. please note on client machines error not encountered , works fine. any thoughts or suggestions appreciated. thanks in advance. that client has lower version of sl.. used silverlightversion.com check version.. after upgrade runtime error not there more...

Are curly braces necessary in one-line statements in JavaScript? -

i once heard leaving curly braces in one-line statements harmful in javascript. don't remember reasoning anymore , google search did not much. there makes idea surround statements within curly braces in javascript? i asking, because seems so. no but recommended. if ever expand statement need them. this valid if (cond) alert("condition met!") else alert("condition not met!") however highly recommended use braces because if (or else) ever expands statement required. this same practice follows in c syntax style languages bracing. c, c++, java, php support 1 line statement without braces. have realize saving two characters , people's bracing styles aren't saving line. prefer full brace style (like follows) tends bit longer. tradeoff met fact have extremely clear code readability. if (cond) { alert("condition met!") } else { alert("condition not met!") }

How to get time from jquery Timepicker -

i use jquery timepicker extended able pick not date time. adding timepicker jquery ui datepicker. how pick data: $('#test').live('click', function(){ $('body').append('<div id="timepicker"></div>'); var d = new date(); $('#timepicker').datetimepicker({ mindate: new date() }); }); from examples date pasted input field. not want have input field, have button #test . done button of picker work input fields. how can fix , how date without input field? you can hide input field using css <input type="text" style="display:none" id="datetimefield" /> hope helps

visual studio 2010 - Where do I get SQL Server Compact Edition 4? -

last week guthie announced sql server compact edition 4 released. http://weblogs.asp.net/scottgu/archive/2011/01/13/announcing-release-of-asp-net-mvc-3-iis-express-sql-ce-4-web-farm-framework-orchard-webmatrix.aspx but in post doesn't mention it. older post indicated packaged in vs2010 sp1 http://weblogs.asp.net/scottgu/archive/2011/01/11/vs-2010-sp1-and-sql-ce.aspx vs 2010 sp1 still in beta, little bit confused. if want start using now, can it? you can download here microsoft sql server compact 4.0 the vs2010 change add integrated sql server ce management tools ide.

Google Maps question to obtain coordinates in php -

this on php have following variable on array array ( [0] => { "name": "bravo mario1050 [1] => capital federal [2] => argentina" [3] => "status": { "code": 200 [4] => "request": "geocode" } [5] => "placemark": [ { "id": "p1" [6] => "address": "buenos aires [7] => capital federal [8] => argentina" [9] => "addressdetails": { "accuracy" : 4 [10] => "country" : { "administrativearea" : { "administrativeareaname" : "capital federal" [11] => "locality" : { "localityname" : "ciudad autónoma de buenos aires" } } [12] => "countryname" : "argentina" [13] => "countrynamecode" : "ar" } } [14] => "extendeddata": { "latlonbox": { "north": -34.5349161 [15] => "south": -34....

.net - Could not find Stored Procedure -

i have inherited website apparently referencing stored procedure "xyz" , when site runs error message saying not find stored procedure "xyz". makes sense because inside mssql studio, sproc in fact not exist. however, have no idea getting referenced inside solution. have done search of entire solution "xyz" , says it's not found. can go find stored procedure being referenced , eliminate problem. in advance help/advice your store procedure xyz maybe called stored procedure.

Which JSR 168 compatible Java web frameworks are there? -

there many java web application frameworks available alternatives when developing jsr 168 portlets? found couple: struts spring that's sven, haven't tried jsf portlet bridge, have been working struts portlet bridge , spring-webmvc-portlet 2 years. this my own opinion : i try avoid using struts portlet bridge. it's dead thing still exists because portals had utilized , still built in them. it's quite old, serves purpose, spring-webmvc-portlet - using wouldn't wise. unless struts enthusiast , haven't tried spring-mvc or jsf. i principle how spring portlet environment integrated servlet env. there everyhing developer needs implemented, except few things add multipart request support portlet resource requests (spr-7662) spring portlet mvc - unable return json data @resourcemapping (spr-7344) with struts bridge end doing tons of low level stuff hide fact, after request hits main portal servlet, becomes "portlet request". spr...

jquery ajax and asp.net data entry form -

i have pretty big data entry form has many text fields dynamically added on browser user. can not use server side controls such asp:textbox. what best way submit form , capture data on server side? i use asp.net 3.5 (web forms) register hidden field in asp net page put changes on client side it. load hidden field in postback validate sooo much!

PHP/HTML how do you creat a drop down list that open another drop down list? -

all, writting php script runs part of joomla site. have table event day; time; races; (is array of race id's) .... here race table race id; name; ... on site want have drop down list of table event. when click on event in list, want open second drop down list on page of possible races (using values of event.races query). idea on how first drop down selected can create second on page? check out son of suckerfish menu system. you'll need creative css accomplish, these guys have done , it's pretty easy implement.

c++ - Is there a way to break out of boost::mpl for_each? -

simple question really, let me give background: i have mpl::vector of types each type has id, @ run time use mpl::for_each iterate through vector , find matching type given id. once found, there no point in continuing loop, - question is, there way break out of ( without throwing exception )? nope, there no way 'break' mpl::for_each . being said, might have misunderstood problem, seems me need mpl::find_if more mpl::for_each : #include <boost/mpl/find_if.hpp> #include <boost/mpl/vector.hpp> template<int n> struct foo { enum { id = n }; }; template<int n> struct has_nested_id { template<class t> struct apply { static const bool value = (n == t::id); }; }; int main() { typedef boost::mpl::find_if < boost::mpl::vector<foo<1>, foo<2>, foo<3> >, has_nested_id<3>::apply<boost::mpl::_1> >::type iterator_type; typedef boost...

iphone utility application tutorial -

i'm new iphone development. want create utility application weather app (enter zip codes cities track weather). weather app allows users scroll through favorite places. there's flip side can manage selections. looking tutorial on how create similar type app. can point me tutorial utility iphone apps please? i've been googling , can't find i'm looking for. in advance. how this ? found googling "iphone utility application tutorial". should next time. :)

Obtaining Facebook Likes for Multiple Users using FQL -

i'm trying replicate results of graph api call: graph.facebook.com/[fbid]/likes using fql can obtain likes of multiple people using single call. know if possible / how it? fql can supposedly support multiqueries. check out page: fql multiquery which says: "query2":"select name, url, pic profile id in (select uid #query1)"

c# - "Animating" a MapPolyLine in Silverlight -

i need animate mappolyline such on given event, start pin zips end pin. approach considerg animate frames such divide mappolyline n number of segments , decrease timespan ts between each frame along logic of chosing (to keep things simple, let's ts = ts / 2 after each cycle). i know 1 cannot animate mappolyline, 1 can change appearance of line updating latitude , longitude of end position. question concerns timing. experience multithreading minimal, did not want take risk of user running threading based error may difficult diagnose. should i: use simple dispatchertimer , tick method use backgroundworker reports progress every-time timespan has elapsed use dummy animation , attach event handler rendering event solution other above mentioned options? thank in advance help! decided use dispatchertimer considering amount of time animation going take - creating separate animation object holds state , own dispatch timer, ended being more efficient using separate t...

Compare Date portion of Datetime in SQL -

i working sql , have 2 columns datetime field. want compare date portion of these datetime fields , see if there different. for example, col1 | col2 '2010-01-02 23:58:00.000' | '2010-01-03 06:21:00.000' '2010-01-04 16:03:00.000' | '2010-01-04 21:34:00.000' row1's dates different row2 same i thinking datediff(day,col2,col1) < 1 //then different else same. not sure how parse date compare 2 fields. abs(datediff(day, col1, col2)) > 0

windows - tnsping ping fails, even though I can successfully connect to database -

in trying establish connectivity workstation (actually, seeing same behavior on both winxp32 , win764 workstations) oracle server, first thing try tnsping. when so, get: > c:\>tnsping mydbname > > tns ping utility 32-bit windows: > version 10.2.0.1.0 - production on > 25-jan-2 011 15:03:35 > > copyright (c) 1997, 2005, oracle. > rights reserved. > > message 3511 not found; no message > file product=network, > facility=tnsmessage 3512 not found; > no message file product=network, > facility=tnsattempting contact > (description = (address_list = > (address = (protocol = tcp) (host = > thisismyservername.com)(port = 1577))) > (connect_data = (sid = mydbname))) > message 3509 not found; no message > file product=network, facility=tns so, can see, detecting tnsnames file, , picks correct server address , port specified database, tnsping fails 3511 , 3509 errors. the strange part is, using sqlplus or toad, sam...

sql - sybase: how do I drop all tables, and stored procs if possible? -

i want drop tables , stored procedures in schema, know how this? i'd avoid dropping entire database if possible. you iterate on sysobjects table series of drops , systematically drop objects want gone. declare tables cursor select name sysobjects type='u' go declare @name varchar(255) open tables fetch tables @name while (@@sqlstatus = 0) begin exec("drop table "+ @name) fetch tables @name end close tables deallocate cursor tables yes requires cursors , it's gonna bit slow should pretty wipe database clean. for tables need have type='u' , use drop table in loop for stored procesures have p or xp , use drop procedure in loop more information: the sysobjects table specification using cursors

java - Why are Vector and HashTable widely believed to be due for deprecation? -

possible duplicate: why java vector class considered obsolete or deprecated? also, there official word sun/oracle on that? thanks. edit: i'm aware of other topic, didn't mention whether there official word on this, why topic worded "widely believed". plus, topic addresses vector, not hashtable. vector synchronized; don't need incurs serious overhead. hashtable synchronized , can't reasonably store null s. people use various lists , hashmap instead.

iis - ASP.NET 4 Response.Redirect not working from / but is from /index.aspx -

i have basic test page, button , on button click call response.redirect("b.aspx") this works fine when page loaded http://myhost/index.aspx . when same page loads via http://myhost/ , redirect doesn't work (the same page reloads normal postback). the thing i've been able determine response code / 200, whereas /index.aspx it's correctly 302 the server iis7 running asp.net4. i have tried using true , false second param in redirect() no difference. thanks dan index.aspx not default homepage aspx. try default.apx when try type www.yoursite.com load default.aspx hope helps

multithreading - Android - ProgressDialogs and Threads -

i have progressdialog couldn't display love nor money. bit of research suggested needed put in thread. so example public void update(final int scheduleid, final context context) { final handler progresshandler = new handler() { public void handlemessage(message msg) { x.dismiss(); } }; x = progressdialog.show(context, "scheduling...", "calculating , storing dates", true, false); new thread() { public void run() { // nothing boolean bresult = updatehistory(scheduleid, context); log.i("here","finished here?"); if (bresult) { progresshandler.sendemptymessage(0); } } }.start(); } but seems happen me, spinner disappears off screen , activity finishes, while updatehistory continues run in background. if move call updatehistory below .start() (outside of thread), don't prog...

data binding - WPF databinding issue for itemsControl in usercontrol -

i have 2 classes , usercontrol. class pvalue { public string value; public bool selected; public pvalue(string v, bool s) { value = v; selected = s; } } class param { public string name { get; set; } public string prefix { get; set; } public ilist<pvalue> values { get; set; } public param(string _name, string _prefix, ilist<pvalue> _values) { name = _name; prefix = _prefix; values = _values; } } <usercontrol datacontext="{binding param}" > <grid>... <itemscontrol x:name="itemctl" itemssource="{binding path=values}"> ... <itemscontrol.itemtemplate> <datatemplate> <togglebutton ischecked="{binding path=selected}"> <textblock text="{binding path=value}" /> </togglebutton> </datatemplate> ...

Add header to JavaScript WCF service call -

i'm calling wcf service via javascript. there way can add header wcf service call? http headers part of request, irrespective of javascript or .net call can set. jquery , other libraries provide them. whereas if trying add soap header javascript request becomes post request body having header xml. following paper explains in detail how call soap based service javascript using xmlhttprequest. hope helps. http://www.ibm.com/developerworks/webservices/library/ws-wsajax/