Posts

Showing posts from March, 2013

c - How to make 64bit Preprocessor defined constant compile without warning? -

imagine this: #define putvalue 0x000000000000000f #define setstr(s) literate(s) #define literate(s) #s ... foo (putvalue, setstr(putvalue)); how can make work this, foo wants first parameter 64 bit integer, , second parameter const string hexadecimal representation of integer leading 0x . so cant do: #define putvalue 0x000000000000000full as break second parameter. but not doing breaking first. oh figgured out awesome way so: foo (int64_c(putvalue), setstr(putvalue)); is doing job.

c# - user.config ignored assembly information and is located in default location -

i have c# excel add-in project uses user settings. the file saved in weird location, guess default one. far understand, location derived information taken assemblyinfo.cs file. in theory path should be: c:\users\jeremy\appdata\local<profile directory>\<company name>\<app name>_<evidence type>_<evidence hash>\<version>\user.config but in case, user.config ends in: c:\users\jeremy\appdata\local\microsoft_corporation\c__users_jeremy_path_u1gevrwm5dgrhpsynfqgtuhhmlxzqlm4\14.0.7132.5000\user.config i double checked , information company name or version defined in assembly file. somehow ignored. causes me lot of trouble because have 2 applications should using own user.config files, because of issue write in same file... for info, i'm building executables wix. do have hints solve that? i'm still not sure why i'm having weird path, might because of nature of software vsto add-in. in case, solved issue implementing

sql server - SQL CASE statement for if -

i've looked around , cannot find answer this. far i'm aware i'm using correctly i'm missing keeps coming 'incorrect syntax near keyword 'case'' i'm trying take 2 values, , depending on 'word' return value of 1-5. these multiplied give me 'rating' declare @pr int declare @ir int declare @r int declare @probabilityrating varchar(max) declare @impactrating varchar(max) set @probabilityrating = 'high' set @impactrating = 'medium' case @probabilityrating when 'very low' @pr = 1 when 'low' @pr = 2 when 'medium' @pr = 3 when 'high' @pr = 4 when 'very high' @pr = 5 end case @impactrating when 'very low' @ir = 1 when 'low' @ir = 2 when 'medium' @ir = 3 when 'high' @ir = 4 when 'very high' @ir = 5 end set @r = @ir * @pr where going wrong?! since you're reusing case , maybe makes sense

c# - Why am I not able to access an image from code-behind -

i have following gridview: <asp:gridview showheaderwhenempty="false" alternatingrowstyle-backcolor="#ebe9e9" autogeneratecolumns="false" onsorting="yourtasksgv_sorting" allowsorting="true" id="yourtasksgv" runat="server" clientidmode="static" emptydatatext="you have no tasks assigned you" onrowdatabound="yourtasksgv_rowdatabound" onrowcreated="yourtasksgv_rowcreated"> <columns> <asp:templatefield> <itemtemplate> <asp:image id="imgexpcol" alternatetext="plus" clientidmode="static" imageurl="~/theimages/subtaskplus.png" runat="server" cssclass="imgexpcol" /> <asp:panel id="pnlsubtasks" runat="server" cssclass="pnlsubtasks" clientidmode="static"> <asp:gridview id=

pdf - iText Error: java.io.IOException: trailer not found -

i'm creating web application fill pdf form using itext. create pdf forms i'm first using microsoft word create template, saving it, opening file in adobe acrobat xi pro, adding form fields, , saving pdf. problem pdf not saving trailer when execute this: pdfreader reader = new pdfreader(templatename); it throws exception "java.io.ioexception: trailer not found". know can read pdf if has trailer because i've tried reading other pdfs. appears issue acrobat not adding trailer pdf. if try creating pdf form scratch in acrobat not saved trailer. has else run problem? there setting in acrobat add trailer? there way itext read without trailer? ====update==== i must have had old version of itext because when downloaded latest version able read pdf file. after reading file , stamping got exception closing stamper. code looks this: pdfreader reader = new pdfreader(templatename); fileoutputstream os = new fileoutputstream(outputpath); pdfstamper stampe

Where to find php_imagick.dll for php 5.5.12 for Windows wampserver 2.5? -

i using wampserver 2.5 on windows 7 (32 bit) , php version 5.5.12 . unable use imagick . i have installed imagick version 6.8.9 on system , works charm on command line. further, have followed instructions enable on wampserver. inserted " setenv magick_home c:/imagemagick " in httpd.conf @ appache. downloaded php_imagick-3.1.2-5.5-ts-vc11-x86.zip copied , pasted php_imagick.dll zip php.ini @ appache. while running simple script on php [$a = new imagick()] i error [class 'imagick' not found] . kindly direct me right way of installation , right downloads install imagick on wampserver 2.5 / windows 7 / 32bit / php 5.5.12 . manual installation of imagick on wamp, xampp, , iis create folder imagick in php/ext folder. now add newly created php/ext/imagick folder windows path. download latest version of imagick windows link. http://windows.php.net/downloads/pecl/releases/imagick/ download php extension of imagick link. http://windows.php.net

Custom animation for navwindows Titanium -

//load profile controller. function go_to_profile() { var controller = alloy.createcontroller('profile', { title : 'profile', name : '_profile', isflyout : true }); var newwindow = controller.getview(); alloy.globals.navgroup.openwindow(newwindow, { animated : true, transition:titanium.ui.iphone.animationstyle.curl_up }); } here code. modify it, window slides in upwards. transition not seem work , keeps sliding in left right. any idea why, cheers. it's simple, ti.ui.ios.navigationwindow doesn't allow transitions. only when call `window.open()' can define transition prop.

ios - draw an coloured rectangle in CPTAxisLabel (core-plot) -

what want draw small rectangle inside cptaxislabel display colour, have ready tried draw rectangle in layer , add sublayer, stretches small sublayer on label , text isn`t visible anymore, tried make cptlegend , add label did not found method position in right side of label, sits in center, tried changing legends position, frame, bounds, padding , nothing. know better way of adding rectangle shape in cptaxislabel , keep text in label ? i assume you're using cpttextlayer label's contentlayer . use image fill on text layer contains rectangle. make stretchable image , set stretchable area right of rectangle. set paddingleft on text layer leave room rectangle left of label text.

android - Custom view draw circle produces elipse -

Image
i have custom view , i'm trying draw circle in middle of view. code produces elipse: paint p = new paint(); p.setstyle(style.stroke); p.setcolor(color.green); p.setstrokewidth(0.02f); mcanvas.drawcircle(0.5f, 0.5f, 0.2f, p); the view width , height same darker round rectangle. after few tries, figured out it's because width , height of canvas not equal. had scale canvas same width/height. code if encounters same problem: mcanvas.save(); mcanvas.scale(1f, ratio); //ratio between width , height mcanvas.drawcircle(0.5f, 0.5f/ratio, 0.2f, p); mcanvas.restore();

javascript - Phone number validation regex with custom constraints -

i should validate phone number. constraints this. phone numbers should not contain alphabets(silly though mention ;) ) phone number should have minimum 10 characters , maximum 17 characters. phone number should accept "-" , ".", "+".(not mandatory) "-" or "." if present, should not in starting of number or ending of number. only 1 "+" allowed , in starting of number phone number should not valid if characters entered "-" or "." so far using following expression. var phoneexpression = /^(?=.*[0-9])([0-9\.\-\+\ \(\)\/]+)*$/; though not meeting constraints. please provide me regular expression . this 1 should meet constraints except 10 characters , maximum 17 characters because not count + sing if present. if need should duplicate regex alternation | ^\+?[0-9][0-9.-]{8,15}[0-9]$ demo

sql - Perl/Postgresql: plperl.so undefined symbol: Perl_sv_2bool_flags -

this first post on here sorry if don't provide information required first time round! my boss , have been trying install plperl on our postgres installation on 1 of our servers (centos 6.5, postgres 9.2.1, perl 5.10.1) , keep running same problem follows: error: not load library "/opt/postgresql/9.2/lib/postgresql/plperl.so": /opt/postgresql/9.2/lib/postgresql/plperl.so: undefined symbol: perl_sv_2bool_flags this error returned when try , install language (create language plperl;) either through sql or using pgadmin iii gui. i have checked have lperl.so file in /opt/postgresql/9.2/lib/postgresql/ looking libperl.so posts pertaining problem suggest. have tried placing libperl.so in lots of different places every man , dog has different suggestion should placed. running ldd /opt/postgresql/9.2/lib/postgresql/plperl.so returns following: ldd /opt/postgresql/9.2/lib/postgresql/plperl.so linux-vdso.so.1 => (0x00007fff2d9b7000) libpe

ls - Linux list files recursively ignoring a pattern -

i have same problem this post . only instead of finding .txt files, want list of files not .txt files. something like $ ls -lr | grep -v .java which not want. use find suggested in post , negate -name condition ! have other way round: find . -type f ! -name "*.txt" # ^^^^^^^ ^^^^^^^^^^^^^^^ # files | # file names not ending .txt

ios8 - How can you download WatchKit? -

does know when watchkit available download ios developers? will xcode 6 include emulator allow apple watch app created/tested on mac? update: 11/18/14 - watchkit officially available on apple's website . must download latest version of xcode developer center. watchkit allows developers build apple watch apps. according apple, apple watch apps using current watchkit (released in november) must tied iphone app (you create new target in xcode project). however, apple has said later in 2015 support independent apple watch apps. watchkit available in november of 2014 download. there's still no word on when apple launch apple watch besides "early 2015"

c# - Can two repositories share the same unit of work? -

in project have 2 tabs , in viewmanager class have following code add register views region , ibondsunitofwork unitofwork = new bondsunitofwork(new testentities(dalutilities.projconnectionstring)); irepo1 repo = new repo1(unitofwork); irepo2 repo_second = new repo2(unitofwork); my question can use same unitofwork different repositories ? yes, there no restriction doing it. getting control of data access in level above, when access repositories , tasks insert , update , delete . pseudo-code sample, sample: ibondsunitofwork unitofwork = new bondsunitofwork(new testentities(dalutilities.projconnectionstring)); try { unitofwork.open(); unitofwork.begintransaction(); irepo1 repo = new repo1(unitofwork); repo.update(obj); irepo2 repo_second = new repo2(unitofwork); repo.add(obj2); unitofwork.commit(); } catch (exception ex) { unitofwork.rollback(); // catch exception here... // log.. } { unitofwork.close(); }

variables - PHP MIN to exclude 0 value -

i have 3 numeric values want find the lowest value. use min() , this: $last_activity = min($last_article, $last_comment, $last_video); is possible make min() exclude variable if value 0? note 3 variables simple strings number 10 , not arrays... no, min has no such option. you have option filter 0 values first: min(array_filter([$last_article, $last_comment, $last_video]))

c++ code producing different outputs through Visual Studio c++ and Gcc -

i have following c++ program: //============================================================================ // name : // author : bryce sandlund // version : // copyright : // description : code skeleton //============================================================================ #include <iostream> #include <iomanip> #include <set> #include <vector> #include <algorithm> #include <cmath> #include <complex> #include <cstdlib> #include <sstream> #include <list> #include <map> #include <fstream> #include <string> #include <time.h> #include <queue> #include <tuple> #include <functional> #include <unordered_set> #include <unordered_map> #define inf 1000000000 #define all(c) (c).begin(),(c).end() #define tr(c,i) for(typeof((c).begin()) = (c).begin(); != (c).end(); ++i) #define ep .00001 using namespace std; typedef pair<int, int> ii; typedef v

"java.lang.ClassNotFoundException: oracle.jdbc.pooling.Factory" -

i'm having sort of problem ucp.jar if use ucp.jar oracle 12.1.0.1 works. if use version oracle 12.1.0.2 following exception: java.lang.classnotfoundexception: oracle.jdbc.pooling.factory is there can me? thanks, mauro the jdbc (ojdbc7.jar) , ucp (ucp.jar) jars must same version (12.1.0.2). can't upgrade 1 without upgrading other. version dependency introduced in 12c. wasn't case before.

mongodb - Spring XD - UDP inside Jobs -

i have been using spring xd while continuous ingestion of sensor data , works perfectly. the new requirement have ability "replay" portions of data. in particular case reading mongodb (with query), generate udp packet filed of entry , send socketaddress in fixed interval of time. the first attempt implementing through spring-batch job. reader simple since querying mongodb data, concern udp portion. not feel natural use spring-batch sending udp packets, know if can suggest me idea implementing this. thanks you use custom xd source mongodb inbound channel adapter piped custom sink using udp outbound channel adapter .

android - Up navigation not appearing for single activity app with multiple fragments -

i have android application has single main activity employs many fragments switch view. i'm not sure if that's right way it, have inherited project , avoid doing major refactors changing fragments activities or that. according android documentation, looks calling setdisplayhomeasup(bool) function should display button default: set whether home should displayed "up" affordance. set true if selecting "home" returns single level in ui rather top level or front page. the main issue when use function: actionbar.setdisplayhomeasupenabled(true); it not set button opens navigation drawer instead turn 'up' button. removes 'hamburger' ic_drawer icon side. navigation drawer still opens. here custom code navigationdrawerfragment (i copy+pasted exact file when create new application navigation drawer within android studio): navigationdrawerfragment.java @override public view oncreateview(layoutinflater inflater, viewgroup cont

c# - Derived UserControl layout resets after build -

i have basic "base" usercontrol added properties. when inherit base usercontrol , add buttons in designer seems fine. when build project of buttons disappear , layout restores original base usercontrol. doing wrong here? public partial class baseusercontrol : usercontrol { public baseusercontrol() { initializecomponents(); } public bool canclose { get; set; } } public partial class inheritedusercontrol : baseusercontrol { public inheritedusercontrol() { initializecomponents(); } }

java - How do I rebuild/make .iml files in maven multi-module project in Intellij 13.1.4 -

i'm working in multi-module maven project in intellij. there snapshot update in module required update in few poms. click "re-import maven projects" maven plugins tool full build. however, time .iml files associated changed poms weren't being updated. wasn't until did "build->rebuild project" .iml files updated. know how update .iml files part of build configuration? note: before rebuilding project, know mvn @ least picked on change because local .m2 repo had latest snapshot. edit #1: so, true if add maven runtime dependency in module. won't pick change unless rebuild project.

.net - vb.net Xmldocument, selectSingleNode only returns value with vs2008 "watch" utility -

i have problem selectsinglenode function. context: in program need perform subsequent filters, have no problems on those, time have weird "bug". i have next code: dim test xmlnode = parentxmlnode.selectsinglenode("day[@date='" & fecha.date.tostring("o") & "']" problem: when debug/run code above, variable "test" alwas have nothing, if apply "watch" on "selectsinglenode" instruction return xmlnode. no matter if go , re-degug part of code, result same. of course code above oversimplification of original code, here untouched original code causes problem: edit : full code wasnt necessary, in fact make question hard read, error in line of code exposed before. any information highly appreciated. in advance. the error in " fecha.date.tostring("o") " part of code. when use watch utility on part datetimekind.unspecified format of iso 8601 (2009-06-15

Manage a Gmail Setting through google admin sdk -

i searched on web find evidence changing gmail settings through google admin sdk not find anything! want add labels gmail account(x@gmail.com) through google admin sdk. need know possible or not? if is, how should authentication keys. best, majid yes, possible. within admin sdk , you'll see option on left, manage settings . here, can click on email settings . managing labels detailed here , authorization info can found within email settings api authentication section. hope helps!

android - Getting bundle with intent null, Intent issued from helper object -

i sending intent start activity broadcast receiver using helper object follows: broadcast receiver code: myreceiver extends broadcastreceiver{ onreceive(){ new helper(this).startmyactivity(); } code in helper object: helper{ private context mycontext; public helper(context c){ mycontext=c; } public void startmyactivity(){ intent i=new intent(mycontext,myactivity.class); i.addflags(intent.flag_activity_new_task); i.putextra("code", 1); mycontext.startactivity(i); } } but when try extract out bundle in activity myactivity, null value: myactivity extends activity{ onresume(){ bundle b=getintent().getextras(); int c=b.getint("code"); } } why getting bundle null? the problem need override onnewintent(intent) in activity , explicitly tell use new intent @override protected void onnewintent(intent intent) { super.onnewintent(intent); setintent(i

php - explode string to a multi array with 2 delimiter -

i have kind of sting variable in php: $hccrol = ga#cor,op#cor,for#tb,ga#lts,for#mod,ga#pmai,ldr#lid,hcc#lad,hn#lad,op#lad,ga#lad,ga#wm,op#wm,hn#wm,op#vz,hn#vz,ga#vzai i want convert multi array somthing this: array ( [ga] => array ( [1] => cor [2] => lts [3] => lad [4] => wm [5] => vzai ) [for] => array( [1] => tb [2] => mod ) [op] => array( [1] => cor [2] => wm [3] => vz ) ) so # determines in witch primary array value must come cbroe gave steps traditional way, fun because bored: parse_str(str_replace(array('#',','), array('[]=','&'), $hccrol ), $result); print_r($result); php >= 5.4.0: parse_str(str_replace(['#',',&

after upgrading to meteor 0.9.1 i keep getting "Warning: Blaze.insert has been deprecated." -

hi upgraded meteor app 0.9.1.1 , keep getting these 2 warnings in console w20140910-18:37:07.781(3) (blaze.js:67) warning: blaze.render without parent element deprecated. must specify insert rendered content. logging.js:65 w20140910-18:37:07.787(3) (blaze.js:67) warning: blaze.insert has been deprecated. specify insert rendered content in call blaze.render. logging.js:65 i have no idea error occurs, or why happens. any idea of might missing ? thanks the blaze api changed in meteor 0.9+ if using ui.insert(ui.render(template.foo), document.body) ui.insert(ui.renderwithdata(template.foo, {bar: "baz"}), document.body) you need update ui.insert() & ui.insert(ui.renderwithdata()) to new blaze api: blaze.render(templateorview, parentnode, [nextnode], [parentview]) blaze.renderwithdata(templateorview, data, parentnode, [nextnode], [parentview]) check updates: http://docs-0.9.1.meteor.com/#blaze_render

Explain execution flow of following complex javascript return statement -

i've found hard follow execution flow of return statement. if explain how execution flows work , better if can explain whats pros , cons of creating such complex statements rather more readable multi-line statement appretiate. return option = option ? option : {}, typeof option.xvalue == "boolean" && (_ready = option.xvalue), option.name && _ready == !1 && log(option.name + "(" + option.caller + " ) api not ready.", "e"), _ready the expression uses comma operator multiple statements, , short-circuit operation of && operator if expression. you can write code as: if (!option) { option = {}; } if (typeof option.xvalue == "boolean") { _ready = option.xvalue; } if (option.name && _ready == false) { log(option.name + "(" + option.caller + " ) api not ready.", "e") } return _ready; the advantage of writing single complex expression is singl

jquery - How to remove button present in other section -

i have html . <div id="restmenu" class="restmenu"> <ul> <section id="locationx" class="ulsewrap lielement"> <div class="intit">locationx<span class="indelete"></span></div> <ul class="restlistings"> <div class="inner-intit"> <sub class="sub">your favorite restaurant</sub><br> <li> <h6>swaghat</h6> <p>madhapur , near policstation,hyderabad</p> <span class="indelete indeletesub"></span> </li> </div> <input type="button" location="locationx" name="btn1" class="btn btn-success addnewrestaurant" value="locationx"> </ul> </se

Use of undeclared identifier "applicationDidChangeStatusBarOrientation" in Xcode 6 -

i updated xcode 5 xcode 6 , ran these issues. code worked fine xcode 5 i have code in red - (void)applicationdidchangestatusbarorientation:(nsnotification *)notification; in appdelegate.m with error "use of undeclared identifier "applicationdidchangestatusbarorientation" and also (void)application:(uiapplication*)application didreceiveremotenotification:(nsdictionary*)userinfo with error "invalid argument type "void" unary expression" here's screenshot http://prntscr.com/4liq0n [error][1] having parse issue http://prntscr.com/4liqcl can please me out? thanks! philip mills right, semicolon error here.

java - Android uncaught exception logs -

i've written piece of code logs uncaught exceptions may arise in android application. since have encrypted apk, exception logs don't have exact class names , instead logs refer classes such a.java or b.java etc. ideas how preserve logs can track exceptions can arise? add -dontobfuscate proguard config file.

routing - I'm in iptable hell -

so i'm relatively new iptable routing, i'm trying should easy. i'm trying direct traffic ip block, i'm using program called inetsim , use ip-address bind address , become similar router. i'm using 192.168.444.1 gateway , dns server per config instructions. there options toward bottom use routing have yet friendly. have 2 eth ports called eth0 , eth1 ip-addresses on them 10.10.10.123 , 192.168.444.1 respectively. have reporting server on 10.10.10.250. the machines follows 192.168.444.2 windows7sp1 192.168.444.1 + 10.10.10.123 debian server the reporting server has program sets connection target machine reporting server. under normal circumstances work without hitch, inetsim internet blackhole of sorts creates iptables route traffic fakenet including unknown services, routed dummy port 1. i need way of forwarding packet destined 10.10.10.250:48002 192.168.444.2[connected 192.168.444.1] through 10.10.10.123[unless there easier way of doing this]. have tried

knockout.js - Knockout Validation - Dont validate input when empty + evaluate when submit -

check fiddle: http://jsfiddle.net/bhzrw01s/ i trying 2 things: first: dont validate when field empty. know there onlyif option.. there easier? second: need run validation when click on submit (if test fiddle, error messages pop, wont apply errorclass css) thanks :d css: input.error { color: red; border-color: red; } js: ko.validation.configure({ insertmessages: false, decorateelement: true, errorelementclass: 'error', messagesonmodified: false }); function signinviewmodel() { var self = this; self.username = ko.observable().extend({ required: true }); self.password = ko.observable().extend({ required: true }); self.errors = ko.validation.group(self); self.login = function (e) { if (self.errors().length == 0) { alert('no errors'); } else { this.errors().foreach(function(data) { alert(data); }); //

android - Duplicate id layout error -

i've got following error in textview inside layout. duplicate id @+id/communications, defined earlier in layout but not duplicated. don't know why , causes error. please help! just clean project. issue of eclipse not reindex/rebuild r file containing resources ids. clean should resolve problem.

centos - Can't connect to local MySQL server, Lost connection, Server has gone away -

i have strange problem server. first, server crashed. use cpanel , whm. , not able access used ssh restart server. , worked, normal. but after began new problem: "can not connect local mysql server through socket '/var/lib/mysql/mysql.sock' (2)" "mysql server has gone away" "lost connection mysql server @ 'reading initial communication packet', system error: 104" "lost connection mysql server @ 'reading authorization packet', system error: 104" but these errors not always, site online , working, having problem @ 1 time or another, or in cpanel , mysqltuner error shown. the first thing did: search. i changed my.cnf (added socks), not resolved. rebooted server, not solved. came old my.cnf (which had backup), not resolved. tried changing 'localhost' '127.0.0.1' created new problem "can not connect mysql server on '127.0.0.1'." i tried find. nothing solved. furthermo

android - Picasso loading already created bitmap? -

i trying picasso load bitmap. when try use picasso.with(getactivity()).load(bitmap1).into(image); gives me error he method load(uri) in type picasso not applicable arguments (bitmap) . how able make picasso loads bitmap? thanks. you don't need picasso this. picasso loading images internet or disk. can display bitmap in imageview this: image.setimagebitmap(bitmap);

osx - Get display (monitor) names in C++ Mac -

i need name of monitors computer using c / c++. using this: https://developer.apple.com/library/mac/documentation/graphicsimaging/reference/quartz_services_ref/reference/reference.html (is best way this?) can lot of information , things monitors, cannot display name. this question asked here, answers given obj-c not c++. how display name display id in mac os x?

iphone - Cordova 3.5 iOS - Xcode Apple Mach-O Linker error for CDVCamera -

i'm encountering error during build phase of cordova (3.5) project: undefined symbols architecture i386: "_cgimagedestinationaddimagefromsource", referenced from: -[cdvcamera imagepickercontrollerreturnimageresult] in cdvcamera.o ... , 15 more of a lot of posts noted, have add cdvcamera.m file compile sources section. without entry don't error... app won't able use camera in case. tried different versions of plugin, nothing changed. is there may have forgotten? i have had same issue , have managed fix xcode: select target in build phases > link binary libraries should add imageio.framework , coregraphics.framework an image settings: http://screencast.com/t/rsxzrukyslay

Building a python wheel that includes svn:externals files on Jenkins -

i'm building package on python 2.7.6 32bit windows 32 the definitive source of components of package svn 'share'. common practice in company include project using svn:externals. the normal way build package is: python setup.py bdist_wheel all appears normal on workstation (where checked out code tortoisesvn), when run same process on jenkins bdist_wheel process not include .py file sourced via svn:externals. after reading through documentation, appears because of feature identifies scripts part of package based on files tracked svn. appears consequence of how jenkins checks out files, bdist_wheel sees i'm using svn , assumes knows how determine files tracked, gets answer wrong. what need way stop bdist_wheel command trying guess files care (i want every .py file in project included, regardless of how it's been brought in) i tried tried specifying files needed using manifest.in file, did not work. recursive-include externals *.py in example, 

javascript - How to retain $scope value once we navigate from one page to another in angularjs -

i have 2 controllers in file. whenever navigate 1 page page, scope values empty. here how declare controllers: var app = angular.module('name',[]); app.controller('ctrl1',function($scope){}); app.controller('ctrl2',function($scope){}); the above code works fine in 1 html, when navigate html, can't access $scope values in controller. any appreciated. changing page wholesale forces angular app reload, , why losing scope. obviously, less desirable. needs happen this: your base page loads (index.html) , app lives on page. not contain content. your app calls default route , loads html partial page in main ng-view. route should contain controller reference should operate on view. when need load new information on screen, load partial ng-view via route, along associated controller. there plenty of examples out there choose show how this. stuff "year of moo" comes mind. pick 1 , go it.

powershell v3.0 - How to retrieve variable in $Global namespace via variable -

i created variable this: set-variable -name $credvarname -value (get-credential $username) -option readonly -scope global i retrieve via variable: $varname = $credvarname $global:$varname but doesn't work: $global:$varname variable reference not valid. '$' not followed valid variable name character. consider using ${} delimit name. any ideas on how variable via variable? you're using dynamic variable names, consider using get-variable instead of $global: : get-variable -name $varname -scope global -valueonly

wpf - Expose ToolTip DependencyProperty on custom DataGridTextColumn -

i know can style column , set tooltip way, want have real tooltip property on grid column. having trouble exposing tooltip property textblock before created. custom column. public class datagridtextcolumn : system.windows.controls.datagridtextcolumn { public static readonly dependencyproperty texttrimmingproperty = dependencyproperty.register( "texttrimming", typeof (texttrimming), typeof (datagridtextcolumn), new propertymetadata(default(texttrimming))); /// <summary> /// horizontalalignment dependency property. /// </summary> public static readonly dependencyproperty horizontalalignmentproperty = dependencyproperty.register( "horizontalalignment", typeof (horizontalalignment), typeof (datagridtextcolumn), new frameworkpropertymetadata(horizontalalignment.left, frameworkpropertymetadataoptions.affectsarrange), validatehorizontalalignmentvalue); pu

In Access SQL, is there anyway to use user input as the field name? -

i have database table field names date (e.g., jan, feb...). there way can ask input users return column? for example, there pop-up window user can type "jan" in order generate single column name of jan? thanks!!! yes, can use switch function this. select switch ( [select month] = "jan", jan, -- if user enters jan, use column jan [select month] = "feb", feb -- if user enters feb, use column feb ) month yourtable [select month] is prompt shown. running query in access show prompt , select column based on input.

C++ Loops - Flow bug? -

in programming class, have been tasked writing program convert word or phrase phone number, evaluating each character , translating corresponding number. here's code far: #include <iostream> #include <string> using namespace std; int main() { char letter; int noofletters; char response; cout << "enter y/y convert telephone number " << "form letters digits.\n" << "enter other letter terminate program: "; cin >> response; cout << endl; while (response == 'y' || response == 'y') { cout << "enter telephone number using letters: "; cin >> letter; noofletters = 0; cout << "the corresponding telephone number is: "; while (noofletters != 7) { //cout << "[" << noofletters << "]"; noofletters+

jstl - Type [java.lang.String] is not valid for option items upon migrating from Spring 3.0.6 to 3.2.3 -

i working on migrating dynamic web project spring 3.0.6 3.2.3. prior migration, had no issue our dropdowns. however, after migrating, following error: exception created : com.ibm.websphere.servlet.error.servleterrorreport: javax.servlet.jsp.jspexception: type [java.lang.string] not valid option items i've removed code isolate issue, below relevant code. please let me know if further information needed. thing puzzles me list isn't string based. realize jsp treat values string options, understanding there built-in propertyeditor translation. controller: @requestmapping("/reports-menu.html") public string showreportshome(@modelattribute("reportform")reportform reportform, model model, httpsession session, httpservletresponse response, httpservletrequest request) { list<integer> intlist = new arraylist<integer>(); intlist.add(1); intlist.add(2); intlist.add(3); model.addattribute("intlist", intlist);

infopath2010 - InfoPath 2010 changing Date/Time/second Formula -

i have formula in textbox generate date, time, , seconds. want format date mm/dd/yyyy instead of yyyy/mm/dd translate(now(), "_-:t", "") use functions concat, substring, translate concat(substring(translate(now(), "_-:t", ""), 5, 2), "/", substring(translate(now(), "_-:t", ""), 7, 2), "/", substring(translate(now(), "_-:t", ""), 1, 4)) output: 09/12/2014

javascript - Variables not converging... where's the error? -

i ported code in language. it's supposed run through probability estimations , continue running through them until converges on solution. convergence determined maximum change in probability getting below threshold. works in other language. on first iteration, max probability change should 50%, on second, should 22%, etc. , should converge fast. however, in javascript, it's going 2 iterations before getting "stuck" , looping infinitely. i'm sure there's simple error here, can't seem find life of me. idea what's going on? and here's fiddle: http://jsfiddle.net/lxlhuc0k/ var probs = new array(); (i=0; i<=99; i++) { (j=0; j<=99; j++) { (k=0; k<=99; k++){ probs[i,j,k]=.5; } } } var maxchange=100; while (maxchange>.01) { maxchange=0; (i=0; i<=99; i++) { (j=0; j<=99; j++) { (k=0; k<=99; k++){ oldvalue=probs[i,j,k]; probs[i,j

blogs - Wordpress Site-Title -

Image
i have problem wordpress-site. have tryed , searched d'ont can find solution or serious answer - nor advise problem. i change wordpress site-title. (i have local site try out...) have crashed site 2 times. title like: "nicesite". have "nice site" i use html on pages plug-in, post-name permalink structure. i ask because dont beginn start again if make mistakes again. why wordpress sensible in things, know writes in database, realy big minus wordpress-system.' thanks if can explain me how do, on local , live-site's. go wordpress dashboard-> settings -> general . enter site title

jquery - Using bootstrap datepicker in Laravel 4 form -

i'm having trouble trying use bootstrap date-picker ( http://tinyurl.com/o7njj9n ). i tried using suggestions these 2 threads: laravel using twitter bootstrap , datepicker , laravel 4 bootstrap-datepicker not luck in solving problem. currently, have form field: {{ form::text('date', null, array('type' => 'text', 'class' => 'form-control datepicker','placeholder' => 'pick date task should completed', 'id' => 'calendar')) }} i reference css , js in master template, such: <link rel="stylesheet" href="css/datepicker3.css"> <script type="text/javascript" src="/bootstrap-datepicker.js"></script> i have following javascript: <script type="text/javascript"> $(document).ready(function() { $('#calendar').datepicker({ }); } ); </script> i'm not sure what's wrong? thanks help. edi

php - Highcharts with date and time for x axis (from a database with format YYYYMMDDHHMM) -

i trying draw graph using highcharts values time , date x axis. database has date values yyyymmddhhmm (201409011345) , want plot y values date , time. code follows ; <?php while ($row = mysql_fetch_array($result)) { extract $row; $data[] = "[$datetime, $value]"; //here $datetime 201405242625 (yyyymmddhhmm) } ?> var chart = new highcharts.chart({ chart: { renderto: 'container' }, series: [{ data: [<?php echo join($data, ',') ?>] }] }); please give me suggestions correct datetime values x axis thanks your date value needs either in epoch format, or date.utc object. i'm not sure how php understand date format, assuming can, can use strtotime() function. in case, be $date_stamp = strtotime($datetime) * 1000 you need * 1000 because php uses epoch time in seconds, javascript uses milliseconds. if php has hard time interpreting date format, may need format within database que

onedrive - How to refresh token from a windows service? -

is possible refresh token if application not have access browser control or http context? have winform logs user in , gets consent, passes token windows service files can uploaded onedrive. when token expires, seems methods refreshing token require callback url. you can if you've requested wl.offline_access scope , you're using authorization code grant flow in oauth 2.0. once user has logged in through oauth, you'll receive access_token valid 1 hour, , refresh_token , valid long time. each time service needs work on user's behalf, can redeem refresh_token new access_token , refresh_token , , use access_token work. make sure save new refresh_token well, make sure extend expiration. this way can have service performs actions on behalf of user long time, without needing user sign in again. however, possible refresh_token expire or become invalid, need handle situations unable redeem refresh_token .

ios - CLLocationManager requestWhenInUseAuthorization errors with no known class method -

i changed target version app ios 8 , updated xcode 6.0 version. when build see bunch of methods getting marked deprecated confirms building against ios 8.0 when try call [cllocationmanager requestwheninuseauthorization], build error saying no known class method selector 'requestwheninuseauthorization' am missing here ? requestwheninuseauthorization instance method, not class method - create cllocationmanager instance, , call method on that. see the docs more info.

algorithm - Big O, Theta, and big Omega notation -

based on understanding, big o similar theta notation can include bigger given function (e.g. n^3 = o(n^4), n^3 = o(n^5) , etc.), , big omega includes smaller given function ( n^3 = Ω(n^2 ), etc.). however, professor said other day n^0.79 = Ω(n^0.8) , while doing exercise involved master theorem. why/how true when n^0.8 larger n^0.79 ? you have big o , big omega backwards. big o "same" or smaller function.

detecting the deletion of an android account -

i'm developing android application accounts, sync , content provider. adding account works, syncing , data saved in content provider. now, when user deletes account using settings, syncing stops, data stays in content provider. i'd delete it, don't know how catch event of account deletion. there accountmanager.addonaccountsupdatedlistener() , i've tried add sync service, sync service started sync , stopped. whenever account gets deleted while there no sync, can't caught. is there best practice on how handle private data when account gets deleted? first should add onaccountsupdatelistener accountmanager using command: accountmanager maccountmgr = accountmanager.get(getcontext()); maccountmgr.addonaccountsupdatedlistener(new accountsupdatelistener(), null, false); accountsupdatelistener implemented class of onaccountsupdatelistener this: private class accountsupdatelistener implements onaccountsupdatelistener { @override public void

xcode gm ios 8 gm swift today extension crash in simulator and device: Library not loaded: @rpath/libswiftCore.dylib -

Image
i error when run today extension ios: dyld: library not loaded: @rpath/libswiftcore.dylib referenced from: /users/andy/library/developer/coresimulator/devices/724ff0c3-6622-4d12-865a-90244c8c63c1/data/containers/bundle/application/30d8974b-ed1a-4f3a-8958-e9b7aa8901a9/app.app/plugins/today.appex/today reason: image not found i've restarted, uninstalled, installed xcode, rebooted machine, created fresh today extension , still got error :-/ same problem on simulator , on device.. do have idea? build settings -> "embeded content contains swift code" -> yes seems trick. thanks @dlinsin on twitter if still not working check too: https://stackoverflow.com/a/25247890/2184338 mine is: edit: if still still not: check "runpath search paths" check linked frameworks (i have notificationcenter.framework in case) product->clean restart xcode restart machine check provisioning , signature

javascript - Parse, how to save Appended text -

let's have following code: $('.button').click(function() { $('body').append("<p>random text</p>"); }); where when .button clicked, text appended body. how go saving text , having appear when user visits page. wise store in variable , send data browser under post or class? hope isn't confusing, thanks! this isn't ideal without creating server side or clientside db quick fix. if user switches browsers or clears cache storage gone. http://jsfiddle.net/4gseg96g/1/ $(document).ready(function() { // read localstorage. function getstorage() { var obj = localstorage.getitem('objname'); if(!obj) { obj = ''; } return obj; } // append localstorage obj, if any. $('body').append(getstorage()); $('.button').click(function() { console.log('click'); var str = "<p>random text</p>&quo

WSGI : Cookies can only be called after the ** start_response **? -

i can not call cookie right after the: def application(environ, start_response): like this: import cookie co = cookie.simplecookie() def application(environ, start_response): co.load(environ['http_cookie']) start_response('200 ok', ('content-type', 'text/html')) because although works.. cookie must set work. if cookie not exist.. script fail. the solution seems be.. placing under "start_response()" if 'http_cookie' in environ: co.load(environ['http_cookie']) = co.get('a') , co['a'].value in other words: import cookie co = cookie.simplecookie() def application(environ, start_response): start_response('200 ok', ('content-type', 'text/html')) if 'http_cookie' in environ: co.load(environ['http_cookie']) = co.get('a') , co['a'].value yield str(a) but method rather not strange given asking environ

pug - IntelliJ does not resolve relative path for jade extend -

i have simple setup: app/layout/layout.jade app/user/user.jade user.jade should extend layout.jade i set basepath jade %projextdir%/ (which contains app folder above) intelij can resolve paths: // relative: extends layout/layout extends ../app/layout/layout // absolute: extends /app/layout/layout which leads paths in jade: // relative: %projectdir%\app\user\layout\layout.jade // wrong %projectdir%\app\app\layout\layout.jade // wrong // absolute: %projectdir%\app\layout\layout.jade // ok so absolute paths resolved correctly. the correct relative paths jade be: extends ../layout/layout but intellij can not resolve it. have no ide support (e.g. strg+click). is there known bug? or solution fix behaviour in intellij?

excel - R XLConnect readWorksheet: rename column names in each worksheet -

i parsing excel file several worksheets , 3 columns in each worksheet. 3 columns have different names in each worksheet (date vs date, etc), when execute code df data frame has several columns of data. want condense df 3 columns renaming headers each excel sheet. how can rename header values when read in each worksheet? require(xlconnect) wb <- loadworkbook("~/downloads/bearriverband-rancheria-windturbine-log-2009-2014.xlsx") lst = readworksheet(wb, sheet = getsheets(wb)) df <- ldply (lst, data.frame) i solved problem: require(xlconnect) require(plyr) wb <- loadworkbook("~/downloads/bearriverband-rancheria-windturbine-log-2009-2014.xlsx") lst = readworksheet(wb, sheet = getsheets(wb)) dat=data.frame() (l in 1:(length(lst)-4)){ s <- data.frame(lst[l]) names(s) <- c('time','data','by') dat <- merge(dat,s,all = true) }