Posts

netlogo - How to stop two breeds of turtles from repeating the same command? -

this first time posting, criticism appreciated! started netlogo recently, , have move way model working on. model suppose evaluate farmers join a) ecommerce or b) traditional means. both, ecommerce , traditional commerce increase farmers' wellbeing differently. ideally, these 2 breeds of turtles join ecommerce or traditional commerce. turtles joined ecommerce evaluate if wellbeing better off once joined ecommerce. if not, traditional commerce turtle , join it. turtles went traditional commerce should decide join ecommerce if there other turtles using ecommerce in proximity. still don't have part of code since stuck on one. unfortunately, part of code: set wellbeing wellbeing + traditional-wellbeing-value makes turtles' wellbeing increase every tick on time. looking way prevent turtles increasing wellbeing on , on again. then, have each turtle evaluate current wellbeing , decide move if needed. below code i've come far: globals [ area max-farmers max-patche...

netduino - vistual studio 2017 from mac not install .net mf sdk 4.3 -

netduino mac vistual studio 2017 mac, plugin version 0.6.1 build output: netmf_test/netmf_test/netmf_test.csproj(3,3): error msb4019: imported project "/library/frameworks/mono.framework/versions/5.2.0/lib/mono/xbuild/microsoft/.net micro framework/v4.3/csharp.targets" not found. confirm path in declaration correct, , file exists on disk. (msb4019) (netmf_test) thank's!

javascript - Getting Attribute from Table Cell into Script -

i'm generating html table contains rows one: i've been able id , trackingnumber value, i'm trying data-categoryname-id value , i'm stumped. here's script: $("input[type='text']").change(function() { var parent = $(this).parents('tr'); var recid = $(this).closest('td').attr('id'); var trackingnumber = $(this).val(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <tr id="53462365"> <td>jb44566</td> <td>sku123</td> <td>carton paper a4</td> <td>paper</td> <td></td> <td>966257111</td> <td></td> <td id="53462365"><input type="text" class="form-control" placeholder="tracking #" name="trackingnumber" data-categoryname-id="office supplies" autocom...

How to raise frequency of sounds - javascript -

i trying raise frequency of every node in sound. have tried many ways. here small code work, it's not working. please help. in advance. <script src="./wad.js"></script> <script src="./tuna.js"></script> <script> var countaudio = 1; var voice = new wad({source : 'mic'}); var tuner = new wad.poly(); tuner.add(voice); voice.play({volume : 1}); logpitch(); function logpitch() { tuner.updatepitch() localstorage.setitem(countaudio, tuner.pitch) countaudio = countaudio + 1; if (countaudio < 1000) { settimeout(logpitch, 5) } else { tuner.stopupdatingpitch() voice.stop() highvoice(countaudio) } }; = 1; var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); function playnote(frequency, duration) { var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.value = frequency; // value in hertz oscillator.connect(audioctx.destinati...

java - Android Rename File using Google Drive REST API v3? -

how rename file using google drive rest api on android? have searched internet could, can't find how this. i trying write sync method moves , renames cloud files if detects local copy has been moved or renamed: void syncmetadataonly (com.google.api.services.drive.model.file cloud, java.io.file local) throws ioexception { workspace.finf fileinfo = workspace.getfileinfo (this, local); // metadata object. map<string, string> appproperties = cloud.getappproperties (); // keep track of last rename , move in our private app properties: long cloudlastrename = appproperties.containskey ("last-rename") ? long.valueof (appproperties.get ("last-rename")) : 0; long cloudlastmove = appproperties.containskey ("last-move") ? long.valueof (appproperties.get ("last-move")) : 0; boolean needupdate = false; boolean needn...

use of fft, ifft and fftshift in matlab -

i trying implement split-step fourier method solve nonlinear schrodinger equation in optics. treats linear part , nonlinear part separately. solves linear part using fourier transform , nonlinear part in time domain. the following code copied book: alpha = 0 beta_2 = 1 gamma = 1 t = linspace(-5,5,2^13); delta_t = t(2)-t(1); l = max(size(a)); delta_omega = 1/l/delta_t*2*pi; omega = (-l/2:1:l/2-1)*delta_omega; = 2*sech(t); a_t = a; step_num = 1000; h = 0.5*pi/step_num; results = zeros(l,step_num); a_f = fftshift(fft(a_t)); n=1:step_num a_f = a_f.*exp(-alpha*(h/2)-1i*beta_2/2*omega.^2*(h/2)); a_t = ifft(a_f); a_t = a_t.*exp(1i*gamma*(abs(a_t).^2*h)); a_f = fft(a_t); a_f = a_f.*exp(-alpha*(h/2)-1i*beta_2/2*omega.^2*(h/2)); a_t = ifft(a_f); results(:,n) = abs(a_t); end where a_t pulse (the function solved). don't understand in beginning uses fftshift shift 0 frequency center, later in loop doesn't have fftshift . tried adding fftshift ma...

java - Sqoop 1.99.7 Installation on Centos 7 -

i new hadoop eco system. i in process of setting hadoop eco system on single node. hadoop system been setup , working fine along hbase , hive. to connect external sources of data, setting sqoop 1.99.7 server. finding difficult setup, documentation creating sort of confusion. can 1 me step step process... steps done me far .. java 1.7 version - available hadoop common - been setup , verified downloaded , installed sqoop version 1.99.7 configured ~/.bashrc file export sqoop_home=/usr/lib/sqoop export path=$path:$sqoop_home/bin source bashrc file now not clear, per documentation provided, on , stuck here last 1 day... 1. creating third party jars - have created directory /var/lib/sqoop2 using mkdir -p /var/lib/sqoop2 (creation did not give error , unable locate directory) hence copy mysql-jdbc* files, postgresql-jdbc not done. unable locate mysl-jdbc* files in server path 2. presume no action required configure sqoop_boot starp. properties , sqoop.properties ...