Posts

Showing posts from June, 2011

Format date value in material design to remove time -

i have following input on form: <md-input-container class="md-block" flex> <label>install date</label> <input type="text" date="yyyy-mm-dd" ng-model="selectedcompanydetail.installdate" disabled> </md-input-container> as can tell, want date displayed format yyyy-mm-dd . however, getting this: 1993-01-01t00:00:00 . it looks correct if this: <md-input-container class="md-block" flex> <label>install date</label> <input type="text" ng-model="selectedcompanydetail.installdate | date:'yyyy-mm-dd':'utc'" disabled> </md-input-container> but, error in developer tools: angular.js:13307 error: [ngmodel:nonassign] http://errors.angularjs.org/1.5.0-rc.2/ngmodel/nonassign?p0=selectedcompanydetail.installdate%20%7cnanate%3a 'yyyy-mm-dd'%3a'utc'&p1=%3cinput%20type%3d%22text%22%20date%3d%22yyyy-mm-dd%22%20

How to use remote file URL's with MediaFileUpload from Google Python Youtube API -

when invoke mediafileupload in python (apiclient.http) google api: media_body=mediafileupload(options.file, chunksize=-1, resumable=true) it works local file on drive: options.file = "/www/var/videos/video.mp4" but when try use remote file lets on cdn amazon - fails. options.file = "http://xxx-website-us-west-2.amazonaws.com/video.mp4" is there option use mediafileupload remote files havent found without having pull remote file down , uploaded via google api , delete it?

html - Two different colored columns inside parent container -

how can style .playing, .time-before, , .time-after , divs .time-before , time-after divs split .playing div equal width columns , fill container height. live link: https://riot-controls.herokuapp.com/ html: <li each={ queue } onclick={ play }> <span>{ title }</span> <span>{ artist }</span> <span>{ stringifytime(length) }</span> <div class='time-before'></div> <div class='time-after'></div> </li> css: .playing { color: orange; } .playing > .time-before { background-color: green; display: inline-block; height: 100%; float: left; } .playing > .time-after { background-color: red; display: inline-block; height: 100%; float: right; } display:flex; basicly , can wrap few lines or colu

Why selector is not getting called in cocos2d? -

can please review code written below , tell me why tick method never getting called. -(void)okpressed { cclabelttf *getreadylabel = [cclabelttf labelwithstring:@"get ready" fontname:@"backbreaker.ttf" fontsize:30]; [self addchild:getreadylabel]; getreadylabel.position = ccp(_winsize.width/2,_winsize.height/2); [self schedule:@selector(tick:) interval: 0.1]; } -(void)tick:(cctime)dt { cclog(@"dt=%f",dt); } when run code, getreadylable showing in centre of screen, tick method never getting called. doing wrong?

python - Dummy variables when not all categories are present -

i have set of dataframes 1 of columns contains categorical variable. i'd convert several dummy variables, in case i'd use get_dummies . what happens get_dummies looks @ data available in each dataframe find out how many categories there are, , create appropriate number of dummy variables. however, in problem i'm working right now, know in advance possible categories are. when looking @ each dataframe individually, not categories appear. my question is: there way pass get_dummies (or equivalent function) names of categories, that, categories don't appear in given dataframe, it'd create column of 0s? something make this: categories = ['a', 'b', 'c'] cat 1 2 b 3 become this: cat_a cat_b cat_c 1 1 0 0 2 0 1 0 3 1 0 0 using transpose , reindex import pandas pd cats = ['a', 'b', 'c'] df = pd.dataframe({'cat': ['a', 'b', &#

Qt: cannot open file for writing -

i try access simple text file qt-widget application qfile class reading writing. reading file line line string works fine. opening ready write fails. following code checks if file exists , tries set proper permissions, in end file won't open. here failing piece of code: #include "mainwindow.h" #include <qapplication> #include <qfile> #include <qdebug> int main(int argc, char *argv[]){ qapplication app(argc, argv); mainwindow w; w.show(); qfile file(":/test.dat"); qdebug() << "exists? " << file.exists(); qdebug() << "writable? " << file.iswritable(); qdebug() << "permissions before? " << file.permissions(); qdebug() << "permissions set? " << file.setpermissions(qfiledevice::writeother | qfiledevice::readother); qdebug() << "permissions after? " << file.permissions();

graph tool - proper linking of PATH and LD_LIBRARY_PATH after gcc-5.2 install in own directory -

i compiled , installed gcc-5.2. did not have root access installed in own directory. forget @ end meant link through ld_library_path , path setenv ld_library_path /bigbang/data/username/lib/gcc-5.2/lib setenv ld_library_path /bigbang/data/username/lib/gcc-5.2/lib64:$ld_library_path setenv path /bigbang/data/username/lib/gcc-5.2/bin:$path when run ./gcc following error: gcc: error while loading shared libraries: libiconv.so.2: is there wrong how linking lib paths? in advance. also, simple did configure ./configure --prefix=/bigbang/data/username/lib/gcc-5.2/ , recommended configuration flags should use? i'm aiming use graph_tool . if have installed gcc non-standard prefix /my/gcc/prefix can use installation without special preparations passing: -b/my/gcc/prefix whenever call frontend ( gcc , g++ , etc). call frontend usual command: gcc -b/my/gcc/prefix ... this assumes some version of gcc installed standardly. see 3.15 options directory search

java - How can I programmatically configure a log4j 2.5 RollingRandomAccessFileAppender to limit files without renaming? -

i have thousands of processes creating logs using log4j2 , renaming of files on every rollover not acceptable due burden places on filesystem. currently have following code create appender: pathcondition[] pathconditions = new pathcondition[1]; pathconditions[0] = ifaccumulatedfilecount.createfilecountcondition(10); deleteaction deleteaction = deleteaction.createdeleteaction(basepath, true, 1, true, null, pathconditions, null, config); action[] actions = new action[1]; actions[0] = deleteaction; string filename = "file"; string filepattern = filename + "_%i.log"; rollingrandomaccessfileappender appender = rollingrandomaccessfileappender.createappender( filename, filepattern, "false", // append "rollingrandomaccessfileappender", // name "true", // immediateflush "8192", // buffersizestr sizebasedtriggeringpolicy.createpolicy(long.valueof(maxfilesizeinmb*1024*1024).tostring()),

hadoop - Error Loading CSV data into a Hive table -

i have csv file has rows in following format, 1, 11812, 15273, "2016-05-22t111647.800 us/eastern", 82971850, 0 1, 11812, 7445, "2016-05-22t113640.200 us/eastern", 82971928, 0 1, 11654, 322, "2016-05-22t113845.773 us/eastern", 82971934, 0 1, 11722, 0, "2016-05-22t113929.541 us/eastern", 82971940, 0 the create hive table following command, create table event_history(status tinyint, condition smallint, machine_id int, time timestamp, ident int, state tinyint) then trying load csv file table following command, load data local inpath "/home/ubuntu/events.csv" table event_history; but nulls when try select query in created table. missing here? the hive version hive 1.2.1 my error in table creation. fixed following changes create table event_history(status tinyint, condition smallint, machine_id int, time timestamp, drqs int, state tinyint) row format delimited fields terminated ',';

html - wrap text within <li> using css -

i have ul containing bunch of li's. in each li there image , caption. li or image not have set width. want wrap text wide image above it. it's fiddle <ul><li></li></ul> http://jsfiddle.net/g4hvaljc/ i want text under image wrap width of image. can help?! you give fixed width li , use ellipsis text .figures span { font-size: 12px; font-family: "book antiqua", "palatino linotype", georgia, serif; letter-spacing: 0.1em; display: block; width: 100%; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } check fiddle

javascript - Need to create a mouse over help icon -

icon needs display message when mouse on , message becomes hidden when mouse out. plain javascript please <img src="helpicon.png" width=50 height=50 onmouseover="mytooltip('click form field see requirements.');" onmouseout="mytooltip('');" /> function mytooltip(valuetodisplay) { document.getelementbyid("helpicon").innerhtml = valuetodisplay; } you can use html5 title attribute. e.g. #mybigfatdiv { padding: 100px; background-color: #ddd; cursor: pointer; text-align: center; } <div id="mybigfatdiv" title="hell yea is!">hover on me find out if great answer</div>

android - Home/Drawer button in Actionbar cannot be focused with keyboard/controller -

i'm implementing controller/keyboard navigation in application accessibility, , can't seem make drawer button gain keyboard focus. setting actionbardrawertoggle (in oncreate): this.drawerlayout = (drawerlayout) this.findviewbyid(r.id.drawer_layout); this.drawerlayout.setscrimcolor(0x99000000); this.actionbardrawertoggle = new actionbardrawertoggle(this, this.drawerlayout, r.string.root_drawer, r.string.root_drawer); this.actionbardrawertoggle.sethomeasupindicator(r.drawable.ic_utilitybar_menu); this.actionbardrawertoggle.setdrawerindicatorenabled(true); this.drawerlayout.setdrawerlistener(this.actionbardrawertoggle); setting action bar (also in oncreate): actionbar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); actionbar.setdisplayshowtitleenabled(false); actionbar.setbackgrounddrawable(new colordrawable(color.parsecolor(actionbar_background_color))); actionbar.setelevation(0); actionbar.sethomebuttonenabled(true); actionbar.setdisplay

asp.net mvc 4 - force singleordefault to execute -

can tell me why following code not work in api controller (mvc4)? error saying "cannot access disposed object". found in other cases there should call tolist() forces query executed. in case, i'm using singleordefault(), isn't executed on database right away? public httpresponsemessage getpurchaseorder(int poid) { purchaseorder po; httpresponsemessage resp; using (pmdatadatacontext database = new pmdatadatacontext()) { po = database.purchaseorders.singleordefault(x => x.poid == poid); if (po == null) { var message = string.format("id = {0} not found", poid); httperror err = new httperror(message); resp = request.createresponse(httpstatuscode.notfound, err); } else { resp = request.createresponse(httpstatuscode.ok, po); } } retur

algorithm - thread "main" java.lang.NullPointerException, Implement three stack in a single array -

the purpose of code implement 3 stacks in single array. use linked node implement stack. elements pushed array 1 one directly, , elements in each stack connected previous pointer. pointer int value corresponding index in array item stored. nextavaindex method return next available index can store new pushed item. because there space released in beginning of array after executing pop method. if indexused < arr.length it keep moving forward store new item, while if indexused reaches end of array, method search there free space in beginning of array. when run it, throws nullpointerexception , know meaning of error, can't fix it. comments! code correct? 1 more question of removal item int type array. let arr[i].data = 0 delete item, , use statement arr[i].data == 0 check if 1 space null. if 1 space store 0 ? suggestion! public class flexiblemultistack { private int[] toppoint = {-1, -1, -1};// assume number of stack ==3; private int indexused = 0; private stacknode[] arr

c# - How to bind all the items in a list to DataGridView? -

i have class zones has list of objects of type row. i'm trying datagridview display rows in of zones. code gives me rows first zone in list aircraft.zones. bindingsource mysource = new bindingsource(); mysource.datasource = aircraft.zones; mysource.datamember = "rows"; the zone class looks this public class zone { public list<row> rows{ get; set; } public string name { get; set; } double arm; private int id; } i can inserting rows datatable binding don't want changes won't updated. ideas how can rows in zones show up? thanks. try this, think work including updates, although not inserts or deletes: mysource.datasource = aircraft.zones.selectmany(t => t.rows).tolist(); (and remove datamember assignment)

windows - Unable to run powershell script remotely leading to test agent deployment failures in Azure -

i having setup need run automation script test agent. build step fails following message connecting remote server devbox02 failed following error message : client cannot connect destination specified in request. verify service on destination running , accepting requests. consult logs , documentation ws-management service running on destination, commonly iis or winrm. if destination winrm service, run following command on destination analyze , configure winrm service: "winrm quickconfig". more information, see about_remote_troubleshooting topic.'. troubleshooting but when analysed test agent machine, getting messsage winrm service running ps c:\windows\system32> winrm quickconfig winrm service running on machine. winrm set remote management on computer. ps c:\windows\system32> not sure why getting message when able see winrm service , running i have configured firewall exception . please me in pointing missing. lot winrm/remote powershel

python - PyQt5 - Clicking Cancel on QFileDialog Closes Application -

i've noticed that, using following code, if choose click "cancel" on filedialog "import file", entire application closes instead of returning menu , awaiting different choice. how can return mainmenu? (note: i've noticed if don't put after initial file dialog call, functions fine.) code: import sys import xml.etree.elementtree et pyqt5.qtwidgets import * pyqt5.qtgui import * class mainmenu(qdialog): def __init__(self): qdialog.__init__(self) layout = qgridlayout() # create objects main menu logolabel = qlabel("testapp") logofont = qfont("broadway", 48) logolabel.setfont(logofont) versionlabel = qlabel("version 0.1a") copyrightlabel = qlabel("copyright 2016") importbutton = qpushbutton("import file") quitbutton = qpushbutton("quit") # set locations of widgets layout.addwidget(logo

opencv - How Can I Detect Any Object from Video Camera in IOS? -

i developing application identify object real world object. possible identify object video camera? on words using opencv library identify object. recording video not anything. poor ar. please suggest me have identifying real world object if possible. step 1: follow this setup opencv camera step 2: add code processimage delegate - (void)processimage:(cv::mat&)image { //process here cv::cvtcolor(image, img, cv::color_bgra2rgb); int fixedwidth = 270; cv::resize(img, img, cv::size(fixedwidth,(int)((fixedwidth*1.0f)* (image.rows/(image.cols*1.0f)))),cv::inter_nearest); //update model bg_model->apply(img, fgmask, update_bg_model ? -1 : 0); gaussianblur(fgmask, fgmask, cv::size(7, 7), 2.5, 2.5); threshold(fgmask, fgmask, 10, 255, cv::thresh_binary); image = cv::scalar::all(0); img.copyto(image, fgmask); } you'll need declare following global variable cv::mat img, fgmask; cv::ptr<cv::backgroundsubtractor&g

android - Unable to use BubbleIconFactory in Google map utils -

unable use new bubbleiconfactory giving deprecated dependency gradle build file: dependencies { compile 'com.google.maps.android:android-maps-utils:0.4+' } // want use bubbleiconfactory bubbleiconfactory = new bubbleiconfactory(this); bubbleiconfactory deprecated. can use icongenerator instead: icongenerator iconfactory = new icongenerator(this); markeroptions markeroptions = new markeroptions() .icon(bitmapdescriptorfactory.frombitmap(iconfactory.makeicon("your text here"))) .position(new latlng(40, -4)) .anchor(iconfactory.getanchoru(), iconfactory.getanchorv()); mmap.addmarker(markeroptions); here can find official demo activity.

javascript - how to return true/false from nested jquery callback functions -

i trying validate elements inside javascript function contains 2 jquery callback loops. based on conditions want return true / false inner jquery loop , should sent calling method of javascript. if result of inner loop true loop should stop running. if(validate(key)){ } else{ } function validate(key) { $jquery.each(function(){ $jquery.each(function(){ if(){ return true; } else{ return false} }) }) } i think you're looking for, stop both loops when true condition met function validate(key) { var result = false; $jquery.each(function(){ $jquery.each(function(){ if(){ result = true; return false;//break inner loop } }); if(result) return false; //break outer loop if got true in inner }); return result; } demo fiddle can open console , see loop stops when true condit

knockout.js - Undo change on cancel button -

i trying cancel changes done during page edit. whenever click on cancel, updated changes reflected. how revert changes on click of cancel button. on helpful since new knockout https://jsfiddle.net/tan2dgsa/ // viewmodel.js var viewmodel = { articles: [{ id: 1, title: "knockout templating", content: "content knockout goes here." }, { id: 2, title: "sharepoint 2013 rest api", content: "content sharepoint." }, { id: 3, title: "knockout sharepoint", content: "content knockout , sharepoint." }], selectedtemplate: ko.observable("readonly"), selectedmode: ko.observable(), }; viewmodel.currenttemplate = function (tbl) { return tbl === this.selectedmode() ? 'editmode' : this.selectedtemplate(); }.bind(viewmodel); viewmodel.reset = function (t) { this.selectedmode("editmode"); }; ko.applybi

maven - Adding xuggler dependency gives error -

i want generate single thumbnail image video i'm using xuggler. tried add dependency , repository. <repository> <id>xuggle repo</id> <url>http://xuggle.googlecode.com/svn/trunk/repo/share/java/</url> </repository> <dependency> <groupid>xuggle</groupid> <artifactid>xuggle-xuggler</artifactid> <version>5.2</version> </dependency> but after adding dependency error missing artifact xuggle:xuggle-xuggler:jar:5.2 . according this link changed version still gives me error. please help. in advance no 1 maintaining xuggler anymore, there still saved repository. try using repository xuggler: https://files.liferay.com/mirrors/xuggle.googlecode.com/svn/trunk/repo/share/java/ (version 5.4 only ) code: <repositories> <repository> <id>xuggle repo</id> <url>https://files.liferay.com/mirrors/xuggle.googlecode.com/svn/trunk/repo/shar

web.sitemap - Should sitemap must have main page url as well? -

i know sitemap should have urls associated site, helps google crawl. question is, wise have main url in sitemap or doesnot have meaning? sitemaps not have 'main page' concept, not have meaning. but, means, including url consider main page in sitemap helps.

.net - Is it possible to implement concept of lazy loading/ Eager loading on memory object like List (Not with DB objects) -

Image
i asking question clear confusion .net/entity framework possible implement lazy loading/eager loading concepts on memory objects database object. know entity framework provides feature inbuilt database entities. can use same approach (with or without using entity framework) in memory object class objects/list etc. for example: public class student { public student() { } public student(int studentid, string name, address address, list<subject> subjects) { studentid = studentid; name = name; address = address; subjects = subjects; } public int studentid { get; set; } public string name { get; set; } public address address { get; set; } public list<subject> subjects { get; set; } } public class address { public string addresslineone { get; set; } public string addresslinetwo { get; set; } public string city { get;

java - Problems while building HiveDB in Eclipse -

Image
i trying build hivedb project hivedb github in eclipse. able clone project link. however, project unable add maven dependencies automatically, when trying convert maven project , building it. causing huge number of errors in code. is there way fix it? tried doing maven-clean , build again resulted in error. following screenshot of same. thanks in advance. you should start create local repository - use nexus or artifactory this, , if can't find library maven repo, put manually in local repo. save lot of time. and seems have compilation issue - not able jdk? should put : <build> <plugins> <plugin> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <fork>true</fork> <executable>d:\jdk1.7.49\bin\javac.exe</executable> </configuration> </plugin> </plugins>

java - Validate model when it is created from json string in spring -

i preparing model json string using json jackson object mapper in spring. my code objectmapper mapper = new objectmapper(); string empvalue = mapper.writevalueasstring(employeemap); employees employee = mapper.readvalue(empvalue, employees.class); before preparing object of employee want validate json because if mismatched data set through exception while preparing model.how can it? you can valuable information out of exception out of jsonmappingexception class , sub classes (under com.fasterxml.jackson.databind.exc package) using getpath , getpathreference methods here 2 examples: public class objectmappertest { private objectmapper objectmapper; @before public void setup() { objectmapper = new objectmapper(); } @test public void testwrongdatatype() { string personstr = "{\"age\":\"100y\",\"firstname\":\"jackson\",\"lastname\":\"pollock\",\&

android - Drag, Rotate and Zoom a relative layout -

i want rotate & scale in same time, it's flickering while rotating , scaling layout. code public class customrelaytivelayout extends relativelayout implements rotationgesturedetector.onrotationgesturelistener { private float scale = 1.0f; private float touchx = 0.0f; private float touchy = 0.0f; public scalegesturedetector mscaledetector; public rotationgesturedetector mrotationdetector; private customrelaytivelayout customrelaytivelayout_; float mscalefactor = 1; float mpivotx; float mpivoty; public customrelaytivelayout(context context) { super(context); mscaledetector = new scalegesturedetector(context, new scalelistener(this)); mrotationdetector = new rotationgesturedetector(this); customrelaytivelayout_ = this; } public customrelaytivelayout(context context, attributeset attrs) { super(context, attrs); mscaledetector = new scalegesturedetector(context, new scalelistener(this)); mrotationdetector = new rotationgesturedetector(this);

Visual Studio C# Project Reference not working -

i created solution in vs 2 projects, 1 "core" class library project, other app project. added class numberutil (uses namespace core.util) , want reference in app project choose r-click, add ref... pick projects , add core project reference. ref core appears under references in project explorer if try use numberutil in class in app project can't find it. anyone know i'm doing wrong here? i'm not new programming new vs , c#. did use using core.util instruction? when try use class, vs propose using instruction you. can click on code error , press alt+shift+f10.

arrays - php - sorting function does not sort indicies -

i using following function sort array function array_sort($array, $on, $order=sort_asc){ $new_array = array(); $sortable_array = array(); if (count($array) > 0) { foreach ($array $k => $v) { if (is_array($v)) { foreach ($v $k2 => $v2) { if ($k2 == $on) { $sortable_array[$k] = $v2; } } } else { $sortable_array[$k] = $v; } } switch ($order) { case sort_asc: asort($sortable_array); break; case sort_desc: arsort($sortable_array); break; } foreach ($sortable_array $k => $v) { $new_array[$k] = $array[$k]; } } return $new_array; } $prevnext = array_sort($prevnext, 'distance-between', sort_asc); when var_dump(); sorted array ($prevnext), expected result, when var_du

c# - Image path have special characters when it's bind to gridview -

i trying bind images grid-view path stored in database. lets path stored in database ../images/products/scenttower.png when image bind grid view path appears format `../images/products/scenttower%0d.png` what causing that? <itemtemplate> <asp:image id="imagecontrol" runat="server" imageurl='<%# eval("picture") %>' /> </itemtemplate> %0d carriage return character ( \n ). there line break in file name. don't know operating system allows this, best thing make sure have proper input validation , checks in database prevents unwanted characters in file name. one way validate file name check on path.getinvalidfilenamechars() . if don't want input validation, can normalize image url removing or replacing occurrences character in list.

c++ - Cannot Give a Parameter To QT connect Function -

i implemented reading bytes @ serial communication in qt project(5.5) in visual studio 2013. code here: main.cpp int main(int argc, char *argv[]) { qapplication app(argc, argv); //qcoreapplication coreapplication(argc, argv); int argumentcount = qcoreapplication::arguments().size(); qstringlist argumentlist = qcoreapplication::arguments(); qtextstream standardoutput(stdout); if (argumentcount == 1) { standardoutput << qobject::tr("usage: %1 <serialportname> [baudrate]").arg(argumentlist.first()) << endl; return 1; } qserialport serialport; qstring serialportname = argumentlist.at(1); serialport.setportname(serialportname); int serialportbaudrate = (argumentcount > 2) ? argumentlist.at(2).toint() : qserialport::baud9600; serialport.setbaudrate(serialportbaudrate); if (!serialport.open(qiodevice::readonly)) { standardoutput << qobject::tr("failed open port

css - How do you style an SSRS Report based on a target style sheet? -

what i'm wanting embed ssrs report number of existing applications, each of them having own theme (colours, grid styles, etc.) what want design reports in way means styles applied based on target style sheet, instead of generating inline style sections. the css classes generated ssrs in form a57c, a58, etc. can't parse them unfortunately. i know can apply style sheet using various integration methods in ssrs, however, styles outside of report, not report itself. if it's relevant, i'm using soap api, , ssrs on top of sql server 2008, we'll moving 2012. i have themed dynamic templates use of reports. it's complex, got information needed tutorial , heavily customized meet needs. gives ability control , feel of reports based on values in table. 4 part article source files , such: dynamic template tutorial

excel - c# publishing a project -

i have created program gets access database , output information excel file . in bin/debug folder use excel template , excel workbook data gets input too. in later version wanted save user input excel file in same directory , access via program. is there way can give user ( test purposes ) folder maybe .exe inside can start , use program ( , excel files located in bin/debug ) ? yes, excel files located in bin/debug. and steps publishing c# project below: add setup project clicking on file-> add-> new project. select here setup , deployment in left side bar in project types. here find 3 options following: application folder user's desktop user's program menu these 3 options 3 places want copy our setup fules during installation process. here have select 1 option. suppose select user's desktop. right click on user's desktop option , select add-> project output. after clicking on project output, new window open. here select fir

eclipse why cannot set breakpoint in static block code -

Image
maven project have dependency jar -- log4j-1.2.14.jar , <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>1.2.14</version> </dependency> when executes junit test have below error info java.io.filenotfoundexception: /users/foo/documents/logs/info.log (no such file or directory) ... @ org.apache.log4j.logmanager.<clinit>(logmanager.java:122) @ org.apache.log4j.logger.getlogger(logger.java:104) ... i'd set breakpoint in logmanager.java 122 line, cannot. it strange , set breakpoint in other part of same class. found 122 line in static block code. static {...} it seems if line in static block code , cannot enable breakpoint here. so why this?

python - Error while importing datashader -

code: import datashader ds error: self._handle = _dlopen(self._name, mode) oserror: [winerror 126] specified module not found detailed error: traceback (most recent call last): file "d:\adarsh\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\llvmlite\binding\ffi.py", line 40, in <module> lib = ctypes.cdll(os.path.join(_lib_dir, _lib_name)) file "d:\adarsh\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\ctypes\__init__.py", line 351, in __init__ self._handle = _dlopen(self._name, mode) oserror: [winerror 126] specified module not found during handling of above exception, exception occurred: traceback (most recent call last): file "<stdin>", line 1, in <module> file "d:\adarsh\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages\datashader\__init__.py", line 5, in <module> .core import canvas file "d:\adarsh\winpython-64bit-3.4.4.2\python-3.4.4.amd64\lib\site-packages

html - CSS hover table cell -

i got table , have different text boxes when hovering on cells. <div class="plan"> <h2 class="title">premium</h2> <div align="center"> <p class="plan-price">499<span>&euro;</span></p> </div> <ul class="plan-features"> <li><strong>hello1</strong></li> <li><strong>hello2</strong></li> <li><strong>hello3</strong>></li> <li><strong>hello4</strong></li> <li><strong>hello5</strong></li> </ul> <a href="#" class="plan-button">start now</a> </div> i show box text when example user move pointer on hello1. this css code .plan-features { margin-bottom: 20px; line-height:

objective c - iOS:UILabel, how to judge UILabel's content overflow? -

as title, wanna judge uilabel show content. such as, if set uilabel numberoflines 2,maybe content can arrive end,maybe not,how can judge that? my code you titlelable.minimumscalefactor = 0.5; [titlelable sizetofit];

jquery - Swiper with holder.js -

in use of holder.js height of swiper's wrong. because swiper executed before / simultaneously holder.js. holder.js must performed first swiper knows correct image dimensions. there simple solution? $(document).ready(function () { // ============================================= // carousel (swiper) // ============================================= // hero carousel // - - - - - - - - - - - - - - - - - - - - - var herocarousel = new swiper('.swiper-hero', { keyboardcontrol:true, autoplay: 3000, autoplaydisableoninteraction: false, autoheight: true, pagination: '.swiper-hero-pagination', loop: true, simulatetouch: false, paginationclickable: true, slidesperview: 1, nextbutton: ".swiper-hero-r", prevbutton: ".swiper-hero-l", breakpoints: { 544: { }, 992: {

algorithm - Ruby: calculating number of unique permutations without using .permutation with duplicates in data set -

i require method taking in string of varying length , content, returning number of permutations without repetition. have written following try solve problem def permutations(n) k = n.to_s.chars.uniq.length e = n.to_s.length m = (1..e).reduce(1, :*) p = (1..k).reduce(1, :*) l = m / p case when k == 1 1 when k < e l else m end end the above returning results i've been confused couple of days i've realised occur there more 1 set of duplicate values uniq check. if pass through bbbb789 210 correct. if have set 2 duplicates such 73839 expected result 60 reach 5 i realised yesterday issues can't find way factor in duplicates also first method solving use k = n.to_s.chars.uniq.length m = n.to_s.chars.length return 1 if k <= 1 n.to_s.chars.permutation(m)to_a.uniq.size this worked takes age cycle through permutations of longer sets tl;dr: def factorial(n) (1..n).inject(1, :*) end str = '73839' # https://

c++ - Align double vs align float for AVX operations -

i want multiply 2 (float/double) vectors avx operators. in order that, need aligned memory. function float values is: #define size 65536 float *g, *h, *j; g = (float*)aligned_alloc(32, sizeof(float)*size); h = (float*)aligned_alloc(32, sizeof(float)*size); j = (float*)aligned_alloc(32, sizeof(float)*size); //filling g , h data for(int = 0; < size/8; i++) { __m256 a_a, b_a, c_a; a_a = _mm256_load_ps(g+8*i); b_a = _mm256_load_ps(h+8*i); c_a = _mm256_mul_ps(a_a, b_a); _mm256_store_ps (j+i*8, c_a); } free(g); free(h); free(j); that works, when trying double values, memory access error (such if memory not aligned correctly): double *g_d, *h_d, *i_d; g_d = (double*)aligned_alloc(32, sizeof(double)*size); h_d = (double*)aligned_alloc(32, sizeof(double)*size); i_d = (double*)aligned_alloc(32, sizeof(double)*size); for(int = 0; < size/4; i++) { __m256d a_a, b_a, c_a; a_a = _mm256_load_pd(g_d+4*i); b_a = _mm256_load_pd(h

Include parent directory in gulp src task -

i create resources.zip file contain css/styles.css . far have got of working, problem archive contains styles.css file , not parent directory css . gulpfile.js const gulp = require('gulp'); const zip = require('gulp-zip'); gulp.task('default', () => { return gulp.src('css/*') .pipe(zip('resources.zip')) .pipe(gulp.dest('build')); }); i think need setup base gulp.src : gulp.src('css/*', {base: '.'}) this because default base is: default: before glob starts (see glob2base) source . zipped file path: zip .

How to organize OrientDB DAO in case of transactions in multithreaded environment? -

i try organize architecture of dao orientdb. below - example of my: connection manager: public class db { private static final opartitioneddatabasepoolfactory poolfactory = new opartitioneddatabasepoolfactory(); public static odatabasedocumenttx frompool() { return poolfactory.get(sdburl, sdbuser, sdbpassword).acquire(); } } dao (it uses in multithreaded environment): public class dao { public static void addgold(string rid, long gold) { try (odatabasedocumenttx db = db.frompool()) { final string updatequery = "update " + rid + " increment gold = " + gold + " lock record"; db.command(new ocommandsql(updatequery)).execute(); } } public static void removegold(string rid, long gold) { try (odatabasedocumenttx db = db.frompool()) { final string updatequery = "update " + rid + " increment gold = " + -gold + " lock record";

javascript - When to use requestAnimationFrame? and why we need requestAnimationFrame if we have had css transition? -

i don't know when use requestanimationframe. if requestanimationframe , css both can satisfy needs, 1 should choose? can show me of applied cases? thx much~ i think reason opt requestanimationframe on css animations when want quick animations need ensure browsers make smooth. animations jump, stop, pause, return benefit using requestanimationframe . the thing requestanimationframe uses no cpu power, , draws animation visible user (it doesn't consume if swich tabs, minimize, etc). frames drawn when browser ready , since there no ready frames waiting drawn, there no unnecessary frame draws. so, smoothness guarantee, can safely opt requestanimationframe . if plan simple doesn't fit above explanation, requestanimationframe overkill , you'd better switch css animations. source consulted: https://dev.opera.com/articles/better-performance-with-requestanimationframe/

php - Select second last row of database -

for school project i'm making web portfolio. on site i'm using subject: "projects" on site these 3 colums. question generated them last 3 rows database, can't fixed. can body me? what need select last second row database can display in portfolio select * [table name] 1 order id desc limit 1,1 ; where id can auto increment primary key of table. mysql query syntax

http - OkHttp "java.net.ProtocolException: Unexpected status line: nullHTTP/1.1 200 OK" after a "204 NO-CONTENT" response using same connection -

i need sequence of calls using same connection (okhttpclient fits needs) , 1 of them returns 204 status code (no body), after "204 call" success: java.net.protocolexception: unexpected status line: nullhttp/1.1 200 ok @ okhttp3.internal.http.statusline.parse(statusline.java:69) @ okhttp3.internal.http.http1xstream.readresponse(http1xstream.java:184) @ okhttp3.internal.http.http1xstream.readresponseheaders(http1xstream.java:125) @ okhttp3.internal.http.httpengine.readnetworkresponse(httpengine.java:775) @ okhttp3.internal.http.httpengine.access$200(httpengine.java:86) @ okhttp3.internal.http.httpengine$networkinterceptorchain.proceed(httpengine.java:760) @ okhttp3.internal.http.httpengine.readresponse(httpengine.java:613) @ okhttp3.realcall.getresponse(realcall.java:244) @ okhttp3.realcall$applicationinterceptorchain.proceed(realcall.java:201) @ okhttp3.realcall.getresponsewithinterceptorchain(realcall.java:163) @ okhttp3.realcall.execute(realcall.java:57) @ it.test.main

java - How to override SourceViewerConfiguration in eclipse text editor -

i making eclipse plugin text hover extends eclipse text hover. trying make own "design" text hover using method public iinformationcontrolcreator gethovercontrolcreator() in own texthover class but, information give in function return default when focused on hover. read need set iinformationcontrolcreator in sourceviewerconfiguration class using following function: getinformationcontrolcreator but, can't override sourceviewerconfiguration. this override function: package texthoverpackage; import org.eclipse.jface.text.itexthover; import org.eclipse.jface.text.source.isourceviewer; import org.eclipse.jface.text.source.sourceviewerconfiguration; public class texthoversourceviewerconfig extends sourceviewerconfiguration { public itexthover gettexthover(isourceviewer sourceviewer, string contenttype) { system.out.println("i in other place!!!"); return new javatexthover(); } } the "i in other place!!!" message not

graphicsmagick - gm convert: Unrecognized units type -

i try compress png graphicsmagick(1.3.23 q8), here command: gm convert -units undefined -type palette -define png:format=png8 src.png dest.png and comes error: gm convert: unrecognized units type (undefined). "gm convert -help" shows units type supports pixelsperinch, pixelspercentimeter, or undefined. acctually, try imagemagick(7.0.1-6 q8 x86_64),and command following works fine: convert -units undefined -type palette -define png:format=png8 src.png dest.png i confused error. use "+units" instead of "-units undefined" (this works both imagemagick , graphicsmagick). in general, can use "+option" turn off options. documentation should clarified.

php - Why does the codeigniter cron not working -

i trying set cronjob in codeigniter on localhost when run same path terminal works this path have run cli(terminal): /usr/bin/php /home/user_name/path_to_index.php users foo this works but when set in crontab file : 3 * * * * /usr/bin/php /home/user_name/path_to_index.php users foo this not working. any idea wrong here? thanks in advance! try /usr/bin/curl http://examblewebsite/index.php/front/cronjob front - controller name cronjob - function name in localhost 0 13 * * * php [application_path]/index.php cli/reminders if have more details see link

scala - How to load data into hive external table using spark? -

i want try load data hive external table using spark. please me on this, how load data hive using scala code or java thanks in advance assuming hive external table created using like, create external table external_parquet(c1 int, c2 string, c3 timestamp) stored parquet location '/user/etl/destination'; -- location directory on hdfs and have existing dataframe / rdd in spark, want write. import sqlcontext.implicits._ val rdd = sc.parallelize(list((1, "a", new date), (2, "b", new date), (3, "c", new date))) val df = rdd.todf("c1", "c2", "c3") //column names data frame df.write.mode(savemode.overwrite).parquet("/user/etl/destination") // if want overwrite existing dataset (full reimport source) if don't want overwrite existing data dataset... df.write.mode(savemode.append).parquet("/user/etl/destination") // if want append existing dataset (incremental imports)

php - custom over-the-air android app installation -

help me in following query if has idea it: - in over-the-app android app installation, user redirected app store if clicked on download app link. dont want user redirect anywhere. what want when user clicks on download app link on website should popup sign in thorugh gmail , select mobile , agree permission , app automatically download on mobile.

php - Need Seprate Category Page for custom post types -

i have created custom post types(passion) , using built in categories it. please note using built in posts home page working fine, has own category,archive page. "passion" post type paid user. custom posts working fine. unable create category page "passion" post type if user goes url "www.site.com/passion/dance" shows "passion" custom posts "dance" category. using wck plugin create post types. have tried creating archive-passion.php,category-passion.php, taxonomy-passion.php files nothing worked. use http://domain.com/category/dance/?post_type=passion cpt , add custom code in archive-passion.php

c++ - Why is getchar_unlocked() faster than alternatives? -

i know how code works not find why code faster other i/o methords??? int read_int() { char c = getchar_unlocked(); while(c<'0' || c>'9') c = getchar_unlocked(); int ret = 0; while(c>='0' && c<='9') { ret = 10 * ret + c - 48; c = getchar_unlocked(); } return ret; } scanf("%d\n", &x) has parse format string , lock stream before , after reading. std::cin >> x might locking too, , might have sync stdin , , might need go through abstraction layers. with above, 1 type of input parsing (so no need parse format string , decide based on that) , importantly, don't lock stream. locking streams mandated posix, , glibc uses recursive mutexes prevent multiple threads (even in single-threaded environment) accessing stdin file simultaneously (which corrupt it). these mutexes quite expensive (your read_int should several (fivish?) times faster scanf("%d",&x) ). reg