Posts

Showing posts from May, 2012

javascript - Chart.js render in hidden Bootsrap tab -

this driving me mad, using chart.js in bootstrap tabs not render because width set 0 when dom loaded. found out after trying , figuring out why graph not there! i've searched online , nothing seemed fix issue, can please me this, think need script renders graph when tab selected , succesfully loaded im using js: var data = [ { value: 300, color:"#f7464a", highlight: "#ff5a5e", label: "red" }, { value: 50, color: "#46bfbd", highlight: "#5ad3d1", label: "green" }, { value: 100, color: "#fdb45c", highlight: "#ffc870", label: "yellow" } ]; var options = { responsive : true, animation: true, }; var ctx1 = $("#invest-chart").get(0).getcontext("2d"); var invest_chart; new chart(ctx1).doughnut(data, { responsive : true, animation: true, }); along html piece in tab: <canvas id="invest-chart">&l

c# - Error 2 The type <T> exists in both... with ILMerge -

i have 3 projects: a_mainproject (startup project) b_intermediateproject c_sharedclasslibrary the depencies are: a depends on b & c b depends on c and c depends on system only. every project has it's own namespace. as long no ilmerge installed, works fine. if ilmerge activated project ("a_mainproject") still works fine , 1 self-contained executable project generated. if ilmerge activated b_intermediateproject, following error: error 2 type 'c_sharedclasslibrary.sharedclass' exists in both 'c:\dev\ilmergeerror\b_intermediateproject\bin\debug\b_intermediateproject.exe' , 'c:\dev\ilmergeerror\c_sharedclasslibrary\bin\debug\c_sharedclasslibrary.dll' c:\dev\ilmergeerror\a_mainproject\program.cs 12 a_mainproject i use "msbuild ilmerge task" 1.0.3-rc2 "ilmerge" 2.13.0307 (from mbarnett). the minimal solution contains 3 projects 1 class each. version has ilmerge activated on 1 project , wor

html - How to anchor text field text to the right? -

Image
i have set of fields forming line items , fields text aligned right currently. in cases works fine, when number exceeds input width text/numbers displayed left right. while extreme case, i'm wondering if there way anchor field text right. as pointed out in comment. solution in stackoverflow.com/q/1962168/1059070 looking for.

multithreading - How to define thread safe array? -

how can define thread safe global array minimal modifications? i want every access accomplished using mutex , synchronized block. something 't' type (note 'sync' keyword not defined afaik): sync array!(t) syncvar; and every access simmilar this: mutex __syncvar_mutex; //some func scope.... synchronized(__syncvar_mutex) { /* edits 'syncvar' safely */ } my naive attempt this: import std.typecons : proxy: synchronized class array(t) { static import std.array; private std.array.array!t data; mixin proxy!data; } sadly, doesn't work because of https://issues.dlang.org/show_bug.cgi?id=14509 can't surprised though automagical handling of multi-threading via hidden mutexes unidiomatic in modern d , concept of synchronized classes relict d1 times. you can implement same solution manually, of course, defining own sharedarray class necessary methods , adding locks inside methods before calling internal private pl

javascript - Using php catch to display errors in stripe -

i attempting display errors on page when using stripe card number supposed trigger stripe error number 4000000000000002 . error seems appear in console 402, can't seem grasp how output php. i more used javascript, im not sure how try , catch work, assumption try runs code until error thrown , catch runs. want spit out errors page @ charge point of stripe code. here code try { $customer = stripe_customer::create(array( 'email' => $email, 'card' => $token, "description" => $quantity . " copies of economic definition of ore -cut-off grades in theory , practice")); $charge = stripe_charge::create(array( "amount" => $total, // amount in cents, again "currency" => "usd", 'customer' => $customer->id, "metadata" => array("first name:" => $firstname, "last name:" => $lastname))); $success = '<div class="alert alert-

vb.net - How to search multiple treeview nodes at a particular depth -

Image
please know how can search text of multiple treeview nodes @ particular depth on click of button? treeview nodes arranged follows: i want prevent user entering duplicate grandchild nodes of same title treeview, i.e entering 'movie 2' second time should throw message movie 2 has been entered; if not, add new movie title. the grandchild node titles fed treeview textbox. using visual basic 2010 express. thank in advance. the code using is: private sub button11_click(sender system.object, e system.eventargs) handles button11.click 'new movie title has been introduced study dim selectednode treenode selectednode = treeview1.selectednode 'to avoid entering duplicate movies title dim newmoviename string = textbox1.text.trim.tolower ' content of node dim parentnode = selectednode.parent ' parent dim childnodes treenodecollection = parentnode.nodes ' children dim wehavedu

Graph DFS in Java giving stack overflow error on large input -

this homework problem- given undirected graph, if 2-colorable, color it, , if not, output odd-length loop within it. method goes through, coloring goes, , if finds loop pops stack , outputs loop. works fine small input, on large input gives stack overflow error. there can not overflow large input? p.s. know should using getter , setter methods variables in node. children list of nodes edge given node. public static boolean isoddloop(node current){ for(int x=0; x<current.children.size(); x++){ node next = current.children.get(x); if(next.color==0){ //i.e. unvisited next.color=3-current.color; //colors 1 , 2, sets opposite if(isoddloop(next)){ system.out.println(current.number + ": " + current.color); return true; } } if(next.color==current.color){ system.out.println(next.number + ": " + next.color); system.out.println(current.n

java - CDI interceptor Scope annotation -

context: wildfly 8.1.0 cdi 1.2 according cdi specification cdi1.2 , not need declare cdi in beans.xml if annotated @priority(somepriorityvalue) however, following cdi interceptors never called unless add @dependent annotation @requiresloggedinaccount @interceptor @priority(interceptor.priority.application) public class myinterceptor { @aroundinvoke public object intercept(final invocationcontext ic) throws exception { //intercept , then... return ic.proceed(); } } and interceptor binding: @inherited @documented @interceptorbinding @target({method, type}) @retention(runtime) public @interface requiresloggedinaccount { } note interceptor binding , interceptor defined in different jar module used (so purpose @priority). is have overlooked? why must add cdi 's @dependent scope interceptor kick? is because have stated in beans.xml bean-discovery-mode="annotated" wildfly 8.1 ships weld 2.1.x (i forget x, 2.1 cdi 1.1 compliant)

260K image files resizing with php -

i have 260k image files in folder.i need resize them php.but there execution time limit.i think process longer 60 seconds. how can execute url without problem ? not sure cronjob case ? think ? i not asking anycode you. wrote code how can execute ? if cannot modify php.ini , server allows can change timelimit set function set_time_limit(0); //no limit but if cannot change php.ini , server don't allow modify set function, cron have same problem.

xml - HXT: How to use output of an arrow as function argument? -

it's difficult give title question… i'm stuck hxt again. understand want do, i'm not sure how make play nicely arrows. here give simplified description of problem. function foo takes int , returns arrow: foo :: arrowxml => int -> xmltree xmltree function bar extracts value of attribute: bar :: arrowxml => xmltree string now, need write baz takes map string s int s , returns arrow: import qualified data.map.lazy m baz :: arrowxml => m.map string int -> xmltree xmltree logic of baz : extract value of attribute bar , in map. if m.lookup returns just x , invoke foo x , otherwise don't (input of arrow goes through unchanged). afaik every such arrow works filter, in reality arrowxml => xmltree string type means takes xmltree , returns (possibly empty) list of string s. makes me reformulate logic of baz . given input xmltree there may many strings, every string should used integer , first found integer should passed foo . if of t

iron router - How to extend a main controller within a meteor package -

what right way extend main controller within meteor package? this case, main controller inside app.js file, located in both/controllers/app.js the content is appcontroller = routecontroller.extend({ layouttemplate: 'applayout' }); inside my-package folder, i've created router.js file packages/my-package/lib/router.js below content of file, here came question: why if move dashboardcontroller declaration outside meteor.startup() function, doesn't work? dashboardcontroller = appcontroller.extend({}); // here doesn't work meteor.startup(function () { router.route('/dashboard', { controller: dashboardcontroller, name: 'dashboard' }); the output is referenceerror: appcontroller not defined why if move dashboardcontroller declaration outside meteor.startup() function, doesn't work? that's because of load order of meteor build process : every package js files loaded according depend

Import a mysql database using mysql command line -

i wondering if it's possible import mysql database using mysql command line. most solutions give mysql -u root -p nameofdatabase < mysqlfile.sql i wondering if it's possible inside mysql commmand line, instead of passing arguments executable. if mysql> mydatabase < mysqlfile.sql; that doesn't work. thank you. did mean this? mysql> use nameofdatabase; mysql> set autocommit=0 ; source the_sql_file.sql ; commit ; the important part, looking for, source command. switch off autocommit because of execution time.

Formula for calculating interest Python -

i learning python through video tutorial on youtube, , have come against formula cannot seem grasp, nothing looks right me. basic concept of excersise make mortgage calculator asks user input 3 pieces of information, loan amount, interest rate, , loan term (years) then calculates monthly payments user. here code: __author__ = 'rick' # program calculates monthly repayments on interest rate loan/mortgage. loanamount = input("how want borrow? \n") interestrate = input("what interest rate on loan? \n") repaymentlength = input("how many years repay loan? \n") #converting string input variables float loanamount = float(loanamount) interestrate = float(interestrate) repaymentlength = float(repaymentlength) #working out interest rate decimal number interestcalculation = interestrate / 100 print(interestrate) print(interestcalculation) #working out number of payments on course of loan period. numberofpayments = repaymentlength*12 #formul

iphone - iOS jailbreak: simple alert is not getting displayed in `applicationDidFinishLaunching` -

i newbie jailbreak tweak development.now want alert dialog when springboard loaded first time. tweak.mx %hook springboard -(void)applicationdidfinishlaunching:(id)application { %orig; uialertview *alert = [[uialertview alloc] initwithtitle:@"welcome" message:@"hello akash " delegate:nil cancelbuttontitle:@"thanx" otherbuttontitles:nil]; [alert show]; [alert release] } %end makefile include theos/makefiles/common.mk archs = armv7 armv7s arm64 test_frameworks= uikit tweak_name = test test_files = tweak.xm include $(theos_make_path)/tweak.mk after-install:: install.exec "killall -9 springboard" so here compile tweak properly,and iphone getting respring.so @ point should alert,but not getting on screen.what step missing i using iphone 5s ios 7.1.2 edit i see console output logs below error <error>: ms:error: dlopen(/library/mobilesubstrate/dynamiclibraries/test.dylib, 9): no suitable ima

sockets - Java multiple connection to server in dynamic ports -

i need have udp server allow me receive/send informations from/to clients dynamically open socket free port (so it differente device , device ). client send , receive in same port, server must able communicate it. how set server stay open in every port? if had 250 thousand users how handle them without tails problem , preventing port occupied client? i thought open every port different sockets in different thread, don't know if correct way. a udp server can listen , open on 1 port. clients can send data port. server have handle each data , respond if needed peer sent data. should happen if more 1 client wish send data server. in udp context 1 client not hog server port.(unless application badly written).

boost - c++ Bridge pattern and smart pointer -

i use bridge 1 class, , life create std::vector of std::vector of bridge. whilst vector of bridge working. for example : std::vector<bridge> lbridge(5) the vector of vector not working. example : std::vector<std::vector<bridge>> lbridge(5,std::vector<bridge>(4)) when create vector of vector, goes constructor bridge(const bridge & original), , original null... this code : bridge.h #ifndef bridge_h #define bridge_h #pragma once #include <myobject.h> #include <boost/make_shared.hpp> class bridge{ public : bridge(const bridge & original); bridge(const myobject & innerobject); bridge(){}; bridge& operator=(const ibridge& original); private : boost::shared_ptr<myobject> mmyobjectptr; }; #endif bridge.cpp #include<bridge.h> bridge::bridge(constbridge& inoriginal){ mmyobjectptr = inoriginal.mmyobjectptr->clone(); } bridge::bridge(const myobject& ininnerobjec

ace editor - How to build a mode in ace? -

i've create mode using http://ace.c9.io/tool/mode_creator.html what process build useable file existing version of ace? seems maybe have pass code through sort of build step output such https://github.com/ajaxorg/ace-builds/blob/master/src/mode-golang.js ... i got work: checked out ace github made bosun.js contained sort of loading boilerplate - based on d example. placed might highlight rules in bosun_highlight_rules.js. ran node ./makefile.dryice.js -nc build ace , , copied resulting bosun.js (which has embedded various requirements) ace directory in project. built file ends in /build/src-noconflict/mode-bosun.js . bosun.js (pre build, in /lib/ace/mode of repo: define(function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var textmode = require("./text").mode; var bosunhighlightrules = require("./bosun_highlight_rules").bosunhighlightrules; var mode = function() { this.highlight

Android: Send Longitude ans Latitiude after 60 seconds to the localhost server(WAMP) -

i want send longitude, latitude, timestamp , stonest wifi access point json format server (wamp- localhost) after every 60 seconds best approach that? use asynctask asynctasks should ideally used short operations (a few seconds @ most.) can give short example sending data approach asynctask? i appreciate help. start these tutorials http://www.tutorialspoint.com/android/android_php_mysql.htm http://www.tutorialspoint.com/android/android_php_mysql.htm after here how repeate every 60 seconds boolean run=true; handler mhandler = new handler();//sorry forgot add ... ... public void timer() { new thread(new runnable() { @override public void run() { while (run) { try { thread.sleep(60000);//60000 milliseconds 60 seconds mhandler.post(new runnable() { @override public void run() {

XStream get parent object in converter -

for local converter, when marshalling xml, there way access parent object ? i need marshall collection items third-party source - using id stored in parent object. alas, there seem no way query object path leading current object. or there ? i found solution little bit reflaction: import java.io.inputstream; import java.lang.reflect.field; import java.util.list; import java.util.map; import org.junit.test; import org.springframework.util.reflectionutils; import com.thoughtworks.xstream.xstream; import com.thoughtworks.xstream.annotations.xstreamalias; import com.thoughtworks.xstream.annotations.xstreamasattribute; import com.thoughtworks.xstream.converters.converter; import com.thoughtworks.xstream.converters.marshallingcontext; import com.thoughtworks.xstream.converters.unmarshallingcontext; import com.thoughtworks.xstream.core.abstractreferenceunmarshaller; import com.thoughtworks.xstream.io.hierarchicalstreamreader; import com.thoughtworks.xstream.io.hierarchical

c - Is it okay to delete a POSIX timer in the event handler function? -

the question if call create_timer sigev_thread constant stored in sigev_notify field in sigevent structure, when timer event happens, sigev_notify_function callback called. are there hidden implications or undesirable side-effects calling timer_delete from within callback function ? specific concerns my initial thought should fine. however, don't understand mechanics operating behind scenes, , i'm concerned there being proper cleanup of callback's thread , handling of signals if timer , it's associated structures removed before handling complete. background another user asked this question , says, "do need delete timers after calling timer_create ? answer resounding yes . asked follow-up question in comments: "is okay timer callback function?" , didn't have answer that. it looks in principle not allowed call timer_create or timer_delete , @ least on linux. signal(7) allowing async-signal-safe functions called directly

html - @-moz-document not working -

in end, want firefox , chrome display same way. on chrome i've noticed float: left breaks site works on ff. however, if put float:none chrome displays broken on ff. i have tried @-moz-document url-prefix() {.attempt{float:left}} appears not working. i've tried @document url() {.attempt{float:left}} doesn't either. any appreciated. <style> @-moz-document url-prefix() { .attempt { float:left } } .attempt { float:none } </style> <div class="attempt">sometext</div> also it has been asked before no answer. on surface seem because @-moz-document appears before float:none rule — overridden regardless. presence of conditional at-rule not change how cascade works; common gotcha @media rules , applies @-moz-document . you want move bottom override previous rule in firefox: <style> .attempt { float:none } @-moz-document url-prefix() { .attempt { float:left } }

java - PostMethod/HttpClient -

i need make http post request below url url parameters along xml. trying below code , not able proper response back. url - https://mytest.com?z=123&b=abc&c=%10 xml - <test> <data> test xml </data> </test> public string getresponse(string xml) { httpclient client = new httpclient(); string url="https://mytest.com"; postmethod pmethod = new pmethod(url); pmethod.addparameter("z","123"); pmethod.addparameter("b","abc"); pmethod.addparameter("c","%10"); post.setrequestentity(new stringrequestentity(xml, "application/xml", "utf-8")); client.executemethod(pmethod); } please elaborate kind of response expecting? if facing problem in sending xml string given url may send xml string through post method in java you.

expression - Account Balance For Invoice Purposes Access 2010 -

i have created new transactions table (tbltransactions) can log [debits] ( i.e. invoices ) , [credits] ( i.e.payments ). can run query an expression current account balance. however, invoicing purposes, if pulled current account balance described above, wouldn't 'previous account balance' value want display customer on invoice, because it's showing value includes current invoice amount. want customer see previous balance prior to invoice. my current solution uses expressions in query calculate 'previous account balance', don't know if done way. suggestions on how done better? i couldn't post picture of query b/c don't have enough reputation points. invoice fields i'm trying populate: invoice amount previous account balance (prior invoice) final invoice amount below calculations used in query invoice amount: debit previous account balance: format([account credits]-[account debits],"currency") final invoice am

api - in REST what method to use for the sync operation -

synchronizing data once user gets online involves both insert , update ( upsert ) , i'm sending both kinds of records in single request ( array ) , server iterates through records determine insert or update. my question whether use post or put ? also how response server (json) should in it's body? data sent array, example { "ids" : "15,16,17", "success" : true } edit: and should response code, has both create , update operations: 200 ok 201 created rest not crud. mapping http methods crud operations convention introduced frameworks, has nothing rest. read this answer clarification on that. a put complete replacement ignores current state of resource. think of mv command in shell. if there's nothing on destination, creates it. if there's something, replaces completely, ignoring whatever in there. that's how put should work. ideally, application should have uniform implementation of put works in exac

css3 - CSS Transform scale - image still takes up space -

when following css property added image, image still occupies same space did when sized @ 100%? there way make text fill space around image? transform: scale(0.2); height: auto; float: right; that's not how transform works understand it. changes apperance visually ; actual dimensions of original object maintained. you have adjust width/height of image rather use transform. jsfiddle demo of differences div { background: red; overflow: hidden; margin-bottom: 25px; width: 40%; float: left; margin: 2%; } img { float: right; display: block; transition: 0.5s ease; max-width: 50%; } .trans:hover img { transform: scale(0.5); } .dimen:hover img { max-width: 25%; } <div class="trans"> <img src="http://lorempixel.com/400/200/sports/1/" alt="" /> <p> lorem ipsum dolor sit amet, consectetur adipisicing elit. voluptas sequi fugit quis ipsam veniam dicta sint aliquid m

Meteor & Mongo: addToSet inserting -

i have documents in base: //example docs {"_id": "qwerty12345", "name": "bob", "cards":["cardid1", "cardid2", "cardid3"]} i'm using inserting data: template.insert.events({ 'click add': function(){ if(confirm("add card?")); mycollection.update({_id: session.get('fooid')}, { $addtoset: { cards: this._id}}) } }); then i'm using helper template: template.index.helpers({ cards: function(){ query = mycollection.findone({_id: session.get('fooid')}); return query.cards; } }); and in template: <img src="{{img}}" class="add"> {{#each cards}} {{this}}<br> {{/each}} this works perfecty, have trouble: as see, every image have id , url({{image}}), i'm need add image url 'mycollection' every card(on click). how make it? and second problem: how allow mongo insert du

How to use multiple versions of a python module on single machine -

on single machine, how can/should 2 versions of single python module used (a) simultaneously on same machine, (b) under single user, and (c) without installing external programs (cant reliably install external stuff on windows work computer, sadly), (d) having same name (to allow no pains when upgrading ( $ git pull newversion ) ) a production version of code project running constantly. on same machine, test/development version of code running periodically. how can both use own specific version of given module? version a: #!/usr/bin/python34 #c:\\myproject\\testversion\\bin\\myprogram.py import mymodule ## version in c:\\myproject\\testversion\\lib\\python mymodule.do_stuff() # do_stuff version version b: #!/usr/bin/python34 #c:\\myproject\\productionversion\\bin\\myprogram.py import mymodule ## version in c:\\myproject\\productionversion\\lib\\python mymodule.do_stuff() ## do_stuff version b strictly using pythonpath environment variable pick same mymodule b

oracle - Update of nested table -

i have following objects , nested tables set serveroutput on declare contador pls_integer; begin select count(*) contador user_objects object_name=upper('matriculación'); if contador = 1 execute immediate 'drop table matriculación'; end if; select count(*) contador user_objects object_name=upper('matrícula'); if contador = 1 execute immediate 'drop table matrícula'; end if; select count(*) contador user_objects object_name=upper('alumnoobj'); if contador = 1 execute immediate 'drop type alumnoobj'; end if; select count(*) contador user_objects object_name=upper('tablatitulación'); if contador = 1 execute immediate 'drop type tablatitulación'; end if; select count(*) contador user_objects object_name=upper('titulaciónobj'); if contador = 1 execute immediate 'drop type titulaciónobj'; end if; select count(*) contador user_objects object_name=upper(&

Docker Registry 2.0 - how to delete unused images? -

we updated our private docker registry official registry 2.0. version can delete docker images identified hashtag (see https://docs.docker.com/registry/spec/api/#deleting-an-image ) still don't see way cleanup old images. as our ci server continously producing new images, need method delete images private registry no longer identified named tag. if there's no built-in way achieve this, think custom script possibly work, don't see v2 api method either list stored hashtags of image.. how can keep private registry clean? hints? this doable, although ugly. need running (i think) registry 2.3 or greater, , have enabled deleting ( registry_storage_delete_enabled=true env var or equivalent). example commands below assume local filestore in /srv/docker-registry , i'd surprised if equivalent couldn't cooked other storage backends. for each repository wish tidy up, need enumerate digest references no longer required. easiest way per-tag, using latest

properties - Show Skip, Take, OrderBy in ServiceStack metadata page -

in of services using servicestack autoquery greater simplify data access. helpful. when looking @ metadata page correctly shows data operations available not show default iquery ones skip, take, orderby, , orderbydesc. these show since query operations. tried several things not figure out. i thought autoquery ignore properties solution, not sure still don't show. var autoquery = new autoqueryfeature() { orderbyprimarykeyonpagedquery = true }; autoquery.ignoreproperties.remove("skip"); autoquery.ignoreproperties.remove("take"); autoquery.ignoreproperties.remove("orderby"); autoquery.ignoreproperties.remove("orderbydesc"); plugins.add(autoquery); the metadata pages have been modified show definitions of built-in servicestack types querybase in metadata pages in commit . this change available v4.0.41+ of servicestack that's available on myget .

spring - How to make @Cacheable return null when not found in cache but do not cache the result? -

following @cacheable annotation @cacheable(value="books", key="#isbn") public book findbook(isbn isbn, boolean checkwarehouse, boolean includeused) looks in cache based on key if found return result cache if not found evaluates method updates cache return result so next time method called same arguments fetched cache. what want instead to look in cache based on key if found return result cache if not found return null i don't want update cache in case of cache-miss, there way using spring annotation here ended with, trick use 'unless' our advantage @cacheable(value="books", key="#isbn", unless = "#result == null") public book findbookfromcache(isbn isbn, boolean checkwarehouse, boolean includeused) { return null; } this method looks in cache based on key if found return result cache if not found evaluates method return null return value matched unless condition (which return t

javascript - Clear dropdown selection when search input is entered -

trying create proof of concept using angular right now. have working plunker if choose option dropdown display list of items $http.get( ) . have search input well, , when enter text want able make it's own $http.get( ) call , display data in same list list above. having trouble getting work together. want user able either select dropdown or search, not both. here html: <html> <head> <script data-require="angular.js@1.4.0-rc.0" data-semver="1.4.0-rc.0" src="https://code.angularjs.org/1.4.0-rc.0/angular.js"></script> <link rel="stylesheet" href="style.css" /> <script src="script.js"></script> </head> <body ng-app="myapp" ng-controller="mainctrl"> <h1>hello plunker!</h1> <div> <select ng-options="post post.id post in allposts" ng-model="selectpost" ng-change="select()">

scala - ScalaJS enumeration -

i trying use enums angularjs-toaster class toaster extends js.object{ // see https://github.com/jirikavi/angularjs- toaster/blob/master/toaster.js#l58 def pop(`type` : toastertype,title : string,body:string) : unit = js.native } with enum this object toastertype extends enumeration{ type toastertype = value val success = value("success") ... } and calling like toaster.pop(toastertype.success, "some title", "text") when toaster popped there no title or text. when use string type on pop definition , pass `"success" works expected. (i used http://www.scala-js.org/doc/semantics.html , https://github.com/scala-js/scala-js/issues/38 . thought above should work, no?) scala enumeration s not string s, should not work. have use string , thing javascript string .

Magento OnePage modification, need to skip a step -

i new magento , using version 1.4 currently. steps on onepage checkout are: checkout method (guest or sign-in) billing information shipping information delivery information payment information order review i want skip delivery information. have done 2 things: 1. changed (actually extended) core checkout class not include #4 delivery information ( 'shipping_information' ), 2. in controller, call checkout class method saveshippingmethodaction( ) inside of saveshippingaction( ) (since there never submission of shipping method user), data value passed manually. everything works expected, , step skipped, inside checkout::saveshippingmethodaction( ) there these 2 lines: mage::dispatchevent('checkout_controller_onepage_save_shipping_method', array('request'=>$this->getrequest(), 'quote'=>$this->getonepage()->getquote())); $this->getresponse()->setbody(mage::helper('core')->jsonencode($result)); the problem

Stripe Checkout, charge redirected to http://website/create_payment and the payment is not recorded in Stripe. What steps am I missing? -

i have embedded stripe checkout code on site, @ checkout, site redirected website/create_payment , payment not recorded in stripe. steps missing? here code used stripe documentation: <form action="/create_payment" method="post"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key= data-image="/square-image.png" data-name="demo site" data-description="2 widgets ($00.00)" data-amount="0000" data-currency="usd" data-alipay-reusable="true" data-locale="auto" data-alipay="auto"> </script> </form>

javascript - how to pass number of hits count based on button action in php -

we developing web sit. have button.in button action placed pdf file downloading.working fine.but need how count download pdf file website. we tried not get. <?php //$down=$_get['down']; $a="hello"; $i=0; ?> <script type="text/javascript"> var i=0; function submitform() { <?php $i = @file_get_contents('count.txt'); // read hit count file echo $i; // display hit count $i++; // increment hit count 1 @file_put_contents('count.txt', $i); // store new hit count ?> } </script> <html> <head> </head> <body> <input type="button" onclick="submitform()" value="submit 1" /> </body> </html> we got nothing .we new php please guide us. well, can download pdf , count @ form submit: <?php $i=0; $i = (int) @file_get_contents('count.txt'); // read hit count file i

c - bruteforce-code is not running -

i tried code litle bruteforce programm. cant compile it. easy programmcode think , thats reason why bug me hard didnt compile. searched solutions couldnt strike bonanza... `1 #include <stdio.h> 2 #include <string.h> 3 char pass; 4 strcpy(pass,"m"); 5 int pass_test(int argc, char *argv[]){ 6 char s_pass[2]; 7 argv[0] = s_pass; 8 if (s_pass == pass){ 9 printf("=================\n==access gained==\n================="); 10 } 11 else{ 12 printf("sth. went wrong"); 13 } 14 } 15 int main(){ 16 char solved_pass[2]; 17 char *op_abc; 18 int i, p, z; 19 strcpy(op_abc, "abcdefghijklmnopqrstuvwxyz"); 20 if ((strlen(pass)) == 1){ 21 for(i=0;i < strlen(op_abc);i++){ 22 pass_test(op_abc[i]); 23 } 24 } 25 if (strlen(pass) == 2){ 26

change tick labels in sunflower plot in R -

Image
say have following data a <- c(1,1,1,2,2,3,3,4,4,4) b <- c("a","b","a","c","c","a","c","d","c","a") x <- data.frame(a,b) sunflowerplot(x$b ~ x$a, main = "sunflower plot", xlab = "type a", ylab = "type b", size = 0.25, cex.lab = 1.5, mgp = c(2.5,1,0)) then referring link want change vertical ticks factors of b with refernce website axis , text editing how 1 use code change labels axis(2, at=null, labels=c("a", "b", "c", "d")) use yaxt argument suppress y-axis in sunflowerplot() . see ?par : yaxt a character specifies y axis type. specifying "n" suppresses plotting. sunflowerplot(x$b ~ x$a, main = "sunflower plot", xlab = "type a", ylab = &qu

c++ - Incorrect report descriptor and report data structure? -

i working on hid report descriptor using modifying sample code here: https://code.msdn.microsoft.com/wudfvhidmini-sample-b304f83a/sourcecode?fileid=42918&pathid=205101617 (the link opens queue.cpp file of read/write code driver , default hid report descriptor). updated report descriptor have far in driver (as of 5/11/2015): hid_report_descriptor g_defaultreportdescriptor[] = { 0x06, 0x00,0xff, // (global) usage_page 0xff00 vendor-defined 0x09, 0x01, // (local) usage 0xff000001 0xa1, 0x01, //(main) collection 0x01 application (usage=0xff000001: page=vendor-defined, usage=, type=) 0x85, 0x0f, // (global) report_id 0x0f (15) 0x09, 0x01, // (local) usage 0xff000001 0x15, 0x00, // (global) logical_minimum 0x00 (0) <-- redundant: logical_minimum 0 0x26, 0xff,0x00, // (global) logical_maximum 0x00ff (255) 0x75, 0x08, //(global) report_size 0x08