Posts

Showing posts from July, 2013

batch file - Error The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered -

i trying run powershell script windows batch file. sharepoint related script uses import-spdata . this works without issue when using usera 's login. however, if try run same batch file userb 's login, error below: c:\ps>execmypowershellscript.bat c:\ps>c:\windows\system32\windowspowershell\v1.0\powershell.exe -psconsolefile " c:\program files\common files\microsoft shared\web server extensions\14\config\p owershell\registration\psconsole.psc1" -command "c:\ps\mypsscript.ps1" the local farm not accessible. cmdlets featuredependencyid not registered. import-spdata : cannot access local farm. verify local farm configured, available, , have appropriate permissions access database before trying again. at c:\ps\run_mypsscript.ps1:5 char:18 userb has permissions run bat , ps1 files. you assuming, error related permission either bat or powershell file. the error comes sp cmdlet, have opened bat file , run powersh

iphone - Show String together with text in Localnotification -

i guess problem isn't tough one. i'm working on local notification. uilocalnotification* localnotification = [[uilocalnotification alloc] init]; localnotification.firedate = pickerdate; localnotification.alertbody = @"%@ additional text",[self nametextfield].text; localnotification.alertaction = @"show"; localnotification.timezone = [nstimezone defaulttimezone]; localnotification.applicationiconbadgenumber = [[uiapplication sharedapplication] applicationiconbadgenumber] + 1; localnotification.soundname = uilocalnotificationdefaultsoundname; so far works expected, alertbody shows <null> "additional text" why? you can't that, try [nsstring stringwithformat:@"%@ additional text", [self nametextfield].text]; the way you're doing show string literals not work variables. i'm surprised compiler let away that.

c# - MVC4 ExceptionContext ExceptionHandled Property no try catch block ELMAH -

i trying install , test elmah fist time. think have setup correctly. know elmah designed log unhandled exceptions. use standard template mvc 4 application generated visual studio 2012 in homecontroler class throw error without try , catch block public actionresult about() { // throw test error can see handled elmah // test go ~/elmah.axd page see if error being logged correctly throw new exception("a test exception elmah"); return view(); } in opinion unhandled exception. further use handleerrorwithelmahattribute class handle error. construct shown in many elmah tutorials posted here: how elmah work asp.net mvc [handleerror] attribute? the code bothers me is: public override void onexception(exceptioncontext context) { base.onexception(context); var e = context.exception; if (!context.exceptionhandled // if unhandled, logged anyhow || raiseerrorsignal(e) // prefer signaling, if possible || isfiltered(conte

javascript - .style("background-position", function(){...}) not populating the attribute -

full code here: http://jsfiddle.net/rczun/5/ the important part @ end wish use sample data set correct "background-position" element according data set, log displays there iteration , data it's still not being assigned. var container = d3.select('.icon-selection-container').attr('width',500); var s = container.selectall('.icon') .data(icon_defs); s.enter() .append('div') .attr({ class : 'icon icon-book' }) .style("background-image", "url('http://static.mabelslabels.com/images/booklabels2.png')") .style("background-position", function(d,i) { var bgpos = d.style.slice(20);//clean sample data console.log(bgpos); return bgpos; } ); you need remove ; @ end of value, work var bgpos = d.style.slice(21,-1); http://jsfiddle.net/rczun/6/

C++ assigning arrays to eachother; type int* = type int works but not int = int*? -

i have question: why throw error (cannot convert int* int[5]) int static_array[5]; int *dynamic_array; dynamic_array = new int[5]; static_array = dynamic_array; while works fine? int static_array[5]; int *dynamic_array; dynamic_array = new int[5]; dynamic_array = static_array; //this line changed i guessing types int can converted int* compiler? why couldn't int converted int* compiler well? anyone can provide actual explanation? thanks! this one: int static_array[5]; int *dynamic_array = new int[5]; // 1. dynamic_array = static_array; // 2. dynamically allocates array , stores address of first element in pointer dynamic_array overwrites address address of first element of static_array but one: int static_array[5]; int *dynamic_array = new int[5]; static_array = dynamic_array; attempts initialize array using address (thus compiler gives error invalid pointer array conversion). so why first 1 works? because static array (on righ

function - Make a program that calculates the sum of the first 20 Fibonacci numbers -

i need write program has sum of first 20 fibonacci numbers. using 2 functions summon size , sum of 20 numbers. have far. #include <stdio.h> int main( ) { int fib[20] = {0,1}; int *fib_ptr = &fib[2]; for(int = 0; < 20; i++){ *fib_ptr = *(fib_ptr - 1) + *(fib_ptr - 2); fib_ptr++; } for(int x = 0; < 20; x++) printf(“%4d”, fib[x]); printf(“\n”); return 0; } i know makes fibonacci numbers , not sum. instead of printf @ end, add numbers when looping through @ end. sum += fib[x]

insert into mysql with conditions using php -

i trying insert data database in loop list of people attend meeting need check availability first , if room holding meeting available here code <html> <body> <?php //try using error reporting on error_reporting(e_all); ini_set('diplay_errors', 'on'); $dbhost = "127.0.0.1"; $dbuser = "root"; $dbpass = ""; $dbname = "mss"; $connection = mysql_connect($dbhost, $dbuser, $dbpass, $dbname); if (mysql_errno()) { die("database connection failed:" . mysql_error() . "(" . mysql_errno() . ")"); } mysql_select_db('mss'); ?> <?php echo $id = (isset($_post['id']) ? $_post['id'] : "hello"); ?> <br> <?php echo $title = (isset($_post['title']) ? $_post['title'] : "hello"); ?> <br> <?php echo $employee = (isset($_post['employee']) ? $_post['employee'] : "hello"); ?> <br>

android - get handler return null in LooperThread -

public class looperthread extends thread { private handler handler = null; public handler gethandler() { return handler; } @override public void run() { looper.prepare(); handler = new handler(); looper.loop(); } } class helper { private static looperthread databasethread = null; static { databasethread = new looperthread(); databasethread.start(); } public void postrunable(runnable r) { databasethread.gethandler().post(r); databasethread.gethandler().sendmessage(new message()); } } //ui thread. class uiactivity extends activity { private helper helper = new helper(); public void oncreate(bundle savedinstancestate) { helper.postrunnable(new runnable() { public void run() { //work asyn,like query db. } }); } } sometimes call databasethread.gethandler().post(r); ,it return null,sometime not,why this?as usual, handler should initial static block.

NetBeans 8.0 PHP CodeIgniter Framework support -

i using netbeans 8.0 shows auto-complete zend framework not codeigniter . how can use codeigniter auto-complete support??? thanks copy code in answer here: netbeans code completion codeigniter php file in project. i used ci_autocomplete2.0.php in root of project. it's hack, work. since i'm familiarizing myself ci's syntax & naming conventions want. i installed 1 of kenai 7.3 modules in 7.4, other 1 show on webpage wasn't listed in plugin options, uninstalled , can't re-install again. haven't tried in netbeans 8 yet though. edit: sorry, figured out kenai modules both listed. "php ci framework repository" installed ok (don't know what, if anything, did yet). it's "php ci framework" won't install , lists out bunch of module dependencies. i'll update again if there's add when try nb8.

Pad A String With Leading Zeros for Specified Value Range in SQL Server -

i've used answer @ pad string leading zeros it's 3 characters long in sql server 2008 to pad column leading zeros in case it's 2 zeros , i'm using this: right('0'+isnull(replace(<columnname>, '"', ''),''),2) data ranges 1 99 includes value of of 'unk' unknown truncated using method. is there way around or should exploring different solution i'm dealing text , numbers in same column? cheers j (second revision) try this: select case when len(isnull(<columnname>, '')) > 1 isnull(<columnname>, '') else right ('00'+ isnull(<columnname>, ''), 2) end sample input/output: input null / ouput '00' input 'unk' / ouput 'unk' input '1' / ouput '01' input '99' / ouput '99'

php - How do I pass arguments in a route when defined in ini files in fatfree framework? -

in fatfree framework, defining routes in ini files. like: get|post /admin/login = controllers\siteadmin\login->index get|post /admin/login/@action = controllers\siteadmin\login->@action now wondering how pass arguments functions in setup. how set cache , ttl values each route? in .ini file, can pass arguments of route() method, separated commas: get /foo=class->method //ttl=0, kbps=0 /foo=class->method,86400 //ttl=86400, kbps=0 /foo=class->method,0,56 //ttl=0, kbps=56 to pass arguments, use following syntax: get /foo/@arg1/@arg2=myclass->mymethod the method receive parameters 2nd argument: class myclass { function mymethod($f3,$params) { echo $params['arg1']; echo $params['arg2']; } } concerning cache, set globally, not each route: [globals] cache=true

python - Counting items in list before consecutive instance -

i'd count amount of items in array before consecutive amount of zeroes inputted user. ['1', '0', '1', '0', '0', '0', '0', '0', '0', '0', 'e'] for example, if user inputs 3, there 3 items in list before consecutive amount of 3 zeroes. at moment code checks amount of consecutive zeroes , returns based on - how can change gain value of items before consecutive instance? largeblock = max(sum(1 _ in g) k, g in groupby(line) if k == '0') seats, wanted = ['1', '0', '1', '0', '0', '0', '0', '0', '0', '0', 'e'], 3 itertools import groupby occ, grp in groupby(enumerate(seats[:-1], 1), key = lambda x: x[1]): if occ == '0': available = list(grp) if len(available) >= wanted: print([seats[-1] + str(item[0]) item in available[:wanted]]) # ['e4'

javascript - Trigger action on Label change -

i'm doing website plugin appending block of code on existing web page, monitors content change of web element on existing page , trigger further actions on change. as plugin don't want modify code block of original page, want monitored element , register kind of "change event" on element code block. example <html> ... <body> ... <label id="idlable">some text</label> ... <!-- here begin code block --> <script> var label = document.getelementbyid("idlabel") label.addonchange(function (oldvalue, newvalue) { //do }); </script> <!-- here end code block --> </body> </html> i googled long time, didn't find solution. there possible that? my thanks, hai there no native function/option in js. can monitor changes using setinterval function here sample code : var oldtext=document.getelementbyid("idlabel").data; var tmr = window.setinterval(function(){ if(docu

web scraping - collect web page source with python 2.5.2 -

i working on appliance using old version of python (2.5.2) . i'm working on script needs read webpage, can't access normal libraries - urllib , urllib2 , requests not available. how did people collect in olden days? i wget/curl shell , i'd prefer stick python if possible. need able go through proxy may force me system calls. if want old-school entirely within python without urllib, you'll have use socket , implement tiny subset of http 1.0 fetch page. jumping through hoops through proxy painful though. use wget or curl , save few days of debugging.

http - How to format header WWW-Authenticate when authentication fails -

i'm implementing rest api provides functionality authenticating users. authentication requires user send post request following data in body: { "useroremail": "spook", "passowrd": "test1234" } if username , password match, user gets token server, while if don't, server returns 401 unauthorized, following header: www-authenticate: credentials realm="http://localhost:9000/auth/users/credentials" is header acceptable? realm contains location user can try authenticate again. it appears acceptable, maybe not optimal except under specific conditions. rfc1945 : the realm value (case-sensitive), in combination canonical root url of server being accessed, defines protection space. these realms allow protected resources on server partitioned set of protection spaces, each own authentication scheme and/or authorization database. realm value string, assigned origin server, may have additional semantics specif

makefile "no rule to make a target" error -

Image
i have been looking @ problem while , still don't know wrong. my makefile looks like: f90 = pgf90 netcdf_dir = /opt/netcdf lbs = -l$(netcdf_dir)/lib -lnetcdff -lnetcdf include_modules = -i$(netcdf_dir)/include exec = cng_wrfchem_emi objs = module_cng_wrfchem_emi_lib.o \ cng_wrfchem_emi.o ${exec} : ${objs} ${f90} -o $@ ${objs} ${libs} .f90.o: ${f90} -c ${include_modules} $< clean: rm -f ${exec} ${objs} *.mod the error message is: make: *** no rule make target `module_cng_wrfchem_emi_lib.o', needed `cng_wrfchem_emi'. stop. all files in same directory picture shows: thanks make doesn't know .f90 suffix, suffix rule not valid. it's not enough declare suffix rule if make doesn't know suffix. if want use suffix rules, have add new suffix .suffixes pseudo-target, this: .suffixes: .f90 or can use pattern rules, don't require (but gnu make-specific): %.o : %.f90 $

variables - Why does Go allow compilation of unused function parameters? -

one of more notable aspects of go when coming c compiler not build program if there unused variable declared inside of it. why, then, program building if there unused parameter declared in function? func main() { print(computron(3, -3)); } func computron(param_a int, param_b int) int { return 3 * param_a; } there's no official reason, reason given on golang-nuts is: unused variables programming error, whereas common write function doesn't use of arguments. one leave arguments unnamed (using _), might confuse functions like func foo(_ string, _ int) // what's supposed do? the names, if they're unused, provide important documentation. andrew https://groups.google.com/forum/#!topic/golang-nuts/q09h61oxwww sometimes having unused parameters important satisfying interfaces, 1 example might function operates on weighted graph. if want implement graph uniform cost across edges, it's useless consider nodes: fu

sql server - How to update and insert in T-SQL in one query -

i have database needs time time update. may happens there new data while update runs. in mysql there option insert ignore i can't find in t-sql. no problem update id 1-4 there new record id 5. update query don't work here. , when try insert data again duplicate key error. additional infos: i've forgotten data come external sources. call api data it. there have insert these data database. i have admit don't understand merge. solution use truncate first , insert data again. not best solution merge works, far understand it, 2 tables. have 1 table. , create table temporarly use merge , later drop table in eyes bit little table 200 records in it. you can use merge keyword. basically, need specify column(s) on join source of data target table, , depending on whether matching (existing record) or not matching (new record), run update or insert . reference: http://msdn.microsoft.com/en-us/library/bb510625.aspx

mysql - Increment File Name Before Extension By 1 in the Database -

Image
i have script uploads file , stores details of file name in database. when document gets uploaded want able update name of file in database proceeded incremental number such _1, _2, _3 (before file extension) if document_id exists. table structure looks this: id | document_id | name | modified | user_id 33 | 81 | document.docx | 2014-03-21 | 1 34 | 82 | doc.docx | 2014-03-21 | 1 35 | 82 | doc.docx | 2014-03-21 | 1 36 | 82 | doc.docx | 2014-03-21 | 1 so in case above want id 35 name doc_1.docx , id 36 name doc_2.docx. this have got far. have retrieved last file details have been uploaded: $result1 = mysqli_query($con,"select id, document_id, name, modified b_bp_history order id desc limit 1"); while($row = mysqli_fetch_array($result1)) { $id = $row['id']; $documentid = $row['document_id']; $documentname = $row['name'

c# - Change DateTimePicker Format different from Windows Format -

i have done system contains lot of forms use datetimepicker. need publish in country different date format mine. did search , found property can put custom format. don't want seek system datetimepicker put property. is there better way this? if want force specific format datetimepicker objects have, have no choice other going through them , setting values of datetimepicker.format , datetimepicker.customformat . reason limitation objects totally independent. no change on specific object affect object (unless expressed in logic flow). you might want create global application variable , reference in existing datetimepicker objects. 1 time action. later on able change value of global variable reflected in existing objects. i assume (out of question title) know default format of windows, or more of culture configuration on host machine. deploying country mean deploying host running other culture configurations (which automatically reflected datetimepicker objects

javascript - Avoiding repetitive creation of functions when calling async functions in loop -

is there way following without creating anonymous function 10 times? assuming settimeout takes 2 parameters , callback , interval. i've heard shouldn't create functions in loop since it's slow. however, if asynchronous function doesn't allow pass parameters want callback know about, possible avoid doing so? note: know in chrome settimeout takes more params, isn't ideal example. function dosomethingasync(i){ settimeout(function() { //this anonymous function created 10 times console.log(i); }, 1000); } (var = 0; < 10; i++) { dosomethingasync(i); } short answer - no . not if want match each iteration's value mapped back, doing here. not going comment performance here, rather focus on need first. if don't care value being mapped right call, can avoid creating functions simply there cases javascript engines allow. apply not having define multiple anonymous functions. achieved providing more info regarding current execu

ios - Xcode 5.1: Develop apps for iPad 1 -

Image
i create new project, set deployment target 5.1.1 (by typing in). can run app in simulator, when run on old ipad ios 5.1.1. displays black screen , in console see * terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'could not find storyboard named 'main_ipad' in bundle nsbundle /var/mobile/applications/404931a2-e5fd-46d0-88ce-19ceff459298/singleview.app (loaded)' does xcode 5.1 support ipad? when create ios project, make sure set universal 1 contains second storyboard called main_ipad .

html5 - How can I use DOMStringMap in TypeScript? -

let's have function: angular.foreach(myelements, function prepareelements(myel: htmlelement, index) { myel.dataset.myproperty = "whatever"; }) the problem error ts2094: property 'myproperty' not exist on value of type 'domstringmap' i don't understand interface in lib.d.ts interface domstringmap { } declare var domstringmap: { prototype: domstringmap; new (): domstringmap; } then later on... interface htmlelement { dataset: domstringmap; hidden: boolean; msgetinputcontext(): msinputmethodcontext; } is me or little unclear? i tried casting <domstringmap>myel.dataset.myproperty = "whatever" , did nothing... the domstringmap interface empty because spec not finalized : https://developer.mozilla.org/en/docs/web/api/domstringmap in meantime can use: myel.dataset['myproperty'] = "whatever";

c++ - Printing an array of STL list -

i'm having trouble printing array of lists (ex. list<string> hashtable[100] ) heres have far, question @ bottom: hash2.h 1 #ifndef __hash2_h 2 #define __hash2_h 3 4 #include<string> 5 #include<list> 6 #include<fstream> 7 8 using namespace std; 9 10 class hash 11 { 12 public: 13 void processfile(string filename); 14 void print(); 15 16 private: 17 list<string> hashtable[100]; 18 19 private: 20 int hf(string ins); 21 22 23 }; 24 25 #endif hash_function2.cpp 1 #include<iostream> 2 #include<string> 3 #include<fstream> 4 #include "hash2.h" 5 6 using namespace std; 7 8 void hash::processfile(string filename) 9 { 10 string word; 11 ifstream myifile(filename.c_str()); 12 while(getline(myifile, word)) 13 { 14 int index = hf(word); 15 hashtable[index].push_back(word); 16 } 17 myifile.close(); 18 } 19 20 void hash::print() 21 { 22 for(int = 0; < 100; i++) 23 { 24 if(h

How to add inputs values generated with a loop using jQuery in PHP -

how can values of inputs generated jquery loop in php? i have 2 inputs, generated loop , need 2 inputs jquery use validation in our thesis. the code is: <?php ($i=0; $i <5 ; $i++) { echo "$i. <input class='text$i' type='text' name='text$i'> <input class='text$i' type='text' name='text$i'> </br></br>"; ?> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(<?php echo "'.text$i"?> ).each(function(){ $(this).keyup(function(){ calculatesum(); }); }); }); function calculatesum() { var sum = 0; $(<?php echo "'.text$i'";?>).each(function() {

r - Error when converting dataframe row to character vector -

so i've got following dataframe, datafr. x1 x2 x1.1 x2.1 composite element composite element 14-3-3_epsilon-m-c -0.8660101895 14-3-3_epsilon-m-c -0.6814387425 4e-bp1_ps65-r-v 0.1056560215 4e-bp1_ps65-r-v 0.1787506005 4e-bp1_pt37t46-r-v 0.6408257495 4e-bp1_pt37t46-r-v -0.7485933875 4e-bp1_pt70-r-c 0.6413568085 4e-bp1_pt70-r-c 0.9554481415 i want make second row column names, @ row datafr[1,] and should be x1 x2 x1.1 x2.1 composite element composite element however, when convert character vector words changing numbers... as.character(c(datafr[1,])) [1] "49" "161" "49" "161" what going on? the problem data.frame columns not characters factors (read difference in r introduction.) you have do: as.character(unlist(datafr[1, ])) to character vector out ot cu

android - Robolectric and Library modules with resource files -

i using following project structure: main |_ project |_ build.gradle |_ library |_ build.gradle |_ settings.gradle i have included robolectric 2.3 in project , i've created basic unit test. problem every test fails (nullpointerexception) because have resources inside library cannot loaded unit tests. i've read robolectric should correctly work resource files inside library projects since 2.0. i cannot make run. in intellij idea project configuration, under test configuration, working directory set project module (i have resource files under project module also). thank you, hope robolectric confirm me if libraries resource files supported. solution : added project.properties file @ root of project following: target=android-18 android.library.reference.1=../mylibrary now robolectric finds resource files inside library , project.

html - Background size shrinks from 'cover' to 50% when using a keyframe animation on 'transform: scale' in Firefox -

i'm trying animate 'transform: scale' property of ::before pseudo element scale(1) scale(1.1), meant animated background of div covers whole viewport. background-size set 'cover' , displays correctly on page load, when animation kicks in after short delay, background shrinks 50% of viewport. works expected in safari, chrome , opera (on mac), on firefox (mac) behaviour described above. on top of that, when resizing browser window down smaller size, displays fine again, see issue in firefox, browser window needs @ least wider 1000px. example below (jsfiddle: http://jsfiddle.net/yuy4u/embedded/result/ ). html: <!doctype html> <html> <head> <title>animation test case</title> <link href="style.css" rel="stylesheet"> </head> <body> <div>this div</div> </body> </html> css: html { height: 100%; width: 100%; } body { height: 100%; margin: 0;

ios - skscene UIViewController send SMS from SKScene -

i trying allow player share score sms when game over. i have imported framework in project. imported in viewcontroller.h file. here viewcontroller.h file #import <uikit/uikit.h> #import <spritekit/spritekit.h> #import <messageui/messageui.h> @interface myviewcontroller : uiviewcontroller <mfmessagecomposeviewcontrollerdelegate> { } @end i tried import myscene.h so: #import <messageui/messageui.h> @interface myscene : skscene <mfmessagecomposeviewcontrollerdelegate> { } when want show sms share, use code in myscene.m file mfmessagecomposeviewcontroller *textcomposer = [[mfmessagecomposeviewcontroller alloc] init]; [textcomposer setmessagecomposedelegate:self]; if ([mfmessagecomposeviewcontroller cansendtext]) { [textcomposer setrecipients:[nsarray arraywithobject:nil]]; [textcomposer setbody:@"happy happy joy joy!"]; [self presentviewcontroller:textcomposer animated:yes completion:null]; } else { nslo

php - How to check if the server is in production or development environment? -

i refer this question regarding checking of server's environment php. why remote_addr being used instead of server_addr when checking whether server in production environment or development environment? sorry, confused here because thought remote_addr refers client's ip address. better use server_addr or there other reason why remote_addr chosen? the server_addr returns ip address of server under current script executing. the remote_addr returns ip address user viewing current page. you should read manual. assume below script running on server.. <?php echo $_server['server_addr']; echo $_server['remote_addr']; the first line prints server's ip address (this not change unless move script other server). second line prints ip address of user viewing page.(this changing different users connected different pcs)

vba - How to get InsertCrossReference() to create a relative link instead of an absolute link? -

in word vba, have built tool uses word insertcrossreference() function automatically insert link word document, e.g., ‎the function can create link section 2.1.5 . the link worked , seemed fine. when "used under industrial conditions", found when writer changed document structure by, example, adding section, example, section 2.1.5 becomes section 2.1.6, f9 refresh function did not change link 2.1.6 . stayed 2.1.5. so after investigating problem, found problem insertcrossreference() function created absolute link instead of relative link. on examining internals of link -- doing shift+f9 -- saw link looked follows: { ref _ref378698314 \n \h } which apparently absolute link. so tried changing \n \r change field { ref _ref378698314 \r \h } that worked! when applied shift+f9 field, value of field became 2.1.6 , supposed be. so... questions: why absolute link (\n) created default? given absolute link created default, there way of changing default? ev

java - Creating a postfix converter -

this question has answer here: handling parenthesis while converting infix expressions postfix expresssions 4 answers i trying create program takes in infix notation , prints out postfix form. problem output still in infix form, a+b*c output a+b*c. believe problem lies first while loop. goal in while loop if character operator while stack not empty priority method called should pop , print out operators of greater value, peek top of stack check priority. put stack.push() method outside while loop. hoped doing after priority established or if stack empty operator pushed onto stack. while second while loop should pop , print out left in stack. guys can give me , appreciate time people take guide programming greenhorn such myself. here code far: import java.util.*; public class postfixconverter { public static void main(string[] args) { scanner sc = new scanner(

Android: Google Analytics as part of Google Play Service -

now google analytics become part of google play services 4.3, changes need expect? do still need include googleanalytics jar android project? what dispatching data? on page https://developers.google.com/analytics/devguides/collection/android/v3/dispatch it's written: the local dispatch methods referenced in document have been marked deprecated due forthcoming availability of google analytics part of google play services. local dispatch methods may still used in non-google-experience devices. but doesn't explain how dispatching can managed under google play services also, wonder, there risk users won't have google play services 4.3 installed, , can't tracked google analytics? the documentation google analytics sdk v4 (now part of google play services) has been published! https://developers.google.com/analytics/devguides/collection/android/v4/

sass - Why won't PyCharm automatically refresh CSS output files when I am using an SCSS file watcher? -

Image
i have configured pycharm file watcher transpiles scss (in scss folder) css (in css folder). css files appear reflect changes in scss files when close , re-open css folder dropdown. how can make process automated? this have in arguments field: --no-cache --update $filename$:$projectfiledir$/main/static/css/$filenamewithoutextension$.css the output paths refresh option directory gets refreshed. needs match output directory specified in arguments field $projectfiledir$/main/static/css/

c# - Windows 8 XAML ListView Header not same size -

Image
currently having issue header of listview larger listview items, header doesn't line properly. use margin on header hack fix it, surely there's proper way fix this? <datatemplate x:key="headertemplate" > <grid height="36" background="#99999999" margin="0,0,5,0"> <grid.columndefinitions> <columndefinition width="3*"/> <columndefinition width="*"/> <columndefinition width="3*"/> <columndefinition width="*"/> </grid.columndefinitions> <textblock x:uid="name" textwrapping="wrap" horizontalalignment="left" text="project" grid.column="0" style="{staticresource bodytextblockstyle}" /> <textblock x:uid="qty" textwrapping="wrap" horizontalalignment="left" text="qty&qu

javascript - Tooltips for multiple lines Google Line Chart -

i wondering if knows how go adding tooltips multiple lines of data google line charts using datatable, addcolumn , addrow? i've seen done using other methods, quite hard in project , feel dumbass not figuring out. anyways, i've dumbed down code present essentials of problem. as see, tooltip shows line 2, not line 1. question this: how add tooltip line 1 using method? code: http://jsfiddle.net/qquse/550/ <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('number', 'y'); data.addcolumn('number', 'line 1'); data.addcolumn('number', 'line 2'); data.addcolumn({type: 'string', role: 'tooltip'}); data.addrow([1, 1, 2, "some fancy tooltip"

storing and retrieving images in dictionary - python -

can tell me how store images in dictionary, , how retrieve images dictionary based on key value. thanks in advance! it better store images in files , reference them filename: pictures = {'mary': '001.jpg', 'bob', '002.jpg'} filename = pictures['mary'] open(filename. 'rb') f: image = f.read() that said, if want store images directly in dictionary, add them: pictures = {} open('001.jpg', 'rb') f: image = f.read() pictures['mary'] = image images aren't special, data.

jquery - Check if input starts with X, alert and clear if not -

showalert = false; $('input').keyup(function(){ var value = $(this).val(); if (value.indexof('+') == 0) { $(this).val(''); // clear input showalert=true; // alert user if (showalert==true) { console.log ("phone number must start +"); showalert = false; } } }); i want phone number input filed + display alert once... code doesn't seem work. please check link click here you should match !="0" this should jquery var show=""; $('input').keyup(function(){ var value = $(this).val(); if (value.indexof('+') != 0) { $(this).val(''); if(show=="") { alert("phone number must start +"); } show="1"; } }); because want alert once

What does plugin migration mean in Redmine? -

i trying add plugin named redmine scrumbler redmine. far have created folder named "plugins" in root folder redmine installed , i've cloned plugin repository redmine scrumbler folder. now this says if plugin requires migration have migrate it. how know if plugin requires migration or not? plugin migration mean in redmine? also didn't see "plugins" folder in root folder redmine installed. folder need created or not? (the version of redmine 2.4.1) now how know if plugin requires migration or not? check plugin folder plugin_root/db/migrate . if folder exists , have migrations (files) plugin requires run migration. mentioned plugin requires migration ( https://github.com/256mbteam/redmine-scrumbler/tree/master/db/migrate ) also plugin migration mean in redmine? the plugin update db structure. plugins create additional tables/columns. also didn't see "plugins" folder in root folder redmine installed. folder nee

asp.net mvc - ActionLink with parameters not working? -

i trying call action result parameters show null? here actionlink: @html.actionlink("add", "apnewquote", "apquotes", new {oenum = model.oenumber, quotenumber = model.quotenumber, claimnumber = model.claimnumber, motorbodyrepairer = model.motorbodyrepairer, vehicleregistration = model.vehicleregistration, vehiclemakeid = model.vehiclemakeid, vehiclemodelid = model.vehiclemodelid, vehiclerangeid = model.vehiclerangeid}, new { @class = "btn btn-primary nicebutton" }) and in controller: public actionresult apnewquote(string oenum, string quotenumber, string claimnumber, string motorbodyrepairer, string vehicleregistration, int? vehiclemakeid, int? vehiclemodelid, int? vehiclerangeid) { //do things variables passed in apnewquoteviewmodel viewmodel = new apnewquoteviewmodel { oenumber = oenumber, quotenumber = quotenumber, claimnumber = claimnumber, motorbodyrepairer = motorbodyrepairer, vehicleregistration = vehicleregistrati

big o - solving recurrence T(n) = T(n/2) + T(n/2 - 1) + n/2 + 2 -

need on solving runtime recurrence, using big-oh: t(n) = t(n/2) + t(n/2 - 1) + n/2 + 2 i don't quite how use master theorem here for n big enough can assume t(n/2 - 1) == t(n/2) , can change t(n) = t(n/2) + t(n/2 - 1) + n/2 + 2 into t(n) = 2*t(n/2) + n/2 + 2 and use master theorem ( http://en.wikipedia.org/wiki/master_theorem ) for t(n) = a*t(n/b) + f(n) = 2 b = 2 f(n) = n/2 + 2 c = 1 k = 0 log(a, b) = 1 = c and have ( case 2 , since log(a, b) = c ) t(n) = o(n**c * log(n)**(k + 1)) t(n) = o(n * log(n))

Object detection using Kinect V2 -

i know object detection not possible using kinect v1. need use 3rd party libraries open cv or pointclouds (pcl). but curious know can achived using kinect v2? has done work on it? take @ project , use google blob detection keyword.

java - How can I stack 20 "plate" looking objects (ellipse shape) to 20 with if or while statements? My functions are not working correctly -

i trying code in java 20 plate stack using key pressed function stack new plate , mouse click function make individual plates disappear 1 one 0. cannot figure out why functions won't work not command them, please help. // declare global (shared) variables here float plate1x = 50; float plate1y = 200; int platecount = 20; // not write statements here (must inside methods) // add statements run once when program starts here. example: void setup() { size(400,400); plate1x = 200; plate1y = 50; background(255); plate1x = width/2; plate1y = height-25; } // end of setup method void draw() { // declare local variables here (new each time through) // add statements run each time screen updated here ellipse(plate1x, plate1y, 200,50); stroke(0); fill(50,100,40); } // screen repainted automatically @ end of draw method // end of draw method // add other methods here void keypressed() { plate1y = -25; while(

How can I solve this warning in iOS? Memory Leak -

this line in function creates warning: performselector may cause memory leak because selector unknown. doing wrong? - (void)connectiondidfinishloading:(nsurlconnection *)connection { [_delegate1 performselector:_selector1 withobject:json]; } and below method performselector - (void)httprequest:(nsurl*)url poststring:(nsstring *)poststring method:(int)method withselector:(sel)selector withdelegate:(id)delegate { _responsedata = [[nsmutabledata alloc] init]; // procedures parse @ desired url request = [nsmutableurlrequest requestwithurl:url cachepolicy:nsurlrequestreloadignoringlocalandremotecachedata timeoutinterval:5]; // set http method if (method == 0) { [request sethttpmethod:@"get"]; // asks xml response [request setvalue:@"application/json" forhttpheaderfield:@"accept"]; } _selector1 = selector ; _delegate1 = delegate ; [self startconnection]; return; }

Apply css on required input field -

Image
i want styling on default required oninvalid="this.setcustomvalidity('please enter drug name')" shown below. to this. is possible that? nice css sample picture: width: 100%; background: #1a1a1d; position: relative; color: #fff; min-width: 120px; font-size: 11px; border: 1px solid #000000; padding: 4px 10px 4px 10px; text-shadow: 0px 1px 0px #111;

iphone - View frame changes when hiding the status bar iOS 7 -

i trying solve issue while, i have view controller embedded in navigation controller , want toggle status bar hide/show. the problem when set status bar hidden view including navigation bar jumps up. how can avoid behavior? want hide status bar without other effects, , navigation bar staying extended 0 64 px height. i created simple project demonstrate problem. few notes possible solution: - cant use auto layout - navigation bar cant translucent - "view controller-based status bar appearance" must set no to honest, recommend modify desires. behavior you're describing built uinavigationcontroller, so, basically, can't you're describing without writing own uinavigationcontroller subclass - though, more honest, far clear me you'd have override interfere behavior, might necessary write substitute interface. example, have presented view controller containing navigation bar , interface, , in complete control of height , position o

c++ - Setting or consulting boolean. Which has the best performance? -

just curiosity, process fastest: setting value boolean (ex: changing true false) or simple checking value (ex: if(boolean)...) the problem have "which fastest" underspecified answered conclusively, , @ same time broad yield useful conclusions if answered conclusively. productive avenue curiosity can take build mental model of machine , run both cases through it. foo = true stores value true location allocated foo . raises question: , how foo stored? impossible answer without running complete source code through compiler right settings. anywhere in ram, or in register, or use no storage @ all, being eliminated compiler optimizations. depending on foo resides, cost of overwriting can vary: hundreds of cpu cycles (if in ram , not in cache), couple cycles (in ram , cache), 1 cycle (register), 0 cycles (not stored). if (foo) means reading foo , performing conditional branch based on it. regarding aspects i'll discuss here (i have omit many details , majo

javascript - Controller issues in Angular -

i have controller simple thing.. opens url being passed using phonegap inapp browser. working no longer working! .controller('jobdetailctrl', ['$scope', '$routeparams', 'job', 'profile',function ($scope, $routeparams, job,profile) { $scope.job = job.get({jobid: $routeparams.jobid}); $scope.url=$scope.job.url; $scope.read($scope.url); //defining read function open inapp browser $scope.read =function(url){ console.log("myurl"+url); var ref = window.open(url, '_blank', 'location=yes,toolbar=yes'); ref.addeventlistener('exit', function() { }); }; when call function fails. not print in console. please help. thanks js you have define function before calling it... try this .controller('jobdetailctrl', ['$scope', '$routeparams', 'job', 'profile',function ($scope, $routeparams,

php - vagrant-shopware fails at establishing database connection -

this error shown after step 4 of installation "database import" . cannot understand why referenced file "sw4_clean.sql" not in github repo of shopware-4 @ location shown should show missing during install? i tried editing config.php before each attempt establish database. results database details = internal sever error shown in config.php.dist = internal sever error empty = config.php populate settings = internal sever error i using vagrant build on windows 8 https://github.com/eriksixt/vagrant-shopware can shed light on might going wrong? error received error message. url: importdatabase?offset=0&totalcount=0 message: internal server error please try fix error , restart update. response {"code":2,"message":"fopen(\/vagrant\/shopware- 4\/install\/src\/..\/assets\/sql\/sw4_clean.sql) : failed open stream: no such file or directory", "file":"\/vagrant\/shopware- \/install\/src\/lib

Ignoring quotes while sorting lists in Python? -

i making program read file, alphabetize info, , paste output.. issue having in information begins quotes (""). the main function program auto-sort mla works cited pages (for fun obviously). here code... love criticism, suggestions, opinions (please keep in mind first functioning program) tl;dr -- how ignore " 's , still alphabetize data based on next characters.. code: import os, sys #list text mainlist = [] manlist = [] #definitions def fileread(): open("input.txt", "r+") f: newline in f: str = newline.replace('\n', '') #print(str) manlist.append(str) mansort(manlist) #print("debug") #print(manlist) def main(): print("input data(type 'done' when complete or type 'manual' file-read):") x = input() if x.lower() == 'done': sort(mainlist) elif x == '': print("you must type something!") main() elif x.lower

quickblox - Video chat in android -

what doing: i building android application 1 1 video chatting , need here what did: 1) came across quickblox , tried best understand , implement , coudn't working 2) researched sipdroid , cant understand either what want: i in need of either 1) simple library, documentation implement video chat. 2) excellent tutorial implementing video chat in android. please guide me

c# - Windows Store App and a WebApi -

i'm having bit of trouble recent windows store app , webapi. i'm trying login system on it, , had working console application + asp.net webapi. here's console application code: using (var client = new httpclient()) { console.writeline("insira o username"); string nome = console.readline(); console.writeline("insira password"); string password = console.readline(); client.baseaddress = new uri("http://localhost:49800"); // variavel global client.defaultrequestheaders.accept.clear(); client.defaultrequestheaders.accept.add(new mediatypewithqualityheadervalue("application/json")); users usrlogin = new users() { login = nome, password = password }; var response = client.postasjsonasync("api/employees/login", usrlogin).result; if (response.issuccessstatuscode) basically, i'm creating users object , send webapi, makes checking db. how can "translate" windows store application?