Posts

Showing posts from February, 2010

c# - How to open a webview in reading view ? UWP -

i have feedreader app , pages open in reading view ( feature ie 11 , edge ) .as example news app in windows 10 uses feature , news descriptions in reading view . possible ? reading view example (screenshot) : https://social.msdn.microsoft.com/forums/getfile/733596 news app reading view example (screenshot) : https://social.msdn.microsoft.com/forums/getfile/733599 thanks in advance . in these cases content of web page extracted , shown custom styling. to same result can use diffbot (which think used in news app) or embedly cheaper, , content parsed , returned nice , structured. after you'll have style yourself. you can style "converting" html , show in textblock , or can show in webview . edit: can use htmlutilities.converttotext text html. think can convert 1 section @ time, way can style headers , such.

typeclass - Haskell Type Class Implied -

i want able types b class g f :: g -> int class b g h :: g -> int instance g => b g h = f i'm getting compile error: illegal instance declaration `b g' … (all instance types must of form (t a1 ... an) a1 ... *distinct type variables*, , each type variable appears @ once in instance head. you should not this . however, it's reasonable write like class b g => g f :: g -> int this produces useful entailment. defaultsignatures extension (which dislike various reasons), can write class b g h :: g -> int default h :: g => g -> int h = f

linux - I cannot print color escape codes to the terminal -

when run script: fn main() { // \033[0;31m <- red // \033[0m <- no color println!("\033[0;31mso\033[0m") } i expect get so #in red letters however, get: 33[0;31mso33[0m when ran similar script in go or python, expected output. going on? missing? how fix this? i using: $ rustc --version rustc 1.3.0 (9a92aaf19 2015-09-15) $ lsb_release -a no lsb modules available. distributor id: ubuntu description: ubuntu 14.04.3 lts release: 14.04 codename: trusty rust 1.3.0 not seem support octal escape strings such \033 . instead, can use hexadecimal escape strings \x1b . fn main(){ println!("\x1b[0;31mso\x1b[0m") }

eclipse - how to display lyric while song is playing android? -

i have songs , lyric. want display lyric while song playing. don't how this. read topic this but not clear me. there tutorial that? should read ".lrc" file , search time stamp how use them? think can put time stamp in array , according times start textview. here example this: https://github.com/douzifly/androidlrcview

php - Laravel 5 groupBy on collection -

i trying group tasks due date display in list. wednesday 1 january 2015 task 1 task 2 etc here function: public function index() { $user = auth::user(); $tasks = $user->tasks()->orderby('due_at','asc')->get(); $tasks_group = $tasks->groupby('due_at'); return view('tasks.index', compact('tasks_group')); } but receiving error: array_key_exists() : first argument should either string or integer i have tried few other ways returning 1 task per date. any on doing wrong here great. you need eager load tasks relationship groupby . try following codes: $user = auth::user(); $user->load(['tasks' => function ($q) { $q->orderby('due_at', 'asc'); }]); $tasks_group = $user->tasks->groupby('due_at'); return view('tasks.index', compact('tasks_group'));

python - why does x -= x + 4 return -4 instead of 4 -

new python , trying wrestle finer points of assignment operators. here's code , question. x = 5 print(x) x -= x + 4 print(x) the above code, returns 5 first time, yet -4 upon second print. in head feel number should 4 reading x= x - x +4. however, know wrong python returning -4 instead. gracious if explain me (in simple terms novice) have been pounding head on table on one. x -= x + 4 can written as: x = x - (x + 4) = x - x - 4 = -4

android - @VisibleForTesting does not work as expected -

i wanted try @visiblefortesting annotation android unit-test - have class 1 annotated method: public class foo { public void bar() { } @visiblefortesting private void baz() { } } but in unit-tests still can see bar - not baz the point of annotation convention , used in static code analysis. change visibility of method package . in case method has reduced visibility testing , visible tests in same package. public class foo { public void bar() { } @visiblefortesting /* package */ void baz() { } }

Can not compile aplication.scss rails can't find bootstrap-sprockets -

i'm trying use sass , sublime text rails project, when try compile aplication.css.scss file, sublime shows me error: error: file import not found or unreadable: bootstrap-sprockets. gemfile ... gem 'bootstrap-sass', '~> 3.3.5' gem 'sass-rails', '>= 3.2' ... application.css.scss @import "bootstrap-sprockets"; @import "bootstrap"; @import "favourites.scss"; @import "custom.scss"; i use sublime sass , buildonsave packages compiling sass. my assets directory: /app /assets /stylesheets /bourbon application.css.scss custom.css custom.css.map custom.scss favourites.scss this because bootstrap-sprockets don't exist in currect directory. sass @import directive import files exists. you can download file again, directly, here .

javascript - Using array.prototype.push vs array.push -

this question has answer here: how extend array.prototype.push()? 6 answers i have seen people using 2 different ways of using different methods of array object in javascript. i use so: arr.push(element1, ..., elementn) but have seen people using this: array.prototype.push.apply(this,arguments) i understand javascript objects inherit properties , methods prototype. object.prototype on top of prototype chain. what differences between 2 approaches , when should each approach used? the call via .apply() used when you're interested in using .push() object isn't array. jquery object, example, not array instance, code maintains .length property that's enough look like array, @ least far .push() , other array prototype methods concerned. for real array instance, there's no need that; .push() method directly available via prototyp

php - how to use button as a link? -

can show me how use html button link connect php? i'm not quite sure how , can't find useful code can me achieve it. i'm pretty new bit struggling it.thanks http://i.stack.imgur.com/ydhen.jpg [![<!doctype html> <html> <head> <meta charset="utf-8"> <style> h1 { padding-top: 50px; text-align: center; color: white; margin-right:60px; } </style> <title> washing machine control system</title> <link rel="stylesheet" type="text/css" href="bk.css"/> <link rel="stylesheet" type="text/css" href="machinebuttons.css"/> <script src="http://code.jquery.com-1.11.3.min.js"></script> </head> <body bgcolor = "black"> <h1>machine controller</h1> <br></br> <br></br> <form method="get/post" action="thenameofmyphpfil

objective c - APNS in ios application -

could please tell me best practice use fetchcompletionhandler when receiving remote notification in function : - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult result))completionhandler i saw people write code @ end of above function: completionhandler(uibackgroundfetchresultnewdata); what if write : completionhandler(uibackgroundfetchresultnodata); or happens when don't put above code? note: using xcode7.1, objective-c, ios9.1 uibackgroundfetchresult.newdata - called when new content has been fetched, , application has been updated. uibackgroundfetchresult.nodata - called when fetch new content went through, no content available. uibackgroundfetchresult.failed - useful error handling, called when fetch unable go through. you have call let ios know result of background fetch was. uses information schedule future

Java (swing) toolbar not showing -

Image
i have been following tutorial: java toolbar tutorial when tried insert toolbar gui, doesn't show up. can kindly give me advice on do? code far this: import javax.swing.box; import java.awt.container; import java.awt.eventqueue; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.grouplayout; import javax.swing.jbutton; import javax.swing.jcomponent; import javax.swing.jframe; import javax.swing.jpanel; import java.awt.event.keyevent; import javax.swing.imageicon; import javax.swing.jmenu; import javax.swing.jmenubar; import javax.swing.jmenuitem; import javax.swing.abstractaction; import static javax.swing.action.mnemonic_key; import static javax.swing.action.small_icon; import static javax.swing.jframe.exit_on_close; import javax.swing.keystroke; import java.awt.borderlayout; import java.awt.event.itemevent; import java.awt.event.itemlistener; import javax.swing.borderfactory; import javax.swing.jcheckboxmenuitem; import javax.swin

symfony - Error retrieving credentials from the instance profile metadata server. Network unreachable -

i have following adapter , service configured: knp_gaufrette: adapters: sc_documents: aws_s3: service_id: sc.aws_s3.client bucket_name: hidden options: directory: documents create: true filesystems: sc_documents_fs: adapter: sc_documents alias: sc_document_storage sc.aws_s3.client: class: aws\s3\s3client factory_class: aws\s3\s3client factory_method: factory arguments: - key: 'hidden' secret: 'hidden' region: 'eu-central-1' version: '2006-03-01' i keep getting following error both read , write: error retrieving credentials instance profile metadata server. (curl error 7: failed connect 169.254.169.254 port 80: network unreachable (see http://curl.haxx.se/libcurl/c/libcurl-errors.html )) the bucket policy is: "id&qu

jquery - Bootstrap div as multiline in yii2 -

Image
i using list in bootstrap css , responsive making notification list long text notification in facebook i have 1 question how can make div multiline @ image below. i want make div if if resize window should automatically break text , display in next line. and here html of li <li>'+ '<div id="notification-panel" class="panel panel-default">'+ '<div id="notification-body" class="panel-body">'+ '<div id="notification-image" class="panel-more1">'+ '<img src="../uploads/'+notificationlist[index].image+'" class="img-rounded" width="50" height="50" />'+ '</div>'+ '<div id="notification-info" class="panel-info">'+ '<label> checked '+ notificationlist[index].sourcename + '</label><br>

MySQL complex WHEN filter with CASE -

i'm trying figure out how filter output "combination" case. first 2 statements work , me lessons want (i.e., snowboard lessons @ skier's ability level + unrated private lessons). third statement (inpreferredlessontype = 3, is, either snowboard or ski) fails filter output set properly--i snowboard lessons or ski lessons various ability levels match either of skier's 2 (separately stored) ability levels. not right idea, , confusing user. what i'd snowboard lessons @ skier's snowboard ability level + ski lessons @ skier's ski ability level + unrated private lessons. please help! (...rest of select statement...) case when inpreferredlessontype = 1 program.nbool_issnowboard = 0 , (program.n_ability_level = inskiabilitylevel or program.n_ability_level = 0) when inpreferredlessontype = 2 program.nbool_issnowboard = 1 , (program.n_ability_level = insnowboardabilitylevel or program.n_ability_level = 0) when inpreferredlessontype = 3 pr

php foreach value loop of variables in file.php instead of array -

i'm trying find way create foreach loop can echo values, can in array, issue (as far know) cannot echo them variables name. example right now: <?php $stuff = array( foo => "<a href=\"/foo\">foo</a>", bar => "<a href=\"/bar\">bar</a>", thing => "thing", ); ?> <?php foreach($stuff $val) { print '<li>' . $val . '</li>'; } ?> my issue is, can't echo 1 of these name anywhere <?php echo $foo; ?> if stored variables. can tell, echo them number <?php echo $stuff[1]; ?> what want store variables in file file.php , still able foreach loop above. example: <?php $foo = "<a href="/foo">foo</a>"; $bar = "<a href="/bar">bar</a>"; $thing = "thing"; ?> pseudo code of want: <?php foreach(var in /path/to/file.php $value) { print '<li>' . $

not recognizing error messages specified for a custom validation in laravel 4.2 -

i made custom validation in laravel 4.2 , put in app/start/global.php , code there this validator::extend('captcha', function($attribute, $value, $parameters) { $captcha = $_session["captcha"]; return $value == $captcha; }); validator::extend('csy', function($attribute, $value, $parameters) { $appnd = "sy " . $value ."-". ($value + 1); $chksy = db::table('dbo_schoolyear') ->where('schoolyear' , '=' , $appnd) ->count(); if($chksy) { return false; } else { return true; } }); then in controller here code $rules = array( 'nsy' => 'required|integer|min:2005|csy' ); $messages = array( 'nsy.required' => 'please enter starting year.', 'nsy.integer' => 'starting year can contain integer values', 'nsy.min' => 'school year minimum 2005', &

How to prove full nodes = leaves -1 for a binary tree? -

without proper mathematical proof how supposed go proving number of full nodes (a node consists of 2 children (left , right)) same number of leaves - 1? hint supposed using proof of 'structural induction', unfortunately not understand means, me out here? mathematically, proof induction way prove statement s true values of natural number n. idea prove 1) s(1) true, 2) if s(n) true s(n+1) true, , therefore 3) s(n) true n. in case, want prove binary trees have property. trick show binary tree (other smallest possible one) can transformed smaller binary tree, such if smaller tree has property, larger one. if can prove smallest possible binary tree has property, binary trees. so if you're give large binary tree, what's simplest possible way make smaller? edit: suggest take pencil , paper , try draw tree doesn't have property. start single node, root node, , add nodes 1 @ time, keeping track of number of full nodes , number of leaves. once convinced c

Linking button to controller using jquery and ajax (url) -

i'm trying create button database lookup value in mvc project. i'm bit stuck after reading round tips. actual cshmtl create odel oncologyrta.controllers.oncologypatient @{ viewbag.title = "create"; } <h2>add new patient</h2> @using (html.beginform()) { @html.antiforgerytoken() <button type="button" name="button" value="find">search</button> <div class="form-horizontal"> <h4><font color="red"><strong>live dataset</strong></font></h4> <hr /> @html.validationsummary(true) <dl class="dl-horizontal"> <dt> @html.labelfor(model => model.hospitalid, new { @class = "control-label col-md-2" }) </dt> <dd> @html.textboxfor(model => model.hospitalid, new { onkeyup = "inputto

handlebars.js - Pass data to JavaScript variable from Handlebars in Keystone.JS -

i using handlebars views , want pass returned data database javascript/jquery. similar logic code in handlebars? //these lines of code jade template. <script type="text/javascript"> var sydjs = {}; sydjs.meetup = !{json.stringify(meetup)}; </script> use triple curly braces {{{ }}} see http://handlebarsjs.com/ html escaping

neo4j - Cypher: How to use FOREACH on an array of objects to create multiple nodes and multiple relationships -

i having trouble fetch described in title of question. attempt following string: foreach (_tabobj in {_tabarray} | match (a:superlabel),(b) a.id = {_parentid} , b.id = _tabobj.id merge (a)-[r:includes]->(b { name : _tabobj.name }) i trying create relationship if not in database , nothing if relationship in database. trying create b node if not in database , nothing if b node in database. i grateful can offer how this: match (a:superlabel {id: {_parentid}}) a, tabarray in {_tabarray} unwind tabarray tabobj match (b {id: tabobj.id) merge (a)-[r:includes]->(b {name: tabobj.name}) i use foreach last resort ;) and simpler solution: match (a:superlabel {id: {_parentid}}), (b) b.id in extract(tabobj in {_tabarray} | tabobj.id) merge (a)-[r:includes]->(b {name: tabobj.name}) an important consideration both of these queries: when matching b node on id property database index (if have one) won't used because indexes label / proper

servicebus - REBUS Send message in Queue ,and receive in another application -

i want implement following scenario using rebus. creating on sender application , 1 receiving application. there class suppose public class getpersonrequest { public int id { get; set; } public string name { get; set; } } public class getpersonresponse { public int id { get; set; } public string name { get; set; } } i send class object in queue values. , want display value in receiver. how achieve this? sender code this: static void main(string[] args) { getpersonrequest objgetpersonrequest = new getpersonrequest(); objgetpersonrequest.id = 12; objgetpersonrequest.name = "kumar"; using (var activator = new builtinhandleractivator()) { activator.register(() => new printname()); var bus = configure.with(activator) .logging(l => l.none()) .transport(t => t.usemsmq("rebus-application.input")) .routing(r

java - How to know what you selected in the JComboBox -

i making basic calculator app in java has 2 jtextfields , 1 jcombobox. want know if there way let jbutton detect selected in jcombobox, when did text field looked static string divide = "/"; if (n == joptionpane.ok_option) { if (symbol.gettext().equals(divide)){ <code> } } so there similar way jcomboboxs?? string[] symbols = {times, minus, plus, divide}; that's jcombobox's content code. you can selected item jcombobox method .getselecteditem() . say have string[] symbols = {times, minus, plus, divide}; input when constructing jcombobox (see constructor jcombobox(e[] items) ) jcombobox jcb = new jcombobox(symbols); //you see string selected system.out.println(jcb.getselecteditem());

ios - Jenkins cannot find pods -

/usr/local/share/jenkins_agent/workspace/ios myproject/myproject/user.h:9:9: fatal error: 'realm/realm.h' file not found #import <realm/realm.h> why can see files not finding pods? clueless. edit: because output folder wasn't in correct part of repo , pods creating own output folder, not recognising each other. created output folder both read :) likely jenkins hasn't pulled down pods. if haven't, add script before xcode plugin runs in jenkins in it: #!/usr/bin/env bash source ~/.bash_profile pod repo update pod install

javascript - After deletion changing id of textbox inside cell id not working -

i have table using javascript , deleting rows using delete function after deletion trying reindex table cell ids function updaterowcount(){ var table = document.getelementbyid("ordertable"); var rowcountafterdelete = document.getelementbyid("ordertable").rows.length; for(var i=1;i<rowcountafterdelete;i++){ table.rows[i].id="row_"+i; table.rows[i].cells[0].innerhtml=i+"<input type='checkbox' id='chk_" + + "'>"; table.rows[i].cells[1].id="notes_"+i; table.rows[i].cells[2].id="amount"+i; } } but following lines not working: table.rows[i].cells[1].id="notes_"+i; table.rows[i].cells[2].id="amount"+i; <td> 's contains input boxes, this <td><input type="text" title="notes"></td> <td><input type="text"

winapi - Delphi - Calling Win API -

what difference between calling win api in following codes code #1: uses winapi.activex; procedure foo(); var pv :pointer; begin cotaskmemfree(pv); end; code #2: procedure cotaskmemfree( pv: pointer ); stdcall; external 'ole32.dll'; procedure foo(); var pv :pointer; begin cotaskmemfree(pv); end; i noticed executable file size of code 1 (161,792 bytes) bigger executable file of code 2 (23,552 bytes). think because of code 1 compile following units. unit winapi.activex; uses winapi.messages, system.types, winapi.windows; is there other advantage of using method used on #code2 ? is there risk of doing ? the difference in size reasons outline. when use unit, executable contain code unit, , dependent units. there various options can use reduce impact, invariably executable size increase when use unit not used. procedure cotaskmemfree(pv: pointer); stdcall; external 'ole32.dll'; it reasonable define yourself, in manner

Simple login with Java code - using conditional assignment -

this question has answer here: how compare strings in java? 23 answers i'm still newbie java programming. , can tell me what's wrong source code? when run code, conditional assignment outputs "login failed". import java.util.scanner; public class programbiodatamahasiswa { public static void main(string[] args) { scanner input = new scanner(system.in); string username, password, output; system.out.print("enter username : "); username = input.nextline(); system.out.print("enter password : "); password = input.nextline(); output = (username=="kesit" && password=="ps123") ? "login successfully" : "login failed" ; system.out.println(output); } } with strings ("quest" , "ps123")

Windows 10 Mobile Geolocation settings issue -

i have several applications use geolocation. when access functionality, popup confirm permission appears described in documentation , setting yes or no works fine. but app doesn't appear in location settings then, cannot switch on , off @ will. i noticed it's case apps (8.1 , 10) apps on phone here maps, or here drive. for example denied here drive permission on first launch, , cannot switch on doesn't appear in settings. do notice same behavior or there specific line add make appear ? thanks advance. this bug of os. hard resetting phone solved problem.

linux - How do I increase the RGB value of a specific pixel with Image::Magic in Perl? -

Image
i want 1 pixel (x=3, y=3) , change rgb values (r 100 101 , g 99 100 , b 193 194 ). use strict; use image::magick; $p = new image::magick; $p->read( 'myfile.jpg' ); $pix = $p->getpixel( width => 1, height => 1, x => 3, y => 3, map => 'rgb', normalize => 0 ); # in $pix rgb value now? how add 1 rgb components? can split decimal rgb 3 values (r,g,b) , increment separately, , merge 3 r,g,b values 1 rgb? :) how do that? $pix = .... code here... # make changes $p->setpixel( x => 3, y => 3, channel => 'rgb', color => [ $pix ] ); $p->write ('my_new_file.jpg'); this bit tricky figure out, here go. i'll show did result, not how works. i'm using small image has starting color (100, 99, 1

php - mySQL update sort - order from table with unlimited childs after delete one or more -

i have table this: id | parent_id | order 1 | 0 | 1 2 | 1 | 1 3 | 1 | 2 4 | 1 | 3 5 | 0 | 2 6 | 0 | 3 7 | 5 | 1 8 | 5 | 2 it takes unlimited categories , childs in same table parent_id. have form checkboxes delete 1 or more , want re-ordering after delete 1 or more rows group parent_id . i have write code: mysql_query("set @rownumber = 0;"); $sql_previous_order = "update `cms` set `order` = (@rownumber:=@rownumber+1) order parent_id, `order` asc"; but not turn rownumber 0 (0) after change parent_id. you can introduce additional variable - p_id. compare parent_id , reset rownumber 0 when parent_id changed. set @rownumber = 0; set @p_id = 0; select id, case @p_id when parent_id @rownumber:=@rownumber+1 else @rownumber:=0 end new_order, @p_id:=parent_id p_id cms order parent_id asc ;

c# - Starting a new thread on a web page button click -

i have inherited legacy app , there code can simplified down to: protected void somebutton_click(object sender, eventargs e) { var otherthread = new system.threading.thread(delegate() { system.threading.thread.sleep(20000); fireanasyncprocess(); }); otherthread.start(); thankyoupanel.visible = true; otherpanel.visible = false; } the fireanasyncprocess() seems intermittently failing run. of course number of things wondered: given pause of 20000 above, fireanasyncprocess() called after button click has been handled? new thread called regardless of happens thread called it? edit: result/outcome of fireanasyncprocess() not required on web page , page not intending wait them. rather trying start thread , assume gets fired. this web environment - each request handled in own thread context, , thread.start() isn't useful: child thread aborted after request been handled, , parent thread aborted. so if need run piece of work

c# - is .net framework required in install shield? -

i have 1 question regarding activex control. we have developed application in vc++. in have dialog container , hosting in it, activex control developed in c# , .net framework 3.5. want know required include .net framework 3.5 in install build create? any appreciated. this not related install shield. if application requires .net framework 3.5 installed, need install installer if not installed. you can't guarantee installed beforehand on end user's machine - reason.

c# - How can I inject dependencies into a System.Web.Http.AuthorizeAttribute subclass? -

i'm working on asp.net web application uses web api 2 , unity. we've decorated our controllers/controller methods subclass of built-in system.web.http.authorizeattribute apply authorization our various rest endpoints exposed web api. we able inject dependencies attribute using unity. i've done quite bit of searching, examples different enough use case not useful. how go injecting dependencies system.web.http.authorizeattribute subclass using unity? i've tried creating custom filterprovider calls unity's buildup method on attribute instance, i'm not sure base class should extending or interface should implementing. you have implement ifilterprovider. if extend actiondescriptorfilterprovider can call base.getfilters filters specified both @ controller , action level. public class unityfilterprovider : actiondescriptorfilterprovider, ifilterprovider { private readonly iunitycontainer _container; public unityfilterprovider(iunityc

java - How to hide and use dialog boxes when using Microsoft Crypto API (Windows Certificate Store) -

i want leverage windows certificate store in java application. able load keystore windows-my has aliases/certs need, when loading faced dialog box asking "please insert smart card". if click cancel on few times, keystore still loads right content. is there way suppress dialog box? there way use windows certificate selection box java? answer have seen on net this: https://social.msdn.microsoft.com/forums/en-us/52dca221-1e05-44c1-8c45-9e0d4a807853/java-keystoreload-for-windowsmy-pops-up-insert-smart-card-window?forum=windowssecurity , don't want have remove because don't expect users that. here how loading keystore: keystore ks = keystore.getinstance("windows-my"); ks.load(null, null); i never tried load certificase through keystore, supplied them means of system properties. system.setproperty("javax.net.ssl.keystoretype", "windows-my"); system.setproperty("javax.net.ssl.keystore", "none"); system.se

java - Inner class - final variable can't be looped? -

i'm trying make loop gives each button method parameter dependent on button is. keep getting error: i not final variable - must if nested in inner class. for (int = 0; < 14; i++) { buttons[i].setonclicklistener(new button.onclicklistener() { public void onclick(view v) { // issue value here move.makemove(move.cups.get(i); updatebuttons(); } }); currentcup = nextcup; } try way: for (int = 0; < 14; i++) { final int currenti = i; buttons[i].setonclicklistener(new button.onclicklistener() { public void onclick(view v) { // issue value here move.makemove(move.cups.get(currenti); updatebuttons(); } }); currentcup = nextcup; }

java - JasperReports Connection -

i'm trying export datatable, i'm using jasperreport, doesn't work. got error: net.sf.jasperreports.engine.jrexception: error retrieving field value bean can me please. <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" language="groovy" pagewidth="842" pageheight="595" orientation="landscape" columnwidth="802" leftmargin="20" rightmargin="20" topmargin="20" bottommargin="20" > <style name="title" fontname="times new roman" fontsize="50" isbold="true" pdffontna

html - jQuery Form Validation issue for Drupal 7 custom module -

i have inherited drupal 7 site few ugly custom modules form workflow through site. 1 of modules presents form user. form dynamically created. form working fine , data submission working fine. fields on form have no validation @ , must validation working urgently on form. happy if field required validation working. i have been doing lot of reading jquery.validate.min.js , totally confused, , can see following scripts in head of page jquery-1.10.2.min.js jquery.validate.min.js note site using jquery update set jquery version 1.10.2 the code form follows <form class="details-form" enctype="multipart/form-data" action="" method="post" id="details-form" accept-charset="utf-8"> <div class="return-block-2"> <div class="enquire-form-wrapper form-item webform-component webform-component-textfield webform-component--name webform-container-inline"> <label>postal code<

Git - Can you do something with rebase that you can't do with merge? -

every time i've tried rebase , i've been involved in infinite loop of unsolvable conflicts. before resolving x conflict, y conflict appeared, , x conflict again, , on. the point (apparently) merge , or cherry-pick , provide same functionality expect rebase , don't they? if not, usefulness of rebase ? rebase rewrites history. way more merge or cherry-pick -- advanced tool takes practice (and can dangerous, since rewrites history...be careful git push -f ). when rebase used merge , process quite distinctively different. git fetch origin && git merge origin/master : download changes origin merge changes on top of local branch resolve conflicts , commit git fetch origin && git rebase origin/master : download changes origin reset local branch common point in history (a commit both local/remote repos share) fast forward origin apply commits on top of new commits 1 one resolve conflicts , commit each local change the big adva

sql - Concatenating strings based on previous row values -

consider following input: id -------- 33 272 317 318 i need somehow following result: result -------- /33 /33/272 /33/272/317 /33/272/317/318 how can achieve single select statement? using cross apply , for xml path() : ;with cte as( select *, rn = row_number() over(order (select null)) tbl ) select * cte c cross apply( select '/' + convert(varchar(10), id) cte rn <= c.rn xml path('') )x(s)

Lazy loading existing contact images in Android -

i'm trying use lazy loading , create contact list pre-defined images (the images used each contact). can find how use lazy loading load images web, there way can use existing images? use picasso library lazy loading image in storage (sd,network,etc ...) add line application gradle build file: compile 'com.squareup.picasso:picasso:2.5.2' and in code can snippet : picasso.with(context).load(new file(...)).into(imageview3); check picasso webpage more example !

sql - Group function in select with subquery -

i have following select : select distinct max(tctc_cntipcli) "typeofcontract" , max(texe_cncclipu) "contractnumber", max(tctc_cndocidc) "clientname", max(tsrv_cndesser) "servicename", max(texe_cnfuncid) "servicenumber", tsrs_cnsubsdc "subservicename", texe_cnsubser "subservicenumber", tmap_cndesc "map", ( select decode(to_char(count(tlof_cnlofrid)), '0', 'na', count(tlof_cnlofrid)) service.kndtlof tlof_cncclipu = tctc_cncclipu , tlof_cnservic = texe_cnfuncid , tlof_cnsubser = texe_cnsubser , tlof_cnfhalta > trunc (sysdate, 'mm') ) "volumeoffilesmessages" service.kndtctc, service.kndtexe, service.kndtscm, service.kndtsrv, servi

Batch script to delete the list of files with specific pattern names -

i need in deleting files specific patterns in folder. example in c/program files/ have files test_1.txt,test_2.txt,test_3.txt,test_4.txt,test_5.txt. criteria delete files test_2.txt test_5.txt . thank you for /l %%i in (2,1,6 ) ( /f "tokens=*" %%a in ('dir /b ^| findstr test_%%i') del %%a ) this worked fine me.

type coercion in JavaScript -

i guess kind of know differences between == , === in javascript, == type coercion when compare === not. understand following code true: console.log(true == "1"); but when code below false? console.log(true == "true"); when loosely compare boolean value of type, boolean coerced number. and when compare number , string, string coerced number. the full rules explained in the abstract equality comparison algorithm the process this: true == "true" ─┐ ├─ number(true) // 1 1 == "true" ─┤ ├─ number("true") // nan 1 == nan ─┤ ├─ // comparing `nan` produces `false` false ─┘

treeview - VB.NET 2008 Not recognizing Path.GetFileName Method -

i have read post nothing works. visual basic not recognizing path.getfilename method following page in trying filename in visual basic application can't compile microsoft official page private sub form1_load(byval sender system.object, byval e system.eventargs) handles mybase.load size_mode_list.items.addrange([enum].getnames(gettype(pictureboxsizemode))) each drive driveinfo in driveinfo.getdrives dim node treenode = _ file_view_tree.nodes.add(drive.name) node.tag = itemtype.drive node.nodes.add("filler") next end sub private sub file_view_tree_beforeexpand(byval sender system.object, byval e system.windows.forms.treeviewcanceleventargs) handles file_view_tree.beforeexpand dim currentnode treenode = e.node currentnode.nodes.clear() try 'now go files , folders dim fullpathstring string = currentnode.fullpath 'handle each folder each dolderstring string in _

github - git: can't create upstream branch -

the problem i'm going bananas due git (or github?) idiosyncrasy - i've created new branch, can't push upstream repo on github. not first branch i'm pushing on repo, , went smooth far. walkthrough i've created new branch: $ git checkout -b adam/no-push-bugfix made changes file, and added of them (this means of changes not committed): $ git add --patch path/to/some/file made sure changes right: $ git diff --staged $ git commit -v $ git status and tried push: $ git push --set-upstream origin adam/no-push-bugfix $ fatal: adam/whatever-name-bugfix cannot resolved branch. any idea why new branch rejected upstream? i not find right explanation issue on internet. adding other people understand problem. git branch name case-sensitive , mapped file/directory in repository (not common new branches). result case-difference in git branch name may cause problem in case. in particular case see existing branches started "adam/". means

amazon web services - How to add ContentType to AWS PHP SDK MultiPartUploader -

i have searched high , low how add simple contenttype metadata multipartuploader in aws php sdk. docs mention how putobject, have no mention of how multipartuploader. i have tried every method find online, nothing working , file getting set application/octet-stream. does have experience this? here code: $uploader = new multipartuploader($this->s3, $local_path, [ 'bucket' => env('aws_bucket'), 'key' => $path .'/'. $filename, 'contenttype' => 'video/mp4', // have tried 'metadata' => [ // have tried (all variations of caps) 'contenttype' => 'video/mp4', ] ]); { try { $result = $uploader->upload(); } catch (multipartuploadexception $e) { $uploader = new multipartuploader($this->s3, $local_path, [ 'state' => $e->getstate(), ]); } } while (!isset($r

php - Optimising neo4j cypher query for retrieving a social news feed -

up to have tried query slow scans nodes. capable of want retrieve match (u:users{user_id:140}),(p:posts),(pu:users{user_id:p.created_by}) optional match (p)-[:post_media]->(f) optional match (p)-[:comment]->(c)<-[:comment]-(u3) (p)-[:created_by]->(u) or (p:public , (u)-[:follow]->(pu) )or (p:private , (p)-[:shared_with]->(u)) return {user_id:pu.user_id,firstname:pu.firstname,lastname:pu.lastname,profile_photo:pu.profile_photo,username:pu.username} pu,p,collect({user_id:u3.user_id,profile_photo:u3.profile_photo,text:c.text}) comment,collect(f) file order p.post_id desc limit 25 before query tried query fast can't retrieve complete news feed capable of retrieving posts followings not users's himself , not others users private posts may shared user retrieving newsfeed. match (u:users{user_id:140})-[:follow]->(pu)<-[:created_by]-(p:posts) optional match (p)-[:post_media]->(f) optional match (p)-[:comment]->(c)<-[:comment]

python - Ping Pong simulation not correctly triggering function -

i'm new oop , practicing putting little bit more complex programs using various classes , implementing principles inheritance. i've created ping-pong simulation has player class contains probability player win serve. have pingpong class subclass of super class racquetsports. each instance single game, ability change server, , record won, , whether or not shut-out. finally, have simstats class purpose record stats across "n" number of games. my problem seems play_game function not correctly firing, when place print statement in there never triggers. current result when running whole program player1 has 10 wins no shutouts, , player2 has 0 of both. finally, suggestions on better oo practice appreciated. here player class: from random import random class player(object): def __init__(self, prob_win): self.prob = prob_win self.points = 0 def wins_serve(self): return self.prob >= random() def add_point(self):