Posts

Showing posts from May, 2013

matlab - Draw a truncated rectangular pyramid -

Image
how can draw truncated rectangular pyramid in matlab ? base , top rectangles should have 4:3 aspect ratio. image shown guideline. ability through funnel nice. >> x = [0 0 0 0; 1 1 -1 1; 1 -1 -1 -1]; y = [0 0 0 0; 5 5 5 5; 5 5 5 5]; z = [0 0 0 0; 1 1 -1 -1; -1 1 1 -1]; fill3(x,y,z, ones(3,4)) this achieves pyramid now need adjustments cut peak. x =[ 3/4 -3/4 -3/4 -3/4; 3/4 3/4 -3/4 3/4; 3 3 -3 3; 3 -3 -3 -3]; y =[ 5/2 5/2 5/2 5/2; 5/2 5/2 5/2 5/2; 5 5 5 5; 5 5 5 5]; z =[-4/2 4/2 4/2 -4/2; 4/2 4/2 -4/2 -4/2; 4 4 -4 -4; -4 4 4 -4]; fill3(x,y,z, ones(4,4)) grid this create truncated square pyramid 4:3 aspect ratio @ base.

vbscript - VB script to convert one excel file format to another -

i have following vb script save excel file (tab delimted format) excel file (excel workbook or excel 97-2003 workbook format) dim objexcel, objworkbook set objexcel = createobject("excel.application") set objworkbook = objexcel.workbooks.open("\\scc-fs\reports\aaa.xls") objexcel.visible = true objworkbook.saveas "new.xls",56 wscript.quit error: object invoked has disconnected clients wrong ?

ssl - PHP cURL call returning error 56 with NSS error -12195 -

i have internal server (internal network) make rest api call external server. i don't know if helps external server running php 5.3.6 curl 7.19.7 . to make safer (other firewall box limits external ip addresses can call internal server static ip address of external server), generated self-signed ssl server certificate internal server. i generated client certificate used external server when making calls. the calls being made using curl library of php . page makes calls looks (this page created "proof of concept", see call can made): <?php $mycurl = curl_init(); $verbose = fopen('curl_error_log','a'); $url_site = 'https://internal.server.com/api_test.php'; $options = array( curlopt_header => false ,curlopt_returntransfer => true ,curlopt_verbose => true ...

php - Magento custom module with two tables in the backend menu -

i spent 3 days trying solve problem custom module. have custom menu 3 submenus the first item (regions), gets correct table config.xml file but, when i'm trying add table second item (subregions), can't see anything, see blank page. there config.xml <models> <web> <class>company_web_model</class> <resourcemodel>web_mysql4</resourcemodel> </web> <web_mysql4> <class>company_web_model_mysql4</class> <entities> <web> <table>regions</table> </web> <subregions> <table>subregions</table> </subregions> </entities> </web_mysql4> </models> i've tried lot of different possibilities.

SQL Server - Update with FROM and JOIN not considering all the rows that satisfies JOIN condition -

so, have 2 tables t1 , t2 in t1 has primary key column "a" unique values , t2 has foreign key "a" shown below. t1 --- conditionmet 1 0 2 0 t2 --- b c 1 10 5 1 20 20 2 10 10 2 30 0 now, want update "conditionmet" column of t1 table "1" whenever value of column b in t2 equal value of colum c (for 1 specific value in a). update query below update t1 set t1.conditionmet = (case when t1.conditionmet = 0 , t2.b = t2.c 1 end) t1 t1 inner join t2 t2 t1.a = t2.a here problem is not looping through rows of t2 going through first record value of "a". suppose if take value "1" in t1, @ first row (1 10 5) not @ second row (1 20 20) of t2. please me understand whats wrong query. in advance!! try this.... update t1 set t1.conditionmet = case when t1.conditionmet = 0 , t2.b = t2.c 1 end t1 t1 inner join t2 t2 on t1.a = t2....

initializing memory in VHDL -

i have piece of code: type mem_type array (0 15) of std_logic_vector (15 downto 0); signal mem : mem_type:= (x"269f",x"351a",x"7752",x"9152", x"ccd1",x"7a8b", "a429",x"5758", x"a325",x"bc3d",x"725d",x"b459", x"7264",x"e241",x"74fc",x"19bc"); i getting following error @ line initializing mem: no array or record type can found has elements of types matching aggregate. one of initialisation values doesn't have x before specify hex value. code trying put string 16-bit std_logic_vector , of course error.

date - VBA DatePart vs Format function -

i wondering if there difference while formating date as: myyear = datepart("yyyy", date) or as: myyear = format(date, "yyyy") i figured out format returns value string. there other differences?

Rationale for breaking this answer into a function using Javascript -

so doing coderbyte problem earlier today , happy able break down , complete without looking @ answers else completed. however, after completing it, realized way did it, did not build functions. kept calling former variable. question really, necessary use function when answering problem? looking @ big picture, pro's of converting answer mine function ( or pair of functions) i took number represented full minutes, , broke down hours , minutes. think should easy follow. var num = 400; var hourdivide = ( num / 60 ); var digits = hourdivide.tostring().split(''); var hour = digits[0] var = 60 * digits[0] var minutes = num - console.log( "you have " + hour + " hours , " + minutes + " minutes left" ) the rationale breaking code function reusability , composability. let's @ how that code turned useful function function minutestohours(num) { var hourdivide = ( num / 60 ); var digits = hourdivide.tostring().split('...

javascript - In angular, how to access object property via bracket notation inside templates? -

i'm creating custom directive show form errors (using ng-messages) in generic way. directive invoked via: <show-errors form="login_form" field="email"></show-errors> ... <show-errors form="login_form" field="password"></show-errors> the directive declaration: function showgenericerrors() { return { restrict: 'e', templateurl: 'views/error.dir.tmpl.html', replace: true, scope: { form: '@', field: '@' }, transclude: true, link: function (scope, element, attrs, ctrl, transclude) { scope.theform = scope.$parent[attrs.form]; transclude(scope, function (clone, scope) { element.append(clone); }); } }; } and it's template: <div> <!-- here can access form property via bracket notation --> <!-- {{theform[field].$blurred }} --> <!-- here cannot u...

Access 2013 - text search on all queries and/or all tables -

in access 2013... how can search queries particular table name? how can find queries include update command? how can search tables particular field name? thanks. you should give this try. essentially, can export objects text file, , search there.

internet explorer - How can I make an iframe security error occur in IE? -

Image
a user of 1 of websites reporting alarming-looking frame content error on page embeds google maps. have played security settings in ie9, ie10 , ie11 have been able either display embed without issue or display nothing (blank space iframe should be.) what need in version of ie see error? here embed in question (need redact specific map.) <iframe id="googlemap" width="640" height="480" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps/ms?t=m&amp;msa=0&amp;msid=1234.1234&amp;source=embed&amp;ie=utf8&amp;ll=37.996163,-96.855469&amp;spn=33.053774,56.25&amp;z=4&amp;output=embed"></iframe> here screenshot of error user receiving. open new browser window, , pull down "tools" menu. select "internet options". click "security" tab, select "internet" icon, ,...

Zurb Foundation's tab in quadrant layout -

Image
i use code found zurb foundation documentation. unfortunately, tabs laid out horizontally. need them - here tab code zurb foundation , link well http://foundation.zurb.com/docs/components/tabs.html#tabs-deeplink-2 <ul class="tabs" data-tab role="tablist"> <li class="tab-title active" role="presentational" ><a href="#panel2-1" role="tab" tabindex="0" aria-selected="true" controls="panel2-1">tab 1</a></li> <li class="tab-title" role="presentational" ><a href="#panel2-2" role="tab" tabindex="0"aria-selected="false" controls="panel2-2">tab 2</a></li> <li class="tab-title" role="presentational"><a href="#panel2-3" role="tab" tabindex="0" aria-selected="false" controls="panel2-3"...

ios - Center a dynamically created UIView over a UILabel in the storyboard not working -

Image
i have uilabel placed on storyboard autolayout. (constraints include height , width , center horizontally , , vertical spacing top ). i have uiview makes circle drawrect method using uibeizerpath . nothing fancy far. for simplicity sake using hard coded numbers illustrate problem. now want circleview placed on uilabel , centering label in circle. however, can not line correctly. anchor points or messing up. i tried setting circleview's centerpoint labels center point. no luck. i tried setting circleviews x location of label minus width divided two. no luck. the closest can y coordinate. use label.center.y - 52.5 (half of radius). cv = [[circleview alloc] initwithframe:cgrectmake(whathere.x, whathere.y, 155, 155)]; cv.radius = 75; cv.strokewidth = 5; the radius of circle 75. width/height of circleview 155 because stroke of circle 5. (radius x 2) + 5 , give me view see circle. the dar...

c++ - Printing an array of structs of structs results in an unexpected execution error? -

for struct definitions, initialize of them print contents printstruct(); after printing first element program hangs unexpectedly, 1.i thinking if malloc() fails elements right?. 2.i unfortunately have work thse structs, ideas whats wrong code below? note: char arrays have sizes equal max length of content receive plus 1 null terminating character '\0', each team has 7 players maximum, amount of teams 21000. sorry kind of error-checking question have never worked structs in c++ in past. typedef struct player{ char firstname[50]; char lastname[50]; }player; typedef struct team{ int id; char title[50]; char summary[100]; int numberofplayers; player *players; }team; typedef struct teamslog{ team *arr; int numberofteams; }teams; int main() { teamslog log; log.numberofteams = 21000; log.arr = (team*)malloc(log.numberofteams * sizeof(team)); (int = 0; < log.numberofteams; ++i) { (log.arr+ i)->id = 1; (log....

Enter key disabled on Linux box -

i have ssh'd linux box , reason cannot hit enter run command (such pwd ). can press enter when there no text on prompt, time text in prompt, seems enter disabled. kind of security measure? i've tried in putty , cygwin, , both exhibit behavior. how can enable enter key can run commands on box? try using ctrl + j intead of enter.

Qt QML nested listview, weird scrolling behaviour -

i having problem concerning scrolling behaviour of listview . when nesting lists, inner lists able scroll , down, looks ugly. to avoid problem set inner lists boundsbehavior flickable.stopatbounds . solved problem , inner lists looks commond delegates. however, scrolling behaviour appears little bit weird. scrolling upwards works fine if want scroll downwards, have move finger in opposite direction @ least millimeter. seems first have activate downwards scrolling scroll upwards. how fix this? not sure fits use case, using repeaters instead of inner lists?

javascript - Why can't SignalR model passed to client be parsed like JSON? -

it hard word question, let's hope detailed explanation better! i have signalr set have struct i'm passing client each time game board updates. that object is: public struct updatemodelmini { public bool ismatchupover; public int player1wins; public int player2wins; public timespan timeleft; } of updatemodelmini can parsed on client side json object: updateboardmodel.ismatchupover etc... the problem can't seem recognize "parts" of system.timespan object provided .net where updatemodelmini.timeleft.timeleft returns: 00:00:15 updatemodelmini.timeleft.timeleft.seconds ...returns undefined i'm sure there's simple trick here object exposed hub , consequently client, can't seem find via google... do need create own [public] object model store timespan object? encountered this?

cross platform - Is OS detection possible with GLib? -

is possible determine on platform (gnu/linux, win32, os x) vala app running? as vala compiled language (as opposed intermediate or interpreted) can determine platform using favorite build tool , use conditional compilation . something like: #if windows message ("running on windows"); #elif osx message ("running on os x"); #elif linux message ("running on gnu/linux"); #elif posix message ("running on other posix system"); #else message ("running on unknown os"); #endif the build tool have pass -d linux , etc compiler. i careful , last resort, because can backfire. it's better use cross platform libraries handle differences you. btw: see how done in c++ .

ios - How to send Parse query into another ViewController -

i'm trying send on query salesarray = [[nsmutablearray alloc]initwitharray:objects] editdata, can't life of me figure out. i'm trying fill picker view..i query executed [parseconnection parseproduct] can't array on editdata.m parseconnection.h #import <foundation/foundation.h> #import <parse/parse.h> #import "constants.h" //#import "editdata.h" @protocol parseconnectiondelegate <nsobject> @end @interface parseconnection : nsobject //<pfsubclassing> { nsmutablearray *salesarray, *callbackarray, *contractorarray, *ratearray, *ziparray, *jobarray; } - (void)parsesalesman; @property (strong, nonatomic) id<parseconnectiondelegate> delegate; //added @property (strong, nonatomic) uitextfield *salesname; parseconnection.m #import "parseconnection.h" @interface parseconnection () { // nsmutablearray *salesarray, *callbackarray, *contractorarray, *ratearray, *ziparray, *jobarra...

c# - Awaiting last method call -

a few posts on stack overflow have suggested following: any async method have single await expression awaiting task or task < t >, right @ end of method no further processing, better off being written without using async/await. architecture async/await await or return is advice particular circumstances? on web server, isn't 1 of main reasons use async/await , being while awaiting updatedataasync method below, thread return threadpool , allowing server work on other requests? should savedataasync await db update call given it's last call in method? public async task workwithdataasync(data data) { manipulatedata(data); await savedataasync(data); await senddatasomewhereasync(data); } public async task savedataasync(data data) { fixdata(data); await dbconnection.updatedataasync(data); } also, given don't know savedataasync used, making synchronous hurt method workwithdataasync not? removing await , returning task ...

php - "404 not found" error after updating public_html -

i'm quite of rookie @ programming yet, , have made webpage couple of months ago. had add more functions , changes, , uploaded them "public_html" folder it's needed, after uploading (and yes, file manager shows new files , modified ones properly) when try accessing them web, don't exist. new files go 404, , existing files have overwritten don't show latest changes, is, if didn't change @ all, it's host still shows previous "image" or ghost of site before updated it. is there other folder i'd have update files public_html? also, checked on "www" folder, , files there well, won't show. host 000webhost.com this might not 'programming' question itself, it's latest phase, , i've been whole night through it, it's frustrating worked through , won't show. thank you. edit: uploaded page , please try in check if it's pc cache or not, hope is... if php error, exists, if 404, doesn't edit2: ...

java - One Class/Multiple Constructors vs. Multiple Classes (Inheritance) -

i'm trying implement following tree-like structure @ moment (i.e., man, woman, child, specialman, specialwoman, specialchild). there neater/alternate (less repeating code) way approach it? public class person { int hat; int one_glove; } public class man extends person { int coat; int shorts; } public class woman extends person { int coat; } public class child extends person { int shorts; } public class specialman extends man { int second_glove; } public class specialwoman extends woman { int second_glove; } public class specialchild extends child { int second_glove; } what i'm thinking having class person contain variables , having multiple constructors -> linked each specific object type? public class person{ int hat; int one_glove; int coat; int shorts; int second_glove; public person(int coat;int shorts; int hat; int one_glove;){} //man public person(int coat;int hat; int one_glove;){} //woman public person(int c...

java - FindBugs: overridden equals() causing static code analysis error EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS -

i getting findbugs error confused how fix. since old, legacy code, can not it. equals() implementation, not perfect doing job, shows error @ static code analysis. findbugs error: eq_check_for_operand_not_compatible_with_this equals checks incompatible operand any suggestions on how fix this? i did make couple of tweaks not prevent error. class account extends managedaccount{ string accountid; public void setaccount(entityid value) { //some setter } void entityid getaccountid() { return entityid;//entityid class } public boolean equals(object o) { if (o instanceof account) { if (this.getaccountid().equals(o))) { return super.equals(o); } } return false; } } probably findbugs triggers @ third line of equals method: if (this.getaccountid().equals(o))) there strange here. compare this.getaccountid() entire object o . just fix line , should fi...

regex - Find and replace in Java using regular expression without changing file format -

i've code replaces 10:a 12:a in text file called sample.txt . also, code i've changing file format, shouldn't. can please let me know how same using regular expression in java doesn't change file format? file has original format below 10:a 14:saxws after executing code outputs 10:a 14:saxws. import java.io.*; import java.util.*; public class filereplace { list<string> lines = new arraylist<string>(); string line = null; public void doit() { try { file f1 = new file("sample.txt"); filereader fr = new filereader(f1); bufferedreader br = new bufferedreader(fr); while ((line = br.readline()) != null) { if (line.contains("10:a")) line = line.replaceall("10:a", "12:a") + system.lineseparator(); lines.add(line); } fr.close(); ...

java - Error building Selenium+Maven: missing pom.xml -

i new selenium , maven tools. trying set selenium 2.0 java project using maven, via this guide . after creating , saving pom.xml in project directory, run mvn clean install , following error: (...) goal specified requires project execute there no pom in directory (c:\users\user\documents\testautomation). please verify invoked maven correct directory. -> [help 1] my pom.xml looks this, in example link: <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>mysel20proj</groupid> <artifactid>mysel20proj</artifactid> <version>1.0</version> <dependencies> ...

javascript - kendo ui treelist - lock a column -

i trying create lock on column on treelist in kendo ui. if user clicks on button lock column in treelist, tried : <!doctype html> <html> <head> <base href="http://demos.telerik.com/kendo-ui/treelist/frozen-columns"> <style>html { font-size: 12px; font-family: arial, helvetica, sans-serif; }</style> <title></title> <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.common-material.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.material.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.dataviz.min.css" /> <link rel="stylesheet" href="http://cdn.kendostatic.com/2015.1.408/styles/kendo.dataviz.material.min.css" /> <script src="http://cdn.kendostatic.com/2015.1.408/js/jqu...

SQL list of things LIKE -

this question has answer here: is there combination of “like” , “in” in sql? 19 answers instead of doing query in sql such as: select quartersection label 'ne%' or label 'sw%' is there anyway, can query group values label in ('ne%', 'sw%') ? you can create temp table , put values there, use join create table tempkeywordsearch ( keyword varchar(20) ); insert tempkeywordsearch values ('ne%'), ('sw%'); select q.* quartersection q join tempkeywordsearch t on (q.col t.keyword);

join - Split multiple count using in mysql with same table -

i have query in below format: select etm.etm_taxonomy, count( pe.pp_profileid ) total_counts expertise_taxonomymaster etm left join expertise_taxonomy et on etm.etm_id = et.`et_taxonomy` left join expertise e on e.et_taxonomy = et.`et_id` left join profile_expertise pe on pe.pp_expertiseid = e.et_id pe.pp_profileid in ( select pj.pj_profileid jobtitle_taxonomymaster jtm left join jobtitle_taxonomy jt on jtm.jtm_id = jt.`jt_taxonomy` left join jobtitle j on j.jt_taxonomy = jt.`jt_id` left join profile_jobtitle pj on pj.pj_jobtitleid = j.jt_id jtm.jtm_taxonomy = 'associate' or jtm.jtm_taxonomy = 'partner' ) , et_lawfirmid in (195,196) group etm_taxonomy and have results follows: etm_taxonomy total_counts advertising 18 antitrust 47 banking 258 but need below results, count should split based on jtm.ttm_taxonomy field etm_taxonomy patners195 par...

javascript - How to stop function execution on click? -

i have function shows slide animated elements. the click on $('.slider-wrapper') must hide slide stop animations on , bring them initial position. i use animate.css library animate elements. when hide slide before animation complete , open again, animations aren't running in order how can reset animations on slide close , start them begining on slide show? $('.slider-wrapper').on('click', function(event){ $(this).hide(); $('video')[0].pause(); cleartimeout(timer); $('.slide').stop(true, false).hide(); $('.slide').find('*').removeclass('animated'); $('.slide').clearqueue(); }); $('.a-1').on('click', function(){ showslide1(); }); function showslide1() { var slide = $('#slide-1'); slide.show().children().hide().delay(1000); slide.children('h1.center').delay(400).show(0).addclass('animated zoomin'); slide.children('h1 + p').delay(2...

python - Row vs. Column Vector Return during Numpy Array Slicing -

i learning python , stumbled across result confused me little bit when performing basic array slicing commands. i created 4x5 matrix using command: >>> = numpy.arange(20).reshape(4,5) which gives: [[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10,11,12,13,14], [15,16,17,18,19]] if index array this: >>> a[0:3, 2] i row vector: [2, 7, 12] but if index array this: >>> a[0:3, 2:3] i column vector: [[ 2], [ 7], [12]] when plugging 2 commands in expected results same, why getting different types of vectors? thank you! tl;dr version in numpy, taking single index along dimension array reduces dimensionality 1, taking index 2d array results in 1d array (first case). taken slice along dimension maintains same dimensionality, if slice has length of one, taking length-1 slice of 2d array still 2d array (second case) detailed version the issue first result isn't row vector, 1d array. when take single scalar index dimension,...

android - How to get info of currently playing music using broadcastreceiver while the app isn't running? -

i receive broadcasts music players while app in background. i found following code here: @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); intentfilter if = new intentfilter(); if.addaction("com.android.music.metachanged"); if.addaction("com.android.music.playstatechanged"); if.addaction("com.android.music.playbackcomplete"); if.addaction("com.android.music.queuechanged"); registerreceiver(mreceiver, if); } private broadcastreceiver mreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { string action = intent.getaction(); string cmd = intent.getstringextra("command"); log.v("tag ", action + " / " + cmd); string artist = intent.getstringextra("artist"); string album = intent.getstringextra(...

java - How to update a field in an entire collection in mongodb using morphia -

i have collection named teaminfo, created class in java using morphia's annotations follows: @entity("teaminfo ") public class teaminfo { @id private integer teaminfoid; private string teamname; private integer usercount; } i need update operation on teaminfo changes usercount , sets 0. need query set usercount value in teaminfo documents. how teaminfo documents in query? updateoperations<teaminfo> updateoperation = datastore.createupdateoperations(teaminfo.class).set("usercount", 0); query<teaminfo> query = datastore. ??? ; datastore.update(query, updateoperation); i started learning morphia, great if can me. you use empty query without condition. updateoperations<teaminfo> updateoperation = datastore.createupdateoperations(teaminfo.class).set("usercount", 0); query<teaminfo> query = datastore.createquery(getentityclazz()); // empty query datastore.update(query, updateopera...

pointers - How can I delete a node in my linked list in C++? -

i've pasted work far here: http://codepad.org/whjuujrm the concepts of linked lists boggle mind, thought i'd practice. know how add nodes, , edit nodes, don't know how remove nodes in particular scenario. my pseudo code: previous == - 1; if(stdid == now->getid()); previous->setnext(now->getnext); delete now; return; how implement this? the mind-tease in deleting element linked list updating pointer brought element in first place. in list case, top (and/or possibly bottom ), node's next . walk through list hunting cur pointer, keep prev pointer advance 1 step behind enumerate. assuming find victim node (if don't, there's nothing do, woot!), prev in 1 of 2 states: it null, in case top pointer refers victim node , top must updated, or... it pointer node, in case node's next member needs updated reflect victim node's next member value. in both cases bottom may need updating well. in first case bottom need chang...

C++ No instance of function template matches speciefied type -

i have template: template <typename t> t func(const t[],int); and try specialize to: template <> char* func(const char[], int); but have error: no instance of function template "func" matches specified type i don't know why cannot return char* template? solution change to: template <typename t> t* func(const t[],int); you declaring specialization wrong: template <> char func<char>(const char[], int) if meaning return pointer, have solved on own, , need change general case t* t refers typename , not including qualifiers - function return t & if wanted to. t type/name ( typename !) of object.

angularjs - How to get row index in angular ui-grid 3.0 -

i'm working angular ui-grid version 3.0 , can not find way index of row, add numeration column grid. me. there isn't way index of row easily, depends you're trying do. expect numbering when sorts data - want numbers stay in original data, or want them change , align new sort order? in faq http://ui-grid.info/docs/#/tutorial/499_faq find: the question here you're trying achieve. want actual row index, or want display sequential id in rows? if latter, can adding counter column data: $scope.mydata.foreach( function( row, index){ row.sequence = index; }); if want show index of row within grid internals, depends on internal want. can index of row within grid.rows, show row stands in original rows list (not filtered nor sorted), or index of row within grid.rendercontainers.body.visiblerowcache (filtered , sorted), or render index of row within displayed rows (given virtualisation, particularly useless number). if you're ok whenever sorts or fi...

javascript - What format is used for nodejs fs.utimes -

in nodejs, arguments of fs.utimes should written in format,e.g. atime , mtime . api: fs.utimes(path, atime, mtime, callback) those parameters javascript date s, not strings. from docs: please note atime, mtime , ctime instances of date object , compare values of these objects should use appropriate methods. general uses gettime() return number of milliseconds elapsed since 1 january 1970 00:00:00 utc , integer should sufficient comparison, there additional methods can used displaying fuzzy information. more details can found in mdn javascript reference page. and source code : fs.utimes = function(path, atime, mtime, callback) { callback = makecallback(callback); if (!nullcheck(path, callback)) return; binding.utimes(pathmodule._makelong(path), tounixtimestamp(atime), tounixtimestamp(mtime), callback); }; // converts date or number fractional unix timestamp function tounixtimestamp(time) { if (uti...

java - Maven Uberjar as Maven Dependency -

i'm working legacy app, process building plugins requires adding dependencies on 150 non-maven (ant believe?) jar files. ideally, i'd package these 150-jars single jar, place on artifactory, , use maven-dependency team can more setup development environment. i've been experimenting one-jar, maven-assembly-plugin, , maven-shade-plugin, appears create 1 jar contains several other jars (i.e. unzip contents). when adding jar maven dependency, maven appears unable resolve contents/dependencies within these "sub-jars." the code below example of i've tried; feel free suggest other approaches. <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.company</groupid> <art...

c# - Apply a debugger visualizer without assembly dependencies -

i trying create debug visualizer applies variety of objects without make visualizer assembly dependency. want apply visualizer variety of classes, including private nested, internal, , lots of complex generics involved (both of parent , nested classes). means i'm creating proxy object critical data involved. i don't want main assembly have dependency on visualizer assembly, , don't want visualizer assembly know guts of main assembly. in main assembly, have looks this: namespace mainasm { public interface ivisualizable { debugproxy debugvisualizer { get; } } [serializable] public class debugproxy { // data required visualization here public debugproxy() { } public debugproxy(ivisualizable source) { var orig = source.debugvisualizer; // copy properties orig } } } then visualizer, have code looks this: [assembly:system.diagnostics.debuggervisualizer( typeof...

Counting first element in python and printing? -

i have data structure in python keeps track of client analytics looks this 'b': ['j'], 'c': ['k'], 'a': ['l'], 'd': ['j'], 'e': ['l'] i'm trying print table this: site counts: j got 2 hits k got 1 hits l got 2 hits so far i've thought of using .fromkeys() method, don't have of idea how go getting data, i've tried lot of different things , have had no luck on problem. python comes counter class included: collections.counter() : from collections import counter site_counts = counter(value[0] value in inputdict.values()) demo: >>> collections import counter >>> inputdict = {'b': ['j', 'k', 'l'], 'c': ['k', 'j', 'l'], 'a': ['l', 'k', 'j'], 'd': ['j', 'l', 'k'], 'e': ['l', 'j', 'k...

x86 64 - Unable to install Maximo 7.5.0.7 Fix Pack after install Maximo 7.5 DEMO -

Image
i installed maximo 7.5 on windows server 2008 r2 64-bit defaults (websphere 7, db2, tivoli directory). i'm trying install 7.5.0.7 fix pack error after ran install_win64.bat (run administrator). error occurs few steps after "database ready upgrade" checkbox. ctgin2076e: exception running wasthingclient method task runconfigurationstep. the ccmd_install.log said: fndupgradepanelactionshandleinstall: getting thin client config task object fndupgradepanelactionshandleinstall: running thin client config task fndupgradepanelactionshandleinstall: returned running thin client config task fndupgradepanelactionshandleinstall: got task result task return. completion message :ctgin2076e: exception running wasthinclient method task runconfigurationstep. fndupgradepanelactionshandleinstall: verifyinputs method, rc=-1 cmpmessage=ctgin2076e: exception running wasthinclient method task runconfigurationstep. stderr=ctgin2286e: error occurred while configuring websphere ap...

unicode - Python TypeError using the translate() method -

i trying build function in python pulls specific characters out of string, , returns each of remaining words on separate line. apostrophes must removed -- , contraction must split, second half moving new line. for instance, have sentence fragment: ", doesn't mean him." and want remove these punctuation characters: ",'." it should return: that doesn t mean him here function i've written: def remove_chars(frag, punc): if "'" in frag: frag = frag.replace("'", " ") frag = frag.translate(none, punc) frag = frag.split(" ") in frag: print remove_chars(", doesn't mean him.", ",'.") and here's error i'm receiving: typeerror: deletions implemented differently unicode thanks in advance this. the unicode.translate() method indeed different str.translate() method. takes one argument, dictionary mappi...

php - Shorthand for arrays: is there a literal syntax like {} or []? -

what shorthand array notation in php? i tried use (doesn't work): $list = {}; it perfect, if give links on information other shorthands php. update: of php 5.4.0 shortened syntax declaring arrays has been introduced: $list = []; previous answer: there isn't. $list = array(); can start adding elements. <?php $list[] = 1; $list['mykey'] = 2; $list[42] = 3; it's ok far php concerned. won't e_notice undefined variables . e_notice level error issued in case of working uninitialized variables, not in case of appending elements uninitialized array. as shorthand methods, there lots scattered over. if want find them read the manual . some examples, amusement: $arr[] shorthand array_push . the foreach construct echo $string1, $string2, $string3; array concatenation + the existence of elseif variable embedding in strings, $name = 'jack'; echo "hello $name";

python - Avoiding Excel's Scientific Notation Rounding when Parsing with Pandas -

i have excel file produced automatically occasional large numbers 135061808695 . in excel file when click on cell shows full number 135061808695 visually automatic "general" format number appears 1.35063e+11 . when use excelfile in pandas pulls value in scientific notation 1.350618e+11 instead of full 135061808695 . there way pandas pull full value without going in messing excel file? pandas might pulling full value not showing in default output: df = pd.dataframe({ 'x':[135061808695.] }) df.x 0 1.350618e+11 name: x, dtype: float64 standard python format: print "%15.0f" % df.x 135061808695 or in pandas, convert integer type integer formatting: df.x.astype(np.int64) 0 135061808695 name: x, dtype: int64

PHP LDAP search issue -

i'm trying first time use ldap in php code. want determine if member of particular ad group. i've cobbled code other examples , runs without error, indicates 0 results, when user in fact member of group. here code: $hostname="192.168.1.1"; $conn=ldap_connect($hostname, 389); ldap_set_option ($conn, ldap_opt_referrals, 0) or die('unable set ldap opt referrals'); ldap_set_option($conn, ldap_opt_protocol_version, 3) or die('unable set ldap protocol version'); if ($conn) { $dn = "dc=domain,dc=local"; // if (!($ldapc=ldap_bind($conn,'cn=username,cn=users,dc=domain,dc=local','p@ssw0rd'))) { if (!($ldapc=ldap_bind($conn,'username@domain.local','n0tmyp@ssw0rd'))) { is full cn=,dc=, etc or @domain.local preferred method here? also, assuming searches performed membership against user authenticated ldap_bind()? code continues: echo "<p>error:" . ldap_error($conn) . ...

sql server - C# Linq to SQL Query Not Returning results but generated SQL works fine? -

i trying run below code linq sql. know results return zero. when run correlating select statement linq generates in sql server management studio , substitute parameters values returns result. ideas? var qryres = (from res in dbhistorycontext.tblresumes res.updateddate >= dtdatefrom.date && res.updateddate <= dtdateto.date select res); it returns sql code: select [t0].[resumehistoryid], [t0].[resumeid], [t0].[monsterid], [t0].[resumetitle], [t0].[updateddate], [t0].[updatedstatus], [t0].[source], [t0].[lastmodified], [t0].[modifiedby], [t0].[datechanged], [t0].[monsterhistoryid], [t0].[changetype] [dbo].[tblresume] [t0] ([t0].[updateddate] >= @p0) , ([t0].[updateddate] <= @p1) where @p0 = '4/01/2015 12:00:00 am' , @p1 = '04/30/2015 12:00:00 am' but reason returned select statement works when directly copies , pasted , ran against dbcontexts database linq sql doesn't seem return results when do: var lst = qr...

R Send Email on Windows without Java -

i have script sends email pdf attachment using r , mailr. however, windows server putting script on not have java installed mailr not work. alternatives? mail server requires username , password think sendmailr out since not support authentication. nice within r script. honestly best bet have server mail enabled , write script can execute on http call. response <- download.file("http://{url}/", "response.html", method="internal")

c++ - User defined spatial predicate within Boost Geometry -

i need determine whether interiors of 2 geometries intersect. interiorsintersect predicate not specified ogc or boost geometry defined de-9im matrix ( see also ): t * * * * * * * * i've created own predicate using relate function in boost geometry. namespace bgr = boost::geometry::detail::relate; using interiorsintersectmask = bgr::static_mask<'t','*','*','*','*','*','*','*','*'>; template<typename geom1, typename geom2> inline bool interiorsintersect(const geom1& geom1, const geom2& geom2) { return bgr::relate<interiorsintersectmask>(geom1, geom2); } this works great. concern relate function , static_mask type not documented part of boost geometry api , implementation details far can tell. safe use relate in way? there alternative achieving same goal using boost geometry? ideally see relate algorithm within boost/geometry/algorithms . the relate() , rel...