Posts

Showing posts from April, 2014

javascript - Zingchart last element keeps changing color and not matching with legend -

my zingchart's last element's color not match legend, , keeps on changing unlike others. ideas? else works good. though i'm parsing data through mysql database, how javascript looks like. my code: <script> var mydata = ["12","15","7","20","2","22","10","7","7","10","8","15","9"]; var mydata = mydata.map(parsefloat); var mylabels = ["general verbal insults","general beatings\/pushing","terrorizing\/threatening remarks","false gossip inflation (rumors)","discrimination","rough fighting","sexual utterance\/assaults","general exclusion","theft","racist utterance\/assaults","personal property damage","internet related (cyber)","other\/unspecified"]; window.onload=function(){ var color

java - Failed to resolve dependencies on Grails -

i installed grails 2.5.0. anytime try run it, displays following message: resolve error obtaining dependencies: failed resolve dependencies (set log level 'warn' in buildconfig.groovy more information): cglib:cglib-nodep:2.2.2 and run dependency - report: :::::::::::::::::::::::::::::::::::::::::::::: :: unresolved dependencies :: :::::::::::::::::::::::::::::::::::::::::::::: :: cglib#cglib-nodep;2.2.2: not found :::::::::::::::::::::::::::::::::::::::::::::: | obtaining dependency data.... | error error executing script dependencyreport: : java.lang.illegalstateexception: report file '/home/mballeng91/.grails/ivy-cache/org.grails.internal-mballeng91-build.xml' not exist. (use --stacktrace see full trace) thanks help. im tryng develop interesting app community. best, miguel angel ballen use version 2.5.4 (and in general use latest patch version available avoid discovering lots of

javascript - AWS Lambda Duration vs Function run time -

i noticed duration vs function run time issue in cloud watch log nodejs lambda function. using serverless plugin deploy/code functions. this lambda function code: module.exports.handler = function (event, context, cb) { console.time("function_run_time"); myfunction(function (callback) { console.timeend("function_run_time"); return cb(null, callback) }); }; in cloud watch logs im getting following 2016-05-25t00:18:58.881z 45cd0785-ccce-11e6-818f-cb61404e173c function_run_time: 477ms report requestid: 45cd0785-ccce-11e6-818f-cb61404e173c duration: 1866ms billed duration: 1900 ms memory size: 1024 mb max memory used: 39 mb i wondering why function run time @ 477ms duration @ 1866ms. is there in code need call end lamdba function earlier? thanks check if have code running after calling callback see here: aws lambda by default, callback wait until node.js runtime event loop empty before freezing proce

javascript - Node.js chat app with username variables not working -

i'm making chat app in node.js based on tutorial socket.io. purpose user enter in username , message. chat display "username: message". username text field disappear after first entry. have working except chat displaying message username. chat displays 4 messages instead of one, both variables undefined. js var app = require('express')(); var http = require('http').server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendfile(__dirname + '/index.html'); }); io.on('connection', function(socket){ console.log('a user connected'); socket.on('disconnect', function(){ console.log('user disconnected'); }); }); io.on('connection', function(socket){ socket.on('chat message', function(msg, usn){ io.emit('chat message', msg); io.emit('chat message', usn); }); }); http.listen(3000, function(){ console.log('

database - What situations is RethinkDB ill-suited to? -

rethink says in faq: "rethinkdb not choice if need full acid support or strong schema enforcement—in case better off using relational database such mysql or postgresql." https://rethinkdb.com/faq/ one example of "full acid support" multi-document transactions (important in eg financial systems), else include? in ways rethinkdb not acid?

c++ - Why does using my print method with std::cout result in an error? -

#include <iostream> using namespace std; class fam { public: char you, urmom, urdad; void addperson(char y, char m, char f) { = y; urmom = m; urdad = f; } }; class tree: public fam { public: void showfamtree() { cout<< "name: " << << endl; cout<< "mother's name: " << urmom <<endl; cout<< "father's name: " << urdad <<endl; } }; int main(void) { tree tree; char a,b,c; cin >> a; cin >> b; cin >> c; tree.addperson(a,b,c); cout<< "family tree: " << tree.showfamtree() <<endl; return 0; } i wanted print family tree person's name, mother's name, father's name when compile it, following error: invalid operands binary expression ( basic_ostream<char, s

highcharts - present halo animation in Highmap -

i'm digging highcharts/highmaps now. need help. occasion is: when server give me lat/lon information, present halo animation according lat/lon. problem animation. desired animation this /*css*/ body { background-color: black; } #circle-1 { display: block; width: 40px; height: 40px; border-radius: 40px; opacity: 0; animation-name: scale; animation-duration: 3s; animation-iteration-count: infinite; animation-timing-function: linear; } @keyframes scale { 0% { transform: scale(0.1); opacity: 0; box-shadow: 0px 0px 50px rgba(255, 255, 255, 0.5); } 50% { transform: scale(0.5); opacity: 1; box-shadow: 0px 0px 20px rgba(255, 255, 255, 0.5); } 100% { transform: scale(1); opacity: 0; box-shadow: 0px 0px 20px rgba(255, 255, 255, 0); } } //js var renderer; $(function () { renderer = new highcharts.renderer( $('#container')[0], 400, 300 )

Submit form to php page and carry over POST data to redirect page -

i have found general info on question nothing seems answer exact question. i have form on .php page, when submitted post's inputs php page, sends form inputs email , redirects php page using (location: page.php) so: form.php --> email.php (hidden) --redirect--> submitted.php i have input form.php carried on hidden input box on submitted.php i hope makes sense, in advance help! edit: on submitted.php have single hidden form input. need value of input equal 1 of inputs form.php. post input php page (not seen above) send email. simply, put sending email code in submitted.php code , using sessions prevent user duplicating input pressing f5 or refreshing submitted.php follows: in form.php session_start(); $_session['submit'] = true; in submited.php session_start(); if (isset($_session['submit']) && $_session['submit']){ /* * code */ $_session['submit'] = false; } else{ echo 'some error'; }

android - Converting base64 into bitmap and loading into recycler view -

i'm trying convert base64 image bitmap image , load using picasso library recycler view. however, error whenever run code saying need pass in uri picasso method. public string getimage(){ context context =null; byte[] decodedstring = base64.decode(image, base64.url_safe); bitmap decodedbyte = bitmapfactory.decodebytearray(decodedstring, 0, decodedstring.length); bytearrayoutputstream bytes = new bytearrayoutputstream(); decodedbyte.compress(bitmap.compressformat.png, 100, bytes); path = mediastore.images.media.insertimage(context.getcontentresolver(), decodedbyte, null, null); return uri.parse(path); } dataadapter: picasso.with(context).load(data.get(i).getimage()).into(holder.reportimage); once have downloaded , decoded bitmap, there no point of using image loading library. of benefits (request queue , cache) lost. can use holder.reportimage.setimagebitmap(bmp); another approach write custom req

Why does && in Ruby sometimes shortcut evaluates and sometimes doesnt? -

i want test if element in hash exists , if >= 0, put true or false array: boolean_array << input['amount'] && input['amount'] >= 0 this raises no >= on nilclass error. however, if this: input['amount'] && input['amount'] >= 0 #=> false no problem. basically: false && (puts 'what heck?') #=> false arr = [] arr << false && (puts 'what heck?') #=> stdout: 'what heck?' arr #=> [false] what gives? currently it's being grouped as: (boolean_array << input['amount']) && input['amount'] >= 0 try: boolean_array << (input['amount'] && input['amount'] >= 0) however, if ends being false, expression returns nil , want: boolean_array << (!input['amount'].nil? && input['amount'] >= 0)

javascript - p styling not showing up. Typed out one by one -

i have simple html page. using typed.js jquery plugin make text typed out. problem none of text in p tags stylized when outputted. text in p tags printed out 1 one. typed out @ 1 go. not sure how fix these issues. <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <style type="text/css" media="all"> center { position: relative; margin-top: 10%; line-height: 20px; } p { /*font-family: monaco, monospace; */ font-family: 'lucida console', monospace; font-size: 1.2em; color:#00ff00; } </style> <title>personal website</title> </head> <body bgcolor=""> <center> <div id="typed-strings"> <p>some text </p> <p>this more text.</p>

c# - Perform logout in Sharepoint 2010 Login Control -

i trying customize login control public partial class logincontrol : usercontrol in sharepoint 2010 application getting error message after login control performs loggedin event: system.argumentexception: eine ausnahme vom typ "system.argumentexception" wurde ausgelöst. parametername: encodedvalue bei microsoft.sharepoint.administration.claims.spclaimencodingmanager.decodeclaimfromformssuffix(string encodedvalue) bei microsoft.sharepoint.administration.claims.spclaimprovidermanager.getprovideruserkey(string encodedidentityclaimsuffix) bei microsoft.sharepoint.applicationruntime.spheadermanager.addisapiheaders(httpcontext context, string encodedurl, namevaluecollection headers) bei microsoft.sharepoint.applicationruntime.sprequestmodule.prerequestexecuteapphandler(object osender, eventargs ea) bei system.web.httpapplication.synceventexecutionstep.system.web.httpapplication.iexecutionstep.execute() bei system.web.httpapplication.executestep(iex

How to execute a python script from django management commands? -

i'm trying execute python script not inside django project directory... example management class call command: i need run root because needs access gpio pins on raspberry pi. (and error) (env) sudo python manage.py bubbles which calls script: execfile('/home/pi/rpi/bubbles.py') # /home/pi/djangoprojects/raspberrypi/graphics/management/commands django.core.management.base import basecommand, commanderror django.core.management.base import basecommand graphics.models import graphic class command(basecommand): = "my test command" def handle(self, *args, **options): execfile('/home/pi/rpi/bubbles.py') i error traceback (most recent call last): file "manage.py", line 8, in <module> django.core.management import execute_from_command_line importerror: no module named django.core.management so i'm guessing problem virtual environment, there no way execute script outside scope of virtual environment? t

escaping - How to escape double and single quotes in YAML within the same string -

i need escape single , double quotes in ansible playbook in order set environment variable. none of works: - name: set environment variable command: > export extra_config=“'”{"client": {"subscriptions": ["dind-worker"], "cluster": "internal"}}“'” - name: set environment variable command: > export extra_config=''{"client": {"subscriptions": ["dind-worker"], "cluster": "internal"}}'' - name: set environment variable command: > export extra_config=''{\"client\": {\"subscriptions\": [\"dind-worker\"], \"cluster\": \"internal\"}}'' looked @ this: http://yaml.org/spec/current.html#id2532720 https://github.com/dotmaster/toyaml/issues/1 the error message is: fatal: [ip.address]: failed! => {"changed": false, "cmd": "e

javascript - Difference between UTC, GMT and Daylight saving time in JS -

i read lot of post , little confused utc, gmt , daylight saving time. anyone can explain javascript date() object utc, gmt , daylight saving time. the main point want know is, when work date, need think or not daylight saving time. and calculation of utc,gmt , daylight saving time same or not in different kind of programming languages. utc standard, gmt time zone. utc uses same offset gmt, i.e. +00:00. interchangeable when discussing offsets. all javascript (ecmascript) date objects use time value utc milliseconds since 1970-01-01t00:00:00z. when date constructor called without arguments, gets time , time zone offset host system , calculates time value. therefore, accuracy of generated date depends on accuracy of components. when outputting date values using utc methods (e.g. getutchours, getutcminutes, etc.), vaules utc (gmt). when not using methods (e.g. gethours, getminutes, etc.) host system time zone offset used time value generate "local" value

javascript - Subdomain pointing to a php file but have JS No 'Access-Control-Allow-Origin' -

i have following line .htaccess rewriteengine on rewritecond %{http_host} !^www\. rewritecond %{http_host} ^(.*)\.domain\.com rewriterule ^(.*)$ index-merchant.php?id=%1 [l,nc,qsa] 1) enter abc.domain.com point domain.com/index-merchant.php?id=abc 2) js gives error - response preflight request doesn't pass access control check: no 'access-control-allow-origin' header present on requested resource 3) research on similar case on stackoverflow , other website solutions gotten did not solve problem. i tried placing header add access-control-allow-origin: "*" on .htaccess file no luck. please enlighten me on issue , should place code at.

mysql - How to choose a table that have the table name : "group"? -

i have table. name of table "group" i run query : select * group there exist error : error code: 1064 have error in sql syntax; check manual corresponds mysql server version right syntax use near 'group limit 0, 1000' @ line 1 any solution solve problem? thank you use backquote : select * `group` you can alias table name later use in where clause instance: select * `group` g g.id = 1

Why my OPcache configuration in php.ini doesn't take effect? -

Image
i configued opcache in php.ini zend_extension=opcache.so opcache.memory_consumption=256 i sure zend_extension=opcache.so took effect because when comment out, opcache infomation no longer appears in phpinfo page. but strange thing is, opcache.memory_consumption=256 i found parameter remains default value 64mb in phpinfo page: could tell me did miss ? =====more info=================== php version : 5.6.9 server : nginx php-fpm os: centos

ios - how to call a method by using nstimer in background state -

i want fetch service every 15 mins,so using nstimer.it working fine.but how call same service while app in background state using nstimer.nstimer not working in background state.please suggest me. //when application move active inactive state. - (void)applicationwillresignactive:(uiapplication *)application { [self sendbackgroundlocationtoserver]; } - (void) sendbackgroundlocationtoserver { uibackgroundtaskidentifier bgtask = uibackgroundtaskinvalid; bgtask = [[uiapplication sharedapplication] beginbackgroundtaskwithexpirationhandler:^{ [[uiapplication sharedapplication] endbackgroundtask:bgtask]; }]; //start timer [self starttimer]; //close task if (bgtask != uibackgroundtaskinvalid) { [[uiapplication sharedapplication] endbackgroundtask:bgtask]; } }

MobileFirst: How to pass parameters to adaptor using angularJS -

i using angularjs in mobile first , getting error parameter values not recevied adaptor need know how pass parameters in function(function($scope.username, $scope.password)) & parameter(parameters : [$scope.username, $scope.password]) variable using $scope or without $scope app.controller('logincontroller',function($scope){ $scope.login = function($scope.username, $scope.password){ $scope.usernametxt = angular.element('#usrname').val(); $scope.passwordtxt = angular.element('#pass').val(); console.log($scope.username, $scope.password); $scope.username = $scope.usernametxt; $scope.password =$scope.passwordtxt; $scope.loginprocedure = { procedure : 'login', adaptor : 'sql', parameters : [$scope.username, $scope.password] }; wl.client.invokeprocedure($scope.loginprocedure,{ onsuccess : $scope.loginsuccess,

optimization - C++: Fastest way to initialize class object to 0 -

let's have object initialize 0 in constructor. every bit instanced object occupies should 0 without exception, including non-pod members, ignoring personal default constructors completely. is possible in c++? , if so, there way can done @ least fast initializing each member 0 through initialization list (when allowed)? (there's obvious pitfalls i'm curious; please assume have not-awful reason!) there no "magic" syntax achieves this. if class has no virtual table, use memset(this, 0, sizeof(* this)) , not recommended. you try play offsetof pinpoint address of first member, , erase there on. bit better memset ing whole thing, still making me uncomfortable: // example non-pod type. class b { public: b() : b(0xdeadbeef) {} int b; }; class monstrosity { public: monstrosity() { size_t offset = offsetof(monstrosity, a); uint8_t *erasestart = (uint8_t *)this + offset; memset(erasestart, 0, sizeof(monstros

php - Predis \ Connection \ ConnectionException -

Image
i trying run laravel shop menu project on local machin in xampp. when try run show me below error. please me solve problem. have attached screen shot more clearification. thanks in advance: error: predis \ connection \ connectionexception php_network_getaddresses: getaddrinfo failed: no such host known. [tcp://tunnel.pagodabox.com:6379] open: c:\xampp\htdocs\laravel\laravel-shop-menu\vendor\predis\predis\lib\predis\connection\abstractconnection.php * helper method handle connection errors. * * @param string $message error message. * @param int $code error code. */ protected function onconnectionerror($message, $code = null) { communicationexception::handle(new connectionexception($this, "$message [{$this->parameters->scheme}://{$this->getidentifier()}]", $code)); } the issue tunnel.pagodabox.com not have valid corresponding dns entry in associated nameservers, therefore it's unable resolve

node.js - Making request to uber sandbox api not changing anything -

i'm using uber api make requests sandbox. specifically, i'm using node-uber library here: https://github.com/shernshiou/node-uber when try set surge multiplier, using following code snippet: uber.products.setsurgemultiplierbyid('90475b1e-382e-437f-a50f-d9ac28c150c8', 2.2, function (err, res) { if (err) console.error("error" + err); else console.log("surge success" + res); }); and make request: uber.requests.create({ "start_latitude": lat, "start_longitude": longitude, }, function (err, res) { if (err) console.error(err); else console.log(res); }); i see in response surge multiplier still 1.0 what doing wrong? , also, uber sandbox supposed hold state between put request sandbox , request call uber? how save state me? based on auth token? thanks! i don't think you're doing wrong! sandbox mode supposed keep track of "state change" (request status, product status). ap

gradle - com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml -

i creating 1 app uses restapi fetch data , , operation using retrofit 2 , okhttp3 , jackson parsing json object , app use firebase cloud messaging when compile code gives me following error & can't able run it error:execution failed task ':app:transformresourceswithmergejavaresfordebug'. com.android.build.api.transform.transformexception: com.android.builder.packaging.duplicatefileexception: duplicate files copied in apk meta-inf/maven/com.fasterxml.jackson.core/jackson-databind/pom.xml file1: /users/silent/work/silentinfotech/dooreye/app/libs/jackson-databind-2.7.2.jar file2: /users/silent/.gradle/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.2.2/3c8f6018eaa72d43b261181e801e6f8676c16ef6/jackson-databind-2.2.2.jar i using android studio 2.1.1 , os x ei capitan 10.11.2 some library added in projects libs folder converter-jackson-2.0.2.jar jackson-annotations-2.7.0.jar jackson-core-2.7.2.jar jackson-datab

qt - Unable to use QFileSystemModel along custom QSortFilterProxy -

i'm new qt , trying hide directories in qtreeview . i'm trying hide folders based on names using custom qsortfilterproxy named cachefilterproxy . i setup tree view way: filemodel = qtgui.qfilesystemmodel() rootindex = filemodel.setrootpath(rootdir) filemodel.setfilter(qtcore.qdir.dirs | qtcore.qdir.nodotanddotdot) filemodel.setnamefilters([patternstring]) model = cachefilterproxy() model.setsourcemodel(filemodel) self.filetreeview.setmodel(model) self.filetreeview.setrootindex(model.mapfromsource(rootindex)) self.filetreeview.clicked.connect(self.selectedfilechanged) and then, in self.selectedfilechanged try extract filename , filepath of selected item in tree view. name of file retrieved, retrieving file path causes whole program stop working , quit. def selectedfilechanged(self, index): filemodel = self.filetreeview.model().sourcemodel() indexitem = self.filetreeview.model().index(index.row(), 0, index.parent()) # works normal filename = filemode

android - How to use seek bar in each row of recyclerview -

i have situation need show seekbar in every row of recylerview download media(audio). file downlaoding everytime click downlaod button , last seekbar of recylerview work not seekbar associated particular row. this adapter downloading audio public class listentestadapter extends recyclerview.adapter<listentestadapter.myviewholder> implements adapterview.onitemclicklistener, view.onclicklistener, view.ontouchlistener, mediaplayer.oncompletionlistener, mediaplayer.onbufferingupdatelistener { private static final int download_thread_pool_size = 1; private final handler handler = new handler(); public textview testnametextview, downloadtextview, seekbartextview; mydownloaddownloadstatuslistenerv1 mydownloadstatuslistener = new mydownloaddownloadstatuslistenerv1(); int downloadid1; private list<listen> list = new arraylist<>(); private activity context; private mediaplayer mediaplayer; private seekbar seekbarprogress; private

MySql table have two or more columns have default date vaule CURRENT_TIMESTAMP,any Solutions? -

if have table 2 columns create_time , update_time,the data type timestamp,then have default value current_timestamp,the sql code of created table is: create table `t_activity` ( `id` int(11) not null auto_increment, `startdate` timestamp not null default current_timestamp, `enddate` timestamp not null default current_timestamp, primary key (`id`) ); but prompt error:1293,there can 1 timestamp column current_timestamp in default or update clause. i not sure you're trying accomplish having both startdate , enddate populated current_timestamp. fix code try changing data types datetime this: **create table `t_activity` ( `id` int(11) not null auto_increment, `startdate` datetime not null default current_timestamp, `enddate` datetime not null default current_timestamp, primary key (`id`) );** http://dev.mysql.com/doc/relnotes/mysql/5.6/en/news-5-6-5.html

mongodb - Meteor does not display collection that exists in db -

a meteor/react noob here, going through meteor-react tutorial , got stuck on step 3. problem data not being displayed in browser, although exists in db. here imports/ui/app.jsx: import react, { component, proptypes } 'react'; import { createcontainer } 'meteor/react-meteor-data'; import { tasks } '../api/tasks.js'; import task './task.jsx'; class app extends component { rendertasks() { return this.props.tasks.map((task) => ( <task key={task._id} task={task} /> )); } render() { return ( <div classname="container"> <header> <h1>todo list</h1> </header> <ul> {this.rendertasks()} </ul> </div> ); } } app.proptypes = { tasks: proptypes.array.isrequired, }; export default createcontainer(() => { return { tasks: tasks.find({}).fetch(), }; }, app); no errors show in console.

uitableview - How to use Asychronous task inside for loop in swift -

i using google map in project. calculating place distance current location nd showing tableview. there multiple places , want show in tableview. each place , distance current location need call google distancematrix api. able store places cordinate inside array , looping through array calling distance martix api. here code func calculatedistance(type : string) { let currentlocationcordinate = "\(usercurrentlocation.coordinate.latitude),\(usercurrentlocation.coordinate.longitude)" var url = string() var remoteurl = nsurl() var request = nsurlrequest() var session = nsurlsession() var locatioarrayindex = 0 //locationarray stores cordinate of nearby array locatioarrayindex in 0...locationarray.count-1 { placecordinationarray = "\(locationarray[locatioarrayindex].coordinate.latitude),\(locationarray[locatioarrayindex].coordinate.longitude)" url = "https:

AngularJS controller test failing with RequireJS -

my jasmine test (using karma) throws error : argument 'saleslistcontroller' not function, got undefined after searching lot question seems close error, unit test not e2e scenario test. my test-main.js (function (window, require) { 'use strict'; var file, requiremodules; requiremodules = []; (file in window.__karma__.files) { if (window.__karma__.files.hasownproperty(file)) { // console.log('loaded file'+ file); if (file.substring(file.length - 26, file.length) === 'saleslistcontrollertest.js') { console.log('added file testing..'); requiremodules.push(file); } } } //requiremodules.push('appmodule'); //requiremodules.push('mocks'); deps: requiremodules, require({ baseurl: '', paths:{ 'angular': '/base/app/bower_components/angular/angular', 'angularresource': '/base/app/bower_components/angular-resource/ang

model - Django app structutre and circular reference -

i'm trying keep project organized, try keep splitted apps. assume blog app blogpost model. add tag app, has tag model foreign key post. if want write method get_tags() , in blog class, circular reference. bad design? maybe should not write such method on blog, or such related models should in same app? i'm trying learn how organize (big) project. i've read lot django app concept, stil haven't found right way the point here django automatically creates reverse lookup when create foreignkey or manytomanyfield. assuming models follows: blogpost model from django.db import models class blogpost(models.model): title = models.charfield(_('title'), max_length=200) slug = models.slugfield(_('slug'), unique_for_date='publish') author = models.foreignkey(user, blank=true, null=true) body = models.textfield(_('body'), ) publish = models.datetimefield(_('publish'), default=datetime.datetime.now)

python - Iterating over a file omitting lines based on condition efficiently -

ahoi. tasked improve performance of bit.ly's data_hacks' sample.py, practice excercise. i have cythonized part of code. , included pcg random generator, has far improved performance 20 seconds (down 72s), optimizing print output (by using basic c function, instead of python's write() ). this has worked well, aside these fix-ups, i'd optimized loop itself. the basic function, seen in bit.ly's sample.py : def run(sample_rate): input_stream = sys.stdin line in input_stream: if random.randint(1,100) <= sample_rate: sys.stdout.write(line) my implementation: cdef int take_sample(float sample_rate): cdef unsigned int floor = 1 cdef unsigned int top = 100 if pcg32_random() % 100 <= sample_rate: return 1 else: return 0 def run(float sample_rate, file): cdef char* line open(file, 'rb') f: line in f: if take_sample(sample_rate): out(line) w

windows - Unchecked DBA administrative role in root@localhost in mySQL 5.5 -

Image
trying beef security on mysql 5.5 database unchecked drop , create privileges , dba, dbmanager , dbdesigner roles in users , privileges window. this has made impossible edit database , restore backup .sql file. i have tried reinstate privileges , receive message below: how can undo

php - Can debug in port :80 but not :9999, etc... (Xdebug & PhpStorm) -

Image
so, i've spent whooole day trying set up, yet haven't been able to. my current workflow: apache server (xampp) listens ports 80 (default xampp webpage) , 9999, 9998, etc virtual servers custom document roots. so, accessing same ip different port returns different project. i develop in 1 machine locally. use utilize dhcp provided ip address. type 192.198.1.xxx whenever refering device instead of localhost. avoid firewall issues turned windows firewall off. my today's configuration xdebug work: phpstorm php7 interpreter - ok xampp matching xdebug installation (dll file, php.ini configs) - ok phpstorm xdebug port - ok phpstorm run/debug configurations - did 2 configurations, 1 server xxx.xxx.xxx.xxx:80, server xxx.xxx.xxx.xxx:9999, same ip different ports. phpstorm web server debug validation - ok result: debug session *80 successful, page loads in browser , stops execution ide debugging... if try debug *:9999 application executes begin end, doesn't

WiX service don't start: service failed to start verify that you have sufficient privileges -

i have java application. have made scansol-agent-app.exe file need make installer wix. below there code of scansol-agent.wxs file. need install app windows service. servise installs well, don't starts. windows shows me error: “service failed start - verify have sufficient privileges start system services” tried variants find, no results. how can start service? <?xml version="1.0"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <product id="*" upgradecode="{eb6b8302-c06e-4bec-adac-932c68a3a98d}" name="scansol agent application service" version="0.0.1" manufacturer="sciencesoft" language="1033"> <package installerversion="200" compressed="yes" comments="windows installer package" manufacturer="sciencesoft"/> <media id="1" cabi

swing - How to get colour, font of java table row/cell/text with Jemmy? -

Image
need check colour/font style of java table (text, background) in swing application cause style of row should depend on column value. it possible colour of font , background of selected (cell/row): maintable.selectcell(0, 0); string bgcol = maintable.getselectionbackground().tostring(); // => javax.swing.plaf.coloruiresource[r=51,g=153,b=255] string fgcol = maintable.getselectionforeground().tostring(); // => javax.swing.plaf.coloruiresource[r=255,g=255,b=255] but selected cell/row has own style of selection, check becomes quite useless. what way accomplish style checking of cell/row (not selected) jemmy library? a renderer used paint each cell in table. should able access component used render cell code like: tablecellrenderer renderer = table.getcellrenderer(row, column); component c = table.preparerenderer(renderer, row, column); system.out.println(c.getbackground());

maven - Eclipse server location using workspace metadata, can't change to installation -

i want eclipse deploy application tomcat installation folder's webapps when add server in eclipse, reason eclipse seems use it's internal server instance under .metadata/.plugins , thought added server manually , provided installation directory. after added server runtime project facets , enabled dynamic web module . when add application server under server tab , start server, application doesn't appear in tomcats installation folder nor instance started up. when server configuration tab, can see eclipse using workspace metadata server location , doesn't let me change tomcat installation. image http://oi68.tinypic.com/2r70d8y.jpg what causing problem , how solve it? have spent hours 1 no luck. remove modules in server configuration/modules tab. close configuration. right click server in "servers" view , publish it. open configuration again. then must editable.

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

Image
when using devexpress, see error: devexpress.wpf.grid.infinitegridsizeexception unhandled message="by default, infinite grid height not allowed since grid rows rendered , hence grid work slowly. fix issue, should place grid container give finite height grid, or should manually specify grid's height or maxheight. note can avoid exception setting gridcontrol.allowinfinitegridsize static property true, in case grid run slowly." the problem dxgrid has infinite height. to fix, set height non-infinite. snoop absolutely invaluable this: if "height" xaml element infinite (i.e. 0 or nan ), can set using one of following: option 1: height="{binding path=actualheight, relativesource={relativesource mode=findancestor, ancestortype=uielement}}" option 2: verticalalignment="stretch" option 3: height="auto" hint: use verticalalignment="stretch" if child of grid <rowdefinition height=

c# - how do i call a click event from a string -

here problem. string btn = "btn7"; //this problem. btnclone.click += this.controles[btn]_click ; so use string share event other button , string must. i hope can me. a more standard way find control id button b = (button)findcontrol(btn); you search if don't know id button oldbutt = this.controls.oftype<button>().(b => b.name == btn).first();

mysql - Select Items that don't have matching Items in another table -

tables _________________________ _________________________ |__________items__________| |_______readstatus________| |___itemid___|____data____| |___itemid___|___status___| | 1 | cats | | 1 | 1 | | 2 | dogs | | 2 | 1 | | 3 | fish | | | | ------------------------- ------------------------- i have 2 mysql tables similar shown above. need entries item table don't have corresponding status 1 in readstatus table. in example need entry data fish . i'm not familiar sql i'm not sure how based on other questions i've come this: select * items inner join readstatus on items.itemid = readstatus.itemid readstatus.status != 1 this not work though because skips entries in items table don't have matching entry in readstatus table. adding status 0 entries search isn't option because create millions

node.js - Is there a way to know from which file a function is called in nodejs? -

this question has answer here: nodejs: filename of caller function 5 answers i'm writing module logger , want add prefix each time function dlog() being called filename of file calling function. right have call each time this: dlog(__filename + " log text"); is there way detect name of file calling function without this? from nodejs: filename of caller function : function _getcallerfile() { try { var err = new error(); var callerfile; var currentfile; error.preparestacktrace = function (err, stack) { return stack; }; currentfile = err.stack.shift().getfilename(); while (err.stack.length) { callerfile = err.stack.shift().getfilename(); if(currentfile !== callerfile) return callerfile; } } catch (err) {} return undefined; }

php - get next auto_increament value without insertion -

i have table this | id | name | | 1 | alaa | | 2 | mohd | and on. id auto increament value. if delete second row table this | id | name | | 1 | alaa | but auto_increament next value 3. now need, need next auto increament value codeigniter. don't tell me use $this->db->insert_id(); there no insertion i need value without insertion. you can grab information_schema see example below, replace tablename , databasename actual values. select auto_increment information_schema.tables table_name = 'tablename' , table_schema = 'databasename' note: make sure table have auto_increment column, otherwise null.

php - Parms were split on blanks -

call php ibm server zendserver sent few parms php script. on 1 of our machines parms split on blanks ? why ? in doublequotes ?? call pgm(qp2shell) + parm('/usr/local/zendsvr/bin/php-cli' + '/www/zendsvr/htdocs/test/t1.php' + 'hallo test' + 'p2' + 'p3') in php args array contains [0] => /www/zendsvr/htdocs/idsmail/t1.php5 [1] => hallo [2] => test [3] => p2 [4] => p3 on other machines same program works fine ?? any ideas ? bye jogi if example looks cl code, you've got many + signs. in source code, cl commands terminate @ end of line. if command continues onto line indicate + symbol. in context not meant concatenation operator (which || ). spaces suffice separate parameters. you don't need + signs on 4th line, seen arithmetic operators. should solve prob

matlab - how to convert from type logical to matrice -

function matb = mbin_init n=6; p=4; sm=1; while(sm>0) matbin=rand(p,n)>=0.5; sv = sum(matbin,2)==0; sm = sum(sv); end matb.matbin = matbin ; end this function create random binary matrices of size(p,n). have created other search if there colomn of zeros in matrix1 @ position p, if yes matrix2 take column of zeros in same position p. function [ matb1 ] = replace( ) matbin1 = mbin_init(); matbin2 = mbin_init(); indexcolonnenulle = 0; i=1:4 if sum(matbin1(:,i)) == 0 indexcolonnenulle = i; end end if(indexcolonnenulle > 0) matbin2(:,indexcolonnenulle) = 0; end matb1.matbin2 = matbin2; end an error appear when executing these functions!! undefined function 'sum' input arguments of type 'struct'. error in replace (line 6) if sum(matbin1(:,i)) == 0 what have please?? thanks

automation - Selenium Grid Support - launch multiple browser windows from same machine -

we know selenium grid supporting parallel testing different machines. my objective launch multiple browser windows same machine , launch tests same machine parallel. possible selenium grid? guide me here, please? regards, -kranti yes, can , can specify how many windows want run @ once on given computer. done through -browser parameter: java -jar selenium-server-standalone-2.42.0.jar -role node -browser browsername=firefox,maxinstances=3 -hub http://localhost:4444/grid/register the above parameter allows node run 3 instances of firefox browser @ once. later on, computer open 3 different instances of firefox , run tests. worked in setup.

html - Laggy CSS animation -

i'm trying size container on site using css3-animation. this container: .new-place-wrapper { background: #004682; display: inline-block; margin-top: 70px; animation-name: newplace; animation-duration: 1s; animation-fill-mode: forwards; animation-delay: 3s; animation-timing-function: linear; max-height: 0px; padding: 0px 20px; overflow: hidden; position: relative; z-index: 8888; } @keyframes newplace { 0% { max-height: 0px; padding: 0px 20px; } 100% { max-height: 9999px; padding: 20px 20px; } } <div class="new-place-wrapper" data-equalizer> <div class="new-place-close"><i class="fa fa-times"></i></div> <div class="inner-place-left" data-equalizer-watch> <span>wir sind umgezogen!</span> ab sofort finden sie uns hier: <address> <strong>company</strong><br>