Posts

Showing posts from June, 2014

php - Unable to show 4 products in row in subcategory/shop page woocommerce -

i'm unable show 4 products in row, put filter in themes/functions.php . code below: function loop_columns(){ return 4; } add_filter('loop_shop_columns', 'loop_columns',999); when return 3, working fine, when put 4 here, shows grid this: product | ______________________________________ product | product | product | product ______________________________________ product | product | product | product ______________________________________ product | product | product | product note: why product display on top? please me. live link of issue http://csjs.com/product-category/bhai-guriqbal-singh-ji-books/ more detail : 4 products in row, after adding filter 4 columns in functions.php, problem occur. if go direct shop page fine, if open category wise products not showing well, because show sub-categories of parent on shop page. note: if reduce width upper 3 columns, single product in row shift on above row. requirement is, 1 row show sub categories ,

android - Show ProgressBar in an AppWidget that updates every second -

i've been researching on topic before implementing it. thing is, mine music player app i'm making widget, control music playback. wanted put seekbar in widget that's not supported. progressbar supported there hardly widgets use one. i'm skeptical of how using progressbar effect user's phone's performance (in terms of battery life , memory usage). since progressbar meant display current position of music playing, have updated every second. read here progress bar in appwidget playback service updating widget's progressbar every second bad idea. post more 4 years old. couldn't find newer. question is, still bad idea use progressbar , updates every second, in app widget? or have latest android updates brought in new ways efficiently? if yes, how go it? any guidance helpful. question is, still bad idea use progressbar, updates every second, in app widget? in general, bad idea update app widget every second, regardless of whe

javascript - How to get the height and width of window in bootstrap -

in bootstrap have fixed top nav bar , fixed bottom nav bar. want show large image in background between space of 2 nav bars , want cover width of window. how can dynamically height between navbars , width of window? window size may change depending on device.so need dynamic $(window).resize(function() { var top_nav_height = $("#id_of_top_nav").height(); var bottom_nav_height = $("#id_of_bottom_nav").height(); var window_height = $(window).height(); var height_of_open_space = window_height - (top_nav_height+bottom_nav_height); $("#id_of_img").css({ height:height_of_open_space+'px'; }); }); this fine if 0px padding , margin, if not values , subtract height_of_open_space before applying img height

android - How to find id of dynamically created radio groups and each have 4 radio buttons -

how find id of dynamically created radio groups , each radio button have 4 radio buttons you can set id every view setid(int) , search it. remember put in layout views without same ids.

c# - How to bind a text box to a member in data context conditionally? -

i'm not sure if it's possible @ wonder if it's possible bind text box 2 different fields depending on value of third. suppose have carrier goes origin destination , has status of being on way or having arrived. because of business logic , way customer works want grid of orders this. #id orgin dest. status 101 b going 102 c d going 103 d going however, when order id e.g. 102 reaches status, point of destination should viewed in origin column , destination column should empty (or show next stop or whatever else), this. #id orgin dest. status 101 b going 102 d - done 103 d going so bind column origin field origin in data context if status going bind field destination if status done . if it's not possible, how can approach it? forced create new data type maps actual orders viewable orders? or add property view model isn't supported field rather renders value depending on status? here exa

Wildcard replace RegEx in C# -

i've searched , searched, seen bits of code looks solution, doesn't work. i'm not experienced in use of regular expressions , see i'm doing wrong here. string line = input.replace("<td>", ";"); string withouttabs = regex.replace(line, "\t", ";"); string withouttd = regex.replace(withouttabs, ".*</td>", ";"); the code above trying replace of <td> </td> , tabs html table layout. doesn't work, doesn't remove tabs nor replace </td> tags. </td> tag attached text, this: text</td> i want this: text; could point out mistake, or regex wrong , need replace else? i want replace <td> </td> , tabs ; regex.replace(input, @"</?td>|\t", ";"); demo

android - Change Image in ListView if cursor has certain value -

i have several markers on google maps , in each marker listview several entries. each entry can liked user , if has liked, there stored entry in sqlite database marker id, entry id , if has liked (1) or took (0). want filled heart shown below each list item user has liked. problem is: if there many entries, there randomly filled hearts, if user liked 1 entry. can figure out mistake? activity, saves in sqlite database if entry saved: getallentryslistview.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { try { jsonobject entryclicked = jsonarray.getjsonobject(position); entryid = entryclicked.getstring("id"); } catch (jsonexception e) { e.printstacktrace(); } likebutton = (imageview) view.findviewbyid(r.id.heartimage);

c# - It is possible to request a bing map image from a given size ( meters )? -

hello work on game based on map generation bing. the problem is: card generated based on address given user, after generate 1km2 card (1000m wide , 1000m long). unfortunately found no bing api retrieve map defined size in meters. can define "level zoom" , resolution. here's use (from microsoft bing api tile code library example): bing maps tile system // bing map (resolution max. 834 pixel) zoom level 16 var stream = await httpclient.getstreamasync("api/newmap/?latitude=46.6052284&longitude=7.0967002&mapsizeheight=834&mapsizewidth=834&zoomlevel=16"); // calculated "latitudecentre" , "zoom level" , 0.8 meter/pixel double meterperpixel = tilesystem.groundresolution(latitudecentre, 16); for example (834/834 pixel) , zoom level 16 => gives me scale of 0.8 meter / pixel. can not generate 1 meter / pixel map. think solution problem exist? i hope if yes ^^ :-) ok , yes it's possible !! take time

php - htaccess rewrite url with parameters not showing images -

i trying rewrite urls using htaccess. i want similar url, www.mydomain.com/region/category/product/ it go page, www.mydomain.com/index.php?reg=region&cat=category&prod=product i using below code in htaccess, rewriterule ^([^/]+)/([^/]+)/([^/]+)/?$ index.php?reg=$1&cat=$2&prod=$3 [l] though able access parameters in index.php, browsers unable load images, css etc, htaccess rewriting urls them. please me solve issue. thanks in advance! you can use rewritecond before rewriterule statement rewritecond %{request_uri} !\.(jpg|png|css)$ [nc]

hadoop - No daemons are running after formatting the namenode -

after format namenode in singlenode cluster, not able see any java process or hadoop daemnos running in cluster..i have restarted cluster many times. didn't work. after format nanenode.... ur name node new clusterid. others nodes have old cluster id. make ur cluster unstable. i'd u have backup of metadata restore using that.

unix - Copy column data from one text file add to end of another -

i looking unix cmd or script extract column file1: 150807 0 9 5 and append file2: date 150706 150713 150720 150727 *150807* p1aw01 0 0 0 0 *0* p1aw02 0 12 12 12 *9* p1cp01 0 0 0 0 *5* the added column needs left justified , aligned others in file2. join command used, removes formatting , spacing added file2. i'm using older ver. of korn shell , cannot use column tool or sed -i option. thanks! try paste command paste file2 file1 > outputfile

javascript - Sorting a JSON by value of a dynamic name property -

i've been trying online coding excericise, excercise : a json array has random number objects contains key , double value. array may have 10000 objects. ex: = [{"a": 2.0},{"a": 2.7},{"c": 2.0},{"b": 5.1},{"d": 2.9},{"c": 2.0},{"f": 2.2},{"h": 2.1}] another array b has random set of sum operations executed keys. value of keys can found in a. if key not presented in a, value zero. ex: b = ["a+b","b+d+f","k+z"] your job combine arrays b , a, providing array c contains results of sum operations of b. resulting array must sorted in descending order. combining examples above, resulting array be: ex: c = [ {"b+d+f": 10.2}, {"a+b": 9.8}, {"k+z": 0} ] the code looks (please let me know if there better implementation whit smaller o()) var = [{"a": 2.0},{"a": 2.7},{"c": 2.0},{&qu

javascript - Webpack - dynamic require and paths -

my webpack.config file looks this var path = require('path'); var webpack = require('webpack'); module.exports = { entry: { app: './app' }, output: { path: path.resolve(__dirname, 'build'), filename: '[name]-bundle.js' } }; i have dynamic requires this function loadmodule(modname, cb, onerr){ if (modname == 'contacts') require(['../modules/contacts/contacts', 'html!../modules/contacts/contacts.htm'], cb); else if (modname == 'tasks') require(['../modules/tasks/tasks', 'html!../modules/tasks/tasks.htm'], cb); else onerr(); } which work great. i'm seeing 1.1-bundle.js , 2.2-bundle.js getting added build folder . the problem is, when these dynamic requires triggered, i'm seeing 404s in network tab, since webpack trying load 1-1.bundle.js root of project, instead of build folder told webpack put it. how correct this?

sql - REPEAT function equivalent in Oracle -

i know how achieve same functionality repeat() in sql*plus. example consider problem: display character '*' many times value specified integer attribute specified each entry in given table. nitpicking: sql*plus doesn't have feature that. database server (oracle) provides ability execute sql , has such function: you looking rpad() select rpad('*', 10, '*') dual; will output ********** more details can found in manual: https://docs.oracle.com/cd/e11882_01/server.112/e41084/functions159.htm#sqlrf06103

kernel - MPTCP configuration in ubuntu -

[![enter image description here][1]][1] [1]: http://i.stack.imgur.com/nxrbp.png <-a picture captured understanding said i want ask installation & implementation of mptcp in ubuntu. by following web site, multipath-tcp.org, i'm going set mptcp test environments. after finishing configuring apt-repository, typed command 'netstat -m'. but, did'nt see mptcp connection. as guess reason of problem, component have in red box apply net.mptcp.mptcp_path_manager. because of absence of 'fullmesh' in red box, can see event green box. in case of blue box, can see 'default' can applied net.mptcp.mptcp_path_manager. correctly. i want know how can add additional component red box?? if know that, please ask me..! i have pool english skill, sorry , thank effort read question. in image seems bug. suggest install previous version. sure using correct mptcp , ubuntu versions.

android - How to start app when phone starts with smartface.io -

i using notifications.local.schedulenotification schedule notification. however, if phone rebooted before fire event, notification not fire. i have app start when phone boots can add notification alarm manager again. in android manifest asking following permission. <uses-permission android:name="android.permission.receive_boot_completed" /> how can implemented in smartface? today, not supported smartface, there plugin support soon, can write own plugin , use it. also licenced users, there option ask new implementations. if need new features, can report them smartface team, , these features added road map.

java - 2D Water effect in libGDX -

i'm working libgdx , i'd reproduce water behavior can find in games terraria or go hell. water must able flow under effect of gravity , adapt it's shape container's shape. actually don't know start, therefore have no code show. found tutorial water effects reflexion or physics box2d, nothing want project. if have clue it'd great. thanks ! the water effect can achieved using liquidfun physics engine based on box2d. there liquidfun extension libgdx available.

mysql - Delete duplicate rows with same text -

i have table news fields: idnews idarea title text date what want delete duplicate rows same title , text except 1 (the 1 earliest date) try query without success. i tried these queries, didn't work: delete news idnews not in (select min(date) news group title,text, date); delete idnews news date< date , title= title , text=text; assuming idnews key should work: delete news idnews not in ( select idnews ( select idnews news join ( select title, text, min(date) min_date news group title, text ) x on news.title = x.title , news.text = x.text , news.date = x.min_date ) ); the reason nested joins mysql won't let delete data table you're directly referencing in join. second level subquery creates temporary result set allow delete. sample sql fiddle

python - Django 1.7 Migrations hanging -

i have django migration trying apply. gets made fine (it's small, it's adding charfield 2 different models. when run actual migrate hangs (no failure, no success, sits). through googling i've found other open connections can mess restarted db. db connect continuously running jobs , new queries sneak in right away. small, , last time tried restarting think able execute migrate before else. still nothing. are there other known issues cause this? at least in postgresql cannot modify tables (even if it's adding new columns) while there active transactions. easiest workaround to: run migration script (which hang) restart webserver/wsgi container when restarting webserver open transactions aborted (assuming don't have background processes have transactions open), no transactions blocking table, migration finish.

sql server - Microsoft Dynamics AX 2012 R3 XDS Security on Finacial Dimesion -

i'm trying create ax security framework 1 of client. key task here enable branch accounting in ax 2012 r3 environment. means i'm required filter different transactions / customers / vendors / transfer orders on basis of location & financial dimension bu respectively such each branch (location) should see records of there respective branch. i created custom security roles enabled xds framework on them, easy in case of customer, vendor etc had location wise field. but in case of transactions i.e 'ledgerjournaltrans' table not able filter on basis of financial dimension. field ledgerdimesion combination of different dimensions hard use in aot query. if 1 give insight on how filter transactions or other records on basis of financial dimension combinations ? note: i've studied white paper filter through dimensions on xds example mentioned there based on mydepartment table , methods cannot use in scenario link white paper reference you

c++ - Linker can't find function definition in a namespace -

i /tmp/ccnl7yz1.o: in function 'main': main.cpp:(.text+0x70): undefined reference 'dng::gendungeon()' main.cpp:(.text+0xf0): undefined reference 'dng::clrdungeon(char**)' collect2: error: ld returned 1 exit status error when i'm trying compile program. worked great before added namespace functions. i'm compiling this: g++ -std=c++11 main.cpp dungeon.cpp dungeon.h namespace dng { char** gendungeon(); void clrdungeon(char**); class dungeon { //methods , variables } } dungeon.cpp #include "dungeon.h" using namespace dng; char** gendungeon() { //stuff } void clrdungeon(char** dungeon) { //another stuff } /*implementation of class methods void dungeon::genstart(){} -> */ main.cpp #include "dungeon.h" int main () { //stuff auto dungeon = dng::gendungeon(); //stuff dng::clrdungeon(dungeon); return 0; } i tried make .o files myself g++ -std=c++11 -c main.cpp g++ -st

java - Maven dependency stripVersion creates wrong classpath -

i trying compile project maven (through eclipse), while stripping versions dependency jars. have following in pom.xml: <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-dependency-plugin</artifactid> <version>2.8</version> <executions> <execution> <id>copy-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputdirectory>${project.build.directory}/lib</outputdirectory> <overwritereleases>false</overwritereleases> <overwritesnapshots>false</overwritesnapshots> <overwriteifnewer>true</overwriteifnewer> <stripversion>true</stripversion> </configuration> </execution> </executions> </plugin

sql server - How two split data with two separated? -

have variable declare @var nvarchar(max) = 'a=2*b=3*c=4|a=10*b=11*c=12|a=20*b=21*c=22' want split table variable declare @tbl table(a varchar(50),b varchar(50),c varchar(50)) response must : a b c 2 3 4 10 11 12 20 21 22 how ? when order of fields sorted use this: declare @var nvarchar(max) = 'a=2*b=3*c=4|a=10*b=11*c=12|a=20*b=21*c=22' set @var = replace(@var, '*', ',') set @var = 'select ' + replace(@var, '|', ' union select ') exec(@var) when result has 3 columns, order of fields can changes: declare @var nvarchar(max) = 'a=2*b=3*c=4|b=10*a=11*c=12|a=20*b=21*c=22' set @var = replace(@var, '*', ',') set @var = 'select a,b,c (select ' + replace(@var, '|', ') dt union select a,b,c (select ') + ') dt' exec(@var)

r - Simultaneously subsetting and operating on a specific column of a data frame -

let's have data.frame df df<-data.frame(a=1:5,b=101:105,c=201:205) can call subset of data while simultaneously performing kind of modification (e.g., arithmetic) 1 of columns (or rows) on fly? for example, if want return first , second column of df return log of column 1 values. there notation modify df[,1:2] produce following on fly?: b >1 0.0000000 101 >2 0.6931472 102 >3 1.0986123 103 >4 1.3862944 104 >5 1.6094379 105 this example within() within(df[1:2], <- log(a)) # b # 1 0.0000000 101 # 2 0.6931472 102 # 3 1.0986123 103 # 4 1.3862944 104 # 5 1.6094379 105 or if prefer not have <- in call, can use brackets within(df[1:2], { = log(a) })

php - How exactly do I create a custom EntityManager in Symfony2/Doctrine? -

new guy @ symfony/doctrine. kindly guide me. requirement: create custom entitymanager override of methods remove (instead of remove, want perform update , modify parameter isvalid in class, records never deleted) , find ( find record has non 0 isvalid ) etc , use instead of doctrine's entitymanager. i started reading through thread: is there way specify doctrine2 entitymanager implementation class in symfony2? , found answer user2563451 not straightforward. got lost when talks not follow approaches (again no location of files modified). i have looked @ entitymanager.php , tells not use extend entitymanager class. rather asks extend entitymanagerdecorator. on looking @ entitymanagerdecorator, there no methods available inside (like create, persist, etc found in entitymanager) mean need create new methods each , every single entity manager functionality ? since there no clear defined way done, confused thing started. doctrine cookbook of little use me not have informatio

How to get Process name from process id in windows through C++ without enumerating process? -

i need process name process id in windows find process names associated logged event. able execution process id logged event. process handle required input use getprocessimagefilename() method. it's not able process handle logged event. in duplicate question , talks running process. need not running process since talks logged event. & have doubt of whether processid vs processname combination unique or not in windows. need consider also.. i expect there must structure map process id process name. there structure so? or other methods process image name process id? i need process name process id in windows find process names associated logged event. if getting process id log, valid if original process still running. otherwise, id no longer valid process name. if process has exited before read log, bets off. i need not running process since talks logged event. then out of luck, if original process name not logged. i have doubt of whether proc

how to Delete file form folder by php..by name which is written by user in html form (input) -

how delete file form folder php..by name written user in html form (input).please thanks.. unlink(); i'ts different files: fom http://php.net/manual/en/function.rmdir.php <?php if (!is_dir('examples')) { mkdir('examples'); } rmdir('examples'); ?> you'll want pull $_post variable to, so: <?php $folder = $_post['folder']; if (!is_dir($folder)) { rmdir($folder); } ?>

c# - Web API global error handling add custom header in response -

i wondering if possible set custom header values whenever internal server error has occurred? doing: public class fooexceptionhandler : exceptionhandler { public override void handle(exceptionhandlercontext context) { // context.result contains custom header values context.result = new internalservererrorresult(context.request); } } here want set header values though appears in request response not contain it. is there way of doing this? it should possible creating own exception filter. namespace myapplication.filters { using system; using system.net; using system.net.http; using system.web.http.filters; public class customheadersfilterattribute : exceptionfilterattribute { public override void onexception(httpactionexecutedcontext context) { context.response.content.headers.add("x-customheader", "whatever..."); } } } http://www.asp.net/web-api/over

c# - When Resizing Custom Task Pane It is Flickring ,Working Fine in Word 2010 but in Word 2013 it is Flickring -

public void flow_resize(object sender, painteventargs e) { flowlayoutpanel flow = sender flowlayoutpanel; var item = listctpmgr.firstordefault(o => o.flp.name == flow.name); if (item == null) return; addedctp = (microsoft.office.tools.customtaskpane)item.ctp; if (addedctp == null) return; toolstrip _toolstrip = (toolstrip)flow.controls[0]; int maxbuttonwidthforthistoolbar = 0; foreach (toolstripitem toolstripitem in _toolstrip.items) { if ((toolstripitem.width) > maxbuttonwidthforthistoolbar) { maxbuttonwidthforthistoolbar = (toolstripitem.width); } } maxbuttonwidthforthistoolbar += 10; if (addedctp.dockposition == msoctpdockposition.msoctpdockpositionleft || addedctp.dock

ios - UIPasteboard string returning null from Today extension -

it seems in ios 9/xcode 7 beta 5, unable access [[uipasteboard generalpasteboard] string]; from today widget extension every time no matter contents, returns (null). looked through release notes , did not see regarding this. any ideas? it seems undocumented bug ios 9 beta 5, in particular, ios runtime. same code works normal app on ios 9 beta 5, , today widget in ios 8.x devices.

javascript - knockout.js observablearray push not binding click -

i have html follows: <table id="table"> <thead> <tr> <th>employee id</th> <th>name</th> <th>role</th> <th>actions</th> </tr> </thead> <tbody data-bind="foreach: employees"> <tr> <td data-bind="text: empid"></td> <td data-bind="text: name"></td> <td data-bind="text: role"></td> <td> <a data-bind="click: editemployee">edit</a> </td> </tr> </tbody> </table> <div id="createform"> <input id="empidc" /> <input id="namec" /> <input id="rolec" /> <button type="button" id="inser

R Function Slow, Looking to Increase Speed/Performance -

i've built prediction function in r, when run it's slow, , i'm using sample of 1% of data i'll using in production. function intended predict next word given series of ngrams (two-word, three-word, or four-word combinations - created corpus). i pass words function, example "i can", , series of three-word combinations. output ranked in order decreasing "i can read", count of 4. here two-word ngram passed matrix, dim , example data position 100. dim(bigram_index) [1] 46201 3 bigram_index[,1][100] [1] "abandon" bigram_index[,2][100] [1] "contemporary" bigram_index[,3][100] [1] "1" here prediction function: predict.next.word <- function(word, ng_matrix){ ngram_df <- data.frame(predicted=character(), count = numeric(), stringsasfactors=false) col_ng_matrix <- nrow(bigram_index) if(ncol(ng_matrix)==3){ (i in 1:col_ng_matrix){ first_word <- ng_matrix[,1][i]

machine learning - Aggregating labels in GradientBoostingRegression -

i trying understand scikit-learn's gradient boosting regression algorithm. followed source code , have understanding of iterative construction of trees based on chosen loss function. couldn't figure out answer how take average of labels underlying estimators when invoke predict() . i followed function call down this line . here, scale holds learning_rate , if not provided, default 0.1. so, if use 500 trees, don't understand why multiplying each of 500 different labels, given sample, 0.1. if direct me published paper explains in depth, appreciated.

how the Prestashop code will flow? -

i new prestashop. wanted learn how code flow . ex. how product inserting in database ? how product data fetching , displaying in store page ? please me . you should open prestashop product class. you can product data using this: $product = new product($id_product); if add new product: $product = new product(); write parameters like: $product->name = 'test'; $product->reference = '35gh'; $product->save(); if u print out product array see parameters. luck, have fun. , lot of information in stackoverflow how php add product , etc.

glteximage2d - Generating and updating 8-bit gray-scale texture in OpenGL ES 2.0 -

for opengl texture cache need initialize large (≥ 2048x2048) texture , update little sections of it. the following (pseudo-)code works: // setup texture int[] buffer = new int[2048*2048 / 4]; // generate dummy buffer 1 byte per pixel int id = glgentexture(); glbindtexture(gl_texture_2d, id); glteximage2d(gl_texture_2d, 0, gl_alpha, 2048, 2048, 0, gl_alpha, gl_unsigned_byte, buffer); // perform update glbindtexture(gl_texture_2d, id); gltexsubimage2d(gl_texture_2d, 0, x, y, width, height, gl_alpha, gl_unsigned_byte, data); but find totally unnecessary creation of 4mb int-buffer bit undesirable least. so, tried following instead: // setup texture int id = glgentexture(); glbindtexture(gl_texture_2d, id); glcopyteximage2d(gl_texture_2d, 0, gl_alpha, 0, 0, 2048, 2048, 0); this gave me gl_invalid_operation error, believe caused fact frame-buffer not contain alpha value, rather setting 1, call fails. next attempt: // setup texture int id = glgentexture(); glbindtexture(g

module - node.js c++ addon gyp build fails to start on windows 7 -

i tried build native addon node runs on windows , linux. addon needs access libnfc. compiled libnfc (and dependencys) on windows , linux. on windows copyed following files node-project: "libnfc.dll", "libnfc.lib", "libusb.lib", "libusb0.dll" (libusb used libnfc) my bindings.gyp looks follows: { "variables": { "build_files": ["libnfc.dll"] }, "targets": [ { "target_name": "addon", "sources": [ "addon.cc" ], "include_dirs": [ "<!(node -e \"require('nan')\")", "./nfc_include" ], 'conditions': [ ['os=="linux"', { 'libraries': [ '-lnfc' ] }], ['os=="win"', { 'libraries': [ '-llibnfc' ]

linux kernel - How to distinguish between anonymous vm_area_struct and file-mapped vm_area_struct? -

how can detect area represented structure vm_area_struct mapped anonymous? use !vma->vma_file && vma->anon_vma , doesn't work. it's fault.i add code vma_link monitor allocation of process vitural address space.the area mapped file unmapped immediately.so,when use pmap see space maps,this area doesn't corresponds file.

Powershell does not put system variable in path -

putting following in powershell console, outputs variable value: [environment]::username putting this: ps c:\> test-path c:\users\${[environment]::username}\appdata\local\microsoft\outlook false odd, went ahead , outputted console itself: ps c:\> write-host c:\users\${[environment]::username}\appdata\local\microsoft\outlook c:\users\\appdata\local\microsoft\outlook it returns blank. why? putting variable directly console output value while passing doesnt... you should use $env:localappdata since don't have hard code c:\ . should use join-path cmdlet if want join path: $path = join-path $env:localappdata 'microsoft\outlook'

java - Cannot connect to localhost using service:jmx/rmi//..... When Using Visual VM with Tomcat within Vagrant -

Image
i've got vagrant vm running tomcat , wanted connect visualvm monitor performance of vm during tests. i followed this guide setup configuration recommended creating setenv.sh script , placing within /usr/share/tomcat7/bin. found setenv wasn't being run, placed following in /etc/tomcat/tomcat.conf instead: java_opts="-dcom.sun.management.jmxremote=true - dcom.sun.management.jmxremote.port=9901 -dcom.sun.management.jmxremote.ssl=false m.sun.management.jmxremote.authenticate=false -djava.rmi.server.hostname=localhost -dcom.sun.management.jmxremote.rmi.port=9909" i believe config working when running following, can see ports active: [vagrant@localhost ~]$ netstat -lntu | grep 99 tcp6 0 0 :::9901 :::* listen tcp6 0 0 :::9909 :::* listen here config vagrant file: # ports enabled visualvm work. config.vm.network "forwarded_port", guest: 9901, host: 99

r - Shiny: use server output for further input to create plot -

i have more 2 datasets various columns. datasets differ how data collected. data types/columns may same, differ among datasets. want able create 1 plot @ time data. have code selecting dataset collection frequency , selecting column/data type. have code selecting time window user may interested in, example, hour, several hours, etc. can not, though, figure out how use input time window come indices needed select appropriate rows selected column. here sample of data (i can't figure out how make following code wrap): structure(list(`timestamp-ts` = structure(c(1432052400, 1432052700, 1432053000, 1432053300, 1432053600, 1432053900), class = c("posixct", "posixt"), tzone = ""), `record-rn` = 49178:49183, `rain_in_tot-inch` = c(0, 0, 0, 0, 0, 0), `stage-feet` = c(-0.03, -0.03, -0.03, -0.03, -0.03, -0.03), `isco_tot-` = c(0, 0, 0, 0, 0, 0)), .names = c("timestamp-ts", "record-rn", "rain_in_tot-inch", "stage-feet"

rails 4.0.0 destroy nested attributes throws error -

i have 2 models question , answer. question has many answers. creating , updating of nested attributes working. when nested attribute set remove setting '_destroy' '1' or 'true'. app throws error. in controller params permitted params.require(:question).permit(:name, :answers_attributes => [:id, :name, :_destroy ]) error undefined method 'name' on nil class

Why Curly braces doesn't work instead of parenthesis calling apply method in scala -

afaik, in scala, 1 can choose use either curly braces {} or parenthesis () sending arguments method. math.abs{-10} def fx(x: int) = x * x fx{10} list(1, 3, 5, 7) filter { _ > 5} so, why not applicable apply method in object list? list.apply{"a", "b"} // not compile when call method can pass parameters or inside parentheses or without them if has 1 argument. here fx {10} pass block of return type int {10} without parentheses. it's equivalent fx({10}) . here list(1, 3, 5, 7) filter { _ > 5} pass block { _ > 5} of return type int => boolean without parentheses. in both above cases last block statement legal expression. here list.apply{"a", "b"} pass without parentheses block {"a", "b"} equivalent list.apply({"a", "b"}) , "a", "b" statement illegal in scala.

ios - How do I resolve this CollectionViewCell Constraint issue? -

Image
i can't figure out constraint being broken coming from. i'm resizing width of image width of screen , have aspect ratio on it. if remove both of them , make static height don't error isn't desired result. what missing? from console, appears there nsautoresizingmasklayoutconstraint has been added list of constraints. problematic. suggest setting translatesautoresizingmaskintoconstraints false views (especially ones added programmatically).

javascript - Must memoized functions be defined as variables? -

i've asked question ( multiple errors while momoizing function inside function ) , i've got nice answer... but! understand little more javascript, i'd know if momoized function can written in style: function main () { function memoized_f(){ //memoizing code } } edit: please notice i'm not asking difference in code above, i'm asking if possible memoize second one! so, how rewrite this? function main() { var create_node = (function() { var memo; console.log("memo: " + memo); console.log("create_node") function f() { var value; if (memo) { value = memo.clonenode(); console.log("clone node"); console.log(value); } else { var value = document.createelement("div"); value.innerhtml = "hello"; console.log("new node"); console.log("value: " + value); memo = value; } r

java - Replace File in Gradle Build -

i trying replace file in resource folder (src/main/resources) new file generated gradle build script. i'm having trouble doing this; exclusion seems remembered, , preventing addition of new file. here's short example illustrates behavior. project structure: testproject -- src/main/java ---- entry ------ entrypoint.java ---- run ------ helloworldtest.java -- src/main/resources ---- test.properties // file replace test.properties contents in src/main/resources: wrong file text make obvious 1 being put jar based on size build.gradle: apply plugin: 'java' task makeprop { def propdir = new file(builddir, "props") ext.propfile = new file(propdir, "test.properties") outputs.file propfile dolast { propdir.mkdirs() propfile.createnewfile() propfile.withwriter('utf-8') { writer -> writer.writeline 'right file' } } } jar { dependson('makeprop')

Is it possible to just specify an Azure automation job once, without affecting the schedule? -

i specify azure automation job once ie "scale db1 standard s2 using credential - mycredential". have provide these parameter values every time set new schedule. there seems no concept of creating specific job , specific schedule , linking 2. yes link jobs schedules, schedule can take 1 job, have unlink schedule first before being able link job. i guess desired relationship is: job -< jobschedule>- schedule and have job -< schedule. but job can defined when setting schedule. i job list like: jb-weekdaynightscaledownqav11 jb-weekdaynightscaledownqav12 jb-weekdaymorningscaleupqav11 jb-weekdaymorningscaleupqav12 jb-weekendstartscaledownqav11 jb-weekendstartscaledownqav12 for schedules want: sch-weekdaymorning sch-weekdaynight sch-weekendstart having defined these 9 objects, edit them individually without affecting of others. linkages might like: sch-weekdaymorning -jb-weekdaynightscaledownqav11 -jb-weekdaynightscaledownqav12 however fear n

php - Update sum from another table -

i have items movements , inventory table , report table. movements table: ------------------------------------ id | part_number | amount | code | ------------------------------------ 101 | 3-80-75 | 55 | 2 102 | 5-88-70m | -65 | 1 103 | 1-46-57 | 11 | 1 104 | 3-80-75 | -8 | 2 105 | 5-51-54 | 76 | 2 106 | 3-80-75 | -22 | 1 107 | 5-51-54 | 62 | 1 108 | 1-46-57 | -3 | 2 109 | 3-80-75 | -16 | 2 ----------------------------------- report table: ---------------------------------- id | part_number | total_code2 | ---------------------------------- 456 | 3-80-75 | 457 | 5-88-70m | 458 | 1-46-57 | 459 | 3-80-75 | 460 | 5-51-54 | ---------------------------------- i need update report table sum of code 2 only, each part number. the result need this: ---------------------------------- id | part_number | total_code2 | -----------------------

algorithm - How to find the 'outline' of a (concave) graph in 2D plane? -

i have connected graph in 2d plane composed of vertices , edges defined between them. overall shape of graph not convex, i.e. adjacent vertices on convex hull not connected edge. there existing algorithm finds 'outline' of graph? issue that's troubling me outline polygon may contain vertices not vertices in original graph, rather intersection of 2 edges, i'm not quite sure how deal it... thanks! niko

sql - Lookup value in second table -

i have 2 tables. table data id item kvartal 1 payment 1 2 salary 2 table kvartal id kvartal_text kvartal_nummer 1 q1 1 2 q2 2 i map kvartal in table data kvartal_text in table kvartal matching kvartal in table data id in table kvartal . result payment q1; salary q2 . i have tried select * data data.kvartal in (select kvartal.kvartal_text kvartal kvartal.kvartal_nummer = data.kvartal); simply join 2 tables , select fields want: select d.item, k.kvartal_text data d join kvartal k on k.id = d.kvartal

javascript - passing data through text box from select option into another page -

i trying pass data through text box selected through 'other' in select option. however, when run program, data not passed. ideas how resolve this? here code using. have added of code below. have pass information through select option in form of text box. information not passed. there other method can this, passing through text page? <?php include_once("header.php"); ?> <?php $q_sel = "select * tbl_drug"; $r_sel = mysql_query($q_sel); ?> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $( document ).ready(function() { $('#my_textarea').hide(); $('#quantity').change(function() { var o = $(this).find('option:selected').val(); console.log(o); if(o=='other') $('#my_textarea').show(); else $('#my_textarea').hide(); }); }); </script&

make packages installed in virtualenv visibile to sphinx -

i using sphinx document software. , using virtualenv installation. packages installed in virtual environment, , sphinx not see them. i have code in conf.py : # if extensions (or modules document autodoc) in directory, # add these directories sys.path here. if directory relative # documentation root, use os.path.abspath make absolute, shown here. p = os.path.abspath('..') sys.path.insert(0, p) if 'virtual_env' in os.environ: q = os.sep.join([os.environ['virtual_env'], 'lib', 'python2.7', 'site-packages']) sys.path.insert(0, q) p = p + ":" + q os.environ['pythonpath'] = p yet if make html , sort of warnings: /home/mario/local/github/bauble/bauble.classic/doc/api.rst:358: warning: autodoc: failed import class u'tagitemgui' module u'bauble.plugins.tag'; following exception raised: traceback (most recent call last): file "/usr/local/lib/python2.7/dist-pack

html - Css Diagonal Div -

Image
i trying achieve desired effect div holds sections background slanted 1 direction. able make div diagonally on top portion of div using this solution , realized there background needs seen , adding div on top of main content line instead of div slanting on top. is there way pull effect off through css ? <html> <head> <style> div.background { background: url(klematis.jpg) repeat; border: 2px solid black; } div.transbox { margin: 30px; background-color: #ffffff; border: 1px solid black; opacity: 0.6; filter: alpha(opacity=60); /* ie8 , earlier */ } div.transbox p { margin: 5%; font-weight: bold; color: #000000; } </style> </head> <body> <div class="background"> <div class="transbox"> <p>this text placed in transparent box.</p> </div> </div> </body> </html> try example or go http://www.w3schools.com/css/tryit.asp?

Powershell goto statement replacement -

i know powershell doesnt have goto statements. have requirement follows: foreach($x in $xyz) { #something works fine if($a -eq $b) { #something works fine if($c -eq $d) { $c | add-content "path\text.txt" }else { #here need go first if statement, rather going foreach loop } }else { #nothing } } have tried break :---- , functions both doesnt seems work in case. when use break :----, notifies error in last else. when try use function below: foreach($x in $xyz) { #something works fine function xyz { if($a -eq $b) { #something works fine if($c -eq $d) { $c | add-content "path\text.txt" }else { xyz } }else { #nothing } } } it not entering function xyz. any other suggestions achieve this.? appreciated. i think want nested loops: foreach ($item in $data) { while (condition $data) { # stuff, calculate $state if (othercondition($state)) { # w

How to Terminate a C++ Function Called form C# Using p/invoke -

i calling c++ function c# using p/invoke, function has infinite loop (capturing frames file) should broken when event happened in c#. how can break loop (which terminates function)? i tried run function in thread in c#, , abort thread when termination needed. but abort function didn't work . thread thread = new thread(mymethod); thread.start(); // terminate function thread.abort(); //didn't respond probably safest way 2 things: expose function named (eg) stoprecording sets global variable inside native code inside main function, check value of global @ start of every loop iteration see if stoprecording has been called (and if so, break out of loop) this lets terminate naturally without requiring heavy-handed terminations.