Posts

Showing posts from May, 2015

ios - How to add an image for each customized annotation on MapView? -

ios - How to add an image for each customized annotation on MapView? - i have class of picture contains latitude , longitude , image of each location. want add together them annotation mapview , show image instead of pin locations. i have customized annotation is: @interface annotation : mkannotationview <mkannotation> @property (nonatomic,assign) cllocationcoordinate2d coordinate; @property (nonatomic,copy) nsstring *title; @property (nonatomic,copy) nsstring *subtitle; @property (nonatomic,retain) uiimage *image; @end and @implementation annotation @synthesize title,subtitle,coordinate,image; @end now in main code trying this: cllocationcoordinate2d location; annotation *myann; for(pictures *pic in picturesfromdb) { myann = [[annotation alloc] init]; location.latitude = [pic.langt doublevalue]; location.longitude = [pic.longt doublevalue]; myann.coordinate = location; myann.title = pic.descript; myann.image = [uiimage imagewithdata:pic.ima...

json - multidimensional key-pair array with json_decode (Clickbank IPN v.6.0) -

json - multidimensional key-pair array with json_decode (Clickbank IPN v.6.0) - this illustration of instant payment notification (ipn) receive clickbank: $decrypted = {"transactiontime":"2014-10-06t14:49:00-07:00","receipt":"********","transactiontype":"test","vendor":"comclub","role":"vendor","totalaccountamount":1.00,"paymentmethod":"visa","totalorderamount":1.00,"totaltaxamount":0.00,"totalshippingamount":0.00,"currency":"usd","lineitems":[{"itemno":"1","producttitle":"a passed in title","shippable":false,"recurring":false,"accountamount":1.00}],"customer":{"shipping":{"firstname":"test","lastname":"user","fullname":"test user","email...

Powershell script to check IP connection and delete IP address lease -

Powershell script to check IP connection and delete IP address lease - i looking powershell script check ip connection , delete ip address lease if connection false. here have far. if (test-connection -computername 10.5.5.100 -count 1 -quiet) -eq false {netsh dhcp server \\computername scope 10.15.1.0 delete lease 10.15.1.100} if (test-connection -computername 10.5.5.100 -count 1 -quiet -eq false) {netsh dhcp server \\computername scope 10.15.1.0 delete lease 10.15.1.100} i thinking syntax wrong here can't quite figure out. on 2008 server. bonus: using check scope , addresses not in utilize want remove them. alter lease time less not policy have come way. if there way go 10.5.5.100 through 10.5.5.254 removing ips not active great. just do: if (test-connection -computername 10.5.5.100 -count 1 -quiet) {} else {netsh dhcp server \\computername scope 10.15.1.0 delete lease 10.15.1.100} or if want save result of test: $live = test-connection -computernam...

java - nested for loop prime checker -

java - nested for loop prime checker - here code im kinda new programming way goal of programme out set primes numbers between 0 , user inputted value, each on own line import java.util.scanner; import java.math.*; public class sforprime{ public static void main (string[] args){ double box = 0; double boxxx = 0; int po = 0; int blub = 0; int no = 1; scanner scan = new scanner (system.in); system.out.println("input cieling number"); box = scan.nextint(); boxxx = math.sqrt(box); (int batman = (int)box; batman >= 0; batman--){ if (no == 1){ no = 0; } else if (po == 0){ system.out.println(blub); po = 0; } blub = batman; (int mot = (int)boxxx; mot >= 2; mot--){ if (po == 1 ){ } else if (box%mot == 0){ po++; } } if (po == 0){ system.out.println(blub); } } } } what ends happening doesn...

javascript - Is it possible to run a function that is '2-deep' within another function? -

javascript - Is it possible to run a function that is '2-deep' within another function? - i need execute function window.onload event. function want run lies within function's function. know can run function function by function1(){ function2(); } function2(){ ...a process... } but since cannot run window.onload event within 'overall' function needs @ 'top layer'. tried doing didn't work think want do. <script> function(){ function1(){ ..some stuff.. } function2(){ function1(); } } window.onload = function2; </script> i cannot run function1 window.onload event bound object onclick event. any suggestions how can solve this?? you should study , larn different javascript patterns allow construction code in predictable manner. http://addyosmani.com/resources/essentialjsdesignpatterns/book/ fantastic resource , show things need know. each pattern details implementation, ...

c# - Unable to display contents of Session to ASPX page -

c# - Unable to display contents of Session to ASPX page - so have piece of code which, when user logs in, take username , set session, called username. (for sake of simplicity i've set test string in there useremail.username) else { session["username"] = "test"; response.redirect("default.aspx"); } as far can tell, chunk of code works, 1 time user logs in redirected default.aspx. have piece of code (in master page's code behind on page_load) makes 1 panel visible if session not null, works, meaning there stored in session: if (session["username"] != null) { pnlloggedin.visible = visible; } however when seek display in front end of text: <h3>welcome <h3> so "welcome [username]" can't. don't know code. i've tried creating public string called getusername , calling that, i've tried puttin...

excel - VBA Mis-Match Error 13 -

excel - VBA Mis-Match Error 13 - i'm relatively new vba, wrote sub parse csv info contained in single cell , homecoming pieces of info other cells in spreadsheet. relatively simple code can't find error. err 13 mismatch on line moods = application.index(fullarray, 0, 3) help appreciated. private sub parsecsv() 'parse "notes" column , homecoming moods/keywords apropriate cells dim csv string dim fullarray variant dim lrow long dim keywords variant dim moods variant dim long lrow = activesheet().range("bl" & activesheet().rows.count).end(xlup).row = 3 lrow csv = activesheet.range("bl" & i) fullarray = split(csv, chr(10)) moods = application.index(fullarray, 0, 3) keywords = application.index(fullarray, 0, 2) activesheet.range("cd" & i).value = moods activesheet.range("ce" & i).value = keywords nex...

javascript - Cannot load the image using json data -

javascript - Cannot load the image using json data - for (var = 0; < len; i++) { if (data[i].productid && data[i].name && data[i].shortdescription && data[i].mediumimage && data[i].price && data[i].iconimage) { alert(data) //var date = new date(parseint(data[i].date.substr(6))); var photoq = "../images/homeimages/" + data[i].mediumimage; alert(photoq); //<img id="imgad" src="/images/homeimages/1.jpg" width="181px" height="215px" alt="img"> var photo = "<img id='imgad' src='" + photoq + "' width='181px' height='215px' alt='img'/>"; alert(photo); txt += '<tr><td><div id ="result1" ><div>' + photo + '</div> <div ><div>' + data[i].productid + "</br> name- " + data[i].name + "</br...

android - Ripple Emulator and cordova code accessing file system doesn't run -

android - Ripple Emulator and cordova code accessing file system doesn't run - i buiding app cordova 3.6.3 in netbeans , trying emulate ripple 0.9.15. whenever run code maintain getting: uncaught typeerror: cannot read property 'fire' of undefined ripple.js:40 deviceready has not fired after 5 seconds. cordova.js:1168 channel not fired: onpluginsready cordova.js:1161 channel not fired: oncordovaready the code supposed access file system, create files , display them in listview. here is: <!doctype html> <!-- alter license header, take license headers in project properties. alter template file, take tools | templates , open template in editor. --> <html> <head> <title>directory reader</title> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" /> <link rel="s...

javascript - How to disable future month and year in monthpicker -

javascript - How to disable future month and year in monthpicker - i using month picker, want restrict users selecting future month , year. how can accomplish ? tried using $("#month").monthpicker({ dateformat: 'm-yy', autosize: true, changeyear: true, changemonth: true, showbuttonpanel: true, maxdate: new date().getmonth() }); but restrict future year, can still select future month. help appreciated. by default, year range starts 10 years ago , ends on 10 years now, having current year selected. this , other settings can overwritten on widget initialization: options = { pattern: 'yyyy-mm', // default 'mm/yyyy' , separator char not mandatory selectedyear: 2010, startyear: 2008, finalyear: 2012, monthnames: ['jan', 'fev', 'mar', 'abr', 'mai', 'jun', 'jul', 'ago', 'set', 'out', 'nov...

javascript - Add an extra get method in asp.net web api -

javascript - Add an extra get method in asp.net web api - i'm new comer asp.net web api world. i've got basic understanding of get(), put(), post() , delete. in application, require 2 more get() method. explanation given below- public class studentcontroller : apicontroller { public ienumerable get() { //returns students. } //i add together method======================= [httpget] public ienumerable getclassspecificstudents(string classid) { //want homecoming students specific class. } //i add together method======================= [httpget] public ienumerable getsectionspecificstudents(string sectionid) { //want homecoming students specific section. } public pupil get(string id) { //returns specific student. } } there $http.get(..) in angularjs controller. my question is, how can phone call 2 additional get() methods angular controller. well, haven...

ruby on rails - Activeadmin Formtastic custom input -

ruby on rails - Activeadmin Formtastic custom input - i have simple app, has 3 models assessment , question , assessmentquestion in assessment have association like, class assessment < activerecord::base has_many :assessment_questions, dependent: :destroy has_many :questions, through: :assessment_questions end in question have, class question < activerecord::base has_many :assessment_questions, dependent: :destroy has_many :bank_questions, dependent: :destroy end in assessmentquestion have, class assessmentquestion < activerecord::base belongs_to :question belongs_to :assessment end assessment_questions table has :assessment_id , :question_id , :mark columns i have admin interface using activeadmin gem. while creating assessments in admin interface, in admin/assessment.rb have form generated formtastic gem, form |f| f.inputs f.input :name f.input :duration f.input :questions, as: :check_boxes, member_la...

javascript - Ajax.beginform callback properties , can not understand the differences -

javascript - Ajax.beginform callback properties , can not understand the differences - i read online document describes ajax.beginform callback properties , follow:- onbegin (in jquert beforesend):- called prior request beingness sent oncomplete (in jquery complete):- called if request successful onfailure (in jquery error):- called if request fails onsuccess (in jquery success):- called when request has completed, irrespective of whether request succeeded or failed now can not understand meant "called when request has completed, irrespective of whether request succeeded or failed". allow take next examples:- now if returning http 401 error application , 1 script called , assume onfailure ?, or since returning result onsuccess called instead? and if un-handeled exception raised , assume onfailure called, oncomplete fire ? thanks there succession of 3 callbacks, assuming server sends response (404, 500, 200, 302, etc.). onbegin callback first call...

How can I parse a tempo of midi using Java? -

How can I parse a tempo of midi using Java? - i not understand how grab tempo. still utilize shitty way utilize tempo output. i thinks using note_on & note_off timings give me real time. output still played slow in c++. p.s. utilize 1 voice midis when playing that. (it's fun, computers in our class room playing 2+ voice music synchronized). here code: import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.file; import java.io.ioexception; import javax.sound.midi.*; import javax.swing.*; import javax.swing.filechooser.filenameextensionfilter; import static java.lang.math.*; public class midireader { public static final float default_tempo = 100.0f; public static final int note_on = 0x90; public static final int note_off = 0x80; public static final float[] notes = {32.70f, 34.65f, 36.95f, 38.88f, 41.21f, 43.65f, 46.25f, 49.00f, 51.90f, 55.00f, 58.26f, 61.74f}; private jframe fra...

html - Shape resembling a compass pointer or inner part of a Safari logo -

html - Shape resembling a compass pointer or inner part of a Safari logo - i trying create below shape using css. know achieving shape using image or svg lot easier trying accomplish css proof of concept. the below code have tried far. creates diamond shape using transform: rotate(45deg) diagonals of same length whereas shape need has 1 long diagonal , short. .separator{ background: #555; top: 40px; padding-top: 0px; margin: 0px 40px; height: 100px; width: 100px; -webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); transform: rotate(45deg); } fiddle demo is possible create shape need using css? note: similar question asked before , closed/deleted "too broad" did not show coding attempt. posting new question , self answering based on this meta discussion. please sense free chip in alternate solutions (or) edit question create more useful future readers. for needle resting on tip yes, possible ...

java - Resultset can not be traversed -

java - Resultset can not be traversed - i want utilize while(rs.next()) traverse userinfo table. there 7 records in userinfo table, got first record. after had joined codes of rs.getrow(); , got result want. try{ statement stmt=conn.createstatement(); string querystr="select * userinfo"; resultset rs=stmt.executequery(querystr); while(rs.next()) { string strname="name "+rs.getstring(3)+";"; string intage="age "+rs.getint(5)+";"; string strcompany="company "+rs.getstring(4)+".<br>"; //int rownum=rs.getrow(); out.println(strname+intage+strcompany); } out.println("succeed in visiting userinfo table."); }catch(sqlexception e){ out.println("failed query."); } i don't want utilize rs.getrow(); . how should deal problem? your code appear fine except string part.if using string hold recor...

ios - Core data - can't set nil to an optional relationship -

ios - Core data - can't set nil to an optional relationship - i configured next core info class: class project: nsmanagedobject { @nsmanaged var lastupdatetime: nsdate @nsmanaged var name: string @nsmanaged var prevproejct: project } a project in info model can have previous project. configured relationship 'optional'. however, field in class not configured optional - can't set nil prevproject. so how can set relationship nil? i have 2 thoughts on this: @nsmanaged var prevproejct: project? or: prevproejct = nsnull() ios core-data ios8

javascript - How to force rerendeing after updating tab by ajax call in ExtJs 5.0? -

javascript - How to force rerendeing after updating tab by ajax call in ExtJs 5.0? - i have main page tab control: ext.define("test.index.tabscontroller", { extend: "ext.app.viewcontroller", alias: "controller.tabs-controller", ontabchange: function (panel, newitem, olditem) { if (!newitem.html && newitem.loader) { newitem.loader.load(); } } }); ext.define("test.index.tabs", { extend: "ext.tab.panel", controller: "tabs-controller", listeners: { tabchange: "ontabchange" }, items: [ { title: "static tab", html: "this static tab", }, { title: "ajax tab", loader: { loadmask: true, removeall: true, url: 'views/ajax.html', contenttype: "html", scripts: true, ...

ios - wildcard bundle ID error Xcode -

ios - wildcard bundle ID error Xcode - i have wildcard bundle id com.chatat* which setting bundle identifier project in xcode. however, getting error (null): error: cfbundleidentifier 'com.chatat*' contains illegal character '*' after looking things on apple website states you need replace asterisk appropriate string using reverse-dns format and not sure meant 'reverse-dns' format. able help this? in advance reverse dns format domain name, backwards. example, com.stackoverflow . in order avoid name collisions, bundle ids have format reverse dns name + name of application, reverse dns name reversed form of domain name under control. example, bundle id "myapp" might com.example.myapp . ios xcode bundle-identifier

objective c - swift init not visible in objecitve-C -

objective c - swift init not visible in objecitve-C - i'm trying create init functions in swift , create instances objective-c . problem don't see in project-swift.h file , i'm not able find function while initializing. have function defined below: public init(userid: int!) { self.init(style: uitableviewstyle.plain) self.userid = userid } i tried putting @objc(initwithuserid:) , maintain getting same error again. there else i'm missing? how constructor visible objective-c code? i read below this: https://developer.apple.com/library/ios/documentation/swift/conceptual/swift_programming_language/initialization.html https://developer.apple.com/library/ios/documentation/swift/conceptual/buildingcocoaapps/interactingwithobjective-capis.html how write init method in swift how define optional methods in swift protocol? the issue you're seeing swift can't bridge optional value types -- int value type, int! can't bridged. o...

MySQL / PHP - Storing parameters in a database table: Good or bad idea? -

MySQL / PHP - Storing parameters in a database table: Good or bad idea? - so far store relevant parameters need website variables in php file; point file through require statement in each page needs parameters. of times , easy mantain, need alter variables "on fly" , sense need of sort of web-panel can alter them more (i'm thinking web page form update parameters). i've created table in mysql database store parameters (basically, table has 2 columns: paramname , paramvalue ; i've stored parameter names varchar without $ sign @ beginning), in order create web-panel i've in mind. i thinking extract parameters names , values using query: $query=$mysqli->query('select * parameters'); while($row=mysqli_fetch_assoc($query)) { $paramname=$row["paramname"]; $$paramname=$row["paramvalue"]; } is or bad idea? what main issues encounter doing (in terms of security, too)? how deprecable , unsafe utilize of $$paramname ? i...

python - ipython: echo active conifg object (as defined in ``ipython_config.py``) of an ipython instance? -

python - ipython: echo active conifg object (as defined in ``ipython_config.py``) of an ipython instance? - how can active conifg object (as defined in ipython_config.py ) of ipython instance? i'd inspect check vars set. the config object should stored .config attribute of ipython configurable object. if don't have such object, calling get_ipython() should interactiveshell instance controls ipython. however, values config transferred configurable objects when they're instantiated, , other things may alter options without going through config. see actual values in use, @ attributes of objects you're interested in, next names used in config. python ipython

Calendar using html css and javascript -

Calendar using html css and javascript - i have been trying calendar using html, css , javascript. have little experience 3 of them. i havent got work javascript, sofar have created html+css , ugly solution: css: #day { float: left; border: 1px solid black; width: 85px; height: 85px; padding: 5px; margin: 5px; border-radius: 18px; } html: <div id="content"> <h1>november</h1> <br> <div id="day"> 1 </div> <div id="day"> 2 </div> <div id="day"> 3 </div> <div id="day"> 4 </div> <div id="day"> 5 </div> <div id="day"> 6 </div> <div id="day"> 7 </div> <br> <div id="day"> 8 </div> <div id="day"> 9 </div> <div id="day"> 10 </div> <div id="day"> 11 </div> <div id=...

java - Android custom Row Item for ListView -

java - Android custom Row Item for ListView - i have listview should have next layout in rows: header text header should static text changes every few seconds. i implemented populating string[] array , pass arrayadapter , set every time info changes: data_array = populatestring(); adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, android.r.id.text1, data_array); listview.setadapter(adapter); my problem not know how display info in format above. thanks in advance. add row.xml layout folder <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text=...

xml - xsl conditional tagging with for-each statement -

xml - xsl conditional tagging with for-each statement - here xml file: <?xml version="1.0" ?> <?xml-stylesheet type="text/xsl" href="question.xsl"?> <root> <overall_test> <overall_name> movies </overall_name> <overall_result> passed </overall_result> </overall_test> <subtest> <name> matrix </name> <result> passed </result> </subtest> <subtest> <name> die hard </name> <result> failed </result> </subtest> <subtest> ...

objective c - New location of the Notification Center .db file in 10.10? -

objective c - New location of the Notification Center .db file in 10.10? - good morning all, i have little app using nsnotificationcenter schedule notifications. have no problems access them during runtime , works fine. the problem starts when close app , restart it. seem not have access notifications scheduled during first run. answers here suggest there .db file in ~/library/application support/notificationcenter/ folder not there in os x 10.10 (not hidden, not in of other application back upwards folders either) can see on 10.9 partition. has thought file located or if functionality has been changed , scheduled notifications stored elsewhere? thanks hints, mdschay thanks outside help found out .db file location can seen doing following: open activity monitor seach process usernoted go tab "open files , ports" the files listed there contain .db files searching , in /com.apple.notificationcenter/db subfolder under /private/var/folders (sorry n...

iphone - iOS Push Notifications Working on iOS 8 But Not on iOS 7 in iOS SDK 8.1 -

iphone - iOS Push Notifications Working on iOS 8 But Not on iOS 7 in iOS SDK 8.1 - if([application respondstoselector:@selector(registerusernotificationsettings:)]) { [self registerforios8pushsettings]; //for ios8 } else { //ios7 or before [[uiapplication sharedapplication] registerforremotenotificationtypes:(uiremotenotificationtypebadge | uiremotenotificationtypesound | uiremotenotificationtypealert)]; } unable force notification ios7 device. didregisterforremotenotificatiosnwithdevicetoken called, in fact message delivered. working fine in ios8. with ios8 process had change. create app register ios8 , versions create this: -(void)registerappfornotifications{ if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) { [[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:(uiusernotificationtypesound | uiusernotificationtypealert | uiusernotificat...

php - regex to validate phone number -

php - regex to validate phone number - help me write regex below conditions number can start + number can contain - or . not () , / number can start 0 min number in string should 9 digits excluding extension details , starting + max number in phone number field should not reach more 14 excluding + if string contains ex/ext/x digit after should not have more 5 characters (normally 4) this above should satisfy examples below 0-1234-123456 +91-1234-56789012 +91-1234-56789012 x1234 +91-1234-56789012 ex1234 +91-1234-56789012 ext12345 +91-1234-56789012x1234 +91-1234-56789012ex1234 +91-1234-56789012ext12345 91-1234-56789012 91-1234-56789012 x1234 91-1234-56789012 ex1234 91-1234-56789012 ext12345 91-1234-56789012x1234 91-1234-56789012ex1234 91-1234-56789012ext12345 91123456789012 91123456789012 x1234 91123456789012 ex1234 91123456789012 ext12345 91123456789012x1234 91123456789012ex1234 91123456789012ext12345 91.1234.56789012 91.1234.56789012 x1234 91.1234.56789012 ex1234 91.12345...

Merging nested tables in linq to sql -

Merging nested tables in linq to sql - i have linq query gets info odata reporting service far good, when homecoming info : select new {timesheetactual , timesheetline,timesheet, timesheetproject,timesheettask, subtv, timesheetresource, subres, pleft} it returns collection of nested collections. for service need 1 big table every column every record. know possible explicitly naming every column in select statement this: select new { timesheetactual.column1, timesheetactual.column2, .., timesheetline.column1,.., timesheetproject.column1,..} but due massive amount of columns i'm little reluctant way. so question, there way either merge collections or way same result without having specify 100+ columns? linq-to-sql

javascript - PUT and POST Request of .save() of Backbonejs model -

javascript - PUT and POST Request of .save() of Backbonejs model - how confirmed whether backbonejs .save() sending set request ?? checked server side, working good, there no problem in server side. .save() not working. here model of backbone define(['underscore','backbone'],function(_,backbone) { var my_model = backbone.model.extend( { urlroot: "http://localhost/back/server_file.php/number" }); homecoming my_model; }); here how using .save() var my_data = { id: data.id, code: data.code }; var my_model = new my_model(); my_model.save(my_data, { success: function(response) { alert('yes'); }, error: function(response) { alert('no'); } }); i think .save() sending post request server. update i think find out ...

ios - Apple Push Notification Implementation -

ios - Apple Push Notification Implementation - i have app in trying implement apns. receiving force on device unable open corresponding screen. the scenario application has navigation bar root view controller. pushes view controllers login. if login successful pushes tab bar controller , hides itself. each tab bar controller has navigation controller root view controller. when receive force want open 3rd tab unable ? please help... when receive force notification, in function can create instance , save force notification page type , create tabbar, in select 3 tab using code if condtion if (instancepage == 3){ [self.tabbarcontroller setselectedindex:2]; } ios iphone apple-push-notifications push

jssor - Is it possible to connect image-maps to the slides? -

jssor - Is it possible to connect image-maps to the slides? - in order define areas of slides links wherever, desirable, if "usemap" tag used that. is possible? yes, definitely. please seek , allow me know if there problem. jssor

ios - How to minimze quad count in SpriteKit -

ios - How to minimze quad count in SpriteKit - i'm looking @ increasing performance in spritekit application. noticed in ios 8 apple has introduced debug property called showsquadcount skview . description on property says lower number better. when enabled it, i'm horrified find out quad count 1 1 mapping node count! if have 1000 nodes on screen, quad count 1000! can explain me why might be? how spritekit determine how many quads should utilize render scene? i can post code if help, @ point i'm not sure post. help! quite simple: display fewer nodes. 1000 nodes on screen a lot! if cutting number of nodes downwards 800 cut down quad count 80%. each node (on screen) requires 1 quad (two triangles). there's nil can optimize quad count except drawing fewer quads (aka nodes). ios objective-c sprite-kit opengl-es-2.0

Android Passing Data -

Android Passing Data - i need advice on application writing android using eclipse. writing application adds 2 numbers , passes info first activity using intent. not sure if utilize intent.putextra ( num1 +num 2), advice appreciated. thanks- suppose u r going activity activity b , u want homecoming activity a, here example. hope helps : code go activity b o button click : button1.setonclicklistener(new onclicklistener() { @override public void onclick(view arg0) { intent intent=new intent(mainactivity.this,secondactivity.class); startactivityforresult(intent, 2); //2 request code. u can take ur own. } }); also in same activity override onactivityresult method : @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); // check if request code same passed h...

LLDB swift print object -

LLDB swift print object - im little dumfounded how utilize lldb inspect object in swift project. in particular case i'm using nsjsonserializer serialize little chunk of json , i'd inspect value. in xcode 5.1 super simple, type "po json" @ lldb prompt , i'd wanted. commands po , print fail me printing out garbage. tried calling description property because works swift types still doesn't work. lastly resort used look println statement , works. certainly there must improve simpler way? here output of lldb: (lldb) print json (anyobject?) $r4 = (instance_type = builtin.rawpointer = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary) (lldb) po json (instance_type = builtin.rawpointer = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary) { instance_type = 0x00007ff05c0c49d0 -> 0x0000000107ef32c8 (void *)0x0000000107ef32f0: __nscfdictionary } (lldb) print json.d...

angularjs - Securing Web API web services, windows authentication -

angularjs - Securing Web API web services, windows authentication - i need secure web services existing project, , wasn't sure how that. i'm trying prevent 1 user calling web service can perchance info user. this setup: .net 4.5 - web api web services, windows authentication, ajax (angularjs) front end end. using nhibernate , sql server. know every web service write can check httpcontext current user, don't want have in every single web service method. there right (easier) way this? read bit asp.net identity , owin, way on head , in add-on supports entity framework out of box, have write custom providers or utilize nhibernate. right no i'm looking alternatives such using global.asax or , enabling session on server store , valid user info. ok do, or there easier alternative? any advice? thanks! i'm assuming have web server configured windows authentication , part working. for authorization, take @ system.web.mvc.authorizeattribute (m...

php - Check-boxes Addition ($_POST) -

php - Check-boxes Addition ($_POST) - i wondering how create when click 2 check-boxes submit, value appears; in case wanted value "15 percent" i have tried create work in several ways & read '$_post' in php manual can't figure out how solve problem php lab 04 <form name="orderform" action="<?php echo $_server['php_self'];?>" method="post"> discount<br /> <input type="checkbox" name="discount" value="student"/>customer 1 15%<br /> <input type="checkbox" name="discount" value="senior"/>customer 2 10%<br /> <input type="checkbox" name="discount" value="klant"/>customer 3 5% <br /> <input type="image" src="button.jpg" value="order" /> </form> ...

Create executable of a python application -

Create executable of a python application - i want create executable of python application can work on ubuntu machine. python setuptools has options windows(bdist_wininst) , rmp(bdist_rpm), couldn't found alternative in python setuptools ubuntu or debian. there 1 more alternative "bdist_dumb" don't use. questions: how create ubuntu executable using python setuptools ? how pyinstaller different setuptools , should utilize ? stdeb might you're looking , works distutils, similar setuptools. here's simple illustration taken their repo: #!/usr/bin/env python # -*- coding: utf-8 -*- distutils.core import setup import sys setup(name='simple_pkg', packages=['simple_pkg'], version='0.1', author='mister unicodé', author_email='mister.unicode@example.tld', description='python bundle unicodé fields', long_description='this python bundle unicodé data.',...

r - Obtaining the subset of points which are outside a specified irregular polygon using {spatstat} -

r - Obtaining the subset of points which are outside a specified irregular polygon using {spatstat} - i have big set of points (latitude , longitude) constrained complex polygon. of points not within bounds of polygon, , subset these points original info frame (not ppp object, described below). #simple illustration of polygon , points. ex.poly <- data.frame(x=c(0,5,5,2.5,0), y=c(0,0,5,2.5,5)) df <- data.frame(x=c(0.5, 2.5, 4.5, 2.5), y=c(4,1,4, 4)) bound <- owin(poly=data.frame(x=ex.poly$x, y=ex.poly$y)) test.ppp <- ppp(x=df$x, y=df$y, window=bound) #plotting example, show 1 out of bound owin object plot(bound) points(df$x, df$y) the error message 1 point rejected lying outside specified window comes up, expected. how subset original dataframe df find out point(s) rejected? generate boundary , list of points ex.poly <- data.frame(x=c(0,5,5,2.5,0), y=c(0,0,5,2.5,5)) df <- data.frame(x=c(0.5, 2.5, 4.5, 2.5), y=c(4,1,4, 4)) identify , plo...

javascript - phantomjs-node + lab (test utility from hapijs) + test coverage -

javascript - phantomjs-node + lab (test utility from hapijs) + test coverage - i using phantomjs-node , is, unfortunately, not playing lab's test coverage stuff. when run lab -t 100 , trying inject __$$labcov function passed page.evalute() . however, function not executed in context of code in appears. executed in context of phantom browser. so, in code beingness tested, if have in midst of phantomjs code: page.evaluate( function () { homecoming 'foo'; }, function (result) { // result here ph.exit(); } ); in sec function, result should string "foo". , that's happens when run code. if run via lab -t 100 , null , "phantom stdout: referenceerror: can't find variable: __$$labcov". is there way tell lab, "hey, know 1 line looks code yo u want create sure gets run, really, don't worry little function here, it's not you."? alternately, there way can access __$$labcov ...

grails - How can I set a variable from a regular helper method in GSP? -

grails - How can I set a variable from a regular helper method in GSP? - i need output html values depend on kind of object have (i'm transitioning between db representations). right have logic in block of g:if expressions. it's relatively hard read , debug. <g:if test="${o.iskinda}"> <g:set var="x" value="${...}" /> <g:set var="y" value="${...}" /> ... </g:if> <g:else> <g:set var="x" value="${...}" /> <g:set var="y" value="${...}" /> ... </g:else> i particularly not interested in adding these values x , y methods of o . i'd set them using view helper, understand == "tag lib" in grails: // tag helper // class amazingtaglib { def valuexfor = { attrs -> o.iskinda? 1 : 2 } ... } // previous gsp, rewritten // ... <g:set var="x" value="${ valuexfor(o) }" />...

ruby on rails - How to define Ubuntu sudoer permission for specific set of commands -

ruby on rails - How to define Ubuntu sudoer permission for specific set of commands - to allow rails application run upstart commands via foreman gem, resorted providing sudoer definition below specific user. there variation of sudoers definition can provide list of linux commands passwordless sudo authorization? my current sudoer definition bill all=(all) nopasswd:all this allows user 'bill' run privileged commands without password. how can restrict 'bill' run next commands via sudo w/o password? sudo service rails_app stop sudo service rails_app start sudo service rails_app restart i tried next definition, received syntax error when saving visudo edit. bill localhost=(service rails_app stop, service rails_app start, service rails_app restart) nopasswd:all the simplest file be: bill all=(all) nopasswd:/usr/bin/service rails_app stop bill all=(all) nopasswd:/usr/bin/service rails_app start bill all=(all) nopasswd:/usr/bin/service rails_...

c++ - Using ifstream when filename contains wide characters -

c++ - Using ifstream when filename contains wide characters - using c++builder xe5 (bcc32) in windows 7. i trying open file filename contains wide character. actual filename i'm testing c:\bΛx\foo.txt . non-ascii character there u+039b . i have filename stored correctly in std::wstring . however, trying: std::ifstream f( filename.c_str() ); fails open file. of course, in standard c++ fopen takes char * . however, dinkumware c++ rtl implementation has overload accepting wchar_t * . unfortunately implementation of overload in ...\embarcadero\rad studio\12.0\source\cpprtl\source\dinkumware\source\fiopen.cpp not phone call _wfopen . instead uses wcstombs convert string utf-8 , calls fopen . checking source fopen , calls narrow version of underlying function ___topen passes utf-8 string createfile . when inspect effort open file using sysinternals process monitor, shows did effort open file utf-8 file string, , operating scheme rejected result name collision...

html - How to change width of text-box using kendo-ui? -

html - How to change width of text-box using kendo-ui? - so, want 2 adjacent text boxes different widths, using kendo-ui. my html: <tr> <td><input type="checkbox">1d22339</td> <td>12243jnj3427676</td> <td><input type="text" class="k-input k-textbox.medium"><input type="text" class="k-input k-textbox.small"></td> </tr> my css code: .k-textbox.small{ width: 20px; } .k-textbox.medium{ width: 50px; } the problem is, both textboxes appear same default size. how may correctly style text-box? thanks! you should it- input[type='text'].k-textbox.small{ width: 20px; } input[type='text'].k-textbox.medium{ width: 50px; } or .k-textbox.small{ width: 20px !important; } .k-textbox.medium{ width: 50px !important; } hope helps you. html css textbox kendo-ui

podio - How do you get the value of a "embed"? -

podio - How do you get the value of a "embed"? - i have link field called lien . when api through item belongs to, receive next array: [lien] => array( [0] => array( [embed] => 49935230 [file] => 129256002 ) ) i have no problem file. how url value? the embeds documentation: https://developers.podio.com/doc/embeds a similar issue exists when getting value of category field through item object. it's array of selected option_id , doesn't hold option_text . workaround corresponding app object , search option_text using provided option_id . the field's values returned collection of embed objects. can see documentation at: http://podio.github.io/podio-php/fields/#linkembed-field e.g.: $item = podioitem::get_basic(123); $field_id = 'embed'; $collection = $item->fields[$field_id]->values; foreach ($collection $embed) { print "embed id: ".$embed->embed_id; print "emb...

How can I verify multiple other Adsense publisher-ids on my website -

How can I verify multiple other Adsense publisher-ids on my website - i have website articles written myself , others. reward other persons written content website share adsense income. i'm thinking making standard adsense code , allow publisher-id rotate. can utilize publisher-id or should others person verify website somehow in adsense account? , may utilize multiple publisher-ids on website? hopefully can tell me do. can't lead ban? google states "publishers permitted place advertisement code different adsense accounts on same page long owner of website has given permission ads placed on site, , webpage complies our programme policies. a publisher credited clicks , impressions on advertisement units associated account. additionally, publishers responsible monitoring each webpage upon advertisement code appears ensure compliance our policies." source: google groups adsense

javascript - Compare a given Date object to a specific time on the same day -

javascript - Compare a given Date object to a specific time on the same day - my goal check if specific date object within time frame, , show right button on page result. currently, have this: ng-if="payment.transactiondatetime <= *six pm on same day* && payment.transactiondatetime >= *six pm day before payment.transactiondatetime*" what should create work? need check if payment occured between 6pm day prior transactiondatetime property of payment , 6pm same day transactiondatetimeproperty. in controller, transaction datetime , create scope variables compare. i'm not sure format have transactiondatetime basic sample code. if(!payment.transactiondatetime) { var transactionday = new date(date.parse(payment.transactiondatetime)); $scope.beforesixsameday = transactionday.sethours(18); $scope.aftersixdaybefore = new date().setdate(transactionday - 1).sethours(18); } on html page, <div ng-if="payment.transactiondatetime ...

rest - How select json value in soapui property transfer from HTTP request? -

rest - How select json value in soapui property transfer from HTTP request? - here raw response: http/1.1 200 ok date: tue, 21 oct 2014 08:46:31 gmt content-type: application/json;charset=utf-8 transfer-encoding: chunked server: jetty(9.2.2.v20140723) {"id":"myid"} i tried set property (source response test step, property can request, response etc.) response , responseasxml , both can not extract value. , seek xpath selection not work. possible extract id http response json? updated if select responseasxml next string: [<response xmlns="http://localhost/path"> <id>882fe993-d150-b67c-4b0f-014931e2dd21</id> </response>] i have tried xpath: declare namespace sam="http://localhost/path"; //sam:response also wrote //sam:response or //response result [null] string. it worked me in comment answer: soapui - how utilize property transfer post request you can use: //*:id json ...

java - Groovy classloader exception when using template engine -

java - Groovy classloader exception when using template engine - i'm new groovy , tried utilize gstringtemplateengine execute groovy scripts on jboss 5.1 everything works fine in local development environment, fails when moved dev server managed different team. i found exception thrown @ try { groovyclass = loader.parseclass(new groovycodesource(templateexpressions.tostring(), "gstringtemplatescript" + counter.incrementandget() + ".groovy", "x")); } grab (exception e) { throw new groovyruntimeexception("failed parse template script (your template may contain error or trying utilize expressions not supported): " + e.getmessage()); } on gstringtemplateengine.class, line 190 the exception message groovy.lang.groovyruntimeexception: startup failed: general error during class generation: uri not hierarchical java.lang.illegalargumentexception: uri not hierarchical @ java.io.file.<init>(file.java:363) @...

asp.net mvc 4 - System.web.Mvc does not exist in the namespace system.web - but it is there ~ -

asp.net mvc 4 - System.web.Mvc does not exist in the namespace system.web - but it is there ~ - it's been more 2 days, i'm stuck in situation. have several projects in solution. working fine previously, when interacted tfs , , merged content of solution, started having build error saying: error 566 type or namespace name 'mvc' not exist in namespace 'system.web' (are missing assembly reference?) but there! tried solutions, , been through this, this , several other posts, nil worked (eg: tried cleaning, rebuilding, setting re-create local flag true, etc.). , not understand few solutions. the solution worked me manually updating reference file. did was, deleted system.web.mvc references , added 1 time again reference (from other project) , worked. but everytime, cannot go references of each project, delete reference , add together new 1 (because have several projects, , time consuming , not proper solution). kindly guide me, i'm stuck. sugges...

tcp - Should we frame whole packet ( headers , check sum, etc ) to use netmap? -

tcp - Should we frame whole packet ( headers , check sum, etc ) to use netmap? - i reddish netmap allows user programmers access packets in user space, means user applications can read / send network packets using netamp. netmap : http://info.iet.unipi.it/~luigi/netmap/ can 1 familiar netamp, tell me should create entire packet want send out, or using stack features send out. edit : here illustration on how utilize api https://www.freebsd.org/cgi/man.cgi?query=netmap&sektion=4 #include <net/netmap_user.h> void sender(void) { struct netmap_if *nifp; struct netmap_ring *ring; struct nmreq nmr; struct pollfd fds; fd = open("/dev/netmap", o_rdwr); bzero(&nmr, sizeof(nmr)); strcpy(nmr.nr_name, "ix0"); nmr.nm_version = netmap_api; ioctl(fd, niocregif, &nmr); p = mmap(0, nmr.nr_memsize, fd); nifp = netmap_if(p, nmr.nr_offset); ring = netmap_txring(nifp, 0); fds.fd = fd; fds.events = pollout; (;;) { ...