Posts

Showing posts from 2015

What to use insread of Underscore.js ._where() for the arrays of property values -

let's have following data: [ { "name": "experiment type10", "scale": ["whole brain", "cell"], "datatype": "table" }, { "name": "experiment type11", "scale": ["tissue", "cell"], "datatype": "image" }, { "name": "experiment type12", "scale": "tissue", "datatype": "text" } ] with underscore ._where can filter out objects datatype "text", can't filter out objects scale equals "tissue" since it's in array. possible type of filtering elegantly? use filter , contains : var hastissues = function(item){ return item.scale === 'tissue' || _.contains(item.scale, 'tissue'); } var tissues = _.filter(list, hastissues);

How can I do a Facebook Connect with meteor.js? -

i following error when facebookconnect: w20140817-21:48:56.623(2)? (stderr) typeerror: cannot call method 'remove' of undefined w20140817-21:48:56.624(2)? (stderr) @ app/server/oauth.js:2:36 w20140817-21:48:56.624(2)? (stderr) @ app/server/oauth.js:11:3 w20140817-21:48:56.625(2)? (stderr) @ /users/username/copro/chatapp/.meteor/local/build/programs/server/boot.js:161:10 w20140817-21:48:56.625(2)? (stderr) @ array.foreach (native) w20140817-21:48:56.625(2)? (stderr) @ function._.each._.foreach (/users/username/.meteor/tools/cef2bcd356/lib/node_modules/underscore/underscore.js:79:11) w20140817-21:48:56.625(2)? (stderr) @ /users/username/copro/chatapp/.meteor/local/build/programs/server/boot.js:82:5 how can fix error?

javascript - plugin that auto img's height got an EXAMPLE -

i looking plugin arrange images that: http://milli.wpengine.com/ i have trying have not succsed... http://build-net.co.il/aba/ thanks guys. sorry bad english you want use jquery plugin masonry , allows stack images or it's more commonly known being used on: pinterest.

Export Excel Charts as Images using Powerpoint VBA -

i have below code have written export "chart1" excel sheet called "sheet1" new slide in created instance of powerpoint: sub chartstopowerpoint() dim pptapp powerpoint.application dim pptpres powerpoint.presentation dim pptslide powerpoint.slide dim pptslidecount integer dim ws worksheet dim intchnum integer dim objch object 'open powerpoint , create new presentation. set pptapp = new powerpoint.application set pptpres = pptapp.presentations.add 'set chart , copy new ppt slide set objchart = worksheets("sheet1").chartobjects("chart 1").chart objchart.chartarea.copy set pptslide = pptpres.slides.add(pptslidecount + 1, pplayoutblank) pptslide.shapes.pastespecial pppastejpg 'format picture size/position. j = 1 pptslide.shapes.count pptslide.shapes(j) if .type = msopicture .top = 87 .left = 33 .h

javascript - Loop through a <select> tag and append the content to JSON object -

i have <select> tag on site contains multipe choises options. need append these options in <select> tag existing json object. my html code: <form onsubmit="return false;" role="form"> <div class="form-group"> <label for="groupselector">group:</label> <select class="form-control" id="groupselector"> <option value="guests">guests</option> <option value="members">members</option> <option value="vips">vips</option> <option value="mods">mods</option> <option value="admins">admins</option> <option value="owners">owners</option> </select> </div> <div class="form-group"> <input type="text" placeholde

sql server - Change Default Name of Relations -

i have 2 tables below structure : *table user* id int identity username varchar role varchar *table ticket* id int identity admin_id int user_id int admin_id , user_id foreign keys user table. set relation name relations in mssql diagram, when create model database, relations : user , user1 . when i'm changing them manually, going ok, after refreshing model or re-create ticket table, user , user1 back. how can set final name relations in ef model?even refresh or delete entire model, want ef model relation name being same diagram relation name. there no way force entity framework names of properties relation names, instead takes table name property name (with integer suffix multiple properties). now issue, in scenario renamed properties change original names when ever update model database . we can stop entity framework not reset property names renamed them our own. way is, open model file (.edmx) go association folde

top.location.pathname stopping jquery working on other pages -

i have added following statement above plugin plugin work on specific pages. if (top.location.pathname === '/' || top.location.pathname === '/tickets/sell/' || top.location.pathname === '/contact/') { !function ($) { the problem since have added statement jquery work on pages listed above. i.e following statement in on master page run on login page if login url added plugin statement. <script> $(function () { if (location.href.match('login/?redirect=/basket/')) { $('div#sign').show(); } else { $('div#sign').hide(); } }); </script> any / advice appreciated! i guess added these if cases top of plugin. have care did added if using post-back way works if uses partial request(ajax) script link may not work.(browser not download js file). guess question can

python - Pad outgoing messages -

i can't quite figure out how pad message send. basically.. want pad message max 512 chars defined in rfc. i understand message being sent user contain user!user@hostname privmsg #chan (or other_user): text text text \r\n. thanks in advance. to pad string can use functions ljust , center or rjust , respectively: print "hello, " + "world".ljust(10) + "!" print "hello, " + "world".center(10) + "!" print "hello, " + "world".rjust(10) + "!" output ( try it ): hello, world ! hello, world ! hello, world! all 3 functions have optional second argument fillchar lets specify character used fill additional space.

Binding Dropdown list in MVC4+ASP.NET -

@html.dropdownlistfor(model => model._categoryid, new selectlist(viewbag.abc, "_categoryid", "_categoryname"), "select category") this above code working fine binding dropdown list need understand it.....can elobrate it? actually confused model=>model._categoryid why required? above line its expression evaluates property want bind to, in case _categoryid . html helper used generate html attributes used when posting back, in case <select name="_catagoryid" ... value="thevalueofcategoryid">

Redirect user that tries to view malicious URL or one that is not on the snort rule list? -

i have simple inline ips set using snort detection system. wondering if possible snort redirect user tries view url on disallowed list. i'm subscribed snort live-updated/most recent database , working , giving me alerts, thing have seen far on topic of redirections go: malicious attack -> snort recognizes attack -> redirected honeypot, , not: user on lan -> snort recognized disallowed site -> redirects xyz page you can use snort's replace keyword in rule replace disallowed url url of choosing. qualifications when using keyword new text must same length previous text. you can use react keyword respond html page of choice, block connection too.

I can't get any value from php Facebook graph api -

this full code. // include required files form facebook sdk require_once( 'facebook/httpclients/facebookhttpable.php' ); require_once( 'facebook/httpclients/facebookcurl.php' ); require_once( 'facebook/httpclients/facebookcurlhttpclient.php' ); require_once( 'facebook/entities/accesstoken.php' ); require_once( 'facebook/entities/signedrequest.php' ); require_once( 'facebook/facebooksession.php' ); require_once( 'facebook/facebookredirectloginhelper.php' ); require_once( 'facebook/facebookrequest.php' ); require_once( 'facebook/facebookresponse.php' ); require_once( 'facebook/facebooksdkexception.php' ); require_once( 'facebook/facebookrequestexception.php' ); require_once( 'facebook/facebookotherexception.php' ); require_once( 'facebook/facebookauthorizationexception.php' ); require_once( 'facebook/graphobject.php' ); require_once( 'facebook/graphsessionin

java - how to record testcase using selenium in IE -

i new selenium. my application ie compatible. i know can run test cases in any browsers using respective drivers is there way can use record test case using selenium ide in internet explorer ?? we have implemented our own recorder used recording in internet explorer. javascript file. the concept add listeners each object in source code of gui of web page. below code helps that. page loaded these listeners added. when perform click action, properties captured. here have given example of adding listener , getting properties of object of type "select", can same thing other types of objects. var added_mclistener = false; var tagn = dobj.tagname; if(tagn == "select") { dobj.attachevent("onchange",so_showobjinfo); dobj.added_oclistener = true; dobj.so_prevbgcolor = alll[i].style.backgroundcolor; } if(ta

php - reset key count in array -

i have array this: array{ 10 - 2011 headlight assembly nissan versa 11 - lh 07-11 ins qtly o.e.m - free same day shipping 12 - 000 13 - a0 14 - 40626a1 15 - $165 actual 16 - more desc stuff } that produced simple dom result. there multiple items within list. reset key 10 after 17 reached can loop on results within array , find proper values without having keys 10, 14, 15 - , keys 20, 24, 25, etc. not quite sure if have explained correctly, or how accomplish it. guidance appreciated. in advance! well, indexes deny suggest tu use array of these indexes. , loop through array 10 16 , come 10, suggest this $indexes_to_deny = [14,15,16]; $index = 10; while( condition stop loop ) { if($index%17===0) $index = 10; if(in_array($index,$indexes_to_deny)) { $index++; continue; } /* code here can access items inside array $array[$index] */ $index++: }

sql - Data did not display in Stored Procedure -

i'm new here, please correct me if ask wrongly. i did stored procedure, however, when execute it, errornumber , spname , errormessage came out. can please explain me did wrong? thanks. this executed: exec dbo.sppartmasterextension @domainsite = 'bris0011', @itemno='1002424251911', @itemdescription = 'new item', @itemvalue = '1', @itemum = '1', @employeeno = 'nn031097' this stored procedure: create procedure [dbo].[sppartmasterextension] @domainsite nvarchar(8), @itemno nvarchar(18), @itemdescription nvarchar(50), @itemvalue nvarchar(50), @itemum nvarchar(50), @employeeno nvarchar(18) begin declare @errorno integer = '', @spname nvarchar(max) = '', @errormessage nvarchar(max) = '' declare @itemumoriginal nvarchar(50) if exists (select id partmasterextension itemno = @itemn

codec - The reason for a 'free' box in an ISO BMFF or MP4 file? -

it's easy spot free box in .mp4 (or iso bmff) file. i'm wondering reason box. sort of padding file size? sometimes, spotted 2 consecutive free boxes! the following partial info mp4dump [ftyp] size=8+20 major_brand = iso5 minor_version = 0 compatible_brand = avc1 compatible_brand = iso5 compatible_brand = dash [free] size=8+17 [moov] size=8+637 [mvhd] size=12+108, version=1 timescale = 24000 duration = 14315000 duration(ms) = 596458 there padding boxes, other sections can correctly aligned (it ease updates ).

google docs - Script not changing data on template -

i have been trying create script email me report when form completed. sending email , pdf properly, not replacing key data data form. doing wrong? code.gs var doctemplate = "19vff3mzo9gbd2xywmrhlbfmnvzuxc4tdf44bcqr9sfy"; var docname = "test form2pdf"; function onformsubmit(e) { var email_address = "email@goeshere.net"; var field1 = e.values[1]; var field2 = e.values[2]; var field3 = e.values[3]; var field4 = e.values[4]; var field5 = e.values[5]; var field6 = e.values[6]; var field7 = e.values[7]; // document template, copy new temp doc, , save doc’s id var copyid = docslist.getfilebyid(doctemplate) .makecopy(docname + ' ' + field1) .getid(); // open temporary document var copydoc = documentapp.openbyid(copyid); // document’s body section var copybody = copydoc.getactivesection(); copybody.replacetext('keyfield1', field1); copybody.replacetext('keyfield2', f

winapi - C++ Transparent Client Area -

i attempting create program where, when click button on main window, secondary invisible window pops up, drawings on them, hence images appearing if floating. reason however, no part of "invisible" window becomes transparent. code declaring window class is: const char g_szclassname2[] = "inviswindow"; wndclassex inviswindowclass; hwnd invishwnd; inviswindowclass.cbsize = sizeof(wndclassex); inviswindowclass.style = ws_ex_transparent; inviswindowclass.lpfnwndproc = wndprocedure2; inviswindowclass.cbclsextra = 0; inviswindowclass.cbwndextra = 0; inviswindowclass.hinstance = hinstance; inviswindowclass.hicon = loadicon(null, idi_application); inviswindowclass.hcursor = loadcursor(null, idc_arrow); inviswindowclass.hbrbackground = (hbrush)(color_window+1); inviswindowclass.lpszmenuname = null; inviswindowclass.lpszclassname = g_szclassname2; inviswindowclass.hiconsm = loadicon(null, idi_application); registerc

How will I know, if two nodes are somehow connected in Cypher Neo4j -

i have graph depicts node , relationships, entity - references - entity. i want list containing source entity , connected entity these 2 entities not directly connected connected somehow. for example : - references -b , c - references - a, d - references - c. in case, want cypher qry return d - references - a. the output : a-b c-a d-c c-b d-a d-b cypher pattern matching in graphs. pattern interested in cover not a-b a-c-d . can using variable length match, e.g.: match (n)-[*]-(m) return n.name, m.name this assumes there name property on nodes, can returned. change other relevant property, or return n, m if you're using browser visualization. note match relationships regardless of direction, means you'll both a-d , d-a in result (and every other combination). if want match 1 direction, use: match (n)-[*]->(m) return n.name, m.name be careful these approaches - in small graphs, end matching huge number of combinations , cause neo4

c++ - Why it connected continuously whether the path is correct or wrong -

Image
i've written following code connect sqlite database file . qsqldatabase db = qsqldatabase::adddatabase("qsqlite"); db.setdatabasename("c://database.db"); if(!db.open()) ui->label->settext(ui->label->text() + "failed connect database"); else ui->label->settext(ui->label->text() + "connected."); when change correct path wrong path (ex: c://datafile.db or c:database.db ), remain prints connected. text. notice: if database file not exists, or correct path changed wrong path, create empty database file wrong path. is there problem in code prints connected time? if using sqlite always attempt create database file if can. may not want -- example, if need use data pre-existing database. should verify file exists on disk before trying open. qsqldatabase db = qsqldatabase::adddatabase("qsqlite"); qfile file ("c:/database.db"); if (file.exists()) { if(!db.open()) {

How to display specific column from CSV file in php? -

i have 1 csv file has 10 columns(a j). now, problem want display data column name e on screen using php. how read , display 1 column csv file? you can use fgetcsv() function. takes line of csv file , expands array. following script wil print out fourth column of each line of csv file. can change $col variable print out different column. <?php //column print, e 5th $col = 5; // open file reading $file = fopen("yourfile.csv","r"); // while there more lines, keep doing while(! feof($file)) { // print out given column of line echo fgetcsv($file)[$col]; } // close file connection fclose($file);

sql server - drop sql database vs dropping all tables -

after advice. i'm using mssql, , have process requires clean slate each run. current process uses drop database , create new one. every , hit error being in use. in order eliminate annoyance, wondering if dropping tables better method. what peoples thoughts on this? if want remove database detach server, , attach prepared clean database. means no longer t-sql operation server maintenance operation. might quicker.

regex - PHP replace : find and replace the same characters with different text -

how can find , replace same characters in string 2 different characters? i.e. first occurrence 1 character, , second 1 character, entire string in 1 go? this i'm trying (so users need not type html in body): i've used preg_replace here, i'll willing use else. $str = $str = '>>hello, code>> here text >>this more code>>'; $str = preg_replace('#[>>]+#','[code]',$str); echo $str; //output above //[code]hello, code[code] here text [code]this more code[code] //expected output //[code]hello, code[/code] here text [code]this more code[/code] but problem here is, both >> replaced [code] . possible somehow replace first >> [code] , second >> [/code] entire output? does php have in 1 go? how can done? $str = '>>hello, code>> here text >>this more code>>'; echo preg_replace( "#>>([^>]+)>>#", "[code]$1[/code]", $str );

oracle - Filter option using regular expression -

i have requirement filter names in table. example table name :- student columns :- name, class. the date name ----class highspeed ---c highspeed11 ---c1 highspeed22 ---c2 normal-------------n normal1-------------n1 normal2-------------n2 like have data srq, pwe ... my requirement need remove data using name... select distinct name student upper (name) 'srp%' or upper (name) 'highspeed%' or upper (name) 'srq%' or upper (name) 'pwe%' or upper (name) 'spinterface%' or upper (name) 'srm%' instead of using or condition, please let me know other option... ? thanks in advance. i'm not oracle user, quick through docs indicates oracle supports posix extended regular expressions (ere). regular expression matches names in query be: ^(srp|highspeed|srq

google maps api 3 - Javascript - calculate distance between latlng as percentage -

i have google map. within map have bounding box. within box, have series of points. need function express position of point respect bounds - ie 25% top of box, 15% left. i've tried countless (been @ day) different formulae, no result. i thought work (pseudo code): var y = ((point.latitude - ne.latitude) / (sw.latitude - ne.latitude)) * boundingboxheight normally have convert degrees radians , convert miles or km using radius of earth @ equator distance calculations. but in case can use degrees are. using following values pointlat 25% below nelat . var nelat = 62; var swlat = 58; var pointlat = 61; var y = ((nelat - pointlat)/(nelat - swlat))*100;

php string echo behaving weirdly -

the following not printing , have not yet found explanations online: <?php function aa() { return "<w"; } $r = aa(); echo $r; ?> no matter kind of quotes use. if print string not starting < , followed character prints correctly. on php.ini but, ideas??? you can try this: <?php function aa() { return htmlspecialchars("<w"); } $r = aa(); echo $r; ?>

android - How to preven the gridview scroll by default once dataset changed -

i have activity contains scrollview , , have gridview inside scrollview , layout: <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/root"> <relativelayout android:padding="10dp" android:layout_width="match_parent" android:layout_height="match_parent"> ......... <com.test.android.view.scrollablegridview android:layout_width="match_parent" android:layout_height="wrap_content" android:numcolumns="auto_fit" android:columnwidth="100dp" android:verticalspacing="2dp" android:focusable="false" android:clickable="false">

javascript prompt sent to php but output empty -

i trying allow adding of category category dropdownlist clicking '+' button below using ajax dropdownlist keeps disappearing instead. html codes follows <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title></title> <script> function addcategory() { var category = prompt("please enter new category: ", ""); if (category != null){ if (window.xmlhttprequest) { xmlhttp=new xmlhttprequest(); } else { xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4){// && xmlhttp.status==200) { document.getelementbyid("category").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","add_category.php?category="+category,true); xmlhttp.send(); } } </script> <script

sql - MySQL - Operand should contain 1 column(s) -

while working on system i'm creating, attempted use following query in project: select topics.id, topics.name, topics.post_count, topics.view_count, count( posts.solved_post ) solved_post, (select users.username posted_by, users.id posted_by_id users users.id = posts.posted_by) topics left outer join posts on posts.topic_id = topics.id topics.cat_id = :cat group topics.id ":cat" bound php code i'm using pdo. 2 valid value ":cat". that query though gives me error: "#1241 - operand should contain 1 column(s)" what stumps me think query work no problem. selecting columns, selecting 2 more table, , continuing on there. can't figure out problem is. is there simple fix this, or way write query? your subquery selecting 2 columns, while using project 1 column (as part of outer select clause). can select 1 column such query in context. consider joining users table instead; give more flexibility when selecting colu

Android Get length of highlighted text in TextView -

i'm doing app has textview , that's clickable. when clicked allows user select words or whole sentence or paragraph. got part of selecting , highlighting text, problem want have different colour highlight , save highlighted text db next time user check it, he/she see highlighted text. so far i've tried: tv.setonlongclicklistener(new onlongclicklistener() { @override public boolean onlongclick(view v) { int startselection = tv.getselectionstart(); int endselection = tv.getselectionend(); string selectedtext = tv.gettext().tostring().substring(startselection, endselection); log.e("text", "" + selectedtext); spannablestring spannable = new spannablestring(tv.gettext().tostring()); //spannable spannable = new spannablestring(tv.gettext().tostring()); spannable.setspan(new backgroundcolorspan(color.blue), startselection, endselection, 0);

Bootstrap thumbnail scroller -

Image
i want bootstrap thumbnail scroller, can scroll 1 one on click. $(document).ready(function() { $('#mycarousel').carousel({ interval: false }) });

php - Get input from HTML form as an Array and Check if there is input in the array or not -

Image
i input values html form array this: <form method = "post" action = "akf.php"> enter values in array $a:<br><br> <input type="text" name="a[one]" /> <input type="text" name="a[two]" /> <input type="text" name="a[three]" /> <input type="text" name="a[four]" /> <input type="text" name="a[five]" /> <br><br><input type="submit" value="find"><br><br> </form> now input php html form , display this: $a=$_post['a']; print_r($a); now without giving input in form (ie., empty form) if submit form, it should return message "no values entered in array ". note: want php return above message after submit form. functions , syntax's used achieve output: if (empty($a)) { echo 'no values entered i

Easy PHP Unexpected end of Apache -

my easyphp server stops working, has happened before, , changed port 8080, not work again. i checked whether there processes using port using netstat there aren't apps using port. here written in log: 18/08 15:43:25 easyphp apache createprocess "c:\progra~2\easyphp\binaries\apache\bin\eds-httpd.exe" 18/08 15:43:26 easyphp serverbase::timerproc : getprocessversion apache (pid: 7656) error 5 18/08 15:43:26 easyphp apache unexpected end of apache ! and when go eds-httpd.exe try , run it, " no listening sockets available, please try again i have no clue what's going on, please advise. update i found error. apparently ip has changed 10.0.1.15 10.0.1.14 i found ipconfig , changed config in httpd.conf

Icon for Action Extension in iOS8 -

i have worked on extensions , it's interesting. type of extensions, icons work except action extension icon white? know how create icon action extension? in build phases of extension settings, add images.xcassets (or icon file) copy bundle resources . ps: action icon, color data in image ignored. via apple docs the alpha channel of image used mask generate final image presented user. color data in image ignored.

java - Spring.io and Tiles 3 - Error 404 when .war file is deployed in Tomcat server -

i error 404 when deploy generated .war file stand alone tomcat server, if deploy war inside ide(intellij) tomcat server works fine. this initializer public void onstartup(servletcontext servletcontext) throws servletexception { annotationconfigwebapplicationcontext mvccontext = new annotationconfigwebapplicationcontext(); mvccontext.register(appconfig.class); servletcontext.addlistener(new contextloaderlistener(mvccontext)); servletregistration.dynamic dispatcher = servletcontext.addservlet( "dispatcher", new dispatcherservlet(mvccontext)); dispatcher.setloadonstartup(1); dispatcher.addmapping("/"); } this application configuration **tiles configuration** @bean public tilesconfigurer gettilesconfigurer() { tilesconfigurer tilesc

meteor - Linking Robomongo to an automatic email sending service? -

i have application running on meteor.js , mongo.db. using robomongo tool mongo.db. i'd following: 1. registers service (adding email db) 2. want send automatic welcome email person. is there possibility how it? you need email server (smtp), , use the meteor email library . if don't have email server , don't want create one, use commercial solution. ( example )

asp.net - Reading Value From Google Distance Matrix API C# -

i have following xml packet comes google. <?xml version="1.0" encoding="utf-8" ?> - <distancematrixresponse> <status>ok</status> <origin_address>poplar drive, kingsbridge, devon tq7 1sf, uk</origin_address> <destination_address>1 saint michaels road, kingsteignton, newton abbot, devon tq12 3aq, uk</destination_address> - <row> - <element> <status>ok</status> - <duration> <value>2710</value> <text>45 mins</text> </duration> - <distance> <value>37958</value> <text>38.0 km</text> </distance> </element> </row> </distancematrixresponse> now trying assign 2 values fields variables. i have pulled stream ie. stream stream = client.openread("http://ho-www/googleapiaccess/distancematrix.aspx?origins=" + orilat + "," + orilong + "&destinations

c++ - Crash in thrust sorting example -

i trying first example of official website's example https://developer.nvidia.com/thrust , changed vector size 32<<23. code like: #include <thrust/host_vector.h> #include <thrust/device_vector.h> #include <thrust/generate.h> #include <thrust/sort.h> #include <thrust/copy.h> #include <algorithm> #include <cstdlib> #include <time.h> using namespace std; int main(void){ // generate random numbers serially thrust::host_vector<int> h_vec(32 << 23); std::generate(h_vec.begin(), h_vec.end(), rand); std::cout << "1." << time(null) << endl; // transfer data device thrust::device_vector<int> d_vec = h_vec; cout << "2." << time(null) << endl; // sort data on device (846m keys per second on geforce gtx 480) thrust::sort(d_vec.begin(), d_vec.end()); // transfer data host thrust::copy(d_vec.begin(), d_vec.end(), h_vec.begin()); std::cou

virtual machine - Edit VMX file with vSphere Client -

i'm looking correct solution editing vmx file via vsphere clinet without need ssh esx host or using vi , nano please me?? @hwoosuk best way , have use vmware, winscp http://winscp.net , connect directly esxi ip console after enable ssh in vmware firewall (configure/soft/security profile) , can browse local esxi disk or vmfs on san/nas. edit whatever want carefully , log etc.., vmxf (no write or edit permit vmware if vm power on).so best way go inside vmware file system reading low-level subsystem. enjoy winscp linux serveur may use in life micro$ computer may use admin datacenter. in winscp menu go options/pref , paste directory have putty installed. (%programfiles%\putty\putty.exe) . retain @mister_potato_head solution safely vmware imposes , in case better thing have do. :)

visual studio - Im trying to make a write to text file in c# -

i have code doesn't seem doing bit stuck const string spath = "movieadd.txt"; system.io.streamwriter savefile = new system.io.streamwriter(spath); if (listbox1.selecteditems.count ==1) { foreach (var item in listbox1.selecteditems) { savefile.writeline(item); } savefile.close(); } the code writes lines when 1 entry in list selected. i'm unsure whether want, considering you're trying write 1 line per selected item. may want rewrite code following, allows more 1 row selected. also, file closed in case in following code. const string spath = "movieadd.txt"; if (listbox1.selecteditems.count >= 1) { using (system.io.streamwriter savefile = new system.io.streamwriter(spath)) { foreach (var item in listbox1.selecteditems) { savefile.writeline(item); } } } another issue may don't have explicit path in spath variable. may cause problems, depending on current w

ios - UIView draw rect retain's the previous drawing and does not clear on view.transform -

i have following code show marker in uiview. marker show's well, , once try pinch zoom , scale uiview using transform first drawing remains is, after calling setneedsdisplay. my custom uiview subclass has following code - (void)drawrect:(cgrect)rect { // drawing code cgfloat w=20.0f; cgfloat h=8.0f; cgcontextref context=uigraphicsgetcurrentcontext(); cgcontextsetfillcolorwithcolor(context, [uicolor bluecolor].cgcolor); cgcontextclearrect(context,self.bounds); cgcontextsetstrokecolorwithcolor(context, [uicolor redcolor].cgcolor); cgcontextsetlinecap(context, 2.0); cgmutablepathref leftmarker=cgpathcreatemutable(); cgpathmovetopoint(leftmarker, null, 0, 0); cgpathaddlinetopoint(leftmarker, null, w, 0); cgpathaddlinetopoint(leftmarker,null, w, h); cgpathaddlinetopoint(leftmarker,null, h, h); cgpathaddlinetopoint(leftmarker,null,h, w); cgpathaddlinetopoint(leftmarker,null,0, w); cgpathaddlinetopoint(leftmarke

c# - Thread to delay a process when F4 key detected -

please refer following code static class program { [flags] private enum keystates { none = 0, down = 1, toggled = 2 } [dllimport("user32.dll", charset = charset.auto, exactspelling = true)] private static extern short getkeystate(int keycode); private static keystates getkeystate(keys key) { keystates state = keystates.none; short retval = getkeystate((int)key); //if high-order bit 1, key down //otherwise, up. if ((retval & 0x8000) == 0x8000) state |= keystates.down; //if low-order bit 1, key toggled. if ((retval & 1) == 1) state |= keystates.toggled; return state; } public static bool iskeydown(keys key) { return keystates.down == (getkeystate(key) & keystates.down); } public static bool iskeytoggled(keys key) { return keystates.toggled == (getkeystate(key) & keys

php - Using variables in fat-free framework template -

i'm reading fat-free framework user guide , want try display template uses f3s own template language. template displayed, variable not substituted , don't know why. index.php $f3 = require('../f3/base.php'); // moved lib dir 1 level $f3->set('ui', 'ui/'); $f3->route('get /*', function($f3) { $f3->set('test', 'foo'); echo view::instance()->render('layout.html', 'text/html'); } ); $f3->run(); layout.html contains {{ @test }} and displayed too, instead of "foo". other directives of f3 template language don't seem work either. am missing step activate first or something? you have use template class instead of view class $f3 = require('../f3/base.php'); // moved lib dir 1 level $f3->set('ui', 'ui/'); $f3->route('get /*', function($f3) { $f3->set('test', 'foo');

ODBC connection to Informix database from another Linux-based system -

i want connect informix database using odbc connection web server. both informix server , web server implemented on different machines; both system using suse linux. i know how create odbc connection on same informix server using unixodbc. but don't know how create odbc connection 1 linux based machine machine informix server implemented. if use windows 7 instead of linux windows 7 provides odbc connection template , there no problem in connectivity. but how client pc running linux os. please guide me. if can connect 1 linux machine informix database using odbc have installed informix odbc client , 1 of odbc managers. such manager can unixodbc, informix own manager or else. on linux managers use odbc.ini , odbcinst.ini configuration files configure driver , connection. check how configured on linux machine works: find .ini files, check environmet variables ( informixdir , informixsqlhosts ) , find odbc manager (unixodbc?). if use unixodbc can test conne

java - minimum hibernate version compatible with java8 -

i have terrible time trying find out minimum version of hibernate supports being run on java8 jre, user code use java8 features. i found this bug , talks making use of java8 features in hibernate, it's planned hibernate 5.2 , sure hibernate 4.3.1 supports java8, since wildfly ships , claims support java8. i've tried find in hibernate bug tracker bugs related java8, again "too new". finally i've searched in hibernate release notes .0 versions, , again without success: seems release notes describe changes since previous rc or beta release... tried tracking rc , beta releases 4.3.0.final , 4.2.0.final failed finding such mention. we using hibernate 4.2.12.final , wonder whether start using java8 or whether need upgrade newer version of hibernate (4.3.x presumably). for context, using tomee application server. 1.7.0 released support java8. in case must upgrade hibernate 4.3.x, i'm bit afraid can't use hibernate 4.3.x tomee i've seen this: &q

android - Update fragment in ViewPager -

i have 2 fragments in viewpager , on 2nd fragment page have textview contains total of edittext's on both fragment pages. have code in onresume() method not called between swipes. what easiest way update total in textview on 2nd fragment when values changed in first fragment. i hoping simple 1 line job for such behavior should make interface between fragments , define interface , make object(initialize getactivity()) of in first fragment , when event occured(changing data in first fragment) call function has been defined in interface , in parent activity implement interface , fragmentmanager pass changed value second fragment , update textview .

c - Pass double to a function expecting uint8_t* -

suppose have function takes double pointer argument , want modify value: void fun(uint8_t *arg1) { *arg1 = 2; } int main(void) { double a; fun((uint8_t*)&a); // not work return 0; } is possible? what specifying undefined behaviour : can't cast pointer different type. your best bet create uint8_t in main , pass pointer function fun , assign modified value double.

android - Difference between INTERNAL SD CARD and Internal storage. -

i m confused abt difference between "internal sd card" , "internal storage". have 12 gb shown internal sd card , 1 gb internal storage in "storage" settings of android.there's no micro sd card inserted.i didnt attach external micro sd card. i find "move tablet" , "move sd card" options applications installed. internal storage occupied, wanted move app "internal storage" "internal sd card" using "move sd card" option says "not enough storage"."internal sd card" has 100 mb available. why cant move data between these 2 internal storages. the storage in device partitioned, example have 32gb of storage: name | fs type | size /system | ext4 | 591mb : partition rom stored, it's mounted read can't write there /data | ext4 | 1.5gb : partition called "internal storage", it's used store apps , it's data. /storage/sdcard0 | vfat | 27gb : it's

SQL Server 2008 - Sum of Sums -

i have managed write following query returns results need see occupancy , capacity floors in building. select fma0.bldgcode, fma0.floorcode, sum(fma0.occ) occupancy, sum(case when fma0.spacetype 'a-off-%' or fma0.spacetype 'a-wks-%' fma0.capacity else 0 end) capacity fma0 fma0.bldgcode = 'tst01' group fma0.bldgcode, fma0.floorcode order fma0.bldgcode, fma0.floorcode but need add in order column sum of "occupancy / capacity". thks ftd select bldgcode, floorcode, occupancy, capacity , occupancy+capacity allsum from( select fma0.bldgcode, fma0.floorcode, sum(fma0.occ) occupancy, sum(case when fma0.spacetype 'a-off-%' or fma0.spacetype 'a-wks-%' fma0.capacity else 0 end) capacity fma0 fma0.bldgcode = 'tst01' group fma0.bldgcode, fma0.floorcode )tmp order bldgcode, floorcode

java - character getting replaced by using regular expression -

string tempprop="(kfsdk)#"; tempprop = tempprop.replaceall("[^\\s]\\)\\#", "\"?if_exists}"); system.out.println("1"+tempprop+"2"); i want output 1(kfsdk"?if_exists}2 but output of regular expression 1(kfsd"?if_exists}2 last k getting trimmed, , don't know why. if tempprop ( )#, output should 1( )#2 without "?if_exists regular expression adds "?if_exists if no space present else returns string is you use negative lookbehind instead of [^\\s] because causes effect in final output. is, lookarounds 0 width match. string tempprop="(kfsdk)#"; tempprop = tempprop.replaceall("(?<!\\s)\\)#", "\"?if_exists}"); system.out.println("1"+tempprop+"2"); output: 1(kfsdk"?if_exists}2 explanation: (?<!\s) negative lookbehind asserts preceeds not space character. \)# matches literal )# symbols.

Android Dragging Custom ListView -

i'm trying implement google example ( https://www.youtube.com/watch?v=_bzivjmgh-q ), custom object. almost ok, items in listview doesn't change position could explain missed in code? mainactivity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_list_view); arraylist<product> prodarray = new arraylist<product>(); for(int = 0; < cheeses.scheesestrings.length; ++i) { prodarray.add(new product(cheeses.scheesestrings[i],r.drawable.ic_launcher)); } stablearrayadapter adapter = new stablearrayadapter(this, r.layout.text_view, prodarray); dynamiclistview listview = (dynamiclistview) findviewbyid(r.id.listview); listview.setcheeselist(prodarray); listview.setadapter(adapter); listview.setchoicemode(listview.choice_mode_single); } adapter: package com.example.android.listv