Posts

Showing posts from July, 2011

javascript - Function toString() not working -

i use javascript in qml application , want insert code of function string: function test(parameter) { console.log("something do!"); } ... function otherfunction(otherparam) { console.log("output: "+test.tostring()); } all print following: "output: function() { [code] }" instead of desired string: "output: function() { console.log("something do!"); }" p.s.: remember code worked somewhere during migrating qt 5.2 qt 5.4 , fixing cmake scripts, broke. what problem here? tostring applied function implementation detail. per ecma-262, should works expect, evidently, implemented, doesn't :( in case, standard allows work differently between implementations. you depended on implementation detail, changed implementations, shouldn't surprised. if need store code, can generate function eval -uating string, , add code property of function. according 5th edition of ecma-262 , section 15.3.4.2, function...

java - Shall jarrayObject (array of strings) be deleted/released after usage in a JNI call ? -

i'm experimenting in c++ jni , have doubt java object i've created in c++ being used jni call argument. take simple java class, string array argument: public class mytest { public static void main(string[] args) { system.out.println("hello, world in java"); int i; (i=0; i<args.length; i++) system.out.println(args[i]); } } i call c++ following jni code: jmethodid mid3 = env->getstaticmethodid(cls2, "main", "([ljava/lang/string;)v"); // signature string array arg. if(mid3 == nullptr) cerr << "error: method not found !" << endl; else { jobjectarray arr = env->newobjectarray(5, // constructs java array of 5 env->findclass("java/lang/string"), env->newstringutf("str")); // default value env->setobjectarrayelement( // change 1 of array elements arr, 1, env-...

android - ActivityTestRule.getActivity returns null in Before method -

i need empty user's data before each test // kotlin code fun getactivity() = activityrule.getactivity() before fun setup() { cleanup(getactivity()) } i need context in order so, in setup, activityrule.getactivity() returns null. i tried: before fun setup() { val = intent() i.addflags(intent.flag_activity_clear_top) activityrule.lauchactivity(i) cleanup(getactivity()) } i got activity, cleanup works half of time (i believe race condition apply here) i want avoid cleanup in after function in order see manually app state if needed. is there anyway context in before function? thanks you can context instrumentationregistry calling gettargetcontext() method.

java - Illegal UTF8 string in constant pool in class file error in IntelliJ -

whenever try run file (java main, cucumber feature, junit test) following error in intellij idea: information:15/05/2015 14:57 - compilation completed 1 error , 0 warnings in 1s 134ms error:internal error: (java.lang.classformaterror) illegal utf8 string in constant pool in class file org/jetbrains/jps/model/serialization/java/jpsjavamodelserializerextension$javaprojectextensionserializer java.lang.classformaterror: illegal utf8 string in constant pool in class file org/jetbrains/jps/model/serialization/java/jpsjavamodelserializerextension$javaprojectextensionserializer @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:800) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ java.net.urlclassloader.defineclass(urlclassloader.java:449) @ java.net.urlclassloader.access$100(urlclassloader.java:71) @ java.net.urlclassloader$1.run(urlclassloader.java:361) @ java.net.urlclassl...

html - how to skip quot in image src -

so have image src <img src="http://www.google-analytics.com/collect?v=1&tid=key1&cid=&lt;% contact field="id" %&gt;&t=event&ec=email&ea=open&el=open_email&cs=newsletter&cm=email&cn=test_newsletter"> the problem "" in contact field="id" , please if has idea how skip "" image src appreciative replace 1 of usages of " '. like <img src='...' /> or contact field 'id'.

c# - add an entry to options window in Visual Studio -

Image
is there way using envdte interface programmatically add entry(like environment) in options window of tools menu in visual studio using c#? i'm stuck , don't know how proceed many thanks

javascript - Knockout.js not wanting to bind my list of records that has been grouped by location -

i have been trying few days no luck. i'm building asp.net mvc 5 application. i'm building reservations application restaurant. idea extract days reservations group location linq entities , send signalr client side. on client side want bind grouped query knockout.js , display it, , goes wrong. sending grouped reservations client side works fine can't seem make mapping knockout work. please help. model on server side var reservations = db.bistroreservations_reservations .groupby(reservation => reservation.bistroreservations_location.description) .orderby(reservation => reservation.key.tostring()).tolist(); var context = microsoft.aspnet.signalr.globalhost.connectionmanager.gethubcontext<reservationshub>(); context.clients.all.testinggroupedreservations(reservations); model on client side var reservationsviewmodel = function () { var self = this; var connection = $....

javascript - Youtube API pause when i press play in some mobile browser -

i have been working youtubes javascript api webpage , has been working great. today noticed problem has not been present before. on mobile browsers instance firefox on android youtube players works ones. if press play(on video) start playing , if press pause stops. if press play again play couple of frames , pause again. think new problem have done lot of testing last couple of weeks. here code creating players. //start youtube api var tag = document.createelement('script'); tag.src = "http://www.youtube.com/iframe_api"; var firstscripttag = document.getelementsbytagname('script')[0]; firstscripttag.parentnode.insertbefore(tag, firstscripttag); var youtubeready = false; //variable dynamically created youtube players var players= new array(); var isplaying = false; function onyoutubeiframeapiready(){ youtubeready = true; //the id of iframe , same videoid jquery(".video").each(function(i, obj) { players[ob...

ios - using storyboards -

i trying tutorial using story board ray. using tab bar controller connecting tableview embedded navigation controller, , table view named players , view controller connecting tab bar controller named gestures. displaying players game, name , rating in players tableview storing details in object. have created new file player base object store them properties have store properties in array of view controller called player view controller , have make array , test player objects in app delegate , assign playersviewcontroller’s players property using instance variable.so in appdelegate.m, imported player , player view controller.h headers , add new instance variable named _players. code in app delegate.m below error subscript requires size of interface 'nsarray' not constant in non-fragile abi @ line viewcontrollers[0]. #import "appdelegate.h" #import "player view controller.h" #import "player.h...

android - Application onCreate() NOT getting called everytime -

i have important initialization when app starts. found best way put code inside oncreate() of class extends application class. class applicationdemo extends application{ public void oncreate(){ super.oncreate(); log.d("log", "inside oncreate()"); } } the problem i not find log statement executed every time app run. start app first time, log statement, close app , start again launcher. no, log statement doesn't come. what problem? how can ensure particular code run every time app run , before else performed? my guess have open application just once . i'm pretty sure that, after closed application, goes background, waiting put in foreground again. (it not created again, reuse have created.) try making sure killed process of application before re-opening it; make sure closed & reopen it, , not simple background-foreground thingy.

Identify Arduino Version through USB and Processing -

i have 1 big problem: wrote 2 processing applications, 1 arduino uno , 1 arduino mega. both applications runs simultaneously on 1 computer both arduinos plugged usb ports. my problem identify automatically right arduino device on each application. select port manually, such approach not practicable user.

php - Send a variable's content to a file through FTP -

i create file on ftp server variable's content. possible without writing data file locally first ? this can do: $tmpfname = tempnam("/tmp", "foo"); file_put_contents($tmpfname, $file_contents) ftp_put($conn_id, $destination_file, $tmpfname, ftp_binary); unlink($tmpfname); but send $file_contents without saving first file. it's possible using wrappers: ftp_put($conn_id, $destination_file, 'data://text/plain;base64,' . base64_encode($file_contents), ftp_binary);

java - Can we use the Lambda Expression for WindowListener? if yes how? if no why? Can i set the Lambda Expression for the below code snippet? -

this question has answer here: java 8 lambda expressions - multiple methods in nested class 6 answers this.addwindowlistener(new windowadaptor(){ public void windowclosing(windowevent we) { system.exit(0);//to close window } }); this request, please make code using lambda expression. a lambda expression can substitute functional interface (i.e. interface single non default method). therefore windowadapter, has multiple methods ( windowactivated(windowevent e) , windowclosed(windowevent e) , windowclosing(windowevent e) , ...), can't substituted lambda expression.

windows - ESC/POS Command Answer -

good morning, i developing kiosk application. in application need send commands printer esc / pos protocol. i have commands give me information printer (printer status, end of paper status). sending command use this function , need read printer reply. how can it? (the printer connected in usb mode). i'm developing on delphi xe2 thanks the example assuming string type simple such shortstring . try declaring s shortstring . can not work widestring or unicode .

php - Magento how to detect changed fields only in admin section? -

i need insert values custom database table based on values of changed custom field, if specific custom field value (in custom shipping method) had changed.i need check in observer.php event i'm firing admin_system_config_changed_section_carriers getting values field , insert values table is there possible way ? edit: here observer function public function handle_adminsystemconfigchangedsection($observer){ $post = mage::app()->getrequest()->getpost(); $firstbarcodeflatrate = $post['groups']['flatrate']['fields']['barcode_start']['value']; $lastbarcodeflatrate = $post['groups']['flatrate']['fields']['barcode_end']['value']; $flatraterange = range($firstbarcodeflatrate,$lastbarcodeflatrate); $shippingmethod = 'flatrate'; foreach($flatraterange $barcodes){ $insertdata = array( 'barcode' => $b...

c# - Filtering by user input getting error message can not get table 0 -

i have wrote code following tutorial posted here http://csharp.net-informations.com/datagridview/csharp-datagridview-filter.htm however keep getting error "cannot find table 0", have tried several things none have worked i have posted code in form load , button start process string connectionstring = "server=localhost;user id=root;database=epas="; string sql = "select * pricing sterling"; sqlconnection con = new sqlconnection(connectionstring); sqldataadapter dataadapter = new sqldataadapter(sql, con); con.open(); dataadapter.fill(ds, "pricing table"); con.close(); datagridview1.datasource = ds.tables[0]; and button dataview dv; dv = new dataview(ds.tables[0], "id = '21' ", "type desc", dataviewrowstate.currentrows); datagridview1.datasource = dv; remove spaces name of datatable in dataadapter.fill(ds, "pricingtable");

java - Orika clean MapperFactory -

i´m using spring mvc , orika mapper entities xml, problem i´m facing when try reuse mapperfactory new mappers in same instance, not dont remove previous mapper registered, after supposedly add new one, invoke in map method call, first mapper register. here code: @override public void configuremapper() { converterfactory converterfactory = factory.getconverterfactory(); classmapbuilder builder = factory.classmap(publicprocurement.class, requestforquotationbody.class) .mapnulls(false); (documentbodymapper<requestforquotationbody, publicprocurement> mapper : mappers) { mapper.register(builder, converterfactory); } builder.register(); } @override public void setmappers(list<documentbodymapper<requestforquotationbody, publicprocurement>> documentbodymappers) { this.mappers = documentbodymappers; } so first time configure mapperfactor mappers list {amapper.class}, after finish create xml, invoke again passing time mappe...

php - Related Products ACF WordPress -

i not using woocommerce plugin, normal site. i have page, need let user select 'related products'. now, using acf, , looking @ using post_object allow user select product. what needs do, product name, products image , description. i have used code, acf site, attempt grab post object title. <?php $post_object = get_field('post_object'); if( $post_object ): // override $post $post = $post_object; setup_postdata( $post ); ?> <div> <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <span>post object custom field: <?php the_field('field_name'); ?></span> </div> <?php wp_reset_postdata(); // important - reset $post object rest of page works correctly ?> <?php endif; ?> but won't display anything? is there obvious issues can see? since allowing multiple selections, get_fiel...

java - How do I get a reference to the Jackson Object Mapper in a jersey2 / hk2 application -

i have jersey2 application configured json support via jackson, adding <dependency> <groupid>org.glassfish.jersey.media</groupid> <artifactid>jersey-media-json-jackson</artifactid> <version>${jersey.version}</version> </dependency> in pom file , public myapplication() { ... register(jacksonfeature.class) ... } in application. works, resources deserialized pojos arguments @post @consumes(mediatype.application_json) public void blah(mypojo p) { ... } now 1 of thoese resources needs reference jackson's objectmapper deserialization on own. i've tried doing like @inject public myresource(@context objectmapper mapper) { ... } or @get public string foo(@context objectmapper mapper) { ... } but in both cases reference mapper null. how can inject reference objectmapper in resources? first there no default objectmapper used jackson provider. doesn't use objectmappe...

Missing class for indicator field value [SUPP] of type [class java.lang.String] with JAXB and unmarshalling -

i'm trying unmarshal json java object jaxb got error : [exception [eclipselink-43] (eclipse persistence services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.descriptorexception exception description: missing class indicator field value [supp] of type [class java.lang.string]. descriptor: xmldescriptor(com.travelsoft.cameleo.bookingprocess.data.elementjson --> [])] @ org.eclipse.persistence.jaxb.jaxbunmarshaller.unmarshal(jaxbunmarshaller.java:191) @ com.travelsoft.cameleo.bookingprocess.refactoring.action.process.searchavailabilityandquotationaction.execute(searchavailabilityandquotationaction.java:551) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ com.opensymphony.xwork2.defaultactioninvocation.invokeaction(defaultactioninvocatio...

linux - Bash Script division -

i'm beginner in scripting. have temperature sensor gives me temperature if cat file /sys/bus/w1/devices/28-000006c5772c/w1_slave . output of file looks like: 83 01 4b 46 7f ff 0d 10 66 t=24187 as can see temperature t= 24187 have divide 1000. script looks this: #!/bin/bash date +%y-%m-%d-%h-%m s= cat /sys/bus/w1/devices/28-000006c5772c/w1_slave | grep t= | cut -d "=" -f2 x= 1000 f= echo $(( $s / $x )) | bc -l echo temperature $f but dosen´t work. when start script, output here: 2015-05-04-08-51 (date wrong ntp not configured^^) 23687 /home/pi/rab.sh: line 5: 1000: command not found /home/pi/rab.sh: line 6: / : syntax error: operand expected (error token "/ ") to assign output of command variable, need use backticks or (preferably) $() syntax. s=$(cat /sys/bus/w1/devices/28-000006c5772c/w1_slave | grep t= | cut -d "=" -f2) will set $s 24187 that, , removing spaces after = signs suggested chepner want.

cloudflare - Is resource bundling needed on SPDY to reduce response times -

here use term bundling refer concatenate js , css resources reduce number of http requests. http/2 solves underlying issues gave birth resource bundling web development best practices in first places (round trip times, resource fetch blocking). however, how spdy, deployed, shares these characteristics http/2? if use spdy-aware cdn, cloudflare, there sense bundle resources anymore if not need care legacy clients? please note resource transpiling might done separately bundling , question response times, not compiling code. http/2 (and predecessor spdy, being phased out) clients can perform larger number of concurrent requests server http/1.1 clients. where http/1.1 between 4 , 8 concurrent requests @ time only, http/2 can typically 100. the bundling of resources workaround http/1.1 limitation, , it's not strictly needed anymore http/2. the reasons think of continue bundling may increase gzip compression efficiency of resources (but should measured quantify b...

formatting - Python format negative currency -

i haven't found addresses how format negative currency, far, , driving me crazy. from decimal import * import re import sys import os import locale locale.setlocale( locale.lc_all, 'english_united states.1252' ) # cbalance running balance of type decimal fbalance = locale.currency( cbalance, grouping=true ) print cbalance, fbalance result negative number: -496.06 ($496.06) i need minus sign not parenthesis how rid of parenthesis , minus signs? looks can use _override_localeconv dict (which bit hackish). import locale cbalance = -496.06 locale.setlocale( locale.lc_all, 'english_united states.1252') locale._override_localeconv = {'n_sign_posn':1} fbalance = locale.currency(cbalance, grouping=true) print cbalance, fbalance or use string formatting .

vba - Import 150 text files to Access as Tables using SQL -

i have 150 text files in csv format using pipe | seperator. files in different folders on network. filenames date specific , have suffix holds date. have created table has 3 fields: file location; file name excluding suffix; suffix (in format yymmdd). i want create sql script import each of 150 files named in table have created 150 seperate access 2007 tables named file name excluding suffix. tried using vba filenames contain full stops , vba didn't this. each of files has different column structure first row headers. can use features native access 2007 organisation work not allow third party addons or applications. don't have sql server available me. i complete novice when comes access , struggling achieve approaching this. can help? i struggled achieve wanted in access , went on excel instead. code below creates each of text files sheet within single excel workbook master table holding filename / path etc "master" sheet within workbook. delet...

sorting - sort a list of @Sortable objects in descending order -

i have class @sortable(includes = ['date']) class item { // other fields not relevant question date date } if sort list of these objects sort them in ascending order based on date field. there way sort them in descending order instead? know call reverse() on result of ascending sort, seems bit inefficient here couple of ways: def items = [ new item(date: new date(40000)), new item(date: new date(1000)), new item(date: new date(200000)), new item(date: new date(00100)), ] items.sort { a, b -> b <=> } items.sort(true, collections.reverseorder())

c# - how to upload a pdf file and other string parameter in rest wcf service -

i had created rest wcf service , want post pdf file , other string data correct way it 1) converting pdf base64 string , form xml , post rest web service decode in rest service. 2) directly uploading using below code byte[] pdffile = file.readallbytes("pdf file path here");webrequest request = webrequest.create("https://test.site.fr/testfile"); request.method = "post"; request.contentlength = pdffile.length; request.contenttype = "application/pdf"; stream stream = request.getrequeststream(); stream.write(pdffile, 0, pdffile.length); stream.close(); httpwebresponse response = (httpwebresponse)request.getresponse(); streamreader reader = new streamreader(response.getresponsestream()); console.writeline(reader.readtoend()); reader.close(); which better respect large files , if other compression required the best way use multipart/form-data. c# not have inbuilt multipart/form-data pa...

javascript - Multi Column Sorting Using Ember JS -

my requirement sort array using dynamic property names using emberjs. what have done single column sorting ents = @get('acceptedentities') //get array @set('sortascending', !@get('sortascending')) sort_data = ents.sortby(property_name) //property name sort order and looking id ents = @get('acceptedentities') @set('sortascending', !@get('sortascending')) sort_data = ents.sortby([property_name1, property_name2]) i tried above solution no luck , here computed sort , implemented this model = @get('acceptedentities') sortproperties = [property_name, 'entity_sf_account_name'] sort_data = ember.computed.sort(model, sortproperties) but sorting not going properly, please give me suggestions this. i tried too sortproperties = ['one:asc', 'two:desc', 'three:asc'] sort_data = ember.arrayproxy.createwithmixins(ember.sortablemixin, { content: model, sortproperties: sortprope...

php - Send weekly report with cron job in linux server -

i working application need send weekly reports automatically administrator, application files hosted in linux server , set cron job send weekly reports, want know there other better way apart cron job, send automatic reports? you try anacron , fcron , hcron or jobber . for more details on these schedulers refer cron alternatives linux

mysql - Creating DataTable with inner join query on DataSet -

i'm having small issue on trying create datatable following query: select sp_sales_data.productname, sp_sales_data.quantity, sp_sales_data.tax_percent, sp_sales_data.finalprice, sp_sales.date, sp_stores.location, sp_sales.change, sp_sales.ammountreceived, sp_sales.totaltopay, sp_users.firstname, sp_users.lastname, sp_company_data.logo, sp_company_data.maincity, sp_company_data.name, sp_company_data.mainzipcode, sp_company_data.nif, sp_company_data.phone sp_sales_data inner join sp_sales on sp_sales_data.sale_id = sp_sales.id inner join sp_users on sp_sales.client = sp_users.id inner join sp_stores on sp_sales.store = sp_stores.id inner join sp_company_data on sp_company_data.id = '1' it reports me following problem: error in select clause : expression near date missing clause. unable parse query text the preview works fine tableadapter still empty

iphone - How to access UIAlertView action over Application in iOS? -

Image
hello using here uiwebview , load request map . have done when run app first time pop show, attaching image here now want ask how access pop actions (don't allow , ok) ,because default generated first time when app run. don't know how access "ok" button want write code on "ok" button. so please tell me how access these pop buttons in case. implement cllocationmanagerdelegate protocol call event alert button pressed authorization status. locationmanager:didchangeauthorizationstatus: tells delegate authorization status application changed. - (void)locationmanager:(cllocationmanager *)manager didchangeauthorizationstatus:(clauthorizationstatus)status there various authorization status provided mention follows : typedef enum { kclauthorizationstatusnotdetermined = 0, kclauthorizationstatusrestricted, kclauthorizationstatusdenied, kclauthorizationstatusauthorized, } clauthorizationstatus; kclauthorizationstatusnotdeter...

postgresql - Use deferred reflection in SQLAlchemy 0.7 with cached metadata -

in project delaretive base deferred reflection being used. from sqlalchemy import ( create_engine, table, column, integer, biginteger, text, datetime, numeric, string, ) sqlalchemy.dialects.postgresql import cidr sqlalchemy.orm import mapper, sessionmaker, relationship, backref sqlalchemy.orm.mapper import configure_mappers sqlalchemy.orm.util import _is_mapped_class sqlalchemy.pool import nullpool, queuepool sqlalchemy.ext.declarative import declarative_base, declared_attr sqlalchemy.schema import sequence sqlalchemy.ext.hybrid import hybrid_property # class taken sqlalchemy recipes class declarativereflectedbase(object): _mapper_args = [] @classmethod def __mapper_cls__(cls, *args, **kw): cls._mapper_args.append((args, kw)) @classmethod def prepare(cls, engine): while cls._mapper_args: args, kw = cls._mapper_args.pop() klass = args[0] if args[1] not none: table = args[1] ...

r - Mutate all columns applying type conversion -

i have dataframe , convert column types. actualy have function : library(dplyr) convertdftypes <- function(obj, types) { (i in 1:length(obj)){ fun <- switch(types[i], character = as.character, numeric = as.numeric, factor = as.factor, integer = as.integer, posixct = as.posixct, datetime = as.posixct) name <- names(obj)[i] expr <- paste0("obj %<>% mutate(", name, " = fun(", name, "))") eval(parse(text = expr)) } return(obj) } mydf <- data_frame(date = seq(sys.date() - 4, sys.date(), = 1), x = 1:5, y = 6:10) coltypes <- c("character", "character", "integer") str(mydf) # classes ‘tbl_df’, ‘tbl’ , 'data.frame': 5 obs. of 3 variables: # $ date: date, format: "2015-05-11" "2015-05-12" ... # $ x : int 1 2 ...

css - cant center image in magento catalog -

i have magneto store custom template; , increased size of catalog image; after images shifted left , not center please inspect image link : http://www.sajidat.com/topsandsweaters.html tried add this text-align: center; , margin: 0px auto; how can center images , keep image compatible responsive rules? appreciated.

php - Displaying Tags on taxonomy page -

i have option in cms, add tags custom post type single page. now, wanting display tag 'featured' item. so, in taxonomy-'filename', use following code gathers tags , displays them in taxonomy page: <?php $args = array( 'tag_slug__and' => array('sector1'), 'post_type' => array( 'sectors' ) ); $loop = new wp_query( $args ); while ($loop->have_posts() ) : $loop->the_post(); ?> <a href="<?php echo get_permalink(); ?>"> <?php echo "<div class='col-md-6' style='margin-bottom:20px;'>"; ?> <div class="row mobilemargin"> <div class="categorytiletextsector1"> <div class="col-md-6 col-sm-6 col-xs-12 nopr"><?php echo get_the_post_thumbnail( $page->id, 'categoryimage', array('class...

zend framework - Undefined index: HTTP_X_URL_BEFORE_REWRITE -

i have application written in zend framework. when try open index file give me error: php notice: undefined index: http_x_url_before_rewrite in c:\inetpub\wwwroot\test\library\zend\controller\request\http.php on line 326 php notice: undefined index: http_x_url_before_rewrite in c:\inetpub\wwwroot\test\library\zend\controller\request\http.php on line 326 it`s depends of line in index.php echo $ctrl->dispatch(); because when coment it, application give me white site. $ctrl is: $ctrl = zend_controller_front::getinstance(); $ctrl->setbaseurl('/test'); $ctrl->throwexceptions(true); $ctrl->registerplugin(new dpcpluginauth($auth, $acl)); $ctrl->setcontrollerdirectory($config->controllers->toarray()); echo $ctrl->dispatch(); and function of liblary zend localized on zend/controller/request/http.php , name public function setrequesturi please me ... don't know what's incorrect in code , means message. my mod_rewrite mod...

facebook - Get data off completionhandler - FBRequestConnection -

i found lot of information concerning completionhandlers. however, don't yet how handle in case. maybe can me. i'm trying list of facebook friends , store in array. getfacebookfriends func getfacebookfriends() -> nsmutablearray { var retfriendids:nsmutablearray = [] fbrequestconnection.startformyfriendswithcompletionhandler { (connection:fbrequestconnection!, result: anyobject!, error:nserror!) -> void in if (error == nil){ var resultdict = result as! nsdictionary self.data = resultdict.objectforkey("data") as! nsarray var friendids:nsmutablearray = [] (var = 0; < self.data.count; i++) { let valuedict : nsdictionary = self.data[i] as! nsdictionary let id = valuedict.objectforkey("id") as! string friendids.addobject(id string) } retfriendids = friendids } } return retfriendids } ...

ios - No access token (session) upon ParseUI login with Facebook v4 -

using parse ui 1.1.3 (with parse 1.7.2) , facebook v4, have problem upon login facebook. code basic: let logincontroller = pfloginviewcontroller() logincontroller.delegate = self logincontroller.fields = pfloginfields.usernameandpassword | pfloginfields.passwordforgotten | pfloginfields.loginbutton | pfloginfields.facebook | pfloginfields.signupbutton | pfloginfields.dismissbutton logincontroller.facebookpermissions = ["public_profile", "user_friends"] logincontroller.loginview!.logo = uiimageview(image: uiimage(named: "icon_parse")) self.presentviewcontroller(logincontroller, animated: true, completion: nil) when logging via facebook, there no visual error. retrieve parse user pfuser.currentuser() , facebook access token empty fbsdkaccesstoken.currentaccesstoken() . is bug parse sdk ? it parse bug, corrected in parse 1.7.3 (but update makes parse crash reporting crash...)

copy - How I can compare and move data from A to B in Powershell older than x Days? -

i have problem powershell script. ;( want delete/ move/ compare powershell. here idea: if start script remove empty folder a. after want move data b x days older. (here first problem) if make copy works fine. a other idea compare , b , diffrend copy or move. (but don't know how can this) here code: function removefiles($source,$destination){ $elements = get-childitem $source -recurse foreach($element in $elements){ if(($element.psiscontainer) -and (!(get-childitem -recurse -path $element.fullname))){ write-host "delete: " $element.fullname remove-item $element.fullname -confirm:$false } } } function copyfiles($source,$destination,$days){ $elements = get-childitem $source -recurse $lastwrite = (get-date).adddays(-$days) foreach($element in $elements){ if($element.creationtime -le $lastwrite){ $targetfile = $destination + $element.fullname.substring($source.length) ...

c# - Preventing a user from deleting, modifying, ext -

i need make program reads data text file , changes program state according specific data found in text file, program needs privileges read, write , create text file. i want users or other software prevented deleting, modifying, or copying file. how begin implement this? you can achieve in 3 ways: 1) application starts filehandle , lock file. of course work if applications runs (for example service) time 2) adjust priviledges in files security tab , set read only. create technical user write access (works best in domains). open file in program technical user while using impersionation (windowsimpersonationcontext). using simple: using (new impersonation(domain, username, password)) { // whatever want } a sample class windowsimpersonationcontext (should work charm): [permissionset(securityaction.demand, name = "fulltrust")] public class impersonation : idisposable { private readonly safetokenhandle _handle; private readonly windowsimpersonat...

What does python sys getsizeof for string return? -

what sys.getsizeof return standard string? noticing value higher len returns. i attempt answer question broader point of view. you're referring 2 functions , comparing outputs. let's take @ documentation first: len() : return length (the number of items) of object. argument may sequence (such string, bytes, tuple, list, or range) or collection (such dictionary, set, or frozen set). so in case of string, can expect len() return number of characters. sys.getsizeof() : return size of object in bytes. object can type of object. built-in objects return correct results, not have hold true third-party extensions implementation specific. so in case of string (as many other objects) can expect sys.getsizeof() size of object in bytes. there no reason think should same number of characters. let's have @ examples: >>> first = "first" >>> len(first) 5 >>> sys.getsizeof(first) 42 this example co...

Android : FATAL EXCEPTION: main -

i new in android studio. creating tab swipe. while executing getting error fatal execption. logcat 2497-2497/com.polus.binil.test e/androidruntime﹕ fatal exception: main process: com.polus.binil.test, pid: 2497 java.lang.runtimeexception: unable start activity componentinfo{com.polus.binil.test/com.polus.binil.test.mainactivity}: java.lang.nullpointerexception @ android.app.activitythread.performlaunchactivity(activitythread.java:2184) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2233) @ android.app.activitythread.access$800(activitythread.java:135) @ android.app.activitythread$h.handlemessage(activitythread.java:1196) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:136) @ android.app.activitythread.main(activitythread.java:5001) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) ...

c# - How do I reference method parameters in a method summary when writing xml documentation? -

suppose have method follows: /// <summary> /// here want reference parameter <see cref="personid"/>. /// </summary> /// <param name="personid"> /// person id. /// </param> /// <returns> /// <see cref="person"/>. /// </returns> public person getperson(int personid) { } when publish xml documentation using sandcastle, cref: <see cref="personid"/> gets converted [!:personid] . the warning in sandcastle is: 'unknown reference link target' any advice? thanks. use <paramref> <paramref name="personid"/>

node.js - How to remove node version 0.12 from Ubuntu? -

i had installed node js 0.12 getting harmony features. on project development, using nvm can have multiple node versions. have made default version 0.10.34. , whenever type command: node --version i getting version 0.10.34. fine. but on installing of packages node-inspector, following warning coming , debugger not working on installing. engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.3","npm":"2.9.1"}) the debugger gives error like: error: cannot find module '/usr/lib/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.4/node-v11-linux-x64/debug.node' runtime.getproperties failed. referenceerror: frame_index not defined according npm installer, version still 0.12. have searched lot remove version cannot find working solution. execute sudo apt-get remove nodejs to uninstall 0.12.x version of nodejs. if experience mine on ubuntu 14.04,that ...

javascript - Something I don't understand about 'use strict' and this -

as far know, declare in javascript, belongs global object (unless declare inside of object, object belong window object, , whatever declare inside of it, object), so, inside of browser environment, global object window . say declare: var x = 'hi' this accessed with: x or window.x and both absolutely same, right? why, 'use strict' , when returning this 'global' variable, can window object if specify said function belongs window ? function fun() { 'use strict'; return this; } fun(); // undefined window.fun(); // window object // aren't both absolutely same? also, why function return undefined , if function supposed belong obj ? obj = { method: function () { 'use strict'; function yeah() { // doesn't belong obj? return this; // doesn't seem 'yeah' } // belongs window. return yeah(); } }; thanks. so why, 'use str...

messagebroker - WMBT msg flow class inherit error -

i'm trying build websphere message broker i've stumbled weird issue. when using mqsicreatebar create bar file build returns following error trice (three times, different problem number): problem 22: resource - /errorhandlinglib/error/handling/errorhandler.subflow; error message - class should inherit mbjavacomputenode.. i have found solution in 1 of forums stated adding full class path mbjavacomputenode (as in: extends com.ibm.broker.javacompute.mbjavacomputenode) problem should solved. older wmbt version , neither this, neither of new ibm released wmbt fixes helped. the error printing 3 times because java compute node in sublfow used in 3 different routes. websphere message broker toolkit used v8.0.0.5 the classes, assign java compute nodes in flows must extend mbjavacomputenode class. error says have java computes not referencing such classes. i suggest creating classes java compute nodes wizard, starts when double click newly inserted java compute nod...

java - how to get only selected table from stored procedures? -

i have stored procedure following create procedure [dbo].[spconfiguration_test] @id int select empid,name employee; select * address; i wanted call stored procedure jpa.so did this daocode public list test() { string execproce="exec spconfiguration_test 1"; system.out.println(execproce); query query = entitymanagerutil.entitymanager.createnativequery(execproce); return query.getresultlist(); } service class code list test=servicedaoimpl.test(); when debug list(test) size showing 1 , when run gives me records of 1st table(select empid,name employee;) but want details of 2nd table when stored procedure executed. can 1 guide me please? if merge 2 queries one. must work. example: select e.empid ,e.name ,a.* employee e ,address e.empid = a.empid;

jsf - How to do ThemeSwitcher using Primefaces -

Image
this demo i'm trying do. http://www.primefaces.org/showcase/ui/misc/themeswitcher.xhtml my html code: <h:form > <h:panelgrid columns="2" cellpadding="10"> <h:outputtext value="basic:"></h:outputtext> <p:themeswitcher effectspeed="normal" effect="fade" style="width:165px" id="defaultswitcher" value="#{themeswitcherbean.theme}"> <f:selectitem itemlabel="choose theme" itemvalue="" /> <f:selectitems value="#{themeswitcherbean.themes}" /> <p:ajax global="false" listener="#{themeswitcherbean.savetheme}" /> </p:themeswitcher> </h:panelgrid> <p:separator /> <p:dialog header="dialog" widgetvar="dlg" minheight="40" modal="true"> <h:outputtex...