Posts

Showing posts from March, 2015

sql - error- Each column has to have a unique name when you’re returning the query -

i trying run reporting services below sql query select ca.callingpartynumber, ca.originalcalledpartynumber, case when calledpartylastname not null ca.calledpartylastname + ',' + calledpartyfirstname else p1.name end, p1.location, p1.dept, p1.title, case when callingpartylastname not null ca.callingpartylastname + ',' + callingpartyfirstname else p3.name end calldata.calldetailreport ca join ps_bc_peoplesource_base p1 on ca.originalcalledpartynumber = replace(p1.bc_int_phone, '-', '') left outer join ps_bc_peoplesource_base p3 on ca.callingpartynumber = replace(p1.bc_int_phone, '-', '') originalcalledpartynumber in (select replace(bc_int_phone, '-', '') internal_modified ps_bc_peoplesource_base bc_lan_id = 'f7c') --and datetimedisconnect between @startdate , @enddate --1221 i error- “an item same key has been added.” you missing column alias 2 case statement in select query. ssrs uses colu

linux - TCP receiving window size higher than net.core.rmem_max -

i running iperf measurements between 2 servers, connected through 10gbit link. trying correlate maximum window size observe system configuration parameters. in particular, have observed maximum window size 3 mib. however, cannot find corresponding values in system files. by running sysctl -a following values: net.ipv4.tcp_rmem = 4096 87380 6291456 net.core.rmem_max = 212992 the first value tells maximum receiver window size 6 mib. however, tcp tends allocate twice requested size, maximum receiver window size should 3 mib, have measured it. man tcp : note tcp allocates twice size of buffer requested in setsockopt(2) call, , succeeding getsockopt(2) call not return same size of buffer requested in setsockopt(2) call. tcp uses space administrative purposes , internal kernel structures, , /proc file values reflect larger sizes compared actual tcp windows. however, second value, net.core.rmem_max , states maximum receiver window size cannot more 208 kib.

Inserting data from two similar tables into one master table in Sql Server -

table1 -> id, countryfk, companyname table2 -> id, countryfk, companyname, website i need merge table1 , table2 1 master table. know can done below query - insert mastertable(id, countryfk, companyname) select * table1 union select * table2; but, have column, website in table2 isn't there in table1 . need column in mastertable . and more importantly, table1 , table2 have repeating companies same countryfk . eg, ibm @ countryfk=123 present twice in table1 . , table1 have companyname present in table2 . for eg: ibm @ countryfk = 123 present in table1 , table2 . need make sure mastertable not have duplicate companies. please note companyname need not unique. mastertable can have ibm countryfk = 123 , ibm countryfk = 321 . mastertable cannot have ibm countryfk=123 twice. imho, if need ensure both companyname , countryfk not duplicate in mastertable, should add unique index on column. below query selects dist

list - Java calling method from generic class -

is possible. list<?> mylist = getmylist(); class cls = class.forname("com.lab.myclass"); cls = mylist.get(0); cls.getvalue(); create instance fully-qualified name of class , use declared methods? no, if call class.forname , @ compile time know nothing returned class instance. don't know represents class; might interface example. in particular, if class , create instance of it, cannot call methods of except defined in object because, @ compile time, compiler cannot check whether these methods exist. the 2 solutions: first, can use reflection find out methods class has, , call these methods. cumbersome. second, if use class.forname dynamically load classes @ runtime, know classes load. example, might know class implements interface. can cast result of newinstance interface , call methods defined in interface directly. for example: // in file plugin.java interface plugin { void dosomething(); } // in file main.java public class main

php - Invalid cookie on submitting a form with Codeception -

i'm trying test project codeception (acceptance tests). going fine until had submit form paypal button. when debugging shows i submit form "form:nth-child(3)", [uri] https://www.sandbox.paypal.com/cgi-bin/webscr [method] post [parameters] {"cmd":"_s-xclick","hosted_button_id":"buttonid"} error and goes [runtimeexception] invalid cookie: cookie value must not empty i not set cookies during test. , have no clue why firing error up. here's acceptance.suite.yml class_name: acceptancetester modules: enabled: - phpbrowser: url: http://test.mysite.com - \helper\acceptance here's subscriptioncest.php: <?php use \acceptancetester; class subscriptioncest { public function _before(acceptancetester $i) { } public function _after(acceptancetester $i) { } // main function public function run(acceptancetester $i) { $i->am("new use

amazon web services - How to index aws snapshot output? -

here printing snapshots. posted below snapshot print out like, , able print individual snapshots. not sure how great. svc := ec2.new(&aws.config{region: "us-east-1"}) params := &ec2.describesnapshotsinput{ ownerids: []*string{ aws.string("130300684064"), }, } b, err2 := svc.describesnapshots(params) if err2 != nil { panic(err2) } fmt.printf(awsutil.stringvalue(b)) here gets outputted: http://imgur.com/3mnbnxi output: { snapshots: ----0 description: "snapshot multi", encrypted: false, ownerid: "130300684064", progress: "100%!"(missing), snapshotid: "snap-81b1dff6", starttime: 2015-07-21 18:41:54 +0000 utc, state: "completed", volumeid: "vol-5121ebaa", volumesize: 1 },{ ----1 description: "snapshot multi", encrypted: false, ownerid: "130300684064", progress: "100%!"(missing), snapshotid: &quo

Capturing url within text by using regex in xslt code -

this test input: <license> <p>some text (http://creativecommons.org/licenses/by/3.0/) text.</p> </license> desired output: <license xlink:href="http://creativecommons.org/licenses/by/4.0/"> <p>some text (http://creativecommons.org/licenses/by/3.0/) text.</p> </license> basically trying copy url inside text license element not contain attribute xlink:href="http:// ******"> looking in child <license-p> , move url xlink:href attribute on parent (license) and here xslt: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="xs" version="3.0"> <xsl:output method="html" encoding="utf-8" indent="yes" /> <xsl:strip-space elements="*"/> <xsl:temp

php - How to use same callback function for multiple text fields in codeigniter -

i want check if value other integer , float, have written form validation follows, $this->form_validation->set_rules('charge_hour', 'per hour', 'xss_clean|callback_money_type'); $this->form_validation->set_rules('charge_day', 'per day', 'xss_clean|callback_money_type'); $this->form_validation->set_rules('charge_weekly', 'per week', 'xss_clean|callback_money_type'); $this->form_validation->set_rules('charge_monthly', 'per month', 'xss_clean|callback_money_type'); and common call function text filed money_type() public function money_type($charge) { if (is_float($charge) == false && is_int($charge) == false && $charge >= 0) { $this->form_validation->set_message('{what enter here}', 'enter valid charges space.'); return false; } else

Xpages : Time Picker, Cannot type specific time (Domino 9 Server) -

Image
i need regarding time picker in domino 9. i cannot type specific time in textfield. when try put application in domino 8.5, works fine. time picker allows time every 15 mins. , cannot modify using textfield. output should this. (12:13 am) i there solution regarding issue? regards, thanks! [edited] suggest check version , install fp2, since fp corrects bug related default value of pick date . i'm sorry can't test xpage now. [original response] in standard client works (i can edit field), maybe should install fp2 see http://www-10.lotus.com/ldd%5cfixlist.nsf/whatsnew/7ff6a78cb16153d085257d2b0062d7b8?opendocument . mentions: +hoka8rz5kl (lo67745) - fixes issue in xpages correct date (or time) won't show on date time picker. regression in 8.5.3. i tested ibm notes 9 social edition release 9.0.1fp2 shf202 revision 20140804.1000-t00202shf-fp2 (release 9.0.1fp2 shf202)

python - Is it okay to put error-prone code in an OR statement? -

this in python, can applied language. a = none if (not a) or (a+3==5): print("is okay?") is programming practice have a+3 in if statement, though cause error if a none ? i'm relying on or stop before error, seems bad idea me in case a else doesn't support addition, or or statement (in other language) looks @ both values. what best way program this? yes can depend on short-circuiting perform error handling , validation. however in case, logic wrong, need and perform error handling if , (a+3==5): alternatively type checking if isinstance(a, int) , (a+3==5): again short-circuit before reading + operation

java - Requesting multiple scopes in Spring Security Oauth2 version 2.0.7.RELEASE -

we have application using spring-security-oauth2:1.0 . trying change newer version, spring-security-oauth2:2.0.7.release . if don't specify scope or if specify single scope, application works fine. have problem while requesting multiple scopes read,write , used work in previous version. the client requesting has read,write , trust permissions. when using spring-security-oauth2:1.0 , token used call like http://localhost:8080/oauth/token?grant_type=password&client_id=ws&client_secret=secret&scope=read,write&username=user@abc.com&password=temp123 if see scope parameter scope=read,write , requesting way used token scope read , write . if try same thing oauth2 version 2.0.7.release (with post request though), invalid scope exception because tokenrequest is taking read,write single scope. client requesting has read,write , trust permissions read,write not 1 of them. if try scope=write or scope=read , works fine because read or write part

c# - Assembly declaration in Xamarin's custom renderers -

i reading through xamarin forms documentation custom renderers trying make sense of assembly attribute required each implementation of renderer did. took @ c# documentation assemblies , couldn't seem find (simple) explanation. going myentry example outlined in documentation, shed light happening assembly attribute/what does? for sake of clarity, these type of declarations talking about: [assembly: exportrenderer (typeof (myentry), typeof (myentryrenderer))] [assembly: exportrenderer (typeof (myentry), typeof (myentryrenderer))] myentry name of placeholder class in common (pcl or shared) forms library. myentryrenderer name of actual platform specific implementation class in ios/android/wp project. essentially, telling forms, "when need render myentry on platform x, use class myentryrenderer ."

python 3.4 and Django 1.8.3 PIL import issue -

i have django blog-type app articles. i'd attach images these articles. when try that, following error , traceback: environment: request method: post request url: http://[site].com/admin/paper/article/1/ django version: 1.8.3 python version: 3.4.1 installed applications: ('sorl.thumbnail', 'django_mobile', 'event_ticker', 'paper', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles') installed middleware: ('django.contrib.sessions.middleware.sessionmiddleware', 'django_mobile.middleware.mobiledetectionmiddleware', 'django_mobile.middleware.setflavourmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contri

javascript - is reactjs a full ui framework including responsive scaffolding? -

is reactjs full ui framework including responsive scaffolding? think angular provides internal scaffolding bootstrap used provide responsive scaffolding website when using angular. the short answer no. react components render html, can include styling references target css usual.

c# - Button Click event not firing for dynamically created button -

i have created dynamic controls on dropdownlist 's selectedindexchanged event. button 1 of controls. have assigned event button debugger not coming on click event. following code. protected void page_load(object sender, eventargs e) { try { token = session["logintoken"].tostring(); if (!ispostback) { binddata(); fssearch.visible = false; btndownload.visible = false; } else { foreach (htmltablerow row in (htmltablerowcollection)session["dynamiccontrols"]) { tblsearch.rows.add(row); } } } catch { } } private void binddata() { ddlreportname.datasource = svccommon.getreports(token, out message); ddlreportname.datavaluefield = "key"; ddlreportname.datatextfield = &qu

php - RedBean multi table join -

i'm using redbean create time sheet application. here (simplified) db structure: owner id name email project id description owner_id task id description project_id log id start end description task_id the table structure far more complicated above should enough demonstrate issue. there hundreds of log items in task , hundreds of tasks in project. so if wanted log items specific owner , associated tasks , projects along how achieve that? to use sql query data straight forward enough, can choose data want etc if modify data need create beans it. of tables have similar column names redbean wont (or doesn't seem magically) convert data beans. so guess question how construct redbean query, get, getall, fetch, load etc convert data uses each join bean? the closest thing can find traverse method means id recursively go each bean find its' children means returning whole result set , processing it. if fastest way run sql query ,

Visual FoxPro 9 Assign Query to Variable List -

i c# programmer working on legacy foxpro (point of sale) system, , know how assign results of dbf query variable can useful selected data. in c#, flow create model reflecting database table, run query, assign results list of mymodel, , perform subsequent operations on list of mymodel. feeling foxpro different paradigmatically, , i'm having heck of time finding information online. while supervisor way more experienced me, there no-fault communication barrier because different programming eras. can teach new dog trick? what do: myvar = select netinteractivity.status; netinteractivity.dbf netinteractivity; id=myid foxpro doesn't let direct assignment query way. have 2 options: 1) store query result array , use appropriate array element. select netinteractivity.status; netinteractivity.dbf netinteractivity; id=myid ; array astatus * astatus[1] contains value selected store query result cursor , use appropriate field.

sqlite - Android SQLlite Database query not ordering -

i working sqlite query selecting multiple records database table passing ids db table. want when select records should ordered. not ordering, below query please tell me doing wrong. "select * tbl_product productid in (" + makeplaceholders(ids.length)+")"+ " order rating desc"; it returns records match given ids not in order. and here makeplaceholders method public string makeplaceholders(int len){ if(len > 0){ stringbuilder namebuilder = new stringbuilder(); for(int = 0; < len; i++){ namebuilder.append("?").append(","); } namebuilder.deletecharat(namebuilder.length() - 1); return namebuilder.tostring(); } else{ return null; } }

java - What is "Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains)" -

i new in maven , tried creating maven project using command line. when run mvn archetype:generate command line first thing after completion of processes were: choose number or apply filter (format: [groupid:]artifactid, case sensitive contains) i know can skip these pressing enter. wanted know these lines are? googled there no crisp , simple answer given. questions are: why , how choose number, how related filter (as filter , number in or). we can skip these why given maven.. why number 630 displayed. is there default value assigned when skip these lines pressing enter.[this more important] looking sharp , crisp answer or link. update : these few lines before "choose number.." appears.. 1380: remote -> tr.com.lucidcode:kite-archetype (a maven archetype allows u sers create fresh kite project) 1381: remote -> uk.ac.rdg.resc:edal-ncwms-based-webapp (-) 1382: remote -> uk.co.nemstix:basic-javaee7-archetype (a basic java ee7 maven ar chetype) 1383

c# - Clipboard content of closed Windows Universal App -

i write c# windows universal app user can copy file clipboard. if app closed clipboard content gets lost. usability horrible if user can lose clipboard content easily. there way make clipboard content of app persistent in other classic windows application? sample code: public static void copyfiletoclipboard(storagefile file) { datapackage dp = new datapackage(); dp.requestedoperation = datapackageoperation.copy; dp.setstorageitems(new list<storagefile>() { file }); clipboard.setcontent(dp); // not available after app closed clipboard.flush(); } public static void copytexttoclipboard(string text) { datapackage dp = new datapackage(); dp.requestedoperation = datapackageoperation.copy; dp.settext(text); // available after app closed clipboard.setcontent(dp); clipboard.flush(); } //i have tried copy file app folder first has nothing changed. public async static void cacheandcopyfiletoclipboard(storagefile file) { datapackage dp =

batch file - CMD - Ping and traceroute from list of ips -

we have sporadic connection failures when webserver tries connect service on net. there problem trace failure php many reasons. i'm web-programmer , not familiar command-line scripts. can following cmd-script: -there list of ips separated newline in text file (ip_list.txt) -take ip list , ping it, if fails on first attempt - traceroute it -go next ip in file i don't sure want test, here's pretty useful command test ping. enter ping ip_address -l 10 -n 10 directly cmd, change ip_address ip address want. -l 10 - ping ip address 10 bytes of data -n 10 - ping 10 times ping /? - more informations each ip address (line line) in text file, use for /f %%a in (your_file.txt) ( //to ) . since i'm not sure want, that's can :)

windows - Python Interpreter crashing in Powershell ISE -

i have python 3 installed on system , path executable has been added path. when inter python in windows powershell (win8.1) runs fine, i'd use powershell ise advanced features has. running python in powershell ise crashes following log: python : python 3.4.3 (v3.4.3:9b73f1c3e601, feb 24 2015, 22:43:06) [msc v.1600 32 bit (intel)] on win32 in zeile:1 zeichen:1 + python + ~~~~~~ + categoryinfo : notspecified: (python 3.4.3 (v...ntel)] on win32:string) [], remoteexception + fullyqualifiederrorid : nativecommanderror type "help", "copyright", "credits" or "license" more information. >>> (sorry partly in german) i can't enter , have ctrl+c powershell. what might issue here? powershell ise isn't meant running typical interactive console programs such python.exe. hides console window , redirects stdout pipe. see in practice run following in ise: python.exe -i -c "import ctypes; ctype

javascript - Three.js same shader with multiple objects different parameters -

i'm working three.js , trying write shader render many spheres of same attributes except radii. radii varying in real time , i'm not sure efficient way change radii of individual spheres. here have far test. seems uniform variable radius doesn't affect radius of sphere @ all. <!doctype html> <html> <title>test sphere</title> <head> </head> <body> <div id="test"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js"></script> <script type="x-shader/x-vertex" id="vertexshader"> /** * multiply each vertex * model-view matrix , * projection matrix (both provided * three.js) final * vertex position */ uniform float radius; void main() { gl_position = radius * projectionmatrix * modelviewmatrix * vec4(position,1.0); } </script> &l

javascript - blueimp jquery upload : drag and drop submitting all file fields -

i'm having small problem implementing blueimp's jquery upload. i have form includes several different file fields uploading. <div id="file1"> <input class="fileupload" type="file" name="files[]" data-url="jqueryfileupload.php?pic=1"> <div class="dropzone fade well" data-url="jqueryfileupload.php?pic=1">drop files here</div> <div class="progress"> <div class="bar" style="width: 0%;"></div> </div> <input type="text" name="pic1" id="pic1" value=""> </div> <div id="file2"> <input class="fileupload" type="file" name="files[]" data-url="jqueryfileupload.php?pic=2"> <div class="dropzone fade well" data-url="jqueryfileupload.php?pic=2">

Elasticsearch template not reading params -

i've been following example @ site parameterizing queries in solr , elasticsearch in es section. note, older es version author working with, don't think should affect situation. using version 1.6 of es. i have template {{es_home}}/config/scripts/test.mustache looks below snippet. note {{q}} parameter in "query". { "query": { "multi_match": { "query": "{{q}}", "analyzer": "keyword", "fields": [ "description^10", "name^50", ] } }, "aggregations": { "doctype" : { "terms" : { "field" : "doctype.untouched" } } } } i post http://localhost:9200/forward/_search/template following message body { "template": { "file": "test", "params": { "q": "a" } }

vpn - Connect different Windows User in SQL Server Management Studio (Windows 10) -

in windows 7, used following method connect sql server different domain/user: runas /netonly /user:domain\username program.exe source: connect different windows user in sql server management studio (2005 or later) however, has stopped working since windows 10 update. following error: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 26 - error locating server/instance specified) (microsoft sql server, error: -1) i'm using vpn, seems working (can use remote desktop , view intranet pages). have used setup on multiple locations, on multiple systems. used windows 7 or 8.1, hence why think 10 problem. has had luck fixing this? thanks! update: have rolled windows 7 , works again. tried pinging server, gives me 127.x.x.x address on windows 10, , correct ip on windows 7.

javascript - Access to object in module -

im doing logic parse json data object , want expose in module specific object outside other module can use, try following doesnt work,any other idea? var jsonobject; module.exports = { parse: function () { //here parsing .... jsonobject = json.parse(res) , //here want expose outside jsonobj:jsonobject } if trying expose entire object, build other javascript object , use module.exports @ end : myobj = function(){ this.somevar = 1234; this.subfunction1 = function(){}; } module.exports = myobj; if want expose functions, don't need build object, , can export individual functions : var somevar = 1234; subfunction1 = function(){}; nonexposedfunction = function(){}; module.exports = { subfunction1:subfunction1, somevar:somevar };

php - How to get view for each article? -

i have 4 tables articles category article_category view i need find view count each article below sql query select a.id, (select sum(view) view v on v.aid=a.id) view articles join article_category ac on a.id on ac.aid join category c on c.id=ac.cid left join view cv on v.aid=a.id group a.id my guestion if there ways without using select query? it seems need take sum out of subquery , use it. select a.id,sum(cv.view) articles join article_category ac on a.id = ac.aid join category c on c.id=ac.cid left join view cv on v.aid=a.id group a.id

barcode - What are the specific criteria I should consider when choosing a Java Barcoding Library and which ones do you recommend? -

it's 2015 , last time question asked 2009, , sourceforge.net down, i'm having hard time researching different java implementations of barcoding libraries decide best fit our organization. barcode4j , barbecue seem 2 hot ones out right i'm paying attention those. flexibility key requirement our organization: need support variety of customers may have different printers, size requirements, etc. of our barcodes embed internal database id several of our data types, there may few barcodes need accommodate more complex amounts of data. apart of libs mentioned zxing not reader generator lot of barcode types.

javascript - Turn Observable Array into nested JSON -

Image
i'm having problem getting array of information stored json. i made fiddle illustrate problem . enter set of tags , take @ console see output. more explanation: so have input takes in comma-separated list of tags, format. function createtagarray() { // given input value of 'tag1, tag2, tag3' // returns array = ['tag1', 'tag2', 'tag3'] } i thought needed next following: loop on array , create 'tag' object each item includes id tag , id of contact tag associated with. each object pushed tags , observable array. function single_tag(id, contactid, taglabel) { var self = this; self.id = id; self.contactid = contactid; self.taglabel = taglabel; } function createtags() { var array = createtagarray(); (var = 0; < array.length; i++) { self.tags().push(new single_tag(uuid.generate(), self.contactid, array[i])); } } then, converted json self.contactinformation = function() { return ko.tojs({

mysql - select within if add block code -

i have selection , wanted search column of table left join if user enabled pre condition essar search condition adds tables little confused, not know if separate searches or @ once .... says it's me @ mysql system, see so if .condition... ... end if; my code select user. * u user if (u.visible == 1, left join houseuser hu on u.id = h.id_user left join h house on hu.id_house = h.id_house ) u.age> 30 if visible add code can see in house user is. you can incorporate condition on clauses: select u.*, hu.*, h.* user u left join houseuser hu on u.id = h.id_user , u.visible = 1 left join h house on hu.id_house = h.id_house , u.visible = 1 u.age > 30; the columns come back, null when visible not 1 .

python - Where to locate user data in Flask application? -

i have flask application user's profile image stored. stored images in static directory so: application.py templates/ static/userdata/user/icon.png though don't think idea because not practice modify static directory in production. i tried making new userdata folder @ root so: application.py templates/ static/ userdata/user/icon.png though when try access file jinja , html, <img src="/userdata/user/icon.png"> the image not show. why this? thanks, in advance. use url_for function .html <img src="{{ url_for('userdata', filename='/user/icon.png')}}"> .py from flask import send_file @route('/userdata/<filename:filename>') def get_user_data_files(filename): return send_file(app.config['user_data_folder'] + filename)

Test "dynamic" page title in a view spec (Rails 4 + RSpec 3) -

i following tutorial rails , rspec have evolved, writing tests. my goal test when visit page " http://domain.fr /users/1 " page title follow format : "#{base_title} | #{@user.name}" base_title constant. before, saw possible use render_views in controller specs not best way , not exist anymore in rails 4/rspec 3. my last try : require 'rails_helper' describe "users/show.html.erb", type: :view "should render correct title" user = factorygirl.create(:user) assign(:user, user) render template: "users/show.html.erb", layout: "layouts/application.html.erb" expect(rendered).to have_selector("title", text: user.name) end end i use helper rendering in application.html.erb : <title><%= title %></title> here helper : def title base_title = "simple app du tutoriel ruby on rails" @title.nil? ? base_title : "#{base_title} | #{@title}" end

clickonce - Error: Failed to connect while Publishing Click Once Application Wpf -

Image
i got error while publishing wpf application. publishing on desktop , location of installation folder , publish folder same. \ error says--- error 1 failed connect '\localhost\users\administrator\desktop\deploy\' following error: unable create web site '\localhost\users\administrator\desktop\deploy'. path '\localhost\users\administrator\desktop\deploy' not exist or not have access. specified path invalid. i have change path local host c:/ build.

python - Conditional output in Sphinx Documentation -

i'm writing documentation sphinx , i'd print out block of text html documentation, not latex documentation. tells me should able sphinx.ext.ifconfig can't figure out how. know how this? no extension required. use only directive . works this: .. only:: latex stuff in here appears in latex output. .. only:: html stuff in block appears in html output. it's useful use directive it: .. raw:: html it's embedding stuff, video.

java - Time complexity of creating hash value of a string in hashtable -

it's said inserting , finding string in hashtable o(1). how hash key of string made ? why it's not o(l), length of string? it's clear me why integers it's o(1), not strings. note that, understand why in general, inserting hashtable o(1), confused before inserting hash table, making hash value phase. and there difference between how hash keys strings produced between hashtable in java , unordered_map in c++? inserting etc. in hashtable o(1) in sense constant in number of elements in table . the "o(1)" in context makes no claim how fast can compute hashes. if effort grows in way, way is. however, find unlikely complexity of decent (i.e. "fit application") hash function ever worse linear in "size" (i.e. length in our string-example) of object being hashed.

Usage of Netty WRITE_SPIN_COUNT -

i understand usage of netty's channel option "write_spin_count". effect of setting value higher or lower default( 16 ). should set @ all.? got netty documentation wasn't clear why , when should set value : http://netty.io/4.0/api/io/netty/channel/defaultchannelconfig.html#getwritespincount() per documentation says : returns maximum loop count write operation until writablebytechannel.write(bytebuffer) returns non-zero value. similar spin lock used in concurrency programming. improves memory utilization , write throughput depending on platform jvm runs on. default value 16. the write spin count used control how many times underlying socket.write(...) called per netty write operation. keep in mind write netty's buffers underlying sockets may not transfer data in 1 try. there balance between how time of i/o thread can spent attempting write single buffer, , if buffer not written i/o thread must register write event , woken when underlying socket writ

angularjs - How to globally config Laravel's Route::resource to be compatible with ng.resource (a Laravel route for each ng resource)? -

laravl 5 uses put/patch verbs update resource while angular ng.resource uses post default both creation , update. how globally set laravel's route::resource follow angular behavior (a laravel route each ng resource)? (it's possible make angular compatible laraval, i'm not sure approach better.) i don't know laravel's rest capabilities. still suggest modify angular's behaviour. put implementing put quite easy. you can modify behaviour of ng-resource while creating factory $resource(url, parameters, actions), third parameter describes custom actions ... in https://docs.angularjs.org/api/ngresource/service/ $resource there example creating put method available update on service , $update on instance. : app.factory('notes', function($resource) { return $resource('/notes/:id', null, { 'update': { method:'put' } }); }]); // in our controller id url using ngroute , $routeparams // pass in $r

windows - Why/how are Registry Entries Hidden in Regedit but visible in PowerShell? -

Image
i'm working new property schema, , have been in habit of checking registry when register or unregister new version. 1 of primary places check hkey_local_machine\software\microsoft\windows\currentversion\propertysystem\propertyschema . interestingly, lose access registry location in regedit. see see (note absence of propertyschema): i know schemas still registered, because can use prop.exe tool , propschema sdk sample application describe them. properties available in windows explorer , in search. also, can use powershell list contents of hive: c:\users\carlton> cd hklm: hklm:\> c:\users\carlton> cd hklm: hklm:\> cd software\microsoft\windows\currentversion\propertysystem\propertyschema hklm:\software\microsoft\windows\currentversion\propertysystem\propertyschema> dir hive: hkey_local_machine\software\microsoft\windows\currentversion\propertysystem\propertyschema name property ---- -------- 0000

machine learning - Encog - Error saving network weights, Not a valid EG file -

i've got network trained , want save , able load later don't have re-train it... duh. end of training code: //save network serializeobject.save(new file("encognet"),network); encog.getinstance().shutdown(); loading file basicnetwork network = (basicnetwork) encogdirectorypersistence.loadobject(new file("encognet")); i error exception in thread "main" org.encog.persist.persisterror: not valid eg file. can tell me how fix this? i think problem not saving file .eg extension. if not problem, i'm not sure serializeobject.save , know encogdirectorypersistence works me. so, test out code saving public static final string filename = "test_load_net.eg"; encogdirectorypersistence.saveobject(new file(filename), network); and load this public static final string filename = "test_load_net.eg"; basicnetwork network = (basicnetwork)encogdirectorypersistence.loadobject(new file(

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot

php - php_intl extension installation error in cakephp -

i using cakephp 3.0.8 on xampp 5.6.8-0 in mac os x yosemite. have set database string in app file , make db cakephp. have uncomment extension=php_intl.dll in php.ini file. but if try use phpinfo, not showing php_intl . , when try use cakephp on localhost says fatal error: must enable intl extension use cakephp. in /applications/xampp/xamppfiles/htdocs/cakephp/config/bootstrap.php on line 38 could tell me please whats problem. if have linux vps or dev box, package missing!! just run @ command line sudo apt-get install php5-intl why php5? it's have installed, if you're running greater in future, adjust php5 phpx whatever you're running there!

c# - Add PDF attachment to BizTalk email service -

i have come ownership of asp.net mvc site utilizes biztalk 2013 handle tasks sending emails. new biztalk forgive obvious mistakes in post. quick overview the service called through application , orchestration calls stored procedure in sql db populate of values email (including html email) , sends email out. i want add pdf attachment email. as test, added pdf file server , have tried adding actualemailmsg(smtp.attachments) = "c:\\pdfs\\test.pdf"; actualemailmsg(smtp.messagepartsattachments) = 2; message assignment expression shape suggested in this post no avail. ( i tried physical path 1 "\" "c:\\pdfs\test.pdf" , didn't work ) i have ruled out possibility of lack of permissions service account pdf folder. email sends correctly no attachment present. getting no errors in code or in event viewer on server @ point @ loss might be. after lots of googling found the issue related send pipeline . this thread got me on right track.

python - Using numpy shape output in logic -

i using python 2.7.5 on windows 7. reason python doesn't when use 1 of dimensions of numpy array comparator in if statement: a = np.array([1,2,3,4]) # reshapes array has 2 dimensions if len(np.shape(a)) == 1: = np.reshape(a, (1, np.shape(a))) b = np.shape(a)[0] if b <= 3: print 'ok' i create 1d numpy array (in actuality 'a' input may 1d or 2d). reshape form 2d numpy array. try use size of newly created dimension comparator , error: "typeerror: integer required" i tried "int(b)" convert long integer plain integer in if statement , gives same error. if "type(b)" gives me "type 'long'". feel though i've done before without problems, can't find examples. how change 1d array 2d array? appreciated. the problematic line a = np.reshape(a, (1, np.shape(a))) . to add axis front of a i'd suggest using: a = a[np.newaxis, ...] print a.shape # (1, 4) or none same thing np.newaxis

javascript - AngularJS: $http get Json from external file -

i newbie @ angular , not strong in javascript begin with. i'm trying make app using ionic framework. , im trying list json file. i've made work raw json in variable. i'm trying use $http.get() retrieve remote file in project folder. .service('staffservices', ['$q', '$http', staffservice]); function staffservice($q, $http) { var staffs = {}; var promise = $http.get("/js/jsons/settings.json") .success(function(response) { staffs = response.staffsettings; console.log(staffs); //has need }); console.log(staffs); //empty object return { loadallsettings: function () { return $q.when(staffs); }, query: function (params) { return filterfilter(staffs, params); }, get: function (params) { return this.query(params)[0]; } } }; for reason can't access result outside of .success() function. i'm not sure if due ignorance in javascript or newbie

PHP Search by Image within website -

i have ecommerce website in core php. want add search-by-image facility google images or other reverse image search search engines. i searched lot on internet , can't use google's search facility in website (neither api nor curl ). main reason want search pages images (search result pages contains images) within website. here scenario. when user uploads image, backend php process image , find related image stored on server (images stored in server's directory , filename stored in database associated product , in turn, list product having similar product image) i assume first have process images stored in server , store related pixel information in database along filename. have no idea store in order search later. to use google's search image, try reading post: http://www.askdavetaylor.com/how_to_add_google_images_search_my_site/ it looks thats you're aiming at

php - Bounce <nobody@gmail.com> Gmail API sending failure -

i'm trying send emails google api. i'm able read emails, authenticate oath using client_secret.json file per quickstart instructions. i've got sending emails working, unable send successfully. my email bouncing , i'm unable specify email i'm sending (hence nobody@gmail.com address). code here bellow works part. i've commented out parts work: (reading emails). code: <?php require 'google-api-php-client/src/google/autoload.php'; define('application_name', 'gmail api quickstart'); define('credentials_path', '~/.credentials/gmail-api-quickstart.json'); define('client_secret_path', 'client_secret.json'); define('scopes', implode(' ', array( google_service_gmail::mail_google_com, google_service_gmail::gmail_compose) )); /** * returns authorized api client. * @return google_client authorized client object */ function getclient() { $client = new google_client(); $clie

What is the easiest way to find Chrome extension's id in a setup application? -

i need setup native application talks chrome extension. creating setup, need extension's id added in native application's manifest file. id says extensions allowed talk native application. how extension id, assuming user manually installs extension dragging , dropping. btw, knowledge installing external chrome extension (no chrome web store) silently close impossible. highly appreciate if has solution that, too. the recommended flow keep extension in web store (possibly unlisted if not work without module), silently queue installation using registry or other platform-specific method, , warn user accept install in dialog on next browser restart. close "silent" gets. if absolutely have distribute extension externally (and drag&drop install not work), can pin id setting the "key" field in manifest . see this question ways of doing so.

Create Python list split on spaces -

this question has answer here: how split string list? 8 answers in python, how take full_name , create variable called name_list holds name list, split on spaces? know how create name_list = list(full_name) how split on spaces in 1 line? var full_name = "my name" use str.split : string.split(s[, sep[, maxsplit]]) return list of words of string s. if optional second argument sep absent or none, words separated arbitrary strings of whitespace characters (space, tab, newline, return, formfeed). if second argument sep present , not none, specifies string used word separator. returned list have 1 more item number of non-overlapping occurrences of separator in string. if maxsplit given, @ maxsplit number of splits occur, , remainder of string returned final element of list (thus, list have @ maxsplit+1 elements). if maxsplit not specified or -1,

java - Facebook 4.x Login SDK Not Completing Login Process -

i following tutorial , working, when click on login button, progress spinner appears brief moment, disappears. have tried debug, , i'm not hitting callback: private facebookcallback<loginresult> callback = new facebookcallback<loginresult>() { @override public void onsuccess(loginresult loginresult) { accesstoken accesstoken = loginresult.getaccesstoken(); profile profile = profile.getcurrentprofile(); displaymessage(profile); } @override public void oncancel() { } @override public void onerror(facebookexception e) { } }; here complete code: import android.content.intent; import android.support.v4.app.fragment; import android.os.bundle; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.textview; import com.facebook.accesstoken; import com.facebook.accesst