Posts

Showing posts from September, 2014

javascript - Call an event from another element -

i have button a onclick = "alert(1);" and button b . how do, when click on button b , should call event on button a ? click b -> eventb -> eventa html: <button id="buttona"> button </button> <button id="buttonb"> button b </button> javascript: var = g('buttona'), b = g('buttonb'); function g(s) { return document.getelementbyid(s); } a.onclick = function() { alert('button clicked!'); }; b.onclick = function() { alert('button b clicked!'); a.click(); } live demo: http://jsfiddle.net/tapwr/1/ update: if button b inside iframe use top object reference window object of "parent" page. iframe code so: var b = document.getelementbyid('buttonb'); b.onclick = function() { alert('button b clicked!'); top.document.getelementbyid('buttona').click(); }

cryptography - rijndael s-box with an example in simple words -

all on google , wiki i'm not able understand rijndael s-box key scheduling... can explain them in simple words , clear example???? check this flash presentation , i've seen when studying rijndael cypher , needed understand it, hope :)

ruby on rails - JRuby Rails3 Trinidad/Jetty_Rails fails on simplest install - feeling as dim as a 2watt bulb -

ok. been getting quite frustrated trying jruby/rails3 running jetty , tomcat. trying local install of jruby/rails3 , jetty/tomcat app running on os-x. (and ubuntu stage , live server) error on startup could not find activerecord-jdbc-adapter-1.1.1 in of sources try running `bundle install`. i've tried googling myself distraction trying find out why happens. 1 source mentioned issue 'bundler' didn't give version information. others gave varying options change gemfile have tried exhaustively last 5 hours no luck. in exasperation decided start scratch plain install. installed jruby in /opt/jruby-1.6.0.rc1/ symlink /opt/jruby. gems installed: jruby -s gem list *** local gems *** abstract (1.0.0) actionmailer (3.0.3, 2.3.5) actionpack (3.0.3, 2.3.5) activemodel (3.0.3) activerecord (3.0.3, 2.3.5) activerecord-jdbc (0.5) activerecord-jdbc-adapter (1.1.1) activerecord-jdbcmysql-adapter (1.1.1) activeresource (3.0.3, 2.3.5) activesupport (3.0.3, 2.3.5) arel (2.0

asp.net mvc - Why is NHibernate persisting new objects in the wrong order of creation even inside a transaction? -

in asp.net mvc app have log object tracks happens in forum. when comment added inside transaction following happens: a new comment added submissions table a new log entry reference id of comment added logs table finally transaction committed , no exceptions generated. turns out when transaction committed, nhibernate first inserts log record , comment record, therefore saving log record incorrect comment id 0. here code show happening: using (iatomictransaction transaction = unitofwork.begintransaction()) { try { submissionrepository.addcomment(comment, parentsubmission); logrepository.addcommententry(comment); transaction.commit(); } catch { transaction.rollback(); throw; } } unitofwork , atomictransaction wrappers around isession , itransaction objects nhibernate apis. , here log generated confirms problem: 2011-02-09 14:42:05,631 [15] debug nhibernate.sql - insert logs (version, created_at

database design - Except joining 20 tables any other options for writting / reading data? -

i creating user profile. fields lookup based own tables favourite movies, favourite music, favourite food, sports, etc... these not text fields auto suggest fields system maintained list. reason these in own table have more colunms unique them. so read data @ user input ok after 2 problems: 1) writting data: since m:m relationship need 20 different tables? 2) reading data @ profile load time: need join these 20 tables user's data? what other option have store these user details? concern performance since social site. 20 joins not good. not sure other techniques. using mysql , php. the other option can think of store data in array in db although dont know how searches work that. install favorite dbms. create user table, , 2 or 3 user favorites tables. write little program generate , load million random users. write little program generate , load 10 million favorite movies (or whatever) million users. run queries. if speed problem, post schema "datab

where to get the SP 2010 Enterprise Search Query sample? -

where sp 2010 enterprise search query sample? with "contains" , "freetext" option. i find tool complex not working in share point 2010 sites. is there tool available generate sp 2010 search query? what tool codeplex did try? i use sharepoint searchcoder tool of zevenseas http://mosssearchcoder.codeplex.com/

facebook - FQL and Graph API in iOS -

have used fql of graph api in ios? trying users posts different groups have read fql documentation need see example me proceed? please help here example: nsmutabledictionary * params = [nsmutabledictionary dictionarywithobjectsandkeys: @"select uid,name user uid=4", @"query", nil]; [facebook requestwithmethodname: @"fql.query" andparams: params andhttpmethod: @"post" anddelegate: self];

xcode - How do I build my application for the iPhone device (not sim) -

i keep getting error: code sign error: identity 'iphone developer' doesn't match valid certificate/private key pair in default keychain i have paid me $99 (which had beg/borrow/steal). thanks you have install provisioning profile can @ ios provisioning portal. go developer.apple.com , click ios dev center, login, ios provisioning portal.

c# - Want Images as PanoramaItems in WP7? -

i have panorama control need programmaticaly add items images. want implement them flicking on image slide second image , on.. did add images panaroma item shows 1 image only. (int = 0; < 10; i++) { image_new = new image(); panoramaitem pi = new panoramaitem(); image_new.source = "some image bitmap"; pi.content = image_new; image_panaroma.items.add(pi); } xaml layout : <grid x:name="layoutroot"> <controls:panorama name="image_panaroma"> </controls:panorama> </grid> can tell me wrong? also there other way possible give sliding transition images? you don't exception get, think better approach create itemtemplate panorama control , bind list of objects. public class itemdata { public string name { get; set; } public string path { get; set; } } ... list<itemdata> items = new list<itemdata>(10); (int = 0; < 10; i++) { items.add(n

window - Cannot get focus on new opened tab with selenium IDE -

i'm trying create web test selenium ide. have 1 problem when click on javascript link opened new tab. need perform check on new tab can't focus still in main page. tried several things i'ad search on google without succeed works. hope can me. thanks in advance. update: so tried several things , tink i'm on way. i can windows names : storeallwindownames names echo names=${name} i have like: , 987dfg4545sdfgsd it seems value before "," null default page , other value name of page. but i'm not able open selectwindow. does know how should ?? thanks in advance. more info selenium tests: <tr> <td>setspeed</td> <td>1000</td> <td></td> </tr> <tr> <td>selectwindow</td> <td>null</td> <td></td> </tr> <tr> <td>click</td> <td>link=show tree...</td> <td></td> &

iphone - How to create wolf 3D kind of basic 3D walls in openGL -

Image
i trying figure out how can create simple 3d walls in opengl. dont want create fancy stuff basic 3d wall can move fwd , backwards imagine wolf 3d game map no killing etc. is there framework can use this?? want in opengl can create/render thing on iphone. thanks pranay if body can point me sample source code helpful. as non-opengl alternative, can construct such maze , move through using core animation. textured wall segments calayers containing images had been transformed in 3-d face appropriate directions. maze translated relative camera cause user move through area. code simpler equivalent opengl es implementation written scratch. an example of presented john blackburn in article here .

php - in foreach, isLastItem() exists? -

using regular loop, it's possible comapred current index last tell if i'm in last iteration of loop. there similar thing when using foreach ? mean this. foreach($array $item){ //do stuff //then check if we're in last iteration of loop $last_iteration = islast(); //boolean true/false } if not, there @ least way know current index of current iteration $iteration = 5 , can manually compare length of $array ? you can use combination of spl ’s arrayiterator , cachingiterator class have hasnext method : $iter = new cachingiterator(new arrayiterator($arr)); foreach ($iter $value) { $last_iteration = !$iter->hasnext(); }

django - Can't exclude ForeignKey fields for User in Piston -

i have model: # models.py django.contrib.auth.models import user class test(models.model): author = models.foreignkey(user, related_name="tests") title = models.charfield(_("title"), max_length=100) then in api folder django piston webservice: class testhandler(basehandler): allowed_methods = ("get") model = test fields = ("title", ("author", ("username",))) def read(self, request, id): base = self.model.objects try: r = base.get(pk=id) return r except: return rc.not_found if call webservice get: { "title": "a test" "author": { "username": "menda", "first_name": "", "last_name": "", "is_active": true, "is_superuser": true, "is_staff": true,

Is there a better way to do this Concatenation in SQL Server 2008? -

i've got following sql statement subquery concatenation. if notice, uses for xml .. .. .. gives me shivers bit :: feel it's code-smell. is there better way sql server 2008 ? select a.cityid locationid, a.city, stuff( (select ', ' + x.county [dbo].[countiesview] x inner join [dbo].[citycounties] y on x.countyid = y.countyid y.cityid = a.cityid xml path ('')) , 1, 2, '') [dbo].[citiesview] a.statecode = 'ny' what code doing listing cities (and counties) state of new york. because city can exist in 1 or more counties, wish concatenate county names ... otherwise i'll 1 city row per county (which don't want). can refactored, better? i tried use coalesce had no luck. "better" in eye of beholder. haven't seen better way in sql server 2005+, haven't been looking hard. the best way program own aggregate function . think i'd rather maintain

svn - Which Version Control for Drupal? -

i starting need work on bigger sites , multiple people know need start using kind of version control. grrr. while understand , use features , context put config info code instead of db, still confused version control system should use? there advantage using git? or subversion? in terms of workflow. i still pretty new version control "conceptually" , practically not sure need setup. i'd able use version control locally well. i'd able use version control locally well. in case use git or other dvcs . svn centralized , not allow make local commits. i suggest git reasons listed on whygitisbetterthanx.com (branching , local commits), subjective.

symfony1 - Symfony module not redirecting -

i developed module here http://www.symfony-project.org/askeet/1_0/en/2 when access http://askeet/contact says object not found! as told in commands, not learn symfony 1.0. the probable solution problem: not have mod_rewrite enabled virtualhost. make sure both enable apache module , in vh configuration.

[Grails/Groovy]minimum value of Map entries -

query: how can pull minimum value map in grails so far have found following code minimum value map in groovy ["java":1, "groovy":4, "javascript":2].min{it.value} but donot work in grails i have tried following piece of code def map = ["java":1, "groovy":4, "javascript":2] println map.min{it.value} assert map.min{it.value}==1 thanks in advance if want minimum value map, can do: def map = ["java":1, "groovy":4, "javascript":2] println map.values().min() assert map.values().min() == 1 edit also, closure accepting version of map.min has been in groovy since 1.7.6, , grails (as of v1.3.6) uses groovy 1.7.5

php - How to validate the google video code? -

in project, users insert google video code textbox - i'd certify video being referenced indeed exist. i'm presently using youtube api similar youtube references, i'm not sure best method google video. direction appreciated. can request url , see if 404s or not? function googlevideoexist($id) { // validate id need $id = (int) $id; $headers = get_headers('http://video.google.com/videoplay?docid=' . $id, true); // get_headers() follows location: headers, // , sent in sequential order foreach(array_reverse($headers) $header => $value) { if (strstr($value, '200')) { return true; } } return false; } url above guide - adapt suit. also, can use curl if more comfortable that.

asp.net - NHibernate holding on to a reference to data objects -

i'm trying work out lot of memory in app going , while doing profiling i'm noticing data objects loaded nhibernate hanging around once request (is asp.net), , therefore session, has ended. tracing back, there various things seem doing it, "singletableentitypersister" , "statefulpersistencecontext". i've disabled 2nd level caching now, they're still being held on to any ideas? the session being correctly disposed: if (session != null) { if (session.transaction != null && session.transaction.isactive) { session.transaction.rollback(); } else { session.flush(); } session.close(); session.dispose(); } nhibernate tracks changes made objects, means if do: user.firstname = "name" it make appropriate update in db. but track nh needs references objects. not tracked

math - Conversion between RGB and RYB color spaces -

i trying convert colours between rgb (red, green, blue) colour space , ryb (red, yellow, blue) colour space , again. based on details in following paper, able convert ryb rgb using trilinear interpolation - parametric weightings (s,t,u) ryb colors, , vertices of cube 3d points in rgb space. paint inspired color mixing , compositing visualisation - gossett , chen - section 2.1 - realization details my difficulties in reversing conversion process. a second paper references use of technique , indicates reverse conversion achieved using newton's method. provides no further details. indicate root finding in solving trilinear interpolation equations. on transfer of painting style photographic images through attention colour contrast - xiaoyan zhang; constable, m.; ying he; before expand on question equations, has seen or solved in language such java/c/c++/c# ? my current approach take forward equations of trilinear interpolation (ryb rgb), expand , rearrange provid

C# Excel Text to Column Problem -

hi i've called text column function in c# didn't turned out way wanted be. i have data in first cell of worksheet. guest;0;12/10/2010 03:46:34 pm;66082 if run text column manually excel, get. guest 0 12/10/2010 15:46 66082 however if ran through c# code, get. guest 0 10/12/2010 15:46 66082 the date format have switched "dd/mm/yyyy" "mm/dd/yyyy" here's c# code ((range)ws.cells[1,1]).entirecolumn.texttocolumns( type.missing, excel.xltextparsingtype.xldelimited, excel.xltextqualifier.xltextqualifiernone, type.missing, type.missing, true, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing, type.missing); i recorded macro excel. selection.texttocolumns destination:=range("a1"), datatype:=xldelimited, _ textqualifier:=xlnone, consecutivedelimiter:=false, tab:=false, _ semicolon:=true, comma:=false, space:=false, other:=false, fieldinfo _ :=array(array

events - ASP.net control Postback Problem (Can't read the value the user entered!) -

i've written custom widget allow user select location database of locations. first asp.net custom control. seemed working fine, there's problem. my control implements raisepostbackevent function follows: public void raisepostbackevent(string eventargument) { selectedlocationid = eventargument.split('|')[0]; selectedlocationdescription = eventargument.split('|')[1]; } i wrote test page , included following in asp code: <%= locationselector.selectedlocationid %> that worked fine. however, in web application, following code not work: protected void page_load(object sender, eventargs e) { if (page.ispostback) response.write(locationselector.selectedlocationid); // selectedlocationid null here!!! } when run code in debugger, see page load event fires before post event! therefore, data not yet read postback. know using ms provided text field control, text available @ page load, think must do

iphone - How do I register as a paid iOS developer? -

i developed app. want test app on device. not registered apple. how put identity device? how run app on device? please give step step instructions run app on device. since question "how register paid ios developer", answer is: go http://developer.apple.com , follow instructions.

javascript - Use jQuery .append() inside a function? -

i've been trying call function appends html tags inside of pre-existing div tags this: function loadtextbox(jsonurl,divid){ $.getjson(jsonurl, function(json) { alert('hello'); $('#' + divid).append('<h2></h2>') .find('h').append(json.heading).attr(json.config.backgroundconfig) .find('h').attr(json.config.headingconfig).append(json.heading).parent() .find('p').attr(json.config.bodyconfig).append(json.body); }) } this complex example haven't been able working append() function inside sort of other function. can append fine straight .js otherwise no luck. know fact json calls working use identical call , queries different function. there problem putting append() in function? edit: note, above alert not work is. if moved 1 line (above $.getjson call works fine. maybe important? also, calling function directly below in same .js file so: loadtextbox("./json/textbox.json&qu

java - With eclipse, how to hide superclasses methods in Content Assist? -

for example, have: jpanel pan = new jpanel(); then "pan." , eclipse shows content assist. in content assist, there methods in jpanel class , methods in jpanel superclasses (a lots). want eclipse shows me methods of jpanel class, not methods of superclasses. how that? its not content assist, can use ctrl + o see methods of class without superclass.

sql server - Help improving SQL join -

i have stored procedure runs update gaming points user balances. it's insert 5 subqueries. have isolated 1 of subqueries query slows entire batch down. without it, stored procedure run in under 2 seconds. it, take as 8 seconds. 8 seconds isn't end of world, sake of scalability, need have complete faster. here isolated subquery: (select isnull(sum(a.transamount) + sum(case when a.betresult = 1 (a.betwinamount + (a.transamount * -1)) end), 0) user_t left outer join user_td b on a.tid = b.tid left outer join lines_bl c on b.lid = c.lid left outer join lines_bm d on c.bmid = d.bmid left outer join event_m e on d.eid = e.eid left outer join event_kb f on a.transreason = f.bid left outer join event_m g on f.bid = g.eid a.userid = u.userid , (a.issettled = 1) , ( (a.transreason = 1 , (datediff(dd, convert(datetime, e.edate, 101), convert(datetime, @enddate, 101))

c# - All the time getting WebResource.axd?d=.... errors -

i have asp.net c# application , getting different errors time, 1 can see below. know how fix that? thank you. page: http://www.sitename.com/webresource.axd?d=oyuyekazwsmodoajydrqkg2&t=634022222718906250 message: invalid webresource request. source: system.web inner exception: stack trace: @ system.web.handlers.assemblyresourceloader.system.web.ihttphandler.processrequest(httpcontext context) @ system.web.httpapplication.callhandlerexecutionstep.system.web.httpapplication.iexecutionstep.execute() @ system.web.httpapplication.executestep(iexecutionstep step, boolean& completedsynchronously) i can think of 3 causes, 1 of point real error such: somebody trying exploit security hole in asp.net (a patch here ) can 1 of axd handlers serve content on web server if can figure out encryption key. unlikely, possible. in case, don't have anything, except make sure have fix applied. (this have observed on site finished) scenario existing

UITableView with custom cell subview - respondsToSelector:]: message sent to deallocated instance -

i have viewcontroller contains uitableview in cells created via custom subview (so each cell have label , textfield). subview includes textfield delegate methods fired on textfielddidbeginediting, textfielddidendediting, etc. uitableview caches cells visible , destroys them when cell no longer visible. problem have when user taps on textfield in cell , scrolls table cell being "edited" out of view , taps on new cell edit it, original cell's textfielddidendediting delegate method called, causing "respondstoselector:]: message sent deallocated instance" error because original/first textfield has been destroyed uitableview when scrolled out of visible area. has dealt issue before , found solution can keep textfielddidendediting methods proper handing of data user's input without having now-invisible cells destroyed? edit: found in uitableview class reference doc: "avoid relayout of content. when reusing cells custom subviews, refrain laying out

php - How to get the textarea ID using jQuery -

ive got textarea area on each table row unique id . how retrieve unique id javascript? php: $query = $db->query("select * bs_events eventdate = '".$date."'"); while($row = $query->fetch_array(mysqli_assoc)){ echo '<textarea id=\"att_name_" . $row['id'] . "\" style=\"width:300px\"></textarea>";' } php output: <textarea id="att_name_1" style="width:300px"> <textarea id="att_name_2" style="width:300px"> <textarea id="att_name_3" style="width:300px"> jquery: $(document).ready(function(){ $("#book_event").submit(function(){ id = event.target.id.replace('att_name_',''); $.post("scripts/book_event.php", { att_name: $("att_name_"+id).val(), }, function(data){ if(data.success) { $("#err&q

json - How to deal with version issues in android 1.6 to 2.x -

i built json consumer in android 1.6 (thought practice build on oldest version max support). able retrieve json under 1.5-1.6. threw app on droid (2.x) , receive "org.json.jsonexception: expected literal value @ character ....". why difference in versions? how can deal this? if can't working library, try gson great http://code.google.com/p/google-gson/

How do i tell in Perl what the size of a file inside a gzip archive is without unpacking the whole file? -

i have bunch of ridiculously big files (multiple gigabytes in size) have high compression ratio (1:200 or better). have process , @ least show kind of progress estimate. reason i'd know size of file inside .gz, can compare pulled out already. however, since unpacking whole file in advance each time rather prohibitive , waste of time, i'd figure size out without doing that. i know possible. can open gzip files total commander , viewer plugin show me right size. (i know it's not unpacking because shows me size immediately, wouldn't possible 10gb file inside gzip.) there header fields contain information. however looking through docs of various cpan modules couldn't find fits bill. io::uncompress::gunzip lets me @ a header, doesn't contain file size information. any suggestions? just there's proper answer this: sub get_gz_size { ( $gz_file ) = @_; @raw = `gzip --list $gz_file`; $size = ( split " ", $raw[1] )[1];

android - Imageview.setMaxHeight is working wrong -

hy! i download picture internet , want display it. height should 1/6 of max screen height (for multi phone support) code: final imageview iv = (imageview) findviewbyid(r.id.imageview01); iv.setmaxheight(getwindowmanager().getdefaultdisplay().getheight()/6); please help! try using layout_weight attribute of linearlayout divide screen parts need. ratio of values set different parts makes parts become bigger or smaller.

Windows Phone 7 DirectX development -

i know it's maybe silly question it's interesting me. know can create apps windows phone 7 using silverlight or xna, possible develop pure directx 9 applications can run on windows phone 7? thank answers , time in advance. no cannot use directx-9 make apps wp7 (without jailbreak). making silverlight or xna app using indirectly, though.

Accessing currently logged-in Drupal user from Java application -

i have java application hosted on same domain drupal website. java application gets client request form browser (so access cookies). possible using cookies in java application check if client logged drupal same browser? i thought using xmlrpc java application perform request drupal services module, couldn't find way information logged in user providing cookie data. any ideas? thanks lot. ps: i'm using freshly installed drupal 7. if have drupal 6 example job. thanks. well, if can session id, can hit sessions table, , see if there row in table has same sid (session id = sid). if uid isn't 0, user logged in, , can there.

objective c - Apple Mac OSX Native applications development with bundled Mysql -

i new mac osx development. can use bundled mysql in mac osx database of application? means when user install app, mysql database created , data being put db automatically. (as if use sqlite in ios apps development). , app runs on database then. if mysql sql not choice, can use instead? sqlite again? core data seems nightmare me. any ideas? thanks. if core data seems frightening that's reason spend time learning it. core data has practically become standard framework used persisting data in applications. sure there couple other ones, using after having mastered core data , wanting more. are going have problems in core data? yes, pretty same things you'll run during development persistence framework. worse if using sqlite have manually manage memory, migration of data, etc. if have little experience core data , seems little scary i'd sit down , take time read on apples guides , documentation on it. have use it? no, unless have specific reason chances co

c# - WpfToolkit DataGrid: Highlight modified rows -

is there way highlight modified rows on datagrid? since grid bound system.data.datatable figured might able bind colour of each row it's rowstate (example below), doesn't seem work. any ideas? xmlns:data="clr-namespace:system.data;assembly=system.data" <style x:key="datagridrowstyle" targettype="{x:type toolkit:datagridrow}"> <style.triggers> <trigger property="isselected" value="true"> <setter property="background" value="blue" /> </trigger> <datatrigger binding="{binding rowstate}" value="{x:static data:datarowstate.modified}"> <setter property="background" value="lightyellow" /> </datatrigger> </style.triggers> </style> <datagrid.rowstyle> <style targettype="datagridrow"> <style.triggers>

php - prevent page opening on an iframe? -

how can prevent page opening on iframe using php? gmail inside iframe? for php, can use. header("x-frame-options: deny"); this supported in modern browsers, ie8+, firefox 3.6.9, safari 4 , chrome. older browser, require javascript.

amazon web services - AWS SES for bulk mail : Require email verification? -

we're thinking of moving amazon's ses sending bulk mail. it appears have unique api call each email want send. if there 20k emails send, make 20k api calls. question is, need verify these email addresses before send them? have existing database of users , i'd rather transition ses transparent them. i noticed ses has api method verifying emails. if aren't required verify, why use method? http://docs.amazonwebservices.com/ses/latest/apireference/index.html?api_sendrawemail.html says: important: if have not yet requested production access amazon ses, able send email , verified email addresses. so, method asked used building list of addresses can e-mailed to, if haven't requested production access yet. since seem have done that, it's not useful you.

Actionscript: ExternalInterface.addCallback is not working in IE -

html: <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="testqwe"> <param name="movie" value="http://www.mydomain.com/swf/testqwe.swf" /> <param name="bgcolor" value="#ffffff" /> <param name="allowscriptaccess" value="always" /> <embed name="testqwe" src="http://www.mydomain.com/swf/testqwe.swf" width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> javascript: try { if(navigator.useragent.indexof('msie') != '-1') { var embed = jquery('#testqwe')[0]; } else { var embed = jquery('#testqwe embed')[0]; } } catch(e) { log({error:e}); } actionscript: private function jsapi():void{

iphone - What does the following error mean? -

program received signal: “exc_bad_access”. [switching process 388] kill error while killing target (killing anyway): warning: error on line 2179 of "/sourcecache/gdb/gdb-1472/src/gdb/macosx/macosx-nat-inferior.c" in function "macosx_kill_inferior_safe": (os/kern) failure (0x5x) quit debugger has exited status 0.(gdb) program received signal: “exc_bad_access”. [switching process 388] kill error while killing target (killing anyway): warning: error on line 2179 of "/sourcecache/gdb/gdb-1472/src/gdb/macosx/macosx-nat-inferior.c" in function "macosx_kill_inferior_safe": (os/kern) failure (0x5x) quit note error is; gdb has crashed. potentially due crash in application, particular messages not useful debugging real problem. and, more not, actual crash has nothing over-release of object. maybe so, not. typically, when gdb crashes in fashion, because trashed heap or stack in fashion gdb trips on corruption

android - Using Multiple Fragments in an single activity -

i want develop android application using honey comb 3.0 in want display list , clicking on item in list should display list beside list item in form of fragment. can 1 provide me sample code in sorting out issue? thanks in advance, have @ these 2 blog posts google's reto meier: http://blog.radioactiveyak.com/2011/02/android-app-surgery-earthquake-redux.html http://blog.radioactiveyak.com/2011/02/strategies-for-honeycomb-and-backwards.html he has lots of code examples in there handling fragments.

Calling WS with SSL in java -

i connect web service client work fine: wscsi wscs = new wscsi("http://localhost:8080/servicev2/services/wscsisoap?wsdl","wscsi","wscsisoap"); iscoring instance = new scoringcfa(wscs); assertequals(true, instance.statusservice()); i need use ssl, change url to: https://localhost:8181/servicev2/services/wscsisoap?wsdl and add in vm options: -djavax.net.ssl.truststore="c:\cacerts.jks" ('keytool -list -keystore "c:\cacerts.jks', when run command see certificate need there) when run client error: java.security.cert.certificateexception: no name matching localhost found.) that's because cert you're using issued against specific hostname (www.myhost.com). try solution in article . warned, code sample intended localhost testing, remove once move onto integration/assembly testing on proper server.

Combining two images in java? -

in project users uploads picture. times smaller expected. i'd create default size white(empty) image , place users image(small) @ center of white image. in other words, want cover sides of small image white pixels. how can java? i not in java image processing. use buferedimage expand uploaded image. bufferedimage newimage = new bufferedimage(50, 50, bufferedimage.type_int_rgb); newimage.getgraphics().drawimage(srcimage, 0, 0, srcimage.getwidth(), srcimage.getheight(), null); the above code, fills black color if source image width , height less 50. source image rendered left top , remaining area filled black. is possible move source image center , fill remaining pixels white color. any suggestions appreciative. thanks did try newimage.getgraphics().translate((25-srcimage.getwidth()/2), (25-srcimage.getheight()/2)); ?

SQL: multiple queries vs joins (specific case) -

this question seems have been asked lot , answer seems "it depends on details". asking specific case: better me have multiple queries or use joins? the details follows: "products" table -- around 2000 rows, 15 or columns "tags" table -- around 10 rows, 3 columns "types" table -- around 10 rows, 3 columns i need "tags" , "types" table tag/type-id in product table. my gut says if join tables end searching much larger set better multiple queries, not sure... thoughts? no, join outperform multiple queries. tables extremely small.

android - SMS and phone call detector -

1- function tell if call or sms received , made (means in , out). 2- can use returned value can true or false or object details other stuff destination, source, sms content,etc..) you may 1 only, doing 2 highly appreciated know many people searching well.

sql - mysql, iterate through column names -

i of column names mysql table, loop through each column name , run stored procedure using column names variable. effect of: colnames = column names table each colname if changed else else it looks show columns mytable give me column names, how column names loop? i run of in stored procedure using native sql. since i'm still learning intricacies of mysql, , out project. help. i think want this: declare col_names cursor select column_name information_schema.columns table_name = 'tbl_name' order ordinal_position; select found_rows() num_rows; set = 1; the_loop: loop if > num_rows close col_names; leave the_loop; end if; fetch col_names col_name; //do whatever else need col name set = + 1; end loop the_loop;

forms - Secure PHP File Upload Script -

i have asked question twice think, first time have gotten close this. planning on allowing users upload , download files (.pdf, .doc, .exl, .ppt, .png, .jpg, .gif). will these tips suffice: http://blogs.sans.org/appsecstreetfighter/2009/12/28/8-basic-rules-to-implement-secure-file-uploads/ also, there script can utilize, new php. a late response, think script should based on this: http://blog.insicdesigns.com/2009/01/secure-file-upload-in-php-web-applications/ it covers aspects of security , explains valid points. hope helps. edit: above link dead, here cached version of article .

php - Significance of the backslash? -

magic_quotes_gpc we hate , many servers still use setting , knowingly enough provides argue it's safer must disagree. the question have is, backslash needed for? want remove them can not sure if needed? edit other sql injection. magic_quotes_gpc() provided based on misguided notion data submitted php external source inserted database. if wanted send data somewhere other database, had remove slashes php inserted, doubling work required. as well, not databases use slashes escaping metacharacters. \' fine in mysql, in ms access, escaping single quote '' - not php doing unecessary work, in many situations, doing work wrong begin with. and then, on top of that, addslashes (which magic_quotes_gpc() calling internally) can't handle forms of sql injection attacks, particularly unicode used. addslashes glorified form of str_replace("'", "\\'", $string) , works @ ascii level - plenty of unicode sequences can regular ascii

python - Appending/formatting a string -

in c# format string do: string = string.format("/blah/blah/{0}_{1}/blah.html", int1, int2) in python, convert integer string automatically? how similar above in python.? in python 2.6 , above: a = "/blah/blah/{0}_{1}/blah.html".format(int1, int2) in python 2.7/3.1 , above, do a = "/blah/blah/{}_{}/blah.html".format(int1, int2) see docs on string formatting .

Google App Engine Channel API and Chrome Extensions -

over christmas implemented code open channel app engine application using channel api , working fine. i returned code , find broken, , problem seems lie in talkgadget client code trying load frame. i took snapshot of code returned /_ah/channel/jsapi on december 21 , comparing today's code. when older version tried talkgadget.google.com/talkgadget/d?token=[my-token] hardcoded use http. sensibly enough, code later changed check page's protocol in document.location , adapt cases https used. problem when running in chrome extension grabs chrome-extension: protocol , naturally channel fails open in extension. setting base of background page appspot url not change document.location, although had vague notion should. (not sure standards say.) is there workaround this? 1 thought create own iframe loaded site, nest actual channel iframe, complicating things. i wonder if moishe or else on app engine team comment on this. seems bug , code should take chrome extensions eith

jquery - General Dynamic Selectbox Question -

this general question...i'm in process of trying figure out how fire event (call function) populate select (dropdown) options once user clicks on it. core question is: how can fire event when select (or similar) clicked...without firing event again on change (on select...when user chooses something)? demo: http://so.devilmaycode.it/general-dynamic-selectbox-question $(function() { var options = ["the", "brown", "fox", "jump"]; $('#create-select').click(function(e) { e.preventdefault(); var select = '<select id="select-create">\n'; $.each(options,function(i, item) { select += '<option ' + (i === 0 ? 'selected': '') + ' value="' + item + '">' + item + '</option>\n'; }); select += '</select>'; $(this).fadeout(200,function (){ $(

Apache: Why on IE .htaccess rewrites non Latin character URLs to urlencode? How to solve it? -

apache: why on ie .htaccess rewrites non latin character urls urlencode ? how solve it? domain.com//контакты rewrites domain.com/%d0%ba%d0%be%d0%bd%d1%82%d0%b0%d0%ba%d1%82%d1%8b rewriteengine on # rewrite multiple slashes single slash after domain rewritecond %{the_request} ^[a-z]+\s//+(.*)\shttp/[0-9.]+$ [or] rewritecond %{the_request} ^[a-z]+\s(.*/)/+\shttp/[0-9.]+$ rewriterule .* http://%{http_host}/%1 [r=301,ne,l] seems there still no solution ie , depends of browser address-bar encoding. chrome 12 shows utf-8 url domain.com/контакты, on ctr+c, ctr+p unicode url http://domain.com/%d0%ba%d0%be%d0%bd%d1%82%d0%b0%d0%ba%d1%82%d1%8b

c# - Can I mark a class as not my code so the debugger steps over it? -

i have utility class has been thoroughly tested, , not want vs debugger step of methods. think have heard of way mark not code just code debugger setting causes debugger step on these method calls, life of me cannot recall class attribute (nor can google it). i know separate class own assembly , build in release mode alleviate issue, step of assembly (and keep class is). is possible, or dreaming option? update i did testing 2 options (debuggerstepthrough , debuggernonusercode), , found debuggernonusercode behaves same framework when having just code enabled / disabled. debuggerstepthrough attribute causes debugger skip section marked attribute. consistency's sake, went debuggernonusercode. you looking debuggernonusercode attribute.

silverlight - SL4 - TextTrimming in DataGridRowGroupHeader -

i'm customizing datagridrowgroupheader in our project. works fine except can't text trim. here's style: <sdk:datagrid.rowgroupheaderstyles> <style targettype="sdk:datagridrowgroupheader"> <setter property="cursor" value="arrow" /> <setter property="istabstop" value="false" /> <setter property="background" value="transparent" /> <setter property="height" value="20"/> <setter property="margin" value="18,0,20,0"/> <setter property="isenabled" value="false"/> <setter property="template"> <setter.value> <controltemplate targettype="sdk:datagridrowgroupheader">

winforms - Is there a limit to how many OpenGL rendering contexts you can create simultaneously? -

my .net winforms application creates 3 opengl rendering contexts in main window, , allows user popup other windows each window has 2 more rendering contexts (using splitter). @ around 26th rendering context, things start go slow. instead of taking few milliseconds render frame, new rendering context takes between 5 , 10 seconds. still works, slow! , opengl not return errors (glgeterror). the other windows work fine. new rendering contexts after number slow down. if close windows, fine -- until reopen enough windows pass limit. each rendering context has own thread, , each 1 uses simple shader. slow down appears happen when upload texture. size of texture has no effect on how many contexts can create, nor size of opengl window. i'm running on nvidia cards , see on different gpu's different amounts of memory , different driver versions. what's deal? there limit how many rendering contexts application can create? does else have application lots of rendering contexts

python - How to make a field non modifiable on edit page but able to create on add page -

i have scenario given below: in models.py class room(models.model): pop = models.foreignkey('pop', verbose_name="pop", help_text="pop room belongs to", null=true, blank=true) .... other fields .... class pop(models.model): .... fields .... in admin.py class roomadmin(admin.modeladmin): search_fields = [..some fields...] list_diplay = (pop, ....) ..... other configuration ..... since room has foreign key relationship pop, possible associate multiple rooms 1 pop. have t o implement this. when user clicks on "add pop" link django admin page, user should allowed associate multiple room objects pop object. once room objects have been associated pop, can neither edited nor can associated pop edit screen. possible achieve this? i have these possible solutions don't know how implement these ideas in django or if these ideas viable: css magic. can associ