Posts

Showing posts from January, 2014

r - Need help creating the following sequence: -

in r, need create vector b = (1, 1+pi, 1+2pi, 1+3pi,...,1+19pi) . unsure how this. keep trying use seq command (i.e. seq(1, 1+npi n = 1:19) , that's totally wrong!), don't know proper syntax make work, never does. any appreciated. r needs multiplication operator. b <- 1+ seq(0,19)*pi or faster in situations speed might matter: b <- 1+ seq.int(0,19)*pi you use equivalent: b <- 1+ 0:19*pi because ":" operator has high precedence ( see ?syntax ), it's reasonable safe. careful understand precedence when use minus or plus sign might parse binary operator (remembering spaces ignored , unary-minus has higher precedence single-colon, binary minus or plus has lower precedence : > 1: 5+5 [1] 6 7 8 9 10

c# - CS0117 - Xamarin not detecting 'Resources' folders and files -

i have been developing xamarin.forms app, on ios , android. have run problem whereby code unable see resources being referenced in mainactivity.cs . have same error 2 different resources. i following along udemy course , instructor emphasising manually building of xml files, hence 2 types, axml , xml . first error /users/richardcurteis/desktop/onedrive/devshared/xamarinprojects/notetaker/droid/mainactivity.cs(35,35): error cs0117: `notetaker.droid.resource' not contain definition `menu' (cs0117) (notetaker.droid) second error: /users/richardcurteis/desktop/onedrive/devshared/xamarinprojects/notetaker/droid/mainactivity.cs(21,21): error cs0117: `notetaker.droid.resource.id' not contain definition `action_add' (cs0117) (notetaker.droid) mainactivity.cs using system; using android.app; using android.content; using android.runtime; using android.views; using android.widget; using android.os; using supporttoolbar = android.support.v7.widget.toolbar;

laravel - Use of Command inside of a service -

im using laravel 5.0 , attempting set command queueing job inside of mailer service. my problem don't know how inject command dispatcher mailer service. my structure: services folder mailer.php (contains abstract class mailer ) usermailer.php (contains class usermailer extends mailer class) things have tried: i've tried use dispatchescommands trait within usermailer class , within mailer class. have tried inject \illuminate\contracts\bus\dispatcher constructer of usermailer class. in 3 instances error "class services\mailers\sendemail not found" mailer.php: abstract class mailer { public function emailto($view, $mdata) { mail::queue($view, $mdata, function($message) use ($mdata) { //code here - not relevant } }); } } usermailer.php: use illuminate\contracts\bus\dispatcher dispatcher; class usermailer extends mailer { protected $bus; function __construct(dispatcher $bus) { $this->bus

javascript - How do the regular expressions in sizzle.js work? -

if escaped characters in regular expression created in javascript regexp object need escaped again how following code in sizzle.js work - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+" if \\\\\\\ = \ , \\\w = \w how \0 = \0 when single backslash used? when run in google console identifier "(?:\\\\.|[\w-]|[^-\\xa0])+" is mistake or not understanding correctly? if correct , how intended work purpose of \0 ? if regular expression needs contain backslash — e.g., because need \( (which matches actual ( ) or \w (which matches letter or digit or underscore) — , you're creating regular expression string literal, need write \\ , ends \ in regular expression. but in \0 example, regular expression doesn't need contain backslash. needs contain character u+0000 (which matches itself). string literal can contain \0 , ends character u+0000.

multithreading - How to start a gen_server or gen_fsm on demand in Erlang without race conditions? -

i need spawn several independent instances of same gen_fsm on demand, , able route calls correct instance. gproc library seems great way of registering processes arbitrary names. has function gproc:reg_or_locate/3 spawning things on demand without race conditions. way don't need supervisor - if crash they'll spawned on demand again. can't figure out how apply gproc:reg_or_locate/3 spawning gen_fsm or gen_server. what i've tried far: i call gen_server:start() through function, create intermediate process, give name intermediate process, intermediate process spawn gen_server , terminate, , end nameless gen_server. both gen_server , gen_fsm export enter_loop function seems need if feed gproc:reg_or_locate/3 , documentation reads: the process must have been started using 1 of start functions in proc_lib, see proc_lib(3) . and docs gproc:reg_or_locate/3 not mention through proc_lib. alternatively make intermediate process acquire name , atomical

html - Auto adjust my background image size -

Image
i've been googling awhile , none of answers seem match need, need me this, thanks. my personal website is: http://simonykhsu.com refrences my code background image <div class="landing-header" style="background-image: url('skitrip_owlshead.jpg');"> i've tried implementing background image code cant find section in css file make background go skin color <div id="image-container"> <img id="image" src="skitrip_owlshead.jpg" alt="middle"/> </div> and second code above doesnt seem bring image middle... for centering image , set backgroud color can in image-container div <div id="image-container" style="text-align:center; background-color:#ccc;"> <img id="image" src="skitrip_owlshead.jpg" alt="middle"/> </div> #ccc sample color ... set color code..

swift - Exclamation mark prefix on variables during if statements and other as well? -

i'm confused after looking through similar questions of the(!) operator when prefixed on variable or other object in if statements, functions, etc? example: mutating func add(value: t) { if !contains(items, value) { items.append(value) } } the exclamation mark ! used 2 purposes. when see appear @ beginning of object, such in !contains(items, values) , means "not". example... let x = 10 let y = 5 if x == y { print("x equal y") } else if x != y { print("x not equal y") } the above code print => " x not equal y " . the logical not ( ! ) operator can used reverse boolean values. example... var falseboolvalue = false falseboolvalue = !falseboolvalue print(falseboolvalue) the above code print => " true " in addition usage logical not operator, exclamation mark used implicitly unwrap optional values. whenever see exclamation mark appear @ en

javascript - Finding the middle index between any two indexes in a circular array -

i have array , 3 indexes: var arr = ['a', 'b', 'c', 'd']; var f = 0; // first element var l = arr.length - 1; // last element var c = 0; // current element i'm trying write function makes index c cycle through array. requirement never reach index l . so, whenever c reaches value, f , l need increased well. a reasonable value work limit c thought middle point between f , l. function wrote this: var mod = function(x, m) { var r = x%m; return r<0 ? r+m : r; } while (true) { console.log('f', f, 'l', l, 'c', c); if (c == l) { console.log('error'); } c = mod(c + 1, arr.length); if (c > mod(l - f, arr.length) / 2) { f = mod(f + 1, arr.length); l = mod(l + 1, arr.length); } } it doesn't work, clearly. there nice simple formula modulo operator want or approach totally wrong? here's fiddle try it: https://jsfiddle.net/wku37h9e/2/ edit: explai

hadoop - After completion of MapReduce job, RunJar is still active -

i executing few mapreduce program on hadoop cluster. programs executed , gave required output. using jps command noticed runjar still running process. stopped cluster still process id up. i know hadoop jar invokes base runjar execution of jar, normal after job completion process up? enter image description here if yes, in care muliple runjar instances keep running, how can make sure after job completion, run jar stops(i don't wish kill process)

c++ - Can you change your program name listed in volume mixer/sndvol in windows without using Core Audio APIs? -

i have been searching way change name displayed in windows volume mixer/sndvol used in win 7 preferably work vista well. might not such issue if not using openal-soft create sounds. references seem come directed windows core audio api. trying not use more os specific apis have can more port finished program linux later if wish without having rewrite whole program. right program shows in mixer, has ".exe" attached it, think looks unprofessional. found this article on msdn regarding ca api , seems more suited if going access windows apis yourself, , far attempts use iaudiosessioncontrol::setdisplayname didn't change anything, since tried use that. i prefer not have add more 10-15 lines of code this, , appears me use api looking @ lot more lines of code. there way can change display name program appears in windows volume mixer? the name in volume mixer same window title, can change window title. i've tried that, worked.

html - Formatting email layout issue Outlook 2013 - Windows 7 -

Image
i have modified email template (from campaign monitor) responsive , works on email browsers. but, email header running formatting issues on outlook 2013, windows 7. i have messed formatting inline , using css attempt find solution. correct email outlook 2013, windows 7 i have created jsfiddle review html code: https://jsfiddle.net/jeremyccrane/wz4ly555/ <!--[if mso]> <body class="mso"> <![endif]--> <!--[if !mso]><!--> <body class="half-padding" style="margin: 0;padding: 0;min-width: 100%;background-color: #e7e7e7;"> <!--<![endif]--> <center class="wrapper" style="display: table;table-layout: fixed;width: 100%;min-width: 620px;-webkit-text-size-adjust: 100%;-ms-text-size-adjust: 100%;background-color: #e7e7e7;"> <table class="header centered" style="border-collapse: collapse;border-spacing: 0;margin-left: auto;margin-right: au

Powershell wget protocol violation -

i trying browse command on embedded webserver using wget / invoke-webrequest. how can error avoided? wget : server committed protocol violation. section=responseheader detail=cr must followed lf already tried multiple things, example below without success: [system.net.servicepointmanager]::servercertificatevalidationcallback = {$true} when using bits instead, error i'm getting start-bitstransfer : server did not return file size. url might point dynamic content. content-length header not available in server's http reply. thanks clem setting servercertificatevalidationcallback delegate won't - ssl/tls not protocol being referred - protocol violation regards http headers (eg. long after tls has been established). there's .net configuration flag called useunsafeheaderparsing controls whether such violations ignored or not. using reflection, can set runtime. this technet forum answer give's great example of how in powershell, can wrap

Folder Choose in Html -

i want users select folder path. for example; user choose 'd:/example/' folder. then im save 'd:/example/' database. <input type='file'> doesnt work me . need folder path how can ? edit: everyone show answer but not question. listing directory. i want folder path d:/asd/ user pick asd folder on d. so save database 'd:/asd/' .just this i dont know how can explain more. i hope can you you can see folder name in alert when select file <script type="text/javascript"> function getfolder(e) { var files = e.target.files; var path = files[0].webkitrelativepath; var folder = path.split("/"); alert(folder[0]); } </script> <input type="file" id="flup" onchange="getfolder(event)" webkitdirectory mozdirectory msdirectory odirectory directory multiple />

android - Update ProgressBar onTouch and restart it on release (with imageButton) -

Image
i trying achieve following design/functionality: have circular image surrounded circular progress bar. want when user touches imagebutton progress bar start progress that: the proglem when user decides remove finger imagebutton (motionevent.action_up) progress bar not stop , return initial state (0). please share if have suggestions/improvements problem. thank in advance! this code: public class mainactivity extends appcompatactivity { public circleprogressbar progressbar; private static final string tag = mainactivity.class.getsimplename(); private int totalprogresstime = 100; thread t; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); progressbar = (circleprogressbar)findviewbyid(r.id.custom_progressbar); t = new thread() { @override public void run() {

c++ - Logical Error with input function -

i working on project on inheritance, dollaramount parent class of class spendingrecord. there seems problem these 2 input functions because whenever type in -1 ( delimiter ) not enter if statement in main, program never breaks , accepts -1 acceptable dollar amount ( should accept -1 if user no longer wishes enter dollar amounts ). getdollar, getcent, , getdelim functions of dollaramount class, assumed spendingrecord inherited them. can help? void dollaramount::inputdollar( istream &ins ) { char decimal; int dollar, cent; cout << "\n$printdollar " << endl; cout << "enter expenditure record (e.g., 1.95, coffee, enter -1 end): $"; ins >> dollar; if ( dollar != getdelim()) { ins >> decimal >> cent; } // //check make sure user inputs correct amount //ensures dollar in between 0 , 9999

multithreading - I need to trace my kernel in FreeBSD, It is getting stuck at bootup because I'm changing the scheduler, How do I do that? -

i modifying scheduler , it's causing stuck (because i'm not able implement properly, , i'm not picking stuff throw in queues). i'm trying see how far gets. how write stuff log, , how read log, when boot kernel.old i throwing threads new set of queues, instead of traditional 3 runq's of 64 each. traverse , pick thread, i'm using tailq_foreach. you doing wrong. what should run hypervisor support debuggers, qemu or bhyve. attach gdb kernel boot , inspect state crashes. in principle /could/ have log write stuff , retrieve after failed boot, don't see why this. simplest way of achieving printf , possibly extend size of buffer can fit more messages. kernel puts log @ same location , checks magic number on boot knows whether should start scratch or start appending. said log available in dmesg , /var/log/messages. noted earlier, that's not way it .

c# - How to change media capture photo resolution for UWP? -

so have code takes photo in uwp app (running on windows desktops , phones) using code. await _mediacapture.capturephototostreamasync(imageencodingproperties.createjpeg(), stream); and works great takes image @ full resolution of device... (so 44 megapixels on lumia 1020) big me. want limit resolution fixed size (say around 16 megapixel). so there way of setting camera capture resolution or have capture @ full resolution , downscale myself? you should able change resolution of mediacapture element setting mediastreamproperties after initialization: // initialization here // available resolutions var resolutions = capturemanager.videodevicecontroller.getavailablemediastreamproperties(mediastreamtype.photo).tolist(); // set used resolution await capturemanager.videodevicecontroller.setmediastreampropertiesasync(mediastreamtype.photo, resolutions[1]);

r - Apply custom function to any dataset with common name -

i have custom function want apply dataset shares common name. common_funct=function(rank_p=5){ df = any_dataframe_here[any_dataframe_here$rank <rank_p,] return(df) } i know common functions below value of each. apply(mtcars,1,mean) but if wanted : apply(any_dataset, 1, common_funct(anyvalue)) how pass along? library(dplyr) mtcars$rank = dense_rank(mtcars$mpg) iris$rank = dense_rank(iris$sepal.length) now how go applying same function both values? if understand question, suggest putting data frames list , apply on it. so ## example function common_funct=function(df, rank_p=5){ df[df$rank <rank_p,] } ## sanity check common_funct(mtcars) common_funct(iris) next create list of data frames l = list(mtcars, iris) and use lapply lapply(l, common_funct)

Output PHP Mysql Date format to ISO 8601 with "T" sign only -

i datetime formatted specific way. can in mysql or need in php? this output mysql : 2016-01-30 23:21:46 i need formatted in (similar not same) fashion: 2016-01-30t23:21:46 is there php function handle correctly or possible change mysql? you use insert() : select insert(<whatever>, 11, 1, 't')

vba - Can't send multiple Outlook Messages -

i can send single outlook message using excel vba. however, want loop through rows , send email each row meets condition. unfortunately, when put email code in loop 1 email gets sent or none @ (depending on how structure code). is there calling outlook multiple times should know? private sub commandbutton1_click() dim outapp object dim outmail object dim myvalue variant dim contactrange range dim cell range dim toaddy string, nextaddy string dim integer set contactrange = me.range("contactyesno") myvalue = inputbox("enter body of email message.") each cell in contactrange if range(cells(cell.row, cell.column).address).value = "yes" nextaddy = range(cells(cell.row, cell.column).address).offset(0, 5).value toaddy = nextaddy & ", " & toaddy end if next cell if len(toaddy) > 0 toaddy = left(toaddy, len(toaddy) - 2) end if

java - UDP or TCP for Android Audio Stream -

my ultimate goal here stream user's voice input android device on desktop application. for android device, running java based android application. desktop application, i'm considering writing java applet accept stream. these benefits , drawbacks of tcp , udp explained wikipedia transmission control protocol connection-oriented protocol, means requires handshaking set end-to-end communications. once connection set up, user data may sent bi-directionally on connection. reliable – tcp manages message acknowledgment, retransmission , timeout. multiple attempts deliver message made. if gets lost along way, server re-request lost part. in tcp, there's either no missing data, or, in case of multiple timeouts, connection dropped. ordered – if 2 messages sent on connection in sequence, first message reach receiving application first. when data segments arrive in wrong order, tcp buffers delay out-of-order data until data can re-ordered , deli

performance - Javascript Game Code Running Very Slow -

i wanted build little , forth shooter game in javascript final class project in digital art. however, code have written starts run after few seconds. @ first using setinterval(), switched on requestanimationframe() try , improve performance. didn't work. here code: var canvas = document.getelementbyid("mycanvas"); var ctx = canvas.getcontext("2d") var youtube = new image(); // create new img element var bullet = new image(); var background = new image(); var spaceship = new image(); var url = new image (); var moveh = 150 var shipx = 150 var right = true var rightpressed = false var leftpressed = false var spacepressed = false var bulletup = 280 var shot = false var explosion = false document.addeventlistener("keydown", keydownhandler, false); document.addeventlistener("keyup", keyuphandler, false); function keydownhandler(e) { if(e.keycode == 39) { rightpressed = true; }else if(e.keycode == 37) { leftpresse

Laravel Model accessing a value of an instance of its self -

i've got model , model self linked multiple other databases 1 @ time. instead of having eloquent method possible databases; have 1 use variable self instance choose database , return that. it save alot of work, returning each 1 , testing see if there results cumbersome. <?php namespace app; use illuminate\database\eloquent\model; class feature extends model { /** * database table used model. * * @var string */ protected $table = 'companies'; /** * attributes mass assignable. * * @var array */ protected $fillable = [ 'name', ]; /** * attributes excluded model's json form. * * @var array */ protected $hidden = [ 'db_name', 'enabled', ]; /** * uses own database name determine input return. */ public function inputs() { // if this->hidden->db_name == 'input type 1' // return $this->hasmany(inputtype1::class); ...

ios - How to select a cell in table view without scrolling it? -

i building settings screen app using table vc. in viewdidload , want show user his/her current settings selecting cells. there checkmark on left of selected cells. didselectrowatindexpath method: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { let cell = tableview.cellforrowatindexpath(indexpath) row in 0..<tableview.numberofrowsinsection(indexpath.section) { let celltobedeselected = tableview.cellforrowatindexpath(nsindexpath(forrow: row, insection: indexpath.section)) celltobedeselected?.accessorytype = .none } cell!.accessorytype = .checkmark tableview.deselectrowatindexpath(indexpath, animated: true) } this works well. when select row, checkmark appears. when select row, previous checkmark disappears , new 1 appears. however, want select rows programmatically in viewdidload , in order show current settings. i found method called selectrowatindexpath . tried use requires uitableview

To POST a file to a REST api directly from a URL without writing to disk in java -

i trying post file object rest api without writing disk. file object available me http url. is there anyway can send file object rest without saving disk temporarily. you can directly use @requestmapping(value = "{id}/file/{filename:.+}", method = requestmethod.get) public void uploadfile () { // write post method here }

java - pagination of xlsx file to XSSFworkbook using apache POI -

right in code, reading xlsx file, xssfworkbook, , writing database. but, when size of xlsx file increases, causes outofmemory error. can not increase server size, or divide xlsx file pieces. tried loading workbook using file (instead of inputstream), didn't either. i looking way read 10k rows @ time (instead of entire file @ once) , iteratively write workbook , database. is there way apache poi? poi contains called "eventmodel" designed purpose. it's mentioned in faq : the ss eventmodel package api reading excel files without loading whole spreadsheet memory. require more knowledge on part of user, reduces memory consumption more tenfold. based on awt event model in combination sax. if need read-only access, best way it. however, may want double check first if issue somewhere else. check out this item : i think poi using memory! can do? 1 comes quite lot, reason isn't might think. so, first thing check - what's source of prob

Spring support for a mock framework? -

i'm new springs , looking support mock framework in springs.i have come across support junit , couldn't find documentation support of mock framework.please provide links. have considered mockito . have used mockito junit , can use mocked spring beans quite @injectmocks , @mock annotations. have go. p.s here few links started. http://lkrnac.net/blog/2014/01/mock-autowired-fields/ 1 uses testng same true junit well. https://ahlearns.wordpress.com/2012/03/02/spring-3-autowired-unit-tests-with-mockito/

Android camera error Failure delivering result ResultInfo -

i'm trying camera work android app keep getting following error 02-07 22:30:48.217 13197-13197/com.example.romsm.lap e/androidruntime: fatal exception: main java.lang.runtimeexception: failure delivering result resultinfo{who=null, request=1, result=-1, data=intent { act=inline-data dat=content://media/external/images/media/8557 (has extras) }} activity {com.example.romsm.lap/com.example.romsm.lap.treequestionsactivity}: java.lang.nullpointerexception @ android.app.activitythread.deliverresults(activitythread.java:3510) @ android.app.activitythread.handlesendresult(activitythread.java:3553) @ android.app.activitythread.access$1200(activitythread

sql - calculate total salary based on employee type -

i want calculate salary each employee foe each month, i have 2 tables , 2 views looks this employees_view | id | name | payrate | payunitcode | commission | |----|-------|---------|-------------|------------| | 1 | james | 10 | c | 0 | | 2 | mike | 10000 | s | 0 | | 3 | jude | 20000 | sc | 5 | | 4 | clara | 8 | c | 0 | jobs | id | created | |----|---------------------| | 1 | 01/21/2016 10:56:05 | | 2 | 01/21/2016 10:56:05 | | 3 | 01/21/2016 10:56:05 | | 4 | 01/21/2016 10:56:05 | | 5 | 01/21/2016 12:11:59 | | 6 | 01/25/2016 08:03:07 | | 7 | 11/01/2015 22:55:22 | job_items_view | job_id | amount | emp_id | |--------|--------|--------| | 1 | 135 | 4 | | 1 | 500 | 2 | | 3 | 1500 | 2 | | 3 | 250 | 4 | | 4 | 1000 | 2 | | 5 | 500 | 4 | | 6 | 500 | 4 | | 7 | 1000 |

xml - Error CODE - UC SEG STATUS NOT ALLOWED -

i trying generate pnr. purpose used “enhancedairbookrq” air book “ota_airbookrq” , “ota_airpricerq” price. the work flow given below. (1) used “bargainfindermaxrq” search (2) used “enhancedairbookrq” air book , price iternary. (3) used “passengerdetailsrq” input passenger details (4) last want end transaction. i tried many things did not able finish successfully. necessary fields missing in “enhancedairbookrq” book , price , how continue “passengerdetailsrq”. //request “enhancedairbookrq” <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap-env:header> <m:messageheader xmlns:m="http://www.ebxml.org/namespaces/messageheader"> <m:from> <m:partyid type="urn:x12.org:

javascript - AngularJS - Pass some flag from html to controller -

i new angular js. stuck, , not find solution. problem - have html code given below : <div ng-controller="mycontroller" ng-model={{tt="a"}}> </div> <div ng-controller="mycontroller" ng-model={{tt="b"}}> </div> <div ng-controller="mycontroller" ng-model={{tt="c"}}> </div> and controller code : myapp.controller('mycontroller', function($scope) { if($scope.tt == "a") //do else if($scope.tt == "b) //do else }) note - html ng-model, wrote let know want. question - want send controller html, can check value , conditionally. this not best practice if want bring data in html angular can stash data property of window inside of <script> tag. var app = angular.module('myapp',[]); app.controller('mainctrl', function($scope){ $scope.tt = window.data; }) <div ng-app='myapp'> <div ng-controller=&

linux - Fast way to check timestamp of files in directory tree -

i need check file structure in directory tree every second, script taking long suspect collecting timestamps , calculating base64 it's name takes time in large directory tree. how can gather tree structure, store them in array, , loop through each file collecting timestamp in array, array key cipher file path? later i'm comparing array older version , adds additional wasted time, improve efficiency. shopt -s globstar dotglob files=("$base"/**) new() { keys=("${!files_new[@]}") in "${keys[@]::2}" unset "files_new[$i]" done file in "${files[@]}" stamp=$(stat -c "%y" "$file") hash=$(echo "$file" | base64) files_new[$hash]=$stamp done } i have achieved faster probing using find command -printf output suggested peter cordes. loop went 3 seconds 300 milliseconds. loop() { while read string stamp=${s

Count of Comma separate values in r -

Image
i have column named subcat_id in values stored comma seperated lists. need count number of values , store counts in new column . lists have null values want arid of. i store counts in n column. we can try nchar(gsub('[^,]+', '', gsub(',(?=,)|(^,|,$)', '', gsub('(null){1,}', '', df1$subcat_id), perl=true)))+1l #[1] 6 4 or library(stringr) str_count(df1$subcat_id, '[0-9.]+') #[1] 6 4 data df1 <- data.frame(subcat_id = c('1,2,3,15,16,78', '1,2,3,15,null,null'), stringsasfactors=false)

NDK Integration with Android Studio -

i'm new in ndk .and try setup integration ndk .but after research through many sites ,i not solved problem. here build.gradle file apply plugin: 'com.android.model.application' model { android { compilesdkversion 23 buildtoolsversion "23.0.2" } android.ndk { modulename "native" } defaultconfig.with { applicationid "app.com.jnitester" minsdkversion.apilevel 15 targetsdkversion.apilevel 23 versioncode 1 versionname "1.0" buildconfigfields { create() { type = "int" name = "value" value = "1" } } } /* android.ndk { modulename = "native" }*/ android.buildtypes { release { minifyenabled false proguardfiles += file('proguard-rules.txt') } } android.productflavors { create("flavor1") { applicationid "com

autohotkey word com obj add multiple tables -

i try create word document 2 tables autohotkey. add 1 table , type text. try create table in same document below old table. oword := comobjcreate("word.application") ; create ms word object document := oword.documents.add ; create new document oword.visible := 1 ; make winword visible range := oword.activedocument.range(0, 0) ; set range oword.activedocument.tables.add(range,1,2) ; add table in range oword.selection.tables(1).style := "table grid" ; set style oword.selection.tables(1).cell(1,2).range.select ; select cell oword.selection.typetext("hi hi") ; type text in selected cell oword.selection.endkey ; here couldn't able create new table oword.selection.typeparagraph range := oword.activedocument.range(0, 0) oword.activedocument.tables.add(range,10,5) oword.selection.tables(1).style := "table grid" oword.selection.tables(1).cell(1,3).range.select ;

ios - icarousel Vertical Scroll Effect on tableview with images -

i trying apply icarousel vertical type effect on tableview cell images. not set vertical scroll effect. check this, https://github.com/nicklockwood/icarousel in example set horizontal scroll effect. , want set vertical type effect. , suggest me demo link or proper code solution. this code ... - (catransform3d)carousel:(icarousel *)carousel itemtransformforoffset:(cgfloat)offset basetransform:(catransform3d)transform { const cgfloat centeritemzoom = 1.6; const cgfloat centeritemspacing = 1.5; cgfloat spacing = [self carousel:carousel valueforoption:icarouseloptionspacing withdefault:1.0f]; cgfloat absclampedoffset = min(1.0, fabs(offset)); cgfloat clampedoffset = min(1.0, max(-1.0, offset)); cgfloat scalefactor = 1.0 + absclampedoffset * (1.0/centeritemzoom - 1.0); offset = (scalefactor * offset + scalefactor * (centeritemspacing - 1.0) * clampedoffset) * carousel.itemwidth * spacing; if (carousel.vertical) { transform = catransfor

sml - Multiple input types with fold -

i trying figure out how implement fold functions on inputs of differing types. sample, i'll use count function list (though, have multiple functions implement this). assuming int list input (this should work type of list, though), count function be val count = foldr (fn(x:int,y)=>y+1) 0 ; val count = fn : int list -> int however, attempting make count function type val count = fn : int list * bool list -> int where int list universe of set, , bool determines values of universe in set. ie, (1,3,5,6),(true,false,false,true) results in final set of (1,6), have count of 2. first thought try form of val count= foldr (fn(x:(int*bool),y)=>if #2x y+1 else y ) 0 ; but results in return type of val count = fn : (int * bool) list -> int which not quite need. logically, similar, expected group 2 types in 1 list each. you use listpair.foldl : fun count (xs, bs) = listpair.foldl (fn (x, b, acc) => ...) ... (xs, bs) where first ... combination

wordpress - How to create Woocoomerce order query with product name? -

hi need orders belongs or contain product. ie if product1 product name need orders in loop contain product . order detail use following query $args = array( 'post_type' => 'shop_order', 'post_status' => 'publish' ); $loop=new wp_query($args); while($loop->have_posts()): $loop->the_post(); $order_id=get_the_id(); $order = new wc_order($order_id); ..details fetched query .. endwhile ; to item details can use $order->get_items(); want to (1) best method fetch order details in loop ? (2)how fetch orders belongs product1 [where product1 product name ] .? is know ,please . for first question yes need think on it, second question can use following, <?php global $wpdb; $produto_id = 22777; // id produto $consulta = "select order_id {$wpdb-&

linux - Share futex between unrelated processes -

how can unrelated processes cooperate using futex? let's have unrelated processes, 1 being, say, apache subprocess module, being e.g. background script. i'd establish condition variable mutex between 2 using futex, benefit user-space fast code path. it seems me memory @ mutex stored in mmap 'd file, if memory mapped, e.g. mlock 'd 2 processes theoretically issue futex calls against same address. alternatively, perhaps futex can passed 1 process using futex_fd . code submissions low-, high-level , dynamic languages accepted (c, c++, python, etc.). "robust futex" api must supported too. references: https://www.kernel.org/doc/documentation/robust-futexes.txt http://locklessinc.com/articles/mutex_cv_futex/ thanks phillip , felix m. pointers. python user code (file data structures exists, initialised pthread_process_shared ) with open("/tmp/semaphore", "rb+") f: m = mmap.mmap(f.fileno(), 0) # default: fil

r - Creating bivariate normal distribution ellipse on plot that has log-transformed x and y axis -

Image
although have found many answers on how draw bivariate normal distribution ellipse on existing plot, have question regarding plotting ellipse onto existing plot x- , y-axis log-transformed. as example have following data add ellipse library(mixtools) library(truncnorm) x<-rtruncnorm(n=100, a=0, b=20) y=1+.3*x+.3*rnorm(100) data<-cbind(x,y) mu <-c(mean(x), mean(y)) sigma <- var(data) plot(data) ellipse(mu, sigma, alpha=0.1, npoints = 200, newplot = false) however, actual data requires use log transformed x- , y-axis, so plot(data,log="xy") when plotting "ellipse" function, no longer ellipse ellipse(mu, sigma, alpha=0.1, npoints = 200, newplot = false) adding "log" ellipse function specifications no option ellipse(mu, sigma, alpha=0.1, npoints = 200, newplot = false,log="xy") warning message: in plot.xy(xy.coords(x, y), type = type, ...) : "log" not graphical parameter. can me out one? tha

How to configure NHibernate with SignalR -

i want configure nhibernate once , reuse session factory open different sessions manipulate database, hubs considered transient objects , loose object state when client initializing request hub. way far have read make objects static in order reuse it. is there other way of achieving without making objects static ? myconfiguration = new configuration(); myconfiguration.configure(); mysessionfactory = myconfiguration.buildsessionfactory(); mysession = mysessionfactory.opensession(); thank in advance :) there nothing wrong having configuration , sessionfactory objects stored in static fields. sessions should not shared. an alternative use di container , register them singletons.

joomla - is Jcron for Java scheduling? -

i have been searching through entire internet sometime , not able understand whether jcron api java scheduling or specific joomla cms ? if can used java can share links of example. thanks in advance from jcron web page : jcron scheduler joomla component cron jobs management , scheduling! it's purpose simulate cron jobs through joomla front end interface @ preset periods of time users either don't have access server crontab or don't want use purpose! it belongs joomla world, , has nothing java. if looking cron scheduling in java should check cron4j .