Posts

Showing posts from April, 2014

php - Codeigniter decode not working -

i making little login system using php inside of codeigniter framework. using encryption class encode password, store in database. on login, finds encrypted password using username, matches against password entered. passwords getting encoded during registration. , in below code, have been able print out encoded password database, fails out whenever run through decode. no error message, nothing. public function check_pw(){ //post username , password database $data['username'] = $this->input->post('username'); $data['password'] = $this->input->post('password'); $this->load->model('lindsdata'); //encoded password returned database - working $return_data = $this->lindsdata->password($data); //$return_data = $this->encrypt->decode($return_data); //print_r shows $return_data hold encrypted password //but when uncomment line decode in it, $return_data print_rs nothing. print_

javascript - Embed Facebook video via ajax -

i have database store id of x videos facebook also, youtube , vimeo, load video via ajax, vimeo , youtube load facebook doesn't load, loads html code via ajax contains script wich requiered facebook... embed video facebook code this: <script> (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.0"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk') ); </script> <div class="hidden-xs hidden-sm visible-md visible-lg"> <div id="fbid"> <div id="fb-root"></div> <div class="fb-post" data-href="https://www.facebook.com/video.php?v=<?php echo $v->v; ?>" data-width="800"> <div c

.net - App with windows auth asks for login -

i have auth set windows because running on company intranet. web.config looks like: <authentication mode="windows" /> <authorization> <deny users="?" /> </authorization> i building in vs 2013. each day, first time run app pops auth required login box , once give windows creds, fine (i assume caches creds). want app start , not ask valid user login creds. i thought behavior of windows authentication. there iis express setting need change? else needed in web config? you have configure web application domain "local intranet" site in internet explorer (chrome inherit setting ie, believe firefox have configured manually). can accomplished through "internet options --> security --> local intranet --> sites --> advanced --> add website". you need configure automatic logon outlined in link: https://technet.microsoft.com/en-us/library/dd572939%28v=office.13%29.aspx?f=255&mspperror=-214

Java runtime retention annotations - annotation class required at compile time but not at runtime? -

i trying figure out exact effects in regards compile time , runtime classpaths of class annotated runtime level retention annotation, example: @javax.inject.named. understanding far: the javax.inject.named class must present @ compile time on classpath. this compiled bytecode meta-data , can obtained @ runtime via reflections api , processed accordingly; however, class not need exist on runtime classpath. thus, if compile jar java class annotated @javax.inject.named, compiled jar file can run both in container (ie jboss) , in plain old jvm launched command line (with no additional classpath entires). however, if make source code available project compiled along using javac (and no additional classpath entires), no longer compile correctly? if assumption correct, seems little limiting if need share both compiled binaries , source files amongst projects may or may not running in container (ie jboss). if case, need create wrapper object (annotated @javax.inject.named) delegat

java - Parenthesis/Brackets Matching using Stack algorithm -

for example if parenthesis/brackets matching in following: ({}) (()){}() () and on if parenthesis/brackets not matching should return false, eg: {} ({}( ){}) (() and on. can please check code? in advance. public static boolean isparenthesismatch(string str) { stack<character> stack = new stack<character>(); char c; for(int i=0; < str.length(); i++) { c = str.charat(i); if(c == '{') return false; if(c == '(') stack.push(c); if(c == '{') { stack.push(c); if(c == '}') if(stack.empty()) return false; else if(stack.peek() == '{') stack.pop(); } else if(c == ')') if(stack.empty()) return false; else if(stack.peek() == '(') stack.pop(); else

stata - Sort by variable in twoway scatter. X-axis stays alphabetical and sort produces gibberish: why? -

Image
i have 2 variables: ie_ctotal cntry2 note: cntry2 encode d version of string variable cntry : don't know if may affecting things. i want twoway scatter of ie_ctotal , cntry2 , , want sort scatter variable gdppc , twoway || scatter ie_ctotal cntry2, c(1) xlabel(,valuelabel) the above without sort works fine. once introduce sort , however, twoway || scatter ie_ctotal cntry2, c(1) sort(gdppc) xlabel(,valuelabel) the graph turns gibberish, or rather connects according sort , x axis remains alphabetical, making connections seem scribbled. any ideas doing wrong? note: don't want sort original data, because advised in previous questions bad idea. want sort data 1 graph. there no reproducible example here, , not graph, possible guess problem. you typing above c(1) which ill-advised, although stata right thing. better type c(l) which instructs stata join data points on graph in line. (nod @dimitriy v. masterov on detail.) in first ex

javascript - Detecting if you are on a desktop -

i'm building app touch screens , has on screen keyboard them use. works wonders desktop computers, not mobile devices have built in keyboards. i have been looking around see if there way detect if on desktop or mobile, have seen has been deprecated. there way so? can enable library if on desktop computer. you can accomplish doing: if(/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.useragent)){ //your code mobile devices } here fiddle: http://jsfiddle.net/mnbw23gg/

php - Composer cannot find the package for new require within Yii2 composer.json -

ok, i'm using yii2 , trying add new requirement/library project. said library can found here: https://github.com/cyphix333/sbbcodeparser it forked project added composer.json . i tried adding requirement in projects main composer file, ie: "require": { //.......... "samclarke/sbb-code-parser": "*" }, then ran: composer update it complained couldn't find package or version of it. then removed line , tried: require samclarke/sbb-code-parser i have files in yii vendor folder located at: @app/vendor/samclarke/sbb-code-parser i'm pretty new composer , not sure i'm doing wrong or how composer supposed know files based on package name. the package samclarke/sbb-code-parser can found @ packagist. https://packagist.org/packages/samclarke/sbb-code-parser by default composer tries resolve stable set of packages. packages doesn't provide stable version (version tag), yet - dev-master version exists. co

Better way to improve the for loop for my case in R? -

prob stat : data set holds 2 columns mstr_program_list, loc_cat 600000. loc_cat column holds both missing , non missing cells. other columns not havings na's. each prog in mstr_program_list, need find total number of loc-cat associated program, % of non missing rows , among non missing rows find count of categories divided into. ex : unknown prog - total number of rows = 3, non missing rows in loc_cat 1 therefore % (2/3)*100 , number of categories divided 2 (rests:full) (rests:lim) > head(data) l.name mstr_program_list loc_cat 1 6 j'sgroup unknown <na> 2 bj's- maine roasted tomat rests: full 3 bj's- maine unknown rests: full 4 brad's q q unknown rests: lim expected output: mstr_prog total_count %good(non missing rows) number of loc_cat unknown

windows 7 - Strange FTP behavior when running the "MDelete" Command -

i running issue "mdelete" command in ftp when running on windows 7 professional 32 bit. below getting in log file after running mdelete command. ftp> ftp> mdelete siftinpt.dat obviously doesn't execute command." i expecting see ftp> mdelete siftinpt.dat a note script running, have same script running on 100+ pcs have windows 7 on them , not experience issue. have never run issue before. , when run mdelete command

php - Create html table from fields in foreach loop -

i have following code displays custom fields html form: <?php foreach ( $job_fields $key => $field ) : ?> <fieldset class="fieldset-<?php esc_attr_e( $key ); ?>"> <label for="<?php esc_attr_e( $key ); ?>"><?php echo $field['label'] . apply_filters( 'submit_job_form_required_label', $field['required'] ? '' : ' <small>' . __( '(optional)', 'wp-job-manager' ) . '</small>', $field ); ?></label> <div class="field <?php echo $field['required'] ? 'required-field' : ''; ?>"> <?php get_job_manager_template( 'form-fields/' . $field['type'] . '-field.php', array( 'key' => $key, 'field' => $field ) ); ?> </div> </fieldset> is there way customize code display fields in html tab

average list of dictionaries in python -

i have list of dictionary this data = [{'name': 'john', 'height': 176, 'weight':62, 'iq':120,..},...] the .. signifies various other integer/float attributes , elements of list has same format.. i want average height, weight , other numerical attributes in cleanest/easiest way. i not come better way normal looping messy... , don't want use external packages you can use following sum([item['weight'] item in data])/len(data) and use float(len(data)) if want more exact value.

css - Scalable canvas as overlay in Google Maps Javascript API -

i have image (9600x7200) using overlay on google maps enabled web page. anchor sw , nw corners latlng , image scales correctly when zoom map. want create second overlay html5 canvas element, sized 9600x7200, sits on top of image. can when draw on canvas, scaling/positioning wrong. used https://developers.google.com/maps/documentation/javascript/examples/overlay-simple template both overlays, sets overlay element 100% of parent div, anchored map. works fine <img> , not html5 canvas, not have inherent size image does. (you can set width/height in css, underlying image has real dimensions scale css dimensions). so, question is: how create drawable canvas size of 9600x7200, , anchor map positions , scales match <img> overlay beneath it? there code samples this? don't use css resize canvas, set via width , height attributes of canvas element. if draw on canvas (let's it's stretched twice it's normal size simplicity) both it's size , position

html - How to display items side by side until window width then in next row -

Image
i have list of items in angularjs scope variable. want display them in browser screen side side upto window width, in next row. this. i want padding of 5px; sides between 2 items. how using bootstrap/css. bootstrap preferred. you can giving these items display: inline-block; , padding: 5px; keep gap want. here's code need: .box { padding : 5px; display : inline-block; min-width: 100px; min-height: 50px; background-color: red; } <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> you can resize window see difference , how behave dynamically. resize result window in demo fiddle best results.

xsd - What is wrong with my XML? -

can please me below xml? <?xml version="1.0" encoding="utf-8" ?> <xs:collection-list xmlns:xs="http://www.hp.com/hpsim7.5.0.0" elementformdefault="qualified"> <xs:collection name="abc" type="system" parent="systems type"> <member name="all servers" type="query" display-status="0"default-view="tableview" hidden="false" /> </collection> </collection-list> i not sure what's wrong it. what's wrong xml is not well-formed . that is, not meet basic requirements being xml. then, per comment error indicating collection-list cannot found, xml not valid . is, not meet additional requirements specified schema. might want read more well-formed vs valid xml in general. below, each category of problems in pa

java - view and viewgroup android -

i know java basics , learning android development now. have learnt there 2 central android classes ui,view , viewgroup. want correct me wherever wrong. viewgroup subclass of view,and holds view objects together.textview,edittext etc subclasses of view , linearlayout,gridview etc subclasses of viewgroup. want relate oop concept of java dont seem this. objects?how come subclass container? i'll give basic overview here. i'm pretty new android, correct-me-if-i'm-wrong thing goes me too. :) a view unit of ui; like, say, box of 24x24 pixels (yes, basic). box can used anything, because top-most entity in hierarchy. can define more precisely specifying want hold, textview, imageview, webview, etc. come in. box 24x24 may hold text, image or web-page content, respectively. a viewgroup can belong in 'etc.' above. showing text, 24x24 box can used display 4 boxes 12x12. if so, view can classified viewgroup. further, when know type of arrangement require box ho

Python f.read not reading the correct number of bytes -

i have code supposed read 4 bytes reading 3 sometimes: f = open('test.sgy', 'r+') f.seek(99716) aaa = f.read(4) bbb = f.read(4) ccc = f.read(4) print len(aaa) print len(bbb) print len(ccc) exit() and program returns: 4 3 4 what doing wrong? thanks! you're assuming read not. documentation tells you: read(...) read([size]) -> read @ size bytes, returned string. it reads at most size bytes if need exactly size bytes, you'll have create wrapper function. here's (not thoroughly tested) example can adapt: def read_exactly( fd, size ): data="" remaining= size while remaining>0: #or "while remaining", if you'd newdata= fd.read(remaining) if len(newdata)==0: #problem raise ioerror("failed read enough data") data+=newdata remaining-= len(newdata) return data as mark dickinson mentioned in comments, if you're on wind

java - Fragments and android life cycle -

i've got strange android app. if run main activity , go through few fragments, i'll see main activity after hiding/unhiding app. if press "back", show fragment shown right before hiding. app shows me last fragment after unhiding. how can make app show last fragment everytime if it's possible? or how can make app save state? if understand, want when "back" button pressed, last fragment should displayed. can depend on addtobackstack method handle press. google code snippet @ fragments : fragment newfragment = new examplefragment(); fragmenttransaction transaction = getfragmentmanager().begintransaction(); // replace whatever in fragment_container view fragment, // , add transaction stack transaction.replace(r.id.fragment_container, newfragment); transaction.addtobackstack(null); // commit transaction transaction.commit(); note: in case newfragment last fragment.

Copying and Editing Jenkins Jobs -

i have been using jenkins couple of months now, , have been able set simple ci system. have build tab - build , deploy 25 different components successfully, based on building svn trunk. i'm taking first branch - people develop on trunk , develop fixes on branch. i have ci , running both branch , trunk - create second tab - repeat of jobs first tab, time changing svn path check out branch. as have rather lot of jobs , task quite repetitive, there easy way ? i'm hoping each job tab might single xml can edit / rename give me second tab ? yes, each job is single xml file, located under $jenkins_home/jobs/$job_name/config.xml . there number of places in config.xml reference it's location, copy-pasting actual file isn't best option. jenkins ui has "copy job" function. click "new item" want it select "copy existing item" specify name of existing item copy specify name new job then go configure new job , change need.

objective c - subview user interaction disabled on UIViewController on iOS 7 -

i have .xib file in app. inserted .xib file subview viewcontroller. have user interaction enabled, , on ios 8 works expected when run app on ios 7 user interaction not working. check in attribute inspector, user interaction enabled checked or not.

javascript - Chrome Extension webRequest.onBeforeRequest Cancel Page -

i attempting create chrome extension queries external source reference block or allow through particular page. following part of code. new javascript, , scope seems screws me up. chrome.webrequest.onbeforerequest.addlistener( function(details) { var http = new xmlhttprequest(); var url = "http://xxx.xx.xxxx"; var params = "urlcheck="+encodestring_(details.url); http.open("post", url, true); //send proper header information along request http.setrequestheader("content-type", "application/x-www-form-urlencoded"); http.onreadystatechange = function() { if(http.readystate == 4 && http.status == 200) { guilt = 0; console.log(guilt); }else if(http.readystate == 4 && http.status == 404){ guilt = 1; console.log(guilt); } } http.send(params); i

javascript - Using Dalekjs test tool, how to select Option in Dropdown(Select element) when there is no "value" attribute in Option tag? -

lets consider below "select" example "value" attribute, <select onchange="fruitselected();" id=""> <option value=""></option> <option value="apple">apple</option> <option value="mango">mango</option> <option value="banana">banana</option> </select> using dalekjs i'm able select option using below code, .click('#moduletype option[value="apple"]') but, when above example don't have "value" attribute show below, <select onchange="fruitselected();" id="fruitid"> <option></option> <option>apple</option> <option>mango</option> <option>banana</option> </select>; how select option dropdown? i tried using .execute below, .execute(function () { document.getelementbyid("fruitid").selectedindex = "1"

php - is there any way we can post image on facebook using facebook app on access allowed user's wall on be half them/app endless? -

is there way can post image on facebook using facebook app on access allowed user's wall on half them/app ? we have access of user 1 time , whatever user upload automatically post post wall. we have tried storing user access token expire after 2 months. so if there option generate no expire token, work. as figured out, long-lived access token expire after 60 days, should more enough use cases. in case, posting user's timeline after they take action (and consent) should work fine need request new token. , if use javascript sdk, done in background. more here .

Python: Using a multidimensional multiprocessing.manager.list() -

this might not intended use, know how use multidimensional manager.list(). can create on fine, this: from multiprocessing import manager test = manager.list(manager.list()) however when ever try access first element of test list returns element's value , not proxy object test[0] # returns [] , not proxy, since think python running __getitem__. is there anyway me around , use manager.list() in way? the multiprocessing documentation has note on this: note modifications mutable values or items in dict , list proxies not propagated through manager, because proxy has no way of knowing when values or items modified. modify such item, can re-assign modified object container proxy: # create list proxy , append mutable object (a dictionary) lproxy = manager.list() lproxy.append({}) # mutate dictionary d = lproxy[0] d['a'] = 1 d['b'] = 2 # @ point, changes d not yet synced, # reassigning dictionary, proxy notified of change lpr

android - No files detected on FTP server -

i'm running ftp server, contains file in root directory: "/". program able connect , login server , able change root directory. when try list name of files , print out single file located, gives me error saying: "attempt read null array". here code: ftpclient = new ftpclient(); log.d("loginactivity", "ftp"); ftpclient.connect("xxx.xxx.x.xx", xx); boolean connected = ftpclient.isconnected(); if(connected){ log.d("loginactivity", "connected: true"); } boolean loggedin = ftpclient.login("name", "password"); if(loggedin){ log.d("loginactivity", "loggedin: true"); } boolean founddirectory = ftpclient.changeworkingdirectory("/"); if(founddirectory){ log.d("loginactivity", "directory found: true"); } string[] files = ftpclient.listnames("/"); log.d("logina

How to list files and folders together in liferay? -

i trying list files , folders under root folder of liferay site. querydefinition querydefinition = new querydefinition(workflowconstants.status_any, queryutil.all_pos, queryutil.all_pos, null); list<object> list = dlfolderlocalserviceutil.getfoldersandfileentriesandfileshortcuts(groupid, folderid, null, true, querydefinition); is right way? how differentiate files , folders? you can , differentiate files, folders , shortcuts following: list <object> foldersandfileentriesandfileshortcuts = dlappserviceutil.getfoldersandfileentriesandfileshortcuts( folder.getgroupid(), folderid, workflowconstants.status_any, true, queryutil.all_pos, queryutil.all_pos); (object folderandfileentryandfileshortcut: foldersandfileentriesandfileshortcuts) { if (folderandfileentryandfileshortcut instanceof fileentry) { fileentry fileentry = (fileentry) folderandfileentryandfileshortcut; } else if (folderandfileentryandfileshortcut instanc

ember.js - Reset isDirty-flag -

i have 2 models: // subject export default ds.model.extend({ willbeactive: ds.attr('boolean') }) // studyplan export default ds.model.extend({ name: ds.attr('string'), subjects: ds.hasmany('subjects'), havachanges: function(){ var isdirty = this.get('isdirty'), subjectsdirty = this.get('subjects').isany('isdirty', true); return subjectsdirty || isdirty; }.property('isdirty', 'subjects.@each.isdirty') }) i use embeddedrecordsmixin , activemodeladapter embed inside studyplan payload subjects have changed, when promise resolved isdirty flag of each subject remains in true . can reset isdirty flag of each subject after saving studyplan ? you might interested in this package it marks parent dirty when child record dirty , clears isdirty field on child records when parent saved.

Android check if string changed over time -

so, question simple. have program check every minute if specific string has changed. hoping textwatcher work on strings aswell unfortunately wasn't case. similar or better ways achieve this? edit: string im talking broadcast receiver. save last received string sharedpreferences see . compare each received string preference know if has changed. if has changed, save new string.

windows phone 8 - Visual Studio - deploys without building -

today vs pro 2013 started acting up. stopped building wp8 project before deploying on device, have start build manually , start debugging. until had tap f5 run everything... there option connected such behavior might've gotten turned on/off or kind of bug in ide? i had same situation , looks me vs bug. restarting vs helps! :)

Special and accented characters in mysql generates bad symbols in PHP -

my collation set utf8_general_ci both on tables , fields. html has meta tag changes charset utf8. when use php framework, such codeigniter, or use following queries before selecting database, see no problem on pages mysql_query("set names 'utf8'"); mysql_query('set character_set_connection=utf8'); mysql_query('set character_set_client=utf8'); mysql_query('set character_set_results=utf8'); but i'm neither using kind of framework nor libraries, i'm working in company had project finished , noticed that, when save accented characters in database, example, "maçã" (apple in pt), seem stored fine mysql (at least when use phpmyadmin read table) displayed badly php/html. looks similar this: ma< ?>< ?> this known bad character question mark keeps coming everytime echo these words on code. is there kind of configuration mysql or php solves problem (this specific one, i'm not talking general solution cha

ios5 - Testing app on iPad 1 (iOS 5.1.1) using Xcode 6.2 -

Image
when launch app using xcode 6.2 on ipad 1 running ios 5.1.1, following error: i couldn't find documentation on how exclude architecture. ideas? app's deployment target set 5.1.1. the problem in arm64 architecture in valid_archs. removing arm64 valid_archs solves issue. in case had create separate branch testing on ios 5 devices. then try run app. set setting xcode archs = armv7 armv7s valid_archs = armv7 armv7s arm64 in case, binary built armv7 armv7s arm64 architectures. same binary run on archs = armv7 armv7s .

reporting services - How to enable the export to 'csv' in visual studio -

Image
one of colleagues not able export csv visual studio. not getting option export 'csv' getting on below screen shot. we using vs 2010 devloper edition. we not referencing report server well. i beileve need change in report server config (rsreportserver.config) file unable find report server config file in local system. we can see reports having export option in report server problem local machine. any highly appreciable. for developer's visual studio environment, rendering options can found in file: c:\program files (x86)\microsoft visual studio 9.0\common7\ide\privateassemblies\rsreportdesigner.config

How can I verify a cryptographic hash created by Python's Passlib using Node.js? -

i have backend application written in python used content managers of site. users' passwords hashed using passlib's pbkdf2_sha512 function. began develop frontend application decided use nodejs react ux reasons. now problem can't figure out how can verify passwords hashed passlib using nodejs authenticating users. passlib's implementation seems specific me , i'm not crypto stuff figure out. i have mcf know algorithm , digest type, salt, number of iterations , key length. how can verify output passlib in node? should rather choose algorithm better supported both platforms? ok, turned sha512_crypt instead , found nice library node called sha512crypt-node . readme contains example both python , node, needed. here's little example ppl. using these platforms: python: from passlib.hash import sha512_crypt orig = "password" h = sha512_crypt.encrypt(orig) print("hash", h) # h eg. $6$rounds=100000$5yntxatkh4b1pljp$3qqjvifjrbitak

java - unable to connect spring with mysql -

i working on spring hello samples spring documentation. in connecting embedded database, instead trying configure mysql database. samples git https://github.com/spring-guides/gs-batch-processing.git kindly guide me steps. adding jdbc-driver pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>org.springframework</groupid> <artifactid>gs-batch-processing</artifactid> <version>0.1.0</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.2.2.release</version> </pare

advanced custom fields - How can I restrict Two dates in ACF date picker for Starting date and Ending Date in Wordpress? -

i have created event post type in wordpress. have put starting date , ending date acf datepicker. i want admin can select ending date greater starting date. is there way restricting starting date , ending date? for example, if admin choose 1st jan 2016 starting date, can select ending date 1st jan or greater selected date. i think can java script , use code set limit of end date : $( ".selector" ).datepicker({ mindate: new date( ) });

javascript - Regex - match from N-th occurence of a character till end of string -

going mad here :) because must simple , can't crack it. example: htz_2015_cs_ss5_cncenter_1020x200_as2_10k.html htz_2015_cs_ss5_cncenter_1020x200_as2_10k.swf htz_2015_cs_ss5_cncenter_1500x1000_160k_w1020.jpg match 6th "_" (underscore character), select , follows, till end of string replace nothing (basically delete 6th underscore end of string) i using sublime text text editing, find/replace function if necessary use online tool (any suggestions?). these might have guessed banner file names regularly need modify, hundreds of them @ time. many thanks! p.s. can write simple js maybe option if must be. if sure there @ least 6 _ in string : src.match (/^((?:[^_]*_){5}[^_]*)(_[^]*)$/)[1] 'htz_2015_cs_ss5_cncenter_1020x200_as2_10k.html'.match (/^((?:[^ ]* ){5}[^ ]*)( [^]*)$/)[1] == 'htz_2015_cs_ss5_cncenter_1020x200' otherwise use : (src.match (/^((?:[^_]*_){5}[^_]*)(_[^]*)$/) || [,src])[1]

nosql - Stream data aggregation sorted by timestamp -

i have use case receiving events client , of these events logically related (belong single session), , there definite ordering among events based on timestamp. now, want build solution should continue aggregating events until last 1 of particular group received in increasing order of timestamp. so, if event not in order received, should held on until events before them, received. , then, go ahead storing in data store such hbase based on key of particular group. the problem number of such incomplete groups @ time can in millions, , need can support fast appending incomplete group , holding events received unordered. how should go this? you use event stream processing or complex event processing frameworks http://en.wikipedia.org/wiki/complex_event_processing . write query/pattern, load in engine, feed engine events , query being continually updated or fires when time comes. i codehaus esper, it's open source, restricted in unpaid version, had implement storing of

c# - How to get available space on Storage Device -

i'm working on windows store app (windows 8.1, using vs2012), , i'm having trouble retrieving available/used space specific storage folder , retrieved storage device. clear, app meant run on desktop, , exchange files usb devices connected through storage device api. this have until now: storagefolder folder = windows.devices.portable.storagedevice.fromid(phoneid); uint64[] info = new uint64[] {}; var properties = await folder.properties.retrievepropertiesasync( new string[] { "system.freespace", "system.capacity" }); if (properties.containskey("system.freespace") && properties.containskey("system.freespace")) { info = new uint64[] { (uint64) properties["system.freespace"], (uint64) properties["system.capacity"] }; } return info; but no success, 'info' empty array. ideas? i've found out doing wrong. storagefolder object representing phone connected desktop. if 1

NEST query for Elasticsearch not working -

we using nest api work elasticsearch using c#. while can insert data, queries reference specific fields in object not working. for example, given following class: internal class magazine { public magazine(string id, string title, string author) { id = id; title = title; author = author; } public string id { get; set; } public string title { get; set; } public string author { get; set; } } objects of class created , inserted elasticsearch follows: magazine mag1= new magazine("1", "soccer review", "john smith"); magazine mag2= new magazine("2", "cricket review", "john smith"); uri node = new uri("http://localhost:9200"); connectionsettings settings = new connectionsettings(node, defaultindex: "mag-application"); elasticclient client = new elasticclient(settings); client.index(mag1); client.index(mag2); the following query works, , returns 2 rows: var searc

performance - What would be the best size for a full-width website slider image? -

i have client needs slider full-width, without containers or wrappers. think it's bad practice(you may correct me otherwise), couldn't convince otherwise. i'm concerned image sizes. images lazy-loaded, still. 1 image can take long time download if set large. airbnb quite here: https://www.airbnb.com/rooms/50724?s=jmld what should maximum width of images be?

Counting String objects created by Java code -

how many string objects created following code? string x = new string("xyz"); string y = "abc"; x = x + y; i have visited many websites line of code creates 3 objects , creates 4. wanted know how many objects created after line of code executed. by end of run there 4 string objects: a string corresponds interned "xyz" literal its copy created new string("xyz") a string corresponds interned "abc" literal a string corresponds concatenation "xyz" + "abc" the real question attributing or of these objects program. 1 can reasonably claim few 2 or many 4 string s created code. though there 4 string objects in total, objects 1 , 3 may not created code, because in constant pool, created outside code's direct control.

php - Dropbox api not working in codiegniter? -

public function request_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $this->load->library('dropbox', $params); $data = $this->dropbox->get_request_token(base_url()); $this->session->set_userdata('token_secret', $data['token_secret']); redirect($data['redirect']); } //this method should not called directly, called after //the user approves application , dropbox redirects public function access_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $this->load->library('dropbox', $params); $oauth = $this->dropbox->get_access_token($this->session->userdata('token_secret')); $this->session->set_userdata('oauth_token', $oauth['oauth_token']); $this->session->set_userdata('oauth

model view controller - Is MVP a design pattern or an architectural pattern ? What about MvC and MvvM? -

after doing research on android patterns kept finding different answers. people start talking design pattern, architectural or architectural presentation patterns. i'm reaching conclusion architectural presentation pattern mvc architectural pattern while mvp & mvvm design pattern on same rank design pattern observer. correct? design pattern general reusable solution commonly occurring problem within given context. reside in domain of modules , interconnections. connected code. on other hand architectural patterns similar software design patterns have broader scope . describing overall pattern followed entire system. for me mvc, mvp , mvvm architectural patterns other architectural patterns may hear off (the list not exhaustive) : event driven architecture cqrs rest microservices soa pipe & filter architecture you can find examples on wiki : http://en.wikipedia.org/wiki/list_of_software_architecture_styles_and_patterns

linked list - Per-node memory overhead -

i learning pros , cons of using stacks linked lists, when found cons say: " memory cost each node can more databin stored. ex 32 bit value such integer can memory overhead 7 times larger integer itself." what mean? when use general memory allocator don't know how big block allocates on each request. many of them round requested size quantity each block aligned address divisible, say, 8 or 16, or 32. in case always use @ least 32 bytes, if request 1 byte. 32 bytes of heap 4-byte piece of data, 8 times need, overhead equal 7. edit often allocator adds 'header' before block returns , header size allocation size step. header 16 bytes long requested allocation size rounded nearest 16 multiply , incremented 16 header. requested size 1 through 16 use 32 bytes, 17—32 use 48, 33—48 it's 64 , on.

xaml - Show one of multiple items on the page (tab-like interface) -

i want have tab-like interface have multiple buttons (tabs) , when user press 1 of button show corresponding container , hide other ones. something like: <!-- buttons --> <stackpanel verticalalignment="stretch" grid.column="0"> <button style="{staticresource detailsectionbutton}" content="info" click="button_click"/> <button style="{staticresource detailsectionbutton}" content="map" click="button_click2"/> <button style="{staticresource detailsectionbutton}" content="attachment" click="button_click3"/> </stackpanel> <!-- info --> <scrollviewer x:name="secinfo" grid.column="1" visibility="collapsed" ... <!-- map --> <map:mapcontrol zoomlevel="6" x:name="secmap" gri

django - Python REST API access custom header values -

i using django rest-framework posting or getting data client application. client application sending custom header along request. how can access custom header value in rest api. custome-header-key: asdqweryhh #this custom header set client. please help thanks you can use request.meta dictionary. with exception of content_length , content_type, given above, http headers in request converted meta keys converting characters uppercase, replacing hyphens underscores , adding http_ prefix name. so, example, header called x-bender mapped meta key http_x_bender. so header value in example do: request.meta['http_custom_header_key']

html - How to add inline input elements between texts -

i trying create form similar this. finding hard show text inline form elements. form this: certify beneficial owner resident of ____ within meaning of income tax treaty between united states , country______ text here. (i want place text fields in place of dots) <p> certify beneficial owner resident of <input type="text" /> </p> put inside p (paragraph) tag. copy , paste code.

c++ - In general How to find out whether client has assigned static Ip or it is dhcp client -

i have retrieved ip, subnet , broadcast using ioctl() system call. can me find out whether client static or dhcp?? asking in general , using system call. client instead of interface. the interface has nothing dhcp. can configured have particular ip address, gateway, etc. that's all. configuration, however, can done smart little program called dhcp client :) need find out (i mean, program) has configured interface. update: for example, under majority of linux distributions may a ps aux | grep 'dhcpcd .* eth0' if gives result /sbin/dhcpcd --netconfig -l -e -hhh -c /etc/sysconfig/network/scripts/dhcpcd-hook -t 0 -h somehostname eth0 you can eth0 configured dhcp

c++11 - Using iterator for removing items from map in c++ -

map<int, int> m_map; // ... map::iterator = m_map.begin(); while (it != m_map.end()) { m_map.erase(it++); } when ++ action take place? before or after erase ? when safe so? i don't think it's specified whether ++ happens before or after call erase . still, if guaranteed peformed before call, fact had asks shows code bad. there better, 100% safe alternative: while (it != m_map.end()) { = m_map.erase(it); } erase returns iterator element past erased one.

class - how to get multiple screen data and submit from final screen in android? -

i have 5 screens homedetails,addressdetails,officedetails, positiondetails,applydetails. these details submit applydetails class. here doubt is, when click submit button in applydetails class, send classes information server. how can homedetails,addressdetails,officedetails,positiondetails data in applydetails class. you can save data using sharedpreferences. for ex. wanna save string in mainactivity class sp = getsharedpreferences("savedata", 0); sharedpreferences.editor ed = sp.edit(); ed.putstring("string1", stringtobesent); ed.commit(); now retrieve in class use sp = getsharedpreferences("savedata", 0); string retrievedstring = sp.getstring("string1","");

c# - Can we configure baud rate in socket class for ethernet communication -

i need configure baud rate of ethernet port of pc 100mbps. after searching net, couldn't find way change baud rate in socket in c# code. possible set baud rate ethernet port in c#. need communicate between pc , micro controller. if, in micro controller, baud rate of ethernet port set 100mbps, baud rate of ethernet port in pc set 100mbps automatically? thank you i think you've got terms , technologies mixed bit. sounds you're used working serial connections (like rs232 or rs422) both end-points have configured in same manner. ip networks don't operate way. on modern switch, each connected device can have it's own link speed. computer can connected 1gbps , computer can have 100mbit, dependent on computers interface can handle. the network protocol use should handle throttling, resending of lost packets , such (like tcp does). if use udp you'll have either not care lost packets, or implement such mechanisms on own. if connect computer dire

php - TCPDF can see line in pdf generated but not in printout -

$style = array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 0, 0)); $pdf->line(5, 10, 80, 30, $style); i uses above statements draw line. result view in screen has line drawn. it's not printed on paper. any highly appreciated. i'm sorry folks, it's not tcpdf problem. using google print out pdf generated , having problem. if try internet explorer there no problem.

c++ - OpenSSL connection fails with non-blocking socket -

i have openssl server has echo functionality described here , client described here . made minor changes server (e.g. changing certifiacte , private key paths, adding more debug outputs,...) , in client removed "bio* out" , printed bio_read result console instead. both client , server use tlsv1_1_client_method , tlsv1_1_server_method respectively. the codes work fine together, if add "bio_set_nbio(web, 1);" client before bio_do_connect, connection doesn't work anymore. bio_do_connect returns -1. can handshake problem , if so, how can handshake non-blocking sockets? this error first occurred in larger project of mine. used example codes verify it. problem is, need non-blocking sockets, because calling bio_read different thread , can't join thread if it's stuck trying read. i tried set socket non-blocking using fd_set , select, throws wsaenotsock error (10038). did following: header: bio* _bio; ssl* _ssl; fd_set _fdset; socket _socket; timev

ios - Seamlessly updating a layer's visual property values after a `CAAnimationGroup` completes? -

i'm trying animate scale then opacity of calayer , so: cabasicanimation *scaleup = [cabasicanimation animationwithkeypath:@"transform"]; scaleup.fromvalue = [nsvalue valuewithcatransform3d:self.timerprogresslayer.transform]; scaleup.tovalue = [nsvalue valuewithcatransform3d:catransform3dmakescale(1.0, 1.0, 1.0)]; scaleup.duration = 0.25; scaleup.fillmode = kcafillmodeforwards; cabasicanimation *fadeout = [cabasicanimation animationwithkeypath:@"opacity"]; fadeout.fromvalue = @(1.0); fadeout.tovalue = @(0.0); fadeout.begintime = 0.3; fadeout.duration = 0.25; fadeout.fillmode = kcafillmodeforwards; caanimationgroup *group = [caanimationgroup animation]; group.animations = @[scaleup, fadeout]; group.removedoncompletion = yes; group.duration = fadeout.begintime + fadeout.duration; [self.timerprogresslayer addanimation:group forkey:@"trigger"]; that's simple enough, , animation works fine. however, @ end of animation it's removed , value

android - App's download count in google play by my suggestion -

i'm looking information on details shown in app's page on google play. have web page , have replaced link, redirect user app in google play. possible know how users download app google play suggestion? yes. need integrate tracking sdk app. example, appsflyer sdk .

web services - SOAPHandler handleMessage return custom fault -

i have custom soaphandler , handlemessage() follows : public boolean handlemessage(soapmessagecontext context) { // todo auto-generated method stub /* step-1: extract credentials soap header */ boolean isoutbound = (boolean) context .get(messagecontext.message_outbound_property); log.info("in transporthandler.handlemessage(...) " + isoutbound); if (!isoutbound) { soapmessage soapmsg = context.getmessage(); try { soaputil soaputil = new soaputil(); credentials credentials = soaputil.retrievecredentials(soapmsg); /* validate credentials against directory */ securityutil securityutil = new securityutil(); securityutil.authenticateclient(credentials.getusername(), credentials.getpassword()); } catch (securityfault_exception e) { // todo auto-generated catch block log.error( "securityfaul

java - Creating a JavaScript SOAP Client -

i'm creating soap client js, first time webservices , must have several mistakes in code. the poit is, code, cant take acces webservice, don't know how access methods inside. webservice gives me following response: <h1>version</h1> <p>hi there, axis service!</p> <i>perhaps there form invoking service here...</i> instead of correct xml method i'm calling. this code of soap client: <html> <script type="text/javascript"> function run(){ var objxmlhttprequest = new xmlhttprequest(); objxmlhttprequest.open("get", "http://localhost:8080/crunchifyws/services/version?wdsl/", true); objxmlhttprequest.onreadystatechange = function () { //alert(objxmlhttprequest.readystate+" "+ objxmlhttprequest.status); if (objxmlhttprequest.readystate == 4 && objxmlhttprequest.status == 200) { result = objxmlhttprequest.responsexml