Posts

Showing posts from September, 2015

python - Creating a new virtualenv gives a permissions error -

i'm getting following output when running virtualenv newvenv . traceback (most recent call last): file "/usr/local/bin/virtualenv", line 5, in <module> pkg_resources import load_entry_point file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <module> add_activation_listener(lambda dist: dist.activate()) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 700, in subscribe callback(dist) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <lambda> add_activation_listener(lambda dist: dist.activate()) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2227, in activate self.insert_on(path) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2334, in insert_on self.check_version_conflict() file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2373, in check_version_conflict...

go - Idiomatic way to handle template errors in golang -

say have html/template following: <html> <body> <p>{{somefunc .somedata}}</p> </body> and somefunc returns error. there idiomatic way deal this? if write directly responsewriter , status code 200 has been written before encounter error. var tmpl *template.template func handler(w http.responsewriter, r *http.request) { err := tmpl.execute(w, data) // "<html><body><p>" has been written... // err? } preferably return status code 400 or such, can't see way if use template.execute directly on responsewriter . there i'm missing? since template engine generates output on-the-fly, parts of template preceding somefunc call sent output. , if output not buffered, (along http 200 status) may sent. you can't that. what can perform check before call template.execute() . in trivial case should enough call somefunc() , check return value. if choose path , return value of somefunc() c...

facebook - android ACTION_SEND to share with specific application only -

in android application have 4 buttons facebook , viber , telegram , whatsapp , want share different content based on each button. for example if user clicks on viber button want user action_send share content viber only. i found this explains how facebook , twitter seems it's calling specific class name of application don't know applications wanna use except facebook. all android apps have unique id, first have check if these apps installed in user's device , can pass unique id via intent sharing. according below: unique ids different apps : viber : com.viber.voip telegram : org.telegram.messenger whatsapp : com.whatsapp check if these apps installed , if installed send messages through intent. private void sendmessage(context context,string message, string appids) { final boolean isappinstalled =isappavailable(context, appids); if (isappinstalled) { intent myintent = new intent(intent.action_send); myintent.settype("text/p...

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null ....

javascript - cocos2d-js draw circle not instantly -

i wondering how draw circles (or other shapes also) not instantly. so far tried drawcircle(args...) in ccdrawnode.js , drawcircle(args...) in cc.drawingprimitivecanvas class, , draw circles popping out instantly on screen. what if want achieve effect circular progressive bar, completes circle based on percentage of initialization? or more generally, if want draw circle respect prolonged period? thinking there drawcircle function elapsed time argument fail find any. or have implement own? thanks suggestions, far out of ideas. i think have implement own. think can achieve update circle drawing on each time update() function called.

print tables with dynamic columns angularjs and ngtable -

i'm using angularjs , ngtable , wish print table dynamically generated. this code: var app = angular.module('dl', ['ngtable']); app.controller('dactrl', function($scope, ngtableparams, $http) { $scope.headers=[]; $scope.data = []; //----------------------example-------------------------- //---$scope.header[{label: "value1"},{label: "value2"},{label: "value3"}]----- //---$scope.data[{value1: 1, value2: 2, value3: 3},{value1: 18, value2: 30, value3: 6}, {value1: 15, value2: 21, value3: 56},......]-------------- //------- header y data are dynamically generated $scope.tableparams = new ngtableparams({ page: 1, count: 10, filter: { message: '' }, sorting: { asset: 'asc' ...

r - Heatmap.2 color gradient with an additional solid color -

Image
the heatmap using creates gradient 0.7 1.3 using heatmap.2 : heatmap.2(lifespan.matrix, col=bluered, breaks=c(seq(0.7,1.3,0.01)), rowv = false, colv = false, trace="none", main="lifespan") in heatmap can see gradient emerge ending oftenly in solid blue line. happens because of 0 values in matrix @ these points. i'd change color, in matrix noted 0, different color i.e. yellow. me problem? breaks <- seq(0.7,1.3,0.01) lifespan.matrix <- matrix(sample(c(breaks,rep(0,100)),100,replace=true),nrow=10) heatmap.2(lifespan.matrix, col=c("#ffff00",bluered(length(breaks)-2)), breaks=breaks, rowv = false, colv = false, trace="none", main="lifespan") you specify exact colors associated breaks.

twitter bootstrap - Accordion (web design) -

Image
i'm using twitter bootstrap: what i'm trying do? i'm building "login", "sign up" side side button using accordion, should display form inside div alternatively. i.e when login button clicked "sign up" form inside division should hide , "login" form inside same div should display, vice-versa "sign up" button. view html markup below , screenshot of html page. screenshot of login & signup inside div <div class="login-window"><!-- login window--> <button type="button" class="btn btn-primary accordion" data-toggle="collapse" data-target="#login">log in</button> <button type="button" class="btn btn-primary accordion" data-toggle="collapse" data-target="#signup">sign up</button> <div id="login" class="collapse in"...

ios - AFNetworking GET Parameters in body -

i have following code , want force parameters in body of call , not part of query string nsstring * requesturl = [nsstring stringwithformat:kxxxbaseapiurl,@"findfriends"]; nsstring * lastcalltime = [[xxxcommon sharedinstance] lasttimestampforurl:requesturl]; afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; afhttprequestserializer * serializer =[afjsonrequestserializer serializer]; [[xxxcommon sharedinstance].currentaccount addauthorization:serializer]; [manager setrequestserializer:serializer]; [manager.requestserializer setvalue:lastcalltime forhttpheaderfield:@"if-modified-since"]; [manager get:requesturl parameters:@{@"id":[xxxcommon sharedinstance].currentaccount.userid, @"details" : [[xxxcommon sharedinstance].contactfriends valueforkey:@"user_key"]} success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"%@",responseobject); } failure:^(a...

c++ - How to programmatically add a Qt widget (QPushButton, QTextEdit, QLabel) to a Qt Designer layout? -

is possible dynamically add widgets (pushbuttons, labels, etc.), qt designer-generated central widget layout? how can done? thank you! of course, , it's quite easy. can have @ ui_mainwindow.h @ debug/release dir. prefer setting layouts widgets in qtdesigner code. it's this: //set layout programatically auto layout = new qhboxlayout(ui->centralwidget()); //or if have set horizontallayout in qt designer auto layout = dynamic_cast<qhboxlayout*>(ui->centralwidget->layout()); layout->addwidget(new qlabel("hello"));

unity3d - Make two physics objects not collide but do detect collisions in Unity -

i have unity project in there 2d game world consists of static colliders make geometry solid characters inhabit it. player dynamic collider (with non-kinematic rigidbody). there's enemy character dynamic collider. both characters walk on floor , bump walls i'd expect them to. what want achieve player , enemy not solid each other, can move through each other. achieved putting enemy , player on separate layers , setting collision matrix these layers not collide each other. problem i'm having now, however, want detect whether or not enemy , player ran each other. added trigger collider enemy character, it's on enemy layer means doesn't detect collisions player. i thought of making sub-gameobject enemy, put on player's layer, add rigidbody , trigger collider , use detect collisions between player , enemy, feels convoluted leaves me wondering if there isn't more elegant solution this. yes, need create child gameobject , trigger collider, , put in...

ios - Set beginning of Separator Lines in UITableView? -

Image
this question has answer here: is there way make uitableview cells in ios 7 not have line break in separator? 17 answers a uitableview has seperator lines shown in following image. not start @ beginning of row. see red box in image. want change start. how can specify separator lines in table view begin? add table view separator insets zero. add code in cellforrowatindexpath : if (cell.respondstoselector("preservessuperviewlayoutmargins")){ cell.layoutmargins = uiedgeinsetszero cell.preservessuperviewlayoutmargins = false } see preview :

module - Why was the ISO standard for prolog a failure? -

in introduction here , states iso standard prolog failure. can elaborate on this? the system cite, swi-prolog, system core developed single developer. such bold statements quote personal opinions. in past, swi did follow iso standards period. then, changed. if want read more this, please refer this answer . there systems conforming - in particular: sicstus prolog sicstus-prolog , gnu prolog gnu-prolog . in case want know more purpose of standards, in particular iso standards, refer national standardization body. offer 1- or 2-day introductory courses. not place discuss this.

Loop through columns of excel pivot with vba -

i trying loop through columns of pivottable add conditional formatting. cant figure out how select data of column. able select columnheader. in following code left conditional formatting part away reduce complexity. sub format_pivot_columns() set pt = activesheet.pivottables("piv_scrapedata") each ptfld in pt.columnfields ptfld.datarange.select selection.interior.color = vbyellow next ptfld end sub any idea? thanks! i ended following code works charm. inspiration! sub format_pivot_columns() set pt = activesheet.pivottables("piv_scrapedata") each ptfld in pt.databodyrange.columns ptfld.select selection.interior.color = vbyellow next ptfld end sub

javascript - ThreeJS collisions with SAT missaligned collision boxes -

i'm working on simple game school, have encountered problem making collisions. collision boxes seems miss aligned. here game: http://ggeasy.herokuapp.com/game those little boxes drawn this: for(var x = 0; x < colliderpolygon.points.length; x++){ var test = new three.mesh(new three.cubegeometry(8,8,8),material) test.position.x = colliderpolygon.pos.x + colliderpolygon.calcpoints[x].x test.position.z = colliderpolygon.pos.y + colliderpolygon.calcpoints[x].y this.mesh.add(test) } i translated collision, because in theory threejs position bound bottom center of box , in sat it's bound left top corner of box. whole program's code available here: https://github.com/hajtosek/ggeasy any ideas, have did wrong? ok, key understand position binding points. three.js has ind middle of mesh, sat has in top left corner. var collider = new sat.box(new sat.vector(cubemesh.position.x - halfwidth, cubemesh.position.z - halfheight), width, height);...

python - How to label and change the scale of Seaborn kdeplot's axes -

Image
here's code import numpy np numpy.random import randn import pandas pd scipy import stats import matplotlib mpl import matplotlib.pyplot plt import seaborn sns fig = sns.kdeplot(treze, shade=true, color=c1,cut =0, clip=(0,2000)) fig = sns.kdeplot(cjjardim, shade=true, color=c2,cut =0, clip=(0,2000)) fig.figure.suptitle("plot", fontsize = 24) plt.xlabel('purchase amount', fontsize=18) plt.ylabel('distribution', fontsize=16) , results in following plot: i want 2 things: 1) change scale of y-axis multiplying values 10000 and, if it's possible, add % sign numbers. in other words, want y-axis values shown in above plot 0%, 5%, 10%, 15%, 20%, 25%, , 30%. 2) add more values x-axis. i'm particularly interested in showing data in intervals of 200. in other words, want x-axis values shown in plot 0, 200, 400, 600,... , on. 1) looking combination of get_yticks() , set_yticks: plt.yticks(fig.get_yticks(), fig.get_yticks() * 100) ...

Java 8 : Lambda Function and Generic Wildcards -

i have following class class book implement borrowable { @override public string tostring(function<? extends borrowable , string> format) { return format.apply(this); } } this gives me error cannot use "apply" on this(book object). my current formatter function<book, string> regular_format = book -> "name='" + book.name + '\'' + ", author='" + book.author + '\'' + ", year=" + book.year; i don't want make lambda function of type function<borrowable, string> as lose access members of book not exposed borrowable. the function<? extends borrowable, string> type means function able accept some type extends borrowable . not mean accepts book . best solution introduce generic parameter borrowable : public interface borrowable<t> { public string tostring(function<? super t,...

python - import error does not occurs only when required library is installed while repl is running -

i'm trying test cppyy module in pypy. cppyy requires reflex library, installed it. without it, error occurs >>>> import cppyy traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: missing reflection library libcppyy_backend.so while python repl still runing, install reflex library , after that, 'import cppyy' works. however, when close repl , run again , try import cppyy, not works again(the error above). point when install reflex library while repl running, 'import cppyy' succeeds. think real problem not cppyy or reflex , there have been similiar problems python repl. know how fix it? i think you're confused behavior of pypy (which bug, should reported http://bugs.pypy.org/ ): if type import cppyy once, fails importerror shown above, inconsistently, trying again import cppyy "works". of course, broken module. to answer real question, seems fai...

How to pass data from local variable to datagridview using c# -

how pass value of calculated result in datagridview. in following code filled 2 columns of grid values fetched database through datatable, add new column named "text". want pass value of calculated hash in column there may b syntax problem or mistake causes error occurred. following code; sqldataadapter sda = new sqldataadapter("select image,hash userinput pincode = '" + txt_lpin.text + "'",conn); datatable dt = new datatable(); sda.fill(dt); datagridview1.datasource = dt; int nor = datagridview1.rows.count; if (nor == 5) { logincluepoint lcp = new logincluepoint(); lcp.dgv_lcp.autosizecolumnsmode = datagridviewautosizecolumnsmode.fill; lcp.dgv_lcp.rowtemplate.height = 101; lcp.dgv_lcp.datasource = dt; datagridviewcolumn col = new datagridviewtextboxcolumn(); col.headertext = "text"; int colindex = lcp.dgv_lcp.columns.add(col); lcp.dgv_lcp.columns[2].visible = false; } ...

python - Test if dict contained in dict -

testing equality works fine python dicts: first = {"one":"un", "two":"deux", "three":"trois"} second = {"one":"un", "two":"deux", "three":"trois"} print(first == second) # result: true but second dict contains additional keys want ignore: first = {"one":"un", "two":"deux", "three":"trois"} second = {"one":"un", "two":"deux", "three":"trois", "foo":"bar"} is there simple way test if first dict part of second dict, keys , values? edit 1: this question suspected duplicate of how test if dictionary contains keys , i'm interested in testing keys and values . containing same keys not make 2 dicts equal. edit 2: ok, got answers using 4 different methods, , proved of them working. need fast process, tested each ...

html - Why are my footer logos including the margin-left? -

i have run problem regarding logos in footer. there 4 logos in footer (a pinterest logo, facebook logo, twitter logo , google+ logo). each of 4 logos linked seperate webpages however, can't understand why white space (margin-left: 15px) between logos can clicked on. if explain why occurs , how go fixing issue (only logo should clicked on access link, not white space in between), appreciated. thank in advance. here relevant html code: <body> <div id="footer"> <div id="footerlogos"> <a href="https://www.pinterest.com/fwtemplates/" target="_blank"> <img src="http://s8.postimg.org/9rkvn5myp/pinteresticon.png" alt="pinterest icon" height="22px"/> </a> <a href="https://www.facebook.com/freewebsitetemplates" target="_blank"> <img src="http://s1.postimg.or...

docker - Server and client network apps simulated in one machine -

i simulate server machine , several client machines operating on vpn. test server application client applications on 1 machine. would able few docker applications running on machine - or should using systemd-nspawn? yes. linking containers, exposing , publishing[publish ports containers can communicate each other or host machine.

javascript - how to make effects happen one after another -

hi want make these events 1 after another. means when 1st event ends events occur. unable so. 2nd image appears after first event starts animating please me. code <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> </style> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>‌​ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>‌​ <script> $(document).ready(function(){ $("#pin01").animate({left: '650px'}); $("#pin01").promise().done(function(x){ $("#pin02").animate({left: '350px'}); }); }...

jdbc - Squirrel Setup to connect to Phoenix - HBASE: Error java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.NoSuchMethodError: -

i newbie hbase & phoenix. trying connect hbase via phoenix jdbc driver using squirrel client. somehow seem strange error runtime complains of nosuchmethod exception. have included relevant client jar phoenix-4.4.0-hbase-1.0-client in lib folder of squirrel , have registered driver succesfully. when try connect exception seems bit weird. have xtracted jar , seen indeed method getcurrentuser() exists in org/apache/hadoop/security/usergroupinformation.class file. java.util.concurrent.executionexception: java.lang.runtimeexception: java.lang.nosuchmethoderror: org.apache.hadoop.security.usergroupinformation.getcurrentuser()lorg/apache/hadoop/security/usergroupinformation; @ java.util.concurrent.futuretask.report(futuretask.java:122) @ java.util.concurrent.futuretask.get(futuretask.java:202) @ net.sourceforge.squirrel_sql.client.mainframe.action.openconnectioncommand.awaitconnection(openconnectioncommand.java:132) @ net.sourceforge.squirrel_sql.client.mainframe.action.openconnec...

maven - Trying to use Java Message Service (JMS) API with Service Bus and AMQP -

i'm trying execute example program , getting following class not found exception: javax.naming.noinitialcontextexception: cannot instantiate class: org.apache.qpid.amqp_1_0.jms.jndi.propertiesfileinitialcontextfactory [root exception java.lang.classnotfoundexception: org.apache.qpid.amqp_1_0.jms.jndi.propertiesfileinitialcontextfactory] @ javax.naming.spi.namingmanager.getinitialcontext(unknown source) @ javax.naming.initialcontext.getdefaultinitctx(unknown source) @ javax.naming.initialcontext.init(unknown source) @ javax.naming.initialcontext.<init>(unknown source) @ filternet.simplesenderreceiver.<init>(simplesenderreceiver.java:30) @ filternet.simplesenderreceiver.main(simplesenderreceiver.java:60) caused by: java.lang.classnotfoundexception: org.apache.qpid.amqp_1_0.jms.jndi.propertiesfileinitialcontextfactory* i have included following dependency in pom file: <dependency> <groupid>org.apache.qpid</groupid> <...

php - How to show username after login in web page -

Image
i created simple web page using php , html...in page logged in dont know how show username after login.. @ same time want hide login , signup.. please help.. here code: .welcome { float:right; width:33.33%; right: 0px; text-align: right; } <nav class="navbar navbar-default navbar-inverse" role="navigation"> <div class="container-fluid"> <div class="welcome"> <!--<a href="" id="welcome">welcome!!</a>--> <?php if (isset($_session['name1'])) { /*echo ' <div class="rightone" onclick = "arrow();">'; echo '<ul>'; echo '<li><div class="arrow-down"></div>'; echo '<div class="arrow-up"></div>...

Unable to click on list button option in selenium : Exception Element not visible -

hi trying select on list option cold , flu getting element not visible exception, can please me how select in selenium script. site url : http://www.healthdirect.gov.au/symptom-checker/tool?symptom=cold colds , flu here selenium code public void selectspecificsymptom(string arg) throws interruptedexception { // todo auto-generated method stub switch(arg.tolowercase()) { case "cold , flu": /* actions actions = new actions(driver); webelement menuhoverlink = driver.findelement(by.xpath("//*[@ng-true-value='49|feeling sick or unwell|1']")); actions.movetoelement(menuhoverlink); actions.click(); actions.perform();*/ thread.sleep(5000); driver.findelement(by.xpath("//*[@ng-true-value='49|feeling sick or unwell|1']")).click(); driver.findelement(by.id("submitanswer")); break; default: system.out.println("not valid option...

visual studio - VB.net: How do I link XAML VB files? -

how link vb mainwindow.xaml , calculatorwindow.xaml together. i have code in mainwindow.xaml file <controls:metrowindow.rightwindowcommands> <controls:windowcommands> <button content="information" click="buttonclicked"/> <button content="calculator" click="buttonclicked2"/> </controls:windowcommands> </controls:metrowindow.rightwindowcommands> i want add code links mainwindow.xaml calculator.xaml.vb via buttonclicked2 , how do that?

node.js - Is there a way to limit the maximum size of a string? -

i have application in wish limit maximum size of message sent across wire connected client. since theoretical maximum of message in nodejs 1.9gb , never want application allocate big chunk of memory if malicious clients tries send over-sized packet. how can limit incoming message size, say, 1024 bytes? each character 1 3 bytes in length. can technically substring string desired length. var limited = fullstring.substring(0, 1024); or can use package : utf8-binary-cutter

Android is killing my service? -

with broadcastreceiver, execute service @ smartphone boot: public class bootreceiver extends broadcastreceiver{ @override public void onreceive(context context, intent intent) { intent startserviceintent = new intent(context, myservice.class); context.startservice(startserviceintent); } } myservice: private runnable myrunnable = new runnable() { public void run() { parsing.cancel(true); parsing = new parsing(); parsing.execute(); handler.postdelayed(this, timeoutupdate); } }; @override public int onstartcommand(intent intent, int flags, int startid) { handler.removecallbacks(myrunnable); handler.postdelayed(myrunnable, 1000); return service.start_sticky; } the service executed @ boot, if set timeout of 1 hour between executions, service not executed (maybe system killing it). otherwise, if set 60 sec between repetition, works. how can it? thanks. you may run service in foreground using startforeground() ...

Ordering 3 tables in DataTables (jQuery) -

i'm using datatables ( http://datatables.net/ ) plugin jquery. have 3 tables same columns, different data, , want synchronize ordering them. i.e. order 1 table, want other tables ordered same column. javascript code following: $(document).ready(function () { var abstable = $('#abstable').datatable(); var diftable = $('#diftable').datatable(); var reltable = $('#reltable').datatable(); $('#abstable').on( 'order.dt', function () { var absorder = abstable.order(); diftable.order( [ absorder[0][0], absorder[0][1] ] ).draw(); reltable.order( [ absorder[0][0], absorder[0][1] ] ).draw(); } ); $('#diftable').on( 'order.dt', function () { var diforder = diftable.order(); abstable.order( [ diforder[0][0], diforder[0][1] ] ).draw(); reltable.order( [ diforder[0][0], diforder[0][1] ] ).draw(); } ); $('#reltable').on( ...

Error in Android RelativeLayout when wrapping_content -

i have relative layout 2 views. imageview , textview. textview should have same width imageview , below of imageview. so set them this <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageview" android:maxwidth="50dp" android:minwidth="50dp" android:layout_centervertical="true" android:layout_torightof=some_other_view android:layout_marginleft="8dp" android:minheight="10dp" /> <textview android:id="@+id/textview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignleft="@+id/imageview" android:layout_below="@+id/imageview" android:singleline="true" android:text="stuff" a...

Extract a html tag that contains a string in openrefine? -

there not add title. it's i'm trying do. suggestions? i reviewed docs @ github , googled extensively. the best got is: value.parsehtml().select('p[contains('xyz')]') it results in syntax error. the 'select' syntax based on select syntax in beautiful soup ( http://jsoup.org/cookbook/extracting-data/selector-syntax ) in case believe syntax need is: value.parsehtml().select("p:contains(xyz)") owen

ios - How to implement trimming of video which is playing on AVPlayer? -

my requirement implement trimming , editing of video playing on avplayer trimming : can customize avplayer player trimming in default editing of video through uiimagepickercontroller .i had found few links on showing progress bar,but here requirement display sequence of images there editing default editing of uiimage picker controller if knowledge shared might me!!! we have access class called uivideoeditorcontroller allows movie editing. here sample project shows how . separately, here's tutorial on how use avexportsession trim avassets (you'd need modernize arc).

.net - WPF Localization with Visual Studio 2013 -

i want learn how localize wpf project written in c#. found following webpage , followed example of wpf localization, run dialog box example https://msdn.microsoft.com/en-us/library/ms788718.aspx created new project according description , worked until have use locbaml utility. tried download utility ms url http://go.microsoft.com/fwlink/?linkid=160016 not work (anymore). searched internet tool , found seems old version. able use command locbaml /parse rundialog.resources.dll /out: generate "rundialog.resources.dll.csv" , csv file created file empty. now questions: does else have experience localization , locbaml utility , knows find updated version of utility , maybe more detailed description or sample how use it? is localization using description in ms article above best way work localization or there better alternatives? currently work example learn it. program plan localize in planning , design scratch flexible use whatever way now. i used appr...

Uncss Twitter Bootstrap Modal -

i want make use of grunt plugin "uncss". still misses classes of bootstrap modal. right grunt setup uncss looks this: uncss: { dist: { options: { ignore: [ ".fade", ".fade.in", ".collapse", ".collapse.in", ".collapsing", ".alert-danger", // modal ".modal", ".modal.fade.in", ".modal-dialog", ".modal-scrollbar-measure", ".modal-backdrop.fade", ".modal-backdrop.in", ".modal.fade.modal-dialog", ".modal.in.modal-dialog", ".modal-open", ".in", ".modal-backdrop", /\.open/ ] }, files: { 'css/app.css': ['index.html...

python - django - invalid literal for int() with base 10 in django Admin | Primary Key CharField -

i'm trying figure out simple (but weird) problem. need modelb have foreign key reference modela (with charfield pk), so: class modela(models.model): name = models.charfield(primary_key=true) tags = taggablemanager() class modelb(models.model): model_a = models.foreignkey(modela) my code seems understand in runtime , can create modela/modelb objects no problem. however, when try manually add/delete model objects in django admin, kind of value exception. exception value: invalid literal int() base 10: i know has trying interpret key charfield int() id, why djangowebsite/admin not know how deal these relationships? update: full stack trace: environment: request method: post request url: http://127.0.0.1:5000/admin/src/ratedmodel/add/ django version: 1.7.7 python version: 3.4.3 installed applications: ('src', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions...

xml - How to get a mean from data.frame? -

i have data.frame, got this: data <- ldply(xmltolist("http://www.nbp.pl/kursy/xml/a025z100205.xml"),data.frame) i create list : list <- data[[6]] then deleted na values list <- list[!is.na(list)] and got this [1] 0,0900 2,9915 2,5851 0,3850 2,7805 2,0566 2,1043 4,0921 1,4918 2,7837 [11] 4,7009 0,3723 3,3450 0,1561 0,5496 0,2615 2,3211 0,4987 0,4005 0,5589 [21] 0,9894 2,0923 1,9688 1,1851 5,7733 0,0643 0,2271 0,3884 1,5965 0,8687 [31] 0,0981 3,1673 0,2557 0,4384 4,5657 35 levels: 0,0900 2,9915 2,5851 0,3850 2,7805 2,0566 2,1043 4,0921 ... 4,5657 but can't mean list. because of levels? how can this? the class of 'list' factor due non-numeric component ( , ). when there non-numeric element in column, creating data.frame , default option stringsasfactors=true . can include argument stringsasfactors=false inside data.frame character column, still , should replaced. assuming meant decimal, replace . using sub , convert ...

filesystems - How do I tweak GlusterFS performance? -

i have 2 dedicated servers following specs: - e3 1270v3 cpu - 32gb ram - 960gb ssd - 1gbps private ethernet network. using local drives, dd tests in range of 600mb/s, good. i setup glusterfs replicated cluster, installing both glusterd , glusterfs clients on each machine. dd test result of global namespace dropped 50mb/s, , whenever try run application requires high read/write performance, application crashes. how tweak glusterfs better performance using 2 machines replicated cluster?

android - Animating Toolbar along with Fragment Transactions -

i have mainactivity implementing navigation drawer using below xml: <android.support.v4.widget.drawerlayout xmlns:android ="http://schemas.android.com/apk/res/android" android:id ="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <linearlayout android:id="@+id/container_toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <include android:id="@+id/toolbar" layout="@layout/toolbar" /> </linearlayout> <framelayout android:id="@+id/content" android:layout_width="fill_paren...

php - How to search for the backslash (\) mark and the zero (0) in MySQL? -

summary/background i have tried make search engine can search characters in mysql. encounter question below: when try search backslash (\) mark, result unwanted. (the result shows many data don't contain backslash) when try search number 0 (0), result none no matter content is. my try i have tried describe problem. , below code. <? $search="\\"; //the searching word. (here wanna search word backslash (\).) $link=mysql_connect("localhost","xxx","ooo"); mysql_select_db("xxx",$link); if($search){ $str="select xxx sheet xxx '%$search%'"; $list=mysql_query($str,$link); while(list($xxx)=mysql_fetch_row($list)){ echo $xxx."<br>"; } } mysql_close($link); ?> the data in database below data in database: (xxx field in datasheet sheet ) +-------------------------------------------+ | xxx | +===================...

java - Capture entire window with winapi -

Image
i using winapi capture window of opened software applications in java. function below captures window of software application , returns image. public static bufferedimage capture(hwnd hwnd) { hdc hdcwindow = user32.instance.getdc(hwnd); hdc hdcmemdc = gdi32.instance.createcompatibledc(hdcwindow); rect bounds = new rect(); rect bounds1 = new rect(); user32extra.instance.getwindowrect(hwnd, bounds); user32extra.instance.getclientrect(hwnd, bounds1); int extragap = (bounds.right-bounds.left-bounds1.right); int width = bounds.right-bounds.left-extragap; int height = bounds.bottom-bounds.top-extragap ; hbitmap hbitmap = gdi32.instance.createcompatiblebitmap(hdcwindow, width, height); handle hold = gdi32.instance.selectobject(hdcmemdc, hbitmap); gdi32extra.instance.bitblt(hdcmemdc,0, 0, width, height, hdcwindow, bounds.left+bounds1.right-bounds.right+extragap, bounds.top+bounds1.bottom-bounds.bottom+extragap, wingdiextra.mergecopy); gdi32.instan...