Posts

Showing posts from September, 2012

java - How to pass id to delete one record from table -

i retrieved data database , show list table. delete single record when click "delete" in table. i'm not sure how pass id of record want delete. please check code , give instructions? i'm appreciate instructions. jsp: <table id="employee" class="table"> <thead> <tr> <th><span>id</span></th> <th><span>name</span></th> <th><span>dob</span></th> <th><span>address</span></th> <th><span>position</span></th> <th colspan="2"><span></span></th> </tr> </thead> <tbody> ...

Hide nested html elements except the first two (jQuery)? -

i have structure this: <ol class="feeds"> <li class="feed"></li> <strong> <li class="feed"></li> <strong> <li class="feed"></li> <strong> <!-- , on --> </strong> </strong> </strong> </ol> how can hide .feed elements except first , second? try :- $(".feed:gt(1)").hide(); //since javascript arrays use 0-based indexing have use '1' in index. read more :gt() here.

c# - Reusable Included Layouts -

i've discovered can include .axml layout file inside of using tag. great, allowing encapsulation of common layout themes, i'm wondering whether there way bind code/logic included layout? my include layout contains few buttons, , i'd each of these buttons take user different activity. obviously, don't want have repeat code inside of each activity there way can write class contains logic included layout , bind it? if provide example appreciated ;) you can reuse method have written button there boiler plate code comes it. can either: in each activity add method buttons click event. or define click method in xml , implement in activities (with base class or individually) so: the activity [java.interop.export("somebuttonclick")] public void somebuttonclick(view v) { yourreusablemethod(); } the axml <button android:id="@+id/some_btn" android:layout_width="wrap_content" android:layout_h...

android - Application Error: The protocol isn't supported (cedemo://com.example.scheme.MainActivity) -

Image
i want launch android app phonegap using custom url scheme.my phonegap web link <a href="cedemo://com.example.shcema.mainactivity">launch application</a> it manifest file: <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:scheme="cedemo" android:host="com.example.shcema.mainactivity"/> </intent-filter> </activity> it main activity: public class mainactivity extends activity ...

javascript - function not working in jsp page? -

<script> function keepcount() { var x=0; var count=0; var x; for(x=0; x<document.questiongenerate.elements["questions"].length; x++){ if(document.questiongenerate.elements["questions"][x].checked==true || document.questiongenerate.elements["option"][x].checked==true || document.questiongenerate.elements["description"][x].checked==true || document.questiongenerate.elements["fillups"][x].checked==true){ count= count+1; document.getelementsbyname("t1")[0].value=count; } else { document.getelementsbyname("t1")[0].value=count; //var vn=$('#t1').val(); // alert(vn); //alert(vn); //alert("value is"+count); } } // va...

php - how to select random index based on the current time -

given array of length n, how select random index based on current time. wanted generate random integer 0 n based on current time. possible mathematically? you can seed random number generator derived value time() : mt_srand(time() / 30 / 60); // reseed every 30 minutes echo mt_rand(0, n); without random number generator can use modulo: echo (time() / 30 / 60) % n; note mt_rand() output may include n whereas module version doesn't.

asp.net mvc - MVC web api with GET and POST Method -

how execute mvc web api method different name type , post. can't able execute. shows error. here code. webapiconfig.cs config.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{id}", defaults: new { action = "get", id = routeparameter.optional } ); employee controller : [httpget] public string test1() { return "this test1 string"; } [httpget] public string test2() { return "this test2 string"; } [httppost] public string test3() { return "this test3 string"; } i want execute both post , method in different scenario. how it? there 2 ways achieve specify different input parameters methods same http method (httpget/ httpost/httpput). example - [httpget] public string test1(string input) { return "this test1 string"; } [httpget]...

Java: Type aliases support annotation processing tool (APT)? -

i never worked type aliases, concept seems useful feature adding semantics on same-typed objects , defending common typos. let's say, there void foo(float volume, float weight) . it's ok if it's invoked this: foo(v, m) , foo(m, v) not obvious typo. void process(iterable<file> javapath, iterable<file> classpath) can use case. unfortunately there no type aliases in java, , workarounds true overkill: aggregating single field class (boxing primitive object; object in object having reference; more complicated serializing/deserializing rules) extending 1 class 1 (like how create variable type alias in java - impossible primitives; classes may final or have inaccessible constructor). so both of them have drawbacks , runtime/performance cost. as far can see, in java, runtime-based "type aliasing" might replaced compile-time checks, @notnull , @nullable processed. there static type-alias checkers/apt tools featuring support constructions void ...

c++ - Will the connection be disconnected in Qt automatically? -

from problem here: qt signals , slots object disconnect? if first call delete on qobject, call disconnect function this: myqclass* = new myqclass(); connect(a,signal(a_s()),this,slot(b_s())); a->deletelater(); ... disconnect(a,signal(a_s()),this,slot(b_s())); will cause crash? found cause crash under qt4, not qt5? different qt version doing different? otherwise, there might else wrong code. connections disconnected automatically on object destruction. crash happens because trying call disconnect on object destroyed. getting dangling pointer (having address object not exist anymore). depends little "..." is.

asp classic - Upload and display picture -

i have created shadowupload.asp , upload.asp. works but, want display picture uploaded don't know how display it my source code is <!-- #include file="shadowupload.asp" --> <form action="<%=request.servervariables( "script_name" )%>?action=1" enctype="multipart/form-data" method="post"> picture profile: <input type="file" name="file1" value="<%=mypicture%>" /><br /> <button type="submit">upload</button> </form> <img border="0" src="<%=mypicture%>" width="90" height="100">` <% dim objupload if request("action")="1" set objupload=new shadowupload if objupload.geterror<>"" response.write("sorry, not upload: "&objupload.geterror) else ` response.write("found "&objupload.filecount&" files...<...

export - line shown in bold when exporting Highcharts with Phantomjs -

Image
i want export line chart server using highcharts , phantomjs, image exported line shown in bold: here source code used generate chart: var system = require('system'); var page = require('webpage').create(); var fs = require('fs'); page.injectjs("/var/www/test/public/jquery.js") || (console.log("unable load jquery") && phantom.exit()); page.injectjs("/var/www/test/public/js/highcharts.js") || (console.log("unable load highcharts") && phantom.exit()); page.injectjs("/var/www/test/public/js/exporting.js") || (console.log("unable load exporting") && phantom.exit()); page.onconsolemessage = function(msg) { console.log(msg); } var width = 550, height = 400; if(system.args.length == 4) { width = parseint(system.args[2], 10); height = parseint(system.args[3], 10); } console.log("load result file"); var result = [['nintendo', 54030288], ['ele...

php - How to make mysql like and not like fetch strings from a list -

i have following mysql code select * loans_book the_amount < 500000 , loan_amount_you_require not '%avensis%' or loan_amount_you_require not '%prius%' or loan_amount_you_require not '%porsch%' or the problem is,if keep adding not likes,they bound add 100 , suspect list grow longer. i way mysql has not in can comma separate strings not like different in need specify column name each time. is there way possibly go around requirement state column name each time want use not like ?. you can try using not regexp this... query should following: select * loans_book the_amount < 500000 , loan_amount_you_require not regexp 'avensis|prius|porsch';

Embed Jetty loading web context issue -

i want load web context not xml, configure programatically. if use method setwar(), worked. <!doctype web-app public "-//sun microsystems, inc.//dtd web application 2.2//en" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app id = "derbynet_id"> <servlet> <servlet-name>h2console</servlet-name> <servlet-class>org.h2.server.web.webservlet</servlet-class> <init-param> <param-name>weballowothers</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>h2console</servlet-name> <url-pattern>/console/*</url-pattern> </servlet-mapping> </web-app> but, want remove webapp. becasuse has xml only. so, want set servlet programmaticall...

c++ - Boost spirit parser not compiling -

i tried write simple expression parser boost::spirit. started calculator example (see: http://www.boost.org/doc/libs/1_41_0/libs/spirit/example/qi/calc2_ast.cpp ) , tried add "ref" rule denoting reference variable. here code: #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/variant/recursive_variant.hpp> #include <boost/variant/apply_visitor.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spirit/include/phoenix_function.hpp> #include <iostream> #include <vector> #include <string> namespace client{ namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; /////////////////////////////////////////////////////////////////////////// // our ast /////////////////////////////////////////////////////////////////////////// struct binary_op; struct unary_op; struct ref { std::string name; ...

java - Pass integer to activity from within handler -

i'm working on app in activity shown 3 seconds, after next activity started. succeeded following code: // shows picture 3 seconds, takes user gameplay final handler handler = new handler(); handler.postdelayed(new runnable() { public void run() { intent intent = new intent(showimage.this, gameplay.class); showimage.this.startactivity(intent); showimage.this.finish(); } }, 3000); this activity shows picture , want pass id of picture next activity. know can done (from experience, in activity) using following code (i tried inserting in blank line above): this.putextra("id", selected_image); however, error "the method putextra(string, int) undefined type new runnable(){}" my question is , how pass image-id next activity, while containing 3-seconds delay? here rest of activity's code: import android.content.intent; import android.graphics.bitmap; import android.os.bundle; import ...

mysql - ERROR 1452 (23000) does not print the line number in the data file sourced -

i importing data dump , error below. there way line number in source file caused this? mysql> source datadump.sql; error 1452 (23000): cannot add or update child row: foreign key constraint fails ... to add, dont see error messages in logs. thanks.. instead of using source command mysql monitor, use mysql command directly shell: $ mysql < datadump.sql

osx - Ghostscript over PHP on Mac Yosemite doesn't work. On Shell it works -

i 'm despair... i installed ghostscript on mac os x yosemite via homebrew. ghostscript works on shell, doesn't work, if executed via php. $gs = '/usr/local/opt/ghostscript/bin/gs'; // count pdf $shell = $gs . ' -q -dnodisplay -c "(' . $pdf . ') (r) file runpdfbegin pdfpagecount = quit" 2>&1'; $result = shell_exec($shell); // execution $shell = $gs . ' -dnumrenderingthreads=4 -dnopause -sdevice=jpeg -dfirstpage=1 -dlastpage=1 -soutputfile="' . $filepaththumb . '" -djpegq=100 -r300 -q "' . $pdf . '" -c quit 2>&1'; $result = shell_exec($shell); the output of $result is: dyld: library not loaded: /usr/local/lib/libtiff.5.dylib referenced from: /usr/local/opt/ghostscript/bin/gs reason: incompatible library version: gs requires version 8.0.0 or later, libtiff.5.dylib provides version 7.0.0 if execute same command on shell works... i tired many things in last days...

java - Can anyone help me to find what is wrong in below code? -

i not getting updated list method passed references list<person> beans = new arraylist<person>(); boolean alreadypresent = ispersonpresentonsolr(solrserver, beans); // beans.size() 0 boolean ispersonpresentonsolr(solrserver solrserver, list<person> beans) { queryresponse response = solrserver.query(solrqry); beans = response.getbeans(person.class); //beans.size() 5 } you should not do beans = response.getbeans(person.class); // lost reference of object. c++ way, //but not works java you should do list<person> newbeans = response.getbeans(person.class); beans.addall(newbeans);

MongoDB .limit() ignoring .sort()? -

on mongodb 2.6.5 using mongo shell run queries the problem: .limit() seems ignore .sort(). is regular behavior? don't think it's suppose i'm not sure. if not, there way make work sorting , limiting rather limiting sorting. i'm running following query db.post.find({categories: {$in: ["101"]}, location: {$near: [1.310000, 103.700000], $maxdistance: 0.449964}, dateexpire: {$gte: isodate("2014-11-27t00:00:00z")}, defunctind: null}, {_id: 1, datecreated: 1}).sort({datecreated: -1}).limit(5); and result (the dates not in order of sorted list below) { "_id" : objectid("5473df733a0da831248b4567"), "datecreated" : isodate("2014-11-25t01:46:26.059z")} { "_id" : objectid("546ea9f63a0da8725b8b4725"), "datecreated" : isodate("2014-11-21t02:56:51.143z")} { "_id" : objectid("546da7503a0da856058b4633"), "datecreated" : isodate(...

c++ - Delete a file on 'Cache Clear' in IE -

we creating browser extension ie. using atl , c++ create same. we writing file: authtest.txt on successful login inside %appdata%\local\microsoft\internet explore to store information during session. on logout, deleting file well. my question when user clears cache of ie browser, authtest.txt not deleted. how delete file on cache clear code? ie maintains database of files in cache. have tell ie file can added database. @ createurlcacheentry() , commiturlcacheentrya() , , commiturlcacheentryw() . refer msdn more details working ie cache: caching (windows)

security - What happens when a server without SSL makes an HTTPS request to a server that does? -

in these instances, happens? communication fall http? i'm assuming communication either fail, or fallback, depending on setup of ssl-enabled destination server. example case: a plugin installed on server (which may or may not have ssl), communicates api functions on https on server b. i think question not clear enough. mean, "a server without ssl", that the server system has no kind of ssl software installed. in case of course no ssl requests can done server. or web server available http , not https, there script on needs access other hosts https. in case can these requests if required software installed on server , if target host available https , if no firewalls blocks connections etc. configuration of web server has nothing kind of requests programs on web server can do.

c# - Best practice for ServiceBus message versioning -

i setting system transport messages between several internal services on servicebus topics. messages hold serialized objects. model objects defined quite complex trees of classes. means not practical maintain duplet versions of model structures in code. we expect model structure change have exposed model version property on brokered message. what best way handle transition when need upgrade model version? i don't think need support 2 parallell model versions. concerned don't loose messages during transition. assume strategy upgrade sending services first , let subscribers continue process messages. when messages of previous version processed, time upgrade subscribing services. what best mechanism skipping messages new version listening service not handling? i know go old school , define parallell model versions using schemas json or xml, making possible listening service handle parallell versions. cumbersome, want avoid that. i noticed brokeredmessage has defer ...

optimistic locking - Hibernate: lockMode for criteria is not working -

i need specify lock mode hibernate. doing: session().createcriteria(clazz, "c") .add(restrictions.eq("c.a", false)) .add(subqueries.propertyeq("c.b", subquery)) .setlockmode("pos", lockmode.pessimistic_read); but when see provided query - hibernate still doesn't provide select update how can force hibernate make select update clause? see case when works this: session().get(clazz, id, lockoptions.upgrade); but need use more complex query. i've found reason why it's wasn't working. it's bug in hibernate 3.5-3.6 , it's fixed in 4.0.1. https://hibernate.atlassian.net/browse/hhh-5275 so, i've ended workaround: myobject myobject = criteria.uniqueresult(); myobject lockedone = (myobject) session() .get(myobject.class, myobject.getid(), lockmode.upgrade_nowat);

php - How to get more than 1 ajax call response in different intervals? -

as i'm doing ajax call need show in front end what's running in end. for example, i'm uploading file. @ time have following steps complete. inserting file data db moving of files folder, based on response step 1 finally updating db through single ajax while step 1 running need show : inserting files db... in step 2: moving files folder... in step 3: updating table... i know how 3 responses @ time json_array('res1' => '', 'res2' => '', 'res3' => '') but need same responses 3 intervals. below code understand function file_sampe_upload(){ //code insert ....... echo json_array('status' => 1, 'res1' => 'files inserted successfully'); //code moving files specific folder ...... echo json_array('status' => 1, 'res2' => 'files moved successfully'); //code updating files ...... echo json_array('status'...

Android Linear Layout Split Screen with Scrollview -

the following layout <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="0.5" android:layout_gravity="top" android:background="#ffffff" > <scrollview android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="0.5" android:gravity="center_horizontal" android:orientation="vertical" android:background="#ffffff" android:layout_marginleft="15dp" android:layout_marginright="15dp"> <linearlayout android:layout_width="0dip" android:layout_height="match_parent" android:background="#f4f2f2" android:layout_weight=...

r - extracting hashtags from tweets -

i trying perform sentiment analysis , facing small problem. using dictionary has hashtags , other junk value(shown below). has associated weight of hashtag. want extract hashtags , corresponding weight new data frame. there easy way it? have tried using regmatches, how giving output in list format , messing things up. input: v1 v2 1 #fabulous 7.526 2 #excellent 7.247 3 superb 7.199 4 #perfection 7.099 5 #terrific 6.922 6 #magnificent 6.672 output: v1 v2 1 #fabulous 7.526 2 #excellent 7.247 3 #perfection 7.099 4 #terrific 6.922 5 #magnificent 6.672 this code should work , give desired output data.frame input<- data.frame(v1 = c("#fabulous","#excellent","superb","#perfection","#terrific","#magnificent"), v2 = c("7.526", "7.247" , "7.199", "7.099", "6.922", "6.672")) extracthashtags <-...

javascript - Hardcode file path instead of manual file input -

i want read text file using javascript. passing filelist object , available codes use <input type="file"> change event, want path of txt file hardcoded inside javascript , event fired onload of document. how can implement it?? available code <input type="file"> is: <input type="file" id="fileinput" /> <script type="text/javascript"> function readsinglefile(evt) { //retrieve first (and only!) file filelist object var f = evt.target.files[0]; console.log(evt); if (f) { var r = new filereader(); r.onload = function(e) { var contents = e.target.result; alert( "got file."+f); } r.readastext(f); } else { alert("failed load file"); } } document.getelementbyid('fileinput').addeventlistener('change', readsinglefile, false); </script> you can't. access files on user's system ...

Display data from db to JSP page with update and delete links corresponding each row? -

this question has been asked many times. extending it. want display database table data onto jsp page table , 2 links follow each row. first is, update. second, delete. assume each row has id associated coming database itself , how can create links , pass id when press delete, corresponding row deleted. also, how update values id ? <table border="1"> <tr> <th>id</th> <th>name</th> <th>address</th> <th>update</th> <th>delete</th> </tr> <% while(resultset.next()){ %> <tr> <td> <%= resultset.getstring(1) %></td> <td> <%= resultset.getstring(2) %></td> <td> <%= resultset.getstring(3) %></td> <td> <a href="#">update</a> </td> <td> <a hre...

sql - MySQL: Sum if rows are equal -

Image
i want make sql select-query select everything, when client , thickness , material same value of 'amount' should added. how go creating such query? if understand correctly. this: select client, thickness, material, sum(amount) totalamount table1 group client, thickness, material

angularjs - angular-dimple error TypeError: Cannot read property '_hasCategories' of null -

i trying build stacked-bar chart using dimple.js need through angular directives using angular-dimple here have coded run sample example: <script type="text/javascript"> var app = angular.module("dimpletestapp", ['angular-dimple']); app.controller('myctrl', ['$scope', 'dataservice', function($scope, dataservice) { dataservice.getdata().then(function(response) { $scope.graphdata = response.data; console.log($scope.graphdata); }); }]) .service('dataservice', ['$http', function($http) { return { getdata: function() { return $http.get('data.json'); } }; }]); </script> </head> <body ng-app='dimpletestapp'> <div ng-controller="myctrl"> <graph data="graphdata...

sql server - SQL: Arrange numbers on a scale 1 to 10 -

i have table in sql server 2008 database number column want arrange on scale 1 10. here example column ( scale ) want accomplish sql name count (scale) ---------------------- 19 2 b 1 1 c 25 3 d 100 10 e 29 3 f 60 7 in example above min , max count 1 , 100 (this different day day). i want number each record belongs to. 1 = 0-9 2 = 10-19 3 = 20-29 , on... it has dynamic because data changes everyday can not use where clause static numbers this: when count between 0 , 10... try this, though note technically value 100 doesn't fall in range 90-99 , therefore should classed 11, hence why value 60 comes out scale of 6 rather 7: sql fiddle ms sql server 2008 schema setup : query 1 : create table #scale ( name varchar(10), [count] int ) insert #scale values ('a', 19), ('b', 1), ('c', 25), ('d', 100), ('e', ...

python - Printing non-matching (unique) lines in a file -

i'm trying create function opens file ( filename ), prints each line of text differs previous line (with first line written). each output line should prefixed line number in input file. i've come following, consistently prints last line of text regardless of whether or not duplicate line: def squeeze(filename): file = open(filename, 'r') prevline = '' line_num = 0 line in file: line_num = line_num + 1 if line != prevline: print ('%3d - %s'%(line_num, line)) prevline = line filename = 'test.txt' squeeze(filename) i can't seem figure out , flaw in code fix this? thank you, helpful, used ticked one! each line should terminated in newline character \n or \r\n . final line doesn't have it. you can use str.strip() remove it. with open(filename, 'r') input_f: prevline = '' line_num = 0 line in input_f: line_num += 1 i...

asp.net mvc - AngularJs UI-Router - $stateProvider can't read my abstract state -

i have problem html5mode. in mvc project have 1 controller public class homecontroller : controller { public actionresult index() { return this.file("index.html", "text/html"); } } in angular project have 2 routes , 1 abstract. angular.module('app').config(function ($urlrouterprovider, $stateprovider, $locationprovider) { // if none of above states matched, use fallback $urlrouterprovider.otherwise('/app/articles'); $stateprovider .state('app', { url: "/app", abstract: true, templateurl: "templates/blocks/layout.html", controller: 'appctrl' }) .state('app.articles', { url: "/articles", templateurl: 'templates/articles.html', controller: 'articlesctrl' }) .state('app.one-article', { ...

How to make schema less titan graph?How to set schema-default propery? -

how make schema less titan graph?how set schema-default propery ? please suggest way?here code : try{ //timestamp,1416375283,ipaddress,2097152002,mobilenumber,966566564213,eventname,1000 // todo auto-generated method stub fileinputstream fstream = new fileinputstream("/root/edges_sorted.txt"); datainputstream in = new datainputstream(fstream); bufferedreader br = new bufferedreader(new inputstreamreader(in)); string csv = "/root/log.csv"; filewriter writer = new filewriter(csv); configuration conf = new baseconfiguration(); conf.setproperty("storage.backend","hbase"); conf.setproperty("storage.hostname","192.168.51.98"); conf.setproperty("storage.batch-loading","true"); conf.setproperty("storage.batch-loading",true); conf.setproperty("storage.buffer-size",3024000); conf.setproperty("storage.tablename",graphname); ...

c# - LINQ - GROUP BY on object to create string -

so have object called version it contains list of states, , list of dates i want first: group states, , create string of states (comma separated) group dates, , create string of dates (comma separated) here have tried: date = version.states.groupby(v => v.date).select(vh => vh.tostring()).tostring(), state = version.states.groupby(s => s.state).select(st => st.tostring()).tostring() can me out here? try this: var states = version.states.aggregate(string.empty, (c, state) => c + state.tostring() + ",").trimend(new []{','}); var dates = version.dates.aggregate(string.empty, (c, date) => c + date.tostring() + ",").trimend(new []{','});

iOS background view not updated using NSTimer while scanning the bluetooth DEVICE -

i trying work on getting bluetooth scanning page pair ble device using bluetooth. have found nsuinteger [ _ble.scannedperipheral count ] change while scanning. however, when comes execution, background view images , pages cannot change. please tell me other wayout make page change if variable showing available ble devices changes 0 1,2 or 3 ? the below code : (only relevant) - (void)viewdidappear:(bool)animated { if (_ble) { _ble.delegate = (id) self; _ble.btstatus = bt_idle; [_ble startscanning]; } [nstimer scheduledtimerwithtimeinterval:0.2f target:self selector:@selector(reloaddata) userinfo:nil repeats:yes]; } -(void) reloaddata { dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ // time consuming workout dispatch_async(dispatch_get_main_queue(), ^{ // ui update workout bluetooth scanning if( [ _ble.scannedperipheral count ] > 0 ){ ...

Symfony, Sonata Admin -

Image
i try install sonata admin symfony. follow instruction of link http://sonata-project.org/bundles/admin/master/doc/reference/getting_started.html . i choose file format admin.yml. when run php app/console assets:install i got error here admin.yml acme/demobundle/resources/config/admin.yml in extension file demobundle\dependencyinjection\demobundleextension (or whatever named it), should load configuration file loader\yamlfileloader, doing loader\xmlfileloader class demobundleextension extends extension { public function load(array $configs, containerbuilder $container) { $loader = new loader\yamlfileloader($container, new filelocator(__dir__.'/../resources/config')); $loader->load('admin.yml'); } }

3d - Jmonkey animation-jump to waypoint -

i’ve been messing while , can not seem find out how this. problem when start motioncontrol, spawn spatial @ first waypoint , move there. however, need make spatial , motion start @ user-defined waypoint (for example: waypoint 10) , go there. could help? thanks the method can find in motionevent changes position on track settime(float) . sane values lie between 0.0f (0%) , initialduration (100%). each time add waypoint motionpath update underlying spline , total length , lengths of each segment. using information can calculate corresponding "time marks" waypoints: public float calcwaypointtime(motionpath path, motionevent motionevent, int waypointindex) { // distance between start , waypoint float wpdistance = 0; // sum segment lengths until waypoint reached list<float> seglen = path.getspline().getsegmentslength(); for(int i=0; i<seglen.size() && i<waypointindex; ++i) wpdistance += seglen.get(i); ...

How to get the audio and video from a WebRTC stream using ffmpeg on server -

i trying audio , video webrtc stream , handle (transcode or dump) ffmpeg on ubuntu server. have naively expected interpret sdp offered webrtc, mistaken. suspect ffmpeg not capable of signaling answer sdp , must done manually. here offer sdp: v=0 o=mozilla-sipua-33.1 3662 0 in ip4 0.0.0.0 s=sip call t=0 0 a=ice-ufrag:5e0a74d1 a=ice-pwd:7446c0eb445117d0018ca2afc5f3ca54 a=fingerprint:sha-256 76:1b:19:ce:3f:41:c5:4d:64:e6:fd:72:d2:fc:42:e1:98:d4:0f:2b:73:ae:c7:f4:2c:73:2c:e7:9e:dc:6a:eb m=audio 23063 rtp/savpf 109 0 8 101 c=in ip4 188.253.146.208 a=rtpmap:109 opus/48000/2 a=ptime:20 a=rtpmap:0 pcmu/8000 a=rtpmap:8 pcma/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=sendrecv a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=setup:actpass a=candidate:0 1 udp 2128609535 192.168.1.100 4130 typ host a=candidate:1 1 udp 1692467199 188.253.146.208 23063 typ srflx raddr 192.168.1.100 rport 4130 a=candidate:0 2 udp 2128609534 192.168.1.100 4131 typ host a=candidate:1 2 udp 16...

java - Postgres encryption is failing in hibernate -

i new postgresql. trying store data in postgres db in encrypted format. per postgres documentation should use pgcrypto. have implememted code in hibernate. if trying store data in plaintext format storing easily. when adding @columntransformer insertion failing below error message. i have executed " create extension pgcrypto; " thanks in advance. 18:07:46,814 info [stdout] (http-localhost/127.0.0.1:8080-1) hibernate: 18:07:46,814 info [stdout] (http-localhost/127.0.0.1:8080-1) insert 18:07:46,815 info [stdout] (http-localhost/127.0.0.1:8080-1) 18:07:46,815 info [stdout] (http-localhost/127.0.0.1:8080-1) book 18:07:46,815 info [stdout] (http-localhost/127.0.0.1:8080-1) (author, name, price, id) 18:07:46,815 info [stdout] (http-localhost/127.0.0.1:8080-1) values 18:07:46,815 info [stdout] (http-localhost/127.0.0.1:8080-1) (?, pgp_sym_decrypt(?, '*************'), ?, ?) 18:07:46,932 warn [org.hibernate.engine.jdbc....

java - Is this called Overloading? -

i have wo methods same name different parameter types , different return types. public class testoverloading { public void display(){ system.out.println("inside display method of testoverloading class"); } public int display(int i){ system.out.println("inside display method of testoverloading class values "+ i); return 0; } } output: following code works fine no errors in jdk 1.6. is called overloading? if not, why not? if methods has same name , different parameters called overloaded methods. return type not matter.

vb.net - Issue with Application.DoEvents() -

i have used application.doevents() in code can exit loop button press, having issue have click on screen before can press exit button, needing 2 clicks. happens every time play try stop program, without closing it. how fix this? do while stopprogram = false application.doevents() radianangle = angle * placeholder me.refresh() if directionpositive = false angle += 1 if angle = 51 angle = 49 directionpositive = true end if elseif directionpositive = true angle -= 1 if angle = -51 angle = -49 directionpositive = false end if end if loop private sub button2_click(sender system.object, e system.eventargs) handles button2.click stopprogram = false runningprogram() end sub private sub button3_click(sender system.object, e system.eventargs) handles button3.click stopprogram = true end sub one workaround: work ok if use mousedown instead of...

MongoDB Java driver edit a cursor after it has been retrieved -

in mongodb java driver retrieve documents query. dbcursor cursor = dbcollection.find(query).sort(new basicdbobject("date", -1)); return json.serialize(cursor); this works fine returns following: { "issuccessful": true, "result": [ { "date": { "$date": "2014-11-26t23:00:00.000z" }, value: 20 } ] } but: want edit field $date using simpledateformat i've tried this: dbcursor cursor = dbcollection.find(query).sort(new basicdbobject("date", -1)); while(cursor.hasnext()){ dbobject dbo = cursor.next(); dbo.put("date", simpledate.format(dbo.get("date"))); } return json.serialize(cursor); but while loop doesn't affect returned result. gives same result back. how change date field , return it? i've put following line: simpledate.format(dbo.get("date")) i...

substring - can we extract multiple data from a single query using string functions in mysql? -

i wonder if can extract multiple data single query using string operations.? here looking query returns me +-----------------------------------------+ | geodata | +-----------------------------------------+ | {"lat"=>"28.644348", "lon"=>"77.219682" | +-----------------------------------------+ can extract lat value , lon value through string query? i tried , succeed extracting single value. can suggest me how this? of-course can after pulling data rails app thinking pull data directly query. yes done assuming pattern shown same mysql> select replace(substring_index(substring_index('{"lat"=>"28.644348", "lon"=>"77.219682"','"lat"=>',-1),',',1),'"','') lat; +-----------+ | lat | +-----------+ | 28.644348 | +-----------+ 1 row in set (0.00 sec) mysql> select replace(su...