Posts

Showing posts from August, 2012

android - Turn off multithreaded debugging in Eclipse CDT -

i'm trying debug android stuff eclipse, crashes when use android gdb in eclipse instead of terminal. suspect it's because of multi-threaded stuff. possible turn off? (i read eclipse 3.2 debugger didn't multithreaded stuff, can't find 3.2 cdt package download anywhere ...)

mysql - How to mysql_query from same table with different where clause in same php file -

i have table containing 4 articles id 1,2,3 , 4 ordering value 1,2,3,4. have separate columns title, image etc. need them distinctly clause. did: article 1: //topstory1 $sql_topstory1 ="select * topstory story_active='1' && story_order='1'"; $result_topstory1 = mysql_query($sql_topstory1); $row_topstory1 = mysql_fetch_array($result_topstory1); $story1_title = $row_topstory1['story_title']; $story1_abstract = $row_topstory1['story_text']; and article 2 //topstory2 $sql_topstory2 ="select * topstory story_active='1' && story_order='2'"; $result_topstory2 = mysql_query($sql_topstory2); $row_topstory2 = mysql_fetch_array($result_topstory2); $story2_title = $row_topstory2['story_title']; $story2_abstract = $row_topstory2['story_text']; as have reuse them in page. problem is, first query works second 1 doesn't. seems mysql cannot ex

c++ - output can compile -

i can't seem code run , need know output. can 1 please me? vector<int> myinventory(4); myinventory[0] = 2; (int = 1; <= 3; i++) { myinventory[i] = 2*myinventory[i -1]; } myinventory.push_back(34); (int = 0; < myinventory.size(); i++) { cout << myinventory[i]<< " "; } please, if can provide output great. just walk through on pen , paper. or said; write it, compile , run.

php - While returning no results -

i've got following query in existing script - it's not returning value though should based off what's in database. there plenty of things in database should grabbing - there. don't see wrong - barely anymore :) see anything? $query = "select id xtags tag_id = '$tagid' order rand() limit 2"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $query = "select * xtable id = '$row[id]'"; $result = mysql_query($query) or die(mysql_error()); $row2 = mysql_fetch_assoc($result); echo $row2[title]; } $result being used inside loop , outside, try making new variable inside , not reusing outside one.

custom class library as an array C# -

i'm working class library in c# own methods , want create array library, when call in main program cant see methods. public class classlibrary1 { public int num; public classlibrary1 () { } public void readdata() { console.write("write number "); num = int.parse(console.readline()); } } program.cs : classlibrary1[] arraynumbers = new classlibrary1[5]; arraynumbers.readdata(); and can't use readdata() . can me? if want call methods in class, you'll have create @ least 1 instance. is, you've done create array of null references, , attempt call method on array. here's 1 way it. classlibrary1[] arraynumbers = new classlibrary1[5]; for(int = 0; < 5; i++) { arraynumbers[i] = new classlibrary1(); } arraynumbers[0].readdata();

android - How to create emulators with small screen size -

hello i'm testing application different screen densities. have created 4 emulators low medium high , high density , normal screen size screens doesn't have same size. specified in launch options screen size (in) = 3.7 , monitor dpi = 113 i'm using mac book pro 1280 x 800 13". can done? best regards. follow instructions here: http://developer.android.com/guide/developing/devices/managing-avds.html in skin, check "resolution" , add resolution want. in hardware, add required dpi. the screen size determined these 2 factors detailed here: http://en.wikipedia.org/wiki/pixel_density#calculation_of_monitor_ppi make sure use dpi values of device want emulate, not values monitor. for list of screen sizes , resolutions, check http://en.wikipedia.org/wiki/list_of_displays_by_pixel_density (it includes monitor, although information irrelevant emulator)

c# - How to set watermark text on watermark textbox -

i have template this, <style x:key="watermarktextboxstyle" basedon="{staticresource {x:type textbox}}" targettype="{x:type textbox}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type textbox}"> <grid> <scrollviewer x:name="part_contenthost" snapstodevicepixels="{templatebinding snapstodevicepixels}" /> <textblock x:name="textblock" opacity="0.345" text="enter text here" textwrapping="wrap" visibility="hidden" /> </grid> <controltemplate.triggers> <multitrigger> <multitrigger.conditions> <condition property="isfocused" value="false" />

android - Working in background -

actually, found lots of answers questions time totally stuck. my question easy. building radio streaming application .pls streams , when user press home button, want application continue working. think lots of know ebuddy , skype or basic media players. putting notification bar , can reach them place. tried create notification app, when click icon on notification bar, can't reach app. directly opens new version of app , can't control streaming, initial working app no longer existing. you may want read descriptions launchmode: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode you want launch activity singleinstance edit: maybe singletask better. this workflow want achieve: workflow http://i55.tinypic.com/xm0llx.png all background work has done service. implementing 1 quite simple, creating activity. there many examples on how it: http://developer.android.com/reference/android/app/service.html http://marakana.com/forums/an

php - How can I submit a form right after a user chooses a picture? -

i have form , i'm trying figure out how can submit form after user uploads picture , verified picture. trying use javascript verify image being uploaded. try this: <script> function submitformafterimagecheck() { if(/(\.jpeg|\.jpg|\.gif|\.png|\.tiff)$/.test(document.getelementbyid("myfile").value)) { document.getelementbyid("myform").submit(); } else { alert("you can upload image"); } } </script> and html: <input id="myfile" type="file" onchange="submitformafterimagecheck();" />

actionscript 3 - Flash authoring environment strange Test Movie behavior (AS3) -

i can't life of me figure out why happening. let me describe i'm experiencing. i add dynamically via actionscript. in flash authoring environment, when test movie, of movieclips on stage disappear , see color of stage. the strange thing can still rollover/rollout (i added trace statements rollover/rollout handlers). i'm tracing out 'visible' , 'alpha' property , visible=true , alpha=1.0 !!! on thing am seeing rollover/rollout methods called multiple times in quick succession. i.e. method invocation order rollover, rollout, rollover or rollout, rollover, rollout. the actions have in rollover , rollout methods really simple. turn on/off other movieclips...imagine map...when rollover icon, path shows on map , when rolloff, path goes away. however, if adjust window of test movie window, appears again! the crazy thing when publish it, behavior doesn't happen in browser or app! what's going on? memory thing authoring environment? pos

winforms - WindowsFormHost items in a WPF ListBox - Z-Order -

i have been end of web , , can't seem find solution z-ordering windowsformshost issue. issue specific rendering listbox items windowsformshost wrapped winform controls. when rendered items displayed outside bounds of listbox -- makes entire screen horrible. i attaching quick code sample. have options? need rethink layout? <window x:class="wfh_zorderissue.window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wf="clr-namespace:system.windows.forms;assembly=system.windows.forms" xmlns:wfi="clr-namespace:system.windows.forms.integration;assembly=windowsformsintegration" title="wfh listbox zorder" height="300" width="600"> <grid> <listbox background="lightblue" horizontalalignment="left" itemssource="{binding}" maxwidth="400" borderthickness=&qu

php - retrieving xml data -

in stores.htm , have input 2 values: 1 street address (streetno , street name) , other suburb. on basis of providing inputs, retrieves data stores.xml file. the problem street address , suburb both stored in <address> element of stores.xml file, not separately. tried lot i'm not finding solution of how match inputs xml file data. i stuck in if (condition) which in php file stores.xml <?xml version="1.0" ?> <stores> <store> <name>galaxy</name> <address>50 callander road,noble park</address> </store> <store> <name>remica</name> <address>10 challander road,noble park</address> </store> <store> <name>home</name> <address>10/10 callan road,richmond</address> </store> </stores> stores.htm <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>search</title> <script type="text/javas

bundler - How can I add gems to my vendor/cache directory in a Rails 3 app? -

i use engineyard, , have deployment failing. getting message: some gems seem missing vendor/cache directory. not find rspec-core-2.6.0.rc2 in of sources how make sure gems in directory? bundler ships command explicitly creates cache bundle package after you've done bundle install check , keep vendor/cache directory date. if want install gems on machine without checking on rubygems, run bundle install --local however, beware, if upgrading gems (like every time subrelease of rails comes out), vendor/cache can grow. my current project's git repository 80mb, of more 30mb data stored in vendor/cache. it seemed idea speed deploys, overall made our repository bigger.

How to retrieve data from SQLite table in Android -

i doing map application in android using sqlite store , retrieve data. create table store latitude , longtitude not know how retrieve latitude , longtitude values sqlite bind them latitude , longtitude values in map activity. can me? use start: sqlitedatabase db = openorcreatedatabase("my_locations.db", sqlitedatabase.create_if_necessary, null); string[] columns = new string[]{"latitude", "longitude"}; string[] name = new string[]{"dientringh"}; cursor c = db.query("location", columns, "name=?", name, null, null, null); string latitude = c.getstring(0); string longitude = c.getstring(1);

c# - Uninstall application on remote computer silently -

i developing c# program remotely uninstall application. works fine problem not list of installed products on particular selected computer. the code listing installed product using wmi : void listallproducts() { try { connectionoptions connection = new connectionoptions(); connection.username = connect.username; connection.password = connect.password; connection.authority = "ntlmdomain:mshome"; managementscope scope = new managementscope("\\\\"+ connect.machinename +"\\root\\cimv2", connection); scope.connect(); objectquery query = new objectquery("select * win32_product"); managementobjectsearcher searcher = new managementobjectsearcher(scope, query); system.threading.thread.sleep(5000); foreach (managementobject queryobj in searcher.get()) { listbox4.items.add(queryobj["name"].tostring()); listbox2.items.a

Which device to attach filter driver to for Xbox 360 controller? -

as learning exercise, i'm trying write filter driver wired xbox 360 controller on windows 7 64-bit. controller shows hid joystick, seems should straightforward. i've made example filter driver mouse swaps left , right mouse buttons. based on moufiltr , firefly samples come wdk. however, i'm having trouble converting example work xbox 360 controller. when plug controller in, 3 different devices appear in device manager: human interface devices/hid-compliant game controller human interface devices/usb human interface device common controller windows class/xbox 360 controller windows which 1 of these should attach driver to? with mouse filter driver, able follow installation directions firefly sample: right-click on mouse in device manager, choose "update driver." xbox 360 controller, i'm not sure device should install driver for. or talking hardware independently, , need install filter each 1 of them? i should note i've tried attaching

Facebook Registration Plugin - How to set Advanced Permissions? Offline Access etc? -

i'm using fb registration plugin: https://developers.facebook.com/docs/plugins/registration/advanced/ what can't figure out how set adv permissions access offline permission, post wall etc? thanks you can't, @ least, not yet. registration plugin doesn't have options permission requests- unfortunately makes totally useless me, , i'm sure many other people.

.net - stand alone application c# -

so wondering if tell me best way go taking i've written out in c#(wpf) , turning stand alone application? , if had links tutorials or explain me how so. thank assistance. let me rephrase. have program can run on someone's computer without need of ide, or have have installation wizard or along lines run application. i think looking executable of project. creates .exe file in side project folder/bin/debug/ (or release depend on build mode). can copy .exe file machine has installed required .net framework , execute it. if want create nice setup program. here good example

iphone - [NSCFString stringValue]: unrecognized selector sent to instance -

my created application crashed when executing below lines of code c1 integer variable. nsstring *path = c1.stringvalue; shows following error in log: -[nscfstring stringvalue]: unrecognized selector sent instance 0x5566e80 2011-05-11 14:56:15.813 e-trend[1552:207] uncaught exception happens!! (nsinvalidargumentexception: -[nscfstring stringvalue]: unrecognized selector sent instance 0x5566e80) 2011-05-11 14:56:15.816 e-trend[1552:207] * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nscfstring stringvalue]: unrecognized selector sent instance 0x5566e80' if have idea solve issue , please answer accordingly. where c1 integer variable what mean? how c1 declared? if c1 int , c1.stringvalue wouldn't compile. the dot syntax works when object reference -- c1 -- of specific object reference type (not id ) , reference-- class-- responds method. so, have like: mythingthatrespon

difference between mysql and cassandra -

what difference between cassandra , mysql? i searched using google. not satisfied, , not understand. please tell me clearly. mysql relational database, supports complex, flexible queries using sql query language. relational model consists of tables (relations) can interlinked keys common multiple tables. cassandra key-value store (like hashmap) lets plain or structured values based on key. not support complex/flexible queries, in return provides greater scalability , performance. not use fixed predefined tables, uses "column-based" model, each row of data can contain data items of various types, don't have predefined. cassandra uses cassandra query language (cql) uses syntax similar sql. cassandra provides older binary query interface via thrift protocol.

c++ - How can I test for the last element in a vector when using BOOST_FOREACH? -

i have vector iterate over. final element of vector special case, , i'd test separately. example, may such: for (iterator = vector.begin(); iterator != vector.end(); ++iterator) { if ((iterator + 1) == (vector.end())) { ... } else { ... } } i replace iterator boost_foreach macro. can similar test final element done? if(!vec.empty()) { boost_foreach(int e, boost::make_iterator_range(vec.begin(), vec.end()-1)) { // handle each element last } // handle last element here }

iphone - iOS frame by frame animation, by script -

there few questions regarding frame frame animation (such frame frame animation , other similar questions), feel mine different here goes. this partially design question little ios experience. i'm not sure "frame frame" correct description of want let me describe that. basically, have "script" of animated movie , i'd play script. script json file describes set of scenes. in each scene there few elements such background image, list of actors positions , background sound clip. further, each actor , background there's image file represents it. (it's bit more complex - each actor has "behavior" such how blinks, how talks etc). job follow given script referencing actors , background , every frame, place actors in designated position, draw correct background , play sound file. movie may paused, scrubbed forward or backward similar youtube's movie player functionality. of questions i've seen refer frame-by-frame animation have

cocoa touch - Auto fetch data from website iOS/iPhone Programming -

i wanted auto fetch data(gold price) website , update variable. have load whole .html file in string , find price? there other way? if updated variable, how save it, retains it's updated value(price)? do have load whole .html file in string , find price? yes is there other way? only if web site provides api gives access data need. even if updated variable, how save it, retains it's updated value(price)? a variable keep it's value until change it. if want preserve when user quits app, starts again same value, save in nsuserdefaults example. do aware however, data copyright, can't scrape data website , publish app based on data without considering legal perspective. price data owned exchange , need license re-publish it.

android - some DateFormat AM/PM formatting options don't appear to be working on AVD for API Level 8 -

android.text.format.dateformat specifies using format string 'a' should yield 'a' or 'p' , 'aa' should yield 'am' or 'pm'. however, on avd, using 'a', 'a', or 'aa' yields 'am' or 'pm' not congruent on-line documentation. final long currenttimemillis = system.currenttimemillis(); log.i("dateformat", "a: " + (string) dateformat.format("a", currenttimemillis)); log.i("dateformat", "aa: " + (string) dateformat.format("aa", currenttimemillis)); log.i("dateformat", "a: " + (string) dateformat.format("a", currenttimemillis)); log.i("dateformat", "aa: " + (string) dateformat.format("aa", currenttimemillis)); since dateformat has been available since api level 3, running regression or there wrong development environment? (i'm new android don't have experience framework yet

What is interface casting for in C#? -

i understand how writing interface works in c#, example described here: codeguru explanation interface iintelligence { bool intelligent_behavior(); } class human: iintelligence { public human() { //............. } /// interface method definition in class implements public bool intelligent_behavior() { console.writeline("........"); return true } } i confused following process of interface casting: human human = new human(); // human object casted interface type iintelligence humaniq = (iintelligence)human; humaniq.intelligent_behavior(); what sense of having class ( human in case) implement interface, , casting instance human interface? question not how works, why done. .net offers 2 types of interface implementations implicit implementation , explicit implementation. when using implicit implementation , become part of type interface example if have iperson interfa

Is the GPS linked to WiFi connection in Android? -

i have written code detects current location. locates if wifi connection onam not switching on gps manually have enabled programatically. , if enable gps manually, not locating position.. gps , wifi linked in android.? can 1 me out , tell me may reason such thing happen..thanks in advance. there multiple location providers in android. gps , network 2 of used. while gps not need wifi, network provider needs wifi give location. to answer question gps not need wifi line of sight give new location information.

wpf - Firing a Command within EventTrigger of a style? -

as know can't bind event directly command without behaviour: <datagrid> <i:interaction.triggers> <i:eventtrigger eventname="previewmousedoubleclick"> <i:invokecommandaction command="{binding tradeentrycommand"} /> </i:eventtrigger> </i:interaction.triggers> </datagrid> this works fine, have refactor double clicking datagrid double clicking cell. (i don't care cell clicked) i hoping define behviour inside cell style this: <style x:key="defaultcellstylebase" targettype="{x:type datagridcell}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type datagridcell}"> <controltemplate.triggers> <eventtrigger routedevent="previewmousedoubleclick"> ????????? </eve

CSS for my ZoomHandlers as shown -

i have css zoomhandlers shown .zoomhandle { width: 10px; height: 55px; } please see image of zoomhandlers on chart here http://www.tiikoni.com/tis/view/?id=74ce68f what want have , left , right arrow marks on left , right zoom handlers on , shown here http://www.tiikoni.com/tis/view/?id=bab7819 i have tried adding background-image:("test.png"); , did not got shown any ideas ?? here solution. css sprites you ask how?in tutorial see how can display part of large image tell zoom <ul id="container"> <li id="image"></li> </ul> <style type="text/css"> #container{ position:relative; width:400px; height:200px; background-image:url("background.jpg"); overflow:hidden; } #image{ position:relative; width:1024px; height:200px; left:-100; } </style> and can have 2 button , jquery increase or decrease left position of #image

asp.net - How to get the primary key of the last row inserted into the table -

i using multiview index insert news details. in first view user can enter details of news inserted db on clicking next button second view gives user add images of news (only 3 images allowed) , what having problem first view inserts data table dbo.newsdetail primary key newsid , while second view should add respected images using newsid of news added newsimages table. dont know how newsid of details added in first view news id working foreign key both table. or suggestions highly appreciated . static public void insertnews(string newsdescription, string newsimage, string newstitle) { sqlconnection conn = new sqlconnection(connectionstring); conn.open(); sqlcommand insertnews = new sqlcommand("insert caravannews(newsdescription, newsimage, newstitle) values ('" + newsdescription + "', '" + newsimage + "' , '" + newstitle + "')",conn); insertnews.executenonquery(); conn.close(); } a sep

iphone-Page-Navigation-on-uitableview -

i make 1 form display diamonds primary detail when select single row ,page navigate second page "detail page" show full detail of selected diamond.. (i use single uitableviewcell display full detail of diamond) firstpage navigate second. code is - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { self.diamonddetail = [[diamonddetail alloc] init]; dimentity *dim = [dimarray objectatindex:indexpath.row]; _diamonddetail.diamond = dim; self.title = @" detail "; [self.navigationcontroller pushviewcontroller: _diamonddetail animated:yes]; [self.tableview deselectrowatindexpath:indexpath animated:yes]; } now ,, output of detail page on navigationbar left side there 1 button automatically generated " detail " when click button page again navigate first page.. but.. i want.. when user move his/her finger on ipad-iphone surface / uitableviewcell from right left page s

measurement - Measure execution time of Java with JVMTI -

for profiler implement using jvmti start measuring execution time of java methods. jvmti offers events: methodentry methodexit so quite easy implement, came across note in api: enabling method entry or exit events degrade performance on many platforms , not advised performance critical usage (such profiling). bytecode instrumentation should used in these cases. but profiling agent works headless, means collected data serialized , sent via socket server application displaying results. how should realize using byte code instrumentation. kind of confused how go on here. explain me, if have switch strategy or how can approach problem? i don't know sun jvm ibm jvm goes call fullspeeddebug mode when request methodentry/exit events.... fsd slows down execution quite bit. as can use bci profiler unless selective methods instrument see slow down. example profiler inserts if(profiling) callprofilerhook() on every entry , of possible exits in method object crea

jvm - Is it possible for a single Java Virtual Machine to have different id's -

we're running several jboss instances hotspot 1.5.22 , today found jvm has 2 different vmid's. i'm seeing: $./jinfo -flags 13278 attaching process id 13278, please wait... debugger attached successfully. server compiler detected. jvm version 1.5.0_22-b03 [flags jboss_node_b1] $./jinfo -flags 20569 attaching process id 20569, please wait... debugger attached successfully. server compiler detected. jvm version 1.5.0_22-b03 [flags jboss_node_b1] $./jinfo -flags 13255 attaching process id 13255, please wait... error attaching process: sun.jvm.hotspot.debugger.debuggerexception: can't attach process now, if run "ps -ef | grep jboss_node_b1" have 1 process node running pid 13278. actually, impossible 2 instances of same node running since 1 of them crash. this jps reporting: $./jps 13278 -- process information unavailable 20569 -- process information unavailable 13255 -- process information unavailable 26716 jps [several other jboss jvms] so have thi

Behaviour of Worksheet_Calculate event in Excel – stored events? -

and thank reading post. have encountered strange (in opinion) behaviour of worksheet_calculate event in excel (windows 7 ultimate, excel 2010), let me describe problem i’m having giving set up. take workbook 2 sheets. sheet 2 cell a1 has formula =sheet1!a1, enablecalculation property of sheet2 set true , in sheet2 object there sub private sub worksheet_calculate() = msgbox("value " & me.range("a1").value, vbokonly) end sub in module1 there sub public sub mysub() application.enableevents = false thisworkbook.worksheets(2).enablecalculation = true thisworkbook.worksheets(2).enablecalculation = false application.enableevents = true end sub now, enter 1 in sheet1 cell a1 – message box “value 1” displayed. next, set enablecalculation property of sheet2 false , enter 2 in sheet1 cell a1 – nothing happens. now, run mysub in module 1 – cell a1 on sheet2 displays 2 , enablecalculation property of sheet2 set false. far, good. enter 3 in

preload images before render javascript -

i wanna display images instantly images loaded smooth slider, not working. var myphotos = { _counter: 0, images: [], init: function() { servercall1(0, 'xml', 'rssphotos.php', function(xml) { imageobj = new image(); $(xml).find('item').each(function() { var desc = $(this).find('description').text(); var resp = getimgarray(desc); myphotos.images[myphotos._counter] = resp[0]; myphotos._counter++; }); //start preloading (i = 0; < myphotos._counter; i++) { imageobj.src = myphotos.images[i]; } ////put header home page topheader.putdata(topheader.photodata()); }); } }; after execution of function, loop through myphotos.images them instantly, rendering 1 one slowly. perhaps this var myphotos = { _counter: 0, images: [],

extjs - How can we call another view from a view Spring MVC -

i using springmvc , extjs project. in dispather-servlet: mapping (welcome.htm welcome.java file) , (process.htm process.java) file. welcome.java file return view name hello.jsp in hello.jsp using extjs ui components. in hello.jsp when user click button want redirect process.htm process.jsp executes how can or unclear question. please let me know thanks. i don't know if mean, how redirect @controller public class pgpcontroller { @requestmapping(value="/index.html", method=requestmethod.get) public modelandview index(){ modelandview mv = new modelandview("index"); return mv; } @requestmapping(value="/signin.html",method = requestmethod.get) public modelandview submit){ modelandview mv = new modelandview("signin"); return mv; } @requestmapping(value="/signin.html",method = requestmethod.post) public modelandview submit(){ modelandview

Change image src of imagebutton using jquery 1.4.4 -

i tried change image src of imagebutton using jquery fails change background. i have tried below script or that: $(document).ready(function () { $('#<%=imagebuttonid.clientid%>').click(function () { $('#<%=imagebuttonid.clientid%>').attr("src", "mobile/images/writelogbook_icon.png"); }); }); i have tried object.css("backgroundimage","path"); but, fails. please suggest me. using jquery 1.4.4 min edit: relavent code html: <input type="image" name="imagebuttonid" id="imagebuttonid" src="images/admin.png" /> $('#imagebuttonid).click(function () { $(this).attr('background-image', 'images/customer.png'); }); thanks, naresh goradara you should try this: <asp:imagebutton id="imagebuttonid" runat="server" src="images/admin.png"> </asp:imagebutton>

javascript - Always getting wrong radio button value. What's wrong? -

here live example of problem http://jsfiddle.net/littlesandra88/xksb9/ i have expected "create" button returned empty string, when radio buttons not selected. instead reads value radio buttons form below. the bottom "save" button returns value form above. strange! here code $(document).ready(function(){ $('form').live('submit', function(){ var title = this.elements.title.value; var owner = this.elements.owner.value; var type = $('input:radio[name=ctype]:checked').val() || ''; alert(type); }); }); the idea is, auto-generate forms of type @ bottom, , don't know id's before hand, give them random numbers make them unique. how can problem solved? you may want change line: var type = $('input:radio[name=ctype]:checked').val() || ''; to var type = $('#create_form input:radio[name=ctype]:checked').val() || ''; so jquery lo

javascript - Uncaught TypeError -

can explain theses errors? uncaught typeerror: cannot set property 'innerhtml' of null uncaught typeerror: cannot read property 'style' of null uncaught syntaxerror: unexpected token illegal uncaught typeerror: object # has no method 'dispatchevent' this test website at point in page have: function display_price(price, oid) { ... element = document.getelementbyid(oid); if (valor != 'nan' && valor != null && valor != '') { element.innerhtml = valor + money_simbol; the last line causing error because element null. should add condition if(): is, change line: if (valor != 'nan' && valor != null && valor != '') to this: if (element && valor != 'nan' && valor != null && valor != '') in other words, it's practice always check return value of function before accessing properties.

android - I want change the volume of ringertonevolume -

i used code adjust volume didn't work int volume=23; audio.setstreamvolume(audiomanager.stream_ring,volume, audiomanager.flag_play_sound|audiomanager.flag_allow_ringer_modes);} you should not set volume 23 instead should first make call getstreammaxvolume(streamtype) max volume possible streamtype in case ringer's volume. for example, set ringer's volume max this! audiomanager.setstreamvolume(audiomanager.stream_ring, audiomanager.getstreammaxvolume(audiomanager.stream_ring), flag_allow_ringer_modes|flag_play_sound); updates int streammaxvolume = audiomanager.getstreammaxvolume(audiomanager.stream_ring); toast.maketext(this, integer.tostring(streammaxvolume), toast.length_long).show(); //i got 7 audiomanager.setstreamvolume(audiomanager.stream_ring, streammaxvolume, audiomanager.flag_allow_ringer_modes|audiomanager.flag_play_sound); ok. @ home can try out codes. here can see, streammaxvolume gives me integer of 7. if try set 23 way much

Regular Expression for @ Array in Perl -

actually m using 1 perl script prepare readme txt builds. in script used foreach $line (<log>) { if(length(trim($line))>0) { $line=trim($line); $line=~ s/[\r]//gs; if(rindex($line,'#')!=-1) { $icut=substr($line,0,index($line,']')); $icut2=substr($icut,index($icut,'#')+1,length($icut)); } push(@issue,$icut2); it's fetching correct issue no when situation comes [i#1303350], [i#1270918],[i#1312521] updated physical confirmation template based on co then it's fetching 1 issue no not issue same line. modified code foreach $revno(<rev>) { if(length(trim($revno))>0) { $revno=trim($revno); $revno=~ s/[\r]//gs; if(rindex($revno,'#')!=-1) { $revcut=substr($revno,0,rindex($revno,']')); print "$revcut\n"; $revcut1=substr($revcut,index($revcut,'#')+1,length($revcut)); } }

sql server - SQL how to select date from 1 - many -

in sql 2005 stored proc need run query contains 1-m. need return 1 of many table 1 earliest date. i have looked @ in sql how write query return 1 record 1 many relationship? and sql conundrum, how select latest date part, 1 row per part (unique) but not sure what's best solution in case doing insert temp table , using dynamic sorting , paging. here sql. want return many rows of foo, earliest b.createddate between start , end data paramaters pass in there 5 rows in bar each foo. declare @startdate datetime declare @enddate datetime insert @results select distinct f.name, f.price b.createddate , // loads more columns removed brevity foo f join bar b on f.id = b.fooid // loads more table removed brevity (@x null or f.id = @x) , (@deal null or f.isdeal = @deal) , (@startdate null

sql - Email trigger when data is changed -

i created trigger send email when field aantal changed problem won't deleted , inserted data place in body of email. , told because deleted , inserted contains multiple rows. please suggest solution "get row containing changed data". im using sql server 2008r2 code: --de triggert-- alter trigger [dbo].[rvabestellingenaantalwijzigentrigger] on [dbo].[rva_bestellingen] after update --vars declare @body varchar(500) declare @bestellingid int declare @categorieid int declare @subcategorieid int declare @aantalorigineel int declare @aantalnieuw int declare @locatienaam varchar(255) declare @componentnaam varchar(255) declare @categorienaam varchar(255) declare @subcategorienaam varchar(255) declare @datum datetime if update(aantal) /*and (select datum inserted) = cast(floor(cast(dateadd(day,1,getdate()) float)) datetime) */ , (convert(varchar,getdate(),108)>'11:00') begin --zetten aantallen set @aantalorigineel = (select aa

jquery accessor id vs class? -

at link: http://jqueryui.com/demos/tabs/ when "view source", have: <div id="tabs"> <ul> <li><a href="#tabs-1">...</a></li> <li><a href="#tabs-2">...</a></li> <li><a href="#tabs-3">...</a></li> </ul> <div id="tabs-1">...</div> <div id="tabs-2">...</div> <div id="tabs-3">...</div> </div> so want know, how implement class instead of id, considering portion of code used multiple times may loaded ajax, in different times. for dynamically adding tabs, there add method auto-name tab controls you, letting re-use tab creation code repeatedly. when tab added page, fires add event, shown in tabs doc page: var $tabs = $('#example').tabs({ add: function(event, ui) { $tabs.tabs('select', '#

Rails 3: How To Return A JSON Document? -

i'm in process of creating simple api application. have create controllers , did processing. however, view being returned. how can return json document user instead of view? also, if there's error, should return json document or... ? thanks! add controller respond_to :html, :json (remove html if want json-api). in actions can use respond_with call, like: respond_with(@posts = post.all) it render json-object if format json, , render html-view if html requested. if routes created standard resources, adding .json suffix url give json-result, ie. if route specified as: resources :posts

.net - How to load RSA Public Key generated by openSSL into RSACryptoServiceProvider? -

i writing .net class reads cookie our central authentication server. contains userid, timestamps , signature created openssl_sign() using 2048 bit rsa key , sha1 hash. the current public key provided in openssl pem format on server , changes on occasion. cannot read key using .net managed code alone (yet) , worked out following procedure working: extract exponent , modulus public key check key still 2048 bit store key length, exponent modulus in source, compile , deploy (drop leading zeroes modulus make work) the class creates new rsacryptoserviceprovider(2048) , feeds public components using rsaparameters structure csp. verification of signature succeeds. i working without me creating, compiling , deploying new assembly each time key changes. make things interesting stick managed code (rules out examples found). sounds perfect internal asn.1 reader when creating instance of asnencodeddata(oid, data) oid found match, rsa aka 1.2.840.113549.1.1.1, did not work , produ

haskell - Comparing design by contract to type systems -

i read paper compared design-by-contract test-driven-development. there seems lot of overlap, redundancy, , little bit of synergy between dbc , tdd. example, there systems automatically generating tests based on contracts. in way dbc overlap modern type system (such in haskell, or 1 of dependently typed languages) , there points using both better either? the paper "typed contracts functional programming" ralf hinze, johan jeuring, , andres löh had handy table illustrates whereabouts contracts sit in design spectrum of "checking": | static checking | dynamic checking ------------------------------------------------------------------- simple properties | static type checking | dynamic type checking complex properties | theorem proving | contract checking see here: http://people.cs.uu.nl/andres/contracts.html

php - Is it good to have two separate tables in database for user information and other for Paypal user? -

i'm new programmer. i'm working on project need integrate paypal in website. i'm confused: why saving user information twice in database? first collect information user , through paypal button. in general, want have information once in database. however, there may case want separate out data. example, if paypal data different data given directly (first name different, etc.), might want store paypal data separately. however, if getting duplicate data, suggest merging 2 tables 1 possible. maybe create second table links user table store paypal info (paypal id or whatever else new information related account, not user). you need consider information change. if user going change name, going ok if 2 tables merged? matter paypal if try ask jon doe , paypal expecting jonathan? not since doubt paypal doing name lookup. however, need @ these types of possibilities. need consider idea of user having multiple paypal accounts (personal , work example). in cas

javascript - Single queue for jQuery animate() elements -

by default jquery queue created animate() done per element, i'm wondering if there way create single queue animations done animate()? i.e. 1 animation should occuring @ time you own custom queue on 1 element using queue: http://jsfiddle.net/jrawx/2/ $(function(){ $('#myqueue') .queue('myqueue',function(next){ $('#t1').animate({left: 100}, {duration: 1000, queue: false, complete: next }) }) .queue('myqueue',function(next){ $('#t2').animate({left: 100}, {duration:1000, queue:false, complete: next}) }) /* etc. */ .dequeue('myqueue') })

Facebook Canvas App - Finding all users who have installed the app -

how find out users have installed canvas app ? there ui on facebook or need query api ? it can't done per - how user ids of people using facebook application i suggest use use depreceated rest api call once save ids of users, , add new user list (keep on saving in db).

php - Mysqli Query is not returning any result -

i seem having trouble getting mysqli return result query. code is: $db_conn = get_database(); //function returns static mysqli object reference if($result = $db_conn->query("select city state name='ca' ")) { $row = $result->fetch_object(); $city= $row->city; $result->close(); } else { echo $db_conn->error; } when echo contents of city variable, contains nothing. check get_database() make sure proper database selected the column state in clause same table name, state . change name instead if can.

perl - Moose vs. MooseX::Declare -

postlude moosex::declare no longer recommended relies on devel::declare served purpose obsolete. @ point if wants mx::d should @ moops original assuming have decent knowledge of old-style perl oo, , assuming going write new code in flavor of moose (yes, understand there performance hit), wondering if deeper down either rabbit hole, going wish had chosen other path? so-monks enlighten me relative merits of moose vs. moosex::declare (or other?). how interchangeable are, 1 one class , other another, should choose switch. (p.s. ok cw-ing question, think formed answer might able avoid subjectivity) moosex::declare sugar-layer of syntax on moose. are, past parser, identical in produce. moosex::declare produces lot more of it, lot less writing. speaking enjoys syntax of moosex::declare still prefers write of code in plain moose, tradeoffs on development & maintainability side. the basic list of items of note when comparing them: moosex::declare has much more

migration - Can I Turn Off Implicit Navigation in Jsf 2.0? -

i'm migrating old projects jsf 1.2 jsf 2.0. projects jsp based. i'm having trouble implicit navigation after migration. action methods return values (let's say, internal use) cause jsf try navigate non existing pages. for example, method return "error" make browser try access /error.jsp result in 404. i like, these projects, turn off implicit navigation. possible? thanks! no, that's not possible. it's planned jsf 2.2, see jsf spec issue 937 . what it, internal use you're trying (ab?)use navigation outcomes? exception handling? might want throw normal exception instead , handle usual way.

search java swing calendar appointement component -

Image
i searching java swing calendar component allow adding schedule , reminder features, mig calendar expensive. here's screenshot: any suggestion? that fancy component. price not bad get. don't know of cheaper or free component exact same thing. if put end spending more-time effort cost buy component.

module - flex: relative sizing and performance -

we building flex project , render faster. have situations reference parent module size properties size current module containers, current module size properties bunch of attributes including font size , element positions , sizes. would create temporary variables a) pcw=parentcontainer.width, pch= parentcontainer.height b) ccw=currentcontainer.width, cch=currentcontainer.height and reference pcw,pch,ccw , cch while doing positioning. help? also given bulk of positioning done in mxml, setting these interim variables in initialization function, allow them used in mxml such resize browser size changed. pointers i'm not sure if you're using term "module" a generic term refer component, or if explicitly referring classes of module class. it breaks encapsulation if container aware of it's parents. in flex, parent responsible sizing it's children; , child should never size itself. you had code access parent's height , width: pcw=parent

Where to find libClang documentation for haskell? -

where can find documentation haskell libclang bindings? since package relies on c library, package not build on hackage , meaning documentation not build. you can generate docs in source directory package. can source running: $ cabal unpack libclang and generate docs running: $ cd libclang-0.0.9 $ cabal configure $ cabal haddock i did this, , put the docs libclang here.

php - how to change Download show after upload by jQuery-File-Upload/ -

i've installed the blueimp jquery-file-upload but had big problem modify view after finish uploading, want show making image raised in specific div i hope edits must in jquery.fileupload-uix.js , and in code : this.getfileurl = function (file, handler) { return file.url; }; this.getthumbnailurl = function (file, handler) { return file.thumbnail; }; this.buildmultidownloadrow = function (files, handler) { var rows = $('<tbody style="display:none;"/>'); $.each(files, function (index, file) { rows.append(handler.builddownloadrow(file, handler).show()); }); return rows; }; this.builddownloadrow = function (file, handler) { if ($.isarray(file)) { return handler.buildmultidownloadrow(file, handler); } var filename = handler.formatfilename(file.name), fileurl = handler.getfileurl(file, handler), thumbnailurl