Posts

Showing posts from July, 2013

Google+ Login Not working properly on Android fragment -

i working google+ login application , when done using activity work charm , after move code fragment , after when try login google+ not working have open fragment activity 2 times login google+ can tell me happen code fragment added below public class googleplusefragment extends fragment implements connectioncallbacks, onconnectionfailedlistener { private static final int rc_sign_in = 0; private static final string tag = "mainactivity"; private static final int profile_pic_size = 800; private googleapiclient mgoogleapiclient; private boolean mintentinprogress; private boolean msigninclicked; private connectionresult mconnectionresult; private signinbutton btnsignin; private button btnsignout; private context mcontext; private activity mactivity; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mactivity = getactivity(); mcontext = getactivity().getapplicationcontext(); } @override public vie...

Use C# managed app class in C++ unmanaged app -

i have project class written in c# use serialize data. [xmltype("cpersoane")] public class cpersoana { public cpersoana() { } [xmlelement("name")] public string name { get; set; } [xmlelement("profession")] public string profession{ get; set; } [xmlattribute("age")] public int age{ get; set; } //... } i have project in same solution written c++ mfc (no clr support) dialog box 3 text boxes. how can access "cpersoana" class c++ can use "name", "profession" , "age" text boxes? any appreciated! firstly, c# project needs dll (output type = class library). secondly, cannot access c# code in unmanaged c++, c++ project needs @ least 1 source file compiled /clr can access c# class. in source file, can write code like #using "mycsharpproject.dll" using namespace mycsharpnamespace; ... gcroot<cpersoana^> ...

mysql query add single quote in query -

need suggestions how convert below query result in to: use philips,led,and tv in single quote. insert company_rawdata_split select 2,splits (select null splits union select 'philips' union select 'led' union select 'tv') splits not null; query: select concat ('insert company_rawdata_split select ',id,',splits (select null splits union select ', replace(complaint_against ,' ', ' union select '),') splits not null;' ) prodcatqueries company_rawdata_new result insert company_rawdata_split select 2,splits (select null splits union select philips union select led union select tv) splits not null; the following should accomplish you're attempting. it's matter of getting clever placement of escaped single quotes \' select concat ('insert company_rawdata_split select ',id,',splits (select null splits union select \'', replace(complaint_against ,' ', ...

asp.net mvc - Convert object list to another object list even they are not same type -

i want separate between viewmodel , mode(data access object or data members). please see below. major dao public class major public majorid integer public majorname string end class major vm public class majorvm public major major end class but major view model take reference major. in case, convert major object majorvm object list. please see below. dim majorlist list(of major) = getallmajorlist() dim majorvmlist list(of majorvm) majorvmlist = majorlist how can solve this? thanks. try this. dim majorvmlist new list(of majorvm) each item major in majorlist dim m new major major.majorid = item.majorid major.majorname = item.majorname majorvmlist.add(major) next

excel - Expected array when calling function -

i'm trying learn little vba i'm in process of saving ranges csv files. however, i'm having trouble line of code call saverangeascsv(selectdown("b5:d5"), "c:\test\test.csv", true) and here snippet of selectdown function. private function selectdown(range string) range selectdown = range(range, activecell.end(xldown)).select end function i error: expected array. cannot seem understand problem is. appreciated :-) it sounds function saverangeascsv expecting array, passing in range. function not built-in excel function, can't check it. maybe check arguments expecting?

binary - Floating point division in ARM7, quick calculation of inverses -

i'm using arm7 device without neon floating point arithmetic hardware capabilities, project i'm having write in assembly, have multiplier working, there why calculate inverses quickly? will gcc software floating-point library you? you'll find assembler routines floating-point division under libgcc/config/arm .

matlab - Gilbert-Peierls algorithm for LU Decomposition -

i searched gilbert-peierls algorithm, haven't found useful (well, found this , it's not working should). think problem second part, , lines: u(1:k, k) = x(1:k); l(k:n, k) = x(k:n)/u(k, k); should (according this example): u(1:n, k) = x(1:n); l(k:n, k) = x(k:n)/u(k, k); also, in example, l identity matrix, find bit strange. describe algorithm, please? (with or without code) first, gilbert-peierls’ algorithm left-look decomposition , loops 1 column in every iteration. thus, "k" means loop column. note u upper triangular matrixm, entries below k in each column zero. that's reason of it. second, gilbert-peierls’ algorithm starts identity l matrix way calculate diagonal entries. helps users calculate diagonal entries of u @ first , deal rest entries of u. gilbert-peierls algorithm does.

python - How to code in openerp so that user can create his fields? -

i have been developing modules in openerp-7 using python on ubuntu-12.04. want give users feature have ability create ever fields want . set name, data_type etc field , on click , field created. dont have idea how implemented. have set mind create button call function , create new field according details entered user . approach of mine right or not? , work . ? please guide me can work smartly. hopes suggestion the user can add fields, models, can customize views etc client side. these in settings/technical/database structure , here can find menus fields, models etc user can add fields. , views can customized in settings/technical/user interface .

postgresql - How to use substring of result in PosrgreSQL/SQL -

i don't know how name syntax properly. got table (say t) column a in store entries in format user-yyyy-mmdd . want extract rows a column's year part ( yyyy part) greater 2010. e.g. table t +----------------+ | | +----------------+ | user-2011-1234*| | user-1992-1923 | | user-2014-1234*| +----------------+ (*) want: yyyy part greater 2010. sql should looks this, dont know how in postgresql. select * t a[5-8] > 2010 thanks! select * t to_number(substr(a, 6, 4)) > 2010; note fail error if string cannot converted number more details in manual: http://www.postgresql.org/docs/current/static/functions-string.html btw: storing more 1 information in single column bad design. should store username , date in 2 different columns. additionally storing dates varchar bad idea. date should stored date not varchar

Javascript's Object(this) usages in polyfills? -

i saw here array.prototype.foreach() 's polyfill , have question implementation : /*1*/ if (!array.prototype.foreach) /*2*/ { /*3*/ array.prototype.foreach = function(fun /*, thisarg */) /*4*/ { /*5*/ "use strict"; /*6*/ /*7*/ if (this === void 0 || === null) /*8*/ throw new typeerror(); /*9*/ /*10*/ var t = object(this); /*11*/ var len = t.length >>> 0; /*12*/ if (typeof fun !== "function") /*13*/ throw new typeerror(); /*14*/ /*15*/ var thisarg = arguments.length >= 2 ? arguments[1] : void 0; /*16*/ (var = 0; < len; i++) /*17*/ { /*18*/ if (i in t) /*19*/ fun.call(thisarg, t[i], i, t); /*20*/ } /*21*/ }; /*22*/ } looking @ line #10 : why did use object(this) ? as searched usages saw this : the object constructor creates object wrapper given value. if value null or undefined , create , return empty object, othe...

cordova - Phonegap inappbroswer events w'ont fire -

i using phonegap latest version (3.4.0) , trying implement google aouth login. have added inappbroswer plugin project, , tryed use object events (loadstart,loadstop,loaderor,exit) seems dont fire. my code simple, looks this: ref = window.open('http://apache.org', '_blank', 'location=yes'); ref.addeventlistener('loadstart', function() { alert('start' ); }); i running app on ripple eulator i have looked solution on web , have'nt fine one. question if know of working sulotion this? thanks all. update . have tryed inappbroswer plugin on fresh new phonegap app created testing this, , plugin doesn't work! phone gap version 3.4.0-0.19.7 , inappbroswer version latest. installed plugin via cli command cordova plugin add org.apache.cordova.inappbrowser also have tryred run on normal android emulator , nothing far.. the plugin docs right there this not answer question rather alternative easy solution, easy use , don...

c# - Getting only Last items in the List -

i have foreach loop retrieve list items like: //gets records of employee, var emps = (from n in db.timesheets n.empid_id == 123 select n); //gets number of records , ex: no. of records 2. int count = emps.count();//ex: count = 2 //timesheet model class contains , set properties below list<timesheetmodel> list = new list<timesheetmodel>(); objts.gettimesheetdetails = list; if (emps.count() > 0) { timesheetmodel model=new timesheetmodel() foreach (timesheet ts in emps) { //from model class //from database "timesheet" table model.proj_id = ts.proj_id; model.sun_hrs = ts.sun_hrs; model.mon_hrs = ts.mon_hrs; model.tue_hrs = ts.tue_hrs; model.wed_hrs = ts.wed_hrs; model.thu_hrs = ts.thu_hrs; model.fri_hrs = ts.fri_hrs; model.sat_hrs = ts.sat_hrs; objts.gettimesheetde...

How to link an other eclipse perspective when clicking on a file in package explorer? -

i have 2 screens : first 1 displays file (in file editor), , other 1 (in new eclipse window) displaying package explorer. when click on file in package explorer, opens file in current perspective instead of perspective editor. how link package explorer composant or perspective ?

java - How do set environment variable in gradle via task? -

i have gradle application. , main gradle-file include tasks (groovy). need when start task - environment variable "lang" set encoding = ru_ru.koi8-r (for windows, linux), , after completion of task - environment variable contains initial value (en_us.utf-8). how it? me, please. as far know, cannot set system environment variable gradle task. however possible set environment variable process. if need set environment variable build use this: task mytask(type: exec) { environment 'environment_variable_name', 'environment_variable_value' // run or build code needs environment variable } you can make compile depend on task if build code set environment variable before compile: tasks.withtype(javacompile) { compiletask -> compiletask.dependson mytask }

Javascript window location in loop on masterpage -

we have site masterpage. there page policy.aspx. user has accept policy in order access site resources. hence put foll. code on masterpage. there boolean variable ( var boolval ). if(!boolval) { window.location="http://url/policy.aspx"; } for new users boolval false. redirected policy.aspx page. since page inherits masterpage, reloads continuously executes window.location again , again infinitely. can done besides stopping policy.aspx page inherit masterpage? it's hard know without seeing rest of code, first instinct change code to: if(!boolval) { window.location="http://url/policy.aspx"; boolval = true; }

hyperlink - html links not working (using base href) -

hi there using tag: <base href="http://awebsite.ca/” target=" /> in association tag: <a href=“main_page/mainpage.html”><br><b>main</b></br></a> and getting in browser: http://awebsite.ca/â€Å“main_page/mainpage.htmlâ€%c2%9d you have quote attribute values " (quotation mark) or ' (apostrophe), not “ (left double quotation mark) , ” (right double quotation mark). this type of error typically caused writing code using word processor automatic replacement of quotes typographic quotes (aka smart quotes) enabled. try using text editor (such sublime text, komodo edit, emacs or vim) instead.

java - Spring + Hibernate SQL entity name not resolved -

in hibernate sql, class name(entity) not recognised.compile time error, have done following entity class import javax.persistence.*; @entity @table(name="user") public class userentity { @id @column(name="id") @generatedvalue private int id; @column(name="name") private string name; @column(name="address") private string address; //getter , setter dao class import com.springapp.model.userentity; import org.hibernate.sessionfactory; import org.springframework.beans.factory.annotation.autowired; import org.springframework.orm.hibernate3.support.hibernatedaosupport; import org.springframework.stereotype.repository; import java.util.list; @repository public class userdaoserviceimpl implements userdaoservice{ @autowired private sessionfactory sessionfactory; @override public void adduser(userentity user) { this.sessionfactory.getcurrentsession().save(user); } @ov...

ios - Under which circumstances is it fine to drop armv6 support? -

i want use framework recommends disable armv6 support in xcode. though not sure consequences has. as understand far, device older or slower 3gs not have armv7 , armv6. when drop support armv6 assume app binary becomes smaller , stop running on these old devices? if drop armv6 support need specify else required device capabilities exclude devices have armv6? yes, can target app armv7 , above uses device hardware capabilities not exist on armv6 devices. to this, required add armv7 in required device capabilities (uirequireddevicecapabilities) key in project’s info.plist file. uirequireddevicecapabilities (array or dictionary - ios) lets itunes , app store know device-related features app requires in order run. itunes , mobile app store use list prevent customers installing apps on device not support listed capabilities. unrelated important note : uirequireddevicecapabilities cannot changed in app updates . if app supports armv6 cannot submit new update re...

orchardcms - Orchard 'Layers' seem an odd concept when compared to other Asp.net based CMSs -

we're busy investigating orchard cms alternative existing asp.net based cms systems use. came across orchard, installed , started on tutorials. the 1 part confuses me layers. don't have in other cmss seem compare this. what we're used to, having couple of master pages (or templates) create new page , choose template page , add widgets various container areas. here seem create multiple layers , apply them based on url rules (or perhaps others too). questions: assuming these layers, in photoshop layers, seem you're adding widgets layers bottom of stack means widget added bottom layer appear in top layer. correct? or can 1 use rules omit layer? has documented obvious pitfalls approach? it seems odd way go things, perhaps because we're not used it. thanks, the name can confusing because sound there sort of z-index ordering or something. however, layers' job determine whether or not shape gets rendered. if layer rule returns true, shap...

javascript - Facebook login works in Safari but not in UIWebView -

i have app uiwebview displays web page has facebook login. i'm using facebook's javascript sdk (i cannot use ios sdk). the login works when open site in mobile safari not in web view. login dialog opens, enter user credentials , redirects blank white page. know causes this. ina normal browser, login dialog opens in new window. since uiwebview not support multiple windows, login replaces webpage , once logged in, can't redirect original web page. i've searched on solutions of them outdated. don't think there straight forward fix if has workaround/hack, please me out. thank you. check if added facebook application id (your app id) xcode project - app's url schema. make sure redirect user page after fb login. - (void)webviewdidfinishload:(uiwebview *)webview { nsstring *url = [[webview.request url] absolutestring]; // if([url hasprefix:@"https://m.facebook.com/dialog/oauth"]) if([url ha...

cocoa touch - Real time feedback on swipe XCode -

i've managed change views uiswipegesturerecognizer starts changing view after complete swipe. how can make start start dragging finger on screen? i've searched couldn't find answer. use pan gesture uipangesturerecognizer *pan = [[uipangesturerecognizer alloc] initwithtarget:self action:@selector(handlepan:)]; [self addgesturerecognizer:pan]; then do: - (void)handlepan:(uipangesturerecognizer *)gesture { cgpoint touchpoint = [gesture locationinview:your_view]; uiview *draggedview = [gesture view]; switch ([gesture state]) { case uigesturerecognizerstatebegan: break; case uigesturerecognizerstatepossible: break; case uigesturerecognizerstatechanged: break; case uigesturerecognizerstateended: break; case uigesturerecognizerstatecancelled: break; case uigesturerecognizerstatefailed: break; default...

vb.net - Thread safety problems trying to databind across threads -

i have form datagrids bound bindinglist of data being populated constant stream of data tcpip connection. tcpip connection on thread should constatly loop , when finds enough data create instance of class data , add bindinglist(of data). getting error says "cross-thread operation not valid: control '' accessed thread other thread created on.". stack trace points line adds new data bindinglist(of data) datalist.insert(0, dataitem) what strange me keeps going on , populates datagrid properly. not experienced multithreaded programming , of code has been asynchronous. have datalock , mutexes(something learned not sure using correctly). read somewhere using events if newdata event isn't necessary can rid of it. in making code thread safe appreciated. the binding on form this: mydatagrid.datasource = mydatareader.datalist here class launching tread , reading data(sorry know it's lot of code didn't want leave out important): public class datareade...

ruby - Sencha Cmd cannot compile app after upgrade to MacOS X 10.9 -

Image
after upgrading mac macosx mavericks have issue: macbook-pro-sergey:komus boooch$ sencha app build sencha cmd v4.0.3.74 [inf] [inf] init-plugin: [inf] [inf] cmd-root-plugin.init-properties: [inf] [inf] init-properties: [inf] [inf] init-sencha-command: [inf] [inf] init: [inf] [inf] app-build-impl: [inf] [inf] -before-init-local: [inf] [inf] -init-local: [inf] [inf] -after-init-local: [inf] [inf] init-local: [inf] [inf] find-cmd-in-path: [inf] [inf] find-cmd-in-environment: [inf] [inf] find-cmd-in-shell: [inf] [inf] init-cmd: [inf] [echo] using sencha cmd /users/boooch/bin/sencha/cmd/4.0.3.74 /users/boooch/documents/senchaapps/komus/build.xml [inf] [inf] -before-init: [inf] [inf] -init: [inf] initializing sencha cmd ant environment [inf] adding antlib taskdef com/sencha/command/compass/ant/antlib.xml [wrn] application last modified older version of sencha cmd (0.0.0.0), current 4.0.3.74. please run 'sencha app upgrade -noframework' update 4.0.3.74. [in...

JPanel refresh issue with game -

i making lan command based game, , parsing structured english java. have parsed , can draw grid, can hard code text grid before runtime , cant seem grid refresh new text. parsing class: public class serverplayerparsing { servergridgenerator servergrid = new servergridgenerator (10, 10); public string validate(string command){ servergrid.framegen(); if (wordcount(command)== 3) { string[] commandarray = command.split(" "); commandparsing(commandarray); } else { system.out.println("error! format incorrect!"); system.out.println("correct format = [command 1] [command 2] [command 3]"); } return ""; } public int wordcount(string command){ string[] commandcount = command.split("\\s"); return commandcount.length; } public string commandparsing(string[] commandarray) { switch (commandarray[0]) { case "move": secondcommand (commandarray); break; default: system.out.println("error in first command!...

r - separate legend geom_smooth in ggplot2 -

Image
i want make plot similar one: library(ggplot2) ggplot(data=mtcars, aes(x = wt,y = mpg, colour = factor(cyl))) + geom_line() + geom_smooth(method = "lm", se=false, lty = 2) however, want different entry in legend dashed lines (linear trend) , solid lines (data). seems trivial reason haven't been able figure out. if need show 6 different levels in 1 legend combines linetypes , colors, 1 solution make new data frame contains original mpg values , predicted values linear model. make new data frame mtcars2 mgp replaced predicted values. library(plyr) mtcars2<-ddply(mtcars,.(cyl),mutate,mpg=predict(lm(mpg~wt))) add new column mtcars , new data frame show real , predicted data mtcars$type<-"real" mtcars2$type<-"pred" combine both data frames. mtcars.new<-rbind(mtcars,mtcars2) now plot data using combined data frame , color= , lty= use interaction between cyl , type . scale_color_manual() , scale_linetyp...

mysql - DESCRIBE a joined table -

if use describe 'tablename' i filednames, need. possible fieldnames in same way if have joined 1 or more tables? when describe table -> table's fieldnames. (it cannot know table want join with, , can hardly read minds) said in comment, can create view, returning fields joined tables, , try describe view itself.

applet - Java Scanline Polygon Fill Algorithm -

i have started learning computer graphics , new java. java applet performs scan line algorithm works cases. can me out know wrong ? you can view entire code here = http://codeshare.io/9uvuf in advance. i've made similar in c++ , opengl. work concave , convex, not sure if polygons. i don't know if it's best solution, works me. bool graphicobject::ismouseinside(int x, int y) { if (points.size() < 2) { return false; } int count = 0; float ti; float yint = y; float xint = 0; (size_t = 0; < points.size() - 1; i++) { auto p1 = points[i + 1]; auto p2 = points[i]; if (p1.x == x && p1.y == y) { return true; } ti = 0; if ((p2.y - p1.y) != 0) { ti = (yint - p1.y) / (p2.y - p1.y); } if (ti > 0 && ti < 1) { xint = p1.x + (p2.x - p1.x) * ti; // hack: point ...

c# - How to find the execution time of a piece of code? -

c# code is possible find execution time of set of code in visual studio ? if visual studio provide tools alternatives? are there free reliable tools download? sql server management studio is possible find execution time of set of code in sql server management studio ? if sql server management studio provide tools alternatives? are there free reliable tools download? thanks for ssms query execution time in miliseconds in sql server management studio if need query execution time in milliseconds in sql server management studio, there simple way achieve this. set statistics time on -- query set statistics time off this result in following lin in messages window: sql server execution times: cpu time = 16 ms, elapsed time = 16 ms.

.htaccess - Redirect to another page instead of index.php through htaccess -

when first time load page instead of index page should redirect page. after when clicked on home page redirect home page. have done through htaccess. , wanted open database link put below code. directoryindex inventory.php < ifmodule mod_rewrite.c > rewriteengine on rewriterule ^mega_dados/.*$ - [pt] </ifmodule > above code working first time page load rewrite rule not working. if i'll comment first line rewrite rule working directory index not working. wanted both. how can resolve it. depends need exactly, use cookies redirect @ first visit. first visit, index.php not find cookie , goes start.php index.php: <?php if (!isset($_cookie['mycookie'])) { header("location: ./start.php"); exit(); } ?> start.php : <?php if (!empty($_post['waarde'])) { setcookie ('mycookie', 'yes', time() + 3600); header("location: ./index.php"); exi...

ios - Gamekit and Game Center sample from Apple -

for reason, apple's links gamekit samples broken. looking apple's gamekit , game center sample code. https://developer.apple.com/library/ios/samplecode/gktapper/introduction/intro.html try out one. it's bit old, though. what interested in? bet there ton of tutorials cover it.

android - IBM Worklight 6.1 - How to check connection type? -

can 1 me in knowing connection type using worklight api? i tried using getnetworkinfo(callback) not helpful knowing whether 2g or 3g both iphone , android. worklight apps bundled version of cordova. you can use cordova connection api . api able discern between 2g , 3g connection types , others. for example, in your-project\apps\your-app\common\js\main.js , add following wlcommoninit() : function wlcommoninit() { var networkstate = navigator.connection.type; var states = {}; states[connection.unknown] = 'unknown connection'; states[connection.ethernet] = 'ethernet connection'; states[connection.wifi] = 'wifi connection'; states[connection.cell_2g] = 'cell 2g connection'; states[connection.cell_3g] = 'cell 3g connection'; states[connection.cell_4g] = 'cell 4g connection'; states[connection.cell] = 'cell generic connection'; states[connection.none] = ...

CKAN extensions not working if ckanext-sparql activated -

i'm trying install several extensions on ckan. seem work fine until install ckanext-sparql. i've followed instructions on website, , if have sparql extension working alone, works great, when try add extension, gives me following error message: ckan.plugins.core.pluginnotfoundexception: sparql_interface i have installed extensions on virtual environment , work except when try add sparql. sparql extension works, only if no other extension activated. i've solved problem. turns out ckanext-sparql extension wasn't registering correctly. i've added manually easy-install.pth file other extensons were, , works fine.

sql - how can I show only the new rows in the datagridview -

how can show rows in gridview, primarykey>= primarykey.max - 20 (the 20 latest lines) when create sql statement, can use variable declared @ vb.net?(for example counter counts amount of added rows) must put statement in? use sql statement datasource select top 20 yourtable order primarykey desc update if table name , pkey must dynamic can use parameterized command. once sql statement formed can fill dataset , use data source when populating datagridview dim cmd new sqlcommand("select top 20 ? order ? desc", connection) cmd.parameters.addwithvalue("@table", yourdinamictablename) cmd.parameters.addwithvalue("@pkey", yourdinamickeyname) dim ds new dataset dim adapter new sqldataadapter(cmd) adapter.fill(ds) datagridview1.datasource = ds.tables(0)

Rendering multiple Leaflet instances in Meteor -

i want render list of small maps individual leaflet instances in meteor.js. using suggested template.list.rendered callback returns 1 instance first list-element. html: <template name="list"> <div class="list-group"> {{#each happening}} <div class="list-group-item"> <p id="{{_id}}"> {{#constant}} <br> <div id="container" class="container"> <div id="map" class="map" style="height: 300px; width: 90%;"></div> </div> {{/constant}} </p> </div> {{/each}} </div> </template> js: template.list.rendered = function () { set leaflet... }; i reckon rendered isn't way go here? without seeing code, it's hard debug. however, sound...

image - Reading a JPEG in Python (PIL) with broken header -

i'm trying open jpeg file in python 2.7, from pil import image im = image.open(filename) which didn't work me, >>> im = image.open(filename) traceback (most recent call last): file "<pyshell#810>", line 1, in <module> im = image.open(filename) file "/usr/lib/python2.7/dist-packages/pil/image.py", line 1980, in open raise ioerror("cannot identify image file") ioerror: cannot identify image file though when trying out on external viewers, opened fine. digging in bit, turns out jpegimagefile._open method pil 's jpegimageplugin.py file raises syntaxerror exception due several extraneous 0x00 bytes before 0xffda marker in jpeg's file header, corrupt jpeg data: 5 extraneous bytes before marker 0xda that is, while other programs tried ignored unknown 0x00 marker towards end of header, pil prefered raise exception, not allowing me open image. question : apart editing pil 's code directly...

Linux USB: libusb vs sysfs -

on linux system, need list usb hosts , devices various information class, product id, etc. figure both libusb , sysfs task (correct?). 1 better? you should prefer libusb because platform independent , provides better apis work usb devices sysfs. if not need integrate functionality in other program, consider using standalone usb-devices or lsusb programs (which included usbutils package).

Jenkins Email-ext plugin build log all on one line -

ive seen sort of asked in various places haven't found true answer. does know how make build log thats displayed in body using html.jelly template not run , separate each line line break? im pretty sure answer lies sort of change needs happen template have no idea begin. right in email: [copy] copying 1 file /opt/hybris/hybris/bin/ext-channel/cscockpit/resources/localization [mkdir] created dir: /opt/hybris/hybris/bin/platform/tomcat-6/work/catalina/localhost/hmc [echo] [jspcompile] generating.. [echo] [jspcompile] touching jsp files [echo] [jspcompile] compiling.. /opt/hybris/hybris/bin/platform/tomcat-6/work/catalina/localhost/hmc [yjavac] compiling 209 source files /opt/hybris/hybris/bin/platform/tomcat-6/work/catalina/localhost/hmc [touch] creating /opt/hybris/hybris/bin/platform/tomcat-6/work/catalina/localhost/hmc/jspcompile_touch [stopwatch] [build: 36.436 sec] server: [echo] [echo] configuring server @ /opt/hybris/hybris/bin/platform/tomcat-6 [echo] using co...

c# - WPF DataGrid - Binding Source and Width to different objects -

in wpf application, have datagrid bound collection in viewmodel, want width of first column equal property on viewmodel itself, so: public observablecollection<booking> bookings { return repository.bookings(); } public int maxwidth { return 100; } (i realise there's no point in binding fixed property - it's demo purposes) <usercontrol> <datagrid datacontext="{binding bookings}"> <datagrid.columns> <datagridtextcolumn width="{binding relativesource={relativesource findancestor, ancestortype={x:type usercontrol}}, path=datacontext.maxwidth}" header="provider" binding="{binding name}" /> </datagrid.columns> </datagrid> </usercontrol> but if this, width of column remains @ default value - i.e. wide enough accommodate value. what doing wrong? edit: attempted this, see happened: <label name="tricky" content="500"...

asp.net - ModelBindingContext.ValueProvider.GetValue returning nothing even though there is a key for the value I am retrieving -

i working on asp.net mvc3 project. i have implemented custom imodelbinder class.in bindmodel method attempting retrieve id (a guid) of item this: public class myviewmodelmodelbinder implements imodelbinder public function bindmodel(controllercontext system.web.mvc.controllercontext, bindingcontext system.web.mvc.modelbindingcontext) object implements system.web.mvc.imodelbinder.bindmodel dim myvm myviewmodel if (bindingcontext.model isnot nothing andalso typeof bindingcontext.model myviewmodel) myvm = directcast(bindingcontext.model, myviewmodel) else myvm = new myviewmodel end if dim proposedobjectid guid = getvalue(of guid)(bindingcontext, "objectid") myvm.objectid = proposedobjectid '...' return myvm end function private function getvalue(of t)(byval bindingcontext modelbindingcontext, byval key string) t dim returnvalue t = nothing ...

jquery - Hash location basics -

i'm trying understand how location.hash works in jquery, that, i'm trying begin basic form, , once right i'd go deeper, sadly i'm stuck @ think should simple thing. here's code created modifying else's code found in post here: $(document).ready(function(){ $("body").css("background-color", "#ff0"); $(window).bind( 'hashchange', function( event ) { if (window.location.hash == "red"){ $("body").addclass("red"); } else if (window.location.hash == "green") { $("body").addclass("green"); } event.preventdefault(); }); $(window).trigger("hashchange"); }); and here's page http://dlacrem.16mb.com/dlatest/hash.html now, said, i'm trying learn there 80 mistakes in 10 lines :d but, shouldn't adding red class body when go hash.html#red? i'm using bbq plugin ben alman regards, , comes way! ...

CUDA debug invalid kernel image error -

i wrote following cuda kernel , trying load module: #include <stdio.h> extern "c" // ensure function name "vadd" { __global__ void vadd(const float *a, const float *b, float *c) { int = threadidx.x + blockidx.x * blockdim.x; printf("thread id %d\n", i); c[i] = a[i] + b[i]; } } i compile ptx code using following command: nvcc -ptx -arch=sm_20 vadd.cu when trying load file module using cumoduleload cuda 200 error (invalid kernel image). how can find out wrong kernel image? have tried ptxas , according that, generated ptx code fine. edit : code using load module: #include "cuda.h" #include <cassert> #include <dlfcn.h> #include <stdio.h> void check(curesult err) { if (err != cuda_success) { printf("error %i\n", err); } assert(err == cuda_success); } int main(int argc, char **argv) { void *cuda = dlopen("libcuda.so", rtld_now | rtld_deep...

PHP Hotel booking with allotments per day -

searched here similar questions finding stuff more need. what trying create simple "hotel booking" allotments per day . so, basically: user chooses checkin , checkout date , hotel or hotel b. now, each day between checkin , checkout there allotments, i.e. have following possible dates respective allotments (rooms available): hotel a: 17.10.2014 - 25 rooms 18.10.2014 - 40 rooms 19.10.2014 - 20 rooms hotel b: 17.10.2014 - 35 rooms 18.10.2014 - 50 rooms 19.10.2014 - 40 rooms when booking user first chooses checkin , checkout, hotel , script should check if of days in between booked particular hotel , particular date range , return message there no free allotments selected date range - maybe show days "problematic" (i.e. booked) user can choose day before or after. what best approach achieve this? have checked several db schemas , table structures, said finding other solutions, not fit problem.

Jsplumb change position of static anchor -

what want accomplish can rotate jsplumb connections. can use setanchor redefine anchor can't work. found online , works it's not want. jsplumb.selectendpoints("myclickedelement").setanchor([ "continuous", { faces: ["top", "bottom", "left", "right"] }]) i got endpoint on top , bottom of object , when rotate want them @ left , right without deleting existing connections. jsplumb.addendpoint($(this).parent("div").attr('id'), { anchor:[0.5, 0, 0, -1] }, { issource:true, istarget:true, paintstyle:{ linewidth:1, strokestyle:'#ff8700' }, connector: 'flowchart', hoverpaintstyle:{ strokestyle:"#ff8700", linewidth:4}, }) jsplumb.addendpoint($(this).parent("div").attr('id'), { anchor:[0.5, 1, 0, 1] }, { issource:true, istarget:true, paintstyle:{ linewidth:1, strokestyle:'#ff8700' }, connector: 'flowchart', hoverpain...

In HAProxy, how do I redirect all to HTTPS except for certain domains? -

i have haproxy in front of frontend servers working load balancer. redirects incoming requests https: frontend front_http mode http redirect scheme https if !{ ssl_fc } maxconn 10000 bind 0.0.0.0:80 reqadd x-forwarded-proto:\ http default_backend back_easycreadoc frontend front_https mode http maxconn 10000 bind 0.0.0.0:443 ssl crt /etc/haproxy/ssl.crt reqadd x-forwarded-proto:\ https default_backend back_easycreadoc we going add few domains not have certificate (we not own domains, our clients own them). how let connections go through on port 80 without redirecting them https, these domains? frontend front_http mode http acl host_one hdr(host) -i www.one.com acl host_two hdr(host) -i www.two.com redirect scheme https if !host_one !host_two maxconn 10000 bind 0.0.0.0:80 reqadd x-forwarded-proto:\ http default_backend back_easycreadoc http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#redirect

rdf - How to map relational database to OWL? -

i trying map relational database owl here 2 tables student(student_id,student_name,course_id) course(course_id,course_name) +----+--------+-----------+ | id | name | course_id | +----+--------+-----------+ | 1 | adam | 5 | | 2 | michael| 2 | +----+--------+-----------+ +-----------+-------------+ | course_id | course_name | +-----------+-------------+ | 2 | dm | | 5 | webir | +-----------+-------------+ now course_id foreign key in student table referencing course_id in course table.i created ontology(defined schema) using protege 4.3 i trying insert data owl file instances using jena api. in ontology, columns not foreign keys mapped datatype properties , foreign keys mapped object property per paper (mapping relational owl(section 4.4.4)) . adding tuples instances student , course classes in jena. if foreign key object property how can use uniquely determine relation. here jena cod...

python - Calling a Slot by QtCore.SignalMapper -

i want check users input in several qtgui.qlineedits same function different parameters. tried qtcore.signalmapper. code in test-application: self.signalmapper = qtcore.qsignalmapper(self) qtcore.qobject.connect(self.lineedit_331, qtcore.signal(_fromutf8('returnpressed()')), self.signalmapper.map) qtcore.qobject.connect(self.lineedit_341, qtcore.signal(_fromutf8("returnpressed()")), self.signalmapper.map) self.signalmapper.setmapping(self.lineedit_331,'links') self.signalmapper.setmapping(self.lineedit_341,'rechts') qtcore.qobject.connect(self.signalmapper, qtcore.signal(_fromutf8("mapped(qstring)")),self.test) the signalmapper exists , connects return 'true' slot isn't called (the same after changing order of 'connect' , 'setmapping'). connecting lineedits signals slot works: qtcore.qobject.connect(self.lineedit_331, qtcore.signal(_fromutf8("returnpressed()")), self....