Posts

Showing posts from September, 2014

javascript - Close hover div in IE 11 -

when hover 1 div code executed,and bizdetails show, now want when mouse out in bizdetails div it's close my code is $("div.bizdetails").css("left", -$("div.images").width() / 2).fadein('slow', function () { $("body").mousemove(function (e) { if (!$(e.target).parent().hasclass("bizdetails") && !$(e.target).hasclass("bizdetails")) { $("div.bizdetails").fadeout(); } }) }) this code work fine in chrome , firefox but in ie work in first use,and in secound when hover div , bizdetails show , close, bizdetails html <div class="bizdetails" style="left: -71.5px; display: block;"> <img src="../static/css/images/img1.png"> <h2>graphic</h2> <p>decription</p> <span>texttexttexttexttexttextex</span> </div> please me

animation - Transition chaining and cancellation -

i have 2 functions perform animations on lines. first function, one executed @ beginning, in order perform operations on enter selection, , animates lines' horizontal movement ( x1 , x2 ). second function two animates lines' height (only y2 , y1 stays fixed). through user events, function one cannot interrupted function two , vice versa (also because animation in two considerably longer). means that, when transition two still running, user can trigger one . this gave me serious headaches, because one somehow take values of last state of running transition of two instead of correctly assigning data-driven value (i.e. .attr('y2', function(d){ ... }); ). http://jsfiddle.net/h39wn/6/ - please following: click on one . see horizontal movement animated data changes. see @ end of execution, lines should ordered lowest highest. click on two once , wait full 2 seconds until animation completed. click on one again. desired behavior. now click on two , wai...

apple push notifications - When one PushSharp message fails, they all fail -

i'm using push sharp library send push notifications apple apn server. code works great, can send 1000s of notifications. the problem is, if attempt send notification invalid device token receive failure message push sharp framework pushsharp.apple.notificationfailureexception , every message queued after point not sent. basically, pushsharp clears queue if single notification fails. for example, if queue 4 notifications (1,2,3,4) , notification 2 has invalid device token, notification 1 sent, 2 fail, , 3 , 4 not sent (and no event fired informing of this). i understand notification invalid device token not sent not acceptable drop other n queued notifications on floor. are there workarounds this? here's code: _applesettings = new applepushchannelsettings(!notification_service_use_development, notification_service_use_development ? ssl_certificate_name_dev : ssl_certificate_name_prod, ssl_certificate_password); _applesettings.connectiontimeout = notificatio...

svn - How to extract information from tortoisesvn -

i'm using tortoisesvn in delphi xe2 project. i extract messages typed in moment commit in files create version documents clients. how can ? tortoisesvn => show log then select range of revisions (click on first or last revision want included, hold down shift, , click on last revision). right-click on highlighted revisions , select "copy clipboard" that give log message + modifications, in nicely formatted plaintext manner, , can take , format see fit.

Python ctypes and mutable strings calling Fortran DLL: Access Violation Error -

i trying call subroutine in fortran dll requires 3 mutable strings passed it. subroutine of form: subroutine getinfo(string_1, string_2, string_3, index) char *60 string_1, string_2 char *30 string_3 string_1 = "string 1 return value" string_2 = "string 2 return value" string_3 = "string 3 return value" end subroutine im calling function in python follows: dll = ctypes.windll.loadlibrary('library.dll') funcprot = getattr(dll, 'getinfo') funcprot.argtypes = [ctypes.c_char_p, ctypes.c_long, ctypes.c_char_p, ctypes.c_long, ctypes.c_char_p, ctypes.c_long, ctypes.c_long] string_1 = ctypes.create_string_buffer(60) string_2 = ctypes.create_string_buffer(60) string_3 = ctypes.create_string_buffer(30) funcprot(string_1, 60, string_2, 60, string_3, 30, 701) i following error. windowserror: exception: access violation reading 0x000002bd i tried suggestions post , didn't help. what doing wrong? thank help.

c++ - QT console application with Crypto++ library -

this driving me nuts. using crypto++ ver 5.6.2. qt 5.2.1 on mac osx. projects built inside qt creator. im not using make command line i build crypto++ unpacking , building follow: qmake -project deleted gnumakefile open in qt , modified .pro file adding macx { defines += cryptopp_disable_asm } the target cryptopp: target = cryptopp set release, ran qmake , did rebuild all. dylibs generated: libcryptopp.1.0.0.dylib libcryptopp.1.0.dylib (alias) libcryptopp.1.dylib (alias) libcryptopp.dylib (alias) created bare console application , included crypto class. modified .pro file follow: macx { # config += release cryptopp libs += /users/adviner/qt5.2.1/5.2.1/clang_64/lib/libcryptopp.1.0.0.dylib qmake_post_link += install_name_tool -change libcryptopp.1.0.0.dylib $$[qt_install_libs]/libcryptopp.1.0.0.dylib $(target) } in console test app in debug mode. ran qmake , rebuild all. keep getting following error: :-1: error: symbol(s) not found...

java - Streaming video from server using VideoView, error (1, -2147483648) with larger files (Sorry, this video cannot be played) -

as title says, i'm trying stream video app using videoview. works fine smaller videos, larger ones, refuses play ("sorry, video cannot played" popup, , server receives clientabortexception). i assume way works downloads whole file memory or , attempts load @ once (which perhaps device handle?). i've implemented chunked streaming functionality on server (parsing range headers, etc) imagine need implement same functionality client side well. can done videoview? here's server code (it works fine ios video player, requests in chunks default): fileinputstream in = new fileinputstream(file); servletoutputstream out = response.getoutputstream(); long begin = 0; long length, end = file.length(); list<integer> range = parserange(request); if (range.size() > 0) { begin = range.get(0); } if (range.size() > 1) { end = range.get(1); } int datalength = (int)(end - begin) + 1; response.setheader("accept-ranges", "bytes...

c# - Sending multiple files Client & Server -

i have client , server code files sending. reason need receive @ client , send server... everything work perfectly, in cases files sent , received perfectly. in cases after sending few files programm crashes. don't understand problem... errors: client colsole server console client // client code using system; using system.io; using system.collections.generic; using system.linq; using system.net; using system.net.sockets; using system.text; class client003 { const string destfilepath = @"..\..\..\"; const int buffersize = 1024; public static void startreceiving() { // data buffer sending data. byte[] buffer; // filestream read data filestream filestream; int filenamelen = 0; string filename = ""; long filelen = 0; int noofpackets = 0; int receivedbytes = 0; int i, j; // connect remote device. try { // establish r...

sql - Moving Data From One Table To Set Of Tables -

i preparing move data existing table, set of new tables. old table, inherited, growing (in columns), , new set developed try accomodate growth. data move move data entered old table new 'system' of tables. i've come rough logic plan , code, but, i'm pretty new in-depth in sql server, appreciate input , on best course of action. here's basic outline, not syntatically correct (due inexperience), helps illustrate steps needed. possible in outline, in single loop, or need break down smaller actions? loop through obj_out_old table, , copy data it... a. obj_out_old.courseid , put objectives.courseid b. obj_out_old.objective , put objectives.objective c. loop through outcome columns - begin --explanation of course year , course semester: --check year in obj_out_old.courseid (the last 2 digits - e.g. "79991208", "08" means "2008"), --check semester in obj_out_old.courseid (the 6th digit - e.g. if equals "1...

ios - GMSTileURLConstructor Returns Strange Data for Zoom -

i trying draw custom overlay on google maps ios using gmstileurlconstructor . i using following code url gmstileurlconstructor urls = ^(nsuinteger x, nsuinteger y, nsuinteger zoom) { nsstring *url = @""; (nsdictionary *limits in [selectedpropertymap objectforkey:@"property_map_zoom_levels"]) { int zoomlevel = [[limits objectforkey:@"level"] intvalue]; int tileminx = 0; int tilemaxx = 0; int tileminy = 0; int tilemaxy = 0; if ([limits objectforkey:@"tile_min_x"] != (id)[nsnull null]) { tileminx = [[limits objectforkey:@"tile_min_x"] intvalue]; } if ([limits objectforkey:@"tile_max_x"] != (id)[nsnull null]) { tilemaxx = [[limits objectforkey:@"tile_max_x"] intvalue]; } if ([limits objectforkey:@"tile_min_y"] != (id)[nsnull null]) { ...

java - Switch Statement Inside a method of another class -

public int alphcheck(char check){ switch(check){ case 'a': return 1; break; case 'b': return 2; break; case 'c': return 3; break; case 'd': return 4; break; case 'e': return 5; break; case 'f': return 6; break; case 'g': return 7; break; case 'h': return 8; break; case 'i': return 9; break; case 'j': return 10; break; case 'k': return 11; break; case 'l': return 12; break; case 'm': return 13; break; case 'n': return 14; break; ...

android - if loop inside if loop -

here code having problem with. if (adi == 1) { if (rs >= 10) system.out.println("oooooooo"); { // todo codes incomplete system.out.println("ohhhhh"); vib2.vibrate(600); mediaplayer mp = mediaplayer.create(getbasecontext(), r.raw.beep02); mp.start(); } finish(); } the problem don’t check rs>=10 play mp , vibrate . rs = 0 . not getting out put "ooooooo" getting "ohhhhh" . don’t want play mp , vibrate if rs < 10 . any appreciated . if m not wrong committing silly mistake... if (adi == 1) { system.out.println("oooooooo"); if (rs >= 10) { system.out.println("ohhhhh"); vib2.vibrate(600); mediaplayer mp = mediaplayer.create(getbasecontext(), r.raw.beep02); mp.start(); } else finish(); } if compare code ...

ios - iOS7 UIButton image flashes -

Image
i'm working on custom number pad , having issue background image of uibuttons. appears work should during push animations buttons flicker white in between each other. happens when popping view controller view numberpad. when change background color of enclosing view radical green flicker green, seems somehow background showing through. more pronounced , reproducible every time double click on home button. please see screenshots reference of things when it. buttons set follows: _onebutton = [uibutton buttonwithtype:uibuttontypecustom]; //rinse , repeat rest of buttons _ninebutton = [uibutton buttonwithtype:uibuttontypecustom]; _clearbutton = [uibutton buttonwithtype:uibuttontypecustom]; nsarray *allbuttons = @[_zerobutton, _onebutton, _twobutton, _threebutton, _fourbutton,_fivebutton,_sixbutton,_sevenbutton,_eightbutton,_ninebutton, _deletebutton, _clearbutton]; [allbuttons enumerateobjectsusingblock:^(uibutton *button, nsuinteger idx, bool *stop) { button.tag = idx...

mod wsgi - Django 1.4 and CONN_MAX_AGE -

i have graphite-web apache, mod_wsgi , django 1.4. construction makes pool of connections mysql, open , hanging. in version django 1.6 added option conn_max_age, can set lifetime of connections. there such possibility in 1.4? upgrade 1.6 not possible, set timeout in mysql not considered.

javascript - explanation of zero index in getElementByTagname method -

i trying use getelemenstbytagname method access array elements.i have searched internet , found of uses.i have seen without [0] @ end of tagname method not work.say in code if use var c=document.getelementsbytagname("p"); it doesn't work.rather have use var c=document.getelementsbytagname("p")[0]; what [0] index means , why used?? full code : <html> <head> <style> *{margin:0px;padding:0px;} </style> </head> <body> <script> var j=2; var temp; var arr=["favourite","fruit","is","mango","orange","apple"]; for(i=0;i<3;i++){ document.body.innerhtml+=arr[i]+" "; } setinterval(function (){ j++; var c=document.getelementsbytagname("p")[0]; c.style.color="blue"; c.innerhtml=arr[j]+" "; if(j==5){j=2;} },2000); </script> <p style="position:absolute;float:right;top:0px;left:97px;border:0px soli...

php - Importing a pre-uploaded file into a value field for a file upload -

i finishing off database entry aspect of project , have got 1 remaining snag that's interfering. the database in mysql accessible via web site, includes posting new entries calling current entries , editing them before replacing originals. so far works fine text based entries , can create form, populate old entries automatically, make corrections , resubmit, allowing updates without needing re-enter everything. unfortunately, final part of selection of pictures. uploading process works fine cant find out how import value field upload box or if possible. because nature of upload code looks file think needs there work , importing address wont work. field uploading file shown below... <div id="productpic" style="position:absolute;left:10px;top:280px;width:150px;height:16px;z-index:5;text-align:left;"> <span style="color:#000000;font-family:arial;font-size:15px;">product picture (main display):</span></div> <input typ...

c++ - No matching function for call to classname::constructor -

this question has answer here: no matching function call “standard constructor” 4 answers class transport{ private: int weight; // member variable (private) int capacity; // member variable (private) int speed; // member variable (private) public: transport(int aweight, int acapacity, int aspeed) { // default constructor if(aweight > 0) { // perform validation @ time of creating object weight = aweight; } else { weight = 0; } if(acapacity > 0) { // perform validation @ time of creating object capacity = acapacity; } else { capacity = 0; } if(aspeed > 0) { // perform validation @ time of creating object speed = aspeed; } else { speed = 0; } } void carrygoods(); // member function (...

java - codenameone List Hortizontal scrolling -

how can implement horizontal scroll bar in list in codenameone? there seems no scrollpane? i have tried other ways around seems i'll need horizontal scroll in list. ideas? thanks! list in codename 1 can either horizontal or vertical , doesn't provide ability side scroll. uncommon pattern in mobile devices , if need should rethink ui design.

c# 4.0 - Indexer Class and AutoMapper C# -

how map 2 indexer class automapper? need map 2 models have property use collectionitem type. tried use automapper. doesn't work. please see example indexer class below: public class collectionitem { private readonly ienumerable<string> _keys; private readonly idictionary<string, ilist<item>> _relatedcontents; private static readonly ilist<item> _emptylist = new list<item>(); public collectionitem(ienumerable<string> keys) { _keys = keys; _relatedcontents = new dictionary<string, ilist<item>>(); } public ilist<item> this[string key] { { if (!containskey(key)) { throw new keynotfoundexception("the given key not present in dictionary"); } return _relatedcontents.containskey(key) ? _relatedcontents[key] : _emptylist; } } public bool containskey(string key) { re...

How to make application badge on android? -

--edit on 23 apr 2016-- i use shortcutbadger of device, think should enough me. shortcutbadger basically, shortcut badger send broadcast, intent, etc specific launcher, such lg launcher, make badge. may not cover launchers @ least works recent smart phones. --edit-- what seeing on lg g2 (4.4), there number of of apps, e.g. line, showing unread count. this application badge mean , want find way work out. this number notified launcher itself, when app in put inside folder, folder show badge. i think there should have ways make work, found several apps having badges. --original-- i did search before , found there way make application badge on samsung , sony, want support other vendor, such lg , htc. is there universal way make application badge? thanks help! unfortunately, android not allow changing of application icon because it's sealed in apk once program compiled. there no way programmatically change 'drawable'. you may achieve goal u...

android - Desigining a mobile app for an existing Spring MVC application (Spring Mobile or Phonegap) -

i created web application on openshift using spring mvc , mysql. now want go mobile application. want publish same application mobile app (android mainly). primarily, mobile version should play httppost/webservice security authorisation too. i know pivotal has spring mobile project helps create mobile site same application (with more sophistication spring form tags , all). on other hand, phonegap can create cross-platform mobile app of html5 , css. my questions are: is worth put effort on phonegap or spring mobile? if choose spring mobile, how publish mobile app in android play store? some pros , cons or links reference helpful. intro first, let me give warning. while constructive question (better average questions asked here), people questions users spent time searching answer themselves. explain part later. differences phonegap (cordova) , spring mobile 2 different frameworks, serve different purposes. have found googling. phonegap (cordova) wr...

error handling - how to use 'try catch finally' block to display message when mysql query is executed successfully -

i have been using 'try catch finally' in code c# windows form query mysql database. code works well: when catch block flags errors, message box display error messages. in block, coded message box show when database updated. if there no error message works well. success message shows. but if there error, error message in catch block displayed, followed success message in block. does know solution program display either error message or success message when mysql updated? thanks, peter here code sample: private void btnupdateemployeetable_click(object sender, eventargs e) //update record in employee table { string myconnection = @"server=localhost; database=shopdb; username= **; password=** ; convert 0 datetime=true"; mysqlconnection connect = null; try { connect = new mysqlconnection(myconnection); connect.open(); //open connection //this mysql command query db. ...

openxml - Different excel column appearance when working with open xml -

Image
this question edited several times , found problem , solution. edited post other users use. created excel file using open xml. created excel file opens no errors. has following problems: the size of column set correctly, shown bigger expected ( bigger template file). below image shows template file: , next image shows created file using open xml : see,the columns of second file wider, while there no difference between values. edit the code begins following lines: using openxml=documentformat.openxml; using excelspreadsheet = documentformat.openxml.spreadsheet; using packaging = documentformat.openxml.packaging; packaging.spreadsheetdocument spreadsheet = packaging.spreadsheetdocument.create(filename, documentformat.openxml.spreadsheetdocumenttype.workbook); packaging.extendedfilepropertiespart extendedfilepropertiespart = spreadsheet.addextendedfilepropertiespart(); generateextendedfilepropertiespart(extendedfilepropertiespart); ...

performance - Why does MongoDB have a 100MB limit per aggregation pipeline stage? -

why mongodb have 100mb limit per aggregation pipeline stage ? you can set allowdiskuse extend limit. my question is, why number 100mb? i guess won't exact answer unless mongodb core developers. the idea have threshold limit before using disk. 100mb max in-memory threshold mongodb has put not aggregation pipeline operations compact operation well. 100mb arbitrary number , knowledge 100mb limit because if consider each document of size 100kb , each pipeline returns 1000 documents reaches 100mb limit.

c# - SuggestCompletion Nest usage -

i'm trying suggestcompletion query location (countries , cities), i'd perform query on 2 fields. my mapping far following: var response = _client.createindex(platformconfiguration.locationindexname, descriptor => descriptor.addmapping<locationinfo>( m => m.properties( p => p.completion(s => s .name(n=>n.countryname) .indexanalyzer("simple") .searchanalyzer("simple") .maxinputlength(50) .payloads() .preserveseparators() .preservepositionincrements()). completion(s=>s.name(n => n.city) .indexanalyzer("simple") .searchanalyzer(...