Posts

Showing posts from July, 2015

Jquery image rollover on parent li hover -

i have responsive image based nav menu used jquery swap out rollover image. <ul id="mainmenu"> <li><a href="#"><img src="nav1-off.png" class="rollover"/></a> <div class="mega-menu"><p>mega menu content in here</p></div> </li> <li><a href="#"><img src="nav2-off.png" class="rollover"/></a> <div class="mega-menu"><p>mega menu content in here</p></div> </li> </ul> $("img.rollover").hover( function() { this.src = this.src.replace("-off", "-on"); }, function() { this.src = this.src.replace("-on", "-off"); }); how instead toggle image src when parent li hovered over. basically need when newly added mega menu divs hovered on hover image still shows in menu.

Java : Deploy restful web service without jersey -

thanks in advance. new in web services , when try deploy restful web service using java , generate exception. follow restful java jax-rs learn web services, according book chapter 3 ,i try build example , after deploying example generate exception , know , miss , don't know missing. following code of example . <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>restfultest</display-name> <servlet> <servlet-name>rest</servlet-name> <servlet-class>com.restfultest.controller.shoppingapplication</servlet-class> </servlet> <servlet

qt - QComboBox text position -

i programming qt , have problem qcombobox. when program starts, qcombobox hast no items, created on button click event, if button clicked, qcombobox cleared, , other items inserted. this works fine default text, when combobox not clicked, disappears half under top border. font has default size fits combo box. when click on combo box, normal , items shown text in correct position. what can reason this?

Rails doesnt log tempalte errors in development mode -

my rails 3.2.9-app not show specific error information me on errors in templates ! doesn't matter if use haml or erb, getting "we're sorry, went wrong". in fact, webrick is in development mode , if there errors in models or controllers, full ordinary error screen. examples example error in helper-template ("@resource" not exist, must "resource"): -> lousy "we sorry, went wrong" <% @resource.errors.full_messages.each |msg| %> example error in 1 of controllers: resposnd_to |format| -> undefined method `resposnd_to' ... anyone may me? :-( i solved problem!! in all, searched more 1 year, now, got solution: the problem use umlauts or blank spaces in path of rails project. if move rails project path without umlauts or blanks , error message should shown :-)! tested on ubuntu-machine, maybe important bug. bug appears in rails 3.2.9, 3.2.13 , 3.2.14 definitely. (consider_all_requests_local activate

PHP & Android - UTF-8 encoding problems -

we're doing post request via android php , android passing utf-8 string, our database cp1252 (has live iphone backend, hence working it) however can't seem string converted cp1252. tried following code without results $userkey = utf8_decode($userkey); $userkey = iconv('utf-8', 'cp1252', $userkey); $userkey = mb_convert_encoding($userkey, 'cp1252', 'utf-8'); check response echo 'userkey: '.mb_detect_encoding($userkey); always returns utf-8 further more if $userkey sent value "no" , following if($userkey == "no"){ echo "not registered" }else{ echo "registered find db record" } the code seems drop else - great :)

curl - unable to set private key file: './cert.pem' type PEM -

i using curl download data https site using public certificate files. system information: os: fedora 14 curl: curl 7.30.0 openssl: openssl 1.0.0a-fips the command is, curl -v "https://<ip:<port>" --cert "./cert.pem" --cacert "./cacert.pem" --cert-type pem * connect() kng.com port 443 (#0) * trying 11.19.37.123... * adding handle: conn: 0x8189e68 * adding handle: send: 0 * adding handle: recv: 0 * curl_addhandletopipeline: length: 1 * - conn 0 (0x8189e68) send_pipe: 1, recv_pipe: 0 * connected fkng.com (11.19.37.123) port 443 (#0) * unable set private key file: './cert.pem' type pem * closing connection 0 curl: (58) unable set private key file: './cert.pem' type pem i have have given permission .pem file, still curl throwing error. thanks after reading curl documentation on options used, looks private key of certificate not in same file. if in different file, need mention using --key file , supply

javascript - Disable a h:commandButton when h:inputText has no value -

i have 2 h:inputtext textboxes , h:commandbutton. how can disable button in case there no value in either of text box? how disable other text box in case have value in 1 of text box. please find sample code below: <h:form id="myform"> <h:inputtext id="first" value=#{mybean.first}></h:inputtext> <h:inputtext id="second" value=#{mybean.second}></h:inputtext> <h:commandbutton id="submit" action="#{mybean.submit}" value="submit"/> </h:form> javascript: document.getelementbyid("myform:first").onkeyup = function() { if (this.value.length > 0) { document.getelementbyid("myform:second").disabled = true; document.getelementbyid("myform:submit").disabled = false; } else { document.getelementbyid("myform:second").disabled = false; document.getelementbyid("myform:submit").disabled

select - SQL complicated query -

i have following problem sql query. managed execute 15 of them 1 makes me sick. it's hard translate understand. show years , months numbers , sum of costs of ‘borrowed-time’ in months monthly sum of costs lesser biggest 1 in february , march in 2006. and have far (one of version of query because tried many of them) select extract(month data_wyp), sum(koszt) wypozyczenia koszt<(select sum(koszt) wypozyczenia sum(koszt)<(select max(sum(koszt)) wypozyczenia extract(month data_wyp)='2' or extract(month data_wyp)='3' group extract(month data_wyp))) group extract(month data_wyp); the problem cannot equal sum(koszt) , tried save them using as doesn't work either. please me because ruined day. thanks in advance. to filter results of aggregate function in sql query, place comparison

android - Listactivity error with jelly bean running device ( SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length) -

i have app start splash screen open listactivity rows, clicking on row opens activity containing textview, 2 buttons (one of opens infinite gallery, other opens custom dialog), , menu items (about, preference, exit). this app runs on ginger bread when tested on galaxy s3 running jelly bean, opens when click on 1 of listactivity rows appears ignore click. log cat on eclipse shows : span_exclusive_exclusive spans cannot have 0 length however, there no force close (the listactivity scrolls , menu items work fine , ). update: noticed application: created eclipse since around 1 month ago name lets ( trip ) , today testing ( trip.apk ) on both ginger bread , jelly bean works perfectly. but wanted change name trip travel , did not use refactor . instead created new project application name called travel other things same previous app trip including classes, res, , when tested jelly bean shows: span_exclusive_exclusive spans cannot have 0 length update 3 : i solve

encoding - TEXT in Arabic showing wrong characters instead -

i've character encoding issue. i've text file written in arabic, when open weird characters.. åÇÜÇáÍÌÑäÇáÑÝÇÚíãäí .. is there way fix , correct text? text file written utf8x encoded. as in comment: not utf8 , windows-1256 encoding, can repair on linux using iconv command file test : jh@jh-aspire:4804~$ iconv -fwindows-1256 -tutf8 test هاـالحجرنالرفاعيمني (i have no idea means don't know arabic)

linux - When a computer wakes from sleep mode, does it use the same physical addresses as before? -

when computer wakes sleep mode, use same physical addresses before? curious one. i'd assume since suspends memory. is possibly os-dependent? if so, how work specific operating systems such windows or linux. and, hibernate mode? the ram stays in same place (assuming no 1 hot-plugged or hot-unplugged of memory, of course) - it's organization decided bios or whatever boot-process non-pc based systems use. the term "sleep" means "suspend ram", means processor stops running. since processor only[1] thing can re-arrange goes in memory, , isn't powered during sleep, it's ram doesn't changed during time. that's not example drivers told "you're going sleep, please shut down" , "you're waking up, please initialize yourself", , in these steps frees , allocates physical memory. the term "hibernate" means "suspend disk", memory written disk, , believe done based on virtual address of memor

asp.net mvc - WCF MVC model for A view -

im trying display data view foreach loop have problem define @model can me please. this service method public ienumerable<categorytype> getcatlist() { shopentities context = new shopentities(); list<category> produkty = context.category.tolist<category>(); return changetypee(produkty); } private list<categorytype> changetypee(list<category> categorie) { list<categorytype> producttypes = new list<categorytype>(); ; categorytype product = new categorytype(); foreach (var c in categorie) { product.id = c.id; product.name = c.name; producttypes.add(product); } return producttypes; } this contract [operationcontract()] ienumerable<categorytype> getcatlist(); and controller method public actionresult index() {

unit conversion in python as python built-in conversions -

i'm new python. how can convert unit in python? mean not using conversion function this. built-in syntax in python, complex numbers works. e.g., when typed 1mm in python command line, , expect result 0.001 >>> 1mm 0.001 #just built-in complex numbers or scintific expressions >>> 1j 1j >>> 1e3 1000 i totally have no idea, knows how complex number or scintific expressions work in python? or idea on how it. thanks, how bout mm = 0.001 1*mm not sure if asking ... if have ever messed report lab simillar stuff. (although use convert pixels actual border sizes , not) eg: inch = dpi*some_thing margin = 2*inch

c++ - Parsing html with qt? -

how can extract html page content in easiest way, such example strong tags parents p , of class ? xpath equivalent .//p[@class='a']/strong. "the easiest way" very, debatable; easy enough use qtwebkit parse page, , use qwebframe::findallelements + css2 selector want? (or, inject jquery , use navigate dom)

x86 - Why does 0xE1 0x4F disassemble to different instructions in LLVM and NDISASM? -

in bash shell: $ echo "0xe1 0x4f" | llvm-mc-3.2 -disassemble -triple i386 .section __text,__text,regular,pure_instructions loope 79 $ echo -n "\xe1\x4f" | ndisasm -b 32 - 00000000 e14f loope 0x51 but 0x51 81 in decimal. it should disassemble as loope *+79 that is, loop branch relative forward 79 bytes. in ndisasm case, instruction @ address 0 (so next instruction, relative branch computed off, address 2), computes target (absolute) address you: 2+79 = 81 (0x51)

c# - Why do 'Convert.ToInt32' and 'as int?' work differently? -

convert.toint32(mycommand.executescalar()); // returns 100, because mycommand sql command gets non-null bigint cell mycommand.executescalar() int? ?? 0; //returns 0 when mycommand sql command gets non-null bigint cell i have use second way in case, because mycommand.executescalar() can return dbnull . why second way return different result convert.toint32 ? edit: thank you, all. changed type int64 , it's working now. converting , casting (with cast operator, is operator , as operator) 2 different things: convert changing 1 type type. string or int64 int32 . casting can done base type inheriting type. in case object int32 . object must contain int32 succeed. in case not , cast return null . in code: int64 l = 100; object o = l; int32 i1 = o int32? ?? 0; // cast fails, "as" return 0. "??" make 0. int32 i2 = convert.toint32(o); // int32 inside object converted int32 , return 100.

Android: http login not having desired effect -

i couldn't seem log in page work, kept telling me username/password incorrect when know not. started debugging , popping in log.v's , found interesting. line says "//<--- line!" class logmein extends asynctask<string, void, string> { httpclient client = new defaulthttpclient(); httppost post = new httppost("http://www.fakesite.com/login.php"); protected string doinbackground(string... urls) { try { username = un.gettext().tostring(); password = pw.gettext().tostring(); list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>( 2); namevaluepairs .add(new basicnamevaluepair("username", username)); namevaluepairs .add(new basicnamevaluepair("password", password)); post.setentity(new urlencodedformentity(namevaluepairs)); httpresponse response

java - Using less Timers -

it doesn't lag in game know reduce lot of lag in game having less timer 's running. game have multiple timer 's because have 1 timer updates players location , obstacles have other timer 's use remove power ups get. for example have 1 timer have it's initial delay set 5000 , when runned 1 time (it run 1 time) remove specific power , have timer have it's initial delay set 20 000. how keep different delay of each timer still using 1 or @ least fever use now? is there anyway use priorityqueue or scheduledthreadpoolexecutor accomplish this? , if how? you schedule tasks on scheduledthreadpoolexecutor , , re-schedule them different delay if want run same task again. another option use delayqueue store tasks want execute, , use separate thread take , execute runnables off of queue. scheduledthreadpoolexecutor you'd have put runnables on queue new delay if want them run again. the scheduledthreadpoolexecutor lets schedule tasks contin

java - How to sort ArrayList based on a variables value -

this question has answer here: sort arraylist of custom objects property 23 answers i have 1 arraylist<users> users_list; , in users have name, surname, age etc. want implement sorting algorithm sort arraylist based on users age. searched lot found sorting arrays. use custom java.util.comparator : public class usercomparator implements comparator<user> { @override public int compare(user u1, user u2) { return u1.getage().compareto(u2.getage()); } } and sort like: collections.sort(users_list, new usercomparator());

Python decode french char in html email attachment -

i'm trying decode html attachment file of email take on imap server. if html file contain normal character it's working without problem, when have french é character have this: "vous \xc3\xa9t\xc3\xa9 envoy\xc3\xa9e par" have \n \r appear. i use beautifulsoup make search on html code. use loop check mail(not present in code) imap_server = imaplib.imap4_ssl("server",993) imap_server.login(username, password) imap_server.select("test") result, data = imap_server.uid('search', none, "unseen") latest_email_uid = data[0].split()[-1] result, data = imap_server.uid('fetch', latest_email_uid, '(rfc822)') raw_email = data[0][1] raw_email=str(raw_email, 'utf8') msg = email.message_from_string(raw_email) i walk in mail, if find html decode base64 , send beautifulsoup. after print utf-8 conversion. if replace encode.('utf-8') latin-1 have special char. if msg.is_multipart(): part in msg.wal

PHP retrieving array values using dash arrow "->" -

i've been using php quite while now, never been advanced programmer. feel dumb question never understood why array values can retrieved using different methods: this: $array->value rather normal: $array['value'] the standard $array['value'] works, 1 using -> method doesn't @ times. why that? here's example. using zend framework 2 , can grab session value using -> method: $this->session->some_value however, can't if new, normal array: $array = array('some_value' => 'myvalue'); $array['some_value']; // works!! $array->some_value; // not work :( in zend framework 1 arrays work fine way, , in zf2 more , more , run issues need change way value. make sense? sure appreciate help. thanks, greg as stated before in other answers, using -> means accessing object, not array. however, possible object treated array. when implementing arrayaccess interface. coder can such eg. calli

javascript - Select options based on percentage -

i need efficient method select options based on percentages. for example, assume have 4 colors: black, blue, red , white. now, i'm going create array filled colors, except, need select them based on following percentages: black - 80% chance of selection blue - 70% chance of selection red - 30% chance of selection white - 5% chance of selection i thought of assigning range between 1 , 100 each color , generating random number between. means % of colors has add 100%, which, might not avoidable really. code not necessary love algorithms can implemented via javascript accomplish this. edit: based on patrice levesque's answer, created this test . while haven't verified statistics of it, visually represents i'm after. usual, over-thought problem. other answers more welcome. you need normalize values; total “percentage” (in instance, 80 + 70 + 30 + 5 → 185) , pick number between 1 , total; in case, 1-80 black, 81-150 blue, 151-180 red , 181-185 white.

input - Java check if user is typing in the console -

is there way check if user typing in console window in java? program prints information receives client connections using system.out.print() , want stop printing information temporarily while user typing. user input read on separate thread using scanner class. need able see if user has typed , still have whatever user has typed (if anything) available scanner. if it's possible avoid using external libraries , stick java libraries. no, there no ways directly using console (that i'm aware of) - content of console sent application once enter pressed , available scanner . one way solve make own console, can read , write from. you'll able want (including check if highlighted , on). if don't know how code gui, should that. oracle has tutorial on gui swing.

Php - Find only one number in a string -

i have php script loads different ids , send them page on variable, separated coma: .../page.php?items=12,13,43,17, i load mysql while loop table shows up, , need see if id of table item same adds style table row. so did was: $style = (strstr($_get['ids'], $segn['itemid'])) ? 'style="background:lightgreen;"' : '' ; <tr class="gradex" <?= $style ?> >; in case worked single numbers. in case have ids: 1, 2, 3 ... 12 , page request "page.php?items=12" ids '12' , '1' , '2' . i thought use explode(',' , $_get['ids']) guess goes long. how ids? (i've no affinity whatsoever regexp...). instead of: strstr($_get['ids'], $segn['itemid']) you this: in_array($segn['itemid'], explode(',',$_get['ids']));

php - How to get last value of for loop? -

i'm trying value of $row->price last iteration in loop below foreach ($getprices->result() $row) { if ($bb=='on'){ $pric = $row->price+2.50; $pri = number_format($pric,2); }else{ $pric = $row->price; $pri = number_format($pric,2); } i did try following, didn't appear work $numitems = count($getprices->result()); $i = 0; foreach($getprices->result() $row) { if(++$i === $numitems) { if ($bb=='on'){ $pric = $row->price+2.50; $pri = number_format($pric,2); }else{ $pric = $row->price; $pri = number_format($pric,2); } } } any suggestions? use $row->price after loop has ended: foreach ($getprices->result() $row) { // ... } $lastprice = $row->price; this trick, work. if iterating on array can this: $array = $getprices->result(); foreach ($array $row) { // ... } $lastprice = end($array)->price; // work i

How to read a text file line by line in verilog? -

i have srec file simple text file , want read line line in verilog. how can that? the following reads through file, 1 line per clock cycle: expected data format 1 decimal number per line. integer data_file ; // file handler integer scan_file ; // file handler logic signed [21:0] captured_data; `define null 0 initial begin data_file = $fopen("data_file.dat", "r"); if (data_file == `null) begin $display("data_file handle null"); $finish; end end @(posedge clk) begin scan_file = $fscanf(data_file, "%d\n", captured_data); if (!$feof(data_file)) begin //use captured_data other wire or reg value; end end

java - How to check if there is at least: two letters, one number and one special character? -

how check if there @ least: 2 letters, 1 number , 1 special character in java? here code dont know if i'm in right direction. public static boolean validarcodigo(string codigo){ //return pattern.compile("[abc]").matcher("ba").find(); boolean containsatleasttwoletters = pattern.compile("[0-9]").matcher(codigo).find(); boolean tienealmenosdosletras = pattern.compile("('/[a-za- z]/')").matcher(codigo).find(); boolean containsatleastonespecialchar; = pattern.compile ("'/[^a-za-z\\d]/'").matcher(codigo).find(); return containsatleastonedigit && containsatleasttwoletters && containsatleastonespecialchar; your regex seems bit off you've done job. 1 main thing you're checking one number , letter. solve this, try following regexes: boolean containsatleasttwoletters = pattern.compile("[0-9].*[0-9]").matcher(codigo).find(); boolean tienealmenosdos

ASP.Net MVC4 ViewModel null properties and HttpPost -

i have following viewmodel: public class myviewmodel { public int id { get; set; } public string title { get; set; } public int parentclassid { get; set; } public list<anotherclass> anotherclassitems { get; set; } } and in view have form input title, , list of anotherclassitems aren't editable - used display list of items related class. of properties set when 'edit' view loads, when view post, parentclassid & anotherclassitems lists null. here httppost actionresult controller: [httppost] public actionresult edit(formcollection collection, myviewmodel myviewmodel) { if (modelstate.isvalid) { //myviewmodel.parentclassid , myviewmodel.anotherclassitems null?? } return view(myviewmodel); } is there way pass parentclassid & anotherclassitems properties without having them form inputs in view? or should use viewbag this? remember, form posts html input fields. if did not make text boxes or hidden boxe

javascript - jQuery if statement causes browser to crash -

i have small script should show hidden div if corresponding button pressed. example, if button first-button clicked div first-button-content should show. right now, when click on button, chrome crashes , div not show. here html: <div class="home-middle-buttons"> <div class="first-button"> <span>i’m in-house marketer</span> </div> <div class="second-button"> <span>i work @ agency</span> </div> <div class="third-button"> <span>i’m business owner</span> </div> </div> <div class="home-middle-content"> <div class="first-button-content"> <p>lorem ipsum dolor</p> </div> <div class="second-button-content"> <p>lorem ipsum dolor</p> </d

Google App Engine Launch error: "C:/Documents and Settings/userName/php" is a directory and a yaml configuration file is required -

i totally new gae , trying install , start using gae php sdk. i unable follow instructions on the first hello, world! example start server. since new cannot seem figure out going wrong. got files paths , instructions have been typing. i using windows xp 32 bit. have installed python 2.7.5 as instructed ( installing php sdk on windows ) . extracted php , google appengine in c:\documents , settings\username\ . these file paths : php: c:\documents , settings\username\php google app engine: c:\documents , settings\username\google_appengine helloworld test files , yaml file "app.yaml": c:\documents , settings\username\helloworld on command line typed as instructed (in first hello, world! example) c:\documents , settings\username> "google_appengine/dev_appserver.py" --php_executable_path = "c:/documents , settings/username/php" helloworld/ and following error: google.appengine.tools.devappserver2.errors.invalidappconfigerror:

java - StringIndexout of range -

i got error: stringindex out of range: -1 error line string anemail = linefromfile.substring(s+1, e). can see im trying print part of line in input file doesn't work. can me explain why? import java.io.*; public class email13 { static boolean isvalidemailcharacter(char c) { boolean result = false; if((c>='a'&&c<='z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||(c=='.')||(c=='-')||(c=='+')) result = true; return result; } public static void main(string[] args) throws exception{ bufferedreader cin, fin; cin = new bufferedreader(new inputstreamreader(system.in)); //description system.out.println("programmer: minh nguyen"); system.out.println("description: program start final project."); system.out.println(); string namein, nameout, dein, deout; namein=""

Javascript functions: var func = someFunction() and var func = someFunction? -

var funchi = function() { var a=6; var b=5; return a+b; }; var withbrace = funchi(); var withoutbrace = funchi; console.log("with braces: "+withbrace) //'reference 1' console.log("without braces: "+withoutbrace) //'reference 2' console.log("without braces: "+withoutbrace()) //'reference 3' the code pretty simple , clear. 'reference 1' , 'reference 3', console show 11 i'm not clear use 'reference 2'. 'refernce 2', console show complete function instead of showing 11. many times, use 'reference 2' thing (e.g. window.onload = initall) how useful. window.onload = initall; //what do? why not 'window.onload = initall()' i not clear concept behind it. if possible, give me link lesson on thing? in first case : withbrace contains result of calling funchi , therefore it's 11 in second case : withoutbrace references function

php - Why am I getting an "array to string conversion" error in CodeIgniter? -

i'm having problem error: array string conversion here's code: controller: function get_tariff() { $this->load->model('model_tariff'); $data['destination']=$this->input->post('dest',true); $data['lines']=$this->input->post('lines',true); $data['weight']=$this->input->post('weight',true); $data['priceperkg']=$this->model_tariff->get_tariff(); $data['pricetotal']=$data['priceperkg']* $data['weight']; $this->load->view('tariff_result',$data); } model: function get_tariff() { $destination=$this->input->post('dest'); $lines=$this->input->post('lines'); $weightt=$this->input->post('weight'); $this->db->select('price'); $this->db->from('view_tariff'); $this->db->where('city_name',$destination); $th

ruby on rails - Gmaps4rails visualRefresh (Google maps) -

good day. know how turn on visualrefresh on gmaps4rails gem. tried (for non static maps) add &visual_refresh = true url parameter didn't work. in docs wroted insert google.maps.visualrefresh=true; before map shows. have no idea put line gmaps4rails. please help. this not supported version of google api used in gmaps4rails, set 3.8 on latest gem (v 1.5.6) , 3.9 on master . have opened pull request asking version updated 3.12. you use forked version , make sure set google.maps.visualrefresh=true on page before map gets rendered. e.g. - content_for :scripts :javascript google.maps.visualrefresh = true; this further cleaned making option passed gmaps method call, unfortunately @ time don't have bandwidth such change.

entity framework - Implementing EntityFramework 5 in to Solution -

in solution have more 40 projects. want confirm that, if have used common entity project degrade performance or have use separate entity(objectcontext) each project. which 1 better..? can me..? thanks. suggest take @ bounded contexts article julie lerman large contexts can inefficient. worse contexts many entries @ once. can have 1 dal/ef project contexts address business areas/spaces. these , should reused across projects. i use 1 large context migration/initial db creation , bounded contexts day day access. business process dictate context loaded/accessed

raspbian - Is it possible to run JavaFx without X-server? -

my plan run javafx application on raspberry pi. while usual way start gui redirected hdmi port, presents whole of desktop on tv. however, not want see desktop or else, other content rendered application on tv. possible send rendered output directly hdmi port? yes need arm port of java8, fx renders directly framebuffer.

jquery - How to set z-index of SlideJs lower than z-index of dropdown menu -

i using slidejs plugin http://www.slidesjs.com/ . i facing z-index issue. can see example code http://jsfiddle.net/wntps/ slidejs-slideshow below dropdown menu. when hover menu dropdown menu hides behind slideshow. tried give highest z-index dropdown menu issue not resloved. please tell me best solution resolve issue. thanks http://jsfiddle.net/wntps/3/ i think should fix problem. gave id slides postion of relative , z-index of 0, , gave menu id z-index of 1. note z-index work positioned elements. highest index appear on top. #menu{ width:1024px; height:50px; position:relative; border:1px solid; z-index: 1; } #menu li{display:inline; height:20px; display:block; float:left; overflow:hidden; } #menu li:hover{overflow:visible;} #menu li ul li{float:none;} #menu li a{display:inline-block; width:100px} #slides { position: relative; z-index: 0; }

rest - What is the appropriate response for a broken link in the request entity? -

say have restful api binds user company: put http://example.com/users/john.smith { "company": "http://example.com/companies/nintendo" } but referenced company not exist (possibly due race condition, possibly due user error). operation cannot complete because database requires foreign keys point existing rows. appropriate response code , why? i return http 400 - bad request , adding in response body hint (e.g. nintendo not valid option). it's not 404 - not found error, since url , resources referenced in correct. as side note body of request { "company": "http://example.com/companies/nintendo" } i expect users pass name, or id company, not whole uri. add more complexity without possibly gaining anything. imagine user passing valid company name, e.g. sega , in uri has typo, e.g. comp p anies . i'm guessing backend try access uri, and, failing that, return error. well, could, me seems making both yours , users l

Loading Profile Images on VK.com in ActionScript -

i have iframe application in vk.com. can use api looks fine when want load profile images security sandbox error. when print result , errors this: (i using greensock imageloader) myurl : 'my image url on cs408919 subdomain of vk' loading crossdomain on cs408919 scriptaccessdenied : error #2048 securityerror : error #2048 error : error #2048 scriptaccessdenied : error #2123 security sandbox violation, no policy files granted access it seems me crossdomain.xml issue couldn't find right one. thanks... yes, it's crossdomain issue, vk sub-domains images doesn't provide crossdomain.xml user avatars, still able load (and add display list well) them. can't access loaded content (and set smooth bitmap flag example, or draw hole stage vk images on it). if need access content can use "policy-hack", it's hack, can fixed in fp update (i guess answer may bring closer moment:) ): the idea listen added event if image loader: pr

sql - How to do WHERE clause BEFORE INNER JOIN -

how query ? select distinct station , slot , subslot, compid , compname devicetrace dt dt.deviceid = '1339759958' inner join complist cl , dt.compid = cl.compid i need dt.deviceid = '1339759958' before start inner join. work sql server. i find difficult believe makes difference. query optimiser should apply predicate before join if calculates more efficient so. circumstance might need when optimiser makes erroneous choice (for inner joins @ least -- there valid cases outer joins).

elisp - Emacs Lisp map over a list of function names and call them all with the same arg -

i'm having trouble understanding approach need take fold on list of functions , invoke them particular argument. here assumed work. i've tried various variations on it, using eval etc. pointers? (mapcar (lambda (fn) (fn 'utf-8)) (list #'set-terminal-coding-system #'set-keyboard-coding-system #'prefer-coding-system)) when run "symbol's function definition void: fn". edit | ok, works, seems odd need use apply when above example passes functions #'function-name synax. (mapcar (lambda (fn) (apply fn '(utf-8))) '(set-terminal-coding-system set-keyboard-coding-system prefer-coding-system)) in emacs lisp, symbols have separate value , function slots 1 . function arguments passed in value of argument's symbol, when evaluate (fn 'utf-8) using fn symbol's function slot, not contain want (or in instance, @ all; hence error "symbol's

php - Concise method of using file_exists for a range of filenames -

i using file_exists determine whether image files in specified directory, , if are, displaying them within image rotator. works fine code seems long winded achieves. there better way? at moment have: <?php if (file_exists($reg_photo_1_f)) { echo "<li>"; echo "<a href=". $reg_photo_1_f .">"."</a>"; echo "</li>"; } if (file_exists($reg_photo_2_f)) { echo "<li>"; echo "<a href=". $reg_photo_2_f .">"."</a>"; echo "</li>"; } if (file_exists($reg_photo_3_f)) { echo "<li>"; echo "<a href=". $reg_photo_3_f .">"."</a>"; echo "</li>"; } if (file_exists($reg_photo_4_f)) { echo "<li>"; echo "<a href=&quo

php - phpbb navbar in external website -

i have phpbb3 integrated in site. i have login in header webpage explained in https://wiki.phpbb.com/external_login . all works fine, go bit further, have navbar in website header, see new messages , user profile in website header. using code: <?php define('in_phpbb', true); $phpbb_root_path = '../phpbb3/'; $phpex = substr(strrchr(__file__, '.'), 1); include($phpbb_root_path . 'common.' . $phpex); // start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?> <div class="registro"> <?php if ($this->_rootref['s_user_logged_in']) { ?> <div class="navbar" style="background-image:url('../img/opaco.png');"> <div class="inner"><span class="corners-top"><span></span></span> <?php if (!$this->_rootref['s_is_bot'] && $this->_

java - JSP Application Scope settings for Database Query -

i want store query result in hashmap each "service" parameter passed class , store them application scope application.setattribute() , if service exist in application scope values application.getattribute() . there 3 columns stored each service. how can 3 column values depending upon services parameter if exist in application scope? please suggest how store values in application scope (if doing wrong in following code). service=request.getparameter("service"); map<string,string> freetextmap=new hashmap<string,string>(); if(application.getattribute(service)==null ) { query = "select aunique,atitle,abody freetexts service='" +service+ "' rs = dbutils.getrs(con,query); if (rs.next()) { clientfreetextmap.put("unique", rs.getstring("aunique")); clientfreetextmap.put("body",rs.getstring("abody")); clientfreetextmap.put("txt",rs.getstring("atitle")); applica

Scroll to bottom of a <div> with jQuery on page load (multiple <div>) -

i know has been answered here scroll bottom of div on page load (jquery) , solution not working, when having more 1 <div> different heights. $('.mycontent').scrolltop($('.mycontent')[0].scrollheight); is not working multiple <div> different heights! see http://jsfiddle.net/4pflq/ try this: $('.mycontent').each(function () { $(this).scrolltop($(this)[0].scrollheight); }); fiddle demo

android - SherlockFragmentActivity causing ClassNotFoundException -

i'm having class extends sherlockfragmentactivity when trying run program getting classnotfoundexception i've tried this solution no avail. i mention i'm setting class launcher activity in manifest. when change sherlockfragmentacivity sherlockactivity i'm able run program can't use fragments anymore there's no getsupportfragmentmanager() method in sherlockactivity class. i found solution. deleting support library libs folder did trick me.

Starting/using SQL Server Management Studio from Visual Studio -

i have visual studio 2012 installed on win7 x64 machine. know has sql server management express version installed on it. unsuccessfully trying install sql server management studio 2012 developer edition since 2 weeks (tried 20 times, option, full install, upgrade, did tests, tried setup checks , test passed, did whole process on many different virtual machines start again clean os, anything...) setup fails. stupid microsoft can't make own software work together. whatever. see people using sql server on own. error is: 'microsoft.vc80.atl,version="8.0.50727.6229",publickeytoken="1fc8b3b9a1e18e3b",processorarchitecture="x86",type="win32"'. per ulteriori informazioni, consultare guida e supporto tecnico. hresult: 0x800706be. i never got what's difference using within visual studio or on own, need program on own because have book teaches use sql server management studio on own, not on visual studio. need because don't

syntax - Parsing Python function calls to get argument positions -

i want code can analyze function call this: whatever(foo, baz(), 'puppet', 24+2, meow=3, *meowargs, **meowargs) and return positions of each , every argument, in case foo , baz() , 'puppet' , 24+2 , meow=3 , *meowargs , **meowargs . i tried using _ast module, , seems thing job, unfortunately there problems. example, in argument baz() function call itself, couldn't find simple way length. (and if found one, don't want bunch of special cases every different kind of argument.) i looked @ tokenize module couldn't see how use arguments. any idea how solve this? this code uses combination of ast (to find initial argument offsets) , regular expressions (to identify boundaries of arguments): import ast import re def collect_offsets(call_string): def _abs_offset(lineno, col_offset): current_lineno = 0 total = 0 line in call_string.splitlines(): current_lineno += 1 if current_lineno ==