Posts

Showing posts from June, 2011

knockout.js - knockoutjs viewmodel not loading ajax return -

i'm new knockout , have been having trouble loading ajax json return viewmodel. i"m using knockoutjs mapping plugin. here json return: {"operator":[{"employeeid":394,"category":"mc","opfirstname":"fred", "opsurname":"penner","regnumber":"a12234","status":"ft","supervisorid":0,"team":"a", "teamgroup":"a1","issupervisor":"y"}]} here code: <table> <tbody data-bind="foreach: opviewmodel.items"> <tr> <td><ul> <li data-bind="text: opfirstname"></li> </ul> </td> </tr> </tbody> </table> <script type="text/javascript"> function opviewmodel() { var self = this; $.getjson("../controllers/getallops.php...

c# - How to get multiple dynamic row value into the database using asp.net mvc -

public void create(account_detail c, int jobcard_id) { sqlconnection con = new sqlconnection(@"data source =(localdb)\v11.0;attachdbfilename=c:\users\wattabyte inc\documents\carinfo.mdf;integrated security=true;"); sqlcommand cmd = new sqlcommand(); cmd.commandtype = commandtype.text; cmd.connection = con; con.open(); string additionaltext = string.empty; bool needcomma = false; foreach (var details in c.data) { if (needcomma) { additionaltext += ", "; } else { needcomma = true; additionaltext += "('" + jobcard_id + "','" + details.completed_by + "','" + details.reporting_time + "','" + details.cost_activity + "','" + details.spared_part_used + "')"; } cmd.commandtext = "insert child_detail values " + additionaltext + "...

tkinter - Python key pressed without Tk -

i use raspberry pi via ssh windows 7 , build robot. if press arrow, move. detect key tkinter module, needs graphic environment. if in ssh terminal, can't run. there module can detect keys , doesn't need window? i have not tried it, quick search has shown this: example github source which linux implementation of pyhook (windows only) so use it: import pyxhook import time #this function called every time key presssed def kbevent( event ): #print key info print event #if ascii value matches spacebar, terminate while loop if event.ascii == 32: global running running = false #create hookmanager hookman = pyxhook.hookmanager() #define our callback fire when key pressed down hookman.keydown = kbevent #hook keyboard hookman.hookkeyboard() #start our listener hookman.start() #create loop keep application running running = true while running: time.sleep(0.1) #close listener when done hookman.cancel()

git - How do you resolve a GitHub merge conflict that appears to have everything merged in? -

Image
the repo contributing uses forking/rebasing pattern on github. feel i'm missing concept here did not result expecting. currently, pr says can't merge because there conflict, however, there appears no commits in dev branch don't exist in mine. the steps took end here follows: created fork of repo created branch feature based on dev made changes, committed files created pull request at point, got following error appveyor message: this pull request contains merge conflicts must resolved. the recommendation "pull latest dev, rebase pr on it." so, branch did following 2 commands update upstream (aspnet) , rebase branch off of dev: git fetch aspnet git rebase aspnet/dev i expected branch contain of commits aspnet/dev, commits. instead, changes seem appear twice, other commit has appears in between them (so...there nothing left merge), have no conflicts locally , i've landed in following state: now, changes aren't huge - limited sing...

dbunit/unitils: how to export a multi-schema dataset? -

the official tutorial of dbunit give example exporting dataset single database schema. is there way export different tables different schemas 1 single dataset (say table_a schema_a, table_b schema_b)? exported dataset, when written xml file, this: <?xml version='1.0' encoding='utf-8'?> <dataset schema:schemaa schema:schemab> <schemaa:tablea ..... /> <schemaa:tablea ..... /> <schemab:tableb ..... /> </dataset> i've got same problem , fix need set feature_qualified_table_names properties: see below same example code change (i removed part of code because don't need full database export): public static void main(string[] args) throws exception { // database connection class driverclass = class.forname("com.microsoft.sqlserver.jdbc.sqlserverdriver"); connection jdbcconnection = drivermanager.getconnection( "jdbc:sqlserver://<ser...

Prime Numbers Exercise - Loop Issue C++ -

i trying solve exercise written in stroustrup's book calculating , printing if number between 1 , 100 prime number or not. my code seems work but, when prints values on screen, starts 6 , not 2. i have tried figure out why not able understand reason of that. can lend me hand? thank much! // prime numbers.cpp : definisce il punto di ingresso dell'applicazione console. // #include "stdafx.h" #include "std_lib_facilities.h" vector<int> primes = { 2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 }; int primecheck(int x) { (int : primes) { if (x <= primes[i]) break; if (primes[i] == x) return 1; while (x % primes[i] != 0) { --i; if (i < 0) { return 1; break; } else { if (x % primes[i] == 0) return 2; } } } } int _tmain(int a...

lotus notes - Notice API is not working -

i not able accept meeting invitation using rest web service call. facing issue, if meeting invitation rescheduled owner before accept/decline participant error code below { "code":400, "text":"bad request", "cserror":1028, "message":"error processing notice action." } rest url details http://domain:port/mail/testuser.nsf/api/calendar/notices/b2b6c5e4b1d4d3df65257e7c004192c0/action?type=accept method :- put

How to get the unclean CSS after gulp-uncss -

i know can clean css using gulp-uncss so: var gulp = require('gulp'); var uncss = require('gulp-uncss'); var rename = require('gulp-rename'); gulp.task('clean-my-css', function() { return gulp.src('original.css') .pipe(uncss({ html: ['http://mywebsite.com'] })) .pipe(rename('clean.css')) .pipe(gulp.dest('./fresh')); }); and run task so: gulp clean-my-css however, i'd unclean css well. in other words, if concatenated these 2 files (clean , unclean) have original.css: clean.css + unclean.css = original.css is possible gulp-uncss or other tool?

c# - How to detect when ListView Reached to and end in Windows 10 Universal app development -

i followed link detect when wpf listview scrollbar @ bottom? scrollbar.scroll doesn't exist listview in windows 10 .. how achieve requirement in windows 10 thanks use methods described here how can detect reaching end of scrollviewer item (windows 8)? if want incremental loading there's built-in solution that. otherwise go , traverse visual tree scrollviewer object in template.

symfony - Comment entity related to Article or Product -

i have entities "article" , "product". want add comments these 2 entities. should create 2 different entities "articlecomment" , "productcomment" same properties, , build manytoone relation respective entity, or create single "comment" entity , find way build relation both "article" , "product" entities. considering solution #2, how ? considering solution #2, how ? one way use single table inheritance single table inheritance inheritance mapping strategy classes of hierarchy mapped single database table. in order distinguish row represents type in hierarchy so-called discriminator column used. this means can create 2 separate entities articlecomment , productcomment both extending comment . use advantages discriminatormap column provides. your comment entity hold relation called parent instance refer either article or product entities. creating new instance of articlecomment or pr...

Android Handle IntentService onStop event -

i want handle intentservice onstop event. intentservice receive intents, launch worker thread, , stop service appropriate have not found onstop method. has ondestroy() ondestroy() method can not called. ondestroy called when system low on resources(memory, cpu time , on) , makes decision kill activity/application or when calls finish() on activity. can add code in onstop intentservice time ? you can use stopself() stop service. perform task before service stops can write custom callback/ broadcast after thread notify ui.

xml comparison using python confusion -

i trying compare below given 2 xml formats in python , have inputs on approach file 1: <p1:car> <p1:feature car="111" type="color">511</p1:feature> <p1:feature car="223" type="color">542</p1:feature> <p1:feature car="299" type="color">559</p1:feature> <p1:feature car="323" type="color">564</p1:feature> <p1:feature car="353" type="color">564</p1:feature> <p1:feature car="391" type="color">570</p1:feature> <p1:feature car="448" type="color">570</p1:feature> <p1:feature car="111" type="tires" unit="percent">511</p1:feature> <p1:feature car="223" type="tires" unit="percent">513</p1:feature> <p1:featu...

Android Deep linking using explicit intent -

currently having 2 web pages, home , about . about deep link in ,so when click on link , android gives me option use browser or own app open link. explicitly open link in app.i don't want list of apps handle it. is possible? below code: androidmanifest.xml <activity android:name=".aboutpage" android:label="@string/about_page"> <intent-filter android:label="@string/filter_name"> <action android:name="android.intent.action.view"/> <category android:name="android.intent.category.default"/> <category android:name="android.intent.category.browsable"/> <data android:scheme="http" android:host="appindexing.robscv.info" android:pathprefix="@string/abouthtml"/> </intent-filter> </activity> aboutpage.java public class a...

c - Data section of program is too big or not? -

i kinda new c, wrote simple program. have 2 int variables. #include<stdio.h> #include<conio.h> int main(){ int x = 3; int y = 4; printf("x = %d \n y = %d",x,y); return 0; } so when analysed image exe . found data section 12 kb normal or there cant see, mean program size including pe header,code , imports measures 72 kb size of second.exe you compiler source file generated code actual source file , not else. executable have been linked other object files , libraries, needed external functions , variables need. of course makes executable bigger contains more code. contains other things needed run program perfectly.

jquery - scroll to top of a bootstrap modal on click of a button in modal -

<div class="modal-dialog" role="document"> <div class="modal-content login conatct_main" id="mdlcont"> <div class="modal-body"> <div class="row"> <div class="col-md-12"> <button id="registrsubmit" name="registrsubmit" value="true" class="friends_log pull-right">register</button> </div> </div> </div> </div> </div> the modal not scrolling top after click. tried scrolltop() method. not working . can me on this? ![enter image description here][1] wow! coincidence, did today morning. need is: // before calling modal window... $("#modalid").scrolltop(0); also using bootstrap's modal window events api, can this: $('#modalid').on('shown', function() { $(this).scrolltop(0); })

Display the content of parent page in SilverStripe -

i have simple tree structure in silverstripe. parentpage , childpage. on parentpage display list of childpages. don't want make accessible url: /parent-page/child-page i want allow /parent-page that's why did redirect in childpage index action parentpage: class childpage_controller extends page_controller { public function index() { $this->redirect('/parent-page/'); } } it works on frontend. in cms after click chidpage in tree, redirects me editing parentpage. (not frontend url admin/pages/edit/show/parentpageid ). happen in split or preview mode. can advice how prevent it? or there other option? thanks! in init function can check if user has permission view cms , if page has stage variable set: class childpage_controller extends page_controller { public function init() { parent::init(); if (!($this->getrequest()->getvar('stage') && permission::check('view_cms...

javascript - How to set dial to maximum in angular gauge chart when value is more than maximum? -

i'm using fusion chart library. in using angular gauge chart report. i'm facing issue dial automatically set fusion chart library based on dial value passing it. issue when pass value more maximum limit, fusion chart sets dial pointer 0. want pointer end if passed maximum value. if add 1 condition before passing data dial value if beyond maximum value overwrite maximum value works. pointer set expected value showing not want. maximum value time. fiddle you can see. when pass 101 , sets pointer 0. want set @ 100 want display value 101 only. any appreciated. this limitation angular gauge , reported , being fixed. work around increase range in colorrange section. "colorrange": { "color": [ { "minvalue": "0", "maxvalue": "50", "code": "#e44a00" }, { "minvalue"...

angularjs - Why is my watcher giving me a "Infinite $digest Loop" error? -

i'm having weird issue watcher function: $scope.$watch('builder.edititemform.quantity',function(newvalue,oldvalue){ if(newvalue !== oldvalue){ if(newvalue % 2 == 0){ builder.edititemform.quantity = newvalue; } else { builder.edititemform.quantity = oldvalue; } } }); i getting error as: error: $rootscope:infdig infinite $digest loop 10 $digest() iterations reached. aborting! watchers fired in last 5 iterations: [["builder.edititemform.quantity; newval: 1; oldval: undefined"],["builder.edititemform.quantity; newval: undefined; oldval: 1"],["builder.edititemform.quantity; newval: 1; oldval: undefined"],["builder.edititemform.quantity; newval: undefined; oldval: 1"],["builder.edititemform.quantity; newval: 1; oldval: undefined"]] https://docs.angularjs.org/error/$rootscope/infdig?p0=10&p1=%5b%5b%22builder.edititemform.quantity;%20newval:%201;%20oldval:%2...

php - How to reattach multiselect in Laravel 5? -

Image
i have mulutiselect option enabled in select html code, frontend this: for example if user unselect option , select other how can update in database, idea? if have manytomany relationships between group , project can use sync() method maintain association below, $group->projects()->sync([$projid1, $projid2]); above remove previous association between current group( $group ) , projects , associates newly supplied projects i.e. $projid1, $projid2 . if want maintain previous associations pass false second argument in sync() below, $group->projects()->sync([$projid1, $projid2], false); above code maintain previous group , project association , associate passed projects.

c++ - Undefined variables within header files -

thanks taking time view question. i've spent lot of time looking can't find solution problem: i have class person its' respective header file person.h. cpp class having hard time understanding variables name, age, , iq are. //person.cpp /* makes person. person has name, age, , iq level. create many of these objects within other classes. */ #include "person.h" person::person() //empty constructor { } person::person(string thename, int theage, int theiq) { name = thename; age = theage; iq = theiq; } string getname() { return name; //error: identifier "name" undefined } int getage() { return age; //error: identifier "age" undefined } int getiq() { return iq; //error: identifier "iq" undefined } void setname(string aname) { name = aname; //error: identifier "name" undefined } void setage(int aage) { age = aage; //error: identifier "age" undefined } void setiq(int aiq) {...

javascript - Disable input if checkbox is ticked on page load AND when it is clicked -

i've looked @ loads of questions describe how check weather check box checked or not none of them gives answer need. want check whether check box checked on page load , if is, disable input. need disabled input changed when box checked/uncheked after page load. this have: jquery(document).ready(function($) { if ($('.is-repeat-event').prop('checked')) { $('.event-date').prop('disabled', 'true' ); } $('.is-repeat-event').change(function(){ var d = this.checked ? 'true' : 'false'; $('.event-date').prop('disabled', d ); }); }); either part on it's own works putting them doesn't work (the .change event has no effect on input). that beacause property disabled need set boolean true/false values. can trigger event after binding see relevant changes in page load: $('.is-repeat-event').change(function(){ $('.event-date').prop(...

.net - How to set auto size of textobject in SAP Crystal Report -

i using sap crystal reports in windows application (visual studio 2010) , took box having background color gray , text object inside it. took input user insert text. user entered long length text, 5-6 lines. enabled can grow property on text object still problem not resolved. how can set auto size of textobject in sap crystal report?

Load iOS 'smart app banner' through JavaScript -

i'm having troubles ios smart app banner , i'm trying add through javascript. the actual smartbanner simple adding little block head of html: <meta name="apple-itunes-app" content="app-id=1008622954"> unfortunately, i'm quite restricted in way can upload script. can't change html directly, i'll through our tag manager, through javascript. turns out doesn't work. i've tried simplify case testing: hardcoded tag in html: works (as expected) <meta name="apple-itunes-app" content="app-id=1008622954"> inserted javascript directly when document ready: works $(document).ready(function(){ $("head").append('<meta name="apple-itunes-app" content="app-id=1008622954">'); }); inserted javascript, after settimeout delay: does not work $(document).ready(function(){ settimeout(showbanner, 1); //after 1 millisecond }); function showbanner(){ $...

css - HTML animate "ghost-img" when dragging element -

it's there way animate "ghost image" when dragging element? just google drive, drag files trigger cool effect. tried add css animation ghost-img , this it's not work. go way https://jsfiddle.net/mdvrkaer/4/ : miss " drag " event. move ghost, make him follow mouse cursor... $(document).ready(function(){ draganddrop(); $('#ghost-img').hide(); }); function draganddrop(){ var dragelement = document.getelementbyid('row-1'); dragelement.addeventlistener("dragstart",function(evt) { $('#ghost-img').show(); //ghost image var crt = document.getelementbyid('ghost-img').clonenode(true); crt.style.position = "absolute"; crt.style.top = "0px"; crt.style.right = "0px"; crt.style.zindex = -1; document.body.appendchild(crt); evt.datatransfer.setdragimage (crt, 0, 0); ...

web applications - Best practices for managing and deploying large JavaScript apps -

what standard practices managing medium-large javascript application? concerns both speed browser download , ease , maintainability of development. our javascript code "namespaced" as: var client = { var1: '', var2: '', accounts: { /* 100's of functions , variables */ }, orders: { /* 100's of functions , variables , subsections */ } /* etc, etc couple hundred kb */ } at moment, have 1 (unpacked, unstripped, highly readable) javascript file handle business logic on web application. in addition, there jquery , several jquery extensions. problem face takes forever find in javascript code , browser still has dozen files download. is common have handful of "source" javascript files gets "compiled" 1 final, compressed javascript file? other handy hints or best practices? the approach i've found works me having seperate js files each class (just in java, c# , others). alternati...

php - insert form data into table -

my form emails data customer ok, need save data table called card, doesn't do. please let me know i'm going wrong. i'm it's when connect db. <?php if(isset($_post['email'])) { $email_to = ($_post['email']); $email_subject = "customer registration"; function died($error) { // sese echo "we sorry, there error(s) found form submitted. "; echo "these errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "please go , fix these errors.<br /><br />"; die(); } // siati data if(!isset($_post['first_name']) || !isset($_post['last_name']) || !isset($_post['pay_address1']) || !isset($_post['pay_address2']) || !isset($_post['pay_address3']) || !isset($_post['pay_address4']) || !isset($_post['pay_contact_no']) || !isset($_post['email']...

classloader - Tomcat Unable to create initial connections of pool -

so have web app deploy / redeploy on remote tomcat server instance. sometimes, deploy , redeploy (by redeploy mean moving root.war through sftp , leave tomcat redeploy it) work expected, no issues whatsoever database connection. unfortunately, other times, after redeploy, refuses connect database, apparently doesn't recognize mysql driver anymore. mysql connector lib inside tomcat's lib folder, not package war. pom.xml: <dependency> <groupid>mysql</groupid> <artifactid>mysql-connector-java</artifactid> <version>5.1.36</version> <scope>provided</scope> </dependency> webapp/web-inf/web.xml: <resource-ref> <description>app mysql</description> <res-ref-name>jdbc/app_mysql</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> </resource-ref> webapp/meta-inf/conte...

android - How to display names and percentages in a pie chart legend using mpchartlib -

i want display pie chart this please note not want display names of items , theirs values inside of each slice because having allot of items , when displaying names slices names , values aren't intelligible. i don't know if of not can pass value textview , per knowledge, can change textview value on method public void onvalueselected(entry e, int datasetindex, highlight h) i'm doing this desc.settext(code.get(h.getxindex()) + " - " + name.get(h.getxindex()) + ", area: " + area.get(h.getxindex())); where code, name, , area arraylist<string> name, code, area;

Should I initialize the register in x86 assembly? -

i'm trying solve exercise : assume given values in eax,ebx,ecx. write code adds values inside registers, , stores final result inside edx. my code : mov eax,3 mov ebx,4 mov ecx,1 add edx,eax add edx,ebx add edx,ecx do have initialize register edx (mov edx,0) ? do have initialize register edx (mov edx,0) ? the way code written need clear edx prior first add , either mov edx, 0 or xor edx, edx . instead of adding instruction can replace first add mov : mov edx,eax ; edx = eax add edx,ebx ; edx += ebx add edx,ecx ; edx += ecx or, 1 instruction less: lea edx,[eax + ebx] ; edx = eax + ebx add edx,ecx ; edx += ecx

javafx - Unable to load external TTF fonts -

Image
for reason unable load ttf fonts in app. here simple example: file f = new file("/blah/font.ttf"); system.out.println(f.canread()); system.out.println(f.length()); system.out.println(font.loadfont(new fileinputstream(f), 20)); the output: true 52168 null the font not loaded. tried different fonts, none of them worked. problem? i'm running arch linux. $ java -version java version "1.8.0_45" java(tm) se runtime environment (build 1.8.0_45-b14) java hotspot(tm) 64-bit server vm (build 25.45-b02, mixed mode) assuming have package structure in application this the following code should work import java.io.inputstream; import javafx.scene.text.font; public class accesstest { public static void main(string[] args) throws urisyntaxexception, malformedurlexception { inputstream = accesstest.class.getresourceasstream("opensans-regular.ttf"); font font = font.loadfont(is, 12.0); system.out.println("f...

angularjs - how to use chart.js with angular-chart using requirejs -

trying implement lazy load using requirejs . everything fine when not using charts. when want use charts(angular charts), not going sucseed! using chart.js angular-chart . here main.js: require.config({ baseurl: "http://localhost/ums/angular/js", paths: { 'angular': 'lib/angular.min', 'ngroute': 'lib/angular-route.min', 'flash': 'lib/angular-flash', 'angular-loading-bar': 'lib/loading-bar.min', 'nganimate': 'lib/angular-animate.min', 'ui.bootstrap': 'lib/ui-bootstrap-tpls-0.12.0', 'uniquefield': 'admin/directives/angular-unique', 'input_match': 'admin/directives/angular-input-match', 'uniqueedit': 'admin/directives/angular-unique-edit', 'angularamd': 'lib/angularamd.min', 'chart.js': 'lib/chart.min', ...

asp.net mvc - Getting Error Code 400 Bad Request While Connecting to my Quickbook API V3 Sandbox Company in nopcommerce V3.60? -

i sending order item quickbooks sandbox account online using api keys , tokens. when searching product online , gives error code 400 exception bad request. // sending order item quickbook online account [nonaction] public void postorderpos(order order) { string accesstoken = "qyprd9yjd4unmlr3zcrcw8zfdjs9wwtgm71oh3t2pzbsc8cb"; string accesstokensecret = "srsbyb9iynyywfjaxxl4zlavjjl8hpfw0an3swra"; string consumerkey = "qyprdwz4vag2knd4e1aehqaufcchpm"; string consumersecret = "bvormln4y7h5cg9na0ov27pqyb9bzsucmiyurt70"; oauthrequestvalidator oauthvalidator = new oauthrequestvalidator(accesstoken, accesstokensecret, consumerkey, consumersecret); string apptoken = "bd0a230bb9dc9b4321ba9feb899e18471d58"; string companyid = "1403414765"; // realm servicecontext context = new servicecontext(apptok...

python - A command line for registry comparison tool -

i looking command line api tool of comparing registry keys before , after operations doing. i've found tool here , don't see option operate tool via command line interface, through gui. know if tool has command line api option, or know other tools allowing me comparing registry state via command line api? you can first query registry 2 results in plain text format. compare results suitable tool. options querying: the reg command https://technet.microsoft.com/en-us/library/cc732643.aspx http://ss64.com/nt/reg.html the regedit command may useful . powershell´s get-itemproperty https://technet.microsoft.com/en-us/library/ee176852.aspx http://ss64.com/ps/get-itemproperty.html

javascript - Jquery Onclick priority vs Href -

i've small problem set priority on href vs onclick: $("#table_head tr").click(function (e) { /* function */ }); but if use "href" : <table id="table_head"> <tr> <td><a href="http://stackoverflow.com">my link</a></td> </tr> </table> how can priorise href vs onclick please? assuming mean you're trying execute code before page redirected, need stop normal link behaviour using preventdefault() , process logic, manually redirect page using window.location.assign() . try this: $("#table_head tr").click(function (e) { e.preventdefault(); /* function */ if (e.target.tagname == 'a') window.location.assign(e.target.href); });

java - VerifyError when instrumenting webapp on WildFly 8 -

i'm working on project, trying insert additional log4j logging statements running webapp. realise that, start java agent via jvm parameter when launching wildfly: -javaagent:path/to/agent.jar the agent's premain method receives instrumentation object , establishes mbean remote access. logging insertion achieved using instrumentation , javassist. far, works perfectly. however, keep working, agent.jar has reside in webapp's war file on deployment, since log4j logger class used logging ships jar. if not, verifyerror when class definition updated instrumentation api. trying load e.g. classes java.lang inserting code "math.random()" works expected. it's important notice agent classes loaded appclassloader parent of application's moduleclassloader. therefore i'm wondering why classes residing in agent.jar can't loaded delegation through moduleclassloader. these observation brought me assumption webapp module needs declare explicit dependency ...

Mysql : left outer join issue -

i have 2 tables : income(month, amount) expenditure(month, amount) i need display each month of table income amount minus expenditure amount (if exists). think need use left outer join between 2 tables, like select income.amount - expenditure.amount income left outer join expenditure on income.month = expenditure.month but don't know how http://sqlfiddle.com/#!9/7a7d5/1 if can on sqlfiddle thanks. i assume if there no income should treated 0, likewise expenditure. mysql doesn't have full outer join can similar: select month, sum(amount) (select month, income amount income union select month, - expenditure amount expenditure) group month; this creates union of 2 tables (with expenditure negative simplicity). sums amounts , groups month. example: http://sqlfiddle.com/#!9/7a7d5/14

php - $_POST[] data at the top of page -

i'm having 20 $_post[] items @ top of page. there quicker way of writing these post data rather having retype $_post on , on again? (e.g.: may using foreach loop ?) /* $fname = $_post['fname']; $lname = $_post['lname']; $phone = $_post['phone']; $address = $_post['address']; */ $arr = array('fname', 'lname', 'phone', 'address'); foreach ( $_post $data => $val ) { } the keys , variable names same. extract() - extract($_post); will extract data in , assign variable s named key s. checks each key see whether has valid variable name. checks collisions existing variables in symbol table. or if want use foreach - foreach ( $_post $key => $val ) { $$key = $val; } this assign value variable name key . variable variables

angularjs - Laravel 5 always returning 200 OK - no matter what -

Image
i realise going very, vague. sending ajax requests angularjs (ngresource, or standard $http) backend. these requests fine , receive appropriate response, except 1 small issue. 200 back, if see laravel stack trace, or send sort of forced header. return response::make('message', 400); i out of ideas. wild guesses out there?

Using wkhtmltoimage from wkhtmltopdf -

i read in documentation wkhtmltoimage inside wkhtmltopdf , installed wkhtmltopdf using apt-get, because that's way dependencies working. now can use wkhtmltopdf , when use wkhtmltoimage , keep getting command not found. why so? how can use it? i want able this: wkhtmltoimage --width=750 'http://google.com/' test.jpg what wkhtmltopdf --version output you? versions apt-get can ancient. suggest download manually

php - How can I determine whether or not a card is credit or debit in Braintree? -

i using braintree php sdk , i'm unable figure out if card debit card or not. is possible know if card debit or credit? if store credit card braintree, response include bin database information country_of_issuance - country issued credit card. debit - whether card debit card. possible values: braintree::creditcard::debit::yes braintree::creditcard::debit::no braintree::creditcard::debit::unknown

Automated text file Editing -

i have text file looks similar this: +phonenumber 3/5/15 7:16 pm text here +phonenumber 3/5/15 7:16 pm text here +phonenumber 3/5/15 7:16 pm text here +phonenumber 3/5/15 7:16 pm text here now problem lines this: +phonenumber 3/5/15 7:16 pm text here runs down here +phonenumber 3/5/15 7:16 pm text here +phonenumber 3/5/15 7:16 pm text here runs down here +phonenumber 3/5/15 7:16 pm text here runs down here or longer now have lines vary in length, , things above examples. goal need every single line first example. ie want every line begin "+phonenumber" not text. of text should backspaced it's previous line finishes sentence. more this: +phonenumber 3/5/15 7:16 pm text here runs down here +phonenumber 3/5/15 ...

Matplotlib in wxPython with multiple panels -

i trying turn example multi-panel example. import os import wx import numpy np import matplotlib matplotlib.use('wxagg') import matplotlib.figure figure import matplotlib.backends.backend_wxagg wxagg class myframe(wx.frame): def __init__(self): wx.frame.__init__(self, none, -1, 'title') #self.create_menu() self.create_main_panel() self.draw_figure() def create_menu(self): self.menubar = wx.menubar() menu_file = wx.menu() m_exit = menu_file.append(-1, "&quit\tctrl-q", "quit") self.bind(wx.evt_menu, self.on_exit, m_exit) self.menubar.append(menu_file, "&file") self.setmenubar(self.menubar) def create_main_panel(self): """ creates main panel controls on it: * mpl canvas * mpl navigation toolbar * control panel interaction """ self.panel = wx.p...

html - Allowing decimal no input to a textbox and validation using javascript -

i have textbox needs accept decimal number input, , disallow other characters , dot entry if more once.i used below approach same $('#bankemi').keydown(function (e) { var key1 = e.keycode; if (key1 == 190 || key1 == 110) { var s = $('#bankemi').val(); if (s.indexof('.') > - 1) { e.preventdefault(); return false } return true } if (key1 == 13 || key1 == 8 || key1 == 9 || key1 == 46 || (key1 >= 35 && key1 <= 40)) { return true } if (e.shiftkey || e.ctrlkey || e.altkey) { e.preventdefault() } else { var key = e.keycode; if (!((key >= 48 && key <= 57) || (key >= 96 && key <= 105))) { e.preventdefault() } } }) }); bankemi- input box. need support number of kind 4100.50 haven't put restrictio...

active directory - LDAP query: Is int bigger? -

this ldap search filter invalid: (msexchresourcecapacity>5) . this ldap search filter valid: (msexchresourcecapacity>=5) . documentation says: >= lexicographically greater or equal to this means 5 >= 40, not desirable room capacity, obvious reasons. how can check bigger number? documentation falls short answer question. there no documentation because there no such feature in ldap. 1 has resources ad , comparison in client-side code.

maven - How to integrate the cucumber in testNG? -

i have framework used created core java+testng. , framework followed tdd model, , pom our build management tool. can tell me there possible update framework tdd bdd using cucumber. still minimum changes requirement, not changing existing technologies(core language,testng, maven sys.,). objective how run cucumber tc's using testng.xml/testng plugins in eclipse. possible implement code in jenkin ci server minimum changes? can share me basic example? yes, can have cucumberjvm integrated testng, selenium , maven. you can run tests jenkins mvn test . here have basic example: http://automatictester.co.uk/2015/06/11/basic-cucumberjvm-selenium-webdriver-test-automation-framework/

Robocopy fails with error 121 when running in a new window of conemu -

i have long running process spans robocopy windows parallelize copying process. goes under cmd.exe, when try under conemu, child windows has following message: conemuc: root process alive less 10 sec, exitcode=1. press enter or esc close console... and parent window: [2015-07-08 09:57:20] error: not copy xxxxx. robocopy exitcode: 121. how can debug , fix that? perhaps batch uses start start new console robocopy . may disable start processing in conemu's settings . or may using old conemu version. there may other issues without exact information nobody can tell more.

stringbuilder - Fast string insertion at front in c# -

i need insert strings @ beginning. right use stringbuilder.insert(0, stringtoinsert) insert @ front, it's taking lot of time (around 2 mins 80,000 strings). the append() method runs lot faster (30 secs 80,000 strings), it's not order need. how can reverse order of strings (and not string itself) , decrease insertion time? yes, reversing enumerable much faster. for example: var numstrings = 80000; var strings = new list<string>(); for(var = 0; < numstrings; i++) { strings.add(guid.newguid().tostring()); } var sw = new stopwatch(); sw.start(); var sb = new stringbuilder(); foreach(var str in enumerable.reverse(strings)) sb.append(str); sw.stop(); sw.elapsedmilliseconds.dump(); // 13 milliseconds sb.dump(); sw = new stopwatch(); sw.start(); sb = new stringbuilder(); foreach(var str in strings) sb.insert(0, str); sw.stop(); sw.elapsedmilliseconds.dump(); // 42063 milliseconds sb.dump();

javascript - mouseenter is not firing when mousedown is fired in Internet Explorer 11 -

i have 2 lists in div tag. trying drag & drop type functionality in code. working chrome not working in ie when mouse entered on div recording id "selected" or "removed" in "listselected" variable , in mouseup event checking on div mouse button released using variable "listselected". mousedown event implemented know starting div tag & user expecting drag operation. but problem after mousedrag event fired, mouseenter event not firing in ie. working in chrome. when release button mouseenter or mouseover events firing not firing instantly while dragging. it helpful if know how handle in ie. here code html <div id="lstrmv" style="float: left; background-color:antiquewhite" onclick="return mouseclick();" onmousedown="return mousedown(event,'removed');" onmouseenter="return mouseenter('removed');" onmouseout="return mouseleave(event, 'removed');...

How to Exposing secure rest/soap service in Mule, require best and simple approach -

in flow, have many http rest api call, have used key-store (as below) fine internal api calls. need expose rest/soap service external api. simple , best way secure mule api. i'm using mule 3.5.1 version. <https:connector name="http_https" doc:name="http-https" cookiespec="netscape" receivebacklog="0" receivebuffersize="0" sendbuffersize="0" socketsolinger="0" validateconnections="false" clientsotimeout="10000" serversotimeout="10000" enablecookies="true"> <https:tls-key-store path="cer/check.jks" keypassword="abc" storepassword="abc" /> </https:connector> <flow name="service" doc:name="service"> <https:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8085" doc:name="http" connector-ref="http_...

treeview - C# Clone a specialized TreeNode containing another Object of type Object -

i have been searching simple solution cloning of object containing other objects. public class tpftestcasetreenode: treenode, icloneable { public object obj; public tpftestcasetreenode(string title, object o) { // set attributes treenode text = title; // not sure 1 need name = title; // not sure 1 need // , additionally, remember test case object obj = o; } } for cloning, using : foreach(treenode t in listalltestcases) { if(t.name.equals(testcaseiddesc)) { thenode = (treenode)((icloneable)t).deepclone(); } } listalltestcases contain tree nodes of type "tpftestcasetreenode". "t" in loop, contain valid value "obj" per debugger mode i have tried normal clone() , deepclone() well, none of them able clone state of object "obj". remains null in cloned object treenode "thenode". can provide plausible explanation why clo...

ruby on rails - How to use link_to with a method and how to route it? -

i trying toggle administrator user users list, whenever try grant or revoke admin status, redirected "something went wrong..." page. i following hartl's tutorial. i'm learning rails. try exercise, tried make admin_toggle method destroy method works well. unfortunately don't work same , can't figure out why. here code : # users_controller.rb class userscontroller < applicationcontroller before_action :logged_in_user, only: [:index, :edit, :update, :destroy] before_action :correct_user, only: [:edit, :update] before_action :admin_user, only: [:destroy, :index, :admin_toggle] ... def destroy user.find(params[:id]).destroy flash[:success] = "user deleted" redirect_to users_url end def admin_toggle admin = user.find(params[:id]).admin user.find(params[:id]).toggle!(:admin) if admin == false flash[:success] = "user granted" redirect_to users_url else flash[:success] = ...