Posts

Showing posts from June, 2014

java - best online tutorials for J2EE and J2ME -

i new j2ee , j2me familiar core java. have started learning j2ee , j2me. request suggest best online tutorials both (pdf , videos) j2ee , j2me. please guide me how start learning mvc frame works,which should start first , best? thank quora it j2ee - https://www.quora.com/what-is-the-best-and-quickest-way-to-learn-j2ee j2me - https://www.quora.com/how-can-i-learn-j2me-from-basic even can find better articles.

php - Symfony : why am I not allowed to combine "type" with "defaults" in routing.yml -

short version of question : symfony's error message explains cannot use type key in conjunction defaults , can use resources (see details below). why ? how can fix ? detailed version : here exact sequence of did in symfony : composer create-project symfony/framework-standard-edition sym-book/ '~2.5' php app/console generate:bundle --namespace=middleman/bookbundle --format=yml edit contents of src/middleman/bookbundle/resources/config/routing.yml to middle_man_book_example: path: /example defaults: { _controller: middlemanbookbundle:lucky:number } type: annotation in directory src/middleman/bookbundle/controller , rename defaultcontroller.php luckycontroller.php , , edit contents to namespace middleman\bookbundle\controller; class luckycontroller { /** * @route("/lucky/number") */ public function numberaction() { $number = rand(0, 100); return new response( '<html>

php - Unable to get page name in wordpress -

i customizing wordpress plugin used popup email subscribing. when user submits email gets confirmation email in iam sending custom html him. have 5 different pages on web site , every page has popup. iam doing want name of page according want send html in email. did same thing other plugin , worked in popup plugin iam unable page name called. have tried following things failed. global $post; /* worked perfect on other plugin */ $pagename = $post->post_name; if($pagename=="page1") { // html page1 // } else { // html page2 // } just tried this $slug = basename(get_permalink()); if($slug=="page1") , on here go, need title this, as $post = get_post( $post ); $pagename = isset( $post->post_title ) ? $post->post_title : ''; hope helps.

bash - Tripwire Silent Installation on Ubuntu -

i trying install tripwire non-interactively doing following, still getting window screen inserting local , site keys. code in bash file written below. can advise solution ? thanks tripwirelocalpassword=something tripwiresitepassword=something sudo echo "postfix postfix/main_mailer_type select internet site" | sudo debconf-set-selections sudo echo "postfix postfix/mailname string `hostname`" | sudo debconf-set-selections sudo echo "tripwire tripwire/local-passphrase password ${tripwirelocalpassword}" | sudo debconf-set-selections sudo echo "tripwire tripwire/local-passphrase-again password ${tripwirelocalpassword}" | sudo debconf-set-selections sudo echo "tripwire tripwire/site-passphrase password ${tripwiresitepassword}" | sudo debconf-set-selections sudo echo "tripwire tripwire/site-passphrase-again password ${tripwiresitepassword}" | sudo de

javascript - Markdown to HTML w/ syntax highlighting using Gulp -

Image
i'm using gulp-markdown package render markdown file html partial. (it uses npm marked package actual rendering.) renders fine, except code blocks!! how gulp put out correctly formatted html? here gulp: var gulp = require('gulp'); var markdown = require('gulp-markdown'); markdown.marked.setoptions({ renderer: new markdown.marked.renderer(), gfm: true, tables: true, breaks: false, pedantic: false, sanitize: true, smartlists: true, smartypants: false }); // turn md files html partials gulp.task('blogposts', function () { return gulp.src('src/blog/blogone.md') .pipe(markdown()) .pipe(gulp.dest('src/partials')); }); and here markdown: ```javascript app.controller('displaycontroller', ['$scope', 'clogsservice', function($scope, clogsservice){ $scope.clogs = []; $scope.getclogs = function() { clogservice.getclogs() .then(function(response){ clogss

android - MPAndroidChart: Different xValues for each zoom level -

consider chart years xvalues. want change xvalues months when user zoom in or double tap. , change xvalues days next zooming level. possible great mpandroidchart? i play function float displayed = totalitemcount/30; mchart.setscaleminima(displayed, 1f); i've set show 30 values, can set show whatever need changing values, , changing tags when user doubletouchs screen.

crash - Error on startup android application (Titanium framework) -

i've problem titanium android application. app works correctly in ios, not in android. i following error: v8object: (krollruntimethread) [88,88] runtime disposed, cannot set property 'useragent' [info] : dalvikvm: not find method android.app.activity.checkselfpermission, referenced method ti.modules.titanium.media.mediamodule.hascamerapermission [info] : dalvikvm: not find method android.app.activity.checkselfpermission, referenced method ti.modules.titanium.media.mediamodule.hasstoragepermission [warn] : dalvikvm: vfy: unable resolve virtual method 27: landroid/app/activity;.checkselfpermission (ljava/lang/string;)i [warn] : dalvikvm: vfy: unable resolve virtual method 27: landroid/app/activity;.checkselfpermission (ljava/lang/string;)i [info] : dalvikvm: not find method android.app.activity.checkselfpermission, referenced method ti.modules.titanium.media.mediamodule.hascamerapermissions [warn] : dalvikvm: vfy: unable resolve virtual method 27: landroid

Warnings when compiling a Linked List code in java -

i trying write simple code implement linked list in java using java.util.linkedlist library. have tried best keep error-free. it compile (and execute) using -xlint:unchecked. generates lot of warnings of type - ll.java:25: warning: [unchecked] unchecked call add(e) member of raw type linkedlist can me 1. comprehend why happening? 2. remove warnings! any appreciated... import java.util.linkedlist; class ll{ public static void main(string[] args){ //creating new linked list object linkedlist llobj = new linkedlist(); //adding data linked list llobj.add("t"); llobj.add("h"); llobj.add("i"); llobj.add("s"); llobj.add(" "); llobj.add("i"); llobj.add("s"); llobj.add(" "); llobj.add("a"); llobj.add(" "); llobj.add("l"); llobj.add("i"); llobj.add("n"); llobj.add("k");

Javascript running from html but not php -

i've read similar question here, can't seem around in case, appreciate clarification. have page in php runs several instances of javascript work on cue on localhost . 1 particular instance of javascript (that makes arrow hide when scrolls beyond 10px) not run, when run same html version of same php page, arrow action works desired. why case? here code of page in jsfiddle (exactly same used respective sections in php page.) to clarify have added bit of javascript in following manner @ end (after footer, before body end) of index.php file (along other blocks of javascript work desired respective targets): <script type="text/javascript"> $(window).scroll(function () { if ($(this).scrolltop() > 10) document.getelementbyid('arr_downpoint').style.visibility = 'hidden'; else document.getelementbyid('arr_downpoint').style.visibility = 'visible'; }); </script> i have added jquery follows (and

Integrate description from one file in another XML file in Perl -

i'm new here apologize bad english. have 2 files (file 1: main-xml-file , file 2: description-file) , want integrate description line per line in specific position (replace xx in hit_def) in xml-file. file 1: here xml-tree: <blastoutput> <blastoutput_iterations> <iteration> (gene 1) <iteration_hits> <hit> (1-10) <hit_def> <iteration> (gene 2) <iteration_hits> <hit> (1-10) <hit_def> and here first , last lines, because file 5 gb big: <?xmlversion="1.0"?> <blastoutput> <blastoutput_program>rapsearch</blastoutput_program> <blastoutput_version>rapsearch2</blastoutput_version> <blastoutput_reference>yonganzhao,haixutangandyuzhenye.rapsearch2:afastandmemory-efficientproteinsimilaritysearchtoolfornextgenerationsequencingdata.bioinformatics2012,28(1):12

How to hold and drag (re-position) a layout along with its associated layouts in android -

Image
i making android app. in have scenario. first watch screen shot below 1 come here answer has clear picture want. scenario: activity having map below navigation bar, relativelayout (red background) in center, listview below red relativelayout what want: want drag or re-position (whatever term may used others) red relativelayout holding finger on , move , down on screen along listview below should move layout code tried: xml layout <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <relativelayout android:layout_width="match_parent" android:layout_height="@dimen/fifty_five_dp" android:id="@+id/topbar" android:backgro

sql - What's wrong with this Winform C# code? It will run fine in Windows, but in mono(Linux), will throw a NullReferenceException -

the error is: system.nullreferenceexception: object reference not set instance of object. i know error occurs when object used not initialize or being initialized later declared null nevertheless being accessed caused exception. can't figure out offending object can correct myself. error show after selected string listbox control second time. @ first work , if select item second time program quit abruptly, error show @ command line in linux. i can show complete error after running mono win_binary_file if needed. after debugging, i've found offending code throw nullreferenceexception: public void flistitems(datagridview datagridview1, string param_name) { npgsqldataadapter dr = default(npgsqldataadapter); dataset ds; string sql; npgsqlconnection dbcon; string connectionstr = "server=" + databasehost + ";database=" + databasename + ";user id=" + databaseuser + ";password=" + databasep

java - Getting error SEVERE: MessageBodyWriter not found for media type=application/xml, -

jersey get/post call throws following error after upgrading jaxrs , jaxws jar latest version in project: org.glassfish.jersey.message.internal.writerinterceptorexecutor$terminalwriterinterceptor aroundwriteto severe: messagebodywriter not found media type=application/xml, type=class java.util.arraylist, generictype=java.util.list<javax.xml.bind.jaxbelement<com.play.classbase> it working fine accept:application/json , application/xml .i getting error.how fix it? please, verify have jersey-media-jaxb.jar in lib folder of application.

c++ - How to get QModelIndex to insert a new row in a QAbstractTableModel? -

i using model/view programming first time, using table view along qabstracttablemodel , qstyleditemdelegate need combo boxes. model: class stablemodel : public qabstracttablemodel { q_object public: stablemodel(int rows = 1, int columns = 1, qobject *parent = 0); int rowcount(const qmodelindex &parent = qmodelindex()) const; int columncount(const qmodelindex &parent = qmodelindex()) const; qvariant data(const qmodelindex &index, int role) const; qvariant headerdata(int section, qt::orientation orientation, int role = qt::displayrole) const; qt::itemflags flags(const qmodelindex &index) const; bool setdata(const qmodelindex &index, const qvariant &value, int role = qt::editrole); bool insertrows(int position, int rows, const qmodelindex &parent = qmodelindex()); bool insertcolumns(int position, int columns, const qmodelindex &parent = qmodelindex()); bool removerows(int

javascript - Automate populating fields in rails from one link -

so i'm working on links. have list of events, have 1 link inside looks this, provider1.co.uk/event/1f004cc6c1fa8142 not go on know, if called provider 1's api, can access date, venue name, location, etc. now haven't set yet, i'm wanting js script load api. (which have elsewhere). now sidetrack little heres provider twos link. provider2.com/buy-(name-of-event)-tickets/(venue-name)-tickets/(date-of-event)/perf/1028576 and provider 3's provider3.com/(event-name)-tickets-(event-name)-(location-name)-(venue-name)-(date-of-event)/event/9277843/ now how stands @ moment enter these text boxes manually. we'd @ making automatic, provider1 automated. want other 2 providers automatically filled inputboxes on page load. thats it, sounds simple i'm not 100% sure :) sam heres json response provider 1 way "venue": { "venueid": 10191, "name": "venue name", "street": "lo

javascript - How do I disable div animations onclick() using jQuery? -

i have div animates page loads. have button. after 1 clicks on button want make new div , animate animated previous, onclick() first div changes it's position. how should somehow disable animate effect on div animated. <div class="wrapper"> <div class="car"></div> </div> <button id="button">spawn new car</button> $(document).ready(function() { var car = $('.car'); car.animate({left:"+=367px"}, 2000); car.animate({top:"-=247px"}, 2000); $("#button").click(function () { $(".wrapper").append('<div class="car"></div>'); var car = $('.car'); car.animate({left:"+=367px"}, 2000); car.animate({top:"-=247px"}, 2000); }); }); following way can move newly added div. add 1 temporary move class when add , remove after animation. $(document)

c# - Difference in two angles in radians? -

Image
i have simple chart whereby user can determine start & end direction in radians. control draws chart using override of onrender . drawing arcs streamgeometrycontext.arcto . method has islargearc property determines how arc drawn (true > 180 degrees (pi), false < 180 degrees). determining value condition works fine: //rule not exceed 180 degrees in direction (radian), islargearc= false else true if (start < math.pi && (end - start) < math.pi || //currently unknow condition in here deal < pi when start angle > end angle?) { //islargearc = false; } else { //islargearc= true; } the issue comes when start < end. e.g. 270 degrees 120 degrees. need condition satisfy angle on 180 degrees (pi) in situation. maths not strong point. think need add pi*2 end , somehow compare 2 values not sure on how achieve this? well, add full circle end , (or start; according direction) angle e.g.: if (start < end) start += 2 *

c# - How to create a window that blocks the parent in WinForms -

i have order form page within program building in c# windows forms, want make user can add items order using separate pop window displays list of products user can select. once item selected pop window closes , item added order form, item adding process can repeated necessary. my question is, in addition showing window, how pass details of order selected 1 form another? use dialog. if call .showdialog() on form , block until form closed. this means can following: // la la normal code var itemselect = new itemselectionform(); itemselect.showdialog(); // check have selected if (itemselect.itemlist.selecteditem != null) { // item adding code // ... // use itemselect.itemlist.selecteditem selected item popup form }

regex - Python regexp to match numbers with spaces -

i'm regexp newbie , need help. have text represents table. know consist of 7 columns: | int | int mixed -. | unicode string | float | float | int | float | problem float expressed using spaces between thousands (1234,43 => 1 234,43). string can contain spaces , end numbers. tried (for each line striped of new line char): regex = re.compile(r"(\d+) ([\d.-]+) (.*) ([\d+ ]?\d+,\d+) ([\d+ ]?\d+,\d+) (\d+) ([\d+ ]?\d+,\d+)$", re.unicode) w = regex.findall(line) unfortunately doesn't work in cases. test data: 49 602 dskod smcx 262,59 1 131,30 1 1 131,30 49 602 dskod smcx 3 5 262,59 1 131,30 1 1 131,30 50 61-201 łóćźż 1 2 669,50 334,75 1 334,75 51 1-214 aÓŻĆÓds" 70,35 350,18 3 105,53 cases thousands problematic i'm getting: [] [] [(u'50', u'61-201', u'\u0142\xf3\u0107\u017a\u017c 1 2', u'669,50', u'334,75', u'1', u'334,75')] [(u'51', u'1-214', u'a\xd3\u017b\u0106\xd3ds&q

objective c - Defining NSLayoutConstraints to include rectangles inside a view -

Image
i have input data in format of: [ {{0,0}, {0.3, 0.8}}, {{0.4, 0.2}, {0.3, 0.2}} ] so they're string representation of cgrect s contained in 1x1 rectangle. now need display them on screen, inside uiview thats dimensions calculated using auto layout. wanted translate nslayoutconstraints , inside rectangles resize superview resizes. i can set width , height of subviews pretty easily. in loop on rects array create new uiview : cgrect r = cgrectfromstring(rectstring) uiview *rect = [[uiview alloc] init]; [superview addsubview:rect]; nslayoutconstraint *width = [nslayoutconstraint constraintwithitem: rect attribute: nslayoutattributewidth relatedby: nslayoutrelationequal toitem: superview attribute: nslayoutattributewidth multiplier: r.size.width constant:0]; [superview addconstraint:width]; the same goes height. but when want set x , y coordinates of rectangles based on width , height of sup

objective c - Respond to GURL apple event if application isn't running -

i have application responding 'gurl' (get url) apple events custom registered url protocol. being registered , works fine when application running, if application not running start application, not respond url api indicates should. i'm not quite sure how have xcode attach process it's started external source, i'm not sure if application being started arguments indicating url? if not, there way determine application started gurl apple event whenever started? i initializing handler following way: - (void)applicationwillfinishlaunching:(nsnotification *)notification { // register url handler nsappleeventmanager* manager = [nsappleeventmanager sharedappleeventmanager]; [manager seteventhandler:self andselector:@selector(geturl:withreplyevent:) foreventclass:kinterneteventclass andeventid:kaegeturl]; }

ember.js - Ember: Add conditions in form-element to display field contents -

how add conditions in ember template. want achieve condition. if(modalforadd == true) // if modalforadd true set model or property of each input textfield blank { {{bs-form-element controltype="text" label="quantity" property=""}} } else { {{bs-form-element controltype="text" label="quantity" property="model.quantity"}} } here code template {{#bs-modal open=openmodalfordetails title="add new order" body=false footer=false}} {{#bs-modal-body}} {{#bs-form model=this action=(action "saveneworder" model "this")}} {{bs-form-element controltype="text" label="item sku" property="model.item" id="item"}} {{bs-form-element controltype="text" label="quantity" property="model.quantity" id="quantity"}} {{bs-form-element controltype="text" label="descriptio

build - xilinx xps using command line mode -

i working xilinx platform studio(xps) tool make automated design command line tools (without using gui). know how build project using xps in gui mode, don't know how build project command line tools. got information command line tools usage " embedded system tools reference manual " , " command line tools user guide ". but, didn't information following things: how select bus interconnect type. how select clock how select processor how select bram memory how make signals external how import our peripheral how select address i did following steps in xps command line creating new .xmp project adding architecture, device, package speed language setting,simulation setting loading ucf file i don't know how add peripheral, processor , interconnect bus type. i struggling @ stage - know how synthesize, implementation, , bitfile generation. if knows information these things using command line tools or documents, kindly reply post

vbscript - easiest way to download a file -

there many examples on internet , simplest/easiest beginner seems be: dim xhttp: set xhttp = createobject("microsoft.xmlhttp") dim bstrm: set bstrm = createobject("adodb.stream") xhttp.open "get", "http://bla.com/ea_csv_160126.csv", false xhttp.send bstrm .type = 1 '//binary .open .write xhttp.responsebody .savetofile "c:\myfolder\ea_csv_160126.csv", 2 '//overwrite end this returns: write file failed code: 800a0bbc source adodb.stream i debug one, there people complaining error no fix. also, if possible, define variable in order hold value date. script should able download file website adapting changed value in url 160126 else. note: on same website, there file has same name ea_csv_update_160126.csv , 1 update shouldn't taken. edit: if know simpler or equally easy solution works, please post it.

html - Video fullscreen in html5 -

i trying make fullscrren page video.this code: <video id="backgroundvideo" autoplay controls> <source src="{% path video, 'reference' %}" type="video/mp4"> </video> the css : #backgroundvideo { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100; -webkit-transform: translatex(-50%) translatey(-50%); transform: translatex(-50%) translatey(-50%); } when trying open page on phone android (5 inch) doesn't work, opening iphone 4 works. think problem related css. can me fix or can give me solution? since don't how doesn't work, i'm not sure how you. however: top: 50%; left: 50%; if going fullscreen, why position video 50% down, , 50% right? top: 0; left: 0; seems more logica

Android: How to use ksoap2-android? -

i'm using webservice w3school testing, , have method: public static float getcelsius(int fahrenheit) { string soap_action = "http://www.w3schools.com/xml/fahrenheittocelsius"; string method_name = "fahrenheittocelsius"; string namespace = "http://www.w3schools.com/xml/"; string url = "http://www.w3schools.com/xml/tempconvert.asmx"; soapobject request = new soapobject(namespace, method_name); request.addproperty("fahrenheit", fahrenheit); soapserializationenvelope envelope = new soapserializationenvelope(soapenvelope.ver11); envelope.dotnet = true; envelope.setoutputsoapobject(request); try { httptransportse transport = new httptransportse(url); transport.call(soap_action, envelope); soapprimitive result = (soapprimitive)envelope.getresponse(); return float.parsefloat(result.tostring()); } catch(exception e) { return 0; } } but doesn&

mysql - How to display error message in view page using PHP -

i need display error message using php.i explaining code below. addcomplain.php: <div style="color:#f00; text-align:center;"><?php echo $error?></div> <form name="billdata" id="billdata" enctype="multipart/form-data" method="post" onsubmit="javascript:return checkform();" action="complain.php"> </form> suppose have form above , when submit below file called. complain.php: $sql="select * medilink_complain email='".$email."'"; $selres = mysqli_query($con,$sql); if(mysqli_num_rows($selres ) > 0) { $error = "email id exists!"; } when above error come,i need should display above form.in case not getting anything.please me resolve issue. you don't need session. merge code 1 file. show $error if not null , so: <?php $error = null; if ($_server['request_method'] == 'post')

javascript - Giving different number variables to different browsers in Node.js -

i trying give different numbers each of clients. when click button on first browser must usernumber 1 , when in second browser expect usernumber 2 . says usernumber 2 when press button twice or more. after press button on second browser, open first browser , press button, says usernumber 2 , when press 2 or more times says usernumber 1 . so not stable @ , have press button keep in correct value. if run files see mean better. use google chrome, express version 3.0.0 , socket.io version 0.9.16. here app.js , index.html files: index.html <!doctype html> <html> <head> <meta charset="utf-8" /> <title> client number </title> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script src="/socket.io/socket.io.js"></script> <script> var ax; jquery(function($) { var socket = io.connect(); socket.emit('getbrowser1', {}); socket.on('getbrowser1

spring - Cannot convert value of type [com.ibm.ws.naming.util.CacheableReference] to required type [javax.persistence.EntityManagerFactory] for property -

i have spring (using jsf1.2 , hibernate) web application, when try run in websphere8.5 following exception unable debug below error stacktrace: com.ibm.ws.naming.util.cacheablereference@70bf45a1[super=reference class name: javax.persistence.entitymanagerfactory type: jpajndilookupinfo content: puid=3dsacsfrontofficeweb_war#3dsacsfrontofficeweb.war#3ds-acs-entitymanager-pu, 3dsacsfrontofficeweb_war#3dsacsfrontofficeweb.war#persistence/3ds-acs-entitymanager-pu, isfactory=true, issfsb=false, , properties=[] ] [27/01/16 10:18:27:872 wet] 0000008a ffdcprovider w com.ibm.ws.ffdc.impl.ffdcprovider logincident ffdc1003i: incident ffdc émis sur c:\program files (x86)\ibm\websphere\appserver\profiles\appsrv01\logs\ffdc\server1_22048ced_16.01.27_10.18.27.8516602842131953426877.txt com.ibm.ws.webcontainer.webapp.webapp.notifyservletcontextcreated 1341 [27/01/16 10:18:27:872 wet] 0000008a webapp e com.ibm.ws.webcontainer.webapp.webapp notifyservletcontextcreated srve0283e: exceptio