Posts

Showing posts from June, 2013

java - Trying to import NetBeans Project from an older version using .forms -

i'm trying import netbeans project older version (6.9.1) latest (8.0). i've gotten necessary forms few .java files too. try importing them .zip file tells "no netbeans projects added" after telling me exist. please help. thank :) perhaps file format has changed? there no backward compatibility guaranteed such a old nb version, coming from. but following should work: import 6.9.1 projects 7.0.1 , export them. import exported 7.1 , export gain. imported exported project (from 7.1) 7.2 , export... (you idea)

android - Saving user registation data to a database -

i'm trying data entered registration form saved database. here database: package com.nebulanewsco.gameofwin; import android.content.contentvalues; import android.content.context; import android.database.cursor; import android.database.sqlexception; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqliteopenhelper; import android.util.log; public class gowdbadapter { public static final string key_username = "username"; public static final string key_password = "password"; public static final string key_rowid = "_id"; private static final string tag = "gowdbadapter"; private databasehelper mdbhelper; private sqlitedatabase mdb; /** * database creation sql statement */ private static final string database_create = "create table notes (_id integer primary key autoincrement, " + "title text not null, body text not null);";

Symfony2 Form Type - how to set form CSS class as attribute? -

when set css class in form controller , pass $options array element works. private function createeditform(ordercard $entity) { $form = $this->createform(new ordercardtype($this->get('security.context') ->isgranted('role_super_admin')), $entity, array( 'action' => $this->generateurl('ordercard_update', array('id' => $entity->getid())), 'attr'=>array( 'class'=>'form-horizontal' ) )); return $form; } but when want have same effect using formtype not added form: public function buildform(formbuilderinterface $builder, array $options) { $builder // not works ->setattribute('attr', array('class' => 'form-horizontal')) // not works either ->setattribute('class', 'form-horizontal') //... what wrong?

c# - How do I get the NVIDIA core temperature in an integer value? -

i taking arduino microcontroller class , i'm working on final project: automated computer cooling system works according case temperature. i unable nvidia gpu core temp using following sources: this msdn link or this nvidia link . how can value of temperature of gpu? my knowledge in c# basic , couldn't make heads tails on manual or code examples in msdn. i'm gonna go ahead , answer own question after long time of searching how found way data. using openhardwaremonitor.dll open source links able needed. this code used in windows c# application (it might not best way gets job done. hope finds helpful: using openhardwaremonitor.hardware; . . . public partial class mainwindow : form { computer mycomputer; public mainwindow() { initializecomponent(); mycomputer = new computer(); mycomputer.open(); mycomputer.gpuenabled = true; mycomputer.cpuenabled = true; foreach (var hardwareitem in my

Excel - How to Convert / Reverse the Column Sequence from Right to Left -

i have got excel sheet around 50 columns in it. current data present in opposite sequence of required. now how reverse column sequence in such way column @ end on right side, becomes first column on left side , on. need reverse order of columns. i have found way display data in required format using method - file, options, advanced, tick: show sheet right left apply but changes display , not real data within, when copy paste data sheet, again shows data in original / wrong sequence only. please suggest how this. thanks lot. this small macro takes columns on sheet1 , copies them sheet2 in "flipped" order: sub columnflipper() dim s1 worksheet, s2 worksheet set s1 = sheets("sheet1") set s2 = sheets("sheet2") dim m long, n long, long n = 1 s1 m = .cells(1, columns.count).end(xltoleft).column = m 1 step -1 .cells(1, i).entirecolumn.copy s2.cells(1, n) n = n + 1 ne

performance - Is timestamp in mysql cached when retrieved in different timezones? -

in mysql 5.6 manual, says: mysql converts timestamp values current time zone utc storage, , utc current time zone retrieval. but if have different connections different timezones, timestamp value cached? according oz_ here : another 1 difference: queries "native" datetime not cached, queries timestamp - be. – oz_ apr 28 '11 @ 17:37 but cannot find confirmation of googling, , doesn't provide link.

javascript - How to use my own option configurations for concat and uglify with grunt-usemin -

for example: im using current configuration below uglify js scripts in gruntfile: uglify: { options: { report: "min", //"gzip", sourcemap: true, preservecomments: false, //"some", "all" }, application: { options: { // expand: true, banner: '<%= app.banner %>', preservecomments: "some" }, src: 'dist/js/application.js', dest: ".tmp/js/application.min.js" }, dependencies: { options: { sourcemap: false }, src: ['dist/js/dependencies.js'], dest: ".tmp/js/dependencies.min.js" }, im aware grunt-usemin generates src , dest options code block in html file declared in useminprepare gruntfile option, example: <!-- build:js js/app.js -

.net - How to use Group by from a Dataview values in vb.net -

is there way use group on datatview values.i can sort values in dataview how group data in data view (in vb.net) want apply aggregate function on dataview how make possible? you can group objects dataview or other data collection using groupby method extension. for dataview you'd first have cast ienumerable(of datarowview) . here's simplistic example: dim groupedrows = mydataview.cast(of datarowview).groupby(function(r) r("myfield")) if you're using typed dataset might find easier group on typed datarow instead you'll able use hard properties grouping rather object values obtained string references: dim groupedrows = mydatatable.groupby(function(r) r.myfield)

javascript - Create a new object array based on jQuery result set -

i have table contains list of people. want query table , produce new array of objects pass ajax call. so far have this: var result = $("table tr").not(":has(th)").each(function() { return { id: 0, islead: 0 }; }); assuming table 3 rows, expected value result be: [{ id: 0, islead: 0 }, { id: 0, islead: 0 }, { id: 0, islead: 0 }] instead, result contains elements match jquery selector. i'll providing proper values id , islead based on data in row, keep things simple i've excluded here. i'm missing fundamental in approach. i've tried searching existing questions maybe i'm not phrasing correctly can't find else similar this. sounds want map , not each var result = $("table tr").not(":has(th)").map(function() { return { id: 0, islead: 0 }; }).get();

python - What does it mean when it says "you should not be parsing the "text" field. in getting the top 10 hash tags -

i have twitter assignment in python need write program top_ten.py computes ten occuring hash tags twitter stream put .txt file. mean when says" should not parsing "text" field? the twitter api returns tweets in form like { "entities": { "hashtags": [ { "text": "freebandnames", "indices": [ 20, 34 ] } ] }, "text": "aggressive ponytail #freebandnames" } (many, many fields have been removed clarity.) assignment means should examine hashtags looking @ hashtags list in entities object instead of trying parse text field find hashtags yourself.

android - Why do I get the wrong shortcut name during installation of my app? -

i published first app android marketplace , noticed if user has setting "add icon home screen" set true in play store app, shortcut gets created during installation has wrong name. instead of string specified on application label or label on intent filter gets label of activity. if user manually creates shortcut, naming correct. here's excerpt androidmanifest.xml: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dosolves.gym" android:versioncode="2" android:versionname="1.1" > ... <application android:name="com.dosolves.gym.app.gymapplication" android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity

Android/Java: How to make a static write method -

i have write method save few variables , use method throughout more 1 class. can need use in static places in classes won't work because save method cannot static. here's method: public void savelesson(int lessons2, int problem2, int mlessons2, int mproblem2, string checkaccuracy) { string newline = system.getproperty("line.separator"); final string saved = new string(lessons + newline + problem + newline + mlessons + newline + mproblem + newline + dontcheckmaxstring()); fileoutputstream fout = null; try { fout = openfileoutput("lessonstore.properties", context.mode_private); } catch (filenotfoundexception e) { e.printstacktrace(); } outputstreamwriter osw = new outputstreamwriter(fout); try { osw.write(saved); osw.flush(); osw.close(); } catch (ioexception e) { toast andeggs = toast.maketext(lessons.this, "error while writing...", toast.le

c - Hexadecimal to RGB values in WebGL Shader -

i'm working on application take single integer input (basically color) and, using webgl shaders, color box given input. planned, originally, combination of shifts & mask demonstrated below: uniform int u_color; float rvalue = (((u_color) >> 16) & 0xff) / 255.0; float gvalue = (((u_color) >> 8) & 0xff) / 255.0; float bvalue = ((u_color) & 0xff) / 255.0; gl_fragcolor = vec4(rvalue, gvalue, bvalue, 1.0); so given int 0xff33cc, red=1.0, green=0.2, blue=0.8 however, ran problem , found out webgl shaders can't perform bitwise shifts. i'm wondering how able efficiently produce proper fragcolor given integer, if that's possible. edit: after bit of trial , error, , @jongware, i've come solution uniform int u_color; float rvalue = float(u_color / 256 / 256); float gvalue = float(u_color / 256 - int(rvalue * 256.0)); float bvalue = float(u_color - int(rvalue * 256.0 * 256.0) - int(gvalue * 256.0)); gl_fragcolor = vec4(rvalue / 255.

c# - Correct approach to storing different types in two subclasses -

i working in c# , i'm trying write abstracttriangle hierarchy 2 subclasses: triangle , specialtriangle. triangles made of lines, specialtriangles made of speciallines! i can think of number of ways store lines in triangles: abstracttriangle contains list of abstractline abstracttriangle contains list of iline itriangle has accessors list of iline, triangle , specialtriangle responsible own lists of line or specialline what correct, elegant way of handling these hierarchies? do need sacrifice triangles returning concrete typed lines make work properly? use generics instead of inheritance: class triangle<t> t: iline { list<t> edges; ··· } and instantiate as triangle<line> or triangle<specialline>

jquery - Accessing very nested element directly by referring main Parent class -

i working on chrome extension. have following html belongs facebook. goal fetch latests posts. can fetch posts looking class name timelineunitcontainer <div class="timelineunitcontainer" id="u_jsonp_2_3" data-gt="{"eventtime":"1396797532","viewerid":"100000804868370","profileownerid":"100000804868370","unitimpressionid":"f5511fc8","contentid":"3298878988034773094","timeline_unit_type":"statusmessageunit","timewindowsize":"3","query_type":"36","contextwindowstart":"0","contextwindowend":"1398927599"}" data-time="1396685690"> <div class=""> <div role="article"> <div class="clearfix mbs pbs _1_m"> <a class="_29h _303 _51wa" href="https://www.facebook.com/sid.

linux - I need help using the 'at' command -

hello guys started use ubuntu , ubuntu server, i'm stuck using @ command. don't know how initiate command. i'm trying to: i'm trying run file @ 5 using 'at" command /etc/holler.sh thank in advance! you should able at - 1) install at sudo apt-get install @ 2) schedule command at 05:00 /somepathto/somecommand

java - NullPointer exception when using second non-static reference to static object -

i have static object in class, class writer, , instances of class need refer 1 of static objects. avoid code duplication (where i'd have write same code multiple times, each difference in of static objects used). solution have static writer called writer1 , static writer call writer7, , have non-static writer called otherwriter, in constructor of either writer1 or writer7 points other writer. however, keep getting nullpointer exceptions when access otherwriter. error , code below - ideas? sorry, code not neat - it's hacky fiddeling @ stage. thanks error: java.lang.nullpointerexception @ popl.poplformative.generalwrite(poplformative.java:108) @ popl.poplformative.run(poplformative.java:51) package popl; import java.util.arrays; public class poplformative extends thread { int currentindex = 0; int lastindexwritten = -1; static int data[]; int writerid; static poplformative writer1; static poplformative writer7; poplformative o

Gnuplot: Colour proportional to y-value for builtin functions -

Image
does know of easy way plot, say, sin(x) , such colour changes depending on y-value? set palette defined (0 "blue", 1 "green") plot sin(x) lc palette frac abs(sin(x)) also doesn't work! any ideas? thanks. you can try use special filename '+' internally generates list of values (x values $1) , use values plot want using third column play palette. set palette defined (0 "blue", 1 "green") plot '+' u ($1):(sin($1)):(abs(sin($1))) lines palette

forms - Silex, Symfony2 FormServiceProvider - SLOW -

time time i'm trying use symfony formserviceprovider , have issues speed witch stops me going forward. 1.1 simple twig form - execution time: 0.28957605361938 $app->match('/test2', function (request $request) use ($app) { return $app['twig']->render('form.html'); }); 1.2 registering providers formserviceprovider, translationserviceprovider - execution time: 0.36547303199768 2.1 registering providers formserviceprovider, translationserviceprovider , constructing form - execution time: 1.0038349628448 $app->match('/test1', function (request $request) use ($app) { $choices = array('1'=>'mr.', '2'=>'miss', '3'=>'mrs.'); $data = array( 'name' => 'my firstname', 'email' => 'my lastname', ); $form = $app['form.factory']->createbuilder('form', $data) ->add('name') ->add('title', &

ruby on rails - Dependent jobs in Sidekiq - How to avoid the one that launches to finish? -

i have following job structure in rails app: def perform(page_ids, email, order_id) job_ids = [] page_ids.each |id| job_ids << shoebuilder.perform_async(id, order_id) end checkstatus.perform_async(job_ids, email) unless job_ids.empty? end basically launch n shoebuilders, , have checkstatus worker keeps checking if of jobs have finished in order send email user. here how checkstatus looks: def perform(ids, email, order_id) finished = [] while finished.size < ids.size ids.each |id| status = sidekiq::status::status(id) # consider finished if has been completed or failed if (( sidekiq::status::complete?(id) || sidekiq::status::failed?(id) ) && !finished.include?(id)) finished << id end end sleep 5 end notifier.thanks(email, order_id).deliver end so, problem here following: the shoebuilder work, @ point, if has not been able find information (it parser

c# - How I get one variable argument from one method to another -

hy, i have following constuctor: public partial class selectsize : form { public selectsize(string name) { this.name = name; initializecomponent(); } public string name { get; set; } and want name use in following method: p private void button1_click(object sender, eventargs e) { if (((int.parse(norows.text) % 2) == 0) && (((int.parse(nocols.text) % 2) == 0)) && ((int.parse(norows.text) == int.parse(nocols.text))) && ((int.parse(norows.text) > 6) && ((int.parse(norows.text) > 6)))) { //string name = this.name; playme f = new playme(int.parse(nocols.text), int.parse(nocols.text), name); this.hide(); f.showdialog(); this.close(); but null reference name. how transfer 1 variable method? sincerly, if this.name null different constructor has been called or null passe

jquery mobile, issue when changing page -

inside jquery mobile website i'm sending footer textinput request controller sends json data view popup window (data inside popup window rendered using jstemplate). everything works expected when change page request passed controller popup window not showing. from js function i'm sending $("#mydatapopup").popup("open").enhancewithin(); and inside _layout.cshtml <div id="mydatapopup" data-role="popup" class="ui-content" data-theme="a" /> again, works fine until change page (since code inside _layout) should work on other pages well. since you're using jquery mobile 1.4, recommend using external popup can accessed page. external popup should placed outside page div data-role="page" , should initialized manually. external popup: <div data-role="popup"> <!-- contents --> </div> <div data-role="page"> <!-- contents --&

php - Can't connect to database to update member details -

i can't connect database while running page on submitting updated details. life of me can't figure out why wont connect. most recent error: warning: mysql_connect() [function.mysql-connect]: access denied user 'matts1'@'localhost' (using password: yes) in f:\xampp\htdocs\site\profileupdate.php on line 69 cannot connect below db.inc file details well, since has no password have no clue why error being posted. my db.inc file is: $hostname = "localhost"; $username = "root"; $password = ""; $databasename= "schurter_products"; php/sql: <?php session_start(); require 'db.inc'; // initialise error string $errorstring = ""; // trim posted values - gets rid of unecessary whitespace $firstname = trim($_post["firstname"]); $surname = trim($_post["surname"]); $emailaddress = trim($_post["emailaddress"]); $username = trim($_post[&qu

Java Regex to extract the Url of hyperlink (not to use Pattern & Matcher) (Java Regex)? -

how capture urlofhref not use pattern & matcher. i using gwt plaform & doesn't have pattern & matcher . this code ok, uses pattern & matcher. public static string gettheurlofhref(string href){ pattern p = pattern.compile("href=\"(.*?)\""); matcher m = p.matcher(href); string url = null; if (m.find()) { url = m.group(1); // variable should contain link url } return url; } so how extract url of hyperlink (not use pattern & matcher) (java regex)? hmm, perhaps remove don't need instead? public static string gettheurlofhref(string href){ href = href.replaceall("^.*?href=\"", ""); // remove before // , including href=" string url = test.substring(0,test.indexof('"')); // till // first " character return url; } ide

c - Need to change the Pointers make me problems -

hello have program receiving parameters user. transmission performed using pointers. code later not use pointers creates problem received. happy if me fix code work. code - #include <stdlib.h> #include<string.h> void order(int n,char argv[99]); int main(int argc, char** argv) { int i,n; n = argc; order(n,*argv); } void order(int n,char argv[99]) { int i,j; char temp; for(i=1; < n; i++) { for(j = 0 ; j < n - 1; j++) { if(argv[j] > argv[j+1]) { temp=argv[j]; argv[j]=argv[j+1]; argv[j+1]=temp; } } } system("pause"); (i = 0; < n ; i++) { printf("%c",argv[i]); } } it appears confused argc , argv . int argc contains number of command-line arguments passed program, char **argv array (null-pointer terminated even) of strings (null-byte terminated character arrays) containing these arguments. @ odds program: 1. there no reason limit length of

changing from html to jsp : referenceerror d3 is not defined -

i have html file in draw svgs using dc.js , d3.js .. moment change extension jsp. starts throwing : uncaught referenceerror: d3 not defined in dc.js no clues why :( .. suggestions ? this how inclusing js in html/jsp <script type="text/javascript" src="../javascripts/jquery.js"></script> <script type="text/javascript" src="../javascripts/d3.js"></script> <script type="text/javascript" src="../javascripts/crossfilter.js"></script> <script type="text/javascript" src="../javascripts/dc.js"></script> see thing when use html then, @ time, html page directly accessing recourse. in case of jsp, it's mvc architecture jsp cannot directly access recourse. have provide path of file using jsp tags. following gives example of how can it. suppose created file structure under myproject -> webapp : res -> mytheme -> js -> fi

How to authenticate multiple active directory user on single application in azure -

i have created 2 active directory in azure connect 2 different local active directory (two different companey) i have application in want both azure active directory user can login on same instance of application don't want host 2 instance of application . after authentication need to check active directory user belongs . any appreciated since struggling last 3 days you need create multi-tenant application, pksorensen's comment states. want register application in 1 of directories , update configuration make multi-tenant capable (discussed in links below). when user directory signs in application, app starts consent flow hitting azure ad's common authentication endpoint (different tenant-specific one), , displays consent dialog. after user consents, azure ad registers application in other directory. all information need implementing scenario: brand new code sample multi-tenant web application sign-on info multi-tenant apps, how make application m

Returning IWICStream / IStream from unmanaged C++ DLL to managed C# and reading it -

within c# program receive image data (probably in form of istream ), returned function imported unmanaged c++ dll. i have read several similar questions , msdn docs on general topic far have been unable figure out complete working solution. c++ function exported consumption in managed c#:- extern "c" __declspec(dllexport) istream* getimage(){ iwicbitmap *pbitmap = null; //... code emitted clarity //... bitmap creation , direct2d image manipulation //... iwicstream *pistream = null; istream *stream; createstreamonhglobal(null, true, &stream); hresult hr = pistream->initializefromistream(stream); //... pbmpencoder iwicbitmapencoder, pibitmapframe iwicbitmapframeencode //... pfactory iwicimagingfactory hr = pfactory->createencoder(guid_containerformattiff, null, &pbmpencoder); hr = pbmpencoder->initialize(pistream, wicbitmapencodernocache); //... hr = pbmpencoder->createnewframe(&pibi

javascript - jQuery: click event inside iframe -

i'm trying fire click event on click of element inside iframe, doesn't seem working. current set up: jsfiddle: http://jsfiddle.net/q4aa3/ jquery: $(document).ready(function () { $('#this-iframe').load(function () { $('#this-iframe').contents().find('img').live({ click: function () { alert('clicked img'); } }); }); }); clicking on image inside iframe isn't firing alert, i'm not sure why, or there better way achieve this? suggestions appreciated! when have iframe on same domain, can use script catch clicks in iframe. don't use .live, depriciated of jquery 1.7. var iframebody = $('body', $('#iframe')[0].contentwindow.document); $(iframebody).on('click', 'img', function(event) { dosomething(); }); you can manipulate body through iframebody variable.

regex - PHP str_replace duplicates -

i have function convert user input various services youtube , opengraph function link_to_opengraph($content) { // patterns author https://github.com/leonardocardoso/facebook-link-preview/blob/master/php/classes/regex.php // overall code inspiration https://github.com/leonardocardoso/facebook-link-preview/ $urlregex = "/(https?\:\/\/|\s)[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})(\/+[a-z0-9_.\:\;-]*)*(\?[\&\%\|\+a-z0-9_=,\.\:\;-]*)?([\&\%\|\+&a-z0-9_=,\:\;\.-]*)([\!\#\/\&\%\|\+a-z0-9_=,\:\;\.-]*)}*/i"; $imageregex = "/<img(.*?)src=(\"|\')(.+?)(gif|jpg|png|bmp)(\"|\')(.*?)(\/)?>(<\/img>)?/"; $imageprefixregex = "/\.(jpg|png|gif|bmp)$/i"; $pattern_youtube = '#\b(?:https?://)?(?:www\.)?(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})[^\s,]*#x'; preg_match_all( $urlregex, $content, $allstars ); if($allstars) {

c++ - Function pointer loses its value -

i'm trying implement menu using map of chars , function pointers. program compiles fine, when try run pointers lose value along way. i'm hoping guys might know it. i'm using typedef: typedef void (gui::*useraction)(); and following map: map<char, useraction> menuoptions; here function registering pointers: void gui::registeractions(){ menuoptions['c'] = &gui::addcd; menuoptions['j'] = &gui::addjournal; menuoptions['n'] = &gui::addnonfiction; menuoptions['f'] = &gui::addfiction; menuoptions['x'] = &gui::removeobject; menuoptions['h'] = &gui::showhelpmenu; menuoptions['s'] = &gui::search; menuoptions['l'] = &gui::lenditem; menuoptions['r'] = &gui::collectitem; menuoptions['q'] = &gui::quit; cout << menuoptions['c'] << endl; // writes 1 } i use template interpret user se

ios - is applicationWillResignActive the earliest indicator we get that an app is becoming inactive? -

- (void)applicationwillresignactive:(uiapplication *)application { //pause avplayer if music playing } however upon pressing home button music doesn't stop until ios has returned home screen (after app-closing animation). i'm wondering if there's way make music stop sooner this, before ios app-closing animation.

java - Get specific text from huge string -

i'm calling api , getting huge string of text (thousands of words in cases). all want thumbnail_url. here's sample: "thumbnail_url": "http://ecx.images-amazon.com/images/i/4171sq7vc4l.jpg", "type": "rich", "thumbnail_height": 379 so want http://ecx.images-amazon.com/images/i/4171sq7vc4l.jpg example. idea? edit - thumnail_url in middle of big block of text, need search "thumbnail_url" or something, right? what can use external json library such gson - think google or this fine and use in such way : jsonobject json = (jsonobject)new jsonparser().parse(yourstring); system.out.println("url=" + json.get("thumbnail_url"));

javascript - jQuery CLNDR Firefox issue -

i using: https://github.com/kylestetz/clndr i have multiday calendar , in firefox 28.0 (win 7) [nor ie 9 nor ie10] past events won't display. e.g. have 2 days event started on 4th april , lasts until 5th of april. today 6th of april , in firefox 4th , 5th not marked event ( "event" class not assigned "< td >" elements. works great in chrome. can give me helping hand? here example: http://wwiz.comyr.com/calendar/

c++ - OpenGL 3.1 Issue rendering textures with indexed drawing -

i'm trying use gldrawelements draw model loaded assimp, geometry displays fine textures dont show on model, black version of model i've loaded. load model function modelinfo loadmodel(const std::string& modelpath){ printf( "loading model: %s\n", modelpath.c_str()); //verify file exists first std::ifstream fin(modelpath.c_str()); if(!fin.fail()){ fin.close(); }else{ throw std::runtime_error("could not open file" + modelpath); } assimp::importer importer; const aiscene* scene = importer.readfile( modelpath, aiprocesspreset_targetrealtime_fast | //aiprocess_calctangentspace | aiprocess_triangulate | aiprocess_gensmoothnormals | aiprocess_flipuvs //aiprocess_joinidenticalvertices | //aiprocess_sortbyptype); ); if(!scene){ throw std::runtime_error(importer.geterrorstring()); } printf("imported %s\n",modelpath.c_str()); fflush(stdout); std::vector<unsigned i

jodatime - In Scala I can have reference to a private type via implicit conversion -

i've found interesting behaviour in nscala_time package (scala version of joda-time) import com.github.nscala_time.time.imports._ import com.github.nscala_time.time.durationbuilder object tests { val x = 3 seconds //> x : of type com.github.nscala_time.time.durationbuilder val xx: durationbuilder = 3 seconds //> fails compile: // class durationbuilder in package time cannot accessed in package com.github.nscala_time.time } what i'm trying achieve implicit conversion nscala_time duration scala.concurrent.duration need becuase i'm using rxscala , nscala_time in 1 application. // e.g. following should implicitly converted // nscala_time duration first // scala.lang.concurrent.duration 3 seconds nscala_time offers rich time & date api application, while i'm using rxscala in same class gui responsivness. can download simple project play around: https://dl.dropboxusercontent.com/u/9958045/implicit_vs_private.zip from scala-user gro

dev mode - trouble using prestashop : blank page without errors -

i met trouble while using prestashop. i've sent message forum nobody seems know trouble. the fact have blank page in front office. office works fine. i've set debug mode on that define('_ps_mode_dev_', true); i've clear smarty cache, etc... , force recompilation, not display mistakes, not know show mistakes. anykind of appreciable

multithreading - Pausing/unpausing a thread upon keypress in Java -

i'm hoping can me this. i've been searching week answer issue, no avail. i have custom thread class implements runnable , i'd pause upon key press. based on research, i've learned best way go using wait() , notify() , triggered key that's using key binding. my question is, how can work? can't seem set key binding without going wrong, , how might implement wait() , notify() without running deadlock beyond me. wait , notify meant used synchronization. seems me wanted use methods thread.suspend(), thread.stop() , thread.resume(), have been deprecated risk of problems lock cause. the solution use helper variable thread check periodically see if should running, otherwise, yield(or sleep) why not use suspend, stop or resume: http://docs.oracle.com/javase/6/docs/technotes/guides/concurrency/threadprimitivedeprecation.html simple solutions: how pause , resume thread in java thread http://www.tutorialspoint.com/java/java_thread_control.htm

Rails: Rspec and console output differ -

i'm having issue specs. i'm trying run spec creates , destroys associated object, none of specs creating or destroying object. weird thing is, can literally copy , paste every line of code (except .should ) out of each test console , console run each expectation perfectly, creating , destroying objects. here's sample: it "should not destroy notification on comment" comment = factorygirl.create(:comment) = factorygirl.create_list(:like, 2, likable: comment) like.first.destroy note = comment.user.notifications.find_by(notifiable: comment, from_comment: false) note.should_not be_nil end only first on specific comment send notification comment's author. , if comment has 1 like, , destroyed, destroy notification had sent, won't destroy notification if comment has more 0 likes @ time. is problem i'm not writing scalable code? know specs aren't perfect, why console getting different results identical input? are running rails c