Posts

Showing posts from August, 2012

.net - c++/cli ref class and dynamic allocation using handles? -

in .net's version of c++, can declare class in following way: ref class coolclass { public: string^ getname() { return name;} void setname(string^ n) {name = n;} private: string^ name; } when create class way, instances of class created , managed on managed heap clr's garbage collector. now, lets created 2 instances of animal class. animal cat; animal ^dog = gcnew animal(); both of these classes operate same. there real important difference between creating instances of classes 1 way or other? both should managed code right? first way seems easier , prevents me having use "->" operator. the first syntax called stack semantics . simulates stack allocation in standard c++. upon leaving scope, including when exception raised, object automatically disposed. nice syntactic convenience, under hood both objects instantiated on managed heap. use first syntax disposable types only, such database connections. as d...

asp.net - DropdownList Selected Value as Parameter for another DropdownList -

i'm having bit of difficulty trying accomplish goal here, i have 2 dropdowns, i'd able change values available within dropdown_objective according selected value within dropdown_parent. these dropdowns contained within templatefield, <asp:gridview id="gridview1" runat="server" allowpaging="true" allowsorting="true" pagesize="20" autogeneratecolumns="false" datakeynames="visitobjectivekey" onsorting="gridview1_sorting" onpageindexchanging="gridview1_pageindexchanging" width="100%"> <columns> <asp:templatefield headertext="parentid" sortexpression="parentid"> <edititemtemplate> <asp:dropdownlist id="updparentid" runat="server" width="100%" skinid="-1" cssclass="text ui-widget-content ui-corner-all" appenddatabounditems="true...

How to test registration pages in Protractor, with multiple browsers? -

i'm trying use multicapabilities define multiple browser drivers, when try running test registrates same user in different browsers, first browser tries register returns error (user exists). is there way run parallel e2e tests in protractor information cannot duplicated (like user name, user e-mail , such)? i found way test them, creating different configs each browser , defining different params (like user name) each of them. there better way of doing this? you might @ answer help: how can use command line arguments in angularjs protractor? i think can on per-browser basis in config, should able pass in different usernames , passwords way.

Heroku CLI error -

unable use heroku cli anymore: error installing heroku toolbelt v4... done. more information on toolbelt v4: https://github.com/heroku/heroku-cli setting node-v4.1.1... ! rename c:\users\me\appdata\local\heroku\tmp\download200968087\file c:\users\me\appdata\local\heroku\node-v4.1.1-windows-x86\bin\node.exe: access denied. error loading plugin commands error loading plugin topics error loading plugin commands i reinstalled git heroku toolbelt. ran git bash admin. im on windows 8.1 delete executable under c:\users\me\appdata\local\heroku\node-v4.1.1-windows-x86\bin\node.exe , should able proceed. this permission error. environment under script runs doesn't have permission delete file. you, however, do.

sql server - Port Error While Connect MSSQL with Android Device? -

i developing software , work in android. also, android app, i'm developing windows app , need connect mssql server. i configure sql server , can connect sql server windows app , android emulator. can't connect sql server real android device. app throwing error; "network error ioexception: failed connect /'my computer static ip' (port 1433): connect failed: econnrefused (connection refused)" already i'm setup 1433 port sql server, can't connect. please me... why can connect emulator can't connect real android device? thanks answer. have day.

javascript - Why do we recycle table view cells in iOS or Domain Objects in html? -

when write ios application, way new table view cell recycle disappeared cell , repopulate it. similarly, when implement infinite scroll in javascript, recycle top object , repopulate bottom. what's reasoning behind that? why can't remove old 1 , insert? tradeoffs?

jquery - Iterate over javascript object such that key variables are used as methods to call the object -

right i'm hard-coding new properties javascript application , horrible code smell don't know better when comes javascript implementation. code looks now: $.getjson(url, function(data) { $("#total_population_2013").html(data.table.total_population_2013); $("#median_age_2013").html(data.table.median_age_2013); //etcetera, long time might add }); its ruby openstruct object converted json i'm sending getjson method. trial , error solution, can access properties shown above. i'm add many more variables i'll writing html id tags, , prefer more professional manner. here i've tried far not working: $.getjson(url, function(data) { for(var k in data) { var value = data[k]; var id_str = "#"+k; $(id_str).html(value); }); } thanks i notice 2 things. 1 for..in iterates on properties of object, can include stuff gets prototype chain. typically not want, want instead: for(var k in data) if (data.haso...

php - Yii2 - How to pass 'isNewRecord' to custom form? -

i have custom form createadminform admin in backend can create new admin user. created own form model can handle passsword. fill out username, nicename, email, password, select status (active, banned, deleted), , choose role (root, super, admin). enter password normal, , custom form encrypts it. - have checks root can create anything, super can create regular admins, , regular admins can not create other admins @ all. i had working on last project, bypassed isnewrecord because created forms in respective view files (create.php , update.php) instead of them both using same _form.php file. isn't big deal, follow way yii things , _form.php file handling forms again, if possible. since using own model createadminform instead of admin model (which spin off of user ), not have access isnewrecord . how can _form.php use isnewrecord custom createadminform model? truncated createadminform: class createadminform extends model { public $nicename; public $usernam...

php - How to handle drop down list -

i trying make code work using drop-down list. possible strip_tags not work drop down list? if 1 can me helpful html <!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> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <script src="spryassets/spryvalidationselect.js" type="text/javascript"> </script> <link href="spryassets/spryvalidationselect.css" rel="stylesheet" type="text/css" /> </head> <body> <span id="spryselect1"> <label> <form method="post" action="b.php"> <select name="s" id="s"> <option value="friends" selected>friends</option...

how to access to the php content of a html tag in jQuery? -

this question has answer here: what difference between client-side , server-side programming? 4 answers i know how access php content of html tag in jquery. explanation below: this html code: <div id="edittitle" title="editing title"> <b><?php $id="a"; ?></b> </div> and jquery code: $("#table_child_title").on("click", ".editlink", function(event){ var string2=$("#edittitle" ).children('b').contents(); alert(string2); }); what want when executing line alert(string2); alert window shows me between <b> , </b> . in other words, shows message below: <?php $id="a"; ?> is possible in jquery? if yes, wrong in code , right one? thanks in advance. first must echo php variable: <div id="edittitle" title...

How to access Azure Webjobs log using C# -

i have azure webjob running on scheduled basis , need access run logs , output of each run. i bumped kudu api, couldn't go further not sure credentials pass web request. sample code: private static void getapidata2() { string url = "https://mywebsite.scm.azurewebsites.net/azurejobs/api/jobs"; webrequest request = webrequest.create(url); request.contenttype = "application/json"; request.method = "get"; //your azure ftp deployment credentials here request.credentials = new networkcredential("what should go here?", "and here?"); webresponse response = request.getresponse(); console.writeline(response.tostring()); } i 401 unauthorized if use azure administrator account. what username , password should use authenticate? please take @ this page understand kind of credentials can pass these apis.

View Gradle dependency tree in Eclipse -

Image
is possible visualize dependency tree inside of eclipse (e.g. output of gradle dependencies )? expanding gradle dependencies tree in eclipse flat view , not show dependencies other projects (e.g. if have dependency compile project(':project2') , none of project2's dependencies shown). based on this looks tree view not supported? basically i'm looking equivalent of in maven plugin: at time of writing, neither spring eclipse integration gradle nor buildship provide dependency hierarchy view know m2e. i don't know when has been implemented can gradle dependencies either on command-line or via buildship gradle tasks view within eclipse. prints nice dependency tree of project's dependencies console.

c++ - Right aligning money_put results -

i'm trying c++ library generate formatted usd output ($ sign, commas every 1000s place etc). i'm close, cannot right alignment work: #include <iostream> #include <iomanip> #include <locale> using namespace std; int main() { double fiftymil = 50000000.0; // 50 million bucks locale myloc; const money_put<char>& mpus = use_facet<money_put<char> >(myloc); cout.imbue(myloc); cout << showbase << fixed; cout << "a"; cout.width(30); cout.setf(std::ios::right); mpus.put(cout, false, cout, ' ', fiftymil * 100); // convert cents cout << "b" << endl; return 0; } i'm getting: a$50,000,000.00 b i want get: a $50,000,000.00b any ideas why isn't working? i'm using latest solaris compiler (12.4) update: seems issue c++ libraries included solaris compiler. workaround used: ...

What a git SHA depends on? -

i wondering on parameters git sha depends on ? guessing there other parameters timestamp etc., besides content of commit, on construction of sha depends on. i interested in such parameters on depends on. interested in situation when such parameters same, or enforced same resulting in same git sha of 2 commits made 2 persons on planet. for commit, id depends on checksums of @ least ... the tree (all files , directories) id made of... the content of files, not diff, called blob. the directory tree (names of files , directories , how they're organized). the permissions of files , directories. the parent commit id(s). the log message. the committer name , email , date. the author name , email date. if change commit commit id changes. including parent commit ids important. means 2 commits same content, built on different parents, still have different ids. why that? means if id of 2 commits same know entire history same. makes very efficient compare , upd...

r - How to show standard deviation using googleVis -

i trying show standard deviation using googlevis , going use intervals chart . surprise have not found in googlevis 0.5.10. is there way still intervals chart in googlevis? or other way show standard deviation recommend? thank you. intervals not supported, can show standard deviation using annotations capabilities of google charts, googlevis support. more information here: https://cran.r-project.org/web/packages/googlevis/vignettes/using_roles_via_googlevis.html

jdbc - Eclipselink generated SQL with ROWNUMBER, which is not recognized by SQLServer -

i using eclipselink connect different dbs. , run same query against db2 , sqlserver. query runs on db2 failed on sqlserver. here error message: internal exception: com.microsoft.sqlserver.jdbc.sqlserverexception: 'rownumber' not recognized built-in function name. error code: 195 call: select * (select * (select el_temp.*, rownumber() over() el_r ownm (select t0.eval_id a1, t0.eval_typ_id a2, t0.create_datetm a3 , t0.eval_desc a4, t0.eval_name a5, t0.revision_nbr a6, t0.update_datet m a7, t1.logicl_db a8, t1.query_string_hash a9, t1.query_string_txt a10 eval t0, sql_eval t1 ((t0.eval_name = ?) , ((t1.eval_id = t0.ev al_id) , (t0.eval_typ_id = ?))) order t0.revision_nbr desc) el_temp) el_temp2 el_rownm <= ?) el_temp3 el_rownm > ? bind => [ba-td.lodg_rm_night_trans_fact.price_amt_local_with_oms, 1, 1, 0] i think query generated eclipselink since original query simple. question is, sqlserver cannot recognize 'rownumber' how change 'row_nu...

php - Delete Individual Conversations Between Users -

i have created private message system social media network users, similar facebook. pretty much, want work facebook... click on user , view conversation, , able delete conversation user. i tried several ways, , first php script deletes private coversations, between users they've had conversation instead of individual conversations... here's php deletes conversations: <?php error_reporting(0); include "assets/includes/config.php"; $conn=mysql_connect($sql_host,$sql_user,$sql_pass); mysql_select_db($sql_name,$conn); $query1=mysql_query("delete messages timeline_id='".$_request['timelineid']."'"); $query1=mysql_query("delete messages recipient_id='".$_request['timelineid']."'"); header("location:index.php?tab1=messages"); ?> but, said, need way user delete individual conversations, tried doing way, doesn't work: here's php: <?...

javascript - Get column name from JSON -

i have following sample json , name of column dribbble, behance ... { status: 200, success: true, result: [ { dribbble: 'a', behance: '', blog: 'http://blog.invisionapp.com/reimagine-web-design-process/', youtube: '', vimeo: '' }, { dribbble: '', behance: '', blog: 'http://creative.mailchimp.com/paint-drips/?_ga=1.32574201.612462484.1431430487', youtube: '', vimeo: '' } ] } i'm using request module , returns json fine i'm struggling column name in string format. if column in number format @ least, able know if it's right column 2 0s instead. request({ url: url, json: true }, function (error, response, body) { if (!error && response.statuscode === 200) { callback(body) var json = body.result; (var key in json) { if (json.hasownproperty(key)) { ...

powershell - Create Function Parameter Accept Wild Cards -

i have function writing , create wild card process on wmi call. wondering options might be. first thought take parameter value sent , replace asterisk percent signs , have case statement use query string depending on if need use like statement or not. on complicating , there simpler way have not found? here top portion of function so [cmdletbinding()] param( [parameter(mandatory=$false,valuefrompipeline=$true,valuefrompipelinebypropertyname=$true)][string]$name = "", [parameter(mandatory=$false,valuefrompipeline=$true,valuefrompipelinebypropertyname=$true)][string]$computername = $env:computername, [parameter()][string]$port = "", [parameter()][switch]$full ) process { if($computername.trim()) { try { $printers = (get-wmiobject -query "select * win32_printer portname '%$port%' , name '%$name%' " -computername $computername -enableallprivileges -erroraction stop) this kind of trying no avail. we clear clutt...

javascript - Is there a way to do partial parsley.js validations? -

i creating page long form i'd have 2 action buttons: 'save' , 'submit'. 'save' identical 'submit' except run subset of built-in parsley validations, namely 'required' , 'pattern'. parsley documentation doesn't seem address this. parsley allow this, or there elegant work-around? idea far run validations on page, use css hide irrelevant error messages, , consider form 'validated' long there no error messages regarding subset of validations i'm testing for 'save'. there no way run subset of validation types parsley. you should consider removing , adding data-attributes other validations want before , after save?

android - Bar status not changing color and ActionBar good practices -

i'm quite new in world of android, , i'm not sure how modify action bar. in case, main activity has framelayout switch between fragments navigation drawer. i've seen there several ways change actionbar parameters, i'm not quite sure 1 best. i'm using far change actionbar (and fragment) following: @targetapi(build.version_codes.honeycomb) public void displayview(int position) { // update main content replacing fragment fragment fragment = null; imageview imageview = new imageview(getsupportactionbar().getthemedcontext()); imageview.setscaletype(imageview.scaletype.center); switch (position) { case 0: imageview.setimageresource(r.drawable.ic_launcher); getsupportactionbar().setbackgrounddrawable(new colordrawable(getresources().getcolor(r.color.main_menu))); fragment = new seccion1mainmenu(); break; case 1: imag...

c# - How to allow project referencing my DLL to use a newer version of a DLL my project references? -

i have written dll references entity framework version 5. packaged nuget package has dependency on entity framework >= 5. when install package project has reference entity framework 6 there no complaints dependency crashes runtime saying cannot find entity framework 5 dll. the reference has specificversion set false in dll's project , have tried adding bindingredirect in web.config of project references dll, still error occurs. any idea how can work or missing here?

mysql - Im getting an error when creating my database (#1064) -

i trying create database using phpmyadmin keep on getting error #1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near ') not null,first name varchar(30) not null,last name varchar(30) not' @ line 3 im using tomcat version 8.0. below query executing create table `cs485_lab5`.`orders` ( `item number` varchar(20) not null, `price` double(10) not null, `first name` varchar(30) not null, `last name` varchar(30) not null, `shipping address` varchar(50) not null, `credit card` varchar(20) not null, `ccn` int(16) not null, primary key (`credit card`) ) engine = innodb; don't specify length double . also, if designing table, don't put spaces in column names. use names don't need escaping. having use escape characters clutters queries unnecessarily. so: create table orders ( `itemnumber` varchar(20) not null, `price` double not null, `firstname` varc...

ruby on rails - How can I clobber factory girl associations? -

i have factory generated: factorygirl.define sequence :account_login |n| "login-#{ n }" end factory :account sequence :email |n| "someone#{n}@gmail.com" end email_confirmation { |account| account.send :email } url { faker::internet.url } login { generate(:account_login) } password { faker::internet.password } password_confirmation { |account| account.send(:password) } current_password { |account| account.send(:password) } twitter_account 'openhub' name { faker::name.name + rand(999_999).to_s } about_raw { faker::lorem.characters(10) } activated_at { time.current } activation_code nil country_code 'us' email_master true email_kudos true email_posts true association :github_verification end end what need create second factory creates user nil github_verification attribute. something this: factory :account_with_no_verifications, parent: :acc...

multiplechoicefield - How to save ModelMultipleChoiceField in Django view? -

i have subject model , customuser model. during registration users can select multiple subjects. following code in forms. forms.py class signupform(forms.form): ... subjects = forms.modelmultiplechoicefield(label="subjects", widget=forms.checkboxselectmultiple, queryset=subject.objects.all()) what can in views.py save data? usual method of cleaning data , using save method doesn't work unfortunately. scarily, similar questions have little no answers in so. nevermind. found it. if password == password2: u = customuser.objects.create_user(username, email, password, first_name=fname, last_name=lname, dob=year+'-'+month+'-'+day) u.subjects = subjects u.save i made mistake of trying squeeze in subjects in create_user method other variables.

How to use script to build IntelliJ Idea project to a jar -

i have created intellij idea (community edition) java project. project quite simple. contains main() method, uses 2 jars dependencies. created artifact project build jar. my question there way build jar using script? because want add build process existing build script. thanks idea doesn't code on own, counts on default tools provided sdk. in short, need javac , jar packaging.

header - C - Using .h files -

i'm in process of learning c coursework assignment. 1 thing confuses me header files. i've tried find information regarding question no avail. my question is, have 3 different .c files. convention (atleast reading sources) - each .c file has it's own .h file, e.g. parser.c has parser.h, lexer.c has lexer.h, typechecker.c has typechecker.h (if making compiler). we go on add statement: #include "parser.h" #include "typechecker.h" in lexer.c file, , same other .c files (changing header files include). instead of using convention, okay add prototypes 3 classes files 1 header, header.h, , include in 3 classes ? problem 3 classes have prototypes of functions included in class, don't see problem (i'm beginner @ c wrong). thanks. what suggest permissible not recommended. having prototypes in 1 header cost in terms of compilation , building. try concentrate on "why header files used?". if answer refrain adding in 1 hea...

angularjs - Angular-Formly: How to put an input- sm class in field -

how set class .input-sm in field using angular-formly? ex.: <input class="form-control input-sm" name="test" type="text" placeholder=".input-sm"> here go . use ngmodelelattrs property: { key: 'yourkey', type: 'input', ngmodelelattrs: { class: 'form-control input-sm' // <-- it! }, templateoptions: { label: 'input' } }

notepad++ - A Regex that search for lines that contains a string, and not contains another string -

i want analyze error log. decided search error header in error log using notepad++ can first line of errors on search result (which contains short description error) determine if need deeper it. error log apparently full of 'useless' error log 1 kind of event, 90% of it, kinds of hide real error, searching needle in haystack. so example made error log: error on server1: network connection reset. detail: client gone. error on server2: network connection reset. detail: client gone. error on server1: network connection reset. detail: client gone. error on server1: null pointer error. detail: object 'cart' not exists. stacktrace: @ updatecart function @ addproducttocart function error on server2: network connection reset. detail: client gone. error on server2: io error detail: resource on url (www.example.com/data.xls) not exists. error on server2: network connection reset. detail: client gone. i want create regex o...

html - Adding a column to a Navbar Dropdown -

i add column academic affairs can have 2 groups of 4 links adjacent each other have failed @ every attempt. appreciated. </button><div class="navbar navbar-inverse"> <div class="navbar-header"> <button <a href="#" class="navbar-brand">ibhe</a> </div><!--enf of navbar-header --> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="active"><a href="#"><span class="glyphicon glyphicon-home">home</a></li> <li><a href="#" class="dropdown-toggle" data-toggle="dropdown">executive director's corner</a> <ul class="dropdown-menu"> <li><a href="#">meet dr. james applegate</a></li> <li><a href="#">blog</a...

php - Get record from current post -

i trying value of meta_value field current post. <?php $cupost = $post->id; $registros = $wpdb->get_results( 'select meta_value auto_postmeta post_id = $cupost , meta_key="mg_game"'); echo $registros[0]->meta_value . "<br/>"; ?> it not shows echo $registros . but if put directly on query number of post ( post_id = 7 ), shows value of meta_value . thy out: <?php $cupost = $post->id;//first check if variable gets id, echo $cupost variable check. $registros = $wpdb->get_results( "select meta_value auto_postmeta post_id = ".$cupost." , meta_key= 'mg_game' "); echo $registros[0]->meta_value . "<br/>"; ?> you have concatenate query string php variables

c# - Button with onserverclick will not response -

i have code in aspx: <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">project name</a> </div> <div id="navbar...

C evaluating a recursive sequence - expected expression error -

i'm trying code recursive sequence values n = 60. know x0 = 1. xn+1 = 2^(n+1) * (sqrt( 1 + 2^-n*xn) - 1) so far have int main () { // first term x0 = 1 double xn = 1; double x; double squareroot = 1 + (pow(2, -x) * xn); (x = 1; x <= 60; x++) { double xn = pow(2, x) * double sqrt(squareroot) - 1); printf("%f\n", xn); } } but expected expression error on line there double sqrt. as mentioned in other answers, code had syntax errors in line: double xn = pow(2, x) * double sqrt(squareroot) - 1); here parenthesis not balanced have 1 more ) ( . in addition cannot place double did (it not needed sqrt returns double ) below placed code comments of how interpreted equation along notes on found ambiguous how written: #include <math.h> #include <stdio.h> int main() { int n; // mentioned x0 1.0 , variable updated initialized 1.0 double x = 1.0; // goal: xn+1 = 2^(n+1) * (sqr...

scikit learn - Error while loading MNIST database in Python -

i'm trying work mnist handwritten digits database below 2 lines giving me error. going wrong?? from sklearn import datasets dataset = datasets.fetch_mldata('mnist original') the error getting followed: traceback (most recent call last): file "e:/hwrecognition/deep-belief-network-gpu-update/kk.py", line 5, in <module> dataset = datasets.fetch_mldata('mnist original') file "c:\python27\lib\site-packages\sklearn\datasets\mldata.py", line 142, in fetch_mldata mldata_url = urlopen(urlname) file "c:\python27\lib\urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) file "c:\python27\lib\urllib2.py", line 397, in open response = meth(req, response) file "c:\python27\lib\urllib2.py", line 510, in http_response 'http', request, response, code, msg, hdrs) file "c:\python27\lib\urllib2.py", line 429, in error result = self._call_chain(*arg...

python - How can i use custom function in class based views -

i have view class userview(genericapiview): def get(self, request, format=none, **kwargs): pass def post(self, request, format=none, **kwargs): pass this works fine url url(r'^user$', userview.as_view(),name='user'), but want have custom url def custom(): pass i want url(r'^user/custom/$', userview.as_view(custom),name='user'), how can that you can't this. from django.conf.urls import url django.views.generic import templateview urlpatterns = [ url(r'^about/', templateview.as_view(template_name="about.html")), ] any arguments passed as_view() override attributes set on class. in example, set template_name on templateview. similar overriding pattern can used url attribute on redirectview. if want 'custom' url, use functions based views urls url(r'^user/custom/$', custom, name='user'), views def custom(request): # ...

visual studio - Should I deploy a neutral app bundle or x86, x64, ARM separately? -

Image
when creating release build windows 8 app, should use neutral appx? or should use app bundle x86, x64, , arm separately? what difference? pros/cons? if app using c++ dlls example sqlite need deploy each version separately. otherwise can release anycpu version. note in uwp app (win 10) there no longer cpu option.

loops - print empty asterisk triangle c -

so i've looked , found normal triangles questions out there. 1 bit tricky. given n, program should create asterisk unfilled triangle n side size. example 1 inform n: 1 * example 2: inform n: 2 ** * example 3: inform n: 3 *** ** * example 4: inform n: 4 **** * * ** * example 5: inform n: 5 ***** * * * * ** * here's attempt, make filled triangle inefficiently void q39(){ int n,i,b; printf("inform n: "); scanf ("%i",&n); ( = 0; < n; ++i) { printf("*"); ( b = 1; b < n; ++b) { if (i==0) { printf("*"); } else if (i==1 && b>1) { printf("*"); } else if (i==2 && b>2) { printf("*"); } else if(i==3 && b>3){ printf("*"); } else if(i==4 && b>4){ printf("*"); ...

Undocumented Wunderlist update user endpoint -

there appears endpoint on wunderlist api updating wunderlist user (at https://a.wunderlist.com/api/v1/user ) not appear in official docs user information can updated sending put request it, e.g. : curl \ -h "x-access-token: $wl_access_token" \ -h "x-client-id: $wl_client_id" \ -h "content-type: application/json" \ -xput -d '{"revision":1234,"name":"some-name"}' \ https://a.wunderlist.com/api/v1/user assuming data valid, returns http 200 . is endpoint supported?

Geocoder.getFromLocationName does not work for intersection address -

i trying use geocoder class in app , found geocoder.getfromlocationname returns null if address intersection of 2 streets. ex. "quail ave , dunford way, sunnyvale, ca 94087" . however, method works perfect other type address. during debug session, see address parameter passed , reflects correctly, "geocodematches" returns size(0) zero. appreciate help!! public static list<address> getgeocode(@nonnull context context, @nonnull string address){ try { geocodematches = new geocoder(context).getfromlocationname(address, 1); if (!geocodematches.isempty()) { return geocodematches; } } catch (ioexception e) { log.e("error", "error retrieve geocode" + e); e.printstacktrace(); } return geocodematches; } geocoder working on networklocationservice. in cases, networklocationservice stopped working due reason. don't know exact reason. can address google api ...

"git svn" command fails with error "git: 'svn' is not a git command. See 'git --help'." -

i trying execute command on redhat 6.5 box , throws error "git: 'svn' not git command. see 'git --help'." have git 1.7.1 installed on box. please help. git svn clone http://yourcompany.com/path/to/svn/project-abc project-abc you need have git-svn package installed (this separate package).

c# - NotSupportedException in creation of xps file -

i'm trying create xps file out of documentviewer: microsoft.win32.savefiledialog dlg = new microsoft.win32.savefiledialog(); dlg.filename = "myreport"; // default file name dlg.defaultext = ".xps"; // default file extension dlg.filter = "xps documents (.xps)|*.xps"; // filter files extension // show save file dialog box nullable<bool> result = dlg.showdialog(); // process save file dialog box results if (result == true) { // save document string filename = dlg.filename; fixeddocument doc = (fixeddocument)documentviewer.document; xpsdocument xpsd = new xpsdocument(filename, fileaccess.readwrite); system.windows.xps.xpsdocumentwriter xw = xpsdocument.createxpsdocumentwriter(xpsd); xw.write(doc); xpsd.close(); } but throws following exception in xw.write(doc) : bitmapmetadata not available on bitmapimage either way, creates xps file in don't see (of course) following message: this page cannot ...

java - IllegalArgumentException using Java8 Base64 decoder -

i wanted use base64.java encode , decode files. encode.wrap(inputstream) , decode.wrap(inputstream) worked runned slowly. used following code. public static void decodefile(string inputfilename, string outputfilename) throws filenotfoundexception, ioexception { base64.decoder decoder = base64.getdecoder(); inputstream in = new fileinputstream(inputfilename); outputstream out = new fileoutputstream(outputfilename); byte[] inbuff = new byte[buff_size]; //final int buff_size = 1024; byte[] outbuff = null; while (in.read(inbuff) > 0) { outbuff = decoder.decode(inbuff); out.write(outbuff); } out.flush(); out.close(); in.close(); } however, throws exception in thread "awt-eventqueue-0" java.lang.illegalargumentexception: input byte array has wrong 4-byte ending unit @ java.util.base64$decoder.decode0(base64.java:704) @ java.util.base64$decoder.decode(base64.java:526) @ base64coder....

Gradle build failing due to dependency issues -

we have declared ojb:db-ojb:1.0.4 required compiling our project , getting below issue , searching dependency commons- transaction:commons-transaction:1.1 , have org.apache.commons.transaction:commons-transaction:1.1 in archiva. check , let know how can avoid checking dependency commons-transaction or other solutions handle in gradle: [04:14:17][gradle failure report] > not resolve commons-transaction:commons-transaction:1.1. [04:14:17][gradle failure report] required by: [04:14:17][gradle failure report] com.e2open.e2mc:iome:8.2 > ojb:db-ojb:1.0.4 [04:14:17][gradle failure report] > not resolve commons-transaction:commons-transaction:1.1. [04:14:17][gradle failure report] > inconsistent module metadata found. descriptor: org.apache.commons.transaction:commons-transaction:1.1 errors: bad group: expected='commons-transaction' found='org.apache.commons.transaction'

scala - sbt-assembly: Merge Errors - Deduplicate -

i getting these errors using sbt assembly . i using spark seems @ root of problem. val spark = seq( "org.apache.spark" %% "spark-core" % sparkversion, "org.apache.spark" %% "spark-sql" % sparkversion, "org.apache.spark" %% "spark-streaming" % sparkversion ) error: [error] 12 errors encountered during merge [trace] stack trace suppressed: run last corebackend/*:assembly full output. [trace] stack trace suppressed: run last core/*:assembly full output. [trace] stack trace suppressed: run last commons/*:assembly full output. [error] (corebackend/*:assembly) deduplicate: different file contents found in following: [error] /volumes/coyote/developer/tibra/lib_managed/jars/org.osgi/org.osgi.core/org.osgi.core-4.3.1.jar:osgi-opt/bnd.bnd [error] /volumes/coyote/developer/tibra/lib_managed/jars/org.osgi/org.osgi.compendium/org.osgi.compendium-4.3.1.jar:osgi-opt/bnd.bnd [error] deduplicate: different file contents foun...

php - PDO update query runs changes no rows. No errors -

so i'm running pdo update working, , reason won't update table... $business_id = 9874128; $hidden = 1; $query = "update business_property_overrides set hidden=? business_id=?"; try { $stmt = $pdo->prepare($query); $stmt->execute(array($business_id, $hidden)); } for reason won't update, though no errors. existing tables schema looks this, , data is: there existing data set business_id = 9874128 , hidden set 0, won't update when run above code. create table `business_property_overrides` ( `business_id` int(11) not null, `id` int(11) not null auto_increment, `name` varchar(512) not null, `apt_type` varchar(25) default null, `apt_num` varchar(9) default null, `street_address` varchar(255) default null, `city` varchar(255) default null, `state` varchar(255) default null, `zip` varchar(25) default null, `phone` varchar(11) default null, `url` varchar(512) default null, `hours` varchar(100) default null, `openh...

ios - Change UISearchBar Cancel button to icon -

Image
i want change uisearchbar 's cancel button 1 has image, , no text. here's got far original behaviour to this a step in right direction, problem button wide. when debug view, can see has button label insets of 11 points on left , right. does know how make button fit content size? image square. here's code customising button: uibarbuttonitem *barbuttonappearanceinsearchbar; if (ios9) { barbuttonappearanceinsearchbar = [uibarbuttonitem appearancewhencontainedininstancesofclasses:@[[uisearchbar class]]]; } else { barbuttonappearanceinsearchbar = [uibarbuttonitem appearancewhencontainedin:[uisearchbar class], nil]; } barbuttonappearanceinsearchbar.image = [uiimage imagenamed:@"close"]; barbuttonappearanceinsearchbar.title = nil; another weird issue when dismiss search bar , activate again, button image turns dark (it's still there, can see when debugging views), looks this any idea how keep icon white? tried method below, without ...