Posts

goangular - GoInstant: Match a single array element with $goQuery? -

is possible yet query key array value single array element goinstant goangular? example, if querying list of items following keys/properties, can select items belong single user? item: { name: 'item name', description: 'a longer description of item , details', category: 'business', user_ids: [1,3,7,15] //this array of user id's because items //have many-to-many relationship users } i tried query not return anything: var queryresults = $goquery('items', { user_ids: 1 }, { limit: 10 }).$sync(); i believe proper syntax according mongodb documentation , i'm not sure if goinstant has implemented operator yet. appreciated. this should work expect, it's bug! stay tuned, i'll update answer once it's been fixed.

c# - Speech Recognition is not available on this system. SAPI and Speech Recognition engines cannot be found -

good day! try write simple speech text engine use speech sdk 11. try execute test example . so , create console app , run code. (with task) task speechrecognizer = new task(dowork); speechrecognizer.start(); speechrecognizer.wait(); static void dowork() { // create new speechrecognitionengine instance. speechrecognitionengine sre = new speechrecognitionengine(); // configure input recognizer. sre.setinputtowavefile(@"c:\test\colors.wav"); // create simple grammar recognizes "red", "green", or "blue". choices colors = new choices(); colors.add(new string[] { "red", "green", "blue" }); // create grammarbuilder object , append choices object. grammarbuilder gb = new grammarbuilder(); gb.append(colors); // create grammar instance , load speech recognition engine. grammar g = new grammar(gb);...

Scala Custom Data Structures & Optimization -

am new scala... wondering how create / design data structure supports these features: • constructor takes used size: datasize: int • accessor method: def get(key: k): option[v] • setter / put "data structure" method: def put(key: k, value: v): unit • bigo(1) of used keys; bigo(datasize) = bigo(1) • bigo(log n) of key • bigo(log n) put of key any advice beneficial... use scala.collection.mutable.map .

JMeter: Can each User in Thread Group run multiple HTTP Sampler? -

i need send 40k http requests server @ same time. repeat scenario every 15mins. now, in jmeter cannot spawn 40k users. right now, able spawn 500 users in thread group. thinking if can keep user count 500 , make each user execute 80 http samplers, job done! but don't know how achieve this. can please guide me here? thanks! http request being executed thread. if able 500 threads @ time load limited these 500 concurrent threads. there following options available: switch i.e. tsung tool more optimized multi-threading , less memory-consuming jmeter. consider jmeter remote testing when on jmeter master engine orchestrates multiple slaves produce combined load take jmeter load testing cloud offerings

methods - How to take input from user in C#? -

i have following program. using system; public class myeventhandler { private int x; private int y; public myeventhandler(int a, int b) { x = a; y = b; } public myeventhandler() { } public int add() { return x + y; } public int sub() { return x - y; } } public class test { public static void main() { int a, b; console.writeline("enter first number"); = convert.toint32(console.readline()); console.writeline("enetr second no"); b = convert.toint32(console.readline()); myeventhandler mh = new myeventhandler(a,b); int z = mh.add(); console.writeline("you enetered {0} , {1} sum {}", a, b,z); console.readkey(); //console.writeline("the sum of {0} , {1} {2}", a, b, mh.add()); //console.readkey(); } } when run program, stops working after t...

java - Android Studio generating stub for a class not included in the Android Wear Support Library -

i'm not sure if i'm going crazy or what, android studio 0.8.0 generates mobile + wear app, subclasses watchactivity mainactivity of watch itself. fine , dandy, class not exist. what developers supposed do? ones available, according javadocs, android.support.wearable.activity.insetactivity , android.support.wearable.activity.confirmationactivity. auto-generated activity template has been changed in android studio 0.8.1. watchactivity has been removed , activity class extends activity. try update android studio , recreate app again.

java - Override Thread.sleep() -

we have few classes extends base class. noticed use quit few sleeps method , wanted log when sleep occurs. there way override thread.sleep method in can add custom logic ( ie logging) , call actual thread.sleep()? way wouldn't have change places thread.sleep being used in bases classes. i'm open other options well. you cannot override thread.sleep method, cannot instrument or transform either it's native method. 1 way automatically add logging places call thread.sleep using java agent. while following approach works , quite fun, in case it's better refactor calls thread.sleep separate method , add logging there. you can find introduction java agents here . in nutshell it's special mechanism allows (among other) transformation of loaded java byte code. following example of java agent class automatically enhances calls thread.sleep system.out logging , measure time spent in method: package fi.schafer.agent; import javassist.cannotcompileexception...