Posts

Showing posts from February, 2011

javascript - validate input for jquery -

i haven`t form, input html: <script src="index.js"></script> </head> <body> <p>name</p> <input type="text" size="15" id="title" placeholder="enter title" onclick="check(this)"> <p>description</p> <textarea rows="7" cols="20" id="description" placeholder="enter description"> </textarea> <p>price</p> <input type ="number" value="00.0" min="0" step="0.1" id="price"><br> <button id="add_new_product" >add new product</button><br> <a href="catalog.html">all product</a> </body> i must validate input on empty. js file: $(function(){ $('#add_new_product').click(function(){ var title = $("#title").val(); var description = $("#description").val...

java - Remove tabulation on TextArea and go to next field -

in javafx8 want know how it's possible don't add tabulation in textarea when press tab , go the next field textfield do. in javafx2 resolve problem following code public class tabtextareaskin extends textareaskin implements skin<textarea> { public tabtextareaskin(final textarea textarea) { super(textarea); textarea.focusedproperty().addlistener(new changelistener<boolean>() { @override public void changed(observablevalue<? extends boolean> observablevalue, boolean aboolean, boolean aboolean2) { if (!aboolean2) { textarea.deselect(); } } }); textarea.addeventfilter(keyevent.key_pressed, new eventhandler<keyevent>() { @override public void handle(keyevent event) { if (event.getcode() == keycode.tab) { skinbase skin = (skinbase) textarea.getskin(); if (skin.getbehavior() instanceof textareabehavior) { ...

algorithm - Determine offset where the most constructive interference occurs -

Image
i have 2 arrays of data: i align these similar graphs (by adding offset either array): essentially want constructive interference, shown when 2 waves produce same wave larger amplitude: this same finding destructive interference, 1 of arrays must inverted shown: notice second wave inverted (peaks become troughs / vice-versa). the actual data not consist of 1 major , 1 minor peak , trough, of many, , there might not noticeable spikes. have made data in diagram simpler show how data aligned. i thinking few loops, such as: biggest = 0 loop -10 10 offset count = 0 loop through array1 ar1 loop through array2 ar2 count += array1[ar1] + array2[ar2 - offset] replace biggest count if count/sizeof(array1) > biggest however, requires looping through offset , looping through both arrays. real array definitions extremely large , would take long. how go determining offset required match data1 data2? jsfiddle (note language agnostic ...

php - I connect Twitter and Google, but then error: {"message":"SSL is required","code":92}]} -

i use sparks codeigniter , want connect social platforms. facebook works, twitter , google not. my error: fatal error: uncaught exception 'exception' message 'error fetching remote https://api.twitter.com/oauth/access_token [ status 401 ] invalid / expired token /oauth/access_token ' in /home/binotumv/public_html/beta/sparks/oauth/0.3.1/libraries/oauth.php:87 stack trace: #0 /home/binotumv/public_html/beta/sparks/oauth/0.3.1/libraries/request.php(504): oauth::remote(' https://api.twi ...', array) #1 /home/binotumv/public_html/beta/sparks/oauth/0.3.1/libraries/request/access.php(20): oauth_request->execute(null) #2 /home/binotumv/public_html/beta/sparks/oauth/0.3.1/libraries/provider.php(214): oauth_request_access->execute() #3 /home/binotumv/public_html/beta/application/controllers/auth.php(74): oauth_provider->access_token(object(oauth_consumer), object(oauth_token_request)) #4 [internal function]: auth-...

Windows Batch File to Find String in Filename -

how can find string in filename using windows batch command. systems generated files has dates in file name "xxx_2014-04-11_v1.xml", want read file name verify date before performing other operation. how can achieved? something this: for /f "delims=_ tokens=2" %%a in ('echo "xxx_2014-04-11_v1.xml"') echo %%a

c - How to record sound in buffer using ALSA -

i'm begining learn linux , alsa , wondering if there way store sound record microphone directly buffer. read here http://www.linuxjournal.com/article/6735?page=0,2 how make recording program. need little more complex. need record sound untill hit key. reason need because i'm messing raspberrypi(debian on it) , see if turn sound monitoring/detecting device. my main problem when try use record (./rec >name.raw ) nothing. ouputs empty .raw file. #define alsa_pcm_new_hw_params_api #include <termios.h> #include <alsa/asoundlib.h> struct termios stdin_orig; // structure save parameters void term_reset() { tcsetattr(stdin_fileno,tcsanow,&stdin_orig); tcsetattr(stdin_fileno,tcsaflush,&stdin_orig); } void term_nonblocking() { struct termios newt; tcgetattr(stdin_fileno, &stdin_orig); fcntl(stdin_fileno, f_setfl, o_nonblock); // non-blocking newt = stdin_orig; newt.c_lflag &= ~(icanon | ec...

javascript - For google analytics i am getting Status: Tracking Not Installed -

i have added google analytics site http://share-books.herokuapp.com/ when view page source, google analytics scripts there, getting following message when view statistics, , there 0 visits. can 1 kindly me problem. status: tracking not installed in google analytic console, getting following initializing google analytics. analytics_debug.js:9 registered new plugin: ga(provide, "linker", function) analytics_debug.js:9 registered new plugin: ga(provide, "displayfeatures", function) analytics_debug.js:9 running command: ga(create, ua-49998516-1, share-books.herokuapp.com) analytics_debug.js:9 creating new tracker: t0 analytics_debug.js:9 running command: ga(send, pageview) analytics_debug.js:9 sent beacon: v=1&_v=j18d&a=647141557&t=pageview&_s=1&dl=http%3a%2f%2fshare-books.herokuapp.com%2f&dr=http%3a%2f%2fshare-books.tk%2f&ul=en-us&de=iso-8859-1&dt=share-book%20%3a%20donate%20your%20extra%20books&sd=24-bit&sr=13...

html - Why is my LI tag not growing with it's child P tag? -

i can't figure out why li's height not increasing when p element does.. tried kinds of position , overflow on elements, don't see it.. can me out? in advance! for more code see fiddle html: <div class='todo_list'> <div class='add_list'>&#43; list</div><br> <h3 contenteditable='true'>new list<span class='remove_list' contenteditable='false'></span></h3> <ul> <li> <input type='checkbox' class='task_status'> <p class='task' contenteditable='true'></p> <span class='drag'></span> </li> </ul> <div class='add_task'>&#43;</div><br> </div> css: *{ margin: 0; padding: 0; } body{ font-family: tahoma, sans-serif; } div.todo_li...

Android AppCompat Themes -

i'm running through android developer classes, i'd start building apps. i've downloaded adt package eclipse, i'm familiar eclipse. i'm playing around themes, reason, project has been set allow appcompat themes. means have use themes theme.appcompat.light. if try use theme.holo or theme.translucent, run time error: illegalstateexception: need use theme.appcompat theme i've set minimum sdk version in androidmanifest.xml follows: <uses-sdk android:minsdkversion="11" android:targetsdkversion="19" /> any appreciated. edited after guillermo's response: thanks guillermo, hasn't worked. here updated androidmanifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myfirstapp" android:versioncode="1" android:versionname="1.0" > <uses-sdk ...

ezpublish - Ez publish 4.7: embed twit in xml block -

i want embed tweet xml block using ezoe. there way embed custom html code it? tweet embed code looks this: <blockquote class="twitter-tweet" lang="en"><p>bla bla </p>&mdash; air france (@airfrance) <a href="https://twitter.com/airfrance/status/454220292685320192">april 9, 2014</a></blockquote><script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script> you need activate html class literal tag. settings/content.ini [literal] availableclasses[] # class 'html' disabled default because gives editors # possibility insert html , javascript code in xml blocks. # don't enable 'html' class unless trust users has # privileges edit objects containing xml blocks. #availableclasses[]=html customattributes[] => reproduce following in admin & front siteaccesses settings/siteaccess/youradminsiteaccess/content.ini.append.ph...

How to change the font of the page numbers in word using delphi xe5 -

i automating word documents. generating them solely code. currently adding page number in header of each page, know how change font name of page number along font size. any appreciated. please note, wrddoc active document variable. here code create page number with: wrddoc.sections[1].headers[1].pagenumbers.add(wdalignpagenumberright); and tried following code change font error, "method font not supported automation object": wrddoc.sections[1].headers[1].pagenumbers.font.name:='times new roman'; wrddoc.sections[1].headers[1].pagenumbers.font.size:=12; any appreciated thank you. it works me: wrddoc.sections.first.headers.item(1).range.font.name := 'times new roman'; wrddoc.sections.first.headers.item(1).range.font.size:= 12; delphi xe, office 2010.

java - Error happens when compiling lib from *-rpc.discovery file on iOS -

i have tried 1 https://developers.google.com/appengine/docs/java/endpoints/consume_ios compile , generate lib on ios still print error: "error: parameter 'userid' has objcname 'userid' , did else." here discovery file generated eclipse: https://mega.co.nz/#!45p2nzzd!ktwfr2kbqgron4oehbzhojupsiqlaayzhtcbannbyja can me? thank much i realize old question putting here in hopes of helping others. tracked down putting xcode breakpoints in google service generator... crazy. error happening because java endpoint has both @named annotation , parameter same name. so you've got both this: @apimethod(name = "somemethod", path = "whatever") public void blah( @named ("theproblem") string foo ) throws serviceexception { .... } and this: @apimethod(name = "anothermethod", path = "whatever") public void blah( @named ("bar") string theproblem ) throws serviceexception { .... }

jquery - How Can Update MySQL field Using Ajax And PHP -

i want update data in mysql database using ajax , php. html <td><input type="text" class="event" name="title<?php echo $row['id']?>" id="title_id_<?php echo $row['id']?>" value="<?php echo $row['title']?>" disabled/></td> <td><input type="datetime" class="event" name="start<?php echo $row['id']?>" id="start_id_<?php echo $row['id']?>" value="<?php echo $row['start']?>" disabled/></td> <td><input type="datetime" class="event" name="end<?php echo $row['id']?>" id="end_id_<?php echo $row['id']?>" value="<?php echo $row['end']?>" disabled/></td> <td><div class="edit_wrapper"><a href="#" c...

Checking a character is fullwidth or halfwidth in Python -

i want check whether character fullwidth or halfwidth using python string="你好hallo" char in string: if( \uff60- \u0f01 , \uffe0-\uffe6 ): print( char +"is fullwidth") elif(\uff61-\uffdc , \uffe8-\uffee):print(char+ " halfwidth") please me change pseudocode real python code. you can check width of character using unicodedata.east_asian_width(unichr) : import unicodedata char in string: status = unicodedata.east_asian_width(char) if status == 'f': print('{0} full-width.'.format(char)) elif status == 'h': print('{0} half-width.'.format(char))

c++ - Object getting deconstructed when out of scope -

i have class , has array of objects instance variable. each object internally contains int , struct . somehow object gets deconstructed. i.e. class allinput { public: int numproducts; product * products; public: allinput(int _numproducts, product * _products); }; class product { public: int sellingprice; //ri struct demanddistribution observationdemand; //c2i public: product( lucydecimal _sellingprice, //ri lucydecimal _costpriceassmbly); }; and have function creates it: allinput* in1() { struct demanddistribution * _observationdemand1 = (demanddistribution*) malloc(sizeof(demanddistribution)); // set values product * product1 = new product(165,_observationdemand1); //initialize product2, product3, product4 product products[4] = { *product1, * product2, *product3, *product4}; allinput* = new allinput(4, products); return all; } when allinput* in = in1() . executed, see each prod...

java - Regular expression to match strings in quotes with double-quotes inside -

Image
i face challenge match input in following format: the input consists of key=value pairs. key starts slash. value may number or string in quotes. the value may optionally contain escaped quotes, quote following quote (""). such escaped quote should considered part of value. there no need check escaped quotes balanced (e.g. ends escaped quote). the regular expression should match given key=value part of sequence , should not break long inputs (e.g. value 10000 characters). first came solution: /(\w+)=(\d+|"(?:""|[^"])+"(?!")) and performs not bad, fails in java6 stackoverflowerror long inputs (cashes regexplanet example). tried improve bit run faster: /(\w+)=(\d+|"(?:""|[^"]+)+"(?!")) but if input not matching, enters endless loop in backtracking trying match it. then came regex: /(\w+)=(\d+|".+?(?<!")(?:"")*"(?!")) which performing slower, seems solve task. ...

java - Appropriate location for an external config file used by an external library in tomcat -

i have jar placed in lib/ext within tomcat directory. needs load config file external jar. directory appropriate? practice place properties file within lib/ext folder, .i.e, same folder location of jar. or more apt place in conf folder within tomcat directory assuming relative path lib/ext conf remain same?

ios - Reactive Cocoa and multiple AFNetworking requests in short period of time -

i'm struggeling way handle multiple requests web service afnetworking , reactive cocoa. in scenario user asking api deliver bunch of suggestions character/integer search input pick city out of list. here's code: first method gets executed user types in more 3 characters/integers - (void)fetchdata:(nsstring *)searchtext { nslog(@"%@", searchtext); if ([searchtext validatestringwithpattern:bkpostcoderegex]) { self.searchurl = [nsstring stringwithformat:@"%@location/postalcode/%@/%@", bkbaseurl, self.countrycode, searchtext]; } else if ([searchtext validatestringwithpattern:bkcityregex]) { self.searchurl = [nsstring stringwithformat:@"%@location/city/%@/%@", bkbaseurl, self.countrycode, searchtext]; } else { nslog(@"error alert - no valid input"); return; } rac(self, searchresults) = [[[self postrequest] map:^(nsdictionary *json) { nsarray *results = json[@"data...

mdm - Configuration Profiles - iOS -

with encoded plist file mdm vendor,i have created 2 push certificate have 2 unique topic configuration profile. create 2 configuration profile (.mobileconfig) wi-fi payload. in each profile create connection 2 individual wifi networks. when both profiles installed mobile, how know network connected? can set preference? a side note: 2 push certificate different topics should used 2 different customers. each device can enroll 1 mdm server , use 1 topic. also, unrelated configuration profiles (meaning nothing in push certificates influence configuration profiles). answering question: the control on connection have "autojoin" key wifi network. if both networks have autojoin keys, don't think have control on network connected (if both of them in range). i not sure, believe network best signal quality connected in such case.

sql server - How to update data from textbox to SQL? -

private sub button1_click(sender object, e eventargs) handles button1.click cn.open() try cmd.commandtext = "update patient_detail set (name ='" & textboxname.text & "',age = '" & textboxage.text & "',sex = '" & textboxsex.text & "',address = '" & textboxaddress.text & "',check_in = '" & textboxchin.text & "',check_in_illness = '" & textboxchinl.text & "',sevice = '" & textboxservice.text & "',check_out_illness = '" & textboxchoutl.text & "',check_out = '" & textboxchout.text & "',transfer = '" & textboxtransfer.text & "',patient_result = '" & comboboxptr.text & "') id = '" & textboxid.text & "' " cmd.executenonquery() ...

ios - UITableViewCell Autolayout for Different Widths -

Image
i've setup uitableviewcell in storyboard has 2 labels, setup so: ----------------------- | ------------------- | | | label 1 | | | ------------------- | | ------------------- | | | label 2 | | | ------------------- | ----------------------- label 1 has fixed 15px constraints top, left , right margins. content hugging (h: 251, v: 251). compression resistance (h: 750, v: 750). label 2 has fixed 15px constraints bottom, left , right margins. content hugging (h: 251, v: 251). compression resistance (h: 750, v: 751). label 1 has fixed 1px constraint label 2. the height of cell calculated follows: - (cgfloat)tableview:(uitableview *)tableview heightforrowatindexpath:(nsindexpath *)indexpath { int width = tableview.bounds.size.width - 30; nsstring *label1text = ....; nsstring *label2text = ....; int label1height = ceilf([label1text boundingrectwithsize:cgsizemake(width, maxfloat) options:nsstringdrawinguseslinefragmentorigin attributes:@{n...

Sharepoint 2010 NintexWokflow won't save -

i have workflow working in intranet, have edit workflow nintex workflow on friday , able save until today tried edit , save workflow giving me error below: server unable process request ---> filehttp://inet/solutions/support/nintexworkflows/service status v2/service status v2.xoml.wfconfig.xml checked out editing me i don't know how check in file again , don't know file located solution me on how or resolve error i using nintex workflows in sharepoint 2010 seeing can't create new tags solution found open support site via sharepoint 2010 navigate file want check in files checked out the can continue editing workflow

java - Equals Method for assertEquals with String-objects to compare -

i want override equals method can compare 2 variable-objects if equal object has string "abc" variable, , object has string "abc" variable. need class in order manage , parse expressions. so want make testclass testing wether variable-objects equal. want override that. @override public boolean equals(object obj) { return this.variable.equals(((variable) obj).getvariable()); } now problem not quite sure if work later, since use equals-method here, used before compare strings. since override it, doesn't mean use same method now? or variable-strings using equals-method comparing strings? if thats not working, else should compare string in overwritten equals method? as @jbnizet said, method, of right now, throw classcastexception if obj not of right type. should work on first: @override public boolean equals(object obj) { if (!obj instanceof variable) { return false; } return this.variable.equals(((variable) obj).getvar...

php - Comparing start and end time with other time 'blocks' -

Image
i'm working fullcalendar , unable see solution problem. i've tried many things. stackoverflow posts , own ideas (based on posts). the problem/challenge when add event on fullcalendar. adds calendar , thats want. there should restriction on overlapping events. there no overlapping events. my question extremly similar determining if 2 time ranges overlap @ point what have a list of events in array fetch database. the database i've start , endtime event drop in format available (e.g. timestamp/date) example finially code efficient way check if current date between 2 dates (years dont matter) based on accepted answer here if($error == false){ foreach($events $skey=>$dbevent){ if(strtotime($dbevent['start_time']) == strtotime($event->starttime)) { $skey = 0; break; } if((strtotime($dbevent['start_time']) < strtotime($event->starttime)) && (strtotime($...

ruby on rails - how to use check box with additional textbox -

i have multiple check box in form ,working good.i need give more option add 4 chkbox text field related them my model looks like paymentgateway.rb has_many :payment_rfps has_many :rfps, :through => :payment_rfps class paymentrfp < activerecord::base attr_accessible :payment_gateway_id,:rfp_id belongs_to :payment_gateway belongs_to :rfp end rfp.rb has_many :payment_rfps has_many :payment_gateways, :through => :payment_rfps my view part <div class = "lft_cms" ><b>payment gateways</b> <div class="field"> <%= hidden_field_tag "rfp[ payment_gateway_ids][]", nil %> <% paymentgateway.all.each |payment_gateway| %> <%= check_box_tag "rfp[payment_gateway_ids][]",payment_gateway.id, @rfp.payment_gateway_ids.include?(payment_gateway.id), :id => dom_id(payment_gateway) %> <%= label_tag dom_id(payment_ga...

c++ - use a run-time value in template instantiation -

please consider class a , , function object a_less . a_less compares 2 a pointers, depending on result of a::getvalue() . class { int getvalue(const string &parameter); }; struct a_less : public binary_function<a *, *, bool> { a_less(const string &p) : parameter(p) { } bool operator()(const *lhs, const *rhs) const { return a->getvalue(parameter) < rhs->getvalue(parameter); } string parameter; } how go declaring/creating sorted containers (sets, priority_queues, ...), of a pointers, sorted a_less depending on specific (run-time) values of parameter ? like this: std::string p = ...; std::set<a,a_less> m(a_less(p)); you have specify template parameter compare (which 2nd set ). when constructing map, need give comparison function object constructor of map .

How to lazy evaluate functions in a sequence in Scala -

let's have 3 functions in class can return option[file]. looking nice way execute them in order , stop when first function evaluates (similar pick() lazy evaluation), i.e. don't want use nested if-else statements. abstract class foo() { def first(): option[file] def second(): option[file] def third(): option[file] def pick(): option[file] = { seq(first(), second(), third()).find(_.isdefined).map(_.get) ) } the parameter option.orelse passed name, can use chain methods: def pick(): option[file] = first orelse second orelse third

assembly - Entering the CMOS or BIOS at the console after boot and before the OS comes up, its able identify the devices -

can confirm thinking based on question above? after cpu process reset vector address instruction located @ system bios address. process system bios code includes scanning io buses , dynamically assigning system resources (interrupts, io addresses) these io devices. , builds interrupt vector table these allocated system resources in system memory? pretty yes. talking x96 though. x86 pc model bios scan , detect isa/pci(e) based peripherals. bioses on each peripheral (and/or main bios) setup respond bios interrupts. not in way bios , isnt first thing bios in list of tasks bios does.

call to column gives row vector instead of column vector python -

hey im making loop have repeatedly update column vector x estimate adding column x estimate, whenever i'm calling column in x estimate givers me row vector , cannot redefine output row column using vstack because no longer able plug in @ start of loop needed new calculations below output xestimate xest = [[ 0. 0. ] [ 1. 1. ] [ 1. 1.0001] [ 1. 1.0001]] later on call 'xest[:,0]' output >> '[0 1 1 1]' however need column, '[[0], [1], [1 [1]]' i dont understand call [:,0] should column should not? thanks i understand xest numpy array. quick answer: can obtain want np.vstack(xest[:,0]) or, better, xest[:,0][:, np.newaxis] slightly longer answer: why want that? of time, don't, , rely on broadcasting you. there no such thing "column vector" in numpy, cases can handled normal "row vector". corner cases need distinction, can make view , play strides, [:, np...

express - OData - Strange index with MongoDB [Mongoose: Cast Error] -

i have mongodb documents schema: id: {type: "id", key: true, computed: true, nullable: false}, name: {type: "string", nullable: false, maxlength: 50} and these documents exposed odata small web application (i'm using express, jaydata, , mongoose). these of documents: { "_id" : objectid("5343fd656b9c5c084b8f2a70"), "name" : "service74"}, { "_id" : objectid("5343fd656b9c5c084b8f2a6f"), "name" : "service73"}, { "_id" : objectid("5343fd656b9c5c084b8f2a6e"), "name" : "service72"}, ... if type address http://localhost:8080/marketplace/services('5343fd656b9c5c084b8f2a70') correspond service74 result: ... <d:id>ntm0m2zknju2yjljnwmwodriogyyytcw</d:id> <d:name>service74</d:name> ... of course if use id specified in result obtain same page. the problem occurs when try use mongoose function findbyid : a...

build - Unnecessary project rebuilds when unit testing in Visual Studio -

Image
i know this question (and answers), despite trying suggested options still stuck. i have solution multiple projects, particular case let's i've got exampleprojecta , corresponding unit test project exampleprojectatest . first 1 added reference test project - not via visual studio's "project references" link dll (something "..\path\$(config)\exampleprojecta.dll" ) - due build server requirements in our company, problem existed when still had "project references" . building , running single unit test works fine changing single letter in unit test , letting test run results in rebuild of exampleprojecta , though shouldn't necessary setting (there few) files in exampleprojecta "copy always" "copy if newer" in respective properties didn't help checking checkbox under tools => options => projects , solutions => build run (see below) didn't change to see if there more information available,...

mariadb - mysqld_safe does not allow MySQL connection -

i cannot start mysqld without getting following error: [root@alarm ~]# mysqld 140414 16:01:04 [error] fatal error: please read "security" section of manua l find out how run mysqld root! 140414 16:01:04 [error] aborting 140414 16:01:04 [note] mysqld: shutdown complete if try start mysql, tell me cannot connect local mysql server through socket '/run/mysqld/mysqld.sock'. fixed running mysqld_safe instead of mysqld. has stopped working , following error: error 2002 (hy000): can't connect local mysql server through socket '/run/mys qld/mysqld.sock' (2) i use mariadb on archlinux distribution. know how fix this? edit 1: steve, managed start mysqld service using systemctl can seen here: [root@alarm ~]# ps aux | grep mysql mysql 880 1.0 10.3 514276 52776 ? ssl 09:30 0:01 /usr/bin/mysqld --pid-file=/run/mysqld/mysqld.pid root 1618 0.0 0.1 4032 936 pts/0 s+ 09:31 0:00 grep mysql when try run mysql, still erro...

c# - Custom names on enum elements -

suppose there's enum so. [flags] public enum crazies { 1 = 2, 2 = 3, 3 = 4 } now, when force different values stringified, text in beautiful tongue, differ considerably usual meaning of numerics. suppose users prefer more conventional definition of natural numbers , wish see text " two ", although variable value one (nb it's crazies.one ). what'd simplest way map stringification of predefined names of elements? right i'll go following don't it. private static string decrazyfycrazies(crazies wrong) { switch(wrong) { case crazies.one: return "two"; case crazies.two: return "three"; } return "four"; } if need int cast int return (int)crazies.one; for more custom string display can use display name i.e public enum crazies { [display(name="custom name one")] 1 = 2, [display(name="custom name two")] 2 = 3 } see more power enum

excel - Finding minimum difference between two cells over range? -

given values below... b c d e (f) (g) abs() blake ... 292 ... 290 ... 291 ... 285 0 -2 +1 -6 6 alan ... 262 ... 253 ... 252 0 -9 -1 9 ...how find minimum difference between pairs of cells (b:c, c:d, d:e, etc), goal find "most weight lost in 1 week?" -6 , -9 answers i'm looking for. this office weight loss challenge thingy .. , i'm not incredibly familiar excel. in advance! -6 , -9 answers i'm looking for. use 1 in g1 : =min(if(c1:e1<>"",c1:e1-b1:d1)) this array formula , type formula press ctrl + shift + enter . curly brackets automatically appear @ start , end of formula. drag formula down. if you'd returns abs of min value, use: =abs(min(if(c1:e1<>"",c1:e1-b1:d1))) with array entry

mongodb - Does Moongoose 3.8.8 support $position operator? -

does moongoose 3.8.8 (the lastest version) support $position ( http://docs.mongodb.org/manual/reference/operator/update/position/ ) operator mongodb 2.6.0? in following code example new elements inserted in end of array useractivity.activities: model: var useractivity = new schema({ userid: {type:string, required:true, unique:true}, activities: [activity] }); var activity = new schema({ act: {type: number, required:true}, }); query: var activity = { act: 1 }; model.useractivity.update( { _id: dbact._id }, { $push: { activities: { $each: [ activity ], $position: 0 } } }, function (err, numaffected) { if (!err) { // } }); this doesn't matter , never matters "framework" implementation , not mind explaining why. every single "framework" ( such mongoose, mongoid, doctrine, mongoengine, etc, etc, etc ) built upon basic "driver" implementation has in cases ...

html - Jumbotron can't get centered -

i started using bootstrap. i'm having problem centering jumbotron. can't post image example because need 10 reputation. code: <div class="container"> <div class="col-md-8 jumbotron center"> <h1>jumbotron heading</h1> <p class="lead">cras justo odio, dapibus ac facilisis in, egestas eget quam. fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> <p><a class="btn btn-lg btn-success" href="#" role="button">sign today</a></p> </div> </div> my css: .jumbotron { border-bottom: 1px solid #e5e5e5; } .jumbotron .btn { padding: 14px 24px; font-size: 21px; } .center{ text-align: center; } i'm sorry if solution easy i'm beginner web developer. you've set size of jumbotron 8 columns on 'me...

ios - how to save an NSMutableArray to local storage -

i want save nsmutablearray file , load every time program runs. best solution this? this example: // add new item arraylist nsstring *textnewcategory = [alert textfieldatindex:0].text; [arraylist insertobject:textnewcategory atindex:0]; // save arraylist usercategory = [nsuserdefaults standarduserdefaults]; [usercategory setobject:arraylist forkey:@"newcategory"]; nslog(@"arraylist 1:%d", arraylist.count); // ex: in case, has count : 30 //in viewdidload, array saved before usercategory = [nsuserdefaults standarduserdefaults]; arraynewcategory = [[nsmutablearray alloc] initwitharray: [usercategory objectforkey:@"newcategory"]]; arraylist = arraynewcategory; nslog(@"arraylist 2:%d", arraylist.count); // in moment, has count: 29. i don't understand why re-loaded array has 29 items instead of 30 expect. save array plist: [array writetofile:path atomically:no] and retrieve it: nsmutablearray *array = [[nsmutablearray al...

c - Can't find documentation for strtok_s() -

what each argument passed it, return? how better regular strtok ? please give me simplified , basic explanation possible. this detailed in appendix k (bounds checking interfaces) of iso c11 standard. optional part of standard provides "safer" (a) versions of existing functionality provided in core part of standard. the prototype is: char *strtok_s ( char * restrict s1, rsize_t * restrict s1max, const char * restrict s2, char ** restrict ptr); the runtime constraints checked part of safety features are: the pointers s1max , s2 , , ptr must non-null. if s1 null pointer, *ptr must not be. the value of *s1max must less or equal rsize_max . the end of token found must occur within first *s1max characters of s1 first call the end of token found must occur within first *s1max characters of searching resumes on subsequent calls. the safety aspect that, if of constraints violated, no indirection occurs on s1 ...

javascript - Get "this" within the parent class -

my problem can't access proper this object in parent class. parent class : viewcontroller.prototype.display = function() { console.log(this); // log window object }; child class : parentmissionsviewcontroller.prototype = object.create(viewcontroller.prototype); parentmissionsviewcontroller.prototype.constructor = parentmissionsviewcontroller; parentmissionsviewcontroller.prototype.parent = viewcontroller.prototype; parentmissionsviewcontroller.prototype.display = function() { // other stuff here this.parent.display.call(); }; i don't why isn't current object, if can explain me ? if call this.parent.display(); then looks like: var = this.parent; that.display(); which you, suppose, wanted avert. using call way, need provide value this : this.parent.display.call(this /* , arg, arg... */); see the signature of call @ mdn .

ios - Search results label in UISearchbar -

Image
how set search results label app store on iphone ? or this: you can either use uisearchdisplaycontroller class or add uisearchbar, set controller using it's delegate , implement necessary methods. apple's reference: https://developer.apple.com/library/ios/documentation/uikit/reference/uisearchdisplaycontroller_class/reference/reference.html

Swig: passing unsigned char array from C++ to Java -

i have c++ function in .cpp file; unsigned char *myfunc() . how can convert array in byte[] array in java? mean, in java, want like: byte[] b = mylib.myfunc(); i using swig , appearently need define kind of conversion unsigned char byte in .i file, don't know how. thank in advance try returning std::string instead of unsigned char* , %include <std_string.i> in .i file. std_string.i typemaps, might end byte[] on receiving side. if can change return type of myfunc create wrapper via %inline , %inline %{ std::string myfuncstr() { return myfunc(); } %} if want can %rename myfuncstr myfunc , hiding fact myfunc exported java wrapper real myfunc . if doesn't work, flexo's solution swig: convert return type std::string(binary) java byte[] will.

How to clean Maven cache from Grails command/SDK? -

i'm looking grails sdk command (i.e. grails maven-clean ) clean local .m2\ cache, forcing rest of grails build ( grails war , grails run-app , etc.) re-fetch them remote repos. ideas? have u tried ..> refresh dependencies , issue grails clean on command line ...some time deleting bogus file under ./m2 , refresh dependencies might save lot of time... also : related grails maven-clean -u command check one grails maven help mavenrepo ("http://my.server/repos/my-grails-plugins") { updatepolicy 'always' } here possible values updatepolicy: never – never check new snapshots – check new snapshots daily – check once day new snapshots (the default) interval:x – check once every x minutes new snapshots

c++ - glGetUniformLocation gives glError: GL_INVALID_VALUE -

i'm using modified version of this minimal example opengl code (in qt 5.2.0) working oculus hmd. relevant parts have not been changed me. however, calls glgetuniformlocation in gl_uniform_2f/4f/1i functions give glerror gl_invalid_value (it's call, used many glgeterror calls find it). i read before trying such operation in different threads might cause problem, i'm not using threads (as far know, anyway). the shader program compiles/links without problem, shouldn't issue, either. so far, nothing tried helped, , since i'm rather inexperienced regarding shaders, maybe can see problem. edit: after validating shader program with glvalidateprogram(gl_fragment_shader_program); glgetprogramiv(gl_fragment_shader_program, gl_validate_status, &result); glgetprogramiv(gl_fragment_shader_program, gl_info_log_length, &infologlength); std::vector<char> programerrormessage(infologlength+1); glgetprograminfolog(gl_fragment_shader_program, infologle...

How can I find device model name in universal app for Windows 8.1 -

the api i'm using requires model name of device being used. in windows 8 use microsoft.phone.info.devicestatus.devicename . however, creating new universal app in windows 8.1 , 'microsoft.phone' namespace seems missing. how find model name of device being used universal app in windows 8.1 you can use easclientdeviceinformation class retrieve device information. sample: var deviceinformation = new easclientdeviceinformation(); var devicename = deviceinformation.friendlyname; var operatingsystem = deviceinformation.operatingsystem;

pdfbox - embedding an image on an existing pdf is not working -

i using pdfbox api fix image on particular location. existing pdf document has images , text. document using template. have put company specific logo on top right corner of document. but when try position it, previous formatting , other stuffs lost , seems 2 images seen. first covering whole pdf , second actual position.not sure why happening. problem images, because have used same way write texts , works perfectly. .. please me have stuck...thanks in advance.

View Scheduled Emails in Google Analytics -

i consulting group has several users on ga account. how can see scheduled email each person set make sure they're correct , can assist them when have problems? if can't done, can please point me official google statement saying can't done?...at least way can tell boss :) thanks! that cant done. pointing googles statement of why cant done thing can give current documentation api. imo feature located in management api under user permissions i'm not sure that's best place either. user permissions - developer guide i feel idea , added long list of feature requests feel free star it. manage scheduled emails i'm not sure add think may decided there grate spam risk this. have wait , see. tell boss not available in google analytics api feature request made.

ios - boundingRectWithSize adds extra bottom padding to UILabel -

Image
uilabel created this: label = [[uilabel alloc] initwithframe:cgrectmake(32, 10, 268, 44)]; label.textalignment = nstextalignmentleft; label.backgroundcolor = [uicolor yellowcolor]; label.numberoflines = 2; label.linebreakmode = nslinebreakbytruncatingtail; then update label this: label.text = sometext; cgrect frame = label.frame; nsdictionary *attributes = @{nsfontattributename: label.font}; cgrect rect = [sometext boundingrectwithsize:cgsizemake(label.frame.size.width, maxfloat) options:nsstringdrawinguseslinefragmentorigin attributes:attributes context:nil]; frame.size.height = rect.size.height; label.frame = frame; this works fine label has 1 line of text, have maximum of 2 lines. when 2nd line gets truncated, bottom padding gets added label, makes impossible position label below (the red label in images): why happen? if it's bug, there wo...

c++ - Lambda capture reference variable by reference -

for lambda, i'd capture reference held in outer scope reference already. assume referenced value outlives lambda, not scope in lamdba gets created. i know that if lambda captures reference variable by value , referenced object copied. i'd avoid copy. but happens if capture reference variable by reference ? if original reference variable out of scope before executing lambda? safe? in other words: object behind reference referenced or reference variable referenced in lambda? auto f() { const auto & myref = g(); return [&]{ myref.dosomething(); }; } f()(); // safe? yes, key issue in capturing object reference lifetime of referenced object, not lifetime of intervening references used it. can think of reference alias rather actual variable. (and in type system, references treated differently regular variables.) reference aliases original object, , independent of other aliases used alias object (other fact alias same object). =====edit====...

How do i use a While/For loop to create classes?? (Python/PyQt) -

i have created code create multiple classes different class names (i.e. question1, question2 etc.) import sys pyqt4 import qtcore, qtgui class starttest(qtgui.qmainwindow): def __init__(self, parent=none): super(starttest, self).__init__(parent) self.central_widget = qtgui.qstackedwidget() self.setcentralwidget(self.central_widget) question1 = question1(self) self.central_widget.addwidget(question1) self.central_widget.setcurrentwidget(question1) question1.proceed.clicked.connect(self.question2) def question2(self): question2 = question2(self) self.central_widget.addwidget(question2) self.central_widget.setcurrentwidget(question2) = 0 while i<2: class question+i(qtgui.qwidget): def __init__(self, parent=none): super(question+i, self).__init__(parent) question = qtgui.qlabel('what 5+5?') self.proceed = qtgui.qpushbutton("proceed...

editor - Sublimetext 2.2 Highlight Matching Lines -

Image
i can't seem find package plugin or setting highlighting matching lines in sublimetext 2.2? if highlight single word circle other matching words, need entire line. see attached image editplus, that's need. guys know of this? thanks! after selecting line of interest, ctrl + d select next instance of line. if wantto select matching lines, use ctrl + super + g (if on osx, think alt + f3 on windows). no additional package needed find matching lines.

android - Why does we mention activities in manifest -

we specify current activity , start activity intent , call through method startservice(). why need mention activity in manifest again..?? indexing (what can app do?) can answer @ least part of why activities. manifest declare intentfilter how system understands application does. i.e. should activity illegible choice when user trying take picture? choose file? share piece of text? in addition intentfilter tells launcher application have activity included in applications drawer. configuring (what main activity?) there several configuration options can set on activities have done in manifest i.e. singletop. without declaration in manifest there no place declare these configurations. time saving (where can system find service?) manifest file used system know kind of components application have. without registering activities/services/receivers/content providers system have scan , parse whole apk every time wants use specific component find it. slow, that's why there...

nsmanagedobject - Core Data Managed Objects Sets -

i trying write simple personal finance app own use , have following issue , wondered if can set me straight. my data model quite simple, have 'account' managed objects have nsset of 'transaction' managed objects in turn have nsset of 'split' managed objects. the 'split' object has category , amount transaction can made of multiple categories differing amounts. e.g transaction total £40 made £25 - food , £15 - fuel etc the 'transaction' managed object can have optional 1 1 relation 'transaction' managed object. when want represent transfer. therefore have 2 'transaction' objects same attributes date etc each belongs different 'account' shows when query list of transactions account. i have overridden appropriate setters on 'transaction' managed object setdate when called, checks see if has 'transaction' managed object linked , if has, changes date of transaction. way changes made 1 transaction re...

c# - Loading application for Console Application -

i have application in c # , wpf application calls console application performs tasks , makes call main form. first step completed, when trying call main application, not possible. this main application method calls console app private void window_loaded(object sender, routedeventargs e) { var doc = new xmldocument(); doc.load("http://www.mysite.org.br/cantina/arquivoxml.xml"); if (doc.documentelement != null) { var node = doc.documentelement.selectsinglenode("/application/version"); var node1 = doc.documentelement.selectsinglenode("/application/zipfile"); if (node != null) { var version = node.innertext; var versionassembly = system.reflection.assembly.getexecutingassembly().getname().version.tostring(); if (convert.todouble(version) > convert.todouble(versionassembly)) ...