Posts

Showing posts from September, 2012

java - How would I modify my code to search a multidimensional array diagonally from left to right and right to left? -

java - How would I modify my code to search a multidimensional array diagonally from left to right and right to left? - i have code searching multidimensional array left right , right left. what need search array top left bottom right,the top right bottom left, bottom left top right, , bottom right top left. what need alter in existing methods create new method want? // left right public static string findlefttoright (char[][]board, string word) { char[] letters = word.tochararray(); (int = 0; < board.length; i++){ (int j = 0; j < board[i].length; j++) { boolean found = true; (int k = 0; k < letters.length; k++) { if ((j+k >= board[i].length) || (letters[k] != board[i][j+k])) { found = false; break; }

ruby on rails - Looping two different array at same time -

ruby on rails - Looping two different array at same time - i have loop through 2 different arrays @ same time. let's have 2 arrays this: a1 = ["a","b","c","d"] a2 = ["e","f","g","h"] i want output this: a,e b,f c,g d,h i tried program, printing both arrays 2 times: a1 = ["a","b","c","d"] a2 = ["e","f","g","h"] a1.each |a| a2.each |b| puts a[0] puts b[0] end end loop through 1 array, , utilize current index element want in other array: a1.each_with_index |a, i| puts "#{a},#{a2[i]}" end ruby-on-rails ruby arrays loops hash

C++ splitting string? -

C++ splitting string? - this question has reply here: split string in c++? 64 answers i've been dealing c++ strings , wondering how can split article of string , info that's left. let's have string: a gold coin how can split article in case a separate string , other info contents different string in case gold coin? please note article can an , have no article. edit not trying split strings space token splitting special words string in status extracting pronoun article name , pronoun string. you can utilize .replace str.replace(str.begin()+1,str.end()1,1,''); the reference c++ string split

ruby - How to get width of an element with xpath Watir in pixels? -

ruby - How to get width of an element with xpath Watir in pixels? - i have problem getting width of "tbody" element xpath watir. have code: browser.element(:xpath , "//table[@onselectstart='return false']").tbody.tr(:index , 2).td.table.tbody.style "width" this code returns me "auto", fine because attribute must set "auto" positioned on web automatically, if firebug shows me width of element. can value in pixels? try (not tested): browser.element(:xpath , "//table[@onselectstart='return false']").tbody.tr(:index , 2).td.table.tbody.wd.size.width for more info see documentation element#wd, element#size , dimension#width. ruby xpath width element watir

php - Form validation using if array key exists -

php - Form validation using if array key exists - here html , php code have used: <?php require_once('include_function.php'); require_once('validation_functions.php'); $errors = array(); $message =""; if(isset($_post['submit'])){ $username = trim($_post['username']); $password = trim($_post['password']); if (array_key_exists('submit', $_post)){ } $fields_required = array("username","password"); foreach($fields_required $field){ $value = trim($_post[$field]); if(!has_presence($value)){ $errors[$field]= ucfirst($field). " cant blank"; } } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>single page submission</title> </head> <body> <?php echo $message;?> <?php echo form_error($errors)?> <form action="form_with_

java - Parse anonymous array from JSON result with Google HTTP Client Library -

java - Parse anonymous array from JSON result with Google HTTP Client Library - my rest service respons next data: [ { "name": "bart", "age": 10 }, { "name": "homer", "age": 42 }, { "name": "marjorie", "age": 34 } ] the result set array of objects want automatically parse google's http client library. hence created simpsonresult , simpson class: simpsonresult.java public class simpsonresult { private list<simpson> simpsons; public simpsonresult() { } public list<simpson> getsimpsons() { homecoming simpsons; } public void setsimpsons(list<simpson> simpsons) { this.simpsons = simpsons; } } simpson.java public class simpson { @key private string name; @key private int age; public simpson() { } public string getname() { homecoming na

Detecting CSS property value of a html element by JavaScript -

Detecting CSS property value of a html element by JavaScript - untill alert ok, if not executing. here programme stack. there way observe display property of div "bloc" or "none"? for(i=1;i<=10;i++) { alert("hamdun soft past job deleted"); if(document.getelementbyid(i).style.display=="block") document.getelementbyid(i).innerhtml="hamdun soft clear now"; } oh! kepp in mind div id=1 10, one's display= "block" , of 9 "none". did javascript program. need observe "block" one. tanks. the issue element.style.display work when element has inline style. need computed style: class="snippet-code-js lang-js prettyprint-override"> for(i=1;i<=10;i++){ var elem = document.getelementbyid(i); if((elem.currentstyle ? elem.currentstyle.display : getcomputedstyle(elem, null).display) == 'block') elem.innerhtml="hamdun sof

c++ - Why is 'insert' faster than 'append' in string padding? -

c++ - Why is 'insert' faster than 'append' in string padding? - i want padding string in c++, originally, adding \0 end of string directly. paddingstr = "test"; (int index = 0; index < 20000*1024; ++index){ paddingstr += '\0'; } then find several ways accomplish goal, , add-leading-zeros-to-string-without-sprintf padding-stl-strings-in-c c-can-setw-and-setfill-pad-the-end-of-a-string i want know method efficient. , compare them. string paddingstr = "test"; __int64 before_run_t = gettimems64(); string afterpadding = paddingstr.append(string(20000*1024, '\0')); cout << "the run time of append " << gettimems64() - before_run_t << endl; paddingstr = "test"; before_run_t = gettimems64(); paddingstr.insert(paddingstr.end(), 20000*1024, '\0'); cout << "the run time of insert " << gettimems64() - before_run_t << endl; paddingstr = "

mdx - How to return the LastDate as a measure -

mdx - How to return the LastDate as a measure - this expression: with fellow member [date].[calendar].[lastdate] tail( nonempty( [date].[calendar].members, [measures].[internet sales amount] ) ).item(0) fellow member [measures].[measurex] [date].[calendar].[lastdate].member_value select { [measures].[measurex] } on columns [adventure works]; the result this: how configure measurex returns lastly date in [date].[calendar] dimension? the formula of calculated fellow member cannot homecoming member; utilize iccube function ;-) ssas perhaps creating set of 1 fellow member might trick you. accessing fellow member done using notation: myset(0). hope helps. mdx

android - Upload base64 encoded image using HttPost and HttpClient -

android - Upload base64 encoded image using HttPost and HttpClient - i seek upload image (base64 encoded) alongside other values php webserver, takes info , farther processing. the folowing functions part of asynctask, executes request. i build postdata hand concatenating different values. the jsonurllook class helps me finding right url sending info to. verified it. correct. when seek execute created httppost response null. thought why is? private string getpostdata(string arraystring, string base64image, string boundary) { string remotemethod = "uploadpic"; string postdata = ""; // add together remote method name postdata += "--" + boundary + "\r\n"; postdata += "content-disposition: form-data; name=\"" + boundary + "[method]\"\r\n\r\n"; postdata += remotemethod; postdata += "--" + boundary + "\r\n"; postdata += "content-disposition

monotouch - How can I run my iOS project in Xamarin Studio? -

monotouch - How can I run my iOS project in Xamarin Studio? - i have created ios single view application on xcode. can open project in xamarin studio?if yes how? i have checked project directory created on xcode. shows .xcodeproj. in short, can't. i suggest go read on how create application using xamarin.ios @ http://developer.xamarin.com/guides/ios/getting_started/hello,_ios/ p.s. 1 time you've done trywhat can create single view application in xamarin studio , import storyboard create in xcode. monotouch xamarin-studio

html - CSS - individual background-image -

html - CSS - individual background-image - this question has reply here: background-image within div not showing up 2 answers i have next html code: <div class="avatar"></div> ... , next css: .avatar { background: url(img.png) no-repeat; background-position: 2px 5px; } but image won't show. how can prepare this? (and yes, searched years answer, nil found.) my entire code: <body onload="countdown()"> <div class="avatar"></div> <img src="..." class="logo" /> <div id="box"><b><u><?php echo $titel; ?></u></b> <br /><br /> <?php echo $text1; ?><br /><br /> lorem ipsum.. <span id="countdown" style="color: white"></span>lor

jsf - does not display the result (Java) -

jsf - does not display the result (Java) - hello trying figure out jsf (primefaces) , little goes viz. compiled war archive in maven seek run through glassfish, server starts in origin writing "artifact qwe-1.0-snapshot.war: server not connected. deploy not available." in late writes "artifact qwe-1.0-snapshot.war: artifact beingness deployed, please wait... artifact deployed successfully." seems normal, opened page in browser empty although in index.xhtm , pom.xml , web.xml link pastebin , should button styles connected in primefaces tell me if i'm doing wrong? here's screenshot of result in browser. link1 <p:button outcome="productdetail" value="bookmark" icon="ui-icon-star"> targets productdetail page. if not have productdetail.xhtml page @ currect path, index.xhtml page cannot resolve navigationcase outcome. thus, create page productdetail.xhtml , set same directory of index.xhtml. in additio

jsf 2 - Issue with JSF 2.2.4 in JBoss AS 6 -

jsf 2 - Issue with JSF 2.2.4 in JBoss AS 6 - 15:25:00,017 severe [config] critical error during deployment: : com.sun.faces.config.configurationexception: tag named passthroughattribute namespace http://xmlns.jcp.org/jsf/core has null handler-class defined anybody please suggest how resolve issue? stacktrace: 17:25:24,790 info [config] initializing mojarra 2.2.4 ( 20131003-1354 https://svn.java.net/svn/mojarra~svn/tags/2.2.4@12574) context '/app' 17:25:29,105 info [application] jsf1048: postconstruct/predestroy annotations present. managedbeans methods marked these annotations have said annotations processed. 17:25:29,268 severe [config] unable process annotations url, vfs:/d:/jboss-6.1.0.final/server/app/deploy/app.ear/appweb.war/web-inf/lib/primefaces-4.0.jar/meta-inf/faces-config.xml. reason: java.util.zip.zipexception: zip file empty 17:25:29,268 severe [config] : java.util.zip.zipexception: zip file empty @ java.util.zip.zipfile.open(native method) [:1.

mysql - Why won't my SQL results get printed in PHP site? -

mysql - Why won't my SQL results get printed in PHP site? - i'm having real problems code, have external server trying phone call , add together info single php info site. reason after reading loads on subject still cannot work. the next code below, , concept have in mind, reason, having no luck in getting work correctly? any help much appreciated: <html> <head> </head> <body> <?php // determine yesterday date_default_timezone_set('europe/london'); $m= date("m"); // month value $de= date("d"); //today's date $y= date("y"); // year value $yd = date('d', mktime(0,0,0,$m,($de-1),$y)); $ym = date('m', mktime(0,0,0,$m,($de-1),$y)); $yy = date('y', mktime(0,0,0,$m,($de-1),$y)); $yest = $yy.'-'.$ym.'-'.$yd; $cd =

image - Limit Color Palette using PHP -

image - Limit Color Palette using PHP - is there way limit image custom color palette of 15 colors (plus transparency)? adjust color palette of images specific set of colors using php functions. right loading images using imagecreatefrompng(), contain default rgb palette. have 4x4px image each desired color. i have tried using imagepalettecopy(), doesn't seem have effect. $palette = imagecreatefrompng(public_path() . "/assets/palette2.png"); $original = imagecreatefrompng(public_path() . '/uploads/test1.png'); $resampled = imagecreatetruecolor(5, 5); imagepalettecopy($resampled, $palette); imagecopyresampled($resampled, $original, 0, 0, 0, 0, 5, 5, imagesx($original), imagesy($original)); imagepalettecopy($resampled, $palette); thanks! i found next work excellently pure php. not sure how stacks performance-wise, provides desired results: $palette = imagecreatefrompng(public_path() . "/assets/palette.png&q

android - Show dialog before opening autoLink in TextView -

android - Show dialog before opening autoLink in TextView - i using android:autolink="web" in textviews convert urls clickable links. works great. since links user-generated want inquire user dialog beforehand, whether want openthis link. i haven't found anything, there way intercept click , show dialog before forwarding typical action_view intent? try add together textview properties like: <textview android:text="http://www.google.com" android:layout_width="wrap_content" android:layout_height="wrap_content" android:autolink="web" android:onclick="onurlclick" android:linksclickable="false" android:clickable="true" /> and override onclick method like: public void onurlclick(final view view) { alertdialog.builder builder = new alertdialog.builder(getactivity()); builder.setpositivebutton("yes", new dialoginterface.oncli

html - Bootstrap Image Responsive messed up on IE -

html - Bootstrap Image Responsive messed up on IE - i had been developing website using bootstrap , basically, have structure.. <div class="container"> <img src="~/content/theme/img/image.png" class="img-responsive" style="margin: 0 auto;" /> </div> it works on chrome , firefox when test on net explorer 9, image becomes enlarged, beyond image size itself. when used debug mode on ie (f12) , untick width:100%; setting under .img-responsive , returns normal. how should resolve this? i've tried few solution on here including adding .col-sm-12 image, still doesn't prepare on ie. since no reply has been posted, i'll pipe up. add together overrides stylesheet: .img-responsive {width: auto;} that, in conjunction max-width statement in bootstrap, should resolve issue. note bootstrap v3.2.1 reverted commit caused issue. github give-and-take bug #13996 html twitter-bootstrap interne

PHP using ruby returning output (using metainspector) -

PHP using ruby returning output (using metainspector) - i'm creating php page ssh phone call .rb (ruby) file. rb file require 'metainspector' page = metainspector.new("www.hln.be") puts page.image when creating php file next code (php): $cmd = "ruby facescrape.rb"; $last_line = system($cmd, $retval); echo $last_line . ' echo $retval; this returns value 1. however 2 things : when running same command in ssh, print page.image correctly. when alter rb file , instance set lastly line puts "test" this value returns correctly print correctly aboven php code. i don't why printing page.image works in ssh won't work using php code. tried using exec() instead of system() . thank in advance! kind regards, kurt colemonts php ruby linux

Netlogo : change patch color of one patch if orthogonal neighbors have the same color -

Netlogo : change patch color of one patch if orthogonal neighbors have the same color - i'm new netlogo , need help. i trying grow continuous patch of 1 color (green on black background). however, have black patch surrounded greenish patches. alter color of black patches green. i tried : ask patches [ if neighbors4 [pcolor = 55] [set pcolor 55] ] but gives me error, does ask patches [ if any? neighbors4 [pcolor = 55] [set pcolor 55] ] here code works leave black patches surrounded greenish patches : to setup clear-all set-patch-size 4 resize-world -50 50 -50 50 inquire patches[set pcolor black] grow-cell reset-ticks end grow-cell inquire patch 0 0 [ set pcolor 55 inquire neighbors [ set pcolor 55 ] ] repeat 45 [ inquire patches [pcolor = black] [ set pcolor [pcolor] of one-of neighbors4 ] ] end here ugly/barely clever hack. ask patches[ if mean [pcolor] of neighbors4 =

javascript - Safari Extension and (extension) reload button suddenly not working -

javascript - Safari Extension and (extension) reload button suddenly not working - i've got simple test extension pops alert. the problem extension (which installed) isn't working @ all. 'reload' button in extension builder isn't functioning either, though 5 minutes ago. i've restarted safari multiple times, no avail. any thought on earth happening here? javascript safari safari-extension

audio - how to combine different frequence into one .wav -

audio - how to combine different frequence into one .wav - i want creat .wav 12khz 13khz matlab.i know how create single frequence,but idont know how combine them 1 file. there simple command? class="lang-matlab prettyprint-override"> fs =44100; tonefreq1 = 12000; nseconds = 25; f1 = sin(linspace(0, nseconds*tonefreq1*2*pi, round(nseconds*fs))); tonefreq2 = 12100; nseconds = 25; f2 = sin(linspace(0, nseconds*tonefreq2*2*pi, round(nseconds*fs))); tonefreq3 = 12200; nseconds = 25; f3 = sin(linspace(0, nseconds*tonefreq3*2*pi, round(nseconds*fs))); tonefreq4 = 12300; nseconds = 25; f4 = sin(linspace(0, nseconds*tonefreq4*2*pi, round(nseconds*fs))); tonefreq5 = 12400; nseconds = 25; f5 = sin(linspace(0, nseconds*tonefreq5*2*pi, round(nseconds*fs))); tonefreq6 = 12500; nseconds = 25; f6 = sin(linspace(0, nseconds*tonefreq6*2*pi, round(nseconds*fs))); tonefreq7 = 12600; nseconds = 25; f7 = sin(linspace(0, nseconds*tonefreq7*2*pi, round(nseconds*

java - Tanuki Software Wrapper unable to be customized -

java - Tanuki Software Wrapper unable to be customized - i wrapping java application via tanuki software wrapper tanuki software wrapper making windows service , working fine , after want customize per documentation given on customizing application (windows). per documentation when run next command wrapperw.exe --customize --icon myicon.ico --splash mysplash.bmp --target myapp.exe --manufacturer "my organization name" --passthrough the next error come fatal | wrapper | 2014/10/29 13:23:45 | encountered fatal error in wrapper fatal | wrapper | 2014/10/29 13:23:45 | exceptioncode = exception_access_violation fatal | wrapper | 2014/10/29 13:23:45 | exceptionflag = exception_noncontinuable_exception fatal | wrapper | 2014/10/29 13:23:45 | exceptionaddress = 76ea4123 fatal | wrapper | 2014/10/29 13:23:45 | read access exception 4942f3b0 fatal | wrapper | 2014/10/29 13:23:45 | wrapper main loop status: fatal | wrapper | 2014/10/29 13:23:

c# - How to filter elements by a List item in linq? -

c# - How to filter elements by a List item in linq? - i have user belongs community specific role, classes of user, community, communityrole , communityroletype described bellow: public class user{ public int userid { get; set;} public list<communityrole> communityroles { get; set; } } public class community{ public int communityid { get; set;} public string name { get; set; } } public enum communityroletype{ type1, type2 } public class communityrole { public community community { get; set; } public communityroletype roletype {get; set; } } how get, list of users, subset of users belong specific community , assigned specific role?? edit: var userstype1 = users.where(usr => usr.communityroles.any(role => role.roletype == communityroletype.type1 && role.community.communityid == communityid)).tolist(); c# linq entity-framework-6

java - Multiple string method chained in single code -

java - Multiple string method chained in single code - i working on bit of code public class simplestringtest { public static void main(string args[]) { string ints="123456789"; system.out.println(ints.concat("0").substring(ints.indexof("2"),ints.indexof("0"))); } as per knowledge on java "when multiple methods chained on single code statement, methods execute left right" then, why bit of code throwing stringindexoutofbondsexception? thanks in advance, gpar because string s immutable. by invoking concat , not modifying ints , creating new string . therefore time invoke ints.indexof("0") , ints still equal former value , indexof invocation returns -1 , in turn outer bound of substring . try counter-example mutable charsequence such stringbuilder : stringbuilder ints = new stringbuilder("123456789"); system.out.println(ints.append("0").substring(ints.inde

postgresql - Automatically allow access to tables in postgres from a user -

postgresql - Automatically allow access to tables in postgres from a user - i have postgresql database web application. database owned particular user on system, let's foouser . owner, user has total permissions on database. the server has user, let's webappuser , user under application server runs. instead of specifying username , password in web application's config file, want utilize "peer" authentication. have gotten authentication work properly, ran next issue. when created webappuser role in postgresql, granted login permission grant on database foo webappuser; , within database grant on schema public webappuser; . the issue having table permissions. unlike mysql allows access default tables if have access database (a reasonable assumption in opinion), postgresql denies access of tables though permission has been given on schema , database. in order around this, have explicitly grant permissions on new tables, views, procedures, etc. c

hibernate - Mapping PostgreSQL XML type to byte[] field of entity bean -

hibernate - Mapping PostgreSQL XML type to byte[] field of entity bean - we need map xml field in postgres table java entity field of type byte[]. using hibernate orm. please allow know best method this. thanks! this done implementing org.hibernate.usertype.usertype interface. then annotated entity given below: @column(columndefinition="xml") @type(type="app.domain.xmltype") private string contentxml; hibernate postgresql java-ee jpa hibernate-mapping

How do I store all the links into the variable while allowing them to be read separately? (Python) -

How do I store all the links into the variable while allowing them to be read separately? (Python) - i trying bring in links .txt file , store them in 'link_name'. problem when loop ends, stores lastly link of file in 'link_name'. how store links variable while allowing them read separately? considering list, if that's proper route, unsure how implement it. help can offer. fr = open('links.txt', 'r') link in fr: link_name = link fr.close() print(link_name) just append links list. link_name = [] fr = open('links.txt', 'r') link in fr: link_name.append(link) fr.close() print(link_name) or through list comprehension, link_name = [link link in open('links.txt', 'r')] print(link_name) python

javascript - jQuery - on load of element with ajax -

javascript - jQuery - on load of element with ajax - i searched time not find working solution problem (sorry if searched wrongly)... have equivalent of next function element loaded ajax: $(document).ready(function() { $('.div-modal-text').css("background-color","red"); }); therefore using next code: $('#parent_id').on('action', '#id or class born', function performed() ); in illustration parent-child construction is: #projectmodals (div content dynamically loaded)>...>.div-project-description>.div-modal-text this translates next code in example: $('#projectmodals').on('load', '.div-project-description', function() { $(this).find('.div-modal-text').each(function() { $(this).css("background-color","red"); }); }); i know 'load' not work .on(), tried different alternatives , not find working. thanks help

excel - Date changing to USA Format from userform -

excel - Date changing to USA Format from userform - i have userform requires date input , until today hasn't caused issue (used lastly 2 weeks). when date input posts info staging sheet visible on printable page. the format worked - activecell.formular1c1 = textbox4.value but date beingness 03/11/2014 switching round 11/03/2014. i tried alter code format date e.g. activecell.formular1c1 = format(textbox4.value, "dd/mm/yyyy") but 1 time again date showed 11/03/2014. does have solution date format error? thanks al what avoid problem date formatting is: with activecell .value = textbox4.text .numberformat = "dd/mm/yyyy" end like create shown value cell independent how inserted user, long it's date-time value. p.s. have arbitrarily removed .formular1c1 since inserting value, not formula, there's no point insert textbox value formula property of active cell. excel vba date excel-vba

c - Understanding implicit conversions for printf -

c - Understanding implicit conversions for printf - the c99 standard differentiate between implicit , explicit type conversions (6.3 conversions). guess, not found, implicit casts performed, when target type of greater precision source, , can represent value. [that consider happen int double]. given that, @ next example: #include <stdio.h> // printf #include <limits.h> // int_min #include <stdint.h> // endianess #define is_big_endian (*(uint16_t *)"\0\xff" < 0x100) int main() { printf("sizeof(int): %lu\n", sizeof(int)); printf("sizeof(float): %lu\n", sizeof(float)); printf("sizeof(double): %lu\n", sizeof(double)); printf( is_big_endian == 1 ? "big" : "little" ); printf( " endian\n" ); int = int_min; printf("int_min: %i\n", a); printf("int_min double (or float?): %e\n", a); } i surprised find output: sizeof(int): 4 sizeof(float): 4 sizeof(double)

linux - How to filter lines with a filter chain -

linux - How to filter lines with a filter chain - suppose have text file, list.txt , this: # category 1 foobar # category 2 dummy1 dummy2 dummy3 # category 3 foobar.dummy foobar.dummy and have bash script, say, list.sh , extract lines list.txt . script takes 1 or more patterns filter text file grep. conceptually, commandline: cat list.txt | grep filter1 | grep fitler1 | ... | grep filtern however, problem number of filters varies, have utilize loop filtering. loop, hoping below work. filters=$* filter in ${filters[@]}; result=`ad_hoc_show $result | grep $filter` done ad_hoc_show $result # should maintain original line construction for example, below desired output. $ list.sh foobar foobar foobar.dummy foobar.dummy $ list.sh dummy \d dummy1 dummy2 dummy3 so, advice on how implement ad_hoc_show function? if grep supports -p can utilize function: filt() { re=$(printf "(?=.*?%s)" "$@") grep -p "$re" li

IntelliJ 14 - Create / Import a Scala / SBT project -

IntelliJ 14 - Create / Import a Scala / SBT project - intellij 14 supports (in theory) sbt / scala projects through scala plugin, still available in official repo. according this post "scala plugin project uses sbt build , dependency management". cannot find way create or import sbt / scala project intellij. there lack of documentation explaining more new way of configuring scala plugin. i have scala plugin activated in intellij ultimate 14.0 (139.224). ideas? install scala plugin. settings -> plugins -> scala -> install open directory sbt build: file -> open project -> select directory build.sbt -> configure settings that worked me couple of minutes ago. may necessary reset cache , restart: file -> invalidate caches / restart . scala intellij-idea sbt intellij-14

How do I get this list to be seperated by a tab? (HTML/CSS) -

How do I get this list to be seperated by a tab? (HTML/CSS) - so i've started html/css, , decided start simple, nav bar. thing tutorials online go point (below code) , completely ignore how set space between each list item. i've tried adding width, makes uneven space. please show me how this? thanks! here's code; working model here html: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="bannercontent"> <ul id="banner"> <li id="bannerlinks"><a id= "links" href="#">what </a></li> <li id="bannerlinks"><a id= "links" href="#"> pricing </a></li> <li id="bannerlinks"><a id= "links" href=

python - Custom App Folder in Django 1.7 -

python - Custom App Folder in Django 1.7 - so used utilize next include custom app directory (for organization sake) , worked until django 1.6 noticed it's not working django 1.7 (python 2.7). suggestions in right direction much appreciated. the error inability find app included in settings.py import os import sys base_dir = os.path.dirname(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(base_dir, 'apps’)) python django

iphone - Flash/AIR problems with IOS8 -

iphone - Flash/AIR problems with IOS8 - i have problems flash application ios8. i getting black space before , after application content, whatever can not remove black space (atm background white, it's not application space). i using flash cs6 , air 15.0.0.349. screen shot here: http://i.stack.imgur.com/vrh51.png iphone flash air ios8

android - If else statement conflict for device orientation -

android - If else statement conflict for device orientation - i created app retrieves web service api data. able display info in list view. works fine except want utilize spinner instead of listview when in portrait mode. created code 2 xml files: 1 in portrait spinner , 1 in landscape listview , code checks these orientation changes unfortunately app crashes. can explain going on? @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { if(getresources().getconfiguration().orientation == configuration.orientation_landscape){ view view = inflater.inflate(r.layout.master_fragment, container, false); // loads available info in receipelist master fragment. arrayadapter<string> adapter = new arrayadapter<string>(getactivity(), android.r.layout.simple_list_item_1, receipelist); setlistadapter(adapter); homecoming view; }else { view v

java - Replacing Vowels In A String With Increasing Numbers -

java - Replacing Vowels In A String With Increasing Numbers - i'm trying figure out way take string , replace vowels increasing number. for example: "abcdef" --> "0bcd1f" i tried replaceing vowels single symbol, seek replacing each occurrence of symbol increasing number. doesn't work though, because i'm setting word2 instance. public static string getnumberstring( string s) { string word = s; string word1 = word.replaceall("[aeiouaeiou]", "@"); int c = 0; for( c = 0; c <= word.length(); c++) { string word2 = word1.replacefirst("@", integer.tostring(c)); } homecoming ""; } any help appreciated. following should work. of returning empty string. apart that, in java string immutable need update word2 have different string value in every iteration. public static string getnumberstring( string s) { string word = s; string word1 = wor

javascript - Jquery Sortable. Adjusting CSS on Selected / Drag -

javascript - Jquery Sortable. Adjusting CSS on Selected / Drag - using jquery sortable. want simple css switch function can alter background colour of field have selected ( <div class='bar-across' ) white yellowish bg using css class .selected ( <div class="bar-across selected"> ) . when release mouse / click, homecoming original state. fiddle html: <div id="reorder-list"> <div id="listitem_1" class="bar-across cf"><span class="handle">drag</span>item 1</div> <div id="listitem_2" class="bar-across cf"><span class="handle">drag</span>item 2</div> <div id="listitem_3" class="bar-across cf"><span class="handle">drag</span>item 3</div> </div> javascript: $(document).ready(function () { $("#reorder-list").sortable({ placeholder: "de

sql - case statement in where clause for avoiding checking null evaluation -

sql - case statement in where clause for avoiding checking null evaluation - i have query like case when ( select sum(amount) table id in(10,100) , to_char(month,'yyyy-mm') = to_char(@date::date,'yyyy-mm') ) null ( select sum(amount) table id in(10,100) , to_char(month,'yyyy-mm') = to_char(@date::date- interval '1 month','yyyy-mm') ) else ( select sum(amount) table id in(10,100) , to_char(month,'yyyy-mm') = to_char(@date::date,'yyyy-mm') ) end i need rewrite query can utilize case statement in clause in postgres i think want smthing this, not clear. coalesce(select sum(amount) table id in(10,100) , to_char(month,'yyyy-mm') = to_char(@date::date,'yyyy-mm') , select sum(amount) table id in(10,100) , to_char(month,'yyyy-mm') = to_char(@date::date- interval '1 month','yyyy-mm')

javascript - Number of Select Options cause a slow response to text entry on an iPad -

javascript - Number of Select Options cause a slow response to text entry on an iPad - i have standard html form css styling. everything works fine when testing on ipad (both ios7 , 8) slow (approx 1-2 seconds) respond key presses on native keyboard when trying come in text in form fields. i tried removing elements page work out causing issue , appears select boxes. 'nationality' field has in excess of 100 selectable values. i tried on other peoples' live form , same problem appeared believe ipad/ios issue. has uncounted , know workaround? kind regards, f.y.i ipad/ios issue fixed in ios 8.1.3 javascript html ios ipad dom

java - Save the field values of a panel using I/O file write -

java - Save the field values of a panel using I/O file write - i have created swing page netbeans ide including 2 labels name , age , 2 text fields corresponding each label. problem how save page exclusively text file? private void jbutton1actionperformed(java.awt.event.actionevent evt) { string sb = "test content"; int retrival = jfilechooser1.showsavedialog(null); if (retrival == jfilechooser.approve_option) { try( filewriter fw = new filewriter(jfilechooser1.getselectedfile()+".txt")) { fw.write("name: "+txtname.gettext()+"\n" ); fw.write("\nage: "+txtage.gettext() ); } grab (exception ex) { ex.printstacktrace(); } } } i have tried code. expecting save panel text file. if next true can simple: all fields text fields (e.g. no text areas, combo boxes, spinners etc.). all labels associated fields (as in label.setlabelfor(component) called). ex