Posts

Showing posts from February, 2012

Joomla Custom component with sample form in admin -

i need sample form in administrator having add,edit,delete options manage "success stories" in web app. i searched sample component install. if that, change form according app & table too. please me giving link resource suits requirement. sorry ask this, new joomla. thanks in advance, sunil. take @ joomla component creator: http://www.notwebdesign.com/joomla-component-creator/

c++ - std::stringstream does not name a type (Global) -

i'm doing simulation of few ising models (lattice 1 or -1) , don't want use files (don't gonna details here, guess :d). so, thing is, i'm using stringstreams format data & data's filename separate them bash. show example code #include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <sstream> #include <string> using namespace std; void print2bash(string file, string data); int main(int argc, char *argv[]){ int i, j, n = atoi(argv[1]); // want put outside main() { stringstream ssbash; ssbash.clear(); ssbash.str(""); stringstream ssfile; ssfile.clear(); ssfile.str(""); //} // don't have ss.clear , ss.str("") every time before using them ssfile << "this_" << n << "_is_the_filename.dat" << endl; for(i = 0; < n ; i++){ for(j = 0; j < n; j++) s...

xml - Java Xpath query failing on compile -

i have following xml document: <application xmlns="http://www.example.com/schemas/app-config/1.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.example.com/schemas/app-config/1.0 http://www.example.com/schemas/app-config/1.0/app-config-1.0.xsd"> <info name="dummy application" runningon="dev"/> </application> when run following code: xpathfactory factory = xpathfactory.newinstance(); xpath xpath = factory.newxpath(); xpathexpression expr = xpath.compile("/application/info@name"); i xpathexpressionexception on compile method. exception's message " null ". looks i'm correctly using xpath locate name attribute, i'm wondering if xmlns , xsi declarations causing problems here? if not i'm totally clueless , have no idea what's causing exception. one thing - how can compile failing before ever associate xpath instance ac...

authorization - How does a XACML PEP interact with a context? -

my question has role , purpose of xacml context handler. if understand oasis xacml3.0 spec properly, pep intercepts request resource or access client app uses context handler create native xacml context object suitable pdp process. in design, have context handler global class methods create request objects , parse xml results. envision class looking this: public static class contexthandler { public static bool createpolicy(policytype policyname) { // serialize policytype xml document } public static policytype loadpolicy(string policyname) { // 1. load policy db, filesystem... // 2. hydrate/deserialize xacml policy object // 3. return policytype object } public static requesttype buildrequest( dictionary<string, string> subjects, dictionary<string, string> resources, dictionary<string, string> actions, dictionary<string, string> environment) { ...

asp.net mvc 3 - Manage multiple calls of Membership.GetUser().ProviderUserKey; -

i thinking yesterday how solve issue, because give or check user depended of provideruserkey (id). so made 1 static function public static guid getuserid() { string userid = string.empty; if(httpcontext.current.session["userid"] != null) { userid = httpcontext.current.session["userid"].tostring(); } if(!string.isnullorempty(userid)) { return new guid(userid); } userid = membership.getuser().provideruserkey.tostring(); httpcontext.current.session["userid"] = userid; return new guid(userid); } main point of class reduce database connections check/get user id. my problem function not not working, problem if logged user log out , log account? or better add session value on log in , clear session value on log out? where can see other problem kind of "get user id"? if log user out should killing session. when login user have session reinitialized. note you'll wa...

Why do tools like yacc and ANTLR generate source code? -

these tools input grammar , output code processes series of tokens more useful, syntax tree. these tools written in form of library instead? reason generating source code output? there performance gain? more flexible end user? easier implement authors of yacc , antlr? sorry if question vague, i'm curious historical reasons behind decisions authors made, , purpose auto-generated code has in today's environment. there's big performance advantage achieved parser generator working out interactions of grammar rules respect 1 another, , compiling result code. one build interpreters accepted grammars , did parsing; there parser types ( earley ) relatively @ that, , 1 compute grammar interactions @ runtime (earley parsers kind of anyway) rather offline , execute parsing algorithm. but pay parsing performance penalty of 10 100x slowdown, , big storage demand. if parsing using small grammars, or parsing small documents, might not matter. grammars many parser gen...

ruby on rails - Phusion Passenger error with rvm -

i have rails 2 app im upgading rails 3. installed rvm can run both app @ same time. the rails 3 app works fine. when try revive rails 2 app error. processing applicationcontroller#index (for 122.179.134.45 @ 2012-06-04 09:56:46) [get] argumenterror (wrong number of arguments (1 2)): <internal:prelude>:10:in `synchronize' passenger (3.0.12) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request' passenger (3.0.12) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request' passenger (3.0.12) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop' passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler' passenger (3.0.12) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `block in handle_spawn_application' passenger (3.0.12) lib/phusion_passenger/utils.rb:479:in `safe_fork' passenger (3.0.12) lib/phusion_passenger/class...

lua - Button removal in Corona -

i'm trying nest pages , such button presses in app working on. however, widget, carries on , such , must removed using display.remove() or :removeself. i'm trying make these buttons delete/remove view pressed , next page loaded, when either not work, or throws runtime error. suggestions? edit: using, although leaves button gone permanently after click. ` local onbuttonevent = function (event ) if event.phase == "release" display.remove( mybutton ) mybutton = nil display.remove( buttongroup ) buttongroup = nil storyboard.gotoscene( "shape" ) end end here's way. why don't set mybutton.isvisible = false inside onbuttonevent function. and i've never used storyboard, i'm pretty sure there event fired ("willenterscene" think) when enter scene. so can set mybutton.isvisible = true there

MATLAB to Python Conversion, matrices and lists -

how translate following python matlab? i'm still trying wrap head around lists/matrices , arrays in numpy, etc. outframe(:,[4:4:nout-1]) = 0.25*inframe(:,[1:n-1]) + 0.75*inframe(:,[2:n]) pos=(beamnum>0)*(beamnum<=nbeams)*(binnum>0)*(binnum<=nbins)*((beamnum-1)*nbins+binnum) index =1:512: outarray(index,:) =uint8(interp1([1:n],inarray64(index,:),[1:.25:n],method)) (there's other stuff, these particular statements i'm not sure how make sense of. have numpy imported, the main workhorse in numpy ndarray (or array). part replace matlab matrices when translate code. matlab matrix, ndarray stores homogeneous data (ie float64) , optimized numerical operations. the numpy matrix subclass of ndarray can convenient linear algebra intensive applications. here more info differences between two. the python list more matlab cell array (though not same). it's 1 of basic python data structures, in scientific applications find comes when need hold hete...

xml - Group child nodes into group of 4 -

i have following xslt, using identity transform because need keep xml intact , change specific section of xml i.e: <committee committeetype="associate"> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output indent="yes"/> <xsl:strip-space elements="*"/> <!--identity transform.--> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="committee[@committeetype='associate']/affiliation"> <committee committeetype="associate"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </committee ...

dataset - View large data set on the R console -

is there way view large data set [1380160 obs. of 44 variables] in full on r console ? i have changed print limit using options(max.print=...) , however, cannot see full data set, i.e. right first row last there no way scroll through data. use view function (note capitol 'v'), open data frame, matrix, or other table object in new window in spreadsheet style format can scrolled viewing data (but not editing). window independent of console can continue issue commands without having close viewing window (however changes data object not seend in viewing window, need close window , run view again see changes). if want edit data in spreadsheet window use edit or fix (but these cannot run other commands until close editing window). some of gui's r have tools viewing or editing data objects scrolling.

java - Get notified when a JMS message is consumed -

is there way notified when jms message consumed jms queue? listener or notification? thanks i assume using activemq since tagged question it. you can register advisory notification when message consumed client. see docs advisories , 1 you're looking activemq.advisory.messageconsumed.queue . ===== update ===== oh, errr.. you're using joram, not activemq. it's not simple, use client side interceptor return acknowledgement message queue or topic listen on. interface looks this: public interface messageinterceptor { public void handle(javax.jms.message pmessage, javax.jms.session psession); } see chapter 3.5. message interceptors of latest joram doc pdf . you use interceptor_out server side interceptor.

iphone - Add Row to TableView from another UIView -

i have uiviewcontroller save button. when click add string array in uitableviewcontroller . have segue goes table view , want new object in array display row in table. how can data view controller show on table view controller? what doing isn't working. uiviewcontroller: - (void) prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender{ if([[segue identifier] isequaltostring:@"showfindtable"]) { findtableviewcontroller *findtablevc = [segue destinationviewcontroller]; findtablevc.titles addobject:titlefield.text]; [findtablevc.tableview reloaddata]; } } uitableviewcontroller: - (void)viewdidload { [super viewdidload]; self.titles = [[nsmutablearray alloc] init]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"findcell"; findtablecell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifi...

extjs - Proxy JsonP and callbackkey -

im near finish app , when try put in onlin server find problems... my proxy don't work ajax issue, need put jsonp , configure drupal use jsonp. before: proxy: { type: 'ajax', url: 'http://mydomain/json-art', reader: { type: 'json', rootproperty: 'nodes' }, } after: proxy: { type: 'jsonp', url: 'http://mydomain/json-art', callbackkey: 'callback', reader: { type: 'json', rootproperty: 'nodes' }, } then in drupal 7 put... jsonp prefix: ext.data.jsonp.callback1 and.. works fine. but.. have 4 stores in app, , try reply configuration in other stores. , works first one. try change callback1 callback2, callback3, etc.. have same error: object [object object] has no method 'callback4' i don't know whats correct way use callbackkey in app...

mysql - SQL Get All Results That Relate To All Keys -

i've got table relates words each other. table_word_relationships +-------------+-------------+ | word_a | word_b | +-------------+-------------+ | cat | dog | +-------------+-------------+ | cat | rabbit | +-------------+-------------+ | owl | cat | +-------------+-------------+ | bird | dog | +-------------+-------------+ | dog | banana | +-------------+-------------+ | banana | cat | +-------------+-------------+ i need run 2 types of queries on it. 1 easy. give me words relate word "dog" "select * table_word_relationships word_a = 'dog' or word_b = 'dog'"; the result be: cat bird banana the second 1 one having trouble with... need query words have relationship of words in array of words... so, in english "give me words have relationship word "dog" , have relationship word "cat" results be: banana b...

c++ - CSparse: getting element of sparsed marix -

is possible ask element (i,j) in csparse cs object , value or 0 if not filled? should write function myself or there solution in csparse? lack of documentation made me sad. here reference code: timothy davis, direct methods sparse linear systems, siam, philadelphia, 2006. here source you're right. documentation poor. let see if cannot generate rough documentation of our own. copying directory http://www.cise.ufl.edu/research/sparse/csparse/csparse/source/ one's own pc, entering directory, , issuing command sed '/^[^[:space:]#{}]/!d;/^\//!a\\' *.c yields /* c = alpha*a + beta*b */ cs *cs_add (const cs *a, const cs *b, double alpha, double beta) /* clear w */ static csi cs_wclear (csi mark, csi lemax, csi *w, csi n) /* keep off-diagonal entries; drop diagonal entries */ static csi cs_diag (csi i, csi j, double aij, void *other) { return (i != j) ; } /* p = amd(a+a') if symmetric true, or amd(a'a) otherwise */ csi *cs_amd (csi ...

ajax - Generic Loading Icon in Dojo -

i'm giving maintenance application makes several ajax calls with: dojo.xhrpost() , dojo.xhrget() and want add generic loading "icon + message" calls on system.. seance system find difficult , low maintainable add loadingfunction call load:function of xhr so wander if there way add listener ajax calls on system everytime made call show loading... i read can aspect in 1.7 application i'm working on dojo version of 1.6 so if know way show generic message ajax calls.. . thanks in advice.. you can achieve via dojo/topic , namely io pipeline topics , works since dojo 1.4. see working example @ jsfiddle: http://jsfiddle.net/phusick/cmhdt/ first of have globally enable io pipeline topics, set iopublish: true in 1 of dojoconfig , data-dojo-config or djconfig (depends on use). then dojo.subscribe() specific topics, e.g.: dojo.subscribe("/dojo/io/start", function(e) { dojo.style(throbbernode, "display", "block...

c# - multiple file reading issue -

i having multiple text file different name in single folder . want read file 1 one -->> * read second file after finishing 1st . after reading should delete file directory .i able read single file . when trying read files in 1 shot giving error . how can use thread reading , delete file. file having same format . my sample code : streamreader objreader = new streamreader("c:\codeo\testm.txt"); string sline=""; arraylist arrtext = new arraylist(); while (sline != null) { sline = objreader.readline(); if (sline != null) arrtext.add(sline); } objreader.close(); foreach (string soutput in arrtext) console.writeline(soutput); console.readline(); for del : private void btndelete_click(object sender, eventargs e) { if (file.exists(fileloc)) { file.d...

backbone.js - Backbone fetch success callback -

i'm new backbone.js , i'm having issues giving collection success callback. i'm overriding fetch in order have url parameter in it. understand should able assign success callback in options pass backbone.collection.prototype.fetch.call()... but, code isn't working. fetch works correctly, callback function not called. here bit of code: app.chartcontroller = { load: function(userconceptid) { app.chartpointlist.fetch(userconceptid); } }; app.chartpointlist = backbone.collection.extend({ model: app.chartpoint, url: function() { return '/chartpoints/' + this.userconceptid; }, fetch: function(userconceptid, options) { console.log("fetch chart point"); typeof(options) != 'undefined' || (options = {}); options.success = this.postprocess; options.error = this.handleerror; this.userconceptid = userconceptid; return backbone.collection.prototype.fetch.call(this, options);...

android - Taking a picture and storing it to internal storage -

i'm trying take picture , when user clicks button, want save picture internal storage. testing on tablet not have sd card. i'm new taking pictures on android , web has been no trying find specific code need write somewhere other sd card. here camera.java looks like. package com.test; import com.test.r; import java.io.filenotfoundexception; import java.io.fileoutputstream; import java.io.ioexception; import android.app.activity; import android.hardware.camera; import android.hardware.camera.picturecallback; import android.hardware.camera.shuttercallback; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.framelayout; public class camera extends activity { private static final string tag = "camerademo"; camera camera; preview preview; button buttonclick; /** called when activity first created. */ @overr...

ruby - how to make resque process jobs ordered -

i have queue process 'products' thar sent via json. receive them in order {1, 2, 3, 4}, resque processed them in {1, 3, 2, 4}. pretty important resque process ordered because old version of product can override new version thar processed there way tell resque process {job} orderede {job.field_i_want} ? edit: code enqueue job def produto if params[:json] # upload = params[:json] # content = upload.read # parsed_json = json(content) parsed_json = json(params[:json]) parsed_json['idfila'] = params[:idfila] logger.info parsed_json resque.enqueue(produtoworker, parsed_json) render json: activesupport::json.encode(retorno.new(:status => "ok", :mensagem => "produto recebido")), :status => :ok else render json: activesupport::json.encode(retorno.new(:status => "erro", :mensagem => "sem json")), :status => ...

Android - how to build webview? -

i using webviews inside of viewflipper display text can full justification , other aspects of html. webview welcometext = new webview(this); welcometext.setverticalscrollbarenabled(false); welcometext.setbackgroundcolor(0x00000000); ((linearlayout) findviewbyid(r.id.welcometext)).addview(welcometext); welcometext.loaddata(getstring(r.string.welcome_text), "text/html", "utf-8"); and xml: <linearlayout android:id="@+id/welcometext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16dip" /> this works great except 1 small annoyance wish eliminate. when switch child view webview first time on opening app, webview height not seem set causes sort of accordion affect (so webview kind of slides place pushing down rest of view). going next child view webview , same happens on one. going previous view works ok view built fully. im not sure if related webcore warning in logcat d...

Backbone.js - How to model a nested list -

i trying model multi-level nested list in backbone , wondering how best model collections/models. i have (in coffeescript) my collection class app.collections.list extends backbone.collection model: app.model.listitem my model class app.model.listitem extends backbone.model defaults: name: "foo" bar: "bar" children: new app.collections.list # doesnt work because need load models before collections parent: # initialized param hash i initialize view e new app.collection.list (of listitem models) gives list of depth 1. when click on listitem want perform http get, can populate it's children with, , on , forth. have 3 levels deep grow deeper. should use supermodel [1] or backbone-relational [2]? [1] http://pathable.github.com/supermodel/ [2] https://github.com/pauluithol/backbone-relational

ssas - Should ID be in User Hierarchy? -

i have seen go both ways in different implementaions. in hierarchy there let's 6 levels bottom level id (example productid), there product name unique. tend think id not need in hierarchy if product name "human" identifier. safe take out of hierarchy? update: clear - product dimension has prodid , prodname on each record. join fact table on prodid. hierarchy had both prodid , prodname prodid lowest level. can not remove prodid hierarchy? build hierarchy based on ids , change "namecolumn" property of attribute name, can see user friendly name being calculated id

Outer Join statement in LINQ -

i trying create outer join statement in linq , not having luck. know performing outer join requires 2 steps: (1) convert join group join into (2) use defaultifempty() on group generate null value expect if joined result set empty. i have been using code example: var query = (from p in dc.gettable<person>() join pa in dc.gettable<personaddress>() on p.id equals pa.personid tempaddresses addresses in tempaddresses.defaultifempty() select new { p.firstname, p.lastname, addresses.state }); so tried this: var outerjoin = h in resulthours join u in results on h.key equals u.key outer dictionary in outer.defaultifempty() select new { the problem intellisense doesn't recognize in select new {} statement. i've tried u. , h., dictionary. the problem may running i'm trying outer join 2 dictionaries. doesn't seem that, although told need do. doing wrong or not understanding something. i need join dictionary results.un...

javascript - Controlling ENTER key -

how can make form in page doesn't submit on pressing enter — rather. same work pressing particular button or icon or image? here contents of form: <input type="text" id="txt" /><input type="button" value="search" onclick="searchresult()" /> the problem if press enter , form submits , text field clears function searchresult() doesn't show effect. when pressing button, works well. html <input type="text" id="txt"/> <input type="button" value="search"/> jquery $('input[type=text]').on('keyup', function(e) { if(e.which == 13) { // 13 keycode enter e.preventdefault(); } }) you can bind submit() following $('form').submit(function(e) { // instead of `form`, // use `id` or `class` combination if(e.which == 13) { e.preventdefault(); } }); remainder ...

Is OSGi the right approach for us? -

Image
we have support @ least 2 versions of functionality @ same time. can in web side or services, meaning we'll have different layout different users in web or service implementation different different users. should able route users based on login right version of web application / bundle. we thought of (please see bigger picture here http://i.stack.imgur.com/6nxhf.png ). also possible have multiple web applications / bundles deployed 1 eba? if yes, possible share session between these web apps / bundles? new osgi, looking forward suggestion on design have chosen. appreciate / suggestions on this. thanks, bab. yes, osgi can lot this. the architecture have chosen looks fine, suggest perhaps adding 'sessionmanager' suggested christian. regarding osgi specifics need this: if have 2 different versions of "services" bundle, packaged in same java packages, should define package versions when exporting them in manifests: in services v1: expo...

c - Iteration through linked list leads to Segmentation fault -

i wrote simple linked list, when iterating through list via add() , display() program seg faults. #include <stdlib.h> #include <stdio.h> typedef struct entry { void *value; struct entry *next; } entry; typedef struct list { entry *items; } list; list *create(void) { list *l; l = malloc (sizeof(list)); l->items = malloc(sizeof(entry*)); l->items->next = null; return l; } void add(list *l, void *value) { entry *temp, *last, *new; (temp = l->items; temp != null; temp = temp->next) { last = temp; } new = malloc(sizeof(*new)); new->value = value; new->next = null; last->next = new; } void display(list *l) { entry *temp; (temp = l->items; temp != null; temp = temp->next) { printf("%s\n", temp->value); } } int main(void) { list *l = create(); add(l, "item1"); add(l, "item2"); add(l, "item3...

excel - Copy multiple rows from many sheets to one sheet -

i receive workbook daily lists 50 rows of information per page on variable number of pages depending on how many rows there total. how can copy 50 rows each page onto 1 master list? from recording macro get sub macro2() sheets("page1_2").select rows("5:54").select selection.copy sheets("page1_1").select range("a56").select activesheet.paste end sub but need loop through entire workbook. can't find way increment sheet selection 1 each iteration , paste range 50. any help? how about: sub test() dim currow integer dim activeworksheet worksheet set activeworksheet = activesheet currow = 1 each ws in activeworkbook.worksheets if not ws.name = activeworksheet.name ws.range("5:54").copy destination:=activeworksheet.range(cstr(currow) & ":" & cstr(currow + 49)) currow = currow + 50 end if next ws end sub ...

ruby - Why does RVM install duplicate gems for different gemsets? -

so, i've created separate rvm gemset each of rails projects. both use same version of ruby 1.9.3 . this causes bundle install install fresh set of gems both projects. doesn't matter if other project has exact same version of gem installed in other gemset. i'm guessing expected behavior me seems inefficient use of hard drive space , bandwidth. i know manually move of gems global gemset, seems tedious me , prone breaking if dependencies change particular project. is there better way organize things, or have rvm auto detect when gem version installed , use copy? or there better alternative rvm should using. this design. gemsets allow isolate libraries used don't have accidental interaction between projects. if don't need isolate can use interpreter without gemset: rvm use 1.9.3 if there few gems use across projects, switch global gemset interpreter: rvm use 1.9.3@global gem install common gems , won't re-installed per-project anymore ...

rubygems - Missing Gemfile.lock on creation of rails application -

while creating rails application: user$ rails new app all other files created, i.e. app, config, db, doc, script, test, gemfile, etc find gemfile.lock fails created. particular reason why happening? facing errors in bundling gems, though not know whether absence of gemfile.lock file causing this. please help! you dont lock until after bundle, , whenever there form group of gems built (with dependancies available..) if run: bundle install i think 1 should created you. or bundle update if have lock file , have updated gemset

Alter or Create multiply stored procedures at once from multiply files in SQL Server 2008 -

i have large amount of stored procedures updating , transferring duplicate database on server. have been opening each “storedproc.sql” file within sql server management studio 2008 , selecting execute in tool bar ether create or alter existing stored procedure. have been doing each stored procedure. i looking script (or way) allow me alter of stored procedures on databases ones located in folder @ 1 time. looking script similar pseudo-code text below. use [databasename] update [storedprocname] using [directory\file\path\filename.sql] update [storedprocnamen] using [directory\file\path\filenamen.sql … not cleanest pseudo-code understand idea. willing drop of stored procedures (based on name) , create same stored procedures again on database. if need more clarity don’t hesitate comment, thank in advance. to further explain: i changing every reporting stored procedure ssrs conversion project. once report developed, move report , stored procedure server. have manually r...

eclipse - How to know the size of assembly lines of code between two c++ break points? -

i'm building c++ project under eclipse, , perform cache optimization need estimate if hot spot of code can fit in cache. put 2 break points , triggered eclipse disassembler, looks hard manually count code way.. is there idea more practical way? have compiler emit assembly output. sure release builds, different debug builds. can analyze output manually, , see how memory needed code. you've mentioned eclipse, assume talking gcc under linux, true msvc under windows.

multithreading - Does the runnable class go out of scope when a java thread ends? -

if create object implements runnable, , start thread it... arraylist<thread> threadlist = new arraylist<thread>(); { mergethread mmt = new mergethread(); thread t = new thread(mmt); threadlist.add(mmt); t.start(); } t.join(); thread t = threadlist.get(0); at point mmt guaranteed exist or have gone away if garbage collection got it. what asking if thread object holds on runnable class after thread has ended. edit: there's mistake in above should threadlist.add(t); from source of thread class : /** * method called system give thread * chance clean before exits. */ private void exit() { if (group != null) { group.remove(this); group = null; } /* aggressively null out reference fields: see bug 4006245 */ target = null; /* speed release of of these resources */ threadlocals = null; inheritablethreadlocals = null; inheritedaccesscontrolcontext = null; blocker = null; uncaughtexceptionhandler = null; } so system...

android - Java control Windows Media Player with Java -

i have seen java servers wich can control wmp android device or such. how make server controls wmp. need it? thanks. windows media player supports upnp server discovering , dlna remote controlling. say if want create client app (android or whatsoever using java) remote control windows media player: use upnp discover available wmp server on network zero configuration . use dlna remote control available wmp server on network, example, expose playlist, control volume , etc. java library implements upnp/dlna: cling hope make sense.

java - EJB Glassfish v3.1.2 client passed data to session bean is always null -

i having problem when calling session bean method passing method parameters client application, data reaches method call null or set default value. while process of method works object for example: -we have method persist object entity addstudent(student student); - client create student object setting student fields student name , on, calling method addstudent(ourstudent); ourstudent reaches method fields of null or default value. student added these empty fields. thanks in advance. you using eclipselink weaving, , doesn't work. should try without weaving. editing persistence.xml (s) <persistence-unit name="xxx" transaction-type="xxx"> <jta-data-source>xxx</jta-data-source> <jar-file>or list of classes or else</jar-file> <properties> [other properties] <property name="eclipselink.weaving" value="false"/> </properties> </persistence-unit...

python - Can I make the Django database path (for sqlite3) "cross-platform"? -

i'm in process of learning django , python (as programming in general). sake of simplicity, using sqlite3 database while i'm going through tutorials django , such. i multi-platform user (mac os, windows, linux) depending on @ time. so, have done put programming projects in dropbox can work on same code anywhere. the problem that, in settings.py file particular project, specify database path so: databases = { 'default': { 'engine': 'django.db.backends.sqlite3', # add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'name': 'c:/users/david/dropbox/programming/mysite/database', # or path database file if using sqlite3. ... when i'm using macos or linux, c:/ chokes. wondering if had suggestion of simple remedy this. of course, 1 way set database remotely on webserver via mysql or something, thought there might simple way such 'if' s...

mysql - PHP Pagination Issue -

Image
i have search trying have pagination with. found cool php script, at phpeasystep (yeah, i'm new @ php, , programming.) implemented it, , worked display pagination , go forward page( page 1 page 2), when go page 2 page 1, search query gone , displays every single database entry (but paginated). search query must getting lost somewhere? the code ( when pasted got compacted i've done best indent i'm super sorry if still hard read. if hard read on website got in better indentation...there link above!) <?php $q = mysql_real_escape_string(ucfirst(trim($_get['searchquery']))); ?> <?php require('config.php'); $tbl_name="companies"; $adjacents = 3; $query = "select count(*) num $tbl_name company_name '%$q%' or company_description '%$q%' or cat1 '%$q' or cat2 '%$q' or cat3 '%$q' or company_phone '%$q'"; $total_pages = mysql_fetch_array(mysql_query($query...

Read 2-dimensional array into R -

my data stored in text file looks this: 1, { {0, 1}, {1, 0}, {2, 6} } 2, { {0, 3}, {2, 2}, {0, 1} } ... the first element integer, , second 2-dimensional array. there function reads r? data.frame( lapply( read.csv(text= "1, { {0, 1}, {1, 0}, {2, 6} } # read line character columns 2, { {0, 3}, {2, 2}, {0, 1} } # '{' , '}' non-syntactic characters ", header=false ), function(x) as.numeric( gsub("[^[:digit:]]", "", x) ) ) ) #---------------------- v1 v2 v3 v4 v5 v6 v7 1 1 0 1 1 0 2 6 2 2 0 3 2 2 0 1

android - Go to a item in Listview without using smoothScrollToPosition -

i'd go (display) specific item in listview without scrolling. don't want animation i'd instantaneously transported desired item. i'm using checkable listview : mylistview.setchoicemode(1) . i understood mylistview.setselection(position) solution, when use it, nothing happens (maybe because it's checkable listview ?). when use mylistview.smoothscrolltoposition(position) , works have scroll animation don't want. what ? thanks. try out: mylistview.post(new runnable() { @override public void run() { mylistview.setselection(pos); view v = mylistview.getchildat(pos); if (v != null) { v.requestfocus(); } } }); from google developer list answer romain guy link

javascript not defined even though i use it the line before? -

console.debug("slide number"); console.debug(slidenumber) console.debug("divs"); console.debug(imageiddivs); var singleimageiddiv = imageiddivs[slidenumber]; this section of javascript. in firebug output. slide number inspec...0001647 (line 49) 1 inspec...0001647 (line 50) divs inspec...0001647 (line 52) [div#75bf9997-f111-4cbe-bee7-0765ba3bb8ca.slideshowimage, div#68c33349-cae6-4c2d-a9ed-1f87b12f06a2.slideshowimage, div#9e068363-6613-4346-b1e3-2ff4a3e2223b.slideshowimage, div#963a1d6a-a744-4a81-8608-5475b8fb21b1.slideshowimage, div#bd3f116d-9af9-4ca0-a45c-a366fd166ed0.slideshowimage, div#8ad2a764-14ab-466f-a614-a3676cca2127.slideshowimage, div#e99b579a-8e09-42e5-8951-b00613bc333a.slideshowimage, div#843ccfe7-5708-4794-b0dd-b10350277c64.slideshowimage, div#1e24f5f4-de3a-4b4f-b23d-b6ef9b513dad.slideshowimage, div#e862c867-5b93-4a3b-a235-b7bc0ac9cf37.slideshowimage, div#d99ca360-952d-46ff-9bda-bc87e13ef0a2.slideshowimage] inspec...0001647 (line 53) imageiddi...

php - JSON Clarification -

can please me breakdown statement below... base_url pointing can assume directory contained .csv file. given have custom .csv file on server, changed address of base_url, i'm not seeing data. i have million questions around short deadline. appreciated. btw... i've looked through jquery site sites try , understand.. appreciated. $.getjson(this.base_url+"?callback=?", {cmd:"getmakes", year:"2009"}, function(data) { //the 'data' variable contains response data. var makes = data.makes; (var = 0; < makes.length; i++) { //you can response data alert(makes[i].make_display); } }); from looking @ syntax of script , context being used in, throw out there say, 'this.base_url' not supposed .csv file. first, $.getjson , set request webserver. if request csv file, make sense, getting csv file. but, json keyword added, meaning expecting formatted json response request. secondly, adding dat...

insert - inserting another row in mysql database with values similar to previous row -

i have table like, batchid volume1 volume2 volume3 1 3.0 4.0 5.0 1 2.0 1.0 2.0 2 1.0 2.0 4.0 2 1.0 1.0 1.0 2 1.0 1.0 1.0 i trying add batchid 3 same volume1, volume2 , volume3 values such looks (same records batchid 2) 1 3.0 4.0 5.0 1 2.0 1.0 2.0 2 1.0 2.0 4.0 2 1.0 1.0 1.0 2 1.0 1.0 1.0 3 1.0 2.0 4.0 3 1.0 1.0 1.0 3 1.0 1.0 1.0 i wrote following query insert table1 (batchid,volume1,volume2,volume3) values (`3`,select volume1,volume2,volume3 table1 batchid = '2') gives error. p.s know above not database design. on simplified version of actual design. you can use insert ... select : insert table1 (batchid, volume1, volume2, volume3) select 3, volume1, volume2, volume3 table1 batchid = 2