Posts

Showing posts from January, 2010

java - Problems displaying barcode font -

java - Problems displaying barcode font - i creating labels bar codes ean13. not want utilize barcode4j lib reasons of processing speed. using ireport added font ff ean, , custom function barcode translation. because run study in java (in eclipse ide), exported font in jar file, , added java project. using pdf preview ireport barcode can seen properly, running in java barcodes not displayed. font exporting procedure runs well, because had integrated font times new roman, not available default. why font ff ean ignored? java fonts jasper-reports barcode

c++ - Undefined reference to Template Static Function -

c++ - Undefined reference to Template Static Function - what wrong code !!!! undefined reference `bool bioqt::qsequencevalidator::isvaliddnasequence(bioqt::qsequence)' class qsequencevalidator { public: template<class seq> static bool isvaliddnasequence(seq seq); } template<class seq> bool isvaliddnasequence(seq seq) { foreach (qchar c ,seq) { if(!compoundset::dnacompoundset().contains(c,qt::caseinsensitive)) homecoming false; } homecoming true; } int main(int argc, char *argv[]) { qcoreapplication a(argc, argv); qdebug()<<qsequencevalidator::isvaliddnasequence(pop); homecoming a.exec(); } add qsequencevalidator:: before isvaliddnasequence definition. defining free function, not static fellow member function. i.e. template<class seq> bool qsequencevalidator::isvaliddnasequence(seq seq) { ... } c++ qt qt4

actionscript 3 - Flash AS3 ComboBox Dropdown Hover Color -

actionscript 3 - Flash AS3 ComboBox Dropdown Hover Color - hi working on designing flash programme using adobe flash cs6 , as3. cannot life of me figure out how alter dropdown default lite bluish hover color in combobox component. have changed other colors need that. able alter font color when hovered on using code below. simply design constraint , isn't affecting programme in other way except uniformity. help appreciated! import fl.events.*; import fl.managers.*; import fl.controls.*; import fl.controls.listclasses.*; stop(); var standard = new textformat(); standard.color = 0x000000; stylemanager.setstyle("standard",standard); var hover_color = new textformat(); hover_color.rollovercolor = 0xff0000; stylemanager.setstyle("hover_color",hover_color); stylemanager.setcomponentstyle(combobox,"textformat",stylemanager.getstyle("standard")); stylemanager.setcomponentstyle(textinput,"textformat",stylemanager.getstyl

c++ - Best place to call MiniDumpWriteDump() to catch a crash -

c++ - Best place to call MiniDumpWriteDump() to catch a crash - i have large-ish win32 programme i'm maintaining, , i'd instrument automatically , unconditionally generate minidump file whenever something bad happens. can't inquire customers install userdump.exe, , can't inquire them install visual studio. is there way of doing this? i'd able generate minidump whether abort() called our assert handler (which complicated), whether touches bad memory, or else bad happens. on posix, i'd install signal handler , done this. understanding equivalent approach on windows seh, our programme starts lot of threads in lot of different places painful wrap every thread entry point __try/__catch. ideas? c++ windows exception signals structured-exception

memory management - mmap vs malloc vs calloc performance microbenchmark: What to expect -

memory management - mmap vs malloc vs calloc performance microbenchmark: What to expect - i have created microbenchmark compare allocation performance , rss usage malloc vs mmap. i'm coming conclusion mmap fastest unless utilize memory. hence utilize sparsely populated info structures. my questions whether conclusion right , numbers came create sense (see below details). #include <string.h> #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include <sys/time.h> int main() { #define size 100 void* allocated[size]; size_t size[size]; timeval then, now; memset(allocated, 0, sizeof allocated ); gettimeofday(&then, null); size_t count = 0; size_t = 0; ( ;; ) { if ( allocated[ ] ) { munmap( allocated[ ], size[ ] ); //free( allocated[ ] ); } size[ ] = rand() % 40000000 + 4096; allocated[ ] = mmap( null, size[ ], prot_read | prot_write, map_private | m

html - absolutely positioned picture covering text -

html - absolutely positioned picture covering text - i have image i've positioned absolutely utilize background. it's covering content of page. <!doctype html> <html> <head> <meta charset="utf-8"> <title>untitled document</title> <style> #pic1 { position:absolute; top: 0px; left: 0px; } </style> </head> <body> <h1> hi there </h1> <h1> hi there </h1> <h1> hi there </h1> <img id="pic1" src="1.jpg" width="100%" alt="picture"> </body> </html> you should alter z-index css property of image the z-index property specifies stack order of element. an element greater stack order in front end of element lower stack order how ever can utilize property on body element set background : background-image:url('image url'); html css

html - Align fixed navigation-div to the right outer div -

html - Align fixed navigation-div to the right outer div - the navigation bar sticks left of container-div. want stick right. tried several things none of them worked. here barebones code. how can navigation bar sticks right side, ending container-div ends? ps: has fixed because want navigation remain @ top of browser window, no matter how much user scrolls down. #container { margin: 0 auto; width: 820px; } #navigation { position: fixed; z-index: 10000; display:block; } ok, had guess @ html code , build you: http://jsfiddle.net/vdl6b/ from can imagine you're trying achieve, it's possible 1 of 2 solutions: removing position:fixed; , adding float: right; navigation css. adding right: 0; define position. i chose latter. here's example using first. html css

struts2 - execute action when .js file loads -

struts2 - execute action when .js file loads - question: there way execute action on welcome.jsp file? my problem: welcome.js file has string literals substituted java properties like: <button value"${com.button.ok.literal}" ... and substituted when action executed, problem initial doesn't execute action , there's no substition, struts.xml looks like: <action name = "createprocess" class = "com.acme.actions.init" method="create"> <result name ="ok">/jsp/welcome.jsp</result> </action> i tried execute empty action 'loadlabels', defining in welcom.js init(): funcion init(){ ... <% string checkfirst = (string)request.getattribute("checkfirst"); %> if ("<%=checkfirst %>" != "first"){ document.forms[0].action ="loadlabels.action?parameter=first";

wpf - C# Group results from List into another List with selected fields -

wpf - C# Group results from List<T> into another List<T2> with selected fields - i wondering if there's simpler way using linq or other way... i want extract, list, rows, grouping them particular field , storing result in different, list containing grouped, not repeated, result of search parameter. here's example: public class customobj { public int doc { get; set; } public string desc { get; set; } public string name{ get; set; } } public class worker() { public void dowork() { list<customobj> objs = new list<customobj>(); objs.add(new customobj(1, "type1", "name1")); objs.add(new customobj(1, "type2", "name1")); objs.add(new customobj(2, "type2", "name2")); objs.add(new customobj(3, "type1", "name1")); objs.add(new customobj(3, "type2", "name1")); objs.add(new customobj(3, "typ

mysql - SQL returning null results when queried -

mysql - SQL returning null results when queried - i'm doing bring together statement 2 database tables. here's code , output: code select recurrentemergencies.day, emergencies.systems, emergencies.descriptions, emergencies.breakers emergencies right bring together recurrentemergencies on recurrentemergencies.systems = emergencies.systems order emergencies.descriptions; output day systems descriptions breakers 1 null null null 1 null null null 0 null null null 0 null null null 1 null null null 1 null null null 1 null null null 0 null null null doing left bring together partially right, returns correctly, duplicates each row in the emergencies table. day systems descriptions breakers 1 avionics ads 2 fail avionics[2] 1 avionic

r - Aperiodic To Periodic Time series -

r - Aperiodic To Periodic Time series - i trying implement interpolating time series create periodic. have inserted info below. datetime x 7/1/2010 0:03 12.7 7/1/2010 0:08 12.7 7/1/2010 0:13 12.7 7/1/2010 0:18 12.5 7/1/2010 0:23 12.5 7/1/2010 0:28 12.4 7/1/2010 0:33 12.5 7/1/2010 0:38 12.5 7/1/2010 0:43 12.4 7/1/2010 0:48 12.4 7/1/2010 0:53 12.4 7/1/2010 0:58 12.4 7/1/2010 1:03 12.2 7/1/2010 1:08 12.2 7/1/2010 1:13 12.2 7/1/2010 1:18 12.2 7/1/2010 1:23 12.2 7/1/2010 1:28 12.2 7/1/2010 1:33 12.2 one hr data. 7/1/2010 00:00:00 12.508 7/1/2010 00:00:00 12.2 i tried cublic spline interpolation in sas guide. gave results. trying implement similar in r. r datetime interpolation

swift - Cannot find overload for '/', '*', Failure when running an app on anything but iPhone 5s simulator -

swift - Cannot find overload for '/', '*', Failure when running an app on anything but iPhone 5s simulator - my game builds , runs on iphone 5s simulator, when seek on other version next 2 errors: `could not find overload '*' accepts supplied arguments` `could not find overload '/' accepts supplied arguments` i'm writing game exclusively in swift, , deployment target ios 7.1 the die rolls in image defined as let lengthdiceroll = double(arc4random()) / 0x100000000 allow sidediceroll = int(arc4random_uniform(uint32(4))) your problem difference between 32- , 64-bit architecture. note target architecture you're compiling target determined selected device—if you've got iphone 4s simulator selected target in xcode, example, you'll building 32 bit; if you've got iphone 5s simulator selected, you'll building 64-bit. you haven't included plenty code help figure out going on (we'd need know types of

playframework 2.2 - Play 2.3 subproject dependsOn -

playframework 2.2 - Play 2.3 subproject dependsOn - this how configure subprojects @ play 2.3. however, gives me sbt.resolveexception: unresolved dependency. wrong settings? works in 2.2. val model = project(appname + "-model", file("models")).enableplugins(play.playscala).settings( version := appversion, librarydependencies ++= modeldependencies ) val main = project(appname, file(".")).enableplugins(play.playscala).enableplugins(sbtweb).settings( version := appversion, librarydependencies ++= appdependencies ).dependson(model % "test->test;compile->compile") try this: lazy val model = project( id = s"${appname}-model", base of operations = file("models")) .enableplugins(play.playscala) .settings(version := appversion) .settings(scalaversion := "2.11.1" ) .settings(librarydependencies ++= modeldependencies) lazy

android - Why Use Start Activities? -

android - Why Use Start Activities? - i've been looking through api documentation, , noticed starting api level 16 context class includes next method: public abstract void startactivities (intent[] intents) i've been googling around in attempts stave curiosity through example's of it's utilize in application code, question, or article, haven't come across of yet. if has asked similar question, please allow me know. anyways, i'm curious when should/could used in application code, , (if any) benefits of doing be? i've never seen method used, , fail grasp it's utility. feedback appreciated. it's used in application code. going never, i'm not that sure ;) however, can used create synthetic stack, when starting new task. want have ready-made stack, key navigates "hierarchically" within task. curiously, it's improve explained in documentation of contextcompat in context itself. start set of activities

python - django view not passing a value to the temple using render_to_response -

python - django view not passing a value to the temple using render_to_response - i followed this link , tried similar in django app. in views.py defined this: def acadprogram(request): name = program_requirement_category.objects.get(name='as.science') student_id = 2773951 values = {'student_id':student_id} descendants = name.get_descendants(include_self=true) homecoming render_to_response("courses.html", {'nodes':descendants.all()}, values, context_instance = requestcontext(request)) and tried accessing student_id this: <h3><font color=#428bca>caleb streeter {{student_id}}</font></h3> but django threw me error follows: render_to_string() got multiple values keyword argument 'context_instance' so how seek passing value through render_to_response? two options: edit values be values = {'student_id':student_id, 'nodes':descendants.all() } and return

Freebase - get Movies AND TV Shows by Artist -

Freebase - get Movies AND TV Shows by Artist - i doing this: var que = '[{\ "id": "' + id.id + '",\ "name": null,\ "/film/actor/film": [{\ "film": null,\ "id": null,\ "character": null,\ }]\ }]'; var json = json.stringify(eval("(" + que + ")")); var films = new array(); var url2 = 'https://www.googleapis.com/freebase/v1/mqlread?query=' + json; $.getjson(url2,function(data){ films = data.result[0]["/film/actor/film"]; (x=0; x<films.length;x++){ var title = films[x].film; var id = films[x].id; $("#movies").text($("#movies").text() + title + ","); } }) and works fine far, when check result, includes movies actor or actress performed in, how can include or request tv shows well? include necessary types , properties tv shows

In asp.net mvc when updating data how does one know that the data beeing manipulated does really belong to the user making the call? -

In asp.net mvc when updating data how does one know that the data beeing manipulated does really belong to the user making the call? - in asp.net mvc when creating, updating, deleting info how 1 know info beeing manipulated belong user making call? [authorize] [httppost] public actionresult edit(model model) { // edit info in database } if user manipulate own info can see , find out info of other users witch public manipulate. how can sure user says when illustration edit called? the authorize makes sure user has logged in. i'm thinking using controller.user.identity.name in update create sure user how created info 1 changes it. but comes question possible user go around manipulating controller.user.identity.name ? how can 1 know user says regard this? there 2 kinds of authorization. one, "vertical", has helpers provided framework (such authorize attribute). "vertical authorization" determines if user allowed cre

statistics - Blom (or other rank-based) transformation in Java -

statistics - Blom (or other rank-based) transformation in Java - i'm trying implement blom transformation in java, means transforming ranks standard normal distribution. i'm using java statistical classes libraries derive ranks , create normal distribution, doesn't seem provide proper function transformation. any idea? java statistics

javascript - Can it be determined if window.resizeTo will work? -

javascript - Can it be determined if window.resizeTo will work? - inside javascript console, if execute: m = window.open(location.origin); m.resizeto(400, 400); the window resize, if execute: window.resizeto(400, 400); then nil happens. understand reason behavior. how can observe situations window.resizeto nothing? approach 1: you can utilize window.opener property. if it's null, did not open window , cannot resize it. window.parent intended more iframes , like. such as: if (m.opener) { m.resizeto(400, 400); } else { // did not create window, , not able resize it. } approach 2: ajp15243 brings point, 1 thing hear resize event , see if resizeto worked: var resizefired = false; ... var triggeredresize = function() { resizefired = true; m.removeeventlistener('resize', triggeredresize); } m.addeventlistener('resize', triggeredresize, true); m.resizeto(400, 400); if (resizefired) { // resize worked.

javascript - Maintain background scroll when modal opens -

javascript - Maintain background scroll when modal opens - i had looked through many other questions on , other sites. having same issue neither of solutions working me. mutual solution saw remove # href attribute of a tag modal opens on click of div , other having different cases, neither of them suited situation. what happens when scroll downwards , click on div open modal, modal opens successfully. before that, having issue when opened modal, scrollbar added , per reply of previous question, said this: body.modal-open { overflow: hidden !important; } i did , worked when open up, background scrolls top. know that's happening because of position: fixed property. might need specify top attribute maintain scroll position everytime, top offset alter no constant top value top property. i looked out finding out page's scroll offset , found utilize window.pageyoffset figure out how much user has scrolled background. tried log value of pageyoffset cons

php - NumberFormatter::SPELLOUT spellout-ordinal in russian and italian -

php - NumberFormatter::SPELLOUT spellout-ordinal in russian and italian - this code works english, spanish , high german ordninal numbers, russian or italian ordninal numbers doesn't work. 'ru-ru' , 'it-it' don't work i illustration in russian 2 -> два (this cardinal number) , want ordinal number , here 2 -> второй. i illustration in italian 2 -> due (this cardinal number) , want ordinal number , here 2 -> secondo. update: i found solution works in french, spain, high german , other languages: maskuline ordinal numbers: %spellout-ordinal-maskuline feminine ordinal numbers: %spellout-ordinal-feminine russian , italian version doesn't work , tried -maskuline/-feminine $ru_ordinal = new numberformatter('ru', numberformatter::spellout); $ru_ordinal->settextattribute(numberformatter::default_ruleset, "%spellout-ordinal"); numberformatter using icu formatting. as can check here: http://saxo

javascript - kendo ui - data-column template function is undefined in grid -

javascript - kendo ui - data-column template function is undefined in grid - i've 2 files: customer.js , add-customer-template.html . there grid on add-customer-template.html given below. <div id="leadsgrid" data-role="grid" data-bind="source: leadsds" date-scrollable="true" data-editable="popup" data-toolbar="['create']" data-columns='[ { field: "salesperson", title:

javascript - Oninput event in ace.js -

javascript - Oninput event in ace.js - i have few editors on 1 page. stored in array. how determine editor come in text? for(var = 0; < types.length; i++) { editors[types[i]].on('input', function() { console.log( ? ); // how current editor? //console.log(editors[types[i]]); // doesn't work }); } thanks in advance. according examples here, can see ace's on functions have this variable references caller for(var = 0; < types.length; i++) { editors[types[i]].on('input', function() { // eg: console.log(this); }); } javascript ace-editor

hadoop - Point Mahout to HDFS instead of local disk -

hadoop - Point Mahout to HDFS instead of local disk - i trying run logistic regression on mahout file that's in hdfs - name of file ppeng.txt next command line. mahout org.apache.mahout.classifier.sgd.trainlogistic --passes 5 --rate 1 --lambda 0.5 --input ppeng.txt --features 21 --output test_mahout --target nbr_of_txns --categories 2 --predictors lifetime_rev_usd_amt ntpv_12_mth_sent_usd_amt --types n n this file in hdfs, but, line errors out file not found exception unless re-create file local machine. my hadoop_local variable set null well. error follows - has have experience fixing problem - if so, please help. exception in thread "main" java.io.filenotfoundexception: ppeng.txt (no such file or directory)** @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:120) @ org.apache.mahout.classifier.sgd.trainlogistic.open(trainlogistic.java:316) @ org.apache.mahout.

c# - Deserialize array with ServiceStack -

c# - Deserialize array with ServiceStack - here's i'm trying post servicestack web service: $.ajax({ url: 'http://localhost:8092/profiles', type:'post', data: { firstname : "john", lastname : "doe", categories : [ "category 1", "category 2", "category 3" ] }, success: function (response) { $('#response').append('success!'); }, error: function (xhr, ajaxoptions, thrownerror) { alert(xhr.status + ' error: ' + thrownerror); }, datatype: "json" }); and here's destination class: [route("/profiles", "post")] public class profilerequest { public string firstname{ get; set; } public string lastname{ get; set; } public string[] categories{ get; set; } } all fields beingness populated except array. can servicestack not handle objects of complexity or missing something?

javascript - Can I use code inspector in Firefox to do a Check All input type = checkbox on a website that isn't mine? -

javascript - Can I use code inspector in Firefox to do a Check All input type = checkbox on a website that isn't mine? - i have question little outside realm. i'm newbie jquery , javascript. run forum on proboards, , when forum runs out of allocation attachments (pictures users can post) have manually go through attachment list , check every single checkbox 1 one, able click delete button delete every attachment i've checked. checking thousands of boxes 1 1 takes forever. there no implemented "check all", , there thousands of checkboxes. in code, every single checkbox has name ids[]: <input type="checkbox" value="1494" name="ids[]"></input> so should able target them name "ids[]" think. value different each one. name same all. question is... code utilize , set in firebug or inspector? i'm sadly much of noob able figure out do. i have firebug firefox, , in have add-on jquerify, can forcefulne

php - converting special characters after reading a site's meta tags -

php - converting special characters after reading a site's meta tags - i'm pulling facebook meta tags external site code, works: $site = file_get_contents($link); $html = new domdocument(); @$html->loadhtml($site); $meta_title = null; foreach($html->getelementsbytagname('meta') $meta) { if($meta->getattribute('property')=='og:title'){ $meta_title = $meta->getattribute('content'); } } echo 'og:title: '.$meta_title; my problem if og:title contains apostrophe, example, outputs bunch of funky characters. example: that̢۪s spot instead of: that's spot how create output correctly? check 3rd part website collation, on utf-8 or latin. then should convert website collation. using? utf8 or latin? if using utf8 , 3rd part latin, should utilize utf8_encode($actualvar) if using latin , 3rd part utf8, should utilize utf8_decode($actualvar) i suppose there 2 differ

workbench - Round Function in MySQL -

workbench - Round Function in MySQL - i have value of 18.5 , when used round() , remains 18. how round off value 19. 18.5 ---> 19 [any other functions] thankx you might want refer ceil function. seek ceil(18.5) mysql workbench

c# - XML processing instructions not appearing in the prolog -

c# - XML processing instructions not appearing in the prolog - i have c# programme generates xml application. taking attribute values of these xml tags , attempting display them in formatted table using xslt. have been able stylesheet(xsl) reference appear in xml document, appears @ bottom hence displaying original xml. how can processing instruction tag appear right after declaration? snippet puts processing instruction @ bottom of xml doc. xmlprocessinginstruction newpi; string pitext = "type='text/xsl' href='stylesheet.xsl'"; newpi = b.createprocessinginstruction("xml-stylesheet", pitext); b.appendchild(newpi); if additional info needed please allow me know , appreciate input. thanks use b.insertbefore(newpi, b.documentelement) . c# xml xslt

c - How can I debug 'zend_mm_heap corrupted' for my php extension -

c - How can I debug 'zend_mm_heap corrupted' for my php extension - the problem i've written php extension (php 5.3) appears work fine simple tests moment start making multiple calls start seeing error: zend_mm_heap corrupted normally through console or apache error log, see error [thu jun 19 16:12:31.934289 2014] [:error] [pid 560] [client 127.0.0.1:35410] php fatal error: allowed memory size of 134217728 bytes exhausted (tried allocate 139678164955264 bytes) in unknown on line 0 what i've tried do i've tried find exact spot issue occurs appears occurs between destructor beingness called php class calls extension before constructor runs first line of constructor (note, have used phpunit diagnose this, if run in browser work 1 time , throw error log on next effort 'the connection reset' in browser window no output. i've tried adding debug lines memory_get_usage , installing extension memprof output fails show serious memory

bash - While loop executes only once when using rsync -

bash - While loop executes only once when using rsync - i've created bash script migrate sites , databases 1 server another: algorithm: parse .pgpass file create individual dumps specified postgres db's. upload said dumps server via rsync . upload bunch of folders related each db other server, via rsync. since databases , folders have same name, script can predict location of folders if knows db name. problem i'm facing loop executing 1 time (only first line of .pgpass beingness completed). this script, run in source server: #!/bin/bash # read each line of input file, parse args separated semicolon (:) while ifs=: read host port db user pswd ; # create dump. no need come in password we're using .pgpass pg_dump -u $user -h $host -f "$db.sql" $db # create dir in destination server re-create files ssh user@destination.server mkdir -p webapps/$db/static/media # re-create dump destination server rsync -azhr $db.sql user

string - Is there an error in Gusfield's description of the dynamic programming algorithm for finding global alignments with constant gap penalty? -

string - Is there an error in Gusfield's description of the dynamic programming algorithm for finding global alignments with constant gap penalty? - gusfield (algorithms on strings, trees, , sequences, section 11.8.6) describes dynamic programming algorithm finding best alignment between 2 sequences , b under assumption penalty assigned gap of length x in 1 of aligned sequences of form r+sx constants r , s. in special case s=0, there penalty origin gap no penalty lengthening it. seems me there error in gusfield's formulae , hope can help me understand true state of affairs. gusfield defines 4 functions v(i,j), g(i,j), e(i,j) , f(i,j) next properties: v(i,j) best score possible alignments of prefixes a[1..i] , b[1..j]. e(i,j) best possible score alignments of these prefixes under status b[j] paired against gap in a. f(i,j) best possible score alignments of these prefixes under status a[i] paired against gap in b. g(i,j) best possible score alignments pa

javascript - Applying a title tag to a frame within an iFrame -

javascript - Applying a title tag to a frame within an iFrame - i trying add together title tags frames within iframe. files reside on same domain. the total selector html page loading within iframe "html > frameset:nth-child(2) > frame:nth-child(1)" however using next code not update attribute frames within iframe. $('#project_frame').contents().find('frame').attr('title','table of contents'); <iframe id="project_frame" name="project_frame" src="<?= $uri ?>" frameborder="0" title="project_frame"></iframe> the iframe loading source asynchronous main execution, here's nice trick create desired code wait 'til it's loaded: <iframe id="project_frame" name="project_frame" src="<?= $uri ?>" frameborder="0" title="project_frame"></iframe> $("#project_frame").loa

Idiomatic way to handle nested nullable objects in scala? -

Idiomatic way to handle nested nullable objects in scala? - i'm working scala , inherited java code needs grafted in , unfortunately rewriting in scala isn't in cards. has nested object structure, , level can null. care values deep within nesting. ideally, i'd this: option(foo.blah.blarg.doh) but if of foo.blah.blarg null, generate npe. for i've taken wrapping in try: try(option(foo.blah.blarg.doh)).getorelse(none) note using .tooption doesn't work quite right can lead some(null) if final bit of chain null. i'm not particularly fond of construct, other ideas out there? take advantage of by-name parameters build own construct: def handlenull[t](x: => t): option[t] = seek option(x) grab { case _: nullpointerexception => none } handlenull(foo.blah.blarg.doh) scala

python csv don't print duplicates -

python csv don't print duplicates - we have many csv files follows: name,type 1,fuji 2,fuji 3,fuji 4,fuji 5,washington 6,washington 7,washington 8,washington 9,washington we print out types of apples without printing duplicates. fuji:6 washington:4 gaza:1 or fuji washington gaza the next our attempt. although doesn't seem work unknown reasons. # python 2.7 import csv import glob import collections collections import counter list = glob.glob('c:apple*.csv') file in list: infile = open(file, "rb") reader = csv.reader(infile) column in reader: discipline = column[1] print collections.counter(discipline) infile.close() i haven't used csv module before here quick effort @ think might trying achieve. import csv src = r'c:\apples_before.csv' dst = r'c:\apples_after.csv' apples = set([]) # read file. open(src, 'r') srcfile: reader = csv.reader(srcfile, delimi

How to merge elements of vectors in new vector in R -

How to merge elements of vectors in new vector in R - i want extract elements of each vector , new vector attached elements x<-c(1,2,3,4) y<-c(w,w,w,w) z<-c(1,2,3,4) expected result xyz<-c(1w1,2w2,3w3,4w4) thank also, as.character(interaction(x,y,z,sep="")) #[1] "1w1" "2w2" "3w3" "4w4" r

msbuild - When publishing solution, is it possible to ignore certain projects? -

msbuild - When publishing solution, is it possible to ignore certain projects? - we have projects used in environments publishing skip them. however, when publishing whole solution next msbuild error: "c:\source\solution.sln" (default target) (1) -> "c:\source\project\project.csproj" (default target) (51) -> (validatepublishprofilesettings target) -> c:\program files (x86)\msbuild\microsoft\visualstudio\v11.0\web\microsoft.web.publishing.targets(4253,5): error : value publishprofile set 'sta ge', expected find file @ 'c:\source\project\properties\publishprofiles\stage.pubxml' not found. [c:\source\project\project.csproj] c:\program files (x86)\msbuild\microsoft\visualstudio\v11.0\web\microsoft.web.publishing.targets(4260,4): error : publishprofile(stage) set. $(web publishmethod) not have valid value. current value "". [c:\source\project\project.csproj] c:\program files (x86)\msbuild\microsoft\visualstudio\v11.0\we

Find the Story Name In VersionOne using Project ID or Name python SDK -

Find the Story Name In VersionOne using Project ID or Name python SDK - i using versionone python sdk, , want know story names within project (scope) have project (scope) id , name , using project id , name how story id , name? v1 = v1meta() for scopeobj in v1.scope.select('id','name').where(name='work management'): print scopeobj.id # print scpe id but how story names , id, within project(scope). you can utilize approach: the "filter" operator take arbitrary v1 filter terms. here's documentation that: v1 = v1meta() story in v1.story.filter("scope.id='scope:1122'"): print story print story.name python versionone

javascript - Google Maps InfoBox enableEventPropagation -

javascript - Google Maps InfoBox enableEventPropagation - i using infobox plugin create custom interactive info-windows in google maps. these infowindows users can scroll through list , click on image invoke script. works, issue when enableeventpropagation enabled can click through infobox other markers causes infobox pop up. does have experience solving problem? infowindow = new infobox({ content: document.getelementbyid("infobox-wrapper"), disableautopan: true, enableeventpropagation: true, zindex: null, pixeloffset: new google.maps.size(-300, -0), closeboxurl: '../assets/images/info-close.png', boxstyle: { color: 'white', background: '#101010', width: &

xml - XPath to find elements that have no other elements referencing them -

xml - XPath to find elements that have no other elements referencing them - given next xml document… class="lang-xml prettyprint-override"> <r> <e id="a" /> <e id="b" /> <e id="c" /> <x ref="#b" /> </r> …how can write xpath 1.0 look finds <e> elements not have <x> element referencing them? in example, result should #a , #c . based on this question tried //e[ not(//x[@ref=concat("#",@id)]) ] , not omit referenced element: class="lang-ruby prettyprint-override"> # ruby code using nokogiri puts doc.xpath( '//e[ not(//x[@ref=concat("#",@id)]) ]' ) #=> <e id="a"/> #=> <e id="b"/> #=> <e id="c"/> is there way utilize attribute in found set farther query values of other attributes in other elements? from xml <r> <e id="a" /> &

Doctrine and Like query symfony2 -

Doctrine and Like query symfony2 - i have search bar in page , action in in charge of looking user search : public function searchaction(request $request){ $em = $this->container->get('doctrine')->getentitymanager(); $evenements= $em->getrepository('mql14mqlmebundle:evenement')->findall(); if ('post' === $request->getmethod()) { $search = $request->get('search'); $query = $this->container->get('doctrine')->getentitymanager()->createquery( 'select e mql14mqlmebundle:evenement e e.nom :search') ->setparameter('search', $search); $resultats = $query->getresult(); homecoming $this->container->get('templating')->renderresponse('mql14mqlmebundle:event:search.html.twig', array( 'resultats'=>$resultats, )); } homecoming $this->listeraction();

xcode - iOS: sign app for inhouse distribution with a customers provisoning profile -

xcode - iOS: sign app for inhouse distribution with a customers provisoning profile - i'm having troubles code sign app in-house distribution. client got ios enterprise developer business relationship , set provisioning profile. don't know how sign app , if there prerequisites have met. currently during development app signed via profile of company (the team apple-id in). testing devices added via udid profile. next step utilize customers provisioning profile , certificate build app in-house distribution. have respective files somehow i'm stuck. when seek bring certificate or provisioning profile in i'm getting code signing errors. can help me steps have take? if provisioning profile crated there scheme (client mac) , want utilize provisioning in scheme need scheme cer.p12 file , double click on instal in key-chain. can utilize provisioning system. no need other stuff. just tel client sending cer .p12 file go keychain , select cer appear in

angularjs - Unit testing in Angular -

angularjs - Unit testing in Angular - as understand scenario-runner deprecated. run unit tests in karma , e2e test in protractor. for me feels wrong start browser(karma) running unit tests. assumptions correct? how test angular applications? a practised standard when come testing angular utilize phantomjs headless browser unit testing. whatever way @ need javascript engine , running before can test. however, using headless browser lot quicker there no ui. i utilize karma, chai , sinon (for mocking) - dev workflow uses phantomjs , ci , release builds utilize actual browsers ie, chrome etc utilize browserstack when ci builds run. you can see illustration of tests , karma config here you want @ grunt / gulp manage process of testing. anything after in particular around testing? angularjs karma-runner protractor

garrys mod - Lua attempt to index global 'self' error (GMod Lua script) -

garrys mod - Lua attempt to index global 'self' error (GMod Lua script) - i have been getting next error section of code: [error] lua/entities/cook/init.lua:58: effort index global 'self' (a nil value)1. cooked - lua/entities/cook/init.lua:58 the function starts @ line 57, , when remove line 58 (local pos = self.entity:getpos() , gives same error message line 61. function cooked() local pos = self.entity:getpos() local roll = math.random(1, 5); if roll == 5 self.entity:emitsound("phx/explode06.wav") self.entity:remove() else local createfood = ents.create("food") createfood:setpos(pos + vector(0,10,100)) createfood:spawn() self:sendlua("gamemode:addnotify(\"you finish cooking nutrient , bundle product!\", notify_generic, 4)") end end it's unclear self should be. error says it's global, consistent code have shown.

Three.js - Can't change loaded JSON position -

Three.js - Can't change loaded JSON position - i have model of temple made in google sketchup (.obj file). convert json , load application. problem mesh moved far away position, can't see it. i'm trying alter position i've failed far. below code. can tell me what's wrong? i'm new three.js , i'm @ loss // set scene, camera, , renderer global variables. var scene, camera, renderer; init(); animate(); // sets scene. function init() { // create scene , set scene size. scene = new three.scene(); var width = window.innerwidth, height = window.innerheight; // create renderer , add together dom. renderer = new three.webglrenderer({antialias:true}); renderer.setsize(width, height); document.body.appendchild(renderer.domelement); // create camera, zoom out model bit, , add together scene. photographic camera = new three.perspectivecamera(45, width / height, 0.1, 20000); camera.position.set(0,16,0); scene.add(camera); //

objective c - Swift app migration issue -

objective c - Swift app migration issue - i'm rewriting app swift , worked fine far. tried translate uicollectionviewflowlayout subclass , encountered problems. i'm unable understand how translate layoutattributesforelementsinrect method of class... many errors. problem class it's single 1 i've not written. downloaded class net don't understand logic behind it. can help me? here finish class, need layoutattributesforelementsinrect method since i've translated sec (layoutattributesforitematindexpath) one. , oh, yes! layout left-aligns every cell within corresponding collection view! in advice! #import "iyalignleftlayout.h" const nsinteger kmaxcellspacing = 30; @implementation iyalignleftlayout - (nsarray *)layoutattributesforelementsinrect:(cgrect)rect { nsarray* attributestoreturn = [super layoutattributesforelementsinrect:rect]; (uicollectionviewlayoutattributes* attributes in attributestoreturn) { if (nil == attributes.represe

mysql - update timestamp trigger not working -

mysql - update timestamp trigger not working - iam trying create trigger on particular field of table.each time value of column changes timestamp should recorded in timestamp column field ticket_close_time (data tytpe timestamp).but every time seek execute trigger error "#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax utilize near '' @ line 6" dont understand issue is.i have tried now(),current_timestamp nil works maintain getting error. trigger code delimiter // create trigger updtrigger before update on ticket_tran each row begin if new.ticket_resolved_flag <> old.ticket_resolved_flag set new.ticket_close_time = now(); end if; end // there no need trigger, mysql has native on update current_timestamp see: http://dev.mysql.com/doc/refman/5.0/en/timestamp-initialization.html as trigger: can't spot syntax error. think problem delimiter stil

qt - Issue Subclassing a Qlabel C++ -

qt - Issue Subclassing a Qlabel C++ - i attempting subclass qlabel using header file , error on constructor intellisense: indirect nonvirtual base of operations class not allowed class foo : public qlabel { q_object foo(qwidget* parent = 0) : qwidget(parent) { } void mousemoveevent( qmouseevent * event ) { //capture } }; any suggestions why happening , how can prepare ? the problem here: foo(qwidget* parent = 0) : qwidget(parent) you inheriting qlabel, specify qwidget base. should write intead: explicit foo(qwidget* parent = q_nullptr) : qlabel(parent) // ^^^^^^ also, please utilize explicit constructor q_null_ptr or @ to the lowest degree null instead of 0. c++ qt intellisense qtgui qlabel

compile and link objects with mingw, g++, gcc, ld -

compile and link objects with mingw, g++, gcc, ld - i'm next istructions found here compile os kernel. unfortunely error , don't know do: gcc boot.o kernel.o -t linker.ld -o kern - nostdlib -nodefaultlibs -lgcc yields this: boot.o: in function `start': boot.asm:(.mbheader+0xe): undefined reference `kernel_main' collect2.exe: error: ld returned 1 exit status everything same except replaced loader.o boot.o (it seems me mistake, loader.o not mentioned anywhere on page). how can create work? c++ name mangling calling kernel_main else. i defined function extern "c" recompiled , opened object. saw actual function name _kernal_main. opened boot.asm file , referenced name. gcc mingw ld

xamarin.forms - Can the TableView have multiple headers? -

xamarin.forms - Can the TableView have multiple headers? - i've attached image. can tableview have multiple headers , grouped sub model? my model construction looks this. class="lang-csharp prettyprint-override"> public class moduleviewmodel { public string title { get; set; } public ilist<mediaviewmodel> media { get; set; } } public class mediaviewmodel { public string title { get; set; } public string icon { get; set; } public modulesectionviewmodel modulesection {get; set;} } public class modulesectionviewmodel { public string title { get; set; } } the view you're seeing in image moduleview the tableview (the sliding navigation bit) bind it's source media property the table grouped modulesection.title property is possible? if so, start? to add together complication, prefer doing bindings in xaml :) tableview not bindable right now. can accomplish similar result subclassing it, , assigning tablev

java - Passing the child instance on construction -

java - Passing the child instance on construction - i have parent class has methods need utilize child's class instance, can't seem pass via constructor: public abstract class codelanxplugin<e extends codelanxplugin<e>> /* other inheritance */ { private final e plugin; public codelanxplugin(e plugin) { this.plugin = plugin; } @override public void onenable() { //need able utilize plugin instance } } however, because kid class has able collect kid instance in form before onenable called, came this: public class myplugin extends codelanxplugin<myplugin> { public myplugin() { super(this); } which of course of study not possible since can't super(this) . how can pass kid instance upon construction? one thought had was: public myplugin() { super(new box<myplugin>(this).getinst()); } private class box<e> { private e inst; public box(e inst) { this.ins

java - Why does `%4.` add space to my number? -

java - Why does `%4.` add space to my number? - i have code: private string padwithzerorighttoperiod(string serverformat, float unformattednumber, int index) { int ndigits = getnumberofdigitsafterperiod(serverformat); string floatingformat = "%4." + ndigits + "f"; string formattedprice = string.format(floatingformat, unformattednumber); when called unformattednumber beingness 846 , why result " 846" (a space , 3 digits)? what %4. mean? the docs string.format refer this documentation on format strings, says: the format specifiers general, character, , numeric types have next syntax: %[argument_index$][flags][width][.precision]conversion the optional argument_index decimal integer indicating position of argument in argument list. first argument referenced "1$", sec "2$", etc. the optional flags set of characters modify output format. set of valid flags depends on conversion.

Problems adding to list and submitting via html form and jquery -

Problems adding to list and submitting via html form and jquery - i working on node.js app. on client side have next input(type='hidden', name='imgurl', id="categorylist", value='[]') ... var images = $.parsejson($('#categorylist').val()) images.push(data.result.secure_url) var jsonimages = json.stringify(images) $('#categorylist').val(jsonimages) then save orchestrate db this... exports.addtodb = function(req, res, next){ console.log(req.body) if(req.params.type) db.put(req.params.type, uuid.v4(), req.body, false) next(); } problem when saved, looks like... "imgurl": "[\"https://res.cloudinary.com/dbkbp16kc/image/upload/v1403448829/img.png\"]" a 'normal' 1 looks like... "imgurl": [ "https://f0.bcbits.com/img/a2976218772_2.jpg" ] as can see seems escaping of quotes causing issue. know how alter way handled? this happens because string

extjs - Adding mousewheel to Sencha Desktop App -

extjs - Adding mousewheel to Sencha Desktop App - so supposed advantage using sencha beingness able have 1 code base of operations multiple platforms. have project need on ios, android, pc, , mac. have found can utilize sencha touch build mobile devices , handle finger swipe events automatically. problem have encountered when building desktop app doesn't respond mousewheel. i have been on sencha forums , question unanswered in 1 place, , in promised back upwards on 2 years ago. 3rd part solutions have found either not documented or won't work. elsewhere have been told sencha touch mobile development extjs desktop, don't want have build codebase mousewheel. there jsfiddle here delta returns 1 when mousewheel up, , -1 when mousewheel down. var doscroll = function (e) { // cross-browser wheel delta e = window.event || e; var delta = math.max(-1, math.min(1, (e.wheeldelta || -e.detail))); // `delta` console.log(delta); e.p

python - XML parser that contains debug information -

python - XML parser that contains debug information - i'm looking xml parser python includes debug info in each node, instance line number , column node began. ideally, parser compatible xml.etree.elementtree.xmlparser , i.e., 1 can pass xml.etree.elementtree.parse . i know these parsers don't produce elements, i'm not sure how work, seems such useful thing, i'll surprised if no-body has one. syntax errors in xml 1 thing, semantic errors in resulting construction can hard debug if can't point specific location in source file/string. point element xpath (lxml - getpath ) lxml offers finding xpath element in document. having test document: >>> lxml import etree >>> xmlstr = """<root><rec id="01"><subrec>a</subrec><subrec>b</subrec></rec> ... <rec id="02"><para>graph</para></rec> ... </root>""" ... >>&

qtip2 - Qtip and not displaying title -

qtip2 - Qtip and <select> not displaying title - i have next bootstrap , knockout select: <select title="select outbound header column value on right map to. selecing default allow define constant value populate outbound feed with." name="attributeselect" class="btn btn-default" data-bind="options: $root.columndropdown, optionstext: 'pdbcolumnname', optionsvalue: 'pdbcolumnid', value: selectedcolumn "></select> when mousing on title displays next qtip doesn't format properly $('select[title]').qtip(); i have exact same implementation working on page check boxes, there missing work selects? i'd maybe utilize data-qtip-title , this: $('[data-quip-title]').qtip({ // elements non-blank data-tooltip attr. content: { attr: 'data-qtip-title' // within attribute content } }) http://jsfi

Is ok for implementations of IEnumerator.MoveNext() to include a long running process? -

Is ok for implementations of IEnumerator.MoveNext() to include a long running process? - are implementations of ienumerator.movenext() expected relatively quick? or ok if "moving next item" includes disk io, web requests, or other potentially long running operations? for illustration i'm working on project processes documents, , want abstract access documents idocumentsource . implementations of idocumentsource may pull documents local file system, other's may download documents webserver temp location before opening them. in case movenext() close , delete previous temp file, , download , open next file process. there no guidelines expected performance of movenext() , unlike ones exist property getters, example. you approach looks reasonable. still, wise include note behavior in class/method docs. ienumerator

python - Retrieving AMQP routing key information using pika -

python - Retrieving AMQP routing key information using pika - new rabbitmq , trying determine way in retrieve routing key info of amqp message. has tried before? not finding lot of documentation explicitly states how query amqp using pika (python). this trying do: basically have consumer class, example: channel.exchange_declare(exchange='test', type='topic') channel.queue_declare(queue='topic_queue',auto_delete=true) channel.queue_bind(queue='topic_queue', exchange='test', routing_key = '#') i set queue , bind exchange , routing_keys (or binding keys suppose) beingness passed through exchange. i have function: def amqmessage(ch, method, properties, body): channel.basic_consume(amqmessage, queue=queue_name, no_ack=true) channel.start_consuming() i think routing_key should "method.routing_key" amqmessage function not how work correctly. python amqp pika

How to import external library in python? -

How to import external library in python? - hie can help me out detailed process of downloading & importing external library called pyenchant, check spelling of word valid english language word or not the official pyenchant page asks these prerequisites before install: prerequisites to pyenchant , running, need next software installed: python 2.6 or later enchant library, version 1.5.0 or later. windows users, binary installers below include pre-built re-create of enchant. mac osx users, binary installers below include pre-built re-create of enchant. for convenience there's exe should able above - download it. if want install enchant first, , pyenchant, download enchant here. pyenchant on pypi, should able pip install pyenchant if don't have pip, download get-pip.py , run python get-pip.py (this might require have admin privileges) and in python prompt, >>> import enchant >>> help(enchant) from

hibernate - java.lang.SecurityException: signer information does not match signer information of other classes in the same package -

hibernate - java.lang.SecurityException: signer information does not match signer information of other classes in the same package - we have renewed security certificates in our java applications , have started receiving below mentioned exception: java.lang.securityexception: class "org.hibernate.cfg.configuration"'s signer info not match signer info of other classes in same bundle @ java.lang.classloader.checkcerts(classloader.java:806) [rt.jar:1.6.0_37] @ java.lang.classloader.predefineclass(classloader.java:487) [rt.jar:1.6.0_37] @ java.lang.classloader.defineclasscond(classloader.java:625) [rt.jar:1.6.0_37] @ java.lang.classloader.defineclass(classloader.java:615) [rt.jar:1.6.0_37] @ org.jboss.modules.moduleclassloader.dodefineorloadclass(moduleclassloader.java:344) we utilize ant tool build our code. found links on so describing similar issue. bur not sure how resolve issue related hibernate jars. please allow me know, if have ide