Posts

Showing posts from June, 2011

javascript - Background color for ionic toggle and range -

Image
i using ionic make mobile app. want add background toggle button , range. used toggle/range-background-dark. did not work <ion-toggle toggle-class="toggle-balanced toggle-background-dark" ng-model="check"> 33 </ion-toggle> <div class="item range range-balanced range-background-dark"> <i class="icon ion-ios-sunny-outline"></i> <input type="range" name="volume" min="0" max="100" ng-model="rv"> <i class="icon ion-ios-sunny"></i> </div> you can change toggle button , range background color using css .toggle input:checked + .track { background-color: #8577b5; border-color: #8577b5; } .range.range - balanced input::-webkit - slider - thumb: before { background: #8577b5;} .range.range-light input::-webkit-slider-thumb:before { background

javascript - Cookies or session variables that record user preferences for the whole site -

i'm trying setup cookies or session varibles make user preferences on website remain on every page of site, , i'm attempting using javascript, i'm open trying code works. i want make onclick user options stay active user on every page of website session. if navigate page 2, choice of layout page 1 remembered , remains active on page 2. what i'm building ereader on website, want user have ability change font size, change background color , change text width suit preference. i've got working, when click next page, settings clear, , have set them again. want site remember choice whole session on site or length of time if that's possible. i'm new javascript (it's first day writing any), code below might shockingly bad. i don't know if need use cookie or session variable, fixes i've found either don't work, or aren't meant purpose, can't use them. in code i've created inside 'story' div changes when user clicks on

php - Just for learning, should I write my own framework without any components or tools, or just read the source code of an open source framework? -

i want understand how frameworks work. should make own framework scratch without using open source components or tools composer or phpunit .. etc. or read source code of open source framework symfony or laravel .. etc. and should try not use composer , phpunit (for autoloading , testing)? me in learning process? a question - why want , how php know? a framework tool - idea is abstracts away (boring , mundane stuff) can more productive - in other words, idea don't need know how works or why works - makes life easier. the frameworks relatively lightweight in not make page slower while, @ same time, increasing development throughput. now obviously, need know framework in order use it, don't need know how works in detail , , guess question sits - why bother learning unless planning on making own framework or going customize - plan? regardless, if underlying goal learn more php, not need frameworks. now, stack overflow - instead of me asking questions in ans

scrollview - Single word per line in kivy(GridLayout) -

i'm trying make app similar menu. did scrollview gridlayout, don't know how show separate, instance, in left column names, , in right column age, in way app may have variable number of rows (infinity). hope have been less confusing possible, same english. everybody, didn't post code here because think isn't necessary. bye, have day. ass important post code here, i'm going try post. i'm sorry mistakes indent. .py class primeiroscreen(screen): def __init__(self, **kwargs): self.name = 'home' super(screen,self).__init__(**kwargs) class segundoscreen(screen): text = stringproperty('') def __init__(self, **kwargs): self.name = 'dois' super(screen,self).__init__(**kwargs) class rootscreen(screenmanager): pass class scrollmanageapp(app): def build(self): return rootscreen() if __name__ == '__main__': appvar = scrollmanageapp() scrollmanageapp().run()

c++ - MSVC 2015 SFINAE Failing To Find Proper Member Function -

using msvc 2015, have basic code follows: class setter { public: void set(int value) {} template <int size> void set(int value[size]) {} }; it doesn't seem matter setters do, left them blank. however, if attempt use array version of set follows: int data[128]; setter setter; setter.set(data); i receive following compile-time error: error c2664 : 'void setter::set(int)' : cannot convert argument 1 'int [128]' 'int' according rules of sfinae, shouldn't there exist member function signature matches setter class? template set , seems, should match along lines of template<> void setter::set(int value[128]) {} can deduced. there rule prohibits code compiling in standard, or msvc doing wrong? thanks! edit really, need solution here. if can't point me answer in standard knows work around, i'm receptive that. solution: template <int size> void set(int (&value)[size]) {} you can't

javascript - Mixing react code with jQuery -

i have table checkbox on each row allow user select rows. in head of table have checkbox supposed toggle on/off or checkboxes in table. to achieve i'm using jquery inside componentdidmount method have strange feeling i'm doing things wrong...that react can this. since i'm @ start of react learning needed ask guys if can little more elegantly. here's code: class products extends component { componentdidmount() { const dispatch = this.props.dispatch; dispatch( asyncgetproducts() ); // not sure following part var self = this; $( '.proucts tbody tr' ).click( function() { $( ).find( '.checkbox' ).checkbox( "toggle" ); } ); $( '.proucts * .ui.checkbox' ).checkbox( { onchecked: function( el ) { if( $( ).attr( 'name' ) == "toggle_select_all" ) { $( '.proucts * .ui.checkbox' ).checkbox

php - Laravel Postgis generate Point object -

i developing system laravel framework using postgres database postgis. database has table geometry field (3d point). need convert 3 dimensions point object , point objects 3 dimensions. i searched laravel postgis library , found laravel-postgis , developed 2d point , has no support 3d points. therefore decided use directly or develop convert function in php using in laravel. some code tried insert new data directly : $arr = ['geometry' => "st_pointfromtext('point(' || " . input::get('latitude') . " || ' ' || " . input::get('longitude') . " || ' ' || " . input::get('altitude') . " || ')', 4326)"]; location::where('id','1')->update($arr); the sample initialize of $arr variable st_pointfromtext('point(' || 1 || ' ' || 1 || ' ' || 1 || ')', 4326) it's found in this link but laravel debug got errors me : pdo

r - Choropleth or Thematic map creation from number of points within Shapefile polygon -

i have geocoded data points (.csv) , shapefile (tigerline) read r , maps overlaying points (locations) on polygons (counties) under same projection using plot() , add=. i trying find way map number of points found in each polygon (county). assume choropleth or sort of thematic map. associating shapefile , points throwing me loop. and if can't tell, both r , spatial analysis newbie i have gotten far: count1<-table(epoints.spdf$county.name) count1 count2<-as.data.frame(count1) count2 county$count<-count2 merge(count2$freq, county$count, = c('var1', 'county.name')) error in fix.by(by.x, x) : 'by' must specify uniquely valid columns var1 freq 1 amelia 7 2 caroline 33 3 charles city 1 4 chesterfield 209 5 colonial heights 26 6 dinwiddie 23 7 goochland 15 8 hanover 84 9 henrico 241 10 ho

r - Transpose / reshape dataframe without "timevar" from long to wide format -

i have data frame follows below long pattern: name medname name1 atenolol 25mg name1 aspirin 81mg name1 sildenafil 100mg name2 atenolol 50mg name2 enalapril 20mg and below (i not care if can columns named way, want data in format): name medication1 medication2 medication3 name1 atenolol 25mg aspirin 81mg sildenafil 100mg name2 atenolol 50mg enalapril 20mg na through site have become familiarish reshape/reshape2 package, , have went through several attempts try work have far failed. when try dcast(dataframe, name ~ medname, value.var='medname') bunch of columns flags of medication names (values transposed 1 or 0) example: name atenolol 25mg aspirin 81mg name1 1 1 name2 0 0 i tried dcast(dataset, name ~ variable) after melted dataset, spits out following (just counts how many meds each person has): name medname name1 3 name2

swing - java Checker board issues -

Image
so have program asks user number of rows , columns , makes checker board issue works odd numbers if user put in 9 , 9 again display checkered board if number inputted shows columns of white , black import javax.swing.*; import java.awt.*; public class checkers { public static void main(string[] args) { jframe thegui = new jframe(); thegui.settitle("checkers"); string inputstr = joptionpane.showinputdialog("number of rows"); if (inputstr == null) return; int rows = integer.parseint(inputstr); inputstr = joptionpane.showinputdialog("number of columns"); if (inputstr == null) return; int cols = integer.parseint(inputstr); thegui.setsize(cols * 50 , rows * 50); thegui.setdefaultcloseoperation(jframe.exit_on_close); container pane = thegui.getcontentpane(); pane.setlayout(new gridlayout(rows, cols)); (int = 1; <= rows * cols ;i ++) {

ios - Call order of performActionForShortcutItem vs applicationWillEnterForeground -

so, have app has server state, , refresh timeout value , checking timeout in applicationwillenterforeground , reloading if timeout has expired. has worked until now. i want implement new force touch shortcut action performs server operation. however, don’t want status-fetch operation happen @ same time shortcut action. not problem when app launched through shortcut, when transitioning inactive -> active, end starting 1 server operation in applicationwillenterforeground , , in performactionforshortcutitem , not optimal. what i'm after potentially refresh state if app not (re)launched result of force touch press. i thought solve bool, “ishandlingshortcut” set in performactionforshortcutitem , check in applicationwillenterforeground , , in case skip refresh - turns out doesn’t work since applicationwillenterforeground called first! is there any way can find out i’ve (re)launched app via shortcut in applicationwillenterforeground ? edit: perhaps move "refresh&

python - Rotation of AVL tree nodes does not work -

i trying write avl tree in python rotation doesnt work becase cannot swap "self" node other. there way fix it? think doing in java or c way not correct... class sentinel(object): value = left = right = none height = -1 sentinel = sentinel() #singleton of sentinel node class node: def __init__(self, data, left=sentinel, right=sentinel, height=0): self.data = data self.left = left self.right = right self.height = height def addnode(self, data): if self.data == data: #return when node duplicated return isleft = self.data > data child = self.left if isleft else self.right if child sentinel: if isleft: self.left = node(data) else: self.right = node(data) else: child.addnode(data) if abs(child.right.height - child.left.height) == 2: print("rebalancing after inserting", data) ''' need balance subtree'

css - angular, background image and background position -

i'm struggling add additional background styles using ng-style . idea of trying make grid of speakers using ng-repeat , each grid element having it's own image of speaker. fine, except want images background , , while can image reflect can't add css background-position & background-size . basics of doing here , issue i've tried using inline styles unsuccessfully: code: <div class="grid" ng-repeat="speaker in home.speakers"> <div class="grid-image" ng-style="{'background':'url({{speaker.img}})' 'center center' '/' 'cover'}"></div> <span class="caption"><h3>{{speaker.name}}</h3></span> </div> i've played single quotes every imaginable way, still console error has no idea trying do. i've tried setting background size , background position in separate class, doesn't work because image isn't declared

javascript - Height Percentage, responsive -

i have ton of different divs on website, finished width part, setting kind of different calculated widths , percentage of width. anyhow i'm onto height of different divs , , can't seem use height percentage work on following div showed on image: http://i.imgur.com/rjfanqp.jpg i want reach bottom , no further, website fit different browsers. if set divs height predetermined height:500px , fits charm on chrome, won't fit charm in firefox, or if re-size browser window. appreciated.

javascript - Does defining a frequently used string as a variable improve performance? -

this question has answer here: do common javascript implementations use string interning? 2 answers in languages, used strings defined variables/constants, called instead of literal strings. same javascript? in particular, have frequent use of string 'none' . instead of writing literal 'none' everywhere in code, improve performance if define: var none = 'none'; and use none everywhere in code? or, there way intern literal string expression evaluated once? literal strings automatically interned javascript compilers. var = 'hello' , var b = 'hello' pointing @ same copy of 'hello' string in memory, no need further optimization on part. the way make sure different string objects created same string value defining each 1 via string global object, i.e.: var = new string('hello'); var b = new str

c# - Trying to bind data from sql query to view for a dropdown -

my sample code : model hold list items: public ilist<listitem> listofrecords { get; set; } populating model in controller: public actionresult index() { var model = new viewmodel(); model.listofemployees = getallrecordsfromdatabase(); return view(model); } my view: <select data-bind="options: optionvalues, selectedoptions: selectedoptionvalues"></select> knockout code populating dropdown: function donotcallmodel(optionvalues, selectedoptionvalues) { var self = this; self.optionvalues = ko.observablearray(optionvalues); self.selectedoptionvalues = ko.observable(selectedoptionvalues); return self; } @foreach (var item in model) { <text> model.contactusers.push(new contactmodel('@item.id', '@httputility.javascriptstringencode(item.insertrequestedbyemployee)', '@httputility.javascriptstringencode(item.phonenumber)', &

java - :app:compileDebugUnitTestJavaWithJavac FAILED Android Studio -

i have searched degree on stack overflow etc try find answer question. have far been unable find solution works specific problem. up until 5th of february, when ran command: .\gradlew test the command complete , build successful. today (7th), pulled changes teams remote repo. when ran command below output: :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72311library up-to-date :app:preparecomandroidsupportdesign2311library up-to-date :app:preparecomandroidsupportrecyclerviewv72311library up-to-date :app:preparecomandroidsupportsupportv42311library up-to-date :app:preparecomjourneyappszxingandroidembedded310library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets up-to-date :app:generatedebugresvalues up-to-date

Python - editing my range to print certain strings -

i'm trying edit code produce 10 lines. first line starts @ 0 , last ends @ 9. each line contains string of 10 integers 0 being first , in successive order. have produced following , cannot life of me figure out next. for in range(10): in range(10): print(i,end=' ') print('\n') which output 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 if you're trying make each line 0 0 0 0 0 0 0 0 0 0, , on, problem reusing variable loops: for in range(10): j in range(10): print(i,end=' ') #now 0 first line, 1 next, , on print('\n')

javascript - Google Maps Multiple Markers. What is wrong with my code? -

so have code below. doesn't show when run it. white blank page on browser. should googlemap markers(multiple) on it. want know wrong code because doesn't show error @ all. <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>google maps multiple markers</title> <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> </head> <body> <div id="map" style="width: 500px; height: 400px;"></div> <?php include 'location.php';?> <script type="text/javascript"> var locations = <?php echo json_encode($location); ?>; var map = new google.maps.map(document.getelementbyid('map'), { zoom: 10, center: new google.maps.latlng(6.40, 125.60), mapty

javascript - Inserting image to SAP HANA Table using XSJS -

i know known issue i'm having difficulty on fixing problem. seems don't receive ui5 application when sent image via fileuploader server. new hcp , first time handling xsjs file. hope can me. ui5.controller.js sap.ui.define([ "sap/ui/core/mvc/controller" ], function(controller) { "use strict"; return controller.extend("sample.controller.view1", { handleuploadpress : function(oevent) { var fileloader =this.getview().byid("fileloader");//xml view var filename = fileloader.getvalue(); jquery.sap.require("sap.ui.commons.messagebox"); if (filename === "" ) { sap.ui.commons.messagebox.show("please choose file.", sap.ui.commons.messagebox.icon.information, "information"); } else { var uploadurl = "https://xxxxxx/services/sample.xsj

android - Saving fragment state on navigating up -

situation : starting host activitya/fragment a, click on button start host activityb/fragment b. fragment b fragment enables filtering options fragment a. after selecting options, user can press navigate button return fragment a. problem : i state of options selected retained when navigating fragment b more once. since filtering option, preferable not save in storage beyond duration of application (it's filtering. not necessary keep information stored long time. in between navigation). things i've tried : onsavedinstancestate - realized onnavigateupto() / finish() don't trigger onsavedinstancestate android:launchmode="singletop" - because activity finished , destroyed backstack, no instance of activity available receive new intent. setretaininstance - activity destroyed attached fragment destroyed. a possible solution i've found use setresult , return values fragment a. put these values extras new intent when starting fragment b again. solu

python - py2exe the following modules appear to be missing -

as title says, when i'm trying use py2exe create windows executable file, error: the following modules appear missing ['carbon', 'carbon.files', 'elementc14n', 'openssl.ssl', '_frozen_importlib', '_imp', '_scproxy', '_sysconfigdata', 'backports.ssl_match_hostname', 'builtins', 'certifi', 'charade.universaldetector', 'configparser', 'datrie', 'genshi.core', 'html', 'html.entities', 'html.parser', 'http', 'http.client', 'http.cookies', 'http.server', 'importlib.machinery', 'importlib.util', 'ipaddr', 'ipaddress', 'java', 'lzma', 'ndg.httpsclient.ssl_peer_verification', 'ndg.httpsclient.subj_alt_name', 'netbios', 'ordereddict', 'org.python.modules.posix.posixmodule', 'packages.six.moves', 'packages.ssl_match

c++ - HTTP request in DLL returns nothing -

i'm trying request dll (which hooked program) no matter try, hangs. i tried use curl , winhttpclient. both did same thing differently. curl made program hang long time , displayed nothing (that code isn't commented , contains code other stack overflow questions.) winhttpclient returns nothing. // dllmain.cpp : defines entry point dll application. #include "stdafx.h" //#include "winhttpclient/winhttpclient.h" #include <windows.h> #include <iostream> #include <stdio.h> #include <curl/curl.h> using namespace std; // fix later static size_t writecallback(void *contents, size_t size, size_t nmemb, void *userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } extern "c" __declspec(dllexport) void quack(); __declspec(dllexport) void quack() { /*winhttpclient client(l"http://www.google.com"); client.setuseragent(l"mozilla/4.0 (compatible; msie 8.

sql - Perform COUNT based on data from two tables -

i still new sql, , performing basic functions challenging, apologize if basic question. i have several tables 2 being customer , orders. need count of how many orders each customer has placed. trying code , fails: select customer.firstname || ' ' || customer.lastname customer, count(orders.orderid) orders customer inner join orders on customer.customerid = orders.customerid group customer; can tell me correct statement? the query want looks this: select c.firstname || ' ' || c.lastname customer, count(o.orderid) numorders customer c left join orders o on c.customerid = o.customerid group c.firstname || ' ' || c.lastname; notes: table aliases make query easier write , read. oracle doesn't support column aliases in group by . need repeat expression (or use subquery or cte). if want customers, use left join include customers, no orders. edit: the answer question in comment: select c.firstname || 

c# - How to add Page Indicator to FlipView? UWP -

currently i'm developing uwp app. want design welcome page when user opens app first time. i want use flipview control display multiple pages. don't have idea how use flipview control , how add page indicator it. can give me example of blank flipview control page indicator? thank you! not sure asking for, little sample create flipview 3 pages , page indicator under show index of page. <grid background="{themeresource applicationpagebackgroundthemebrush}"> <stackpanel> <flipview x:name="flipviewfun" height="300"> <flipviewitem> <textbox text="hello world" /> </flipviewitem> <flipviewitem> <textbox text="sweet" /> </flipviewitem> <flipviewitem> <textbox text="ok" />

java - selenium click link href with javascript -

i newbie java , selenium. having issue in clicking link javascript in href. below page source: href="javascript:navigatetodifftab('https://site_url/medications','are sure want leave page without saving changes?');" tabindex="-1">medications please note: replaced actual url "site_url" because of business concerns. i tried below code did not work: driver.findelement(by.cssselector("a[href^='javascript:navigatetodifftab'][href$='site_url/medications']")).click(); i not want use id or linktext changes different environments , languages. any appreciated. use below code. working fine me:- webelement element= driver.findelement(by.cssselector("a[href^='javascript:navigatetodifftab'][href$='site_url/medications']")) javascriptexecutor executor = (javascriptexecutor) driver; executor.executescript("arguments[0].click();", element); if above code not work

extjs - Json data is not populated in treeview panel -

here below json formate need show in treeview panel in extjs6 after loading store server not able see records in tree panel. should model view , store json rendering in tree view panel . thanks. here code : model : ext.define('file', { extend: 'ext.data.treemodel', fields: [ {number: 'number', type: 'string'}, ] }); store : var store = ext.create('ext.data.treestore', { model: 'file', proxy: { type: 'ajax', url: 'component-tree.json', reader: { type: 'json', rootproperty: 'components', leaf: true, children: 'components', expanded: true, }, }, foldersort: true, }); view : var tree = ext.create('ext.tree.panel', { autoload: true, collapsible: t

xcode - Podfile PXGoogleDirections and GoogleMaps conflicting names -

i'm trying install new pod (pxgoogledirections) existing xcode project had googlemaps pod installed. platform :ios, '8.0' use_frameworks! target 'roadtrip' pod 'googlemaps' pod 'pxgoogledirections' end target 'roadtriptests' end target 'roadtripuitests' end when run "pod install" i'm getting error: "[!] 'project' target has frameworks conflicting names: googlemaps." any idea how can fix that? i've tried use same googlemaps version pxgoogledirections uses, so: pod 'googlemaps', '1.10.4' but i'm getting same error. thanks help. this because pxgoogledirections bundled googlemaps . in documentation of pxgoogledirections says way use googlemaps it. check if app requires google maps ios sdk, might run troubles because of conflicts bundled google maps ios sdk in cocoapod. if happen face these problems, please try following: add -fra

php - error: mysqli prepared insert statement -

i have table tag. in table there 2 fields id & tag . using mysqli prepared statement insert in db. here codes. $search='test'; // prepared query $result = $mysqli->prepare("select tag tag tag= ?"); $result ->bind_param("s", $search); $result->execute(); $result->store_result(); $result->bind_result($search); while ($result->fetch()) { $tag = $tag; } if($result->num_rows != 1){ echo "test"; $result1 = $mysqli->prepare("insert tag (tag) values (?)"); $result1 ->bind_param("s", $search); $result1->execute(); $result1->store_result(); if($result1->affected_rows == 1){ //$res['success'] = true; $data[] = "added successfully"; }

java - how can i use two diffrent string value with same name in String.xml? -

i want have 2 kind of message types example ironic , official. when user selected ironic message show in ironic way , when user select official messages show in official way. want 2 string value type same name different value in string.xml. want select type used in program when app run. there other way that. help. you cannot have 2 different strings same key or name in string.xml you can make app_name , app_name_1 ironic , official , whenever official append _1 string

asp.net - SEO friendly dynamic url in c# -

i search google many times didn't suitable result that.. i have dynamic url in c# http://192.168.10.120:81/imgdetails.aspx?id=5702&icod=100-106083 title of image man having breakfast i want url following example http://www.alamy.com/stock-photo-senior-man-looking-out-over-hopi-point-grand-canyon-arizona-focus-73496317.html so can rewrite dynamic url same please help. if using asp.net version 4 or above following might help. https://code.msdn.microsoft.com/easy-steps-to-url-2f792901

css - Reverse states on hover with Less -

i have following less code: .favourite-action-link { &:after { color:@grey; content: '\e836'; } &.is-favourite:after { color:@red; content: '\e811'; } &:hover { &:after { color:@red; content: '\e811'; } &.is-favourite:after { color:@grey; content: '\e836'; } } } with essential goal being there normal state , hover state, reversed when class present. i'll repeating other actions (eg .share-action-link , .review-action-link etc) , seems messy way have it. there way create mixin such provide so: .favourite-action-link { &:after { color:@grey; content: '\e836'; &:hover { color:@red; content: '\e811'; } .reverseonclass(is-favourite); } } or that? way can think of far do: .favourite-action-link

linux - Pthread Mutex lock unlock by different threads -

a naive question .. i read before saying - " a mutex has unlocked thread locked it. " but have written program thread1 locks mutexvar , goes sleep. thread2 can directly unlock mutexvar operations , return. ==> know why doing ?? question - right behaviour of mutex ?? ==> adding sample code void *functionc() { pthread_mutex_lock( &mutex1 ); counter++; sleep(10); printf("thread01: counter value: %d\n",counter); pthread_mutex_unlock( &mutex1 ); } void *functiond() { pthread_mutex_unlock( &mutex1 ); pthread_mutex_lock( &mutex1 ); counter=10; printf("counter value: %d\n",counter); } int main() { int rc1, rc2; pthread_t thread1, thread2; if(pthread_mutex_init(&mutex1, null)) printf("error while using pthread_mutex_init\n"); if( (rc1=pthread_create( &thread1, null, &functionc, null)) ) { printf("thread creation failed: %d\n", rc1); }

build - Android: Execution failed for task ':dexDebug' -

i facing problem when change targetsdk version 21 23. after changing , build gradle, when try run application getting error error:execution failed task ':dexdebug'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.8.0_66\bin\java.exe'' finished non-zero exit value in lib folder have library called org.apache.http.legacy this library added when change sdk version 21 23 , because in 23 depricated. sync: ok make project: ok clean: ok run: error my gradle file is buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' } } apply plugin: 'android' dependencies { compile filetree(dir: 'libs', include: '*.jar') compile 'com.android.support:appcompat-v7:23.1.1' compile('com.android.support:support-v4:21.0.3') { exclude module: 'suppo

java - the number of iterations of >>>> "for(int i=start;i<num;i++)" i -

i'm talking loops in form for(int i=0;i<5;i++) i expecting increment statement done after check , think wrote programs depending on concept . the problem when tried run code `for( int = 0; i<5; i++) { system.out.println(i); } i surprised find doesn't include 5 output 0 1 2 3 4 i'm confused think statments must executed @ order write i<=5 : for( int = 0; i<=5; i++) { system.out.println(i); } output: 0 1 2 3 4 5

ios - Check date format style in Objective-C -

how can check date in format getting response api , in getting dates converting date string according format confusion getting date in 2 format, yyyy-mm-dd't'hh:mm:ss.sss , yyyy-mm-dd't'hh:mm:ss include sss , not, kindly tell me how can first check date format style , use date format according that. here following using code converting string desired format. nsstring *datestr = @"2016-01-18t13:28:06.357"; nsdateformatter *formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss.sss"]; nsdate *date = [formatter datefromstring:datestr]; looking response. initially check like nsdate *date; nsdateformatter *formatter = [[nsdateformatter alloc] init]; // check 2016-01-18t13:28:06.357 [formatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss.sss"]; // returns date , date = [formatter datefromstring:datestr]; // check if date empty or if(date == nil) { // add date format

artificial intelligence - Line of Sight Algorithm for Graph/Tree search -

i implemented bresenham's line algorithm in python identifying occupancy of grids between noted list of grid cells grid world (say [(1,1), (3,2),(5,6),(8,4) in 10x10 grid world occupied grids) , applied line of sight algorithm check if can skip vertex list in order reduce total distance. but how can line of sight graph based search ? wonder how can represent tree/graph nodes represented grid cells in coordinate form (x,y) ? suggestions/ideas highly appreciated.

c++ - Eclipse Errors - FRC - Windows -

Image
i having issues. trying run frc plugins in eclipse. program executed test program. goal able deploy not seem work. what these errors , why getting them? thanks, base2101 if going create arcade drive command, suggest starting template included in plugins. go create new project instead of doing normal way, click other , click either c++ or java wpi development folder. click robot java project or robot c++ project. after that, folders , classes done you. to create arcade drive class, need right click on commands folder , create new class, , again go new>other>wpilib robot c++/java deveopment>command. to see full tutorial, see page here .

ember.js - Ember sort by attribute on relationship -

in application, user can related user , , relationship status can either accepted , pending , declined , , no relationship. in database, have users table, , relationships table. users table - id relationships table - id - from_user_id - to_user_id - status in ember, how can users , sort relationship status ?

syntax - Clojure — Meaning of pound symbol?` -

in om next quick start, use #js , #uuid . pound symbol here mean? link: https://github.com/omcljs/om/wiki/quick-start-(om.next)#components-with-queries--mutations snippets: #js : (defui counter static om/iquery (query [this] [:count]) object (render [this] (let [{:keys [count]} (om/props this)] (dom/div nil (dom/span nil (str "count: " count)) (dom/button #js {:onclick (fn [e] (om/transact! '[(increment)]))} "click me!"))))) #uuid : (om/from-history reconciler #uuid "9e7160a0-89cc-4482-aba1-7b894a1c54b4") commonly found in edn , clojurescript use of # called tagged literal . @ example, user=> (java.util.date.) #inst "2014-05-19t19:12:37.925-00:00" when create new date represented tagged literal, or in case tagged string. can use clojures read-string read (or use directly) user=> (type #inst "2014-05-19t19:12:37.925-00:00"

How can I detect whether a user deletes the Telegram Bot chat? -

is possible check, via api, whether has deleted bot chat in telegram? my test : if user deletes chat, new messages not stop sending user. nope. getting error while sending user something. even calling sendchataction method not return error if user blocked chat: $ curl https://api.telegram.org/bot***/sendchataction -d 'chat_id=7975895' -d "action=typing" {"ok":true,"result":true} $ curl https://api.telegram.org/bot***/sendmessage -d 'chat_id=81083738' -d "text=ololo" {"ok":false,"error_code":403,"description":"[error]: bot blocked user"}

Button action event in swing java not working?And code queries -

Image
please have patience read query thank you:) this code below have generated in gui form(using swing awt) code work read text files folder , repeated words count , save specified folder. save files .xls import java.io.*; import java.nio.charset.charset; import java.nio.charset.standardcharsets; import java.nio.file.files; import java.nio.file.paths; import java.util.arraylist; import java.util.collections; import java.util.comparator; import java.util.hashmap; import java.util.list; import java.util.map; import java.util.set; import java.util.stringtokenizer; import java.util.map.entry; public class maxoccurrence2 { final static charset encoding = standardcharsets.utf_8; public map<string, integer> getwordcount(string filename) { fileinputstream fis = null; datainputstream dis = null; bufferedreader br = null; map<string, integer> wordmap = new hashmap<string, integer>(); try { fis = new fileinputstream(filename); dis = new datainputstrea