Posts

Showing posts from July, 2010

matplotlib - Overwriting Existing Python Plots with New Function Call -

i overwrite existing plot made in python new function call. produce plot, @ it, call same function again different arguments produce plot. second plot replace first plot. is, don't want 2 figure windows open; original window overwritten. i have tried using interactive mode when plotting (ion()), placing plot() , show() calls in different places, , clearing figures. problems have that: 1. can never overwrite , existing window, open more 2. show() blocks code continuing , unable perform 2nd function call 3. use interactive mode , window appears second before going away what i'm trying seems simple enough, i'm having great difficulty. appreciated. write plotting function like def my_plotter(ax, data, style): ax.cla() # ax.whatever rest of plotting return artists_added and call like data = some_function() arts = my_plotter(plt.gca(), data, ...) or do fig, ax = plt.subplots() and call plotting function like arts = my_plotter(ax, data, ....

javascript - My simple routing is not working and I can't figure out why -

i'm working through basic node tutorial , having difficulty getting routes.js file work. it working earlier today. server node reading file. reason, though not utilizing it. code looks tutorial -- though teacher on pc , on mac (though can't see why matter). before issue started occur, hooked database (file below) -- again, can't see why screw routes. when put code in server.js, can proper routing. help me stackoverflow, you're hope! see "cannot /" my routes.js file var user = require('../models/user'); module.exports = function(app){ app.get('/', function(req, res){ res.send("hello world"); }); // app.get('/:username/:password', function(req, res){ // var newuser = new user(); // newuser.local.username = req.params.username; // newuser.local.password = req.params.password; // console.log(newuser.local.username + " " + newuser.local.password); // newuser.save(function(err...

design - Abstract Factory method practice or usage of abstract factory pattern in an API -

first of sorry may sound quite stupid while asking this. i want understand practical usage of abstract design pattern. apis have implemented pattern , under use case. one of use case strikes me di of objects need created using run time information. i have understanding pattern used create object of various product families. every new product family have change existing factories. if there addition implementation of product family have provide new factory new implementation. for example i have products frame , textbox 2 types of os ( windows , mac). have 2 factories 1 each window , mac windowfactory returns textbox , frame windows , macfactory return same objects mac. want add os solar in case need write new factory returns corresponding objects solar. how api use patterns in real world? if using java can check entitymanagerfactory, has method create entitymanager, entity manager has different configuration depend on type of entitymanager (hibernate, openjpa, et...

html - Align text to image in auto-width container that stretches to image width -

here fiddle https://jsfiddle.net/qyljxwrv/1/ . as can see left , right titles aligned screen corners, while align them image corners. trying 2hours without success... .wrapper { position: absolute; left: 0px; right: 0px; top: 0px; background-color: rgba(213,213,213,.5); text-align: center; } .info { text-align: left; } .right-title { float: right; } <div class="wrapper"> <div class="inner"> <div class="info"> <span class="left-title">left</span> <span class="right-title">right</span> </div> <img src="http://i.imgur.com/crcopps.jpg" /> </div> </div> note don't want titles appear inside image, above , aligned left , right corner of image. it seems can simply, , see comments inline. updated demo .wrapper { display: table;...

How to allow input from terminal to contain spaces in perl -

i trying create program allows name entered user , prints name , whether or not found in column of file , how many times found. have far allows user enter name since names have spaces returns name not found because can't detect exact string. here's have: #!/usr/bin/perl use warnings; use strict; %author; $input; $firstauthor; open ($input, "<", 'gwas_catalog_v1.0-downloaded_2015-07-21.tsv') || die(); while (<$input>) { @r = split (/\t/); $firstauthor = $r[2]; $author{"$firstauthor"}++; } print "\nenter name: "; $usrin = <stdin>; chomp $usrin; if (exists $author{"$usrin"}) { print "$usrin seen $author{"$usrin"} time(s).\n\n"; } if (!exists $author{"$usrin"}) { print "$usrin isn't author of contained in file.\n\n"; } the problem solved adding quotation marks surround $usrin inside $author{"$usrin"} .

javascript - WordPress AJAX call not executing PHP -

i'm trying custom ajax action on wordpress isn't working. have following form: <form method='post' name='form-bid-<?php echo get_the_id() ?>' class="bid-form"> <input type='submit' name='<?php echo get_the_id()?>' value='licitar' class='bidvalue'> <?php wp_nonce_field('ajax-bid-nonce', $post->id); ?> </form> the form way because it's generated inside loop, 1 every post on site, therefore use post id unique name input. then, capture form submit on custom javascript file: jquery(document).ready(function($) { // perform ajax bid on form submit $('form.bid-form').on('submit', function(e) { var action = 'ajaxbid'; var auction_id = e.target.name.substring('form-bid-'.length); var security_container = "#".concat(auction_id); var security = $(security_container).val(); $.ajax({ type: ...

linux - How to pass encrypted password for execution of a script from Command Task to call pmrep -

scenario i working on code execute pmrep command. cannot execute unix box code pages different ( unix server executing pmrep command , power centre installed), , dont have other option exceute unix box, because dont have sudo login , connecting citrix , informatica not installed locally. so have come option of putting pmrep commands in .sh script , passing username, password,environment , path variables env file. executing above script command task in workflow. i able execute pmrep commands (connect, deploy dg etc) using above process. now comes problem. i saving username , password in .env file. remove this. for pmrep connect command, passing -x $password, pass encrypted password in place of original password. have used pmpasswd utility encrypted password , stored in variable (encrypted_password) used variable in place of orginal. -x $encrytped_password used variable -x $encrypted_password. where -x used general password , -x used environmental password both ...

bash - awk read float precision: cannot read small floats, e.g. 4e-320 -

i cannot awk or gawk read small floats in scientific notation , interpret them correctly floating point numbers. i want output numbers above small threshold awk. example : consider following input: 4 3e-20 4.5e-320 3 1e-10 i want threshold 1e-15, following: echo -e "4\n3e-20\n4.5e-320\n3\n1e-10" | awk '$1 > 1e-15' which gives output: 4 4.5e-320 3 1e-10 of course, 4.5e-320 not pass 1e-15 threshold, awk , gawk fail reject it! i looked (g)awk floating point precision. seems apply only arithmetic operations within awk. so, replacing awk '$1 > 1e-15' gawk -v prec="double" '$1 > 1e-15' fails. fails prec="quad" thus, conclude (g)awk not reading 4.5e-320 float, instead string? i expected output awk version 3.1.5. i output awk version 3.1.7. you can force awk convert string number adding 0 it. so try awk script instead: printf '4\n3e-20\n4.5e-320\n3\n1e-10\n' ...

vba - Run macro on another worksheet from one sheet Excel -

i have 2 excel workbooks (wb1, wb2). want able run macro wb1 run macro on wb2. macro want run on wb2 in wb2. want click button run wb2 macro on wb2. you can use application.run run macro on different workbook. assuming wb2 open, , macro want run called macroname can use following ... application.run "wb2!macroname" from within wb1

php - Can someone please explain this mysql statement to me -

i trying learn mysql on own debugging php program. stuck. not understand particular statement or does: $statusrequirements = array( array(80*1024*1024*1024, 0.50, 0.40), array(60*1024*1024*1024, 0.50, 0.30), array(50*1024*1024*1024, 0.50, 0.20), array(40*1024*1024*1024, 0.40, 0.10), array(30*1024*1024*1024, 0.30, 0.05), array(20*1024*1024*1024, 0.20, 0.0), array(10*1024*1024*1024, 0.15, 0.0), array(5*1024*1024*1024, 0.10, 0.0) ); $db->query("update users_main set requiredstatus=0.50 access>100*1024*1024*1024"); in simple english understand this: database query update users_main , set required status 0.50 access greater 100 * 1024 * 1024 * 1024. what don't understand significance of numbers 100*1024*1024*1024. could please explain me? if doing code inspection , reading code, 1 way be: "in table users_main , update requiredstatus field 0.50 rows have access field greater 10g."

transactions - @TransactionAttribute without @stateless or @stateful ? J2EE 6 - JBoss EAP 6 -

if specify @transactionattribute on class, not specify @stateless or @stateful, behavior ? session bean, or @transactionattribute ignored. ?? @stateless @transactionattribute(transactionattributetype.required) public class photosserviceimpl implements photosservice vs @transactionattribute(transactionattributetype.required) public class photosserviceimpl implements photosservice without @stateless can't inject other ejbs. if instantiate without doing injection, transactionattribute wouldn't kick in anyway. so yes, transactionattribute on non ejb class have no effect.

Rails[PaperTrail]: accepts_nested_attributes_for not restored -

i'm using papertrail gem. have 3 models faq , subgroup , , group . group has one-to-many relationship subgroup , , subgroup had has-and-belongs-to-many relationship. papertrail doesn't support habtm changed has-many-through. when destroy faq reverted correct subgroup associations. group on other hand accepts_nested_attributes_for :subgroups , seems why fails. subgroup gets destroyed whenever parent group gets destroyed; papertrail won't restore subgroup when parent group restored. however, can see there versions subgroup , papertrail isn't getting called restore them. how can so? group.rb class group < activerecord::base has_many :subgroups, :dependent => :destroy, inverse_of: :group validates :name, presence: true #validates :subgroups, length: { minimum: 1 } accepts_nested_attributes_for :subgroups, :allow_destroy => true has_paper_trail end subgroup.rb class subgroup < activerecord::base belongs_to :group, ...

Android: When is WakeLock needed? -

if have intentservice updates sharedpreference , (partial) wakelock needed? i understand wakelock keeps cpu awake, when needed? if need keep cpu running in order complete work before device goes sleep, can use powermanager system service feature called wake locks. wake locks allow application control power state of host device. creating , holding wake locks can have dramatic impact on host device's battery life. should use wake locks when strictly necessary , hold them short time possible. example, should never need use wake lock in activity. one legitimate case using wake lock might background service needs grab wake lock keep cpu running work while screen off. again, though, practice should minimized because of impact on battery life. unfortunately, poorly-coded, malicious, or buggy apps might create abnormal amount of undesirable wakelocks. other apps require constant internet access in order operate in normal fashion - facebook , messenger popular repres...

fbx - Unreal Engine 4, import with c++? -

i need import fbx ue4 using c++. write batch importer sets material connects etc upon import. i am, however, stuck @ first hurdle. i cannot find info on anywhere. how can load fbx model editor using c++ ? edit: i not need @ runtime, need import models editor, , adjust location/material settings so.. parse .fbx (there enough docs), create mesh @ runtime 1 way. if need editor stuff, check out fbxmainimport.cpp ffbximporter::openfile fbxnode* getfirstfbxmesh(fbxnode* node, bool bisskelmesh) etc...

email - Ruby send mail with DSN -

using gem mail , considering http://www.sendmail.org/~ca/email/dsn.html want this: mail = mail.new mail.delivery_method :smtp, :address => 'smtp.server.com', :port => 25 mail.from = 'sender@smtp.server.com' mail.to = '<recipient@yet.another.server.com> notify=success orcpt=rfc822;recipient@yet.another.server.com' mail.deliver! and error: ...ruby/2.1.0/net/smtp.rb:957:in `check_response': 501 5.1.3 bad recipient address syntax (net::smtpsyntaxerror) then try monkey-patching (i know it's dirty): class net::smtp def rcptto(to_addr) if $safe > 0 raise securityerror, 'tainted to_addr' if to_addr.tainted? end # replace # getok("rcpt to:<#{to_addr}>") # getok("rcpt to:<#{to_addr}> notify=success,failure,delay orcpt=rfc822;#{to_addr}") end end and works fine it's ugly ( does know more legal , beauty solution? according documentation source co...

r - rollapply mean 5 previuous years -

i have zoo obj colled z. > z["2013-12",1] allerona 2013-12-01 0.0 2013-12-02 0.0 2013-12-03 0.0 2013-12-04 0.0 2013-12-05 0.2 2013-12-06 0.0 2013-12-07 0.0 2013-12-08 0.2 2013-12-09 0.0 .... it stores daily value of rainfall. i'm able compute 5-days accumulation using rollapply usingi: m=rollapply(z, width=3, fun=sum, by=1, by.column=true, fill=na, align="right") it looks ok > m["2013-12",1] allerona 2013-12-01 0.0 2013-12-02 0.0 2013-12-03 0.0 2013-12-04 0.0 2013-12-05 0.2 2013-12-06 0.2 2013-12-07 0.2 2013-12-08 0.2 2013-12-09 0.2 ... how can calculate each day themean 5-years before? thanks sma (x, n=5*365) does not trick ?

excel - VBA Loop to target certain cells based on criteria -

i trying achieve macro loops through column d , based on value want color in multiple cells on specific row value exists. needs happen each row meets criteria can seem work when active cell has been selected not automated process. here have far: sub validate() dim rng range dim row range dim cell range set rng = range("d4:d1000") each cell in rng if cell.value = "building blocks" activecell.offset(, 16).interior.colorindex = 7 elseif cell.value = "test" cell.interior.colorindex = 4 end if next end sub any appreciated. i didn't want rewrite code you, made few changes yours: sub validate() dim rng range dim row range dim cell range dim counter long set rng = range("d4:d1000") range("d4").select each cell in rng if cell.value = "building blocks" activecell.offset(counter, 16).interior.colorindex = 7 elseif cell.value = "test" activecell.offset(count...

c# - SqlDataAdapter doesn't delete a record -

i use dataset store data , sqldataadapter work database. for change records in database first edit rows (insert,edit,delete) datatable in dataset .. then datarow dr = datasetmain.tables["tbl_error"].select("error_name='" + error.name + "'")[0]; datasetmain.tables["tbl_error"].rows.remove(dr); sqldataadapter adp = new sqldataadapter("select * tbl_error", svariable._databaseconnectionstring); sqlcommandbuilder bui = new sqlcommandbuilder(adp); adp.update(datasetname,tbl_error); for insert or edit record every thing work charm ... delete not work .. i`m sure row in tbl_error deleted adp.update won't delete database ... how can find problem ? calling rows.remove() equivalent call rows.delete() + acceptchanges(). due acceptchanges, update() don't modification. then replace: datasetmain.tables["tbl_error"].rows.remove(dr); by dr.delete()

How to modify _source parameters in Elasticsearch mapping? -

i'm new elasticsearch (elk) , i'm working on project done external company, won't support i'm trying making changes myself. what i'm trying changing field name, since data coming elasticsearch has changed bit. if run this: curl 'http://localhost:9200/_search?pretty' i mappings (i guess word). looks (simplified bit): { "_index" : ".kibana", "_type" : "visualization", "_id" : "count-by-clusters", "_score" : 1.0, "_source":{ "title":"count clusters", "visstate":"{ "type": "histogram", "params": {}, "aggs": [ { "id": "1", "type": "terms", "schema": "group", "params...

Using Django with Bootstrap Dynamic Tabs -

when use bootstrap dynamic tabs requires me use ids in list anchor tags. whereas rather use url django page {% url 'incidents:report' %} . how can use django url , still maintain functionality? bootstrap dynamic tabs work hiding/displaying inline content within specific divs. need content loaded inline, either through sort of script (like ajax request), or iframe: <div id="menu1" class="tab-pane fade"> <iframe style="border:none" src="{% url 'incidents:report' %}"></iframe> </div>

arrays - Manipulating Matched values in Regex C# -

i have read text file , matched data interested in. question is, best way manipulate data have matched? code reading text file is. openfiledialog dialog = new openfiledialog(); dialog.filter = "all files (*.*)|*.*"; //dialog.initialdirectory = "c:\\"; dialog.title = "select text file"; if (dialog.showdialog() == dialogresult.ok) { string fname = dialog.filename; // selected file label1.text = fname; if (string.isnullorempty(richtextbox1.text)) { var matches1 = regex.matches(system.io.file.readalltext(fname), @"l10 p\d\d\d r \s\s\s\s\s\s\s") .cast<match>() .select(m => m.value) .tolist(); richtextbox1.lines = matches1.toarray(); } the result looks like: l10 p015 r +4.9025 and need this: #2015=4.9025 l10 excluded, p015 turns #2015 , r , + turn = , , number sta...

C reverse shell issues -

i need setup reverse shell in order connect device connected internet through gprs modem. when special conditions occours, start command on public server fixed ip nc -l 65535 then i'll make code run (now i'm directly connected device through cable test purposes) (and yes, fork useless in case i'll need in final scenario, kept it) #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> int reverse_shell() { pid_t p = 0; /* fork */ p = fork(); if (p == 0) { char *shell[2]; int i,fd; struct sockaddr_in sin; /* open socket */ fd = socket(af_inet, sock_stream, 0); sin.sin_family = af_inet; sin.sin_addr.s_addr = inet_addr("my server public ip address"); sin.sin_port = htons(65535); /* connect! */ connect(fd, (struct sock...

vbscript - Replace with regex keeping part of the pattern -

in example below, how preserve part of pattern? pattern search must include closing tag </h3> spans elsewhere must not targeted. example: remove </span> </span> text </h3> : regex.pattern = "</span>[^>]*</h3>" hr2 = regex.replace(hr2,"[^>]*</h3>") '<- not work you need set capturing group , use reference in replacement pattern. regex.pattern = "</span>([^>]*)</h3>" hr2 = regex.replace(hr2,"$1</h3>") or regex.pattern = "</span>([^>]*</h3>)" hr2 = regex.replace(hr2,"$1")

jquery - Ajax request will scroll to the top after success. -

get_queue_data() gets called every 10 secs, calls ajax query every 10 sec. issue each time after ajax call gets called, page scrolls top. of solutions online tell me use preventeventdefault. tried passing variable function get_queue_data, , tried calling preventeventdefault. still doesn't work. tried returning false get_queue_data function. get_queue_data(); setinterval(get_queue_data,10000); function get_queue_data() { $.ajax({ url: '/a/order/order_process/all_queues_data', datatype: 'json', async: true, success: function (data) { for(var k=0;k<22;k++) { chart.series[k].addpoint([data.all_queues_data[k]['messages']]); var temp_series = chart.series[k]; average_chart_data[k] = (temp_series.data[temp_series.data.length-1].y+(average_chart_data[k]*(temp_series.data.length-1)))/(temp_series.data.length); } //console.log(average_chart_data, last_value_chart_data); ...

PHP save array made of dictionary items into MySQL table -

i’m trying save array in php table in mysql database. php receives array in json format. array made of list of dictionaries following: { {“first_name” : “sam”, “last_name”: “smith”, “email”: sam.smith@domain.com}, {“first_name” : “mike”, “last_name”: “detman”, “email”: mike.detman@domain.com}, {“first_name” : “linda”, “last_name”: “bennett”, “email”: linda.bennett@domain.com}} the question simplest way save database table corresponding columns keys “first_name”, “last_name”, , “email”? many answers on web suggest using php function serialize(). method seems work saving 1 column table, may not working saving records multiple columns. (i might wrong…..) others suggest using query “insert table (…) values(….)”. method seems working adding single record. can suggest way realize task? thank you! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ input far... here php code trying use loop (i'm dummy on php, please don't laugh if see nonse...

Batch For loop "was unexpected at this time." -

i having issue running batch file, seems hung @ loop , tells me following: \%y\%m unexpected @ time here code: %%y in (2014) ( echo %%y %%m in (jan feb mar) ( if exist %~dp0%%y\%%m ( echo applying updates %%m %%y %%f in ("%~dp0%%y\%%m\*.*") ( echo installing "%%~ff" wusa "%%~ff" /quiet /norestart ) ) ) any ideas on why getting error? loop variables case-sensitive, need replace %%y %%y . also consider using quotes: if exist "%~dp0%%y\%%m" (

css - HTML column below minimum width in Wordpress -

Image
on downloads overview page download manager plugin wordpress there multiple columns , shortcode column overlaps author column. i've set column's minimum width 175px when window resized still shrinks below it's minimum width. .column-wpdmshortcode{ -webkit-font-smoothing: subpixel-antialiased; border-bottom-color: rgb(225, 225, 225); border-bottom-style: solid; border-bottom-width: 1px; border-collapse: separate; color: rgb(50, 55, 60); display: table-cell; font-family: 'open sans', sans-serif; font-size: 14px; font-weight: normal; height: 22px; line-height: 19.6000003814697px; padding-bottom: 8px; padding-left: 10px; padding-right: 10px; padding-top: 8px; text-align: left; vertical-align: middle; width: 77px; word-wrap: break-word; min-width: 175px; } all inherited css properties: http://spencerlarry.com/docs/all-inherited-styles.txt i'm wondering how it's poss...

vb.net - Parser not recognizing a dash -

Image
my program makes calculations on physics vectors , allows copy/pasting websites , tries parse them x, y, , z components automatically. i've come across 1 website ( http://mathinsight.org/cross_product_examples ) has (3,−3,1). while looks normal, minus not recognized vb. visually, longer normal minus (− , -), return same unicode of 45. picture shows unicode every character (i added minus in front of first 3 comparison) in textbox. also, website, had use ctrl+c because right clicking shows not simple html. one valid (the first), second gives vb fits shown below. either won't compile (shown blue line below) or simple assignment (the second one) wrecks havok on form. i have tried using vectorstring.replace("–", "-") and pasting in longer dash target string , normal keystroke dash replacement, nothing happens. i'm guessing since both have same unicode. is there way convert longer, invalid dash 1 recognized vb? tried using dash s...

R igraph Visualizing weighted connections -

Image
i've been playing around igraph in r , having trouble using weights when visualize network. have read may not work every layout type should fruchterman-reingold. my code , output below (i tried 2 different versions of layout function, think doing same thing, tried both in case) i expect cecil , bob close in vers1 because of high weighting on relationship, doesn't seem happen. when create additional rows bob , cecil (vers2) seem occur, that's going pain want larger data set. i post images of i'm getting, i'm new stack overflow , didn't have enough reputation points. any ideas? in advance. code: #vers1 library(igraph) relations <- data.frame(from=c("bob", "cecil", "cecil", "david", "david", "esmeralda"), to=c("alice", "bob", "alice", "alice", "bob", ...

Filter JavaScript Object by value -

i have object array: var result = [ { appaddress:"127.0.0.1", name:"appserver1", dbconnection:"" }, { appadress:"", name:"dbserver1", dbconnection:"server=.;database=master;integrated security=sspi" }]; now need name values (into array), appaddress isn't empty. tried array.filter() , $.map() none of these methods seems want. this tried: var appservers = $.map(result, function (val, key) { return (key == 'appaddress' && val.length > 0) ? key : null; }); and var appservers = result.filter(function (entry) { return entry['displayname']; }); for filtering can use filter , map methods of array . see below example. array.prototype.filter docs array.prototype.map docs var result = [{ appadress: "127.0.0.1", name: "appserver1", dbconnection: "" }, { appadress: "", name: ...

Cypher code for loading relationships into neo4j ignoring data in csv column -

i'm loading relationships neo4j. worked fine me: using periodic commit 500 load csv headers "<link topic relationships.csv>" csvline match (work:work {id: csvline.recordidentifier}),(topic:subject {topic: csvline.topicid}) create work-[:isabout]->topic; but similar scenario not working me: neo4j-sh (?)$ load csv headers "<link authorrel.csv on github>" csvline match (c:creator { name: csvline.creatorid}), (w:work { id: csvline.recordidentifier}) create c-[:created]->w; +--------------------------------------------+ | no data returned, , nothing changed. | +--------------------------------------------+ 493 ms neo4j-sh (?)$ this part works, neo4j-sh (?)$ load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/master/graphdata/authorrel.csv" csvline return csvline; and works neo4j-sh (?)$ load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/m...

windows 10 - Microsoft Edge doesn't open pages via 'microsoft-edge:' protocol and NetBIOS name as a hostname -

i'm trying start edge command line, using 'microsoft-edge:' protocol, e.g. typing in cmd.exe or powershell "start microsoft-edge:http://microsoft.com" . works cases, not when use netbios name (network name of computer in domain or workgroup) hostname, e.g. "start microsoft-edge:http://win-12345678:1337" local machine or "start microsoft-edge:http://mycompanyintranetserver" . i have 2 vmware player 7 virtual machines 32-bit , 64-bit builds of windows 10240, , virtualbox 5.0 32-bit build of 10240, , in both configurations when first execute such command, works. next attempts not work @ (new browser tab doesn't open, nothing happens). can not open new tabafter command execution, close tab or close browser @ all. also, doesn't happen when use ip-address, or 'localhost' on local machine, e.g. "start microsoft-edge:http://localhost:1337" or "start microsoft-edge:http://10.0.0.5" can executed number of...

javascript - Private prototype methods that can share scope and access the instance -

i'm looking pattern both allows me create private scope function prototype has access , need able access instance within scope. for example, how achieving "private methods" (disregard code does, @ structure.) function infopreview() { this.element = document.createelement('div'); } //private methods infopreview.prototype.__newline = function () { this.element.appendchild(createelement({tagname:'br'})); }; infopreview.prototype.__padleft = function(level) { var padding = createelement({tagname: 'span'}); this.element.appendchild(padding); $(padding).width(level * 10); }; infopreview.prototype.__print = function(string) { var span = createelement({ tagname: 'span', textcontent: string }); this.element.appendchild(span); this.element.style["margin-right"]='10px'; }; infopreview.prototype.__puts = function(string) { this.__print(string); this.__newline(); }; //public methods infopreview.protot...

Set up a cron job using values from a database in a java servlet -

i have servlet in query db2 due_dates , need send reminder emails customers. i know how set cron jobs weekly or daily tasks standalone java class not know how take output of query , use set job in cron scheduler. how can schedule cron job using due_dates values ? youd better of having cron run every day/12 hours or whatever , send emails due rather trying schedule cron

javascript - How to make a range of dates avaible in DatePicker mvc4 -

i have method generate range of dates. want make range of dates avaible in datepicker , rest of dates has disabled. this jquery: ;(function($) { $(function() { $("form.xforms-form").bind({ xforms_enrich: function(e) { if ($.fn.datepicker) { $("input.qmatic-dateslot", e.args.data).each(function() { var inp = $(this); if (inp.is(":disabled")) return; var tabindex = inp.attr("tabindex"); var dateformat = $.xforms.getproperty(inp, 'dateformat') || 'd-m-yy'; dateformat = dateformat.replace(/m/g, '0').replace(/h/gi, '0').replace(/t/g, '').replace(/m/g, 'm').replace('yyyy', 'yy'); $("#" + inp.attr("id") + " ~ button.ui-datepicker-trigger").attr(...

Can the Access Subform control property "show page header and page footer" be set using VBA -

the "show page header , page footer" property appears in properties panel can't find on msdn pages: subform.properties how can set value of property using vba? the name of property showpageheaderandpagefooter . in order access value, must reference via subform control's properties collection: ? forms!form2!child0.properties("showpageheaderandpagefooter").value false however, if want change property value, form must open in design view: docmd.openform "form2", acdesign forms!form2!child0.properties("showpageheaderandpagefooter").value = true ? forms!form2!child0.properties("showpageheaderandpagefooter").value true if attempt alter value when form not in design view, access throws error #2136, "to set property, open form or report in design view."

php - Does not get Response in HWIOAuthBundle -

i have installed hwioauthbundle. login facebook bundle. after successful login, no response. see blank screen. my config file is: hwi_oauth: firewall_name: secured_area resource_owners: facebook: type: facebook client_id: xxxxxxx client_secret: xxxxxxx scope: "email" infos_url: "https://graph.facebook.com/me?fields=id,name,email,picture.type(square)" paths: email: email profilepicture: picture.data.url my security file is: security: providers: hwi: id: hwi_oauth.user.provider firewalls: secured_area: anonymous: ~ oauth: resource_owners: facebook: "/login/check-facebook" login_path: /login use_forward: false failure_path: /lo...

actionscript 3 - Why not stop the program when they break point? -

i did project in as3 , used code: public class main extends sprite { public function main() { if (stage) init(); else addeventlistener(event.added_to_stage, init); } private function init(e:event = null):void { removeeventlistener(event.added_to_stage, init); // entry point var numar:number = 10; //here put breakpoint var rectangle:shape = new shape; // initializing variable named rectangle rectangle.graphics.beginfill(0xff0000); // choosing colour fill, here red rectangle.graphics.drawrect(0, 0, 100,100); // (x spacing, y spacing, width, height) rectangle.graphics.endfill(); // not needed put in end fill addchild(rectangle); // adds rectangle stage } } } this app 1 test. example want stop program when variable created , see value. if press f5 run program continue , not stop @ breakpoint. i...

jasper reports - How to create multiple chart using single query result data -

i have query returning me 40 row each row has number_of_bugs_closed , closed_date. closed_date value rage may , jun month. now have create 3 report chart in jasperreports graph show number of closed bugs every day. graph show number of closed bugs every week. graph show number of closed bugs every month. can create these 3 chart using single query result data, or have create 3 different queries? is possible in jasper using script or other way? i hope might use kind of date check in query. where date between may , jun instead create 2 parameters, $p{timecheck} , $p{timerange} . in which, $p{timecheck} parameter used in query time comparison , parameter $p{timerange} used derive value of parameter $p{timecheck} . pass different $p{timerange} value different charts while mapping parameters , example, month chart $p{timerange}='month' , week chart, $p{timerange}='week' , everyday chart, $p{timerange}='all' . parameter $...

qlikview - VBScript Task scheduler not working? -

i trying schedule vbscript using windows task scheduler. doesn't require user interaction. open qlikview application file , download reports no user interaction needed. it works fine when run manually, problem when try run using task scheduler qlikview application not getting opened. process seems running in background (i checked task manager). i have scheduled task : start program : c:\windows\system32\cscript.exe arguments : c:\script_location\script.vbs i have tried creating batch file , scheduling that. didn't work out any idea how fix this? i'm guessing qlikview launched vbscript looking user interaction, possibly licensing or database connection configuration. check windows event application log application pop-ups see pop-up messages qv.exe may have displayed.

php - Need Vimeo API for Upload from URL -

i developing video streaming site , using vimeo server host video's , vimeo has great set of api releases. according requirement want upload video's youtube/gdrive/dropbox/box/onedrive etc. there way upload video's url? looking @ vimeo documentation have api endpoint called automatic (“pull”) uploads takes video url sounds looking for.

java - elasticsearch flushrequest.full() depricated between 1.3.2 and 1.7 -

i'm upgrading java code builds elasticsearch index elasticsearch 1.3.2 1.7 , spring-data-elasticsearch 1.2.1.release. all except class destroy function client.admin().indices().flush(new flushrequest(index_name).full(true)); now fails. full() no longer valid method. i'm guessing default option , can away client.admin().indices().flush(new flushrequest(index_name)); but i'm struggling find definitive documentation. could tell me!? thanks. that appears case somewhat. @ least seems felt not necessary. here link change. https://github.com/elastic/elasticsearch/commit/45dc3ef705676771e250fdafae5098a6cab9dc11

compare string with * character javascript -

is possible compare strings this?: string1 = "abc/def/ghi/*" string2 = "abc/def/ghi/jkl/mno" if (string1 == string2){ //do sth } i mean - * character on end of string1 . in web searchers use * or ? , possible in comparing strings? not using == sign. if remove * can use indexof var string1 = "abc/def/ghi/"; var string2 = "abc/def/ghi/jkl/mno"; if (string2.indexof(string1)>=0){ //do sth }

java - Reading file and store in vector -

i'm reading file: name1 wordx wordy passw1 name2 wordx wordy passw2 name3 wordx wordy passw3 name (i) wordx wordy passw (i) x x word x words words x words at moment can print line line: line 1: name1 wordx wordy passw1 line 2: name2 wordx wordy passw2 i plan have access to: users [0] = name1 users [1] = name2 users [2] = name3 .. passws [0] = passw1 passws [1] = passw2 passws [2] = passw3 .. my code is: public static void main(string args[]) throws filenotfoundexception, ioexception { arraylist<string> list = new arraylist<string>(); scanner infile = null; try { infile = new scanner(new file("c:\\file.txt")); } catch (filenotfoundexception e) { e.printstacktrace(); } while (infile.hasnextline()) { list.add(infile.nextline()+","); } string liststring = ""; (string s : list) { liststring += s + "\t"; } string[] parts =...

MYSQL: SQL debit / credit -

editing previous question, simplified (i hope!) problem. let's go. we have table in fiddle: http://sqlfiddle.com/#!9/42250/1 we have 3 different id_customer, need select made transactions in 2 or more id_shop. in effect have data query: select distinct(id_customer) transaction t1 exists (select id_customer transaction t2 t2.id_shop_where_transaction_is_done != t1.id_shop_where_transaction_is_done , t2.id_customer = t1.id_customer) and data 64982 , 64984. now need calculate credit / debit between shop(s), , having result table following: +------------+-------+--------+ | | debit | credit | +------------+-------+--------+ | trastevere | 5.50 | 0.00 | | monti | 2.00 | 5.50 | | prati | 0.00 | 2.00 | +------------+-------+--------+ why "trastevere" in debit of 5.50? because id_customer 64984 has charged 11.00 in trastevere , spent 5.50€ in monti. why "monti" in credit of 5.50? because id_custom...

html - How to add space between inline-block elements? -

to clear, not want remove space between inline-block elements - want add it. what want have grid of menu items have 2, 3 or 4 items line, i'd achieve using media queries. how can add space between li items, have no margin on left , right sides of each row ? (padding not fix this.) can achieve using css? * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border: solid 1px; font-size: 0; } #main { max-width: 450px; margin: 0 auto; } .item { display: inline-block; width: 200px; } .item img { width: 200px; } .clearfix { overflow: auto; } li { list-style-type: none; } <div id="main"> <li class="item clearfix"> <a href="project.html"> <div class="thumb"> <img src="http://static01.nyt.com/images/2015/06/23/business/greece-portraits-restauranteur/greece-portraits-restauranteur-mediumthreebytw...

swift - Update label in custom UITableView Cell -

i need update label clicking on button in same cell. why code doesn't work ? @ibaction func actionfaveunfave(sender: anyobject) { let cell = self.tableview.cellforrowatindexpath(sender.indexpath) println(cell?.labelfavedtimes) cell.labelfavedtimes = "22"} cell?.labelfavedtimes.text = "22" btw self.tableview.cellforrowatindexpath(sender.indexpath) can return nil if cell not visible

objective c - Identify iOS peripheral advertising in background -

i work on ios application acts bluetooth peripheral. need implement searching ios peripheral non ios centrals. i’m faced problem while ios application advertising in background mode. when advertising in foreground, central can read primary service uuid advertising data, when advertising in background, can’t see name or uuid of peripheral – there apple manufacturer data in advertising packet. the essence of problem lies in fact non ios central can’t determinate – advertising peripheral in background or other peripheral in background. have connect every ios device advertising in background, enumerate services service uuid. the documentation says during background advertising service uuids go special “overflow” area , ios devices can read specifying service in cbcentralmanager’s scanforperipherialwithservices method. looks apple have ability check background advertising packet data service uuid. after searching on found interesting information service hashed uuid. background mod...

plone - Brain attributes and ipdb autocomplete -

why ipdb session don't show every attribute of brain autocomplete? example brain.uid exists not listed on ipdb autocomplete. black magic on brain code? with ipdb can autocomplete attributes of brain: >>> dir(brain) ['__add__', '__allow_access_to_unprotected_subobjects__', '__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__getslice__', '__getstate__', '__hash__', '__implemented__', '__init__', '__len__', '__module__', '__mul__', '__new__', '__of__', '__providedby__', '__provides__', '__record_schema__', '__reduce__', '__reduce_ex__', '__repr__', '__rmul__', '__setattr__', '__setitem__', '__setsli...

Getting the username of SystemUser in a C# console application (Dynamics CRM) -

is there way username (or fullname or of off systemuser) in regular c# console application? if whoamirequest , use userid retrieve "systemuserentity" organizationservice, says there's no entity name 'systemuser'. if try make request userid odata rest endpoint (for example: http://localhost:8081/testorg/xrmservices/2011/organizationdata.svc/systemuserset(guid '58a30c1a-3730-e511-80c8-080027c078bd' ), keep getting 401 forbidden, although if paste link browser, of info need. far understand, because have authentification when using browser. so, possible question "how correct authentification in c# console application talk odata rest endpoint". retrieving fullname once have user id works this: // guid userid = ... var username = service.retrieve("systemuser", userid, new columnset("fullname")).getattributevalue<string>("fullname"); caveat being, have use logical names (all lowercase) instead o...