Posts

Showing posts from April, 2011

json - Converting encoded chars back to original character - PHP -

my database returns following json special chars. need convert original chars: { "event_id":"5153", "name":"event test", "description":"persönlichkeit universität"", "start_time":"2013-04-24 9:00 est", "end_time":"2013-04-24 5:00 pm est" } i want strip out html chars. , convert chars &ouml original chars. description in above json should this persönlichkeit universität" i doing array_walk on array before encoding array json, , strip_tags on each element. fine. (that resulted in above json.). to chars back, tried: 1. encoding again utf8_encode 2. htmlspecialchars_decode 3. html_entity_decode //this 1 eliminating character altogether. but nothing gave original char back. any ideas? update: i tried this. description field returns null array_walk_recursive($results, function (&

r - Extract only coefficients whose p values are significant from a logistic model -

i have run logistic regression, summary of name. "score" accordingly, summary(score) gives me following deviance residuals: min 1q median 3q max -1.3616 -0.9806 -0.7876 1.2563 1.9246 estimate std. error z value pr(>|z|) (intercept) -4.188286233 1.94605597 -2.1521921 0.031382230 * overall -0.013407201 0.06158168 -0.2177141 0.827651866 rtn -0.052959314 0.05015013 -1.0560154 0.290961160 recorded 0.162863294 0.07290053 2.2340482 0.025479900 * pv -0.086743611 0.02950620 -2.9398438 0.003283778 ** expire -0.035046322 0.04577103 -0.7656878 0.443862068 trial 0.007220173 0.03294419 0.2191637 0.826522498 fitness 0.056135418 0.03114687 1.8022810 0.071501212 . --- signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 (dispersion parameter binomial family taken 1) null deviance: 757.25 on 572 degree

javascript - Time picker ONLY in asp.net -

Image
i creating vb.net page. page allow users schedule lectures, appointments etc. have few text boxes add details. have used asp:calendar control select days. cannot find time picker. clear have 3 textboxes. 1 day, 1 start time , 1 end time. want time picker. when user clicks button or link list pops times of day. user clicks whichever time , can time , store in variable pass database, calendar control. ask. has got answer here. know has been asked multitude of times , know there answers out there have spent 9 hours far playing around solutions out there, no success, hoping please please please here can me. i'm desperate , fed up, , it's incompetence. try using jquery timepicker has many cool features such as timezones support datetime picker time picker jquery ui theming support , many other tweaks. usage simple , effective example date , time picker html <input type="text" name="basic_example" id="basic_exampl

Passing values to another php page using anchor tag -

i try pass value of personid list.php delete.php. using anchor tag here code : <a href = "delete.php?pid = <?php echo $row['personid']; ?>"> delete </a> the value passed correctly somehow don't redirected delete.php can note problem in above line? get rid of space in url: <a href="delete.php?pid=<?php echo $row['personid']; ?>"> delete </a>

coldfusion - Find non-ascii characters in string -

?testmsg=ÁáÉéÍíÑñÓóÚúÜü«»¿¡€ <cfset ascii = not refind('[\u0080-\uffff]', arguments.textmsg)> variable ascii returns 1, shouldn't be. refind('[\u0080-\uffff]', arguments.textmsg) returns 0 despite textmsg containing characters above 128. line inside remote cffunction. as per the docs , coldfusion's regex implementation doesn't support \u escape sequence (and, indeed, it's unaware of concept of unicode). to want here, you're gonna have use java regexes .

gcc - Force Exclude /usr/lib64/perl5 Library Directory from Custom Perl Install -

i need create custom system-wide perl install on centos machine. don't want use perlbrew want alter config variables myself, plus same linkage problems. essentially, cannot figure out how compile perl /usr/lib64/perl5 not included linker or in @inc. old centos version, , sucks. no matter how compile though, perl -v yeilds this: @inc: /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl /usr/local/perl5/lib/site_perl/5.16.3/x86_64-linux-thread-multi-ld /usr/local/perl5/lib/site_perl/5.16.3 /usr/local/perl5/lib/5.16.3/x86_64-linux-thread-multi-ld /usr/local/perl5/lib/5.16.3 and when run, insane library errors this: undefined symbol: perl_gthr_key_ptr libraries inside /usr/lib64/perl5. note perl5lib has no effect on this, compiled in. thanks. in order remove directory @inc , can use no lib . example, no lib "/usr/lib64/perl5/"; would remove /usr/lib64/perl5/ directory @inc . for more, try perldoc lib .

I want recover breakpoints which was deleted accidently. (Eclipse) -

i accidently delete breakpoints , want know how restore them back. can please me? thanks there no way, if don't have complete backup of workspace directory. to avoid next time, these alternatives: regularly export breakpoints using file -> export -> run/debug -> breakpoints. use mylyn provisioning plugin , automatically stores breakpoints in task contexts, when using mylyn.

Is there any way to modify this function so that it removes the previous element in the array - C -

so i've been given task of modifying previous code (which simulates deck of card) more accuarely having cards in array removed after drawn. i know there ways using linked list i'm still new using linked list , because i'm on strict timeline not mention doing how i've been taught i'd have change code uses arrays, structs , pointers cost time don't have. void draw(int deck[size]) { int numcards = 10; int i; int hand[numcards]; int card; for(i = 0; < numcards; i++) { card = deck[i]; hand[i] = card; cards(card); } } this current fucuntion need modify when card added hand[i] card removed deck[i] don't repeats. cards function prints cards , can ignore #include <stdio.h> #include <string.h> #include <stdlib.h> #define size 52 enum faces{ace = 0, jack = 10, queen, king}; char * facecheck(int d); void shuffle( int deck[]); void draw(int deck[size]); void cards(int ha

regex - Scan String with Ruby Regular Expression -

i attempting scan following string following regular expression: text = %q{akdce alaska district court cm/ecfalmdce alabama middle district courtalndce } p courts = text.scan(/(ecf\w+)|(court\w+)/) ideally, want scan text , pull text 'ecfalmdce' , 'courtalndce' regex using, trying want string starts either court or ecf followed random string of characters. the array being returned is: [["ecfalmdce", nil], [nil, "courtalndce"]] what deal nil's, have more efficient way of writing regex, , have link further documentation on match groups? your regex captures differently ecf , court . can create non-capture groups ?: text.scan(/(?:ecf|court)\w+/) # => ["ecfalmdce", "courtalndce"] edit about non-capture groups: can use them create patterns using parenthesis without capturing pattern. they're patterns such (?:pattern) you can find more information on regular expressi

How to upgrade only one projects ruby interpreter with RVM? -

i want upgrade ruby i'm using on 1 project 1.8.7 1.9.3. however, still need 1.8.7 project not being upgraded. how can upgrade ruby using rvm , keep gemset in tact? would rvm upgrade 1.9.3 1.8.7 way this? won't migrate every project using 1.8.7 1.9.3? update: it seems way rvm install 1.9.3 , migrating gems project so: rvm gemset copy 1.8.7-p352@journal 1.9.3@journal i'm going try now rvm supports multiple rubies @ once in sandbox, reason existence. result, it's not necessary upgrade 1.8.7 1.9.3. can use separate ruby version, and/or gemsets projects, or different paths, depending on how want set things up. while can upgrade across 1.8.7 1.9.3, i'd recommend keeping 1.8.7 @ final release, , install separate version of 1.9.3 @ final release (currently p392), allowing easy testing between 2 compatibility. install ruby v2.0.0 also, and, updates come out, use rvm upgrade recent, deleting older versions see fit. i think your: rvm gemset

html - Highlight multiple div class with link -

hi everyone - after countless searching, i'm still not sure terminology i'm looking ( it seems simple ). it's been hard try , find progress... sorry have no code show @ point, still trying figure out best direction solution. an example of i'm after can seen @ www.anishkapoor.com - i'm trying create similar navigation content catagorised colour, after clicking on particular nav link highlights (changes colour) of content same class id. when new nav link selected current highlighted content switch new class id. i'm trying write code can applied cms. thank time , hope i've made sense. it works, it's pretty basic attempt. jsfiddle.net/bh6pg/1 i'm going apply wordpress if has better solution cms, please inform :-) $(".oranges").click(function () { $(".orange").addclass("orange_highlight"); $('.apple').removeclass("apple_highlight"); $('.banana').removeclass("banana_high

How to Access and Modify Variables from Different Classes in Java -

this question may it's been asked million times, , that's because has. unfortunately, , maybe fault don't think so, has not been thoroughly , accurately answered. have been looking while answer question , come across many ambiguities , looking actual answer. in research have seen following: "use static variables, never use static variables, use getter , setter, getter's , setter's evil, global variables not exist in java, make public variable, public variables should not used" , more. i'm wanting have variable has value can accessed , changed multiple class , these multiple classes can see changes made variables value. how possible , best way of doing it? there heap of different ways, , depends on how secure want variable be. tend use getters , setters because it's easier track method calls change of variable. if it's class sole purpose hold values in variables might want use direct variable calls, if values in more functional cl

iis 7.5 - Set IIS 7 to listen to different port than 80 -

i know can done each of site hosted can iis's default port set different one? from iis management console, select default web site . on right-hand side, click edit bindings link , in subsequent dialog, change default port binding desired.

android - How can I debug the Google Analytics Tracking Code on a mobile device -

we seeing problem mobile devices surf our website don't seem picked up, not page view or in realtime or in events tracking. happened since march 15th starting notice it. debugging analytics code snipped based on https://developers.google.com/analytics/resources/articles/gatrackingtroubleshooting no problem on desktop how do on mobile device. android phone or iphone. there way debug tracking code on phone make sure works? had been using ga.js async snytax without problems long while. for testing on ios 6 , later can plug iphone desktop , use desktop version of safari described here apple. can see results of ga_debug.js . android has similar tool , however, require install android sdk. i'm not sure other phone operating systems, covers main 2 in question :)

python - how can i change registry_name of argparse's help argument -

python3 argparse use -h , --help argument. want use -h , --host hostname parameter. how can stop argparse use -h help? i know can use add_help=false when creating instance of argumentparse. gets deal print_help self. this: import os import argparse inc import epilog def parsecommandline(): parser = argparse.argumentparser( description = "network client program", epilog = epilog, add_help = false, ) parser.add_argument( "--help", dest="help", action="store_true", help="show message , exit", ) parser.add_argument( "-h", "--host", dest="host", action="store", help="target host", ) parser.add_argument( "-p", "--port", dest="port", action="store", type=int, help="target port&qu

java - Draw a line in Open GL ES 2.0 -

i'd draw line of fixed color given 2 points can change @ will. i have other objects i've got shaders , textures on take code snippets on have way more code think necessary simple line. i'm new open gl es 2.0 , cant figure out how put yellow 3d line on screen without making holder object. this in ondrawframe method of renderer private void drawtestline() { float[] lineendpoints = new float[6]; system.arraycopy(nearpoint, 0, lineendpoints , 0, nearpoint.length); system.arraycopy(farpoint, 0, lineendpoints , 3, farpoint.length); //need here gles20.gldrawarrays(gles20.gl_lines, 0, 2); } vertex shader: attribute vec3 a_posl; uniform mat4 u_mvpmatrix; void main() { gl_position = u_mvpmatrix*vec4(a_posl,1.0); } fragment shader: precision mediump float; uniform vec4 u_linecolor; void main() { gl_fragcolor = u_linecolor; } once have these shaders, pass position, color , matrix using glvertexattribpointer , gluni

php - SimpleXml can't access children -

this snippet of xml i'm working with: <category name="pizzas"> <item name="tomato &amp; cheese"> <price size="small">5.50</price> <price size="large">9.75</price> </item> <item name="onions"> <price size="small">6.85</price> <price size="large">10.85</price> </item> <item name="peppers"> <price size="small">6.85</price> <price size="large">10.85</price> </item> <item name="broccoli"> <price size="small">6.85</price> <price size="large">10.85</price> </item> </category> this php looks like: $xml = $this->xml; $result = $xml->xpath('category/@name'); foreach($result $element) {

android - Viewpager position 0 doesnt work with onPageSelected(0) -

i cant set value start page (position 0) i mean questionpageradapter.tv.settext("default") must work in mainactivity's onpageselected(int position) case 0: gives nullpoint. works position > 0 pageradapter: public class questionpageradapter extends pageradapter{ public static textview tv; @override public object instantiateitem(view collection, int pos) { layoutinflater inflater = (layoutinflater) collection.getcontext() .getsystemservice(context.layout_inflater_service); view page = inflater.inflate(r.layout.page_quiz, null); tv = (textview)page.findviewbyid(r.id.questiontext); } } mainactivity: @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); this.setcontentview(r.layout.activity_main); mpager = (viewpager)findviewbyid(r.id.pager); questionpagerada

javascript - Working of increment operator and document.write function -

as know: i++ -> use first , increment it's value ++i -> increment first , use i's new value but in code below different var n=5; for(i=n;i>=1;--i) { console.log(i);//output:5 why? for(j=1;j<=n;++j) { document.write(j); } document.write("\n"); } even though using predecrement operator why vaule outputs 5 on fist loop? using new line after completion of innerloop dont show .what can reason behind this?is becoz on each loop document.write() running document.open() function?if yes ,in context || conditions document.write runs document.open() function? the ++j in for(j=1;j<=n;++j) occurs @ end of for loop after statements in loop executed there no difference in for construct between ++j , j++ . you can think of loop this: for(j=1;j<=n;) { document.write(j); ++j; } as console.log(i);//output:5 why? question, that's because 5 initial value i assign in i=n . as document.write(

Why this GLSL code don't work on old Intel card (openGL 2.1)? -

as know, 3d software has xyz-axis in view section. suppose draw coordinate axis that. here method. firstly, there function named drawoneaxis() used draw 1 axis. invoke 3 times. however, everytime before draw axis, change model matrix can 3 axes perpendicular each other. function changeuniform_mvp() do. void draw() { (int = 0; < 3; i++) // 0 - x axis, 1 - y axis, 2 - z axis { changeuniform_mvp(i); drawoneaxis(); } } vertex shader: #version 110 uniform mat4 mvp; void main() { gl_position = mvp * gl_vertex; } in function init() , shader compiled , linked , program id named programid . @ end of init() , use shader invoke gluseprogram( programid ) . the result on 2 computers: pc 1: intel card, opengl 3.1, pc 2: intel card, opengl 2.1, 1 axis drew (z axis) why 2 different results here? 1 magic thing!!! result correct on pc2 after add 2 lines of code function draw() . void draw() { (int = 0; < 3; i++) { glus

buffer - Custom FrameDecoder in netty -

i have problem framedecoder of netty following. packet fragmented in {n} frames framedecoder processing correctly. if many packets composed 1 frame , send server(when client sending small packet data continuously), framedecoder reads first packet. remaing ignored. can remaining data continued executed framedecoder? public class binaryframedecoder extends framedecoder { @override protected object decode(channelhandlercontext ctx, channel channel, channelbuffer buffer){ if(buffer.readablebytes() < 2){ return null; } int length = buffer.getshort(buffer.readerindex()); if(buffer.readablebytes() < length + 2){ return null; } buffer.skipbytes(2); return buffer; } } it should work if replace: return buffer; with: return buffer.readbytes(length); because buffer contains more 1 message.

c# - The name 'GroupforA' does not exist in the current context -

here code: class program { static void main(string[] args) { list<item> cont1 = new list<item>(); cont1.add(obja); //obja local varible has been defined. cont1.add(objb); //objb local varible has been defined. cont1.add(objc); //objc local varible has been defined. cont1.add(objd); //objd local varible has been defined. cont1.add(obje); //obje local varible has been defined. int count = cont1.count; list<item> cont2 = groupinga(cont1, count); (int = 0; < cont1.count; i++) { console.write(cont1[i].name + " ");//output item's name. } console.writeline(); console.write("container 2: "); (int = 0; < cont2.count; i++) { console.write(cont2[i].name + " ");//output item's name. } } } public class groupitem { public list<item> groupinga (list<item> obj, int count) {

shell - force git status to output color on the terminal (inside a script) -

i see color because scripting robust enough (so far) handle color codes. seem i'm going against grain here, don't see big deal having parse stuff escape codes in scripts. if colors interactive use, why wouldn't in script use might aggregating data , crunching more data manually? wouldn't colors even more important ? anyway, have neat little shell script wrote munges git status output, , i'm looking make script keep colors intact. global git config set lists of changed , untracked files show in color in git status. unfortunately unlike git diff there no option forcing color git status can find. to abundantly clear, issue: $ git status produces perfect output, (excerpt script follows) git status | sed "s/^#/\x1b[34m#[0m/" produces no colored git status output, , can see here i'm explicitly converting leading hash-characters blue because helps highlight different regions of output script. does know how put out colors? there maybe sta

Inserting python datetime into the mysql table -

i have python date 2013-04-04t18:56:21z i want store mysql database . i tried self.start_at = datetime.strptime(self.start_at.split(".")[0], "%y-%m-%dt%h:%m:%s") but getting error valueerror: unconverted data remains: z please tell me how convert above date in mysql acceptable format . in instance work. >>> datetime import datetime >>> start_at = '2013-04-04t18:56:21z' >>> datetime.strptime(start_at , "%y-%m-%dt%h:%m:%sz") datetime.datetime(2013, 4, 4, 18, 56, 21) are t & z characters in date format or every change? if variation in these seperator characters, should this: >>> datetime import datetime >>> start_at = '2013-04-04t18:56:21z' >>> datetime.strptime(start_at[0:10] + ' ' + start_at[11:19], "%y-%m-%d %h:%m:%s") datetime.datetime(2013, 4, 4, 18, 56, 21)

java - Deleting an item from an array using arraycopy -

i having problems deleting item array using arraycopy. have 2 methods find (which locates index of item deleted) , delete (which deletion). doesn't delete anything. thank in advance. public void find(comparable value2){ scanner sc = new scanner(system.in); comparable value = value2; if (empty() == true){ system.out.println("the array empty"); } else{ int bsvalue = arrays.binarysearch(sa,value); system.out.println("the index is: " + bsvalue); delete(bsvalue); } } public void delete(int bs){ int location = bs; comparable[] temparray = new comparable[sa.length -1]; system.arraycopy(sa, 0, temparray, 0, location); if (sa.length != location){ system.arraycopy(sa, location +1 , temparray, location, sa.length - location - 1); } } you allocate temparray , copy data it, , abandon reference. result, original array ( sa ) stays was. presumably meant make sa p

How to download HTML encoded with PHP/JavaScript content using WGET or Perl -

i have url want download , parse: http://diana.cslab.ece.ntua.gr/micro-cds/index.php?r=search/results_mature&mir=hsa-mir-3131&kwd=mimat0014996 the problem when download unix wget following way: $ wget [the above url] it gave me content different saw on browser (namely, list of genes not there). what's right way programatically? #/usr/bin/perl use www::mechanize; use strict; use warnings; $url = "http://diana.cslab.ece.ntua.gr/micro-cds/index.php?r=search/results_mature&mir=hsa-mir-3131&kwd=mimat0014996"; $mech = www::mechanize->new(); $mech->agent_alias("windows ie 6"); $mech->get($url); #now have access html code via $mech->content(); to process html code i'm recommend use html::treebuilder::xpath (or other html parsing module)

how can i compile for windows XP with Visual Studio 2012 from the command prompt -

i running tcl/tk (8.5) external c library interface d2xx usb library. running windows 8 , trying compile library using vs 2012 native tools command prompt. when start command prompt pwd is: \program files (x86)\microsoft visual studio 11.0\vc the c library (tclftd2xx.c) comes nmake files virtual studio sets environment link required tcl libraries , d2xx header. in vs command window, cd directory containing makefile.vc , type: nmake ..... and tclftd2xx.dll. tclftd2xx.dll calls msvcr110.dll . when both of these placed in /tcl/lib, work great on windows 8 system, , on vista , windows 7. however, when installed on windows xp, windows cannot load tclftd2xx.dll. i did searches , discovered have configure vs2012 v110_xp toolset. link ( http://blogs.msdn.com/b/vcblog/archive/2012/10/08/10357555.aspx ) has note: visual studio 2012 solutions , projects have been switched v110_xp toolset can built command line using msbuild or devenv without additional step

iphone - Cocos 2d: Images rendered on retina devices are double in size -

i new cocos 2d. kindly excuse me incase basic stuff. i creating ccmenuitemimage images , working fine on non retina devices in case of retina device(iphone , ipad retina) images being rendered double of expected size. provided, images used retina devices twice in resolution of non retina devices. instance if button has resolution of 100 x 100 non retina devices, same button retina devices has resolution of 200 x 200(because retina devices have double resolution of non retina ones). i using following code create ccmenuitemimage :- ccmenuitemimage *startbutton = [ccmenuitemimage itemfromnormalimage:startbtnimg selectedimage:startbtnimg target:self selector:@selector(menubuttonaction:)]; in case of retina devices 'startbuttonimg' have file name double resolution compared non retina devices. to summarize when render ccmenuitemimage on retina devices, images being rendered of double size(it should not this). kindly me in figuring out doing wrong. in advance!

objective c - when adding a relationship object w/ core data get "property cannot be found in forward class object" error -

i have core data model 4 entities. entity player has to-many relationship other entities ( player_scores,custom_exercise,selected_exercise ). in app delegate, make nsmanagedobjectcontext,nsmanagedobjectmodel,nspersistentstorecoordinator properties in standard way. then, in different view controller, declare ivars nsmanagedobjectcontext object , newplayer player entity in @interface: @interface newprofileviewcontroller() { nsmanagedobjectcontext *context; player *newplayer; } then in action have following code create player entity , enter in attributes, player_scores entity , selected_exercise entity. code use adds attributes player_scores , player entities. when try add 16 selected_exercise entities in loop , set attributes big fat " property cannot found on forward class object? " error. help!!!!! said code same selected_exercise , player_scores . tried re-starting, deleting database, etc. it's compiler error pops when try newex.exercise=@&quo

javascript - JSON call back function name in getJSON() -

i want access reactome rest api retrieve data. using getjson() json data. don't know callback function name name different every websites. following not working: $.getjson('http://reactomews.oicr.on.ca:8080/reactomerestfulapi/restfulws/frontpageitems/homo+sapiens?jsoncallback=?', function(data) { console.dir(data); }); i tried using ajax since jquery documentation states can leave on jquery decide callback function. $.ajax({ type: 'get', url: 'http://reactomews.oicr.on.ca:8080/reactomerestfulapi/restfulws/frontpageitems/homo+sapiens', datatype: 'jsonp', success: function(data) { console.dir(data); }, error: function(e) { console.log("error"); all signs point service not supporting jsonp. the actual error in jquery being: typeerror: property 'message' of object error: jquery191005664544063620269_1366270377427 not called not function . examining response server wh

Wbadmin & powershell - latest backup version identifier -

i need latest backups version identifier in powershell script. if run wbadmin versions, list of backups , last 1 one need. is there way kind of select top 1 version identifier backups order date or parsing wbadmin output , getting this. edit it may windows.serverbackup module , versionid of get-wbbackupset i'm looking still need parsing this. versionid : 04/17/2013-21:00 backuptime : 17/04/2013 22:00:55 backuptarget : u: recoverableitems : volumes, systemstate, applications, files, baremetalrecovery volume : {system reserved, local disk (c:), local disk (i:), local disk (o:)...} application : {"cluster", "registry", "microsoft hyper-v vss writer"} vssbackupoption : vssfullbackup snapshotid : 58999c7d-dfbf-4272-a5b9-21361d171486 give try, use -last instead of -first last item: get-wbbackupset | sort-object backuptime | select-object -first 1 -expandproperty versionid you can play order

c++ - nvcc failed to compile in debug mode : Single file required -

i have problem trying compile program nvcc cuda. use visual studio 2012 , cuda 5.0. when launch build in release mode, goes fine. in debug mode following error message @ compile time first .cu file: nvcc : fatal error : single input file required non-link phase when outputfile specified my command lines are, release mode: c:\users\ernest\documents\matlab\icem\icem_cpp\cudaicem>"c:\program files\nvidia gpu computing toolkit\cuda\v5.0\bin\nvcc.exe" -gencode=arch=compute_13,code=\"sm_13,compute_13\" --use-local-env --cl-version 2010 -ccbin "c:\program files (x86)\microsoft visual studio 10.0\vc\bin\x86_amd64" -i"c:\program files\nvidia gpu computing toolkit\cuda\v5.0\include" -i"c:\program files\nvidia gpu computing toolkit\cuda\v5.0\include" --keep-dir "x64\release" -maxrregcount=0 --ptxas-options=-v --machine 64 --compile -d_windll -d_mbcs -xcompiler "/ehsc /w3 /nologo /o2 /zi /md "

custom content type with designer workflow -

i developing designer workflow 3 approvals here flow. requester submit request through asp.net form. request go first 1 approvar approval. if approved go 2 , go until approved. my requirement when request go approval , approvar see details of request , can change request(only specific approvar) , see other approvar comments so, these kind of requirement going create custom content type show request data , task update according approvar response. is understanding correct? if have link or solution/example please share me .

UTF-8 and charcters in Java and Eclipse IDE -

public static void main(string[] args) throws unsupportedencodingexception { string str = "अ"; byte[] bytes = str.getbytes("utf-8"); (byte b : bytes) { system.out.print(b + "\t"); } string hindi = new string(bytes, "utf-8"); system.out.println("\nhindi = " + hindi); system.out.println((int) 'अ'); } output: -32 -92 -123 hindi = अ 2309 i need explanation on 3 outputs. last one. also, copy paste character अ web page. how type manually in eclipse ide? example, alt + 65 give 'a' alt + 2309 not give me 'अ' (i copy paste again). the first print: see public byte[] getbytes(charset charset) : encodes string sequence of bytes using given charset, storing result new byte array. the second print: see public string(byte[] bytes, charset charset) : constructs new string decoding specified array of bytes using specified charset. the

smalltalk - Seaside still actively developed? -

just quick question. since last major version of seaside came out in 2010, still being actively developed? there doesn't seem going on @ moment. iliad seems kinda dead. thx, henrik seaside stable , extensible framework. although no major changes have been applied during last couple of years, creating highly dynamic web applications without ever being limited seaside itself. and 3.1 release upcoming.

php - MYSQL - select all time high score -

assuming have table below id | name | userid | score | datestamp | ------------------------------------------------------------ 1 | john | 1 | 44 | 2013-06-10 14:25:55 2 | mary | 2 | 59 | 2013-06-10 09:25:51 3 | john | 1 | 38 | 2013-06-10 21:25:15 4 | elvis | 3 | 19 | 2013-06-10 07:25:18 5 | john | 1 | 100 | 2013-06-14 07:25:18 i want select time high-score of each user. so example if player john have played ten rounds in 2013-06-10 , score 430 in total day. , in 2013-06-14 plays 16 rounds , scores 1220 in total day. want display the best score of user john, , on others players. in example above johns best score 2013-06-14 score 1220. detailed example: if user john plays 3 rounds in 2013-06-10. first round scores 44, second time scores 38 , third time scores 55. total score day 137. , on next day 2013-06-11 plays 5 rounds total scor

How-to properly merge local git repo with remote one (on github)? -

i'm having problem updating local git repository changes remote github repository. local repository has changed since last time updated remote one. when tried pull github in eclipse received merge conflict error. after tried manually merge or overwrite changes. still, in eclipse down-arrow , number 1 displayed next tracked projects in workspace. next thing tried commit. commit went succesfully changes not commited remote (github) repository. what's wrong?

PHP Regular Expression not working : mobile format -

i having problem in code. cant seem solve this. here test subject : +447799604555 , here code preg_match("/^\+44d{10}$/", "+447799604555"); is returning 0 false.. don't know problem is. you have missed \ before d . try following regex: /^\+44\d{10}$/

ios - Xcode Can't remove UIBarbuttonItem without getting error -

so started app 2 buttons in calenderview : day , week button. want use 1 button , dynamically change name of (that part works) using weekbutton that. want remove day button. cant out of program. i tried first deleting link in .xib delete button. remove .h file, , .m results in same error : * terminating app due uncaught exception 'nsunknownkeyexception', reason: '[ setvalue:forundefinedkey:]: class not key value coding-compliant key daybutton.' cant see why cant remove button... you`ve deleted outlet code .h/.m file, somewhere in .xib still connected deleted outlet. recheck connections in .xib file sure have appropriate declaration in .h file.

tags - Canonical way to work on Option elements in Scala -

as example, want apply function f: (int,int) => int 2 elements of type option[int] . thoughts (a,b).zipped.map(f), yields list, , want new option[int] result. scala> def f(a:int,b:int) = a*b f: (a: int, b: int)int scala> val x = some(42) x: some[int] = some(42) scala> val y:option[int] = none y: option[int] = none scala> (x,y).zipped.map(f)//i want none result here res7: iterable[int] = list() how can done without explicitly branching? just many other operations in scala can done via comprehension: def f(a:int,b:int) = a*b (x <- maybex; y <- maybey) yield f(x, y)

Error Code: 1305 MySQL, Function does not Exist -

i have problem. created function in mysql returns string (varchar data type). here's syntax: delimiter $$ use `inv_sbmanis`$$ drop function if exists `safetystockchecker`$$ create definer=`root`@`localhost` function `safetystockchecker` (jumlah int, safetystock int) returns varchar(10) charset latin1 begin declare statbarang varchar(10); if jumlah > safetystock set statbarang = "stabil"; elseif jumlah = safetystock set statbarang = "perhatian"; else set statbarang = "kritis"; end if; return (statbarang); end$$ delimiter ; when call function call safetystockchecker(16,16) , error: query : call safetystockchecker(16,16) error code : 1305 procedure inv_sbmanis.safetystockchecker not exist execution time : 00:00:00:000 transfer time : 00:00:00:000 total time : 00:00:00:000 what's wrong function? that not correct way call function. here's example call function: select safet

css - jQuery UI - Multiple serialized .selectable lists -

i'm making error report handling system, , i'm trying use jquery ui .selectable reports user has clicked, reports grouped in lists based on system come from. multiple lists can selected @ same time. as in linked demo, i'm printing out ids, works fine single list. however, when i'm selecting items 2 or more different lists, ids listed disappear. seem still selected in .selectable's eyes, don't printed anymore. every time click on different list, previous ids disappear , new ones appear. does have idea can printed? also, there way apply .ui-selected class elements, given string/array of values supposed selected? basically, opposite of script's functionality. (if made sense..?) jsfiddle here: http://jsfiddle.net/kantana/z3sbu/1/ javascript $(function() { $(".selectable").bind("mousedown", function(event) { event.metakey = true; }).selectable({ stop: function() { var result = $("#selec

asp.net - Does a Windows Platform based server with IIS7.5 support .htaccess -

i new .htaccess concept. have website hosted on windows server iis 7.5 . want know if .htaccess supported on or not actually want resolve canonical url issue it, tried creating .htaccess , ran on server did not worked. my hosting provider offers me linux server should achieve .htaccess functionality should migrate linux server please note website created in aspx page in html also. i know canonical issue can resolved through web.config file not working. please me. regards, shashikant if website asp.net website (.aspx) .htaccess files of no relevance you, , should running website on windows server. .htaccess files apache web servers , although can used on iis 7.5 e.g. php-based site prestashop require third-party plugin utilise .htaccess files. the windows server iis7.5 closest equivalent web.config file.

java - JAX-WS duplicates complex type when generating wsdl -

i'm developing web service several methods taking input identical complex data types. data types have jaxb annotations , setters , getters, , web service class has jax-ws annotations. template of service.java file: @webservice(servicename = "servicews") public class sericews { private static serviceif serviceimpl; static { serviceimpl = new serviceimpl(); } public result method1(credentials credentials) { @webparam(name = "credentials") credentials credentials) { return serviceimpl.method1(credentials); } public result method2(credentials credentials) { @webparam(name = "credentials") credentials credentials) { return serviceimpl.method2(credentials); } } edit: credentials.java file: @xmlaccessortype(xmlaccesstype.field) @xmltype(name = "", proporder = { "name", "password" }) @xmlrootelement(name = "credentials") public class credentials implements myb

Php File-uploading doesn't work properly -

i manage download image c:\wamp\www\images\ . file's first letter deleted. don't know why happening. also, can't display image on webpage. can me out,please? this php file displays info file , suppose display image doesn't. <html><head><title>file uploads</title></head> <body bgcolor="#33ff33"> <font face="verdana" size="+1"> <?php echo "the uploaded file is: ", $_files['picture_file']['tmp_name'], "<br />"; $filename=$_files['picture_file']['name']; $filesize=$_files['picture_file']['size']; echo "filename".$filename; $directory='c:\wamp\www\images\\'; $uploadfile = $directory . $filename; echo "the moved file is: $uploadfile<br />"; if (move_uploaded_file($_files['picture_file']['tmp_name'], $uploadfile)){ echo "the file valid ,

delphi - Access Violation in NTDLL using IXMLDocument -

i continually access violation @ read of address 0xfeeefeee debugger stops on ntdll.ntraiseexception, can not debug further loop condition telling me app has faulted @ ... use step or run... , takes me beginning. happens in ide (delphi xe2) 32 bit. application using following bits of code var xmldoc: ixmldocument; begin if fod.execute //file open dialog begin try try xmldoc := newxmldocument(); //txmldocument.create(nil); result := fod.filename; xmldoc.filename := xmlfilename; xmldoc.active := true; when file opens call functions loaded xml data binding wizard (file new other xml) parse xml file opened in proc above. intent create csv file , use sqlldr export data oracle database. outside of ide works find, , can leave application running showing data in sring grid overnight in ide crashes within minutes. call stack shows me nothing usefull. can see have tried txmdocument.create, newxml no avail. have tried putting object

java - When we need Collections class method in Arraylist then why not Collections is extended? -

collections.sort() needed each , every time in arraylist when perform sorting , why not "the great man" has developed arraylist not added collections class extended class ! well may because of following reasons arraylist extends abstractlist , can extends 1 class in java all functions of collections static they not want override methods in case in not static if 1 argues can converted final non static methods making collections base class of no use. methods in collections part of job can executed on arraylist , not defines arraylist should do. hence oop point of view i, neither "the great man" have done that.

c# - Push-notifications and MVVMCross -

we facing problem handling notification on android mvvmcross. i implemented default void createnotification() when tap notification in notification center, oncreate() fails following exception: system.nullreferenceexception: object reference not set instance of object the code using: var notificationmanager = (notificationmanager)getsystemservice(notificationservice); //create intent show ui var uiintent = new intent(this, typeof(homeview)); var notification = new notification(android.resource.drawable.staron, title); notification.flags = notificationflags.autocancel; notification.setlatesteventinfo(this, title, desc, pendingintent.getactivity(this, 0, uiintent, pendingintentflags.updatecurrent)); notificationmanager.notify(1, notification); the homeview in sample of type: public abstract class mvxbindingactivityview : cirrious.mvvmcross.droid.views.mvxactivityview tviewmodel : class, cirrious.mvvmcross.interfaces.viewmodels.imvxviewmodel

php - Uploadify: Wait for move_uploaded_file until firing "onUploadSuccess" -

i'm trying upload large video files via uploadify once files big (>800mb) onuploadsuccess event fires before move_uploaded_file is done. there way make uploadify wait actual succes or display kind of waiting message bewteen finished upload , actual success (like "finishing upload" or something)? here's code of upload.php: if($video = wire('pages')->get($_post['id'])) { if (!empty($_files)) { $tempfile = $_files['filedata']['tmp_name']; $targetpath = $_server['document_root'] . $targetfolder; $targetfile = rtrim($targetpath,'/') . '/' . $_files['filedata']['name']; $targetfile = preg_replace('/ /','_',$targetfile); // validate file type $filetypes = array('mov','mp4','m4v'); // file extensions $fileparts = pathinfo($_files['filedata']['name']); if (in_array($fileparts['extension'],$filet

c++ - How to compute in-place set difference of two multisets? -

suppose have 2 multisets. want remove elements occur in second multiset first multiset, respecting number of times each element occurs in each multiset . example, if multiset a contains 1 5 times, , multiset b 2 times, when compute a -= b , 2 instances of 1 should removed a . here code accomplishes this: multiset<int> a; multiset<int> b; // remove items occur in b a, respecting count ("a -= b") (multiset<int>::iterator = b.begin(); != b.end(); i++) { if (a.count(*i) < 1) { // error } // a.erase(*i) remove elements equal *i a, // want remove one. a.find(*i) gives iterator first // occurrence of *i in a. a.erase(a.find(*i)); } surely there's better / more idiomatic way? while std::set_difference requires put elements new set, can still optimize moving elements original set new 1 , swapping both afterwards (ok, int s moving isn't neccessary, way algorithm keeps flexible , generic).

C++: Union Destructor -

a union user-defined data or class type that, @ given time, contains 1 object list of members. suppose possible candidate members needed allocated dynamically. eg. // union destructor #include <string> using namespace std; union person { private: char* szname; char* szjobtitle; public: person() : szname (nullptr), szjobtitle (nullptr) {} person (const string& strname, const string& strjob) { szname = new char[strname.size()]; strcpy (szname, strname.c_str()); szjobtitle = new char [strjob.size()]; strcpy (szjobtitle, strjob.c_str()); // obvious, both fields points @ same location i.e. szjobtitle } ~person() // visual studio 2010 shows both szname , szjobtitle { // points same location. if (szname) { delete[] szname; // program crashes here. szname = nullptr; // avoid deleting deleted location(!) } if (szjobtitle) delete[]

Freeing C pointers declared in the middle of a block (seeking documentation on this) -

where behaviour documented (if @ all)? when declare pointer in c in middle of block, in wrong state (pointing unusable memory) , cannot use standard if (a) free(a) freeing it. the simplest program comes mind is #include <stdlib.h> int main(int argc, char *argv[]){ if(argc > 1) goto end; char *a = null; = calloc(1,1); end: if(a) free(a); } run program without parameters , works ok, if run @ least 1 parameter, break follows: suprisingly (to me), if compile clang, may work (on os x does, on netbsd not). if gcc, returns a malloc: *** error object 0x7fff5fc01052: pointer being freed not allocated notice same program declaration @ head of block correct. edit : notice question documentation . realize doing describe unsafe have found no place explicitly shown. the "pattern" if(a) free(a); is not standard, or @ least shouldn't be. it's safe pass null free() , if adds nothing . i expect value of a undefined (not nu

Send a string on Android with HttpPost without using nameValuePairs -

i looking information how can send information using httppost method on android, , see this: httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(posturl); list<namevaluepair> params = new arraylist<namevaluepair>(); params.add(new basicnamevaluepair("name","var1")); params.add(new basicnamevaluepair("name2","var2")); httppost.setentity(new urlencodedformentity(params)); httpresponse resp = httpclient.execute(httppost); httpentity ent = resp.getentity(); the problem cant that, because have connect resource receive string xml format. any idea how can send string without using list<namevaluepair> have tried using stringentity ? above code can updated use stringentity , following resulting code: httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(posturl); httppost.setentity(new stringentity("your string")); httpresponse resp = htt

Doesn't SVG support auto width and height for images? -

in html image element can created without dimensions specified. have intrinsic width , height: <img src="me.jpg" alt=""> however, in svg image without dimension attributes have 0×0 size, prevent width , height must specified ( as in example ): <image xlink:href="me.jpg" width="64" height="64" /> can svg image forced take it's original width , height (without adding corresponding attributes, of course)? i'm curios inline svg inside html, if matters. the svg 1.1 specification requires width , height attributes <image> element. browsers today implement that, answer not yet. leaving attributes off means default value of 0 used, has effect of making image invisible. however, autosizing of images being added svg2, see https://svgwg.org/svg2-draft/struct.html#imageelement . means you'll able want in not distant future.

c++ - no-throw exception guarantee and stack overflow -

there several special functions guarantee not throw excpetions, e.g.: destructors swap method consider following swap implementation, stated in this answer : friend void swap(dumb_array& first, dumb_array& second) { using std::swap; swap(first.msize, second.msize); swap(first.marray, second.marray); // if stack overlow occurs here? } it uses 2 swap functions - integer , pointer. if second function cause stack overflow? objects become corrupted. guess not std::exception , kind of system exception, win32-exception . cannot guarantee no-throwing, since we're calling function. but authoritative sources use swap it's ok, no exceptions ever thrown here. why? in general cannot handle running out of stack. standard doesn't happens if run out of stack, neither talk stack is, how available, etc. oses may let control @ time executable built or when run, of irrelevant if you're writing library code, since have no control of how

character encoding - replace \n to new line in string with php -

i want replace "\n" characters new line in string using php, : string 'foo\n\nbar' to string 'foo bar` anybody have idea ? thanks. use str_replace('\n', php_eol, 'foo\n\nbar'); <?php header('content-type: text/plain'); $string = 'foo\n\nbar'; $string = str_replace('\n', php_eol, $string); echo $string; ?> shows: foo bar

Execute multiple commands in a bash script sequentially and fail if at least one of them fails -

i have bash script use execute multiple commands in sequence , need return non-zero exit code if @ least 1 command in sequence returns non-zero exit code. know there wait command i'm not sure understand how use it. upd script looks this: #!/bin/bash command1 command2 command3 all commands run in foreground. commands need run regardless of exit status previous command returned (so must not behave "exit on first error"). need gather exit statuses , return global exit status accordingly. just it: exit_status=0 command1 || exit_status=$? command2 || exit_status=$? command3 || exit_status=$? exit $exit_status not sure of statuses should return if several of commands have failed.

java - Hiding and showing Eclipse view programmatically -

i showing , hiding eclipse view code below. works eclipse 3.3, eclipse juno (version 4.3) it's not showing first time showing when fire event second time. iworkbenchpage page = platformui.getworkbench().getactiveworkbenchwindow() .getactivepage(); page.showview(userview.id); page.hideview(page.findview(userview.id)); is come across situation before? i not sure why not getting first time. check see if dont have null pointer errors when fire first time. platformui.getworkbench().getactiveworkbenchwindow().getactivepage() can return null if workbench not yet loaded.