Posts

jQuery throws out a wrong number? -

i'm working on simple roulette wheel using jquery. i can spin wheel using jquery want strange reason jquery code spits out wrong number! here code: jquery code: <script type="text/javascript">//<![cdata[ $(function(){ window.wheeloffortune = { cache: {}, init: function () { console.log('controller init...'); var _this = this; this.cache.wheel = $('.wheel'); this.cache.wheelmarker = $('.marker'); this.cache.wheelspinbtn = $('.wheel'); //mapping backwards wheel spins clockwise //1=win this.cache.wheelmapping = [5,24,16,33,1,20,14,31,9,22,18,29,7,28,12,35,3,26,0,32,15,19,4,21,2,25,17,34,6,27,13,36,11,30,8,23,10].reverse(); this.cache.wheelspinbtn.on('click', function (e) { e.preventdefault(); if (!...

php - PHPUnit error undefined variable -

i'm running phpunit test zf2 application. tried on windows machine (under xampp), , worked fine. when moved virtual ubuntu 14.10 server, keep getting following error every test: undefined variable: services i went /etc/php5/cli/php.ini , set error reporting follows: error_reporting = e_all & ~e_deprecated & ~e_strict & ~e_notice the code tests pointing 1 of module.php files public function onbootstrap(mvcevent $event) { $sharedeventmanager = $event->getapplication() ->geteventmanager() ->getsharedmanager(); $sharedeventmanager->attach('user', 'log-fail', function($event) use ($services) { $username = $event->getparam('username'); $log = $services->get('log'); $log->warn("error logging user [$username]"); }); } it's complaining line $sharedeventmanager->attach('user', 'log-fail', function($event) use ($services) . s...

How to create multiple drop pane on same page using filepicker.io -

basically have table , each rows have image icon want turn drop pane. example code helpful. working example: http://jsfiddle.net/krystiangw/mb4o7kfc/1/ js file: $('td').each(function(e, element){ filepicker.makedroppane( element, { multiple: true, dragenter: function() { $(element).html("drop upload").css({ 'backgroundcolor': "#e0e0e0", 'border': "1px solid #000" }); }, dragleave: function() { $(element).html("drop files here").css({ 'backgroundcolor': "#f6f6f6", 'border': "1px dashed #666" }); }, onsuccess: function(blobs) { $(element).text(json.stringify(blobs)); }, onerror: function(type, message) { $(element).text('('+type+') ...

How to create Firefox Extension to send active tab URL to its Native, similar to chrome native messaging and install it through msi -

i have developed c# win form application , chrome extension native messaging (another c# console app) fetch user's active tab url. have developed msi setup in wix write under registry (hklm/software/wow6432node/google/chrome/extensions , hklm\software\wow6432node\google\chrome\nativemessaginghosts) programmatically , tested installation of chrome extension running setup on different windows 7 machines. publishing extension on chrome web store , shall install extension on several client computers. i want accomplish same mozilla firefox. newbie in field , going through firefox developers guides ( xpcom , js-ctypes etc.) , getting little confused multiple links. it of great if can guide me towards exact solution. please note that, 1) have install extension programmatically through same msi package contains own c# app , chrome extension native app , 2) client machines windows version (xp (optional), 7, 8, server anything). edit: according noitidart's answer, have made...

vb.net - Binding Navigator Navigation Mixed -

i have sdf database setup. problem comes when click movenext button. when keep moving through records goes in order: 23, 24, 25, 32 , 26, 27, 28, 29, 30, 31, 33, 34... , on. supposed 25, 26, 27, 28, 29, 30, 31, 32.. , on right? these numbers auto generated record id incremented every new record when view records in datagridview order good. ideas how can resolve this? update sorry late reply. have been trying create alternative route record navigation goes in order of id number. have created variable cur_navid current records id saved. every time next or previous buttons pressed next record in order displayed. thousands of record method tends bit vague. anyways heres main codes here code for: new record private sub newrecord() if not isediting = true enable_edit() id += 1 me.bindingnavigatoraddnewitem.performclick() cust_nametextbox.clear() contacttextbox.clear() remtextbox.clear() gradetextbox.clear() ...

MongoDb unable to insert documents using Java Driver in sharded env -

when try connect mongo db sharded @ key "state" via jdbc, , insert document, says missing shardkey my shards (2 no, part of individual replica sets) , config servers (1 no, part of replica set)are , running, , can insert document using mongos terminal, cant insert documents using java driver. mongodb version 2.6.5. package dao; import util.instancefactory; import com.mongodb.db; import com.mongodb.mongoclient; import org.apache.log4j.logger; public class mongoconnector { private static mongoconnector mongoconnectorinstance; private db dbconnection; public static db getconnection(string dbname) { mongoconnector.mongoconnectorinstance = instancefactory.instantiateassingleton(mongoconnector.class); if (mongoconnector.mongoconnectorinstance.dbconnection == null) { synchronized (mongoconnector.mongoconnectorinstance) { if (mongoconnector.mongoconnectorinstance.dbconnection == null) { mongoconnector.mongoconnectorinstance.dbconnection = mong...

android - Is this way of fetching data from sqlite correct? -

i using query fetch data sqlite 1 condition working not 2 @ same time. i getting notification no such column exist. string lquery = "select sum(totalcalorie) ltotal fooditem name = ('" + fname + "') , foodtype = 'lunch'"; you might having null values on places checking while calling.. go through code again queries seems write.