Posts

Showing posts from March, 2015

Conditional formatting in rounded values -

facing trouble in cognos 10, in report have apply conditional formatting values less 0 (except zero) red, applying round-off 0 decimals. problem values -0.1 getting rounded-off 0 , shown in red due conditional formatting. is there work around show rounded 0 values in black? try rounding off value on condition on conditional style too. these: round(([columnvalue]*100),0) < 0 then set foreground color or background color red. hope helps.

java - Drools 6.0.1 - Rules not getting picked from JAR -

i working on drools 6.0.1 application. have rule files (*.drl) packaged inside separate project included jar file maven dependency. when deploy project, kiemodule not able find rules files (which packaged inside jar above). not getting error though rules not getting fired. if manually place rules files under classpath web-inf/rules/*.drl detected , rules executed. i under impression kiemodules auto discovered anywhere in classpath. any pointers appreciated. general question hence have not included comprehensive code files. start working once place *.drl files in classpath (take them outside of jar). thanks

java - Appengine modules dispatch.xml routing with custom domain -

i have got appengine modules working. have 2 modules, app , auth . have custom domain domain.com , want route app.domain.com app module, , auth.domain.com auth modules, following dispatch.xml file, <dispatch> <!-- default module serves simple hostname request. --> <url>*/favicon.ico</url> <module>default</module> </dispatch> <dispatch> <!-- auth service auth module --> <url>auth./*</url> <module>auth</module> </dispatch> <dispatch> <!-- default module serves simple hostname request. --> <url>*/favicon.ico</url> <module>default</module> </dispatch> since app module default app.domain.com routed, couldn't able route auth.domain.com auth module, pointing default module, how can route custom domain server specific module? thanks use full hostname: <dispatch> <-- * in front of hostname (*a...

matlab - What's the relationship between the time step size of an individuell block and that of the system? -

as know, level 2 matlab s function has command accquire next hit time block like: block.nexttimehit = block.currenttime + deltat; what's relationship between time step size of individuell block , of system. mean happen, if system has larger sample time step block has? in opinion, solver never let happen, because solver detect block.nexttimehit every block every iteration , make sure current system.nexttimehit smaller every block.nexttimehit. there no sample blocks missed. you won't miss required sample times. when using fixed step solver, simulink checks blocks allow fixed-step size used, , if not throw error. when using variable step solver (required in situation ask about) simulink guarantees take time step @ required time.

linux - How to get greatest number out of 5 number using shell script -

i trying find greatest number 5 given numbers in shell script. testing code on ideone.com in bash category. getting error runtime error time: 0.02 memory: 5312 signal:-1 here code read -p "enter first number:" n1 read -p "enter second number:" n2 read -p "enter third number:" n3 read -p "enter fourth number:" n4 read -p "enter fourth number:" n5 if[ [ n1 -gt n2 ] && [ n1 -gt n2 ] && [ n1 -gt n3 ] && [ n1 -gt n4 ] && [ n1 -gt n5 ]] ; echo "$n1 greatest number" elif[ [ n2 -gt n3 ] && [ n2 -gt n3 ] && [ n2 -gt n4 ] && [ n2 -gt n5 ]] ; echo "$n2 greatest number" elif[ [ n3 -gt n4 ] && [ n3 -gt n5 ] ] ; echo "$n3 greatest number" elif[ n4 -gt n5 ] ; echo "$n4 greatest number" else echo "$n5 greatest number" fi what problem? kindly guide it seems problem spaces. add spaces af...

c# - Get multiple fields in an array linq -

in application user can have multiple locations. want show locations of user in dropdown. created model having 2 fields userid , locations . locations array of strings. want linq query userid , locations . possible in linq? public partial class modellocation { public int userid { get; set; } public string[] locations{ get; set; } } in database records like userid location 1 1 b 2 3 b 3 c 3 d var models = db.locations.groupby(l => l.userid) .select(l => new modellocation() { userid = l.key, locations = l.select(l => l.location).toarray() }); depending on linq engine using (linq-to-sql, linq-to-entities) query can bad performance , result in multiple queries being sent db. way solve retrieve data db first , perform grouping in memory instead introducing call asenumerable() . var models = db.locations.asenumerable().groupby(l => l.userid) .select(l => new modellocati...

android - Read incoming message till verification sms is read -

i m looking add sms reading functionality in app. user enters mobile number in activity , sms containing 1 time password sent user mobile phone server. want trigger app read incoming messages after user has entered mobile number , expecting incoming message server. i have seen questions answered here how read incoming message using service in background in android? but solution seems reading sms come on phone. in case want reading functionality start when user expecting sms , end when message has been received. check answer show how register receiver https://stackoverflow.com/a/7049747/774944 final string some_action = "android.provider.telephony.sms_received"; intentfilter intentfilter = new intentfilter(some_action); smsreceiver mreceiver = new smsreceiver(); registerreceiver(mreceiver,intentfilter);

neo4j - Starting first node in Heo4j HA cluster fails even when allowed to create cluster -

whilst trying diagnose different issue cluster tried isolating environments force elections events. when starting nodes in isolation though app failed start exception: caused by: java.util.concurrent.timeoutexception: null @ org.neo4j.cluster.statemachine.statemachineproxyfactory$responsefuture.get(statemachineproxyfactory.java:300) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.cluster.client.clusterjoin.joinbyconfig(clusterjoin.java:158) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.cluster.client.clusterjoin.start(clusterjoin.java:91) ~[neo4j-cluster-2.0.1.jar:2.0.1] @ org.neo4j.kernel.lifecycle.lifesupport$lifecycleinstance.start(lifesupport.java:503) ~[neo4j-kernel-2.0.1.jar:2.0.1] ... 59 common frames omitted my configuration set 60 second join timeout ( ha.cluster_join_timeout ) , such individual nodes can initialize cluster ( ha.allow_init_cluster ). looking @ truncated chunk of code clusterjoin class believe after negative cases code either loop att...

css - Google earth plugin z-index issue in chrome/windows -

i've been working on project uses google earth. layout pretty simple. have full screen google earth object , div. use z-index stack each other. works in chrome/mac, however, z-index doesn't work in chrome/windows. this known issue. known work around use iframe shims. here example http://earth-api-samples.googlecode.com/svn/trunk/demos/customcontrols/index.html

Why do I have to cast 0 (zero) when doing bitwise operations in C#? -

i using following code sign extend 12 bit value unpacked 1.5 bytes 16 bits: word[0] |= ((word[0] & 0x800) != 0 ? (int16)(-4096) : (int16)0); if don't cast last 0 int16 following complaints compiler: warning 1 bitwise-or operator used on sign-extended operand; consider casting smaller unsigned type first error 2 cannot implicitly convert type 'int' 'short'. explicit conversion exists (are missing cast?) why this? understand c# converts int when doing bitwise operations, integer constants automatically given right type. if assign 0 float don't have cast float first, example. i'm c programmer, please keep in mind when answering :-) the types of integer literals in c# types int , uint , long , , ulong ( c# language specification, version 5 , section 2.4.4.2). literal (such 0 ) have type inferred 1 of 4 (and without indications, it's int ). so, why does: short s = 0; work? due implicit constant expression conversions (se...

outlook - How to get information from .msg file (IPM.Appointment) C# -

i have outlook appointments saved local drive. how can subject , location appointment takes place in c# without creating outlook application object (on computer outlook not installed!) , without spending money on professional solution? it perfect if solution made object of type appointmentitem me, example (which not working): string path = "c:\\appointments\\myappointment.msg" microsoft.office.interop.outlook.appointmentitem appointment = new microsoft.office.interop.outlook.appointmentitem(path); try using verbatium before string path name. e.g. string path = @""; maybe these links help. http://www.codeproject.com/articles/32899/reading-an-outlook-msg-file-in-c how create , send appointments microsoft outlook calender?

How to extend chef resource? -

i'm trying extend bash resource, when invoke shm_wbash , command's output placed in log file runs. since don't want copy available parameters lwrp resource definition, i've tried extend original chef bash resource (i'll omitting actual payload since doesn't matter here): class chef class resource class wbash < resource::bash def initialize(name, run_context=nil) super puts 123 end end end end i've put cookbooks/shm/libraries/wbash.rb , when try run it, no resource or method named 'shm_wbash' for chef::recipe "test"'`. how fix this? use w_bash this chef converting class name use in dsl.

Animate / transition height with CSS3, but using jQuery? -

i'm trying make show/ hide menu button mobile devices using media queries. i'm aware css3 on mobile faster, of time, on mobile compared using jquery animate because of hardware acceleration, hence want use method. i need smooth, 0.5s css3 animation 0px whatever height container is. what i'd - or logic i'd thought of far - when clicking ui icon, toggle height of .nav>ul 0px auto. i've tried using transition: height , adding class required bit using jquery, cannot figure out how apply css£ transform / transition height , smoothly toggle height, , i'm stuck. don't know google (have tried, trust me!). here's working jsfiddle: http://jsfiddle.net/3v47n/ - small grey 20x20 icon trigger. my jquery: $('.nav span').on('click',function(){ $('.nav ul').addclass('animateheight') }); and css: .nav { min-height: 60px; } .nav ul { height: 0; overflow: hidden; transition: height 0.5s ease; } .nav ul.animate...

c# - Web Api using parameterized constructor using Autofac -

i'm converting smartstore.net project webapi , want create api product smartstore.net database. here property , method: irepository<product> productrepository; public ienumerable<product> get() { var query = p in _productrepository.table orderby p.name p.published && !p.deleted && p.showonhomepage select p; var products = query.tolist(); return products; } next step found _productrepository interface have exsist through parameterized constructor of api controller. have read autofac ( here link ) can't find class implements irepository interface. everyboy used smartstore.net can me create example api product or me found class implements irepository interface ? thanks alot ! ! ! smartstore.net 2.0.1 has integrated support webapi. please have here . no need create own interface. if want expose custom entities' api, inherit webapientitycontroller<tentity, tservice> . repository , serv...

objective c - Can i copy an image from my application to mail app in iOS -

i developing native ios application. i have requirement copy image application mail app, how can accomplish task kindly suggest me. thanks in advance.. using mfmailcomposeviewcontroller mfmailcomposeviewcontroller *mail=[mfmailcomposeviewcontroller alloc]init]; // determine file name , extension nsstring *extension =@"png"; nsstring * filename=@"email"; // resource path , read file using nsdata nsstring *filepath = [[nsbundle mainbundle] pathforresource:filename oftype:extension]; nsdata *filedata = [nsdata datawithcontentsoffile:filepath]; // determine mime type nsstring *mimetype; if ([extension isequaltostring:@"jpg"]) { mimetype = @"image/jpeg"; } else if ([extension isequaltostring:@"png"]) { mimetype = @"image/png"; } else if ([extension isequaltostring:@"doc"]) { mimetype = @"application/msword"; } else if ([extension isequaltostring:@"ppt...

Table Convert To Text method C# WPF? -

i have richtextbox in rtf format. user can paste in tables. want take functionality away i.e strip tables rtf on paste . i need keep richtextbox in rtf need keep bullets, numbered lists etc. can't paste in plain text. i'm locking down formatting of pasted text works can't find methods remove tables... private void _btnformat_click(object sender, routedeventargs e) { textrange rangeoftext = new textrange(richtextboxarticlebody.document.contentstart, richtextboxarticlebody.document.contentend); rangeoftext.applypropertyvalue(textelement.foregroundproperty, brushes.black); rangeoftext.applypropertyvalue(textelement.fontsizeproperty, "12"); rangeoftext.applypropertyvalue(textelement.fontfamilyproperty, "arial"); rangeoftext.applypropertyvalue(textelement.fontstyleproperty, "normal"); rangeoftext.applypropertyvalue(inline.textdecorationsproperty, null); ...

javascript - getElementById return null -

i'm new meteor , js it's exciting learn new stuff , play it. i'm doing little app (and other things :p ): in client.html file: <template name="input"> <form action={{submit}}> <p> name : <input type="text" id="bibiname"> message : <input type="text" id="bibimessage"> <input type="submit" value="toto"> </p> </form> </template> in client.js file: template.input.submit = function () { alert(document.getelementbyid("bibiname" )); } result: pop window wit "null". what doing wrong ? is because execution of "submit function" in client.js file occurs before creation of "bibiname input" in client.html ? thx tips if want add listener when form submitted, use template.mytemplate.events instead.

.net - Unmanaged 32bit dll in C# wcf service could not load on IIS 7 using system.dynamic -

i have unmanaged c dll, register under class_root registry. it 32bit , register on x64 bit windows server r2. i have developed wcf application load c dll registry value like type type= type.gettypefromprogid("cdllregistyassociatedkey"); dynamic typeobj= activator.createinstance(type,true); // call c dll function typeobj here.... its work fine during development , debugging vs2012 .net 4.0. when deploye service on iis 7. c dll couldn't load , throw exception. like activator.createinstance(type,bool) type n't null any 1 can please. in advance

objective c - iOS: TabController not showing with Navigation Controller -

Image
i have app start screen consisting of table menu main links 4 different views, 3 options information pages. once on of main menu options chosen, view shown tabbar @ bottom of main menu options. while nav bar @ top has button leading main menu. i built storyboard goes table view select single page. after working , passing data, embedded single view tab bar controller , added second page. seems working expect tab bar not visible on screen. can please help? i have added image of storyboard below: get rid of navigation controller. there no deed far. make tab bar controller root view. if need navigation conroller within certrain tab, or or of them, add navigation controllers tabs (to right in storyboard).

html - Is it good practice to nest bootstrap grid inside smaller elements on the page -

Image
i using bootstrap responsive grid system need whole framework. understand should use grid system layout of page. example have 1 div should contain image on left , text on right side. can put bootstrap grid inside div desired layout 2 columns. how bootstrap grid should used or bad practice , shouldn't use grid inside smaller elements? it fine long place grid elements in right order of hierarchy: container[-fluid] > row > col-??-## > row > col-??-## , on. remember never nest container inside container . should not place container followed col element. all in all, it's ok give layout inner part of div regardless of size.

java - What can I do with xml duplicate elements with Smooks? -

i m doing parse xml java object. here xml example: <weather_data> <date>today</date> <weather>shower</weather> <date>tomorrow</date> <weather>snow</weather> </weather_data> that say, there same elements date , weather inside 1 weather_data if use createonelement="weather_data/date", can last date value. should do. thanks

hadoop - Deleting files from HDFS does not free up disk space -

after upgrading our small cloudera hadoop cluster cdh 5, deleting files no longer frees available storage space. though delete more data add, file system keeps filling up. cluster setup we running 4 node cluster on physical, dedicated hardware, 110 tb of total storage capacity. on april 3, upgraded cdh software 5.0.0-beta2 version version 5.0.0-1. we used put log data on hdfs in plain text format @ rate of approximately 700 gb/day. on april 1 switched importing data .gz files instead, lowered daily ingestion rate 130 gb. since want retain data age, there nightly job delete obsolete files. result of used visible in hdfs capacity monitoring chart, can no longer seen. sine import 570 gb less data delete every day, 1 expect capacity used go down. instead our reported hdfs use has been growing since cluster software upgraded. problem description running hdfs hadoop fs -du -h / gives following output: 0 /system 1.3 t /tmp 24.3 t /user this consistent expect se...

shell - One command to find a list of file names within files in another folder -

i'm quite new unix commands , might intuitive of you, please forgive ignorance. what want find .txt files in folder has other sub-folders files inside. using found list, should file name , extension (no full path), need search .xml files within folder (also have sub-folders , files , parent of first searched folder) occurrences of file names found in first search. hope clear enough! i tried , didn't work (i know, it's absolutely beginner's try): find . -name "*.txt" -printf "%f\n" -exec find .. -name "*.xml" | xargs grep {} \; maybe somethiing (untested): find . -name "*.txt" -printf "%f\n" > /tmp/a find . -name "*.xml" -exec grep -hff /tmp/a {} \; maybe add -w word-delimited searching. another try @ process substitution: find . -name "*.xml" -exec grep -hff <(find . -name "*.txt" -printf "%f\n") {} \;

javascript - Close Dialog box when click outside -

i've read lot od asnwer how close jquery dialog box, can't of solutions posted work. here's code. function openpopup(element){ var = element; var dialog = $("#methods").dialog( { autoopen: false, modal: true, draggable: false, resizable: false, open: function() { $(".ui-dialog-titlebar-close").hide(); //this solution can't work $('.ui-widget-overlay').bind('click', function() { $('#methods').dialog('close'); }) } }); //open dialog dialog.dialog('open'); //set dialog position $( "#methods" ).dialog( "option", "position", { my: "left bottom", at: "left bottom...

c# - How to reduce the size of image in header of the pdf using itextsharp -

public class itseventshandler : pdfpageeventhelper { pdftemplate total; basefont helv; public override void onendpage(pdfwriter writer, document document) { itextsharp.text.image jpg = itextsharp.text.image.getinstance("c:/users/public/pictures/sample pictures/penguins.jpg"); jpg.scalepercent(35f); jpg.setabsoluteposition(130f, 240f); itextsharp.text.image imgfoot = jpg; //header image itextsharp.text.image imghead = itextsharp.text.image.getinstance("c:/users/public/pictures/sample pictures/penguins.jpg"); imgfoot.setabsoluteposition(0, 0); imghead.setabsoluteposition(0, 0); imgfoot.scaleabsolute(826, 1100); pdfcontentbyte cbhead = writer.directcontent; pdftemplate tp = cbhead.createtemplate(2480, 370); // units in pixels i'm not sure...

javascript - Render {Caption} within {block:Photos} on Tumblr -

there seems bit of problem tumblr in can't render {caption} tags if it's within {block:photos} tag. problem way theme works calls done in way. {block:photoset} <div class="object photo"> {block:photos} <a href="{photourl-highres}" class="fancybox" rel="{postid}" title="{caption}"><img src="{photourl-highres}" /></a> {/block:photos} </div> {/block:photoset} the reason i'm using fancybox add caption each of photos in set have adding title title attribute. any suggestions? the example in docs that, {caption} inside {block:photos}. in block, {caption} refers single photo's caption. i'm guessing want photoset's caption, not single photo's. in case caption empty, you're not seeing anything. i don't think can done via template, here's quick fix using jquery: $('.photoset[data-caption]').each(...

sql - Name of parent category with parent_id -

i working on quiz question , have hit wall on how solve problem. problem follows: "write sql query lists film categories category_id, category's name (called category) , parent category's name (called parent), ordered alphabetically category's name." the entity category has category_id, name , parent_cat(which id of category) this query have far: select a.category_id, a.name category, (select b.name a.parent_cat=b.category_id , a.parent_cat not null) parent "category" a, "category" b a.parent_cat not null order a.name unfortunately returning duplicate instances of category of instances having null values "parent" any advice appreciated! select a.category_id, a.name category, b.name parent "category" join "category" b on a.parent_cat=b.category_id a.parent_cat not null order a.name

java - Sometimes velocity does not substitute -

sometimes following code generates $position.getcomment() in template. same other fields. occasional behavior. might reason , how fix? #if($position.hascomment()) <td>$position.getcomment()</td> #else <td class="empty">&mdash;</td> #end position's comment string , hascomment following public boolean hascomment() { return comment != null; } some log might useful @ velocity startup velocity - velocimacro : allowinline = true : vms can defined inline in templates velocity - velocimacro : allowinlinetooverride = false : vms defined inline may not replace previous vm definitions velocity - velocimacro : allowinlinelocal = false : vms defined inline global in scope if allowed. velocity templates not substituting methods try doing this: #if (! $position.getcomment() || "$position.getcomment()" == "") <td class="empty">&mdash;</td> #else <td>$position.g...

php - Join two tables and only output rows that exist in the first table -

Image
i'm working on form allows users apply several award categories. can apply several categories, can apply each category once. the award categories stored in table: when user applies category, row entered following table user's nominee_id , award_category_id: i code show user awards have applied already, works fine. $result = mysql_query(" select award_subsection.*, award_subsection.title subsection_title, award_nomination_category.* award_subsection inner join award_nomination_category on award_subsection.id=award_nomination_category.award_category_id award_subsection.active='1' , award_subsection.award_id='$i...

html - Foundation 5 - 1170 grid calculated incorrectly -

i've started learning foundation 5 , i've got app uses 1170 grid, 70px columns , 30px gutters (70 * 12 + 30 * 11 = 1170). altho when enter default values foundation _settings.scss file: $row-width: rem-calc(1170); $column-gutter: rem-calc(30); $total-columns: 12; but instead of having 70px width columns, single column has width of 97px. knows how gets calculated, maybe i'm missing settings variables? in advance. i've figured out in chome example, generates 68px column 15px padding left , right. way make left , right container padding dissapear? i've figured problem out. it turns out foundations 1170 grid, 1200px grid 15px margins both sides of every columns. it's actualy idea considering want keep outside margins lower resolutions frame gutter. so solution have $row-width set 1200.

java - Printing calling class name in logs using logback -

i have problem in logging class name of calling class. have logging utility class written in logback. created logger utility using singleton pattern performance reasons. when call logging statement other class print utility's class name not calling class. private static logutil logutil =null; public static logutil getinstance(){ if(logutil==null){ logutil = new logutil(); } return logutil; } protected static final logger logger = (logger)loggerfactory.getlogger("mymodule"); public void info(string message){ if(logger.isinfoenabled()){ logger.info(message); } } test class like public class logutiltest { public static void testforlogging(){ logutil.info(“im logging message”); } } i’m getting output below printing logutil instead of logutiltest , need on logging calling class name 2014-04-14 16:47:21 info [main] mymodule [logutil.info:42] class name [com.commonutil.loggi...

mysql - relationship in json data vs actual relationship in db -

i thought know later on stuck , became confused. want ask possible 'think relationship' in json or can done when u designing backend? json doesn't support object references, javascript objects do. can store functions, first class citizens. http://en.wikipedia.org/wiki/json#object_references var anna = {name: "anna"}; var bob = {name: "bob", knows: [anna]}; var charlie = {name: "charlie", knows: [anna, bob]} anna.knows = [charlie, bob]; // 'bob' alert(charlie.knows[0].knows[1].name) // ------------------------------------------------- var call = function(destination) { alert(this.name + " calls " + destination.name); } bob.call = call; // 'bob calls charlie' bob.call(charlie); but beware of infinite loops! (bob knows anna, anna knows bob, bob knows anna, ...) in json, relationships can represented value (which ideally unique id of record). duplicate name, , need entry name find refers to. ...

web services - Interconnect applications- Java EE -

i have 3 web applications. have common set of functionality io operation:- write text file , access written data. going separate function (file writing) single application accepts requests application , write text files , returns when required. actually session management between browser , server. each user connect server identical , each user treated separately. same required here between 3 applications , separated application , connected though http connection . some set of instances of classes of seperated application should identical, seperated each calling applications. this separated application supposed deployed war file. please guide me how can achieve ? have use web services ? or rest ful services? sample sources projects/ codes, links highly appreciated. web service option, specially because it's incredibly easy implement using javaee annotations. one thing must consider in case ensure proper authentication, can sure services being exposed desired c...

design - MySQL: Racer number for different compettitors -

i have table in mysql (among other) columns: id - int auto_increment pk competitionid - fk competition there more (ie registrationdate etc...), 2 important want/need add column racernumber requirements: racernumber autoincremental, each competition restart so... this: id competitionid racernumber 1 1 1 2 1 2 3 1 3 4 2 1 5 2 2 6 3 1 7 3 2 8 3 3 9 3 4 but just... well, running in circles. trying avoid solution using algoritms etc, there way achieve design? know, if dropped id column solved using composite pk (competitionid,racernumber), given how need work racer data etc, lead quite lot of coding added. :( tables: table user - table contains persons - name, gender, etc table competition - table of competition - when, where, table racer contains link between user-competition, saying user has entered...

php - How to automatically logout after register in wordpress? -

now in wordpress website after user registering redirected account page (i use woocommerce). i want hime logged out automatically after register. because want approve first. this code: if (is_user_logged_in()) { $nua = pw_new_user_approve(); $status = $nua->get_user_status(get_current_user_id()); if ($status === 'pending') {?> here function logout automatically! <?php } } any please? <?php if (is_user_logged_in()) { $nua = pw_new_user_approve(); $status = $nua->get_user_status(get_current_user_id()); if ($status === 'pending') { $redirect = 'sitepath'; wp_logout_url($redirect); } } ?>

mysql - 1064 error for ALTER AUTO_INCREMENT -

please help, table 'order' auto increment starting @ 14000 , no matter try, keep getting below error? mysql> alter table order auto_increment = 14000; error 1064 (42000) : have error in sql syntax; check manual corresponds mysql server version right syntax use near 'order auto_increment = 14000' @ line 1 i have performed number of searches , far can tell correct syntax. any appreciated. your table has named order . order reserved word. use ` , table name order. in way `order`

php - How get data in Symfony2 from android's post method -

i have android app makes post function sending data symfony project. want these data , storage in bd. think problem in php code , not in android's. have tried in lot of ways no result. my android's post function: public string sendpost(string username, string password, string email, string city) { httpclient httpclient = new defaulthttpclient(); httpcontext localcontext = new basichttpcontext(); httppost httppost = new httppost("https://192.168.1.120/tortillatorapi/web/new_user"); httpresponse response = null; try { list<namevaluepair> params = new arraylist<namevaluepair>(4); params.add(new basicnamevaluepair("username", username)); params.add(new basicnamevaluepair("password", password)); params.add(new basicnamevaluepair("email", email)); params.add(new basicnamevaluepair("city", city)); httppost.setentity(new urlencodedformentity(param...

javascript - How to assign id to an element in CKEditor custom plug-in -

i have created custom plug-in in ckeditor. inside plug-in there textbox want assign id. reason assigning id want show or hide textbox on click of button. even if assigning id other attributes of element. in source code (i used inspect element), ckeditor assigning random id (e.g cke_121_textinput) field. this random id cannot known while writing code. code goes this: (ckeditor dialogue js) ckeditor.dialog.add( 'testplugindialog', function( editor ) { ... elements: [ { type: 'text', id: 'txtcustomername', label: 'customer name', commit : function( data ) { data.txtcustomername= this.getvalue(); } }... ...

eye detection - Inserting an image at a particular position using matlab -

i want insert sunglasses(png image) @ position eyes gets detected(considering in-plane rotation). have used in-built haar cascade detector detecting eyes in matlab. have eyes detected highlighted bounding boxes return position of eyes in image.let me know how can done(i beginner in matlab). (presuming both images greyscale, expansion rgb not difficult. unchecked , i'm not promising haven't flipped x/y coords @ point). if eye positions on same horizontal line, e.g. for straight face: face = face image ohyeah = sunglasses image fspan = horizontal distance between eyes, in pixels (you should able bounding box info) gspan = ditto sunglasses image (you can manually - need measure once) cpos = central position, [x y] of eyes (again, calc bounding box) check if need resize sunglasses image - might need if it's lot larger or smaller need: sr = fspan/gspan; if abs(sr-1)>thresh; ohyeah = imresize(ohyeah, sr); end now, find top left , bottom right corne...

WPF ListView item's Visible/Collaped not changing according to its Visibility -

thanks time reading thread. i using vs2012, wfp, , .net4.5 on windows 7 64bit i have listview control xaml in following: <listview name="lvviewercontrol" selectionmode="single" selectedindex="{binding path=viewtype, mode=twoway, updatesourcetrigger=propertychanged}" background="{x:null}" borderbrush="{x:null}" margin="2"> <label name="lblview2d" width="40" height="40" margin="3" background="#ff595959" foreground="white" horizontalcontentalignment="center" verticalcontentalignment="center"> <image source="/capturesetup...

date - SQL (Access) Not returning correct records -

having issue this: return rm records cp.date_registered not registered after 01/01/2013 i've been working variations on try job done: select rm.fname, rm.lname, rm.dob, rm.dod, cp.date_registered rm inner join cp on rm.member_id = cp.member_id cp.date_registered <= #01/01/2013# , not cp.date_registered > #01/01/2013# , rm.dod null; so need few fields rm records date registered isn't after 01/01/2013. thought it'd simple, apparently need little help. right code returns all records date registered < 01/01/2013, if registered after date. need exclude records. multiple records each person. need 1 record per person if criteria met, don't care dates. i try following: select distinct rm.fname, rm.lname, rm.dob, rm.dod, cp.date_registered rm inner join cp on rm.member_id = cp.member_id cp.date_registered <= #01/01/2013# , rm.dod null; using distinct should single record (if understand requirements correctly :))

cakephp - install vqmod for cake php -

i trying install vqmod in cake php framework. uploaded vqmod folder root , created controller file following code , placed file in /app/controllers class vqmodcontroller extends appcontroller { var $name = 'vqmod'; } i getting following error missing database table error: database table vqmods model vqmod not found. notice: if want customize error message, create app\views\errors\missing_table.ctp friends kindly me install vqmod cake php framework cuz unable find via google. i don't know vqmod is... if have no table vqmod solve problem- class vqmodcontroller extends appcontroller { var $name = 'vqmod'; public $uses = array(); }

java - Generic class for the Dao classes -

i trying setting generic class serve base class dao classes in application, facing error right now. generic class defined way; public class dao<e> { private final e entity; @autowired sessionfactory sessionfactory; protected session getcurrentsession(){ return sessionfactory.getcurrentsession(); } public dao(e entity) { this.entity = entity; } public e getentity() { return this.entity; } @transactional public boolean persist(e transientinstance) { try { sessionfactory.getcurrentsession().persist(transientinstance); return true; } catch (runtimeexception re) { return false; } } @transactional public boolean remove(e transientinstance) { try { sessionfactory.getcurrentsession().delete(transientinstance); return true; } catch (runtimeexception re) { return false; } } ...

java - Callback function pointer jna -

so have native function in c declared int ngsetevent (int event, long callback) . long callback represent callback function pointer. callback prototype declared int oncodeline(int code, int documentid, char *string) . callback should registered method ngsetevent . problem how pointer function should long or nativelong? have tried lot of different aproaches none of them gave result. callback never invoked. i have tried says in turn callback pointer in jna , no success. don't know try anymore. appreciated. oncodeline public interface oncodeline extends callback { int oncodeline (int code, int documentid, byte[] string); } oncodelinestruct public class oncodelinestruct extends structure { public oncodeline onc; @override protected list getfieldorder() { return arrays.aslist(new string[] { "onc" }); } } main class oncodelinestruct oncodelinstruct; oncodelinstruct = new oncodelinestruct(); oncodelinstruct.onc = new on...

php - Fake referrer not working -

i'm using code fake referrer of user when clicks on link, make he's coming facebook: <?php $ch = curl_init(); curl_setopt($ch, curlopt_url, 'http://bit.ly/randomurl'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_referer, 'https://www.facebook.com/') $html = curl_exec($ch); ?> but doesn't seem working, referrer see url of code above. how can fix it? , appreciate coding i'm not coder. i'm using live http headers mozilla you examining headers sent firefox, referer header setting manually being sent php/curl. different http client , different set of http requests. firefox request php program (and send normal referer headers it). your php program request http://bit.ly/randomurl (and send referer header manually specify it). http://bit.ly/randomurl respond php program. your php program respond firefox.

jquery - no loaded event for handlebar templates -

i'm using handlebars , handlebar jquery plugin bootstrap modal .. problem handlebar library not provide proper events fired after given template compiled , rendered making ui not interactive or have issues in way display. currently code shows correctly if put alert statement on top of : // modal appears out of place $modal.render('bootstrapmodaltemplate', context) // makes modal render correctly alert('works'); $modal.render('bootstrapmodaltemplate', context) can guyz ? there way hookup callback after template has been loaded , rendered ?

ios - Desaturate a live UIView layer (not a UIImageView) -

i'm wondering best way desaturate uiview—particularly, uisliderview custom appearance applied it. in ios 7, standard controls fade out tint colors when view appears on them (for example, share sheet or uialertview), since mine built uiimages, tint property doesn't apply it, , remain saturated. there good, easy way desaturate this, short of re-applying new uiappearance it? (if go route, able animate transition colored images greyscale ones?) thanks in advance!

css - wrap div around other divs -

Image
i'm trying div wrap around 2 other divs. this: is possible? tried float:left; , have small divs display:block; didn't work. thanks. edit: inside each div, add pictures: something this: http://jsfiddle.net/tvcc8/1/ float 2 right containers , keep large container block element. display boxes inside large block element inline-block. <div id='wrapper'> <div id='one'><ul><li></li><li></li></ul></div> <div id='two'><ul><li></li><li></li></ul></div> <div id='three'><ul> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> <li></li> </ul></div> an...

ajax - String formating Javascript -

i have array displays date , conversion. want add +"%" after conversion cant work. know im using array cant add wherever want. way add + "%" after conversionrate? function (data) { var tdata = new google.visualization.datatable(); tdata.addcolumn('date', 'date'); tdata.addcolumn('number', 'conversion'); (var = 0; < data.length; i++) { var datestr = data[i].date.substr(0, 4) + "-" + data[i].date.substr(4, 2) + "-" + data[i].date.substr(6, 2); tdata.addrow([new date(datestr), number(data[i].conversionrate)]); } } this work: tdata.addrow([new date(datestr), number(data[i].conversionrate) + "%"]); but might have replace: tdata.addcolumn('number', 'conversion'); with: tdata.addcolumn('string', 'conversion'); or, better option, jamiec mentioned , use formatter : var formatter = new google.visualization.numbe...

javascript - How to break word in pdf header, PDF generated using jsPDF -

how break words in headers in pdf file, while generating pdf using jspdf(i.e. want break headers "hello world" 2 lines) , how set font size in jspdf. i have tried pdf.setfontsize(12); , not work me. any appreciated. thanks. code: var pdf = new jspdf('l', 'pt', 'a3') , source = $('#tableid')[0] , specialelementhandlers = { } , margins = { top: 20, bottom: 20, left: 30, width: 922 }; pdf.fromhtml( source // html string or dom elem ref. , margins.left // x coord , margins.top // y coord , { 'width': margins.width // max width of content on pdf , 'elementhandlers': specialelementhandlers }, function (dispose) { pdf.save('test.pdf'); }, margins ) if want split hello , world on 2 different lines, add newline \n between hello , world : "hello\nworld" e...

excel - Function call on left-hand side of assignment must return variant or object error -

i've been developing program in excel vba time no errors. today however, adter commenting out outside of sub, of functions throw function call on left-hand side of assignment must return variant or object error error. see sample below: public function fgetemployees() variant() dim odb adodb.connection dim ocm adodb.command dim ors adodb.recordset dim strsql string on error goto err: strsql = "select staffid, firstname, lastname " & _ "from ptqemployees" set odb = new adodb.connection odb.open gcconn set ocm = new adodb.command ocm .activeconnection = odb .commandtext = strsql .commandtype = adcmdtext set ors = .execute end fgetemployees = ors.getrows() ors.close set ors = nothing odb.close set ors = nothing exit function err: call flogdberror(err.number, err.description, 4) end function the error gets thrown on line: fgetemployees = ors.getrows() as said has been functioning no issues sometime now. there's...

html - modifying php email form into a smtp email form -

hi have self included email form doesn't require other scripts have run problem need send via smtp examples have seen past skill level wondering if can me my email form this: <html> <head> <!--[if !ie]><!--> <link rel="stylesheet" type="text/css" href="register.css"> <!--<![endif]--> </head> <body style="background-color:#303030"> <?php // display form if user has not clicked submit if (!isset($_post["submit"])) { ?> <div id="login"> <form method="post" action="<?php echo $_server["php_self"];?>"> <input type="hidden" name="subject" value="can create me account"><br/> message: <textarea rows="10" cols="40" name="message"></textarea><br/> first <input type="text" name="firs...

Mysql Stored Procedure - get rows from multiple database tables -

i trying rows multiple database tables in 1 of database stored procedure in mysql. is possible? please can give me example this. create definer=`root`@`localhost` procedure `user_procedure`(in uid_user int) begin select ucgm_id `conne`.conn_group_membership uid=uid_user; end cursors can take data multiple tables, , can use them in procedures.

php - Redirect after login succes + Silex -

what i'd check when loggin in if have cookie. , when have want redirect them $cookie_data/dashboard . because when select language on server, cookie set. redirect them $language/dashboard . i have: $app['security.authentication.success_handler.secured_area'] = $app->share(function() use ($app) { $request = $app['request']; $cookies = $request->cookies; if($cookies->has("language")) { return $app->redirect('/nl/dashboard'); } }); but gives me errors: warning: array_map(): error occurred while invoking map callback in /applications/mamp/htdocs/pst/vendor/silex/silex/src/silex/provider/securityserviceprovider.php on line 264 fatal error: uncaught exception 'runtimeexception' message 'accessed request service outside of request scope. try moving call before handler or controller.' in /applications/mamp/htdocs/pst/vendor/silex/silex/src/silex/application.php:141 stack trace: #0 /appl...

simplepie - Descending sorting order not working -

i have created crone job retrieve list of feeds once display them not in chronological order: http://softwaretestingblogs.thetestingmap.org/sp/index.php have put in get_date() , get_local_date(). can see 5th of april displayed before 9th of april. any hints doing wrong? this crone job: <?php require_once ('simplepie_1.3.1.compiled.php'); $urls = array( 'http://blog.99tests.com/feed/', 'http://feeds.feedburner.com/ministryoftesting?format=xml', 'http://www.satisfice.com/blog/feed', 'http://agiletesting.blogspot.com/feeds/posts/default', /.......................... ); $cache_location = './cache'; $feed = new simplepie(); $feed->set_feed_url($urls); $feed->set_item_limit(1); $feed->set_cache_location($cache_location); $feed->enable_order_by_date(true); $feed->handle_content_type(true); $feed-...

Java Parking Ticket Simulator -

i have looked on here , spent time on , have hit brick wall. wokring on parking ticket simulator in java. not @ java, seem have of working. problem put in demo/test file , gives me same answer time. ridiculous values. can point me in right direction on how resolve this? thanks, code below: /** * @(#)parkedcar.java * * parkedcar application * * * @version 3.00 2014/2/9 */ public class parkedcar { //define variables private string carmake; private string carmodel; private string carcolour; private string carlicenseplate; private static int numberofminutesparked; //define constructors // no argument constructor // set vaules 0 or null public parkedcar() { carmake = " "; carmodel = " "; carcolour = " "; carlicenseplate = " "; numberofminutesparked = 0; } // constructor accepts input public parkedcar(string make,string model,string co...