Posts

Showing posts from April, 2010

xslt - Get child from node and pass into attribute -

sorry rivial question @ moment can not figure out. i have node in there childs, want these child , "print" these directly in attribute. please take @ code: <fo:declarations> <xsl:for-each select="//lb"> <xsl:for-each select="./dv-group/dv/download"> <xsl:value-of select="." /> <pdf:embedded-file filename="<xsl:value-of select="." />" src="url(test:///c:/users/muster/desktop/template_test/data/mappe1.xlsx)"/> </xsl:for-each> </xsl:for-each> </fo:declarations> i have try variable doesn't work too. any suggestions? thanks. the concept you're looking called attribute value template : in attribute values on literal result element (and in attributes of xsl: instructions too) can enclose xpath expressions in braces , evaluated , result substituted in outp

nashorn replace Java.type with binding -

to invoke java js can use java.type . there way bind java class in bindings? so replace: scriptengine.eval("java.type('my.own.awesomeobj')"); with like: bindings bindings = new simplebindings(); bindings.put("awesomeobj", my.own.awesomeobj.class); scriptengine.setbindings(bingings, scriptcontext.global_scope); i working on framework want make lot of classes available js scripts, , preferably not use string concatenation , eval . throws exception message: awesomeobj not function, makes sense. nashorn distinguishes type java.lang.class instance, java (in java language, my.own.awesomeobj type, while my.own.awesomeobj.class instance of java.lang.class . can use type access static members, or constructor. can't use class object purpose. bad news is, can't directly obtain object nashorn uses representing types; it's instance of jdk.internal.dynalink.beans.staticclass , lives in restricted package. however, can evaluate in

Firefox add-on sdk uninstall hook -

i keep user data in simple-storage . when user uninstalls add-on want remove user data. there event or similar? this work in every file: require("sdk/system/unload").when(function(reason) { if (reason == "uninstall") { // uninstall stuff.. } });

transactions - Can you still lock rows exclusively (block readers) in a SQL Server db that has Snapshot Isolation and RCSI enabled? -

can still lock rows exclusively (block readers) in sql server db has snapshot isolation , rcsi enabled? i want xlock, rowlock select on table. yes, can lock rows exclusively (either using dml or locking hints). readers using snapshot isolation not blocked because don't take locks (on data). after all, not locking , blocking prime advantage of snapshot isolation.

php - Distant HasManyThrough -

i have 4 models: user client store opportunity the relationships defined such: user hasmany client client hasmany store store hasmany opportunity user hasmanythrough store, client (this works) the problem i'm attempting access user->opportunity relationship via built-in laravel relationships, doesn't seem if can without custom query or additional user_id column on opportunities table allow direct access (even though 1 can inferred store->client relationship). i'm not fan of nested foreach loops if can avoided. my question: is there way go 1 level deeper , directly access user's opportunities in scenario? actual model code , relevant relationships follows: user class user extends eloquent{ public function clients(){ return $this->hasmany('client'); } public function stores(){ return $this->hasmanythrough('store', 'client'); } public function proposals(){ return

java - Read username from smart card with Tomcat 7 -

i working on web-application runs on tomcat 7 server. want make site accessible via smart card, made clientauth="true" change in tomcat server.xml. i can access web-app smart card now, want able read username/alias smart card in web-app. efficient way this? also, modern browsers take care of crl checking when site requests client auth? thanks you have implemenent x509usernameretriever , pass class name this method of realm. realm should rest. guess after subjectaltname field retrieve upn of user.

php - html multiple file attribute -

i using html5 multiple attribute in file field, like <input type="file" name="image[]" multiple> and via php loop add images, problem occurring on localhost user can upload 9 normal size images on server can upload 2,3 images @ time how increase number of images uploaded or size of images uploaded??? i tried php ini_set('max_execution_time', 300); and set_time_limit(100); as no profit. create .htaccess in root of project, had in cakephp , paste these 2 lines in end of document php_value upload_max_filesize 60m php_value post_max_size 60m and save, , can select 20+ in 1 selections cheers!

markdown - Kramdown doesn't seem to render checkboxes like in GitHub -

it seems kramdown can recognise github flavoured markdown in jekyll. seems checkboxes available in github isn't getting rendered using kramdown, ideas why? what trying do: - [ ] unchecked - [x] checked this show disabled checkboxes in github not in jekyll. this instructions on official website say. try it, maybe works than. in addition defaults mentioned above, can turn on recognition of github flavored markdown passing input option value of “gfm”. for example, in _config.yml : kramdown: input: gfm source: http://jekyllrb.com/docs/configuration/#kramdown

Processing javascript objects with google charts -

i trying draw google visualization pie chart based on below json. having issues since google takes numerical data, instead of plain objects. for example, want pie chart based on usecase. pie chart list vdi,upgrade,demo , show proportion related total. please help. here json example [{"id":0,"processedtime":"2012/01","approver":"zoo","poc":"poc1","usecase":"vdi"},{"id":0,"processedtime":"2012/02","approver":"zoo","poc":"poc1","usecase":"upgrade"},{"id":0,"processedtime":"2012/03","approver":"zoo","poc":"poc2","usecase":"demo"},{"id":0,"processedtime":"2012/04","approver":"victor","poc":"poc2","usecase":"demo"},{"id"

asp.net - Need to get ArrayList() to Export to Excel -

i having trouble exporting data excel. application uses arraylist() house data. don't understand arraylist's. inside arraylist() mydataclass, val1, val2, etc...the array has 7 columns , can have anywhere 1 300 rows of data. when this, can't seem down val1 data, excel sheet in cell a1 saying, mydataclass. can please me this, thank in advance. on visual studio 2010 , office 2010. protected sub btnexport_click_backup(sender object, e system.eventargs) handles btnexport.click dim itemlist new arraylist() itemlist = session("sessitemlist2") itemlist.reverse() dim dt new system.data.datatable() dt.columns.add("serlnmbr") dt.columns.add("itemnmbr") dt.columns.add("locncode") dt.columns.add("status") dt.columns.add("msl") dt.columns.add("invoicenumber") dt.columns.add("activationstatus") ' doing wrong... integer = 0 itemlist.count - 1

c++ - Draw shape with GLUT_DOUBLE mode -

i have code: #include <gl/glut.h> #include <stdio.h> #define winw 1000 #define winh 500 /* ----------------------------------------------------------------------- */ bool mousedown = false; void myinit(void) { glclearcolor(1.0, 1.0, 1.0, 0.0); glcolor3f(1.0, 0.0, 0.0); glpointsize(5.0); glshademodel(gl_smooth); glmatrixmode(gl_projection); glloadidentity(); glortho(0.0, winw, winh, 0.0, -1.0, 1.0); } void mydisplay(void) { glclear(gl_color_buffer_bit | gl_depth_buffer_bit); glbegin(gl_points); glcolor3f(1.0, 0.0, 0.0); glvertex2i(50, 50); glend(); //glflush(); glutswapbuffers(); } void mymouse(int button, int state, int x, int y){ if (button == glut_left_button && state == glut_down){ mousedown = true; } else mousedown = false; } void mymovedmouse(int mousex, int mousey){ if (mousedown){ //printf("%d %d\n", mousex, mousey); glbegin(gl_point

objective c - Behavior changes for updateViewConstraints in iOS 8 -

i notice small graphical glitches while testing 1 of app under ios 8: uiviews elements not in right place, others have not right size. in first step, use storyboard, auto-layout , constraints. programmatically tune constraints suits devices' screen size, using updateviewconstraints . perfect on ios 7 glitches on ios8 on following picture: ./users/dominiquevial/documents/informatique/dev/novae marathon/_log/captures/ios8 - iphone 6/pause.png after investigation found problem: updateviewconstraints not called. don't understand why, maybe due optimizations... correcting problem easy : use viewwilllayoutsubviews in place of updateviewconstraints or add call setneedsupdateconstraints in viewwillappear which way best 1 ? depends if user can cause views enter invalid state after view appears, if first option. if not possible second. the less work app has better.

android - CMUSphinx PocketSphinx - Recognize all (or large amount) of words -

before tried used pocketsphinx android, used google's voice recognition api. didn't need set search name or dictionary file. recognized every word told. now, in pocketsphinx, need it. can find how set recognition 1 word, or set dictionary (the ones available in demo project have few words) recognizer think these words exist, means if says similar, recognizer thinks word listed in dictionary. i want ask, how set few search names, or how set recognize words available (or large amount of them)? maybe has dictionary file big number of words? before tried used pocketsphinx android, used google's voice recognition api. didn't need set search name or dictionary file. recognized every word told. google api recognizes large still limited set of words too. long time failed recognize "spotify". google offline speech recognizer uses 50k words described in publication . i want ask, how set few search names, or how set recognize words available (

jdbc - How to retrieve data from a table in a database and print it in a table in a GUI form in Java -

i have database tables in contains information. retrieve data table on database table have made on gui form. have tried retrieving data using system.out.print method , results, meaning database connection works , recognizes table. problem not know how tables in code. please keep in mind gui made, code generated automatically not have 100% access code. your connection database seems correct, however, cannot set table contain values need. if diagnosis correct, below find useful information: i not know using tables, assume using jtable, if use else, technical details should change thought process should remain intact. to general knowledge, please read this tutorial.

php - MySQL Table Creation Query Not Working -

i working on installation script creates tables inside database, in script have written detects if table created, exists , can't create table @ all. reason can't seem work, me? /* database queries */ $dbusers = mysqli_query($con, 'create table users (id int(9) not null auto_increment primary key, username varchar(40) not null, password varchar(40) not null'); /* check if users table created */ if ($dbusers) { ?> <p>table "users" created.</p> <?php } elseif (mysqli_query($con, "select * users")) { ?> <p>table "users" exists."</p> <?php } else { ?> <p>unable create "users" table.</p> <?php } so have ideas on how improve or fix code? you missed closing ) @ end of create statement: create table users (id int(9) not null auto_increment primary key, username varchar(40) not null, password varchar(40) not null)

python - How to have something print only once? -

i'm unsure why it's taking answer, , instead of continuing onto next question, repeats once more before doing so? also, after second question (there's two), shows them both in parentheses still? please me, thank you. ^_^ here's code way: print (raw_input('what date of birth?')) y = raw_input('what date of birth?') print ('your date of birth ' + y) print (raw_input('what last name? ')) x = raw_input('what last name?') print ('your last name ' + x) print ('your date of birth ' + y, 'your last name ' +x) i'm using python 2.5.4. raw_input() itself prints prompt. also printing return value of raw_input() call. repeat raw_input() function call again . remove print(raw_input(..)) lines; redundant: y = raw_input('what date of birth?') print 'your date of birth ' + y x = raw_input('what last name?') print 'your last name ' + x next, in python 2, p

PHP script serving files stops after few seconds -

i have small php scripts, serves files. simple download server. i use following code: $mm_type="application/octet-stream"; header("pragma: public"); header("expires: 0"); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("cache-control: public"); header("content-description: file transfer"); header("content-type: " . $mm_type); header("content-length: " .(string)(filesize($path)) ); header('content-disposition: attachment; filename="'.basename($path).'"'); header("content-transfer-encoding: binary\n"); readfile($path); // outputs content of file exit(); i stops download file after 10-15 seconds. when retry download file, exactly stops @ same filesize. example file 4gb, stops downloading @ 230mb, when restart download, again stops @ 230mb. what wrong script?

html - Finding out what http requests were made by the user -

i working on project involving finding out http requests made user. i have http request , response headers (but not data), , need find out content requested user , content automatically sent (e.g. ads pages, streaming on background, , sorts of unrelevant content). when recording net traffic (even short period) alot of content gets generated, , of not relevant. since im no expert in http, i'd directions of headers can safely use (assuming web pages send them), , headers might omitted , not safe rely on. my current idea involves: find html files, , check main html files (no referrer or search engine referrer), , recursively mark files called these html files onward relevant, , discard rest. the problem i've been told can't trust referrer header, , have no idea of how identify html files clicked user. every kind of appreciated, sorry if post not formatted well, first question here. edit: i've been told question is'nt clear enough, i'm asking way determi

osx - launchd: sleep in GCD managed signal handler -

i encounter strange situation in launchd managed daemon when try sleep in sigterm handler managed grand central dispatch described here . works fine , sigterm signal handler before receiving sigkill when not sleep in sigterm handler. sleep -- extremly short amounts of time usleep(1); -- not sigterm handler @ instead daemon sigkilled instantly launchd. btw using enabletransactions in plist file , proper vproc_transaction_begin(3) / vproc_transaction_end(3) code described here . not sleeping in sigterm handler not option me because need poll information "client processess" know if save end daemon or not. it seems me if there compiler flag responsible directly receiving sigkill (and not expected sigterm) sleep in signal handler because when sleep not see outputs of sigterm handler @ all. expect see debug prints sleep call not case. here plist file: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dt

ios - How to make an NSCalendar week begin on Monday instead of Sunday -

when try make current weeks date show in log (monday sunday) it's week starts sunday. example: week wee 38. yesterday 20th of september. code did show days monday sunday correct. today (21th of september) log shows next weeks dates (week 39) when it's still week 38. my code: nsdate *currentdate = [nsdate date]; nscalendar *mycalendar = [[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar]; nsdatecomponents *currentcomps = [mycalendar components:( nsyearcalendarunit | nsmonthcalendarunit | nsweekofyearcalendarunit | nsweekdaycalendarunit | nshourcalendarunit | nsminutecalendarunit) fromdate:currentdate]; int thisweeksnumber = currentcomps.weekofyear; nslog(@"1 %d", thisweeksnumber); [currentcomps setweekday:2]; nsdate *firstdayoftheweek = [mycalendar datefromcomponents:currentcomps]; nsdate *seconddayoftheweek = [self datebyaddingdays:1 todate:firstdayoftheweek]; nsdate *thirddayoftheweek = [self datebyaddingdays:2 todate:firstdayoftheweek]; n

PHP Replace and edit array elements from keywords -

i have following input: $input = [ 0 => '$id000001', 1 => '$id000002', 2 => '$id000003', 3 => 'alexandre' ]; $keywords = [ '$id000001' => 'function_name($+2)', '$id000002' => '$user', '$id000003' => '$-1 = $+1' ]; i implement function replace $input elements $keywords elements, following output: [ 0 => 'function_name($+2)', 1 => '$user', 2 => '$-1 = $+1', 3 => 'alexandre' ]; here point, function have replace $(+|-)[0-9]+ elements (like $+2 , $-1 , ...) $input element value (after has been replaced) , remove them . number row offset index : $-1 = $+1 replaced $user = 'alexandre' function_name($+2) replaced $-1 = $+1 (wich $user = 'alexandre' ) so, final output be: [ 0 => function_name($user = 'alexandre') ] ok, after trying fix infin

linux - awk usage in a variable -

actlist file contains around 15 records. want print/store each row in variable perform further action. script runs echo $j displays blank value. issue? script: #/usr/bin/sh aclist=/root/john/actlist rowcount=`wc -l $aclist | awk -f " " '{print $1}'` ((i=1; i<=rowcount; i++)); j=`awk 'fnr == $i{print}' $aclist` echo $j done file: actlist cat > actlist 5663233332 2223 2 5656556655 5545 5 4454222121 5555 5 . . . the issue happens related quotes , way shell interpolates variables. more specifically, when write j=`awk "fnr == $i{print}" $aclist` the awk code must enclosed double quotes . necessary if want shell able substitute $i actual value stored in i variable. on other hand, if write j=`awk 'fnr == $i{print}' $aclist` i.e. single quotes , $i interpreted literal string. hence fixed code read: #/usr/bin/sh aclist=/root/john/actlist rowcount=`wc -l $aclist | awk -f " " '{print $1}

sql - Querying a Table which contains names of view -

i have primary table exporter has 3 columns col_1, col_2 , view_name. i need able list of column_names , datatypes view_name(s) in exporter table. i know how list of column names , data types view using : select column_name, data_type all_tab_columns table_name = 'view'; but having difficulty figuring out how combine primary table , views.

Verify JtextFiled in java Swing -

i new java language: want know if want how can check input value of text filed , verify it. if verified insert data base if not verified not actions. show error message. question that: 1 of field id , want define id unique number. here code: i want know if want how can check input value of text filed , verify it there number of ways might achieved this... you could... use inputverifier , discussed in how use focus subsystem, validating input , allows post validation on field use documentfilter , discussed in implementing document filter , documentfilter examples , allows real time validation use jformattedtextfield , how use formatted text fields and/or jspinner , how use spinners , allow restrict user can enter, is, again, post validated. just run through list or array of fields , verify each 1 when user hits "save" button, frank, bad idea , plain annoying. if verified insert data base this come down how implement validation routines,

c# - Passing SQL Server exception to .net for ExecuteSprocAccessor to consume -

g'day everybody. need finalize answer similar question. unfortunately, since not have enough points, can not ask final solution people involved. original question here: "[passing sql server exception .net][1]" so, problem: try/catch statement in sql server 2012 swallows exception want pass or re-throw ef 5.0. long exception without try/catch, .net code gets without problems. attempts solve: 1. sql server side: have tried throw / raiseerror, raising exception in , outside of try/catch block, recording original error , re-throwing again. 2. .net side tried planned overloaded "executesprocaccessor" , changed basic code "... sqldataadapter dataadap = new sqldataadapter(command); dataadap.fill(dt); " nothing worked 3. option - guess - think parameter in sql server might blocking - not know yet solution: looking , advise how original managed supressed try/catch behavior. thanks! we have spent day in further attempt bot

c# - Efficiency of DispatcherTimer versus Thread.Sleep -

what more efficient use, dispatchertimer or thread.sleep in c#? i use dispatchertimer : dispatchertimer timer = new dispatchertimer(); timer.interval = timespan.fromseconds(20); timer.tick += timer_tick; timer.start(); // every 20 seconds or, use thread.sleep : while(true) { thread.sleep(20000); // every 20 seconds } in cases should use them? there best practices? edit : based on first answers, need add application developing has no ui (so blocking thread no issue), background tracker, writes data logfile. the dispatchertimer invoke method on ui thread every n [unit of time]. thread.sleep sleep thread completely. difference former, thread continues, invokes tick event , latter stops thread doing anything. it's important realise ui thread busy rendering ui , running code; hence, sleep in ui thread perceived application hang.

c - strcpy function with pointers to character array -

in code below result stack overflow. though null character there both strings, strcpy loop should terminate source string has null character. why stack overflow occurs?? #include <stdio.h> #include<strings.h> int main(void) { char *str="hello world"; char *str1="good morning"; strcpy(str,str1); printf("%s",str); return 0; } the error isn't stack overflow, modifying string literal. str pointer points string literal "hello world" , , modifying string literal undefined behavior. change str to: char str[100] = "hello world";

powershell - Import-vApp throwin Line 157: Duplicate element 'AddressOnParent' error -

i trying deploy ova file using powershell script. found script internet , modified little bit , execute. during execution @ import-vapp command seeing error: import-vapp line 157: duplicate element 'addressonparent'. i able deploy ova manually. thru script, seeing error. appreciated. please find powershell script below. (keeping important script below, per suggestion). param( ) #---- custom ova properties ::> start <:: ----- # $vapppropertyid_ip4enable = "ipv4 enable" $vapp_ip4enable = "true" $vapppropertyid_ip4address = "ipv4 address" $vapp_ip4address = "10.51.98.20" $vapppropertyid_ip4netmask = "ipv4 netmask" $vapp_ip4netmask = "255.255.255.0" $vapppropertyid_ip4gateway = "ipv4 gateway" $vapp_ip4gateway = "10.51.98.1" $vapppropertyid_ip6enable = "ipv6 enable" $vapp_ip6enable = "false" #$vapppropertyid_ip6addres

java - trying to find when CH34xAndroidDriver.isConnected() is becomes true -

i trying find when , ch34xandroiddriver.isconnected() value becomes true. have tried find out , display value in toast. can explain clearly. public class uartloopbackactivity extends activity { public static final string tag = "com.wch.wchusbdriver"; private static final string action_usb_permission = "com.wch.wchusbdriver.usb_permission"; /* thread read data */ public readthread handlerthread; protected final object threadlock = new object(); /* declare uart interface variable */ public ch34xandroiddriver uartinterface; // byte timeout; // time out public context global_context; public boolean isconfiged = false; public boolean read_enable = false; public sharedpreferences shareprefsettings; drawable originaldrawable; public string act_string; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); /* create editable text objects */ readtext = (edittext) findviewbyid

c++ - Why use fabs() rather than casting? -

i'm new c++, having learnt java previously. i'm struggling understand why use fabs() function (from <cmath> ). understand fabs does, it's absolute value of number (i.e. more precision). however, can not in java: int x = 1; float x = (float) x; what benefit in using fabs() function, rather casting? it sounds don't entirely understand fabs - returns absolute value of number, i.e. y = |x| . if x positive returns x , if x negative if returns -x : float x = 1.0f; float y = abs(x); // y = x = 1.0f float x = -1.0f; float y = abs(x); // x = -1.0f, y = 1.0f

How exactly Eclipse Code-Completion works?? What Algorithm they are using? -

can tell me how code completion(or code assist whatever preferable) in eclipse works?? mean tricks/algorithms/data-structures using.. somewhere found "maybe" uses trie, want definite answer, can please answer it?? there different token-scanners search known tokens { , ; colorize current viewport-scopes , fill history . if press ctrl + spc looks backward , search occourences in history .

jquery - Ajax.BeginForm does not show bootstrap modal by onBegin function after post -

i have login view in mvc ajax.beginform. want display bootstrap modal dialog on te onbeing method , once action completes want close bootsrap dialog. problem when submit form dialog doesn't show. action controller works fine! wrong? <!doctype html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>@viewbag.title - b.bring</title> @styles.render("~/content/css") <link href="@url.content("~/content/login/login.css")" rel="stylesheet" type="text/css"/> <script src="~/scripts/jquery-1.11.1.min.js"></script> <script src="~/scripts/respond.min.js"></script> <script src="~/scripts/bootstrap.min.js"></script> <script src="http://ajax.aspnecdn.com/ajax/mvc/3.0/jquery.u

vim - Why check did_load_filetypes in custom filetype files? -

from vim wiki: custom filetype.vim files should have following structure: if exists("did_load_filetypes") finish endif augroup filetypedetect " au! commands set filetype go here augroup end i wondering why if...endif part necessary? i think means if filetypes loaded, skip loading script. in case what's point of creating custom filetype file? this include guard, avoid custom filetype accidentally sourced multiple times. if goes well, indeed looks superfluous, variations in user configuration, plugin managers, etc., it's better safe. , saves vim re-processing potentially large list of definitions, speeding startup. what happens when sourced twice? if use :autocmd instead of :autocmd! , detections defined twice. (note initial :autocmd! cannot used here clear previous definitions, because multiple filetype.vim files involved, , each adds existing ones.)

Use SSRS lookup function in Visual Studio 2008 Business Intelligence Development Studio with SQL Server 2008 R2 -

i'm using ssrs sql server 2008 r2 supposedly should give me option use lookup function can use datasets multiple datasources. formula is: =lookup(fields!orderid.value, fields!intertourref.value, fields!dlvname.value, "dsax") the lookup in formula gives squiggly red line , 'name lookup not declared' error give me idea might not work vs 2008. any ideas? the lookup function added sql server 2008 r2 , original sql server 2008 (prior r2) doesn't have error. it sounds not on sql server 2008 r2 .

android - Phonegap splash screen not loading -

i'm working on application android using phonegap 3.5.0 - testing device samsung galaxy tab (gt-p5100) android 4.1.2 . half year ago did first tests phonegap. remember splashscreen loading @ startup following line in config.xml <gap:splash gap:platform="android" src="res/screen/android/screen-xhdpi-portrait.png" /> now hard- , software mentioned above it's not working anymore... i tried following: <gap:splash gap:platform="android" gap:qualifier="port-ldpi" src="res/screen/android/screen-ldpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-mdpi" src="res/screen/android/screen-mdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-hdpi" src="res/screen/android/screen-hdpi-portrait.png" /> <gap:splash gap:platform="android" gap:qualifier="port-xhdpi" src="res/sc

linux - debian package dependency, how to set it for different version of ubuntu? -

my problem our debian package require other libs, these libs on different version of ubuntu named differently. for example, libgnutls26 --- can found on ubuntu12.04, not on ubuntu14.04 (probably libgnutls28 used instead) . (please notice example) is there way can include it, correct version on both 12.04 , 14.04 version of ubuntu can found? thanks, lj same question here! the best work-around have found setting dependency dev version ( libgnutls-dev in case). development package depends on compiled package , installs proper version automatically. sloppy works.

c++ - sorting a QAbstractTableModel and expose it to qml -

i need create integration between qt , qml , qt ask info server, create tablemodel qt , expose info qml . i've reached point, i've sort info. i'm using qsortfilterproxymodel , of examples i've found created widgets, , create tableview qt , when tried create qml , there's not option "setsortingenabled" , in qml i've many objects no tableview . have used order model->sort(1, qt:ascendingorder) there not change in qml screen simmainwindow.cpp #include "simmainwindow.h" #include "turndisplaytable.h" #include "turndisplayitem.h" #include <qtqml> #include <qgraphicsobject> #include <qdebug> #include <qdeclarativeview> #include <qquickview> #include <qqmlapplicationengine> #include <qtwidgets> #include <qmainwindow> #include <tablemodel.h> #include <qsortfilterproxymodel> simmainwindow::simmainwindow(int argc, char **argv): qguiapplication(argc, argv)

scripting - Attribute template in Maya -

i working in maya 2014. have custom attributes showing in channels box . trying show custom attributes in attribute editor . have aetemplate file called aecamera_orthotemplate.mel code below: global proc aecamera_orthotemplate( string $nodename ) { editortemplate -beginscrolllayout ; editortemplate -beginlayout "camera" -collapse 0 ; editortemplate -label "always show frustrum" -addcontrol "boolattr" ; editortemplate -label "frustrum nearz" -addcontrol "numattr" ; editortemplate -label "frustrum farz" -addcontrol "numattr" ; editortemplate -label "frustrum width" -addcontrol "numattr" ; editortemplate -label "frustrum height" -addcontrol "numattr" ; editortemplate -endlayout ; // editing values on shape object, // drag in shape attributes aeshapetemplate $nodename ; editortemplate -addextracontrols ; editortempl

Tools: replace not replacing in Android manifest -

i using gradle project many different library dependencies , using new manifest merger. in <application /> tag have set such: <application tools:replace="android:icon, android:label, android:theme, android:name" android:name="com.example.myapp.myapplcation" android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/application_name" android:logo="@drawable/logo_ab" android:theme="@style/apptheme" > .... </application> yet receiving error: /android/myapp/app/src/main/androidmanifest.xml:29:9 error: attribute application@icon value=(@drawable/ic_launcher) androidmanifest.xml:29:9 present @ {library name} value=(@drawable/app_icon) suggestion: add 'tools:replace="android:icon"' <application> element @ androidmanifest.xml:26:5 override /android/myapp/app/src/main/androidmanifest.xml:30:9 error: attribute a

bash - How can I list the SSH connection sequence on a remote computer? -

suppose working on locala (username usera ). use ssh tunnel remoteb (username userb ), remotec (username userc ), remotedestinationd (username userd ). it following: usera@locala$ ssh userb@remoteb userb@remoteb$ ssh userc@remotec userc@remotec$ ssh userd@remotedestinationd userd@remotedestinationd$ suppose forget series of connections used connect locala remotedestinationd . have been 1 jump (e.g. usera@locala$ ssh userd@remotedestinationd ) or 3 jumps (as in example above). how programmatically determine series of jumps was? ("scroll through history, dummy!" doesn't count....) i'd bash script output following: usera@locala$ --> userb@remoteb userb@remoteb$ --> userc@remotec userc@remotec$ --> userd@remotedestinationd any ideas? thanks in advance! there no way this, suspect. there bunch of true hacks if willing, such turning on x11 port forwarding , using different ports counting. or, more obnoxiously: sshcount=0 ssh us

python - Error while full update pip packages -

while pip update packages command pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -u pip print error vboxapi downloading/unpacking vboxapi not find downloads satisfy requirement vboxapi externally hosted files ignored (use --allow-external vboxapi allow). insecure , unverifiable files ignored (use --allow-unverified vboxapi allow). cleaning up... no distributions @ found vboxapi storing debug log failure in /users/rmuhamedgaliev/.pip/pip.log can pip ignore vboxapi while update? tried commands pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -u -i pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -u -i --allow-external vboxapi yes, can ignore vboxapi package this. grep -pv '^(?:\-e|vboxapi\=)' the -p flag tells grep use perl-compatible regex. the -v flag says list not match regex follows. the regex matches lines begin -e or vboxapi= full

node.js - How to crash a nodejs app programattically (for test) -

i want test nodejs app crash, need process stop, not throw errors. there simple way programattically? app.get('/crash', function() { //do crash }) thanks! try this: app.get('/crash', function() { process.nexttick(function () { throw new error; }); })

Python / Remove special character from string -

i'm writing server side in python. i noticed client sent me 1 of parameter this: "↵ tryit1.tar↵ " i want rid of spaces (and use replace command), want rid of special character: "↵". how can rid of character (and other weird characters, not - , _ , * , . ) using python command? a regex here: re.sub('[^a-za-z0-9-_*.]', '', my_string)

jenkins - Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project -

i'm using jenkins 1.579 , sonarqube 4.4 , sonar plugin 2.1. tried maven 3.1.1 , 3.2.1 , .3.2.2. this error: [error] failed execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default- cli) on project at-tracking: execution default-cli of goal org.codehaus.mojo:sonar-maven- plugin:2.0:sonar failed: required class missing while executing org.codehaus.mojo:sonar-maven-plugin:2.0:sonar: org/sonatype/aether/graph/dependencyfilter [error] ----------------------------------------------------- [error] realm = plugin>org.codehaus.mojo:sonar-maven-plugin:2.0 [error] strategy = org.codehaus.plexus.classworlds.strategy.selffirststrategy [error] urls[0] = file:/var/lib/jenkins/.m2/repository/org/codehaus/mojo/sonar-maven- plugin/2.0/sonar-maven-plugin-2.0.jar [error] urls[1] = file:/var/lib/jenkins/.m2/repository/org/sonatype/aether/aether-util/1.7/aether-util-1.7.jar [error] urls[2] = file:/var/lib/jenkins/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.1

Solr ran using maven doesn't return same result as downloaded version -

i successful in running solr instance(version 4.7.0) using maven. custom fields added schema doesn't seems responding generic queries. below custom fields added <field name="doc_id" type="string" indexed="true" stored="true" omitnorms="false"/> <field name="doc_name" type="text_autocomplete" indexed="true" stored="true" multivalued="true" omitnorms="false"/> <field name="doc_author" type="text_autocomplete" indexed="true" stored="true" multivalued="true" /> <field name="modifieddate" type="text_autocomplete" indexed="true" stored="true" multivalued="true"/> <field name="doc_content" type="text_autocomplete" indexed="true" stored="true" multivalued="true" omitnorms="false"/> &l