Posts

Showing posts from September, 2014

Recommended way to run a Docker Compose stack in production? -

i have couple of compose files (docker-compose.yml) describing simple django application (five containers, 3 images). i want run stack in production - have whole stack begin on boot, , containers restart or recreated if crash. there aren't volumes care , containers won't hold important state , can recycled @ will. i haven't found information on using docker-compose in production in such way. the documentation helpful doesn't mention starting on boot, , using amazon linux don't (currently) have access docker machine. i'm used using supervisord babysit processes , ensure start on boot up, don't think way docker containers, end being supervised docker daemon? as simple start thinking put restart: always on services , make init script docker-compose -d on boot. there recommended way manage docker-compose stack in production in robust way? edit: i'm looking 'simple' way run equivalent of docker-compose up container stack in robust way.

vba - Saving embedded OLE Object (Excel doc) to file in Excel 2010 vs 2013 -

i trying save embedded ole object (excel doc) current/open workbook location on users pc. ole object template/dashboard gets populated during execution of macro. goal of portion of macro first test if file exists on users c drive. if exist, opens file , sets workbook variable newly opened document. far can tell, works flawlessly between both excel 2010 , excel 2013. in case user not have file saved c drive, macro needs open ole object , save drive. once complete, macro points location , opens file. the below code works 100% in excel 2013, in excel 2010, macro crashes excel whenever try save file drive. if run macro in break mode, saving works fine, during run-time in cause crash. there possible use of doevents or application.wait here? i'm bit unfamiliar technicalities of saving documents , computer resources. some things i've noticed: the crash not generate error code. gives "has stopped responding" i've tried multiple versions of .saveas fileformat:=

hyperlink - Linking article pages on joomla that do not exist as a menu item -

how link article page on joomla without being published menu item? have tried using id number, not work. for example, within 1 of our published pages want link article page page not exist menu item- there not url use. please provide step-by-step instructions. if prefer not have create urls manually can try switching editor joomla uses default (tinymce). find jce editor more useful. can generate links menu items, content or contacts 'insert/edit link' modal popup. has more robust image manager. jce editor can installed 'install web' tab of extension manager install page.

how to add sum of values in datagrid with grouping WPF c# -

hello i'm weary beginning in coding , first serious application. have data grid grouping , want add in each group sum of values column make https://leeontech.files.wordpress.com/2010/02/final.png i have try use many solutions internet nothing work me: my xml <datagrid x:name="gridraport" canuseraddrows="false" verticalalignment="stretch" minwidth="500" alternatingrowbackground="lightblue" alternationcount="2" margin="20,20,20,20"> <datagrid.groupstyle> <groupstyle> <groupstyle.containerstyle> <style targettype="{x:type groupitem}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type

php - List Directories in Json File -

i can list images folder in json using code below: <?php $dir = "images/friday/"; $images = glob($dir."*.jpg"); foreach($images $image){ $registro = array( "file" => $image ); $retorno[] = $registro; } $retorno = json_encode($retorno); echo $retorno; ?> i think work directories nothing displayed if don´t use print_r($dirs). <?php $path = "images"; $dirs = glob($path . "/*", glob_onlydir); foreach($dirs $dir){ $reg = array( "folder" => $dir ); $return[] = $reg; } $return = json_encode($return); echo $return; ?> echo $return not display anything. there simple workaround or have build function ? need "folder" identifier.

copy Function constructor in Javascript -

i'd substitute function constructor fn that function hello(){ console.log("hello") } will give same result as fn lazyhi(){ console.log("i'm lazy function!") } i'm interested test own understanding of javascript inheritance patterns, i'm not sure can done @ "root" level. you cannot replace "function" keyword own "fn" keyword. syntax error.

java - What are good reasons for using Camel XML routes? -

the camel java dsl provides type-safety, code completion , proper support refactoring. helps modularize , (unit-)test code in great manner. speaking camel xml syntax see advantage of being able modify , reload routes @ runtime (e.g. via hawtio ). obviously i'm missing here - rationale behind use of camel xml routes today? in-place editing of routes (although discourage doing that) quick&dirty one-off routes (e.g. routing test qa environment) or simple projects - when have container karaf or servicemix. no need fire ide/compile. write , drop deploy folder. maybe easier non-developers it matter of taste , preference.

testing - Jmeter thread per url -

Image
i have 1 project test load balancers algorithms web cluster , decide use jmeter stuck since not experienced , on internet see different cases , scenarios not detailed described (steps hot achieve them). in test environment have 5 generic websites (web1.com, web2.com, web3.com, web4.com , web5.com). test cases want perform are: case1: linear , proportional web load - other words want check web1 5 times in row web1 , web2 5x, web1,web2, web3 5x, then, web1-4 5x , on end 5 websites 5x. see how computer recurses , web nodes perform in proportional load. far know should done 5 different threads cant define url per website or time when start load other websites well. have tried dataset (cvs) can achieve parallel website check because in cvs can add 1 website under list... case2: in case set own "random numbers" example send website check in "random order": web2,web2,web5,web1,web3,web4,web1,web1 ... reason because want simulate "real case" other word

ios - How to add UIView as header view for UICollectionViewController -

i have uicollectionviewcontroller trying add uiview header view collectionview. current attempt not displaying uiview after amount of time of following multitude of guides. hoping can point me in right direction. my current approach: set height of supplemental view , register viewdidload(){ collectionview.registerclassforsupplementaryview(typeof(collectionheader), uicollectionelementkindsection.header, "headerview"); uicollectionviewflowlayout layout = new uicollectionviewflowlayout(); layout.headerreferencesize = setheader(this).frame.size; //setheader returns uiview collectionview.setcollectionviewlayout(layout, true); } gets supplemental view public override uicollectionreusableview getviewforsupplementaryelement(uicollectionview collectionview, nsstring elementkind, nsindexpath indexpath) { collectionheader headerview = (collectionheader)collectionview.dequeuereusablesupplementaryview(uicollectionelementkindsection.header, "headerview&q

python - Is there a way to append data to a hdfs file using Pydoop? -

i trying write contents of object file in hdfs using python. this, have found hdfs api implemented in python named pydoop. reading api, can use dump() method of pydoop write contents file in hdfs path have not seen method append() append new content old file. know possible have found command line syntax hdfs thinking of using pydoop doing this. appreciated. thanks haven't used pydoop, reads python api appending regular file. from pydoop import hdfs hdfs.open('/path/to/file', 'a') f: f.write('bla')

c# - How to define DataGrid ComboBox column that shows choice of color rectangles from RGB values? -

i managed define column shows available color index (int) values in combobox. instead of color index should show rectangle filled color defined color's rgb-values. xaml: <datagrid name="selectionsets" canuseraddrows="false" canuserresizecolumns="true" canusersortcolumns="true" itemssource="{binding selectionsets}" autogeneratecolumns="false" scrollviewer.cancontentscroll="true" scrollviewer.verticalscrollbarvisibility="visible" selecteditem="{binding selectedselectionset}"> <datagrid.columns> <datagridcomboboxcolumn header="{staticresource xpstrcolor}" selectedvaluebinding="{binding colorindex}" selectedvaluepath="index" displaymemberpath="index"> <datagridcomboboxcolumn.elementstyle> <style targ

tfs - SonarQube MSBuild integration failed - using MSBuild definition for building .Net Application -

this first blog or query. new tfs admin role , sonarqube tool. we using tfs 2013 alm in our project, project based on .net application (new .net well). as per client requirement, trying integrate "sonarqube 5.2" customized build process template instead of default template. i installed "sonarqube 5.2" on "abc server" , "tfs server/build agent" on "xyz". installed sonarqube scanner msbuild 2.1 on xyz server , updated environment variables & sonarqube runner xml accordingly. as per standard link not using default template:- http://docs.sonarqube.org/display/scan/from+team+foundation+server+2013 , using customized build template, hadn't have pre/post build argument options. so edited in customized build process template, added hooks pre/post build scripts activities , updated properties similar mentioned link :- http://www.colinsalmcorner.com/post/build-script-hooks-for-tfs-2012-builds note: per above link, didn’

How do I solve my first python program -

this question has answer here: how can read inputs integers? 14 answers i rookie in programing, needs codes! i can't run following program correctly, type error want know why doesn't work. thank in advance! def main(): celsius = input("celsius: ") farhrenheit = (celsius * ( 9/5 ) + 32) print (farhrenheit) main() it pomps out this: typeerror: can't multiply sequence non-int of type 'float' add float function. celsius = float(input("celsius: "))

python - TypeError: str object is not an iterator -

i have file consisting of words, 1 word on each line. file looks this: aaa bob fff err ddd fff err i want count frequency of pair of words occur 1 after other. for example, aaa,bob: 1 bob,fff:1 fff,err:2 and on. have tried this f=open(file,'r') content=f.readlines() f.close() dic={} it=iter(content) line in content: print line, next(line); dic.update({[line,next(line)]: 1}) i got error: typeerror: str object not iterator i tried using iterator: it=iter(content) x in it: print x, next(x); got same error again. please help! you need keep track of previous line, file object returns own iterator don't need iter or readlines @ all, call next once @ start creating variable prev keep updating prev in loop: from collections import defaultdict d = defaultdict(int) open("in.txt") f: prev = next(f).strip() line in map(str.strip,f): # python2 use itertools.imap d[prev, line] += 1 prev = line

c# - How should I expose an object orientated library to excel without registering DLLs? -

i'm developing object-oriented c++ library expose functionality of users in excel. ideally use library within excel vb , provide higher-level functions can expose through spreadsheet. i have written c-api c++ library it's awkward use objects require explicit create/dispose calls. using c-api, have constructed python api create/dispose calls handled python classes. python api can used build higher level functions , expose them user through ipython notebook. ipython notebook can configured load python modules , specify path on dll loaded without admin rights: import sys sys.path.insert(0,notebook_directory) import mylib mylib.config_library_path(notebook_directory) #used dll loading ctypes this means can distribute notebook self contained entity. need same excel document , dlls distribute it. i can write c# bindings around c-api in same way did python cannot see how c# dll loaded excel without global dll registration. i can use c-api create xll , declare function

Ruby on Rails: User helper method to read attribute -

i'm trying use helper method determine value of attribute several records. here basic function trying working (from view): <% if baseline.where(subject_id: sub.subject_id).first.crf_status(crf) == 1 %> <td bgcolor="#98fb98" > <% else %> my helper function crf_status(crf) , , looks this: application_helper.rb def crf_status(crf) case crf when baseline 'baseline_status' when followup3week 'follow_up_3_week' ... end end so working example if crf_status(baseline) return: <% if baseline.where(subject_id: sub.subject_id).first.baseline_status == 1 %> <td bgcolor="#98fb98" > <% else %> right now, error 'undefined method 'crf_status' baseline'. based on i've read, perhaps have reference applicationhelper in each controller? doesn't sound right. please let me know think. thanks. edit. forgot make more clear: crf_

java - Do not understand how loop is determining how many asterisks to print -

i beginner @ learning java. have stumbled upon problem can not figure out. how loop in code determining how many asterisk print out. keep looking @ part of code.. asterisk < myarray[counter] could please explain in simplest of terms how works, because every time think of counter, see nothing index pointing @ time in loop. public class main { public static void main(string[] args) { int[] myarray = {12, 7, 9, 11, 23}; system.out.println("value distribution"); //start of outer loop for( int counter = 0; counter < myarray.length; counter++){ //start of inner loop for( int asterisk = 0; asterisk < myarray[counter]; asterisk++) system.out.print("*"); system.out.println(); }//end of outer loop simply put asterisk < myarray[counter] means it's checking whether amount of asterisks less value myarray[counter]. so when have counter =

android - Appium - unable to locate elements in view -

android - real device. appium-dotnet-driver v2.0.0.1 c# / vs2015 i have following using uiautomatorviewer, link-image can found here. https://discuss.appium.io/t/cannot-locate-any-elements-in-this-view/12099 i using following command locate relative layout readonlycollection linlayouts = _driver.findelementsbyxpath( "//android.widget.linearlayout[@resource-id='com.mobilaurus.supershuttle:id/content_container']//android.widget.relativelayout"); as cannot seem locate element in view, other views previous , later work using id's , xpath's fine, reason particular view appium cannot locate items/elements - using driver.tap co-ordinates different on several devices not practical i have extended timeout appium applies find request , never comes back.. anyone got ideas why or there way find button @ bottom of screen devices. thanks in advance i recommend using online xpath tester. 1) in appium inspector hit copy xml button 2) use xpath p

symbolic math - Maxima: trigonometric numbers in radical form -

beginner's question maxima: how can obtain trigonometric numbers in radical form? for example, expression evaluates nicely: (%i) cos( 3 * %pi / 4); 1 (%o) - ------- sqrt(2) but 1 not: (%i) cos(3 * %pi / 5); 3 %pi (%o) cos(-----) 5 i expect show this: (%i) cos( 3 * %pi / 5); 1 - sqrt(5) (%o) ----------- 4 see, example, output wolfram alpha: http://www.wolframalpha.com/input/?i=cos%283+pi+%2f+5%29 from maxima documentation piargs , true default: when %piargs true , trigonometric functions simplified algebraic constants when argument integer multiple of %pi , %pi/2 , %pi/3 , %pi/4 , or %pi/6 . from maxima documentation ntrig : the n

Unable to perform functions from Particle iOS Cloud SDK after downloading Xcode 8 / Swift 3.0 -

prior downloading xcode 8 able perform functions particle ios cloud sdk (spark sdk) without problem. now, being given multiple errors similar ones below. sparkcloud.sharedinstance().loginwithuser(username!, password: password!) { (error:nserror?) -> void in // deactivates activity indicator. activityindicator.stopanimating() // reallows interaction events. uiapplication.sharedapplication().endignoringinteractionevents() if error != nil { utils.showalertonvc(self, title: "invalid parameters.", message: "please try again.") self.cleartext() } else { self.performseguewithidentifier("loginuser", sender: self) } } error: cannot convert value of type '(nserror?) -> void' expected argument type 'sparkcompletionblock?' sparkcloud.sharedinstance().getdevices { (sparkdevices: [anyobject]

javascript - How to run user code that might be unsafe? -

i writing program interpret , run user code written in javascript in c#. how go running hard limit in running time? running user code; ever; not safe (see sql injection, obligatory reference xkcd ). there no way make safe (apart sandboxing, @ point aren't running code on computer more). see 10 immutable laws of security ( technet ) that said, use overload of process.waitforexit takes int (msdn) "timeout" , kill process after time period (10s in example): process myveryunsafeproc = new process(); myverunsafeproc.start(); if (!myveryunsafeproc.waitforexit(10000)) { myveryunsafeproc.kill(); } note javascript have killed monitoring process , made whole exercise pointless. did mention can't safely?

c# - PowerShell Crashes On NavigateComplete2 Event Firing -

i've been trying handle ie events shdocvw.internet explorer. added reference c:\windows\system32\shdocvw.dll in visual studio project, when compiled automatically generated interop.shdocvw.dll i unable initialize shdocvw.internetexplorer directly in powershell, more info on issue here powershell version info ps c:\users\chentiangemalc> $psversiontable name value ---- ----- psversion 5.1.14393.103 psedition desktop pscompatibleversions {1.0, 2.0, 3.0, 4.0...} buildversion 10.0.14393.103 clrversion 4.0.30319.42000 wsmanstackversion 3.0 psremotingprotocolversion 2.3 serializationversion 1.1.0.1 current code i'm using [system.reflection.assembly]::loadfrom("c:\support\ieautomator\interop.shdocvw.dll") $code = @' using system; using system.collections.generic; using system.text; pub

angularjs - how to get session or cookie value set in django, php, ruby in angular? -

i trying session and/or cookie value set in django (although don't see being different across other languages php or ruby). i trying value following angular: var app = angular.module('edgefeed', ['ngcookies']); app.controller('feedcontroller', function($http, $cookiestore) { self = this; console.log(sessionstorage.getitem('session_name')); console.log($cookiestore.get('cookie_name')); in console output: null undefined how can session or cookie value in angular?

c# - Is there a way to make DbSet.AddOrUpdate case sensitive? -

i have data set (show below) each record unique on 2 fields when considering case senstivity - var dataset1 = new dataset() { country = "uk", city = "london", ... } var dataset1 = new dataset() { country = "uk", city = "london", ... } on executing dbset.addorupdate () below - database.datasets.addorupdate(ds => new { ds.country, ds.city, }, datalist.toarray()); database.savechanges(); i getting system.invalidoperationexception: sequence contains more 1 element the cause of exception pretty obvious return 2 records when querying city = 'london' question - there way make dbset.addorupdate case sensitive? ps: dataset coming external source cannot tweak persist. instance, change city upper case , ignore duplicates not allowed. you need set database case sensitive. @ moment it's ci (case insensitive).

kubernetes - kubelet FailedSync Error syncing pod, skipping: API error 400 -

i’m running issues while creating container, i’m using ubuntu 16.04 os, docker 1.12.1, flannel 0.5.5, , etcd datastore. sudo systemctl status kubelet.service ● kubelet.service - kubernetes kubelet server loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled) active: active (running) since mon 2016-09-12 14:23:02 edt; 3h 6min ago docs: https://github.com/googlecloudplatform/kubernetes main pid: 15788 (kubelet) tasks: 9 memory: 848.0k cpu: 815ms cgroup: /system.slice/kubelet.service sep 12 17:19:40 vm3-virtualbox kubelet[15788]: w0912 17:19:40.585677 15788 container_manager_linux.go:278] [containermanager] failed ensure state of "/docke sep 12 17:20:40 vm3-virtualbox kubelet[15788]: w0912 17:20:40.615756 15788 container_manager_linux.go:278] [containermanager] failed ensure state of "/docke sep 12 17:21:40 vm3-virtualbox kubelet[15788]: w0912 17:21:40.624172 15788 sep 12 17:23:40 vm3-virtualbox kubelet[15788]: w0912 17:23:40.657396 15788 co

jquery - How to display error message when the user clicks on other tabs instead of the active tabs -

i have 5 tabs out of first tab active tab.on page load when user clicks on other tab rather first tab error message should displayed user using noty plugin should 'first click on first tab' active tab.when user clicks on first tab second tab must enabled not third , fourth,similarly when user clicks on third tab fourth tab must enabled , on till last tab. here code <!doctype html> <html lang="en"> <head> <title>bootstrap case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <sc

javascript - Disable keyup/keydown formatting when using $.number() - jQuery Number Plugin by Custom D -

how can disable keyup/keydown formatting when using $.number()? jquery number plugin custom d https://github.com/customd/jquery-number my code: $( 'input' ).number( true, 2 ); what worked me unbinding 'keyup.format' , 'keydown.format' events element. e.g $( 'input' ).number( true, 2 ).unbind( 'keyup.format' ).unbind( 'keydown.format' ); also, manually format number, .number() plugin instantiated against input element. e.g on blur event ... $( 'input' ).on( 'blur', function() { $(this).val( $(this).val() ); });

ios - Swift - How can I send a notification when AVPlayer gets overridden in the background mode? -

my app continues play music when app in background , hoping send user notification when avplayer gets overridden (e.g. if user uses app on rides it). currently solution use checkintimer sets notification , if app not checkin after x amount of time, notification goes off, if checkin deletes notification , sets one. solution sucks.. any ideas? you need observe audio interruptions : import avfoundation func setup() { nsnotificationcenter.defaultcenter().addobserver(self, selector: #selector(myinterruptionhandler), name: avaudiosessioninterruptionnotification, object: nil) } func myinterruptionhandler(notification: nsnotification) { var info = notification.userinfo! var intvalue: uint = 0 (info[avaudiosessioninterruptiontypekey] as! nsvalue).getvalue(&intvalue) if let type = avaudiosessioninterruptiontype(rawvalue: intvalue) { switch type { case .began: // interruption began case .ended: // int

c++ - Not able to link Crypto++ library in Xcode -

i able set crypto++ library in xcode using instructions on https://www.cryptopp.com/wiki/ios_(xcode) snapshot of built library however, not able figure out way integrate library c++ project. not able find option add library under target dependencies/linked libraries. can guide me on this? after research, did somehow manage integrate library c++ project yesterday. might have helped:- setting library & header search paths. dragging static library command line project & localizing library. i changed architectures universal x86_64 & valid architectures x86_64 of target file under build settings. did trick me.

ios - How do I use self type in a header file in objective c -

this question has answer here: solving circular protocol declarations 1 answer i need define protocol inside class, 1 of method need type of class parameter, how use self type here? code: // myclass.h @protocol delegate - (void)method:(myclass *)myclass; @end @interface myclass : uiview // properties , methods @end it gives error "expected type" indicates myclass not recognized type. use "@class myclass;" @protocol delegate

php - Check if $_POST is empty -

i realize question has been asked multiple times, none have resolved issue me. i want check if values in $_post array empty except 2 (shostfirstname , shostlastname), , throw 400 error if there empty value. way can throw 400 error putting die() command after header command, 400 error no matter if there empty values or not. foreach ($_post $key => $value) { if (empty($value) || !isset($value) && $key != 'shostfirstname' || 'shostlastname') { header("http/1.1 400 bad request"); break; } } isset() return true if variable has been initialised. if have form field name value set username, when form submitted value "set", although there may not data in it. instead, trim() string , test length if("" == trim($_post['username'])){ $username = 'anonymous'; }

api - How to get the most recent posts on Yammer -

i'm trying query yammer api in order search posts hashtag eg. #win , return latest 20 posts. the problem is, " https://api.yammer.com/api/v1/search.json " endpoint returns searches however, they're in seemingly random order , not latest. yammer limits 20 results each time call api, , there may potentially thousands of posts, cannot pull them down , find 20 recent ones myself. anyone have ideas on how latest? could use autocomplete endpoint search id of hastag topic , use returned id pull in documented api? https://developer.yammer.com/docs/messagesabout_topicidjson https://www.yammer.com/api/v1/messages/about_topic/ {{topic_id}}.json

php - URL contain Captal Letters || Does it Decrease Ranking? -

i have designed website in urls contain capital letters eg domian.com//java/introduction-to-java.php . decrease website ranking ? fine or need change complete website url s. if change url s google treat them duplicate because indexed pages in uppercase , current in lowercase . my site new have submitted google 2 days . not have traffic on site , no 1 linking site .i not want old url captal letters. thing worried google indexed site have old urls... in case rename pages , submit google option or not .

python - Stacking arrays in numpy using vstack -

array1.shape gives (180, ) array2.shape gives (180, 1) what's difference between these two? , because of difference i'm unable stack them using np.vstack((array2, array1)) what changes should make array1 shape can stack them up? let's define arrays: >>> x = np.zeros((4, 1)) >>> y = np.zeros((4)) as is, these arrays fail stack: >>> np.vstack((x, y)) traceback (most recent call last): file "<stdin>", line 1, in <module> file "/usr/lib/python3/dist-packages/numpy/core/shape_base.py", line 230, in vstack return _nx.concatenate([atleast_2d(_m) _m in tup], 0) valueerror: input array dimensions except concatenation axis must match however, simple change, stack: >>> np.vstack((x, y[:, none])) array([[ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.], [ 0.]]) alternatively: >>> np.vstack((x[:, 0], y)) array([[ 0., 0.,

php - web page, can check speed each sql running on it -

Image
i have problem site in 1 of page slow. using wampsever 2.5 , apache 2.4.9 , php 5.5.12 , window 7 . want know is. can config when web load? can time speed query running on web page/ or can tell page speed time load on (process on query/js/css/performent code)? we can see on log, it's slow first need check console if website slow because of assets. google pagespeed give recommendations improve that. then if want check what's happen on server side, can trace code excellent tool https://blackfire.io you see how long last each php method. for mysql can enable slow queries http://dev.mysql.com/doc/refman/5.7/en/slow-query-log.html

Node.js Reference Error: Class is not defined -

i writing module exports few functions. created file calls module cant seem file reference class created in module. im not sure im doing wrong. here code. var eventemitter = require('events').eventemitter; var inherits = require('util').inherits; var employeeemitter = function(){} function employeeemitter(data){ eventemitter.call(this); } inherits(employeeemitter, eventemitter); employeeemitter.prototype.lookupbylastname = function(data, lastname) {var lname = _.where(data, {lastname: lastname}); console.log(colors.red('lookup last name: ' + (lastname))); console.log(colors.blue('event lookupbylastname raised! '+ lastname)); console.log(lname); }; employeeemitter.prototype.lookupbyid=function(data, id){ console.log(colors.red('lookup id: ' +id)); console.log(colors.blue('event lookupbyid')); id = _.findwhere(data, {id: id }); console.log(id); }; module.export = employeeemitter; this

ms access 2013 - The Connection String Property Has Not Been Initialized vb.net -

please can tell me why database info not pulling through. fearly new vb , have been trying create project of google stuck on linking db imports system.data.oledb public class myeventdb public shared function getevent(eventid integer) myevent dim myevent new myevent dim connection oledbconnection = myathleteevents.getconnection dim selectstatement string = "select eventid, title, date, fee, location, distance " & "from events " & "where eventid = @eventid" dim selectcommand new oledbcommand(selectstatement, connection) selectcommand.parameters.addwithvalue("@eventid", eventid) try connection.open() dim reader oledbdatareader _ = selectcommand.executereader(commandbehavior.singlerow) if reader.read myevent.eventid = cint(reader("eventid")) myevent.title

How to check if Id is already exist in mysql database using php -

im trying use code not working reason... errorcode: warning: mysql_num_rows() expects parameter 1 resource, line number 27 the code im using: <?php include("db.php"); $lname = $_post['lname']; $fname = $_post['fname']; $mname = $_post['mname']; $adress = $_post['address']; $gender = $_post['gender']; $nationality = $_post['nationality']; $religion = $_post['religion']; $contact = $_post['contact']; $email = $_post['email']; $school = $_post['school']; $year = $_post['year']; $schooladd = $_post['schooladd']; $schoolid = $_post['schoolid']; $database = $school; mysql_select_db("$database", $con); $id = str_replace(' ', '_', $lname.$schoolid); //check if id exist $check = mysql_query("select * wup schoolid = '$schoolid'"); if (mysql_num

amqp - RabbitMQ - Regex Implementation Topic Exchange -

suppose, if have binding key "a.b.*" can use routing keys a.b.1, a.b.2, a.b.3 , a.b.4 , on. i want queue accept messages these routing keys except routing key "a.b.3" . how can implemented? or there way can use regex binding key instead of wildcard characters "*" , "#". no; there's no regex, 2 wildcards. you can use multiple bindings though - have explicitly bind queue a.b.1, a.b.3, a.b.4, then, might use direct exchange.

android studio - Calling IntelliJ plugin from Gradle plugin -

problem : have developed custom gradle plugin. have blocking ui associated take contextual input user during build. hence created swing based ui it. problem approach that, while running gradle build on intellij, if ui ever goes behind intellij window, couldn't figure out way of programatically bringing on top of intellij window. hence thinking of popping intellij based ui iff gradle build of project running on intellij. question : there way call custom intellij plugin's ui gradle task? you can call intellij plugin anywhere, if open socket. grep console plugin that: https://github.com/krasa/grepconsole/tree/master/src/krasa/grepconsole/tail/remotecall

How to get duplicate rows inclusive of first row number in SQL Server? -

i have written below query retrieve duplicate customers using row_number() in sql server. cust_pkid ---------------+ customerid ----------------- + mobileno 1 | a00001 | 9000477444 2 | a00002 | 9000477444 3 | a00003 | 9000477444 query:- select tmp.custid ( select customerid custid, row_number() over(partition mobileno order (select null)) rowno dbo.customers ) tmp tmp.rowno > 1 output:- cust_pkid ---------------+ customerid ----------------- + mobileno 2 | a00002 | 9000477444 3 | a00003 | 9000477444 how can retrieve records including of first rowno record in single select statement? you looking count() over() window function not row_number select tmp.custid ( select customerid custid, count(1) over(pa

lldb type summary provider - SBProcess is invalid -

i wrote lldb type summary provider wstring 16bit wchar on ubuntu 16.04. things work fine if manually following in lldb: (lldb) script import mytypes (lldb) type summary add -f mytypes.wstring_summaryprovider "std::__1::wstring" i tried make things easier auto-loading adding following .lldbinit: script import mytypes type summary add -f mytypes.wstring_summaryprovider "std::__1::wstring" then got failure of "sbprocess invalid" when printing wstring variable. my type summary function has following, believe error encountered: content = lldb.process.readmemory(bufferaddr, bytecount, error) maybe because "process" not assigned yet when type summary added during auto-loading? does know how make auto loading work script? thanks much enrico answered on lldb-dev: http://lists.llvm.org/pipermail/lldb-dev/2016-september/011236.html but following along here: the lldb.process , lldb.thread etc variables meant convenienc

javascript - Get same weekend last year using moment js -

i'm trying same day of year last week can compare analytics. using moment can this var today = new date(); //sunday 4 september 2016 - week 36 var lastyear = new moment(today).subtract(12, 'months').todate(); //friday 4 september 2015 - week 37 what trying same 'sunday' last year, sunday week 36 2015 any idea how this? here's came with: let today = moment(); let lastyear = moment().subtract(1, 'year') .isoweek(today.isoweek()) .isoweekday(today.isoweekday()); it takes today start point, subtracts year, , sets week , weekday ones today. so today (tue sept 13 2016, aka 2016-w37-2 ) last year tue sept 8 2015 (aka 2015-w37-2 ).

php - custom validation error format laravel 5.2 -

i want custom validation json response api. right default error message this {"password":["the password must @ least 6 characters."],"type":["the type field required."]} i want {flag:0,msg:"the password must @ least 6 characters.",data:{"password":["the password must @ least 6 characters."],"type":["the type field required."]}} and want format rest api only. how can achieve it. i found solution. i chnaged parent controller , added formatvalidationerrors method. here is namespace app\http\controllers; use illuminate\foundation\bus\dispatchesjobs; use illuminate\routing\controller basecontroller; use illuminate\foundation\validation\validatesrequests; use illuminate\foundation\auth\access\authorizesrequests; use illuminate\foundation\auth\access\authorizesresources; use illuminate\contracts\validation\validator; class controller extends basecontroller { use authorizesreq