Posts

Showing posts from August, 2010

actionscript 3 - In FLash AS3, does extending an object use more memory, even if the object's methods aren't used? -

i creating object pool cache recyclable objects in memory @ outset of application in order avoid (as possible) performance issues caused gc running; if possible i'd minimize memory object pool reserves, i'm attempting pool generic forms of objects (with no methods) , casting generic variants more specific , complex object types extend generic form when want them on stage. trouble requires generic variant class import/extend movieclip (because more complicated objects movieclips , make use of displayobject methods)-- importing and/or extending class add memory object takes when instantiated if never uses methods inherited class? makes sense would, , light profiling seems suggest does, i'm not 100% certain. how large should 'empty' movieclip instance in bytes? thanks, ccj i no, @ least not significantly. if little, it's unlikely present problem you. there 1 'copy' of bytecode in memory anyway, footprint of individual object depend on number

asp.net - C# WEb App Listview formatting -

building web app here , able alternate listeview rows. can give me sample code achieve this? 3 standard ones in vs2010 sucks , i'd able give goes along scheme of webapp. row 1= blue, 2=gray, 3=blue, etc. effect. thanks set colors in templates: edited add imagine header built in layouttemplate, can bold them there (see code added). you'll want use css - define various styles need in separate css file classes, , assign classes needed save excess typing. <asp:listview id="listview1" runat="server"> <layouttemplate> <table> <tr> <td style="font-weight:bold;">header</td> <td style="font-weight:bold;">header</td> </tr> <asp:placeholder id="itemplaceholder" runat="server" /> </table> </layouttemplate> <itemtemplate> <tr style="background-colo

java - How to run outstanding tasks immediately after ExecutorService.shutdown()? -

i've got scheduledexecutorservice tasks scheduled execute in hour. how list of outstanding tasks can force them run immediately? i believe shutdown() wait hour , looks if shutdownnow() returns list of runnables cannot run() because runnable implementation checks executor state , when notices has shut down runnable refuses run. see scheduledthreadpoolexecutor.scheduledfuturetask.run() actual implementation. any ideas? i've taken mark peters' answer, implementing abstract methods, added thread-safety , tried respecting underlying scheduledthreadpoolexecutor configuration whenever possible. /** * overrides shutdown() run outstanding tasks immediately. * * @author gili tzabari */ public class runonshutdownscheduledexecutorservice extends abstractexecutorservice implements scheduledexecutorservice { private final scheduledexecutorservice delegate; private final scheduledthreadpoolexecutor scheduledthreadpoolexecutor; private final exec

gpu programming - Memory Error in CUDA Program for Fermi GPU -

i facing following problem on geforce gtx 580 (fermi-class) gpu. just give background, reading single-byte samples packed in following manner in file: real(signal 1), imaginary(signal 1), real(signal 2), imaginary(signal 2). (each byte signed char, taking values between, -128 , 127.) read these char4 array, , use kernel given below copy them 2 float2 arrays corresponding each signal. (this isolated part of larger program.) when run program using cuda-memcheck, either unqualified unspecified launch failure , or same message along user stack overflow or breakpoint hit or invalid __global__ write of size 8 @ random thread , block indices. the main kernel , launch-related code reproduced below. the strange thing code works (and cuda-memcheck throws no error) on non-fermi-class gpu have access to. thing observed fermi gives no error n less 16384. #define n 32768 int main(int argc, char *argv[]) { char4 *pc4buf_h = null; char4 *pc4buf_d = null; float2 *pf2inx_d

ruby - Rails URL question -

if have users model, , individual user, say, person1, there way have url: www.myapp.com/person1 show www.myapp.com/users/person1 would? called? thank you! you should define route in routes.rb file: match "/:user" => "users#show" and you'll username given in params[:user] . need know kind of route override other routes defined, because match string, should @ least define constraints on username. for example if usernames matches regexp define constraint match "/:user" => "users#show", :constraints => { :user => /some-regexp/ } and don't forget set route last 1 in routes file, otherwise clash sure other routes. read this full reference

c# - WCF From Class Library - hosting in IIS and wsdl generation -

allmost day today trying research on wcf , 1 of aim create wcf service manually (or so). based on few articles on web on how structure wcf application have created contracts project contain service interfaces , implementation project. both have runtime.serialization i have created app.config <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.servicemodel> <behaviors> <servicebehaviors> <behavior name="fulfillmentservicebehaviour"> <servicemetadata httpgetenabled="true" /> </behavior> </servicebehaviors> </behaviors> <services> <service behaviorconfiguration="fulfillmentservicebehaviour" name="project.services.fulfillment"> <endpoint address="http://localhost:8080/services"

javascript - How to ignore class in jQuery? -

here simple example did: http://jsfiddle.net/j3rbx/ my purpose: when mouseover input, give me alert. seems fine, when mouseover text has class 'txt', doesn't give me alert. should do? just add .txt selector: $(".omg, .txt").bind("mouseover", function() { alert("i mouseover'ed omg class"); }) setting pointer-events: none; on .txt class works.

emacs - How to use default org-mode spreadsheet auto-sum behavior ? -

in example: | | num | |---+-----| | | 5 | | | 6 | | | 4 | |---+-----| | # | 15 | | ^ | sum | #+tblfm: $sum=vsum(@2..@-1); every time press "tab" in sum area or c-c c-c in table formula area below table recalculates sum area. problem after recalculates area adds new sum current sum that's in area. (try in emacs). i've created basic test show issues i've encountered in creating complex spreadsheets in org. until find solution can't trust sums emacs gives me because may press c-c c-c twice , it's inconvenient have go , zeo out sum values in form every time recalculate. if knows solution, please let me know. turns out bug org-mode version using: release 5.23a apr 23 10:17:27 2008 kudos thumper_ in freenode #org-mode pointing out. be sure update newest version of org-mode, folks! :)

Is there a good way to maintain Visual Studio 2008 and 2010 versions of a project? -

if have same libraries used in vs 2008 , vs 2010, there tool or technique allows keep both 2008 , 2010 project files in sync? the same project files can loaded in both vs2008 , vs2010. if mean solution, however, yes, has different. what create 2 solutions: myproject2008.sln , myproject2010.sln it mean have manually add projects them once these can same projects files , since project structure doesn't change in solution isn't big problem in eyes. hope helps.

sql - Combining a Date and a Time Column into One Timestamp Column -

how can create timestamp column date , time column in oracle? oracle databases have date data type (which contains date , time down second) , several timestamp data types (which have date date , time subsecond granularity - 9 digits). there 2 interval data types (year month , day second). there no time data type.

branch - Forking vs Branching in an enterprise context -

i'm curious know dvcs strategy people use in enterprises. the github model based on forks because in open source projects have trust issues , don't want able update code. however, in enterprise context trust issue not critical , branches might more suitable option dvcs in terms of maintenance (less repos, less permissions manage). so, question simple: replicate github model , use forks new features or release sort of pull requests mechanism or rather work branches. this post might people insights strategy should use if think going dvcs in own company. i think pretty strong opinions on question! where work, follow model i , 1 other person have full access machine containing company's official repositories , , we have several developers have read access. make changes, pull/merge eachother/us, , we pull revisions approve , push them our company's official repositories . see http://progit.org/book/ch5-1.html more extended reading on topic.

flex - Removing the border at the bottom of the list items -

Image
highlighted portion in red! how remove it? code render list below: <s:list id="ui_lstindexlist" width="175" height="600" fontfamily="twincen" fontsize="24" alternatingitemcolors="[]" bordervisible="false" downcolor="#7fceff" change="showalert(event)" contentbackgroundcolor="#6fa8bc" color="#ffffff" dataprovider="{indexarraycollection}" selectioncolor="#7fceff"> <s:itemrenderer> <fx:component> <s:iconitemrenderer labelfield="name" messagefield="artist"/> </fx:component> </s:itemrenderer> </s:list> thanks!!! click iconitemrenderer, , start typing "skinclass." when use code completion, offer option of "new skin..."

arrays - What does a.{X} mean in OCaml? -

i'm trying port ocaml f#. i'm "in @ deep end" ocaml , f# bit rusty. anyway, ocaml code builds fine in ocaml compiler, (not surprisingly) gives load of errors in f# compiler ml compatibility switched on. of errors reserved words, bulk of errors complaining .{ in lines such as: m.(a).(b) <- w.{a + b * c}; a,b,c integers. i've done lot of searching through ocaml websites, stackoverflow, english translation of french o'reilly book, etc. , cannot find this. of course doesn't search facilities have problems punctuation characters! yes i've found references . being used refer record members, , { } being used define records, both together? usage, assume kind of associative or sparse array? what syntax mean? closest f# equivalent? there pdf of ocaml documentation/manual available here: http://caml.inria.fr/distrib/ocaml-3.12/ocaml-3.12-refman.pdf on page 496 (toward bottom of page), says of generic arrays , method: val :

Extend model.save method Rails -

can take .save method of activerecord models , add functionality it? use of attributes of item being saved in function can like? class item < activerecord::base def self.save <added stuff save> <including some_other_id_from_this_item> end end or break things? , how access this_item.the_column_i_need? you should use activerecords callbacks extend behavior of save. with before_save hook can access data before record saved, example change case of entered email can like class user < activerecord::base before_save :downcase_email def downcase_email email.downcase! end end

android - Place a call from a View -

i have app consisting of activity displays custom view created (a dialpad). custom view has dials, edittext used display number entered , phonebutton want use place call number user has entered. im trying write listener button. listener must take number edittext , place call it. ive found code can used place calls , placed in activity: public void call(string number){ try { intent callintent = new intent(intent.action_call); callintent.setdata(uri.parse(number)); startactivity(callintent); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } } but listener button inside custom view class. how can call call() method inside activity button listener in view class? *** edit * * it seems there easier way of doing it, found code insert view class: public void call(string number){ intent intent = new intent(intent.action_call); string dialnumber = "tel:";

regex - "Unknown escape sequence" error in Go -

i have following function written in go. idea function has string passed , returns first ipv4 ip address found. if no ip address found, empty string returned. func parseip(checkipbody string) string { reg, err := regexp.compile("[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") if err == nil { return "" } return reg.findstring(checkipbody) } the compile-time error i'm getting is unknown escape sequence: . how can tell go '.' actual character i'm looking for? thought escaping trick, apparently i'm wrong. the \ backslash isn't being interpreted regex parser, it's being interpreted in string literal. should escape backslash again: regexp.compile("[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+") a string quoted " double-quote characters known "interpreted string literal" in go. interpreted string literals string literals in languages: \ backslash characters aren't included lite

jquery - cross-browser solution for changing content of last li element -

i have following un-ordered list structure <ul> <li>coffee</li> <li>tea</li> <li>milk</li> </ul> now, need replace milk buttermilk, how can it, using jquery ofcourse? need solution, works on every browser, starting ie7+ use :last selector $('li').filter(':last').text('buttermilk')

c++ - Sorting an STL vector on two values -

how sort stl vector based on 2 different comparison criterias? default sort() function takes single sorter object. you need combine 2 criteria one. heres example of how you'd sort struct first , second field based on first field, second field. #include <algorithm> struct myentry { int first; int second; }; bool compare_entry( const myentry & e1, const myentry & e2) { if( e1.first != e2.first) return (e1.first < e2.first); return (e1.second < e2.second); } int main() { std::vector<myentry> vec = get_some_entries(); std::sort( vec.begin(), vec.end(), compare_entry ); } note: implementation of compare_entry updated use code nawaz .

SQL Server WITH clause -

i getting error when using clause incorrect syntax near keyword 'with'. if statement common table expression, xmlnamespaces clause or change tracking context clause, previous statement must terminated semicolon. msg 102, level 15, state 1, procedure viewcomplaintbyprofile, line 29 incorrect syntax near ','. here procedure alter procedure [dbo].[viewcomplaintbyprofile] ( @id int ) begin set nocount on 1 (select sno = row_number()over (order complaint_id), complaint_id, complainantname,complainttype_id, complaintprofileid,complainantprofileid,description, email, date_complained, status, admincomments, phone, evidence, plevel = case prioritylevel_id when '1' 'high' when '2' 'medium' when '3' 'low' end , complaint_type = case co

cakephp Ajax: city select box not populating when state is selected -

i'm trying populate city select box based on selected state (which select box) using ajax. when select state, city select box not being populated. there 5 models below: student, merryparent, merryclass, state, city. of them related 1 another. can please tell me on doing wrong? thank you. the following models: student.php <?php class student extends appmodel{ var $name='student'; var $belongsto=array('merryparent','state','city','merryclass'); } ?> merry_parent.php <?php class merryparent extends appmodel{ var $name='merryparent'; $hasmany=array( 'student'=>array( 'classname'=>'student', 'foreignkey'=>'merry_parent_id' ) ); $belongsto=array('state','city','merryclass'); ?> merry_class.php <?php class merrycl

Converting timezone for date faster using java -

i have written method converting date time zone. how reduce execution time of method further. public static timestamp converttimezone(final timestamp fromdate, final timezone fromtz, final timezone totz ){ long timeindate = fromdate.gettime() ; int fromoffset = fromtz.getoffset(timeindate); int tooffset = totz.getoffset(timeindate); timestamp datestamp = new timestamp(fromdate.gettime()); if (fromoffset >= 0){ int diff = 0; if (tooffset > 0){ diff = (fromoffset - tooffset); } else { diff = (fromoffset + math.abs(tooffset)); } long date = fromdate.gettime() - diff; datestamp.settime(date); } else { int diff = 0; if (tooffset > 0){ diff = (math.abs( fromoffset) + tooffset); } else { diff = (math.abs( fromoffset) - math.abs(tooffset)); } long date = fromdate.gettime() + diff; datestamp.settime(date); } return datestamp; } w

linux - How can dlsym successfully import function from stripped binary library? -

it's weird dlsym can import functions stripped binaries. can tell me why/how? === file: a.c === int a1() { return 1; } int a2() { return 2; } === end of a.c === === file: b.c === #include <stdio.h> #include <dlfcn.h> #include <stdlib.h> typedef int (*fint)(); fint dlsym_fint(void *handle, char *name) { fint x = (fint)dlsym(handle, name); char *err = null; if ((err = dlerror()) != null) { printf("dlsym: %s\n", err); exit(1); } return x; } int main() { void *dl = dlopen("a.so", rtld_now); fint = null; = dlsym_fint(dl, "a1"); printf("%p: %d\n", a, a()); = dlsym_fint(dl, "a2"); printf("%p: %d\n", a, a()); return 0; } === end of b.c === $ gcc -shared -fpic -o a.so a.c $ nm a.so ... 00000000000004ec t a1 00000000000004f7 t a2 ... $ strip a.so $ nm a.so nm: a.so: no symbols $ gcc -o b b.c -ldl $ ./b 0x2aaaaaac74ec: 1 0x2aaaaaac74f7:

visual c++ - Self modifying virtual table entries to point to concrete implementation -

short version: can com class modify own virtual table entries @ runtime? (disregarding thread issues) full version: i'm providing number of c++ classes implement com interface. com interface defined in third-party framework. ( edited: vtable of com interface standard on windows platform; relationship between c++ vtable , com vtable isn't clear me.) in order inject implementations correctly framework, needs use two-step initialization: first create object no parameters, call initialize method parameters. moment when 1 of implementations can chosen. to make happen, added "resolver" class (or wrapper class), sole responsibility choose implementation in initialize method. after that, every call com methods forwarded actual implementation. the resolver class injected framework. gets around framework limitation. now, seeing resolver class doesn't have use after initialization, i'm wondering if there way rid of virtual method indirection cos

sql server 2008 - SQL joining 6 tables -

Image
please take @ image.there 5tables related appointtable appointid. need data same appointment id..what should joining query?can 1 me it? here generated query(i using left outer join) select dbo.appointment.appointment_id, dbo.appointment.patient_id, dbo.patientinvestigaiton.investigation_name, dbo.patientinvestigaiton.investigation_id, dbo.patienttreatmentmedicine.medecine_id, dbo.patienttreatmentmedicine.medicinename, dbo.patienttreatmentmedicine.medicinetype, dbo.patientfindings.finding_id, dbo.patientfindings.finding_value, dbo.patientadvice.advice_description, dbo.patientcc.cc_value, dbo.patientcc.cc_id, dbo.patientdiagonosis.diagonosis_name, dbo.patientdiagonosis.diagonosis_id dbo.appointment left outer join dbo.patientinvestigaiton on dbo.appointment.appointment_id = dbo.patientinvestigaiton.appointment_id left outer join dbo.patienttreatmentmedicine on dbo.appointment.appointment_id = dbo.patienttreatme

html - How to place Facebook send dialog box above other content? -

i can't figure out - i've tried positioning, floating , z-index, without success... my problem can seen here: http://procycling.fi/2/uutiset/40-kilpapyoraily/594-paavo-paajanen-aloitti-liegen-ympaeriajon-vatsataudissa when press send button, can see opening dialog box goes behind main content area. in way it's similar case: facebook , css, how place comment dialog on top of video? , that's flash. hopefully solution found! thanks in advance! i think it’s no z-index issue. assigned overflow: hidden .component-content .rt-article-icons should overflow: visible

java - What is the better approach to trim unprintable characters from a string -

i reading data xml. when checked in eclipse console found getting whole data square boxes. example if there 123 in excel sheet getting 123 square boxes. used trim() avoid such things didnot success because trim() method trims white spaces. found characters have ascii value -17, -20 .. i dont want trim white spaces want trim square boxes also so have used following method trim characters , got success. what more appropriate way of trimming string trimming string string trimdata(string accessnum){ stringbuffer sb = new stringbuffer(); try{ if((accessnum != null) && (accessnum.length()>0)){ // log.i("settings", accessnum+"access number length....."+accessnum.length()); accessnum = accessnum.trim(); byte[] b = accessnum.getbytes(); for(int i=0; i<b.length; i++){ system.out.println(i+"....."+b[i]); if(b[i]&

xslt - Getting detailed error description from Saxon 9.x in .net -

i have xslt2 transform engine setted saxon 9.x. have big xml file large xsl transformation file. can make transform xqsharp xslt2 engine, saxon getting error: javax.xml.transform.transformerconfigurationexception: failed compile stylesheet. 1 error detected. i more detailed error information saxon example linenumber of error , cause. 2 exceptions found are: saxon.api.dynamicerror saxon.api.staticerror but not thrown. how detailed error desription? i have following code: <webmethod()> _ public function xsltsaxon(byval inputxml string, byval inputxsl string) string dim response string = "" try ' create processor instance. dim processor new processor() ' create xml reader based on xml string dim xmlreader xmlreader = xmlreader.create(new stringreader(inputxml)) ' load source document. dim input xdmnode = processor.newdocumentbuilder().build(xmlreade

Android, trouble with clicking after layout animation -

i have listview on screen , menu @ bottom. upon click of menu key, animates-slides off screen , listview expands. menubtmvisable = false; animation menu_off = animationutils.loadanimation(this, r.anim.menu_off); menubtm.startanimation(menu_off); display display = getwindowmanager().getdefaultdisplay(); layoutparams listlp = new layoutparams(display.getwidth(), display.getheight()-87 , 0, 50); listviewmain.setlayoutparams(listlp); menu_off.xml <set android:fillenabled="true" android:fillafter="true" xmlns:android="http://schemas.android.com/apk/res/android"> <translate android:fromydelta="0" android:toydelta="120" android:duration="500" /> </set> yet when, menu down, click on listview item "13" ( see picture ), results in menu click, if still in place... what think best way take care of it?

android - Get incoming call country name using phone number? -

hi there way can country name of incoming call on android phone? get calling number. find country code in it find country in map. can use here construct it. hope helps.

android - write private file to internal storage -

i trying write files on internal storage. i saw the fileoutputstream fos = openfileoutput(filename, context.mode_private); on data storage , understood file private application. but problem can open file without path, first opened new directory file file.mkdir(), now, how write file private ? i saw thefileoutputstream fos = openfileoutput(filename, context.mode_private); on data storage , understood file private application. correct. private default. but problem can open file without path, first opened new directory file file.mkdir(), now, how write file private ? your files create in subdirectories off of in getfilesdir() private default -- not have special make them private.

recursion - How exactly does this recursive function work in JavaScript? -

i have following example of recursive function, , don't understand order in things happening: function power(base, exponent) { if (exponent == 0) return 1; else return base * power(base, exponent - 1); } when function return values, @ end of process or each time? a simple way visualize happens in recursion in general this: a stack of calls function created: process needs proper termination condition end (otherwise you'll have infinite recursion, evil ) the single results popped out of stack: each result used calculate next step, until stack empty i.e. if base=5 , exponent=3, call stack (last element on top): 5*(5*(5*1)) 5*(5*(5*power(5, 0))) 5*(5*power(5, 1)) 5*power(5, 2) power(5, 3) then every called function has real parameters , ready return value (first element on top): 5*(5*(5*1)) 5*(5*5) 5*25 125 note here functions calulated in inverse order: first power(5, 0) , power(5, 1) , , on.. after each calulation element of stack r

Create android dialpad like number input show control -

hi want create control activty android default dialpad number showing control. created edittext control it. <edittext android:id="@+id/editid" android:hint="enter number" android:layout_width="fill_parent" android:scaletype="center" android:singleline="true" android:cursorvisible = "false" android:layout_height="wrap_content" > </edittext> but not looking great trying show inpput number centre , keep on decreasing text size if there more numbers entered upto size.also unable set background drawable make dialpad's input box. i tried button control. <button android:layout_height="45dp" android:textsize = "25dp" android:singleline = "true" android:id="@+id/input_number" android:textcolor = "@color/white" android:lay

jquery - Zoom DIV Effect, Weird Behaviour when Hovering Fast -

i have following code: http://jsfiddle.net/8fvjn/15/ i getting weird effect when hover 1 box next in quick succession - start going kind of mad. try hovering 1 other fast, , see mean. is there way stop behaviour? zach try using .stop(true, true) it clear queue , stop current animation. working demo

plotmath - R: How do I put two box plots next to each other, keeping same y-range for both? -

Image
let's have 2 data sets, 1 y-range [min0:max0] , other y-range [min1:max1]. how can put both box plots in 1 plot next each other sane y-range [min(min0, min1):max(max0, max1)]? here's tried: d0 <- matrix(rnorm(15), ncol=3) d1 <- matrix(rnorm(15), ncol=3) par(mfrow = c(1, 2)) boxplot(d0) usr <- par("usr") plot.new() par(usr = usr) boxplot(d1, add = true) but keep first plots y-range , squeeze both plots whereas i'd them square. any ideas? d0 <- matrix(rnorm(15), ncol=3) d1 <- matrix(rnorm(15), ncol=3) # using base r graphics lmts <- range(d0,d1) par(mfrow = c(1, 2)) boxplot(d0,ylim=lmts) boxplot(d1,ylim=lmts) you may want think way using grid graphics, either lattice or ggplot2 packages. here's 1 attempt in ggplot2: # using ggplot2 library(ggplot2) d <- data.frame(d.type=c(rep(0,15),rep(1,15)),sub.type=rep(c('a','b','c'),10),val=rnorm(30)) p <- ggplot(d, aes(factor(sub.type), val)

extjs - how to access a non-global variable in ext js 4.0.0 -

i defined variable in handler of button , want access in different element in same panel(ext.grid.panel) you can not access local variable other scope. save variable in panel scope or in scope visible both places (handler , other). write code , i'll give more detailed advise.

java - jquery mobile android t9 disable -

Image
is there way disable t9 on input? made auto complete, t9 annoying. t9 phone feature instead of browser feature no.

Background task is running only when iPhone is connected with xcode -

hi using following code background task works fine ,when iphone connected xcode , when ran app without connected xcode ,then background tasks won't work - (void)applicationdidenterbackground:(uiapplication *)application { back=1.0f; nsautoreleasepool *pool=[[nsautoreleasepool alloc] init]; nsrunloop *runloop=[nsrunloop currentrunloop]; timer=[nstimer scheduledtimerwithtimeinterval:1.0 target:self selector:@selector(changecounter) userinfo:nil repeats:yes]; [runloop run]; [pool release]; } please why happening have checked documentation background executation? you should start task like: - (void)applicationdidenterbackground:(uiapplication *)application { uiapplication* app = [uiapplication sharedapplication]; bgtask = [app beginbackgroundtaskwithexpirationhandler:^{ [app endbackgroundtask:bgtask]; bgtask = uibackgroundtaskinvalid; }]; // start long-running task , return immediately. dispatch_as

java - Endeca "did you mean" navigation -

how provide did mean suggestions in endeca firstly need -dym flag enabled on dgraph (this should set in appconfig.xml) then need extract dym values in application code, using following code: queryresult.getnavigation().getesearchreports().getdymsuggestions(); this return list of esearchdymsuggestion objects each of has term can displayed user. i sure can find example of on endeca support portal.

rails 3 console error -

i have got error message when using rails3 consol irb(main):018:0> webtrisulmenu.find(1) nomethoderror: undefined method eq' nil:nilclass /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.9/lib/active_support/whiny_nil.rb:48:in method_missing' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:299:in find_one' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:289:in find_with_ids' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/relation/finder_methods.rb:107:in find' /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.0.9/lib/active_record/base.rb:444:in find' (irb):18 /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in start' /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in start'

shell - Return value from a Java code -

there java class creates post request , sends servlet. main method of class file (test) looks this: public static void main(string[] args) throws ioexception { // code logic goes here... // no return statement } this called kornshell (ksh) script this: retcode=`$clk_java_path -cp $classpath test ${password} ${hostname} ${toolset}` if [ $? != "0" ];then echo "error: echo "${retcode}" else echo "${script} success" fi retcode has value "2" independent of if code fails or succeeds. question since return type of main method "void" why code returning value? the return value of java application not return value of it's main method, because java application doesn't end when it's main method has finished execution. instead jvm ends when no more non-daemon threads running or when system.exit() called. and system.exit() way specify return value: argument passed system.e

asp.net mvc - Ninject - binding constructors with arguments / Entity Framework connection string -

please forgive ignorance, new ioc , ninject. have searched high , low understandable solutions far have eluded me. so far have following , works expected: private class standardmodule : ninjectmodule { public override void load() { bind<ilog>().to<nloglogger>(); // use nlog bind<imyentityframeworkrepository().to<myentityframeworkrepository>(); } } myentityframeworkrepository creates own ef dbcontext via connection string declared in app/web.config: public class mydbcontext : dbcontext { public mydbcontext() : base("myappconfig") { } ........ } however!! goal - realise syntax "nonsense" (and think may have ioc mydbconext too) , hope "pseudo-code" conveys desire: private class standardmodule : ninjectmodule { public override void load() { bind<ilog>().to<nloglogger>(); // use nlog string mysqlconnectionstring = myapp.getcommandlineargu

REST - model state transitions -

in rest - revertable delete nice introduction on howto model state changes in rest given. basically, if have resource field status , put new version of resource update status field. in topic, extend model. have resource can in 2 states: 1 , 2. in contrast simple model described in cited post, there 3 transitions traverse state 1 state 2, instead of one. my question is: how model state transitions in rest? i myself cannot come rpc-like post, isn't restian probably: post http://server/api/x target_state=2&transition=3 this changes resource x state 1 state 2 using transition 3. this isn't limited rest; it's more basic question state machines. state machine should encapsulate of state, if find creating multiple transitions 1 state another, , difference significant, difference must captured in state. for example, have no home. can move "homeless" state "home" state in 3 ways: can rent one, can buy one, can steal one. 3 tra

How do i load my html files into the internet? -

i learning html course available tutorials on internet. , knowledge have developed html files , believe there more go. these files consist of our old school friends , present condition , they're doing. have created bunch of html files. have created website named www.mypage.com <a href="d:\mool.txt"> arjun</a> so in href i'm giving path files in desktop pc itself. how put them on internet , share friends living somewhere out of town. want reunite of school friends using these files. upload them , make webiste friends? there free way that? or possible way reach it. and i'm saying sorry if question not tag mentioned. please let me know , remove tag. don't know link wikiposts share views. if know let me see link. thank you. find web hosting service (google knows lots) sign up follow instructions <a href="d:\mool.txt"> arjun</a> and use relative uris

debugging - How to tackle Magento development issues -

i have problem debugging thing (not real error) in magento (ce 1.4.1.1). payment module i've adapted, additional payment fee incorporated , showing on selection of particular payment method. works fine, no problems. a client has onestepcheckout plugin installed. inside it, payment method works fine (small problem: payment fee showing after grand total, that's not issue, completeness of question). so, working fine, other payment modules installed. is, working fine on dev , test! on live server however, fee not show up! i've locally installed other plugins installed on live server well, see if there conflicts among them. none whatsoever. extension conflict extension not indicate class overwriting problems either. of course, i've cleared cache. several times. so question rather general one: how proceed? can , how see what's going on , not break live environment ? far know, there no staging server (there test server, there no error...), i'm bound live en

windows - Is there a better way to make an initial GIT commit for a web application? -

possible duplicate: git gui.. stage everything my employer looking setting source control after pleading of developers. unfortunately, none of our developers, inclusive of myself, have ever done source control. i've looked svn , thought fine of developers didn't it. i've moved on looking @ git option. i've downloaded git gui http://git-scm.com , started tinkering brings me question/problem. the web application we're trying add source control (git) 7,386 files , 712 folders. when doing initial commit, understand, i've got click on each file want commit move unstaged changes staged changes pane. hesitant sit , click 7,386 times (once each file commit). there faster way this? i'm using page reference learn use git gui http://nathanj.github.com/gitguide/tour.html . if has better tutorial/reference using git gui i'd appreciate linking me it. thanks to add every file (that not ignored), use cd /path/to/workspaceroot git add

unit testing - Is it possible to find out if an Android application runs as part of an instrumentation test -

is there runtime check application find out if runs part of instrumentation test? background: our application performs database sync when starting. should happen when started regularly. interferes instrumentation tests testing db sync. not surprisingly. and other tests it's waste of cpu cycles. if you're using activityunittestcase, set custom application object setapplication, , have flag in there switch database sync on or off? there's example of using custom application object on blog: http://www.paulbutcher.com/2011/03/mock-objects-on-android-with-borachio-part-3/

what is the best protocol for sql server express 2008 r2 client and server running on same machine -

we use sql express 2008 r2 simple reporting , data storage. data written typically @ rate of 600 3000 records per minute. (one client 1 connection same machine). need optimal performing protocol. (good performance without hogging memory..) read articles online , quite confusing when comes deciding between tcp/ip, shared mem , named pipes. summarize msdn documentation 1) shared memory has no configurable properties. shared memory tried first, , cannot moved top position of enabled protocols list in client protocols properties list. does mean shared mem preferred , fastest ? 2)for tcp/ip sockets, data transmissions more streamlined , have less overhead. data transmissions can take advantage of tcp/ip sockets performance enhancement mechanisms such windowing, delayed acknowledgements, , on. ok. is faster shared mem ? 3)if server application running locally on computer running instance of microsoft® sql server™ , local named pipes protocol option. local named pipes runs in kernel

Xcode 4.1 can't reinstall. App store says "installed" -

today update system lion , try update xcode. after downloading app store error. so remove old xcode 4.0 command /developer/library/uninstall-devtools –mode=all but in app store have status "installed" , can't reinstall xcode. must do? p.s trash clear. when downloaded xcode mac app store created icon in launchpad called 'install xcode' , you're able kick off install there. my installation failed first time , able reinstall fine.

javascript - JQuery, Google Maps : "Cannot call methods on gmap prior to initialization" -

i have problem i've been trying figure out while now. there's block of code works fine, if add jquery in it, crash everything. i following error : "uncaught cannot call methods on gmap prior initialization; attempted call method 'addmarker" the faulty code starts "$.each(markerslist.markers," any point me out in right direction appreciated. ! function initialize() { var myoptions = { zoom: 7, maptypeid: google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid("map_canvas"), myoptions); $.each(markerslist.markers, function(map, marker) { var destination = (marker.lat + ', ' + marker.lng); $('#map_canvas').gmap('addmarker', { 'position': new google.maps.latlng(marker.lat, marker.lng), 'title': marker.title }, function(map, marker) { $('#map_canvas').gmap('addinfowindow', { &#

mysql - How do you architect massive design db? -

this design question regarding massive db design. instance, if going build database hold 10 million users, how architect it? my main curiousity things database replication, speed anything? when building db of size, fields "username" "name" "company" "dob" "gender" other making 1 table, on scale else should considered? indexes? 10 million not particularly huge, it's large enough should consider options carefully. replication can - lot. assuming you're reading users table lot more you're writing it, might consider master database handles writes. reads application come 1 of n slave boxes. indexes massively important, of course. you'll want indexes on columns searched (either in clauses, or result of relationships other tables (read: joins)). has been written how analyse sorts of queries application makes, , how smartly define indexes based on analysis. if you're learning stuff, go reading, ,

Why this ajax jquery php to do list delete action doesn't work? -

Image
i tested source code tutorial http://query7.com/php-jquery-todo-list-part-1 , deploy source taken here http://query7.com/wp-content/uploads/php-jquery-todolist.zip to surprise after delete action, refreshed screen item still not deleted i can't see bug in code can ? process.php <?php //connect database $connection = mysql_connect('localhost:3316', 'root' , 'root'); $selection = mysql_select_db('notes', $connection); //was form submitted? if($_post['submit']){ //map content sent form variable. not necessary keeps things tidy. $content = $_post['content']; //insert content database $ins = mysql_query("insert `notes` (content) values ('$content')"); //redirect user index page header("location:index.php"); } /*doesn't matter if form has been posted or not, show latest posts*/ //find notes in database , order them in descending or