Posts

Showing posts from March, 2010

bash - how to create multi user paramerter in zabbix from a script -

this shell script return 2 values 1 packet loss percentage , true or false : server_ip=$1 checkip=`ping -c 2 -w 2 $server_ip | grep "packet loss" | cut -d " " -f 6 | cut -d "%" -f1` test1=$? echo $checkip if [ $test1 -eq 0 ]; echo "1" else echo "0" fi in zabbix when create item enter 1 parameter value have 2 values 1 packet loss , second ping result (0 , 1) how can create 2 items 1 packet lost percentage , second ping health check script? dont want create 1 thanks andre try script guide want : #!/bin/bash case $1 in packetloss) ping -c2 -w1 -q 8.8.8.8 | grep -op '\d+(?=% packet loss)' ;; timeout) ping -c2 -q 8.8.8.8 | grep 'time' | awk -f',' '{ print$4}' | awk '{print $2}' | cut -c 1-4 ;; *) echo "use: packetloss , timeout";; esac try (im in zsh): zabbix_agentd -t ping.loss\[timeout\] ping.loss[timeout]

datetime Problems in Python IDLE -

i have weird problem. have 2 python 3.4.3 installations - 1 on windows xp, other on windows 7 x64. only 1 on winxp exhibits these problems: when open python idle shell, can execute dir(datetime) before import , print attributes (but list shorter on windows 7, after importing datetime ). the following fails in idle, because attribute now not found: import datetime datetime.datetime.now() the regular python command prompt works fine. it seem idle has version of datetime imported, differs standard datetime module. unfortunately, not have access xp machine right now, can't run tests right now. same problems present on windows 7 machine, aren't.

ssh - How to do X11 forwarding to a virtual machine running on a remote linux host? -

i running virtual machine on remote linux host: my machine -> linux host -> virtual machine running on linux host i have x11 forwarding enabled on linux host, , on virtual machine. trying run jvisualvm on virtual machine on own machine launched using ssh command (with ssh -x). the ssh command i'm using is: ssh -x -t root@linux_host -l 29998:localhost:29999 ssh -x -t -i /root/.ssh/my_key user@virtual_machine -l 29999:localhost:9999 once i'm connected set display variable with: display=<my machine's ip address>:0.0 then run jvisualvm this, expecting window open on own machine: /usr/java/jdk1.7.0_95/bin/jvisualvm -cp:a /opt/jboss/bin/client/jboss-cli-client.jar --jdkhome /usr/java/jdk1.7.0_95/ but either error display not set, or jvisual exits after few seconds error code of 2. since you're using ssh -x you're apparently expecting use secure x forwarding ssh. in case, ssh sould set display variable , should not override set

android - App-server communication protocol -

i'm building little android app connect server. my app use simple post send message server, , i'm using google cloud messaging server send message app. i built registration page, email confirmation , connection page wonder how lock communication between server , app. this protocol have in mind ( let's take simple exemple of app app message) : app send post infos server self infos (like name , auth_token), destination user , message server search apps belong destination user , use curl forward message gcm gcm send message destination apps how can server sure name, auth_token etc server receive sender ? let server generate authentication token when client doing registration , send client. server knows [client - token] mapping. every time client wants send message, sends authentication token server can , check. client not have send or name, server should know this. to prevent mitm attacks, use secure connection (https).

c# - cmd process won't execute correct command -

i'm working on project "send" command cmd.exe , receive output. command need file path -k , url. have following code (names , values changed): string path = "c:\users\program.exe" string pathcustom = "\"" + path + "\""; //the path needs in quotation marks process p = new process(); p.startinfo.filename = "cmd.exe"; p.startinfo.useshellexecute = false; string address = "1.2.3" string command = pathcustom + " " + "-k" + " " + "https://username:passwort@serveradress" + address; //serveradress url p.startinfo.arguments = "/c " + command; p.startinfo.redirectstandardoutput = true; p.start(); string returnvalue = p.standardoutput.readtoend(); this code working fine want be, need methode thats similar except address looks different. in code above 1.2.3 int following method address has (including

listview - How to get transparent list view in javafx? -

i have list view. want make cells background transparent. currently, doing following: .list-cell { -fx-background-color: transparent; } but, color of cells remain white. have tried same other colors. works other colors. but, it's not working transparent color. how can transparent list-view? you have make both list-view , list-cell transparent. .list-cell { -fx-background-color: transparent; } .list-view { -fx-background-color: transparent; }

ASP.NET 5.0 beta 8 in Docker doesn't start -

i have been running website using asp.net 5.0 beta 7 in docker container, using official docker image - https://github.com/aspnet/aspnet-docker - working fine. i updated project beta 8, , changed dockerfile use beta 8 version of docker image. works fine when run locally on windows machine, whether use visual studio start project iis express, or run using kestrel. however, push dokku server, doesn't seem start properly. don't errors container output, have checks file dokku uses ensure web server has started, , fails (indicating hasn't started properly, or not listening should be). tried removing checks , cannot connect either - bad gateway message nginx. i don't know why happening, because when push dokku, following response: ... remote: [1g-----> attempt 5/5 waiting 10 seconds ...[k remote: [1g checks expected result:[k remote: [1g http://localhost/ => "my website"[k remote: not start due 1 failed checks.[k remote: [1g ! [k r

c++ - Combining Streams and Iteration in STXXL -

stxxl supports streaming model of data processing. stxxl data can either processed iterating through (e.g. using stxxl::for_each ), or converting stream mode (e.g. using streamify() such stream transforms can composed efficient processing. stream results can converted iterators using materialize() . i have bunch of stream transforms, want apply input stream. however, not need store result in output "container". need materialize -like function drives stream without taking output iterators - stxxl::for_each . there such similar function in stxxl? naturally, can write custom "do-nothing"-output-iterators , pass these materialize() , wondering if there more elegant solution. there stxxl::stream::discard . takes stream , throws away results.

c# - How to deploy Crystal Reports .Net based project with Visual Studio 2010? -

i created .net application based on crystal reports display reports want deploy client machine,please tell me solution deploy order work on client computer, search throughout internet not found clear answer deploy .net application along crystal reports. now deploy .net project along crystalreports using crystal reports visual studio 2010 merge modules (msm) create setup project. 1 . in vs .net, open windows application , go view menu , select solution explorer. right-click windows application solution , pop menu, select add click new project. 2 . add new project dialog box appears. select setup , deployment projects in left pane , select setup project in right pane. click ok. 3 . in solution explorer, right-click windows application , select add click project output… 4 . add project output group dialog box appears. select primary output added setup project. when primary output added project, detected dependencies added. • if using bundled version of cr 9

html - how to combine two nodes into one group in Xpath? -

i have html this: <div> <div class="a">10</div> <div class="b">11</div> <div class="a">20</div> <div class="b">21</div> </div> sometimes use //div[@class="a" or @class="b"] 4 groups: [10, 11, 20, 21] . but time want this, 2 groups: ["10 11", "20 21"] , i? i mean how combine 2 nodes(class a, class b) 1 group? this working xpath 2.0 solution ( running example ): //div[@class="a"]/concat( text(), ' ', string-join((following-sibling::div[@class="b"]/text())[1], '') ) i don't think solution xpath 1.0 possible here.

java - Issue in reading data from <p> tag using Selenium Webdriver -

my webpage shows data value need read. e.g., webpage shows like: campaign range: 05/06/2015 - 12/30/2015 budget: $50,00.99 i need read these values using selenium webdriver. structure is: <div class="inner-widget-container"> <div class="widget-menu-container" data-bind="attr:{id: internal.controlwidgetmenuid}" id="widget-369148223195225-menu" style="display: none;"></div> <div class="widget-data" data-bind="attr:{id: internal.controlwidgetinnercontainerid}, event:{dblclick: api.editsettings}" id="widget-369148223195225-inner" style="left: 0px; right: 0px; top: -5px; bottom: 0px;"><div class="rich-text-widget-content" style="position: absolute; left: 10px; right: 10px; height: 320px; overflow: hidden;"><div class="customhtml" style=" color:#000000 ;position: absolute;top: 0;bottom: 0; left: 0; right: 0

javascript - Compatibility from ie11 to ie10 -

i developed on ie11 , code works fine in browser version, when use ie10 - doesn't work. found this: if ($.browser.msie && $.browser.version === 10) { $("html").addclass("ie10"); } but addclass means? how compatibility ie10? the code you've found not you. there whole bunch of reasons why code bad idea in cases, ignoring fact, block of code won't fix itself; tool write other code fix problem. you need work out difference is. ie10 , ie11 browsers when comes rendering things correctly, guess somewhere in code you're using feature wasn't available in ie10 , introduced ie11, , why it's not working in ie10. a couple of lines detect browser version won't resolve that. you'll still need work out feature (or features) you're using aren't working, , how around it. when you've worked out, come , ask further if need it.

javascript - Replicating Script Behavior in Templates -

i trying build website using header.html template included in index.html file. i have template working. had been using jquery rotate ( http://jqueryrotate.com/ ) make logo flip upside down on mouseover. since angular won't allow <script> tags in templates security reasons wondering standard practice replicate script behaviors. can still use ng-mouseover , ng-mouseleave . there convenient way call jquery rotate functions controller?

Is it possible to add incrementing id number to IntelliJ-IDEA run executions? -

is possible add incrementing id number intellij-idea run executions? want unique env variable increment 1 each time run test execution. sorta how jenkins keeps track of build# . there's no direct support feature in idea, you'll have code yourself. however, in run/debug configurations there option perform various actions before running. could, example, write gradle task increment build number , have idea run task each time execute app. if add defaults picked run configurations , won't have remember add in each time.

c# - How to map data to class structure using linq? -

i have raw data separated comma like: name value image catid id blue, era , colors/col_image ,37 , 1 pink, aka, colors/col_image ,37 , 2 and prepared class structure : public class dailystuffs { public string stuffname { get; set; } public string convertedname { get; set; } public string stuffimage { get; set; } public int categoryid { get; set; } } public class stufftype { public string category { get; set; } public list<dailystuffs> dailystuffs; } i want group item according category(color,birds etc) . tried using following code : list<stufftype> stuff = (from line in lines let data = line.split(',').tolist() select new stufftype { category = definerange(convert.toint16(data[4])), dailystuf

CSS HTML overflow issue with static header in wrap -

i struggling bottom part of overflowing content can seen in fiddle. how go fixing this, while keeping layout? http://jsfiddle.net/sa6cb/392/ css: .wrapper { overflow-y: hidden; overflow-x: hidden; border: 1px solid #000; height: 200px; width: 200px; } .wrappedheader { position: static; border-bottom: 1px solid #000; padding: 15px; } .wrappedbody { position: relative; overflow-y: auto; height: 100%; padding: 15px; } html: <div class="wrapper"> <div class="wrappedheader"> header </div> <div class="wrappedbody"> <!-- content causing overflow-y --> </div> </div> your wrappedbody has height 100%, 100% of parent, wrapper. however, wrapper has 2 children, wrappedbody and wrappedheader. height of wrappedbody should height of wrapper minus height of wrappedheader: .wrappedbody { position: relative; overflow-y: auto; height: calc(100% - 79px)

javascript - Jquery ui resizable as Angular Directive -

i'm trying implement jquery ui resizable plugin angular directive. it's successful. when set explicitly handler resizable plugin error whenever click on dom item. uncaught typeerror: cannot read property 'ownerdocument' of undefined here angular directive; app.directive('resizable', function() { return { restrict: 'a', link: function(scope, element, attrs) { $(element).resizable({ handles: { 's' : '.handle' } }); } }; }); html; <div class="row list-box" resizable> <div class="handle ui-resizable-handle ui-resizable-n fa fa-ellipsis-h"></div> also what's best practice using jquery ui angularjs? thanks. i have found solution. problem handler div not placed in resizable div . after placing correctly worked expected. <div class="row list-box" resizable> ... <div class="

Filter CriteriaQuery JPA 2.0 -

i making application java 1.6, jsf 2.0, jpa 2.0, primefaces 5.3 on weblogic server 10.3.6 i require implement lazy datatables burden modules , not make filter work. this load method: public list<t> load(int first, int pagesize, string sortfield, sortorder sortorder, map<string, object> filters) { // todo auto-generated method stub try { list<t> list = new arraylist<t>(); //criteria query criteriabuilder cb = this.ejbutils.getentitymanagerprivate().getcriteriabuilder(); criteriaquery<t> cq = cb.createquery(entityclass); //from root<t> = cq.from(entityclass); //sort if(sortfield != null){ if(sortorder == sortorder.ascending){ cq.orderby(cb.asc(from.get(sortfield))); }else{ cq.orderby(cb.desc(from.get(sortfield))); } } //filters if(!filters.isempty()){ list<predicate> predicates = new arraylist<predicate>(); (iterat

.net - What's the best way to share a dbcontext between multiple services? -

first of all, i'm sorry if has been answered already. wasn't able find solution. let's want create order along lines , @ same time create entity. service layer: public class orderservice { private dbcontext context; public orderservice() { context = new dbcontext(); } public void addorder(order order, list<orderline> lines, anotherentity anotherentity) { context.orders.add(order); context.orderlines.addrange(lines); var anotherservice = new anotherservice(); anotherservice.addanother(anotherentity) context.savechanges(); } } public class anotherservice { private dbcontext context; public anotherservice() { context = new dbcontext(); } public void addanother(anotherentity entity) { // maybe business rules here context.someotherentities.add(entity); context.savechanges(); } } controller: var orderservice = new ord

javascript - Can't get jQuery var to PHP -

i trying jquery var php can use mysql. have searched everywhere nothing seemed solve it. i have following jquery code: $('.eventrow').click(function(){ var eventid = this.id; $.ajax( { url: "index.php", type: "post", data: { phpeventid: eventid}, success: function (result) { console.log('success'); } }); $('#hiddenbox').html(eventid); console.log(eventid); }); if run this, id shown in both #hiddenbox , in console.log. console says "succes" ajax. i trying in php file: $value = $_post['phpeventid']; echo "<div class = 'shownumber'>"."nummer: ".$value."</div>"; it says: nummer: it gives no error whatsoever. thanks help! try var eventid = $(this).attr('id'); where id comes in code ?

java - Truncating float to the two first non-zero decimal digits -

i want truncate floating point numbers in java 2 first non-zero decimal digits. example, 0.000134 0.00013 , or 11.00401 11.0040 . the solution can think of strip integral part, , multiply 10 until number bigger or equal 10. truncate original float number of multiplications decimal digits. but might have operation often, i'm looking faster solution. my test code: public static string truncateto2nonzero(double f) { int integral = (int)f; double decimal = f - integral; int digits = 0; while (decimal < 10) { decimal *= 10; digits++; } double ret = (int)decimal / math.pow(10, digits); ret += integral; return double.tostring(ret); } public static void main(string args[]) { final int tests = 1000000; double[] floats = new double[tests]; random random = new random(); (int = 0; < tests; ++i) { int zeros = random.nextint(6) + 3; // divide 10^zeros double digits = random.nextint(100) + 10

django - Problems Saving Data to Database -

this views.py def signup(request): print "signup" if request.method == 'post': print "post signup" form = registerform(request.post) try: if form.is_valid(): print form.cleaned_data u = user.objects.create_user(form.cleaned_data['emailid'], form.cleaned_data['emailid'], form.cleaned_data['passwd1'] ) ui = userinfo() ui.user = u ui.class_of = form.cleaned_data['gradyear'] ui.grade = form.cleaned_data['grade'] ui.balance = 0 ui.save() and in forms.py have: class registerform(forms.form): grade_choices = ( (9,'9'), (10,'10'), (11,'11'), (12,'12') ,

javascript - jQuery datePicker week selection -

i have jqueryui datepicker , trying code select specific week day picked, works everyday except sundays. when select sunday, following week displayed should displaying current week. example if select may 9th range may 9 may 15, 2016 , when select 15th may 16 may 22, 2016 , when think should displaying same range if selected 9th html <input style="display: none" name="date" type="input" id="datepick"/> <span>week of: </span> <span style="font-weight: bold" id="weekrange"> </span> <br/> m : <span id="mondaynum"></span> <br/> tu : <span id="tuesdaynum"></span> <br/> w : <span id="wednesdaynum"></span> <br/> th : <span id="thursdaynum"></span> <br/> f : <span id="fridaynum"></span> <br/> sa : <span id="saturdaynum"></spa

python - Django Model Graph (pydot) Error -

i have started working on big django project existing complicated model. needed visualize model, decided use django-extensions (namely pygraphviz ). unfortunately, failed install pygraphviz on windows using pip, installed pydot . when running following command on windows cmd: python manage.py graph_models --pydot -a -g -o my_project_visualized.png i following error: attributeerror: 'list' object has no attribute 'write' any suggestion of how solve issue? you must use older pydot . version 1.1.0 works me. install with: pip install pydot==1.1.0

c# - Change Material Image/Texture from Sphere with Script -

i'm trying change image/texture sphere material code. try in new script , add object component: c#: class materialsetter : monobehaviour{ public void setmaterial(material newmaterial) { renderer renderer = getcomponent<renderer>(); renderer.material = newmaterial; } } you can call setmaterial other script, provided have reference target object. could, example, set material @ beginning of game adding start() function materialsetter class: c#: class materialsetter : monobehaviour{ public material startmaterial; // ... void start() { setmaterial(startmaterial); } } now if want set material name, material needs in folder assets/resources. via resources.load, must located in folder. code this: c#: class materialsetter : monobehaviour{ public void setmaterial(string materialname) { material mat = resources.load(materialname, typeof(material)) material; renderer renderer = g

mobilefirst-cli ERR! Error: ry.npmjs.org/cordova-plugin-compat -

i using mfp 7.1 cordova project (mfp cordova). i able add ios environment (mfp cordova platform add ios), got error when try add android environment. following exception: mobilefirst-cli err! error: ry.npmjs.org/cordova-plugin-compat npm http 304 http://registry.npmjs.org/cordova-plugin-compat at childprocess.<anonymous> (/applications/ibm/mobilefirst-cli/mobilefirst-cli/node_modules/cordovacmd/lib/cordova-cli.js:251:41) @ childprocess.emit (events.js:117:20) @ maybeclose (child_process.js:766:16) @ socket.<anonymous> (child_process.js:979:11) @ socket.emit (events.js:95:17) @ pipe.close (net.js:466:12) i cannot confirm this... using 7.1.0.00.20160401-2108 i've tried following: mfp cordova create i provided name , version app, , selected 2 supported platforms: ios , android. app created, both platforms. i try perhaps update npm installation.

c++ - Understanding the Syntax of Overloaded Insertion / Extraction Operators (& Operator Placement) -

its been few months since last programming class (back in spring) , i'm trying practice overloading operators of class before go class. 1 thing never quite understood placement of & operator in function name. example: ostream & operator << (ostream & out, const measurement & x) the placement of first & seems bit odd because place reference operator in front of object want become reference, first 1 placed before operator << . operator << object here? i apologize, our professor never explained syntax, taught not question it, don't prefer. i'd understand syntax entirely. edit: i've included full function below. ostream & operator << (ostream & out, const measurement & x) { out << "inches : " << x.inches; out << "\nfeet : " << x.feet; out << "\nmiles : " << x.miles; out << "\n"; return out; }

java - How can I stop the server thread(and may activate it later)? -

i'm creating multithread server receive message client, process , send result. the problem when want server thread stop, won't. even setting stopflag=true , client still can connect server , result. how can stop server thread(and may activate later)? i tried of these below didn't work. close listening serversocket java server socket program after 1 day stops listening close listening serversocket http://tutorials.jenkov.com/java-multithreaded-servers/multithreaded-server.html public class serverstart implements runnable{ private jtextarea servlog; private boolean stopflag=false; public serverstart(jtextarea servlog){ this.servlog=servlog; } public void setstopflag(boolean stop){ stopflag=stop; } @override public void run() { int port=444; try { serversocket serversock = new serversocket(port); synchronized(this){ while(!stopflag){ socket clientsock=null; try{

php - Where to create and close database connection? -

i know have close db connection @ end. let's have class , there 4 methods , each consists of db queries. question should create connection , close in every different methods or create connection in constructor of class? if create connection in constructor close it. because if close in function no other method can access it. if create new connection every method no of connections may high. where create , close function proper way? if open it, need close it. as long close connection, can close want. seems maybe closing woes more design of procedures of program. because database call uses connection doesn't mean has opened , closed right there it. say might want reuse $mysqli variable that's holding connection. can pass connection function , either return or close inside. in way, can isolate main activity of database call in body of function without having worry opening , closing of everything. using technique, it's possible reuse conn

javascript - Change current percentage of an infinite running CSS animation -

Image
i want create basic slider on own. sliding works charm, infinite, allow user skip/back specific neighbours (e.g. arrows). @keyframes slider-ani { 0% { left: 33.3%; } 20% { left: 33.3%; } 25% { left: 0%; } 45% { left: 0%; } 50% { left: -33.3%; } 70% { left: -33.3%; } 100% { left: 33.3%; } } is there way maybe put javascript command, telling running animation go next step, e.g. 25% 45%. i use css3 possible. know easy done in jquery. jsfiddle got working css , radio buttons (without keyframes). great because runs without jquery , natively on device. it's way harder create it.

ios - Detect touch action that involves status bar -

i have perform action when user returns expanded status bar. can do: 1. user touches status bar. using code [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(onstop) name:uiapplicationwillresignactivenotification object:nil]; how detect action: 2. returning status bar? method doesn't work [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(onstart) name:uiapplicationwillenterforegroundnotification object:nil]; any solution? found solution. use uiapplicationdidbecomeactivenotification instead of uiapplicationwillenterforegroundnotification .

javascript - Grunt-injector - Inject parent directories first -

i'm using grunt-injector , have list of files being injected using 'app/**/*.js don't want inject files alphabetically causing dependency errors. want systematically inject files in parent directory, move next level , inject files , on. way inject parent files first , remove dependency issues. can this? i've tried looking @ grunt-include-source includes top-down file sort want unable working , i'd rather stick injector used heavily @ moment. i had same problem, had changes in injector.js script (node_modules/grunt-injector/tasks/injector.js). you have do: 1.- looking comment "sort files if needed" , add else case: else { //parent dir's files go first. if (options.parentdirfirst) { sources.sort(function (a, b) { return a.file.split("/").length - b.file.split("/").length; }); } } 2.- in gruntfile.js have set option parentdirfirst true: injector: { options: {

windows - NZLoad using Pipe File Syntax Issue -

i looking bulk load big data large text files netezza table , looking @ using named-pipe option. however, having trouble getting started. test using windows 64-bit machine , calling nzload ssis script task , passing arguments in. following online guide saved file loadme.bat . can tell me if syntax correct in file? or way off base , can't of work in control file? when tried running error stating there syntax error , expected datafile or mkfifo: '<'. in .bat file: mkfifo: mkfifo pipefile cat c:\testing\dev\rawfiles\testfile.txt > pipefile nzload -host nzdev -u user -pw pwd -db nzdw -delim "\n" -df pipefile datafile loadme.dat { database ebidw tablename ld_test_table. } calling ssis, argument line i'm using: -host nzdev -u user -pw pwd -cf loadme.bat any appreciated. can table load fine without using pipe-file it's not driver issue or don't think. figured either wrote incorrectly in .bat file or approach isn't correct , misinterpre

python - 2 Sample KS test - something seems wrong -

Image
i attempting run kolmogorov-smirnoff test using ks_2samp function scipy determine if histograms of data same distribution. returned p-value doesn't seem quite right though... for example histogram: aa, bb, cc = ax1.hist(list1, numpy.arange(a-1, b+3, c), alpha = .5, align = 'mid', rwidth=1, linestyle = 'dashed', linewidth = 1.5) dd, ee, ff = ax1.hist(list2, numpy.arange(a-1, b+3, c), alpha = .5, align = 'mid',rwidth=1) print ks_2samp(aa, dd)`[1]` i p-value returned of .96, don't seem right...am doing wrong? shouldn't these histograms different enough p-value lower? ks_2samp applies kolmogorov-smirnov test 2 samples , tests null hypothesis both come same distribution. therefore ks_2samp takes 2 samples (here list1 , list2 ) input. ks_2samp(list1, list2)

psql - PyGreSQL Run SQL interactively -

i have greenplum database, , i'm trying create several external tables. i'm using pygresql package interface database. however, can't escape \i (or \dt , \du , \dv ). db.query("\i h1/ext/eng/ext_eng" + + ".sql") pg.programmingerror: error: syntax error @ or near "\" i've tried "\\i" , " '\i' " , other combinations. i'm not aliases can used generic clients. you can avoid \i first reading file h1/ext/eng/ext_eng.sql python, streaming resulting sql text pygresql db.query() . as \dt, \du, , \dv - sql equivalents can see running \set echo_hidden psql prompt, issuing each see true definition. i've included result below. \dt: select n.nspname "schema", c.relname "name", case c.relkind when 'r' 'table' when 'v' 'view' when 'i' 'index' when 's' 'sequence' when 's' 'special

VBA assign a range to an Array from different sheet -

i have 2 different sheets , have assign 2 ranges these 2 sheets 2 different array problem can not specify sheet before range e.g dim flarr() variant flarr = sheets("xxx").range(a1:a10) this gives me error. workaround? thanks look @ differences between code , mine. remove parenthesis after variant variable, let excel figure out array. need include range in quotations , specify want values range. dim flarr variant flarr = sheets("xxx").range("a1:a10").value hope helps :) you less common construction this, awkward. dim arr() variant redim arr(1 10) arr() = sheets("xxx").range("a1:a10").value hope helps

Dailymotion: This `redirect_uri' ([URL]) isn't allowed by `client_id' configuration -

i working dailymotion sdk php: https://github.com/dailymotion/dailymotion-sdk-php specifically, following instructions here test: https://github.com/dailymotion/dailymotion-sdk-php#authorization-grant-type when try run code, api key , secret generated, getting following error: this redirect_uri' ([url]) isn't allowed by client_id' configuration. where [url] specific application url invoking code. looking @ configuration application in dailymotion, see "application website" same [url], there no discrepancy. i not seeing settings or configurations issue suggest url not allowed. any thoughts, ideas or suggestions why wouldn't work such? you set callback url when create api key @ http://www.dailymotion.com/settings/developer security reason, redirect_uri starting callback url provided accepted, otherwise api returns error message mention. if redirect_uri has contain dynamic part, can use slug way when specify application callback

c# - why does my web api client call not work in Raspberry Pi2 Iot -

i have code: private const string route = "/api/print"; public bool update(string header, string tc) { bool success = false; using (var client = new httpclient()) { client.baseaddress = new uri("my uri"); client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); var print = new print { companyref = new guid(), header = header, tc = tc }; var response = client.putasjsonasync(route, print); } success = true; return success; } public sealed class print { public string header { get; set; } public string tc { get; set; } public system.guid companyref { get; set; } } i call so: update(" header", " string tc"); in c# desktop app works. in windows 10 iot on raspberry pi2 device not work. yet, when calling web api server *in iot) works fine. ? i using code year , w

multithreading - Android | RecyclerView doesn't work -

i want create recyclerview few cardview s in it. start thread in oncreate of activity. there data server , put in list. create adapter recyclerview, doesn't work. here code: here create adapter , should fill cardview s in: listadapter adapter = new listadapter(posts); recyclerview rv = (recyclerview)findviewbyid(r.id.post_list); rv.setadapter(adapter); here adapter class public class listadapter extends recyclerview.adapter<listadapter.postviewholder> { list<post> posts; public listadapter(list<post> posts) { log.d("listadapter", ""); this.posts = posts; } @override public int getitemcount() { log.d("getitemcount", ""); return posts.size(); } @override public postviewholder oncreateviewholder(viewgroup viewgroup, int i) { log.d("oncreateview", ""); view v = layoutinflater.from(viewgroup.getcontext()).inflate(r.layout.insert_layout, viewgroup, false); postvi

javascript - Reading a .config file -

currently have file called router.js set follows: var server = require('mongodb').server; var mongodb = require('mongodb').db; var dbport = 31979; var dbhost = '40.117.155.19'; var dbname = 'node-login'; i to set this: var server = require('mongodb').server; var mongodb = require('mongodb').db; var dbport = readconfig(dbport); var dbhost = readconfig(dbhost); var dbname = readconfig(dbname); how go accomplishing this. have file such test.config, , able read dbport, dbhost, , dbname .config file in router.js. you store config json file , read directly: config.json { "dbport": 31979, "dbhost": "40.117.155.19", "dbname": "node-login" } router.js var server = require('mongodb').server; var mongodb = require('mongodb').db; var config = require('./config.json'); var dbport = config.dbport; var dbhost = config.dbhost

magento - ultimo theme brand slider dont work -

i have magento ultimo theme have set brand slider on home page shows 4 brands images. have 6 brands. first 4 ore shown , doesnt slider other have idea? here code: {{block type=”brands/brands” template=”infortis/brands/brand_slider.phtml” breakpoints=”[0, 1], [320, 2], [480, 2], [768, 3], [960, 4], [1280, 5]” move=”1″ pagination=”1″ block_name=”our brands”}} you must add "brands/brands" system-permissions-blocks

php - showing images in autocomplete results -

i stored image urls in column b of database , hope show them in picture form in autocomplete results. tried compose code follows, gives urls in text format. can solve it? many thanks. index.php <script type="text/javascript"> $(document).ready(function(){ $("input[name='search']").autocomplete({ source:'search.php', minlength:1 }); }); </script> <input type="text" name="search" required/> search.php $keyterms = $_get['term']; $query = $database->query("select * table '%".$keyterms."%' order asc"); while ($row = $query->fetch_assoc()) { $data[] = $row['b'];} echo json_encode($data); something : $keyterms = $_get['term']; $query = $database->query("select * table '%".$keyterms."%&

mysql - Storing timezone in a database -

i using mysql , php , need store timezone in db. spent bit reading on it, , seems need use america/los_angeles , , not pst , pacific standard time , pst8pdt , +02.00 , etc. do store whole america/los_angeles string, or there sort of integer id such https://stackoverflow.com/a/11580459/1032531 describes c#? if string, maximum number of characters? the timezone strings america/new_york refer entries in so-called zoneinfo data base. read this. https://www.iana.org/time-zones it's presently maintained internet assigned numbers authority. changes lot, because maintainer scrambles keep changes daylight saving rules , other temporo-political stuff. on unix-like systems entries stored in filesystem directory hierarchy, , not code number. you asked: do store whole america/los_angeles string yes. is there sort of integer id it? no, not if want application , data base future-proof. there time_zone_id in part of mysql holds zoneinfo data, nobody has

python - Difference between nltk.parse.recursivedescent and nltk.parse.rd? -

would please explain difference between 2 python modules nltk.parse.recursivedescent , nltk.parse.rd? it seems former automatically included when import nltk ipython, interested in using 1 of methods included in latter (nbest_parse), mentioned in the 2009 print edition of book "natural language processing python" omitted in current on-line version. method outdated, , use in place see multiple options parsing ambiguous sentence without falling infinite loop "parse_all". thanks in advance.

c# - How to pass the value from child form to parent form? -

i have 2 forms called billingform (parent form) , searchproduct (child form). billingform code private void textboxproductno_keydown(object sender, keyeventargs e) { if(e.keycode==keys.f9) { using(searchproduct sp=new searchproduct) { sp.showdialog(this); } } } public void updatedtext(string fromchildform) { textboxproduct.text=fromchildform; } searchproduct form code (child form) private void datagridview1_keydown(object sender,keyeventargs e) { if(e.keycode==keys.enter) { billingform bf=(billingform)this.owner; //error appear here bf.updatedtext("hello world"); this.close(); } } i getting error message. an unhandled exception of type 'system.invalidcastexception' occurred in billingsoftware.exe additional information: unable cast object of type 'billingform.mdiparent' type 'billingform.billingform try pass parent constructor , use in var

vim - One mapping to toggle NERDTree and open to current file when toggling on -

i'm trying find way have normal mode mapping can toggle nerdtree, when toggling on, tell nerdtree find current file. i know nerdtreetoggle , nerdtreefind , , i'm looking combination of 2 commands. here's use case: when nerdtree not open, can hit <c-\> , nerdtree open current file. i can hit <c-\> again , nerdtree close. it :nerdtreetoggle command, need, , add % nnoremap <c-\> :nerdtreetoggle %<cr> in provided nerd tree can find :nerdtree command depends on argument given, , in case of :nerdtreetoggle if no nerd tree exists tab command acts same :nerdtree command.

android - AlertDialog in PreferenceFragment crashes app -

i'm trying create alertdialog in preferencefragment user can confirm he/she wants delete user data. this code i've made: public class settingsfragment extends preferencefragment { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); bundle b = getarguments(); addpreferencesfromresource(r.xml.preferences); preference button = (preference)findpreference(getstring(r.string.delete_user_info)); button.setonpreferenceclicklistener(new preference.onpreferenceclicklistener() { @targetapi(build.version_codes.m) @override public boolean onpreferenceclick(preference preference) { //an alertbuilder new alertdialog.builder(getcontext()) //this line crashes app .setmessage("do want permanently delete likes?\nyou not able restore them!!") .setcancelable(true) .setpositivebutton("yes", new di

javascript - Prevent hovering effect after pointer moves away -

i want display element on hover. following code it. there problem, if hover on multiple times, element keeps displaying many times when cursor goes away. hover on link multiple times in demo understand problem. $('li').hover(function() { $(this).find('.box').delay(100).fadein(); }, function() { $(this).find('.box').delay(100).fadeout('fast'); }); .box { color: #fff; width: 200px; background: #000; position: absolute; display: none; margin-top: 50px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div id="images"> <li> show <div class="box"> lorem ipsum dolor sit amet, consectetur adipiscing elit. fusce eu condimentum odio, non congue quam. cras feugiat nulla @ mattis semper. </div> </li> </div> jsfiddle https://jsfiddle.net/e99afrg8/ jquery anim

python - How to run c++ script written by different version of visual studio in cmd? -

now i'm trying use python subprocess module spawn 2 sub-processes, 1 of them running c++ source code using microsoft visual studio 2010 , 1 running c++ source code using microsoft visual studio 2012. how can achieve that? the python code like: import subprocess subprocess.popen(['run code1 visual studio 2010']) subprocess.popen(['run code2 visual studio 2012']) the reason why want cannot combine these 2 source code together, since use different visual studio system runtime. if know answer or how fix runtime problem, please give me advice, appreciated!!

ios - How does one add a callback or get a notification when play is tapped? -

i have added video view using following code: let url = nsbundle.mainbundle().urlforresource("etude", withextension:"mp4") player = avplayer(url: url!) let playerviewcontroller = avplayerviewcontroller() playerviewcontroller.player = player playerviewcontroller.view.frame = cgrect(x: xpos, y: ypos, width: videowidth, height: videoheight) self.view.addsubview(playerviewcontroller.view) self.addchildviewcontroller(playerviewcontroller) i have other events trigger when user taps play button on player. there way set call when happens or perhaps add observer detect it? yes can register key-value-observing playerviewcontroller.player.rate. looks self.player.addobserver(observer:self,keypath:"rate",options:0,context:nil) then implement func observevalueforkeypath(_ keypath: string?, ofobject object: anyobject?, change change: [string : anyobject]?, context context: unsafemutabl

automatic ref counting - For what variables should you use weak var in Swift? How do I figure out the leaks? -

i building app in swift. creating views in entirely programmatic way. in instances, have viewcontroller instantiates custom views. in addition, may have variables "var user" gets populated after alamofire network call , used in various ui elements throughout view controller. besides declaring delegates weak var, there other rules apply? also, there way me figure out whether have strong reference should weak one? should looking for? the basic concept behind reference counting in swift 1 of ownership . objects should hold strong references other objects "own", in sense they're responsible lifecycle of other object, either alone or in conjunction other objects. a lot of object reference graphs in typical application hierarchical - 1 object owns bunch of other objects, each have own children, etc. example, viewcontroller owns window, window owns views, each view owns subviews, , each subview owns images, strings, or other content displays. th

c - linker can't find libraries -

i can't link program "set-manipulation" libraries needs. here message: gcc -l/home/jenia/learn-c-the-hard-way/lib -lset_theory -g -wall -i/home/jenia/learn-c-the-hard-way/lib/include -o "set-manipulation" main.o /usr/bin/ld: cannot find -lset_theory collect2: error: ld returned 1 exit status makefile:9: recipe target 'set-manipulation' failed make: *** [set-manipulation] error 1 here content of -l/home/jenia/learn-c-the-hard-way/lib : /home/jenia/learn-c-the-hard-way/lib: total used in directory 29 available 216513716 drwxr-xr-x 3 jenia jenia 4096 nov 1 12:47 . drwxr-xr-x 8 jenia jenia 4096 oct 31 11:44 .. drwxr-xr-x 2 jenia jenia 4096 nov 1 12:47 include -rwxr-xr-x 1 jenia jenia 6804 nov 1 12:47 set_theory.a -- 50 -rwxr-xr-x 1 jenia jenia 9664 nov 1 12:47 set_theory.so -- 11 here makefile give error (the makefile of set-manipulation program): prefix?=/home/jenia/learn-c-the-hard-way cflags=-g -wall -i${prefix}/lib/