Posts

Showing posts from July, 2014

python - Average a list of dictionaries based on key -

having list of n - dictionaries sample below: n = [ {'gb_written': '6.63', 'avg_write_put': '81.45', 'bgb_written': '4.78', 'bbytes_written': '5129101312', 'body_len': '512', 'body_len_dist': '32', 'bytes_written': '7118499840', 'cache_size': '2.00', 'device': 1, 'documents': '1000000', 'duration': '60', 'engine': 2, 'key_len': '32', 'key_len_dist': '2', 'read_ops': '31287.45', 'read_us': '31.96', 'reads': '1879063', 'thread_reader': '1', 'thread_writer': '1', 'total_ops': '2885853', 'write_amp': '9.4', 'write_ops': '16763.61', 'write_us': '59.65', 'writes': '1006790',

java - can't make updatable resultset with ucanaccess -

i've tried of examples found here , web, can't open ms access database(2002 or 2013) , updatable result set using ucanaccess. same code using jdbc:odbc driver/connection/works. i've written short test code check concur_updatable check this, must missing something. i'm using jdk 1.7 on win7 machine. have machine same results. works: /* class jdbc, testing jdbc:odbc concur_updatable. */ import java.sql.*; public class jdbc { private static string dbfqn; public static void main(string[] args) { try { dbfqn = ("c:\\phil\\programming\\kpjl2002.mdb"); string database = "jdbc:odbc:driver={microsoft access driver (*.mdb)};dbq=" + dbfqn; system.out.println("loading database: " + database); connection conn = drivermanager.getconnection(database, "", ""); statement s = conn.createstatement(resultset.type_scroll_sensitive, resultset.concur_updatable); // fetch records table string seltable = "select * " + "

c# - Add properties to User table using asp identity -

Image
ok, want add properties user table created asp identity. so read , found out can doing this: public class applicationuser : identityuser { public string firstname { get; set; } public string lastname { get; set; } public string gender { get; set; } public int age { get; set; } public ilist<blog> blogs { get; set; } public async task<claimsidentity> generateuseridentityasync(usermanager<applicationuser> manager) { // note authenticationtype must match 1 defined in cookieauthenticationoptions.authenticationtype var useridentity = await manager.createidentityasync(this, defaultauthenticationtypes.applicationcookie); // add custom user claims here return useridentity; } } so properties added table dbo.aspnetusers , not users table. why? so thought maybe places properties there can use them in same dbset added code: public class travelcontext : dbcontext { static travelcontext()

jquery - Using execCommand (Javascript) to copy hidden text to clipboard -

i'm trying copy clipboard without using flash, plan fall onto flash use of zeroclipboard if browser incompatible javascript approach. i have onclick listener button looks like: $(buttonwhereactionwillbetriggered).click(function(){ var copydiv = document.getelementbyid(inputcontainingtexttobecopied); copydiv.focus(); document.execcommand('selectall'); document.execcommand("copy", false, null); } and input field follows: <input type="text" name="element copied" id="inputcontainingtexttobecopied" value="foo"/> this works expected design requires field containing text copied invisible. have tried both setting type="hidden" , style="display: none" neither of have succeeded. both resulting in button selecting whole page , copying whole content user's clipboard. i'm relatively confident cause not browser based incase, testing on chrome (version 43.0.2357.134 (64-b

java - Repaint not working -

i'm having problem repaint function. in jframe pass word jpanel. package grafisch; import logica.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; public class lingoapp extends javax.swing.jframe implements actionlistener { /** * creates new form lingoapp */ letter letter = new letter(); woordenlijst woordenlijst = new woordenlijst(); lingo lingo = new lingo(); newjpanel newjpanel = new newjpanel(); public lingoapp() { initcomponents(); volgendeknop.setenabled(false); controleerknop.setenabled(false); gokinput.addactionlistener(this); } private void controleerknopactionperformed(java.awt.event.actionevent evt) { string input = gokinput.gettext().replaceall("\\s",""); if(input.contains("0123456789") || input.length() <5 || input.length() >5 || input.isempty()){ gokinput.settext("fout"); } else { let

php - Laravel 5.1 - Facebook through Socialite (Client Error: 400) -

using this tutorial on laracast (laravel 5.0 - socialite), until min 12.11 , have setup everything. however, using laravel 5.1 defined route commented out callback provider, trying fetch user details through taken token: route::get('auth/facebook', 'auth\authcontroller@redirecttoprovider'); //route::get('auth/facebook/aaa', 'auth\authcontroller@handleprovidercallback'); added necessities in config>services.php : 'facebook' => [ 'client_id' => '##', 'client_secret' => env('fb_secret_id'), 'redirect' => 'http://laratest.dev/auth/facebook', ], i decided return same page ( auth/facebook ) now. that's why have set return domain.devv/auth/facebook testing. in authcontroller.php , set: public function redirecttoprovider(authenticateuser $authenticateuser, request $request) { return $authenticateuser->execute($request->has('code')); } and

sql - How to create a list of column names? -

i have question creating list of column names table. have table different activities football, basketball, volleyball,... want take of these sports , put them in list way can limit query later based on sport user selected in drop down. can mi problem? select * activities (sleceted sport) = 'basketball'; if you're looking sql query you can here. or here. select * all_tab_columns table_name = 'activities';

sql - MySQL Every Other Row With Weight -

i have problem cant solve sql query mysql. first table "content" id / title / author / curated / created next table "whitelist" id / author / weight what want sql select content where content.created >= unix_timestamp(date_sub(now(), interval 14 day)) order author random of weight author high weight show more lower. using function order -log(rand(1337)) / whitelist.weight asc . , want every other row curated , next 1 not. so result this. id title author curated created 3 home1 krister 1 2015-01-20 13 home14 krister 0 2015-01-20 33 home8 eva 1 2015-01-15 34 home11 krister 0 2015-01-01 43 home18 eva 1 2015-01-01 what have tried... select * ( select `content`.*, if(`content`.`curated`=0, @mr:=@mr+1, @fr:=@fr+1) cur `content` inner join `whitelist` on `content`.`author` = `whitelist`.`author` , (select @mr:=0, @fr:=0) initvars

regex - Find regular expression string and replace it in R -

the purpose tidy dataset cleaning variable names replications. typical example: var.name <- "blue cat" #"true" variable name is found in dataset following entries/replications: char <- c("blue cat","blue cat blueing","blue cats", "blue cat dog", "blue catts cat","blue cat cat") the ideal result of above replications renamed var.name , ie "blue cat". following grep(..) that: char[grep(paste("blue cat", collapse="|"), char, value=f)] <- var.name the drawback of method 1 has manually search & enter char occurrences. ideal solution parse "blue cat" regular expression , replace string matched. any ideas? much. if need parse regular expression, suffice. sub('.*blue cat.*', var.name, char) # [1] "blue cat" "blue cat" "blue cat" "blue cat" "blue cat" "blue cat

email - Sending html from summernote(jquery) to php mail -

i'm using http://summernote.org/ , , want html summernote , show email. far i'm getting email: edição de ' . . '' . <p>ascds ds dds<img src=\"http://www.url.com.br/admin/img/02522a2b2726fb0a03bb19f2d8d9524d.png\" style=\"width: 300px;\"></p><img src=\"http://www.url.com/checkopen.php\" style=\"width:1px;height:1px\"/>; and elements tab: <div> edição de ' . . '<br>' . &lt;p&gt;ascds ds dds&lt;img src=\"<a href="http://www.url.com.br/admin/img/02522a2b2726fb0a03bb19f2d8d9524d.png%5c" target="_blank">http://www.<wbr>url.com.br/<wbr>admin/img/<wbr>02522a2b2726fb0a03bb19f2d8d952<wbr>4d.png\</a>" style=\"width: 300px;\"&gt;&lt;/p&gt;&lt;img src=\"<a href="http://www.url.com/checkopen.php%5c" target="_blank">http://www.<wbr>url.com/<w

ios - Cannot assign self as delegate in property initializer -

i getting strange error message when try access self when initializing property on class. seems class has weird type. this error: cannot assign value of type 'viewcontroller -> () viewcontroller' value of type 'modelcontrollerdelegate?' this code, simple example in playground: import foundation import uikit protocol modelcontrollerdelegate { func modelcontrollerdidfinishtask() } class modelcontroller { var delegate : modelcontrollerdelegate? } class viewcontroller : uiviewcontroller, modelcontrollerdelegate { var modelcontroller : modelcontroller = { let controller = modelcontroller() controller.delegate = self return controller }() func modelcontrollerdidfinishtask() { } } you trying use self when not initialised. might work if use lazy initialisation: lazy var modelcontroller : modelcontroller = { ...

postgresql - Querying across multiple tables with identical schemas -

i'm trying run same query on multiple tables in postgres database, have same schema. this question: select multiple tables without join? shows possible, hard-coding set of tables. i have query returns 5 specific tables main query run on. how can go using result of union approach? in short, want query see 5 specific tables (determined outcome of query) 1 large table when runs query. i understand in many cases similar scenario you'd want merge tables. can not this. one way of doing may satisfy constraints using table inheritance . in short, need create parent table same schema, , each child want query must alter that_table inherit parent_table . queries against parent table query of child tables. if need query different tables in different circumstances, think best way add column named type or such, , query values of table.

SQL Server 2012: why does full-text search not index .pdf, .cs? -

i have installed sql server 2012, executed select document_type sys.fulltext_document_types the result 50 extensions, ok. then downloaded filerpack sp2 microsoft site, installed it, executed exec sp_fulltext_service 'load_os_resources', 1 exec sp_fulltext_service 'update_languages' restarted sql server , executed: select document_type sys.fulltext_document_types the result 151 extensions including .pdf, .cs , on. then: create table documentrepository ( id int not null primary key identity, filename nvarchar(250), filesize int, fileextension nvarchar(10), attachment varbinary(max) ); go grant insert,update,select,delete on documentrepository public; go create fulltext catalog ftscatalog default; go create fulltext index on dbo.documentrepository (filename, attachment type column fileextension) key index pk__document__3213e83fefb4f2b9 on ftscatalog change_tracking auto; go and added files: .pdf, .txt, .cs, .docx microso

android - How to remove corners radius in drawable programmatically? -

i want remove corner radius programmatically. don't know how it. i'm creating progressbarcompat change progress bar color coloraccent don't know how remove corner radius in progressbardrawable in android api lower 11. link drawable: https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/drawable/progress_horizontal.xml can it? i'm using progress drawable: layerdrawable drawable = (layerdrawable) getprogressdrawable(); drawable progressdrawable = drawable.finddrawablebylayerid(android.r.id.progress); // , detect sdk version , call method remove corners on drawable (progressdrawable).

(sed) Delete an entire line if either condition is true -

i working csv file looks this kmgm more words , things 7hsq other more words , stuff jhgq8 more other stuff kh21 , more stuff the valid lines first word letter followed 3 characters letters or numbers. in above example, lines containing kmgm , kh21 valid. want delete others using sed. i wanted make condition say, if first character not letter or fifth character not space or characters two, three, or 4 contain other uppercase letter or number delete entire line i don't know how formulate in sed. had similar problem yesterday rows 4 characters long. have added information , rows vary in length. this might work you. sed -n '/^[a-z][a-z0-9]\{3\} /p' instead deleting, keeps lines match conditions. this: if first character letter , fifth character space , characters two, three, or 4 contain uppercase letter or number keep (print) line /p printing if regex matches -n avoids printing otherwise if want

sql - Oracle Procedure Escape characters -

i stuck escape characters give different values.please me solve problem.please me why same query giving different results. query : select * app_realm_entries id in (select id app_entries app_ext_code ='ttl1' , version_number='1.0.1'); result : single row result comes sql block : declare appcode varchar2(20); version_number varchar2(20); type rc ref cursor; table_cursor rc; rec_table realm_entries%rowtype; begin appcode := 'ttl1'; version_number := '1.0.1'; open table_cursor 'select * realm_entries id in (select id app_entries app_ext_code ='''||appcode||''||'and version_number='||version_number||''')'; loop fetch table_cursor rec_table; dbms_output.put_line('rowcount ' || table_cursor%rowcount ); exit when table_cursor%notfound; end loop; close table_cursor; end; result : rowcount 0 as justin suggested use bind variables. you'll achieve 2 things do

java - Programming: Equivalent function but different(ly optimized) implemention and automatic (cached) choice before each execution - How? -

a function may work on cpu on gpu, both same job. sure, want use gpu-solution (assuming it's faster), not available on -for example- let's older opengl version. instead of programming check (if available use "this" else "that") on each function call, may want call 1 function trough reference bound function call. to go further optimization, imagine 4 solutions: cpu + optimized small pictures cpu + optimized big pictures gpu + optimized small pictures gpu + optimized big pictures now, not (as programmer) have eliminate 2 possibilities depending on old/new "opengl version", have choose 1 of 2 remaining possibilities depending on usage. some calls have small or big pictures function parameters, in others places of code, need choose function want call depending on picture-parameter's values. - 4x4 pixel pictures or small lookup-tables cpu-solution fastest (lower overhead) one solution make function code paths split , lead

javascript - download file in a specific folder -

i have link allows me downlowd text file in web page problem want user able chose save file mean when clicks link window should opened can save file wherever likes can 1 tell me how that? thx . here part of code: $fichierres=fopen('res.txt','a'); ftruncate($fichierres,0); ... fputs($fichierres, $t."\r\n"); ... fclose($fichierres); echo' <div style="text-align:center"><br> <button id="download" width="100px" class="styled-button-8"><a href="res.txt" download="res.txt" style="color: #ffffff"><b>download</b></a></button></div><br>'; most browsers auto-open file can read - how should work. includes .txt files, there's nothing can prevent this. what can provide link anchor ( <a href="/myfile.txt">download</a> ) , provide message next link telling user "right click / save link as

Bigquery in Python: How to put the results of a query in a table? -

i started using bigquery in python2.7 , i'm having issues putting results of query in table. my query: query_data = { 'configuration': { 'query': { 'query': query 'destinationtable': { 'projectid': project_id, 'datasetid': dataset_id, 'tableid': 'table_id' }, 'createdisposition': 'create_if_needed', 'writedisposition': 'write_truncate', 'allowlargeresults': true }, } } query_request.query(projectid=project_number,body=query_data).execute() according read in google bigquery documentation , destinationtable , createdisposition , writedisposition should ensure result of query ends in chosen bigquery table. but doesn't , error: httperror: https://www.googleapis.com/bigquery/v2/projects/project_id/queries?alt=json re

javascript - Jquery load doesn't load DOM elements immediately -

i have html content as <div id="externalcontent"></div> <script src="jquery.js"></script> <script> console.log("the number of div elements before loading tempfile " +$("div").length) $('#externalcontent').load('tempfile.html') console.log("the number of div elements after loading tempfile " + $("div").length) $('#externalcontent').append('temp.html contents loaded above...') settimeout(function(){ console.log("the number of div elements in page after timeout " + $("div").length) }, 5000) </script> it simple stuff. loads external file, tempfile.html has 1000 div elements using $.load, , prints number of div elements in console. the output is, the number of div elements before loading tempfile 1 number of div elements in page after loading tempfile 1 number of div elements in page after timeout 100

SQL How to populate a NULL value -

here scenario: i have table fields: policyid membertype memberaddress membercity there 2 membertype classifications: membertype ---------- owners dependents only owners linked address , city. when have owner , several family members (dependents) owners row shows address, dependents row address field shows null (side note: owner , dependent of same family have same policyid ). how can populate address field when there dependent null address field grab address of owner , populate field. current results policyid membertype memberaddress membercity -------------------------------------------------- 1234 owner 9785 sw 197 ct miami 1234 dependent null null 1234 spouse null null desired results policyid membertype memberaddress membercity ---------------------------------------------------- 1234 owner 9785 sw 197 ct miami 1234 dependent 9785 sw 197 ct mia

javascript - Loading <audio> source - Firefox gets into readyState 2 and Chrome into 4 -

i trying connect htmlaudioelement web audio api ( mediaelementaudiosourcenode ). set src followed calling load() . now while in chromium gets me readystate 0 ( have_nothing ) 4 ( have_enough_data ), follow-up play() succeeds. in firefox state 2 ( have_current_data ) , nothing else happens. am missing crucial step? edit: here debug information: | | ff init | ff load | ch init | ch load | |readystate | 0 | 2 | 0 | 4 | |preload | | | auto | auto | |duration | nan | 186.45 | nan | 186.44 | |error | null | null | null | null | |networkstate | 0 | 1 | 0 | 1 | at least list, difference in initial data preload value in chrome. so adding preload = "auto" after creating media element (to match default has in chromium) makes work in firefox, too.

How to detect if the source of a scroll or mouse event is a trackpad or a mouse in JavaFX? -

this same question this one javafx instead of java swing: i want know if scroll event generated trackpad or mouse in javafx. according documentation on scrollevent there subtle difference in handling scroll events mouse , trackpad. when scrolling produced touch gesture (such dragging finger on touch screen), surrounded scroll_started , scroll_finished events. having in mind can track scroll_started , scroll_finished events , modify scroll_event handler in between these 2 boundaries. trackpad can send scroll_event s after scroll_finished being sent (scrolling inertia) can check out event.isinertia() method filter these events. due probable bug in javafx in rare cases scroll_event s may occur after scroll_finished event.isinertia() == false (if scroll on trackpad many many times). possible workaround track timestamp of last scroll_finished event , ignore these "ghost" events within short time period after timestamp. example code: long la

Javascript and CSS animation render blocking -

my web page has sticky header image in it: /* simplified css: */ header { position: fixed; top: 0px; left: 0px; width: 100%; height: 150px; transition: height .5s; } header > img { display: block; margin: 0px auto; height: 100%; width: auto; } when user scrolls down, header smoothly becomes less high: header.floating { height: 100px; } this scales image due it's 100% height. during transition, image becomes pixelated; anti-alias removed increase browser's performance, suppose. my web page has welcome screen different images in it. image shown changes every 5 seconds. there progress bar show timer's progress. /* simplified css: */ section#welcome { width: 100%; height: 100%; } section#welcome div#progress { width: 0.1%; height: 10px; background-color: green; } /* simplified javascript & jquery: */ setinterval(function() { changeimage(); $("div#progress").animate({

linker - Trying deterministic gcc compilation, symbol table problems -

i work embedded systems , trying make build yields same executable each time. using -frandom-seed helped stabilize names otherwise variable, still have couple of symbols have problems with. example: 0x00003bfc _zn13workingmemory17readtransactionalern3hsl4fileern58_global__n_.. .. .._.._working_memory.cc_ae42a16a_ff4623503alle the ".._.." etc. part evidently worked out of passed -frandom-seed, id est, source filename. of couple of hex number follows sometimes, second 1 different, , guess linked compilation date, not sure. working on arm, using gcc 3.4.0, using flat executables. tried remove symbols using strip on elf file, prevents flat conversion. ideas?

Using Gerrit to restrict read access to a git branch -

i'm beginning suspect not possible. hoping set custom access control in gerrit particular role (defined in tf) not have read access specific branch in repo. however, appears users role unable clone repo @ all. hoping they'd able clone , not beb able check out restricted branch. just wondering if else has enountered , might able confirm behaviour i'm seeing. did see thread here recommending gitolite partial copies i'm restricted using tf/gerrit. thanks!

java - How do I clear the back history of my app only if user performs an action? -

i having trouble controlling behaviour of intent. the use case this: when user browsing internet in chrome , clicks on menu, share , on app, screen opens allowing user edit information. when user done editing or can click on "done, choose chat post". new activity opens available chats. at point, user should able press standard button return editing activity or user can click on chat post. if user clicks on chat , posts link, new acitivity starts chat allowing user continue chatting or press return browser , not "choose chat" activity or "edit information" activity. so want able following: use case 1: [browser] --> [share] --> [edit info] --> [choose chat]. (back button returns [edit info]. use case 2: [browser] --> [share] --> [edit info] --> [choose chat] --> [open chat] . (back button return [browser]. i have tried various combinations of intent flags when starting [edit info] , [choose chat] none giving me behavio

angularjs - Angular JS- ui.bootstrap.collapse not working properly -

i using angular-ui bootstrap application. trying use collapse property of angular-ui bootstrap. i doing same shown in example on site in collapse part. not getting wrong doing in code not working properly. this snippet code <h1>your connections</h1><a href="" ng-click="iscollapsed = !iscollapsed" class="button-link">invite friend join you</a> <div collapse="iscollapsed"> <button style="float:right; margin-right: 4px; margin-top: 5px; background-color: #8aa8bd; height: 30px" ng-click="sendinvite()">send</button> <input type="text" class="well well-sm" style="float: right"> </div> while running code giving following error typeerror: cannot read property 'then' of undefined @ e (ui-bootstrap-tpls-0.13.0.min.js:8) @ object.fn (ui-bootstrap-tpls-0.13.0.min.js:8) @ object.

data mining - elki-cli versus elki gui, I don't get equal results -

though terminal on ubuntu: db@morris:~/lisbet/elki-master/elki/target$ elki-cli -algorithm outlier.lof.lof -dbc.parser arffparser -dbc.in /home/db/lisbet/alldata/literature/wbc/wbc_withoutdupl_norm_v10_no_ids.arff -lof.k 8 -evaluator outlier.outlierroccurve -rocauc.positive yes giving # rocauc: 0.6230046948356808 and in elki's gui: running: -verbose -dbc.in /home/db/lisbet/alldata/literature/wbc/wbc_withoutdupl_norm_v10_no_ids.arff -dbc.parser arffparser -algorithm outlier.lof.lof -lof.k 8 -evaluator outlier.outlierroccurve -rocauc.positive yes de.lmu.ifi.dbs.elki.datasource.filebaseddatabaseconnection.parse: 18 ms de.lmu.ifi.dbs.elki.datasource.filebaseddatabaseconnection.filter: 0 ms lof #1/3: materializing lof neighborhoods. de.lmu.ifi.dbs.elki.index.preprocessed.knn.materializeknnpreprocessor.k: 9 materializing k nearest neighbors (k=9): 223 [100%] de.lmu.ifi.dbs.elki.index.preprocessed.knn.materializeknnpreprocessor.precomputation-time: 10 ms lof #2/3: computing l

mobile - Appcelerator - Android App Deployment -

i trying deploy android app local, plugged-in device. i'm using appcelerator studio ide, , have been having lot of trouble getting app onto local device. the android device has usb-debugging turned on, plugged usb port on of machine (on mac, ports on back), , device set trust unauthorized apps (not app store). i've tried called 'solution' people have posted before, , i'm still struggling this. any advice appreciated.

c++ - Looking for the most elegant solution for looping a specific string -

so got dozen of strings download , 1 of example one "australija 036 aud 1 5,136250 5,151705 5,167160" the spaces shown single here, multiple between numbers , chars. so first idea count manually number need (the second one, 5.151705 in example) , substring.(41,8) seems ify me. second idea save number chars in vector, , vector[4] , save seperate variable. and third 1 loop string until position myself after 5th group of spaces , substring it. just looking feedback on "best". you can think of first trimming multiple whitespace. like std::string str = "australija 036 aud 1 5,136250 5,151705 5,167160"; str.erase(std::unique(str.begin(), str.end(), [](char a, char b) { return ::isspace(a) && ::isspace(b); }), str.end()); a string split may useful std::vector<std::string> split(std::string & str, char delim) { std::vector<std::string> result; std::stri

angularjs - ngCordova geolocation plugin doesn't working -

i make hybrid app ionic.i want use ngcordova location.the app works fine in browser when emulate in android virtual device doesn't working.i've installed in ngcordova docs.any ideas? you can connect emulator via telnet , push gps location. connect via telnet : telnet localhost <console-port> and fix push geo location command line geo fix <longitude value> <latitude value> a better way use real android device , add adb following command line adb devices however can log of device executing command line adb logcat ref: how emulate gps location in android emulator? http://developer.android.com/tools/devices/emulator.html#console http://developer.android.com/tools/debugging/ddms.html#ops-location hpe help regards

javascript - Having another class as a static property on a class -

read example below*, don't pay attention eventemitter inheritance, please – shows utility of class syntax. i realize example not correct es2015, since there no such thing static class statement. what syntactically lean way make work in es2015? class app extends eventemitter { addpage(name) { this[name] = new app.page; this.emit("page-added"); } static class page extends eventemitter { constructor() { super(); this._paragraphs = []; } addparagraph(text) { this._paragraphs.push(text); this.emit("paragraph-added"); } } } should split , use class expression, below? seems less elegant. class app extends eventemitter { addpage(name) { this[name] = new app.page; this.emit("page-added"); } } app.page = class extends eventemitter { constructor() { super(); this._paragraphs = []; } addparagraph(text) { this._paragraphs.push(text); this.emit("para

html - White spacing between <div> containers -

i have 2 containers on top of each other, , there no white space between them. when use < br > tag, white space appear. can solve container? css code below needed layout "abbreviations" page: http://www.16thinfantry.com/help/army-abbreviations/ . there has white spacing between every container abbreviations. first a, b, c, etc. .toc-layout > dl { padding: 0; overflow-x: hidden; list-style: none; } .toc-layout > dl > dt { position: relative; } .toc-layout > dl > dt:before { position: absolute; bottom: 0; font-weight: normal; overflow: visible; z-index: -1; white-space: nowrap; content: ".................." ".................." ".................." ".................." ".................." ".....

python - PyVISA: cannot connect via VICP to LeCroy scope -

i'm trying connect lecroy wavesurfer 400 series via vicp visa passport (tcp/ip) pyvisa 1.7 under windows7/32bit , ni-visa 5.4.1: import visa rm = visa.resourcemanager() scope = rm.open_resource("vicp::169.254.201.2::instr") print(scope.query("*idn?")) i following error: warning (from warnings module): file "c:\python27\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1378 alias_if_exists) visaiowarning: vi_warn_ext_func_nimpl (1073676457): operation succeeded, lower level driver did not implement extended functionality. traceback (most recent call last): file "c:\path\scopetest.py", line 4, in scope = rm.open_resource("vicp::169.254.201.2::instr") file "c:\python27\lib\site-packages\pyvisa\highlevel.py", line 1614, in >open_resource info = self.resource_info(resource_name) file "c:\python27\lib\site-packages\pyvisa\highlevel.py", line 1584,

C++ set keyCompare function for vector -

i'm storing glm::ivec3 keys in set. since type missing keycompare function i've defined in struct. if have 2 numbers a,b write < b; how vector? i tried following: struct keycompare { bool operator()(const glm::ivec3& a, const glm::ivec3& b)const { return a.x < b.x && a.y < b.y && a.z < b.z; } }; typedef set<glm::ivec3, keycompare> chunkset; now able insert values, when checking whether value exists returned true without ever inserting key. do know how comparing done vectors? thanks in advance! you can try return a.x < b.x || (a.x == b.x && a.y < b.y) || (a.x == b.x && a.y == b.y && a.z < b.z); the problem initial implementation following vectors seem equal because !(a < b) && !(b < a) held implementation: (3, 7, 12), (4, 6, 12)

html - Polymer 1.0 a/custom element under toolbar clicking bug -

Image
i encountering problems custom element created me, called <little-game></little-game> . <little-game></little-game> template code : <template> <a href="{{link}}"> <paper-material elevation="1"> <paper-ripple></paper-ripple> <iron-image src="{{img_url}}"></iron-image> <div id="description">{{name}}</div> <div id="category">{{category}}</div> </paper-material> </a></template> and :host css of element: :host { display: inline-block; text-decoration: none; z-index:1; } those <little-game></little-game> elements displayed in page , inside page have <paper-scroll-header-panel> , <paper-toolbar> . problem when scroll down , .tall <paper-toolbar> gets smaller, can click through <paper-toolbar> on <little-game> / <paper-ripple> element. <paper-ripple>

heroku - Unable to connect to production db for taking custom pg_dump -

i trying pg_dump on production db using heroku pg:credentials . when try take dump, takes long time , gives me error: ssl syscall error: operation timed out however, connecting db using same credentials using psql command works fine. i tried pg_dump -s -h abcded.compute.amazonaws.com -d adflaksjdfl23 -u username -p 5512 password: result: pg_dump: [archiver (db)] query failed: ssl syscall error: operation timed out pg_dump: [archiver (db)] query was: select c.tableoid, c.oid, c.relname, c.relacl, c.relkind, c.relnamespace, (select rolname pg_catalog.pg_roles oid = c.relowner) rolname, c.relchecks, c.relhastriggers, c.relhasindex, c.relhasrules, c.relhasoids, c.relfrozenxid, c.relminmxid, tc.oid toid, tc.relfrozenxid tfrozenxid, tc.relminmxid tminmxid, c.relpersistence, c.relispopulated, 'd' relreplident, c.relpages, case when c.reloftype <> 0 c.reloftype::pg_catalog.regtype else null end reloftype, d.refobjid owning_tab, d.refobjsubid owning_col, (sel

python - PHP Google adx RTB integration - Multiple Ads -

we working on google adx rtb integration our adserver using php , python interpretor language. using google protocol buffers, php rtb server processing bid requests. if matching ad data count 1 considered single ads , responded correctly. when processing multiple matching ad data, struggling process requests? how setup multiple ads responses iframe template , positions? note: referred google adx integration basic documents , google groups responses.

osx - go build runtime: darwin/amd64 must be bootstrapped using make.bash -

i install golang brew install go in mac osx 10.10.4 , when run go build got: go build runtime: darwin/amd64 must bootstrapped using make.bash then refer question cross compile go on osx? first tried: brew install go --with-cc-all but question remain, tried: cd /usr/local/go/src sudo goos=darwin goarch=amd64 cgo_enabled=0 ./make.bash --no-clean but question still remains. how can fix this? system version: os x 10.10.4 (14e46) kernel version: darwin 14.4.0 go version: go version go1.4.2 darwin/amd64 i built source . i've done: from checkout source, in src : src $ goos=darwin goarch=amd64 ./bootstrap.bash #### copying ../../go-darwin-amd64-bootstrap ... ---- bootstrap toolchain darwin/amd64 installed in xxx/go-darwin-amd64-bootstrap. building tbz. -rw-r--r-- 1 hvn staff 48149988 aug 21 10:48 xxx/go-darwin-amd64-bootstrap.tbz then unarchive tbz , build normal: $ tar xzf xxx/go-darwin-amd64-bootstrap.tbz cd extracted dir. then $ ./all.bash

load balancing - How to cluster Spark java framework? -

how can cluster web server based on spark ? can't find clustering in documentation, maybe there third-party tools? i use nginx load balancing cluster spark. http://nginx.org/en/docs/http/load_balancing.html

c# - Checking if website is working and login -

i on project , part of should following; 1) should check website if working or not. if working,its okey.if not should send e-mail. 2)with username , password should login website , again if not logged in should send e-mail. console application want enter website,username,password on console , let program above. using these codes send e-mail , okey rest,i saw many codes(mostly windows application) none of them enough me. help! for sending e-mails; mailmessage mail = new mailmessage(); smtpclient smtpserver = new smtpclient("smtp.gmail.com"); mail.from = new mailaddress("blabla@gmail.com"); mail.to.add("blabla2@yandex.com"); mail.subject = "login"; mail.body += "login failed"; mail.isbodyhtml = true; smtpserver.port = 587; smtpserver.credentials = new system.net.networkcredential("blabla@gmail.com&qu

php - Yii 2 - using custom helpers -

i'm trying use custom helper class create under frontend/components/helper (helper.php) the content of file like: <?php namespace frontend\components\helper; class helper { public static function helpergreetings() { echo("hello helper"); } } ?> and on sitecontroller.php have following: use frontend\components\helper; class sitecontroller extends controller { public function actionindex() { helper::helpergreetings(); return $this->render('index'); } } what should have working? btw, error unknown class – yii\base\unknownclassexception unable find 'frontend\components\helper' in file: /users/foo/sites/bar.dev/frontend/components/helper.php. namespace missing? change namespace in helper class namespace frontend\components\helper; to namespace frontend\components;

JavaFX Fit to parent when adding FXML file to SplitPane -

i have splitpane treeview on left , content area on right. when click on item in treeview want display content on right. how load fxml create in scenebuilder. problem fxml doesn't fit splitpane. how load fxml file if (selecteditem.getvalue() == "sample") { try { anchorpane pane = (anchorpane) fxmlloader.load(getclass().getresource("sample.fxml")); splitpane.getitems().set(1, pane); } catch (ioexception e) { e.printstacktrace(); } } how make anchorpane created fit original splitpane size? aligning in fx pain i.t.a. i suggest following: <splitpane> <treeview /> //left <anchorpane anchorpane.bottomanchor="0.0" anchorpane.leftanchor="0.0" anchorpane.rightanchor="0.0" anchorpane.topanchor="0.0"> //right, anchors make content stick corner <anchorpane fx:id="mydynamiccontent"/> </anchorpane> </splitpa

printing - How to print a Pdf file in zebra GK420t without using any middleware software for converting pdf to ZPL on linux? -

i want print pdf file on zebra gk420t . i'm unable (printer doesn't prints anything,doesn't shows job in queue).is there way convert pdf ? i'm using ubuntu 14.04 , trying print file using cup ,i used command lp -d <printer_name> *.pdf . i searched google query , found link link-os virtual device but i'm unable understand this. please i'm newbie.

python - Django Subdomains - Web page has a redirect loop -

i developing django app users intend each user have own custom subdomain. intend use middleware purpose. far, got, on accessing site (on google chrome), redirect loop error: class subdomainmiddleware(object): def process_request(self, request): if request.user.is_authenticated(): if request.company none: company_subdomain = request.user.company.company_url else: company_subdomain = request.company.company_url company_subdomain = company_subdomain.lower() domain_parts = request.get_host().split('.') if len(domain_parts) > 2: if domain_parts[0].lower() != company_subdomain: domain_parts[0] = company_subdomain else: domain_parts.insert(0, company_subdomain) domain = '.'.join(domain_parts) return httpresponseredirect('http://' + domain + request.get_full_path())