Posts

Showing posts from January, 2011

php - How to populate the array of events in fullCalendar? -

i'm using fullcalendar plugin. want ask how populate events using loop. in here, done statically enumerating in codes events: var evt = [ { title : primaryassets[0], start : releasedates[0], }, { title : primaryassets[1], start : releasedates[1], }]; fullcalendar: $('#calendar').fullcalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, editable: true, weekmode: 'liquid', weekends: true, events: evt }); this working if way. can see these events in calendar, want plot them dynamically using loop. here tried using loop displays last set of elements of array: var primaryassets = <?php echo json_encode($primaryasset_array); ?>; var releasedates = <?php echo json_encode($releasedate_array); ?>; for(var = 0;i < count;i++) { var primaryasset = primaryassets[i]; var release_date = releaseda

c# - Reading an integer from user input -

what looking how read integer given user command line (console project). know c++ , have started down c# path. know console.readline(); takes char/string. in short looking integer version of this. just give idea of i'm doing exactly: console.writeline("1. add account."); console.writeline("enter choice: "); console.readline(); // needs take in int rather string or char. i have been looking quite while this. have found lot on c not c#. did find thread, on site, suggested convert char int. i'm sure there has more direct way converting. you can convert string integer using convert.toint32() function int inttemp = convert.toint32(console.readline());

video streaming - Android app cast HLS got error message No 'Access-Control-Allow-Origin' -

i tried cast m3u8 link chromecast. got below error message on debug page: xmlhttprequest cannot load http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8 . no 'access-control-allow-origin' header present on requested resource. origin ' https://www.gstatic.com ' therefore not allowed access. [cast.receiver.mediamanager] load metadata error i added below m3u8 link xml file google sample app "domocastplayer" <media imageurl="http://peach.blender.org/wp-content/uploads/poster_bunny_small.jpg" mimetype="application/x-mpegurl" studio="peach open movie project" title="u3m8 video" type="movie" url="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8" /> can know set access-control-allow-origin header? or need add file this? your issue states gstatic.com not allowed access media placed on server. so, done need add gstatic.com

java - How i add javax.media.jai.* package in project? -

i read posts , download cross platform zip file contain jmf.jar file. jar not contain javax.media.jai package. jar? you try using maven. here maven repo... http://mvnrepository.com/artifact/javax.media/jai_core/1.1.3 or download source here http://www.oracle.com/technetwork/java/current-142188.html

iphone - How to create a Button action inside custom table cell in ios -

i'm using custom tablecell , want 2 button action inside cell 1 pushviewcontroller , 1 popviewcontrolleranimated how can achieved ? in custom cell you'll have create 2 buttons. write following code in cellforrowatindexpath : -(uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { cellcustomcell *cell = [tableview dequeuereusablecellwithidentifier:@"customcell"]; cell.btnpop.tag = indexpath.row; [cell.btnpop addtarget:self action:@selector(popbuttonclicked:) forcontrolevents:uicontroleventtouchupinside]; cell.btnpush.tag = indexpath.row; [cell.btnpush addtarget:self action:@selector(pushbuttonclicked:) forcontrolevents:uicontroleventtouchupinside]; return cell; } it important set tags button they'll tell row button clicked. define actions : -(void)popbuttonclicked:(id)sender { } -(void)pushbuttonclicked:(id)sender { }

javascript - resize jqgrid when splitter of jquery layout is dragged -

while implementing jqgrid jquery layouts jqgrid not resize when splitter of layout dragged. solution dynamically setting width of jqgrid using binding resize event of window object.but case in div , window object width not affected.please suggest work around issue. my jsfiddle code : example html <div id="content"> <div class="ui-layout-center"> <div id="grid-content"> <table id="grid"></table> </div> </div> <div class="ui-layout-west">west</div> </div> js $("#grid").jqgrid({ datatype: "local", height: 330, colnames: ['key', 'value'], colmodel: [{ name: 'key', index: 'key' }, { name: 'value', index: 'value' }] }); $('#content').layout({ applydefaultstyles: true }); css #content { h

java - What does the = operator do when used twice on three integers? -

this question has answer here: java 2 equal signs in 1 statement? [duplicate] 5 answers what do? int x = 1; int y = 2; int z = 3; x = y = z; i have come across multiple of type of thing in few open source projects , have been confused them. them mean = operator being used twice on 3 integers i.e. x = y = z; . need understand this. thanks! the operator = evaluates right hand side , assigns result variable on left hand side. expression returns value. for work, evaluation proceeds right left: x = (y = z); y becomes 3 , value returned 3. thus, x assigned 3 well.

c# - Executable vs wrapper class -

i working on project using asp.net , c# , need pull in wkhtmltopdf . realize there have been several wrapper classes written simplify calls dlls using c#. there reason why should not invoke executable directly? there performance or security gain using wrapper library? although, specific need use wkhtmltopdf, have had same question in past when using libraries imagemagick well. it's matter of preference. using wrapper classes mentioned, work implementing components may not familiar reduced, thereby freeing valuable time concentrate on aspects of application perhaps can make strongest value-add, such overall application architecture , design, or perhaps application's business logic. if choose write code yourself, may find you're less productive developer competition. and, @uwekeim points out in comment, performance may factor well. if wrapper code not perform needs, may need bypass , go straight component/code library you're calling. it's impor

MFC Ftp client in WinCE 5.0, afxinet not declare CFtpConnection function -

before use afxinet.h(cinternetsession,cftpconnection) to develope ftp client on wince, use csocket develope ftp client, decide use afxinet.h(cinternetsession,cftpconnection), in pc site cftpconnection declare in afxinet.h, but in wince 5.0 afxinet.h not support cftpconnection, why? give me advice please . otherwise, can 1 give me csocket example wince 5.0 ftp client pc side ftp client soft wince side ftp client soft lots of functions / classes removed windows ce sdk because of memory requirements on platform. when windows ce 5.0 designed, devices produced 64mb or fewer. wiki ( http://en.wikipedia.org/wiki/windows_ce_5.0 ) can read: memory footprint: minimum footprint of windows ce 350 kilobytes. you can still try porting mfc classes desktop version windows ce, if own visual studio 2005 license in compiler folders find full source code cftpconnection , never used such classes in mfc looks thin wrapper around win api functions. on pc, files interested in

javascript - Bar chart with longer names -

i have quite simple bar chart. http://jsfiddle.net/6m2t6/3/ problem should have quite long names of lpu in app , overlap each other can see in fiddle. data = '[{"lpu":"some long name (very long) #1","amount":"1"},{"lpu":"some long name (very long) #2","amount":"0"},{"lpu":"some long name (very long) #3","amount":"0"},{"lpu":"some long name (very long)","amount":"1"}]'; what best way prevent overlaping , have possibility view full name? you should rotate labels on x axis. this great blog post on that: http://www.d3noob.org/2013/01/how-to-rotate-text-labels-for-x-axis-of.html also remember put more space on bottom of chart leave room labels hope helps.

Running error Java eclipse -

when run code: package jmv; public class euler3 { static int x=1; static long z = 600851475143l; public static void main(string[] args) { system.out.println(isprime(123454321)); } public static boolean isprime(int p){ for(int y=1 ; y<x ;){ if(x%y == 0){ return true; }else{ return false; } } return false; } } it returns false. why? thank help. appereciate every answer given appereiciate better ones more. the fact not checking p, parameter given function isprime(). it should that: package jmv; public class euler3 { static int x=1; static long z = 600851475143l; public static void main(string[] args) { system.out.println(isprime(123454321)); } public static boolean isprime(int p){ if (p%2 == 0) { return false; } else { for(int y=3 ; y<p ; y=y+2){

android - How to retrieve data using json parsing when there are multiple inner nodes? -

i trying retrieve data using url using json parsing in android. i have done following coding not able figure out how parse node present in inner node items . my json array , codes posted below. please guide me step step. part of json array [ { "items": [ { "id": "11", "item_id": "123", "item_name": "chicken cream soup", "price": "8", "currency": "aed", "category": "soup", "description": "creamy chicken soup garnish & side helpings", "unit": "2", "food_type": "non", "image_large": "/images_large/chickensoup.jpg", "image_thumb": "/images_large/chickensoup.jpg", "timestamp": "

java - ProgressDialog appears too late -

following code: public void onclick(view view) { dialog=new progressdialog(view.getcontext()); dialog.setcancelable(true); dialog.setmessage("initializing please wait"); dialog.settitle("loading"); dialog.setprogressstyle(progressdialog.style_spinner); dialog.setprogress(0); dialog.setmax(100); dialog.show(); progressstatus=0; new thread(new runnable() { @override public void run() { // todo auto-generated method stub while(progressstatus<10) { progressstatus=performtask(); } /*dismiss progress bar*/ myhandler.post(new runnable() { @override public void run() { // todo auto-generated method stub dialog.dismiss();//dismiss dialog toast.maketext(getbasecontext()

How to install android Lolipop in eclipse? -

Image
this android documentation says installation procedure of android lolipop. in third step says that select under android l developer preview section , click install packages. but unable find section android l developer preview . download follow steps eclipse juno. help me if know. note: before installing latest tools in sdk manager, recommend update adt plugin -> check updates. otherwise have face issue described here: update eclipse android development tools v. 23 answer: as mentioned in 2 nd step, first have install latest sdk tools , platform-tools , , build-tools . next step: after installing latest tools, android l , android 4.4w sections:

html - align contents to bottom of div without using position:absolute -

hey there there way can align contents of div tag bottom without using position:absolute . other solutions on internet uses position:absolute and/or vertical-align:bottom , there way without using position:absolute , let's example how align cat in image bottom of div in fiddle thanks! the other solution thinking of filling empty space @ top image gets pushed down bottom have no clue on how either. p.s. please don't suggest using tables in div, if that's possible. you try like <div style="border:1px solid black; height:100px; display:table; width:100%;"> <div style="display:table-cell; vertical-align: bottom;"> <img src="http://placekitten.com/100/100" style="height:90px;position:relative;display:block;" /> </div> </div>

How does Swift's for-in loop work? -

with java's stream api possible use functional internal iteration on collections , like collection.foreach(out::println) is swift's following for-each loop construct... for in names { println(i) } ...merely syntactic sugar internal (functional) iteration paraphrased following imperative loop? for var = 0; < names.count; i++ { println(names[i]) } the language reference states for - in loop, the generate() method called on collection expression obtain value of generator type—that is, type conforms generator protocol. program begins executing loop calling next() method on stream. if value returned not none , assigned item pattern, program executes statements, , continues execution @ beginning of loop. otherwise, program not perform assignment or execute statements, , finished executing for - in statement. so, can that for in names { println(i) } is equivalent to var g = names.generate() // "var" because next()

Formula to deliver answer that is in another sheet, to the left of a matched cell -

i working on formula delivers text cell in sheet, left of matched cell. far have got. =lookup(a2,sheet1!$a$1:$a$46729,sheet1!$b$2:$b$46729) in sheet 1 there selection of product data. there product numbers in column , there needs correct barcode placed in each cell in column b. in sheet 2 there product codes in column , barcodes in column b. there more rows of data in sheet 2. what needed formula place in sheet1!b2 looks sheet1!a2 in sheet2!a2:a50000. if a2 matched @ e.g. sheet2!a90, result in sheet1!b2 should value in sheet2!b90. specific issue having getting sheet2!b90 in sheet1!b2. you can use index/match: =index(sheet2!$b$2:$b$46729,match(a2,sheet2!$a$2:$a$46729,0)) or vlookup: =vlookup(a2,sheet2!$a$2:$b$46729,2,false) the last parameters of match , vlookup functions respectively important forces search exact value , not assume sorted list. vlookup no longer work if reversed columns , b on sheet2 because lookup column has first column in lookup range.

android - HttpPost is not working in andorid (with php and iis 8) -

i use code data server hosted on internet using httppost request and use asynctask class call makehttprequest method in jsonparser class in following link public class jsonparser { static inputstream = null; static jsonobject jobj = null; static string json = ""; public jsonobject makehttprequest(string url, string method, list<namevaluepair> params) { try { if (method == "post") { defaulthttpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(url); urlencodedformentity urlencodedformentity = new urlencodedformentity( params); httppost.setentity(urlencodedformentity); httpresponse httpresponse = httpclient.execute(httppost); httpentity httpentity = httpresponse.getentity(); = httpentity.getcontent(); } else if (method == "get") { defaulthttpclient httpclient = new defa

Regex to match only two specific words, e.g. Yes or No -

my attempt is: ^yes|^no|^$ but when use this, words other "yes" , "no" matched how fix it? i've been testing regex using this online regex tester . try this: ^(?:yes|no)$ in vbscript, this: dim myregexp, foundmatch set myregexp = new regexp myregexp.pattern = "^(?:yes|no)$" foundmatch = myregexp.test(subjectstring) what problem? you had alternation 3 options: ^yes matches yes @ beginning of string, match yes in yes, man... ^no matches no @ beginning of string, match no in no way! ^$ matches empty string

ruby - Rails: How to restart sidekiq? -

i using sidekiq gem run api calls in background. ran sidekiq in daemon process like: bundle exec sidekiq -d now made changes in method, want restart sidekiq. tried kill sidekiq using below command: kill -9 process_id but it's not working. want know command restart sidekiq process. if have idea please share me. i tried below command also: sidekiqctl stop /path/to/pid file/pids/sidekiq.pid so after find proces_id, use below command, stop workers getting new jobs, , finish existing jobs. kill -usr1 [process_id] after can kill them kill -term [process_id] also there page on sidekiq/wiki this, called signals. [edit] here signal page. [edit] check video

INSERT INTO prepared statements, PHP MYSQL, optimising a lot of columns -

please me understand how optimize mysql queries in php. when have lot of columns, prepared statement looks $inst = $db->prepare("insert year_$year (user_name,type_of_day,month_row,day_1,day_2,day_3,day_4,day_5,day_6,day_7,day_8,day_9, day_10,day_11,day_12,day_13,day_14,day_15,day_16,day_17,day_18,day_19,day_20,day_21,day_22,day_23,day_24,day_25,day_26,day_27,day_28,day_29,day_30,day_31) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); $inst->execute($chunk_post[$init]); this code here: http://govnokod.ru/php?page=356 people ridicule shitty codes. i not understand how in other way. a little joke: u can use for ($i = 1; $i <= 31; i++) {} construct query ;) the reality: read database normalization here: http://databases.about.com/od/specificproducts/a/normalization.htm your ultimate goal should third normal form. you should think day linked 1 month. think table month , table day . read sql join . sure

Files have disappeared in Visual Studio 2010 Solution Explorer -

i have been working in vs2010 years ... working on web site @ moment, solution explorer empty. shows @ top c:\development\mywebsite\ no files or folders showing below. i have tried refresh folder nothing changes. how can files , folders reappear? i had exact same thing happen. closed solution, opened worked-on solution; closed solution; reopened original , of files again displayed in solution explorer.

javascript - Controlling bar position with tickValues in d3.js -

Image
i'm trying build multi series bar chart using d3 running problems due sparse nature of dataset. i want force x-axis have tick every day, if there no data. test data have can have data points weeks apart i'm expecting wide areas no bars - fine. i thought force xaxis use set of predefined ticks using tickvalues array, these leads strange display of overlaying text each day on top of days have data. i've included screenshot of mean. i feeling i'm supposed when calculating width of bars can't figure out might be. code: var data = []; var tickvalues = []; var max = _.max(chartdata.tabular, function(assessment) { return assessment.dateutc; }); var min = _.min(chartdata.tabular, function(assessment) { return assessment.dateutc; }); var iter = moment.twix(min.dateutc, max.dateutc).iterate("days"); while(iter.hasnext()){ var momentobj = iter.next(); var assessment = _.find(chartdata.tabular, {'date': momentobj.format('dd/mm/y

javascript - order list using sortable with id shown in each item using jquery -

i have following code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>jquery test</title> <link rel="stylesheet" href="css/jquery_ui.css"> <script src="js/jquery-1.10.2.js"></script> <script src="js/jquery-ui.js"></script> <script src="js/functions.js"></script> <link rel="stylesheet" href="css/style.css"> </head> <body> <div class="container"> <ul id="sortable" class="ui-sortable"> <li id="1" class="ui-state-default" >first - </li> <li id="2" class="ui-state-default" >second - </li> <li id="3" class="ui-state-default" >third - </li> <li id="4" class="ui-state-def

java - Joining 3 tables with hIbernate criteria -

is there way write following sql using hibernate criteria? select a.columna1, b.columnb1, c.columnc1 inner join b on a.fk_id = b.id inner join c on c.fk_id = b.id this question different hibernate criteria , multiple join

java - Failed to start glassfish server because Couldn't get lock for /opt/glassfishv3/glassfish/domains/domain1/logs/server.log -

admin@brmsdev:/opt/glassfishv3/glassfish/bin$ ./asadmin start-domain domain1 java.io.ioexception: couldn't lock /opt/glassfishv3/glassfish/domains/domain1/logs/server.log @ java.util.logging.filehandler.openfiles(filehandler.java:389) @ java.util.logging.filehandler.<init>(filehandler.java:287) @ com.sun.enterprise.admin.launcher.gflauncherlogger.addlogfilehandler(gflauncherlogger.java:85) @ com.sun.enterprise.admin.launcher.gflauncher.setup(gflauncher.java:148) @ com.sun.enterprise.admin.cli.startdomaincommand.createlauncher(startdomaincommand.java:239) @ com.sun.enterprise.admin.cli.startdomaincommand.runcommandnotembedded(startdomaincommand.java:122) @ com.sun.enterprise.admin.cli.startdomaincommand.executecommand(startdomaincommand.java:117) @ com.sun.enterprise.admin.cli.clicommand.execute(clicommand.java:257) @ com.sun.enterprise.admin.cli.asadminmain.executecommand(asadminmain.java:229) @ com.sun.enterprise.admin.cli.asadminmain.main(asadminmain.java:167) waiting d

How to hide fragment with transaction fast as possible - Android? -

my current activity contains fragments. want open new activity on button click current activity. new activity transparent, , because of have hide fragment prev activity. no buttons prev activity should shown under new activity's buttons. i've done that. works. problem because there little pause between switching these 2 activities. obviusly hiding fragment of prev activity takes time. can make hide fragment faster? here code: @override public void onarcadebuttonclicked() { fragmentmanager= getsupportfragmentmanager(); fragmenttransaction transaction = fragmentmanager.begintransaction(); transaction.hide(fragments[mainmenu]); transaction.commit(); intent i= new intent(this,arcademapactivity.class); startactivity(i); } when remove first 4 lines , call new intent there no pause, new activity shown immediately, fragment old activity stays visible under new activity. idea how solve problem?

How can I add users to a Facebook group automatically? -

the flow i'm going is: user signs in facebook our site. user pays fee using paypal or similar service. user allowed access particular facebook group. i'm not particularly fussy how process works, i'd avoid manual step if possible. i know can't invite them using graph api (as they're not admin, developer or tester of app ). there other way round? button allows them request access confirm using api? automatic way of emailing invite? or there way of making easier manual step? way of listing new users "invite group" button? friend request button user press? with facebook api can't normal group, can use app groups instead. create app group, have post request url: http://graph.facebook.com/{your-app-id}/groups with following informations: valid app access token name: name of group description: description of group privacy: enum, can open or closed admin: admin's user id then recive gropu id. can info group ith reque

javascript - drag and drop while keeping copy of dragged element -

i want drag , drop input elements 1 div div while keeping copy of dragged element in parent div.i achieve this.but after dropping droppable div still performing drag , drop function.and allowing make multiple copy also.but don’t want this.. how can avoid in droppable div. function allowdrop(ev) { ev.preventdefault(); } //alert("droped"); //alert("droped"); function drag(ev) { //alert("dragging"); ev.datatransfer.setdata("text",ev.target.id); } function drop(ev) { var data=ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data).clonenode(true)); ev.preventdefault(); } html page: <div id="drag1

php - Best method of retrieving stats from multiple machines on local network -

so im building application monitors rasp pi based devices on network. devices running program provides statistical array devices performance need log, can access array via socket connection device on port. network has 100 of these devices grow several hundreds of devices on single network. currently application approached deploying script via ssh2_scp each of devices, application running through list of local ips , using stream_context_create && get_file_contents ping monitoring file on remote devices. monitoring file, gets stat array local machine $_posts data app stores in db. this not ideal @ moment im recording takes around 1.45mins cycle through ip's check them (in cheat fashion using counter $i++ , while cycle through range of numbers rather getting ips database need when more ips added , new locations) , retrieve results , insert them db, cron job set run ping script every 2mins, number of devices increases go on 2minute periodical gap , start backlogs of da

Sencha Architect (touch) - Use camera photos -

i have implemented sencha architect project possibility photo (with phonegap). after taking photo, need see photo directly container other information (the picture smaller original...and there written above , below). how open new container , display image in smaller size? please me, don't understand how can manage photo now use code if have better.... var me = this; ext.device.camera.capture({ success: function(image) { me.add({ xtype:'image', // commento src: image }); }, source: 'camera', cameradirection: navigator.camera.direction.front, destination: 'file'bu }); thank carlo sencha documentation got example it. see http://docs.sencha.com/touch/2.3.1/#!/api/ext.device.camera ext.device.camera.capture({ success: function(image) { imageview.setsrc(image); }, quality: 75, width: 200, height: 200, destination: 'data' }); you can use destination: 'url'

ember.js - EmberJS - Handling 3rd party redirect authentication -

i'm using ember-simple-auth ember app, don't have api endpoint authenticate users, rather page redirect form , signs user in, redirects app. (i don't own authentication) after authentication, gets redirected me, know on server side when user has been authenticated. how manually authenticate users' session when redirected app? currently did hack write 2 cookies: ember_simple_auth:access_token , ember_simple_auth:authenticator . i think setting session store manually ok solution in scenario trigger session restored after redirect (which on startup of ember application). i'd maybe configure custom authenticator redirects external login page in authenticate method. way have redirect centralized , triggered automatically whenever ember simple auth automatically enforces session authentication (e.g. authenticatedroutemixin ).

spring data neo4j - What is the correct way to obtain TraversalDescription? -

i using springrestgraphdatabase , sdn 3.1.0 , neo4j 2.1.2 . i struggling find way how obtain traversaldescription instance. see traversaldescription traversaldescription = traversal.description() deprecated. works! other way suggested elsewhere: traversaldescription traversaldescription = new traversaldescriptionimpl(); does not work since traversaldescriptionimpl removed neo4j 2.x the third way suggested in neo4j user guide through graphdatabaseservice : traversaldescription traversaldescription = graphdatabaseservice.traversaldescription() but getting: caused by: java.lang.unsupportedoperationexception: builtin paths supported @ org.neo4j.rest.graphdb.traversal.resttraversal.evaluator(resttraversal.java:96) any ideas? thanks, milan traversaldescription = graphdatabaseservice.traversaldescription() is indeed correct way obtain traversaldescription() in neo4j 2.x (either embedded or rest). the problem indicated in message you're gettin

orm - Mapping join in fluent nhibernate -

i working legacy database represents hierarchy. objects represented follows (simplified version): class key { public virtual int id { get; set; } // more properties } class leaf { public virtual int id { get; set; } public virtual key key { get; set; } public virtual key parent { get; set; } } class branch { public virtual int id { get; set; } public virtual key key { get; set; } public virtual key parent { get; set; } } the mapping above obvious "key" being mapped foreign key key table. there no direct relationship between leaf , branch. effectively, through key , leaf has many-to-one relationship branch . hence leaf can have 1 parent, , branch can have 1 parent. i provide join map, can provide parentbranch property class leaf, such can access branch. leaf leaf; branch branch = leaf.parentbranch; the query can written var parent = session.queryover<branch>() .where(br =>

php - Handling multiple mysql databases using a web service -

i using rest web service online application developed in php , mysql database. i have 2 mysql databases different name called db1 , db2. both db1 , db2 contains same table structure , same table names. my service decides database use when request made. portal used worilwide , serves thousands of requests. i little worried coz there 2 different database have tables same names. would cause mess?? it not @ all. if programm oop stay inside it's own container/connection. i use multiple databases time, never leave there classes/containers. therefor never touch eachother. , according saying never use both connections @ same time basicly wont ever notice it's there ^^ the way there mess if need both datases synced.

regex to update symfony render tag signature after update -

after symfony update render tag signature has changed ( https://github.com/symfony/symfony/blob/master/upgrade-2.2.md ): before: {% render 'blogbundle:post:list' { 'limit': 2 }, { 'alt': 'blogbundle:post:error' } %} after: {% render controller('blogbundle:post:list', { 'limit': 2 }), { 'alt': 'blogbundle:post:error' } %} {# or: #} {{ render(controller('blogbundle:post:list', { 'limit': 2 }), { 'alt': 'blogbundle:post:error'}) }} i'm looking way modify calls automatically using regular expression. can help? replace: \{% render ([^,%]*?), ([^%]*?)%\} with: {% render controller(\1), \2%}

python - Can't iterate through XPathSelectorList -

i have build simple web-scraper below: from scrapy.spider import basespider scrapy.selector import htmlxpathselector class ittester(basespider): name = 'ittester' allowed_domains = ["sec.gov"] start_urls = ['http://www.sec.gov/archives/edgar/data/320193/000112760212034445/xslf345x03/form4.xml'] def parse(self, response): hxs = htmlxpathselector(response) sites = hxs.select("/html/body/table[3]/tbody/tr") print len(sites) site in sites: hhh = site.select("/td[1]/span[1]/text()").extract() print hhh i goes this site , want scrape , print each of instance of "common stock" (that 2 times "common stock"). i have identified rows of table hxs.select("/html/body/table[3]/tbody/tr") , when printing length of returned xpathselectorlist prints 2, print in for loop returns 2 blank brackets []. have used firebug xpath, have checked tbody in source code. any

mysql version 5.5.27 report [Err] 1005 - Can't create table 'hgwechat-ms.customer_news' (errno: 150) -

i have 3 existed tables:"customer" "news" "hallplace",here code how create them: drop table if exists `customer`; create table `customer` ( `id` varchar(32) collate utf8_bin not null, ... primary key (`id`), ... ) engine=innodb default charset=utf8 collate=utf8_bin; drop table if exists `news`; create table `news` ( `id` varchar(32) not null, ... primary key (`id`), ... ) engine=innodb default charset=utf8; drop table if exists `hall_place`; create table `hall_place` ( `id` varchar(32) not null, ... primary key (`id`), ... ) engine=innodb default charset=utf8; now need create new table "customer_news": create table `customer_news` ( `id` varchar(32) collate utf8_bin not null, .. `fk_customer_id` varchar(32) collate utf8_bin default null, `fk_news_id` varchar(32) collate utf8_bin default null, `fk_hallplace_id` varchar(32) collate utf8_bin default null, primary key (`id`), key `fk8037fe9466e72c39`

javascript - Change year/date format in option value="" -

i have dropdown shows options year 2014 , following ten years. code: <select name="expiry_date" id="expiry_date" class='details_card_expiry_year'> <option value="">- select year -</option> the script var min = new date().getfullyear(), max = min + 10, select = document.getelementbyid('expiry_date'); (var = min; i<=max; i++){ var opt = document.createelement('option'); opt.value = i; opt.innerhtml = i; select.appendchild(opt); } however don't want value show year '2014' instead must '14'. how done? instead of opt.innerhtml = i; you can use opt.innerhtml = string(i).slice(2);

html - li element width image in it - li height is wrong -

take @ this: http://jsfiddle.net/8d4f4/1/ the problem li-element high. can see list element got grey background. can see grey under image. the question is. why li element higher image? i need li element have same height image. html <div id="content"> <ul id="references-all" class="references"> <li data-id="online"> <img src="http://s1.directupload.net/images/140627/779m36rh.jpg" width="324" height="240" class="references-images"> <div class="description"> <img src="http://s14.directupload.net/images/140627/z49aajek.png"> <div> <p>lorem ipsum lorem</p> <img src="http://s1.directupload.net/images/140627/g8yce4ta.png" width="28" height="27"

jquery - Javascript variable is not working -

i'm trying add background image slider in wordpress theme. need add javascript variable slider function correct url images. variable not working printing without printing value. here jquery code , variable name 'turl' <script type="text/javascript"> var turl = '<?= get_bloginfo("template_url"); ?>'; </script> $(function() { $.vegas( 'slideshow', { delay: 8000, backgrounds: [ { src: turl+'bgslider/images/1.jpg', fade: 4000 }, { src: turl+'bgslider/images/2.jpg', fade: 4000 } ] }); }); here how print in page source file () $(function() { $.vegas( 'slideshow', { delay: 8000, backgrounds: [ { src: turl+'bgslider/images/1.jpg', fade: 4000 }, { src: turl+'bgslider/images/2.jpg', fade: 4000 } ] }); }); so: <script> (function ($) { $(

java - How to track email delivery status using javamail -

i have requirement in need check whether email delivered or not. have written code email delivery prints success invalid email address.how track whether email delivered or not using javamail api.thanks in advance :) you might find these javamail faq entries helpful: if send message bad address, why don't sendfailedexception or transportevent indicating address bad? when message can't delivered, failure message returned. how can detect these "bounced" messages?

routing - How to redefine the URLs generation without changes at the HtmlHelper#link(...) calls in CakePHP? -

i have cakephp website many internal links, build htmlhelper : /app/view/mycontroller/myaction.ctp <?php echo $this->html->link( $item['search']['name'], array( 'controller' => 'targetcontroller', 'action' => 'targetaction', $profileid, $languageid ) ); ?> it works fine default route: /app/config/routes.php router::connect('/pages/*', array('controller' => 'pages', 'action' => 'display')); the generated links that: /mycontroller/myaction/$profileid/$languageid . now want use search engine friendly urls (with profile names , iso-639-1 language codes instead of ids) part of website , added new route: /app/config/routes.php router::connect( '/:iso6391/:name.html', array('controller' => 'mycontroller', 'action' => 'myaction'), array( 'iso6391'

c# - How to remove a subarray of an array -

how can remove group of elements inside array ? i have following code: private void processresponse(byte[] response) { byte[] header; byte[] payload; if (response.length > 8) { header = response.take<byte>(8).toarray(); //payload = //should rest of "response" bytes } } } how can make payload response without header ? you looking skip method: payload = response.skip(8).toarray();

css - Issue with hubspot and bootstrap theme -

we have created new theme in bootstrap , applied new theme our blog on hubspot. there issue when resize window responsive dimensions theme stuck , scroll bar disappears around 600px . i can't move page or down need issue why theme stuck in middle , scroll bar disappears. theme link: blog.homearena.co.uk/hanewdesign in homearena-style.min.css you've code: @media (max-width: 899px) #site-wrapper{ overflow-y: hidden; } it should @media (max-width: 899px) #site-wrapper{ overflow-y: scroll !important; }

ubuntu - Broken 'python' command -

i'm trying install python module , , realized python command seems broken: $ python bash: /usr/bin/python: no such file or directory i've been told problematic os aswell (i noticed software center not working). how can fix , link python 3.2? i'm running ubuntu 12.04. thanks! you have broken link. you can check below: find /usr/bin -maxdepth 1 | grep python | xargs ls -l -rwxr-xr-x 1 root root 30284 jun 18 2013 /usr/bin/dh_python2 lrwxrwxrwx 1 root root 9 may 8 16:43 /usr/bin/python -> python2.7 lrwxrwxrwx 1 root root 9 may 8 16:43 /usr/bin/python2 -> python2.7 -rwxr-xr-x 1 root root 2993744 feb 27 20:24 /usr/bin/python2.7 as can see /usr/bin/python points /usr/bin/python2.7 exist. if /usr/bin/python broken , have /usr/bin/python3.2 , following: rm /usr/bin/python; ln -s /usr/bin/python3.2 /usr/bin/python this delete symlink , create new 1 pointing right place.

java - Quick maven instal as a button in eclipse? -

when want run mvn install on project, requires 3 clicks: rightlick project > run > mvn install. isn't possible show button in eclipse toolbar @ top performs mvn install on selected project? you can configure keyboard shortcut this. in eclipse go window -> preference . left pane go general-> keys find out run maven install , edit keyboard configuration in binding field suits you. hopes helps.

c# - Read only error in sdf file after installing windows application setup -

i got following error "access database file not allowed. [ file name = c:\program files\default company name\somedbfile.sdf ]" while trying log on after installing in windows 7. worked if manually remove read property of sdf file not client. pragmatically. appreciable. thanks in advance. tarun the folders 'program files' or 'program files (x86)' read common users. if database file in folder , - change permission of file full control . or - change path of database file

php - Symfony 2.3: Remember form inputs while visiting another site -

what have: a form several different input fields etc. interesting part collection field: $builder->add( 'publicationauthors', 'collection', array ( 'type' => new authorpublicationtype(), 'allow_add' => true, 'allow_delete' => true, 'by_reference' => false, 'label' => 'autoren' )); this collection refers formtype, including entity field , order id: public function buildform(formbuilderinterface $builder, array $options) { $builder->add( 'author', 'entity', array ( 'class' => 'indpubbundle:author', 'multiple' => false, 'label' => 'autor', 'query_builder' => function (entityrepository $er) { return $er->createquerybuilder( 'a' ) ->orderby( 'a.author_surna

jquery - How To Reinitialize Datatable in Ajax -

what need *when ajax loaded datable reintailized. i explain in steps here output of first step : http://postimg.org/image/c6p8jwp3b/ . here output of second step : http://postimg.org/image/6fm1z253h/ here output of third step: http://postimg.org/image/5btny60xf/ . no reinitialize of datatable. i want paging , search should reintialized. i have taken url: http://datatables.net/forums/discussion/256/fnreloadajax/p1 . ajax call code: if ($('#teamtable').size() > 0) { $('#teamtable').datatable({ "spaginationtype": "bootstrap" }); } $("#save_team").click(function() { $.ajax({ type: "post", url: "asana_team.php", data: { people_name: $('#e2').val(), team_name:$('#teamname').val() }, beforesend : function(){ $("#team_table").remove(); $(&qu

Java Newbie Calendar Class Questions -

need understanding below test code. not understand "11" , "12" represent in calendar.set method? example "opencal.set(11, openhrs). public static void main(string[] args) { { int openhrs = 07; int openmins = 30; int closedhrs = 23; int closedmins = 00; calendar cal = calendar.getinstance(); calendar opencal = calendar.getinstance(); opencal.set(11, openhrs); opencal.set(12, openmins); calendar closecal = calendar.getinstance(); closecal.set(11, closedhrs); closecal.set(12, closedmins); if(opencal.before(cal) && closecal.after(cal)) { system.out.println("the business open"); } else { system.out.println("the business closed"); } } } this perfect example of why should avoid magic numbers . instead of set(11 code should set(calendar.hou

java - EBeans alternative to find() in JPA -

i following play! framework tutorial on creating blog. use jpa instead of ebeans , use find() function extend play.db.jpa.model . using ebeans , have extended play.db.ebean.model . however, when use find() function, says no such method exists. have done research , have looked here: http://www.playframework.com/documentation/2.0/api/java/play/db/ebean/model.html and here: http://www.playframework.com/documentation/2.0/api/java/play/db/ebean/model.finder.html but there no mention of simple find() method (there others such findid() don't see how can help). there alternative use in model class? if not, there other classes use easily? edit: the specific part need create connect() method in user class. in tutorial, described as: in user.java source, add connect() method: public static user connect(string email, string password) { return find("byemailandpassword", email, password).first(); } what other options have if can't use find(). ebean.find() work?

.net - Click Once Random Install Prompt -

i've got click once application randomly reshows install prompt. seems notice first thing in morning, though can't when happens. (computer left on over night, screen locked) 2 scenarios open our application, 1 directly start menu , other way of application passes network path myapp.application file iexplore.exe. can reproduce if when happens first time shutdown application , alternate between 2 ways of opening it. morning opened via secondary application, got install prompt clicked install, once application started, closed , opened via start menu , got install prompt again. subsequent attempts did not produce install prompt. couple days ago got 4 or 5 times in row alternating , forth. i've checked dfsvc.exe thinking maybe getting kicked off different user other application causing click once not in right paths or registry settings, under username in task manager (an idea got post http://social.msdn.microsoft.com/forums/windows/en-us/919676cd-39c4-47dc-aa76-afc3c8

javascript - new DOM creation when launching opentok video , make impossible to push button -

i'm developing mobile application opentok 2.2 beta new version , , angularjs 1.2.9 i got problem video conversation, when initialize it, can still push button terminate , when other user connected , new dom created video , can't access (can't push it) anymore button terminate conversation the things don't understand , it's did opentok doc told me , used "insertmode:replace" , seems work "append" mode create child of targeted element... source : http://tokbox.com/opentok/tutorials/subscribe-stream/js/ : -> subscribing stream the javascript : var publisher = tb.initpublisher($scope.apikey, 'layoutcontainer'); var session = tb.initsession($scope.apikey, $scope.sessionid); session.on({ streamcreated: function (event) { var subscriberproperties = {insertmode: "replace"}; session.subscribe(event.stream, 'layoutcontainer', subscriberproperties, function (error