Posts

Showing posts from April, 2010

prototype - Rails not submitting form values -

working on old app uses rails/prototype view helpers/rjs extensively. have recurring problem (happens half dozen times week, on same pages) form params not getting submitted. controllers point of view, params hash contains values router able pick route. looking @ forms themselves, tend basic. one thing in common use remote_form_for, has form disabling code runs after prototype kicks off ajax. in few places, more explicit, (uses ancient syntax, started rails 1 app): remote_form_for :pallet_move, :row_id => 'new_pallet_move', :html => {:id => 'new_pallet_move_form'}, :method => :post, :after => "$('new_pallet_move_form').disable();', :url => create_many_pallet_moves_path |f| in controller, doing this palletmove.new params[:pallet_move].merge(:move => move) now, code works like, 99% of time. according hoptoad, ten times in last month, nomethoderror: undefined method 'merge' nil:nilclass params {...

javascript - JQuery addClass opacity function fade through images - Solve a Fiddle -

this function uses jquery , ui fade images through 1 in gallery. getting strange results. on our site appears images not timing correctly , fading seemingly intimitantly. anyway built fiddle http://jsfiddle.net/tggc5/17/ this fiddle not function @ all, ie. nothing happens yet far can see has resources needs. can solve fiddle - images should fade smoothly through each other creating lovely transition effect. any ideas? marvellous update - getting there still not quite http://jsfiddle.net/tggc5/39/ watch transition between last slide , first one. static not fading through. when thumbnail clicked needs perform function , reset timer. any ideas? here: http://jsfiddle.net/7qrbe/ some mistakes corrected: no need set opacity changing class, use hide / fadein / fadeout remember cleartimeout using global var, or else timer override real clicks first() don't work in case, call '.thumbs.first' had reformulate condition of loop end (checking ...

python - How to improve performance of this recursive function? -

i'm trying write function search str substr, taking account different possibilities write weird letters, such æ, ø, å in danish language. example can search 'Ålborg' , function return true if there is, 'aalborg' in str. the function below works, performance unbearable. recommend improve performance? def danish_tolerating_search(substr, str): '''figure out if substr in str, taking account possible deviations in writing letters æ, ø, å. æ <-> ae ea ø <-> oe o å <-> aa o ''' # normalize input substr = substr.lower().replace('aa',u'å') str = str.lower() # normalized recursive search # todo fix perfomance def s(substr, str): if str.find(substr) >= 0: return true if substr.find(u'æ') >= 0: if s(substr.replace(u'æ','ae', 1), str): return true elif s(substr.replace(u'æ', ...

C++ problem with Datagram (UDP)winsocket to sendto and recvfrom on the same socket through the loopback adapter -

i trying send data udp socket , receive them on same socket through windows loopback adatper. in network properties set loopback adapter have following ip 192.168.1.1 the recvfrom function returns -1 indicating error. monitor traffic on loopback adapter wireshark , nothing seem sent loopback adapter, see no trafic. is true on windows can't use loopback address(127.0.0.1) ? saw on forums, why try use loopback adapter. tried send directly own ip, gives no better results. btw possible send own ip , data back? i appreciate , in case, new socket programming. below code: #define dst "192.168.1.1" int _tmain(int argc, char* argv[]) { int numbytes; int bytes_sent; int server_sock; char send_msg[100]; int send_msg_length = 100; char rcv_msg[100] = { 0 }; int rcv_msg_length = 100; int i; wsadata wsadata; if(wsastartup(makeword(2, 2), &wsadata) != 0) { fprintf(stderr, "wsastartup failed.\n"); return 1; } sockaddr_in t...

ruby on rails - Change JSON formatting -

the following 2 pages provide same json object. possible have facebook style json formatting rails application?? desired formatting: https://graph.facebook.com/19292868552 my application formatting: http://sframework.heroku.com/api/graphs thanks ruby json library has pretty_generate function. require 'json' puts json.pretty_generate(fbjson)

Duplex WCF service channels continuously alive (WSDualHttpBinding) -

the arhitecture: console application contains wcf duplex service; windows app consumers; every app subscribe duplex, have list of subscribers , service must send notifications of them in case events apper; the problem: how maintain connection alive continuously service can send notifications clients ? i found there 2 channels binding. need have permanently channel service (for callbacks) open. thanks; as long client connected service, callback channel alive. once client disconnects (or channel gets faulted), callback channel close.

Scale text in WPF -

how can automatically scale text inside control based on control's size make sure it's readable (that is, want font size stays between 9pt , 30pt) try use scaletransform. in order understand how calculate scale size may refer http://social.msdn.microsoft.com/forums/en-us/wpf/thread/d73c9eb2-9c68-428d-b99b-d23d0c62c095/

android - How would one scan another app (like an antivirus app does)? -

i wondering how antivirus apps - lookout mobile security, example - able scan other apps determine if malicious. specifically, api calls or permissions used this? thanks. check out class android.content.pm.packagemanager. class overview class retrieving various kinds of information related application packages installed on device. can find class through getpackagemanager(). barry

java - Load a config file into the classpath while using an executable jar -

i building assembly in maven command line utility. can run executable jar, fails because need load config file externally. assuming following config, how run jar? jar in /opt/myapp/lib/myapp-assembly.jar config in /etc/myapp/config/settings.xml i'm loading code classpath using classpathresource("/settings.xml"); any appreciated! i see 2 ways it: launch program using jar archive rather executable jar, specifying main class @ run time. in other words, java -classpath /opt/myapp/lib/myapp-assembly.jar:/etc/myapp/config [name of main class]. use class-path field of jar manifest file. entries in directly added run time classpath, , there's nothing stopping specifying filesystem directory rather jar file. manifest contain: class-path: /etc/myapp/config/

SQL Server Compact Edition 3.5 Redistribution Agreement -

i'm trying sign redistribute sql server compact edition 3.5 cannot seem find page register redistribution. found link http://www.microsoft.com/sql/editions/compact/redistribute.mspx posted directs me homepage . if go 4.0 download page there link sql server compact redistribution site , goes same homepage . had use 4.0 page because cannot seem find 3.5 page , links 1 : www.microsoft.com/sqlserver/2005/en/us/compact.aspx go same homepage. does have working link can register? have register? found sql server compact 2005 datasheet , in says: sql server compact edition free download, develop, , deploy applications. sql server compact edition free third parties redistribute. with footnote says: a simple redistribution agreement must signed online. but if go 4.0 download page says: sql server compact 4.0 freely redistributable under redistribution license agreement , application developers redistributing sql server compact 4.0 can opti...

types - Is there a difference between DB_DOUBLE and dbDouble? -

i've started new work , i've got manage, maintain (and feel sorry for) ms-access databases , application. i must normalize, batch-copy db original files new model. when "select cas-ing" read data-types, i'm offered 2 choices each , every data-type; dbdouble , db_double, dbdecimal , db_decimal, etc. anyone knows why two? thanks feeding curiosity! db_* deprecated constants part of access object model , provided backward compatibility. dbdouble , others part of dao object model: ?access.oldconstants.db_double 7 ?dao.datatypeenum.dbdouble 7 i'm guessing (all?) constants same, should confirm either via object browser ( f2 in ide) or immediate window ( ctrl + g ). in case, stick dao constants because others deprecated.

C# - Replace text mid-string and keep the rest of the string, duplicate lines -

i have 2 .txt documents , search in 1 of them keys secoond file. if keys found, want replace match text follows key in second file. also, add "t" or "b" depending on number in file. here example of first file: 1 0010 sometext/numbers text, text .2 0020 sometext/numbers text, text, text 1 0020a sometext/numbers text,text .1 2000 sometext/numbers text,text, text ..3 9123a sometext/numbers text ... ... ... ... here example of second file: 0010 abcd efg 0020 c01 0020a c02, c3, c004, c9901, c938, c12 2000 r123, r13, d34 9123a sometext ... ... from these 2 files, use "keys" second file (at start of every new line). in example keys be: 0010, 0020, 0020a, 2000, 9123a. after have keys want search first text document in second column see if there match. if there match (in case match) replace text in first document , create new...

ruby - Rails Render Action With Different Format -

say have application#search method respond ajax requests. inside of js view (app/views/application/search.js.erb) render html view: $("#content").html( escape_javascript( render( :action => 'search', :format => 'html' ) ) ); $("#title").html( "title" ); i know move things partial , render in both html , js views, problem have many different actions need respond in way , i'd prefer not creating bunch of 1-line view files render partial. is there way explicitly render action specific format , grab different parts of content_for well? above example, set #title html returned content_for :title or something. i'm not sure outputting bunch of html js source great design, wasn't question -- , i've had similar things output html snippets rendered templates xml, consider more reasonable :). anyhow, there several things in question. it changes version version of rails, in rails 4.x, think should work, close...

java - getting the gps position not working -

i dont know why, unable gps position... lm.getlastknownlocation returns null , onlocationchanged never called. can see gps icon on system tray. any ideas? package com.localfotos; import java.io.bufferedoutputstream; import java.io.bufferedreader; import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.net.malformedurlexception; import java.net.url; import java.net.urlconnection; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.client.httpclient; import org.apache.http.client.methods.httppost; import org.apache.http.impl.client.defaulthttpclient; import org.json.jsonexception; import org.json.jsonobject; import android.content.context; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.graphics.canvas; import android.graphics.matrix; import android.graphics.paint; import android.location.location...

winforms - How can I make a notifyicon in C# alternate between two icons? -

im using vs2010 c# , winform. when condition met, notifyicon in c# alternate between 2 icons. see code below created single icon can't see how programmatically change it. "((system.drawing.icon)(resources.getobject("notifyicon.icon")))" part doesn't make sense me. notifyicon.icon = ((system.drawing.icon)(resources.getobject("notifyicon.icon"))); i tried... notifyicon.icon = (system.drawing.icon(application.startuppath + @"\noneed.ico")); but wont work. error "system.drawing.icon' 'type', not valid in given context" thanks help you forget add new keyword: notifyicon.icon = new system.drawing.icon( application.startuppath + @"\noneed.ico" );

How can I polymorphic deserialization Json String using Java and Jackson Library? -

i've classes a, b, c inherit class baseclass. i've string json contains json representation of a, b, c or baseclass. i want have way deserialize string baseclass (polymorphic deserialization). this baseclass base = objectmapper.readvalue(jsonstring, baseclass.class); jsonstring json string representation of of a, b, c, or baseclass. it's not clear problem original poster having. i'm guessing it's 1 of 2 things: deserialization problems unbound json elements, because json contains elements there nothing in java bind to; or want implement polymorphic deserialization. here's solution first problem. import static org.codehaus.jackson.map.deserializationconfig.feature.fail_on_unknown_properties; import org.codehaus.jackson.map.objectmapper; public class foo { public static void main(string[] args) throws exception { baseclass base = new baseclass(); a = new a(); b b = new b(); c c = new c(); objectmapper mapp...

java - Apache Velocity "generic" macro -

we using velocity generate report of results of processing recurring task. pass in list of processed packages , associated results. #foreach($pkg in $packages) <tr> <td>$pkg.name</td> <td>$pkg.numitems</td> <td>$pkg.processingtime</td> <td>$pkg.numerrors</td> </tr> #end now want include summary, i.e. want sum different results. though using "generic" macros can pass list and name of attribute should summed up. like: #macro(sum $list $attribute) #set($total=0) #foreach($item in $list) #set($total =$total+$item.$attribute) #end $total #end but not work - somehow possible write "generic" macro calculate sum of attribute of items of list or have either calculate them totals before calling velocity or calculate them each attribute individually? velocity isn't meant used scripting language. so #set( $total = $total+$item.$attribute ) will not work hope. if $item...

Can I create sub domain for each user in Django -

i want users create own account , users should own user.foo.com , different point different template folder. possible in django. quite new django django unaware of whatever web server using. usually, configure sub-domains, need add virtual hosts webserver's configuration , make sure dns provider forwards requests sub-domain appropriate server. to directly, you'll need run django under user account has write access webserver's configuration file, really not recommended. assuming hosts on same machine, indirectly, such queuing requests , have manually approve them , edit file, or have script run through cron , re-write server configuration every x minutes/hours/days. also, dns registration major issue. if have wildcard domain name such "*.foo.com" , you'll fine. if dns provider doesn't allow this, you'll need have register sub-domains manually. basically, none related django, , of depends on server's software stack (which hav...

jquery class selector doesn't work in IE6 -

eidt: , sorry carelessness. inittree() fails. this works fine in ff , chrome: $("#tree").treeview({ collapse:false, }); this works fine in ff chrome , ie6: $("#tree").treeview({ collapse:false //<-here key, no comma }); i have tree like: <ul id="tree"> <li>root <ul> <li>node_1_2<a class='addnode'>add</a><a class='deletenode'>delete</a> <ul> <li>node_2_4<a class='addnode'>add</a><a class='deletenode'>delete</a></li> <li>node_2_6</li> </ul> </li> </ul> </li> </ul> if click <a>add</a> , should append chid node element. like: $("a.addnode").live("click", function() { if($(this).parent().children("ul").ht...

cannot download all the characters from a url in android -

i have download json file , store text file in application. using following code: public void readandstorefile() throws exception { try { url url = new url(address); urlconnection con = url.openconnection(); int length = con.getcontentlength(); if (length > 0) { log.i("lenght of bytes received", "" + length); inputstream fis = con.getinputstream(); inputstreamreader isr = new inputstreamreader(fis); bufferedreader bf = new bufferedreader(isr); string content = new string(); string line = null; while ((line = bf.readline()) != null) { content += line; } fileoutputstream fos = c.openfileoutput(filename, context.mode_private); bufferedwriter bfw = new bufferedwriter(new outputstreamwriter( fos)); bfw.write(content); } else ...

html5 multiple upload along with ajax -

i trying use multiple upload attribute of html5 upload files. know wouldn't work ie , fall single file upload. found invalid html tag min max allows opera same. i trying following: browse button capable of selecting multiple files. ajax should send files 1 one. scenario this: user selects 5 files , starts upload . ajax should firstfile send first file, second, , on. server side script file , returns data. 1 file upload completed must render part of result. user selects images , starts uploading results come out each file uploaded (and not after files uploaded). i tried : function handlefiles(files) { alert(files.length); //properly returns number of files selected (var = 0; < files.length; i++) { new fileupload(files[i]) } } function fileupload(file) { var reader = new filereader(); var xhr = new xmlhttprequest(); this.xhr = xhr; xhr.open("post", "portfolio/add_media"); reader.onload = function(evt) { xhr.sendasbina...

iphone - Can Game Center's leaderboards support a "skill level"-like system? -

game center's leaderboards used high-score tracking, such tracking user's highest score in game , comparing other users' highest scores. however, if had game if player won, skilllevel went up, , if lost, skilllevel went down (for purpose of matching users other users of same skill level)? game center's leaderboards able support this, or strictly built having scores increase not decrease? you cannot delete high score. as explained here - need send them email report cheating in scores scores deleted. on page 3 of gamecenter guide pdf. as general opinion in game design, giving system this, can discourage players playing game again , again in fear of losing previous scores/accomplishments.

Project euler problem 3 in haskell -

i'm new in haskell , try solve 3 problem http://projecteuler.net/ . the prime factors of 13195 5, 7, 13 , 29. largest prime factor of number 600851475143 ? my solution: import data.list getd :: int -> int getd x = -- find deviders let derivelist = filter (\y -> (x `mod` y) == 0) [1 .. x] filteredlist = filter issimplenumber derivelist in maximum filteredlist -- check nmber simple issimplenumber :: int -> bool issimplenumber x = let derivelist = map (\y -> (x `mod` y)) [1 .. x] filterlength = length ( filter (\z -> z == 0) derivelist) in case filterlength of 2 -> true _ -> false i try run example: getd 13195 > 29 but when try: getd 600851475143 i error exception: prelude.maximum: empty list why? thank @barry brown, think must use: getd :: integer -> integer but error: couldn't match...

objective c - how can i transfer a file from one iphone to another iphone/ipad device without using a server -

can suggest me method of how send/share file 1 iphone/ipad device another. possible achieve using bonjour. thanks in advance. you can use gamekit api send data between peers on bluetooth connection. gksession has following method : - (void) mysenddatatopeers: (nsdata *) data { [session senddatatoallpeers: data withdatamode: gksenddatareliable error: nil]; }

sorting - How to sort IP addresses stored in dictionary in Python? -

i have piece of code looks this: ipcount = defaultdict(int) logline in loglines: date, serverip, clientip = logline.split(" ") ipcount[clientip] += 1 clientip, hitcount in sorted(ipcount.items), key=operator.itemgetter(0)): print(clientip) and kind of sorts ip's, this: 192.168.102.105 192.168.204.111 192.168.99.11 which not enough since not recognize 99 smaller number 102 or 204. output this: 192.168.99.11 192.168.102.105 192.168.204.111 i found this , not sure how implement in code, or if possible since use dictionary. options here? thank you.. you can use custom key function return sortable representation of strings: def split_ip(ip): """split ip address given string 4-tuple of integers.""" return tuple(int(part) part in ip.split('.')) def my_key(item): return split_ip(item[0]) items = sorted(ipcount.items(), key=my_key) the split_ip() function takes ip address string '1...

Compute and edit multiple attributes in a single jQuery call -

i need compute new , edit both 'x' , 'y' attributes of svg element (rect) using single jquery call. now know can this: var incby = 20; $('#test').attr('x', function(i, val) { return parseint(val) + incby; }); which fine computing , editing single attributes, how can edit multiple attributes in way? if factor out, can in 1 line: $('#test').attr('x', myfunction).attr('y', myfunction); function myfunction(i, val) { return parseint(val) + incby; } or abstract more , pass separate function attributes want apply to process('x', 'y'); function process() { (var = 0; < process.arguments.length; i++) $('test').attr(process.arguments[i]), myfunction); function myfunction(i, val) { return parseint(val) + incby; } } it depends on how far want go. include function called in parameters, , selection criteria too.

javascript - Get reference to a JQuery UI Accordion Header -

i have jquery accordion below; <div id="accordion"> <h3 class="ui-accordion-header"><a id="link1" href="#">first header</a></h3> <div id="div1">first content</div> <h3 class="ui-accordion-header"><a id="link2" href="#">second header</a></h3> <div id="div2">second content</div> </div> the accordion generated this: $("#accordion").accordion({ collapsible:true, active:false, navigation:true, autoheight:false, change:function(event, ui){ var index = $(this).find("h3").index(ui.newheader[0]); var header = $(this).find("h3")[index].find("a"); //<--- problem line var currentheaderid = (header.attr("id")); //<--id need } }); jsfiddle link the accordion loading fine. i'm trying achieve 2 things. 1- id of href element i...

Python does not properly process text input from an HTML textarea -

i have standard form on html page usual input types: text , select , submit . using python (the pyramid framework) process these forms has been straightforward , without issue. in particular form, though, have needed use textarea accept longer, multi-line input. when processing user input in python, i've used following code: try: some_input = request.params['form_element'].decode('utf-8') except: some_input = none this works text input, not textarea input. textarea input not processed when unicode character included, , throws following error: (<type 'exceptions.unicodeencodeerror'>, unicodeencodeerror('ascii', u'some text unicode character \u2013 , more text', 14, 15, 'ordinal not in range(128)'), <traceback object @ 0x10265ca70>) is there reason this? looks it's assuming textarea input being treated ascii instead of utf-8, i'm not sure how change this. more information: page form be...

mysql - Can node.js be integrated with php? -

is idea scaling heavy php apps ? example, how node's mysql module compare php's mysqli extension in terms of performance etc .. i'd consider wrapping php app node.js; is, having migration path of existing php being called node code, migrating php code javascript. reason being, execution model of node.js (non-blocking) doesn't play php's execution model. said, execution models can made more compatible wrapping approach; is, having node exposed server, , making appropriate php calls (re-request); can use process "migrate" "wrapped" php on node server, migrate php code node. of course, begs question of whether or not need / want this, that's determine...

CSS automatically fitting multiple divs to span to the size of a page? -

so need multiple lined divs span across page , same thing when div added. i'm not sure how can achieve this. example of is: [ div 1][ div 2][ div 3][ div 4][ div 5] and when div added won't stack below, decrease size of divs fit space. you should use display: table-cell . see: http://jsfiddle.net/2x73j/ the browser support excellent: http://caniuse.com/css-table <div class="multicontainer"> <div>div 1</div> .. </div> .multicontainer { width: 100%; display: table; background: #ccc } .multicontainer > div { display: table-cell; border: 1px dashed #f0f }

python - Create numpy array from C-ptr aquired via ctypes -

i have allocated chunk of double in c library , create numpy 1d array based on data; ideally 2 versions 1 wraps c_ptr readonly - letting c layer retain ownership of data, , 1 copies data. simplified code this: c-code double * init_and_alloc( size_t size ) { double * ptr = malloc( size * sizeof * ptr ); // initialize ptr return ptr; } python code size = 1000 c_ptr = ctypes_func_ptr_init_and_alloc( size ) numpy_array = numpy.xxxx( c_ptr , size , dtype.float64) <--- ????? so function have labelled xxxx exist? best regards joakim hove yes, numpy.ctypeslib.as_array given dtype, as_array(ptr, shape).view(dtype) . this should work, @ least in theory (don't have time test now).

Php upload and bandwidth/traffic question -

i have set upload limit 3m in php.ini. if uploads file 50 mb, upload stop when hits 3mb or continue until upload complete, reads filesize , deletes file? if you're using apache web server, php doesn't chance start until request completes. thus, upload limit comes action after whole upload finishes. apache first receives entire request, , only then invoke appropriate handler (in case, php). since there no server-side mechanism abort http request in progress and return response, you'll need wait until whole request complete. so, answer question: no , upload go through in full; php's internal logic check uploaded file size, see it's larger limit, , fail error. php script not chance run, don't rely on runtime checks - won't executed @ all.

xml - XPATH Selecting by position returns incoherent results -

i need issue can't figure out. i have following xml: <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="prueba.xsl"?> <ficha> <titulo></titulo> <bloque> <texto></texto> <pregunta id="1" tipo="checksn"> <texto>acredita curso bienestar animal minimo 20 h</texto> </pregunta> <pregunta id="2" tipo="texto"> <texto>sistemática inspección</texto> </pregunta> <grupo> <texto>trato adecuado enfermos</texto> <pregunta id="3" tipo="desplegablesnp"> <texto>recetas correspondientes</texto> </pregunta> <pregunta id="4" tipo="multiple"> <texto>disponen de comida y bebida</texto> ...

python - Name 'variable_name' used both as a parameter and as a global. How to fix? -

the code working is build_data = {} # code adds data build_data build_data_filtered = {} if flag: # code adds subset of build_data build_data_filtered global build_data build_data = build_data_filtered the line "global build_data" shows code hint in pycharm name 'build_data' used both parameter , global what can remove hint or there better approach this? why using global statement outside of function? just remove line global build_data , should work.

python - how to make multiline wx.ListBox -

i need listbox show phone book.then need show name in top , number in bottom in each list item phone.how bind datas listbox. now made listbox singleline shown below cur.execute("select fname tblsample1 order fname") names = [str(item[0]) item in cur.fetchall()] lvnames=wx.listbox(panel,-1,(10,40),(210,180),names, wx.lb_single) how bind sqlite3 cursor 2 columns listview i need wx.listbox mouse click event(not evt_listbox because need mouse click event) use htmllistbox , here little example started. import wx class phonenumbers(wx.htmllistbox): def __init__(self, parent): wx.htmllistbox.__init__(self, parent) self.data = [ ("foo", "3452-453"), ("bar", "5672-346"), ] self.setitemcount(len(self.data)) def ongetitem(self, n): return "<b>%s</b><br>%s" % self.data[n] def add_number(self, name, number)...

database - DB Design for high amount of data (20 millions rows / day) -

we looking create software receive log files high number of devices. looking around 20 million rows day log (2kb / each each log line). i have developed lot of software never large quantity of input data. data needs searchable, sortable, groupable source ip, dest ip, alert level etc. it should combining similiar log entries (occured 6 times etc..) any ideas , suggestions on type of design, database , general thinking around appreciated. update: found presentation, seems similar scenario, thoughts on this? http://skillsmatter.com/podcast/cloud-grid/mongodb-humongous-data-at-server-density i see couple of things may want consider. 1) message queue - drop log line , let other part (worker) of system take care of when time permits 2) nosql - reddis, mongodb,cassandra i think real problem in querying data , not in storing. also need scalable solution. of nosql databases distributed may need that.

iphone - display problem in UIView iPad -

i have small application ipad, portrait mode locked in application, problem occurs when turn down ipad, display of application not running down can me?? you should implement below method in of viewcontrollers. - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { if(interfaceorientation==uiinterfaceorientationportraitupsidedown || interfaceorientation==uiinterfaceorientationportrait) { return yes; } return no; } hope help.

javascript - web crawler/spider to fetch ajax based link -

i want create web crawler/spider iteratively fetch links in webpage including javascript-based links (ajax), catalog of objects on page, build , maintain site hierarchy. question is: which language/technology should better (to fetch javascript-based links)? is there open source tools there? thanks brajesh you can automate browser. example, have @ http://watir.com/

python - Page switching using AJAX in Django -

i trying create site navigation using ajax. have navigation menu links different views (using {% url name %} in template). thing trying load page content using ajax. page content trying load enclosed in content block ( {% block content %} ). i found snippet http://djangosnippets.org/snippets/942/ , want use views have defined , content using ajax. any suggestions? you should use django-pjax built kind of thing. all have to, in base template, include whole page or block content based on whether request ajax or not. django-pjax ajax calls using jquery , manipulates history using html5 push state api, way , gracefully degrades in ie older versions.

CSS Sprites Automation -

recently dealed css sprites. it's working fine. i created sprite, .css-file , html-structure. looks like .sprites{ background-image:url('../img/sprite.png'); background-color:transparent; background-repeat:no-repeat; height:44px; width:44px; } .pic1 {background-position:0 0;} .pic2 {background-position:-44px 0;} <div class="outer"><div class="sprites ${image}"></div></div> ${image} chooses class if condition true. i create sprite, css , html manually. have used generator, code have been same. is there way create sprites , css autmatically e.g. java? if there folder 50 images program -which has written guess- shall create sprite , relevant css-attributes itself. possible? have heard of such program yet? it possible .

xcode - ios app does not show the data in the tableview -

i followed tutorial here http://www.techotopia.com/index.php/creating_a_simple_ios_4_iphone_table_view_application reason, white screen. table not show. any ideas why might happening? i have added line show view [window addsubview:self.viewcontroller.view]; [self.window makekeyandvisible]; so sure table should visible. where self.viewcontroller assigned? if putting in nib, did hook iboutlet ? nslog(@"%@", self.viewcontroller"); say?

java - android : How to know about a new process start in device? -

i writing program respond when new process got start. private final broadcastreceiver mbatinforeceiver = new broadcastreceiver() { @override public void onreceive(context arg0, intent intent) { // write here } }; i not know write instead of comments processes info. thanks. you can't monitor process starts using broadcastreceiver. should @ this : have run in loop, that's best bet.

erlang - What is the best programming language to implement neural networks? -

i'm not looking neural networks library, since i'm creating new kinds of networks. need "dataflow" language. of course can in c, c++, java , co. dealing scratch multithreading etc. nightmare. at other extremity, languages oz or erlang seem more adapted, don't have many libraries, , harder master (it's easy play them, ok create complete software ?). what suggest ? i watched interesting conference presentation using erlang neural networks. might want check out: from telecom networks neural networks; erlang, unintentional neural network programming language i know presented system going open-sourced day according the authors tweet .

Drupal theme for specific taxonomy -

hi new theming of drupal 6 want let on http://abc.com , theme garland want when go http://abc.com/me/mypage theme of page should different previous. in other words: i have 2 pages node/12321 , node/1231 want apply custom theme on them not garland theme how can remove style sheet of garland theme , add custom style sheets without modifyng page-node-xxxx.tpl.php page have make search on it says preprocessing page unable understand. plus, how can apply theme page specific taxonomy? take @ themekey module. allows change theme depending on path, taxonomy, , more. themekey project page: themekey allows define simple or sophisticated theme-switching rules allow automatic selection of theme depending on current path , taxonomy terms , language, node-type, , many, many other properties. can extended support additional properties exposed other modules. in combination drupal's theme inheritance , themekey properties can achieve features like: ...

javascript - Converting jquery code to prototype for a cross browser Ajax request in order to obtain Latest Tweets -

converting jquery code prototype cross browser ajax request my first post ! i had fetch latest tweet , had perform cross browser request. current app uses prototype, familiar jquery. so, began in jquery : $.ajax('http://twitter.com/status/user_timeline/apocalyptic_ab.json?count=1&callback=?', { datatype: "jsonp", success:function(data,text,xhqr){ $.each(data, function(i, item) { console.log(item.text); }); } }); i warning : 'resource interpreted script transferred mime type application/json.' but, see last tweet. fine. so, decided same in prototype , try eliminating warnings, if any. but, got near after trying hours. this came in prototype. had lot of changes/alterations followed none worked. new ajax.request('http://twitter.com/status/user_timeline/apocalyptic_ab.json?count=1&callback=?', { contenttype: "jsonp", onsuccess:function(transport){ console.log(transport) ; } }); the r...