Posts

Showing posts from September, 2011

iOS - Facebook getting all events just by url -

iOS - Facebook getting all events just by url - my aim ios app load events facebook. i'd collect url's events , set them database. app should take url's , load content. my approach app/server recognizes event-id url , load them via facebook sdk. sdk work need access token, right? that token can code here: getting events facebook page it great if guys can tell me work or have improve ideas? thanks much , best regards germany, chris ios facebook facebook-graph-api

stored procedure sql server 2008 -

stored procedure sql server 2008 - i working on project , using stored procedure. i'm getting error: line: 939 error: sys.webforms.pagerequestmanagerservererrorexception: invalid object name 'it_assets'. transaction count after execute indicates mismatching number of begin , commit statements. previous count = 0, current count = 1. please find below stored procedure code: alter procedure [itassets_sp_it_assets] -- add together parameters stored procedure here (@mode varchar(12)='add', @id integer , @assetcode nvarchar(20)=null, @description nvarchar(70)=null, @site nvarchar(10)=null) begin if @mode='add' begin begin tran insert [it_assets] ([id] ,[assetcode] ,[description] ,[site]) values (@id, @assetcode, @description, @site ) if @@error <> 0 rollback tran else commit tran select @id end else begin begin tran update [

c# - defining order of elements inside the code -

c# - defining order of elements inside the code - using visual c# defining set of button , set of richtextbox within code (not visually) , here output. i want alter order of elements such richtextbox above button (unlike image behind button). how can programmatically ? just bringtofront: richtextbox rtb = new richtextbox() { ... }; // ... rtb.bringtofront(); or senttoback: rtb.sendtoback(); c# visual-studio

Exception when run the code collect tweets in java -

Exception when run the code collect tweets in java - this question has reply here: java.lang.noclassdeffounderror main (wrong name : com/leslie/quiz/main) 1 reply i used next code collect tweets. when compile there no error. when compile programme shows exceptions. package com.crowley.simplestream; import twitter4j.filterquery; import twitter4j.status; import twitter4j.statusdeletionnotice; import twitter4j.statuslistener; import twitter4j.twitterstream; import twitter4j.twitterstreamfactory; import twitter4j.user; import twitter4j.conf.configurationbuilder; import twitter4j.stallwarning; public class simplestream { public static void main(string[] args) { configurationbuilder cb = new configurationbuilder(); cb.setdebugenabled(true); cb.setoauthconsumerkey("*********************"); cb.setoauthconsumersecret("

java - Scanner class skipping over code -

java - Scanner class skipping over code - so have method isn't complicated @ all, seems skipping on 2 lines of code in while loop have. have tried do-while , normal while loop, neither of help. here code: { system.out.println("enter building material add together :: "); string first = keyboard.nextline(); system.out.println("how many of material add together ::"); int sec = keyboard.nextint(); int = (int)item.getid(first); //long section of code here. it's not necessary system.out.println(""); system.out.println("lumber - " + lumber); system.out.println("plywood - " + plywood); system.out.println("cinderblocks - " + cinder); system.out.println("mortar - " + mortar); system.out.println("tank traps - " + tanktrap); system.out.println("metal poles - " + metalpol

jquery - Audio playback in Safari iOS with HTML 5 -

jquery - Audio playback in Safari iOS with HTML 5 - i'm having problem getting sound tag play on safari ios. i'm trying play file using sound tag. next code works on safari mac chrome android. aware of 'bandwidh conservation' in ios requiring user interaction initiate download have overcome calling next code click interaction callback. $("#myspinner") instance of spin.js (http://fgnass.github.io/spin.js/) library this.audioelement = $('#myaudio'); this.audioelement.empty(); var currenttrack = // .. track backbone model ....... var source = $('<source></source>', { type: 'audio/mpeg', src: currenttrack.get('url'), }).appendto(this.audioelement); this.audioelement.appendto('#container'); console.log("added new track sound tag"); // $("#myaudio")[0].load(); $("#myaudio").on('canplay', function() { $("#myaudio")[0].play(); $("

How to get a document in mongodb only if at least 3 columns have non null values -

How to get a document in mongodb only if at least 3 columns have non null values - i have collection in mongodb pupil attributes id, name, standard, marks, average. want write query documents @ to the lowest degree 3 attributes contain non-null values. all documents contain non null value in (name, standard, marks) or (name,marks,average) or (name,standard,marks,average) or (id, name, standard, marks, average) should printed. if document contains (name,standard) non null or (standard,marks) should ignored. i have said given "students" documents this: class="lang-js prettyprint-override"> { name: "a", standard: "b", marks: 10 }, { name: "b", marks: 5, average: 2 }, { id: 2, name: "c", marks: 10, average: 7 }, { name: "c", standard: "b" }, { standard: "c", marks: 3 } then "ideally" this: class="lang-js prettyprint-override"> db.students.find({

java - Add user input data to an ArrayList and display it into a Jtable using custom a Tablemodel -

java - Add user input data to an ArrayList and display it into a Jtable using custom a Tablemodel - i'm having problems getting updated , displayed array list of people(phonebook contacts). seek add together user input info array list using jbutton , displayed in jtable. i appreciate if can tell me if there design or implementation problem. give thanks in advance suggestions! here part of code custom table model package cartedetelefon.gui; import static cartedetelefon.cartedetelefon.listacontacte; import cartedetelefon.exceptii.exceptiecontactdejadefinit; import cartedetelefon.nrtel; import javax.swing.event.tablemodelevent; import javax.swing.event.tablemodellistener; import javax.swing.table.abstracttablemodel; public class tblmodel extends abstracttablemodel implements tablemodellistener{ nrtel[] contacte = new nrtel[0]; @override public int getrowcount() { homecoming listacontacte.size(); } @override public int getcolumncount() { homeco

internet explorer - Primefaces 4.0 - jquery.js "Member not found" error on IE11 -

internet explorer - Primefaces 4.0 - jquery.js "Member not found" error on IE11 - when browse primefaces application on net explorer 11, getting error "member not found". when debug web site, exception thrown on jquery.js.jsf, line: 25, column 37861 . why error? showing correctly on mozilla firefox's , chrome's latest versions. jquery internet-explorer jsf-2 primefaces

json - Using Python to PUT PMML -

json - Using Python to PUT PMML - i have simple pmml file put scoring server. here curl call: curl -x set --data-binary @decisiontreeiris.pmml -h "content-type: text/xml" http://localhost:8080/openscoring/model/decisiontreeiris here pmml file: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <pmml xmlns="http://www.dmg.org/pmml-4_1" version="4.1"> <header copyright="copyright (c) 2013 vfed" description="rpart decision tree model"> <extension extender="rattle/pmml" name="user" value="vfed"/> <application name="rattle/pmml" version="1.2.34r27"/> <timestamp>2013-05-15 22:02:28</timestamp> </header> <datadictionary numberoffields="5"> <datafield name="species" optype="categorical" datatype="string"&g

lua - Cannot 'gotoscene' with Corona SDK -

lua - Cannot 'gotoscene' with Corona SDK - i have tried, tried , tried. cannot work. all have main.lua button in it. want go about.lua. my main.lua is: local function about(event) storyboard.gotoscene( "about", {"fade", 500} ) homecoming true end local = widget.newbutton { top = 280, width = 320, height = 66, defaultfile = "about.png", overfile = "aboutdown.png", onrelease = } and about.lua is: local storyboard = require ( "storyboard" ) local scene = storyboard.newscene() local widget = require ( "widget" ) local background = display.newimage( "logo.png" ) background.x = display.contentcenterx background.y = display.contentcentery please help! if @ storyboard api see template code need utilize create scene, re-create template code about.lua , include actual code in createscene function, should work. first step: cr

c++ - Does instantiating a template instantiate its static data members? -

c++ - Does instantiating a template instantiate its static data members? - with regard explicit instantiation (iirc used when template declare in header , defined in cpp file because otherwise linker not able find when using somewhere else), if template has static fellow member variable, explicit instantiation instantiate , create static fellow member variable? if explicitly instantiate class template, non-template members instantiated, including static info members long have definition. example: template <typename t> struct foo { static int static_data; void non_template_member() {} template <typename s> void template_member(s) {} }; template <typename t> int foo<t>::static_data = 0; template struct foo<int>; template struct foo<double>; the explicit instantiations @ bottom create definitions static_data , non_template_member() types int , double . there won't definition template_member(s) still open

Sitecore Alias refuses to work -

Sitecore Alias refuses to work - i've inherited sitecore project , added new alias set of existing aliases on item within content tree. however, although can visit older aliases of new aliases seem not work , lead 404. i've tried publishing content items , system/aliases still reject work. am missing obvious? several things preventing aliases working, of depend on setup of system: verify aliases published. this, switch on web db , check see if aliases configured appear, expected. if not published, sure run publish on aliases folder (i suggest republish, safe). if after aliases not working , still not published, seek running total site republish. if still won't publish, move on number 3, below if aliases aliases not working , published, seek rebuilding link database. if aliases still not working, move on numbers 2 , 4, below ensure each alias defined unique. note multi-site solution, beingness unique context site not plenty - if have alias d

hadoop - Sqoop export update only specified columns -

hadoop - Sqoop export update only specified columns - as far know, can update database using "--udate-key" argument. updates whole record key. can either insert or update "--update-mode allowinsert" or "--update-mode updateonly". for illustration have file consists of primary key , column values have update in table has other columns too. question is, can update particular column without updating other columns in table? must specify columns --update-key argument right? there solution or work around this? yes. using "--update-key" , "columns" arguments. example: $ sqoop export --connect jdbc:mysql://localhost/tgl --username root --password root --table staging --export-dir /sqoop/db1_result -m 1 -input-fields-terminated-by "," note: field specified in update-key must in columns argument hadoop sqoop2

java - Aligning buttons to the middle-right with GridBagLayout() -

java - Aligning buttons to the middle-right with GridBagLayout() - would align several buttons location on window gridbaglayout(), though gridbaglayout quite complex , i'm not sure how go this. how can create such layout? forgive me, had utilize ascii because not have plenty rep post image. mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm

regex - how to create mysql view with REGEXP -

regex - how to create mysql view with REGEXP - my table.value varchar. contains string '...totalvalue:xxxx,... . want create view extract xxxx from value` , convert number column of view. maybe this? create view v_data select value regexp `.*,totalvalue:(.*),.*` (1).tonumber totalvalue table; thanks much!!! if can create select gives right reply can create view of select. to extract parts of string utilize substr . find out start , end positions utilize in substr utilize locate ':' , ','. select substr(test, locate(':', test) + 1, locate(',', test) - locate(':', test) - 1) test; sqlfiddle mysql regex view

javascript - Chrome Apps, FileSystem API: chooseEntry method isn't working -

javascript - Chrome Apps, FileSystem API: chooseEntry method isn't working - edit: found error, can't solve it, see below. manifest.json { ... "offline_enabled": true, "app": { "background": { "persistent": true, "scripts": [ "/js/background.js" ] } }, "permissions": [ "notifications", "storage", {"filesystem": ["directory"]} ] } background.js chrome.app.runtime.onlaunched.addlistener(function() { window.open('/index.html'); }); index.html <!doctype html> <html> <head> <title>achshar player</title> <script src="/js/index.js"></script> </head> <body> <input id="input" type="button"> </body> &l

c# - Programs randomly getting System.AccessViolationException -

c# - Programs randomly getting System.AccessViolationException - okay have been having lot of issues debugging. i'm using vs2013 pro , windows 8.1. both date. issue is, when start debugging, half time throws error: an unhandled exception of type 'system.accessviolationexception' occurred in system.windows.forms.dll additional information: attempted read or write protected memory. indication other memory corrupt. its not code's fault either. made simple test illustration below. note not referencing system.windows.forms app. using system; using system.collections.generic; using system.linq; using system.text; namespace consoleapplication2 { class programme { static void main(string[] args) { list<int> testing = new list<int>(); for(int =0; < 50; i++) { testing.add(i); }

drag and drop - ExtJs: Use treeviewdragdrop and gridviewdragdrop together -

drag and drop - ExtJs: Use treeviewdragdrop and gridviewdragdrop together - i want utilize integrate 2 drag n drop features of extjs 4.1.1 i want drag nodes tree panel/grid tree grid. drag , drop feature should have flexibility of treeviewdragdrop wherein can drop node parent node. depth should matter. but since need display info in treegrid format, have utilize gridviewdragdrop. due mismatch between source , destination not able derive required functionality of two. here jsfiddle this: http://jsfiddle.net/atechiediary/6ad6b/2/ please help. change both ptypes 'gridviewdragdrop' , handle depth manually in plugin listener 'beforedrop' in viewconfig. viewconfig: { plugins: { ptype: 'gridviewdragdrop', dragtext: 'drag , drop reorganize' }, listeners: { beforedrop: function(node, data, overmodel, dropposition, drophandlers) { //handle depth manually here } } },

string - Lua gsub case and frontier pattern -

string - Lua gsub case and frontier pattern - using lua 5.1 , gsub function how implement case sensitive/case insensitive , frontier pattern matching alternative count substrings? countsubstring = function(s,ctrlid) --< s = string count local t = scintilla.gettext(ctrlid) if findreplace.findcase == 0 --< no case if findreplace.findwhole == 0 --< no whole word local _,count = string.gsub(t,s," ") homecoming "found "..count .." occourances of "..s else --< whole word local _,count = string.gsub(t,s," ") homecoming "found "..count .." occourances of "..s end else --< case if findreplace.findwhole == 0 --< no whole word local _,count = string.gsub(t,s," ") homecoming "found "..count .." occourance

c# - How to set an icon for each object in TreeListView -

c# - How to set an icon for each object in TreeListView - i have icons should displayed in first column next name of rowobject. different pictures related different type of obects. part of code creates columns objects need. this.descriptiontview = new brightideassoftware.treelistview(); this.descriptiontview.canexpandgetter = x => { if ( ( x itreeviewitem ).items != null ) { homecoming ( x itreeviewitem ).items.length > 0; } else { homecoming false; } }; this.descriptiontview.childrengetter = x => ( x itreeviewitem ).items; var column1 = new brightideassoftware.olvcolumn( "", "part0" ); column1.aspectgetter = x => ( x itreeviewitem ).part0; column1.iseditable = true; var column2 = new brightideassoftware.olvcolumn( "", "part1" ); column2.aspectgetter = x => ( x itreeviewitem ).part1; column1.iseditable = true;

sql - Find duplicate records in MySQL for each customer ID -

sql - Find duplicate records in MySQL for each customer ID - i seek find duplicate records each customer. table: customers_points points_id + customers_id + points_comment 1 200 order: 5227 2 200 order: 5227 3 200 order: 5227 4 201 order: 7000 5 201 order: 7000 6 202 order: 6000 7 203 order: 8000 the result should this: customers_id + duplicate_rows 200 3 201 2 below current sql query(not accurate): select c.* `customers_points` c inner bring together (select points_comment `customers_points` grouping points_comment having count(customers_id) > 1) dup on c.points_comment = dup.points_comment c.points_date_added > '2014-04-01 12:01:00' grouping c.customers_id order c.points_date_added desc limit 100 select customers_id, count(points_com

ios - Converting NSString into NSDAte once again -

ios - Converting NSString into NSDAte once again - i have label : _labelcell.text = [2014-06-22 20:27:48 +0000]; what want convert string nsdate can format : eeee dd mm yyyy i seek : // convert date nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"yyyy-mm-dd't'hh:mm:ss'+0000'"]; nsdate *dte = [dateformat datefromstring:str]; nslog(@"date: %@", dte); but give me null nsdate can help me on little thing ? thank much. your date formatter expecting t in between date , time. returns null because there string has space instead of t . you're missing space before timezone. fix 2 issues, , should work: dateformat.dateformat = @"yyyy-mm-dd hh:mm:ss '+0000'"; beware might give wrong date, because of time zone issues. test out, , if doesn't work adjust accordingly dateformat.timezone = ... ios objective-c nsstring nsdate

javascript - How can I display HTML tags as Text using jQuery? -

javascript - How can I display HTML tags as Text using jQuery? - i trying display unrendered html code using class html , below jquery code. working every tag except tags <html> , <head> , <body> . there way these can displayed text? $(document).ready(function () { $('.html').each(function () { $(this).text($(this).html()); }); }); html code: <pre> <div class="html"> <html> <head><title>title</title></head> <body> <p>unrendred html</p> </body> </html> </div> </pre> expected content: <div class="html"> <html> <head><title>title</title></head> <body> <p>unrendred html</p> </body> </html> </div> actual content: <title>title</title> <p>unrendred html</p> your html inva

r - Create a new column whose formula depends on a cell value of another row -

r - Create a new column whose formula depends on a cell value of another row - how create new column formula depends on cell value of row x y z 1 1 10 2 2 20 3 3 30 4 b 1 40 this sample data. want final output follows x y z prevy 1 1 10 0 2 2 20 10 3 3 30 20 4 b 1 40 0 where prevy z value x=current_x_val , y=current_y_val-1 0 if not available. how accomplish this. my progress far : data[data$x == "a" & data$y==2-1,3] i manually come in values , prevy each row. how do rows in single shot ? or data.table solution (similar mrflick) faster big info set library(data.table) setdt(dat)[, prevy := c(0, z[-length(z)]), = x] r

C# WebService return json -

C# WebService return json - i need homecoming message web service bellow, has in json format. possible accomplish now? c# code: using system; using system.collections.generic; using system.linq; using system.web; using system.web.services; using system.web.script.services; namespace webapplication1 { [webservice(namespace = "http://tempuri.org/")] [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)] [system.componentmodel.toolboxitem(false)] [system.web.script.services.scriptservice] public class webservice1 : system.web.services.webservice { [webmethod] [scriptmethod(responseformat = responseformat.json)] public response helloworld() { response obj = new response { message = "no fromformat recieved.", success = false }; homecoming obj; } } public class response { public string m

html - How to apply css styles to a tag? -

html - How to apply css styles to a tag? - i have tag in html within <i> . applying styles <a> tags in html. separate <a> tag in <i> tag. how can it? a.acategory:link { color: #000000; font-family: arial; font-size: 12px; font-weight: bold; } a.acategory:visited { color: #999999; text-decoration: none; font-family: arial; font-size: 12px; font-weight: bold; } a.acategory:active { color: #000000; text-decoration: none; font-family: arial; font-size: 12px; font-weight: bold; } a.acategory:hover { color: #999999; text-decoration: none; font-family: arial; font-size: 12px; font-weight: bold; } a.asubcategory:link { color: #000000; text-decoration: none; font-family: arial; font-size: 11px; font-weight: bold; } a.asubcategory:visited { color: #999999; text-decoration: none; font-family: arial; font-size: 11px; font-weight: bold; } a.as

javascript - How to merge data across multiple objects -

javascript - How to merge data across multiple objects - example object: { people: [ { "name": "jimmy", "place": ["usa", "canada", "united kingdom"] }, { "name": "serena", "place": ["usa", "japan", "canada", "thailand"] }, { "name": "richard", "place": ["usa", "japan", "china", "united kingdom"] }, { "name": "rachel", "place": ["germany"] } ] } using object need display each place , names associated place this: usa jimmy, serena, richard canada jimmy, serena state of japan serena, richard thailand serena china richard united kingdom of britain and northern republic of ireland jimmy, richard federal republic of germany rachel here's current limited progress. i can'

objective c - Cannot click on TableView cell. (iOS, Custom cell implementation) -

objective c - Cannot click on TableView cell. (iOS, Custom cell implementation) - i have table view list of article titles. have implemented functions delete , archive articles swipes (left swipe - archive, right swipe - delete). works great (like application called "clear" on iphone). then, have been dragged cell (holding ctrl button) new view controller (where have label, imageview , textview) display article (push). however, somehow cells not clickable. can swipes no problem, cannot click , go next view controller. have used - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender setting info display. also, used tutorial configure cell. have included implementation well. suppose, problem, not know how code, configuring cell works. cause of such behaviour? give thanks you. the code inboxviewcontroller.m (the 1 has tableview): . . . #pragma mark view - (void) viewwillappear:(bool)animated { [super viewwillappear:animated]; [self.db ope

java - Remove " // TODO add your handling code here:" Comment from Netbeans Events -

java - Remove " // TODO add your handling code here:" Comment from Netbeans Events - this question has reply here: how can remove line “todo add together handling code here” in netbeans when add together new event swing component? 1 reply remove // todo add together handling code here: comment netbeans events i cleared comments in "generated method body" file. using template manager. not work please screen shot http://prntscr.com/3vzkj4 this done via templates in netbeans. start clicking on tools menu > templates. in tree shows can navigate appropriate template. select template wish change, click "open in editor". create changes , save. next time insert code netbeans utilize modified template. the reply came here how can remove line "todo add together handling code here" in netbeans when add together n

c# - What are the steps required in moving an existing VS2013 website solution to cloud services? -

c# - What are the steps required in moving an existing VS2013 website solution to cloud services? - we have developed , deployed several website solutions through visual studio. now, host these through web roles on azure cloud services. to host solution web role, process simple creating new windows azure cloud service in visual studio, importing related projects new asp.net web role? yes - add together azure cloud project solution , add together existing web project web role in cloud project. see how to: migrate , publish web application azure visual studio details. c# asp.net azure azure-web-roles azure-cloud-services

linux - How do I make my application installable via Yum package manager? -

linux - How do I make my application installable via Yum package manager? - i'm trying larn how build installer yum (as opposed apt, port, brew, etc). i can't seem find clear resources on this. steps need take own application? yum installing rpm packages repository. basically, need bundle app via rpm , publish in repository, folder accessed via http/ftp. the rather old documentation contains basic informations want read on yum repositories. the much more complicated process create installable rpm package, documented here. one simple way host own repository fedorapeople.org linux yum package-managers

How can I pass a variable to an AngularJs controller without creating a named property for it? -

How can I pass a variable to an AngularJs controller without creating a named property for it? - i have seen question after different - don't want have create named properties on service info want pass controller. i have service provides array of items, , each item in array, array. i pass main array root controller (or directive) using service, that's fine. after want iterate each item in array , create directive controller each item - how pass item nested controller? needs dynamic, obviously, because don't know number of items in array. if wrap nested controller in directive, can via directive's scope? edit: i need iterate items , pass each 1 nested directive or controller. can (in pseudo code)? <mydirective> <ng-repeat item in arrayofitems> <mynesteditemdirective> <mycontroller> angularjs

lua - Order of evaluation with mixed logical and relational operators? -

lua - Order of evaluation with mixed logical and relational operators? - what lua interpreting poorly formed look as? return 1 or 2 == 3 , 4 -> 1 it's not stepping through each operator left right: return (1 or 2) == 3 , 4 -> false is evaluating in reverse? you might used arithmetic operators having different precedences. example, if write 1 + 2 * 3 assumed multiplication comes before add-on in 1 + (2 * 3) instead of evaluating left right in (1 + 2) * 3 . these standard math precedences used in programming languages. notable counterexamples can think of smalltalk, evaluates left-to-right , languages forcefulness explicit precedence (lisp , forth). as relational , boolean operators, customary programming languages extend traditional arithmetic precedences cover operators in language. lua's total precedence table can found here: http://www.lua.org/manual/5.2/manual.html#3.4.7 or , < > <= >= ~= == .. +

c# - Turning off bundling and minification (WEBFORMS) -

c# - Turning off bundling and minification (WEBFORMS) - i have created new asp.net website test feature. want able dynamically command whether bundling/ minification can toggled @ runtime. of code self generated shown below except line turning off optimization. public static void registerbundles(bundlecollection bundles) { // added line turn off optimization. system.web.optimization.bundletable.enableoptimizations = false; bundles.add(new scriptbundle("~/bundles/webformsjs").include( "~/scripts/webforms/webforms.js", "~/scripts/webforms/webuivalidation.js", "~/scripts/webforms/menustandards.js", "~/scripts/webforms/focus.js", "~/scripts/webforms/gridview.js", "~/scripts/webforms/detailsview.js",

android - fetching contacts using background thread crashes the app -

android - fetching contacts using background thread crashes the app - i using background thread(asynctask) fetch contacts phone & send server using post request works 50 100 contacts crashed if contacts more 500 or 1000, there other way processing you should create service runs in background , pushes contacts server in batches. you can solve issue 3 steps: 1.create class extending intentservice , in onhandleintent() method , phone call function pushes contacts server. public class contactpushserive extends intentservice { @override protected void onhandleintent(intent intent) { pushcontacts(); } } 2.the function pushing contacts should create batches of contacts internally , force 1 batch @ time. can take batch size 50 contacts in 1 batch. public static void pushcontacts() { int batch_size = 50; //create getcontactsfromos() fetch os contacts list<contact> contact

onListItemClick of Android ListView - How to activate onListItemCLick and deactivate when needed? -

onListItemClick of Android ListView - How to activate onListItemCLick and deactivate when needed? - i have activity loads vouchers on server customer's phone. in activity, have 2 buttons. first button vouchers bought customer. sec list of available vouchers client can buy. now, problem is, need onlistitemclick list of available vouchers (when click on vouchers, have alternative buy). utilize listview listactivity . when set onlistitemclick , event apply bought vouchers well. how can somehow deactivate onlistitemclick event when customers view own vouchers , activate when customers choosing voucher buy? this code of 2 buttons: public void btn_own(view v){ if(!isconnected){ toast toast = toast.maketext(voucher.this, "cannot connect internet", toast.length_long); toast.show(); return; //finish(); } if(email.equals("")){ toast toast = toast.maketext(voucher

c++ - counting of references of an object -

c++ - counting of references of an object - i'm feeling confusion there way count reference of object of class? class { public : a(){} } int main() { obj; * ptr1 = &obj; * ptr2 = &obj; * ptr3 = &obj; } now how i'll able know object obj referenced 3 pointers. raw pointers not reference-counting. need either implement reference-counting smart pointer class yourself, or utilize existing one, such std::shared_ptr . shared_ptr allows access reference count use_count() fellow member function. for example: #include <memory> #include <iostream> class { public : a(){} } int main() { //dynamically allocate rather stack-allocate it, shared_ptr //try delete object when ref count 0. std::shared_ptr<a> ptr1(new a()); std::shared_ptr<a> ptr2(ptr1); std::shared_ptr<a> ptr3(ptr1); std::cout<<"count: "<<ptr1.use_count()<<std::endl; //count: 3 homecoming 0; }

java - Are ReadableByteChannel and WritableByteChannel a replacement of InputStream and OutputStream? -

java - Are ReadableByteChannel and WritableByteChannel a replacement of InputStream and OutputStream? - as far know, readablebytechannel , writablebytechannel nio bundle can considered replacement of inputstream , outputstream legacy io package. if fact, can used same i/o operations , more. nevertheless, still seem not much used. also, back upwards in popular libraries quite poor. example, guava team thinking dropping it. is there reason new code dealing i/o utilize streams respect channels? there historical context should not ignored. when nio introduced (back in java 1.4), lot of features missing , promise hand them in later not hold long time. recall in java 1.4 way filechannel first create fileinputstream , fileoutputstream , or randomaccessfile , invoke getchannel on it. thus, there no way write code using nio/channels without using older io/stream api. the first java version providing way create filechannel without using old api java 7. first versi

loops - Java StringBuilder how to not print "to" at the end -

loops - Java StringBuilder how to not print "to" at the end - my stringbuilder travelroute printing "destination1 destination2 destination 3 to", how can avoid getting "to" @ end of string? arraylist<string> itinerary = new arraylist<string>(); scanner kb = new scanner(system.in); string userchoice; string uppercase; while (true) { system.out.print("destination: "); userchoice = kb.next(); uppercase = userchoice.touppercase(); if (uppercase.equals("done")) { break; } else itinerary.add(userchoice); } stringbuilder travelroute = new stringbuilder(); (int count = 0; count < itinerary.size(); count++) { string uppercasedestination = itinerary.get(count).touppercase(); travelroute.append(uppercasedestination + " to"); } system.out.println(travelroute); two ways solve mutual problem: add "to" in front of terms, except first add after every

google app engine - Task Queues, Idempotence, and Objectify Transactions -

google app engine - Task Queues, Idempotence, and Objectify Transactions - the documentation gae's task queue api states: you can enqueue task part of datastore transaction, such task enqueued—and guaranteed enqueued—if transaction committed successfully. however, documentation datastore transactions states twice should create them idempotent whenever possible, , submitting task queue not idempotent. documentation objectify takes step further, explaining work must idempotent within transactions. so, there standard way handle combining these recommendations/requirements, or should roll own technique (perhaps using this)? there concern task can execute twice (or more) - queue provides "at to the lowest degree once" semantics not "exactly once" semantics. common. some operations easy create idempotent (eg, "set birthdate"). operations can hard create idempotent (eg, "transfer $5 business relationship account b").

javascript - Getting data from database to angular js -

javascript - Getting data from database to angular js - i'm new angular js , i've been learning codeschool. i have problem can't figure out how solve: want info php file i'm working on first wanted create short illustration because doesn't create sense me, , can never retreive info has php file angular controller. i have uploaded on jsfiddle can check out if want here's html, it's pretty basic: <div ng-app="app"> <div ng-controller="mycontroller c"> <h1>{{c.title}}</h1> <p>controller trial: {{c.content}}</p> </div> </div> and here javascript source: var app = angular.module("app", []); app.controller("mycontroller", ['$http', function ($http) { this.title = "my title"; var filecontent = "data should replaced"; $http.get("http://www.otherwise-studios.com/example.php")