Posts

Showing posts from September, 2012

reactjs - 3 legged OAuth with React and Redux -

what's accepted method of authenticating oauth2 in react using redux? my current setup involves wrapping react-router components using redux-auth-wrapper, , if user not authenticated, dispatching action makes necessary external url request oauth provider (google in case). oauth2 requires sending callback url request, i've set react-router url endpoint/component that, when oncomponentdidmount fires, dispatches actions parse returned hash comes oauth provider, store data in redux store, , redirect user page requested, stored in state parameter of oauth request. this seems hacky. difficult manage oauth2 callback url between production , development environments. have slick oauth2 workflow working? p.s. need auth token client can used make client side api requests use token check user has access resources. i've come better solution involves opening new window oauth login form, polled parent window see if has redirected callback url. once has, can capture ch

winforms - Making icon for a Windows Form: How to make it show up correctly? -

ok, have built windows form application. want icon it. use icon editor built visual studio 2012. draw out nice , purdy. once done, have .ico file , make default icon project, , icon 1 winform in application. unfortunately, not show have created it! displayed default icon file existed before modified in icon editor. it's 32x32 4 bit icon. if change extension .bmp shows default. it looks vs icon editor editing else, not appearance of icon. can tell me doing wrong? i used have progam called iconart create icons looked icons when used them in vs. iconart abandonware , won't run on 64bit windows workstation. since didn't answers within time hoping, posted question in msdn visual studio forum, , got answer thought should post here. credit reed copsey, jr , answer! this it: you'll need put design in of different versions. ico files contain multiple versions of same image, different screen resolutions. my personal preference not u

ios - Why is my UILabel nil? -

Image
i have link 3 uilabels in table cell custom class, separate file vc (view controller). listoftasks dictionary tuples inside. here's relevant code: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("mycustomtableviewcell", forindexpath: indexpath) as! mycustomtableviewcell let (name,description,date) = listoftasks[indexpath.row] cell.title.text = name //here error: "fatal error: unexpectedly found nil while unwrapping optional value" cell.subtitle.text = description cell.date.text = date return cell } why giving me error? i did check connections already. p.s. person thinking duplicate of this , answer question doesn't solve problem. edit: code mycustomtableviewcell : import uikit class mycustomtableviewcell: uitableviewcell { @iboutlet weak var title: uilabel! @iboutlet weak var subtitle: uilabel

ios - UICollection View Detail View -

my problem this. have collection view, works. not know how information passed details page. have tried 'prepareforsegue' method, created browser class have no clue how information passed view controller array created. please advise. @interface maincollectionviewcontroller () @end @implementation maincollectionviewcontroller @synthesize menubtn; - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { self = [super initwithnibname:nibnameornil bundle:nibbundleornil]; if (self) { // custom initialization } return self; } - (void)viewdidload { [super viewdidload]; uirefreshcontrol *refreshcontrol = [[uirefreshcontrol alloc] init]; [self.collectionview addsubview:refreshcontrol]; // additional setup after loading view. nsstring *filename = [nsstring stringwithformat:@"%@/main.rss", [mainutil getdocumentroot]]; _articlelistmain = [nsarray arraywithcontentsoffile:filename]; // additi

c# - Remove 'Black Bar' From Any Window -

Image
this question has answer here: disable visual studio 2015 debug option 4 answers so whenever try , run wpf application in visual studio 2015, black box thingy appears: here's icons say: how rid of it? thanks. you're looking @ ui debugger , lets similar things snoop , excellent tool has saved me lot of trouble in past. that being said, have 2 options disable it: detach debugger, or run without debugging see answers in post

contact form - Wordpress Multi Step Survey -

i'm new web development , i've been working quite while now. i'm using wordpress , need on doing multi step survey on wordpress one. sample thank guys ! you can use plugins, search not find out multiple steps form jquery wordpress. here contact form 7 multiple step plugin: https://wordpress.org/plugins/contact-form-7-multi-step-module/ and here demo: http://webheadcoder.com/contact-form-7-multi-step-form/ it's not jquery multiple steps form fast transfer movement, can use survey purpose. contact form 7 not save submitted data database, can find extension it: https://wordpress.org/plugins/contact-form-7-to-database-extension/ survey data use , analyze it. i hope helps.

php - How to create 4 dymanic pages using database values -

i have 4 pages(about, interviews, ask q, contact) per people , have 250+ people , takes long time create new people site what best way have 4 pages(about, interview, ask q, contact) loops through database people , creates pages on fly when user requests them? here's example of person on site http://starsqa.com/aaron-cole i'm thinking of using $_get variables database , changing url using .htaccess rewriting, have no clue how or if it's possible the site uses html, php, mysql , oop what best way achieve this? i have added this: <?php session_start(); error_reporting(e_all ^ e_notice); include("db_conn.php"); $qry_string = "select * stars inner join roles on roles.starid = stars.starid stars.starid = ?"; $prep = $pdo_conn->prepare($qry_string); $prep->execute(array($_get['id'])); $result = $prep->fetch(pdo::fetch_assoc); $pieces = explode(" ", $result['starname']); $gender = "him"; ?>

probability - Displaying only intersections between two sets of permutations in MatLab -

being supplied 2 strings, 'goosegun' , 'goslingnun' , find every permutation of pick 3 of each string, display only intersections between two. doing without using intersect(comboperm1,comboperm2,'rows') , want know how use it. guess main problem figuring out how display text. for variables use in code, here's how they're found. r = 3; numperms = factorial(r); elements1 = 'goosegun'; n1 = numel(elements1); numcombos1 = factorial(n1) / (factorial(n1-r)*factorial(r)); lettercombos1 = nchoosek(elements1,r); elements2 = 'goslingnun'; n2 = numel(elements2); numcombos2 = factorial(n2) / (factorial(n2-r)*factorial(r)); lettercombos2 = nchoosek(elements2,r); counter = -1; here code works (i think). % goes through each combination = 1 : numcombos1 comboperm1 = perms(lettercombos1(i,:)); % goes through each permutation of combination j = 1 : numperms k = 1 : numcombos2 comboperm2 = perms(lettercomb

java - How do I do matchTemplate by iterating all image in a folder? -

i want match character image cropped image set of template image of alphabets folder. used template matching opencv match them. can cropped image mapped first image template folder , go next image image. my question how can iterate through template folder cropped image find correct character match to. , using matchtemplate correct way use or need use other function? is want? here iterate on directory , break loop if template_matching() returns true import java.io.file; file dir = new file("folder-with-images"); file[] files = dir.listfiles(); for( int i=0; < files.length; i++ ){ string path = files[i].getabsolutepath(); // check file type , work jpg/png files if( path.tolowercase().endswith(".jpg") || path.tolowercase().endswith(".png") ) { pimage image = loadimage( path ); // if template_match(image), break } } }

How can I get VM instance running time in openstack via python API? -

i need small billing report usage of vms inside openstack after stopped, far find way flavor information (vcpu, disk, memory) instance name. and want know vm's startup time calculate now. are there ways fetch openstack python api ? it nice if can paste code well. (i got answer china-openstack community , , shared here) in novaclient usage module , instance (active or terminated) can fetched list api, detail information fetched via get api, not clear information exposed via python document. fortunately openstack api : os-simple-tenant-usage tells data structure, uptime want. "tenant_usage": { "server_usages": [ { ... (skipped) "uptime": 3600, "vcpus": 1 } ], openstack dashboard (at least folsom version) use api well.

iphone - UIImagePickerController interfaceOrientation always come up as portrit -

i trying capture current orientation of uiimagepickercontroller being presented, , changing overlay view's hidden property accordingly. if([notification.name isequaltostring:@"uideviceorientationdidchangenotification"]) { uiinterfaceorientation orientation = self.cameraimagepicker.interfaceorientation; if(orientation == uiinterfaceorientationportrait) { self.cameraimagepicker.cameraoverlayview.hidden = no; } else { self.cameraimagepicker.cameraoverlayview.hidden = yes; } } however, orientation == uiinterfaceorientationportrait if rotate camera, method called every time device rotates. note: application supports portrait orientation according project file, rotation somehow still supported uiimagepickercontroller any issue appreciated! after ios6, apple changed orientation api. can try method in appdelegate, hope can you. - (nsuinteger)application:(uiapplication *)application supportedin

iphone - iOS Quartz 2D: draw an image simulating y axis rotation? -

Image
i want this: draw image using quartz 2d, image rotated according y axis in 3d space, this: is quartz 2d capable this? no, cannot directly quartz 2d. supports affine transformations , preserve parallel lines. (it's clear want parallel lines on top , bottom edges of figure become non-parallel.) the term you're looking "perspective transformation", if want search other ways achieve result.

c# - Passing multiple array values to a web api controller using a single model attribute -

i have $scope object bellow $scope.array=[{"id":"1","id":"2","id":"3"}]; what want pass these values following sql query select * table id in("here need above 3 values 1 after another") how can this? create class public class myid { public int id {set;get;} } pass web api public void submitid(list<myid> ids){ // rest of things var id = string.join(",", ids.select(x => x.id).toarray()); var query="select * table id in('"+id+"')"; }

vector - vectorize lookup in matlab 2-d matrix -

hi having trouble @ vectorizing following matlab code segment for i=1:n; vec(i) = mat(index(i),i); end; where index permutation of 1:n. code slow in form. have checked notes on vectorization tricks in matlab no avail might missing obvious. in advance! you can use index , 1:n relevant parts of mat . vec = mat(index, 1:n); if n number of columns in mat , can do: vec = mat(index,:);

Loading navbar into html page from different folders using javascript -

the following html source code structure. products software.html hardware.html index.html main-navbar.html scripts load-main-nav.js i have moved main navigation bar seperate file because repeats in every page , using javascript load respective pages. have empty div in pages want load navbar. <div id="main-nav"></div> i have managed load navbar using jscript index.html page. when click software link goes respective page not show navigation bar. when changed javascript $("#main-nav").load("../main-nav.html"); displays navbar software page not index.html. there way change location part can use same script files in folders in project? main-navbar.html <nav class="navbar navbar-default mc-header navbar-static-top"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="coll

amazon web services - How to make peer connection between two AWS VPC's which has same CIDR? -

i have tried make peer connection between 2 aws vpc's has same cidr. while i'm creating peer connection says cannot create peer connection between 2 vpc's because of same cidr. this not possible. precondition vpcs not have overlapping cidr block. please refer below amazon documentation same. http://docs.aws.amazon.com/amazonvpc/latest/peeringguide/vpc-peering-overview.html

Spring-data-solr config -

i met problem in studying spring data solr,this configuration class: @configuration @enablesolrrepositories(basepackages={"cn.likefund.solr.repository"}, multicoresupport=true) public class solrcontext { static final string solr_host = "http://192.168.11.157:8080/solr"; @bean public solrclient solrclient() { return new httpsolrclient(solr_host); } } and repository: package cn.likefund.solr.repository; import java.util.list; import org.springframework.data.solr.repository.solrcrudrepository; import cn.likefund.solr.model.activity; public interface activityrepository extends solrcrudrepository<activity, string>{ list<activity> findbyname(string name); } when start application,the message in console this error when delete method findbyname in repository,the application start no problem, want method findbyname worked,anybody know should problem? here activity class: @entity @solrdocument(solrcorename ="core_ac

android - Navigation Drawer shows error to the Java File when maps integrated -

i trying have navigation drawer, on of activity current location. when set code in drawer if statement error , doesnt give solution. this mainactivity: @suppresswarnings("statementwithemptybody") @override public boolean onnavigationitemselected(menuitem item) { // handle navigation view item clicks here. int id = item.getitemid(); fragmentmanager fragmentmanager = getfragmentmanager(); if (id == r.id.nav_home_layout) fragmentmanager.begintransaction().replace(r.id.newframelayout, new mapsactivitytest()).commit(); else if (id == r.id.nav_earning_layout) { fragmentmanager.begintransaction().replace(r.id.newframelayout, new earningactivity()).commit(); } else if (id == r.id.nav_campaign_layout) { fragmentmanager.begintransaction().replace(r.id.newframelayout, new campaignactivity()).commit(); } else if (id == r.id.nav_vehicle) { fragmentmanager.begintransaction().replace(r.id.newframelayout, new vehicle()).c

module - ejabber - not able to start ejabberd when mod_rest enabled -

i quick testing using mod_rest ejabberd 16.04 on os x yosemite 10.10.5. seems not working expected. following debug log : 2016-05-25 12:06:33 =crash report==== crasher: initial call: application_master:init/4 pid: <0.37.0> registered_name: [] exception exit: {{bad_return,{{ejabberd_app,start,[normal,[]]},{'exit',{undef,[{mod_rest,mod_opt_type,[db_type],[]},{gen_mod,db_type,3,[{file,"src/gen_mod.erl"},{line,317}]},{ejabberd_riak_sup,'-is_riak_configured/1-fun-3-',2,[{file,"src/ejabberd_riak_sup.erl"},{line,74}]},{lists,any,2,[{file,"lists.erl"},{line,1224}]},{ejabberd_riak_sup,is_riak_configured,1,[{file,"src/ejabberd_riak_sup.erl"},{line,72}]},{lists,any,2,[{file,"lists.erl"},{line,1224}]},{ejabberd_riak_sup,start,0,[{file,"src/ejabberd_riak_sup.erl"},{line,48}]},{ejabberd_app,start,2,[{file,"src/ejabberd_app.erl"},{line,65}]}]}}}},[{application_master,init,4,[{file,"application_mas

ios - AVAssetExportSession in share extension -

i'm trying use avassetexportsession on video selected in share extension , getting error domain=nsurlerrordomain code=-3000 "cannot create file" userinfo={nslocalizeddescription=cannot create file, nsunderlyingerror=0x14811fdb0 {error domain=nsosstatuserrordomain code=-12124 "(null)"}} but can create file manually @ same nsurl without error. here function i'm using func reencodevideo() { let videoasset = avurlasset(url: video.url) let videotrack = videoasset.trackswithmediatype(avmediatypevideo)[0] avassettrack print(videotrack.estimateddatarate) let exportsession = avassetexportsession(asset: videoasset, presetname: avassetexportpreset1920x1080) guard let outputurl = uploadablefileurl else { return } let filemanager = nsfilemanager.defaultmanager() // let created = filemanager.createfileatpath(outputurl.path!, contents: nil, attributes: nil) if let path = outputurl.path filemanager.fileexistsa

android - Commonsware camera preview demo: no preview after device on/off -

i see bug: when camera in preview mode, , user presses on/off, camera preview stops , not start. an obvious suggestion see other people do; have consulted https://github.com/commonsguy/cw-advandroid/tree/master/camera/preview/ , see demo has same bug ( android 4.0.3 ). a direct link java source: https://github.com/commonsguy/cw-advandroid/blob/master/camera/preview/src/com/commonsware/android/camera/previewdemo.java question: how can 1 fix bug? preview mode must working after device on/off. upd: bug not show if first change activity , press on/off on activity. upd2: after on/off, startpreview() invoked, see message system: d/@@ (13428): startpreview() cameraconfigured=true camera=android.hardware.camera@412f66f0 e/camhw ( 2135): preview window null! which means bad happen in depths of system (although message may device-specific). udp3: after on/off, no method surfacecallback invoked. maybe makes difference. upd4: [seen not @ camera demo] if switch different

c# - HttpStatusCodeResult namespace not found -

namespace not recognized in class library project (eventservice.cs) when use in controller (mvc project) works fine , adds assembly properly: using system.net; here code eventservice.cs (class library project serves interface controller) public event geteventbyid(int? id) { if (id == null) { return new httpstatuscoderesult(httpstatuscode.badrequest); } var @event = (from u in db.event u.eventid == id select u).firstordefault(); if (@event == null) { return httpnotfound(); } return @event; } i've tried deleting bin , obj folder in projects , rebuild - no luck.same code works ok in mvc projects. the httpstatuscoderesult part of system.web.mvc namespace. reference if have added mvc in project. here can find more details: https://msdn.microsoft.com/en-us/library/system.web.mvc.httpstatuscoderesult(v=vs.118).aspx

c++ - Get coordinates of scatter points on a graph -

is there way pixel cordinates of points in qcpdatamap ? or there way extract cordinates of scattered points in graph ? use qcpaxis::pixeltocoord of xaxis , yaxis convert graph coordinates px. if need global coordinates, use qwidget::maptoglobal after that.

php - how to load the default active class with href, while loading the page -

<ul class="nav nav-pills nav-stacked project-body" style="background-color: white"> <?php foreach($get_policies $policies) : ?> <li role="presentation" class="<?php echo $policies['policies_id'] == $policies_id ? "active" : "" ?>"><a href="<?php echo base_url().'policies/index/'.$policies['policies_id'] ?>"><?php echo $policies['policies_title'] ?></a> </li> <?php endforeach; ?> </ul> i have above code snippet, can display policies in vertically. want first policies should loaded while loading page. make class active default policies loaded. you can use nth-child doing this $('.project-body li:first-child').addclass('active');

c - Not able to find the bug in my multithreading program? -

i have implemented simple multithreading program, producer access global variable , fills it, after consumner prints it. i have written main #include<stdio.h> #include<stdlib.h> #include<pthread.h> void *prod(void); void *cons(void); unsigned int my_var = 0; pthread_mutex_t mut = pthread_mutex_initializer; int main() { pthread_t th1, th2; int status; status = pthread_create(&th1, null, (void*)prod, null); if(status) { printf("error creating thread 1 : %d\n", status); exit(-1); } status = pthread_create(&th2, null, (void*)cons, null); if(status) { printf("error creating thread 2 : %d\n", status); exit(-1); } pthread_join(th1, null); pthread_join(th2, null); return 0; } my producer function goes : void *prod(void) { while(1) { pthread_mutex_unlock(&mut); printf("enter value : "); scanf("%

c# - Freezing UI and odd thread behavior (WPF) -

i building application wpf , c# , have run odd problem. there multiple threads in application, many of created through system.timer timers. there particular action can take cause ui of application freeze; ui freeze permanently when happens. oddest thing though if check number of available threads threadpool.getavialbalethreads , number of available threads continuously diminish if don't stop application. of threads in application created either via timer or task.startnew method. there several parts of code spin new threads, try show of them here in abbreviated way. datamanager.cs // 2 system.timers.timer(s) handle generating data values on 3 second , 1.5 second intervals. _averagetimer = new system.timers.timer(1000 * 3); _averagetimer.elapsed += generatenewaveragepoint; _averagetimer.enabled = false; _flowgentimer = new system.timers.timer(1000 * 1.5); _flowgentimer.elapsed += generatenewflowset; _flowgentimer.enabled = false; // have primary work loop in class create

javascript - Can not remove the expected row from table using Angular.js -

i have issue.i need remove 1 particular row table structure of app using angular.js.my code present inside below plunkr link. code present here in above code create 3 row monday , fill required data should different each row.delete middle row using - button,you can check there last row subcategory showing wrong.this problem.i need if deleting particular row row data should remove array , other row remain constant selected data was.please me. i edited plunker : https://plnkr.co/edit/4okacc?p=preview your problem in use of $index in ng-repaet. when delete middle row $index of third row change , reference wrong catgeory. change plunker use function return subcategories depends on selected category : $scope.getsubcategoryfor = function(answer) { if(!answer.category) { return []; } console.log(answer); var result = $filter('filter')(subcategories, {id:answer.category.id}); console.log('result', result); return result; } and use in html :

php - imagecolorallocate returns 0 for background color -

i'm trying create bar-code , i'm having issue it. this code $number = $this->uri->segment(3); $width = 200; $height = 80; $img = imagecreate($width, $height); $white = imagecolorallocate($img, 255, 255, 255); // return 0 $black = imagecolorallocate($img, 0, 0, 0); // return 1 imagettftext($img, 36, 0, 10, 50, $black, $barcode_font, $number); imagettftext($img, 14, 0, 40, 70, $black, $plain_font, $number); header('content-type: image/jpeg'); imagejpeg($img); imagedestroy($img); but isn't creating bar-code, said : image cannot displayed because contains errors. please give me idea solve issue, still cannot find solutions

java - Difference between Thread.currentThread().getId() and Kernel32.INSTANCE.GetCurrentThreadId() -

what difference between following 2 lines of code thread id? thread.currentthread().getid(); kernel32.instance.getcurrentthreadid(); to abstract underlying platform jvm sits on top of operating system. w32api os interface/library implemented java , kernel32.instance.getcurrentthreadid() gives id of operating system thread calling line. java language provides mechanisms multi-threading. thread.currentthread().getid() gives id of jvm thread. depending on implementation of w32api- of kernel32 one- , maybe other factors os threads may or may not map vm threads.

delete custom customer attribute in magento -

i have created custom attribute customer in magento. i have accidentally set wrong type attribute. now want either modify attribute or delete 1 , create new attribute. can 1 tell me whether can delete or modify custom attribute in magneto or not? thanks in advance. you can create upgrade script in 1 of modules content: $this->updateattribute('customer', 'attribute_code_here', 'type', 'varchar'); //or other type basically can change attribute customers, categories & products this; $entitytype = 'customer';//or catalog_category or catalog_product $attributecode = 'attribute_code_here'; $changewhat = 'field_name_here'; $changeinto = 'new value here'; $this->updateattribute($entitytype, $attributecode, $changewhat, $changeinto); to remove attribute run this: $this->removeattribute('customer', 'attribute_code_here'); it follows same rules above.

sockets - c# length of data througth StreamWriter -

i have written code client server using tcp/sockets in c# working fine. problem why able send limited size data client server @ single instance. following server code public class asynchioserver { // server port number const int port = 8001; // server ip address const string ip = "127.0.0.1"; const int maxbuffer = 10000; static ipaddress ipaddress = ipaddress.parse(ip); static tcplistener tcplistener = new tcplistener(ipaddress, port); static void listeners() { try { socket socketforclient = tcplistener.acceptsocket(); if (socketforclient.connected) { console.writeline("client : " + socketforclient.remoteendpoint + " connected server."); networkstream networkstream = new networkstream(socketforclient); system.io.streamwriter streamwriter = new system.io.streamwriter(networkstream); system.io.streamreader streamreader = new system.io.streamreader(networkstream);

which one is the best for mysql connection? -

here question below. case 1: always make connection or disconnection every tcp client. case 2: only make 1 connection , share connection every tcp client. which 1 best performance? thanks! i assume architecture n-tier, like: db_server <---> application <----> many_clients ...and consider solution in application part? assuming so, still depends: from performance point of view better have fewer connections. gain of squeezing multiple client requests single connection may small if network has low latency between db_server , application . the logic of application ensure single (multiplexed) connection can simple, if every client requires 1 query. may complex if communication clients requires doing many sql queries, , if intervene. cost (in terms of aplication complexity) may out-weight small benefits in network performance. so have consider gain , cost... result depends heavily on both above factors. of course, can hit connection-table siz

c# - Assembly fails to load in restricted AppDomain -

i trying load assembly restricted appdomain. if not specify restrictions, assembly load correctly: var permissionset = new permissionset(system.security.permissions.permissionstate.unrestricted); appdomain targetappdomain = appdomain.createdomain("lockeddomain" + guid.newguid().tostring("n"),null,domainsetup,permissionset,null); var instance = (iremotefilterclass) targetappdomain.createinstancefromandunwrap(tempassemblypath, "compiledcode.compiledclass"); howevere want lock down created appdomain possible, i.e. give permissions absolutely necessary. if specify permissionset restrict permissions, assembly fails load: var permissionset = new permissionset(system.security.permissions.permissionstate.none); permissionset.addpermission(new fileiopermission(fileiopermissionaccess.read, tempassemblypath)); permissionset.addpermission(new fileiopermission(fileiopermissionaccess.pathdiscovery, tempassemblypath)); permissionset.addpermission(new fileioperm

Java - Why that URL == null -

welcome, have problem code. url shoud hold path resources not initialized can me solving problem? here code of loading class: import java.awt.image.bufferedimage; import java.io.ioexception; import java.net.url; import javax.imageio.imageio; public class bufferedimageloader { public bufferedimage loadimage(string pathrelativetothis) throws ioexception { url url = this.getclass().getresource(pathrelativetothis); bufferedimage img = imageio.read(url); return img; } } and errors getting, like: exception in thread "awt-eventqueue-1" java.lang.illegalargumentexception: input == null! @ javax.imageio.imageio.read(unknown source) @ rpg.bufferedimageloader.loadimage(bufferedimageloader.java:12) @ rpg.character.draw(character.java:40) @ rpg.main.paint(main.java:210) @ rpg.main.update(main.java:190) @ sun.awt.repaintarea.updatecomponent(unknown source) @ sun.awt.repaintarea.paint(unknown source) @ sun.awt

java - How to print the content of an object -

when start program, gives me link object, while want content. where's mistake? i think problem lies in storage.addrecord(record) in readerxls.class . result: reading on start reading storage work2obj.record@2910d926 . public class start { public static void main(string[] args) { system.out.println("start reading xls"); readerxls read = new readerxls(); storage storage; storage = read.readxls("text1obj",0,1); system.out.println("reading over"); system.out.println("start reading storage"); system.out.println(storage.getrecord(1)); } } . public class storage { list<record> record; public storage(){ this.record = new arraylist<record>(); } . public record getrecord(int number){ return this.record.get(number);

ios - MSSyncTable insert -

i have dictionary dict, info (lldb) po dict { createdat = "2016-05-25 06:29:16 +0000"; deleted = 0; diskid = "f54b4bd9-694b-4856-8b8f-7f3afa18fd2e"; updatedat = "2016-05-25 06:29:16 +0000"; userid = "4f119c15-2370-4ad7-bcbc-2cd4254b356e"; version = "1.0"; } i call mssynctable insert function: -(void)insert:(nonnull nsdictionary *)item completion:(nullable mssyncitemblock)completion; the info saved local db successfully, on mobile service side, received object don't have info version , updatedat , createdat, null, mobile service return error ios app below: "{\"message\":\"the operation failed following error: 'a null store-generated value returned non-nullable member 'version' of type 'saveonpayservice.models.sopuserstoresfavorite'.'.\"}"), nslocalizeddescription=not operations completed successfully} is there know what's going on here? update: server side c

c - Trying to write a program that counts the amount of even numbers in an array and returns the value -

i trying make program count number of numbers in provided arrays. when run program now, return amount of numbers in array, not amount of numbers. reason count_even function doesn't work. can help? #include <stdio.h> int main() { int data_array_1[] = { 1, 3, 5, 7, 9, 11 }; int data_array_2[] = { 2, -4, 6, -8, 10, -12, 14, -16 }; int data_array_3[] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; int data_array_4[] = { 6, 2, 4, 5, 1, -9 }; int data_array_5[] = { 1, 3, 9, 23, 5, -2, 4 }; int result_1 = count_even(data_array_1, 6); printf("data_array_1 has %d numbers.\n", result_1); int result_2 = count_even(data_array_2, 8); printf("data_array_2 has %d numbers.\n", result_2); int result_3 = count_even(data_array_3, 11); printf("data_array_3 has %d numbers.\n", result_3); int result_4 = count_even(data_array_4, 6); printf("data_array_4 has %d numbers.\n", result_4); int resul

MYOB API. Using getrange against server returns localhost in URI -

when use getrange against server uris show localhost. normal? communication error when go forward , want eliminate rather basic item. in advance greg the public address on server needs set correct network address. default seems localhost, links generated server work when opened on server itself. you can change public network address in myob api config file. should located on server @ c:\program files (x86)\myob\api\2.x.x.x\ . xml config file should called myob.accountright.api.windowsservicehost.exe.config . in config file, under <appsettings> there should publicaddressserver key. update corresponding value correct network address or dns name server. lastly, restart myob api service changes take effect. windows service name should myob accountright api service . give try , see if helps! edit: source - http://myobapi.tumblr.com/post/70231017169/how-to-change-config-variables-for-the-desktop-api

ios - Swift: CGPathRelease and ARC -

just updated xcode beta 4, , noticed following compiler error code below: var path = cgpathcreatemutable() ... cgpathrelease(path) 'cgpathrelease' unavailable: core foundation objects automatically memory managed so remove release calls , should fine? or there more i'm missing? , there special cases should aware of arc? the working cocoa data types section of using swift cocoa , objective-c says (emphasis mine): core foundation objects returned annotated apis automatically memory managed in swift— you not need invoke cfretain , cfrelease , or cfautorelease functions yourself . if return core foundation objects own c functions , objective-c methods, annotate them either cf_returns_retained or cf_returns_not_retained . … when swift imports apis have not been annotated, compiler cannot automatically memory manage returned core foundation objects. swift wraps these returned core foundation objects in unmanaged<t> structure

osx - Eclipse won't start after Mac failed to load OS -

so, mac (os x el capitan ver. 10.11) slow day, point itunes lagging in playing song. restarted it. 2-3 hours, slowed down again, restarted again. after that, mac stucked on page gray apple , loading bar below, screen when os loaded. after getting safe mode once, go desktop normally, mac still lagging here , there abnormally. then, tried start eclipse, , won't start. said "an error occurred", , tell me see log. here's said log: https://jpst.it/ipls i've tried suggestions found , none of these work, same error log persists: clean start using -clean erase .metadata on workspace erase .lock on workspace update el capitan 10.11.5 (which blind attempt, because eclipse ran fine before) in case it's related, when back-up projects after happened (the first time succeed reach desktop), 1 of projects failed copy-pasted (it's not cut or move), project actively working on when os slowed down. does have idea have happened? looking @

c# - How to access the swf file when playing in wpf web browser? -

hi here using wpf web browser play swf file , want know how find current frame , total frame of swf file.then how access swf file play/pause. this.mainbrowser.navigate(@"c:\users\admin\desktop\array-file-final020.swf"); this code have used play swf want know possible communicate swf file wpf web browser.

http - Nginx does not response to port 80 -

i've moved debian arch server running in problems. i'm running web applications on nginx following config: vhost: https://gist.github.com/anonymous/46dec … cbdd439ccd nginx.conf: https://gist.github.com/anonymous/54f6d … b0ccbbe3f7 if try enter http://2wickl.de in browser (or curl) i'll strange binary data (%). if directly enter https://2wickl.de i'll correct output (in case https://www.2wickl.de ). when i'm trying http://aasdflaksdflalsfdj.2wickl.de not work. if try https://aasdflaksdflalsfdj.2wickl.de works should. think, nginx not chance redirect or deliver default site on port 80. can give me hints, can have or did wrong? netstat -a -p -n|grep listen delivers: https://gist.github.com/anonymous/54d2d … 0111f1135d information: firewall running, no rules configured. thanks help. regards marove after further investigation found problem: one of server-configurations had http2 enabled http port 80 server { listen 80 http2; lis

ibm bluemix - Setting the _id of cloudant in node-red to ensure order of documents -

Image
i have node-red code works in following way: receives message (json form) , saves cloudant db can make http call can see contents of db this good, problem when saves cloudant, gives random _id, order of documents in db isn't same order came in, random. is there way maybe set _id while saving in node red? or there solution? i want when call http shows in order came in (last first, or first last, doesn't matter). you can set _id function node or change node before passing cloudant out node. but if want them in order arrived add timestamp field , make query node use view sorts documents timestamp

java - Cannot find any provider supporting AES/GCM/NoPadding -

we trying encryption supporting aes/gcm/nopadding in java 7 getting below exception. cannot find provider supporting aes/gcm/nopadding code sample generating cipher instance below. secretkeyspec eks = new secretkeyspec(k, "aes"); cipher c = cipher.getinstance("aes/gcm/nopadding"); c.init(cipher.encrypt_mode, eks, new gcmparameterspec(128, iv)); this cipher not supported java 7 se ( exception solaris ). public static void main(string[] args) throws exception { (provider provider : security.getproviders()) { (map.entry<object, object> entry : provider.entryset()) { if (((string) entry.getvalue()).contains("gcm")) { system.out.printf("key: [%s] value: [%s]%n", entry.getkey(), entry.getvalue()); } } } } you might have @ bouncy castle service provider in case. small snippet using bouncycastle. download bcprov-jdk

mysql - Symfony Doctrine query entries by datetime and timezone -

i've got webservice written symfony. app calls , enters messages have send app @ specific time. cronjob on server runs every minute , checks messages have send. user can define time frame when whants receive messages. i query messages following way: $query = $em->createquery(' select m mybundle:message m inner join m.user u m.active = true , m.nextmessageon <= :now , u.receivemessagesfrom <= :now , u.receivemessagesto >= :now order m.id asc ')->setparameter('now', new \datetime('now')); (for presentation purpose "from time" has before "to time") now i've got problem, user can have different timezone server. is there kind of best practice how handle hole time (datetime) / timezone / server / app problem? , symfony (doctrine) there clean way query items? you should save correct timezone user in database , read this: http://docs.doctrine-project.org/en/late

javascript - Reducing redux-thunk boilerplate -

when writing redux-thunk functions, known thunks there allot of boilerplate abstracted away. example in of our async api calls doing following, without side-effects: export const login_request = 'my-app/auth/login_request'; export const login_recieve = 'my-app/auth/login_recieve'; export const login_failure = 'my-app/auth/login_failure'; // ... reducer code here export function login(loginhandle, password) { return (dispatch, getstate, api) => { dispatch({ type: login_request }); api.post('/auth/login', { loginhandle, password }).then( response => dispatch({ type: login_recieve, response }), error => dispatch({ type: login_failure, error }) ); }; } easy! although covers @ least 70% of our requests i'm sure there elegant way abstract away allot of above code (pseudo code): export function login(loginhandle, password) { return (dispatch, getstate, api) => api('post', login_request, '/

Bootstrap not working in Magento theme -

i've got silly problem. it's down me not being able see wood trees... 1 of geniuses might spot problem immediately, or @ least hope so! i've developed theme magento site using bootstrap. first built static html templates, tested responsiveness, , worked fine. integrated templates magento... , responsive elements stopped working. working initially, @ point during site development, stopped working. i've looked , looked @ , can't see what's wrong. presume there's sort of conflict bootstrap somewhere can't see it. there no script errors can see , loading correctly, responsive elements refuse work. can take @ site @ http://www.collaredclergywear.co.uk/ , tell me i'm missing? think it's simple can't see wood trees anymore. cheers, willo one thing in style.css try commenting it. better remove style.css , test .wrapper { min-width: 954px; }

http - set frontend_ip as source IP for backend -

i have server multiple ip configured on ( virtual ip on eth0). i'm using haproxy load balacing. each ip has been configured/pointed different domain name , requests comes each ip address being forwarded different backend server using haproxy. issue here, outgoing traffic haproxy pass through main interface ip [ default]. wanted set source ip backend connection. i tried below config, not working. idea ? backend web1 server ss2 10.11.12.13:80 source ${frontend_ip} frontend new1 bind 10.11.13.15:8080 mode tcp use_backend web1 you have 1 ip in question can't sure. if have multiple virtual ips , want serve different backends, need create 1 frontend each @ least. this: frontend new1 bind 10.11.13.15:80 ... acl is_new1domain hdr(host) -i new1.domain.com use_backend web1 if is_new1domain frontend new2 bind 10.11.13.16:80 ... acl is_new2domain hdr(host) -i new2.domain.com use_backend web2 if is_new2dom

php - Pagekit extensions will not update "your requirements could not be resolved to an installable set of packages" -

Image
i updated pagekit 1.0.2 1.0.3. however, when try update extensions (i.e. blog) or install new ones (i.e. tinymce) same error, saying "your requirements not resolved installable set of packages". also, noticed when updating blog extension says "updating blog 1.0.0", while on version 1.0.0. just few days ago, on different account on same server, installing tinymce no problem @ all. any suggestions? have made own extension or touched composer.json of pagekit ?

javascript - Cordova plugin background mode : onactivate is not working the first time (android) -

i'm trying use background mode plugin in ionic application i'm encountering issue. i same thing shown in readme of github project backgroundmode.onactivate . work fine if not working second time go background. if has idea issue, i'd glad hear :) sample code : $ionicplatform.ready(function() { document.addeventlistener('deviceready', function () { // android customization cordova.plugins.backgroundmode.setdefaults({ text:'doing heavy tasks.'}); // enable background mode cordova.plugins.backgroundmode.enable(); if(cordova.plugins.backgroundmode.isenabled()){ console.log('hi, enabled. signed : backgroundmode.'); } // called when background mode has been activated cordova.plugins.backgroundmode.onactivate = function () { settimeout(function () { // modify displayed notification cordova.plugins.backgroundmode.configure({ text:'running in background more 5s now.' });

android - Cordova debug: the specified file was not found -

i'm working on cordova project android using visual studio 2015. can build project without error , can deploy on ripple. but when want deploy on real device or on emulator, i'have same error: specified file not found. no more information in error list or output (using diagnostic output). when try deploy on emulator, emulator receive application , can use when app lauched have pop-up visual studio: "the specified file not found" , can't debug. when try deploy on real device, have directy pop-up: "there deployment error. continue ?" if click on "yes", have popup "the specified file not found". i have solution , explanation error. thank in advance, can't work kind of error except deploying on emulator , don't use debugging... it seems missing third party component (such android studio), cordova creating android project, android not compiling project android app. that's why deploys on ripple (which uses fi