Posts

Showing posts from March, 2014

c++ - winapi entry point without WinMain -

so going through source of winapi program found online noticed there no winmain anywhere, wonder if possible in anyway ever make winapi program work this, why think original programmer did this, have dialog procedure : static int_ptr callback maindialogproc(hwnd hwnd, uint msg, wparam wparam, lparam lparam) { switch(msg) { case wm_initdialog: { //.............. } } } and main entrypoint instead of void winapi winmain (void); void winapi entrypoint(void) { //........ } is possible? goes against have studied far... i'm sure i'm missing something... the entry point executable image specified through linker setting /entry . if not explicitly set, defaults maincrtstartup (or wmaincrtstartup ) console application, winmaincrtstartup (or wwinmaincrtstartup ) gui application, , _dllmaincrtstartup dll. when using crt ships part of visual studio, of aforementioned raw entry points call user-provided entry points main (or wmain ), winm

How to copy one file to a specific subdirectory in all application data directories in C:\Users? -

one windows 7 x64 trying copy 1 file to c:\users\profilename\appdata\roaming\autodesk\autocad 2011\r18.1\enu\plotters i batch copy file user profiles exist on client pc silently no prompts. the code have tried far no luck: @echo off xcopy /i /y "%~dp0myfile.pc3" "c:\users\*\appdata\roaming\autodesk\autocad 2011\r18.1\enu\plotters" any ideas on how batch file? wildcards can't used inside folder path. windows command interpreter support that. you use following code: @echo off setlocal enableextensions set "targetpath=appdata\roaming\autodesk\autocad 2011\r18.1\enu\plotters" rem path of folder containing users' profile folders. /f %%i in ("%public%") set "usersfolder=%%~dpi" rem copy file subdirectory of each non standard user profile folder. /d %%i in (%usersfolder%*) ( if /i not "%%i" == "%public%" ( if /i not "%%~nxi" == "default" ( if n

api - Facebook Share button - To share the page contents instead of page URL -

this question has answer here: how facebook sharer select images , other metadata when sharing url? 12 answers i using facebook share button. works fine code <a href="https://www.facebook.com/sharer/sharer.php?u=www.sample.com" target="_blank"> share on facebook </a></li>. but code sharing page url alone. need share images , email exists on sharing page. how ?. can me ? <a onclick="fb('www.google.com','abcd')" href="javascript:void(0);"><img src="<?php echo website_img_url; ?>fb.jpg" width="34" height="34" alt=""/></a> (function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net

.net - Can the “Do you want to Open (application) from (url) prompt be avoided with ClickOnce? -

we deploy application via clickonce. time ie prombt comin in bottom of page saying "do want open " when set internet explorer security settings medium low doesn't prompts, when above medium low prompts. know exacct custom settings required disable prompt or there work around avoid ?

How to show a page only once in asp.net mvc -

in app, checking if config file available or not, if it's not want redirect install page. to me best place accomplish application_start . because it's happening 1 time. if checking in application_start , write response.redirect response not available in context . i tried other answers in stack overflow redirect in application_start httpcontext.current.response.redirect ; none worked me. i don't want in base controller or filter because checking logic happen every single request. my goal check once , it's best when app start. update 1 i added response.redirect application_start got error this: application start: protected void application_start() { arearegistration.registerallareas(); filterconfig.registerglobalfilters(globalfilters.filters); routeconfig.registerroutes(routetable.routes); bundleconfig.registerbundles(bundletable.bundles); response.redirecttoroute( new routevaluedictionar

reactjs - Passing helper text to redux-form -

i'm using redux-form 6.0.0-rc.4 , i'm wondering if there's way pass additional property field s. here's renderfield component: const renderfield = field => ( <div classname={field.touched && field.error ? 'invalid' : 'valid'}> <label>{field.input.placeholder}</label> <input {...field.input} /> {field.touched && field.error && <span><i classname="fa fa-warning"></i> {field.error}</span>} </div> ); and field : <field name="addressone" type="text" placeholder="address one" component={renderfield} /> i'd able pass helper text directly field can include in renderfield . docs show redux-form extremely flexible, there doesn't seem easy way achieve this. edit -- when "helper text", mean copy guide user. example, on date field i'd add text along lines of "the selected date mus

ios - NSLocalisedString toggle between displaying key and translated text -

i have app localised, wandering if theres way toggle between displaying key , translated text either while app running or through debug build? i want run through app , make sure there no hardcoded strings thanks not asking for, in xcode menu product -> scheme -> edit scheme… -> run -> options there option “show non-localized strings” capitalize strings in ui not localized. i hope can solve problem.

php - cakePHP - How to solve a 'Trying to get property of non-object' error -

hello received error message when run application on server : notice (8): trying property of non-object [app/template/applicanteducationneeds/view.ctp, line 52] and lines of code in view.ctp : <?php use cake\cache\cache; use cake\core\configure; use cake\datasource\connectionmanager; use cake\error\debugger; use cake\network\exception\notfoundexception; $this->layout = 'userprofile'; if (!configure::read('debug')): throw new notfoundexception(); endif; //echo debug($applicantdesirededucations); ?> <div class='col-md-12'> <div class="applicantgenerals view large-9 medium-8 columns content"> <div class ='col-md-4'> <h3><?= __('desired education') ?></h3> <table class="table"> <thead> <tr&g

html - CSS - Div's are running off page on mobile -

i have below set of code. works fine in browsers. noticed on main galaxy s5 browser (which i'm sure affects other browsers also), 2 images run off page. appreciate help. know answer may simple, after trying 100 things on few days, believe have unnecessary value somewhere , accidentally merged 2 solutions. thanks, .arrow { width: 21px; height: 57px; } .pagination { max-width: 100%; } .pagination_sub { width: 700px; height: 57px; margin: auto; display: flex; align-items: center; } .pagination_pre { width: 410px; height: 57px; } .greypagination { width: 33px; height: 57px; } .prearrow { width: 12px; height: 57px; } .prepagination { width: 44px; height: 57px; } <div class="pagination"> <div class="pagination_sub"> <div class="pagination_pre"></div> <div class="prepagination"> <img src="../images/pgpage.jpg" wid

cppcheck - stumbling upon a non-trivial bool scenario in C++ -

when cppcheck runs on code, [1] complains error : void bool_express(bool apre, bool ax, bool apost) { bool x; const bool pre = apre; if (pre) { x = ax; } const bool post = apost; // error checking passage of original code: if ( !pre || !x || !post ) { if ( !pre ) { trace("pre failed"); } else if ( !x ) { // <-- here cppcheck complains trace("x failed"); } else { trace("post failed"); } } else { // success passage of original code: trace("ok"); } } this message, makes me nervous: id: uninitvar summary: uninitialized variable: x message: uninitialized variable: x i think it's false positive, admit may not obvious. nevertheless don't want touch code, because it's old , lot heavier extracted version. have ever experienced situations this? how deal it? [1] code reduced bones, original

html - Do block elements ignore floating elements? -

w3c states that: since float not in flow, non-positioned block boxes created before , after float box flow vertically if float did not exist . however, current , subsequent line boxes created next float shortened necessary make room margin box of float. this work expected div s: #a { width: 100px; height: 100px; background-color: blue; float: left; } #b { width: 200px; height: 200px; display: block; border: 1px solid black; background-color: red; } <body> <div id=a></div> <div id=b></div> </body> here red div block-level element, therefore it's ignoring floating one. (if changed red 1 display: inline-block appear next floating one) but, if apply display: block image ,it won't ignore floating div , why? #a { width: 100px; height: 100px; background-color: blue; float: left; } #b { width: 200px; height: 200px; display: block; border: 1px solid black; }

ios - dispatch task into queue in order to run the task in another thread -

this question has answer here: dispatch_sync() execute block in main thread 2 answers people asking what way run task in thread . 1 of answer accepted many people(from link) use gcd. so, tried in way printing out thread id see if task executed in thread after put gcd queue: // function in myservice class - (void) dotask { nslog(@"start task on thread = %@", [nsthread currentthread]); dispatch_queue_t queue = dispatch_queue_create("com.company.myqueue", dispatch_queue_serial); dispatch_sync(queue, ^{ nslog(@"execute task on thread = %@", [nsthread currentthread]); }); } i run : // not main thread [myservice dotask] the console output this: start task on thread = <nsthread: 0x15b4be00>{number = 6, name = (null)} execute task on thread = <nsthread: 0x15b4be00>{numb

How to construct an edge list from data in R? -

i have data looks this: +--------+-----------+ | source | targets | +--------+-----------+ | 1 | 3, 4, 5 | | 2 | 1, 3 | | 3 | 6, 10, 11 | +--------+-----------+ where source node in graph data, , targets list of target nodes, i.e. there's connection node 1 3, 4, d 5 nodes. want create edges list, so: +------+----+ | | | +------+----+ | 1 | 3 | | 1 | 4 | | 1 | 5 | +------+----+ but i'm having trouble getting done in r. best i've been able yet following: extract_edges <- function(row) { targets <- strsplit(as.character(locke_relations[row, 3]), ", ") df <- data.frame() for(t in targets) { newrow <- data.frame(from=locke_relations[row,1], to=t) df <- rbind(df, newrow) } df } lapply((2:3), extract_edges) locke_relations above data more or less in form above, , in code above, processing 2 rows (rows 2 & 3). gets me list containing dataframes more or less corrrect: [[1]] 1

java - Hadoop 2.7.2 single node installation ubuntu src-code does not has /etc/hadoop dir -

i setting hadoop-2.7.2 on ubuntu 14.10 . source code downloaded https://hadoop.apache.org not have /etc directory . have configure java_home variable ? should in hadoop-2.7.2/etc/hadoop/hadoop-env.sh the easiest way set hadoop sandbox i've ever seen hortonworks data platform sandbox vm . use speed instead of rolling own. comes hadoop, hbase, spark , bunch of other stuff ready go minimal fuss , designed used support development on workstation guest os.

Should we write catch(Exception e) for every try catch block in java -

my question should have catch(exception e) every try - catch block. knowing catch exceptions .... type of coding recommended in java or should catch exceptions known occur. consider below example. try { //something } catch (numberformatexception ne) { //do } catch (exception e) { log.error(e); } no. not practice. identify exceptions thrown before implementation. catch exceptions throwing method. thoroughly unit test code , identify them.

Android SQLite multiple databases and CRUD -

i'm trying implement databases linked foreign keys , i've been told it's better (more secure) stick queries instead of rawqueries in general, i'm unsure how far. what's best approach crud operations; use multiple queries ( .query(.) ) or use more sophisticated rawqueries? for example if want delete row table iff there no other table linking particular row. or there perhaps better ways when constructing database makes such operations smoother? also, when inserting table , there's row (and column unique or similar restraint), there quick way find rowid of value being inserted regardless of whether or not inserted or exists? i tried `insertwithonconflict(.)` but throws -1 instead of rowid when exists. there better way execute query afterwards upon failure?

MongoDB and fulltext search part of the word -

i need find part of word, if search len shut find words there starting len. i'm trying use fulltext search in mongodb , working when hit 100% words , not part of words. have sombardy soluion me issue working? sample code there working: db.getcollection('product').find({ '$and' : [{ '$text': { '$search' : 'lenovo', // match word '$casesensitive' : false }, '$text': { '$search' : 'y50 b50 y700', // synonym prepared '$casesensitive' : false } }] }) sample code want same resualt: db.getcollection('product').find({ '$and' : [{ '$text': { '$search' : 'len', '$casesensitive' : false }, '$text': { '$search' : 'y50 b50 y700', '$casesensitive' : false } }] }) thanks time, , hope can fulltext search in mongo

Add watermark to animated GIF with imageMagick (PHP) -

i need add watermark animated gif imagemagick . have problem ! my code : <?php $image = new imagick(); $image->readimage("orginal.gif"); $watermark = new imagick(); $watermark->readimage("watermark.png"); // how big images? $iwidth = $image->getimagewidth(); $iheight = $image->getimageheight(); $wwidth = $watermark->getimagewidth(); $wheight = $watermark->getimageheight(); if ($iheight < $wheight || $iwidth < $wwidth) { // resize watermark $watermark->scaleimage($iwidth, $iheight); // new size $wwidth = $watermark->getimagewidth(); $wheight = $watermark->getimageheight(); } // calculate position $x = ($iwidth - $wwidth) / 2; $y = ($iheight - $wheight) / 2; $image->compositeimage($watermark, imagick::composite_over, $x, $y); header("content-type: image/" . $image->getimageformat()); echo $image; ?> original gif : see original gif output gif : see output gif my gif not animated after creating

How to use cURL with multiplexing with sftp -

i want file structure (listing only) on sftp server. i'm using curl bash command multiple calls. in order avoid multiple connections, i'd use openssh multiplexing. followed instructions on https://en.wikibooks.org/wiki/openssh/cookbook/multiplexing though using curl file list not work. on other hand, "standard" ssh connection use multiplexing. questions: is there way use multiplexing curl? if not, there linux command line tool file listing? not sftp, no. ssh protocol (and libssh2 curl using) allow multiplexing fine curl has not been adapted take advantage of this, doing multiple requests same host still use separate connections. the sftp command openssh used like: echo ls | sftp example.com:dir/

I would go a AngularJS array with PHP -

Image
i have these data: controller.js (angularjs) datas = { 'variable' : $scope.variables, }; $http.post('http://localhost/proyectos/3.0copy/app/partials/createjson.php', datas).then(function() { console.log(datas); }); i use http send me these variables create json.php array , try print me everything. have this: createjson.php <?php $datos = $request->datas; echo $datos; $mydata = json_decode($_post['datas']); print_r($mydata); if(file_get_contents("php://input")){ $json = file_get_contents("php://input"); $file = fopen($dir,'w+'); fwrite($file, $email); fclose($file); } ?> i not return anything, generated file empty. <?php $dir='../less/variables.json'; if(file_exists($dir)) { if(unlink($dir)) print "el archivo fue borrado"; } else print "este archivo no existe"; $datos = $request->datas;

stored procedures - How to render & insert alphabets row within the MS sql server records? -

Image
database records: i want represent record set using stored procedure. i have many records likewise in ms sql database. it listing record groupby a, b, c .. z wize.. automatically insert alphabets while got output sql table. want below output procedure.. how possible using stored procedure..? you can use left , union this, though still 3 columns row rows contains first letter: create , populate sample table ( please save step in future questions) declare @t table ( name varchar(20), location varchar(20), createdon date ) insert @t values ('alex macwan', 'new york', '2015-12-10'), ('jone dinee', 'denmark', '2016-05-01'), ('jolly llb', 'usa', '2016-01-02'), ('amin mark', 'india', '2015-01-08'), ('ben denis', 'brazil', '2015-10-02') the query: select name, location, createdon @t union select left(name, 1), null, null @t o

Sitecore commerce server: migration data from older verion -

i have installed sitecore commerce server(ver. 11.3) , need migrate data previous version of commerce server(it 11.2). , restore doesn't work, got following error message: "application not compatible '11.200' version of 'product catalog' resource. expected resource version '11.300'" also, tried follow section "breaking changes" manual: http://commercesdn.sitecore.net/scpbcs81/releasenotes/en-us/index.html , doesn't help, too. what best practices of upgrading sitecore commerce server? appreciated.

php - regexp - match numbers with two decimals and thousand seperator -

http://www.tehplayground.com/#0qrtozth3 $inputs = array( '2', // no match '29.2', // no match '2.48', '8.06.16', // no match '-2.41', '-.54', // no match '4.492', // no match '4.194,32', '39,299.39', '329.382,39', '-188.392,49', '293.392,193', // no match '-.492.183,33', // no match '3.492.249,11', '29.439.834,13', '-392.492.492,43' ); $number_pattern = '-?(?:[0-9]|[0-9]{2}|[0-9]{3}[\.,]?)?(?:[0-9]|[0-9]{2}|[0-9]{3})[\.,][0-9]{2}(?!\d)'; foreach($inputs $input){ preg_match_all('/'.$number_pattern.'/m', $input, $matches); print_r($matches); } it seems looking $number_pattern = '-?(?<![\d.,])\d{1,3}(?:[,.]\d{3})*[.,]\d{2}(?![\d.])'; see php demo , regex demo . the anchors not used, there lookarounds on both sides of pattern instead.

colors - Calculting colours based on contrast -

i hi have website runs several colour themes. want change text select colour based on colour theme. p::selection, li::selection, div::selection{ background-color: #hex; color: #ffffff; } i'm using -moz , -o prefixes. for colour theme i'm using #274569 default colour of #339aff acceptable , i've calculated contrast. want work out how calculate colour (#148545 example) if have contrast. there no shortage of resources web calculate contrast of 2 colours i'm after doing other way round, unless there better way of choosing colour. there way this?

NuGet restore fails with "Package contains multiple nuspec files" on my machine only -

i using vs2015u3 , nuget 3.4.4. running on windows 10 anniversary update. nuget restore gives error when run in visual studio or when run on command line. i've tested on 2 independent solution files same results. build server , laptop restore packages without problem. i've tried downloading nuget.exe fresh, repairing visual studio, uninstalling , reinstalling nuget package manager , clearing nuget cache. here output running nuget restore ..\mysolution.sln on command line: restoring nuget package restsharp.102.7.0. restoring nuget package rx-core.2.2.5. restoring nuget package rx-interfaces.2.2.5. restoring nuget package newtonsoft.json.4.0.8. restoring nuget package rx-linq.2.2.5. restoring nuget package rx-main.2.2.5. restoring nuget package rx-platformservices.2.2.5. restoring nuget package rx-wpf.2.2.5. restoring nuget package rx-xaml.2.2.5. restoring nuget package livecharts.0.6.5. restoring nuget package commandlineparser.1.9.71. warning: package contains multi

Communication between Service Fabric Applications -

we have grouped different functionalities in different service fabric applications. each service fabric application responsible set of functionalities within scope(e.g. news, blogging, user separate applications). different teams can work on functionality scopes. each application has public rest api, /users or /news or /blogs. public website can call these endpoints , retrieve/post information. however, many times these applications need communicate each other. best way set up? there 2 ways go far can see now: create new http endpoint on each application use internally(using own ip port not published publicly). loosely coupled. use rpc calls (but create 'hard' link between applications). coupled. for think separate http endpoint way go, wonder if rpc calls better? it, design philosophy, allowed use rpc calls between applications? or bring me trouble when application updated , interface has changed? or there pattern use here? for sure, have rewrite when

Android bind with existing service across multiple apps -

i have service implemented in module a. apps b , c uses library bind service using bindservice(service, connection, bind_auto_create) creates new instance of service. i'm using messenger return binder connection objects. if use aidl, how sharing same service instance achieved? i've read , tried stackoverflow answers related question. still i'm not able achieve explained above. manifest of service defined inside module full process name process attribute , exported,enabled set true. <service android:name="io.packagename.locationservice" android:enabled="true" android:exported="true" android:permission="android.permission.access_fine_location" android:process="io.packagename.locationservice" /> locationservice-class: class locationservice extends service { incominghandler handler = new incominghandler() messenger messenger = new messenger(handler)

What is the difference between crossinline and noinline in Kotlin? -

this code compiles warning ( insignificant performance impact ): inline fun test(noinline f: () -> unit) { thread(block = f) } this code does not compile ( illegal usage of inline-parameter ): inline fun test(crossinline f: () -> unit) { thread(block = f) } this code compiles warning ( insignificant performance impact ): inline fun test(noinline f: () -> unit) { thread { f() } } this code compiles no warning or error : inline fun test(crossinline f: () -> unit) { thread { f() } } here questions: how come (2) not compile (4) does? what difference between noinline , crossinline ? if (3) not generates no performance improvements, why (4) do? from inline functions reference : note inline functions may call lambdas passed them parameters not directly function body, execution context, such local object or nested function. in such cases, non-local control flow not allowed in lambdas. indicate that, lambda parameter needs m

teradata - International Characters are getting corrupted in Mule -

i querying teradata using mule database connector. have value in table as Åland islands . but through debugging found data extracted getting corrupted �land islands my query simple select cast(col1 varchar(2000)) field_name table) can tell me how fix this? need change datatype? thanks pekka 웃 suggestion lead me debug issue properly. issue in connection url explicitly added parameter charset=utf16 , thats how encoding matched , getting Åland islands in output. again!

java - Maven configeration error - (JAVA_HOME is set to an invalid directory) -

i have installed apache- maven in windows, , set environmental variables : m2_home - c:\users\bg4730\apache-maven-3.3.9; m2 - %m2_home%\bin; java_home - c:\program files\java\jdk1.8.0_74; even though getting (java_home set invalid directory) when trying check maven installation command line: mvn --version if actual value... c:\program files\java\jdk1.8.0_74; the semicolon @ end should culprit. happens gets executed on windows: %java_home%\bin\java if semicolon there, it's going part of path gets executed.

java - updating entity containing object fields -

i'm trying update entity contains fields of type of class. so entity: @entity public class owner { @id @generatedvalue private int id; @column(name = "first_name") @notnull(message="{notnull}") @size(min=2,max=15,message="{size}") private string firstname; @notnull(message="{notnull}") @size(min=2,max=15,message="{size}") @column(name = "last_name") private string lastname; @valid @onetoone(cascade = cascadetype.all) private phone phone; @valid @onetoone(cascade = cascadetype.all) private pet pet; from view: <!doctype html> <html xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="iso-8859-1"></meta> <title>owner details</title> </head> <body> <div id="owner"> <form th:action="@{|/ownerlist/${owner.id}.do|}"

Reshape MongoDB aggregation result to field value documents -

i have data collection containing data in following shape: [ {_id: "1", aa1: 45, aa2: 56, bb1: 90, bb2: 78, cc1: 34, cc2: 98 }, {_id: "2", aa1: 76, aa2: 56, bb1: 45, bb2: 67, cc1: 75, cc2: 87 } ] on data perform mongodb aggregation pipeline: db.colleciton.aggregate([ { $project: { "_id": "$_id", "aaa": { $avg: ["$aa1","$aa2"] }, "bbb": { $avg: ["$bb1","$bb2"] }, "ccc": { $avg: ["$cc1","$cc2"] } } }, { $group: { "_id": "avgcalc", "aaa": { $avg: "$aaa" }, "bbb": { $avg: "$bbb" }, "ccc": { $avg: "$ccc" } } } ]) that gives result in format: [ {_id: "avgcalc", aaa: 67, bbb: 55, ccc: 90} ] i co

Android application crashes when open map activity for multiple location -

i want show multiple location in map activity, every thing ok. cannot sun application. crashes when run on emulator. logcat error show : java.lang.runtimeexception: unable start activity componentinfo{daffodilvarsity.edu.bd.studentportal/daffodilvarsity.edu.bd.studentportal.locationsharemapsactivity}: java.lang.nullpointerexception: attempt invoke virtual method 'com.google.android.gms.maps.model.marker com.google.android.gms.maps.googlemap.addmarker(com.google.android.gms.map s.model.markeroptions)' on null object reference this gradle.build file apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "24.0.1" uselibrary 'org.apache.http.legacy' dexoptions { incremental true javamaxheapsize "2048m" } defaultconfig { applicationid "daffodilvarsity.edu.bd.studentportal" minsdkversion 14 targetsdkversion 23 versioncode 1 versionname "

mapreduce - Hadoop uses one node to process data -

i have hadoop 2.6.4 setup 1 master , 2 slaves. of nodes appear installed , can communicate each other , can ssh each other without passwords. uploaded 16gb text file dfs , ran simple modified wordcount example ( code here ) on test working. hadoop jar test1.jar wordcount /user/text.txt /user/output i ran code on master node , noticed master node doing of processing while slaves idle. (i monitored cpu workload) ran code on slave1 , noticed master , slave2 idle while slave1 did work. why processing done on node code submitted on? related configuration of hadoop or misunderstanding something? the configuration of master core-site <configuration> <property> <name>fs.defaultfs</name> <value>hdfs://master:9000</value> </property> </configuration> mapred-site <configuration> <property> <name>mapred.job.tracker</name> <value>master:54311</value>

r - How to get install() in devtools to look for dependencies in several .libPaths -

i using install function in devtools-package handle installation of r-package building, conveniently handle installation within r. my .libpaths() setup follows: first directory-path in .libpaths() install own packages , packages not on cran., while second directory-path contains lot of common packages cran, installed sysadmin. i wish install package in first directory-path in .libpath(), packages in .libpaths() , install packages not found in of them. however, running install() (or install_github()) in devtools re-installs packages in first directory-path, have installed in second directory-path in libpaths(). not desired behavior, , ineffective package depends on quite lot of other packages. when running "r cmd install package" command line, packages not found in second (or first) directory-path installed (in first one). desired behavior, , how want install in devtools operate. none of input arguments install() seems fix behavior. does know whether possible acco

powershell - Remote user input -

would possible generate popup @ remote computer requires (remote) user input? let's use powershell execute script on remote computer , want active user behind computer accept running script. i'f isn't possible default, there simple third party solutions (that require no installation on remote users computer) use achieve same goal? thinking out of box use powershell send mail , scan incoming replies, feels inefficient. i'm close making using toast messages api uwp. can create toast messages buttons , textboxes (also on remote machine using invoke-command), have been unsuccesfull in getting results inputs or buttons (and going through uwp documentation looks not possible powershell). sample code i've been working on (look through documentation of toast messages in uwp more info - version allows run local or remote. i've not included xml content button that's easy implement if follow api documentation microsoft wrote) - maybe you'll have mo

console - Powershell pipeline commands not work concurrently -

when run 2 commands connected pipeline ps> cmda | cmbb e.g. 1) in powershell ps> ls -recurse | more 2) in cmd.exe c:\> dir /s | more you'll find in powershell cmdb started run after cmda finished, behavior different compare cmd.exe, 2 commands expected work simultaneously producer-consumer. when 1st 1 has lot of messages output, want result @ first time rather after completion of 1st cmd. [updated on 2016/08/09] after few more investigation, guess problem because pipeline operator '|' works different. time created huge text file copy&paste (~50mb) , used same command line both cmd , powershell: c:\tools\msys2\usr\bin\cat.exe .\windowsupdate.log | c:\tools\msys2\usr\bin\cat.exe i used cat command msys2 , avoid `type' command different on both shells. in cmd, messages printed in powershell waited ~30 seconds see messages come out. tried 10 times , got same result. (ps: i'm not using ssd). if in powershell changed receiver `cat' out-h

Is it possible to get specific user's live videos from Facebook Graph API? -

suppose can fetch user_id of specific facebook user, possible user's public live videos through graph api not friend? use graph api explorer provided facebook try fetch specific user's live videos listing , nothing. need specific permissions work or not possible kind of information if user not friend of you? you not able user did not authorize app. if authorized app appropriate permissions, may use /me/live_videos user access token.

reporting services - How to Roll up recursive value in ssrs -

i have table value example id name parentid value date 1 classa 0 null null 2 classb 0 null null 7 jason 1 50 2016-06-01 8 jason 1 20 2016-06-02 9 jason 1 30 2016-06-03 10 kelly 1 20 2016-06-02 11 kelly 1 30 2016-06-03 and want generate report this 2016-06-01 2016-06-02 2016-06-03 classa 50 40 60 jason 50 20 30 kelly 0 20 30 classb 0 0 0 as can see, classa has been rolled , total children i tried few code, either show me empty or show me recursive value rows same value. for example =sum(fields!qty.value) shows result1 then second code tried =iif(isnothing(sum(fields!qty.value, "name", recursive)),0, sum(fields!qty.value, "name", recursive)) ,

Disk size for Azure VM on docker-machine -

i creating azure vm using docker-machine follows. docker-machine create --driver azure --azure-size standard_ds2_v2 --azure-subscription-id #### --azure-location southeastasia --azure-image canonical:ubuntuserver:14.04.2-lts:latest --azure-open-port 80 awesomemachine following instructions here . azure vm docs - max. disk size of standard_ds2_v2 100gb, however when login machine (or create container on machine), max available disk size see 30gb. $ docker-machine ssh awesomemachine docker-user@tf:~$ df -h filesystem size used avail use% mounted on /dev/sda1 29g 6.9g 21g 25% / none 4.0k 0 4.0k 0% /sys/fs/cgroup udev 3.4g 12k 3.4g 1% /dev tmpfs 698m 452k 697m 1% /run none 5.0m 0 5.0m 0% /run/lock none 3.5g 1.1m 3.5g 1% /run/shm none 100m 0 100m 0% /run/user none 64k 0 64k 0% /etc/network/interfaces.dynamic.d /dev/sdb1 14g 35m 13

data structures - Organizing disk file for very fast access -

i developing key value database similar apache cassandra , leveldb. it utilize lsm trees ( https://en.wikipedia.org/wiki/log-structured_merge-tree ) keys strings , using c++. currently data stored on disk in several immutable "sstables", each 2 files. data file - "flat" file - record after record, sorted key, without disk block alignment. index file - contains number of records , array of 8 byte numbers (uint64_t) offcets each record. can position (seek) , find offset record data file. i have mmap-ed these 2 files in memory. if program need locate record binary search. means program lots of disk seeks. did optimizations, example jump search , sequentially read last 40-50 records. on file 1 billion keys, still 20-25 seeks (instead of 30). this works pretty fast - 4-5 seconds 1 billion keys without virtual memory cache (e.g. first ever request) , way under 1 second virtual memory cache. however thinking of building additional data structure on

c++ - Splitting text into a list of words with ICU -

i'm working on text tokenizer. icu 1 of few c++ libraries have feature, , best maintained one, i'd use it. i've found docs breakiterator , there's 1 problem it: how leave punctuation out? #include "unicode/brkiter.h" #include <qfile> #include <vector> std::vector<qstring> listwordboundaries(const unicodestring& s) { uerrorcode status = u_zero_error; breakiterator* bi = breakiterator::createwordinstance(locale::getus(), status); std::vector<qstring> words; bi->settext(s); (int32_t p = bi->first(), prevboundary = 0; p != breakiterator::done; prevboundary = p, p = bi->next()) { const auto word = s.tempsubstringbetween(prevboundary, p); char buffer [16384]; word.toutf8(checkedarraybytesink(buffer, 16384)); words.emplace_back(qstring::fromutf8(buffer)); } delete bi; return words; } int main(int /*argc*/, char * /*argv*/ []) { qfile f("e:\\

laravel - define post route without csrf token -

i want call functions android side. now, want send post values android side. how can disable csrf token functions ? because without got error message . like this: route::post('mobile/android/getlastnews','newscontroller@getlastnews'); open app/http/middleware/verifycsrftoken.php , in protected $except = []; array add url want skipped csrf validation.

php - Error when installed Yii2 -

i've install yii2 framework using composer error in browser (on localhost): invalid configuration – yii\base\invalidconfigexception yii\web\request::cookievalidationkey must configured secret key. how can solve problem? there problem basic app https://github.com/yiisoft/yii2-app-basic/issues/69 composer install doesn't generate key. you need add key manually. go /config/web.php. edit line 'cookievalidationkey' => '', include random string (you can use 'cookievalidationkey' => 'jfsbkjsbfdskjgfdskjbgfsdhjgfajds',

php - In Laravel Eloquent, why is this not selecting properly (no where condition)? -

using this: profile = user::find($user)->with('profile')->first(); will return query of select * profiles , instead of selecting profile belonging id of found user. my user model follows: public function profile() { return $this->hasone('app\models\userprofile', 'user_id'); } why not adding where condition? what find($id) expand query, this: // user::find($user) // user::where('id', $user)->take(1)->get('*')->first() in other words: creates query, limits first row, gets row - returns collection - , returns first item in collection. that means with('profile') gets attached object, not query builder, , tack first() call that. what should instead is user::with('profile')->find($user); ... assume works haven't tested it. :)

vba - How can I return a cell value as it is shown in Excel, without recalculating it? -

i'm beginner in excel programming, wish values of excel file shown, these data calculated in excel file they're in, when getting value using range , cells recalculates value, possible value shown without recalculations ? i'm using in access (opening excel file, sheet , getting data) thank you

java - Hide implementation of methods in jar using android studio IDE -

i build jar using android studio , when using jar in demo project, when open class demo project, able see implementation of methods in class looking when open sdkclass(in jar). public class sdkclass{ public void paymentrequestedfromcreditdebitcard(int i) { toast.maketext(mcontext, "payment requested:" + i, 1).show(); } public void paymentcanceledbycustomer() { toast.maketext(mcontext, "payment cancelled", 1).show(); } public void paymentfailed(int i) { toast.maketext(mcontext, "payment failed \n error code:" + i, 1).show(); } } i want thing public class sdkclass{ public void paymentrequestedfromcreditdebitcard(int i) { /* compiled code */ } public void paymentcanceledbycustomer() { /* compiled code */ } public void paymentfailed(int i) { /* compiled code */ } } you can use obfuscator. e.g. proguard. change names of class, variables in w

keep post variable in php pagination -

i have php pagination page post submit user search something, query mysql in first page ok, in next page, have white blank page. below paging code. $_session['nationality'] = $_post['nationality']; $reclimit = 2; if(isset($_get['page'])){ $page = $_get['page']; } else { $page = 1; } $start = (($page-1) * $reclimit); $sql = "select userid, name, left(hkid, 4) hkid, description, nationality, photo_1, photo_2, photo_3 $tbl_name `nationality` '%$_session[nationality]%'"; $records = $con->query($sql); $total = $records->num_rows; $tpages = ceil($total / $reclimit); $rec = "select userid, name, left(hkid, 4) hkid, description, nationality, photo_1, photo_2, photo_3 $tbl_name `nationality` '%$_session[nationality]%' limit $start, $reclimit"; $records = $con->query($rec); while ($row = mysqli_fetch_assoc($records)){ // loop record } // paging echo '<ul class="pagination pagination-lg"

How to indicate images in android gallery -

Image
using application uploaded images server, next time while open application , trying select images using same application, how can indicate uploaded images? the easiest way creating local database , adding flags uploaded contents. the database schema this, now each time upload content, make following queries, if content name exists in database file_name & is_uploaded status = true, file uploaded. else, create new record file in database , upload. if have list of images show if uploaded, run , loop , change uploaded indicator based on database is_uploaded flag.

c++ - Why to specify a pointer type? -

this question has answer here: why data type needed in pointer declaration? 8 answers what happens while declaring pointer of specific type? there use specify type pointer other pointer arithmetic or indexing? type of pointer needed in following situations dereferencing pointer pointer arithmetic here example of dereferencing pointer. { char *ptr; //pointer of type char short j=256; ptr=&j; // have ignore warnings printf("%d",*ptr) } now because ptr of type char read 1 byte. binary value of 256 0000000100000000 because ptr of type char read first byte hence output 0 . note: if assign j=127 output 127 because 127 hold first byte. now, example of pointer arithmetic : { int *ptr; int var=0; ptr=&var; var++; ptr++;// pointer arithmetic } are statements var++ , ptr++ same thing? no,

ios - How to change constraints when device is in landscape mode? -

is there way change constraints? want change height, centerx , centery of button if device in landscape mode. you can use different constraints using size classes. size classes allows add different constraints various modes i.e landscape , portrait various devices.