Posts

Showing posts from March, 2013

link to another .html file via javascript -

is possible retrieve div id file via javascript 1 file. example: lets editing index.html , want retrieve id, using getelemntbyid page2.html. i understand can use document.getelementbyid; if want id same document, there can use document? thanks in advance you have make ajax call page2 first. paste response of xmlhttpobject in invisible div. then required div want retrieve.

Django orm query help -

employee class has id, first_name, last_name, , lot more fields. i want select employees not have same last_name, it's distinct in sql, how that? employees = employee.objects.value('last_name').distinct() include last_name, cannot find id. if employees = employee.objects.value('id', 'last_name').distinct() results.count() looks different. that's because may have employees same last name. when add 'id' in query, ask distincts rows based on 2 criterias, , have distinct id. clear ?...

What is an XML Namespace, and what does it have to do with Spring Transactions? -

i went through spring transaction tutorial mentions there elements available declarative transaction management , defined in tx namespace. tx namespace contain. defined, registered etc? why need namespace? i want know in general namespaces not specific tx namespace. an xml namespace token that, lack of better description, identifies "version" particular tag or attribute is. idea prevent conflicts if, instance, you're using xml elements defined multiple people/programs/standards bodies/etc. instance, program write uses xml might use namespace http://www.ttdi.us/xml/myapp . then, can define tags <name> without worrying somewhere else, might using <name> own purposes: <thing xmlns="http://www.ttdi.us/xml/myapp" xmlns:pie="http://somebodyelse.example/delicious/pie"> <!-- defines have "thing" in namespace "http://www.ttdi.us/xml/myapp" --> <!-- says prefix pie: different na...

Silverlight C# - How to hold loop progress until an event completes? -

i'm trying loop through text in textbox word in order spellcheck it. i've split contents of textbox array, , loop through each word in array , run through spellchecker. when misspelling found, have popup listbox inside display can choose correction. the issue i'm having, loops through whole array , ends showing last correction needs done. how pause loop waits selection made , resume? here's code loop: foreach(string checkedword in articlewords) { bool success = _spellchecker.checkword(checkedword); list<string> suggest; if (!success) { suggest = _spellchecker.getsuggestions(checkedword); spellchecklistbox.items.clear(); foreach (string s in suggest) { spellchecklistbox.items.add(new listboxitem() { content = s }); } spellcheckerpopup.isopen = true; spellchecklist...

java - instant searching in petabyte of data -

i need search on petabyte of data in csv formate files. after indexing using lucene, size of indexing file doubler original file. possible reduce indexed file size??? how distribute lucene index files in hadoop , how use in searching environment? or necessary, should use solr distribute lucene index??? requirement doing instant search on petabyte of files.... any decent off shelf search engine (like lucene) should able provide search functionality on size of data have. may have bit of work front design indexes , configure how search works, config. you won't instant results might able very quick results. speed depend on how set , kind of hardware run on. you mention indexes larger original data. expected. indexing includes form of denormalisation. size of indexes trade off speed; more ways slice , dice data in advance, quicker find references. lastly mention distributing indexes, not want do. practicalities of distributing many petabytes of data pretty daunting....

.net - I want to use Google Places API using ASP.Net -

i want use google places api in web page, want show searched places in gridview. any appreciated. you can use google geo kit, @ moment alpha version, works pretty good: http://gglgeo.codeplex.com/wikipage?title=google%20places%20api

c++ - QTest - Unable to pass Qt::Enter to QPushButton -

i'm creating automated test application using qtest library. i'm able simulate key presses on application except when gets window having qdialogbuttonbox (save, , cancel). here's sample code: std::auto_ptr<mainform> myform( new mainform( 3, 3 )); myform->show(); qtest::keypress(myform.get(), qt::key_0, null, 1000); qtest::keyrelease(myform.get(), qt::key_0, null, 100); qwidget *pwin = qapplication::activewindow(); qcompare(qstring(pwin->objectname()), qstring("mymainform")); now when gets next window, has several controls input focus on text edit control. when press enter, presses "save" button. theoretically, if should pass qt::enter form, should press "save" button well. when try pass keypress: qtest::keypress(pwin, qt::key_enter, 1000); nothing happens... think going on? i've tried setfocus() button nothing happens well... in qdialogbuttonbox may needed button with qpushbutton * qdialogbuttonbox:...

symfony1 - allow users to change their own password, email and Profile -

i'm creating own blog engine learn symfony, , have question : i can add , edit users sfguarduser module, how can allow users edit reccord ? users should have access page allowing them edit email, name, password, , profile. any ideas ? in action profile updated retrieve users object via getid() method , apply changes on returning object. $user = sfguarduserpeer::retrievebypk( $this->getuser()->getguarduser()->getid() );

internet explorer - CSS simple float left problem in IE compatability mode -

i'm trying 2 boxes side side (a 200px left menu, , next 100% remaining width main content area). it works fine in browsers, lot of our clients using ie6 (nothing can unfortunatly), must support ie compatability mode. unfortunatly, simple css not work! can me without me needing resort tables? relevant css: .clear { clear:both; } /* left menu */ .leftmenu{ width: 200px; border:1px solid green; height:100px; float:left; } /* main content area */ .mainbox{ width:100%; border:1px solid red; } .mainwrapper{ } <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title> </title><link rel="stylesheet" type="text/css" href="css/default.css" /></head> <body> <form name="form1" method="post...

Fetching news in android -

i want fetch news web in android. searched sample example in google not able find source code. can 1 explain logic beyond fetching news in android? ibm host plethora of tutorials. this tutorial explains quite , provides source: http://www.ibm.com/developerworks/xml/tutorials/x-androidrss/index.html

Asp.net: can not debug this problem: Sys.ArgumentNullException: Value cannot be null. Parameter name: elements -

it strange, got problem: sys.argumentnullexception: value cannot null. parameter name: elements. this problem happens in ie. details: scriptresource.axd = line: 4868 code: 0 - char: 12 webpage error details user agent: mozilla/4.0 (compatible; msie 8.0; windows nt 6.1; trident/4.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; infopath.2; .net4.0c; .net4.0e; asktbbt4/5.8.0.12304) timestamp: tue, 25 jan 2011 11:24:42 utc message: sys.argumentnullexception: value cannot null. parameter name: elements line: 4868 char: 12 code: 0 uri: http://asdfsdf/scriptresource.axd?d=7nwonzl2vmauvpybpy_0vvp2zscf0g8yk4dd3sknmq873hwvodhne7rpvjfzwflm0&t=11e661nl.js thanks in advance! changing scriptmode release fixed me. <asp:scriptmanager id="scriptmanager1" runat="server" scriptmode="release"></asp:scriptmanager>

asp.net mvc 3 - setValidationValues in jquery.validate.unobtrusive not available outside file? -

i extending mvc 3 validation using custom validationattributes on server side , have implemented iclientvalidatable output html5 data attributes custom validation. used jquery.validator.addmethod add client side validation. final task write adapter converts html5 data attributes format jquery validator understands. validation takes in several values need use jquery.validator.unobtrusive.adapters.add rather 1 of more straightforward functions such addsingleval. within adapter, useful use several of functions in jquery.validate.unobtrusive file such setvalidationvalues , getmodelprefix if not mistaken, these function inside closure making them available within closure. not want put custom functions in microsoft owned script file may change, unless has ideas, forced replicate these functions in own file not ideal. so ideas , other people do? i afraid not. know these functions implement this: (function ($) { ... function setvalidationvalues(options, rulename, ...

iphone - MFMailComposer view does not suit with the color theme of my app -

does know how can send mail without presenting mfmailcomposerview? or is there way can add background image on mfmailcomposerview? i tried changing backgroud color. doesn't work. thing change navigationbar tint color code: mfmailcomposeviewcontroller *picker = [[mfmailcomposeviewcontroller alloc] init]; picker.mailcomposedelegate = self; picker.navigationbar.tintcolor=[uicolor blackcolor]; picker.view.backgroundcolor=[uicolor browncolor]; thanks in advance! from apple documentation: important: mail composition interface not customizable , must not modified application. in addition, after presenting interface, application not allowed make further changes email content. user may still edit content using interface, programmatic changes ignored. thus, must set values of content fields before presenting interface.

asp.net mvc - MVC - Redirect inside the Constructor -

i know how able redirect request inside controller constructor if need it?. for example: inside constructor need initialize object dynamic value, in cases don't want , in case want redirect other place. @ same way rest of constructor not executed neither "original following action". how can it? thank you edit #1 initially used: public override void onactionexecuting(actionexecutingcontext filtercontext) there redirect other controller/action/url, later in time, needed change controller, initialize variable in constructor , have code needs redirect request :p i need because onactionexecuting executes after controller constructor. , in logic, redirect needs done there. performing redirects inside controller constructor not practice because context might not initialized. standard practice write custom action attribute , override onactionexecuting method , perform redirect inside. example: public class redirectingactionattribute : actionfilt...

c# - Hide/show part of the window with a button click -

i have simple form containing main view , text boxes , "add" button use adding data displayed in main view (and stored in text file). want add little button toggle hiding/showing of adding controls. such button small square containing 2 arrowheads pointing up/down depending on state. how do that? (i'm sorry terrible title, don't know proper name this. tell me?) i don't think there's built-in in winforms that. when needed similar, changed height of form...

c# - lookupedit select by value, devexpress -

is possible select element in lookupedit value ? have valuemeber set , want select elelemnt specified value :) thanks help, bye set editor's editvalue property required value select required element.

Advice needed on WPF TreeView and lazy load databinding with NHibernate -

i'm working on project need provide treeviews users. far i've managed business objects , persistence database functional. i'm using nhibernate sqlite3 store objects. business object follows: public class errorobject { public virtual int id { get; set; } public virtual string description { get; set; } private ilist<errorobject> _errorobjects = new list<errorobject>(); public virtual ilist<errorobject> errorobjects { { return _errorobjects; } set { _errorobjects = value; } } } i'm binding treeview this: <treeview itemssource="{binding errorobjects}"> <treeview.itemtemplate> <hierarchicaldatatemplate datatype="{x:type datamodel:errorobject}" itemssource="{binding errorobjects}"> <textblock text="{binding path=description}" /> </hierarchicaldatatemplate> </treevi...

inverse kinematics - Practical uses of Flash IK classes (IKArmature, IKBone, IKJoint, IKMover) -

are there practical examples of flash inverse kinematics classes (ikarmature, ikbone, ikjoint, ikmover?) i have seen examples on web of how use these classes, not sure come use...it seems more straightforward use bone tool add bones, use poses pose doll, , use frame labels animate poses. that, or, use bone tool , switch "runtime" make bones interactive. it's other tool in flash really, if have use it, use it. we used on homepage of strange & dawson because wanted robot arm... it's natural fit. animation without using ik have been nightmare or @ least involved preset animations. ik let control arm dynamically have more organic behaviour. that said, it's still pretty buggy can struggle coding against armature have fun , see uses imagination can come with!

java - JSF - Application Memory usage at around 1GB -

i have developed jsf application , running funny behavior in lot of things such navigation not work , apache randomly lock up. i started checking memory usage , application using 1gb memory run. seemed lot have no idea first jsf application. 1 user (one session) hitting application. could there memory leak? else? can start try , figure out going on? choose bean scope minimum possible. under life cycle , select scope. it seems putting many data in session or application scope mistake. check jsf-best practices & jsf performance tuning

c - How to stop and continue a pthread? -

i'm coding in c (actually in ooc compiled c). how instruct thread wait @ particular checkpoint until other thread tells continue? i'm using tight loop in thread , polling variable i'm changing main thread, think not performing, right? besides that, when tight loop in thread, should include sleep in loop avoid consuming cpu power looping? it seems looking pthread_cond_wait , related functions. here quote manpage example: consider 2 shared variables x , y, protected mutex mut, , condition variable cond signaled whenever x becomes greater y. int x,y; pthread_mutex_t mut = pthread_mutex_initializer; pthread_cond_t cond = pthread_cond_initializer; waiting until x greater y performed follows: pthread_mutex_lock(&mut); while (x <= y) { pthread_cond_wait(&cond, &mut); } /* operate on x , y */ pthread_mutex_unlock(&mut); m...

multithreading - JPA and Threads in play framework -

i'm trying create multithreading server. problem following error: play.exceptions.jpaexception: jpa context not initialized. jpa entity manager automatically start when 1 or more classes annotated @javax.persistence.entity annotation found in application. what i'm trying access db new thread here's code package controllers; import java.util.iterator; import java.util.list; import models.ball; public class mainloop extends thread { @override public void run() { list<ball> balls; new ball(5,5,2,2,10,15); while (true){ balls = ball.all().fetch(); //here throws exception (iterator iterator = balls.iterator(); iterator.hasnext();) { ball ball = (ball) iterator.next(); ball.applyforces(); } } } } any ideas? don't use plain thread, use jobs instead : @onapplicationstart public class mainloop extends job { public void dojob() { new balljob().now(); } ...

Create a temporary file, then upload it using FTP (Java webapp) -

users of web application have option start process generates csv file (populated data database) , uploads ftp server (and department read file there). i'm trying figure out how best implement this. use commons net ftp functionality. offers 2 ways upload data ftp server: storefile(string remote, inputstream local) storefilestream(string remote) it can take while generate csv data think keeping connection open whole time (storefilestream) not best way. that's why want generate temporary file, populate , transfer it. what best way generate temporary file in webapp? safe , recommended use file.createtempfile ? as long don't create thousands of csv files concurrently upload-time doesn't matter point of view. databases output data row row , if format need csv file recommend not use temporary files @ - conversion on-the-fly: create inputstream implementation reads database data row row, converts csv , publish data via it's read() methods. btw: me...

algorithm - Balanced spanning tree (T) from undirected graph -

i have connected undirected graph. looking way construct balanced spanning tree (t) of graph the specific balanced spanning tree, define follows: if root of tree r .all nodes divided levels.i.e nodes distance r (in t) j in level lj,etc. for each node w 1 can define sub-tree t_w of t,such w root. the goal define spanning tree in such way each level li,for every 2 nodes u , v in level li number of nodes in t_u , t_v maximally equivalent. does can advice algorithm/s building such “relatively” balanced spanning tree? thank in advance. i not sure expression "maximally equivalent." this problem may not have perfect solution, obvious thing how better can do? this problem in generality seems np-complete. greedy approaches might result in constant approx algorithms, if lucky.

android xml Layout issue -

i spent hours on this, layout issue. can tell me how show both image , view switcher in same activity. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:myapp="http://schemas.android.com/apk/res/rg.client.muscle" android:layout_width="fill_parent" android:layout_height="fil_parent"> <viewswitcher android:id="@+id/relative" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true"> <!-- contains 2 relative layouts of same sizes containing same elements switched positions --> <relativelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" > <co...

join - MySQL count of grandchild table returning different results -

i developing php forum. forum uses 4 database tables: forum, thread, post, user. on landing page, have listing of forums, plus columns latest thread (achieved via join , inner join), total threas (simple count subquery), , total posts. i have fair-sized query returns of above, , working quite nicely - except total posts. the main query thus: select f.id forum_id, f.name forum_name, f.description, t.forum_id, #this subquery counts total threads in each forum (select count(t.forum_id) thread t t.forum_id = f.id ) total_threads, #this query counts total posts each forum (select count( p.id ) post p p.thread_id = t.id , t.forum_id = f.id group f.id) total_posts, t.id thread_id, t.name thread_name, t.forum_id parent_forum, t.user_id, t.date_created, u.id user_id, u.username forum f # join finds latest threads of each forum join (select forum_id, max(date_created) latest thread group forum_id) d on d.forum_id = f.id #and inner join grabs...

timer - Objective c: passing an NSTimer with a button -

how pass nstimer have declared timer down method being called button? [stickfig addtarget:self action:@selector(tapfig:andtime:) forcontrolevents:uicontroleventtouchupinside];  sorry formatting. had ask on phone. you can not action: send button itself. inside class may want store values inside of nsdictionary. can tag buttons , use tags nsnumber key of dictionary. ex. ... //tag buttons button1.tag = 1; button2.tag = 2; button3.tag = 3; //add timers dictionary [mutabledictionary setobject:button1timer forkey:[nsnumber numberwithint:button1.tag]]; ... //action buttons -(void)tapfig:(id)sender { nstimer *timer = [mutabledictionary objectforkey:[nsnumber numberwithint:((uibutton*)sender).tag]]; }

iphone - Suggestions on program layout and storage of Cocoa program that analyzes -

short background: writing program in xcode mac, plan take parts of (conceptually, if not whole chunks of code) on iphone. involves receiving data through bluetooth external sensor (regardless of user interaction data must received). i've built simple program on mac using iobluetooth pairs , starts receiving data fine, , plan on using btstack , jailbroken iphone in order access bluetooth chip on iphone. before far want conceptually lay program out correctly, because used procedural programming , obj-c new beast me. stated, able save of code possible when move iphone (i understand there different classes views etc, see -lots- of similarities). 1) program receiving data in background (regardless of user actions - ie, once user starts program , picks bt device, data flow) , need store , analyze data before can presented user. (the question), how 1 lay out? thinking of putting of bt code in appdelegate, , having view controller (on mac 1 handles window, on iphone tab contro...

OpenGL ES texture cut from it -

i have big texture, 256*256 there 64*64 pixel textures on it. how can cut it, , use texture? just draw correct texture coordinates, example, draw quad (0,0) (64,64) texture, use texture coords (0,0) (64 / 256.0, 64 / 256.0)

css - How to put Logo & navigation in one line -

i have css , html code has 2 sections in header: 1 logo , other 1 navigation. wanted put both in same line saves space , looks better. can guide me on how can that? http://css.pastebin.com/adgmqum5 set width logo example 100px; float:left; logo remove width:100%; , float:left; #nav add overflow:hidden; #nav add clear:left; #content live example: http://jsbin.com/eyozo

Rails 3 - Helping with a Commenting Module -

class commentscontroller < applicationcontroller def create @commentable= context_object() @comment = @commentable.comments.build(params[:comment].merge(:user_id => current_user.id)) if @comment.save respond_to |format| format.js end else render :action => 'new' end end private def context_object params[:constraint][:context_type].singularize.classify.constantize.find( context_id ) end def context_id params["#{ params[:constraint][:context_type].singularize }_id"] end end this commenting module has served me ran hitch morning, possibly because of use of nested resources. essentially, have url like: /projects/3/albums/6/attachments/84 when comment on page, error: activerecord::recordnotfound (couldn't find project without id): app/controllers/comments_controller.rb:102:in `context_object' app/controllers/comments_controller.rb:14:in `create' my routes fil...

c# - how to search and highlight pdf's keyword programmatically -

i've tried 2 different component integrate pdf file in windows form application (c#). above mentionated component pdfsharp , sloppycode webbrowserex. now, both of them work fine, i'm not able search , highlight programmatically full text defining user through textbox. can give me suggest achieve purpose? thanks in advance. i found answer me when working pdfs. not sure if seen yet may you. went itextsharp. how highlight text or word in pdf file using itextsharp? hope helps.

c# - how do you remove the space -

got immutable part, miss that, all hi all, string test = "john, jane"; test.replace(" ",""); string[] tolist = test.split(',', ' ', ';'); how remove space in string or space shows potentially? why there 3 items in array , not 2? to remove space, replace empty string: test = test.replace(" ", ""); note just calling string.replace won't - strings immutable, return value of string.replace reference new string relevant replacements.

wcf - ConfigSource attribute - specifying config in two places -

we have wcf service needs deployed 200 plus customers' servers. able make portion of web.config available customization using configsource attribute so: <bindings configsource="bindings.config" /> this allows overwrite main web.config file future upgrades while not overwriting customers' own modifications sections decide externalize way. unfortunately, there's problem - according this article , "when use configsource attribute, must move entire section separate file because there no merging of element settings." means section put in external file outside of our reach upgrades , changes without having mess external files customer may have made modifications to. is there way around this? can have our cake , eat too, or have decide between having control ourselves , giving our customers flexibility? well appears there's no way around this, can 1 way or other. in end decision made use configsource , externalize portions of w...

Facebook Like button cyclically opens and closes a popup window, facebook.com/connect/connect_to_external_page_widget_loggedin -

i associated facebook account gaiaonline account; use connect accomplish this. created js button page @ fb's dedicated page: developers.facebook.com/docs/reference/plugins/like the button's code upon clicking button in xp/firefox 3.6.13, while logged gaia , fb, popup window rapidly opens , closes cyclically until process terminated. behavior not repeatable on other windows machines, macs or chrome. presumably facebook trying initiate fb login page, per third-party login process: developers.facebook.com/blog/post/312 my history identifies page "http://www.facebook.com/connect/connect_to_external_page_widget_loggedin.php?social_plugin=like&external_page_url=http%3a%2f%2ftest135.open.dev.gaiaonline.com%2fforum%2fentertainment-discussion%2fthe-roommate-what-s-the-best-thing-about-having-a-roommate%2ft.67947263%2f". a video of transpiring uploaded youtube: http://www.youtube.com/watch?v=1asj4kmnl6w what causing popup behavior, , can done fix it? ...

Compare two strings in C# -

i store 2 serialized object in 2 text file , read both , store in 2 different string, , try compare 2 strings, comparison failed more 1 time because of carriage return , new line difference in end of 1 of string, how compare both ignoring spaces or carriage returns, know can compress 2 strings , compare them, there done .net library, icomparer, i'm not sure if work me too. thank in advance jp if both values stored strings, string.trim() function take care of troublesome whitespace characters, or compare whilst replacing whitespace characters. string = "string comparison\r\n"; string b = "string comparison"; string c = a.trim(); string d = b.trim(); if (c == d) console.writeline("strings equal"); else console.writeline("strings not equal"); string e = a.replace("\r\n", ""); string f = b.replace("\r\n", ...

Making joda.DateTime a searchable property in grails -

i using joda time library in grails project. i've installed searchable plugin. have few domains important : import org.joda.time.datetime class entry { static searchable = { except = ['id', 'version'] spellcheck "include" tags component: true title boost: 2.0 datecreated boost: 2.0 } string title string content datetime datecreated datetime lastupdated } but on initialization encounter following error: unable map [entry.datecreated]. not appear suitable 'searchable property' (normally simple types strings, dates, numbers, etc), 'searchable reference' (normally domain class) or 'searchable component' (normally domain class defined component, using 'embedded' declaration). derived property (a getter method no equivalent field) defined 'def'? try defining more specific return type my question: possible make datecreated and/or lastupdat...

java - Essential Swing libraries? JGoodies, JFreeChart -

the wheel invented on , on again - @ least seems when looking @ average swing gui project. in many areas there 1 or 2 known libraries things not directly addressed standard class library, e.g. hibernate persistence. but things seem little less clear gui applications - libraries see essential new gui project? i'd propose jgoodies start. , involving displaying data graphically maybe jfreechart. more sophisticated components swingx - have never used hear mentioned. i know there alternatives swing lets stick @ least question. glazed lists sorting , filtering lists , tables xhtmlrenderer (flying saucer) better xhtml , css 2.1 support swingx have mentioned, jxcollapsiblepane alone

entity framework 4 - What is the best approach when trying to use POCO with EF4? -

i have read here 3 approaches towards implementing poco entity framework namely create edmx model , turn off code generation model not create heavy entities you. create poco classes have follow restrictions. you can use poco template can downloaded vs 2010. use code first approach code pocos , define mapping in code. need ef 4.0 feature ctp here . i going opt second approach quicker things should keep in mind since derives objectcontext guess in way coupled? know third approach gives flexibility worth ? please share thoughts regarding this..thanks! that link have provided "poco template" broken - assume mean this: http://visualstudiogallery.msdn.microsoft.com/23df0450-5677-4926-96cc-173d02752313 this template can (and should) used in conjuction option 1 have stated. that's use in current application: 1 - create edmx model 2 - turn off code gen 3 - use poco generator generate poco classes the poco's not derive - pure poco's. ...

security - google search engine inside my drupal / site without show the content to worldwide? -

i have site im developing , want put there content , links (some of them private home links , stuff) drupal search good, not accurate , shows me things site... want search include website, dont let google public world wide... taht possible? it's not possible have google index site without making accessable web. can set local solr server , user apache solr search integration module index site, better normal drupal search. provide search site still. i'm not sure mean "only shows me things site." if not able host solr server alternative acquia's hosted solr search . if pricing right it's quick , easy way solr search on site.

google app engine - What tool can I use to easily manage data within a cloud database (Azure/SimpleDB/etc)? -

i need cloud database back-end mobile app, of them need, need management interface (ideally web-based, windows client) makes easy to: add/edit data in database (including cross-table forms) report on database, ideally dashboards/charts so i'm wondering if aware of web-based can hooked 1 of main cloud-database providers, allows me design forms , reports manage data in database. goal avoid writing forms , reports myself can focus efforts on client mobile app. right "best" solution appears microsoft access (probably hooked microsoft sql azure), , cannot believe i'd have sink low. save me depravity? please? :) the app engine datastore has built in datastore viewers (and editors). on dev_appserver, accessible @ /_ah/admin/datastore , , in production it's accessible through app's admin console. neither 1 lets build forms , reports, though - reports out of scope nosql databases. if you're prepared coding, might want consider django, makes ...

android - Is Secure.ANDROID_ID unique for each device? -

i using call: secure.getstring(getapplicationcontext().getcontentresolver(), secure.android_id); to uid device. think getting same id multiple devices though. should possible? the id in question is: 9774d56d682e549c , apparently there issue several devices returning id http://code.google.com/p/android/issues/list?cursor=10603&updated=10603&ts=1295993403 check thread ,. should careful it's documented "can change upon factory reset". use @ own risk, , can changed on rooted phone. appears if manufacturers have had issues phones having duplicate numbers thread . depending on trying do, wouldnt use uid.

Why is :notice not showing after redirect in Rails 3 -

i have following code in controller def create @tv_show = tvshow.new(params[:tv_show]) respond_to |format| if @tv_show.save format.html { redirect_to(tv_shows_path, :notice => 'tv show created.') } format.xml { render :xml => @tv_show, :status => :created, :location => @tv_show } else format.html { render :action => "new" } format.xml { render :xml => @tv_show.errors, :status => :unprocessable_entity } end end end and following in tv_shows/index.html.erb <div id="notice"><%= notice %></div> but when create new entry notice message not appear after redirect tv_shows_path. have idea why? is there reason you're trying use :notice , not flash[:notice] ? controller: respond_to |format| if @tv_show.save format.html { flash[:notice] = 'tv show created.' redirect_to tv_shows_path } format.xml ...

load multiple videos in a single flash file -

i have swf file, plays 6 videos 1 after other in loop. file huge taking more minute start playing after page finished loading. have taken original video file, , split 6 files. plan have 6 tiles in flash file page loads, , when tile clicked, video loaded dynamically video or swf file saves loading time , once done, want revert main page tiles. starting off flash , have no clue how possible in flash. not asking code, need tips started. thanks. an example video (on wonderfl.net it's possible edit source code , have compiled online) here's research of synchronising several video streams screenshots , source code if need sample app - try describe in comments , i'll try post on wonderfl

TCP client in Android phone: run continuously, display image based on message received from server -

i have tcp client running in android phone. connects , receives data windows application. once receive message, parse , try display image. have keep checking new messages windows app. the client thread keeps running. when message received, pass main activity, parse not able display image. want make client check new message every 100 ms. @ moment, logcat gets flooded thread keeps running , not able see contents of logcat. basically want run client, keep checking new messages every 100 ms, when new message there, pass main activity, parse , display image. please go through code below , suggest corrections or better approach if necessary. the client code below. main activity: public class tcplisten extends activity implements tcplistener { private textview mtitle; public string data[] = new string[2]; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //...

xml parsing - Looking for an Open Source Web Crawler that can crawl API requests and parse XML into csv -

i'm looking webcrawlers crawl through api , parse xml xml or csv file. i've been playing around requests api feeds great if didnt have manually , use automatically , edit data later. for example using api site called eventful, can request "?xml feed?" of data http://api.eventful.com/rest/events/search?app_key=lksbnc8mgtjd4wc5&location=pittsburgh&date=future if inspect link can see there ton of xml data sent back. i thought since xml data broken down elements wouldn't difficult ask crawler handle sorting (e.g city element send data city field in csv document) i'm wondering if has used existing opensource web crawler crawl apis , relate parsed data excel format.... i looked nutch couldnt find reference in documentation sorting xml return excel document based on elements returned api feed. has done before , can refer program. specifics helpful. we @ http://import.io/ have free solution similar mozenda, build api using our we...

ruby - Split array into sub-arrays based on value -

i looking array equivalent string#split in ruby core, , surprised find did not exist. there more elegant way following split array sub-arrays based on value? class array def split( split_on=nil ) inject([[]]) |a,v| a.tap{ if block_given? ? yield(v) : v==split_on << [] else a.last << v end } end.tap{ |a| a.pop if a.last.empty? } end end p (1..9 ).to_a.split{ |i| i%3==0 }, (1..10).to_a.split{ |i| i%3==0 } #=> [[1, 2], [4, 5], [7, 8]] #=> [[1, 2], [4, 5], [7, 8], [10]] edit : interested, "real-world" problem sparked request can seen in this answer , i've used @fd's answer below implementation. i tried golfing bit, still not single method though: (1..9).chunk{|i|i%3==0}.reject{|sep,ans| sep}.map{|sep,ans| ans} or faster: (1..9).chunk{|i|i%3==0 || nil}.map{|sep,ans| sep&&ans}.compact also, enumerable#chunk seems ruby 1.9+, close want. for example, r...

content management system - Open source CMS that can be plugged in on the back end of an existing site? -

i have problem solve think relatively common. have existing web platform, built on php or java framework, serves multiple sites. add cms end enable company's employees create, edit , publish content using intuitive interface. however, not want cms manage front end of site, want create content in database or xml repository, , deploy content multiple environments (preview, staging, production, etc). our priority clean , stable editorial interface non-technical users edit , publish content. i can integrate content php or jsp templates on front end, using mod_rewrite identify content ids in url , call content controllers load correct content repository. there should no need deploy cms code production servers @ all. i've done in past using commercial cmss such interwoven , documentum, i'm looking open-source option. i looking @ usual list of candidates, including drupal, alfresco, wordpress, joomla, , more general frameworks django. would recommend of these tools (or o...

mysql - SQL query that won't execute -

i new sql , @ loss why piece of code won't execute. know errors no results. no matter how long wait, code keeps processing. know problem has specific database, wondering if there overt errors. additionally, if has call making in database, how go debugging since no formal errors? select cr.communications_id answer_id, cr.consumer_id viewer_id, cr.action_log_id, nc.parent_communications_id question_id, cirm.consumer_rating viewer_interest, cim.consumer_interest_expert_id domain ( select 234 consumer_id, action_log_id, communications_id consumer_action_log comm_type_id=4 ) cr join network_communications nc on cr.communications_id=nc.communications_id join communication_interest_mapping cim on nc.parent_communications_id=cim.communication_id join consumer_interest_rating_mapping cirm on cr.consumer_id=cirm.consumer_id , cim.consumer_interest_expert_id=cirm.consumer_inter...

data structures - Filtering / iterating through very large lists in python -

if have list 10 million objects, how filter list quickly. takes 4-5 seconds complete iteration thru list comprehension. there efficient data structures or libraries in python? or python not suited large sets of data? itertools designed efficient looping. particularly, might find ifilter suits purpose. iterating through large data structures expensive, if need of data @ time lazy evaluation can lot. you can try using generator expressions, identical list comprehension counterparts (though usage can different) or generator, have benefits of lazy evaluation.

flex lexer - passing values to yylex -

so want avoid global variables want use flex tokenize input. want know if possible pass value yylex can rid of global s. right have this %{ #include #include #include #include #include "lex.h" %} %option noyywrap digit [0-9] alpha [a-za-z] alphanum {alpha}|{digit}|"_" %% [\t\n ] printf("ws:\n"); {alpha}{alphanum}* printf("symbol: %s\n",yytext); {digit}+ printf("int: %s\n",yytext); {digit}+"."{digit} printf("float: %s\n",yytext); "\"".*"\"" printf("litral: %s\n",yytext); "+" printf("op: %s\n",yytext); "-" printf("op: %s\n",yytext); "*" printf("op: %s\n",yytext); "/" printf("op: %s\n",yytext); "%" printf(...

entity framework 4 - Should the Unit of Work point to the service layer or the repository? -

just wondering, in asp.net mvc3 environnement entity framework. should unit of work point service layer or repository (and repository point service layer) ? ive saw 2 example: one unit of work , repository both have instance service layer.. link: entity framework 4 ctp 4 / ctp 5 generic repository pattern , unit testable doesn't use service layer obvious 1 use in case. second unit of work have instance repository have instance service layer.. link: http://blogs.msdn.com/b/adonet/archive/2009/06/16/using-repository-and-unit- of-work-patterns-with-entity-framework-4-0.aspx what better ? thanks. i'm not sure mean "point to", think transactions responsibility of service layer, not persistence. a persistence object can't know if it's part of larger unit of work. responsible service has references model , persistence objects make unit of work. service responsible managing connections pool on behalf of persistence objects well...

java - How to create an information bubble on a map (not google api) -

in android application have custom view functions map. when user touches particular location, able display more information in sort of information bubble. similar how google maps api works, not want use api. so far have tried drawing rounded rectangle directly canvas , drawing text on top @ specified location. has considerable drawbacks: 1) don't know how calculate how big rectangle should relative length , size of text. 2) drawing rectangle leaves no room power of views (with built in ontouch events, , room customize view) i have tried using view (button) display information have had no success. far know, cannot specify coordinates view should display (since information bubble needs move according map scrolled). in summary, need best of both methods image should resize according amount of text displayed, , information bubble should able move around screen according map scrolled. does have suggestions on best approach create information bubble without using google m...

How to simulate an windows azure system at local? -

possible duplicate: is there windows azure local development environment? hi all. want develop applications save data on windows azure don't want purchase windows azure account now. tell me how can setup simulated windows azure @ local? thanks all. you don't need purchase real account experiment azure. toolkit provide simulated environment development. see link download sdk & tools: http://www.microsoft.com/windowsazure/getstarted/default.aspx

c# - xml issue incorporating byte array -

hello use form of message parsing in write fields buffered stream, , extract byte array repesantaition of stream mymessage _message = new mymessage("me","you",messagetype.peer_message,4252422) ; // in constructor string sender,string receiver,messagetype(enumaraition) m_type,int32 id byte [] buffer = myencoder.encode(message) ; now when pass mydecoder decodes in same metter , works great ! how not issue my issue in cases of misscommunicaition need store byte[] array (buffer) farther use , , i'm trying in xmldocumant under tag here in inner text save array of bytes ive tryed --> utf8encoding.ascii.getstring(buffer) save kind of repsantaition changes values of field wich not strings... when take out using utf8encoding.ascii.getbytes(packet_node.innertext) ; 1)the question how u go saving byte array xmlnode 2)i've tried writing fields 1 one in each tag <packet> <sender>me</sender> <receiver>him...

actionscript 3 - VerifyError: Error #1107: The ABC data is corrupt, attempt to read out of bounds. - Flash CS5 -

i tested flash application in flash ide, never through error. when uploaded in server, got error. why getting verifyerror? flash application loads library assets through bulk loader, later assets bulkloader display in main page. assets includes swf,xml etc. usually happens when loading external swf files, using different version of classes in main application. this because compiled rsl's, modules or other external swf against different version of flex sdk. changed class , didn't recompile of swf's again. sometimes can right, old swf cached browser, , incompatible main application. can around adding version number file names, old cached version never used.

iphone - is there any easy way to get Date? -

i'm new iphone development. want set default date nsdate object string. don't see easy way or method... i think there might method in nscalender? if there's such method, please tell me. thanks in advance. i'm not totally clear on asking, create instance of nsdate object current date, 1 calls: nsdate * mydate = [nsdate date]; if saying have c-string or nsstring needs parsed initialize nsdate object, that's question. i have code posted here: how datetime column in sqlite objective c that shows how create nsdates nsstrings using nsdateformatter.

android - Table Layout with WebView -

i adding webview in table row , loading data, data not displaying me, can tell problem. if linear layout working not working in table layout table row? * main.xml * <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <tablelayout android:layout_width="fill_parent" android:layout_height="wrap_content"> <tablerow android:layout_width="fill_parent" android:layout_height="wrap_content"> <webview android:id="@+id/link4_view" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </tablerow> </tablelayout> ...

CSS Sub Navigation Auto Width -

this has been bugging me quite while. please @ fiddle here. http://jsfiddle.net/y9uef/ you can see subnav can't seem "grow" bigger if there's long text in it. know it's because width 100% of parent (in case top menu home, who, contact). can add width in subnav ul subnav ul bigger, work on subnavs regardign width of subnav content. now if want dynamic? instance, if subnav content has "short text" (let's it's 50 pixels), subnav width 50 pixels. if subnav content has list "a very long text" (let's it's 200 pixels) subnav width automatically 200px. thanks you can try add white-space: nowrap li .

OODBMS - RDBMS difference and which one is suitable for a factory management system -

i searched bit differences between oodbms , rdbms. pretty know are. however, how decide 1 better applications. can kindly me please? what meant factory management is: there production lines manufacture bottled, frozen , other food stuff. application manages assigning staff onto lines, keep production records in system. dbms better such systems? thanks in advance. here nice article rick grehan describes cases odbms useful: http://www.odbms.org/wp-content/uploads/2013/11/006.04-grehan-when-to-use-an-odbms-2005.pdf

android - How to set user agent for new ACTION_VIEW intent -

in application launching new intent url (browser) using following code: intent myintent = new intent(intent.action_view,uri.parse(url)); try { context.startactivity(myintent); } catch (activitynotfoundexception e) { log.e(tag, "cannot initiate browser", e); } is there way tolet new activity send user agent thanks -z one can not programmatically set (from within app) user's browser display custom user-agent string. however, users can hand via fiddling, set system wide. if need send custom user-agent, can embedded browser app via webview . can set custom user-agent .

Java on mac osx uses name like com.pro.MainFrame -

when run java gui app on mac osx, name of application qualified classname of main class. how can change show else. easier easy! add java option on execution -xdock:name="application name" for other aspects specific mac read oracle reference

grails - Should I use Spring integration or Spring social to interact with twitter and Facebook? -

i'll start new project in grails in have interact facebook , twitter (and possibly myspace too). i wondering if tried through spring integration (2.0) adapters vs new spring social apis. if did, give me pros , cons you've encountered each of these ? in spring integration, i've played twitter connector in little example, , found quite easy. liked loose coupling. spring social on other hand seems use templates allow too... hence concerns framework choose. thanks. philippe spring integration best suited if have sequence of steps, workflow you have atleast couple such flows you want separate business logic orchestration logic (which step gets called when kind of stuff) in flows if need simple connnectivity (for fire , forget messages) twitter , like, might need spring social. adding spring integration without real need can lead system complicated understand , maintain.

Efficiently detect broken urls in Java -

what's efficient way detect broken url (http 404) in java? i'd in loop , take little time possible. you can detect 404 after you've requested url: you'll header code (200, or 301 redirect, or 404 missing file), , can check that. so you'll have request , wait possible 404. there's rather comment below should not skipped, i'm repeating here: possible optimization (in case of existing urls): use head request instead of get.

visual c++ - C++ question regarding inserting elements into vectors -

i working through examples in accelerated c++. 1 of problems asks reader copy records students pass exams beginning of vector called students. fgrade function defined elsewhere returns failing students. 1 has use resize function remove elements students contains pass. have tried code not work. tell me if fault lies in code below? #include "stdafx.h" #include <vector> #include "student_info.h" #include "grade.h" using std::vector; // second try: correct potentially slow vector<student_info> extract_fails(vector<student_info>& students) { vector<student_info> fail; #ifdef _msc_ver std::vector<student_info>::size_type = 0; std::vector<student_info>::size_type count = 0; #else vector<student_info>::size_type = 0; vector<student_info>::size_type count = 0; #endif while (i != students.size()) { if (!fgrade(students[i])) { students.insert(students.begin(),...

iphone - What does "WARNING: Input manager failed to load static dictionary for: nl_NL" mean? -

i've been working on dutch localization of xib file. when run app in simulator, following message in log console: warning: input manager failed load static dictionary for: nl_nl i've tried reset simulator, i've deleted app, removed localization stuff , added again, i've cleaned project, nothing seems work. keep getting warning message. my questions: - can ignore it? - how can rid of warning? i've searched web, can't seem find answer. if happens in simulator , doesn't cause other issues, wouldn't worry it. saw warning first time today too. some follow-up questions may help: which sdk using? happen if create new xcode project template? app still loading localized nib correctly?

Regex pattern to match all images with replacement holding self PHP function -

i have preg_replace function find images , wrap them inside <figure> tag different class, depends on image source: $pattern = '"/<img[^>]*src="([^"]+)"[^>]*alt="([^"]+)"[^>]*>\i"e'; $replacement = '"<figure class=\"" . check($1) . "\"><img src=\"$1\" alt=\"$2\" /></figure>"'; preg_replace($pattern, $replacement, $content); therefore, put right class, wish call function check($source) image source parameter. way, function going return necessary class. as can see in code above, trying use e modifier, seems doesn't work. do have modify pattern , replacement? should use preg_replace_all find images, if many inside $content variable? you can use preg_replace_callback() purpose. allows define , use function replacement. function should expect array of matches , supposed return replacement value. preg_replace() e m...