Posts

Showing posts from May, 2011

setting and changing locale in jquery globalize -

i trying understand best practice automatically setting locale , potentially dynamically changing it, when using jquery-globalize library. the requirements getting , running in jquery globalize, or @ least understand them are: include required javascript files load cldr data set locale step #1 out of scope of question; assume prerequisite move forward. step #2 documented plain javascript looking this, in example refer "dynamic" loading: $.when( $.get( "cldr/main/en/ca-gregorian.json" ), $.get( "cldr/supplemental/likelysubtags.json" ), $.get( "cldr/supplemental/timedata.json" ), $.get( "cldr/supplemental/weekdata.json" ) ).then(function() { // normalize $.get results, need json, not request statuses. return [].slice.apply( arguments, [ 0 ] ).map(function( result ) { return result[ 0 ]; }); }).then( globalize.load ).then(function() { // code goes here. }); if understand code properly, uses ch

php - when user click back button in browser data get retrieved from cache -

i want when form in login.jsp submitted, loginaction.jsp first compares value field against lastlogon field's value in user database table. when lastlogon value form greater value in database considered valid login. valid login, field lastlogon in database should updated form's value update lastlogon's time. when browsers resubmit cache in case above, form's lastlogon value not greater database's lastlogon value, therefore loginaction.jsp forwards control flow login.jsp error message stating "session has ended. please log in.". but if alter system time value retrieve system.currenttimemillis() change , none of have stated occur. instead of user able retrieve copy of data cache don't know. want know if system time altered have stated above occur or not. if have stated above happens when 1 alter's system time same happen if use system.nanotime(); thanks in advance.

php - json_encode an array posted from a form -

i have array being passed method insert database. i've tried: $names = $_post['names']; json_encode($names); echo '<pre>' .print_r($names,1). '</pre>'; exit; and... json_encode($names = $_post['names']); but neither seem work.. note when debugging print json encoded array, showing array , values - no json :( suggests array being passed fine json encoding not working! cheers you have use returned string. json_encode not modify array, arguments passed value . $names = $_post['names']; $jsonencoded = json_encode($names); echo $jsonencoded;

tomcat - p6spy makes Tomcat8 will no longer redeploy when in use -

cannot redeploy tomcat when using p6spy on top of postgres database driver. it works great until redeploy. when redeploy, error: javax.management.instancealreadyexistsexception: com.p6spy.engine.logging:name=p6logoptions is there way around this? you should able around problem disabling jmx functionality in p6spy. setting following setting in spy.properties. jmx=false if not using datasource (meaning have jdbc url), can set 'jmx=false' url parameter on jdbc url well. btw - looks bug in p6spy. if don't mind, please create issue in p6spy github project . references: p6spy configuration

php - Cakephp Events registered but not firing -

hi guy's many people i'm having dificulties implementing events cakephp application cool if point out messed im using cakephp v2.7 allso followed martin bean's tutorial on subject: http://martinbean.co.uk/blog/2013/11/22/getting-to-grips-with-cakephps-events-system/ my code follows: app/event/userlistener.php <?php app::uses('cakeeventlistener', 'event'); class userlistener implements cakeeventlistener { public function implementedevents() { #@:off; return array( 'model.user.test' => 'test', 'model.user.created' => 'sendactivationemail', ); #@:on; } public function test($event) { ($i = 0; $i < 10; $i++) { echo "string<br />"; } cakelog::write('cakeevents', 'testevent fired'); } public function sendactivationemail($event) { } } in app/model/user.php <?php app::uses('appmodel', 'model'); app::use

html - Chrome Extension interacting with page styling (Bootstrap container missing left padding) -

Image
i have following problem in page (which uses bootstrap), notice on official bootstrap examples: ( http://getbootstrap.com/examples/grid/ ) even though .container class has: .container { padding-right: 15px; padding-left: 15px; margin-right: auto; margin-left: auto; } 15 pixels of left , right padding, in reality, reason can't pinpoint, left padding seems halved. in case, set $grid-gutter-width: 15px; the padding-left of container, though reported "7.5px" correct, seems 0. that strange... in works fine. when disable it, works correctly aswell. the think saw, cutting part of browser. see yellow rectangle contains div.container 345px x 3427px

javascript - programmatically access a d3 rectangle on click event -

this question has answer here: how invoke “click” event programmatically in d3? 10 answers i create few d3 rectangles , give them each click event: first created container: var svgcontainer = d3.select("#container") .append("svg") .attr("width", 720) .attr("height", 45); then in for-loop create each rectangle inside container: var rectangle = svgcontainer.append("rect") .attr("x", 10 + xappend) .attr("y", 5) .attr("width", 120) .attr("height", 35) .attr("stroke", "b

android - Replacing a fragment in a FrameLayout does not remove the existing fragment from the fragmentManager -

i adding fragment dynamically so: fragmentmanager fm = getchildfragmentmanager(); mfragmentmanager.begintransaction().replace(r.id.learn_detail, detailfragment, learn_fragment_threats).commit(); mfragmentmanager.executependingtransactions(); i call same code when add different fragment r.id.learn_detail (which framelayout) the fragment replaced fine, have noticed old fragment still exists in memory. calling mfragmentmanager.getfragments returns list gets bigger , bigger each time call replace . expected replace destroy old fragment , add new fragment in framelayout. thoughts? edit - problem was creating new fragment, no matter what. complete method ended looking this: private learnpagefragment getpagefragment(learnpageitem item) { learnpagefragment learnpagefragment = (learnpagefragment) mfragmentmanager.findfragmentbytag(learn_fragment_page); if (learnpagefragment == null) { learnpagefragment = learnpagefragment.newinstance(it

jquery - populate ng-bind-html from templateURL or any html template source -

i have tabs controller: $scope.tabs = [ { template:'modules/order/views/estimates-list.html', heading: 'view estimates', route:'default.order.info.estimates.list', active:false }, { template:'modules/order/views/estimates-create.html', heading: 'create new estimate', route:'default.order.info.estimates.create', active:false }, ]; here on active tab following template loading: estimates-create.html <div ng-controller="examplecontroller"> <div ng-bind-html="myhtml"> <div ng-repeat="(key, value) in myobj"> ... </div> </div> </div> i in need ng-bind-html element initialized 1 angular-html-template file or have html now. problem $scope.myhtml reset on opening tab. how can populate $scope.myhtml in template file( template.html ) or keep html in ng-bind-html="myhtml" after initializing? template.html <div ng-repeat="(k

haskell - How to extract RGB values from (most) pictures? -

i want extract every rgb value possible pictures in haskell. what easiest way raw values (0-255)? i got results juicy pixels library, somehow exception: *** exception: ./data/vector/generic.hs:249 ((!)): index out of bounds (660000,660000) this corresponding code. {-# language typesynonyminstances #-} module main import codec.picture (readimage, pixelat, pixelrgb8(..)) import codec.picture.types import system.filepath.posix (splitextension) torgbraw :: filepath -> io () torgbraw fp = image <- readimage fp case image of left _ -> putstrln $ "sorry, not supported codec " ++ fp right dynimg -> let imgrgba8 = fromdynamicimage dynimg let (name, _) = splitextension fp writefile (name ++ ".txt") (concat $ accumpixels imgrgba8) accumpixels :: image pixelrgba8 -> [string] accumpixels img@(image w h _) = [ format (pixelat img x y) x y | x <- [0..w], y <- [0..h]] format (pixelrgba8 r g

In Jquery Mobile Dropdown Popup UI distorts when Orientation change from portrait to landscape or vice versa -

Image
when rotating device portrait landscape or vice versa dropdown popup ui goes upper left corner. screenshots attached. can please that. suggestion or solution great help. below code: <select name="select-custom-1" id="select-custom-1" data-native-menu="false"> <option value="1">veni</option> <option value="2">vedi</option> <option value="3">vici</option> </select>

angularjs - Modal background mask does not appear when i open the modal for the second time -

i using angular bootstrap modal.the modal has angular data table in modal body , close button in modal footer.the issue facing once click on close button,the modal disappear screen remains grayed out , inaccessible.so,i included below code. $('#modal-id').modal('hide'); $('body').removeclass('modal-open'); $('.modal-backdrop').remove(); after adding this,the modal , background works fine when open , close first time when open modal next time,the gray background not appear. insight appreciated. my controller : $scope.modalpop = function(){ $scope.modaloverlay = $modal.open({ templateurl: 'url', scope: $scope, animation: false, windowclass: 'overlay-lg' }); }; $scope.modalclose = function() { $scope.modaloverlay .close(); $('#modal-id').modal('hide'); $('body').removeclass('m

java - How to get folders' name listed in Assets folder? Only folders' names but not any file names -

scenario: assets directory - assets/ folder1 ; assets/ folder2 ; , on. files in folder1 , other folders, such asssets/ folder1 /file1, , others, asssets/ folder /somefile1, , others. i want code access names of folder names assets folder i.e., list. folder1 folder2 and on. new file("file:///android_asset/").listfiles(); new file("file:///android_asset/").list(); both of above statements return null. path assets folder? thanks! you can use file.listfiles() files in given directory (including sub-directories). these can names.

shell - Problems using ImageMagick for converting PDF with accented characters -

Image
i having problem when converting pdf images using imagemagick or ghostscript. accented characters disappear converted image. found couple of people having same problem , apparently updating imagemagick package , ghostscript fixed it, not me. i using pdf file on every tests made: https://www.dropbox.com/s/3gso0sw1e1n8f9r/error-with-accents.pdf?dl=0 i have ubuntu 14.04.2 lts server on azure need imagemagick work. official repositories have imagemagick 6.7.7 , ghostscript 9.10. later, tried upgrading them in order fix issue , have imagemagick 6.8.9-10 running on /opt/imagemagick-6.8 folder , added ubuntu's 15.04 repository install ghostscript 9.15 directly through apt-get. none of these fixed problem me. here latests attempts on ubuntu 14.04 server: $ lsb_release -a no lsb modules available. distributor id: ubuntu description: ubuntu 14.04.2 lts release: 14.04 codename: trusty $ /opt/imagemagick-6.8/bin/convert -version version: imagemagick 6.8.9-10 q16 x86_64 20

c - typecasting a pointer to an int . -

i can't understand output of program . of , , first of , pointers p, q ,r ,s pointing towards null . then , there has been typecasting . how heck , did output come 1 4 4 8 . might wrong in thoughts . , please correct me if wrong . int main() { int a, b, c, d; char* p = (char*)0; int *q = (int *)0; float* r = (float*)0; double* s = (double*)0; = (int)(p + 1); b = (int)(q + 1); c = (int)(r + 1); d = (int)(s + 1); printf("%d %d %d %d\n", a, b, c, d); _getch(); return 0; } pointer arithmetic, in case adding integer value pointer value, advances pointer value in units of type points to. if have pointer 8-byte type, adding 1 pointer advance pointer 8 bytes. pointer arithmetic valid if both original pointer , result of addition point elements of same array object, or past end of it. the way c standard describes ( n1570 6.5.6 paragraph 8): when expression has integer type added or subtracted

jquery - How to send the nested json with the updated value? -

i have following json. if change field of json, have pass whole json updated value using jquery. { "processdefid": "xyz", "name": "name", "sla": "10", "haschild": true, "child": [ { "activitydefid": "sitesurveydef", "activityname": "site survey", "ismandatory": "true", "isoptional": "false", "sla": "10", "sequence": "1", "haschild": true, "child": [ { "activitydefid": "begin", "activityname": "begin", "ismandatory": "true", "isoptional": "false", &qu

ruby - Data replication between tables with same column names in Mysql -

we have main table containing users past 1 year no matter whether expired or active users containing 70 million user records. this table slow in performance, wanted re-create table better indexing , better data type allocation , insert records main table new table date. the main table getting updated/inserted every minute, dynamic. without missing user, need insert records (70 million) main table new table. which best way this? how long take insert 70 million records, asynchronously. is there data replication available? is there any1 please suggest me best solution this, need new table up-to-date faster. will simple insert select not solve problem ? lock tables `oldtable` write; insert `newtable` select * `oldtable`; unlock tables;

asp.net - regular express match e-mail domain -

how use regular expression check e-mail addresses, ensuring domain in e-mail specific domain. using asp.net example. company name abc , employee e-mail addresses on domain abc.com (e.g. john.doe**@abc.com** or donal.smith**@abc.com**) my application should not allow entry of email address ending domain other @abc.com. entry of email john.oh**@gmail.com *should fail*** john.oh**@abc.com *should pass***. the domain can mixed case, upper or lower. @abc.com, @abc.com @abc.com etc should allowed. i think . throwing me off. thanks taking look check domain names regex. "(?i)^.+@abc[.]com$" or "^.+@[aa][bb][cc][.][cc][oo][mm]$"

How do I remove the digits from the left and right side in SQL Server? -

originally claim number looks like. 000000165130 has 12 digits. i'd remove zeros on left side , last 0 on right side making 16513. select [policy number], left([claim number],11 ) [claim number] dw.claimdata [policy number] = 'p000463500' policy number [claim number] p000463500 00000016513 but how remove 6 zeros on left side? assuming fixed-width, can use right . right(left([claim number],11), 5) alternately, if number of zeros variable, cast integer: cast(left([claim number], 11) int) and if need string instead: cast(cast(left([claim number], 11) int) varchar(10))

sql server - Stored procedure expects parameter which was not supplied - what's the cause? -

this error code when execute exception occurs. stored procedure or function expects parameter not supplied. this code: string cs = configurationmanager.connectionstrings["conn"].tostring(); sqlconnection conn = new sqlconnection(cs); conn.open(); sqlcommand cmd = new sqlcommand("sp_login",conn); cmd.parameters.addwithvalue("@username",login.username.tostring()); cmd.parameters.addwithvalue("@pass", login.password); = convert.toint32(cmd.executescalar()); conn.close(); you're not specifying you're calling stored procedure - change code to: string cs = configurationmanager.connectionstrings["conn"].tostring(); // put connection , command "using" blocks using (sqlconnection conn = new sqlconnection(cs)) using (sqlcommand cmd = new sqlcommand("dbo.sp_login", conn)) { // tell command it's callign *stored procedure*! cmd.commandtype = commandtype.storedprocedur

maven - Could java reflection add method into class file that are not in java source file? -

i'm digging source code of deeplearning java recently. there such class neuralnetconfiguration in there tons of fields requires getters , setters. neuralnetconfiguration.java source code not provide any, however. when open project in intellij, ctrl click on usage of class, methods like, neuralnetconfiguration.getninput() or neuralnetconfiguration.getkernelsize(), ide direct me compiled class file in getters defined each of field in class. just wonder how done since i'm new bee java. posts found java reflect suggest reflect can not add method method class unless wrote own classloader. check deep learning java project , don't think have done that. what bothers me time time is, intellij starts report errors getfields methods not resolved since not in source file @ all, after building project using intellij instead of using mvn command line. the magic happens @data annotation on class. annotation project lombok . there annotation processor somewhere hooks co

c# - Why do some files result in 0KB when using WebClient.DownloadFileTaskAsync -

i'm trying download multiple files ftp server using webclient.downloadfiletaskasync , repeatedly have issue several files end being 0kb. i've tried different suggested solutions don't manage files. doing wrong? class program { static void main() { setup(); // sets working folders etc task t = processasync(); t.continuewith(bl => { if (bl.status == taskstatus.rantocompletion) logger.info("all done."); else logger.warn("something went wrong."); }); t.wait(); } private static void setup() {...} static async task<bool> processasync() { var c = new catalog(); var maxitems = settings.getint("maxitems"); logger.info((maxitems == 0 ? "processing items" : "processing first {0} items"), maxitems); await c.processcatalogasync(maxitems); return true;

android - Compatiblity on NavigationView and Toolbar in Kitkat -

i'm trying run project , cool in lollipop devices(designs , etc.without problem) but there problem in project , havent experiences compatiblity in kitkat .after installing: http://i.imgur.com/ksykyeu.png i'm using : https://github.com/akashbang/navigationview and here activty main: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:custom="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:context=".mainactivity"> <android.support.v4.widget.swiperefreshlayout android:id="@+id/swi

building ffmpeg library for android on linux -

i trying install ffmpeg libaray on linux android application. link following https://www.assetbank.co.uk/support/documentation/install/ffmpeg/ have completed steps except last 1 i.e " run "/sbin/ldconfig" root. " it showing following error in linux terminal: anirudh@anirudh-system-product-name:/sbin$ ldconfig /sbin/ldconfig.real: can't create temporary cache file /etc/ld.so.cache~: permission denied please comment if can suggest regarding issue.

c - How to send and receive messages from function other than registered callback function in Netlink socket? -

in following kernel module, hooked syscall sys_open, , trying send filename process in userspace using netlink socket, in response process return msg, , according msg, kernel module proceed further. source code: foo.c #include <linux/module.h> #include <linux/init.h> #include <linux/types.h> #include <asm/uaccess.h> #include <asm/cacheflush.h> #include <linux/syscalls.h> #include <linux/delay.h> // loops_per_jiffy //===============netlink================= #include <linux/module.h> #include <net/sock.h> #include <linux/netlink.h> #include <linux/skbuff.h> #define netlink_user 31 struct sock *nl_sk = null; //===============netlink================= #define cr0_wp 0x00010000 // write protect bit (cr0:16) /* not taint kernel */ module_license("gpl"); void **syscall_table; unsigned long **find_sys_call_table(void); long (*orig_sys_open)(const char __user *filename, int flags, int mode); //=======

php - Real estate site, trying to only output properties based on type -

so inherited old site developer, , i'm not programmer i'm having trouble. i've put code fiddle: https://jsfiddle.net/s6coraf5/ basically there different categories of real estate properties , when click on different pages it's supposed filter them , display ones specific whatever page you're on. problem no matter page you're on, it's displaying everything. i've narrowed down specific code can't figure out why isn't applying right. in php there's: $select_title = "unknown"; if ($select_type == "all") { $select_title = "all listings"; } if ($select_type == "office") { $select_title = "office"; } if ($select_type == "industrial") { $select_title = "industrial"; } if ($select_type == "retail") { $select_title = "retail"; } if ($select_type == "shoppingcenter") { $select_title = "shopping cen

jquery - ui date picker close if click on next -

Image
i'm using jquery ui datepicker plugin ( http://www.kindli.ch ). unfortunately if click next or prev-icon, hole calendar change , close immediately. jquery updated, ui datepicker newest version. my code: if($('input#datepicker_arr').length) { $('#datepicker_arr').datepicker({ dateformat: 'dd.mm.yy', monthnames: ['januar','februar','märz','april','mai','juni','juli','august','september','oktober','november','dezember'], daynames: ['sonntag', 'montag', 'dienstag', 'mittwoch', 'donnerstag', 'freitag','samstag'], daynamesmin: ['so', 'mo', 'di', 'mi', 'do', 'fr', 'sa'], numberofmonths: 3, }

algorithm - Compressing sequence of unique sorted numbers -

this question has answer here: compression algorithm sorted integers 5 answers i project working on, have sequence of numbers (around 2 billion). each number 4 bytes , unique. numbers sorted. goal read them ram asap in uncompressed format. don't care hdd space. if store them uncompressed, need 2 billion*4 bytes = 8gb. take around 100 seconds read. can store data sequence of bits , require 2 billion/8 = 250mb. take around 3 seconds read. i need read , uncompress them in 0.1-0.5 seconds (if possible) using normal hdd. don't care how long take compress data care how long takes decompress them , need done in few milliseconds. the randomness of numbers not known. the question is : kind of compression algorithm can compress numbers around 20-30mb decompression time of 100-200 milliseconds using i3-i5 cpu? edit : maximum number in sequence 2 billion. that&

javascript - Special Characters Must Be Escaped error in Dreamweaver -

am playing bootstrap template , came across error on 1 of lines in dreamweaver not understand. line of code is: <a href="#top" onclick = $("#menu-close").click(); >start bootstrap</a> everything works fine in browser it's not site killer don't understand problem is. tried putting quotes around "$("#menu-close").click();" didn't clear error. a search here has lot of questions characters must escaped don't seem pertain or how might escape them. lol

Bash script being executed in a php script -

i know there other posts this, have tried out solutions , fixes marked solution , none of them works me. as title says, trying make php script execute bash script when being loaded in web server (apache). i using wrapper saw in post, here wrapper.c: #include <stdlib.h> #include <sys/types.h> #include <unistd.h> int main (int argc, char *argv[]) { setuid (0); system ("/bin/sh /var/www/html/scrip/debugport/testversion.sh"); return 0; } this testversion.sh script: #!/bin/bash screen -s skywars -x stuff "stop " cd /tmp pid=$(fuser -n tcp 12321 | awk '{print $1}') kill -9 $pid and php code using: <?php $message=shell_exec("./var/www/html/scrip/php_root"); print_r($message); ?> when ./php_root (which compiled wrapper.c) works fine, when try load web server script doesn't work @ all. it's permissions, used every permission in post's solution: execute root commands via php t

perl - Adding a new node using XML:libXML throwing error -

here xml looks like <rasditemslist xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:rasd="..."> <link rel="edit" type="application/vnd.vmware.vcloud.rasditemslist+xml" href="..."/> <item> <rasd:addressonparent>0</rasd:addressonparent> <rasd:description>hard disk</rasd:description> <rasd:elementname>hard disk 1</rasd:elementname> <rasd:hostresource xmlns:ns12="http://www.vmware.com/vcloud/v1.5" ns12:capacity="59392" ns12:bussubtype="lsilogic" ns12:bustype="6"></rasd:hostresource> <rasd:instanceid>2000</rasd:instanceid> <rasd:parent>2</rasd:parent> <rasd:resourcetype>17</rasd:resourcetype> </item> <item> <rasd:addressonparent>1</rasd:addressonparent> <rasd

javascript - angular click event share to other click -

let's have 2 links using angularjs ng-click, both have same on click event pass same scope variable. ui.myclick(myvar1, myvar2, myvar3) <a ng-click="ui.myclick(myvar1, myvar2, myvar3)">link1</a> <a ng-click="ui.myclick(myvar1, myvar2, myvar3)">link2</a> is possible define on click handler somewhere in html reuse it? this: ng-init="var commonclick = ui.myclick(myvar1, myvar2, myvar3)" then ng-click just: <a ng-click="commonclick">link1</a> <a ng-click="commonclick">link2</a> you can add function in controller , use on ng-click attribute, this: <div ng-controller="myctrl m"> <a ng-click="m.f(arg)">link 1</a> <a ng-click="m.f(arg)">link 2</a> </div> <script> angular .module('app', []) .controller('myctrl', ['$scope', function($scope) {

javascript - Why is the finallyDecrypt method in this code undefined? -

my app receives base64 encoded value encrypted. data can come in few different ways wanted create chain-able methods keep code clean , modular. i want able write: decryptionchain.decodebase64(b64value).stringtobuffer().finallydecrypt(); when run code, last property method "finallydecrypt" returns undefined. why " finallydecrypt " method coming undefined? rest works , if run encryptionchain.decodebase64(b64value).stringtobuffer() buffer expect. when finallydecrypt chained in error out. here code: function decrypt(encrypted) { var decipher = crypto.createdecipheriv(algorithm, password, iv); decipher.setauthtag(encrypted.tag); var dec = decipher.update(encrypted.content, 'hex', 'utf8'); dec += decipher.final('utf8'); return dec; } var decryptionchain = { currentvalue:"", decodebase64: function (encryptedvalue){ this.currentvalue = new buffer(encryptedvalue.tostring(), "ba

Python dictionary code -

so need write python code getting keys in dictionary unique values. example my_dict = {4:3, 5:3, 6:4, 9:8} the program should print [6, 9] because 3 repeated in values. not know how see if values different , how remove them there no ".remove()" dictionaries. have tried making list of keys , values, trying mutate them in way, have had no luck. thanks count values collections.counter dict keep keys dict value equal 1 in counter dict. my_dict = {"4":"3", "5":"3", "6":"4", "9":"8"} collections import counter cn = counter(my_dict.itervalues()) print([k k,v in my_dict.iteritems() if cn[v] == 1]) ['6', '9']

ibm was - IBM Liberty issue -

an architect having issues bringing liberty up. currently, individual running server on local computer , want move shared server. when tries deploy simple “helloworld” it’s failing , receiving error “context root not found”. not sure set in server.xml file have wlp recognize application. have odm 8.5 on mainframe. thinks might if saw example of ear or war file deployed. ideas or suggestions? either put application in dropins folder, detected , started automatically, or put in apps folder , configure in server.xml this: <webapplication id="helloapp" location="helloapp.war" name="helloapp"/> by default context root application file name without extension, can change adding contextroot="mycontext" attribute.

iOS: Code Signing with Cocoapods -

just switched app use_frameworks cocoapods , builds fine , works fine on phone , in our ci server. when uploading ipa itunes connect, error of invalid code signing entitlements. application bundle's signature contains code signing entitlements not supported on ios. specifically, value '[correct_application_identifier]' key 'application-identifier' in '[path_to_pods_framework]' not supported. value should string starting teamid, followed dot '.', followed bundle identifier. this error comes each framework used in app (i have 10 pods in app, , have 10 errors on screen) not sure should do. ideas?

c++ - Why is the pointer blank when it refers to a value of zero? -

playing pointers in c++. have come across unexpected. have code: int main(){ char p=0; char* ptr=&p; cout<<"this pointer: "<<ptr; return 0; } when run code output of ptr blank. if change value of p other value seems output random pointer, e.g. value changes between runs, expect. question different assigning char value 0. info: compiling g++ 4.8.4 char p=0; your variable defined character , assigned integer value zero, internally assigning null terminated character on variable p. if correct above statement follows , print more details may clear you. char p='0'; std::cout<<"this pointer: "<<&ptr<<" ---"<<*ptr <<"----"<<ptr; &&ptr- > getting address of ptr *ptr-> getting value assigned ptr ptr-> getting string ptr until see null terminating character, expects garbage value output. demo: http://coliru.stacked-crooked.com/a/2d13

version control - Update file in SVN repository with changes made in local copy -

i know newbie question, can't seem able accomplish except first copying modified file location, svn remove modified_file , copying file location, svn add modified_file , svn commit . is there easier way make update repo changes made in working copy? just use svn commit . text (from running svn commit ) states: commit (ci): send changes working copy repository. in other words, modified file considered change , running commit send change repository. this perhaps 1 of basic parts of workflow of svn (or version control software), , of course there simple , direct way it. you should read on basic subversion workflow either in red book (primary subversion reference) or via any other tutorial can find .

gulp - IMA.js skeleton install: Cannot find module v8flags -

i've tried install hello world application command: gulp app:hello i'm getting error message: module.js:338 throw err; ^ error: cannot find module 'c:\users\name\appdata\roaming\npm\node_modules \gulp\node_modules\v8flags\3.28.73.flags.json' @ function.module._resolvefilename (module.js:336:15) @ function.module._load (module.js:278:25) @ module.require (module.js:365:17) @ require (module.js:384:17) @ object.<anonymous> (c:\users\name\appdata\roaming\npm\node_modules \gulp\bin\gulp.js:25:22) @ module._compile (module.js:460:26) @ object.module._extensions..js (module.js:478:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) @ function.module.runmain (module.js:501:10) probably have old version of gulp. try reinstall npm install --global gulp .

C array size given by variable -

i found code today confused me. did this: #include <stdio.h> int main(int argc, char **argv) { int x = 5; int foo[x]; foo[0] = 33; printf("%d\n", foo[0]); return 0; } my question why work? the array foo on stack how expanded x ? i have expected thing this: #include <stdio.h> int main(int argc, char **argv) { int x = 5; int foo[] = malloc(sizeof(int)*x); foo[0] = 33; printf("%d\n", foo[0]); free(foo); return 0; } not prettier or but, wonder. the snippet int foo[x]; is talking advantage of called vla ( variable length array ) feature. introduced in c99 standard, made optional feature in c11 . this way, can create array data structure, length given (supplied) @ run-time. point note, though created @ runtime, gcc allocates vlas on stack memory (unlike dynamic memory allocation heap memory).

javascript - NodeJs/Bluebird - keep getting Unhandled rejection Error -

am building daemon listen tcp connection > sends commands > listen events.. so decided use bluebird rid of callbacks.. having issue... cant seem catch rejected error.... have no idea whats wrong here code the promise: function exec(cmd, params, options) { return new promise(function(resolve, reject) { server.send(cmd, params || {}, options || [], function (err, res, rawres) { if (err) reject(err.msg); resolve(res); }); }); } the execution: exec("login", { // login client_login_name: conf.user, client_login_password: conf.pass }).then(exec("use", { // select server sid: 4 })).then(exec("clientupdate", { // change nickname client_nickname: conf.nick })).catch(function (err) { log.error(err); }); the error(server not running) error in reject(err.msg) : unhandled rejection error: server not running @ object.ensureerrorobject (d:\dev\node\a90s\node_modules\bl

email - IMAP, What is proper for multi-data responses? -

if have imap fetch, 12 uid fetch 3 (body.peek[header] body.peek[text]) and respond * 3 fetch (uid 3 body[header] {322} mime-version: 1.0 content-type: text/plain; charset=utf-8;format=flowed content-transfer-encoding: 7bit date: fri, 07 aug 2015 16:36:44 -0400 from: myemail@email.email to: myemail@email.email subject: subjecct message-id: <eea78aff8bfdfgvdfgvdgcdg655d14a4a7@email.email> x-sender: myemail@email.email user-agent: roundcube webmail/0.9.5 body[text] {14} myemailstuff ) all crlf, 322 says length of first block, crlf after line containing 322, crlf before body[text] {14} (take note of space before body ). from there, add space, , body[text] {14} , etc. doesn't work. can't find specs in rfc 3501 single one, yet alone 2 in row. know specifications this, specifically, or know off top of head? also, if matters, error came directly iphone, , server own(the embedded 1 in avuna). a literal takes place of quoted string or atom, , should have

c# - How to handle Windows API LPTSTR output as a formal parameter output -

i'm trying determine classname of window calling getclassname() on hwnd receive findwindowbycaption() . it's not working; see classname garbage characters (specifically, 4 question marks , strange non-alphanumeric character). getclassname() , far understand it, writes data caller's buffer. here's code: [dllimport("user32.dll", setlasterror = true)] static extern system.intptr findwindow(string lpclassname, string lpwindowname); [dllimport("user32.dll", entrypoint = "findwindow", setlasterror = true)] static extern system.intptr findwindowbycaption(system.intptr zeroonly, string lpwindowname); [dllimport("user32.dll")] static extern int getclassname(system.intptr hwnd, [param: marshalas(unmanagedtype.lptstr)] system.text.stringbuilder lpclassname, int nmaxcount); ... system.intptr hwndmywindow = findwindowbycaption(system.intptr.zero, "my window")

Python Regex Script sort and print to new document -

so trying write code scan .txt file bunch of jumble in between ids. want find specific strings, create new line before them, , print new document. currently, code looks this: from__future__import print_function import re ndoc = raw_input("enter name of new document")".txt" log = open("c:python27\ndoc.txt", 'w') file = raw_input("enter file sorted") xfile = open(file) line in xfile: l=line.strip() n=re.sub("(\b)(?=((mth|eng|scn|hst)[|]))","\n",line) if len(n) > 0: nl=split.("\n") item in nl: print(item) when run this, eroor [errno2] no such file or directory: 'xxx' xxx = whatever input variable "file." i'm not sure cause pretty sure entering files in directory. also, on side note, code create new file , print open('filename', 'w') line? you have ".txt" trows error syntaxerror: invalid syntax should use +".t

javascript - How to "remove class" with jQuery? -

i have following code show , hide div if want click on image can add class if want remove clicking image open again. can explain me how works? https://jsfiddle.net/bmhv3edw/ $(document).ready(function() { function close_answer_section() { $('.question-text').removeclass('active'); $('.answer-section-content').slideup(300).removeclass('open'); } $('.question-text').click(function(e) { var currentattrvalue = $(this).attr('href'); if($(e.target).is('.active')) { close_answer_section(); }else { close_answer_section(); $(this).addclass('active'); $('.questions ' + currentattrvalue).slidedown(300).addclass('open'); } e.preventdefault(); }); }); you can see when clicked on img, e.target <img> , don't have class .active , it'll trigger false part. solution, c

Formatting Excel-Formula -

i have made excel formula take data entered column o , multiply .04 , input data column p. can calculate 4 percent fee original number. left bunch of $0.00 in every row in p column lacks data in o column. understand because 0*.04 = 0. wondering if there way make if total in column p less $0.01 or equivalent $0.00 cell remain blank. i tried post image show talking about, not yet have reputation. can understand trying based off typed. do conditional formatting of cell such if value = 0, number type "general" then, in formula cell (assuming multiply c3*b3), can this: =if(c3*b3>0,c3*b3,"") this use number formatting values non-zero, empty string "" general formatting 0 values.

python - Django post on click with jquery not getting a response -

i trying setup button on website when clicked new model item saved database. segments of code pasted below , discuss problem after. textbook.html <script src="../../static/textchange/wishlisting.js"></script> ... <input type="button" id="addwishlist" value="add wishlist"></input> wishlisting.js $('#addwishlist').click(function() { $.ajax({ url: '/textbook/', method: 'post', // or (get), whatever need data: { name: request.user, book: text, // data need pass function click: true } success: function (data) { // success callback // can process data returned function views.py } }); }); views.py def textbook(request, uisbn): form4 = addwishlist(request.post or none) ltextbook = textbook.objects.filter(isbn = uisbn) text = ltextbook[0] wishlists = wishlist.objects.filter(textbook = text) listings = po