Posts

Showing posts from May, 2011

jquery - bootstrap colorpicker change class color -

trying use bootstrap colorpicker ( http://mjolnic.com/bootstrap-colorpicker/ ) change color of text, newbie not able implement it. $('.pickthecolor').colorpicker().on('changecolor.colorpicker', function(event){ $('.headingexample').css("color", "red"); }); is working expected. documentation suggest: $('.my-colorpicker').colorpicker().on('changecolor.colorpicker', function(event){ bodystyle.backgroundcolor = event.color.tohex(); }); how can combine these two? i believe you're looking for: $('.pickthecolor').colorpicker().on('changecolor.colorpicker', function(event){ $('.headingexample').css("color", event.color.tohex()); });

javascript - node.js redis and how to use promise when using a module -

i have express route in node server (file required): var redis = require('../modules/redis'); module.exports = function (app) { var redisclient = redis.init(); app.post('/auth/ticket', cors(), function (req, res) { var hashes = ['hash1','hash2', 'hash3']; var candidates = []; // array collect valid hashes var key; // check each hash against redisdb use loop (key in hashes) { var hash = hashes[key]; console.log("hash " + hash + " proofed now:"); //now try collect valid hashes in candidates array if (redisclient.exists(hash) === 1) candidates.push(hash); } console.log(json.stringify(candidates)); }); }; now here code of module shall manage redis requests: exports.init = function () { redis = exports.redis = function () { var promisefactory = require("q").promise, redis = require('promise-redis')(promisefactory); this

python - split a list with title value: pythonic way -

i have text, this: [1] aaa bbb [2] ccc ddd what want: { 'title1': [ 'aaa', 'bbb' ], 'title2': [ 'ccc', 'ddd' ] } i can split text \n , use for , if statements this, no 'pythonic', elegance way this? kind of key ( [1], [2] ) limited. edit : attempt here, , hard-coded: item = string.split('\n') result = {} in item: # title item if i[0] == '[': name = re.sub(r'(\[|\])', '', item[i]) continue # ...and put result dict if name == '1': if not 'breakfast' in result: result['breakfast'] = [] result['breakfast'].push(value) if name == '2': if not 'lunch' in result: result['lunch'] = [] result['lunch'].push(value) if name == '3': if not 'dinner' in result: result['dinner'] = [] re

ruby on rails - Devise confirmation token invalid -

my problem unrelated transition devise 3.1+, use @token variable in email view. the problem is, confirmation token sent via email not one. if try on console u = user.last.send_confirmation_instructions the_token_from_the_email = xxx #a copy paste email token_digest = devise.token_generator.digest(user, :confirmation_token, the_token_from_the_email) u.confirmation_token == token_digest # false it fails... idea might cause this? the token in email looks 3d7vdawayshxkmm6ys-mhb token in db/after digest looks 6e8d045e084910d0cfb67b73679da12981221f52eeb984776f969f3c2d475937 edit : here's what's happening user clicks on sign_up, enter login we check login against distant ldap, if find him, entry on distant ldap duplicated our ldap if doesn't exist (no db query), , send him email new password then, account user created on rails database if doesn't exist already, following commands issued (note user has_many :clients , check client models in confirmation_

c# - catching exceptions while following SOLID principles in winrt -

public async task<storagefile> getfile( string filename ) { // throw new notimplementedexception(); var _folder = applicationdata.current.localfolder; try { var _file = await _folder.getfileasync(filename); return _file; } catch (filenotfoundexception) { //notify user exception. } return null; } this method in class retrieves file local storage. want notify user exception. if try message box in catch statement braking solid's first rule of single responsibility. how should setup class other handler class can catch exceptions , take required action? first thoughts event handlers, there better technique? public async task<storagefile> getfile( string filename ) { // throw new notimplementedexception(); var _folder = applicationdata.current.localfolder; try { var _file = await _folder.getfileasync(

php - Putting headers back when Apache strips them out -

i'm trying implement etags in php script. $hash 40 character hex string, , rfc etags says there's no maximum length. header("x-etag: $hash"); header("etag: $hash"); the first header, test, comes through properly; when inspect request in chrome, see header. but, second (actual) etag header doesn't show up. suspect server administrator stripping headers in apache configuration, , etag 1 of them. i tried wrapping $hash double quotes made no difference. can override behavior @ .htaccess level etag header sent php goes through? it evil header unset etag directive in .htaccess file. removing made etag show up.

android - Why is our dismiss call causing an AndroidRuntimeException? -

in our code, have simple method dismiss dialog, inside our implementation of dialogfragment : public class ourdialogfragment extends ourbasicdialogfragment { // <= line 15 // ... protected onclicklistener _btnpositiveonclicklistenerwithclose = new onclicklistener() { @override public void onclick(view v) { if (_btnpositivelistener != null) { _btnpositivelistener.onclick(ourdialogfragment.this, dialoginterface.button_positive); } dismissdialog(); // <= line 30 } }; // ... private void dismissdialog() { if (ourdialogfragment.this.getdialog() != null) { simplealertdialog.this.dismiss(); // <= line 58 } else if (getoverridedialog() != null) { getoverridedialog().dismiss(); setoverridedialog(null); } } // ... } this method called when our dialog's ok button pressed. however, on specified line 58, this:

Excel Pivot Table issue setting a column to "Running Total" using VBA -

i using vba loop through pivot tables in order update values include new data (from external source) , update start , end dates groupings. code works... for each pvt in ws.pivottables each pvtfld in pvt.rowfields rowlabel = pvtfld.name pvtfld.datarange.group start:=startdate, end:=enddate, by:=7, periods:=array(false, false, false, true, false, false, false) next pvtfld ... [trouble code go here, let me explain further] next pvt the problem encountering upon refresh of "running totals" reset "no calculation. recording macro helpful not useful other spreadsheets ' sets "total" column each pivot "running total" ws.pivottables("loepivot").pivotfields( _ "total planned loe") .calculation = xlrunningtotal .basefield = "moi" end so, tried embed for each this... for each pvtcol in pvt.columnfields if pvtcol.name .name & "total" pvtcol.calculati

sql - Is there a way to display the table orgin for rows in a union -

when union n amount of tables there way add column result set says table row came from? sure - add hard coded text column each statement. select 'this came table a' sourcetable, id, name tablea -- union -- select 'this came table b' sourcetable, id, name tableb

c# - Create New List From Existing Lists Comparison -

i have 2 lists: list<course> studentcourses = course.getcourses(student.pidm, gettermcode()); list<offeredcourse> offeredcourses = offeredcourse.getofferedcourses(); studentcourses have properties subjectcode , coursenumber . offeredcourses have properties subjectcode , coursenumber . i want create third list of type list<course> contains items studentcourses match both subjectcode , coursenumber of item in offeredcourses . any appreciated. linq uses non-intuitive syntax that: use contains collection might contain values you're after. var result = studentcourses.where(c => offeredcourses.contains(o => o.subjectcode == c.subjectcode && o.coursenumber == c.coursenumber));

c# - Unit Testing - How do I test this class -

i have class cache (wraps system.runtime.caching.memorycache ) have created has following public methods: bool add(string key, object value) bool contains(string key) how test contains() method without using add() method in first place add item cache??? surely if use add() method within unit test contains() method wrong? i think understand dilemma. asking if use new method test new method. sort of testing unknown unknown. to me @ test isolation case of assumption. let me explain... the following applies if both methods there , responsible testing them. in first instance, want test add(,) method. in case, 'assume' other methods work correctly. in case, run add(key,value) , check asserts true, , verify call contains(key) , ensure asserts true. though contains() untested. then in second instance, assume add(,) working , test contains() method. test based on assumption i've got blinkers on , testing specific, specific method, specific class , run

c# - ClickOnce with expired certificate -

i have project use click once create installer package. sign project certificate issued vendor, not test certificate. had certificate expired on may, had update signing manifests new certificate. so, created new certificate, signed clickonce manifests new certificate , created new installer package. works great new installations failed update application because certificates different. according search, customers have uninstall application , install new version, new signing certificate, manually. not cool :( according robin shahan, best way create new installer remove existing version (with old cert) , install new version (with new cert). https://msdn.microsoft.com/en-us/library/ff369721.aspx following steps suggested above, created new package new certificate , set in different url. then, tried create new package old certificate. failed on first attempt because previous certificate expired. way create package setting computer date april , create package. that workflow of

How to handle a button click in Django project? -

i have form below: <form action="{% url clicked %}" method="get"> <input type="submit" value="button" name="btn"/> </form> url : url(r'^clicked/$', views.button_clicked, name='clicked'), whenever click on button, should redirect page , return json file. def button_clicked(request): if request.get.get('btn'): return httpresponseredirect('/clicked/') to_json = { "key1": "value1", "key2": "value2" } return httpresponse(simplejson.dumps(to_json), mimetype='application/json') i'm wondering if best approach deal problem above.

math - Calculate if trend is up, down or stable -

Image
i'm writing vbscript sends out weekly email client activity. here sample data: a b c d e f g 2,780 2,667 2,785 1,031 646 2,340 2,410 since email, don't want chart trend line. need simple function returns "up", "down" or "stable" (though doubt ever stable). i'm terrible math don't know begin. i've looked @ few other questions python or excel there's not enough similarity, or don't have knowledge, apply vbs. my goal simple this: a b c d e f g trend 2,780 2,667 2,785 1,031 646 2,340 2,410 ↘ if there delta or percentage or other measurement display helpful. want ignore outliers. instance, 646 above. of our clients not open on weekend. first of all, data listed a b c d e f g 2,780 2,667 2,785 1,031 646 2,340 2,410 to trend line need

angularjs - Angular Unit Testing Service with multiple service calls using $q.all -

ok here scenario trying unit test jasmine. have service defined similar service below: (function () { 'use strict'; angular.module('mymodule') .service('myservice', myservice); myservice.$inject = ['$q', '$resource', 'progressservice', 'myservice2', 'myservice3', 'ngdialog']; function myservice($q, $resource, progressservice, myservice2, myservice3, ngdialog) { var self = this; self.datalistsvc2 = []; self.datalistsvc3 = []; self.datafromresource = null; self.myroutine = myroutine; var myresource = $resource('/someurl/webapi/getdata'); //trying test routine!!! function myroutine(param1, param2) { return progressservice.show($q.all([ myresource.get({ param1: param1 }).$promise.then(function (response) { self.datafromresource = respo

easeljs - createjs.Stage.update() and unresponsive script in FireFox -

in project drawing plenty of things stage , in firefox getting infamous "warning: unresponsive script" message stage.update() function. i have tried break script multiple asynchronous cycles using settimer , drawing 100 elements in loop before briefly giving control browser. thought stage.update() redraw newly added elements apparently not work way. if create , add stage 1 new element, if there 1000 elements on stage update take same amount of time if added 1001 elements in 1 go. leads "warning: unresponsive script" message. i need able update newly added elements or make update function somehow asynchronous. i had had break constructing of stage more asynchronous cycles, helped.

java - Using custom created components in tapestry -

i started learning tapestry framework. following book example creating custom component , using in code. reason text component not showing (i see hello world text). here .java , tml files: public class index { public index() { } public string gethello() { return "hello world!"; } } index tml : <html xmlns:t="http://tapestry.apache.org/schema/ tapestry_5_3.xsd"> <head> <title>tapestry 5 book</title> </head> <body> <t:mycomponent/> <h1> ${hello} </h1> </body> </html> mycomponent.java public class mycomponent { public string getstuff() { return "random stuff"; } } mycomponent.tml <span> ${stuff} </span> i .java files in corresponding packages (pages , components in main/java...) , .tml files in corresponding packages in resources. question is, why component text not showing ? everything looks ok me, it&#

calculator - I want to use the math.round function in a jquery file but I do not know where to place it to arrive at the wanted result -

i trying make calculator in jquery, , managed couple of things encounted issues , need help. want place math. round function code make division result more pleasant-looking not know where. tried .tofixed not example if have operation 5/2, result 2,500 , want 2.5. adressing wrong var? lost. here code: $operators.click(function (event) { event.preventdefault(); var currvalue = $(this).text(); var curroperand = parsefloat($display.text()); if (currvalue != 'ce') { if (operation != null && !afteroperation) { switch (operation) { case '+': $display.text(operand + curroperand); break; case '-': $display.text(operand - curroperand); break; case '*': $display.text(operand * curroperand); break; case '/':

Jquery/javascript named index array with array association -

i want know if possible (and correct) construct named index array associated other arrays. e.g., var signoptionset = []; signoptionset['basic'] = ['sign width', 'sign height', 'sign depth', 'base material', 'finish']; signoptionset['advanced'] = ['area', 'perimeter', 'lighting']; how access 'sign height' in signoptionset['basic']? i want know if possible... yes, although way you're using it, wouldn't want array, you'd want object ( {} ) (see below). ...(and correct)... some argue using array , adding non-index properties not correct. there's nothing technically wrong it, provided understand things (such json.stringify ) won't see non-index properties. how access 'sign height' in signoptionset['basic']? it's second entry, index 1, of array you've assigned signoptionset['basic'] , so: va

php - Error with id on INSERT INTO entity on Doctrine2/Symfony2 -

since days, i've problème 1 of entity. entity has id defined manually (no auto-increment). when try define it, doctrine return error on insert query : dbalexception: exception occurred while executing 'insert infosperso (num, login, nom, prenom, email, societe, adr1, adr2, cp, ville, tel, fax, nichandle, parrain, actif, state, emailvalide, date_creation, id_entite_legale_pays, pays) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' params [null, "test", "hebert", "donovan", "test@mail.com", "sncf", "tempore excepteur nulla molestiae sed temporibus eum officia error illo tempore et amet voluptatum vel modi cupiditate", "laboriosam eiusmod dolor non saepe incidunt cillum corrupti occaecat dolorem tempore aut quis esse autem", "13001", "marseille", "0442910000", "0442499569", 0, null, 1, 0, 1, "2015-06-04 11:09:46.000", null, 171]:

android - Using Loader to display data in an AlertDialog? -

i looking way display data retrieved loader sqlite db in alertdialog . clicking name in listview transfer db entry id dialogfragment , , based on this, additional data should loaded. loading such work seems happen after alertdialog displayed because message box shows null value. know if possible @ transfer data alertdialog this? help! import java.text.simpledateformat; import java.util.calendar; import java.util.date; import android.annotation.suppresslint; import android.app.alertdialog; import android.app.dialog; import android.content.contenturis; import android.content.dialoginterface; import android.database.cursor; import android.os.bundle; import android.os.handler; import android.support.v4.app.dialogfragment; import android.support.v4.app.loadermanager.loadercallbacks; import android.support.v4.content.cursorloader; import android.support.v4.content.loader; @suppresslint("simpledateformat") public class birthdaydetailsmessage extends dialogfragment imple

excel - Merge cells if another cell has the same value -

i have data in excel so: column1 column2 column3 total 37 45 61 37 68 99 123 76 12 ... i want produce following: column1 column2 column3 total 37 45 61 45, 68 37 68 99 123 76 12 76,... ... if column1 of row1 has same value row's column1 put column2 value in total comma. assuming 100 rows in total, please try: =if(iserror(match(a2,a3:a$100,0)),"",b2&", "&vlookup(a2,a3:b$100,2,0))

python - Django caching queries (I don't want it to) -

so i'm working in python/django , have problem django caches querysets "within session". if run python manage.py shell , so: >>> myproject.services.models import * >>> test = testmodel.objects.filter(pk = 5) >>> print test[0].name >>> john now, if update directly in sql bob , run again, it'll still john. if ctrl+d out (exit) , run same thing, have updated , print bob. my problem i'm running soap service in screen , it'll return same result, if data gets changed. i need way force query pull data database again, not pull cached data. use raw queries doesn't feel solution me, ideas? the queryset not cached 'within session'. the django documentation: caching , querysets mentions: each queryset contains cache minimize database access. understanding how works allow write efficient code. in newly created queryset, cache empty. first time queryset evaluated – and, hence, database que

java - Android right approach : where JSON response should be parsed - in UI thread, or in another one? -

i wondering - jsonobject or jsonarray received web-server should parsed in android app - in main ui or should delivered 1 ? for example, i'm using volley library : private void fetchresults(){ requestqueue queue = volley.newrequestqueue(mcontext); string url = authenticationrequester.url_get_all_orders; jsonarrayrequest jsondepartureobj = new jsonarrayrequest(url, new response.listener<jsonarray>() { @override public void onresponse(jsonarray jsonarray) { ivolleycallback.onjsonarraysuccess(jsonarray); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { volleylog.d(tag, "error: " + error.getmessage()); // hide progress dialog } }); queue.add(jsondepartureobj); } so should put ivolleycallback.onjsonarraysuccess(jsonarray); in thread execution or c

java - Writing a BufferedImage cache and save it to disk -

i'm developing java application in load long lists containing images (downloaded web), added quick hashmap<string,bufferedimage> cache, avoid redownloading same image multiple times. this works fine , application way faster, nice let cache persist through various sessions, changed cache serialized. bufferedimage not serializable , had wrote custom methods. my file structure should like: (int) number of elements [(url) image's key (object) image written using imageio] n times while file saving seems fine (at least have no exceptions), when try load url throws java.io.optionaldataexception length = 4 , don't understand why. first iteration goes fine, have exception try load second url , suspect there's wrong in way load first image. here's full code : import java.awt.image.bufferedimage; import java.io.file; import java.io.fileinputstream; import java.io.fileoutputstream; import java.io.ioexception; import java.io.o

hp uft - Mouse Hover in VBScript -

Image
i wondering if can me figure out solution problem having script. to give context, trying simulate mouse hover on menu. when put mouse on "new vendor", expand menu more options choose (in case "new care organization"). test purposes, want select "new care organization". here's visual of menu: when put mouse on "new vendor", want happen: here's have right now: browser("mypage").page("mypage").webelement("new vendor").click browser("mypage").page("mypage").webelement("medical care organization").click for reason, however, when run this, "new vendor" not expand , therefore "new care organization" not selected. it's if didn't recognize command expand "new vendor" , test fails. i thought doing right, can explain , possibly give me correct code fix this? much appreciated! option 1: if clicking on "medical c

unix - Beginner Software RE help, RAM Addresses, library loading, where to start? -

to start off, use os x unix based system. i have beginner theoretical knowledge in c++ , expand knowledge software reverse engineering. every guide seems jump in half way , seem miss giant gap of information required start up. end goal build working dylib application. start learning ram addresses, how work, how libraries loaded , actual hell start reading, subject. i've learned far has distinct start point, syntax find uses terminology don't understand. find myself branching off more , more because article used keyword don't understand, google it, other 1 uses 5 don't understand , stuck. application under question not have changing memory addresses, learn how compensate using offsets. where start?! before started reverse engeneering you'll need more theoretical knowledge of c language. forget c++ now, c simpler , it's low level once master you'll understand how programs work under hood. copy of c programming language brian kernighan , dennis

php - What's a cleaner way to output HTML from a Wordpress plugin? -

my wordpress plugin creates few shortcodes return blocks of html. when register shortcodes, this: add_shortcode('bb-loans-form', function() { return shortcodes::loanapplicationform(); }); and here static method shortcodes class: public static function loadapplicationform() { $form = new \adamwathan\form\formbuilder; $html = $form->open()->action('/apply')->class('bb-loan-form'); $html .= '<div class="bb-form-field">'; $html .= '<h2>loan application number</h2>'; $html .= $form->text('loan_app_number')->id('loan-app-number'); $html .= $form->submit('continue loan'); $html .= '</div>'; $html .= $form->close(); return $html; } this cumbersome, , messy. don't outputting html this. i've used heredoc, had use string substitution include important values when form rendered. is there better

java - Apache spark map-reduce explanation -

i'm wondering how works little snippet: if have text: ut quis pretium tellus. fusce quis suscipit ipsum. morbi viverra elit ut malesuada pellentesque. fusce eu ex quis urna lobortis finibus. integer aliquam faucibus neque id cursus. nulla non massa odio. fusce pretium felis felis, @ malesuada felis blandit nec. praesent ligula enim, gravida sit amet scelerisque eget, porta non mi. aenean vitae maximus tortor, ac facilisis orci. and snippet code count occurences of each words on text above: // load input data. javardd<string> input = sc.textfile(inputfile); // split words. javardd<string> words = input.flatmap(new flatmapfunction<string, string>() { public iterable<string> call(string x) { return arrays.aslist(x.split(" ")); } }); // transform word , count. javapairrdd<string, integer> counts = words.maptopair(new pairfunc

sql - Refer to a value inside of an exists sub-query -

i'm building query uses sub-query. when sub-query returns value want return value, if sub-query returns nothing want return today's date. problem when sub-query has value don't know how refer column want return. in case effdate: select case when exists(select top 1 pp.period_end_date [effdate] employee ee (nolock) inner join payplanner pp (nolock) on ee.clientid = pp.clientid , ee.paygroupuid = pp.paygroupuid ee.clientid = 85845 , pp.clientid = 85845 , ee.empuid = 133066325953730 , ee.m_eff_end_date null , pp.m_eff_end_date null , pp.payroll_status in ('e','i') , pp.date_type in ('r','a') order period_end_date) ???how access effdate here??? else getdate() end you can't access columns in subqueries. seem want maximum date -- if exists -- or current date. instead, use aggregation query coalesce() : select coalesce(min(pp.period_end_date), getdate()) [effdate] employee ee (nolock) inner join pa

Need to apply multiple filter on an excel column via VBScript -

i need apply multiple filter excel column using vbscript (vbs file, not vba). my sheet this: order line status ord1 awaiting return ord2 entered ord3 shipped ord4 fulfilled ord5 awaiting return ord6 shipped i need apply filter on line status column need show columns 'awaiting return','entered','shipped'. i wrote following code: set objsrcexcel = createobject("excel.application") objsrcexcel.visible = false obj objsrcexcel.displayalerts = false set objsrcworkbook = objsrcexcel.workbooks.open(srcfile) set objsrcworksheet = objsrcworkbook.worksheets(srcsheet) objxlappws .range("k1" ).autofilter 11,"=awaiting return",2 , "=entered",2 , "=awaiting shipping" end but results error. i able apply filter using above code, 2 filter options i.e. 'awaiting return' , 'entered' when try go 3 values, erred. //this code works 2 filter values objxlappws

SendKey command working with vbs but not C# -

i trying send ctrl + alt + left windows form button (c#) rotate screen. intel hotkey. when press button nothing happening, if use same command in vbs file works. this c# code not work: private void button1_click(object sender, eventargs e) { sendkeys.send("^%{left}"); } vb script work: set objshell = createobject("wscript.shell") objshell.sendkeys "^%{left}" i'm new maybe i'm missing obvious? maybe parenthesis issue: sendkeys.send("^(%{left})"); you can find more details in documentation stated that: to specify combination of shift, ctrl, , alt should held down while several other keys pressed, enclose code keys in parentheses. example, specify hold down shift while e , c pressed, use "+(ec)". specify hold down shift while e pressed, followed c without shift, use "+ec". not sure behaviour of vbs: expect same behavior of c# because vbs documentation sendkeys so...

android - Can't center Navigation Drawer items vertically -

main activity layout (removed irrelevant elements): <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" <relativelayout android:id="@+id/layout_relative_in_drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" > // more elements ... </relativelayout> <listview android:id="@+id/drawer_main" android:layout_width="120dp" android:layout_height="match_parent" android:layout_gravity="start" android:backgroun

oracle11g - PHP app connect to Oracle Database 11g - MVS 2013 & PHP Tools -

as in title - i'm using mvs 2013 , installed php tools extension. i'm trying connect created databese (oracle database 11g). <?php $conn = oci_connect('system', 'mypass', 'localhost/xe'); if (!$conn) { $e = oci_error(); trigger_error(htmlentities($e['message'], ent_quotes), e_user_error); } ?> this code gives me error: call undefined function oci_connect()

uiimageview - Crop image in swift -

Image
i trying crop image in swift. i'm trying implement like, user capture photo. once photo captured user allowed set crop area. i'm able image crop area, want crop image should resized particular width , height. is, if particular height or width smaller should resized. this image should of frame of it's maximum width , height. adding transparency other area. i had added code cropping let templayer = cashapelayer() templayer.frame = self.view.frame let path = uibezierpath() var endpoint: cgpoint! (var = 0; i<4; i++){ let tag = 101+i let pointview = viewcrop.viewwithtag(tag) switch (pointview!.tag){ case 101: endpoint = cgpointmake(pointview!.center.x-20, pointview!.center.y-20) path.movetopoint(endpoint) default: path.addl

java - Netbeans fast imports -

Image
i using netbeans , trying use fast import quick keys(alt+shift+i) when box displays no "classes found". ideas? have have updated in hope issue, alas nothing has changed. have gone through options - keymaps, , setting same guy next me. alt+shift+i using fixing selected class's import . example if using simpledateformat . when cursor in simpledateformat can check fix selected class's import. if class not imported can import. if use alt+shift+i in non-classes <no classes found> . importing class must click. if want import 2 or more can use ctrl-shift-i . more information see this: netbeans shortcuts

objective c - iOS: SVProgressHUD doesnt dismiss when user moves from one screen to another in IOS Xcode -

i have used svprogresshud progresshud. found svprogresshud doesnt dismiss when user moves 1 screen another. tedious call [svprogresshud dismiss]; in -(void)viewwilldisappear:(bool)animated of every class want find better solutions. have implemented below code want find better methods -(void)viewwilldisappear:(bool)animated{ [svprogresshud dismiss]; } svprogresshud in git . i know dismiss hud need call 1 of following method: + (void)dismiss; + (void)dismisswithsuccess:(nsstring*)successstring; + (void)dismisswithsuccess:(nsstring*)successstring afterdelay:(nstimeinterval)seconds; + (void)dismisswitherror:(nsstring*)errorstring; + (void)dismisswitherror:(nsstring*)errorstring afterdelay:(nstimeinterval)seconds; but dont want call [svprogresshud dismiss]; in -(void)viewwilldisappear:(bool)animated of every class since writing same code in overall projects in each class not way of coding you can create super class every class uses svprogresshud inherit class

excel - Index/match referring to concatenated cell -

i trying index/match range concatenated date in cell. cell '10-year sgs'!f6 in index/match formula below concatenated date. the date formula is: =concatenate(e6,"/",c6,"/",a6). the index/match formula is: =index('10-year us'!$b$12:$b$4427,match('10-year sgs'!f6,'10-year us'!$a$12:$a$4427,0)) strangely, if type date manually concatenated cell, index/match works. format both cells "date". does have idea? a string looks date not same thing date. try creating actual date date function . =date(a6, e6, c6) alternately, wrap concatenate function datevalue function convert string looking date actual date. =datevalue(concatenate(e6,"/",c6,"/",a6))

php - Laravel - Modify and return variable from @include -

i'm including multiple templates in loop using @include('template.included') before including template define $page = 0; and inside template, multiple times calls $page++; inside included template, value correctly increments, outside template seems $page variable stays same - it's looking @include creates it's own copy of each var use. i need $page variable update inside templates, , have it's value returned main template - missing simple? appreciate suggestions! edit: my issue, example: $page = 0; @include('template.included') //this calls $page++ 5 times echo $page; //returns 0 i need $page return 4, not 0 your assumption correct, laravel's view system creates new scope each view loads. illuminate\view\factory::make() method used when including views, this: new view($this, $this->getenginefrompath($path), $view, $path, $data) it's creating new view , passing data it, means it's sending copy of in

linux - spring integration sftp inbound channel adapter and temp file issue -

we using spring integration sftp inbound channel adapter poll every few seconds , downloads zip file local dir further processing. problem starts when there big file client still uploading file , inbound adapter picks incomplete file. using acceptallfilefilter remote filtering , local have custom filter. is there better way ignore or check if file uploaded , pick processing? this classic problem (s)ftp - fetching partial files. there 2 common solutions... write file different name, rename it. add special file (e.g. foo.done when foo.zip complete). spring integration (on writing side) uses 1) (writes file foo.zip.writing , renames foo.zip ). simplest mechanism because it's easy filter .writing files - spring integration automatically. 2) little more difficult because need write custom filelistfilter ignore foo.zip if foo.done not present. the underlying (s)ftp protocols have no way prevent fetching partial files without using mechanism these. edi

bash - execute shell command with php -

im trying execute bash script php/html button wake nas. <form action="" method="post"> <input type="submit" value="wake nas" name="zero" /> </form> <?php if (isset($_post["zero"])){ #echo "hello world!"; shell_exec("/var/www/html/wakenas.sh &"); }?> "hello world" printed when button pressed. code won't executed. wakenas.sh looks , works if execute on shell #!/bin/bash etherwake -d "bc:5f:f4:09:e1:07" echo "why!?!?!" > "/var/www/html/works.txt" exit 1 wakenas.sh has rights maybe guys know why wont executed. thanks in advance from dump: etherwake: program must run root. when execute wakenas.sh executing root. that's why works. give sudo permission (without password) user php server running. and change wakenas.sh to: #!/bin/bash sudo etherwake -d "bc:5f:f4:09:e1:07" ech

.net - Why WsHttpbindings giving error as "soap header action was not understood" but not the basichttpbinding? -

i have developed wcf service in wshttpbinding. when try consume it, getting error "soap header action not understood". when use same service in basichttpbinding, able consume service. can please explain properly? the ws-* protocol stack requires soap 1.2."soap header action not understood" error when soap 1.1 message processed service set soap 1.2 bindings (wshttpbinding). if client can't send soap 1.2 request, you'll have expose soap 1.1 interface, basichttpbinding is.

java - Unmarshalling Error CXF -

i use intellij latest version, jdk 1.7 , cxf 3.1 used these generate java client code wsdl. here wsdl <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions targetnamespace="http://myserver/definitions" xmlns:tns="http://myserver/definitions" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:icd="http://myserver/schemas/globalid"> <!-- schema imports + elements --> <wsdl:types> <xs:schema targetnamespace="http://myserver/definitions"> <xs:impo

c# - StructureMap throws ArgumentNullException on HttpContext -

i'm having weird issue structuremap.mvc5 i created brand new mvc5 project in visual studio (default options asp.net mvc project left selected.) i installed structuremap.mvc5 via nuget package manager ( install-package structuremap.mvc ). i added following code to top of "homecontroller.cs" file: namespace testmvc.controllers { public interface itest { string testmessage(); } public class test : itest { public string testmessage() { return "this worked again 23"; } } i added constructor , private member follows: public class homecontroller : controller { private readonly itest _test; public homecontroller(itest test) { _test = test; } finally, updated action result follows: public actionresult about() { viewbag.message = _test.testmessage(); return view(); } the project compiles , start up. given default index page normal, somewhere between