Posts

Showing posts from February, 2011

java 7 - How to print/scan Underscores in Numeric Literals -

team, i not able use java 7 underscores in numeric literals feature getting input user , printing out in same format declared. please in doing that? or feature incomplete? scanner input = new scanner( system.in ); int x = 1_00_000; system.out.print( "enter numeric literals underscores: " ); //2_00_000 x = input.nextint(); //java.util.inputmismatchexception system.out.println(x); // prints in normal format, want in 2_00_000. note: in eclipse; able change value of numeric literal underscored numeric literal in runtime. may hack, needed feature input underscored numeric literal in runtime rit?. http://www.eclipse.org/jdt/ui/r3_8/java7news/whats-new-java-7.html#miscellaneous if want maintain underscores can use string: scanner input = new scanner( system.in ); system.out.print( "enter numeric literals underscores: " ); //2_00_000 string stringliterals = input.nextline(); system.out.println(stringliterals); // prints 2_00_000.

clojure - Application configuration file -

i wondering approach/library considered practise in clojure app development configuration files? keep settings e.g. database connection, credentials access external web services etc, in external configuration file. thanks clojure cookbook has section on that: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/04_local-io/4-15_edn-config.asciidoc .

pandas - Log values by SFrame column -

please, can tell me, how can take logarithm every value in sframe , graphlab (or dataframe , pandas) column, without iterate through whole length of sframe column? specially interest on similar functionality, groupby aggregators log-function. couldn't find someself... important: please, don't interest for-loop iteration whole length of column. interest specific function, transform all values log-values whole column. i'm sorry, if function in manual. please, give me link... numpy provides implementations wide number of basic mathematical transformations. can use on data structures build on numpy's ndarray . import pandas pd import numpy np data = pd.series([np.exp(1), np.exp(2), np.exp(3)]) np.log(data) outputs: 0 1 1 2 2 3 dtype: float64 this example pandas data types, works data structures based on numpy arrays.

php - Static url does not redirect to the requested page -

i have question regarding .htaccess file. have rewritten dynamic url in static 1 following: www.mysite.com/index.php?lang=it in www.mysite.com/it using rewrite rule: rewriteengine on rewriterule ^it/([^/]*)\.html$ /index.php?lang=$1 [l] so far good... now need create static url dynamic url redirects product description www.mysite.com/product_details.php?id=1485 the rule inserted in .htaccess is: rewriteengine on rewriterule ^it/prodotto-([^-]*)-([^-]*)\.html$ /it/product_details.php?id=$1&lang=$2 [l] unfortunately if click on related link cannot reach requested page; if comment first rule this #rewriterule ^it/([^/]*)\.html$ /index.php?lang=$1 [l] then can see page. know how solve issue? assuming lang equals language want script so? rewriteengine on rewritebase / rewriterule ^it/([^/]*).html$ /index.php?lang=$1 [l] rewriterule ^it/prodotto-([^/]*)-([^/]*).html$ /it/product_details.php?id=$1&lang=$2 [l] this do yoursite.com/it/$1.html and

SoundEngine can not be resolved cocos2d-android-1 -

i learning here [link] ( http://dan.clarke.name/2011/04/how-to-make-a-simple-android-game-with-cocos2d/ ) stuck @ point have use this soundengine.sharedengine().preloadeffect(context, r.raw.pew_pew_lei); soundengine.sharedengine().playsound(context, r.raw.background_music_aac, true); there no soundengine import fount. says soundengine can not resolved. other soundengine other functionalities working fine. missing thing (some other library). have added cocos2d-android-1 here [link] ( https://code.google.com/p/cocos2d-android-1/downloads/detail?name=cocos2d-android.jar&can=2&q= ) there other library soundengine sorry bother have found problem solution using wrong jar file using jar file fro here [link] ( http://www.java2s.com/code/jar/c/downloadcocos2djar.htm )

Error starting MongoDB in windows 7 [32-bit] -

Image
i followed blog(link) install , configure mongodb in system[ windows 7 32 bit ]. as per blogger said, have download mongodb-win32-i386-2.6.5 , extract d:/mongodb/ , followed blog upto installation alright, when try start service using following command, d:\mongodb\bin>net start mongodb i got error response as, system error 2 has occurred. system cannot find file specified. how solve ? update : log file 2014-11-19t16:43:25.356+0530 [datafilesync] flushing diag log 2014-11-19t16:43:25.403+0530 [initandlisten] mongodb starting : pid=5128 port=27017 dbpath=d:\mongodb\data 32-bit host=avvenire-java 2014-11-19t16:43:25.403+0530 [initandlisten] 2014-11-19t16:43:25.403+0530 [initandlisten] ** note: 32 bit mongodb binary. 2014-11-19t16:43:25.403+0530 [initandlisten] ** 32 bit builds limited less 2gb of data (or less --journal). 2014-11-19t16:43:25.403+0530 [initandlisten] ** see http://dochub.mongodb.org/core/32bit

php - Cut off file_get_contents if it takes too long -

i use freegeoip service track visiting website own database. takes while retrieve data. there anyway can cut off retrieval of data if taking long? here code: $geoip = @file_get_contents("http://freegeoip.net/csv/{$_server['remote_addr']}"); ` you can create context sent timeout (reference: file_get_contents ) excerpt: $opts = array('http' => array( 'method' => 'post', 'header' => "content-type: text/xml\r\n". "authorization: basic ".base64_encode("$https_user:$https_password")."\r\n", 'content' => $body, 'timeout' => 60 ) ); $context = stream_context_create($opts); $url = 'https://'.$https_server; $result = file_get_contents($url, false, $context, -1, 40000); in case should translate (untested): $opts = array('http' => array( 'method' => 'get', 'header'

Android : Referencing child fragment from parent fragment -

i have nested fragment scenario. attempts reference child fragment parent fragment gives null. missing here? this layout file of parent fragment. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <!-- statically nested fragment --> <fragment android:name="reports.fragments.fragments.usagebreakup.fragments.filter" android:id="@+id/fragment_filter" android:layout_width="match_parent" android:layout_height="wrap_content"/> </linearlayout> here how trying access child fragment parent fragment @override public void onviewcreated(view view, @nullable bundle savedinstancestate) { super.onviewcreated(view, savedinstancestate); log.i(log_tag, "on view created"); filter = (filt

gpgpu - Why should I use the CUDA Driver API instead of CUDA Runtime API? -

why should use cuda driver api, , in cases can't use cuda runtime api (which more convenient driver api)? the runtime api higher level of abstraction on driver api , it's easier use (the performance gap should minimal). driver api handle-based 1 , provides higher degree of control. runtime api, on contrary, easier use (e.g. can use kernel<<<>>> launch syntax). that " higher degree of control " means driver api have deal module initialization , memory management in more verbose way, allows more stuff, e.g. disable driver jit optimizations kernel code: cu_jit_optimization_level - level of optimizations apply generated code (0 - 4), 4 being default , highest level of optimizations. option type: unsigned int from http://developer.download.nvidia.com/compute/cuda/4_1/rel/toolkit/docs/online/group__cuda__types_gfaa9995214a4f3341f48c5830cea0d8a.html this isn't possible via code runtime api. finer degree of control means migh

javascript - after appending inline html to html the window.open() doesn't shows append data -

here created after appending inline html table data html table, open new tab , show print view but problem appending data not shows. there show html page table data test.html <div> <p>your content here</p> <table id="toprint"> <tr> <th>name</th> <th>phone</th> </tr> </table> </div> print button in html page , onclick using backbone.js print : function() { var htmltable2 = '<tr class="header">' + '<td>prasanth</td>' + '<td>12345678</td>' + '</tr>'; var html1 = $("#toprint tbody").append(htmltable2); window.open("test.html").print(); }, how change html page table + append inline html data open new tab , show print option. instead of window.open("test.html").print(); window.print(); by op

scala - Spark streaming elasticsearch dependencies -

im trying spark & elasticsearch integration in scala described in elasticsearch guide i have problems dependencies when compiling : [trace] stack trace suppressed: run last *:update full output. [error] (*:update) sbt.resolveexception: unresolved dependency: cascading#ing-local;2.5.6: not found [error] unresolved dependency: clj-time#clj-time;0.4.1: not found [error] unresolved dependency: compojure#compojure;1.1.3: not found [error] unresolved dependency: hiccup#hiccup;0.3.6: not found [error] unresolved dependency: ring#ring-devel;0.3.11: not found [error] unresolved dependency: ring#ring-jetty-adapter;0.3.11: not found [error] unresolved dependency: com.twitter#carbonite;1.4.0: not found [error] unresolved dependency: cascading#cascading-hadoop;2.5.6: not found [error] total time: 86 s, completed 19 nov. 2014 08:42:58 my build.sbt file name := "twitter-sparkstreaming-elasticsearch" version := "0.0.1" scalaversion := "2.10.4" // addit

java - jersey server missing dependencies -

i'm using code: import java.io.file; import java.io.fileoutputstream; import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import javax.ws.rs.consumes; import javax.ws.rs.post; import javax.ws.rs.path; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.response; import com.sun.jersey.core.header.formdatacontentdisposition; import com.sun.jersey.multipart.formdataparam; @path("/files") public class jerseyfileupload { private static final string server_upload_location_folder = "c://users/nikos/desktop/upload_files/"; /** * upload file */ @post @path("/upload") @consumes(mediatype.multipart_form_data) public response uploadfile( @formdataparam("file") inputstream fileinputstream, @formdataparam("file") formdatacontentdisposition contentdispositionheader) { string filepath = server_upload_location_folder +

c# - Resend a message stored in error queue with RabbitMQ -

i'm new rabbitmq , i'm using nservicebus.i searched in google not find me. does know if can send specific message, taken error queue, specific queue (destination)? any appreciated. thank much. you can use serviceinsight , servicepulse that. hth

Retrieving the image from database and displaying in web page in Asp.Net -

i trying store profile picture user uploads in database , retrieve database , display in web page.i have saved image in database don't know how retrieve it.i have tried display when click retrieve button nothing happens. this code in handler page , instead of retrieving image based on id trying passing name of user on welcome page. public void processrequest(httpcontext context) { //passing name here if (context.request.querystring["name"] != null) { string csc = configurationmanager.connectionstrings["dbcs"].connectionstring; using (sqlconnection con = new sqlconnection(csc)) { sqlcommand com = new sqlcommand("retrieveimage", con); com.commandtype = commandtype.storedprocedure; //passing name sqlparameter p1 = new sqlparameter("@username", context.request.querystring["name"]); com.parameters.add(p1); con.ope

java - Spring Expression Language - Size property on List -

i trying use size property on list using spring el, which's throwing exception size can't found. @cacheable(value = "cache", unless = "#result.size > 0") public list<results> getresult(); exception: org.springframework.expression.spel.spelevaluationexception: el1008e:(pos 8): field or property 'size' cannot found on object of type 'java.util.arraylist' @ org.springframework.expression.spel.ast.propertyorfieldreference.readproperty(propertyorfieldreference.java:217) @ org.springframework.expression.spel.ast.propertyorfieldreference.getvalueinternal(propertyorfieldreference.java:85) @ org.springframework.expression.spel.ast.propertyorfieldreference.access$000(propertyorfieldreference.java:43) @ org.springframework.expression.spel.ast.propertyorfieldreference$accessorlvalue.getvalue(propertyorfieldreference.java:346) @ org.springframework.expression.spel.ast.compoundexpression.getvaluei

javascript - Angular - Use $index to load product images -

Image
i have following form in angularjs app: <li ng-repeat="device in devices track $index"> <div class="db-handset-image"> <span class="phone-silhouette"></span> {{ relative image here }} </div> <div class="db-device"> <ul class="opts"> <li> <select name="manufacturer[ [[$index]] ]" ng-model="selectedmanufacturer" ng-change="getmanufacturermodels(selectedmanufacturer)"> <option value="">manufacturer</option> <option ng-repeat="manufacturer in manufacturers" value="[[manufacturer.id]]">[[manufacturer.name]]</option> </select> </li> <li> <select name="device[ [[$index]] ]" ng-model="selectedmodel"

analyzer - How can I track / analyze Meteor DDP calls -

while programming meteor complex application useful track / analyze / sniff ddp traffic in order optimize , make app fast , efficient. example interesting see publications , methods calls flow. in situation tools used? ddp json on websockets (or emulation of it). can use dev tools network tab sniff out messages.

java - Setting the font of a JTextArea -

i want create text editor in java. here i've written far: package com.thundercrust.applications; import java.awt.borderlayout; public class texteditor implements actionlistener{ private static string[] fontoptions = {"serif", "agency fb", "arial", "calibri", "cambrian", "century gothic", "comic sans ms", "courier new", "forte", "garamond", "monospaced", "segoe ui", "times new roman", "trebuchet ms", "serif"}; private static string[] sizeoptions = {"8", "10", "12", "14", "16", "18", "20", "22", "24", "26", "28"}; imageicon newicon = new imageicon("res/newicon.png"); imageicon saveicon = new imageicon("res/saveicon.png"); imageicon openicon = new imageicon("res/openicon.png"); imageicon fo

uitableview - Ios 7 speed dial cell style -

i want create uitableview cells have circle image , text in circle image. should draw every circle , text in it? there cell style this? saw apple did in phone->speed dial you can use uibutton/uiimageview according requirement. make component circle should set corner radius. object.layer.cornerradius = 40; object.clipstobounds = yes;

java - How to move items between collections in Hibernate 4.3.7.Final -

i have 2 entities mapped in application in order model team , members . team can have many members , member can belong no more 1 team . fine handling concepts. problem comes when try move member 1 existing team another. the entities presented below, in simplified form. last method, transfer() , 1 should perform removal of member team , send one. @entity public class member extends person { @manytoone private team team; protected member() { super(); } public member(team team, string name) { super(name); this.team = team; } // trivial getters , setters... public team getteam() { return team; } protected void setteam(team team) { this.team = team; } } @entity public class team { @id private long id; private string name; @onetomany(mappedby="team", cascade=cascadetype.all) private list<member> members = new arraylist<member>(); protected t

runtime - Exception in thread "main" java.lang.ClassFormatError: (unrecognized class file version) -

hi facting below exception when running in unix environment, pls body can help exception in thread "main" java.lang.classformaterror: com.polaris.treasury.bloomberg.marketdata.test.springwebservicetest (unrecognized class file version) @ java.lang.vmclassloader.defineclass(libgcj.so.7rh) @ java.lang.classloader.defineclass(libgcj.so.7rh) @ java.security.secureclassloader.defineclass(libgcj.so.7rh) @ java.net.urlclassloader.findclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ java.lang.classloader.loadclass(libgcj.so.7rh) @ gnu.java.lang.mainthread.run(libgcj.so.7rh)

VBA Excel inputbox run time error 13 type mismatch -

i have macro working well. issue have inputbox. macro running errors when user presses cancel or x out of inputbox. the user can input 15 values search , enters 0 search begin. want make more robust wont run these errors. please help. sub findvalues() dim lsearchrow integer dim rw integer, cl range, lsearchvalue long, lcopytorow integer dim ihowmany integer dim asearch(15) long dim integer ' clear sheets before runs accurate number of funds opend. sheet2.cells.clearcontents sheets("tier 2").cells.clearcontents sheets("tier 3").cells.clearcontents sheets("tier 4").cells.clearcontents sheets("tier 5").cells.clearcontents on error goto err_execute fixc sheet2.cells.clear sheet1.select ihowmany = 0 lsearchvalue = 99 'this end user input required a/c searched while lsearchvalue <> 0 lsearchvalue = inputbox("please enter value search

Android APK Expansion Files. What files I need to upload? -

i have read documentation apk expansion android. i have simple question: have application 5mb of code , has 40mb of assets files. these assets files updated in further release of app, have implemented apk expansion. now, have publish apk , obb files on google play console. documentation says "main" must used files necessary run app, , "patch" optional files. in case assets file optionals , updated togheter app apk code change, files need upload? the apk , file zip named main.<expansion-version>.<package-name>.obb ? the apk , file zip named patch.<expansion-version>.<package-name>.obb ? or apk , file zip containing both 2 files? in case name had use? thanks in advice you need upload apk , zip .zip extension. google play console convert .obb format, don't need care it.

ios - How does Urban Airship gets a push token without implementing application:didRegisterForRemoteNotificationsWithDeviceToken: -

i've implemented urban airship's sdk ios8 , above. everything ok, , i'm able send push messages device. i have noticed wasn't required implement following method: - (void)application:(uiapplication *)application didregisterforremotenotificationswithdevicetoken:(nsdata *)devicetoken { } which typically used pass token apple remote server. how possible? thanks. figured out. all need create class inherits uiresponder, , conforms uiapplicationdelegate protocol. at run time, need to: [[uiapplication sharedapplication] setdelegate:somenewdelegate]; and foreword calls old delegate (so keep pointer it). ** edit ** there option of swizzling. have look: http://nshipster.com/method-swizzling/

How get car route between two coordinates using ruby? -

i'm developing rails app google maps , car routes. i have start , finish points car route - 2 coordinates. how can full car route (array of coordinates car through streets)? can using gmaps4rails , geocoder ? something this: start_point = [41,2423; 45,323452] end_point = [42,2423; 42,323452] full_route = some_method_for_calculate_route( start_point, end_point ) #paint line on map array of points paint_line( full_route ) please help, kindly :) if want client side, have plunkr here . it highly inspired google documentation here . basically way interact google libraries var handler = gmaps.build('google'); handler.buildmap({ internal: {id: 'map'}}, function(){ var start_point = [43.2423, 5.323452]; var end_point = [44.2423, 5.323452]; var directionsservice = new google.maps.directionsservice(); var directionsdisplay = new google.maps.directionsrenderer(); directionsdisplay.setmap(handler.getmap()); var r

php - Twice a where in a survey -

instead of wanting whole table want 1 result based on link. this works: $bandid = intval($_get['bandid']); $sql = "select bandid, naamband, contactband, genre, omschrijving, leden, plaats, prijs, boekerid, website, youtube, notities `bands` bandid = $bandid"; $bandid clicking link on previous page, wanted combined above $sql = "select naam, bandid, naamband, contactband, boekerid `bands` inner join `adres` `bands`.boekerid = `adres`.id "; but doenst work: $bandid = intval($_get['bandid']); $sql1 = "select naam, bandid, naamband, contactband, b

java - Change logging level in Tomcat at runtime? -

i using juli logging framework in current tomcat 7, providing webapp specific logging.properties in web-inf/classes folder. now looking way change log level of logger at runtime . i found several sources saying changing level of logger @ runtime might possible via mbean server . unfortunately appropriate mbean "java.util.logging.logging" not list webapp specific logger, cannot execute method "setloggerlevel" . does know how accomplish this? hints - excluding suggesting use log4j, is... ;-) connecting jconsole tomcat , using mbean tab change logger level ideal way. 1 issue logger names don't exist unless code has triggered creation of logger. can't use mbean create logger ahead of code running. should use jconsole double check mbean doesn't exist. tomcat installs custom logmanager filters current class loader. jmx using system class loader possible classloaderlogmanager won't return logger names because current classloade

c# - Evenly positioning of multiple images on bitmap -

i'm trying position number of images onto single fixed size image . size of fixed image 200 x 200 (pixels). lets assume list<image> contains 3 images. positioning of first 2 images should next each other , positioned @ top of fixed image . third image should rendered on "second" line , centered underneath first 2 images. pattern need repeat number of images in list of images. assuming list contains 4 images, first 2 rendered next each other on first line, , second 2 rendered next each other on second line, , on. here have attempted far, positioning on place: bitmap finalicon = new bitmap(200, 200); image imgfinalicon = (image)finalicon; using (graphics g = graphics.fromimage(imgfinalicon)) { int xoffset = 0; int item = 1; foreach (image icon in iconlist) { int yoffset = 0; if (item > 2 && (iconlist.count() % 2 != 0)) { yoffset = imgfinalicon.height / 2; } else {

php - How to insert an "apply" button in WordPress -

i building job website , trying insert 'apply' button in custom post-type single page (called 'vacancy') within wordpress. need button notify admin of new 'application' = meaning logged in clicked on button. i have thought using comment_form() function not sure how adapt register "button" click. doesn't show @ in fact. i have got following code inside wp_query( $mypost ) while( have_posts() ) : the_post(); loop: if ( comments_open() || get_comments_number() ) : if ( post_password_required() ) { return; } comment_form( array( 'comment_field' => '', 'label_submit' => __( 'apply' ), 'comment_notes_after' => '' ), $mypost ); endif; i don't want affect general comments may need them normal posts , pages, , preferably if can separate comments , instead have else - can't think of way it. thanks in advance! appreciate s

objective c - RemoteDesktopProtocol In IOS -

i beginner in ios. requirement control iphone mac or windows using rdp. surf in web sample code of it. microsoft provide remote desktop client application.it can control remote windows machine through iphone. my necessity control iphone mac or windows. appreciated. just use freerdp here readme ios part

if statement - R - " missing value where TRUE/FALSE needed " -

this question has answer here: error in if/while (condition) {: missing value true/false needed 2 answers i'm trying execute following code in r comments = c("no","yes",na) (l in 1:length(comments)) { if (comments[l] != na) print(comments[l]); } but i'm getting error error in if (comments[l] != na) print(comments[l]) : missing value true/false needed what's going on here? check command : na!=na : you'll result na , hence error message. you have use function is.na if statement work (in general, better use function check na values) : comments = c("no","yes",na) (l in 1:length(comments)) { if (!is.na(comments[l])) print(comments[l]) } [1] "no" [1] "yes"

html - RevealJs like rotation in ImpressJs -

playing impress.js i'm trying acheive reveal.js slide transition, using impress.js. basic effect did come, feel, slides taking 'wider' turn making lil slower. note : in fiddle, maximize output section see said problem more clearly i dont know how else put it, if see http://lab.hakim.se/reveal-js/#/fragments , http://jsfiddle.net/8ukwex3x/1/ , able make out difference. <div id = "impress"> <div class = "step"> slide 1 </div> <div class = "step" data-x = "500" data-z="-400" data-rotate-y="90"> slide 2 </div> </div> what should make work reveal.js' transition. unfortunately fiddle missing javascript (where assume had intended put standard impress.js code) , in case, reading source code don't see how example in way similar reveal-js example does. so, risk might off here, have 1 thing may helpful... the reveal.

ruby on rails - wkhtmltopdf with wicked_pdf issue? -

i using wkhtmltopdf(0.10.0 rc2) , wicked_pdf(0.9.9) generating pdf report. while running got following error. runtimeerror (error: failed execute: ["/usr/bin/wkhtmltopdf", "-q", "--page-size", "a4", "--margin-top", "5", "--margin-bottom", "10", "--margin-left", "5", "--margin-right", "5", "file:////tmp/[\"wicked_pdf\", \".html\"]21873-0", "/tmp/[\"wicked_pdf_generated_file\", \".pdf\"]21873-0"] error: pdf not generated! command error: error: failed loading page file:////tmp/["wicked_pdf", ".html"]21873-0 (sometimes work ignore error --load-error-handling ignore) ) my controller are: render :pdf => "#{@note_name}",:layout => '/layouts/pdf_template.html.erb', :template=>'pdf/financial/maintenance_exp/maintenance_exp_pdf.html.erb' any appreciate

Type level encoding of natural numbers in F# -

i trying encode natural numbers type in f# able check equality @ compile-time instead of run-time. best come was type nat<'t> = abstract member asint : int type z() = interface nat<z> member __.asint = 0 type s<'p>(prev : nat<'p>) = interface nat<s<'p>> member __.asint = 1 + prev.asint type tnat = static member 0 = z() :> nat<z> static member succ (prev : nat<'p>) = s(prev) :> nat<s<'p>> static member 1 = tnat.succ(tnat.zero) static member 2 = tnat.succ(tnat.one) i'm not sure if i'm happy code. can done in better (or easier) way overlooking? and can ensure asint calculated @ compile time? in code, if try: tnat.two = tnat.succ(tnat.one) will yield false. here's alternative implementation without interfaces: type z = z static member (!!) z = 0 type s<'a> = s of 'a static member inli

sql - Select data that exists in A but not in B -

Image
imagine have tables: . what need data exists in not in b, in case select have return "2". i've done before, right know can't remember how. suppose this: select a.* left join b b on b.column = a.column but it's not working. can me, please? thanks in advance. you're missing filter: select a.* left join b b on b.column = a.column b.column null

html - Can I get data in 'display:table'd divs into Excel correctly -

i have series of divs organized in neat table format using display: table, table-row , table-cell rules. looks great, i've been asked support users want copy text , paste excel. in past, we've had similar reports rendered in plain html tables (tr, td etc) , guess excel knows bring in appropriately, styled divs make 1 long column (which not ideal useful report). is possible without resorting html table? my question simple "is possible?". have alternative solution, don't want have go down path if there better way. there not way around - excel doesn't take css layouts account not interpret correctly. besides, if people copying data excel, suggests me actual tabular data <table> correct way display anyway - why tag exists , still valid in html5.

Customizing the page numbers to show in pagination using jquery datatables -

i using jquery datatables , implementing custom server-side processing loading table records. default, api returns 20 records @ 1 time , let's assume total records 200 , showing 10 records per page(this fixed). problem since 20 records loaded in table , 10 rows per page, pagination shows 2 page numbers 1 , 2. want show possible page numbers 20 (200/10). there way can set value no of pages want show or other way achieve this? p.s. in api getting total no of records that's not problem. can't figure out how set value page numbers. set recordstotal , recordsfiltered 200 response , length 10 request. don't need have api return 20 can return 10 (your page size) each call. datatable take care populate table size.

javascript - AJAX/jQuery: Change DIV background based on number value in it? -

i new ajax/jquery , trying new. here fiddle better understanding each of squares divs. <div class="desk_box_ver" id="desk_b20" data-rel="85" style="left:20px;top:1165px;">b20</div> the number inside of being retrieved ajax call gets php script executing query, replace "b20" "1300" example. problem: how can produce "heat map" based on numbers being displayed. example: lets number range 100(the lowest) 1800(the highest). depending on number range, background color have displayed green-ish, yellow-ish, orange-ish, , red. a similar problem found on stackoverflow this one ajax:how displaying numbers inside of divs <script type="text/javascript"> $(document).ready(function() { $('#aht').click(function(){ $.ajax({ type:"get", url : "show_aht.php",

carrot2 pubmed read timed out -

i started using carrot2 directly today (i have previous experience using part of @note2). i able search web , wikipedia through either http://search.carrot2.org or workbench application. when searching pubmed source, following errors: java.net.sockettimeoutexception: read timed out org.apache.http.conn.connecttimeoutexception: connect eutils.ncbi.nlm.nih.gov/eutils.ncbi.nlm.nih.gov/130.14.29.110 timed out could transient or version dependent? else searching , clustering pubmed records carrot2? based on input dawid weiss , jack park @ http://sourceforge.net/p/carrot2/mailman/message/33066121/ ncbi puts various limitations on pubmed queries through http://eutils.ncbi.nlm.nih.gov/entrez/eutils/ they include time-of-day , per-ip limitations. see http://www.ncbi.nlm.nih.gov/books/nbk25497/

java - Mongo Hadoop Connector Issue -

i trying run mapreduce job: pull mongo , write hdfs, cannot seem job run. not find example, issues having if set input path of mongo loos output path of mongo. , getting authentication error when mongodb instance not have authentication. final configuration conf = getconf(); final job job = new job(conf, "sort"); mongoconfig config = new mongoconfig(conf); mongoconfigutil.setinputformat(getconf(), mongoinputformat.class); fileoutputformat.setoutputpath(job, new path("/trythisdir")); mongoconfigutil.setinputuri(conf,"mongodb://localhost:27017/fake_data.file"); //conf.set("mongo.output.uri", "mongodb://localhost:27017/fake_data.file"); job.setjarbyclass(imageextractor.class); job.setmapperclass(imageextractormapper.class); job.setoutputkeyclass(text.class); job.setoutputvalueclass(text.class); job.setinputformatclass( mongoinputformat.class ); // execute job , return status return job.waitforcompletion(true) ? 0 : 1; edit: curr

class - jQuery select child node (hidden field) within table cell -

i trying refactor code , on class click want access hidden value of div contained inside class. see code below: <tr> <td>@html.labelfor(m => m.enquirerdetailspopup, "enquirer details popup")</td> <td class="btnsettingstoggle" style="text-align: right; padding-left: 10px;"> <div style="float: right;" id="btnenquirerdetailspopup"> @html.hiddenfor(m => m.autoworkflowofenquiry, new { id = "hdnenquirerdetailspopup" }) </div> </td> </tr> $('.btnsettingstoggle').click(function () { // hidden value that's inside click }); i have ten of these table rows want use few lines of javascript hidden field value within class of btnsettingstoggle. your jquery needs more this: $(".btnsettingstoggle").on("click", function(){ $hiddenvalue = $(this).find("input[type=hidden]").v

Creating Insert Statement for MySQL in Python -

i trying construct insert statement built results of query. run query retrieves results 1 database , creates insert statement results , inserts different database. the server queried returns fields in reply populated , can differ record record. destination database table has of possible fields available. why need construct insert statement on fly each record retrieved , why cannot use default list of fields have no control on ones populated in response. here sample of code, send off request t&c isin , response name , value. fields = [] data = [] gettcq = ("mdh:t&c|"+isin+"|name|value") mdh.execute(gettcq) tc = mdh.fetchall() values in tc: fields.append(values[0]) data.append(values[1]) insertq = ("insert sp_fields ("+fields+") values ('"+data+"')") the problem fields part, mysql expecting following: insert sp_fields (accrual_count,amount_outstanding_calc_date) values ('030/360','2014-11

Magento catalog price rules discount doesn't work with products with custom options -

we have added several catalog price rules in our magento stores, seems don't applied additional costs set inside products custom options, work standard product price, there way fix this? thanks i think you're missing 1 thing. on catalog price rule, go under actions , change item called enable discount subproducts yes. and set number same original discount above. example: if you're selling pair of shoes, , red ones cost $10 more. with subproduct rule set no, $10 mark-up stays @ $10, if shoes 50% off. if turn subproduct option on, set separate line item, change mark-up value - it's shoes 50% off , 50% off markup red ones.

Search and Replace Byte Order Mark In Sql Server -

i have 10 table , more 10000 record contain  how can search  , replace in db? since  equal 0xef,0xbb,0xbf how can search this? i use code foo(myvarbincolumn) ( select text bpm_letters ) select * foo convert(varchar(max), myvarbincolumn) collate arabic_ci_as '%' + convert(nvarchar(max), char(0xef)+char(0xbb)+char(0xbf)) + '%' i found code in stackoverflow s incomplete. script of bpm_letters code not find record! please me what cte: stripbom ( select case when left(text,3) = 0xefbbbf convert(varbinary(max),substring(text, 4, len(text))) else text end text bpm_letters ) it should provide new table bom characters have been stripped off. p.s. code assumes ' text ' field of type varbinary .

c# 4.0 - C# - Websocket - Sending Message Back To Client -

i've been working on c# web socket server 24 hours. i've figured out how complete handshake , connection initialized. also i've figured out how take byte[] data , decode it's original string. but i'm stuck , looking help. i can't seem figure out how put proper data structure , send client. if send original data received websocket on client-side tell data cannot masked (which why needs decoded) . so basically, i'm asking in short how structure response data send websocket client? i've been using http://tools.ietf.org/html/rfc6455 resource research. please keep in mind i'm using regular socket this. here decode code: if (databuffer.length > 0) { if (databuffer[0] == 129) { int msg_length = databuffer[1] - 128; if (msg_length <= 125) { // msg ready decode. log.info("message length: " + msg_length); byte[] decoded = new byte[databuffer.length];

osx - OS X app store builds are breaking the UI? -

we have run issue submitting build max app store. when running directly xcode or making non app store signed archive perfect (we have tested build on ~20 computers @ point, various hardware , os versions). when make app store build , submit review, review team encounters broken ui in many places. difference have been able find signing of build. have not been able find pattern of how things breaking. elements disappear, moved around, fine. an example: our builds - http://cl.ly/image/182f0h402x3q review teams build during review - http://cl.ly/image/1p3y1p203825 we have been working dts team @ apple - have been responsive after several weeks confused are. have filed bug report , awaiting reply on that. it seems either app store signing, or how review team re-signs binary test it. process has not been made known seems catalyst. has run before? solutions? have tried can think of @ point , have hit wall every time. been tweaked , submitted 5 times now, same result every time

What is wrong with this LDAP filter packet? -

i trying port program queries ldap server perl go, , go version receiving response filter malformed: 00000057: ldaperr: dsid-0c0c0968, comment: server unable decode search request filter, data 0, v1db1\x00 i have used tcpdump capture data transmitted server both perl , go versions of program, , have found sending different filter packets. question not possible bugs in go program, understanding contents of ldap filter packets. the encoded filter is: (objectclass=*) and perl-generated packet (which server likes) looks this: ascii . . o b j e c t c l s s hex 87 0b 6f 62 6a 65 63 74 43 6c 61 73 73 byte# 0 1 2 3 4 5 6 7 8 9 10 11 12 the go-generated packet (which server doesn't like) looks this: ascii . . . . o b j e c t c l s s hex a7 0d 04 0b 6f 62 6a 65 63 74 43 6c 61 73 73 byte# 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 this own breakdown of packets: byte 0: tag when dissect byte 0 both packets, see ident

Meteor and AngularJS delimiters conflicts -

meteor using handlebars mustache {{}} angular using interpolate same delimiters {{}} then, using angularjs on meteor result in obvious conflicts. fortunately there way change angularjs delimiters using example [[]] : var myapp = angular.module('myapp', [], function($interpolateprovider) { $interpolateprovider.startsymbol('[['); $interpolateprovider.endsymbol(']]'); }); as know there no way change meteor's one, nor disable blaze. still experienced side effect: while trying use third party framework such ionicframework, directives using {{}} delimiters within own code. means replacing {{}} [[]] broke other part of project… a brute force fix search , replace {{}} occurrences [[]] using preprocessor. a workaround manually wrap or replace non working directive code know. both seems cumbersome… wish able change start , end symbols on packages, feasible ? yes, annoying thing... angularjs amazing letting meteor not. in me

twitter bootstrap - angularjs: ng-repeat over half the length of an array -

i using ngrepeat angularjs fill out grid in bootstrap. grid needs periodic clearfixes. so, example, if grid is: <div class="container"> <div class="row"> <div class="col-md-4 col-sm-6"> foo bar </div> <div class="col-md-4 col-sm-6"> foo bar </div> <div class="clearfix visible-sm-block"></div> <div class="col-md-4 col-sm-6"> foo bar </div> <div class="clearfix visible-md-block"></div> <div class="col-md-4 col-sm-6"> foo bar </div> <div class="clearfix visible-sm-block"></div> <div class="col-md-4 col-sm-6"> foo bar </div> <div class="col-md-4 col-sm-6"> foo bar </div> </div> </div> is accomplishable ngrepeat? seems structure like: <di