Posts

Showing posts from March, 2013

swing - Java basic if/else statement state change -

please see attached code below , question @ end. class events extends jframe{ private jlabel label; private jbutton button; public events() { setlayout(new flowlayout()); button = new jbutton("click text"); add(button); label = new jlabel(""); add(label); event e = new event(); button.addactionlistener(e); } public class event implements actionlistener { public void actionperformed(actionevent e) { int x = 0; if (x == 0) { label.settext("the new label"); system.out .println("setting x 0 , label display label"); x = 1; system.out.println(x); } else { label.settext("newerer label"); system.out.println("i reached else segment"); x = 0; system.out.pr

javascript - JavasScript function undefined -

i've got html element declared so: <div id="taskimage" runat="server"> <a href="javascript:void(0);" onclick="switchviews('div<%# eval("proid") %>', 'one');"> <img id='imgdiv<%# eval("proid") %>' alt="click show/hide tasks" border="0" src="..."/> </a> </div> and javascript function switchviews declared post-html such: function switchviews(obj, row) { var div = document.getelementbyid(obj); var img = document.getelementbyid('img' + obj); if (div.style.display == "none") { div.style.display = "inline"; img.src = "../../images/icons/delete.png"; } else { div.style.display = "none"; img.src = "../../images/icons/add.png"; } } when click on html element, thrown js error saying "object

javascript - AngularJS: Event callback doesn't fire on google maps native map marker -

i've forked angularui's uimap directive in order swap infowindow infobox , add markerclusters . i've made extensive updates uimap -> icmap; notably moved directive logic out of controllers, making uimap "master" directive). i've got working, except clicking native mapmarker doesn't open infobox. i think reason i'm not binding click event native mapmarker ( ic-map.js:163 ). before re-organised uimap had added icmapinfobox directive in map.js . open event registered/triggered by: ui-event="{'map-click':'openmarkerinfo(marker)'}" which called openmarkerinfo() defined in controller (copy/paste repo: github gist ). however, when click native mapmarker, nothing happens , no errors in console (but other events still fire properly). original plunk simplified plunk (removed markerclusters) in both plunks, problem lies in ic-map.js (first file in list) map.json data file angular.js , angular-ui.js , , inf

parameters - Specify monitor when opening file. (.bat) -

the following .bat file below opens 2 text files overlaying them, i'm wondering if it's possible define specific display source, or if can assist in providing correct parameters. @echo off start /max /wait notepad.exe c:\test\screen1.txt start /max /wait notepad.exe c:\test\screen2.txt what i'm trying get: @echo off start /max /wait notepad.exe c:\test\screen1.txt "monitor1" start /max /wait notepad.exe c:\test\screen2.txt "monitor2" so results trying receive screen1.txt opens on monitor1, , screen2.txt on monitor2. unless application you're launching has command-line switch it, there's no easy way specify on monitor display window. far i'm aware, neither start nor notepad supports such switch. closest solution i've found move window after it's open. and moving window no easy task, either. see this post other options. here's batch script compose , link c# app on fly handle window moves. @echo o

jquery - How to best update a text file on change -

i have jquery script on page that's coming together, code , people here, , i'm stuck @ point need call part of larger function. i'm not sure how break multiple functions think. runs correctly when create dynamic input fields , totals amount fields totals box, if don't create new input boxes don't part need total these inputs. here sample of have far comment in code need help: http://jsfiddle.net/a3dnr/ // ** need call part when text entered/changed in of 'amount' fields ** var total = 0; $('input[name^="amount"]').each(function () { total += parseint(this.value, 10) || 0; if (this.value.length === 0) this.value = 0; }); $('#totals').val(total); the code block calculates totals inside click handler add new row button it'll called when button pressed. need move outside of click handler. check fiddle . i've converted function following function updatethetotal(){

vba - Updating the text displaid in MACROBUTTON in MS Word -

i using macrobutton in vba have field value calculated accessing other system, , @ same time, want able double-click on field specify settings used retrieve data other system. the whole macro stuff works fine can not figure out how change label on macrobutton. typically macrobutton looks { macrobutton macro_name label {some_arg}{some_arg2} } i tried accessing selection.fields(1).code.text , doing regexp replace 'label' else not work, i.e. either lose args or screw label. any advice issue, or perhaps suggestion of other type of field use achieve this? wouldn't mind using docvariable these can not respond clicks , carry arguments? you should able this: sub testit1() dim strtext string dim strlabel string dim strnewlabel string strlabel = "chew" strnewlabel = "devour" ' replace field code values in first field change label strtext = activedocument.fields(1).code.text activedocument.fields(1).code.

datetime - What's wrong with this python timezone conversion? -

i want convert datetime us/eastern timezone budapest/europe timezone way: import pytz datetime import datetime et = pytz.timezone('us/eastern') cet = pytz.timezone('europe/budapest') time = datetime(2013, 04, 18, 0, 0, tzinfo=et) newtime = time.astimezone(cet) this results newtime being: datetime.datetime(2013, 4, 18, 7, 0, tzinfo=<dsttzinfo 'europe/budapest' cest+2:00:00 dst>) , should 2013,04,18,6,0 according time.is , timeanddate.com converters. do wrong ? this because of daylight saving time issue. time passed datetime in et , not edt , hence result. take @ pytz documentation, preferred way use localize method, rather passing tzinfo . you'll expected result if amend code use following line: time = et.localize(datetime(2013, 04, 18, 0, 0))

html - Add/remove unordered lists based on screen resolution with jQuery -

i have section need show content in 1 4 columns based on screen resolution. example, if resolution 320 pixels wide, should display 1 ul , resolution of 1200 pixels wide, should display 4 columns. the problem content have inside it, since have redistribute content equally in each visible column. html have looks this: <ul class="projectslist"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <ul class="projectslist"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <ul class="projectslist"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <ul class="projectslist"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> the css looks this: .p

c++11 - What to do if tgamma() function is not defined? -

i trying use tgamma() standard library. when try compile, error message: call undefined function tgamma i have directive #include <cmath> . use embarcadero c++ builder xe3, claims support c++11 standards. problem, , how fix it? boost contains tgamma function . #include <boost/math/special_functions/gamma.hpp> ... double rootpi = boost::math::tgamma<double>(0.5); of course, can switch different compiler, gcc .

sql server - Using SSPI, how to make my webapp NOT connect to local SQL Express? -

yep - read right! want make web-application not connect local sql server express (2008r) database! i created domain user account web-application, , added user domain (ad) group. in local sql server instance, created login ad group . user account mentioned absolutely in sql database. then in local iis, changed app-pool site use account created. when browse local site in browser, voila! connects database. okay, go ad , remove user account ad group. iisreset. browse local site in browsser, voila!? connects database. huh? how connecting? using [integrated security=sspi][2] , authentication ought made via account being used application pool. so, since doesn't belong group has access sql database, shouldn't fail? how can make fail? maybe connecting other windows authentication? okay, logins server's instance are: mydomaingroup (without app-pool's user account) mydomainadminaccount sa nt authority\network service (necessary everything, even sql

regex - Regular expression, replace between "<" and ">", php -

i'm weak in regular expressions. i need replace < , > (and anything between) new content. this have: $key = preg_replace('/<.*>/', '', $key); my little string <5> should my little string . my little string <96> should my little string . what did wrong? the following works if supply string instead of $key : preg_replace('/<.*>/', '', 'my little string <96>'); what value of $key ?

sql server - Table data into Pivot -

an accounting table has sample data shown below: (there more acctgheads shown here) +-------+-----------+--------+-----+ | loan | acctghead | amount | d_c | +-------+-----------+--------+-----+ | 1 | principal | 10000 | d | | 1 | principal | 500 | c | | 1 | cash | 10000 | c | | 1 | cash | 500 | d | | 2 | principal | 5000 | d | | 2 | cash | 5000 | c | | 2 | cash | 300 | d | | 2 | principal | 300 | c | | 1 | intdue | 50 | d | | 1 | intincome | 50 | c | +-------+-----------+--------+-----+ the desired ouput is: +------+-------------+-------------+--------+--------+----------+----------+-------------+-------------+ | loan | principal_d | principal_c | cash_d | cash_c | intdue_d | intdue_c | intincome_d | intincome_c | +------+-------------+-------------+--------+--------+----------+----------+-------------+-------------+ | 1 | 10000 | 500 | 500 | 10

javascript - Updating Div on Parent Page, preferably by use of jQuery -

i've used jquery's .html() function update content before, has been inside .ajax() function, example: $.ajax({ padding : 15, type : "post", cache : false, url : "anypage.php?page=ajax", data : $(this).serializearray(), success: function(data) { $("#div").html(data); } }); problem is, in order utilize tinymce, had open in fancybox inside of iframe, ran problem of posting data, solved submitting form php $_get url (pretty sure that's not it's called), , closing fancybox: <? if($_get['page'] == "x"){ $_session["x"] = $_post['x']; echo '<script type="text/javascript"> parent.$.fancybox.close(); </script>'; die();} ?> that passes post variable session variable, can call inside main page. problem is, i'd refresh div on main page, , encountering problems. i don't think can

Why do class functions in php not need semicolons at the end? -

for example... public function processrowset($rowset, $singlerow = false){ $resultarray = array(); while($row = mysql_fetch_assoc($rowset)){ array_push($resultarray, $row); }; if ($singlerow === true){ return $resultarray[0]; }; return $resultarray; } ...and next line continues without issue when first starting oop php, made error of putting semicolon @ end , took me hour figure out wrong. thanks help! the difference between statements , expressions: if-statements, while-statements, functions, , on statements not need semicolon-terminated. actual commands expressions (i.e $foo = bar() ). standalone expressions require semicolons, since don't have braces signify expression ends. php borrows syntax c.

code generation - Equivalent of comma operator in Java? -

i trying source transformation on java code results in code every expression, method called if expression evaluated. (the use case simplistic line coverage measure. i've done sort of thing before in javascript: <my-expression> becomes (covered("path/to/file.js", 12), <my-expression>) or something, 12 line number of expression). java doesn't have comma operator. thought wrapping expressions in method call, e.g. covered function declared public static <t> t covered(string file, int line, t expr) , return third argument, write covered("path/to/file.java", 12, myexpression()) doesn't work expressions have type void . is there easy way accomplish this? evil code okay; generated code. (i see problem, now.) the context in java void expression can legally occur when statement expression, or 1st or 3rd part in classic for statement. so: if expression used expression statement: covered(...); <my-expression>;

c# - Dwolla oauth access token in windows app -

i creating windows 8 metro app having trouble getting oauth2 access token. can temporary code code fine: uri requesturi = new uri(string.format(auth_url + "?client_id={0}&response_type=code&scope={1}&client_secret={2}&redirect_uri={3}", client_id, string.join("|", scopelist.toarray()), client_secret, webauthenticationbroker.getcurrentapplicationcallbackuri().absoluteuri)); webauthenticationresult result = await webauthenticationbroker.authenticateasync(webauthenticationoptions.none, requesturi); but when try use code permanent access token, either gives me internal server error (500) or times out. gives me 500 when don't have redirect_uri, keep in. otherwise request times out no response code: private const string token_url = "https://www.dwolla.com/oauth/v2/token"; uri requesturi = new uri(string.format(token_url + "?client_id={0}&client_secret={1}&grant_type={2}&code={3}&redirect_uri={4}", c

osx - Connect to external subversion repository via mac and host a xcode project -

i have made free private subversion repository @ assembla.com. want host project repository or in layman terms want put xcode project in repository colleague able use project @ own place. want setup on mac. know have use terminal , put commands not know procedure after setting external subversion repository. please explain me steps , list tools needed connect repo mac? (so colleague can use too?) you need third-party subversion management tools. prefer sourcetree can read question: https://stackoverflow.com/questions/899/best-subversion-client-for-mac-os . online code repository provide address clone/push. paste subversion tools tool clone automatically. that's quite easy after read each site's instruction. ps: command line not must since there's many nice gui tools. use command line advance functions or shell scripts.

php - How to display appending data without refresh in tree -

Image
this tree view i have done when right click tree name(for example ,asset, non current , shah) , click add head there come jquery dialog form , add head code , head name , saved in mysql database using codeigniter frame work in php. basically , created subhead under head. i need when after submitting, display subhead under head without refresh tree. example , if create subhead under asset append subhead after "104-kamrul" without refresh , display without change. how can solve it, please suggestions? i think need ajax make need, use specific class each tree parent example: <div class="parent-1"> <div class="child-1"></div> <div class="child-2"></div> </div> <div class="parent-2"> <div class="child-1"></div> <div class="child-2"></div> </div> now load need following parents classess: $('.parent-1').children(&#

java - Highlight image portion thats being clicked -

verses of book http://i35.tinypic.com/fne1iu.jpg i have images of holy quran. each image has different verses (one complete sentence.) verses in 1 line, in 2 , in 3 lines. please view attached image. if user clicks on verse 4, complete verse should highlighted (draw overlay on verse opacity low, displays if verse highlighted.) how should this? how should verse selected. android has different devices screen, , different resolution. big som small etc etc. is possible ? note: have images, not text. in case suggest following: create layout consists of separate verse images , use image selector hilight images.

Opencart Iinvoice Currency -

hi there i'm facing problem opencart 1.5.5.1 . the currencies i've set working checkout process don't want changed. after order , i'm going print invoice need change currency fixed 1 (usd of course) coz the forwarder need invoice in usd fot international shipments. the ideal way switch between checkout currency , usd when generating invoice printed. i've found , modified vqmod work current opencart version <modification> <id><![cdata[invoice in base currency]]></id> <version><![cdata[1.0.0]]></version> <vqmver><![cdata[]]></vqmver> <author><![cdata[abhishek tiwari]]></author> <file name="admin/controller/sale/order.php"> <operation> <search position="replace"><![cdata['price' => $this->currency->format($product['price'] + ($this->config->get('config_tax')

mysql - Unable to obtain JDBC connection from datasource -

i trying run following command in gradle , gave me following error : c:\gsoc\mifosx\mifosng-provider>gradle migratetenantlistdb -pdbname=mifosplatfor m-tenants listening transport dt_socket @ address: 8005 :migratetenantlistdb failed failure: build failed exception. * where: build file 'c:\gsoc\mifosx\mifosng-provider\build.gradle' line: 357 * went wrong: execution failed task ':flywaymigrate'. > unable obtain jdbc connection datasource * try: run --stacktrace option stack trace. run --info or --debug option more log output. build failed total time: 13.843 secs the script file here , line no. of error shown 357 dont know why showing me error. incorrect configuration in mysql server please me out here: script: task migratetenantlistdb<<{ description="migrates tenant list db. optionally can pass dbname. defaults 'mifosplatform-tenants' (example: -pdbname=somedbname)" def filepath = "filesystem:$projectdir&quo

sql - Oracle PLSQL merge records within temporary table -

i have procedure in plsql fills temporary table. data looks following: buyer_name quantity amount ------------------------------- john 10 1200 john 12 1310 alan 15 1450 alan 10 1200 john 20 2400 i need sum quantities , amount each buyer, remove existing data , fill table again such each buyer name comes once total quantity , amount. i know can done if create temp table , transfer data through it. however, is there way can merge records within same temporary table (and within same session)? it sounds problem here initil pl/sql procedure fills table. why not modify well? suspect answer makes use of pl/sql -- if so, make every effort convert sql instead, or turn pipelined function can select , aggregate output of. that aside, aggregate result different table. assume these global temporary tables, there not overhead in doing direct path insert gtt more efficient modifying table in place.

Getting illegal character range in regex :java -

i have simple regex pattern verifies names. when run illegal character range error. thought escaping "\s" allow space compiler still complaining. public boolean verifyname(string name) { string namepattern = "^[\\p{l}]++(?:[',-\\s][\\p{l}]++)*+\\.?$"; return name.matches(namepattern); } and error think shouldn't occurring since name might contain anny of these [',-\\s] so not understanding? you can't have range "from , whitespace". perhaps meant escape - ? \s not space, it's [ \t\r\n\v\f] (space, tab, carriage return, newline, vertical tab or form feed). things work: "[ ',-]" "[',\\- ]"

winforms - When debuging the window doesn't appear -

`using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.net.sockets; using system.net; using system.threading; namespace server_chat { class server { private static int myprot = 10000; private static byte[] buf2 = new byte[1024]; private static socket serversocket; private static string message2; /// <summary> /// server socket /// </summary> public void server_run() { iphostentry iphost = dns.resolve(dns.gethostname()); ipaddress ip = iphost.addresslist[0]; serversocket = new socket(addressfamily.internetwork, sockettype.stream, protocoltype.tcp); serversocket.bind(new ipendpoint(ip,program.form1.localport)); serversocket.listen(10); program.form1.myscan_box = "启动监听成功 !!"; thread mythread = new thread(listenclientconnect)

term - Calculating B and |V| in naive bayes text classification -

i found link multinomial naive bayes classifier multinomial naive bayes link how calculate b' or |v| ? the page said number of terms in vocabulary. in example, how 6 b ? counting of term? "chinese", "beijing", "shanghai", "meacao", "tokyo", "japan" one more question, if new term appear in testing document? example, in doc 6 appears "bangkok" or new word never appear before. how count probability of new term ? you right. it's total number of words in vocabulary, since there can 1 entry term in vocabulary.

layout - Android: from surfaceview back to the menu -

i making simple game in draw set of bitmaps on canvas on surface view.. in main activity have linear layout have designed button. in onclick of button write: setcontentview(new surfaceviewclass(this)); it works fine...it opens surfaceview play game etc.. want re view button started mean when game on want menu reappear.. have tried calling void like main.menu(); but app crashes.. please help. make new activity class , write in oncreate() method of it setcontentview(new surfaceviewclass(this)); and in previous activity create intent , start new activity when button clicked e.g ....// onclick method of btn on old activity { intent i=new intent(oldclass.this, newclass.class); startactivity(i); } ....

k-combinations in Python 3.x -

what efficient way generate k-tuples k-combinations given python set? there appropriate built-in function? tells me should possible two-line loop. p.s. did conduct search , found various entries topic "combinations lists, etc in python", proposed solutions seem rather 'un-python'. hoping mind-blowing, idiomatic python expression. itertools has of types of functions: import itertools combination in itertools.combinations(iterable, k): print(combination)

linux - Swap unix compiler flags with a shorter one -

i've been running ns3 sumulations in linux , every time compiled had type g++ -wall -o simulacija simulacija.cc -dns3_assert_enable -dns3_log_enable `pkg-config --libs --cflags libns3.16-core-debug libns3.16-network-debug libns3.16-applications-debug libns3.16-internet-debug libns3.16-point-to-point-debug libns3.16-point-to-point-layout-debug libns3.16-csma-debug libns3.16-csma-layout-debug libns3.16-topology-read-debug libns3.16-wifi-debug` is there way shorten flags eg: g++ -wall simulacija.cc -o simulacija -my_params thank you the gcc compiler supports @ notation embed sequence of arguments inside file. read near end of gcc overall options page. so put in file params.args following lines -wall -i /usr/local -dns3_assert_enable -dns3_log_enable -o and invoke g++ @params.args simulacija.cc -o simulacija you have makefile rule build params.args (e.g. pkg-config etc...) actually, time learn how use gnu make . notice @ option not understoo

Is there a limit to twitter accounts you can register in iOS? -

i trying implement login twitter in app. want user choose twitter account wants login with. want know if there limit twitter accounts 1 can register in settings app, can decide on ui? why not let app use accounts stored inside twitter client ? i have 7 twitter accounts stored twitter client , can use of them iphone app

android - How to re-create activity each time the tab is visited -

i have tabactivity , , want re-create activity tab visited(calling content of oncreate() each visit) . how ? you use .... this.finish(); // instance of tabactivity .... close current 1 , create new intent using intent intent = new intent(this, tabactivity.class); intent.setflags(intent.flag_activity_new_task) startactivity(intent); edit: intent.flag_activity_clear_top seems in fact work will not work, because though intended bring existing activity is brought front (without recreation). check out this more. cheers!

haskell - Weeding duplicates from a list of functions -

is possible remove duplicates (as in nub) list of functions in haskell? basically, possible add instance (eq (integer -> integer)) in ghci: let fs = [(+2), (*2), (^2)] let cs = concat $ map subsequences $ permutations fs nub cs <interactive>:31:1: no instance (eq (integer -> integer)) arising use of `nub' possible fix: add instance declaration (eq (integer -> integer)) in expression: nub cs in equation `it': = nub cs thanks in advance. ... further, based on larsmans' answer, able this > let fs = [addtwo, double, square] > let css = nub $ concat $ map subsequences $ permutations fs in order this > css [[],[addtwo],[double],[addtwo,double],[square],[addtwo,square],[double,square],[addtwo,double,square],[double,addtwo],[double,addtwo,square],[square,double],[square,addtwo],[square,double,addtwo],[double,square,addtwo],[square,addtwo,double],[addtwo,square,double]] and this > map (\cs-> call <$> cs <*> [3,4

trigonometry - how to implement trigonometric expressions using a programming language? -

*expression: -(sqrt((a0+a1 cos wt +a2 cos 2wt )^2 +(a1sin wt +a2 sin 2wt)^2 - ـــــــــــــــــــــــــــــــــــــــــــــــــــــــــــــ - sqrt ((1+b1cos wt+b2 cos 2wt)^2 +(b1 sin wt+b2 sin2 wt )^2 *variables: - a0=.2 - a1=1.2 - a2=a0=.2 - b1=1.6 - b2=.8 - f=32khz *question: i supposed use programming language (not matlab) implement exp , observe o/p signal .... how can , language if possible? in c#, can use system.math , believe has every function need: abs exp sin cos sqrt ... lot of other methods ... data type depends on accuarcy need, can use decimal data type. example: decimal a0 = 0.2; decimal a1 = 1.2; decimal result = math.cos(a0) * a1 - math.sqrt(a1); basically, programming languages have sort of math library, should contain functions.

Session.cookie_domain in php.ini -

i have been reading as possible php.ini file , have found nothing whether or not bad/dangerous not set session.cookie_domain in php.ini. we in production environment , not set. are there security issues not setting this. cookies appear working well, no real issues. the php.ini file looks this: session.cookie_domain = this configuration directive allow restrict subdomains, session cookie valid. since empty, you're accepting session cookies domains - so, it's normal behavior working subdomain. this useful.

Uploadify v3: add a hidden input with the uploaded file's name -

i'm using uplodify v3 , want add hidden input uploaded file's name in it's value. how can that?! try with 'onuploadsuccess' : function(file, data, response) { $('input#yourhiddeninputid').val(file.name); } i tried , work.

javascript - Dynamically updating dictionary on text entry -

lets have text box entering text. under have div displays entered text, highlighting words based on whether have been correctly spelt or not, follows: var validity = { "a": true, "aa": false, "aaa": false }; document.getelementbyid("edit").addeventlistener('keyup', function () { text_array = this.value.split(" "); var output = []; (var = 0; i< text_array.length; i++) { output.push('<span class="' + group(validity[text_array[i]]) + '">' + text_array[i] + '</span>'); } document.getelementbyid("text").innerhtml = output.join(" "); }); http://jsfiddle.net/barra/ac9nt/12/ i have php script can passed array of words , replies via json conveying if valid or not. i wish make request script in dynamic fashion text entered. however, ajax call php script asynchronous , before first reply server, new request script

testing - Test with older versions of Firefox -

i had situation user saw error on browser firefox. might older version. there way test multiple versions of firefox without downloading bunch of them? yes can this. have gone through multiple links find solution. example want install firefox 4.0 want keep 3.6 need install firefox 4.0 using custom installation option, in uniquely named folder — /program files/firefox 4.0/ — don't let 4.0 run after installation procedure complete. create new profile exclusively 4.0 beta version , create desktop shortcut -p "profile" appended target launch profile. helpful links link1 , link2 . during search have found 1 software utilu may useful, speaking have not tried yet, try later.

slidingdrawer - android-how to make a layout on top of every thing and not transpranet -

Image
i working on bottom toolbar android forking slidinguppanel at: https://github.com/umano/androidslidinguppanel i want make on top of every thing not defined in sliding panel. when slide up, if there behind it, layout acting it's transparent. how can fix act real toolbar ? before sliding : after sliding : source : http://www.4shared.com/rar/jea2gbzy/androidslidinguppanel-master.html set background button , change text color. dont think transparent text has same color , button has transparent background default.

wordpress - memory_limit = 256M but still get 'Fatal error: Allowed memory size of 33554432 bytes exhausted' -

i have used php.ini set memory limit 256m, , working checks out phpinfo.php (local , master). (note: have tried setting in .htaccess file, crashes whole admin backend) i using wordpress 3.6 , woocommerce version 2.0.13 i keep getting 'fatal error' message, example if try add pages menu, or turn on other plugins. have found can deactivate woocommerce can add items menu turn on again, that's kind of annoying, , i'm going need add few more plugins. what don't understand have more 33554432 bytes. have restarted apache server? in order see changes made in php.ini have restart server. it's seems server stills have 32mb, because 32mb = 33554432 bytes greetings.

crystal reports - Conditional Formatting Char vs Numeric in String -

i'm trying simple formatting in crystal reports like: string: john smith 212-212-2121 where a-z 1 color , 0-9 different color i tried if numerictext ({mystring}) crred else crnavy any ideas on how ? as far i'm aware, can't have multiple colors in single string. you've got couple of ways of doing this, they're both kind of clunky, , string as-is need either parsed or reformatted. split string 2 separate formula fields. color name field appropriate color, , phone number field appropriate color, , stick both of these fields textbox field. should crudely drawn example: [ [name formula field] [phone formula field] ] change string use html, , format textbox use text interpretation of html. can't work 100%, though, because crystal reports supports html . in case, new string like: < font color='red'>john smith< /font> < font color='blue'>212-212-2121< /font>

javascript - After jquery .load() I cannot operate with script on images -

after clicking on menu item data loaded "#content". want use function makegray() turns pictures class "gallerylist" grayscale , saturating them after pointing mouse. unfortunately, code below doesn't work until second click: $(document).delegate(element, 'click', function() { $('#content') .stop() .animate({opacity: 0}, 'fast', function() { $(this).load('subpage.html', function() { makegray('.gallerylist'); }) .animate({opacity: 1}); }); }); edit after kevin , daniel posts: there code of script making pictures gray. problem how wait until images loaded , run script.

java - OnClickListener not functioning as expected -

i have onclicklistener @ line: massistupdatebutton = (button) findviewbyid(r.id.assist_instr_btn); massistupdatebutton.setonclicklistener(this); which supposed call: public void onclick(view v) { if (v == massistupdatebutton) { but not seem reach point in code. i've looked on several times , cannot seem figure out i've done wrong. any input appreciated. source: import java.io.ioexception; import java.io.inputstream; import java.util.arraylist; import javax.xml.parsers.parserconfigurationexception; import org.xml.sax.saxexception; import android.annotation.suppresslint; import android.annotation.targetapi; import android.app.activity; import android.app.alertdialog; import android.app.notification; import android.app.notificationmanager; import android.app.pendingintent; import android.content.contentresolver; import android.content.contentvalues; import android.content.context; import android.content.dialoginterface; import android.content.intent

c# - How to make last row in a dataGridView on a Windows Form to be displayed all the time while still allowing the remaining rows to scroll -

i have datagridview has 30 rows in , last row of contains sum of cells in particular column. freeze last row has sum while still allowing remaining rows scroll. datagridviewpaymentsreceived.rows[datagridviewpaymentsreceived.rows.count-1].frozen = true; the above code freezes entire datagridview , doesn't allow me scroll on it. can suggest me way keep last row displayed time when scroll on datagridview? the easiest solution create second datagridview directly below first. manually populate single row want displayed every time first datagrid binds data. to make appear totally seamless, don't forget hide column headers in 2nd datagrid: datagridview2.columnheadersvisible = false; see this answer more info.

php - Issue: Images Cached on Server? -

i have seen error seems extremely weird me. http://www.shrimadrajchandramission.org/grace/downloads/wallpapers/images/download.php?wp=srm-wallpaper-36-highres.jpg on browser, above link shows 8.4 mb download file size http://www.shrimadrajchandramission.org/grace/downloads/wallpapers/images/download.php?wp=srm-wallpaper-36-highres.jpg& while 1 shows 15.3 mb download file size. i want understand if server caches in manner, because had hard disk replaced have installed browsers on fresh os, still shows old filesize (and when download it, half of corrupt-gray color). download.php on server has these headers set: header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('last-modified: '.gmdate ('d, d m y h:i:s', filemtime ($file_name)).' gmt'); header('cache-control: private',false); header('content-type: image/jpg'); header('content-disposition: attachment; filenam

java - Trying to figure out how to minimize ehcache logs (n.s.e.constructs.web.filter.Filter) -

i'm new using ehcache , i'm guessing these debug messages have been receiving coming open-source project using. logs growing wildfire , wish find way minimize them. these types of log messages receiving each time page reload occurs. 08:33:19.626 [http-8080-6] debug n.s.e.constructs.web.filter.filter - request headers: host -> my.application.com: connection -> keep-alive: cache-control -> max-age=0: accept -> */*: if-none-match -> w/"17227-1367868490000": if-modified-since -> mon, 06 may 2013 19:28:10 gmt: user-agent -> mozilla/5.0 (macintosh; intel mac os x 10_6_8) applewebkit/537.36 (khtml, gecko) chrome/28.0.1500.95 safari/537.36: referer -> my.application.com/f/u25l1s4/normal/render.up: accept-encoding -> gzip,deflate,sdch: accept-language -> en-us,en;q=0.8: cookie -> sess29f919b3f2c84b3e362ffe4e56d595bd=4b4e6edlaadlhfa6gu8lj66u11; __utma=90227742.1696363642.1351091807.1375806239.1376082782.23; __utmz=90227742.1375806239.22.5.

html - filling a blank between two bars - css -

i'm trying move blue bottom bar paste top blue bar, can't find how, please? screenshot: http://hpics.li/1b82a29 fiddle html code : <%@ page pageencoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!doctype html> <html> <head> <script language="javascript"> var timeforhide; function showmenu(menuid) { cleartimeout(timeforhide) document.getelementbyid('menu').style.visibility = 'visible' } function hidemenu(menuid) { timeforhide = settimeout("didhidemenu()", 700) } function didhidemenu() { document.getelementbyid('menu').style.visibility = 'hidden' } </script> </head> <body> <div> <ul id="nav"> <li

PHP regex to include double backslashes in brackets -

so trying relatively simple php regex check wether string contains 1 of these characters: .,%$@/0123456789 want check wether contains double backslash (i don't want evaluate true if contains 1 backslash) , can't figure out how it. appreciated :) here using far: preg_match('/[.,%$@\/0-9]/',$string) i not sur how include '\\\\' double backslash. thanks in advance! you're looking character set or double backslash, right? so: preg_match('/[.,%$@\/0-9]|\\\\/',$string) where | means "or".

php - How to replace value inside an array? -

i have array shown below. array (size=2) '1s1' => array (size=8) 'order_id' => int 0 'item_id' => int 1 'special_desc' => string 'special xxx' (length=11) 'qty' => int 2 'price' => int 50 'amount' => int 0 'created_at' => int 1376580193 'updated_at' => int 1376580193 '1s2' => array (size=8) 'order_id' => int 0 'item_id' => int 2 'special_desc' => string 'special yyy' (length=11) 'qty' => int 3 'price' => int 150 'amount' => int 0 'created_at' => int 1376580193 'updated_at' => int 1376580193 if wanted replace "order_id" of both elements of array new value before saving database, array function or technique can use

java - Simulate the tossing of a coin three times and print out the percentage of cases in which one gets three tails -

attached problem: http://puu.sh/42qti/ea955e5bef.png in terms of code, have far the question asks "calculate simulated percentage of 3 tails," part stuck on. give me insight on progress next? public static boolean isthreetails(){ random rand = new random(); int numberoftosses = 3; int numberofheads = 0; int numberoftails = 0; for(int = 1; <= numberoftosses; i++){ int value = rand.nextint(2); if(value == 0){ numberoftails++; }else{ numberofheads++; } } if(numberoftails == 3){ return true; } else{ return false; } } double numtosses = 1000000; //choose whatever here double threetails = 0; for(int =0; < numtosses; i++){ if(isthreetails()){ threetails++;

javascript - Email not being generated or script not firing? -

this question exact duplicate of: character limit when generating email? 1 answer i have working generate email if "complainttextbox" contains more 30 characters email not generate.?? <script type="text/javascript"> function sendmail(customertextbox, addresstextbox, citytextbox, statedropdown, ziptextbox, modeltextbox, serialtextbox, referencetextbox, complainttextbox, warrentytextbox) { var customertextbox = document.getelementbyid(customertextbox).value; var addresstextbox = document.getelementbyid(addresstextbox).value; var citytextbox = document.getelementbyid(citytextbox).value; var statedropdown = document.getelementbyid(statedropdown).value; var ziptextbox = document.getelementbyid(ziptextbox).value; var modeltextbox = document.getelementbyid(modeltextbox).value; var serialtextbox = document.getelementbyid(se