Posts

Showing posts from July, 2012

Insert update and delete in servlet and jsp -

i new servlet , jsp trying achieve operation view,add , update , delete dont have idea achieve operation how forward page , maintain session , pass value jsp kindly in right way. had gone many tutorial no idea , here tried controller.java package servlet; import java.io.ioexception; import java.io.printwriter; import java.sql.connection; import java.sql.drivermanager; import java.sql.preparedstatement; import java.sql.resultset; import java.sql.sqlexception; import java.sql.statement; import javax.servlet.servletexception; import javax.servlet.http.httpservlet; import javax.servlet.http.httpservletrequest; import javax.servlet.http.httpservletresponse; import db.dbconnect; public class controller extends httpservlet { private static final long serialversionuid = 1l; public controller() { super(); } protected void doget(httpservletrequest request, http

cloudera - Oozie Web Console working very slow -

in cluster oozie web console slow. when go web console takes 10 -15 secs pass request oozie server , takes 10-15 secs publish result got oozie server. same working fine in hue. has 1 experienced this? getting issue in both cdh 4.4 , cdh 5.0.0 beta2. i guess there issues in oozie tomcat war file. idea guys? often bottleneck oozie it's internal database - derby. works small installations, not if have dozens of coordinators hundreds of materializations. recommend setup external database oozie (postgres/mysql/..). cloudera provided instruction on subject - http://www.cloudera.com/content/cloudera-content/cloudera-docs/cm4ent/4.5.1/cloudera-manager-enterprise-edition-installation-guide/cmeeig_topic_5_3.html

php - CodeIgnitor - Image upload. -

whenever choice file browse , click upload, not work. it codeignitor project. new in php , codeignitor. #my coctroller name member , code below: public function profile_change_avater(){ $this->load->model('member_model'); if($this->input->post('upload')) { $this->member_model->do_upload(); } $data['title'] = "choise avater"; echo "<pre>"; print_r($data['title']); echo "</pre>"; $this->common_load_view('member/user_extended_profile_change_avater_content_view', 'members', 'profile_change_avater', $data ); } model name member_model, code below: public function do_upload(){ //$this->image_path = realpath(apppath .'../asset/images' ); $this->upload->initialize($config); $config = array( 'allowed_type' => 'jpg|jpeg|gif|png', 'upload_path' => '

ksoap2 - Parse Ksoap response array in android -

i want parse ksoap response array not getting it response when debug app: events_data { events = [events { groom = sanskaar; bride = saumya; event_name = wedding; venue = new delhi; event_date = tuesday april 14, 2014; }, events { groom = sanskaar; bride = saumya; event_name = hzbrgbj; venue = new delhi; event_date = tuesday april 14, 2014; }, events { groom = sanskaar; bride = saumya; event_name = wedding; venue = new delhi; event_date = tuesday april 14, 2014; } ]; } code using parse response: soapobject response = (soapobject) envelope.getresponse(); //soapobject response = (soapobject) envelope.bodyin; system.out.print(response); int count = response.getpropertycount(); system.out.

Coupling and how to reduce it -

Image
in of following lines of code coupling occurs? kind of coupling? problem induced coupling? how can code refactored reduce coupling? one way approach @ function/method depends upon. it explicitly depends on arguments - form of control coupling, in case. however if tried compile method in isolation, can see other objects depends upon: log , , specific methods of log (note seem call both of these methods) ignore_user_requests log_verbosity_level , repeated 4 times in method a specific collector class. mem , 4 attributes (size, startaddress, etc) - form of content coupling i think argue there several cases of common coupling (shared global variables) there, though it's not terribly clear limited context. , variables may scoped within object or package, not 'global'. then consider: what happen if wanted change 1 of these items. example, if wanted use different collector implementation, or different logger; or structure of mem changed? how tes

cgi - Linux bash interruptions -

i'm trying put when receives event, , http request apache cgi-bin generate "flag" script picks , execute code? another "interrupt" push button im getting of problems, becuase want put in loop, if source script sourcing script halt because of loop, if use name pipes halt waiting data... i've been triying named pipes, sourcing scripts , sorts of things dont manage consistent, wondering thinking on using other ipc options, signals, shared memory , thoose kind of things. to start have experience this, know resources , if it's possible. i needed work @ kernel level using inter-process communications socket or known domain sockets

Matrix Row manipulation in Breeze using Scala? -

i've densematrix 1 2 3 0 0 0 0 0 0 0 0 0 11 22 33 0 0 0 0 0 0 0 0 0 111 222 333 i want remove first row , last row 0 s 0 0 0 11 22 33 0 0 0 0 0 0 0 0 0 111 222 333 0 0 0 0 0 0 0 0 0 how achieve in breeze ? first, gather rows still want: val subset = matrix(::, 2 3) then add zeroes: val newmatrix = densematrix.horzcat(subset, densematrix.zeros[double](1,9)) i might have mixed rows , columns in last line.

javascript - Sending json data to next jsp page -

my problem follow : making ajax call jsp , getting json object comprising of flag , arraylist jsp : gson gson = new gson(); jsonobject root = new jsonobject(); root.addproperty("flag", flag); //add flag root.addproperty("list", gson.tojson(list)); out.println(gson.tojson(root)); now in success function of ajax function want move other jsp did : success: function(response){ alert(json.stringify(response.list)); //alert(json.stringify(response.flag)); if(json.stringify(response.flag).indexof("true")>=0){ location.href="grouploginscreen.jsp"; } else{ alert("unsuccessful"); } } now,the problem part though getting results here correct how send list argument in url grouploginscreen.jsp @ recieving end can obtained doing : arraylist<string> list1 = (arraylist<string>)request.getattribute("mylist"); please help. location.href="grouploginscreen.jsp" make new request browse

java - Unable to find a factory for http://www.w3.org/2001/XMLSchema -

i'm having annoying problems following code, worked okay until switched java 1.7 import javax.xml.validation.schemafactory; schemafactory factory = schemafactory.newinstance(xmlconstants.w3c_xml_schema_ns_uri); running netbeans -djaxp.debug=1, following error thrown: the above snipped code part of osgi bundle jaxp: using thread context class loader (sun.misc.launcher$appclassloader@5e3a78ad) search jaxp: looking system property 'javax.xml.validation.schemafactory:http://www.w3.org/2001/xmlschema' jaxp: property undefined. jaxp: found null in $java.home/jaxp.properties jaxp: no meta-inf/services/javax.xml.validation.schemafactory file found jaxp: attempting use platform default xml schema validator jaxp: instanciating org.apache.xerces.jaxp.validation.xmlschemafactory jaxp: failed instanciate org.apache.xerces.jaxp.validation.xmlschemafactory java.lang.classnotfoundexception: org.apache.xerces.jaxp.validation.xmlschemafactory @ java.net.urlclassloader$1.run(urlcl

curl - Trouble querying the VersionOne query.v1 api -

i trying access versionone (enterprise edition) server's query.vi api. able query rest services , meta.v1, going /query.v1 gives "trouble executing url" error. i using curl , browser access @ moment query apis. e.g. works: curl -x -u user:pass <baseuri>/rest-1.v1/data/timebox error: curl -x post -u user:pass --header "content-type:application/json" -d @data.txt <baseuri>/query.v1 where data.txt = { "from":"timebox" } also error, going localhost/versionone/query.v1 gives trouble executing url error. what going wrong here? how fix it? i have no problems using curl query.v1. if provided more problems executing url. http status code clue. some potential problems: the query.v1 endpoint introduced in versionone 13.2, summer 2013. see error on release before that. if have selected windows integrated authentication on-premise installation of versionone, query.v1 may require ntlm authentication

Clone HTML Element vs creating it with Javascript -

i'm getting list of employees via ajax request. i'm creating bunch of divs name address telephone etc. these new elements have buttons provide functionality. have been using approach: var employee = function(params) { this.name = params.name; this.hrid = params.hrid; this.initialize = function() { this.container = document.createelement('div'); this.contname = document.createelement('div'); this.conthrid = document.createelement('div'); this.mybutton = document.createelement('button'); this.contname.innerhtml = this.name; this.conthrid.innerhtml = this.hrid; this.container.appendchild(this.contname); this.container.appendchild(this.conthrid); this.container.appendchild(this.mybutton); this.addobservers(); } this.addobservers = function() { this.mybutton.observer = this.dostuff.bind(this); this.mybutton.addeventlistener('click', this.mybutton.observer); } this.dost

php - Warning: mysql_connect(): Access denied for user 'root'@'localhost' (using password: YES) -

warning: mysql_connect(): access denied user 'root'@'localhost' (using password: yes) in c:\xampp\htdocs\login\sessionhandler.php on line 35 so what's on line 35. //to make connection database $conn = mysql_connect("localhost", "root", "password") or die(mysql_error()); i don't know whether problem or code i'm writing. have searched every possible answer not looking for. this code (if problem not on line 35) //validation error flag $errflag = false; //input validation if($_post['uname'] == '') { $errmsg_arr[]='login id missing'; $errflag = true; } if($_post['pword'] == '') { $errmsg_arr[] = 'password missing'; $errflag = true; } //if there input validations, redirect login form if($errflag) { $_session['errmsg_arr'] = $errmsg_arr; session_write_close(); header("location: login.php"); exit(); } //to make

c++ - Assigning texture to an object using multiple textures -

Image
i'm making object loader, , texture parts in different texture files. best solution of having mapped on model? need treat every part has it's own texture 1 model, final body has many separate drawing calls 1 texture each? with advent of programmable rendering pipeline (i.e.: shaders ) can apply , combine multiple textures meshes without need multiple draw calls. modern gpus have several texture units ( glactivetexture ) , shaders can read may units @ time. model on right showed in picture, example, uses variation of phong lighting model diffuse texture, normal map texture , specular map texture highlights. these 3 textures applied each texture unit , whole model rendered in 1 draw call. fragment shader reads textures , combines them produce final image. your question not specific, can now. if have more specific questions, please fell free ask.

c# - How to avoid loss of precision in .NET for converting from Unix Timestamp to DateTime and back? -

consider following snippet var original = new datetime(635338107839470268); var unixtimestamp = (original - new datetime(1970,1,1)).totalseconds; // unixtimestamp 1398213983.9470267 var = new datetime(1970,1,1).addseconds(1398213983.9470267); // back.ticks 635338107839470000 as can see ticks value got different started with. how can avoid loss of precision in c# while converting date unix timestamp , back? http://msdn.microsoft.com/en-us/library/system.datetime.addseconds.aspx datetime.addseconds() per documentation rounds nearest millisecond (10,000 ticks). using ticks: // have datetime in memory datetime original = new datetime(635338107839470268); // convert unix timestamp double unixtimestamp = (original - new datetime(1970, 1, 1)).totalseconds; // unixtimestamp saved somewhere // user needs make 100% precise datetime unix timestamp datetime epochinstance = new datetime(1970, 1, 1); datetime = epochinstance.addticks((long)(unixtimestamp * timespan.ti

php - Wordpress MultiSite - Showing Latest Blogs of ALL Sites? -

in experimenting multisite, see each site gets it's own wp tables numbered. is there efficient way combined results among sites? or independent in database? one thing i'd have list of latest blogs on front page. yet see no apparent way this. forgive fact there no code or "attempts" on question. new me.

Use of request.getSession(false) in TagLib of Grails throws exception -

i trying use below code in taglib of grails 2.3.5. class logintaglib { def logincontrol = { if(request.getsession(false) && session.user){ out << "hello ${session.user.login} " out << """[${link(action:"logout",controller:"user"){"logout"}}]""" } else { out << """[${link(action:"login", controller:"user"){"login"}}]""" } } } i getting following error: groovy.lang.missingmethodexception: no signature of method: org.apache.catalina.connector.requestfacade.session() applicable argument types: (java.lang.boolean) values: [false] possible solutions: getsession(boolean), getsession() racetrack.logintaglib$_closure1.docall(logintaglib.groovy:9) d__java_grails_workspace_racetrack_grails_app_views_layouts__header_gsp.run(_header.gsp:7) d__java_grails_workspace_racetrack_grails_app_views_layouts_m

how to push git branch -

i need git branches. not think understand procedure @ all, keep getting confused. what want make simple branch, can fix issue on website without erasing things i've worked on far. have moved far away have on production server, cant tidy code prevent breaking site. so have tried in several ways make new branch, things keep giving me errors , such. example, saw somewhere can create tag, , turn branch. have. tagged commit wanted branch work from, made new branch, , sure enough have 2 heads "master" , new branch. however, in gitlab page, cannot see new branches... , pushing server gives me errors can't figure out why occur. it gives me log when try push: counting objects: 97, done. delta compression using 2 threads. compressing objects: 100% (25/25), done. writing objects: 100% (51/51), 21.31 kib | 0 bytes/s, done. total 51 (delta 39), reused 35 (delta 25) remote: /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/dsl.rb:33:in `eval_gemfile': ge

c# - Windows Phone 8.1 and Windows Phone 8 device - Will it work -

i've started new windows phone 8.1 project in visual studio 2013 , i've been doing lot of coding already. my questions is, can run project on windows phone 8 device? wikipedia (for example) says isn't possible, that's why wanted second opinion. if have start over, have lot of trouble importing previous files? obviously project needs target 8.0 run on 8.0 or higher. start new 8.0 project , import code. if don't have 8.1 specific code (which likely), compile fine , run on 8.0 , 8.1.

sockets - How to implement SuperSocket -

i trying implement supersockets - https://supersocket.codeplex.com/ project working on. have server uses configuration run. in project i have referenced: supersocket.common, supersocket.socketbase, supersocket.socketengine i added following config section: <configsections> <section name="supersocket" type="supersocket.socketengine.configuration.socketserviceconfig, supersocket.socketengine" /> <!-- more information on entity framework configuration, visit http://go.microsoft.com/fwlink/?linkid=237468 --> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> </configsections> <appsettings> <add key="servicename" value="someservice" /> </appsettings> <supersocket

excel - Sort a list by another list... to organize matching pairs on the same row -

i know title sounds little funky. i'm trying do: have large list of data , i'm trying sort small list off of large list. want small list row number match large list row number. looks this: aaa aaa bbb ddd ccc eee ddd hhh eee kkk fff ggg hhh iii jjj kkk what want this: aaa aaa bbb ccc ddd ddd eee eee fff ggg hhh hhh iii jjj kkk kkk i didn't see in research, wondering if there's simple way in excel. tried pivot table couldn't results want. insert column between with: =iferror(if(match(a1,c:c,0)>0,a1,),"") copied down, select first 2 columns, copy, paste special, values... on top , delete third column.

How can I get the IP address and port of a client with PHP? -

how ip , port of client php? i tried script below gives me ip address. <?php print $_server['remote_addr']; ?> port defined in http server (apache or other , 80 or 443) the php $_server variables can check @ : http://www.php.net/manual/en/reserved.variables.server.php i sure : remote_addr' ip address user viewing current page. but if server behind nat: if serving behind proxy server, save time looking @ these $_server variables on machine behind proxy. $_server['http_x_forwarded_for'] in place of $_server['remote_addr'] $_server['http_x_forwarded_host'] , $_server['http_x_forwarded_server'] in place of $_server['server_name'] :-)

html - Lost Background on Wordpress Post Area -

i'm in need of serious help. i'm working on wordpress website , removed shouldn't have, , can't back, plus, i'm not sure deleted. page seems affected home page, while rest of pages fine. i trying remove few things sidebar, , they're gone now, post background gone (needs white), , footer pushed left side. i've looked @ page encoding through browser, , can identify div it's in, however, i'm having trouble locating in wordpress files. any appreciated. the website located here: http://mathenyheatcool.com/ here's code editing (i working @ bottom): enter code here <?php /* template name: matheny home page */ ?> <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post();?> <div class="post"> <?php the_content(); ?> </div> <?php endwhile; endif; ?> <div id="matheny-sidebar-block"> <div style="width:100%;text-align:center;"&g

google play services - How to implement leaderboard in Android application? -

i'm trying implement leaderboard in android application, don't know connect google play game services , display/update leaderboard. i read google documentation, searched on internet, couldn't find solution. i created except code. created game in developer console, added leaderboard, downloaded google play services android studio, updated androidmanifest <meta-data android:name="com.google.android.gms.games.app_id" android:value="@string/app_id" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> can please post code needs go inside @override protected void oncreate(bundle savedinstancestate) { ... } , required connect google play game services , display/update leaderboard? follow documentation google play services using able implement game, best! https://developers.google.com/games/services/android/l

c# - How to save settings from an windows form app using a savedialog -

i have word search creator app. user inputs list of words, width , height settings, word placement settings etc. when user clicks save button, these settings saved file, later user can open app saved settings. have no idea how though. (except opening savefiledialog) the savefiledialog provides application gui save window allows user choose save location , filename. dialog comes event handler (which believe called fileok) can access mysavefiledialog.filename . no data or file has been saved yet. that, take variety of routes, simplest using system.io.streamwriter: using system.io; ... streamwriter sw = new streamwriter(mysavefiledialog.filename); //pass chosen filename sw.writeline( string goes here ); sw.close(); you'll have come string representation of data, though. for more complex types, use xml serialization. can define data structure class , use .net's built in system.xml.serialization namespace automatically output representation of class easy re

php - How to handle concurrent DB connections by multiple users using PDO in PHP5 -

i want use pdo in application. confused regarding use of pdo here. because application access target multiple users. lets 100 users in simultaneously . so, read pdo create 100 db connections access. can create problem limit on concurrent connections allowed server. , new users connection error. how can use pdo such way handles concurrent connections , not overhead? 100 concurrent users not impressive number though. taken average user makes click once minute, have 100 connects 60 seconds, makes 1.5 connects / second. sanely written app should perform no longer 0,1 sec. means 10 connections fit in 1 second. , have 1.5. yes, can peak sometimes, anyway, number of allowed connections last thing think of. database killed far earlier limit reached - due improper indexing , architecture.

c# - Register multiple components with multiple services in Castle Windsor -

i have services , interfaces them in 2 separated assemblies, 1 interfaces , implementations. i'm trying register them using castle windsor. works using this: container.register(component .for(iservice1) .implementedby(service1) .lifestyle.transient()); container.register(component .for(iservice2) .implementedby(service2) .lifestyle.transient()); the thing here is... possible register components @ once? without having register them 1 one. have seen possible register multiple interfaces simple component, o multiple implementations single interface, haven't seen if it's possible register multiple interfaces 1 assembly multiple implementations assembly. i don't know if has relevance, interfaces have same base(iservice in case). thanks lot. what looking registering components conventions . declare implementations castle should consider, , services should associate implementations with. container.register( // want concrete classes in assembly

java - Is it ok to use 'this' in final instance variable declaration? -

is ok use this keyword in final instance variable declaration/initialization in java? like this: private final someclass foo = new someclass(this); it worked when tried out. , since not static variable guess should referring particular instance. felt unsure if advisable or not therefore wanted ask here. edit: main class android activity class, , someclass-instance needs activity context. it "technically valid" this. indeed, this refers particular instance - namely, instance contains instance of someclass . but not recommend in general. exact behavior , state of this passed constructor depends on subtle details. consider following example: class someclass { public someclass(dangerousselfreference dangerousselfreference) { system.out.println("state: "); system.out.println(" a: "+dangerousselfreference.geta()); system.out.println(" b: "+dangerousselfreference.getb()); system.

code generation - Sitecore Glass Mapper always null -

i using sitecore glass mapper new project i'm setting up. using sitecore 7.2, latest version of team development sitecore (tds) code generation , latest version of glass. the code trying execute: var b = new sitecorecontext(); var c = b.getcurrentitem<t01_homepage>(); b not null. c null. var d = b.getitem<t01_homepage>("path") d null. i added assembly in glassmappersccustom: public static iconfigurationloader[] glassloaders(){ var attributes = new attributeconfigurationloader(new[] { "company.framework.websites.corporate", "company.framework.core", "company.framework.common" }); return new iconfigurationloader[] { attributes }; } when b.glasscontext.typeconfigurations models there. i figured language issue because site in dutch , maybe wrong language resolved incorrectly. not case. i disabled webactivator , added glassmappersc.start() in global.asax application_start method. we using

php - codeigniter don't get the right value using for loop -

i'm struggling getting right values in of loop. here data pass controller view $data['moisstring'] = $moisstring; //result of var_dump var_dump($data['moisstring'] ); array (size=3) 0 => string 'janvier' (length=7) 1 => string 'février' (length=8) 2 => string 'mars' (length=4) $data['year'] = $year; //result of var_dump var_dump($data['year'] ); array (size=3) 0 => int 2014 1 => int 2014 2 => int 2014 in view have form_dropdown , want obtain like: **************** * janvier 2014 * * février 2014 * * mars 2014 * **************** here view: echo form_open('suivrepaiement/view', 'method="get"'); $month = array(); $annee = array(); ($i = 0; $i < count($moisstring); $i++) { $month[] = $moisstring[$i]; $annee[]= $year[$i]; foreach ($fichefrais $mois) {

Prolog - parse with DCG -

i want write dcg can deal text presented in notepad. i've read online tutorial writing dcg none of delt text free , involves strings,dates , integers. i'm not sure how start writing dcg (how represent line or date). help? the 'trick' it's approach problem in declarative way, giving first more selective patterns. data format has apparently defined columnar structure, , using library(dcg/basics) handled: :- [library(dcg/basics)]. row([date,key|numerics]) --> date(date), separe, key(key), separe, numeric_pairs(numerics). date(d/m/y) --> integer(d), "/", integer(m), "/", integer(y). key([f|ks]) --> [f], {f \= 0' }, string(ks). numeric_pairs([num:perc|nps]) --> integer(num), separe, number(perc), "%", whites, !, numeric_pairs(nps). numeric_pairs([]) --> []. separe --> white, whites. test: ?- atom_codes('02/18/2014 bats z 235122734 6.90% 109183482 10.50% 147587409 7.80%', cs

javascript - Dropdown selection creating dynamic input types -

i have 3 options in dropdown in html.now on selecting each 1 of option in dropdown want different input types created dynamically. firstly here options in dropdown : <select name="choicetosearch"> <option value="none" style="display:none;"> ---none--- </option> <option value="searchname"> notification sender </option> <option value="searchtype"> notification type </option> <option value="searchdate"> notification date </option> </select> now, on selecting notification sender want a textbox displayed. on selecting notification type want two checkboxes should shown. on selecting notification date want two date type input fields shown. how can done?please help. you need learn javascript since didn't provide attemts solve problem. anyway, need create fields wan

Error installing Msysgit - Cygwin seems to be in your system path -

when install msysgit netinstall 1.9.0 in windows error: error: cygwin seems in system path i installed cygwin, deleted folder c:\cygwin . in path inside environment variables, there doesn't seem cygwin path (e.g x:\cygwin\bin). no cygwin services running. i use windows 8. wow. simple, there official instructions unistall cygwin: http://cygwin.com/faq.html#faq.setup.uninstall-all i forgot delete registry tree software\cygwin under hkey_local_machine and/or hkey_current_user .

jquery - Click to expand shall result in collapsing other opened items? -

when click on menu item, want item expand , rest shall collapse. example: click on item 1 expand it, click on item 2. so, in case item 1 shall collapse itself. html <ul class="footernav"> <li> <a href="javascript:;" class="toptoggle">item 1</a> <div class="typetoggle typecont"> link area 1 </div> </li> <li> <a href="javascript:;" class="toptoggle">item 2</a> <div class="typetoggle filtercont">link area two</div> </li> </ul> jquery $(document).ready(function(){ $(".toptoggle").click( function () { $(this).parent().children('.typetoggle').slidetoggle(); }); }); fiddle you can slideup() .typetoggles before slidetoggle() specific one. $(".toptoggle").click(function () { $(".typetoggle").slideup(); $(this).parent()

mysql - How to do a SQL insert statement in two tables with one statement? -

i have 2 tables: message , message_content : message id | customer_id | creation_time | msg_headline | status | order_id message_content message_id | msg | creation_time | employee_id when insert new data need create record in both tables (linked id resp. message_id ). possible achieve using single statement? it not possible insert 2 tables single insert statement. there few options. 1 of using last_insert_id()[1] : insert `message` (`customer_id`, `creation_time`, `msg_headline`, `status`, `order_id`) values (...); insert `message_content` (`message_id`, `msg`, `creation_time`, `employee_id`) values (last_insert_id(), 'message', default, 1) in actual implementation should switch prepared statement (and php: prepared statements - manual , since mentioned php).

html - On hover background color covers image, z-index not having any effect -

when hover on paragraph text in js fiddle image gets covered background. using z-index everywhere think of doesn't have effect. (i left useless z-index stuff in there show tried.) tried pointer-events: none; in various places. i tried type of thing elm1:hover elm2{} , didn't help. i'm new css , i'm applying have searched , found. edit: problem: on hover background color covers image markup: <div id="col2-middle" class="three-cols-middle three-cols"> <a href="about.php#how-we-work- projects"> <h1 class="h-big-font">specific projects</h1> <img class="col-img" src="3dplotcroppedwithfinancial.png" alt="3dplot"> <p class="p-on-white"> xxxxxxxx xxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx xx

javascript - jquery draggable and changing the color of the background container -

i'm getting syntax error because doing wrong. here code: <style> body{margin:0 auto;} .draggable { width: 100px; height: 100px; padding: 0.5em;background-color:red;} </style> <script> $(function() { $( ".draggable" ).draggable(); }); var i=0; $(".draggable").each(function(i){ if(i%2==0){ #container("background-color:green"); } i++; }); </script> </head> <body> <div id="container" style="width:100%;height:400px;background- color:#ccc;position:relative;"> <div class="draggable" class="ui-widget-content" style="margin-top:10%;margin- left:1%;position:absolute;"> <p>drag me around</p> </div> <div class="draggable" class="ui-widget-content" style="margin-top:10%;margin- left:20%;position:absolute;">

c# - Unittest for a PCL - LINQ method fails -

we use ttd , xamarin use nunit that. in our project have pcl , monodroid/montouch project. have ios , android integrationtest-projects (with nunit special testrunner). my problem real unittests (the fast ones executed not in simulator) use ttd don't work pcl (and there it's important) use linq-extension-methods example enumerable.any() the exception always: could not load file or assembly system.core 2.0.5.0 if don't use linq methods, works fine... maybe info: in integrationtest-projects can execute tests without problem, our without linq extensions. the pcl looks that: <projecttypeguids>{786c830f-07a1-408b-bd7f-6ee04809d6db};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</projecttypeguids> <outputtype>library</outputtype> <rootnamespace>xylib</rootnamespace> <assemblyname>xylib</assemblyname> <targetframeworkprofile>profile136</targetframeworkprofile> <targetframeworkversion>v4.0</targetframewor

iOS google drive api archive build error -

i working google drive sdk ios. tested on simulator , worked good. logged retrieved files , folders, when tried archive got error: ld /users/mac/library/developer/xcode/deriveddata/myprojectname-dtjsurmhdxhcktaoufqjodibkpdd/build/intermediates/archiveintermediates/myprojectname/intermediatebuildfilespath/myprojectname.build/release-iphoneos/myprojectname.build/objects-normal/armv7/myprojectname normal armv7 cd /users/mac/documents/projects/myprojectname setenv iphoneos_deployment_target 6.0 setenv path "/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/sdks/iphoneos7.0.sdk -l/users/mac/library/developer/xcode/deriveddata/myprojectname-dtjsurmh

excel - Creating a formula to copy cells depending on adjacent cells -

Image
i've got spreadsheet of company names , associated websites next of them. need create formula fill in missing website data correct data when website next company name. for instance in screenshot below, value in b3 needs copied b2. same b7 b6. , b13 b12 , b11 , fourth. some companies have no website @ if website present next last duplicate company name. how create formula this? i'm not sure start don't mind creating new columns , moving data around , sorting etc. if necessary. to deal company no web site start with: copy column c values except when countif 1 (insert unique identifier instead, maybe ¬) then (courtesy of @simoco): select entire range data. press ctrl+g , select special. choose blanks , press ok. selected cells type = , press ↑ key. press ctrl+enter. if want can copy result , make pastespecial-->paste values. and finally: replace ¬ nothing.

Django messaging framework messages not making it passed the redirect() -

i have "save" code sets success message using django messaging framework upon successful creation of record, redirect main 'application_update' view. i'm having trouble determining why these messages not making thru redirect. messaging seems work fine when doing "render_to_response", not when doing "redirect". function snippet (if post) in views.py: if ovrd_form.is_valid(): fields = {'application': ovrd_form.cleaned_data['application'], 'course': ovrd_form.cleaned_data['course'], * other field/values * } try: overrides = overrides(**fields) overrides.save() success_msg = 'override creation successful.' create_message(request, success_msg, 'success') except exception, exception: return httpresponse('error: ' + str(exception)) return redirect('application_update', app_id=app_id)

Jquery PHP Form -

i have link on page loads div using jquery function. on page there form submits database. form works when when type page in directly when function loads page, form doesn't work. $('.menu_top').click(function() { var href = $(this).attr('href'); $('#load').hide().load(href).fadein('normal'); return false }); this using load page div. have added class form , button. when click submit page flashes sql doesnt update when load doom, need use on command. try this: $('body').on('click','.menu_top',function() {

c++ - Is possible to hook some callback and then send some event/signal/interrupt from command line to running process -

i have c++ process running forever , data in memory (not in database). need change code , deploy new version , need stop process before need serialize file and/or save database ( have function inside running class can that). how trigger function, possible hook callback , send event/signal/interrupt command line ? ( can use 0mq , add command inside wonder there more elegant solution this).

Meteor ROOT_URL setting to make accounts-facebook work when behind apache proxy -

i'm running meteor on localhost:3000 , have apache set proxy requests domain meteor instance using virtualhost , mod_proxy. i'm getting error when trying log in meteor app using accounts-facebook: given url not allowed application configuration.: 1 or more of given urls not allowed app's settings. must match website url or canvas url, or domain must subdomain of 1 of app's domains. i think because root_url http://localhost:3000 . if change root_url domain, of course meteor tries listen domain, can't because apache server in way. is there way can make work without ip address? from meteor documentation, ensure $root_url matches authorized domain , callback url configure external service ( for instance, if running meteor behind proxy server, $root_url should externally-accessible url, not url inside proxy ). in case, app listening on configured port mod_proxy behind apache proxy server, listening http://www.example.com:8080

javascript - cant get canvas to display anything -

im trying draw tiles canvas followed tutorial, made sure images in same directory , cant see why isnt working tutorial. can please see error im failing see, driving me wall. <!doctype html> <html> <head> <meta charset="utf-8"> <title> rpg </title> <link rel="stylesheet" type="text/css" href="main.css"> <!--<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.0.min.js"> </script> <script type="text/javascript" src="main.js"></script>--> </head> <body> <canvas id="canvas" height="900px" width="900px"></canvas> <script> var canvas = document.getelementbyid('canvas'); var context = canvas.getcontext('2d'); var map_array = [ [0,0,0,0,0,0,0,0,1,1,0,0], [0,0,0,0,0,0,0,0,1,1,0,0],

Pair completion in Vim -

i coding in vim , have been getting more annoyed pair completion features. don't see need pair completion in general tend naturally try close pairs myself (by pair here mean type closing ')' of set of parentheses, example). annoys me when have text written , surround quotes example i'll @ beginning of word, type ' , 2 pop right on there rather 1 , me pivoting end of word , typing other exclamation point. anyways, that's rant, on stopping vim doing appreciated. use spfvim-13 ( https://github.com/spf13/spf13-vim ) , have modified .vimrc slightly. wasn't able pinpoint specific issue arises. this not native vim behavior, it's plugin causing it. can't pin-point particular plugin spf13 might having this, looked popular ones know, simple_pairs, delimitmate etc. best way investigate what's causing see output of :verbose imap ' , you'll come know it's being set , remove plugin / setting.

sql server - how to pass multiple values in single parameter and how to convert varchar value into integers -

create table students ( id int, name varchar(20) ) insert students(id,name)values(1,'danny') insert students(id,name)values(2,'dave') insert students(id,name)values(3,'sue') insert students(id,name)values(4,'jack') insert students(id,name)values(5,'rita') insert students(id,name)values(6,'sarah') this stored procedure alter procedure emp_sp ( @std_id varchar(500), @std_name varchar(500) ) begin select *from students s s.id in(convert(int,@std_id) ,',') , s.name in(@std_name) end go here execute manually exec dbo.emp_sp @std_id='1,2,3', @std_name='"danny","dave","sue"' but error: msg 245, level 16, state 1, procedure emp_sp, line 8 conversion failed when converting varchar value ',' data type int. anyone can guide me. to current approach working, need use dynamic sql, incredibly fragile , prone sql injection attacks. example of here the

javascript - Different cookie name -

Image
can red , blue outlined names different. have written code below. or if there better way. set_custom_cookies: function ( cookiename,cookiedata,days ) { if ( days ) { var date = new date(); date.settime( date.gettime()+( days*24*60*60*1000 ) ); //cookie expiration date var expires = "; expires="+date.togmtstring(); } else var expires = ""; //add cookie info document.cookie = cookiename + "=" +cookiedata + expires + "; path=/"; } when pass data function set_custom_cookies() send argument cookiename . name of cookie want change. call else. set_custom_cookies("mycustomname", cookiedata, days);

Using mysql like clause in php -

mysql query works fine me : select * `review_details` category = 'italian' , review '%cozy%'; it display results. select * `review_details` category = 'italian' , review %cozy%'; but when execute in php script : $word = 'cozy'; $select = mysqli($con,"select * `review_details` category = 'italian' , review %.$word.%' "); then not display result. please see query correct, when change condition gives result. change like %.$word.%' like '%$word%'

php - Insert a unix_timestamp into a mysql database -

i'm trying create function in php can save unix_timestamp mysql database keep getting error message invalid parameter numbers. this code function: function addnew($array){ $sql = 'insert user (id, acronym, name, password) values (?, ?, ?, unix_timestamp());'; $id = isset($_post['id']) ? $_post['id'] : null; $acronym = isset($_post['acronym']) ? $_post['acronym'] : null(); $name = isset($_post['name']) ? strip_tags($_post['name']) : null; $password = isset($_post['password']) ? strip_tags($_post['password']) : null; $params = array($id, $acronym, $name, $password); $res=$this->db->executequery($sql, $array); if($res) { $output = 'användare skapad!'; } else { $output = 'användare kunde tyvärr ej skapas.<br>'; } return $output; } this code user input: $cont = new cuseradmin($db); $id = isset($_post['id']) ? $_post['id'] : null; $acron

c - Something about "-Wl,-rpath=." -

i have build shared library libc.so, , depends on liba.so , libb.so. , build test.c using libc.so via command: gcc test.c -o test -fpic -i./ -l./ -lc it output error, not find symbols in liba.so , libb.so. know, tt can build successufully when add flags "-la -lb". however not understood, why can build via following command: gcc test.c -o test -fpic -i./ -l./ -lc -wl,-rpath=. i think liba.so , libb.so present in current directory. providing linking option -wl -rpath current directory. linker takes libraries in current directory , link symbols. it not giving errors because of linker options have specified. the next doubt might is, have specified directories search not specified libraries. how linker taking liba.so , libb.so libraries also? linker intelligent , thinks have forgot include these interdependent libraries (you might not know interdependency)but have specified path search dependent libraries. picks interdependent libraries. i think works in

javascript - Chrome webkitNotification not found : api missing -

i developing alert notification extension using angularjs. fetches alerts rest api , shows noification (webkitnotifications). on laptop (where developing) hell broke when sifted desktop testing. error : referenceerror: webkitnotifications not defined @ chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/background.js:156:5 @ chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:72:169 @ e (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258) @ e (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258) @ e (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:100:258) @ chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:102:5 @ h.$eval (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:112:179) @ h.$digest (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.min.js:109:268) @ h.$apply (chrome-extension://dncdcpdlbnnhncggaenbpknljjbmdlpo/js/angular.

Android - AutoCompleteTextView onClickListener works after second click -

i have 4 autocompletetextview s (actv) , they're working fine. created onclicklistener() them know when user selects/presses of 4 @ point in time. however, upon close inspection, noticed had click actv twice before triggered. here code: in oncreate() , initialize actv , set onclicklistener() : brandactv = (autocompletetextview) findviewbyid(r.id.actvbrand); itemactv = (autocompletetextview) findviewbyid(r.id.actvitemname); partactv = (autocompletetextview) findviewbyid(r.id.actvpart); barcodeactv = (autocompletetextview) findviewbyid(r.id.actvbarcode); brandactv.setonclicklistener(actvclicked); itemactv.setonclicklistener(actvclicked); partactv.setonclicklistener(actvclicked); barcodeactv.setonclicklistener(actvclicked); and onclicklistener() defined so: onclicklistener actvclicked = new onclicklistener(){ @override public void onclick(view view){ log.d("hi", "onclickactivated"); switch (view.getid()) { cas