Posts

Showing posts from January, 2011

download manager - java.lang.NoSuchMethodError: android.app.DownloadManager$Request.setNotificationVisibility -

trying use downloadmanager so downloadmanager.request request = new downloadmanager.request(uri) .setallowednetworktypes(downloadmanager.request.network_mobile) .setallowednetworktypes(downloadmanager.request.network_wifi) .setallowedoverroaming(true) .setdestinationinexternalfilesdir(this, null,string.valueof(mpathandfolder)) .setvisibleindownloadsui(false) .setnotificationvisibility(downloadmanager.request.visibility_hidden); long downloadid = downloadmanager.enqueue(request); added following permission in android manifest <uses-permission android:name="android.permission.download_without_notification"/> getting following error @ runtime java.lang.nosuchmethoderror: android.app.downloadmanager$request.setnotificationvisibility why error? how make downloadmanager work? do need use 2 separate downloadmanager.request 1 api 9 , api 11? no, need use java guard bl

How can I make multiple jwplayer audio players inside a jquery-ui accordion render and work correctly? -

Image
i'm trying improve , update of page has multiple jwplayers (audio only). "original" page works fine - audio players render correctly , usable (see http://www.pera.state.nm.us/meetingaudio.html ). but i'm trying put audio players in jquery-ui accordion, , not right; first player inside accordion div rendered , works correctly, subsequent players inside same accordion div rendered incorrectly , not play. play button appears rendered underneath progress bar. here sample code illustrates problem: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <script type="text/javascript" src="/resources/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="/resources/jquery-ui-1.10.2.min.js">

sql - Rails 3 Sum Product of two fields -

i need calculate sum of product of 2 fields in rails 3 app (i.e. equivalent excel's sumproduct function). there method in rails , if not, rails code using custom sql? for example, hotel has many rooms. room has attributes of sqft (square feet), quantity (of size) , hotel_id. calculate total sqft of rooms in given hotel. in sql, hotel.id = 8, believe following statement work: select sum(rooms.sqft * rooms.quantity) sumsqft rooms inner join hotels on rooms.hotel_id = hotels.id hotels.id = 8; yep : room.where(hotel_id: 8).sum("sqft * quantity")

database design - how to do the relation in this case - items, articles, and locations? -

Image
i have table information of items, articles, can have in many locations. example, can have item in warehouse or in shop. have table shops information , other table information of warehouse. how best way relation itms location in can be? i think option have in table items 2 foreign keys, 1 shop , other warehouse. if have fk in shop, fk of warehouse must null. if in future item can in other locations, can add new field in items table. but when want show information, must check fk not null , show information of concrete location. if use view show information of items , main information of location, have many fields null because not location in item. but best way? there other options or correct way it? thanks. i think option have in table items 2 foreign keys, 1 shop , other warehouse. this legitimate solution should work fine when there few kinds of locations can link to. if there (or may in future) many kinds of locations, consider doing this: the symbol

importing json file to mongodb -

i student doing undergrad in it. far have done data management using rdbms. have built few stand alone systems using java -jdbc - rdbms..after going through nosql concepts, use mongodb future project work.. have few questions..i reading mongodb documentation , learncrud operations. want choose decent dataset , import mongodb , kind of search operations , analytics..is there link demonstrates importing json data mongodb..? m totally new this? can please me? this doc on how insert data ( http://docs.mongodb.org/manual/core/create/ ), mongodb uses bson (which json more types support binary data). create database , create collection , insert data. there many language based libraries allow connect mongo , programmatic inserts collection.

image loading issue IE javascript -

i have requirement need populate image urls java , send screen list. in screen images not loading properly. i used img tag , src attribute display images. i used streaming through servlet since image repository not available outside intranet. our application internet application. created servlet through hit image , streaming it. in browser specified below in img src tag using java script display slides: https://kanagaraj.com/simpleservlet?imageurl=http://internalserver/repository/contentadmin/images/img1.jpg so, ie not displaying of images properly. it's not happening images. happens few images. i'm sorry sample url. but, cannot share url use. below code: var pic = new array();//from content web service service. <c:foreach items="${newsitemlist}" var="newsitem" varstatus="row"> pic[${row.count-1}] = '${newsitem.image}'; </c:foreach> (i = 0; < totalitems; i++) { preload[i] = new image(); //pre l

python - Add a datafile type reader to paraview using pvpython -

i'm aware can add readers different datafile types paraview, however, talks doing bunch of vtk stuff in c++ , (maybe worse) re-compiling paraview make aware of datafile format. on other hand, paraview supports scripting in python . maybe lack of familiarity vtk, but, me looks can manipulate vtk objects pvpython. there way dynamically add reader paraview using pvpython? what want "python programmable filter. refer paraview wiki . wiki page shows how write csv reader in python.

php - Parse error: syntax error, unexpected ';' in CODE -

i have php script gives me 1 error: parse error: syntax error, unexpected ';' in code on line 58 i dont know things php , hope take in code , tell me whats wrong, please. if delete ; on link 58 keeps continue on every ";" here code: http://pastebin.com/86zlg73m thank you! don't write ( integer ) ; put there value in...?

python - Need explanation for use of '%' and '/' to grid buttons with Tkinter -

the code below used in simple calculator made using tkinter implement simple gui. new python, , first programming language. first stab @ creating gui. calculator works fine, almost. buttons supposed far. question this: in code below have made row = index%3 , column = index/3. places buttons in nice 3 x 3 block. however, used snippet without understanding it. found online. find can tinker desired results, i'm not entirely clear why works way does. suppose math question really. clarification appreciated though. sorry if it's structured oddly, i'm not used forum formatting business. self.operators = ['+', '-', '*', '/','%','^','c','m','m+'] index in range(9): button(self.opframe, relief=groove, bg="light yellow", text=self.operators[index], width=3, height=1, command=lambda arg=self.operators[index], arg2=self.num_dict, arg3=self.num_list, arg4=self.count : self

c++ - How to overload |= operator on scoped enum? -

how can overload |= operator on typed (scoped) enum (in c++11, gcc)? i want test, set , clear bits on typed enums. why typed? because books practice. means have static_cast<int> everywhere. prevent this, overload | , & operators, can't figure out how overload |= operator on enum . class you'd put the operator definition in class , enums doesn't seem work syntactically. this have far: enum class numerictype { none = 0, padwithzero = 0x01, negativesign = 0x02, positivesign = 0x04, spaceprefix = 0x08 }; inline numerictype operator |(numerictype a, numerictype b) { return static_cast<numerictype>(static_cast<int>(a) | static_cast<int>(b)); } inline numerictype operator &(numerictype a, numerictype b) { return static_cast<numerictype>(static_cast<int>(a) & static_cast<int>(b)); } the reason this: way works in stro

How to Tell if Dropbox API 503's are per-user or per-app -

i had user hit dropbox api @ high rate , caused large number of 503 responses. according dropbox api documentation 503 caused when 'your app making many requests , being rate limited. 503s can trigger on per-app or per-user basis.' the json body of 503 response follows: {"error": "service unavailable"} this doesn't give me information on basis i'm being throttled; per-app or per-user. important affect whether attempt back-off , throttle of applications requests dropbox, or specific user. is there way detect basis such responses occurring on? dropbox work around or increase rate limits if ask . think purposefully ambiguous rate limits means. rate limits exist reason , don't think dropbox, or anyone, wants give away secret circumventing them. from core docs of july 8th, 2014 https://www.dropbox.com/developers/core/docs you'll receive 503 if you're still using oauth 1.0a authentication. you'll receive 429 if

c# - Get item created date in Sitecore -

is there anyway can item's created date programmatically under statistics section? thanks. yes. sitecore.context.item.statistics.created . returns item's created date datetime object.

javascript - Proper way to pause animations when not in view -

i'm wondering whether there proper way pause requestanimationframe animations when user has scrolled , animation not in view anymore? requestanimationframe automatically when browser displays tab, possible when user scrolls? the way divide code in chunk of small functions. as scroll down,keep track of how scrolling being done. you can provide own custom conditions , use window.cancelanimationframe() after functions have been executed , not in focus. how stop requestanimationframe recursion/loop? https://developer.mozilla.org/en-us/docs/web/api/window.cancelanimationframe

oop - Overwriting a field's method in Python -

i have custom class instantiate twice in second class: [edit: old code wasn't capturing issue is, i'm rewriting make clearer. foo going process network events (and need multiple connections, hence why bar have multiple foo fields , can't inherit) using callback function. in bar class, want overwrite callback different. rewriting callb in foo won't work, because inherit in other instances] class foo(object): def __init__(self, x): self._x = x #when event happens, call callb() self.on_certain_event(callback=callb) def callb(self): print self._x def run(self): waitforeventsinfinitely() # class bar(object): def __init__(self): self._foo = foo(5) #overwrite existing callback method in foo class! self._foo.callb = self.callb def callb(self): print self._x * 10 def run(self): waitforeventsinfinitely() # not going write t f = foo(2) f.run() b = bar() b.run() [

java - Inserting to database efficiently by removing repeated code -

i have started working cassandra database recently. , trying insert data 1 of column family have created. below code trying insert cassandra database. in case have around 20 columns in column family means need add below line mutator.newcolumn("column name", "column value"); twenty times in below code looks ugly me. there way, can simplify below method either using reflection or other way if have more 20 columns, should not keep on adding line in below code. for (int userid = id; userid < id + nooftasks; userid++) { mutator mutator = pelops.createmutator(thrift_connection_pool); mutator.writecolumns(column_family, string.valueof(userid), mutator.newcolumnlist( mutator.newcolumn("a_account", "{\"lv\":[{\"v\":{\"regsiteid\":null,\"userstate\":null,\"userid\":" + userid + "},\"cn\":1}],\"lmd\":20130206211109}"),

Navigation Menu in Jquery Mobile -

i'm newbie jquery mobile want build vertical navigation panel specific animation (no page changing). a example here ( don't want sencha touch, need jquery mobile): http://dev.sencha.com/deploy/touch/examples/production/kitchensink/index.html for example, if select "user interface", menu updating (and button appear...) example ios, dropbox ipad application (cf http://www.youtube.com/watch?v=qeqw5orohzy ) how can jquery mobile ? see panels, 1.3 new feature, it's not same thing ... thanks help try this: jqueryui's .menu other that, it's fancy <aside>

graphviz - Shorten execution time and file size of SVG graph generation -

my program generated dot file a.dot , use dot -tsvg a.dot > a.svg there 2 problems using transformation script: is there way shorten execution time of command? currently, verbose mode prints out: dot - graphviz version 2.30.1 (20130218.1601) libdir = "/usr/local/cellar/graphviz/2.30.1/lib/graphviz" activated plugin library: libgvplugin_quartz.6.dylib using textlayout: textlayout:quartz activated plugin library: libgvplugin_core.6.dylib using render: svg:core using device: svg:svg:core activated plugin library: libgvplugin_dot_layout.6.dylib using layout: dot:dot_layout plugin configuration file: /usr/local/cellar/graphviz/2.30.1/lib/graphviz/config6 loaded. render : dot fig map pic pov ps quartz svg tk vml xdot layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi textlayout : textlayout device : bmp canon cgimage cmap cmapx cmapx_np dot eps exr fig gif gv imap imap_np ismap jp2 jpe jpeg jpg pct pdf pic

ioc container - Is it possible to use Ninject Factory Extensions' ToFactory method with open generics? -

i'm building on answered question in icar implementations bound using ninject conventions extensions , custom ibindinggenerator , , icarfactory interface bound using ninject factory extensions' tofactory() method , custom instance provider . i'm trying refactor can bind , make use of ivehiclefactory<t> , t constrained icar , rather previous icarfactory . way, can specify vehicle want in generic type parameter, instead of passing in name of vehicle type in factory's createcar() method. is possible bind open generic interfaces using tofactory() technique? i have feeling i'm barking wrong tree, when specifying icar type name, seemed natural evolution specify icar type generic type parameter... here's test fails: [fact] public void a_generic_vehicle_factory_creates_a_car_whose_type_equals_factory_method_generic_type_argument() { using (standardkernel kernel = new standardkernel()) { // arrange kernel.bind(type

javascript - Return JSON node onclick that matches the text in the link -

the js below returns list of movie titles me after parsing json. each movie title node has more attributes , values not displayed yet. when user clicks movie title in list want return other values in node match title. how go that? thanks. i have posted data example. js creates html list of movie titles. can see there several nodes of same movie title, different "location." want able click on movie title in list , have display different locations specific movie title in html. here js fiddle of doing now. jsfiddle json data: fl({ "nodes" : [ { "node" : { "title" : "180", "releaseyear" : "2013", "director" : "jayendra", "writer" : "umarji anuradha, jayendra, aarthi sriram, &amp; suba ", "address" : "\n \n \n 555 market st. \n san francisco, ca\n united states\n \n \n see map: google maps \n \n", "actor 1"

c - Python Full Precision Division Source -

i've been working arbitrary-precision algorithms lately, , exceedingly curious how python goes it. when type large (600-1000) digits divided large number, works , love it. have python source files , okay c, / in source part governs division can @ , maybe tinker it? end-game number theory-type work in c. the core of implementation of long / long in python 3.3 in longobject.c , function x_divrem . the implementation modelled after knuth's "the art of computer programming", vol. 2 (3rd edition), section 4.3.1, algorithm d "division of nonnegative integers", per comment source.

My python function won't return or update the value -

def getmove(win,playerx,playery): #define variables. movepos = 75 moveneg = -75 running = 1 #run while loop update mouse's coordinates. while(running): mousecoord = win.getmouse() mousex = mousecoord.getx() mousey = mousecoord.gety() print "mouse x = ", mousex print "mouse y = ", mousey if mousex >= playerx: playerx = movepos + playerx running = 0 elif mousex <= playerx: playerx = moveneg + playerx running = 0 elif mousey >= playery: playery = movepos + playery running = 0 elif mousey <= playery: playery = moveneg + playery running = 0 return playerx,playery def main(): #create game window. win = graphwin("python game", 500, 500) drawboard(win) #define variables. playerx = 75 pla

Rails is not creating a new app correctly - conflict with JSON 1.7.7? -

i'm trying learn ruby on rails online tutorial. [rails version]: rails 3.2.13 [ruby version] : ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux] when execute command: rails new first_app i get: gem::installer::extensionbuilderror: error: failed build gem native extension. /usr/bin/ruby extconf.rb mkmf.rb can't find header files ruby @ /usr/share/include/ruby.h gem files remain installed in /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7 inspection. results logged /home/philippe/.gem/ruby/1.9.1/gems/json-1.7.7/ext/json/ext/generator/gem_make.out error occurred while installing json (1.7.7), , bundler cannot continue. make sure `gem install json -v '1.7.7'` succeeds before bundling. sure enough, ran gem install json -v '1.7.7 listed, results are: [philippe@localhost rails_projects]$ gem install json -v '1.7.7' building native extensions. take while... error: error installing json: error: failed build gem native extens

android - NoSuchMethod: isDestroyed() -

i call isdestroyed() on activity , got ex: 04-09 03:08:12.692: e/androidruntime(13234): fatal exception: main 04-09 03:08:12.692: e/androidruntime(13234): java.lang.nosuchmethoderror: android.app.activity.isdestroyed 04-09 03:08:12.692: e/androidruntime(13234): @ hu.illion.beentaps.util.activitykiller.killallpastactivites(activitykiller.java:16) 04-09 03:08:12.692: e/androidruntime(13234): @ hu.illion.beentaps.mapbeenactivity$1.onclick(mapbeenactivity.java:75) 04-09 03:08:12.692: e/androidruntime(13234): @ android.view.view.performclick(view.java:4084) 04-09 03:08:12.692: e/androidruntime(13234): @ android.view.view$performclick.run(view.java:16966) 04-09 03:08:12.692: e/androidruntime(13234): @ android.os.handler.handlecallback(handler.java:615) 04-09 03:08:12.692: e/androidruntime(13234): @ android.os.handler.dispatchmessage(handler.java:92) 04-09 03:08:12.692: e/androidruntime(13234): @ android.os.looper.loop(looper.java:137) 04-09 03:08:12.692: e/androi

How to prompt input dialog for entering matrix elements in matlab? -

i ask there way let user enter matrix elements (eg. 3x3 matrix) in input dialog has total 9 boxes in square manner in matlab. know matlab got inputdlg function input box in vertical manner. know there other option other using gui. concept asking user matrix size , prompt corresponding number of boxes matrix elements. this how have done (for solving simultaneus equations), problem using data in matrix dont think creates matrix because wont find det ` clear clc prompt={'x:','y:','z:'} dlg_title='matrix a' num_lines=[1 50] def={'3','4','8'} a=inputdlg(prompt,dlg_title,num_lines,def) dlg_title='matrix b' def={'4','3','-3'} b=inputdlg(prompt,dlg_title,num_lines,def) dlg_title='matrix c' def={'5','-4','-2'} c=inputdlg(prompt,dlg_title,num_lines,def) d=[a,b,c]'`

javascript - RequireJS optimizer with coffeescript -

i'm running on severals issues when i'm trying run node requirejs on project. this folder structure : -root -/src -app.coffee -/static -/vendor -/plugin -r.js -coffee-script.js -/lib -jquery.js -main.js -build.js this build.js file : ({ appdir : './', baseurl : './static/js/', dir : '../public', optimize : 'uglify', exclude : ['coffee-script'], stubmodules : ['cs'], paths: { // libraries 'modernizr' : 'vendor/modernizr', 'jquery' : ['//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min', 'vendor/jquery'], 'jqueryui' : 'vendor/jquery-ui', 'backbone' : 'vendor/backbone', 'underscore&#

multithreading - Pointer is deallocated shortly after declaration in multithread function -

i'm having weird problem in code of mine. variable seems fine after declaration corrupted right after , results in access violation (basically pointer still pointing @ same place memory seems unallocated). i'm pretty sure problem related multithreading have no idea since quite new multithreading. here code : #include "firewall.h" #include <ws2tcpip.h> firewall::firewall(void) { } firewall::~firewall(void) { } void firewall::parsefile(string filepath) { xmlnode xmainnode=xmlnode::openfilehelper(filepath.c_str(),"firewall"); // filtrage xmlnode nodefiltrage = xmainnode.getchildnode("filtrage"); xmlnode currentnode; for(int i=0; < nodefiltrage.nchildnode();i++) { currentnode = nodefiltrage.getchildnode(i); string nom = currentnode.getname(); if(nom == "permettre") mapfiltrage_.insert(pair<int,bool>(atoi(currentnode.getattribute().lpszvalue), true));

matlab - Result of executable -

is there method pass output of executable apart displaying in console or writing output in text file? executable matlab file. in linux/unix, redirect output /dev/null, discard it. in windows, redirect nul.

onclick - Can't to use add(Calendar.DAY_OF_MONTH,1) in android -

i tried use button onclick handler add 1 day calendar, throws error, when tap nextday button. that's code fragment: public class main extends activity { textview dateview; private int myear; private int mmonth; private int mday; static final int date_dialog_id = 1; gregoriancalendar c; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); dateview = (textview)findviewbyid(r.id.dateview); gregoriancalendar c = new gregoriancalendar(); myear = c.get(calendar.year); mmonth = c.get(calendar.month); mday = c.get(calendar.day_of_month); } public void nextday(view v) { c.add(calendar.day_of_month, 1); updatedatedisplay(); } private void updatedatedisplay() { string[] month_names = getresources().getstringarray(r.array.month_names); dateview.settext( new stringbuilder() .append(mday).append(" ") .append(month_names[mmonth])

linux kernel - How to get registered filesystems list? -

on debugging linux kernel 3.6.11 - "ddd vmlinux /proc/kcore" , "file_systems" list present in fs/filesystems.c shown empty, containing address 0x0 . it supposed contain file_system_type structures of registered file systems . why list empty or else can see list of registered file systems ? debugging kernel not needed that. there proc api provides information: cat /proc/filesystems

memory - MemoryFile.finalize() called while ashmem still open - How to deal with it - Android -

i have seen questions @ regarding same question, none of them has accepted answer. what error informing? why occur? i have few cursors in application, , did close them, after work done. error still shows up. reason? here code ::: private string fetchcontactidfromphonenumber(string phonenumber) { // todo auto-generated method stub uri uri = uri.withappendedpath(phonelookup.content_filter_uri, uri.encode(phonenumber)); cursor cfetch = getcontentresolver().query(uri, new string[] { phonelookup.display_name, phonelookup._id }, null, null, null); string contactid = ""; if (cfetch.movetofirst()) { cfetch.movetofirst(); contactid = cfetch.getstring(cfetch .getcolumnindex(phonelookup._id)); } //system.out.println(contactid); if(cfetch != null) { cfetch.close(); } return contactid; } public uri getphotouri(long contactid) { c

bootstrap .modal has lower z-index than youtube iframe on top fade in (only in firefox) -

Image
when bootstrap fades in top shows underneath youtube iframe embedded videos. once fade done shows on top should. have set wmodes transparent, opaque set z index on both fade , modal high , still no luck. strangely happening in firefox . ie chrome finicky ipad work! how can fix this?!? <div class="modal fade" id="test"> <div class="modal-header"> <a class="close" data-dismiss="modal">&times;</a> <h3>you have voted!</h3> </div> <div class="modal-body"> <p>you may vote again tomorrow.</p> </div> </div> after messing around bootstrap's css having opacity of 1.0 on .modal.fade solved problem: .modal.fade { opacity: 1.0; top: -25%; -webkit-transition: opacity 0.3s linear, top 0.3s ease-out; -moz-transition: opacity 0.3s linear, top 0.3s ease-out; -o-transition: opacity 0.3s linear, top 0.3s ease-out;

android - Black Background on image loaded with univerisal image loader -

Image
as shown below. first image default image linked @ http://goldentrail.towardstech.com/assets/images/membersimage/buttons/eat.png . while second image below image loaded using uil this imageloader configuration file cachedir = storageutils.getcachedirectory(context); imageloaderconfiguration config = new imageloaderconfiguration.builder(context) .memorycacheextraoptions(480, 800) // default = device screen dimensions .disccacheextraoptions(480, 800, compressformat.jpeg, 75) .taskexecutor(asynctask.thread_pool_executor) .taskexecutorforcachedimages(asynctask.thread_pool_executor) .threadpoolsize(3) // default .threadpriority(thread.norm_priority - 1) // default .tasksprocessingorder(queueprocessingtype.fifo) // default .denycacheimagemultiplesizesinmemory() .memorycache(new lrumemorycache(2 * 1024 * 1024)) .memorycachesize(2 * 1024 * 1024)

forms - How to use 2 different versions of jquery in same html -

this question has answer here: can use multiple versions of jquery on same page? 6 answers i want use both form validation datepicker in html. because of conflict not working. please help. here code. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.js" type="text/javascript"></script> <script type="text/javascript"> $().ready(function() { $("#form1").validate({ rules: { asset_name: 'required', asset_code: 'required', asset_desc: 'required', purchase_date: 'required' } });

How to restrict the minimum size of the window for Eclipse e4 -

i making application based on eclipse e4 framework. wondering how minimal size of application window can controlled. there seems no properties can defined in e4xmi file purpose. does know how it? i found thread in eclipse community forum ( http://www.eclipse.org/forums/index.php/t/244875/ ) saying can achieved creating own renderer. how can exactly? thank :) assuming using built-in swt renderers, can listen creation of e4 mwindow elements , gain access underlying swt shell. in example listener registered in addon, can add e4xmi. import javax.annotation.postconstruct; import org.eclipse.e4.core.services.events.ieventbroker; import org.eclipse.e4.ui.model.application.ui.basic.mwindow; import org.eclipse.e4.ui.workbench.uievents; import org.eclipse.swt.widgets.shell; import org.osgi.service.event.event; import org.osgi.service.event.eventhandler; public class minsizeaddon { @postconstruct public void init(final ieventbroker eventbroker) { eventhandle

elasticsearch - A simple app using elastic search and python -

ok, looking playing elastic search , went through site, couldn't find basic or simple app make use of elastic search or show how use elastic search.can 1 provide helpful links or pointers started elastic search using python language. i'm not sure answering question. have advise you. check elastic search anf guide more information. http://www.elasticsearch.org/community/

android - Does our Apps load all classes in the included library files? -

in android applications include many library files such google-play-services-lib , facebook-sdk etc. never use features , classes libraries, question when .apk file gets created classes included or classes use included in our application? if yes there way can around that? ie can remove or avoid inclusion of classes? thank you... you should keep android application small possible. therefore should include classes in jars need. http://www.vogella.com/blog/2010/02/11/java-library-jar-android/ it better obfuscate code using proguard. proguard java class file shrinker, optimizer, obfuscator, , preverifier. the shrinking step detects , removes unused classes, fields, methods, , attributes . optimization step analyzes , optimizes bytecode of methods obfuscation secures code extent. to enable proguard in project, edit project.properties # project target. proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt target=google inc.:google apis:16 android.librar

sql - difference in days between two dates -

i new @ this. need in seperate column in query have difference in days between t.1start , t1.finish. thanks ,louie select row_number() over(order town) 'row', t1.surname, t1.forename, t1.town, t1.description, t1.sex, t1.dob, t1.start, t1.finish, dbo.viewservicecontractfull t1 t1.finish>='2013/01/01' , t1.finish<='2013/01/31' how towns come in query? select row_number() over(order town) 'row', t1.surname, t1.forename, t1.town, t1.description, t1.sex, t1.dob, t1.start, t1.finish, cast(datediff(day,t1.start,t1.finish) varchar) difference dbo.viewservicecontractfull t1 t1.finish>='2013/01/01' , t1.finish<='2013/01/31' additionally have @ this

xml - java.lang.NoClassDefFoundError: javax/servlet/AsyncListener -

i new spring-mvc , developing simple spring application,while running application getting following exception java.lang.noclassdeffounderror: javax/servlet/asynclistener ,can guide me come out of problem java.lang.noclassdeffounderror: javax/servlet/asynclistener @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(unknown source) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:1850) @ org.apache.catalina.loader.webappclassloader.findclass(webappclassloader.java:890) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1354) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1233) @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source)

asp.net mvc 3 - Send model with list to controller via ajax -

i have task model: public class task { public int id { get; set; } public string name { get; set; } public string description { get; set; } public datetime? duedate { get; set; } public int projectid { get; set; } public virtual icollection<useraccount> useraccounts { get; set; } ... } i'd send task model via ajax controller: function sendform(projectid, useraccountids, name, date, description, target) { $.ajax({ url: target, type: "post", contenttype: 'application/json', data: json.stringify({ projectid: projectid, useraccounts: useraccountids, name : name, duedate : date, description : description }), success: ajaxonsuccess, error: function (jqxhr, exception) { alert('es ist ein fehler bei der Ãœbertragung aufgetreten.'); } }); } this working fine there's big probl

Android App only for Tablets -

i have designed app android tablet. it should installed on android tablet . have tried following. supports-screens android.hardware.telephony compatiblity-screens android.permission.call_phone but all above scenarios failed. android app installed both google nexus s 4.1.0 mobile , acer iconia a500 tablet . there other way restrict android app android tablet alone.? how install apk? via adb/sdcard or googleplaystore? you should noticed filter market. cannot prevent user install apk manually.

Oracle Job does not work with tables under Oracle Label Security -

i have database schema myuser under oracle label security (ols) , job myuser.myjob executing procedure myuser.myproc, selects or updates tables in myuser schema. user myuser dba, has full ols privileges, myjob , myproc owner , caller, myjob not work. starts, calls myproc, procedure myproc begins, nothing , ends in 0.01 second without message. but when execute same myproc pl/sql block, out of job, works well. seems myproc executes no access rights myuser tables. could tell me may reason , put light solve issue?

Subset over multiple numerical columns in R -

i have 3 columns of data, each numeric distance value. i created subset each individual column eliminate outliers following function: newdata <- subset(x, x < mean(x)+3*sd(x) & x > mean(x)-3*sd(x)) the problem is, creates 3 new vectors different length, , run t-test on manipulated data. how can best create subset of 3 columns data outside condition discarded?

c# - Timer Interval Calling Long Method -

what happen code below if execute() takes, say, 3000ms finish, being called every 1000ms due timer interval? timer _timer = new timer(); private void setuptimer() { _timer.tick += new eventhandler(pollingtimeelapsed); _timer.interval = 1000; _timer.enabled = true; _timer.start(); } private void pollingtimeelapsed(object sender, eventargs e) { execute(); } edit: using system.windows.forms.timer, since system.timers.timer doesn't have .tick i'm assuming using system.timers.timer class. since autoreset has default value (which true), elapsed event fired each time 1000ms has elapsed. if want fire event 1 time, set autoreset false. if not want fire event while execute-code running, following: timer _timer = new timer(); private void setuptimer() { _timer.tick += new eventhandler(pollingtimeelapsed); _timer.interval = 1

mysql - Union Two SQL Queries -

i have query select o.product_id, p.name, count(o.product_id) total_products_sold, (select count(o.id) ebay.`order` o) total_orders ebay.`order` o inner join product p on o.product_id = p.id group o.product_id the total_orders rerun when executed each not want. i question: i want total_orders combines every result set outer query. i tried return 1 row select tps.product_id, tps.name, tps.total_products_sold, count(oo.id) total_orders ebay.`order` oo inner join ( select o.id, o.product_id, p.name, count(o.product_id) total_products_sold ebay.`order` o inner join product p on o.product_id = p.id group o.product_id ) tps on oo.product_id = tps.product_id any better solution ? thanks. select tps.product_id, tps.name, tps.total_products_sold, s.total_orders ebay.`order` oo inner join ( select o.id,

java - Tomcat application deployment listener -

i'm wondering how can listen tomcat web application deployments. have listener invoked every time application undeployed or deployed from/to container. i investigate bit , found out listeners, i.e. lifecyclelistener can registered on jmx. unfortunatelly listener ins't enough me since triggers events when engine/host/context in shutdown or startup process. the same containerlistener informs container shutdown , startup events. so, question is: which interface shall implement , how can register tomcat in order notified every time new application deployed? servlet context init/destroy import org.apache.juli.logging.log; import org.apache.juli.logging.logfactory; import javax.servlet.servletcontextlistener; import javax.servlet.servletcontextevent; public class appcontextlistener implements servletcontextlistener { private static final log logger = logfactory.getlog(appcontextlistener.class); @override public void contextdestroyed(servletconte

c++ - How to implement the event handler for a MFC CEdit ON_EN_SETFOCUS? -

i'm maintaining mfc c++ code , have screen many cedit objects. i want implement onfocus event of write 1 method treat event. to need know cedit id fired event looks implementation of onfocus event in mfc not have parameter (compared other events onctlcolor has cwnd* object parameter). i refuse believe have implement small method each single cedit passing id main method want!. if that's solution, shame on mfc! on_control_range macro exists allow mapping single handlers same event on multiple controls. first need ensure control ids sequential. in header need declare handler takes control id parameter: afx_msg void onsetfocusmulti(uint ctrlid); this allows distinguish sender control in handler if need it. now need add message map, instead of bunch of on_en_setfocus(idc_edit1, &cmydlg::onsetfocus) : on_control_range(en_setfocus, idc_edit1, idc_edit_x, onensetfocusmulti) ^ ^ ^ ^ // n

Adding a custom bit of text to PHP Twitter code -

i using code below, bulked in "keyring social importer" plugin wordpress, import tweets on regular basis individual blog posts in wordpress blog. i add line of text within each created blog post, after tweet, says "follow me on twitter" link twitter page. how achieve this? so, posts this... title of post = tweet 15 word limit , "..." after it. content = tweet in full. after tweet in full within content, want follow link. many in advance can offer. ht <?php function keyring_twitter_importer() { class keyring_twitter_importer extends keyring_importer_base { const slug = 'twitter'; // e.g. 'twitter' (should match service in keyring) const label = 'twitter'; // e.g. 'twitter' const keyring_service = 'keyring_service_twitter'; // full class name of keyring_service importer requires const requests_per_load = 3; // how many remote requests should mad