Posts

Showing posts from March, 2012

php - Accessing form input by ID -

this question has answer here: php form sending value id instead of value 4 answers i know in php have $_get , $_post , , $_request access form input through names in html tags. possible same ids? example: <form> first name: <input type="text" id="firstname"><br> last name: <input type="text" id="lastname"> </form> in php: $f_name = $_get['firstname']; when submitting form, input fields name attribute submitted. add name attribute same id , or javascript hack populate name attributes on form submit.

hashtable - Java Enumeration on Hash Table -

i'm cs student working on project hashtables in java. creating our own hashtable , i've completed using linked lists manage collisions. however professor asking include method within hash table class returns enumeration go through keys in hash table. i'm having trouble understanding how this. i've googled enumeration , i'm getting enum results. any appreciated. edit: if i'm reading correctly should have hash table class implement enumeration, , define nextelement() , hasmoreelements() within class? getkeys() method returns enumeration returns hashtable class? i suggest use java.util.hashtable implementation example. keys() method returns enumeration

javascript - Saving a file from a chrome packaged app -

i have chrome packaged app has taken me while head around have working. have come across problem. is possible save variable app text file that's placed in app/file directory? i have looked on chrome.filesystem api don't understand it. i wrong , maybe can't save files file directory? any examples or tutorials on great! thanks! i suggest storing file's contents in chrome.storage , dynamically loading , saving contents of css file there instead of using filesystem. me, easier accomplish.

Using bootstrap twitter with google blogger -

i've been trying use bootstrap twitter on google blog on blogger.com. apparently not working, , quite sure problem how including css , js files. i've uploaded .css , .js files .txt files online plain .txt upload server. including them in head. bootstrap.css <link href='http://m.uploadedit.com/b013/1366225851722.txt' rel='stylesheet'/> bootstrap.min.css <link href='http://m.uploadedit.com/b013/1366225875450.txt' rel='stylesheet'/> bootstrap-responsive.css <link href='http://m.uploadedit.com/b013/136622647822.txt' rel='stylesheet'/> jquery <script src='//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js'/> <script src='//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js'/> <script src='http://m.uploadedit.com/b013/1366226081928.txt'/> bootstrap.js <script src='http://m.uploadedit.com/b013/1366225665368.txt'/> bo...

c++ - Fibonacci Sequence ,binary search -

i trying solve following problem: f infinite sequence of integers satisfies fibonacci condition f(i + 2) = f(i + 1) + f(i) integer i. write program, calculates value of f(n) given values of f(i) , f(j). input: input contains 5 integers in following order: i, f(i), j, f(j), n. −1000 ≤ i, j, n ≤ 1000, ≠ j, −2·10^9 ≤ f(k) ≤ 2·10^9 (k = min(i, j, n), …, max(i, j, n)). output: output consists of single integer, value of f(n). i trying solve problem finding f(min(i,j)+1) using 2 neighbors find f(n). told can done implementing binary search on interval (-2*10^9,2*10^9) ,but don't understand how use binary search here.could give me hint or explain algorithm in short manner. one way can think of that: lets < j , f(i) < f(j) want find f(i+1). know f(i) < f(i+1) < f(j) can binary search between [f(i),f(j)] - each time guess f(i+1) , checks if fits (no easy way around think) until correct value. complexity - each iteration can take 2000 steps (worst case), , ...

CSS dropshadow doesn't reach the bottom of the page? -

i wanted use dropshadow on both sides of main content it's not reaching bottom of page. cuts off looks 100 or px before end. haven't been able figure out why. appreciate help! html file: http://db.tt/0z0cnvit stylesheet: http://db.tt/1cjdzbj0 html <div id="container"> <div id="sidebar"> <img name="logo" src="" width="280" height="150" alt="" /> <br /> <br />babylon citizens council of arts not-for-profit arts organization bringing theatre, music, fine arts , cultural events residents of town of babylon. <br /> <br /> <ul id="nav"> <li><a href="about.html">about</a> </li> <li><a href="events.html">events</a> </li> <li><a href="programs.html">p...

css - How to display string inline? -

Image
how force in twitter bootstrap show text inline overflow ? example in http://jsfiddle.net/nonamez/jjdx4/ overflow working except inline words. in code nothing works. use white-space , set nowrap make text go 1 line until break reached. li {white-space:nowrap;} http://jsfiddle.net/jjdx4/1/

java - Sort a list of random arrays from largest to smallest -

alright assignment, have sort series of random numbers in order largest smallest. random numbers going indexofmaxinrange, take index of largest number return that. in swapelements,it have swap index highest element a[0], second highest a[1] , on. these 2 methods passed through sortarray. please give me input on how finish , doing wrong thank you. ps: not called in code, various reason such printing. here code: public static void main(string[] args) { int[] array = randomintarray (10); int index = indexofmaxinrange (array, -5, 15 ); swapelement (array, index, 0); } public static int randomint (int low, int high){ // create serie of random numbers int x = 0; (int = 0; < 10; i++){ x = (int)(math.random ()* (high - low) +low); } return x; } public static int[] randomintarray (int n) { // size of array int[] = new int [n]; (int = 0; <a.length; i++){ a[i] = randomint (-5, 15); } return a; } public static ...

jsf 2 - error when following tutorial of deploying jsf2.1 application on google app engine -

i followed tutorial create application jsf , deploy on google app engine if followed steps of tuto i encountoured error : 18 avr. 2013 01:01:10 com.google.apphosting.utils.config.appenginewebxmlreader readappenginewebxml info: processed c:\users\user\desktop\eclispe_workspace\test_google\war\web-inf/appengine-web.xml 18 avr. 2013 01:01:10 com.google.apphosting.utils.config.abstractconfigxmlreader readconfigxml info: processed c:\users\user\desktop\eclispe_workspace\test_google\war\web-inf/web.xml 18 avr. 2013 01:01:10 com.google.appengine.tools.development.systempropertiesmanager setsystemproperties info: overwriting system property key 'java.util.logging.config.file', value 'c:\users\user\downloads\compressed\eclipse-jee-juno-sr2-win32\eclipse\plugins\com.google.appengine.eclipse.sdkbundle_1.7.7.1\appengine-java-sdk-1.7.7.1\config\sdk\logging.properties' value 'web-inf/logging.properties' 'c:\users\user\desktop\eclispe_workspace\test_google\war\...

c# - Serialport writeline textbox error -

i use virtual com ports testing program. want serial write com8 , serial read com9. when want write values textbox1, error: ioexception unhandled (the parameter incorrect) how rid of this? using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.io.ports; namespace flowerpod_user_interface { public partial class form1 : form { public form1() { initializecomponent(); // show list of valid com ports foreach (string s in system.io.ports.serialport.getportnames()) { combobox1.items.add(s); } } private void textbox1_textchanged(object sender, eventargs e) { } private void form1_load(object sender, eventargs e) { } private void button1_click(obje...

How do you pipe output to the end of a file? (Java, Terminal) -

i type in command line: javac *.java && java neuralnetapp > xormomentumtest.txt this erases in xormomentumtest.txt , fills output program. what want add output end of xormomentumtest.txt , instead of replacing contents, can run program many times , keep output. try this: javac *.java && java neuralnetapp >> xormomentumtest.txt this more of operating system question, java question. i'm assuming have unix or linux os.

c# - Entity Framework Performance - How do I get this to work fast? -

i have object has list of child objects, institution has multiple departments. departments can disabled or enabled based on boolean property on department. trigger property of institution false when there 1 or more departments disabled. have following code in partial institution class: public bool allset { { return !(departments.where(i => i.active == false && i.isdeleted == false).count() > 0); } } this works, when have enabled performance of page shows list of institutions slows crawl , memory usage spikes, apparently doing fundamentally wrong here, have alternative ways this? working solution var institutions = x in ent.institutions let hasdepartments = !x.departments.any(d => d.active == false && d.isdeleted == false) select new { fulltitle = x.title + " - " + x.address.line1 + ", " + x.address.city + ", " + x.address.state, department = x, allset = hasdepartments, guid =...

Mocking Http-503 for a web service -

i mock web service response http 503 (error 503--service unavailable) when server unable handle request due temporary overloading or maintenance of server. best strategy? thanks, d you can use following groovy script: mockrequest.gethttpresponse().senderror(503)

c - return current node from BST -

hello i've run issues cannot seem resolve. have bst traversing through , checking ranks. have method checkrank(link head, targrank) takes in head node , traverses through tree until finds node equal rank targrank. trying have checkrank function return current node found equal rank at. best way achieve because attempts seem return current node head? typedef struct node* link; struct node { item item; // data node link l, r; // left & right links int rank; }; func call: link head; checkrank(head, 13); func: link checkrank(link h,int targetrank) { if (h != null) { if (h->rank < targrank) { checkrank(h->r, targrank); } if (h->rank > tarrank) { checkrank(h->l, targtrank); } if (h->rank == targrank) { return ??; } } else { printf("equiv rank not found\n"); } } first of all...

php - Reducing Akamai count hits by changing Mime type -

we're working on reducing hits akamai records @ moment. 1 of suggestions given outside contractor change mime type of html page. every instance of text/html on web page generates page view in akamai proposed solution remove or replace mime type text/html text/json or other mime type. the problem if make php application set mime type text/json or rfc rectified * application/json* browsers interpret page text file , html not rendered engines. any ideas? you're post pretty vague. by reducing hits, mean reducing hits origin e.g. improve caching? or mean...hits recorded in luna control panel? either way, changing mime type not going in regards reducing hits.

performancecounter - Apple Instruments - Counters - Source unavailable -

i've been running problem apple instruments (4.6, xcode 4.6.2 on 10.8.3). when using time profiler, can @ source , see hotspots without problems (same project). this time i've been trying use "counters" template sample cpus performance counter events. samples events should , have same time based profiling information well, when try step code @ hot spots, can "time profiler", "unavailable" used have source. no assembly either. the project built as: release build debugging information on , not stripped dwarf + dsym used store profiling data. as said, same configuration works time profiler. tried (pretty that's stated in here: xcode 4 instruments doesn't show source lines , except doing -o0, debug performance not of interest me) recompile relocate dysm file using "file -> re-symbolicate" as plainly close instruments, start profile xcode , choose time profiler, works, if go performance counters, stops. is ...

Error while building Android source code (version 4.1.1_r6): trouble processing "javax/net/ServerSocketFactory.class": -

i trying build android source code version 4.1.1_r6. working fine getting error "trouble processing "javax/net/serversocketfactory.class" any appreciated. thanks... goto project-->properties->java build path->libraries-> remove including android jars go project browser, right click on project working on, android tools---> fix project properties... next, clean , build...

How to test web application performance ? -

we have web application (uisng asp.net , alaska waa ) designed many years ago (not team). uses alaska’s xbase++ code via waa query database , generate html response. earlier running on win 2003 , iis 6. web application migrated new environment .. windows 2008 , iis7 (we did migration). this application uses mysql backend , shows images stored in shared drive. problem website’s performance not satisfactory. pages taking more 10-12 sec load (which not case earlier setup). now, want track down down root cause of delay. suspecting performance of db server , shared drive. how can confirm ? there tool can track down cause ths delay ? ( alaska waa – web application adapater—it kind of application server run xbase++ code on server. iis request waa (like cgi application) , waa server side processing.. getting details db, generate html response , retun iis ) or xbase++ code base huge , cannot go through code fine tune queries. there way test db server performance, shared d...

objective c - How to drag and drop mp3 songs in the playlist -

Image
i developing mac desktop based application, created playlists using nsoutlineview . know how drag , drop in nstableview , don't know how drag , drop in playlists according attached image( like itunes application ) ,i dragging songs in playlist 2. at time of selecting songs nstableview, store selected songs id in array. after when mouse reach in nsoutlineview following delegate methods call time user can add playlist table... -(nsdragoperation)outlineview:(nsoutlineview *)outlineview validatedrop:(id)info proposeditem:(id)item proposedchildindex:(nsinteger)index { return yes; } and - (bool)outlineview:(nsoutlineview *)ov acceptdrop:(id )info item:(id)item childindex:(nsinteger)childindex { retuen yes; }

iphone - Adding data in sqlite table using array store only last entered records -

i inserting data in sqlite table , showing data in table view. problem when insert abc show in table abc, when again insert xyz shows xyz instead of abc , xyz. method select data inserted: nsmutablearray *temparray3 = [[nsmutablearray alloc] init]; self.libraryarray = temparray3; [temparray3 release]; [coffee getinitialdatatodisplayl:[self getdbpath]]; adding data method: - (void) addcoffee:(coffee *)coffeeobj { //add database. [coffeeobj addcoffee]; int countone=[libraryarray count]; nslog(@"count before adding %d",countone); //add coffee array. [libraryarray addobject:coffeeobj]; int count=[libraryarray count]; nslog(@"count after adding %d",count); nslog(@"successfully added"); }

bit manipulation - Error codes OR'd together -

i having trouble figuring 1 out , use help. data sheet hardware says "the reported error code or’d result of each detected error. error codes given in table 3." table 3 0x00 -> no error 0x01 -> power error 0x02 -> receiver error 0x03 -> transmitter error the data sheet shows example. example : (etv001t0c) + checksum -> test status 0x0c (rx , tx error) 0c error byte. first question - math wrong? have no idea getting 0c from. pretty sure 0x02 | 0x03 = 0x03. , second if 0c how figure out errors in that? the table giving giving bit shift positions , used << operator. 1 << 0x00 = 0001b (?) -> no error 1 << 0x01 = 0010b -> power error 1 << 0x02 = 0100b -> receiver error 1 << 0x03 = 1000b -> transmitter error using python calculator: >>> (1 << 2) | (1 << 3) 12 >>> hex((1 << 2) | (1 << 3)) '0xc'

ios - How to get hardcoded information from an iPA binary -

i tried strings on application binary..but showing following error: strings: object: malformed object (unknown load command 19) any other way read hardcoded information ios application's binary file the ipa file not binary. it's zip archive have extract in order obtain app bundle directory, in resides actual executable. even executable isn't well-formed. it's encrypted appleid of user has downloaded it. need decrypt before being able run strings on (you can use popular ios application cracking tools purpose).

python - Syndication feeds using Django -

how import details other websites using syndication feeds using django. new django python. in blog need use feeds concept. please give examples that. this should start: adding rss feeds django application . also, make sure read django syndication feed framework

CSS position select box overridden -

Image
i want have dropdown select box under programs menu, been overridden, please refer image attached: edited: here's code select box <div class="slide" style="width:738px;"> <div class="n_title_black" style="padding-left:0;">programs</div> <div class="inner-main_content3" style="height:420px;padding:10px 0;"> <div style="text-align: right; margin: 0px; padding: 0px; position: absolute; top: 90px; left: -6px; z-index: 9;" id="selectgenre"> genre: <select onchange="this.form.submit()" id="filtergenre" name="filtergenre" style="width:220px"> <option selected="selected" value="all">all</option> <option value="7">info/edutainment</option> <option value="8">news/investigation</option><option value="...

parsing - Recursive Descent Parser using Python and PLY -

i apologize basic question but, i'm struggling here. need make recursive descent parser. i'm working in python , using ply. grammar follows: < list > → (< sequence >) | () < sequence > → < listelement > , < sequence > | < listelement > < listelement > → < list > | number would this? way off? end goal read list data structure , print out. def p_list(p) 'list : "("sequence")" | "("")"' def p_sequence(p) 'sequence : list_el","sequence | list_el' def p_list_el(p) 'list_el : list | number' if wondering full solution i'll post shortly. this how i'd it: tokens = ("lbracket", "rbracket", "integer", "float", "comma") # can add other tokens t_lbracket = r'\(' t_rbracket = r'\)' t_integer = r'\d+' t_float = r'\d+\.\d+' t_com...

autocomplete - Emacs ess auto-complete -

i r user, want use r in emacs. but, in trouble customizing ess in emacs. have installed auto-complete packages , latest ess in emacs. when run r in emacs, auto-complete don't work well. when type app, suppose show image in ( http://www.emacswiki.org/pics/static/ess-ac3 ) , in emacs neither of auto-complete nor yellow part shows. my os: ubuntu 12.04 amd64 my ~/.emacs file ;; auto-complete (add-to-list 'load-path "~/.emacs.d/site-lisp") (require 'auto-complete-config) (add-to-list 'ac-dictionary-directories "~/.emacs.d/site-lisp/ac-dict") (ac-config-default) ; ess-site (add-to-list 'load-path "/usr/share/emacs/site-lisp/ess") (require 'ess-site) (setq ess-eval-visibly-p nil) (setq ess-ask-for-ess-directory nil) auto-complete works me setting (setq ess-use-auto-complete t)

ios - unable to change the centre point of a UIImageView -

so, in ios pacman game, after collision detected between pacman , enemy brick method runs. suppose stop game timer, show start button , return pacman start point. method functions correctly except pacman stays , never returns start point, making obvious mistake in changing centre point? -(void)lose{ [self stoptimer]; self.play.hidden = false; _start = cgpointmake(30, 247); self.pacman.center = self.start; [self.pacman setneedsdisplay]; } thanks help, alex if there problem. self.pacman.center = cgpointmake(30, 247);

c# - Using multiple AutoProxyCreator for the same objects -

i using spring.net ioc , aop. seems spring.net not support multiple autoproxycreators. have following classes: [facade] public abstract class abstractfacade{ } [transactionsupportfacade] public abstract class abstracttransactionsupportfacade{ } some classes inherited above classes, have following xml configuration: <object type="spring.aop.framework.autoproxy.attributeautoproxycreator , spring.aop"> <property name="attributetypes"> <list> <value>common.attributes.transactionsupportfacadeattribute, common</value> </list> </property> <property name="interceptornames"> <list> <value>jutransactioninterceptor</value> </list> </property> <property name="checkinherited"> <value>true</value> </property> </object> <object type="spring.aop.framework.autopr...

codeigniter - How to remove dynamic url breadcrumb using Codeignitor breadcrumb helper -

i using codeigniter breadcrumb helper https://bitbucket.org/cahva/codeigniter-autocrumb/src/59a0dbe8aba2/helpers/breadcrumb_helper.php set simple breadcrumb. 1 of url follows, http://example.dev/jobs/c0001/j0002 and here c001 stands customer customer_id 1 , j0002 job job_id 2 , 0001 , 0002 dynamic. breadcrumb page shown follows, home › jobs › c0001 › j0002 but need home › jobs is possible trim last 2 (dynamic) sections? thanks <?php echo set_breadcrumb('',array($this->uri->segment(2),$this->uri->segment(3))); ?> try let me know if works

jsp - How to set the locale using the java variable in <fmt:setLocale> -

i have language code in java variable. want set code setlocale value like <% string lang="en"; %> <fmt:setlocale value="${lang}" scope="session"/> but not working correctly. when set like <fmt:setlocale value="en" scope="session"/> ,it working perfectly. language may es,de... want set value <fmt:setlocale value="${lang}" scope="session"/> . is solutions? please me. as mentioned in comment use set tag <c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pagecontext.request.locale}" scope="session" /> <fmt:setlocale value="${language}" /> see here full description how internationalize java web application?

failing tests - GTEST LINK ERROR -- LINK : fatal error LNK1104: cannot open file 'gtest_maind.lib;gtestd.lib; -

hi facing below error while trying set gtest gtest link error -- link : fatal error lnk1104: cannot open file 'gtest_maind.lib;gtestd.lib; tried cleaning, rebuilding gtest sln using vs2005. followed instructions provided in below links.. still error exists how setup google c++ testing framework (gtest) on visual studio 2005 http://www.youtube.com/watch?v=mzszwqommrs http://blog.afonseca.org/2010/09/20/gtest_vs_tutorial/

How does perl recognise end of variable while printing? -

how perl recognise end of variable? for example, code: use warnings; $a = 10; print "value of $a:::"; output: use of uninitialized value $a:: in concatenation (.) or string @ tryprint.pl line 6. value of : why consider $a:: , not $a: or $a::: this works: print "value of $a\:::"; prints: value of 10::: :: used print/access variable package/symbol table. eg, access scalar variable x in package abc, perl uses $abc::x abc name of symbol table , x variable. similarly, when used $a::: , perl thought there package name ' a ' , variable name : , , hence error. see example below: our $a = 10; { $a=20; print "lexical $a \n"; print "value of $main::a"; }

Trying to get "current user" in Rails -

in /views/layouts directory, how current user? using devise, current_user not work here reason, describes unknown method. want like: <% if user.role? == "gen_admin" %> <li> <%= link_to('admin', users ) %> </li> <% end %> i have role? method defined in user model, still exception: undefined method 'role?' #<class:0x3fcc1e0> so how can current user, , access fields @ level of source tree? thanks! here roles? method: # in user roles = %w[gen_admin teacher_admin student] def role?(base_role) roles.index(base_role.to_s) <= roles.index(role) end your code must account when users logged in, , when not logged in. if no user logged in, current_user return nil (as in case, thought error on devise's part). your view code must handle - eg. <% if current_user.present? && current_user.role?('gen_admin') %>

fbdialogs - Facebook Invite Friend Dialog app_non_users filter seems to have no effect -

i building facebook application sits in facebook page tab (and has canvas url hook.) trying implement app_non_users filter. when introduce filter, here see: in both ['all'] , ['app_non_users'] shown (including have authorized app) in ['app_users'] setting, no 1 shown. i not running on mobile, , passing parameter in expected json form (proved fact facebook doing different things different values.) i not using other conflicting filters or "to" parameter. when inspect network tab, see following params being passed fb: message:invite message title:select list of friends filters:['app_non_users'] api_key:xxxxxxx app_id:xxxxxxxx locale:en_us sdk:joey display:async frictionless:false redirect_uri:https://xyz.com __d:1 __user:xxxxxxxx __a:1 __dyn:798ad5z5ccu-webw __req:9 based on above results, seems me facebook doesn't consider app authorization mean user app_user. so, makes user app_user , how i, app dev, make change? ...

net-ldap authentication format in rails? -

def authenticate(username, password) require 'net-ldap' ldap = net::ldap.new ldap.host = 'server.local' ldap.port = 389 ldap.base = 'cn=users, dc=server, dc=local' ldap.auth username, password if ldap.bind puts "authentication succeeded" else puts "authentication failed" end the above code use in method , not sure why attempts fail. trying authenticate user. not find going wrong? puts authentication failed every time. why? please me. first see if computer using can talk ldap server telnet server.local 389 obviously want replacing server.local actual server details. if can't log server way port 389 isn't open , may need running on ssl port 636. try previous command 636 rather 389 see if case. if unable telnet server on either of ports you've either got firewall rule blocking talking it, ldap configured on non st...

Prolog, "or" operator for rule statments -

i new prolog , want make rule statement whether 2 people cousins. this current code, added "or" need or operator: cousins(e, f) :- siblings(a, c) or siblings(a, d) or siblings(b, c) or siblings (b, d), parent(a, e), parent(b, e), parent(c, f), parent(d, f). i need 1 of siblings() pass, parent() must pass. in prolog, "or" operator ; . or can achieved having different clauses predicate. let's see happens if first alternative turns out hold: cousins(e,f):- siblings(a, c), parent(a, e), parent(b, e), parent(c, f), parent(d, f). or , happens if 2nd holds? cousins(e, f) :- siblings(a, d), parent(a, e), parent(b, e), parent(c, f), parent(d, f). similar 3rd , 4th: cousins(e, f) :- siblings(b, c), parent(a, e), parent(b, e), parent(c, f), parent(d, f). cousins(e, f) :- siblings (b, d), parent(a, e), parent(b, e), parent(c, f), parent(d, f). now have "or" condition expressed 4 clauses. but must have left many i...

error in using WinBUGS from R -

the code following: require(brugs) require(r2winbugs) model<-function(){ for(i in 1:n){ y[i] ~ dnorm(x[i], sigma.y) } x[1] ~ dnorm(theta[1], sigma.y) theta[1] <- 0 for(j in 2:n){ x[j] ~ dnorm(theta[j], sigma.x) theta[j] <- b*x[j-1] # row wrong, # right when set theta[j] <- 1*x[j-1] } ~ dunif(0, 1) b ~ dunif(-1, 1) sigma.y ~ dgamma(0.1, 0.1) sigma.x ~ dgamma(0.1, 0.1) } data <- list( n <- 100, y <- rnorm(100)) data=list(n=100,y=rnorm(100)) inits=function(){ list(sigma.x = rgamma(1,0.1,0.1), sigma.y = rgamma(1, 0.1, 0.1), = dnorm(1, 0, 1), b = dnorm(1, -1, 1)) } parameters=c("a", "b", "x") write.model(model, con = "model.bug") modelcheck("model.bug") # model syntactically correct ret.sim <- bugs(data, inits, parameters, "model.bug", n.chains = 1, n.iter = 1000, program= "winbugs", working.directory = null, ...

java - JMS, MQ Exception in WebSphere -

i getting exception when trying read message websphere mq via mdb, can 1 please guide me.when deploy ear file on websphere works flawlessly getting exception on different websphere. missing in configuration, why exception occur? javax.ejb.ejbexception: injection failure; nested exception is: java.lang.illegalargumentexception: can not set javax.jms.connectionfactory field com.ultramatics.hawkeye.mdb.listener.hawkeyemdblistener.replycf com.ibm.mq.jms.mqqueue you trying assign connectionfactory field mqqueue object, 2 different types. i guess grab them jndi or similar , there might naming mess in configuration?

filter/sum values, not sure how to implement clojure -

i trying "pivot" below data, although trying in excel doesn't seem work. not sure on if have logic right. need convert dataset dataset b. a date medal value1 value2 value3 value4 2013-03-08 silver 0 6052 0 0 2013-03-04 bronze 0 0 0 0 2013-03-04 bronze 0 0 0 0 2013-03-04 bronze 0 0 0 0 2013-03-04 bronze 0 1437 0 0 2013-03-01 bronze 0 0 240 0 2013-03-01 silver 0 0 0 0 2013-03-01 bronze 0 0 0 0 2013-03-01 bronze 0 173 0 0 2013-03-08 silver 0 0 0 271 2013-03-04 silver 0 2547 0 0 2013-03-04 bronze 0 495 0 0 2013-03-04 gold 279 0 0 0 2013-03-02 silver 0 0 0 0 2013-03-01 bronze 0 0 0 0 2013-03-01 silver 0 0 0 0 2013-03-01 bronze 0 0 0 0 2013-03-01 bronze 0 20 0 0 2013-03-03 silver 0 0 0 0 b medal value1 value2 value3 value4 bronze 0 2125 240 0 gold 279 0 ...

c++ - How to check Palindromic lists -

i know how can write function determine if list read in bellow code palindromic? e.g if list of numbers 123456 program print out "this list not palindrome" , if list 12321 print out "this list palindrome". any appreciated. void poparray(int array1[]) { ifstream infile("test1.txt"); if (!infile) { cout << "can't open file: " << endl; exit(exit_failure); } (int = 0; < 10; i++) { infile >> array1[i]; cout << setw(2) << array1[i]; } } void reverselist(int array1[]) { (int x = 9; x > -1; x--) { cout << setw(2) << array1[x]; } } i'd suggest using index i , have go 0 size/2 . inside loop comparing list[i] == list[(size - 1) - ] .

c# - ASP.NET Web Application with multiple database support -

we developing asp.net web based application, example if want deploy same web application ms access end or sql end, data access layer should use should configurable. if go below architecture model employee id name dal employeeaccessdb (uses inline queries) getall getbyid insert update delete employeesqldb (uses stored procedures) getall getbyid insert update delete page (uses employeeaccessdb / employeesqldb) objectdatasource selectmethod="getall" typename=" < employeeaccessdb / employeesqldb >" insert update delete so if use access end page should use access dal , if use sql page should use sql dal. please let me know how can make configurable. please web.config configuration , in dal read value form web.config , make nessesary call database you'll need add reference system.configuration. should using configurationmanager string activedatabase = configurationmanager.app...

c++ - Why does this snippet produce no output -

i reading use python scientific computing , , decided test code myself. c++ code (with bit modification) #include <cstdlib> #include <ctime> #include <iostream> #include <cstring> int main() { std::clock_t begin = std::clock(); double a1[500][500]; double a2[500][500]; double a3[500][500]; memset(a1, 0, 500*500*sizeof(double)); memset(a2, 0, 500*500*sizeof(double)); memset(a3, 0, 500*500*sizeof(double)); int i, j, k; for(i = 0; < 500; i++) { for(j = 0; j < 500; j++) { for(k = 0; k < 500; k++) { a3[i][j] += a1[i][k] * a2[k][j]; } } } std::clock_t end = std::clock(); std::cout << (double)(end - begin) / (double)clocks_per_sec<<std::endl; return 0; } it simple code, weirdly no output @ generated. not 0, nothing. tried vc11 , mingw 4.7, both produce nothing. when for loop inside removed code produce output, 0. and if debug in v...

python - Invalid Syntax class Template(metaclass=_TemplateMetaclass) with mod_wsgi, apache and sqlalchemy -

Image
i have script import: from bottle import route, request sqlalchemy import create_engine, metadata sqlalchemy.ext.declarative import declarative_base sqlalchemy.orm import sessionmaker sqlalchemy import table, column, integer import xml.etree.celementtree et @route('/getmember') def get_member(): pass run(host='localhost', port=8080, reloader=true) i can run script using bottle build in web server: $python3.2 getmember.py that done want run app using apache , mod_wsgi , create script called adapter.wsgi : import sys, os, bottle sys.path = ['/var/www/getmember/'] + sys.path os.chdir(os.path.dirname(__file__)) import getmember application = bottle.default_app() in apache have: wsgidaemonprocess getmember user=www-data group=www-data processes=1 threads=5 python-path=/usr/lib/python3.2/site-packages wsgiscriptalias /getmember /var/www/idcheck/adapter.wsgi <directory /var/www/getmember> wsgiprocessgroup getmember wsgiapplicationgr...

python - How to construct regex for this text -

here's input: 7. data 1 1. str1 str2 3. 12345 4. 0876 9. no 2 1. str 2. strt str 3. 9909090 5. yes 6. no 7. yes 8. no 9. yes 10. 5000 xx 11. 1000 zŁ 12. no prub. 1 1. 1000 xx 2. no 3 1. strt 2. strt 3. 63110300291 5. yes 6. no 7. no 8. no 9. yes 10. 5000 xx 11. 1000 zŁ 12. no prub. 1 1. 1000 xx 2. no 4 1. qweret 2. iostr9 3. 76012509879 5. yes 6. no 7. no 8. no 9. yes 10. 5000 xx 11. 1000 xx 12. no prub. 1 1. 1000 xx 2. no 0 1. and here's expected output: [('1', '1. str1 str2 3. 12345 4. 0876 9. no'), ('2', '1. str 2. strt str 3. 9909090 5. yes 6. no 7. yes 8. no 9. yes 10. 5000 xx 11. 1000 zŁ 12. no prub. 1 1. 1000 xx 2. no'), ('3', '1. strt 2. strt 3. 63110300291 5. yes 6. no 7. no 8. no 9. yes 10. 5000 xx 11. 1000 zŁ 12. no prub. 1 1. 1000 xx 2. no'), ('4', '1. qweret 2. iostr9 3. 76012509879 5. yes 6. no 7. no 8. no 9. yes 10. 5000 xx 11. 1000 xx 12. no prub. 1 1. 1000 xx 2. no')] i've tried thi...

Line replace two values python django -

i want line replace 2 values in same file. want search 'input="default"' , replace value 'this' , pattern="default" 'now'. have created tmp form code reads values , writes file.am new django , python.at moment writing 1 value. views.py with open('/home/usr/dev/django/rulebase/test_pattern_tmp.rb', 'r') pattern_reading: lines = [line.replace('pattern = "default"','now') line in pattern_reading.readlines()] lines = [line.replace('input = "default"','this') line in pattern_reading.readlines()] open('/home/usr/dev/django/rulebase/test_pattern.rb', 'w') pattern_reading: pattern_reading.writelines(lines) the solution is: with open('/home/usr/dev/django/rulebase/test_pattern_tmp.rb', 'r') pattern_reading: open('/home/usr/dev/django/rulebase/test_pattern.rb', 'w') pattern_writing: line in pattern_...

android - how to add Custom Fonts in ActionBar? -

i using sherlock action bar want use custom fonts on action bar in 3 places title tabs menu items. if has used custom fonts, please share on how can done. hello please first googling or searching on stackoverflow: how set custom font in actionbar title? it has details easy implement please dont ask when not needed, of questions asked.

javascript - JSON does not post data to the requested URL -

trying post data @ url: " $(function() { var frm = $(document.myform); var data = "?lm_po_id=154668&authentication=thisisauth&description=thisisdesc";//json.stringify(frm.serializearray()); //var data = json.stringify(frm.serializearray()); // tried alert(data + "i post this:\n\n" + data); $.postjson = function (url, data, callback) { $.ajax({ 'url': frm.attr("action"), 'type': 'post', 'processdata': false, 'data': json.stringify(data), contenttype: 'application/json', success: function (data) { callback(json.parse(data)); }, }); }; }); this call right function when check in debug mode parameters have null values, can 1 me wrong doing. here html form <form action=...

hyperlink - Link to detail page of tt_news is not updated -

i edited title of news: old link: www.domain.com/news/article/some-article-name.html new link: www.domain.com/news/article/test.html now wanted change title url this www.domain.com/news/article/some-article-name.html but still old url: www.domain.com/news/article/test.html i generate link tt_news detail page follows: $typolink_conf = array( "title" => '', "atagparams" =>'', "no_cache" => 0, "parameter" => 25, "additionalparams" => '&tx_ttnews[tt_news]=' . $data['uid'], "usecachehash" => 0 ); $link = $this->cobj->typolink_url($typolink_conf); $link = $globals['tsfe']->tmpl->setup['config.']['baseurl'] . $link; i tried clear caches, clear cache real_url , on. i'm doing wrong? that must cache problem. did delete unique aliases tt_news? go to: web -> info -> realurl mana...

Singleton class method in static library in iOS -

i have static library contains singleton class method, call in (ibaction) function, first time call ok, second crashed, , no error information, singleton class method follows: +(myclass *)sharedclient{ static myclass *_sharedclient = nil; static dispatch_once_t oncetoken; dispatch_once(&oncetoken, ^{ _sharedclient = [[[myclass alloc] init] autorelease]; }); return _sharedclient; } and call follows: -(ibaction) action { [myclass sharedclient] action]; } you're sending autorelease new object inside shared accessor. next time autorelease pool pops, shared object released , destroyed. remove autorelease, , crash should fix itself.

objective c - How to find and hide the NSView? -

view1.h file @property(nonatomic,strong) nsview *aboutview; in view1.m file created nsview aboutview = [[nsview alloc]initwithframe:nsmakerect(6, 6, width -12, height -29)]; [aboutview sethidden:yes]; [view addsubview:aboutview]; nsimageview *imgl=[[nsimageview alloc]initwithframe:nsmakerect(0, 0, width -12, height -29)]; [imgl setimagealignment:nsimagealignbottomleft]; [imgl setautoresizingmask:nsviewwidthsizable | nsviewheightsizable]; [imgl setimagescaling:nsimagescaleaxesindependently]; [imgl setimage:[nsimage imagenamed:@"yuan"]]; [aboutview addsubview:imgl]; nsview in buttoncontroller.m how find , hide nsview ? -(void)mouseup:(nsevent *)theevent{ nsview *aboutview = [(view1 *)self.superview.window aboutview]; [aboutview sethidden:no]; } how -(void)mouseup:(nsevent *)theevent{ view1 *viewobj=(view1 *)self.superview.window; nsview *aboutview = [viewobj aboutview]; [aboutview sethidden:yes]; }

asp.net - Add gridview nested dropdown.selectedValue to database -

Image
i have 2 tables relevant question... tblcelltechnology celltechnologyid, pk description cellname tblactionschedule actionid, pk actionphase actionperiod celltechnology, fk i have bulk edit grid view text boxes displaying actionid, phase, period , dropdownlist linked directly celltechnologyid tblcelltechnology (as per image). have textbox displaying cell name based on value in tblscheduleaction.celltechnologyid (actiondescription pulled table). how can selected value ddl , write tblscheduleaction.celltechnologyid? when hard add celltechnologyid tblscheduleactionid, cellname textbox displays correct value. need able store ddl.selectedvalue tblscheduleaction.celltechnologyid. using masterpages , sqldatasources handle inserting/updating/deleting of records. i want celltechnologyid column in bottom gridview display list of potential celltechnologyid, directly linked column top grid view, selected value should stored in tblscheduleaction.celltechnologyid. cellname ...

VBA excel for existence of image format of type jpg -

lets have spreadsheet in excel named test.xls , inside column named column1 values image1, image2, etc. , have folder named images, contain images of type jpg, named values in column image1.jpg, image2.jpg, etc. need vba code check if images exist in folder based on spreadsheet column. thank you! this example display search results in column. edit variables , don't forget last \ in folder path. sub checkfiles() dim count&, lastrow& dim folderpath, columnread, columnwrite string folderpath = "c:\example\" columnread = "a" columnresults = "b" lastrow = thisworkbook.sheets(1).range(columnread & rows.count).end(xlup).row count = 1 lastrow range(columnread & count).activate if dir(folderpath & range(columnread & activecell.row).value) <> "" range(columnresults & activecell.row).value = "file exists." else range(columnresults & activecell.row...

Java - Generic Static Methods -

i have been trying understand whether possible make method infers generic type based on return class , calls static method of generic type. i.e. below create 2 classes both of implement getinstances , getallinstances methods. attempt create use methods generic wrapper. appears super class method being run regardless of return type. for example, public class parentclass { public parentclass(){} public static <t extends parentclass> t getinstance(){ return (t) new parentclass(); } public static <t extends parentclass> list<t> getallinstances(){ arraylist<parentclass> parents = new arraylist<parentclass>(); for(int i=0;i<5;i++){ parents.add(new parentclass()); } return (list<t>) parents; } } subclassa public class subclassa extends parentclass{ public subclassa(){} @suppresswarnings("unchecked") public static subclassa getinstance(){ ...

javascript - jQuery Set Height of Element to Highest in the group -

i'm trying work jquery find highest element first 3 elements within div set 3 same height check next 3 , set them.. etc.. if window width == x, if window width < x find highest 2 elements set them, next 2 next 2 etc. this current code works elements, to go through elements in groups (2's , 3's) , set height group based on result , window size. // find highest element , set elements height. $(document).ready(function () { // set options var height = 0; var element_search = "#cat_product_list #cat_list"; var element_set = "#cat_product_list #cat_list"; // search through elements set , see highest. $(element_search).each(function () { if (height < $(this).height()) height = $(this).height(); //debug_(height,1); }); // set height element(s if more one). $(element_set).each(function () { $(element_set).css("height", (height+40) + "px"); }); }); any appr...

Getting an error while playing a video using VideoView in android -

in application want show video online streaming video not start , getting error "sorry video can not played" , logcat error couldn't open file on client side trying server side , mediaplayer error (1,-1004) what mean. first check have added internet permission in manifest. next, check extension of video format. here can check files android phones , tablets support, both codec , filename extension information provided. if want play videos on android, find multi-format video player or convert videos android compatible formats.

jquery - When one dropdown is opened close another -

i have 2 drop-down menus mobile responsive site, 1 blog categories , drop-down search box. these work fine when open one, can little messy. have been looking when 1 open , user clicks open another, listen out , close it. have had research , have found functions use 'parent' , 'child' not sure how can apply snippet of code. have looked removing classes nothing seems trick. if has suggestions problem i'd grateful. html <div id="nav-mobile-responsive"><!--mobile navigation--> <div class="categories-mobile-responsive"> <ul id="nav-1"> <li> <h3></h3> <ul> <?php wp_list_categories('&title_li=') ?> </ul> </li> </ul> </div> <div class="searchbar-mobile-responsive"...