Posts

Showing posts from February, 2015

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

java - can i make if's shorter? -

is possible make if statements shorter? example: if (intno == 0 || intno == 4 || intno == 7) could like: if (intno == 0 || 4 || 7) that'll bring error, there that? for integer types , enums, use switch statement instead: switch(intno) { case 0: case 4: case 7: //code here break; } this works strings in java 7+

linux - Single Node Hadoop setup in unbuntu 12.0.04 -

i'm following below steps setup ssh running hadoop in single node, but, how when running sudo apt-get install openssh-server gives me below exception trace, can shed light on this? hduser@ubuntu:~$ sudo apt-get install openssh-server [sudo] password hduser: reading package lists... done building dependency tree reading state information... done package openssh-server not available, referred package. may mean package missing, has been obsoleted, or available source e: package 'openssh-server' has no installation candidate solutions tried: 1 # update , install, no luck sudo apt-get update sudo apt-get install openssh-server 2# ssh, not solution issue, fyi, which ssh gives below info, hduser@ubuntu:~$ info /usr/bin/info whereas, which sshd gives no path, hduser@ubuntu:~$ sshd hduser@ubuntu:~$ 3 # fyi, hduser@ubuntu:~$ ssh localhost ssh: connect host localhost port 22: connection refused hduser@ubuntu:~$ hduser@ubuntu:~$ ssh -vvv l

javascript - Creating custom avatars -

i'm starting project require users able create multiple custom avatars. this, want them able send images in inventory manipulation frame. within frame, users should able move , resize images - double clicking them remove image frame , sending inventory. right of manipulation frame, sortable list dictate z-index of corresponding item item @ top being in of manipulation frame. far, have this: http://jsfiddle.net/thaikhan/e3gd6/10/show/ . the list generates , sortable not affect z-index of image. also, code pretty buggy , images disappear off frame. see jsfiddle here: http://jsfiddle.net/thaikhan/e3gd6/10/ here javascript code: //click frame $('.inventory').on('click', 'img', function () { $(this).resizable({ aspectratio: 1, autohide: true, containment: "parent", minheight: 50, minwidth: 50 }); $(this).parent().appendto(".frame").draggable({ containment: "parent", cursor: "move" })

firefox - Is there a way to run JavaScript code via a shortcut within Firebug? -

is there way (extension or build-in) in firebug create shortcut runs piece of javascript (e.g. function)? for instance, want delete local storage , reload each time press ctrl + y . you (firebug 2.0.1) cannot bind keyboard shortcut javascript code entered within firebug. though @ least have possibility save aliases urls containing scripts described in " how inject javascript snippet via firebug on page load? ". @ least allows store specific functionality , call again later via include() command . there some feature requests targetting easy code snippet execution. may want create new request allowing reference these snippets via shortcut.

javascript - What are the benefits of using ANGULARJS form validation instead of jquery form validation plugin? -

this might weird question. starting use angularjs , have question on form validation using angularjs. my question why use form validation using angularjs if can same using jquery form validation. last 4 years almost, there has been no forms not validate using jquery form validation plugin. want know benefits of using angular js form validation instead of tested jquery form validation i think main benefit ability testing , ease of use. angular approaches form validation declaratively whereas more complex jquery validation done via javascript. angular validation falls in line way html5 elements should validated , believes validation constraints should declared in markup rather in code (which agree). the biggest problem (in opinion) validation in angular while pratice decalare validation rules on element displays data don't believe practice have define validation messages in markup @ same time. <form name="signupfrm" novalidate="novalidate"&

jquery - Draggable into draggable -

i'm looking way drag , drop item item draggable too. html <div id="range"> <span class="test">test</span> <img src="http://1.bp.blogspot.com/_ym3du2sg3r4/tqxjiupb32i/aaaaaaaadcs/kidut36poea/s1600/green-nature-with-sunrise-wallpaper.jpeg" id="background" /> </div> js jquery(document).ready(function() { jquery("#background, span.test").draggable(); }); jsfiddle the problem shown in example when slide block test @ end of background block, blackground block not extend. i'm looking same functionality drag n drop of marker in google maps any idea? thx lot problem in css. should disable overflow:hidden in #range element. css: #range { width:400px; height:400px; border:1px solid black; position: relative; } span.test { position: absolute; left: 20px; top: 20px; padding: 10px; background: white; z-index: 9999; } #backgr

c# - Deserializing Class with 2 non-default constructors -

i've class, trues ser\des objects, given it, using json.net public class jsonserializer { public string serialize(object toserialaze) { return jsonconvert.serializeobject(toserialaze); } public t deserialize<t>(string todeserialaze) { return jsonconvert.deserializeobject<t>(todeserialaze); } } and giving anobject of such class public class isbn { private readonly int _groupcode; private readonly int _publishercode; private readonly int _titlecode; private readonly int _checkcode; private static readonly regex regex = new regex(@"^\s*\d*\s*-\s*\d*\s*-\s*\d*\s*-\s*\d*\s*$"); public isbn(int groupcode, int publishercode, int titlecode, int checkcode) { _groupcode = groupcode; _publishercode = publishercode; _titlecode = titlecode; _checkcode = checkcode; } public isbn(string isbn)

bash - Values in a variable need to be assigned 1:1 like in an array, but not working -

let assume, have varying number of values stored in variable (called my_variable ). first ones i.e.: 12345 67890 ... i go through list of values , assign them 1:1 array-based variable following: my_array[0]=12345 my_array[1]=67890 ... how can achieved? please note: when trying loop fails my_array[0] shows all values (12345, 67890, ...) inside. my bash version: gnu bash, version 3.2.39(1)-release (i486-pc-linux-gnu) my_array=( $my_variable ) will separate values separated spaces my_array beginning index @ 0. you view array values with: ${my_array[0]} ${my_array[1]) etc... viewing values in array @ once with: ${my_array[@]}

WSO2 Auth off Facebook and Windows live -

i've been doing reading on wso2. i've installed identity server , hit bit of brick wall. i'm trying allow users auth via facebook , windows live. assume using oauth this. however, cant seem figure out how or this. could please direct me in right direction. thanks rob yes need use oauth option. wso2 5 supports many third party login providers. need create app on oauth on provider & configure accordingly is. here example how use facebook login via wso2 is. http://prasadtissera.blogspot.com/2014/04/login-with-facebook-for-wso2-identity.html good luck

What is needed to access another user's facebook posts ("App Not Setup") -

i have desktop app uses user access token read me/feed endpoint , can see posts logged in user. if wanted simplify deployment different users need minimise amount of setup/configuration did. is there way access me/feed given userid rather have setup every user developer account , create app it? i have looked @ https://developers.facebook.com/docs/graph-api/using-graph-api/v2.0 , not obvious me how this. what configuration / permissions user in question need activate this. access token should using, , give access posts in same way user access token does. [edit] have looked @ again , problem having when user (who has facebook account not developer) tries login app (which in development mode) following error "app not setup: developers of app have not set app facebook login." in advance

javascript - Jquery .click() not working multiple button -

i want show alertbox on click button more of button id attr , work click on first button not working click on second button. jquery; jquery("#submit").click(function(e){ alert("message"); }); html; (repeat html per message) <div class="reply"> <form id="vivam" method="post" onsubmit="return false;"> <textarea name="reply" placeholder="write reply here"></textarea> <p class="stdformbutton"> <button id="submit" class="btn btn-primary">reply</button> </p> </form> </div> jsfiddle link what solution problem? thank in advance answers. approach 1: ids should unique, use class instead of id. html: <div class="reply"> <form id="vivam" method="post" onsubmit="return false;"> <textarea name="rep

javascript - CRITICAL issue with iOS, CocoonJS and Facebook -

i've published in apple's appstore cocoonjs powered javascript game integrates facebook functions. after creating app facebook, spent weeks testing in cocoonjs launcher, , found following: in ios , user should grant permissions apps tries access facebook through phone's settings -> facebook , list of apps appear. i did cocoonjs launcher , facebook started working expected. however, final app (generated through cloud compiler) has been published in store and, after trying access facebook within app, app says user should grant permission facebook's settings (as did launcher), it doesn't appear @ phone's settings -> facebook (that is, list of apps use facebook , appeared launcher). i've created app in facebook, retrieved id number, put in cocoonjs cloud compiler (both apple , android) and, of course, called "init" function inside game corresponding facebook app code... though worked launcher, doesn't work app, , app alive ,

Why does json4s need a Scala compiler as a runtime dependency -

i've discovered using json4s native <dependency> <groupid>org.json4s</groupid> <artifactid>json4s-native_2.10</artifactid> <version>3.2.9</version> </dependency> brings scalap , scala-compiler dependencies. why need it? does generate code on fly @ runtime? why doesn't use macros processing @ compile time? the people of json4s have answered me in this issue following: because need read byte code find out information scala primitives. more necessary on 2.9 on 2.10

android - default value when checkbox is not clicked -

i writing app selection of output depends on checkbox selected. have 4 checkboxes choosing different filters. private string x=null; public void oncheckboxclicked(view view) { checkbox check1 = (checkbox) findviewbyid(r.id.checkbox_ok); checkbox check2 = (checkbox) findviewbyid(r.id.checkbox_nok); checkbox check3 = (checkbox) findviewbyid(r.id.checkbox_check); checkbox check4 = (checkbox) findviewbyid(r.id.checkbox_allok); if (check1.ischecked()) { x = "0000"; log.d(tag, x); } else if (check2.ischecked()) { x = "1111"; log.d(tag, x); } else if (check3.ischecked()) { x = "8888"; log.d(tag, x); } else if (check4.ischecked()) { x = ""; log.d(tag, x); } else{x=""; } } how put default value if none of checkboxes clicked? tried initialising string x passes filter value app crashes when try display results without checkbox being chec

Changing python syntax coloring in eclipse -

i using eclipse indigo python coding. when comment something, want color of comment blue how can achieve? thanks assuming use pydev plug-in can access color settings in window/preferences/pydev/editor menu.

c++ - Reading in images in a folder withouth knowing the exact names -

i have folder full of images. want use them compute optical flow opencv. cross-platform way read in images without having know exact file names? i rename images 1.png, 2.png, , on, if helps. there's hidden gem in core/utility.hpp: void glob(string pattern, std::vector<string>& result, bool recursive = false); (takes dir or similar, returns vector of filenames)

Simpler way of sorting list of lists indexed by one list in Python -

i want sort list of 2 lists, elements in 2 lists pairs. i want sort lists second element in these pairs. for example if have a_list = [[51132, 55274, 58132], [190, 140, 180]] and want sorted_list = [[55274, 58132, 51132], [140, 180, 190]] is there simpler way following in python2.7? from operator import itemgetter sorted_list = map(list, zip(*sorted(map(list,zip(*a_list)), key=itemgetter(1)))) best regards, Øystein i bit reluctant post answer, why not, actually? no, there no simpler way achieve sort in python -- except can drop inner map : >>> map(list, zip(*sorted(zip(*a_list), key=itemgetter(1)))) [[55274, 58132, 51132], [140, 180, 190]] it may seem bit convoluted @ first (though not as with additional map ), it's totally clear: zip list, sort second element, , zip back. knows python should understand code does. if want make clearer, either add line comment describing sort does, or wrap inside function descriptive name , same or m

c++ - Qt - Compilation for Linux is not compilation for Android? Why? -

qt 5 has android support: using android sdk , ndk can compile qt application work on android too. don't understand. qt cross platform long before android has borne. meant able compile on windows, mac , linux. android linux isn't it? why need special android tools sdk , ndk compile android. why compilation linux in not compilation on android? android not os complete stack of mobile software. this because structure of android (in context of applications) different form of linux. android apps run on instance of dalvik virtual machine(dvm) , sanboxed each other. app requires run on android has dvm compatible. android based on custom linux kernal, uses same file strucure, speaking of in terms of platform apps running in android run on completly different environment. android structure http://www.cubrid.org/files/attach/images/220547/480/224/typical-schematic-of-android_structure.png also there official source here android low-level system architecture i don

How to impliment a concept of arrayList and Model class in javascript -

how impliment concept of arraylist , model class in javascript in java create model class , storing model class objects in arraylist after getting value suppose getting values xml , values storing in model class , model class objects storing arraylist object want know how thing in javascript thank in advance arraylist: suppose in javascript you'd use array. model class: if properties/getters/setters in java, can use simple objects in javascript. every property becomes field. no need declare class upfront. if model class includes interesting methods, make common prototype these objects , put methods there.

invalid factor level, NA generated when pasting in a dataframe in r -

i cannot paste correct data dataframe using rbind. here problem results <- dataframe() value store hospital name meets selection criteria , y[1,2] name of state here when try past results blank dataframe results. class(results) [1] "data.frame" value [1] "john c lincoln deer valley hospital" y[1,2] [1] "az" class(value) [1] "character" class(y[1,2]) [1] "character" results <- rbind(results,as.list(c(value,y[1,2]))) warning messages: 1: in `[<-.factor`(`*tmp*`, ri, value = "john c lincoln deer valley hospital") : invalid factor level, na generated 2: in `[<-.factor`(`*tmp*`, ri, value = "az") : invalid factor level, na generated results x.arkansas.methodist.medical.center. x.ar. 1 arkansas methodist medical center ar 2 <na> <na> 3 <na> <na> how solve this? many thanks you have factor

windows - Run command on Command Prompt start -

is there way run command (eg: cd d:\test) on command prompt start , have instance of command prompt different shortcut/instance. you can create shortcut has target of e.g.: %comspec% /k ""c:\full_path_to\vsdevcmd.bat"" where .bat file command(s) want run on startup. leave open command prompt after commands have executed. (in case it's not obvious, shamelessly ripped 1 of developer command prompt shortcuts visual studio installs in start menu) %comspec% nice way of getting cmd execute. cmd : /k : carries out command specified string , continues.

xslt - Differentiate between capital letters and big roman numerals -

i've below xml document. <root> <toc-subitem><toc-title>(c) 1 year&#x2019;s separation consent (s 11a(c))</toc-title> <toc-pg>1.055</toc-pg> <toc-subitem><toc-title>(i) rescission of decree <content-style font-style="italic">nisi</content-style></toc-title> <toc-pg>1.062</toc-pg></toc-subitem></toc-subitem> </root> here i'm trying differentiate between roman numerals , capital letters using below xslt template. <xsl:template name="get_number_type"> <xsl:param name="number_string"/> <xsl:analyze-string select="$number_string" regex="([0-9]+\.)|(\([a-h]\))|(\([ivx]+\))|(\([a-z]+\))|(\([ivxl]+\))"> <xsl:matching-substring> <xsl:choose> <xsl:when test="regex-group(1) != ''"> <xsl:text>1</xsl:text> </xsl:when> <xsl:wh

android - Enable/disable ProGuard in the product flavor -

so, know in build type runproguard 'bool' directive can used tell whether proguard should run or not. unfortunately directive not work on product flavors. there way specify if proguard should or not run in flavors? have thought of using configuration file says "do nothing", (1) don't know should write in forbid proguard doing absolutely , (2) don't think it's solution. for scenario, feels trying model different phases of development lifecycle. that's build types for. while gradle (and hence gradle android) ships debug , release build types, can define own: buildtypes { debug { applicationidsuffix ".d" versionnamesuffix "-debug" } release { signingconfig signingconfigs.release } mezzanine.initwith(buildtypes.release) mezzanine { applicationidsuffix ".mezz" debuggable true } } here, i: configure debug , release build types clone mezz

php - Extend "popular posts" feed using mysql -

i have social app, , in social app i've done things extend feed if user wants scroll beyond recent 100 posts , did msg_id or timestamp . but i'm trying extend popular posts query , rows ordered number of interactions they've received, instance multiple posts have 5 interactions. is there way can extend such feed in mysql?

web services - Dynamic webservice client and java reflection -

webservice contains: resultobj resultobj = getdoccountaction(requestobj requestobj); where: resultobj , requestobj contain "long count" attribute. so, webservis method gets count on input , returns count on output (i know - it's nonsense :) i want "client.invoke("getdoccountaction", requestobj);" return value responseobj. default returns object[]. // webservice client remote wsdl string wsdlurl = "http://localhost:8080/test/test.wsdl" classloader loader = thread.currentthread().getcontextclassloader(); dynamicclientfactory factory = dynamicclientfactory.newinstance(); client client = factory.createclient(wsdlurl, loader); // accessing request object , setter method count attribute , setting 666 value object requestobj = thread.currentthread().getcontextclassloader().loadclass("pl.kago.stuff.requestobj").newinstance(); method setcount = requestobj.getclass().getmethod("setcount", long.class); setcount.invok

javascript - How to access div in Firefox Add-on SDK? -

i'm trying access div right-clicked , log code (from opening closing tag) add-on sdk. var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.item({ label: "log div", context: contextmenu.selectorcontext("div"), contentscript: 'self.on("click", function (e) {' + // e empty ' if (!e) {e = window.event;}' + // window doesnt have event property ' console.log(e);' + // result {} ' var text = e.target;' + ' self.postmessage(text);' + '});', onmessage: function (selectiontext) { console.log(selectiontext); // null } }); the first argument click callback the actual context node , not event. to outer markup of node, can use .outerhtml var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.item({ label: "log div", context: context

bouncycastle - How to parse SAN from CSR using java or bouncy castle? -

i have generated csr using openssl. want parse csr , display ipaddress, othername available in csr. i have written following code. able display dns, url not able display ipaddress , othername in correct format. public static void testreadcertificatesigningrequest() { string csrpem = null; try { fileinputstream fis = new fileinputstream("e://test.txt"); csrpem = ioutils.tostring(fis); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } pkcs10certificationrequest csr = convertpemtopkcs10certificationrequest(csrpem); x500name x500name = csr.getsubject(); system.out.println("x500name is: " + x500name + "\n"); attribute[] certattributes = csr.getattributes(); (attribute attribute : certattributes) { if (attribute.getattrtype().equals(pkcsobjectidentifiers.pkcs_9_at_extensionrequest)) { extensions extensions = extensions.getinstance(attribute.getattrvalues().ge

mysql - Update database from database on other server -

is there possibility getting/updating (for eg. 1 update per hour) fields databse on server 1 , put them server 2? any ideas? you use serer script on server 1 , call server 2 hourly cron job.

ember.js - How can I include given Handlebars helpers in Ember -

on github, many handlebars helpers presented. can find them here . i'd use them, have no idea, how include them. code looking it's javascript (files ending .js ...), words 'import','export','default' confusing me. as understand (guess), have include if-condition.js @ first. later, other (included) files refer file. but when this, console throws error: uncaught syntaxerror: unexpected reserved word . has idea, how these codes working? import , export keywords upcoming module syntax in next version of javascript. can use them today using transpiler convert normal es5 syntax. however, if you're using few helpers, it's easy 'transpile' them hand. instead of exporting function, pass ember.hanldebars.registerboundhelper call. here's if-condition helper: ember.handlebars.registerboundhelper('if-condition', function() { var args = [].slice.call(arguments); var options = args.pop(); var co

Get string from one class to another class in Android? -

i need string variable 1 class of project class, in first class, made string type variable , global, this: name of class firstclass public string firstclassvar; and assigning value in method public string requestforserverdata(string strurl) throws ioexception, unknownhostexception, illegalargumentexception, exception { //additional code firstclassvar = myobject.getstring("values"); //additional code } now in second class, doing this: public firstclass getvar; public void method{ string secondclassvar; secondclassvar=getvar.firstclassvar; } by doing crashes. have done thing in firstclass is public string getstringpublically() { return firstclassvar; } and accessing class doing this secondclassvar =getvar.getstringpublically(); and doing crashes app. now bit new android, , don't know basic way access string class. you can use sharedpreferences set/get values in class want. here topic it

ios - Virtual Memory Exhaustion - Is This To Blame? -

Image
i'm getting unusual , constant build of virtual memory navigate through app, leading boggy performance , memory pressure crash. app physical memory never goes past 10mb 20mb, virtual memory peaking in 200mb 300mb range @ time of crash. i'm using arc. basically, i'm thinking problem approach i've taken cellforrowatindexpath / itemforrowatindexpath methods, app intensely based on content provided through tableviews , collection views. basically, i'm doing dequeueing cells registered custom xib files, not have class file (which think problem) , referencing objects of dequeued cells through tags rather them class , accessing properties. from code, , i'm gathered, i'm assuming time collection views or tables reload, it's created additional cells doesn't need cells have been created, it's overlaying same content on same cells? or using uilabel *name = (uilabel *)etc.. increasing reference count in places shouldn't be, causing memory usa

c# - Can't Use CookieContainer on my request, only hand made cookie works :\ -

i'm working on project use http web requests. i'm using cookie containers on requests, found doesn't work on specific request. i'm making site change it's page http request each page finds , download info want it, since page url hidden, , if press go in browser doesn't go page before goes homepage. i found body of request can change page , worked when used cookie got using fiddler. since tried cookiecontainer info on pages same 1st page. (int = 2; <= _totalpag; i++) { try { int _pagina = i; httpwebresponse response3; httpwebrequest request3 = (httpwebrequest)webrequest.create(lista_links_categorias[cbo_categorias.selectedindex]); request3.keepalive = true; request3.useragent = "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.153 safari/537.36";

condition - how to check and filter for group of different values in java -

i have text file data shown below example.. 2;30;1;801;2;1951;195102;1111; 2;30;1;801;3;1621;162101;1111; 2;30;1;802;1;1807;180702;1111; 2;30;1;802;1;1807;180703;1111; 2;30;1;802;1;1807;180704;1111; 2;30;1;802;2;1101;110101;1111; 2;30;1;802;2;1139;113902;9999; 2;30;1;802;2;1948;194801;1111; 2;30;1;802;2;1948;194802;1111; 2;30;1;802;3;2477;247701;1111; 2;37;2;803;1;2006;200601;0000; 2;37;2;803;1;2006;200602;0000; 2;37;2;803;2;2005;200501 ;0000; in program have put filter , display, groups rows i.e. row[3] based on row[7] . list should appear after filtering example 802 802;1;1807;180702;1111; 802;1;1807;180703;1111; 802;1;1807;180704;1111; 802;2;1101;110101;1111; 802;2;1139;113902;9999; 802;2;1948;194801;1111; 802;2;1948;194802;1111; 802;3;2477;247701;1111; similarly 803 803;1;2006;200601;0000; 803;1;2006;200602;0000; 803;2;2005;200501 ;0000; the problem value of row[3] not constant , keeps varying throughout file in group example bunch of values 802, next bunch 804

ios - After Receiving Notification how can i get message on app icon click? -

my push notification works in app push notification comes 2 different messages: 1 "task completed" , second "you have message". now when application in background state , notification arrives, how can notification's message when click on app icon? if knows please me. thank in advance. for ios 7 , above can use: - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult))completionhandler this allow quick amount of processing when application in background state.

printing - Ax2012:How can I upload and print an external PDF file -

i'm beginner student working on project ax2012 . have external pdf file print . this,i looking solution upload, display , print pdf external file when click button. i have test job static void aalpdfprint(args _args) { printjobsettings printjobsettings = new printjobsettings(); dialog dialog = new dialog(); dialogfield dialogfilename; str adobeexe; str adobeparm; ; dialogfilename = dialog.addfield(extendedtypestr(filenameopen), "immatriculation"); if (dialog.run()) { printjobsettings.printersettings('sysprintform'); adobeexe = winapi::findexecutable(dialogfilename.value()); adobeparm = strfmt(' /t "%1" "%2" "%3" "%4"', dialogfilename.value(), printjobsettings.printerprintername(), printjobsettings.printerdrivername()

encryption - how verify if data are encrypt when use git transfert? -

i have install own gitlab on server. want encrypt data on network during transfert (clone, push, pull...). datas encrypt default git protocol? or need enable https? how verify if data on network encrypt? thx. git doesn't encrypt during transport, that's transport protocol. plaintext: file:// git:// http:// encrypted: https:// ssh://

how to fix type mismatch json exception while parsing a json url in Android? -

i trying retrieve json data using url . json array posted below. getting type mismatch json exception. can 1 guide me step step going wrong? error logs posted below. secondly, please tell me whether json parsing using url same json parsing using php server database. url : http://166.62.17.208/json_preferencess.aspx "items": [ { "id": "11", "item_id": "123", "item_name": "chicken cream soup", "price": "8", "currency": "aed", "category": "soup", "description": "creamy chicken soup garnish & side helpings", "unit": "2", "food_type": "non", "image_large": "/images_large/chickensoup.jpg", "image_thumb": "/images_

sprite sheet - Transparant spritesheet animation for webgl -

i'm getting started webgl , trying make animation based on spritesheet. i've found example , changed spritesheet own. though removed white background, saved transparant png, animation still shows white background. this example used: http://stemkoski.github.io/three.js/texture-animation.html is there way how can rid off white background? in advance. edit: var runnertexture = new three.imageutils.loadtexture( 'images/run.png' ); annie = new textureanimator( runnertexture, 10, 1, 10, 75 ); // texture, #horiz, #vert, #total, duration. var runnermaterial = new three.meshbasicmaterial( { map: runnertexture, side:three.doubleside } ); var runnergeometry = new three.planegeometry(50, 50, 1, 1); var runner = new three.mesh(runnergeometry, runnermaterial); runner.position.set(-150,25,0); scene.add(runner); to support pngs alpha-channel, have modify meshbasicmaterial accordingly: there attribute 'transparent' set 'true'. try using following

sql server - Can I compare entries of a same table based on their different dates? -

i creating procedure receives 2 dates parameters. the procedure works on table has following columns (i'd put picture of actual table don't have enough reputation yet): date displayname label capacity the data contained in table have been collected on few years , 1 day displayname columns refer the name of vmware. thus, possible start date has 3 entries , end date has 5 (reflecting vmwares created in between). follow. given start , end date, able select displayname (along label , capacity) have been created (or added if will) between 2 dates. have create procedure affichercreationluns @start date, @end date begin select datecollecte, displayname, label, capacity vsp datecollecte = @end , displayname not in (select displayname vsp datecollecte = @start) end this works if start date exact 1 vmware created (and displayname added entries). if pick date before n

voip - Cannot register my Android sip app to Fritzbox -

i using zyxel reach android application , want connect fritz!box. before used csip simple, uses resources phone, switched zyxel reach. the log file of zyxel reach shows 403 forbidden sip server. not matter if try connect outside , stunt server or if try connect within network (wifi), same result.

qcolordialog - How do I set custom colours on a pyqt QCoiorDialog? -

i bringing qcolordialog so:- colour = qtgui.qcolordialog.getcolor() what want know how set colours of custom color swatches before bring dialog? have searched lot , found method setcustomcolor() can't work. repeatedly tells me typeerror: argument 2 of qcolordialog.setcustomcolor() has invalid type i have tried manner of variations of how create qcolor, never seems happy it.this trying:- mycolor = qtgui.qcolor(0,0,0,0) colour = qtgui.qcolordialog.setcustomcolor(0,mycolor) but still gives me same 'invalid type' error... any ideas? all need is: colour_dia = qtgui.qcolordialog() mycolour = qtgui.qcolor(0, 0, 0, 0).rgba() #this needs integer value colour colour_dia.setcustomcolor(0, mycolour) selected_colour = colour_dia.getcolor()

c# - How to turn an IEnumerable (without type) into an IQueryable<T>? -

having used linq quite bit stumbling on basic task today: having iqueryable<t> out of ienumerable (without type specified). specifically want query on parameters of sqlparametercollection . deriving idataparametercollection, ilist, icollection, ienumerable described here . however, these without type specified. thus question boils down to: how use linq query on sqlparametercollection? here's have done (the compiler did not complain): iqueryable<sqlparameter> queryable = sqlcommand.parameters.asqueryable().cast<sqlparameter>(); //throws argumentexception "source not ienumerable<>" note: have searched quite bit, talking ienumerable<t> easy query using asqueryable() of course. i interested in reason why want this. should explained: public iqueryable<t> asqueryable<t>(ienumerable list) { return list.cast<t>().asqueryable(); } call this: iqueryable<sqlparameter> query = as

Client authentication and ACL permissions to znode of zookeeper? -

client authentication , acl permissions znode of zookeeper? when client connect zookeeper create znode acl property (i.e ids.auth_ids) how authentication user access data form znode of zookeeper ? zookeeper command line: you must execute "addauth" command first when access path has been setacl. addauth digest u1:p1 in zookeeper client must run addauthinfo api first. try { zookeeper zk = new zookeeper("ip:2181", 10000, null); string auth = "u1:p1"; zk.addauthinfo("digest", auth.getbytes()); zk.getchildren("/data", null); } catch (ioexception e) { e.printstacktrace(); } catch (keeperexception e) { e.printstacktrace(); } catch (interruptedexception e) { e.printstacktrace(); }

cross domain - If block for specific url .htaccess -

i have little problem here <ifmodule mod_headers.c> header append access-control-allow-origin "*" </ifmodule> how can apply header if requested url mydomain.com/ajax/wigdet ? (i can't outside htaccess) you can use mod_setenvif this: setenvifnocase request_uri ^/ajax/wigdet ajax header append access-control-allow-origin "*" env=ajax

ios - NSURLConnection async thread connection closure -

Image
i used nsurlconnection data internet in thread seperated main thread: put in jsonviewcontroller.h : #import <uikit/uikit.h> @interface jsonviewcontroller : uiviewcontroller <nsurlconnectiondelegate> { bool firsttime; nsmutabledata *_responsedata; } @end i use code start connection in jsonviewcontroller.m : nsurlrequest *request; if (self.jsonitem == nil) { request = [nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"%@%@",my_url,@"testvalue"]]]; }else { request = [nsurlrequest requestwithurl:[nsurl urlwithstring:[nsstring stringwithformat:@"%@%@",my_url,(nsstring *)self.jsonitem]]]; } nslog(@"json item = %@",self.jsonitem); // create url connection , fire request nsurlconnection *conn = [[nsurlconnection alloc] initwithrequest:request delegate:self]; i implement functions related nsurlconnection protocol well: #pragma mark nsurlconnection delegate methods -

SQL - Subtract Date with Integer -

i have document has "delivery date" , "days deliver" fields calculate "dispatch date" = "delivery date" subtract "days deliver" currently i'm trying: dbo.t0.docduedate-dbo.crd1.daystodeliver am getting datetime format error above. getting wrong? assuming using sql server, use sql function dateadd() . first parameter d stands day. second parameter how many days want add , putting minus (-) in front instead of adding subtracts value. last parameter initial date want manipulated. might need cast input values appropriate types - second parameter has integer. select dateadd(d,-[daystodeliver], [deliverydate]) 'dispatch date' [table]