Posts

Showing posts from July, 2012

android - java.lang.RuntimeException: Manifest merger failed : uses-sdk element cannot have a "tools:node" attribute -

i getting error again , again error:execution failed task ':quickscroll:processdebugandroidtestmanifest'. > java.lang.runtimeexception: manifest merger failed : uses-sdk element cannot have "tools:node" attribute i tried using tools:node="merge". this manifest file <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="musicplayer.player.music.audioplayer.musicplayer" android:hardwareaccelerated="true" android:versioncode="49" android:versionname="3.5"> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.modify_audio_settings" /> <uses-permission android:name="android.permission.write_external_storage

c++ - Movie Weekend Codechef Beginner Section : Runtime Error -

i have written following code problem, ideone doesnt give me runtime error compiler codechef giving me one. compiler in codechef gcc 4.9.2 problem [link : https://www.codechef.com/problems/moviewkn] little egor huge movie fan. likes watching different kinds of movies: drama movies comedy movies, teen movies horror movies. planning visit cinema weekend, he's not sure movie should watch. there n movies watch during weekend. each movie can characterized 2 integers li , ri, denoting length , rating of corresponding movie. egor wants watch 1 movie maximal value of li × ri. if there several such movies, pick 1 maximal ri among them. if there still tie, pick 1 minimal index among them. task egor pick movie watch during weekend. expected input the first line of input contains integer t denoting number of test cases. the first line of test case description contains integer n(number of films). the second line of test case description contains n integers l1, l2, ...,ln (l le

Microsoft Excel 2016 T - tests -

i using microsoft excel 2016 data analysis, can carry out test fine cannot produce t value along p value? the function t.inv can used critical values. documentation describes "returns left-tailed inverse of student's t-distribution." thus, e.g. t.inv(0.05,9) returns value -1.83311 . corresponding right-tailed value abs(t.inv(0.05,9)) = 1.83311 returns right-tailed version of more traditionally used in stats books. there function t.inv.2t might prefer if using 2-tailed t-test. the dots in function names t.inv unusual in excel naming conventions. reason behind decade excel used statistical functions mathematically correct had implementations not numerically stable. these tended fine in 99% of cases behave poorly when applied values several standard deviations away mean. microsoft responded persistent criticism , (with excel 2010?) revamped statistical functions. old version kept reasons of backwards. new versions have similar names in cases use dot. ex

javascript - How to get ENV type Laravel + VueJS + Homestead -

i developing app using laravel + vuejs + homestead , knows on laravel 5.2 have env file can set env variables... in way can access javascript code! i have read proccess.node_env don't know if got right looks works on npm start no? running app through homestead don't know how it! thanks in advance! you dump app_env environment variable page hosting javascript , later access or pass vue. <script type="text/javascript"> var env = "{{ env }}"; </script> and in controller... $env = getenv("app_env"); would value of app_env

java - Jar Sound Loading Error NullPointerException -

i have next class stores sounds i'm gonna use game i'm doing, i'm trying test jar file see if working , find next error command prompt exception in thread "main" java.lang.nullpointerexception @ com.sun.media.sound.standardmidifilereader.getsequence(unknown source) @ javax.sound.midi.midisystem.getsequence(unknown source) @ com.sun.media.sound.softmidiaudiofilereader.getaudioinputstream(unknown source) @ javax.sound.sampled.audiosystem.getaudioinputstream(unknown source) @ assets.audiostreaming.loadmusicassets(audiostreaming.java:27) @ crossymain.mainmenu.<init>(mainmenu.java:64) @ crossymain.principal.main(principal.java:18) this class i'm storing audio assets package assets; import java.io.ioexception; import javax.sound.sampled.*; public class audiostreaming { private static clip mainmenu,bgm,coinp,gameover,trainalert,birdgo; private static audioinputstream in_mainmenu,in_bgm,in_coinp,in_gameover,in_trainal

asp.net web api - Managing AutoFac object creation for UnitOfWork -

Image
i new architecture, in process of learning , designing application end end. have below architecture , using autofac manage object creation. all businessobject contracts have been setup on webapi startup , startup can startup autofac configurations/modules. i use unitofwork/repository pattern , resides beyond business layer, not want refer unitofwork in webapi cannot startup unitofwork otherwise. can please give me inputs on should architecture/design/autofac unitofwork implementation? in app_start register web project specific dependencies (controllers, etc). have static method in bl layer registers unit of work, repositories, etc. call static method in app_start when web dependencies being registered below: //app_start (web project) var builder = new containerbuilder(); var config = globalconfiguration.configuration; myproject.businesslayer.registerdependancies.register(builder); <-- register unit of work here in static bl method builder.registercontrollers(t

c# - Right paddle not moving in pong game for unity -

Image
i trying allow player, in pong game, control both paddles. however, reason 1 paddle controllable while other nothing. here image of paddle property bar. and here code right paddle should controlled arrow keys. using unityengine; using system.collections; public class paddleright : monobehaviour { public vector3 playerposr; public float paddlespeed = 1f; public float yclamp; void start() { } // update alled once per frame void update() { float ypos = gameobject.transform.position.y + (input.getaxis("vertical") * paddlespeed); if (input.getkey(keycode.downarrow) || input.getkey(keycode.uparrow)) { playerposr = new vector3(gameobject.transform.position.x, mathf.clamp(ypos, -yclamp, yclamp), 0); print("right padddle trying move"); } gameobject.transform.position = playerposr; } } i can't seem figure out anywhere why won't move.. please, awesome because have checked everywhere @ point. thanks!

Free tools for identifying Memory Leaks in .Net application -

i having .net application when hosted in qa server, suffers memory leaks. best free tools available, can identify problematic code , assist me in troubleshooting problem? if using visual studio 2015, can add live analyzer codebase , determine memory leaks. from simplicity perspective, suggest add codecracker, live analyzer, nuget package. once added, can filter error list code ruleid cc0022 - display instances in codebase unmanaged objects have not been disposed.the light bulb feature of vs 2015, further display suggestions fix memory leaks.

mySQL Temporary Table is Full -

i trying create , load temporary mysql table memory using following syntax running "table full" error: create temporary table if not exists tmphistory engine=memory select * history order date asc; my original history innodb table has 3m rows , 300mb. i've increased both of following server variables 16mb default values: max_heap_table_size = 536870912 tmp_table_size = 536870912 i'm running mysql on aws r3.xlarge 4-core box 30.5gb of ram. i've reviewed this guidance still running table full error. i'm new using memory engine, suggestions appreciated. max_heap_table_size , not tmp_table_size controls maximum size of subsequent memory table. memory has several quirks. perhaps 1 bit you: varchars turned chars . varchar(255) takes 765 bytes each row if character set utf8 . why want copy innodb table memory table? avoid disk hits? no... if innodb_buffer_pool_size big enough, innodb table live in ram. speed things up? no

python - Replacing one column in a file with other values -

i have file this: 1 0 1 0 1 0 2 0 2 0 2 0 3 0 3 0 3 0 3 0 3 0 4 0 5 0 and file, file2 1 column: 0.122 0.133 0.855 -2.1 -9.00 i want replace second column of file 1 data file2 such output file becomes this: 1 0.122 1 0.122 1 0.122 2 0.133 2 0.133 2 0.133 3 0.855 3 0.855 3 0.855 3 0.855 3 0.855 4 -2.1 5 -9 in other words, want copy data second file first until first column value remains same. when value in first column changes, picks second value other file. i have been trying in python , have been able replace column not meet repetitions desired number of times. code copies data first 5 positions of column2 in first file , leaves rest. can suggest solution please? it better see code might logic tweaked (it doesn't write original file , assumes second file has enough lines): f1 = open('file1.txt', 'r') f2 = open('file2.txt', 'r') oldf1value = none v = none l1 in f1: [c1, c2] = l1.split()

c++ : meaning of keyword "typename" in this function -

this question has answer here: where , why have put “template” , “typename” keywords? 5 answers in this answer this question author posted code: template <typename... ts> typename std::tuple_element<0, std::tuple<ts...> >::type // or decltype(auto) callfunction(ts&&... ts) { using type = typename std::tuple_element<0, std::tuple<ts...> >::type; auto = multicache.find(typeid(type)); assert(it != multicache.end()); auto&& fn = boost::any_cast<const std::function<type(ts...)>&>(it->second); return fn(std::forward<ts>(ts)...); } the meaning of typename std::tuple_element<0, std::tuple<ts...> >::type returned type same of first element of first element in ts... , right? no, typename keyword, practical purposes, m

python - Django REST Framework nested serializer having no effect -

i attempting set nested serializer in django rest framework, after following short guide in documentation, http://www.django-rest-framework.org/api-guide/relations/#nested-relationships , have had no change in serialized data. models.py class franchise(models.model): id = models.autofield(primary_key=true) name = models.charfield(max_length=255) class item(models.model): id = models.autofield(primary_key=true) franchise = models.foreignkey(franchise, on_delete=none) title = models.charfield(max_length=255) initial serializers.py class itemlistserializer(serializers.modelserializer): class meta: model = item fields = ('id', 'franchise', 'title') class franshisedetailserializer(serializers.modelserializer): class meta: model = franchise fields = ('id', 'name', 'items') when query itemlistserializer query set expected : [ { "id": 1,

python - Absolute position of leaves in NLTK tree -

i trying find span (start index, end index) of noun phrase in given sentence. following code extracting noun phrases sent=nltk.word_tokenize(a) sent_pos=nltk.pos_tag(sent) grammar = r""" nbar: {<nn.*|jj>*<nn.*>} # nouns , adjectives, terminated nouns np: {<nbar>} {<nbar><in><nbar>} # above, connected in/of/etc... vp: {<vbd><pp>?} {<vbz><pp>?} {<vb><pp>?} {<vbn><pp>?} {<vbg><pp>?} {<vbp><pp>?} """ cp = nltk.regexpparser(grammar) result = cp.parse(sent_pos) nounphrases = [] subtree in result.subtrees(filter=lambda t: t.label() == 'np'): np = '' x in subtree.leaves(): np = np + ' ' + x[0] nounphrases.append(np.strip()) for a = "the american civil war, known war between states or civil war, civil war fought 1861 1865 in u

ubuntu - Any reason not to use Redis 32bit (as opposed to 64bit) except for the 4GB limit? -

i'm concerned mem box on among other things run couple of redis instances. thefore i'm thinking moving redis 32bit since should save me quite bit of ram. from enter link description here redis compiled 32 bit target uses lot less memory per key, since pointers small, such instance limited 4 gb of maximum memory usage. compile redis 32 bit binary use make 32bit. rdb , aof files compatible between 32 bit , 64 bit instances (and between little , big endian of course) can switch 32 64 bit, or contrary, without problems. as said in quote, 4gb max redis instance on 32 bit i'm making sure don't hit this. use multiple redis instances each stay below 4gb limit, guess not problem (?) any other reason, such performance possibly, should out for? using multiple 32 bits redis instances works well. there few drawbacks need consider though: most people run 64 bits version, 32 bits version less tested , deployed. makes less reliable, since increases

javascript - How to extract data from a json object which contains a map with different kinds of objects -

i return json server jsonified map object java. map has list , integer. how can list in jquery? int found = hits.length; list<object> results = new arraylist<object>(); (scoredoc scoredoc : hits) { .... // create object , add results list results.add(object) } map map = new hashmap(); map.put("results", results); map.put("hits", found); objectmapper mapper = new objectmapper(); return mapper.writevalueasstring(map); i pull results search ajax: function search(query){ $.ajax({ type: 'post', url: 'search', data: query, success: function(data){ showresults(data); }, datatype: 'json' }); } now in show results dont know how list map. appreciated function showresults(data){ if(!$('#livesearchcontainer').is(':visible')){ $(this).show(2000); } } some facts javascript , jquery jquery should parse

java - incompatible types: possible lossy conversion from double to int (high school hw) -

hello taking high school class , need help. getting error mentioned in title. here code (i supposed make random numbers people guess 0 , need let them know if theyre close , how close theyre) import javax.swing.joptionpane; public class p5g { public static void main(string[] arg) { string width = joptionpane.showinputdialog("how many rows want?"); string length = joptionpane.showinputdialog("how many columns want?"); int lol = integer.parseint( width ); int wow = integer.parseint( length ); int[][]gameboard = new int[lol][wow]; int[] nums = new int[lol*wow]; for(int =0; < nums.length; i++) { nums[i]=(int)100*math.random(); } string row = joptionpane.showinputdialog("choose row"); string col = joptionpane.showinputdialog("choose column"); int ro = integer.parseint( row );

meteor - Cannot find name 'console' -

i using angular2-meteor, typescript. (meteor version 1.3.2.4) when use console.log('test'); on server side , working well. however, got warning in terminal: cannot find name 'console'. how can rid of warning? or there special method such meteor.log server side? thanks how can rid of warning? if typescript compiler warning (and not runtime one) console defined in lib.d.ts : https://basarat.gitbooks.io/typescript/content/docs/types/lib.d.ts.html make sure compiler setup correctly (e.g. doesn't have --nolib or custom incorrect --lib ). might want @ tsconfig.json 's compileroptions (if any)

How to pass json object using PHP in Wepay API -

i have integrated wepay payment gateway . have facing problem pass json object wepay . shows incorrect json format. please @ below code. $forca_a = array( 'debit_opt_in'=>true ); $forca = json_encode($forca_a,json_force_object); $wepay_create_array = array( 'name' =>"xxxx", 'description' => "xxxxxxxxx xxxx", 'callback_uri' => "xxxxxxx", 'country' => "ca", 'currencies' => array('cad'), 'country_options' => $forca, 'rbits'=> array( array( 'receive_time'=>strtotime("now"), 'type' =>'website_uri', 'source' => 'partner_database', 'properties'=> array('uri'=>xxxxx) ) ) ); if won't pass country_options , seems working if pass parameter, giv

php - How to set css at time of PDF creation in yii2? -

pdf fuction* function call ajax after getting data function it's call anothe file here display data coming data base.that file css part in style tag using style tag prind in pdf text , if css file include in css folder pdf not create in proper format public function actioninvoicespacking(){ $pdf = yii::$app->pdf; $modelshipment = shipment::find()->orderby('ship_id desc')->one(); if(count($modelshipment) == 0) { $shipid= 1; } else { $shipid= $modelshipment->ship_id; } $htmlcontent = file_get_contents('http://localhost/shepherdlogistics_v1.0/backend/views/shipment/invoicespackingdata.php'); $pdf->content = $htmlcontent; return $pdf->render(); } invoicespackingdata.php <!doctype html> <html lang="en"> <head> <title>invoice</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, in

android - java.lang.NoClassDefFoundError: rx.subjects.PublishSubject -

i've added adobe creative sdk project , im getting error when im trying move edit image function. fatal exception: main java.lang.noclassdeffounderror: rx.subjects.publishsubject @ com.adobe.creativesdk.aviary.internal.account.adobeaccountconnection.<init>(adobeaccountconnection.java:45) @ com.adobe.creativesdk.aviary.adobeimageeditoractivity.oncreate(adobeimageeditoractivity.java:517) @ android.app.activity.performcreate(activity.java:5268) @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1104) @ android.app.activitythread.performlaunchactivity(activitythread.java:2178) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2264) @ android.app.activitythread.access$600(activitythread.java:144) @ android.app.activitythread$h.handlemessage(activitythread.java:1259) @ android.o

How about the approximation capability of a convolutional neural network? -

globally, deep cnn series of compositions of linear function , sigmoid function. how approximation capability? given enough neurons, neural networks can approximate function. here nice, visual proof.

amazon web services - Gremlin remote command fails with timeout error: Host did not respond in a timely fashion -

i connected remote gremlin server via gremlin groovy shell. connection succeeded. remote command try execute gives timeout error. command :> 1+1 gremlin> :remote connect tinkerpop.server conf/senthil.yaml ==>connected - 10.40.40.65/10.40.40.65:50080 gremlin> :> 1+1 host did not respond in timely fashion - check server status , submit again. display stack trace? [yn] org.apache.tinkerpop.gremlin.groovy.plugin.remoteexception: host did not respond in timely fashion - check server status , submit again. @ org.apache.tinkerpop.gremlin.console.groovy.plugin.driverremoteacceptor.submit(driverremoteacceptor.java:120) @ org.codehaus.groovy.vmplugin.v7.indyinterface.selectmethod(indyinterface.java:215) @ org.apache.tinkerpop.gremlin.console.commands.submitcommand.execute(submitcommand.groovy:41) @ org.codehaus.groovy.vmplugin.v7.indyinterface.selectmethod(indyinterface.java:215) @ org.codehaus.groovy.tools.shell.shell.execute(shell.groovy:101) @ org.codehaus.groovy.tools.s

.net - C# SMO and SqlEnum references error -

i doing c# project vs2013 using smo object. installed install-package microsoft.sqlserver.scripting install-package microsoft.sqlserver.sqlenum.dll by nuget and included using microsoft.sqlserver.management.smo; using microsoft.sqlserver.management.common; using microsoft.sqlserver.management.smo.agent; but getting following error error 9 assembly 'microsoft.sqlserver.smo, version=11.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' uses 'microsoft.sqlserver.sqlenum, version=11.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' has higher version referenced assembly 'microsoft.sqlserver.sqlenum, version=10.0.0.0, culture=neutral, publickeytoken=89845dcd8080cc91' any hand? the problem version mismatch between smo , sqlenum component, exception specifies. problem package, have used install-package microsoft.sqlserver.sqlenum.dll older package sql server 2008. there folders containing neccessary dll fi

c# - Unable to create additional project configurations in VS2015 Professional for a Web Site -

i new building c# web page , have setup razor3 web site. when site created there web.config , web.debug.config. in our environment, there differences between datasources in development , production, create "release" configuration. unfortunately, when go configuration manager, "create new project configurations" check box greyed out. https://www.evernote.com/l/ajtbghvhubfdpoto_okazt3rbkwyxvx_nso.jpg so far haven't been able find how create new config , have ability launch site though in debug mode. how create additional configuration similar web application can setup?

SAPUI5 - How to bind fields of child entity in same panel as fields of parent entity in SAP Friori Sample "Approve PO" app? -

in sap sample "approve purchase order" application, comes sap web ide, how bind fields of "supplier" entity (child) in same "simple form" ui container control fields of "purchaseorder" (parent) entity. in sample, there 3 separate mock data files, 1 each "purchase order", "purchase order items" , "supplier". relationship between purchase order , supplier 1:1 defined in metadata.xml using association. a) purchaseorder (relevant portion only) <entitytype name="purchaseorder" sap:content-version="1" sap:is-thing-type="true"> <key> <propertyref name="poid"/> </key> <property maxlength="10" name="poid" nullable="false" type="edm.string" sap:creatable="false" sap:filterable="false" sap:label="purchase order id" sap:updatable="false"/> &

c++ - using std::tuple to construct a vector-based dataset refer to variadic-templates -

i want make class template below: template < typename... args > class vectortuple; by example, vectortuple < long, double, string > will instanced tuple < vector < long >, vector < double > , vector < string > > i not familiar variadic-templates. worst method copy code < tuple > , modify it. there easy way directly use std::tuple define vectortuple. if looking typedef variadic-templates type then, template<typename... args> using vectortuple = std::tuple<std::vector<args>...>; now can use like vectortuple<long, double, std::string> obj;

c# - Test wcf service with SOAPUI not working -

i have wcf service working fine while consuming vs application. giving error(an error occurred when verifying security message.) while consuming soap ui. if run wcf in vs below request (working fine) <s:envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:header> <a:action s:mustunderstand="1">http://tempuri.org/itest/getuserdata</a:action> <a:messageid>urn:uuid:7b4aa2ac-4399-4e24-9ea7-b8f3a9c446b6</a:messageid> <a:replyto> <a:address>http://www.w3.org/2005/08/addressing/anonymous</a:address> </a:replyto> </s:header> <s:body> <getuserdata xmlns="http://tempuri.org/"> <employeeid>xxxx</employeeid> </getuserdata> </s:body> </s:envelope> but if try consume soapui below request (not working) post http://localhost/abc/test.svc http/1.

java - Understanding why deadlock happens in this implementation -

i new multithreading, , came across example: public class testthread { public static object lock1 = new object(); public static object lock2 = new object(); public static void main(string args[]) { threaddemo1 t1 = new threaddemo1(); threaddemo2 t2 = new threaddemo2(); t1.start(); t2.start(); } private static class threaddemo1 extends thread { public void run() { synchronized (lock1) { system.out.println("thread 1: holding lock 1..."); try { thread.sleep(10); } catch (interruptedexception e) {} system.out.println("thread 1: waiting lock 2..."); synchronized (lock2) { system.out.println("thread 1: holding lock 1 & 2..."); } } } } private static class threaddemo2 extends thread { public void run() { synchronized (lock2) { system.out.println("thread 2: hol

c# - List is empty after linq operation -

i have problem understend happening in foreach loop- listofbookedtimes successfuly gets elements want, after execution of next line listofbookedtimes empty. why? (all lists contain datetime) foreach (var day in alldays) { list = rep.getlistofworkinghours(fulldayworkinghours, day, spworkinghours); bookedtimes = _bookingsservice.getbookedtimes(day, providerid); foreach (var b in bookedtimes) { var listofbookedtimes = list.where(m => m.timeofday == (b.timeofappointment.timeofday)); list.removeall(m => m.timeofday == (b.timeofappointment.timeofday)); listofbookedtimes.select(m => m.year - 50); list.addrange(listofbookedtimes); } your problem not removeall rather fundemental understanding of linq , yield return. when call list.where(m => m.timeofday == (b.timeofappointment.timeofday)); it not executed rather returns enumerat

wordpress - Woocommerce Categories / Show subcategories -

Image
i`m trying create categories , sub categories products . far this: -furniture subcategory of products . on furniture settings choose display type show subcategories . image : so problem when visit furniture sub category , shouldnt show subcategories of furniture in boxes ? : i want when visit -furniture show categories in boxes image above . show living sub category . thank you have change woocommerce settings . go woocommerce setting -> products -> display -> shop page display -> select show both default category display -> select show both. i hope may you.

java - Clickable View Pager in Android -

i want set on click event in view pager. viewpageradapter looks this- public class viewpageradapder extends pageradapter { activity activity; string image[]; public viewpageradapder(activity act, string[] imgarra) { image = imgarra; activity = act; } public int getcount() { return image.length; } public object instantiateitem(view collection, final int position) { imageview view = new imageview(activity); view.setlayoutparams(new viewgroup.layoutparams(viewgroup.layoutparams.match_parent, viewgroup.layoutparams.match_parent)); new imagedownloadertask(view).execute(image[position]); view.setscaletype(imageview.scaletype.center_crop); view.setadjustviewbounds(true); ((viewpager) collection).addview(view, 0); // view.setbackgroundresource(imagearray[position]); return view; } @override public void destroyitem(view a

c# - 2D basic movement UNITY -

currently character works on keyboard, when convert movements touch, through 3 ui buttons (i tried ui image too, success) i'm not succeeding it goes right, left, , jumps. how should make follow these instructions: when user presses directional, character not stop walking until user user releases button, , when press jump player jump. this script use move through keyboard! using unityengine; using system.collections; public class player : monobehaviour { public float velocity; public transform player; private animator animator; public bool isgrounded; public float force; public float jumptime = 0.4f; public float jumpdelay = 0.4f; public bool jumped = false; public transform ground; private gerenciador gerenciador; // use initialization void start () { gerenciador = findobjectoftype (typeof(gerenciador)) gerenciador; animator = player.getcomponent<animator> (); gerenciador.startgam