Posts

Showing posts from February, 2012

width - nbconvert to convert from notebook to Latex/PDF cuts off the dataframe -

i have notebook displays lots of dataframe tables in html format. when used nbconvert convert notebook latex , pdf, tables wider body gets cut off. have tried using pd.set_option('display.width', xxxx) didn't seem work. seems issue not in display of pandas dataframe( table displayed fine on notebook ), rather in converting notebook latex/pdf. there can resolve problem?

javascript - Image swapping when a variable changes -

i have html page has 1 image object. i trying write javascript isn't working in script. have piece of script reads variable , if variable 'e' equal 1, 1 image appears. if 'e' other number image 2 appears. now, 'e' static, dynamic. how change image dynamically based off variable? any appreciated. <!doctype html> <html> <head> <meta charset="utf-8"> <title>title of document</title> <body onload="changei()"> <img id="im1" src="images/lion1.jpg" width="100" height="180" style="display:show"> <p> hello</p> <script> function changei() { var e = 0; changei(e); // changed e in e = 0; change(e); function changei(e) { var loc = ''; if (image.src.match("lion1")) { image.src = "i

jquery - Curtain.js effect not working after launching single page website -

the curtain.js effect (jquery plugin) on single page website (www[.]webmill[.]eu) went dead after launched website. when click menu items on initial website view nothing happens , can't scroll them either. on mobile display seems working according plan: function triggeranimation(){ if(mq == 'desktop') { //if on desktop screen - animate sections (!window.requestanimationframe) ? animatesection() : window.requestanimationframe(animatesection); } else { //on mobile - remove style added jquery $('.section').find('.container-fluid').removeattr('style').find('.half').removeattr('style'); } //update navigation arrows visibility checknavigation(); } in general it's meant behave this: http://goo.gl/uxtmw3 until believing responsive design related research turned out otherwise , far nothing has done trick. any highly appreciated! i dont know if relative have javascript

angularjs - select dropdown has an extra option -

Image
how can remove first empty < option > in select drop down? want first < option > "-select-". html <div ng-controller="examplecontroller"> distance in km <span class="nullable"> <select ng-model="mycolor" > <option value="null">- select -</option> <option value="10">10</option> <option value="20">20</option> <option value="30">30</option> <option value="50">50</option> <option value="100">100</option> </select> </span><br/> </div> script angular.module('selectexample', []) .controller('examplecontroller', ['$scope', function($scope) { $scope.mycolor = ''; }]); use ng-init initialize default blank value , set blank value

ios - Cordova iPad app – brightness randomly changes -

i have simple cordova ipad app, using fullscreen html5 canvas (and createjs library). when app running, screen brightness randomly changes – darker, lighter. far can tell, device brightness not changing (i.e brightness slider in ios control center doesn't shift). the problem doesn't occur when app runs outside cordova web app, believe cordova-related issue.

angularjs - Angular templating and routing with jquery -

i'm working on first angular website templating , routing. i want image size of window - 70px //jquery (this part works fine alone, tested it.) //dynamically assign height function resize() { var windowheight = $(window).height() - 70; $('.home .image img').height(windowheight); } //initial load of page $( window ).ready(resize); //every resize of window $(window).resize(resize); my problem when load home.html(where picture , act frontpage) index.html doesn't apply style windowheight image, if manually resize window bit, style applies. i tried inserting script directly home.html , works prefer have jquery separate in .js file my guess script doesn't registrer home.html has been loaded index.html until resize has been triggered. note: stylesheets , scripts loaded in index.html head, , pages loaded index.html ng-view looks @ moment <div class="image"><img src="images/56.jpg"></div> sorry bad exp

c# - Geoposition deserialization error (Newtonsoft.Json) -2146233088 -

i'm trying deserialize geoposition object in windows phone (winrt) app getting exception : -2146233088 message: "unable find constructor use type windows.devices.geolocation.geoposition . class should either have default constructor, 1 constructor arguments or constructor marked jsonconstructor attribute. path 'civicaddress'". is geoposition not compatible newtonsoft json.net? if not, use in finding workaround. the code snippet below shows exception thrown. public async void sample() { geolocator geo = new geolocator(); geo.desiredaccuracyinmeters = 50; var x = await geo.getgeopositionasync(); geoposition geo = jsonconvert.deserializeobject<geoposition>(currentcontext.locationasstring); await eventmap.trysetviewasync(geo.coordinate.point, 18d); } it seems geoposition has read-only properties, , no public constructor takes values these properties constructor arguments. can serialize it, not construct d

c++ - Bullet Physics - Orienting a rigid body -

i'm trying orient cylinder in bullet. right now, cylinder thing in simulation. have found answers here, , believe close, still no rotation. here function creating cylinder, maybe jump out @ someone. what doing incorrectly? void createcylinder(int index, double x, double y, double z, double radius, double length, int yaw, int pitch, int roll) { btscalar mass = 1; btvector3 position(x,y,z); btvector3 cylinertia(0,0,0); //create collision shape btcollisionshape* cylcoll = new btcylindershape(btvector3(radius,length,1)); //default motion state btdefaultmotionstate* ms = new btdefaultmotionstate(bttransform(btquaternion(0,0,0,1), btvector3(0,10,0))); //calculate inertia cylcoll->calculatelocalinertia(mass, cylinertia); //construction info btrigidbody::btrigidbodyconstructioninfo cylci( mass, ms, cylcoll, //collision shape cylinertia //inertia ); btrigidbody *cylinder = new btrig

perl6 - How can I run external programs using Perl 6? (e.g. like "system" in Perl 5) -

i can use system in perl 5 run external programs. think of system miniature "linux command line" inside perl. however, cannot find documentation system in perl 6. equivalent? in addition using shell or run , replace system perl 5, can use nativecall invoke libc system function. on windows box, looks this: use nativecall; sub system(str --> int32) native("msvcr110.dll") { * }; system("echo 42");

ios - Where to check iAd revenue? -

i integrated iads in app, not sure how check iad revenue. in itunes connect, don't seem find place find revenue. research new itunes connect, few posts suggested https://iad.apple.com/ but when try login developer id, loops same login page again without errors or anything. have tried safari 8.0.2 , firefox 37.0.1 does else have issue? or need special access site? you should able see income / revenue on sales & trends or payments sections. you should more research before asking though...

ios - Why is my tableview cell behaving differently when I swipe-delete at different speeds? -

i've uploaded video of behavior here (dropbox link). when swipe-to-delete cell quickly, uilabel on right side of cell appears move closer right edge of cell. stays there until swipe-to-delete slowly. if slowly, label stays in right spot , never seems move. the label placed there autolayout constraint (trailing space superview, content view of cell). this began occur after downloading non-beta release of xcode 6.3 , updating device ios 8.3. i've tried debugging constraint pre/during/post editing, , label's constraints correct. happening?

assembly - MIPS: multiplying two 32 bit numbers, getting a 64 bit -

i attempting multiply 2 32 bit numbers in mips. have code here uses mult operation. use mfhi , mflo operations 2 parts mult, not sure how put these together. have them print out operations separately example. the input numbers have been using are: 1143330295 , 999999223 the output program (obviously needs work) is: 266202121 -1483441327 the correct output 1143329406632360785 or can in binary if easier. this code larger project working on have multiply 2 32 bit numbers using shift , add algorithm without using mult function. trying wrap head around representing 64 bit number first. advice/input. .data geta: .asciiz "please enter first number(multiplicand): " getb: .asciiz "please enter second number(multiplier): " space: .asciiz " " promptstart: .asciiz "this program multiplies 2 numbers. " mipmult: .asciiz "the product, using mips mult is: " endline: .asciiz "\n" .tex

WPF Disable Splash Screen Programmatically -

i have wpf application optionally accepts command line parameters. 1 of these parameters specifies "silent mode" (no ui). how can disable presentation of splash screen @ startup based on parameter? you should explicitly create instance of class splashscreen , , show/hide based on program arguments, instead of using splashscreen build action generate splash screen. you need set build action of splash screen image resource instead of splashscreen . for example: private void onstartup(object sender, startupeventargs e) { if (showsplashscreenargument) { splashscreen splashscreen = new splashscreen("yoursplashscreen.bmp"); splashscreen.show(); } // loading code here.. mainwindow mainwindow = new mainwindow(); if (showsplashscreenargument) { // close splash.. splashscreen.close(); } mainwindow.show(); }

php - What is the better way to combine this html into one by using array or variable? -

what better way combine these code one? have same class, id have same prefix name, use one, 2 , 3 differentiate them. thinking using like, array=('one','two','three') , then, become array[0],array[1], still cannot make them become one. appreciate help. <div class="user_voting" id="user_diet_one"> <div class="vote_title" id="diet_one"><span class="title_text">one:</span> </div><!-- vote_title--> <div class="my_vote_body" id="my_vote_one"> <input type="button" class="user_save_button" value="save"/> </div><!-- my_vote_body--> </div><!-- user_voting one--> <div class="user_voting" id="user_diet_two"> <div class="vote_title" id="diet_two"><span class="title_text">two:</span&g

sql - Using Visual Basic variables in a HTML editable form -

i new vb , programming , working sql database. trying make system can add, delete, edit database through vb web application. have setup scripts view database contents, delete rows, , add content. having trouble creating "edit/update" script. in php select * database, store variables , fill in html form variables. user can change he/she wants , update query update database. i unsure how vb. having hard time pulling values database , storing own vb variables, , unsure how put these variables html form let users edit them. here form. <form action="update.aspx" method="get"> <b><center><h2>edit name</h2> first name: <input type="text" name="firstname"> <p> last name: <input type="text" name="lastname"> <input type="submit" value="edit name"> </form> i need able put variables retrieved through sql using vb form.

css - How to determine height and width of text in HTML? -

i having trouble getting block of text in center of page. text trying center: <div id="directions"> <h2>use keyboard rotate face of cube in clockwise direction! <br>hold down shift key rotate desired face counter-clockwise. <br>use mouse rotate cube , zoom in , out.</h2> </div> in cascading style sheet, have following: #directions{ position:absolute; top:80px; left:31.5%; text-align:center; } with above code, text (somewhat) centered in browser when fullscreen. when change size of browser, text becomes awkwardly shifted , not centered @ all. know need specify height , width of text, there easier way it? or me out height , width of text be? thanks a centered layout works this: html <div id="directions"> <h2>use keyboard rotate face of cube in clockwise direction! <br>hold down shift key rotate desired face counter-clockwise. <br>use mouse rot

jquery - Fixing this so it works if the element is not on the current page -

i found fix sticky header , works great, on of pages '.menu' class doesn't exist. i'm wondering how can adjust run if element on current page. when it's not there getting error message. "uncaught typeerror: cannot read property 'top' of undefined" because .menu isn't there // create clone of menu, right next original. $('.menu').addclass('original').clone().insertafter('.menu').addclass('cloned').css('position','fixed').css('top','0').css('margin-top','0').css('z-index','500').removeclass('original').hide(); scrollintervalid = setinterval(stickit, 10); function stickit() { var orgelementpos = $('.original').offset(); orgelementtop = orgelementpos.top; if ($(window).scrolltop() >= (orgelementtop)) { // scrolled past original position; show cloned, sticky element. // cloned element should ha

c++ - Configure NetCDF on Visual Studio -

i'm working on c++ project handles weather data in netcdf format. downloaded netcdf binaries this link , installed it. also configured vs project follows: vc++ directories -> library directories = c:\program files (x86)\netcdf 4.3.3.1\bin;c:\program files (x86)\netcdf 4.3.3.1\lib; c/c++ -> additional include directories = c:\program files (x86)\netcdf 4.3.3.1\include linker -> input = netcdf.lib but problem cannot access netcdf namespace. using namespace netcdf; //gives error but accessing header files doesn't make trouble #include <netcdf.h> //no error can me out on this.......... netcdf c-library, has no namespaces, such should remove "using namespace netcdf".

Trying to recreate Google homepage (HTML/CSS), Can't get footer to stay at bottom -

Image
keep getting (red footer bar) advice on getting rid of it? saw code online keep footer @ bottom, tried keeps appearing @ middle of screen. project trying copy of google (no need functioning search). first time attempting this, bit lost. the red footer (covering search bar) <body> <div id="wrapper"> <div id="trio"> <div class="triple" id="you"> <a href="google.com">+you</a> </div> <div class="triple" id="gmail"> <a href="gmail.com">gmail</a> </div> <div class="triple" id="images"> <a href="google.com">images</a> </div> </div> <img src="https://www.google.com/images/srpr/logo11w.png"> <div id="se

Perl "Out of memory!" when processing a large batch job -

a few others , happy maintainers of few legacy batch jobs written in perl. 30k lines of code, split across maybe 10-15 perl files. we have lot of long-term fixes improving how batch process works, in short term, have keep lights on various other projects depend on output of these batch jobs. at core of main part of these batch jobs hash loaded bunch of data collected various data files in bunch of directories. when these first written, fit nicely memory - no more 100mb or so. things of course grew on years, , hash grows box can handle (8gb), leaving nice message perl: out of memory! this is, of course, poor design batch job, , have clear (long-term) roadmap improve process. i have 2 questions however: what kind of short-term options can at, short of throwing more memory @ machine? os settings can tweaked? perl runtime/compile flags can set? i'd understand why perl crashes "out of memory!" error, opposed using swap space available on machine. for refe

c# - Azure Document DB UpdateDoc -

i starting off azure document db. trying update existing document. when use following query works: dynamic team2doc = client.createdocumentquery<document>(documentcollection.documentslink).where(d => d.id == "t002").asenumerable().firstordefault(); team2doc.teamname = "updated_team_2"; await client.replacedocumentasync(team2doc); but if use below code: dynamic team2doc = client.createdocumentquery<document>(documentcollection.documentslink).where(d => d.teamname== "team1").asenumerable().firstordefault(); team2doc.teamname = "updated_team_2"; await client.replacedocumentasync(team2doc); i error: "the best overloaded method match 'microsoft.azure.documents.client.documentclient.replacedocumentasync(microsoft.azure.documents.document, microsoft.azure.documents.client.requestoptions)' has invalid arguments" is there anyway retrieve document 1 of properties , update document? the

activerecord - Rails 4 associations - modeling parties, invites, and users -

i'm attempting setup associations following scenario (from odin project): "you hosting people dinner want build dinner party invitation site. user can create parties, invite people party, , accept invitation else's party." i came code below have few questions: class user < activerecord::base has_many :parties, foreign_key: :host_id has_many :invitations_sent, class_name: "invitation", foreign_key: :host_id has_many :invitations_rcvd, class_name: "invitation", foreign_key: :guest_id has_many :guests, through: :invitations_sent has_many :hosts, through: :invitations_rcvd end class invitation < activerecord::base belongs_to :host, class_name: "user" belongs_to :guest, class_name: "user" belongs_to :party end class party < activerecord::base belongs_to :host, class_name: "user" has_many :invitations

javascript - Creating FabricJS object inside function -

i don't understand problem exactly. it's in oop. so create own class work canvas through fabricjs, , create method add door (i cupboard). method creates fabric.rect. called method 3 times , got 3 doors (rects), should be. when try select 1 of them canvas returns last one. look @ example jsfiddle , try select 1 of 2 first doors. function dveri_kupe(options){ var defaultoptions = { doorwidth: 200, doorheight: 400, doordivisionwidth: 5, totalwidth: 735, totalheight: 500, startoffsettop: 50, startoffsetleft: 50, strokecolor: "#aaa", fillstyle: "#ccc", linewidth: "5" } for(var option in defaultoptions) this[option] = options && options[option]!==undefined ? options[option] : defaultoptions[option]; var this_ = this; this.doorarr = [] canvas = this._canvas = new fabric.canvas(options.canvasid); canvas.on('mouse:down'

ruby - LocalJumpError: no block given -

i keep getting error while running rspec file: failures: 1) book title should capitalize first letter failure/error: @book.title("inferno") localjumperror: no block given (yield) # ./08_book_titles.rb:7:in `title' here book_title.rb class :: book attr_accessor :some_title def title(some_title) little_words = %w(of , on under or nor yet @ around after along on without) some_title = yield some_t

printf - <MATLAB> How can I save huge data to .txt file? -

i made 865850 4464 matrix. then need save .txt file. for that, use fprintf, met hard obstacle.... there 4464 columns. how can designate formatspec? they integers. now know 1 way... fprintf(fid, '%10d %10d.....%10d', zeros); (4464times..) is way save them? thank you~!! clear all; close all; loop = 1; zeros = zeros(15000, 4464); fileid = fopen('data2.txt','r'); while loop < 4200 data = fscanf(fileid, '%d %d %d:%d %d\n', [5, 100000]); data = data'; dataa = data(:,1); datab = data(:,2); datac = data(:,3); datad = data(:,4); datae = data(:,5); m=1:100000 r = dataa(m); c = ((datab(m)-1)*24*6 + datac(m)*6 + datad(m))+1; zeros(r,c) = datae(m); end n=1:4464 zeros1{n}=zeros(:, n); fileid2 = fopen('result.txt','a'); fprintf(fileid2, '%10d %10d\n ', zeros1{1}, zeros1{2}); end fclose(fileid2); loop =

java - JLabel with multiple lines and alignment to the right -

i searched through many posts , figured out jlabel supports html. can jlabel search = new jlabel("<html>search<br/> by:</html>"); to multiple lines. above code result in search by: however, want search by: adding spaces before "by:" work when window not resizable(and silly lol). can tell me how modify code make work wanted? slightly simpler html seen in @madprogrammer's answer: new jlabel("<html><body style='text-align: right'>search<br>by:");

javascript - AJAX upload file and text not work -

Image
i using ajax code submit form , upload multiple input file. want send form data via ajax. text input send file input not successful post via ajax! how change code? $("#add_order").click(function () { //*****get data input var formdata = new formdata(); formdata.append( 'action', 'add_order'); formdata.append( 'customer_name', $('input[name=customer_name]').val()); formdata.append( 'date', $('input[name=date]').val()); formdata.append( 'order_status', $('input:radio[name=order_stautus]').val()); formdata.append( 'total_price', $('input[name=totalprice]').val()); formdata.append( 'quits', $('input[name=quits]').val()); formdata.append( 'debt', $('input[name=debt]').val()); formdata.append( 'desc', $('#desc').val()); formdata.append( 'desc2', $('#desc2

javascript - Using requirejs to load React Components with a parent/child relationship -

i working on highly pluggable ui using react/flux, , loading modules requirejs. i couldn't around problem, due poor knowledge of requirejs. there layer of indirection, root of problem this: i have react component in module following render function: render: function() { <div> <component b /> </div> } and component b, in separate module simple like: render: function() { <div> text </div> } in top-level module dive requirejs, can componenta this: require(['componenta'], function(componenta) { react.render(react.createelement(componenta,document.getelementbyid('main')); }); this works great, until try , use componentb in render function of componenta...componenta naturally has no idea componentb is, i'm not sure of right approach or how require componentb before componenta tries render. note: i'm converting jsx plain js beforehand, shouldn't factor. any tips? it sounds modules not

Is it possible to send a value to php file whilst performing a jquery GET request -

i making request in jquery php file , need send variable php use in query. possible? want grab emailaddress variable in php. function getdata(){ var emailaddress = "myemail@gmail.com"; $.getjson('myfile.php', function(data){ $.each(data, function(key, val) { $("#userage").val(val.age); }); }); } so in php want able select have email address have passed in. i have use jquery , php developing hybrid app in phonegap cant use php directly. thanks. the optional second argument used passing parameters: $.getjson('myfile.php', { email: emailaddress }, function(data) { $.each(data, function(key, val) { $("#userage").val(val.age); }) }); in php script use $_get['email'] email address.

ios - UIActivityViewController in Swift Crashes on iPad -

i making share function in game , have code , works fine on iphone when test on ipad, when tap share button app crashes. using following code share button let texttoshare = "check out website!" if let mywebsite = nsurl(string: "http://www.apple.com/") { let objectstoshare = [texttoshare, mywebsite] let activityvc = uiactivityviewcontroller(activityitems: objectstoshare, applicationactivities: nil) self.view?.window?.rootviewcontroller?.presentviewcontroller(activityvc, animated: true, completion: nil) } the uiactivityviewcontroller's has non-null popoverpresentationcontroller property when running on ipad. so, try below. if let wppc = activityvc.popoverpresentationcontroller { wppc.sourceview = view // or wppc.barbuttonitem = bar button item } presentviewcontroller( activityvc, animated: true, completion: nil )

PHP + HTML HOTEL FORM -

html <form name="contactform" method="post" action="send_form_email.php"> <table width="450px"> <tr> <td valign="top" "> <label for="first_name ">first name *</label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="last_name">last name *</label> </td> <td valign="top "> <input type="text " name="last_name " maxlength="50 " size="30 "> </td> </tr> <tr> <td valign="top "> <label for="email ">email address *</label>

python - How can I combine PyQt4 and Tornado's event loops into one application? -

i trying program application runs http server gui using tornado , pyqt4 respectively. confused how use these 2 event loops in parallel. can done multiprocessing module? should http server run in qtthread? or bash script best way go run both of these processes @ same time? you won't need bash script. simplest write pyqt application , have application launch web server. server may in separate thread or process depending on requirements, i'd start having single thread first draft , splitting out later. having pyqt app main thread makes sense gui going responsible user inputs (start/stop server, etc) , program outputs (server status, etc) , therefore makes sense make controlling thread references other objects or threads.

ruby on rails - Unwanted display of collection object after iterating through the collection in a view -

Image
i have block iterates through collection of tags , creates links them. the issue have after returns formatted links, returns entire actsastaggableon object text. wish display formatted links. here's partial: <h4>tag cloud</h4> <div> <%= tag_cloud @tags, %w[s m l ] |tag, css_class| %> <%= link_to tag.name, tag_path(tag), :class => css_class %> <% end %> </div> image below shows how returning both formatted links , collection object - don't want display. what need change? in erb, <%= %> display whatever line of code returns. while <% %> executes line of code. change <%= tag_cloud @tags, %w[s m l ] |tag, css_class| %> <% tag_cloud @tags, %w[s m l ] |tag, css_class| %> , object won't displayed.

python - naming objects from a list of names -

i using graphics.py create simple ui. want set number of entry objects fields. there way loop through list of field names , use them variable names create entry objects? or dreaded "dynamic variable" boogeyman seems avoided @ costs? conceptually, i'd able write this: from graphics import * window = graphwin("contact data", 200, 200) x = 100 y = 10 field_names = ['name', 'address', 'phone'] field_text = ['al', '123 4 street', '555-666-7777'] in range(len(field_names)): field_names[i] = entry(point(x, y + 30 * i), 15) field_names[i].draw(window) field_names[i].settext(field_text[i]) # don't know how embed image here show window window.getmouse() window.close() to yield: print(name) al print(address) 123 4 street print(phone) 555-666-7777 but get: print(name) traceback (most recent call last): file "d:\googledrive\cmpt103\graphics\untitled-1.py", line 15, in 0 builtins.nameerror: name

vb.net - IP camera HK vision url streaming in vb .net -

dim mjpegsource new mjpegstream("rtsp://192.0.0.64:554/cam[channel]/mjpeg") mjpegsource.login = "admin" mjpegsource.password = "" videosourceplayer1.videosource = mjpegsource error url prefix not recognized how fixed vlc can streaming mjpegstream expects feed motion jpeg on http. http request/response camera infinitely sends sequence of jpeg images on established http link. your url starts rtsp:// , suggests identifier of rtsp compliant resource. camera sends data in conformance rtsp protocol, rtp payload motion jpeg encoding. rtsp identifier, protocol, connection incompatible mjpegstream class.

java - Doing a Monte Carlo Analysis of the Birthday Paradox using a HashSet -

disclaimer : not want answer problem. need guidance. i want perform monte carlo analysis on infamous birthday paradox (determining probability @ least 2 people in given group share same birthday) using hashset . now when run this, collisioncount way lower expected be.first, expecting collisioncount group of 10 people 11446 (or probability of 0.11446). time got 100 people, expecting collisioncount 100,000 (with probability of 1.0). instead, every 10 people, collisioncount counts 1 (10 people: 1 collision, 20 people: 2 collisions, 30 people: 3 collisions, etc). here code have wrote far : import java.util.hashset; import java.util.random; import java.util.set; public class birthdayparadox { public static void main(string [] args) { random rand = new random(); int tests = 100000; int collisioncount = 0; for(int people = 10; people <= 100; people += 10) { set<integer> birthdays = new hashset<>(365); birthdays.add(rand.nex

jquery - Automatically display div on mouse hover and hideaway when mouse remove -

i have following div html code. <div class="container"> <div class="images"> <img src="<?php echo base_url();?>assets/images/products/<?php echo $product->image;?>" /> </div> <div class="compareme"><h3>compare me</h3></div> </div> and followig css , jquery code: .compareme{ position:absolute; bottom:70px; left: 110px; height: 300px; width:100%; background:blue; display:none; text-align: center; margin-left: 25px; margin-right:30px; font-size:12px; } $('.product-images').on('mouseover',function(){ $('.compareme').show(); }); the problem is, when hover .image div, divs display compare me message. wanted when on over .image div, particular .compareme should appear , fade away when

c# - Why is log4net creating an empty log file before configuration? -

my log4net creating empty log file in debug/release folders reason. example filename "(null) 20150409.txt". i'm not sure how tell not that. programmatically configuring log4net, empty file created before configuration routine run, perhaps result of app.config file itself. here app.config file: <?xml version="1.0"?> <configuration> <configsections> <section name="log4net" type="log4net.config.log4netconfigurationsectionhandler,log4net"/> </configsections> <log4net> <root> <level value="all"/> <appender-ref ref="logfileappender"/> </root> <appender name="logfileappender" type="log4net.appender.rollingfileappender, log4net"> <!--http://logging.apache.org/log4net/release/config-examples.html--> <!--http://logging.apache.org/log4net/release/faq.html--> <!--&l

swift - UIKit dynamics slowing gravity -

i'm using uikit dynamics create falling object , wondering if slow gravity make ball fall slower on command. example, object falling, press button, ball falls slower. how go doing this? here code (p.s. added squareview above didn't include because it's irrelevant question) var squareview: uiimageview! var gravity: uigravitybehavior! var animator: uidynamicanimator! var collision: uicollisionbehavior! func viewdidload() { super.viewdidload() animator = uidynamicanimator(referenceview: view) gravity = uigravitybehavior(items: [squareview]) gravity.gravitydirection = cgvector(dx: 0.0, dy: 1.1) animator.addbehavior(gravity) } i tried writing gravity.gravitydirection = cgvector(dx: 0.0, dy: 0.5) flung object across screen frantically don't know here. you can change magnitude of gravity behavior. (alternatively, possibly can change drag of falling object giving uidynamicitembehavior resistance , haven't tried i'm not of it.)

Python multiprocessing pool get integer identifying call -

import multiprocessing def func(): # print call index pass p = multiprocessing.pool(4) p.map(func, data) in above code, possible print in func(), integer identifying number of times has been called 0, 1... i want because there code in func() want execute once, , cannot moved outside of func() what want involves sharing state between processes -- can hairy in python. if don't think can restructure program avoid it, multiprocessing has of useful synchronization constructs threading module: https://docs.python.org/2/library/multiprocessing.html#synchronization-between-processes . sounds maybe need lock , shared memory.

javascript - Move a list item from left to right or right to left updating data-attribute -

this in reference of question "reorder list elements - jquery?" asked here now want move little further. wanting do, wanting build comparison product items ecommerce. so, here find reordering list item. want add 2 button in each list item named "left" , "right", though here have shown 1 i.e "right". on clicking the "right" button "data-sortby" value update +1 , list move right i.e. in next position , next positioned list item reorder it's previous position. in short side side movement of li items. so html below:[just added buttons] <ul id="ulname"> <li data-sortby="1">three <a href="javascript:;" class="rgth" >right</a></li> <li data-sortby="2">one<a href="javascript:;" class="rgth" >right</a> </li> <li data-sortby="3">two<a href="javascript:;" class="rgt

javascript - How can I change the text of a button when it is disabled using AngularJS? -

i have save button disabled when form pristine. want saved when pristine , change save when form dirty. working fine except text change button. here code: <input type="button" value="saved" class="button success radius expand" ng-click="save(form)" ng-disabled="!signupform.$dirty" ng-class="{disabled:!signupform.$dirty}"> if want make inline do: <input type="button" value="{{(signupform.$dirty)? 'save' : 'saved'}}" class="button success radius expand" ng-click="save(form)" ng-disabled="!signupform.$dirty" ng-class="{disabled:!signupform.$dirty}"> you can create function in controller return text. can useful if logic larger (different texts various specific cases). html <input type="button" value="{{getinputtext()}}" class="button success radius expand" ng-click="save

javascript - Unable to get data from table where <tr> tag have <th> and <td> by jquery mobile -

i try data table on listview click , in want row value it's key , data . you can check html , jquery link . here html code: <div data-role="page" id="home"> <div data-role="header" data-position="fixed" class="header_top" data-fullscreen="false"> <h1>example client</h1> </div> <div data-role="content"> <!-- navigation bar once in horizonal menu--> <ul data-role="listview" data-inset="true" id="homelist" data-theme="a"> <li data-role="list-divider">divider heade 1</li> <li> <a href="#bar" id="1"> <table style="width:100%" class="ui-responsive table-stroke" id="table_one"> <tbody id="tablebody&q

javascript - What is jQuery DataTables data amount limit -

in other words, amount of data can pass it. i'm used server side pagination , know if have let's 10000 rows in table , want display it, chunks of data server , display browser. can data in 1 shot , pass jquery datatables , forget server side implemented pagination , server side implemented row sorting ? i hope clear enough asking question yes can that. if using v1.9 need use sajaxsource in datatables initialisation, don't enable bserverside (server side processing). v.1.10 equivalent ajax $(document).ready(function() { $('#example').datatable( { "ajax": '../ajax/data/arrays.txt' } ); } ); code taken datatables.net example

ios - UIKit<-segue->SpriteKit memory leak -

i enjoy swift, ios development. i add segue between viewcontroller(for uikit), , viewcontroller(for spritekit). i run iphone simulator, memory navigator increase 30m per switch viewcontroller. osx 10.9.5, xcode.6.1.1 new -> project -> game new -> file -> swift file -> firstviewcontroller.swift drag viewcontroller library storyboard, set custom class: firstviewcontroller set arrow firstviewcontroller select firstviewcontroller, option&drag gameviewcontroller(segue) set identifier "togame" select gameviewcontroller, option&drag self exit set identifier "back" code: class firstviewcontroller: uiviewcontroller { @ibaction func returnmenu(segue: uistoryboardsegue) { println("back!") } override func touchesended(touches: nsset, withevent event: uievent) { performseguewithidentifier("togame", sender: nil) } } class gameviewcontroller: uiviewcontroller { override func

[HTML][CSS] How to change opacity of background-image but not the text on it? -

i want create square background image , text on , manipulate background image's opacity. the problem when applying opacity value, changes text. tried put 2 sections inside square, tried change opacity of background image , set opacity of text 1 doesn't work. html: <section> <p>test</p> </section> css: section { height: 200px; width: 300px; background-image: url(graphic/background.jpg); opacity: 0.5; } section p { color: white; opacity: 1; } use following css solve issue: give image url section after or before . , give opacity that. so, not effect text. section { width: 200px; height: 200px; display: block; position: relative;} section:after{ content: ""; background: url(http://video-js.zencoder.com/oceans-clip.png); opacity: 0.5; top: 0; left: 0; bottom: 0; right: 0; position: absolute; z-index: -1; } } section p { opacity: 1;} <body>

html - Is there a way to make CSS (and browser) use system's version of a font if it exists, otherwise font-face? -

i want use font (and have browser download it) if os browser on doesn't have font built in. possible? currently, define font @font-face causes broswer download font automatically. want happen if font not on system. in @font-face , specify local source, e.g. @font-face { font-family: open sans; src: local('open sans') , url('../fonts/open-sans.woff') format('woff'); } note users may have broken local fonts.