Posts

Showing posts from July, 2013

erlang - ejabberd - module gen_mod & gen_server with RabbitMq -

i'm developing ejabberd module can send queue directly rabbitmq using ejabberd hook gen_mod behaviour. queue can sent without issue. however, connection rabbitmq server not persistent. sample working code per following : -module(mod_rab). -author('author@domain.com'). -behaviour(gen_mod). -export([start/2, init/2, stop/1, send_available_notice/4]). -define(procname, ?module). -include("ejabberd.hrl"). -include("jlib.hrl"). -include("logger.hrl"). -include("amqp_client.hrl"). start(host, opts) -> ?info_msg("starting mod_rab testing", [] ), register(?procname,spawn(?module, init, [host, opts])), ok. init(host, _opts) -> inets:start(), ssl:start(), ejabberd_hooks:add(set_presence_hook, host, ?module, send_available_notice, 10), ok. stop(host) -> ?info_msg("stopping mod_rab testing", [] ), ejabberd_hooks:delete(set_presence_hook, host, ...

javascript - How to make Node Inspector (v0.12.8) work with Node v6.5.0? -

node inspector of v0.12.8 seems broken when paired node v6.5.0 (at least on os x el capitan). when firing node-debug , browser launched in order debug application per usual, debugger fails due exception caused injectorclient.prototype._findnminscope not finding 'nativemodule' property. see node inspector issue #905 reference. how can node inspector made work node v6.5.0? looks there's native support inspection in node from v6.5.0 , node inspector might no longer required. can invoked so: node --inspect --debug-brk my-app.js. i've tried it, , seems work although i've yet figure out how use it.

maven - Calling IDX MLS SOAP APIs of ihomefinder from Java Spring MVC -

i want use ihomefinder's test apis data , insert own database. using spring mvc , link provided them configured in pom.xml data http://axisws.idxre.com:8080/axis2/services/ihfpartnerservices?wsdl . various searches found provided apis in package com.ihomefinder.api included pom.xml here pom.xml code: <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-ws</artifactid> <version>1.3.1.release</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.jvnet.jaxb2.maven2</groupid> <artifactid>maven-jaxb2-plugin</artifactid> <version>0.13.1</version> <executions> <execution> <goals> <goal>generate</goal> ...

winapi - How can I omit capturing of a button/region using DirectShow APIs? -

i using "push source desktop" filter capturing screen in application. hide application while recording going on. button stopping recording visible on screen. button gets recorded filter. during playback of saved recording button visible along rest of screen region. is there way can prevent button getting recorded ? my aim record screen without button. cannot hide button required stopping recording of application. have tried alter alpha component of button , make semi-transparent. still filter captures semi-transparent button. how can background region of button , ignore capturing of button itself? the problem has nothing directshow. long story short, directshow starts when send image have using directshow api , form factor of software item. your question how display on desktop , grab same desktop excluding part present user. don't think can implement accurately without going in many details, quite can trick this: know position of ui element can ident...

html - float:"left" vs display:"inline-block" -

i have requirement need display 2 divs side side .this basic requirement need build on many functionalities going further. i able achieve in 2 approaches: approach 1: <div id="id1" style="width:100%"> <div id="id2" style="width:100px;color:#0000ff;display:inline-block;border-color: red;border-style: solid;"> <p>this text in div1 element.</p> </div> <div id="id3" style="width:100px;display:block;display:inline-block;border-color:blue;border-color: blue;border-style: solid;"> <p>this text in div2 element.</p> </div> </div> approach 2: <div id="id1" style="width:100%"> <div id="id2" style="width:100px;color:#0000ff;float:left;border-color: red;border-style: solid;"> <p>this text in div1 element.</p> </div> <div id="id3" style="width:100px;display:bloc...

nginx proxy_set_header X-Forwarded-For with allow/deny something wrong -

nginx's conf: location / { deny 192.168.1.1; allow 127.0.0.1/24; deny all; default_type application/json; } if request http://192.168.1.101:8000 no header ,nginx return 403. if request http://192.168.1.101:8000 set header[" x-forwarded-for "] = 127.0.0.1 ,nginx return 200. so how can denied illegal ip's request ?

Does CSS mix-blend-mode work with transform? -

apparently mix-blend-mode doesn't play nice transform-translate , z-index. applying of these text element cancel mix-blend-mode affect. known limitation? there css-based workaround? can use javascript mimic transform-translate functionality, isn't ideal.

How to fix "No way to resolve conflict between "System.Xml" in xamarin android? -

Image
i building android app in visual studio 2015 . working well. getting deployment error. when cleaning , rebuilding of project successful no error. when try run app visual studio tells me deployment error occurred. error in build output: no way resolve conflict between "system.xml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" , "system.xml, version=2.0.5.0, culture=neutral, publickeytoken=7cec85d7bea7798e". choosing "system.xml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" arbitrarily. i have tried on real device too. showing deployment error on device , emulator well.. output: try this. open project in visual studio. right click on solution , select manage nuget packages... select consolidate tab. set packages in same , right version. note 1 : not sure if there's similar in xamarin studio. when got error, removed packages, navigate project folder delete packages...

Handling the screen orientation change in ReactJS -

i trying create component content changes when screen orientation(portrait/landscape) changes. doing: var greeting = react.createclass({ getinitialstate: function() { return {orientation: true} }, handlechange: function() { if ('onorientationchange' in window) { window.addeventlistener("orientationchange", function() { this.setstate({ orientation: !this.state.orientation }) console.log("onorientationchange"); }, false); } else if ('onresize' in window) { window.addeventlistener("resize", function() { this.setstate({ orientation: !this.state.orientation }) console.log("resize"); }, false); } }, render: function() { var message = this.state.orientation ? "hello" : "good b...

wordpress - Update custom price woocommerce -

i developing plugin works woocommerce , need update custom price after submit order in checkout page. question: possible? i have tried with: header('location: http://myweb.com/?add-to-cart=477'); // define woocommerce_review_order_after_submit callback  function action_woocommerce_review_order_after_submit( ) {  $custom_price = 10; // custome price $target_product_id = 477; foreach ( $cart_object->cart_contents $value ) { if ( $value['product_id'] == $target_product_id ) { $value['data']->price = $custom_price; } } }   // add action  add_action( 'woocommerce_review_order_after_submit', 'action_woocommerce_review_order_after_submit'); thanks. you have in hook, 1 overridden after calculating totals, have in woocommerce_before_calculate_totals hook, change add_action call to: add_action( 'woocommerce_before_calculate_totals', 'action_woocommerce_rev...

Recalling data from a text document on python 3 -

i have made script save players names followed scores. i looking recall data python can sorted table in ui. im sure simple solution can find how save text document. players=int(input("how many payers there? ")) open('playerscores.txt', mode='wt', encoding='utf-8') myfile: in range (players): username=input('enter username: ') score=input('enter score: ') playerinfo= [username,score, '\n'] myfile.write('\n'.join(playerinfo)) there multiple ways 1. reopen playerscores.txt file read data store in buffer sort , write again . 2. while tacking input store in buffer sort them , write on txt file. players=int(input("how many payers there? ")) open('playerscores.txt', mode='wt', encoding='utf-8') myfile: playerinfo = [] in range (players): username=input('enter username: ') score...

Smart bit encoding of floating point values (float, double) -

assume have array of floating point values , bottleneck in disk loading , package size limit. how encode values in order reduce data size, given following 3 inputs: absolute error: can remove mantissa bits long final value not different real value amount (this come design, based on screen error visualization of data) minimum floating point value: smallest value in array maximum floating point value: biggest value in array note: if float value small converted 0 (because whole mantissa removed due usage of absolute error, big numbers mantissa left untouched). the order in floating points values appear important (it not points cloud). whichever encoding is, after decoding order should preserved. right not able save many bits possible: i save 3 5 bits in exponent field using min/max values, not able exploit absolute error, nor exploit bits in min/max values. can cut 1 3 mantissa bits if max value not big, here again i'm not optimally using 3 inputs. i'm not ...

node.js - require() node module from Electron renderer process served over HTTP -

typically, in electron app, can require node modules both main process , renderer process: var mymodule = require('my-module'); however, doesn't seem work if page loaded via http instead of local filesystem. in other words, if open window this: win.loadurl(`file://${__dirname}/index.html`); i can require node module without problems. if instead open window this: win.loadurl(`http://localhost:1234/index.html`); i no longer can require node modules inside web page - uncaught error: cannot find module 'my-module' in web page's console. there way use node modules in electron page served on http? a little context: company building application needs ability hosted web application and inside electron shell. make simpler , consistent across both environments, electron app starts local web server , opens app hosted @ http://localhost:1234 . i'd ability add spell checking/spelling suggestions application using electron-spell-check-provide...

c# - Assign value to variable using LINQ in SSIS Script task -

i trying loop through folder. suffix of each file can found in column in sql table. suffix where linq statement , variable in script task (shown on comments). predicate true, want return value column on same row in sql table, , assign other column's value variable in script task. doing messagebox.show test. i have set oledb connection manager in ssis package, i'm not sure how can run linq query inside task, think i'm missing in how have set connection. pointers gratefully received. here's how far i've got: public void main() { string sourcepath = dts.variables["user::sourcepath"].value.tostring(); string archivepath = dts.variables["user::archivepath"].value.tostring(); string destinationpath = dts.variables["user::archivepath"].value.tostring(); sqlconnection conn = new sqlconnection(); conn = (sqlconnection)(dts.connections["server.database"].acquireconnection(dts.transaction) sqlconnection...

javascript - jQuery html() does ignore element naming (lower and bigger case) -

the .html() function jquery turn xml code lowercase. is there other method can receive output expecting? html = $('pre').html(); goal receive following output: <ok:list title="helloworld"></ok> what receive: <ok:list title="helloworld"></ok> complete code: <!doctype html> <html> <head> <title>test</title> <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script> <script> $(document).ready(function(){ var html = $('pre').html(); console.log(html); }); </script> </head> <body> <pre> <ok:list title="helloworld"></ok> </pre> </body> </html> i know xml standard lowercase. in situation can't change xml part. need solution can have wrong.xml displayed 'wrongly'. check out this fiddle . it's not standard if put xml textar...

Error In SSIS on insert -

i have error in ssis pakage don't understand it: error: 0xc0202009 @ insertstudent, insertstudent [303]: ssis error code dts_e_oledberror. ole db error has occurred. error code: 0x80040e57. ole db record available. source: "microsoft sql server native client 11.0" hresult: 0x80040e57 description: "the statement has been terminated.". ole db record available. source: "microsoft sql server native client 11.0" hresult: 0x80040e57 description: "string or binary data truncated.". error: 0xc0209029 @ insertstudent, insertstudent [303]: ssis error code dts_e_inducedtransformfailureonerror. "insertstudent.inputs[ole db command input]" failed because error code 0xc020906e occurred, , error row disposition on "insertstudent.inputs[ole db command input]" specifies failure on error. error occurred on specified object of specified component. there may error messages posted before more information failure. error: 0xc00470...

python - Read a complete data file and round numbers to 2 decimal places and save it with the same format -

i trying learn python , have intention make big data file smaller , later statistical analysis r. need read data file (see below): scalar nd 3 st 0 ts 10.00 0.0000 0.0000 0.0000 scalar nd 3 st 0 ts 3600.47 255.1744 255.0201 255.2748 scalar nd 3 st 0 ts 7200.42 255.5984 255.4946 255.7014 and find numbers , round in 2 digits after decimal, svae maximum number namber in front of ts. @ end save data file same format following: scalar nd 3 st 0 ts 10.00 0.00 0.00 0.00 scalar nd 3 st 0 ts 3600.47 255.17 255.02 255.27 scalar nd 3 st 0 ts**max** 7200.42 255.60 255.49 255.70 i have written code this: import numpy np import matplotlib.pyplot plt import pickle # open file f = open('data.txt', 'r') thefile = open('output.txt', 'wb') # read , ignore header lines header1 = f.readline() header2 = f.readline() header3 = f.readline() header4 = f.readline() data = [] line in f: line = line.strip(...

Powershell get current time for Asia/Manila -

i working powershell retrieves timesheet information biometric device. 1 of search arguments used query timesheet date , time. currently, retrieve date , time in local machine powershell installed. code inside powershell script getting date is: get-date -format yyyy-mm-dd however, if changes date , time of computer, query gets affected. there way retrieve current datestamp asia/manila using powershell? dont want use local machine time anymore. you can convert date universal time before formatting string: (get-date).touniversaltime().tostring('yyyy-mm-dd')

css - How to style current menu parent and item -

i need assistance in wordpress project i'm working on. 1 of pages having submenus; want style such if click on submenu, both parent menu , clicked submenu take on styling. have tried targeting , styling current-menu-parent , current-menu-item classes seen on inspect element doesn't achieve desired result. tried current_page_parent / item classes, no avail. please note i'm working offline wamp. assistance appreciated. the parent page not have class "current_page_item" or "current-menu-item" anymore, because child-page current. to solve this, wordpress adds class parent menu-item of current page. class called "current_page_ancestor", apply desired styling class aswell.

javascript - Regex to remove unwanted space between unique characters -

we using ocr extract text images. 1 of annoying problems ocr, got sometime unwanted space, because ocr found word big tracking between characters. for example got: var text = "cha blis 1 er cru controleec b e u r o y c chablisienne" i tried do: test.replace(/([a-z])\s(?=[a-z]\b)/, '$1') but if so, got results: cha blis 1 er cru controleecbeauroyc chablisienne but expected results should be: cha blis 1 er cru controleec beauroyca chablisienne my absolute need regroup single character but, not change other words. if: var text = "cha blis 1 er cru controleec beau r o y c chablisienne" it should output: cha blis 1 er cru controleec beau royca chablisienne i didn't succeed yet after hours spent found right combination. ps : no difference of treatment has done between upper , lowercase. if need stick single separated letters together: \b([a-za-z])\s+(?!\w\b) live demo otherwise use single \b word boundary token...

java - Apache commons configuration regex expression interpretation -

on current project, use apache commons configuration read configuration files our applications , tests. i've noticed peculiar behaviour regular expressions in configuration files. we have property regex can find correct files in input folders, example: file_pattern = (xpto(\d{3})).input this find files name starts xpto followed 3 digits, example xpto001.input. the problem in systems expression works, while in others same libs requires \d escaped, works like: file_pattern = (xpto(\\d{3})).input i've read documentation of apache commons configuration , java properties , failed find configuration/setting change this. can me identify affects behaviour? thank you.

android - How to remove transparent Toolbar padding when collapsed in CollapsingToolbarLayout -

Image
i use collapsingtoolbarlayout in app when collapsed, there marginleft , marginright in toolbar picture below. when set toolbar background not transparent ,such red,it normal. how should remove margin? i want below background transparent xml code <android.support.design.widget.appbarlayout android:id="@+id/appbarlayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/transparent"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/toolbarlayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:collapsedtitlegravity="center_horizontal" app:layout_scrollflags="scroll|exituntilcollapsed" app:popuptheme="@style/themeoverlay.appcompat.light" app:expandedtitlegravity="center_horizontal...

hadoop - Getting YARN action application ID in subsequent action -

i running oozie workflow , doing map distributed model fitting within map-reduce action. there many mappers, have written code compiles yarn logs of mapper tasks using yarn logs -applicationid application_x application_x parent application id of map tasks. want make summarization part of workflow need application_x dynamically application id of previous action. there way can this? i have not tested this, think can workflow el function: wf:actionexternalid(string node) returns external id action node, or empty string if action has not being executed or has not completed yet. so in node after map reduce job has completed, should able use likel wf:actionexternalid('mapred-node-name') i suspect return job_xxx instead of application_xxx, can handle ok.

Unable to send emails with attachment using Groovy -

i not know why unable import class multipartemail . seems code not work unless multipartemail class imported. // importing groovy classes import org.apache.commons.mail.*; // create attachment emailattachment attachment = new emailattachment(); attachment.setpath("libraries/pictures"); attachment.setdisposition(emailattachment.attachment); attachment.setdescription("company logo.jpg"); attachment.setname("mycompany"); // create email message multipartemail email = new multipartemail(); email.sethostname("255.255.255.0"); email.setport("25") email.addto("addemailhere", "name"); email.setfrom("from@anywhere.net", "sam"); email.setsubject("email groovy"); email.setmsg("test email"); // add attachment email.attach("company logo.jpg"); // send email email.send();

html - Table with fixed-width columns - without specifying table width -

i'm looking way create table fixed-width cells. when window narrow, horizontal scroll bar should appear. in example, there 2 400px columns, therefore table should 800px wide. when screen width less 800px, horizontal scrollbar appear. that's exact behavior, i'm looking for: http://jsbin.com/xeniwovole/edit?html,css,output and question: can done without specifying table width? in real life, table have dynamic amount on columns , column widths responsive. therefore, it's not reasonable try calculate table width sum of column widths. use min-width , max-width rather width on table cells. prevent table resizing <td> fit table @ 100% width, default behaviour. #wrap { overflow-x: auto; } table { table-layout: fixed; width: auto; } td { background-color: yellow; min-width: 400px; max-width: 400px; } <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="view...

python - https GET behind proxy succeeds with wget + TLSv1, but fails with requests even if ssl protocol is forced to TLSv1 -

i'm trying file via https using requests 2.11.1 python 2.7.12 , openssl 1.0.2h (all installed anaconda) on macos 10.11.6 behind proxy. according ssllabs , server supports tls 1.0, 1.1, , 1.2. moreover, can retrieve file wget (linked openssl 1.0.2h) if explicitly set secure-protocol tlsv1 (but not if set unsupported protocols sslv2). however, if try explicitly set secure protocol used requests tlsv1, tlsv1_1, or tlsv1_2, e.g., follows, from requests_toolbelt import ssladapter import requests import ssl s = requests.session() p = ssl.protocol_tlsv1 s.mount('https://', ssladapter(p)) r = s.get("https://anaconda.org/conda-forge/matplotlib/2.0.0b3/download/osx-64/matplotlib-2.0.0b3-np111py27_5.tar.bz2") i encounter following exception: /users/lebedov/anaconda2/lib/python2.7/site-packages/requests/adapters.pyc in send(self, request, stream, timeout, verify, cert, proxies) 495 except (_sslerror, _httperror) e: 496 if isinstance(e, ...

java - StringBuffer is seem double the String Names -

can please tell me why happening sometimes, looks of in files short names: stringbuffer rbuffer = new stringbuffer(""); file realname = new file(filename[2]); system.out.println(" # realname "+realname); //todo delete returns: realname c:\users\ricar\workspace\tergum\bin\tergum\me\**tbfs.class** rbuffer.append(realname.getname()); system.out.println(" # rbuffer "+rbuffer); //todo delete retuns: rbuffer **tbfs.classtbfs.class** longer names ok short names when stringbuffer seem double is. sorry forgot add buffering realname many thanks in request more details, here belive happens: both variables of codes initiated "null" it's new: here bigger snip of code , happens: while ((lineinsrc = dbbuffer.readline()) != null){ matcher m = filepattern.matcher(lineinsrc); string[] filename = lineinsrc.split(csvsplitbysrc); realname = new...

android - Having trouble getting the correct search suggestions for Icelandic letters? -

using here android sdk, i'm having trouble getting search suggestions (textsuggestionrequest(string)) special characters, e.g. 'Þ' in Þrastarhöfði or 'Æ' in Ægisgata . can suggest way around problem, perhaps if convert strings in someway before searching? the latest here android sdk has introduced textautosuggestionrequest api has improved language support. search request perform similar functionality textsuggestionrequest, returned items contain additional location information... instead of strings.

Android - Accessing storage locations -

ok, quick heads new android programming. have basic experience java uni. i've been messing around android studio , app building samsung galaxy tab. sorry if has been asked before couldn't see it. i have tried make app displays names of files on sd card. @ top level. made quick interface button , text view start (i'm away single text view wont display list had problems got anyway) ended following code. *public void showfolder(view view){ textview test = (textview)findviewbyid(r.id.view); root = new file(environment.getrootdirectory().tostring()); file[] files; files = root.listfiles(); string[] file_list; file_list = root.list();* i ran using debugger see ended in both array lists. ran code 3 times on varied "environment.getrootdirectory" "getexternalstoragedirectory()" , "getdatadirectory()". only getrootdirectory version return anything.in both other instances debugger shows null both files , files_list...

reactjs - How to use node_modules that are not in my directory in React Native? -

i have project folders project/nativeapp , nativeapp folder react native project resides. want use npm libraries, required const react = require('react') . thing is, want have 1 package.json , node_modules/ whole project in project folder 1 npm install needed. how require libraries "one level up" in file system?

Why can't I retrieve data from historian in Bluemix Watson IoT Platform ? -

for past week, error message http 503 when trying query historical data 1 one of devices. working , application has not been modified. device has not been changed. data correctly supplied (according dashboard). has ibm changed interface or service has been disabled? solution worked on month without error. what can cause historical data in bluemix watson iot platform not accessible? earlier month, "built-in" historian feature watson-iot withdrawn. please use last value cache access recent events device. in addition last value cache, old timeseries historian has been replaced managed connector watson iot platform ibm cloudant nosql db service on bluemix. see these blog posts more details: notice of withdrawal of ‘built-in’ time series historian component of ibm watson iot platform enhanced data storage capabilities ibm watson iot platform

echo - How to print name and version of a tool in cmd in one line? -

i want print version of e.g. packer in cmd. works packer --version . unfortunately prints version number - not name of tool. case other tools (e.g. virtualbox, etc.), too. c:\_temp λ packer --version 0.10.1 λ vboxmanage --version 5.1.4r110228 so idea somethink echo packer & packer --version prints in 2 lines: c:\_temp λ echo packer & packer --version packer 0.10.1 now, how can print name + version number in 1 line? result looks like: packer 0.10.1 virtualbox 5.1.4r110228 assign result of version environment variable for /f %a in ('packer --version') set version=%a then echo echo packer %version% explanation: you're looping on output of packer --version (there's 1 line though version gets set one) if need 1 token line can specify eg "tokens=2" second space delimited token. note: these commands work command line. use in batch file turn %a %%a.

unity3d - Unity locked in an infinite loop -

Image
i updated unity pro latest version (5.4.0f3) , have editor entering infinite loop @ specific time in game. looks loops inside unity code in scenetracker::flushdirty (i selected instruction looping) i have no idea cause this, hoped here have same problem + solution.

c++ - Simple way of returning the length of the string to output -

i writing program prints out user-entered string , length. able part: #include <iostream> #include <string> using namespace std; int main() { string x; getline(cin, x); cout << "you entered: " << x << "string length/size is: "<< /* comes here ? */ <<endl; } rest of process remains incomprehensible. there's function belongs string object, in case x.length() return length of string.

wpf - Break Points Only Working When Project Run From Certain Locations -

i have issue visual studio doesn't break @ of breakpoints message: the breakpoint not hit. no symbols have been loaded document i have tried pretty relevant-looking solutions able find no success @ (including the answers here ). luckily, have version on .git working @ time of pushing it, tested cloning repository on various drives see happen: c: (local) - run other projects , have never experienced issue. however, can't use breakpoints project. y: (remote) - departmental drive, have done lot of debugging in past without issue. the break points worked here! h: (remote) - personal network drive - break points did not work here. i tried moving project folder around in drives, same results each i lost , appreciate @ all! happy run more tests if can think of any. it turns out being caused post-build action, ilmerge.bat : cmd echo parameter=%1 cd %1 copy wpffiledeleter.exe temp.exe echo "..\..\ilmerge.exe" "..\..\ilmerge.exe"...

python - unable to install package using pip -

i trying install module using pip , error: $ pip install virtualenv collecting virtualenv downloading virtualenv-15.0.3-py2.py3-none-any.whl (3.5mb) 100% |████████████████████████████████| 3.5mb 312kb/s installing collected packages: virtualenv exception: traceback (most recent call last): file "/library/python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/basecommand.py", line 215, in main status = self.run(options, args) file "/library/python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/commands/install.py", line 317, in run prefix=options.prefix_path, file "/library/python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_set.py", line 742, in install **kwargs file "/library/python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install.py", line 831, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) file "/library/python/2.7/site-packages/pip-8.1.2-py2.7.egg/pip/req/req_install....

How can I provide parameters for webpack html-loader interpolation? -

in html-loader documentation there example require("html?interpolate=require!./file.ftl"); <#list list list> <a href="${list.href!}" />${list.name}</a> </#list> <img src="${require(`./images/gallery.png`)}"> <div>${require('./components/gallery.html')}</div> where "list" come from? how can provide parameters interpolation scope? i template-string-loader does: var template = require("html?interpolate!./file.html")({data: '123'}); and in file.html <div>${scope.data}</div> but doesn't work. have try mix template-string-loader html-loader doesn't works. use template-string-loader images in html not transformed webpack. any ideas? thank you

javascript - JSON object - which structure makes more sense? -

i'm learning json & javascript objects , trying figure out best way structure object particular project. i think i've mapped out object pretty well, i've thought of 2 different ways of doing , i'm not sure 'better' , implications of doing 1 way rather other. { "session": { "sessionid": "", "sessiontitle": "", "sessiondescription": "", "clientname": "", "sessiontopics": [{ "topicnames": [ "name of first topic", "name of second topic", "name of third topic", "name of fourth topic", "name of fifth topic" ], "topicchoices": [ ["a", "c", "a", "b", "e", "a...

c# - Pure CSS popup WITHOUT Javascript on DropDownList Change -

i have users group policies block javascript; use of out of question. i have found page performs function need: pure css popup box however, popup triggered after anchor clicked. my issue issue want popup trigger on event change in asp:dropdownlist. intent if item not listed in ddl, user able select first item "not listed". after selection need have popup open elements allow them add items database populates ddl. i have attempted use following in ddl onselectedindexchanged event: response.redirect(httpcontext.current.request.url.absoluteuri.tostring() + "#popup1"); this idea has failed. believe because have inside update panel. setup follows: <asp:content id="content3" contentplaceholderid="contentplaceholder1" runat="server"> <!-- main wrapper --> <div class="wrapper wrapper-style2"> <div class="container"> <!-- breadcrumbs --> <br /> ...

asp.net - How to allow anonymous user access to virtual directory -

i preventing anonymous users access root application. /web.config <system.web> <authorization> <deny users="?" /> </authorization> </system.web> but allowing anonymous access public resources (images, css, etc.): <location path="images"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> now, add virtual directory should accessible anonymous users. added configuration based on images path, whenever try access location, redirected login page returnurl set virtual directory. <location path="virtualdirectory"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> in addition, tried specify global authorization within virtual directory's web.config...

How to modify a responsebody compressed with an unsupported algorithm with fiddler -

i want modify responsebody. however, data compressed brotli, fiddler not support. want set response breakpoint. when fiddler break on response. decompress data tool, modify , compress modified data. copy modified data fiddlerscript , save fiddlerscript. but find response breakpoint breaks after response arrived. when resave fiddlerscript, script won't work on breaked response. how can modify responsebody compressed unsupported algorithm? you can install compressibility add on http://www.telerik.com/fiddler/add-ons . adds brotly support fiddler @ present.

c# - How to downcast this to the base class? -

i have class hierarchy: public abstract class aclass : someframeworkclass { [workonthisproperty(with.some.context)] private myobject myproperty { get; set; } public override void onsomethinghappened() { externalframework.workon(this); } } public class bclass : aclass { // ... snip ... } externalframework operating on this : instance of bclass need operate on this instance of aclass because externalframework works on type of object passed in , not go inheritance hierarchy. how can downcast this aclass externalframework can detect myproperty ? i've tried casting this object , aclass , , casting directly aclass cast unnecessary doesn't seem run. can this? edit: externalframework cheeseknife . trying inject couple views base fragment class has reusable logic while child fragment classes implement specific behaviour tuning. the problem private members of class can accessed inside of same class. with code: class { private string...

sql - sqlite3 query return field from table1 based on information from table2 -

product: sqlite 3 i very, new sql. @ time, not know how ask question properly. i have 2 tables, tablea , tableb. tablea has following relevant columns: | itemid | itemname | tableb has following relevant columns: | typeid | i want query return itemname each typeid based on limited knowledge , searching, i've started looking sql join type statements, i'm having difficulty figuring out. any advice or direction appreciated. if have common values in itemid , typeid can join on them like select t1.itemname table1 t1 join table2 t2 on t1.itemid = t2.typeid;

c# - Issue integrating Action Delegate, Extensions, and Anonymous Type together -

so playing extensions, action , func in c# in trying mimic way ruby handles iteration on collections. idea objects (that enumerable) handle own iterations. got success extensions , delegates alone , have code below working expected; using system; using system.collections.generic; using system.linq; public class student{ public int studentid { get; set; } public string studentname { get; set; } public int age { get; set; } } public static class extensions { //for when need operations on items in collection public static void foreach<t>(this ienumerable<t> items, action<t> action){ foreach(var item in items){ action(item); } } //for when want return modified collection public static ienumerable<t> foreach<t>(this ienumerable<t> items, func<t,t> action){ foreach(var item in items){ yield return action(item); } } } public...

Parse unpleasant string in ruby to derive a condition -

i have response string gets returned webservice isn't json exactly, nor other kind of hashable object, can serialize. i'm new regex i'm trying learn how can extract needed pieces ruby code. the string horrendous, i'm not sure how go comparing two. don't know regex that's hindrance. thank in advance can provide. the parameter passed partialresult method should valid json. can use regex, extract string. require 'json' hsh = json.parse str.scan(/partialresult\((.*)\)/)[0][0] #=> {"q"=>"laptop bag", "r"=>[["laptop bag", [["electronics", 3944]]], "laptop bags 15.6 inch laptops", "laptop bags women", "laptop bag 15.6", "laptop bags 17.3 in laptops", "rolling laptop bag", "laptop bag wheels", "laptop bag 17\""]} to check common string hsh["r"].flatten && hsh["q"].flatten #=> ...

oauth - IdentityServer3 - Incremental Authorization (leastprivilege) -

i'm looking have client access token (reference token) scope access call api 1, api 1 call api 2, api 2 call id3 add scope (if client allow) access token. if possible? yes possible, need endpoint on id3 project adds/writes scope same repository/datastore iscopestore uses.

actionscript 3 - How to Save X Y Position Object in Variable and in Array by AS3? -

how put value x , y position in variable , array object = (xposition , yposition) box_mc.x = 300 , box_mc.y = 200 try improve question. is wanna do? import flash.geom.point; var p:point = new point(200,300); box_mc.x = p.x; box_mc.y = p.y; you may store values in bi-dimensional array here bellow : var a:array = [[200,300],[150,200]]; box_mc.x = a[0][0]; //200 box_mc.y = a[0][1]; //300 or in case have stored 2 values posx , posy : box_mc.x = a[1][0]; //150 box_mc.y = a[1][1]; //200 you may check links understand difference between different kind of types may store values : actionscript 3 fundamentals: arrays actionscript 3 fundamentals: associative arrays, maps, , dictionaries actionscript 3 fundamentals: vectors , bytearrays

java - Unable to update the required cell values in the excel using apache poi? -

below program trying update birds column value(ex:duck) not updated after "parrot" value.i want output below.can 1 me resolve this. program: package config; import java.io.fileinputstream; import java.io.fileoutputstream; import org.apache.poi.xssf.usermodel.xssfcell; import org.apache.poi.xssf.usermodel.xssfrow; import org.apache.poi.xssf.usermodel.xssfsheet; import org.apache.poi.xssf.usermodel.xssfworkbook; import org.testng.annotations.test; public class writing { @test public void test() throws exception { fileinputstream f1=new fileinputstream("d://xl4.xlsx"); xssfworkbook w1=new xssfworkbook(f1); xssfsheet s1=w1.getsheetat(0); xssfcell c = null; xssfrow r = null; int rows=s1.getphysicalnumberofrows(); for(int i=0;i<=rows;i++) { r = s1.getrow(i); if(r == null) { s1.createrow((short) (i)).createcell(1).setcellvalue("duck"); } } fileoutputstream f2=new fileoutputstream("d://xl4.xlsx"); w1.w...

javascript - Add class to element depending on which side of the screen its on -

i making timeline theme , need have separate class posts on right side of screen , left side of screen. don't see wrong javascript of course not working. var halfscreenwidth = jquery(document).width() * 0.5; var timelinepost = jquery('.blog .post'); jquery(document).ready( function(){ timelinepost.each( function(){ if( this.position().left < halfscreenwidth ){ jquery(this).addclass('timeline-left'); } else{ jquery(this).addclass('timeline-right'); } }); }); made few modifications @ https://jsfiddle.net/zlv4s0ur/26/ . if( this.position().left < halfscreenwidth ) should if( jquery(this).position().left < halfscreenwidth )

Spring MVC Test with RestTemplate: Generic collection fails (even with ParameterizedTypeReference) -

i working spring framework 4.3.1 i have following domain class @xmlrootelement(name="persona") @xmltype(proporder = {"id","nombre","apellido","fecha"}) public class persona implements serializable { @xmlelement(name="id") @jsonproperty("id") public string getid() { return id; } .... where each getter has @xmlelement , @jsonproperty annotations. working jaxb2 , jackson2 i have following too: @xmlrootelement(name="collection") public class genericcollection<t> { private collection<t> collection; public genericcollection(){ } public genericcollection(collection<t> collection){ this.collection = collection; } @xmlelement(name="item") @jsonproperty("collection") public collection<t> getcollection() { return collection; } public void setcollection(collection<t...

jquery - CSS transition display: block -

i looked @ other subject , did same : add padding, height, opacity. but have no transition css above. can tell me why ? when touch button adds class .show div contactemote : #contactemote{ display: none; top: 0px; background-color: #f65b61; width: 100%; z-index: 2000; opacity:0; clear: both; height: 0px; padding: 0 8px; overflow: hidden; -webkit-transition: .3s ease .15s; -moz-transition: .3s ease .15s; -o-transition: .3s ease .15s; -ms-transition: .3s ease .15s; transition: .3s ease .15s; -webkit-box-shadow: 0px 4px 35px -1px rgba(0,0,0,0.68); -moz-box-shadow: 0px 4px 35px -1px rgba(0,0,0,0.68); box-shadow: 0px 4px 35px -1px rgba(0,0,0,0.68); } #contactemote.show{ top: 0px; display: block; height: 100px; opacity: 1; padding: 8px; } you cannot transition elements if toggling display between block , none . try changing rules visibility: hidden , visibility: visible . ...

vector - When I try to get data from MySQL database to jtable same data repeats in the jtable -

try { connection getconnection = getdatabase_connection.getconnection(); statement getsstatement = getconnection.createstatement(); resultset getresultset = getsstatement.executequery("select * ap_database.ap_details"); defaulttablemodel setdefaulttablemodel = (defaulttablemodel) jtable1.getmodel(); vector setvector = new vector(); while (getresultset.next()) { here set data resultset vector setvector.add(getresultset.getstring("s_no")); setvector.add(getresultset.getstring("ap_rm")); setvector.add(getresultset.getstring("ap_serial")); setvector.add(getresultset.getstring("ap_gname")); setvector.add(getresultset.getstring("ap_ci")); setvector.add(getresultset.getstring("ap_co")); setvector.add(getresultset.getstring("ap...

Is it possible to read commandline arguments when running R interactively? -

this question has answer here: how pass command-line arguments when source() r file 4 answers i've got r script run via rscript i'd able run interactively in r play of resulting data - problem is, tries read commandline arguments via commandargs , doesn't seem work in r interactive shell. i'd able start r shell commandline arguments i'd pass script , have read them when source script. $ r arg1 arg2 r version 3.1.2 (2014-10-31) -- "pumpkin helmet" copyright (c) 2014 r foundation statistical computing platform: x86_64-pc-linux-gnu (64-bit) ... > args <- commandargs(trailingonly = true) > args character(0) > source("myscript.r") ... fails because myscript.r depends on args arg1 , arg2 don't seem passed along r shell. if pass command line arguments this: r --args 1 2 , can access them follows: > ...

java - ArrayIndexOutOfBoundsException when trying to implement circular queue using arrays -

Image
above diagram assignment page for homework assignment have implement circular queue using arrays. have conditions working except case in strings "i", "j", "k", "l" appended. result of action, of new values in array supposed loop around beginning. however, arrayindexoutofboundsexception when appending 2nd letter. the debugger further traces issue tostring method, can't understand problem is. any advice? public class circulararrayqueueapp { public static void main(string[] args) { circulararrayqueue queue = new circulararrayqueue(10); string[] data1 = {"a", "b", "c", "d", "e", "f", "g", "h"}; string[] data2 = {"i", "j", "k", "l"}; (string adata1 : data1) queue.enqueue(adata1); system.out.println(queue.first()); system.out.println(queue); (int = 0...