Posts

Showing posts from March, 2015

android - Gradle buildType/productFlavor using unexpected buildConfigField -

Image
given below configuration: productflavors { normal { applicationid "com.app" } mock { applicationid "com.app.mock" } } buildtypes { debug { productflavors.normal.buildconfigfield "boolean", "mockmode", "false" productflavors.mock.buildconfigfield "boolean", "mockmode", "true" } release { productflavors.normal.buildconfigfield "boolean", "mockmode", "false" // release should never point mocks. ever. productflavors.mock.buildconfigfield "boolean", "mockmode", "false" } } i have expected buildconfig.mockmode = true; , however, resultant build config: public final class buildconfig { public static final boolean debug = boolean.parseboolean("true"); public static final string application_id = "*****"; public static final string build_type = "debug"; public s...

ruby - Error installing gems: cannot load such file -- zlib -

i'm trying install bundler gem on mac os yosmite ~/code/hello gem install bundler error: loading command: install (loaderror) cannot load such file -- zlib error: while executing gem ... (nomethoderror) undefined method `invoke_with_build_args' nil:nilclass i've done following: install zlib through homebrew upgrade rubygems reinstall rvm , ruby 2.2.2 switched rbenv , ruby 2.2.2 this doing head in. ruby 2.2.1 works fine 2.2.2 causes issue whenever try install gem. anyone got ideas? the following worked me: brew install homebrew/dupes/zlib rvm reinstall 2.2.2 --with-zlib-dir=/usr/local/cellar/zlib/1.2.8 hope helps else runs it.

android - how to Have different ExclusionStrategy for request and response in retrofit? -

i've implemented this answer want different strategies excluding fields in "request" , "response". how can that? update: example, want send name , last name in request , exclude others in response want email included. model: public class user{ @expose @serializedname("id") private string mremoteid; @expose @column(name = "name") @serializedname("name") private string mname; @expose @column(name = "lastname") @serializedname("lastname") private string mlastname; @expose @column(name = "email") @serializedname("email") private string memail; @expose @column(name = "password") @serializedname("password") private string mpassword; }

coredump - How to set breakpoints and make it break when debugging core dump with gdb? -

how set breakpoints , make break when debugging core dump gdb? when use command "gdb program core", process halt @ crash point, how can make process break before halting there. if cannot make break, commands can use in gdb when debugging core dump? you can restart program once loading core if want trace steps leading crash. use 'start', take first line in program. set breakpoints between main() , crash point. see sample below: <pre> [narz@dev101 src]$ gdb -n -quiet myprogram core.12046 reading symbols </my/path/>...done. [new thread 12046] reading symbols /usr/lib64/libstdc++.so.6...(no debugging symbols found)...done. loaded symbols /usr/lib64/libstdc++.so.6 reading symbols /lib64/libm.so.6...(no debugging symbols found)...done. loaded symbols /lib64/libm.so.6 reading symbols /lib64/libgcc_s.so.1...(no debugging symbols found)...done. loaded symbols /lib64/libgcc_s.so.1 reading symbols /lib64/libc.so.6...(no debugging symbols found)...don...

sql - Cannot bulk load because the file "\\<UC Path>\\Test.csv" could not be opened. Operating system error code 1240 -

i running sql 2014. trying execute bulk insert unc path , receiving error below. script runs fine if execute bulk insert local path. security wise, have granted myself , sql service account full access file on remote disk. tsql: bulk insert exclusionlist_bp '\\test_server\test.csv'with (fieldterminator =',',rowterminator='\n' ,firstrow=2) error: msg 4861, level 16, state 1, procedure test, line 33 cannot bulk load because file "\test_server\test.csv" not opened. operating system error code 1240(the account not authorized log in station.). any idea appreciated. cheers shrestha i know pretty old, if else need it, need map drive in server, following command: exec xp_cmdshell 'net use \\server\shared_folder yourpassword /user:domain\yourusername /persistent:yes' to perform must have admin permissions on server, if not, contact dba. once, map network folder, should able read file.

class - Python changing ClassA instance variables in ClassB -

i trying load whole class instance via dill rather dump , load each class variable 1 @ time. can show me how this: class object(object): pass class classa: def __init__(self): self.data = "initial" class classb: def __init__(self, ca): self.ca = ca def updatevalue(self): #a = dill.load(classa.storage) = object() a.data = "new value" self.ca = print self.ca.data ca = classa() cb = classb(ca) cb.updatevalue() print ca.data so output is: new value new value i think you're asking: given object , object b, how can copy of a's attributes b in 1 step (or programatically)? naive approach: b.__dict__ = dict(a.__dict__) # make copy objects don't share same dict the problem approach clobbers preexisting attributes in b did not exist in a. eg. b.attr = "some value" b.__dict__ = dict(a.__dict__) print(hasattr(b, "attr")) # expect false ...

Different block size Hadoop -

what need have smaller/larger blocks in hadoop? concretely, want have larger number of mappers, gets smaller piece of data work on. seems need decrease block size, i'm confused (i'm new hadoop) - need while putting file on hdfs, or need specify related input split size, or both? i'm sharing cluster, cannot perform global settings, need on per-job basis, if possible? , i'm running job code (later oozie, possibly). what mapper runs controlled input split, , how specify it. hdfs block size has nothing (other fact splitters use block size basic 'block' creating input splits in order achieve data locality). can write own splitter takes hdfs block , splits in 100 splits, if fancy. aslo @ change file split size in hadoop . now being said, wisdom of doing ('many mappers small splits') highly questionable. else trying opposite (create few mappers aggregated splits). see dealing hadoop's small files problem , the small files problem , amaz...

I want to display an option list for configurable attributes on product list page in magento -

i want display option list configurable attributes on product list page in magento, appears on product view page configurable products.i tried nothing working, looked similar topics useless.please me resolve issue. <?php $_productcollection=$this->getloadedproductcollection(); $_helper = $this->helper('catalog/output'); $sidebar=mage::getstoreconfig('buyshoplayout/product_listing/sidebar'); $i=0; $count=0; $span=3; $p_in_row=4; $type=mage::getstoreconfig('buyshoplayout/product_listing/product_listing_image_size'); if($type=='small') { $span=2; $p_in_row=6; } ?> <?php if(!$_productcollection->count()): ?> <div class="category-products aligncenter"> <?php echo $this->getlayout()->createblock('cms/block')->setblockid('buyshop_no_products')->tohtml() ?> </div> <?php else: ?> <div class="category-...

java - Getting Android Alarms Info -

iv'e created several alarms using intent , broadcastreciever , placed them in array of intents. each intent iv'e placed string in intent.putextra("info", string); shown later toast when alarm activated, , gave each different requestcode. when adding multiple alarms, toast shows every other alarms' info well. mainactivity: intent newalarmintent = new intent(this,alarmreceiver.class); newalarmintent.putextra("info",edittext.gettext().tostring()); alarmsarray[alarmcounter]=newalarmintent; alarm.alarmlistsortandsetnext(gamearraylist, alarmarray, this,alarmcounter,alarmsarray[alarmcounter]); alarm class: public void createnew (context context, long alarmtimeaslong, int counter, intent intent) { pendingintent pendingintent; pendingintent = pendingintent.getbroadcast(context, counter, intent, pendingintent.flag_update_current); alarmmanager manager; manager = (alarmmanager)context.getsystemservice(context.alarm_service); manag...

android - Get the Text of clicked item in gridView -

i have gridview in every cell contains imageview , textview. when user clicks on item, want take text of textview in position user clicked. tried code below, every time take first element. grid.setonitemclicklistener(new adapterview.onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) { viewgroup gridchild = (viewgroup) grid.getchildat(position); int childsize = gridchild.getchildcount(); for(int k = 0; k < childsize; k++) { if(gridchild.getchildat(k) instanceof textview ){ textview temp = (textview) findviewbyid(gridchild.getchildat(k).getid()); stationid = temp.gettext().tostring(); log.i("stationid", stationid); } } use @override public view getview(final int position, view convertview, viewgroup parent) { view rowview = convertview; rowview = inflater.inflate(r.lay...

java - LoginButton Facebook with appcompat-v7:22.1.1 -

has try using appcompat-v7:22.1.1 facebook login sdk version 4.0.0 tried failed,and dont know how fix it, when try using different layout works, when using layout contain loginbutton facebook not work, here code : my activity looks : import android.content.intent; import android.content.pm.packageinfo; import android.content.pm.packagemanager; import android.content.pm.signature; import android.os.bundle; import android.os.persistablebundle; import android.support.v7.app.appcompatactivity; import android.util.base64; import android.util.log; import android.view.menu; import android.view.menuitem; import com.facebook.accesstoken; import com.facebook.callbackmanager; import com.facebook.facebookcallback; import com.facebook.facebookexception; import com.facebook.facebooksdk; import com.facebook.graphrequest; import com.facebook.graphresponse; import com.facebook.appevents.appeventslogger; import com.facebook.login.loginresult; import com.facebook.login.widget.loginbutton; impo...

angularjs - Typescript writing angular $httpprovider defaults -

i trying write global angular $httpprovider defaults in typescript . here code, have currently. export class jsondateparser { private httpprovider:any; public static $inject = [ $httpprovider ]; constructor($httpprovider:any) { console.log("json date parser defaults"); this.httpprovider = $httpprovider; // gives me runtime error // referencing angular. } } // here reference registering app.config(jsondateparser); how can write angularjs httpprovider defaults in typescript? also how can apply lambda syntax constructor in typescript. if assign httpprovider variable ng.ihttpprovider type, complier complains this.httpprovider.defaults.transformresponse , transformresponse not resolved. see in type definition angular.d.ts (1.2.x) not defined, should there right? missing something? thanks in advance helping me out. we need bit adjusted syntax: // define parser exp...

indexing - MySQL query with less than and ORDER BY DESC -

i'm doing work rather large set of data , trying create query every combination of 4 different pieces of data. of pieces combined form staggering 122,000,000 rows. then, i'm trying find weight less amount , sort value highest lowest. i can use weight < x no problem. i can use weight < x order height asc no problem. i can use weight < x order height desc when x around both upper , lower end. once starts creeping middle, rises seconds, minutes, "i'm not going wait long." any thoughts? (the names have been changed, types have not) the create: create table combinations ( id bigint(20) unsigned not null auto_increment, smallint(2) not null, left smallint(2) not null, right smallint(2) not null, down smallint(2) not null, weight decimal(5,1) not null, width smallint(3) not null, forward decimal(6,2) not null, backwards decimal(5,2) not null, in decimal(7,2) not null, out smallint(3) not null, he...

php - Using password_hash with bindParam -

i'm trying create login system using slim jquery , ajax. i've got log in part working minimal issues, need able hash password. know can use md5, sha1 and/or salt hash know recommenced password_hash used instead. know how hash of other 3 mentioned because while using bindparam can place around variable. question is, how use password_hash bindparam. closest answer found on site didn't help. my current code is: $app->post('/adduser/', 'adduser'); function adduser() { $request = \slim\slim::getinstance()->request(); $q = json_decode($request->getbody()); $sql = "insert users(firstname, lastname, username, password) values (:firstname, :lastname, :username, :password)"; try{ $dbconnection(); $stmt=$db->prepare($sql); $stmt->bindparam("firstname", $q->firstname); $stmt->bindparam("lastname", $q->lastname); $stmt->bindparam("username"...

android - Can't use of Font class in my App -

i want use of font class in android app,i add jre system library in project(every thing ok),but when run,in log cat show error: java.lang.noclassdeffounderror: java.awt.font you cannot use awt in android. the correct way use custom font instantiate typeface . example: typeface customtypeface = typeface.createfromfile(assets, "fonts/customfont.ttf"); mytextview.settypeface(customtypeface); typeface.createfromfile(assetmanager, string) you can use third party library calligraphy dirty work you. allows set typeface xml layouts , styles

Importing C++ custom library functions into C# -

i have large c++ library need incorporate c# project. successful in using dllimport access functions library, this: [dllimport("mylib.dll")] public static extern int samplefunction(string param); however, can't seem figure out how make work functions either have parameter or return type not defined within dll (i.e., code in dll imports file), such example function takes in list: [dllimport("mylib.dll")] public static extern std::vector<myclass> myfunction(string param); for std library functions, know can dll , import in, other classes myclass in above example? need create managed wrapper class in c++ each of these classes, or there way this? std::vector<myclass> , or indeed unmanaged c++ class, cannot used interop c#. indeed, if wished consume function unmanaged c++ module you'd have make sure using same compiler , dynamic runtime dll exported function. you'll need find other way implement functionality. there lots of...

asp.net - On GridView_RowEdititng Pass Selected Column value in session -

i have gridview <asp:gridview id="grdmod" runat="server" emptydatatext="no data found" autogeneratecolumns="false" skinid="prggrid1" allowpaging="true" bordercolor="maroon" borderwidth="2px" width="600px"> <headerstyle font-names="arial" font-size="10pt" horizontalalign="center" /> <columns> <asp:templatefield headertext="code"> <itemstyle font-names="arial" font-size="9pt" horizontalalign="center" /> <headerstyle font-names="arial" font-size="10pt" font-bold="true" horizontalalign="center" /> <itemtemplate> <asp:label id="lblcode" runat="server" text='<%#bind("code") %>' /> <...

javascript - Word Wrap in CSS3 -

is there other way word-wrap text inside div? can't use word-wrap in css since can use css1 , css2. *use javascript or css thank you! .test_wordwrap { position: absolute; top: 45px; left: 20px; width: 250px; white-space: pre-wrap; } maybe help: .myclass { white-space: normal; overflow: hidden; }

jquery - Access Mongodb directly from client side -

i new mongodb , trying access mongo db , retrieve data in client side [jquery/angular html5] web application. possible me use dependencies or plugins in angular/jquery , access mongo db or mandatory use node or express js , use api's client call crud operations mongo db? please explain , suggest you can use 1 of these provide rest api mongodb , send requests via $q as per reply in comments answer see http://docs.mongodb.org/ecosystem/tools/http-interfaces/#simple-rest-api

Updating Facebook SDK Android -

i using old version of facebook android sdk (i think v 3.0.1) quite while until got problem loging in through facebook. i getting error in stack trace : java.lang.runtimeexception: unable resume activity {com.example/com.facebook.loginactivity}: java.lang.illegalargumentexception: service intent must explicit: intent { act=com.facebook.platform.platform_service cat=[android.intent.category.default] } @ android.app.activitythread.performresumeactivity(activitythread.java:2958) @ android.app.activitythread.handleresumeactivity(activitythread.java:2989) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2372) @ android.app.activitythread.access$800(activitythread.java:148) @ android.app.activitythread$h.handlemessage(activitythread.java:1283) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:135) @ android.app.activitythread.main(activitythread.java:5274) @ java.lang.reflect.method.inv...

java - "Error: Could not find or load main class" JavaFX Terminal -

i'm using following class javafx tutorial: import javafx.application.application; import javafx.stage.stage; public class hellofxapp extends application { public static void main(string[] args) { // launch javafx application application.launch(args); } @override public void start(stage stage) { stage.settitle("hello javafx application"); stage.show(); } } i'm using ubuntu , have correct path .java file in terminal.. when type "javac hellofxapp.java" works fine , new "hellofxapp.class" file created. when try "java hellofxapp" receive following error: error: not find or load main class hellofxapp i checked java version typing "java -version" , looks have latest one: java version "1.8.0_45" java(tm) se runtime environment (build 1.8.0_45-b14) java hotspot(tm) server vm (build 25.45-b02, mixed mode) please tell me if missed something! thank in ad...

javascript - How can I send files along with other field's data to webmethod is asp.net using jquery ajax call? -

i have webform has x number of textboxes , y number of dropdowns etc using code send data webmethod @ server: $.ajax({ type: "post", url: "suppliermaster.aspx/registersupplier", data: json.stringify({ id: $('#txtbidderid').val(), bidamt: $('#txtbidamt').val() }), contenttype: "application/json; charset=utf-8", datatype: "json", async: true, success: function (data, status) { alert(data.d); }, failure: function (data) { alert(data.d); }, error: function (data) { alert(data.d); } }); now problem want include file attachments on form. how add files data: of $.ajax method? not want use external plugins etc unless absolutely necessary. lets modify data object : var datatosend = {}; datatosend.id = $('#txtbidderid').val() datatosend.bidamt = $('#txtbidamt').val() datatosend.append( 'file', input.files[0] );...

javascript - Angular .config routing not working: white page after grunt serve -

when run grunt serve , nothing blank page scroll bar shown. problem related setup of .config routing in app.js, i've struggled terribly long time trying figure out is. index.html <!doctype html> <html class="no-js" ng-app="bcapp"> <head> <meta charset="utf-8"> <title>quickmath</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> <link rel="stylesheet" href="styles/main.css"> <!-- adds mathjax in asciimath form--> <script type="text/javascript" src="bower_components/mathjax/mathjax.js?config=am_htmlormml-full"></script> <script src="bower_components/jquery/dist/jquery.js"></script> <script src="bower_components/angu...

jquery - Using javascript to alter content of a <div> -

how alter content of <div> using javascript when <div> has no id or class . i know using document.getelementbyid('foo').innerhtml = 'your content'; have been used if <div> had id. in case content want alter this <div unselectable="on" style="position: absolute; padding: 2px; top: 0px; left: 1px; background-color: rgb(255, 102, 0); color: white;">boo</div> i partial using document.getelementsbytagname("div")[0].innerhtml = "boo"; find how proceed modify content? way doing things? no there other div 1 content boo if case, can find :contains $("div:contains('boo')").html('hello');

Using maketorrent in libtorrent examples -

so trying build application uses libtorrent. however, before start make sure have compiled lib correctly , have functioning environment testing. running vm opentracker , try connect using example client in libtorrent. first start creating .torrent file using libtorrent (i not sitting in front of computer libtorrent available might remembering exact commands bit wrong): maketorrent.exe dummy.txt -t "http://10.xxx.xxx.xxx/announce" this gives me .torrent file called a.torrent . opening file looks ok, bencoding correct , announce address there. next try add example client hoping starts seed: client_test.exe a.torrent everything starts ok, no tracker found. if press t show tracker information see error (maybe not exact phrasing): alert: {null} unsupported url protocol ok, maybe wrong how built libtorrent. halite client instead since supposed build upon libtorret. there have same problem. have @ code , found error message generated. code checking if supplying a...

VB.NET Convert String to Int throws error : Input String was not in a correct format -

i using .net framework 1.0 , try convert string int throws error input string not in correct format take @ code dim total integer total = (convert.toint32(me.lbloldqty.text)) - (convert.toint32(me.txtqty.text)) dim value string = me.lbloldqty.text + " - " + me.txtqty.text + " = " + convert.tostring(total) me.lblnewvalue.text = value i tried using cint , integer.parse same result. any appreciated try : dim total integer total = integer.parse(lbloldqty.text) - integer.parse(txtqty.text) dim value string = lbloldqty.text + " - " + txtqty.text + " = " + convert.tostring(total) lblnewvalue.text = value use breakpoint while execution , check if values passing correctly lbloldqty.text , txtqty.text

java - Access Spring beans from a servlet in JBoss got property null -

i had follow link: access spring beans servlet in jboss autowired bean properties in bean null ? problem ? please, me. new java !!! public class myservlet extends httpservlet { @autowired private myservice myservice; public void init(servletconfig config) { super.init(config); springbeanautowiringsupport.processinjectionbasedonservletcontext(this, config.getservletcontext()); } } spring needs way inject value servlet. try adding public getter , setter: public void getmyservice() { return this.myservice; } public void setmyservice(myservice s) { this.myservice = s; } or constructor takes myservice: public myservlet(myservice s) { this.myservice = s; }

javascript - how to use multiple preloaders in a same page for different actions? -

i trying use multiple preloaders can loaded in particular area of page instead of loading whole page , during occurrence of different events button click. the code used is: html <style> .preload div#preloader { position: fixed; left: 0; top: 0; z-index: 999; width: 100%; height: 100%; overflow: visible; background: #3c3d3f url('../images/loading.gif') no-repeat center center; } </style> <div class="preload"> <div id="preloader"> </div> </div> js jquery(document).ready(function($) { $(window).load(function(){ $('#preloader').fadeout('slow',function(){ $(this).remove(); }); }); }); you can modifying css. .preload div#preloader { position: fixed; left: 0; top: 0; z-index: 999; width: 100%; height: 100%; overflow: visible; ...

winapi - How to get current operating system language? -

i newbie mfc, , got struck on how current operating system language (ex: if english operating system must english , locale can different. english os locale can japanese vice versa). current locale getting through getsystemdefaultlangid , thing left need current operating system language. can kindly me resolve issue. this came before. maybe need getuserdefaultuilanguage ? user interface language management int wmain(int argc, _tchar* argv[]) { wcout << "getuserdefaultuilanguage: " << getuserdefaultuilanguage() << endl; wcout << "getsystemdefaultuilanguage: " << getsystemdefaultuilanguage() << endl; wcout << endl; wcout << "getuserdefaultlangid: " << getuserdefaultlangid() << endl; wcout << "getsystemdefaultlangid: " << getsystemdefaultlangid() << endl; wcout << endl; wcout << "getuserdefaultlc...

c# - Progress bar does not updated wpf? -

Image
this question has answer here: how correctly implement backgroundworker progressbar updates? 1 answer i trying update progress bar inside contentrendered(object sender, eventargs e) event. code :- mainwindow.xaml.cs dynamiccontrols.progressbarwindow _progressbarwindow = new dynamiccontrols.progressbarwindow("please wait..."); _progressbarwindow.showdialog(); xaml <window x:class="nk_image_converter.dynamiccontrols.progressbarwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="progressbarwindow" height="100" width="500" borderthickness="0" windowstyle="none" resizemode="noresize" background="#d4dce6" loaded="window_loaded" initialized="win...

objective c - Unit tests with strings (Bloc Ios Development) -

i'm going through bloc bootcamp , need little code. need these unit tests pass. below 2 implementation files: changes methods done in stringcheese.m while stringcheesetests.m displays failures. i've copied on 1 failure can work through rest. appreciated. stringcheesetests.m - (void)testthatcheesefavoritingworks { nsstring *ricottastring = @"ricotta"; nsstring *favoritecheese = [self.stringcheese favoritecheesestringwithcheese:ricottastring]; xctassertequalobjects(favoritecheese, @"my favorite cheese ricotta.", @"incorrect favorite cheese string returned."); nsstring *goatstring = @"goat"; favoritecheese = [self.stringcheese favoritecheesestringwithcheese:goatstring]; xctassertequalobjects(favoritecheese, @"my favorite cheese goat.", @"incorrect favorite cheese string returned."); } stringcheese.m - (nsstring *) favoritecheesestringwithcheese:(nsstring *)cheesename { **//work...

javascript - How to resize QR code? -

my current html code: <input id="text" type="text"/> <div id="qrcode"></div> my old javascript code: var qrcode = new qrcode("qrcode"); $("#text").on("keyup", function () { qrcode.makecode($(this).val()); }).keyup().focus(); $("#qrcode").kendoqrcode({ value: "#test" }); $("#qrcode") .css({ width: "100px", height: "100px" }) .data("kendoqrcode").resize(); my current javascript code: var qrcode = new qrcode("qrcode"); $("#qrcode").kendoqrcode({ $("#text").on("keyup", function () { qrcode.makecode($(this).val()); }).keyup().focus(); }); $("#qrcode") .css({ width: "100px", height: "100px" }) .data("kendoqrcode").resize(); i'm using jquery ui 1.9.2 , qrcode.min.js , kendo.all.min.js for old javascript, print out 2 different qrcode. cu...

phoenix framework - Ecto where like query acts like where == -

i'm trying ecto query working this: def find(searchterm) query = c in contact, #where: fragment("? % ?", c.company_name, ^searchterm), where: like(c.company_name, ^searchterm), contacts = repo.all(query) {:ok, contacts} end in table, have company_name "asymptote". using where: like/2 query looks this: select c0."id", c0."company_id", c0."company_name" "contacts" c0 (c0."company_name" $1) ["asym"] (1.0ms) when pg_trm search uncommented, looks this: select c0."id", c0."company_id", c0."company_name" "contacts" c0 (c0."company_name" % $1) ["asym"] (1.0ms) as far can see, queries good, there no results. since added index after adding "asymptote" database, expect why isn't found in pg_trm index, why won't like/2 or ilike/2 work? when entering in full name "asymptote", able find record. ...

Implementing a custom cross-platform userspace filesystem with WebDAV instead of FUSE -

implementing custom filesystem works in userspace cross-platform seems daunting task - fuse great on linux, awkward install on osx, , windows doesn't support userspace filesystems @ all. (one workaround discussed here windows run linux vm fuse , samba, , use smb mount fuse filesystem on windows. but platforms come webdav filesystem built-in, , building cross-platform webdav server seems pretty easy. seems straightforward way implement userspace filesystem, haven't seen done before. my question: filesystem features might impossible or impractical implement through webdav server? here's can see far: things webdav server can't fuse filesystem can: files can have creation , modification dates, , of course sizes, can't have individual users, groups, , permissions. there rfc acls on webdav, it's not supported webdav clients . (on mac, files seem appear user readable, writable, , executable, , owned me.) according webdav protocol, files can have arbitr...

python - How to display the value of the bar on each bar with pyplot.barh()? -

Image
i generated bar plot, how can display value of bar on each bar? current plot: what trying get: my code: import os import numpy np import matplotlib.pyplot plt x = [u'info', u'cuisine', u'type_of_place', u'drink', u'place', u'meal_time', u'dish', u'neighbourhood'] y = [160, 167, 137, 18, 120, 36, 155, 130] fig, ax = plt.subplots() width = 0.75 # width of bars ind = np.arange(len(y)) # x locations groups ax.barh(ind, y, width, color="blue") ax.set_yticks(ind+width/2) ax.set_yticklabels(x, minor=false) plt.title('title') plt.xlabel('x') plt.ylabel('y') #plt.show() plt.savefig(os.path.join('test.png'), dpi=300, format='png', bbox_inches='tight') # use format='svg' or 'pdf' vectorial pictures add: for i, v in enumerate(y): ax.text(v + 3, + .25, str(v), color='blue', fontweight='bold') result: ...

r - Why won't lda() accept a string as it's 'formula' argument? -

i'm doing regression analysis , i've come across strange behavior lda function in mass library. specifically, seems unable accept string it's formula argument. doesn't appear problem base glm functions. i've constructed small example using iris illustrate point. library(mass) myform<-"species~petal.length" # disregard warnings line, they're artifact of example. works. lgriris<-glm(formula=myform, data=iris, family="binomial") # breaks. ldairis<-lda(formula=myform, data=iris) the final line above throws: error in lda.default(formula = myform, data = iris) : argument "x" missing, no default which, judging documentation , seems indicate lda doesn't think it's been provided formula argument. know why happening, or how fix it? you can turn "myform" formula using as.formula() : myform <- "species~petal.length" class(myform) # [1] "character" myform <- as....

ios - Comparing NSNumber instances with isEqualToNumber -

yes, i've read other posts on stackoverflow comparing nsnumber , none of them seem quite address particular situation. solution particularly bad ... nsnumber compare: returning different results because suggested solution doesn't work @ all. using abs(value1 - value2) < tolerance flawed start because fractional values stripped off, making tolerance irrelevant. and apple documentation... nsnumber explicitly doesn't guarantee returned type match method used create it. in other words, if you're given nsnumber, have no way of determining whether contains float, double, int, bool, or whatever. also, best can tell, nsnumber isequaltonumber untrustworthy method compare 2 nsnumbers. so given these definitions... nsnumber *float1 = [nsnumber numberwithfloat:1.00001]; nsnumber *double1 = [nsnumber numberwithdouble:1.00001]; if run debugger , 2 comparisons of these identical numbers using ==, 1 fails, , other not. p [double1 floatvalue] == [float1 floatvalue]...

elixir - receiving :badarg on File.write -

i starting learn elixir, , first dynamic language, lost working functions without type declaration. trying do: def create_training_data(file_path, indices_path, result_path) file_path |> file.stream! |> stream.with_index |> filter_data_with_indices(indices_path) |> create_output_file(result_path) end def filter_data_with_indices(raw_data, indices_path) stream.filter raw_data, fn {_elem, index} -> index_match?(index, indices_path) end end defp index_match?(index, indices_path) indices_path |> file.stream! |> enum.any? fn elem -> (elem |> string.replace(~r/\n/, "") |> string.to_integer |> (&(&1 == index)).()) end end defp create_output_file(data, path) file.write(path, data) end when call function: create_training_data("./resources/data/usps.csv","./resources/indices/17.csv","./output.txt") it returns ...

cordova - Onsen UI with Jquery -

i'm new onsen ui. trying use jquery, examples in internet few. have index.html page single slide menu. has main page(which list page each item menu) wiht navigator. when click in item push corresponding page in navigator. want access buttons(using jquery) ons.ready function o manipulate content part of app.js. how this? this index.html <html> <head> <script type="text/javascript" src="js/app.js"></script> </head> <body> <ons-sliding-menu var="app.slidingmenu" menu-page="menu.html" main-page="main.html" side="left" type="overlay" max-slide-distance="200px"></ons-sliding-menu> </body> </html> main.html <ons-navigator title="main navigator" var="app.mainnavigator" ons-postpush="managenav" id="mainnavigator"> <ons-page> <ons-toolbar> ...

php - After submitting a form and redirecting back to the same page, how can I prevent the browser's back button from simply reloading the same page again? -

page 1 homepage. page 2 forum discussion. page 3 comment submission back-end code. if user goes homepage (page 1) discussion page (page 2) , submits comment, page 3 used insert comment database , redirect user (using header redirect) discussion (page 2). if user clicks browser's button, takes them earlier version of page 2, when in fact want them go homepage (page 1). is there way this?

In Selenium how to select an option if the span class and div class are not unique -

we have tabs called community, resources , support have same section class div class , span class attributes seen in html code below. how "select" or choose 1 of tabs , traverse down path links. <section class="s-fn-item"> <div class="s-fn-wrapper-item"> <h5 class="s-fn-title-item"> <span class="s-fn-item-link">community</span> </h5> <div class="s-fn-wrapper-sub-menu bg-base bg-shadow-down-medium fn- offscreen" style="display: block; height: 245px;"> <ul class="s-fn-sub-menu-item"> <li class="s-fn-promo-sub-menu-item"><a href="here link" class="s-fn-sub-item-link" title="qa community home">qa community home</a> </li> <li class="s-fn-promo-sub-menu-item"><a href="/community" class="s-fn-sub-item-link" title="commun...

Actionscript 3: Align MC to MC Inside MC Cords -

okay trying stage movie clip instance align (x,y) x, y cords of movie clip instance inside of movie clip instance (a little confusing). stagemc.x = targetmc.subtargetmc.x; stagemc.y = targetmc.subtargetmc.y; so on event (mouse click example), want x, y cords of 'stagemc' instance align x, y cords of 'subtargetmc' sits inside of movie clip called 'targetmc'. the movie clip 'subtargetmc' sits inside of primary 'targetmc' instance copy of library mc , has instance name indicated. i did not find solution in forum nor anywhere else online. end resolving myself (as do) wanted use stackoverflow resource. thanks use localtoglobal() convert coordinates. var globalcoordinates:point = targetmc.subtargetmc.localtoglobal(new point()); stagemc.x = globalcoordinates.x; stagemc.y = globalcoordinates.y;