Posts

Showing posts from March, 2014

automation - Error : cannot find module 'sprint.js' on starting appium server -

installed appium on numerous machines unable start appium server on particular machine, using version 1.4.0. facing following error : starting node server module.js:340 throw err; ^ error: cannot find module 'sprintf-js' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ module.require (module.js:364:17) @ require (module.js:380:17) @ object. (c:\program files (x86)\appium\node_modules\appium\node_modules\argparse\lib\argument_parser.js:15:15) @ module._compile (module.js:456:26) @ object.module._extensions..js (module.js:474:10) @ module.load (module.js:356:32) @ function.module._load (module.js:312:12) @ module.require (module.js:364:17) node server process ended

java - Repository layer as webservice consumer -

i'm designing application architecutre @ company. backend i'm planing use spring boot. backend has call wbeservices tibco amx , expose them other services (rest maybe) our model. i want use popular layer stack in case: +-------------------+ +-------------------+ +-------------------+ | | | | | | | controller | | service | | repository | | dto model <----> domain model <----> entity | | | | | | soap/rest client | | | | | | | +-------------------+ +-------------------+ +---------+---------+ | | +---------v---------+ |

java - JNCryptor not working, Cannot Resolve Symbol AES256JNCryptor -

Image
im using jncryptor library, got error "cannot resolve symbol aes256jncryptor" jncryptor cryptor = new aes256jncryptor(); byte[] plaintext = "hello, world!".getbytes(); string password = "secretsquirrel"; try { byte[] ciphertext = cryptor.encryptdata(plaintext, password.tochararray()); } catch (cryptorexception e) { // went wrong e.printstacktrace(); } my android studio version 2.1.2 can tell me wrong ? thanks

Using canvas and bitmap in Android , how to get this image? -

Image
i new in android. trying draw image(match statistic) , fill image color 10% 100% . tried , image this code public class drawview extends view { paint paint = new paint(); public drawview(context context) { super(context); } @override public void ondraw(canvas canvas) { paint.setcolor(color.black); paint.setstrokewidth(3); canvas.drawrect(30, 30, 100, 100, paint); paint.setstrokewidth(0); paint.setcolor(color.gray); canvas.drawrect(33, 60, 97, 97, paint); paint.setcolor(color.white); canvas.drawrect(33, 33, 97, 60, paint); } any suggestion helpful me. in advance. i prepare 2 images - filled , not filled (only stroke). having that, load them 2 bitmap objects , draw that: float fillprogress = 0.1f; // let's image 10% filled canvas.drawbitmap(onlystroke, 0f, 0f, null); // draw stroke first canvas.save(); canvas.cliprect( 0f, // left getheight() - fillprogress * getheight(),

apache spark - How to open a file which is stored in HDFS in pySpark using with open -

how open file stored in hdfs - here input file hdfs - if give file bellow , wont able open , show file not found from pyspark import sparkconf,sparkcontext conf = sparkconf () sc = sparkcontext(conf = conf) def getmoviename(): movienames = {} open ("/user/sachinkerala6174/indata/moviestat") f: line in f: fields = line.split("|") mid = fields[0] mname = fields[1] movienames[int(fields[0])] = fields[1] return movienames namedict = sc.broadcast(getmoviename()) my assumption use with open (sc.textfile("/user/sachinkerala6174/indata/moviestat")) f: but didnt work to read textfile rdd: rdd_name = sc.textfile("/user/sachinkerala6174/indata/moviestat") you can use "collect()" in order use in pure python (not recommended - use on small data), or use spark rdd methods in order manipulate using pyspark methods (the recommended way) for more info:

graph databases - neo4j match nodes and relationships if exists -

i developing small social network applications , have following nodes , relationships in neo4j graph db: user nodes post nodes. post node connected user node posted_by relationship , post node might connected post node sharing relationship in case post shares post. i retrieve posts posted specific user , each post original post in case share (and publisher of original post). i managed required info using optional match new neo4j , not sure if correct way go: match (p:post)-[r: posted_by]-(publisher:user) publisher.userid = {userid} optional match (p:post)-[r2: shared_post]-(sharedpost:post)-[r3: posted_by]-(sharedpostpublisher: user) return p post,publisher, sharedpost, sharedpostpublisher is correct way retrieve info or should use other methods? aside lack of direction on relationships, looks fine. the lack of direction of course less self-explanatory (even if there's implicit direction, user isn't posted_by post ), changes semantics of query: bec

javascript - Async function inside loop -

i'm newer in javascript , trying execute async function inside loop. can explain why loop continuous executing after printing "all done" here code function asynchfunc(n, loop) { settimeout(loop, n); } function processitems(items, cb) { (function loop (index) { if (index == items.length) return cb(); console.log(items[index]); asynchfunc(items[index], loop); loop(++index); }(0)); } processitems([1000,2000,3000,4000,5000], function(ret){ console.log('all done'); }); there many problems in code: loop call asynchloop wich call loop after n millisecond (with index == undefined). you're test case if index == items.length. when call loop inside settimeout, pass no parameters when settimeout call loop, test case failed every time (so recursivity never ends). if want code works need pass index in asyncfunc function , stop calling loop @ end of loop function, : function asynchfunc(n, loop, index) { sett

excel - VBA insert new rows if 2 conditions met -

what i'm trying achieve insert number of new rows after rows contain in column text "rich", , if column b in same row contains value less 10 insert 2 rows after row. if column b in same row contain value higher insert 1 row after row. i'm not best in writing loop code. appreciate help. i managed after time :) sub macro1() range("a1").select ' remember last row contains value dim lastrow integer dim currentrow integer lastrow = range("a1").end(xldown).row currentrow = 1 ' keep on incrementing current row until ' past last row while currentrow <= lastrow ' if desired string found, insert row above ' current row ' means, our last row going 1 more ' row down ' , means, must double-increment our current ' row if range("a" & currentrow).value = "rich" , range("b" & curren

Haskell: Why are my environment variables not available when running my project under cabal? -

does know how define environment variables accessed program run cabal? i want define system environment variables available program, e.g. via system.environment 's 'getenv' function. variables available 'getenv' in ghci, not program run cabal ('cabal run'). i define environment variables as: $ export myvar=myvalue accessing them works in ghci: prelude system.environment> getenv "myvar" "myvalue" however, using 'getenv' in program , running 'cabal run' gives error: getenv: not exist (no environment variable) somehow program not finding them when run via cabal. tried placing 'export' statements in .bash_profile , restarting terminal. gave same issue of working in ghci , giving error when run cabal. thanks comments, realized due stupid mistake me. my program used couple different environment variables, of being read -- error due missing 1 hadn't tested in ghci. so issue due not

Authenticate Silverstripe users using Core PHP -

my client has website , backend made silverstripe. client wants mobile app , wants me build api communicate database. unfortunately wants me use other framework, or core php implementation pdo. my problem: how silverstripe encrypt password? how manually authenticate users using plain php. logic encrypt/hash (like silverstripe does) user input enough me. unfortunately wants me use other framework, or core php implementation pdo you, developer, have ability tell client why might wrong this. if website/application built silverstripe should have good/specific reason not continue use implement api on top of silverstripe data - makes perfect sense use silverstripe this, , little sense rewrite parts of silverstripe framework sake of "not using silverstripe." it's important mention client underlying encryption/hashing algorithms silverstripe implements not part of public api, , hence can change without requiring explicit notice given developers. mean de

android - Get Internal Storage custom directory location -

i' trying location of internal storage dynamically having issues it. following code working with: context context = this; file dir = context.getdir("appdata", context.mode_private); file file = new file(dir, "name.txt"); system.out.println( file.tostring() ); the return path print /data/data/com.example.application.form/app/name.txt want internal storage/appdata/name.txt what doing wrong? use file dir = new file(environment.getexternalstoragedirectory().getabsolutepath()); instead file dir = context.getdir("appdata", context.mode_private);

html5 - release used resources in createjs -

i have container multiple sprite , movieclip objects displayed on stage , sprites use 3mb png spritesheet . @ point load spritesheet in order display different container which uses it. along process of trial , error, i've seen setting visible property of container isn't enough, used removechild() , , cache() , both of helped proper framerate. problem load more containers , spritesheets, framerate gets low. there other steps should take in order release used resources? common pitfalls? yes, had quite bit of performance problems myself, when first started creating applications in createjs. if frame rate lower should be, make sure cache every object isn't created bitmap , since not refreshed , don't consume performance. example, shape type objects refreshed , performance intensive. you should use following pattern objects don't have animated content: var bounds = displayobject.nominalbounds; displayobject.cache(bounds.x, bounds.y, bounds.

c++ - Type definition should be dependent on template parameters -

given template class a , want define type t_res depending on a 's template parameters t_lhs , t_rhs : template< typename t_lhs, typename t_rhs > class { // definition of t_res in case "t_lhs , t_rhs both not primitive types" template< bool lhs_is_fundamental = std::is_fundamental<t_lhs>::value, bool rhs_is_fundamental = std::is_fundamental<t_rhs>::value, std::enable_if_t<( !lhs_is_fundamental && !rhs_is_fundamental )>* = nullptr > using t_res = decltype( std::declval<t_lhs>().cast_to_primitive() / std::declval<t_rhs>().cast_to_primitive() ); // definition of t_res in case "t_lhs and/or t_rhs primitive type" template< bool lhs_is_fundamental = std::is_fundamental<t_lhs>::value, bool rhs_is_fundamental = std::is_fundamental<t_rhs>::value, std::enable_if_t<( lhs_is_fundamental || rhs_is_fundamental )>* = nullptr > using t_re

python - How to scrape more than 100 google pages in one pass -

i using requests library in python get data google results. https://www.google.com.pk/#q=pizza&num=10 return first 10 results of google mentioned num=10 . https://www.google.com.pk/#q=pizza&num=100 return 100 results of google results. but if write number more 100 let https://www.google.com.pk/#q=pizza&num=200 , google still returning first 100 results how can more 100 in 1 pass? code: import requests url = 'http://www.google.com/search' my_headers = { 'user-agent' : 'mozilla/11.0' } payload = { 'q' : pizza, 'start' : '0', 'num' : 200 } r = requests.get( url, params = payload, headers = my_headers ) in "r" getting url's of google first 100 results, not 200 you can use more programmatic api google results vs. trying screen scrape human search interface, there's no error checking or assertion complies google t&cs, suggest details of using url: import requests def sear

android - Image gets rotate though the orientation is 0 using exif while selecting from gallery -

i selecting image gallery , showing on image view. image getting selected, on samsung phones has issue of rotating image solve checking if image rotated or not usif exif interface , if rotated change angle. but not working images. images can see straight, images if straight getting rotate. as did debug orientation image 0, goes in default case , applies normal bitmap rotated bitmap. still image see rotated. not getting why happening.. private void onselectfromgalleryresult(intent data) { bitmap bm=null; if (data != null) { try { bm = mediastore.images.media.getbitmap(getapplicationcontext().getcontentresolver(), data.getdata()); } catch (ioexception e) { e.printstacktrace(); } } bytearrayoutputstream bytes = new bytearrayoutputstream(); bm = bitmap.createscaledbitmap(bm,512,512, true); bm.compress(bitmap.compressformat.png,100, bytes); file destination = new file(environment.getexternalstoragedire

keychain - creating PKCS12 at runtime on iOS without using openssl -

my ios app handling x509 certificates + keys (der encoded) @ runtime. way able import them keychain use pkcs12 using function: secpkcs12import() i have been trying hard running using secitemadd() . used function der encoded certificate , again der encoded key. though call return success, querying keychain afterwards didn't yield secidentityref . so ended using openssl pkcs12 implementation. keen on getting rid of dependency on openssl. have been looking around alernative implementations of pkcs12. alternative lib found hosted in apples open source repo: https://opensource.apple.com/source/security/security-57031.10.10/security/libsecurity_pkcs12/ though os x project has (i suppose) many dependencies other modules of security framework. before start looking deeper i wondering: is there chance me run libsecurity_pkcs12 on ios? or better: there alternative small footprint pkcs12 library not aware of? or better: has imported x509 + key ios keychain (yielding secidenti

extjs - How to remove scrollbars for a combobox in extjs2 -

Image
i want remove scrollbars combox box new ext.form.combobox({ name:'cmbrating', id:'cmbrat', store: new ext.data.simplestore({ fields: ["wordrating","wordratingvalue"], data: [["0","xxxx word"],["1","aaaaa word"],["2","sssss word"]] }), displayfield:'wordratingvalue', valuefield:"wordrating", mode: 'local', triggeraction: 'all', forceselection: true, editable: false,

java - How to get oracle form version from EBS URL? -

i working on testing tool automates oracle ebs transactions. oracle forms(gui) gets changed whenever there patch applies. after recording transaction , if kind of gui changes happens , automation not happen. that, need track version of forms before replaying whether same recording 1 or not. don't know version change when patch applies forms or reports. can find details related oracle forms oracle forms->help->about oracle applications, can not automated. oracle form version change if patch applies? if yes, how can capture version respective ebs url (note: can them sql queries , linux commands , want know form version url ).

php - If not variable condition is not working -

i'm trying check whether variable value false or true, here code $print_ready_flag = $_get['print_ready']; // i'm passing either true or false echo $print_ready_flag ; // i'm getting correct value what i'm trying is, if ($print_ready_flag == false) { file_name = "albumpdf_" . $order['products_name'] . "_" . $orderid . "_" . $orderpid . ".pdf"; } when doing above expression evaluating, when tried if (!$print_ready_flag) {, if (!(bool)$print_ready_flag) . expression not evaluating. there way evaluate expression out using comparison operator. well conditions looks fine. must need add php `error_reporting() in code, find syntax , warnings. you have typo here: // missing $ sign file_name = "albumpdf_" . $order['products_name'] . "_" . $orderid . "_" . $orderpid . ".pdf"; and better use print_ready=0 instead of print_ready=f

titanium - New program with appcelerator don't run -

i've created new app in appcelerator , doesn't run. project gets created doesn't let me write code. i've created project via file -> new -> mobile app project , default alloy project . after creation got following message in tiapp.xml : "the project has invalid/non-platform guid , cannot run. please register app platform." , have button "register app". please me. thanks open terminal, go my/path/project , type appc new --import register app

Spring Boot JPA Mysql Production Setup -

i have spring cloud project microservices running on spring boot 1.3.6 , data jpa . thinking setting production environment . our plan have 2 physical servers , in each microservice running on vm such both servers having copy of microserices . run web app when 1 physical server goes down . how should setup mysql in both servers . load balancing or replication . industry standard on production level mysql setup . in case of replication , should go "master - slave" or "master - master" configuration .

c# - Filtering a list by comparing enums against a selected filter -

i have class named "simplesearchcriteria" 1 of properties enum named "opportunitystatus" containing various statuses. property set depending on users selection, drop down menu. below relevant code that's held in method, creating list of type "opportunitystatus", adding default values list within if statement , filtering based on value of "simplesearchcriteria" using switch statement relevant method code var states = new list<opportunitystatus>(); if(searchcriteria.oppstatusid == null) { states.add(opportunitystatus.active); states.add(opportunitystatus.closed); states.add(opportunitystatus.draft); } else { filterstates(searchcriteria, isadmin, states); } filterstates method private static void filterstates(simplesearchcriteria searchcriteria, bool isadmin, list<opportunitystatus>

c++ - Misra warning for include guard -

this regarding misra rule 16-0-2 misra c++ 2008 guidelines macros shall #define'd or #undef'd in global namespace. i understand rule polyspace misra checking tool complains following include guard declared @ beginning of file non-compliant. guess can happen if file included in namespace, not case header file. what other mistakes in code may cause issue? #ifndef foo_h #define foo_h ... code etc ... #endif note : example quoted in misra guidelines is #ifndef my_hdr #define my_hdr // compliant namespace ns { #define foo // non- compliant #undef foo // non-compliant } #endif if header guards placed outside braces (in global namespace), code fine , tool broken. send bug report polyspace. the rationale behind rule pre-processor directives shouldn't placed inside braces (inside namespace declarations or functions etc) because scope global no matter placed.

java - OrientDb graph TRAVERSE between two vertex with conditions -

Image
this graph schema (little part): busstation class extends v (vertex). every busstation element has stationid property value (1,2,3,4,5...). bus class extends e (edge). every bus element has 3 properties: busid : id of bus between 2 station (long) departure : time when bus went station (datetime) arrival : time when bus came on next station (datetime) i want find $path busstation stationid = 1 busstation stationid = 5 . when execute query through editor/java code: select $path path (traverse oute(bus), inv(busstation) select * busstation stationid = 1 strategy breadth_first) @rid == #17:3509 i shortest path, have conditions must follow: first want on same bus longer posible. means if on stationid = 1 bus busid = 1 on stationid = 2 want busid = 1 , on stationid = 3 on, , on stationid = 4 because don't have busid = 1 pick 1 of possible ability. second filter on arrival time of 1 bus , departure bus bus. must watch out if bus arrive on st

How to create programmatically conncetion string without entity metadata in code first approch -

i trying create connection string programmatically got error need configure metatdata nama & when using code first approach don't have @adventureworksmodel.ssdl|// /adventureworksmodel.csdl res:// /adventurdventureworksmodel.msl"; how able configure connection string some code on trying sqlconnectionstringbuilder sqlconnectionbuilder = new sqlconnectionstringbuilder(); sqlconnectionbuilder.datasource = @"10.103.201.31"; sqlconnectionbuilder.initialcatalog = database; sqlconnectionbuilder.integratedsecurity = true; sqlconnectionbuilder.multipleactiveresultsets = true; string sqlconnectionstring = sqlconnectionbuilder.connectionstring; //initialize entityconnectionstringbuilder entityconnectionstringbuilder entitybuilder = new entityconnectionstringbuilder(); entitybuilder.provider = "system.data.sqlclient"; entitybuilder.providerconnectionstring = sqlconnectionst

java - connect failed: ECONNREFUSED issue on few Anfroid Devices -

i have developed android application consumes webservice. have tested application on different devices , working on tablet of client, it's throwing exception. devices on application tested running android 6.0.1 marshmallow.following exception java.net.connectexception: failed connect web.abc.com(port 80):connect failed: econnrefused (connection refused) following code consuming webservice string namespace = "http://web.abc.com/"; private static final string url = "http://web.abc.com/webservice/servicefilename.asmx"; string soap_action; soapobject request = null, objmessages = null; soapserializationenvelope envelope; httptransportse androidhttptransport; /** * set envelope */ protected void setenvelope() { try { // creating soap envelope envelope = new soapserializationenvelope(soapenvelope.ver11); //you can comment line if web service not .net one. envelope.dotnet = true; envelope.setoutputsoapobject

android - Install application only on notification tab -

i show notification user once application has been downloaded. i have installapk method installs downloaded application in code piece (completenotification) application gets automatically installed. need install once user tabs notification . did overlooked something? thank help. the completenotification method: public void completenotification() { intent install = installapk(urlpath, context, mnotificationmanager, notifycationid); pendingintent pending = pendingintent.getactivity(context, 0, install, 0); mbuilder = new notificationcompat.builder(context) .setcontenttitle(appname) .setcontenttext("ready install."); mbuilder.setcontentintent(pending); mbuilder.setsmallicon(r.drawable.placeholder); mbuilder.setdefaults(notification.default_sound); mbuilder.setautocancel(true); mnotificationmanager = (notificationmanager) context.getsyste

python - Why does my custom 404 page return '404 ok' response in Django? -

i've render custom 404 template django. decided start on basic of it: def custom_page_not_found(request): response = render_to_response('404.html', {}, context_instance=requestcontext(request)) response.status_code = 404 return response and i'm pretty curious know why can't have "404 not found". if don't use handler404 urls.py, have blank 404 page current status. not when want have custom template. does know why? (django 1.7.11) in django 1.9+, changing status_code (e.g. 404) change reason_phrase if not set (e.g. 'not found'). however, using older version of django, have change reason_phrase manually otherwise remain 'ok'. it easier set status when creating response. def custom_page_not_found(request): return render_to_response('404.html', {}, context_instance=requestcontext(request), status=404)

git - Get latest committed branch(name) details in JGit -

how determine latest committed branch in git repository? want clone updated branch instead of cloning branches despite of whether merged master (default branch) or not. lsremotecommand remotecommand = git.lsremoterepository(); collection <ref> refs = remotecommand.setcredentialsprovider(new usernamepasswordcredentialsprovider(username, password)) .setheads(true) .setremote(uri) .call(); (ref ref : refs) { system.out.println("ref: " + ref.getname()); } //cloning repo clonecommand clonecommand = git.clonerepository(); result = clonecommand.seturi(uri.trim()) .setdirectory(localpath).setbranchestoclone(branchlist) .setbranch("refs/heads/branchname") .setcredentialsprovider(new usernamepasswordcredentialsprovider(username,password)).call(); can me on this? i afraid have clone entire repository branches find out newest branch. the lsremotecommand lists branch names , id's o

sql - Excel does't save query cell reference parameters -

in excel workbook i'm using cells value parameter when getting data external data sorurce through "where somedata=?". assign "parameter 1" cell reference. this works great when save workbook , open again reference cell deleted. makes excel top crash when try open workbook again. is bug?

c# - Connect Pouch Db mobile app to .net -

i need connect pouchdb mobile app .net api, sync databases. i'n pouchdb, ionic, cordova app haves connection strings. webservicesurl: 'https://localhost:44302/api/', webservicesurlhttps: 'https://localhost:44302/api/', localdatabasename: 'cbre_opus_local', maxphotosperquestion: 4, maxphotosforinspection: 40, and need correct way of connection, connect api.

angularjs - use of operators( >,<,==,!=) in ng-class -

i want use operators check if value greater or equal other number or variable in ng-class, , apply style class accordingly. want color div based on prob. is usage of ng-class correct? prints value of {{1-apstats.premappedprobability.tofixed(3)}} but ng-class tag doesn't work. reasons? <div ng-class="(1-apstats.premappedprobability.tofixed(3) >=0.5) ? 'yellowclass':'redclass'"> {{1-apstats.premappedprobability.tofixed(3)}} </div> what doing wrong.? thank you @subhash in ng-class directive, first need give class name condition following - ng-class="{morebtngray : condition}" in case - should use 2 ng-class , maintain condition accordingly. <div ng-class="{yellowclass: condition1, redclass:condition2}">{{1-prob.p}} </div>

php - Is there any way to export fusion chart in excel using custom export buttons? -

i using fusioncharts/3.2.4 library rendering charts on webpage. searched on google not find answer how can export fusion charts in excel/pdf using custom export buttons? note: dont want use builtin library aswell. i searched , found fusioncharts/3.2.4 not provide native excel export functionality. thanks in advance. i'm working 3.11.3 , doesn't appear @ xls png , pdf work well. but can answer question: i found can you

c# - Integrating Paypal with link in wpf application -

i want integrate paypal wpf apps. actually, in wpf application there link of buying product. so, when click on link need purchase product through paypal integration , sending mail user. though, have done in web application dont know how in wpf. can plese me? check these following links up: integrating c# app paypal paypal-net-sdk configuring paypal-sdk

system verilog - How to use DPI systemVerilog to detect a substring match? -

how use systemverilog dpi check if string contains string? example, strstr() in c can detect "str" contained within "string". not sure mean dpi systemverilog? if want use functions similar c functions, highly suggest svlib library verilab. provides string manipulation methods using str class http://www.verilab.com/resources/svlib/

localization - Handling name ordering in Facebook Graph API -

according facebook graph api documentation , name_format field gives "the person's name formatted correctly handle chinese, japanese, or korean ordering." for own facebook account, name_format field returns string "{first} {last}" , consistent having western name. but other possible values there name_format ? cannot find documentation of string format. presume chinese user have name_format set "{last}{first}" ; me guessing. (note: this stackoverflow answer attempt answer same question, answer merely guesswork.) edit i have verified chinese name, name_format indeed "{last}{first}" (with no space between two). there other possible values?

Translate C program to other programming languages -

i trying translate c program. destination language doesn't matter, trying understand every single part of program doing. i cannot find detail about: variable=1; while(variable); i understand loop , true (i have read similar questions on stack overflow code executed) in case there no code related while. wondering, program "sleeping" - while while executing? then, part don't understand is: variable=0; variable=variable^0x800000; i believe value should 24bits needed in other programming language not low level c? many thanks while(variable); implements spin-lock ; i.e. thread remain @ statement until variable 0. i've introduced term search technique in new language. it burns cpu, can quite efficient way of doing if used few clock cycles. work well, variable needs qualified volatile . variable = variable ^ 0x800000; xor operation, single bit toggle in case. (i have preferred see variable ^= 0x800000 in multi-threaded code.) exact us

Video capture HTML page to stream -

i screen capture html page video , stream live. i've found way using obs: https://obsproject.com use technology server side. you write c# application using html2canvas http://html2canvas.hertzen.com/ , rmtp streaming library. of course if looking plug n play solution not it.

cmake - How do I detect that I am cross-compiling in CMakeLists.txt? -

the cmake documentation suggests cmake_crosscompiling set when cross-compiling. in cmakelists.txt have lines: if(cmake_crosscompiling) message(status "cross-compiling skipping unit tests.") option(game_portal_unit_test "enable unit testing of game portal code" off) else() message(status "enabling unit testing of game portal code") option(game_portal_unit_test "enable unit testing of game portal code" on) endif() the output running: cmake -dcmake_toolchain_file=../crosscompile/raspberry_pi/cmakecross.txt . includes text "enabling unit testing of game portal code", variable not being set, or not evaluates true anyway. i tried modifying cmakecross.txt include: set(cmake_crosscompiling on cache bool "cross-compiling" force) and after cleaning old cmakecache.txt , rerunning cmake command can see new cmakecache.txt includes variable, still same result regards unit tests being enabled. how can reli

java - Frequency in dfs_query_then_fetch in ElasticSearch -

i trying fetch docfrequency across shards each response. tried default search(query_then_fetch ) , dfs_query_then_fetch. both of them returned different score , docfrequency same matched result. so, docfrequency global in both cases or particular shard in both cases ? , how can global frequency ?

Can I create channels in Microsoft Teams using the API? -

i not programmer - trying find answer question microsoft teams. i'd dev team automate processes in teams including creation , archive of channels. can let me know if possible via api? tia since last week, channels available in microsoft graph api (on beta endpoint). create channel, can post /channel endpoint: post https://graph.microsoft.com/beta/groups/{id}/channels content-type: application/json { "displayname": "channel name", "description": "channel description" } more info method available on microsoft graph documentation page: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/group_post_channels

moq - Writing unit test cases for Sitecore project -

my client wants have 100% code coverage projects. have written few test cases long web api's using nunit. client decided use xunit unit test framework using moq mock framework. as have never worked on unit test case sitecore project, please en-light on approach? start coudl please write sample test case below method? using glassmapperframework orm. public class registrationcontroller : glasscontroller { public actionresult registrationinitiation() { var someobject = getdatasourceitem<iregistrationmaincontent>(); return view(someobject); } } to test controllers, want inject sitecore context controller. glasscontroller has overload method on glasscontroller(isitecorecontext). used unit test controllers. has other overloads if needed... here more complete code need unit test controller private mock<iregistrationmodel> registrationmodel { get; set; }; private registrationcontroller control

json - Search for related properties in the same object. Javascript -

i need matching childrens in same object based on parent id property.... json: { "1": { "id": 1, "name": "my crib", "type": "home", "order": 0, "parent": null }, "2": { "id": 2, "name": "first floor", "type": "floor", "order": 1, "parent": { "id": 1, "url": "http://localhost:8080/rest/areas/1" } }, "3": { "id": 3, "name": "garage", "type": "garage", "order": 2, "parent": { "id": 1, "url": "http://localhost:8080/rest/areas/1" } }, "4": { "id": 4, "name": "garden", "type": "garden", "order": 3, "parent": { "id": 1, "url": "http://localhost:8080/rest/areas/1" } }, "5":

drupal 8 - Best practices D8 config:export:content:type VS Features module -

i'm bit lost new config system. in drupal 7, put content type, blocks, views, etc. in differents features. in d8, drupal config:export:content:type seems features do. except ui have advantages still use features module or should create custom modules , use config:export commands? after tests, realise don't need features. my workflow drush cex -y , drush cim , it's enought.

regex - Sanitizing strings with filenames and extension in Java -

having 4 type of file names: filename double extension filename no extension filename dot @ end, , no extension filename proper name. like this: string doubleexsension = "doubleexsension.pdf.pdf"; string noextension = "noextension"; string namewithdot = "namewithdot."; string propername = "propername.pdf"; string extension = "pdf"; my aim sanitze types , output filename.filetype properly. made little stupid script in order make post: arraylist<string> app = new arraylist<string>(); app.add(doubleexsension); app.add(propername); app.add(noextension); app.add(namewithdot); system.out.println("------------"); for(string : app) { // ends . if (i.endswith(".")) { string m = + extension; system.out.println(m); break; } // double extension string p = i.replaceall("(\\.\\w+)\\1+$", "$1"); system.out.println(p); } this o

forth - Where are pthreads in Gforth? -

i trying load pthreads module in gforth. appears unavailable. needs pthread.fs :1: no such file or directory needs >>>pthread.fs<<< backtrace: $7f647ba86f40 throw $7f647ba87048 required needs pthreads.fs :2: no such file or directory needs >>>pthreads.fs<<< backtrace: $7f647ba86f40 throw $7f647ba87048 required needs unix/pthreads.fs :3: no such file or directory needs >>>unix/pthreads.fs<<< backtrace: $7f647ba86f40 throw $7f647ba87048 required needs unix/pthread.fs :4: no such file or directory needs >>>unix/pthread.fs<<< backtrace: $7f647ba86f40 throw $7f647ba87048 required i running gforth 0.7.0 . there special need load it? available in newer version? after googling, appears probably in version higher 0.7.0 .

objective c - Open the Bluetooth Settings Menu in Ios 10 -

i need open bluetooth settings menu in ios10 , above.but [[uiapplication sharedapplication] openurl: [nsurl urlwithstring:@"prefs:root=bluetooth"]]; not working in ios 10. after exploring multiple document got below link provide code work properly. https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f but, have question app store accept patch code or reject application. please me solve issue. thanks in advance swift 3.0:- working in ios version upto ios 10.2 let url = url(string: "app-prefs:root") //for system setting app @ibaction func blutoothebuttontapped(_ sender: anyobject) { let url = url(string: "app-prefs:root=bluetooth") //for bluetooth setting let app = uiapplication.shared app.openurl(url!) }

version control - How to compare two git branches and filter the differences by commit message? -

i have release branch named release/x.x.x.x contains feature branches want deploy production. release branch made on top of master current state of production. on every release day make sure our release branch contains changes planned release. use command compare release , master branch: git log release/x.x.x.x ^master --no-merges . manually check commits keywords "shr-1234" represent ticket numbers in our ticket management system. need compare each commit list of ticket numbers identify unwanted changes. how can filter commits returned git log release/x.x.x.x ^master --no-merges , do not contain keywords "shr-1234"? way can identify ticket number of unwanted changes. i tried grep , awk results not useful because don't filter out whole commit. the git log command provides 2 interesting options here: --grep=<pattern>        limit commits output ones log message matches specified pattern (regular expression). more 1 --g

apache pig - Hello world in clean pig workspace -

i wonder wheter possible classic 'hello world!' in apache pig. pig related sql , hive 1 do: select 'hello wold'; however, have been unable find way 'create nothing' in pig. note if able load in 1 line of data or more, of course following: load limit 1 generate hello world however, not looking for. hope find way create hello world example without having kind of data available. in case wonder: asking out of curiosity, convenient speed testing of code doing in code (without having touch file system).

streaming - How to live stream video in facebook with live reading of like counts from facebook? -

i want stream video in facebook graphs read likes/reactions post , update live in video itself. example : https://www.facebook.com/sportnews07/videos/712585572223590/ here simple tutorial capture , stream in real-time facebook live reactions: https://socialwall.me/en/capture-stream-in-real-time-facebook-live-reactions/

database cluster failed: error : Microsoft Dynamics CRM user exists with the specified domain name and user ID -

i stuck on 1 of issue of dynamic crm. my dynamic crm application not running in pre-prod environment , showing message no microsoft dynamics crm user exists specified domain name , user id. a few months back, db cluster failed of application in pre-prod db server hence lost database after took database copy production , restore on pre-production db server, dynamic crm application showing message no microsoft dynamics crm user exists specified domain name , user id. maybe active directory related issue not sure cause due db cluseter failure took production database pre-prod db server environment , of pre-prod application pointing db took production. to clone prod in staging process pretty straightforward [staging environment] delete organization through crm deployment manager delete <orgname>_mscrm database [production environment] backup <orgname>_mscrm database (can done live) copy backup staging sql [staging environment again] re

php - Magento 1.9 Catch product options event -

i have store product color options. use magento 1.9. how can catch color change event php source? thank you. the file handles changes in configurable product options js/varien/configurable.js take in there, see if can figure out. if not, come , post actual code at.

join - Joining entity objects by foreign key with Java Stream API -

i training using java steam api , implemented mentioned in title. dissatisfied code. for example, there 3 entity classes simple immutable bean. code: public class country { private final integer countryid; // pk, primary key private final string name; public country(integer countryid, string name) { this.countryid = countryid; this.name = name; } // omitting getters } public class state { private final integer stateid; // pk private final integer countryid; // fk, foreign key private final string name; public state(integer stateid, integer countryid, string name) { this.stateid = stateid; this.countryid = countryid; this.name = name; } // omitting getters } public class city { private final integer cityid; // pk private final integer stateid; // fk private final string name; public city(integer cityid, integer stateid, string name) { this.cityid = cityid;

performance - Efficiency of uniqueness validation in Active Record Rails -

which more efficient while creating records unique values column in rails placing uniqueness validation vs finding if record exists same value , create based on existence. which more efficient in terms of coding , performance . a database uniqueness constraint give highest performance. at application level, whether using validates_uniqueness_of or manually finding if record exists, performance same. in fact, how implemented in rails: https://github.com/rails/rails/blob/0d73d6e7b6dd1900f105397460b777ef6c03d3b6/activerecord/lib/active_record/validations/uniqueness.rb#l33

purescript - How to launch psci without compiling current project? -

my project has compiler error, should not deter me opening interactive purescript session, yet does: $ pulp psci error found: @ /users/srid/code/ps/pallanguzhi/src/board.purs line 41, column 50 - line 41, column 50 unable parse module: [..] see https://github.com/purescript/purescript/wiki/error-code-errorparsingmodule more information, or contribute content related error. how launch psci shell regardless of state of project? don't care not being able import project modules; need bare shell. there no way now, other running psci directly , providing glob of subset of modules known build. we have open issue track already.

ruby on rails - undefined method `[]' for "jpg":Sass::Script::Value::String -

after upgrading rails 4 strange errors when trying application , running. = favicon_link_tag "favicon.png" produces error: undefined method `[]' "jpg":sass::script::value::string below full stacktrace produces error: actionview (4.2.7) lib/action_view/helpers/asset_url_helper.rb:174:in `compute_asset_extname' actionview (4.2.7) lib/action_view/helpers/asset_url_helper.rb:130:in `asset_path' sprockets (3.7.0) lib/sprockets/sass_processor.rb:124:in `asset_path' sass (3.4.22) lib/sass/script/tree/funcall.rb:143:in `_perform' sass (3.4.22) lib/sass/script/tree/node.rb:58:in `perform' sass (3.4.22) lib/sass/script/tree/funcall.rb:173:in `perform_arg' sass (3.4.22) lib/sass/script/tree/funcall.rb:124:in `block in _perform' sass (3.4.22) lib/sass/script/tree/funcall.rb:124:in `each' sass (3.4.22) lib/sass/script/tree/funcall.rb:124:in `each_with_index' sass (3.4.22) lib/sass/script/tree/funcall.rb:124:in `each' sass