Posts

Showing posts from January, 2010

ios - SDWebImage starts to load too late -

in cellforrowatindexpath , using following function inside dequeresuablecell update image in cell let imagensurl = nsurl(string: post.imageurl) let placeholderimage = uiimage(named: "loadingplaceholder")! postimageview.sd_setimagewithurl(imagensurl, placeholderimage: placeholderimage, options: [], progress: { (bytesent: int, byteexpectedtosend: int) in // progress }, completed: { (image: uiimage!, error: nserror!, imagecachetype: sdimagecachetype, url: nsurl!) in if error != nil { print("error \(error.localizeddescription)") } else { // image download complete } }) however, every time cell "just appear", see glimpse of placeholder image. seems sdwebimage sdk starts downloading image close when cell appears on screen. wondering if else experiencing or knows how fixed? ----update---- in response comments i thought cellforrowatindexpath called

php - Failed to send message -

i have problem on sending message email list(text file). code: <?php $to="emails.txt"; $subject="hey"; $txt="hello..."; mail($to,$subject,$txt); ?> i not have syntax errors.... msg not sent emails list , proplem here please advice , if have txt file every email address in new line, can make this: $file = fopen("file.txt", "r"); $subject="hey"; $txt="hello..."; while(!feof($file)){ $to = fgets($file); mail($to,$subject,$txt); } fclose($file);

java - Hibernate- failed to lazily initialize a collection of role: beans.Language.patients, could not initialize proxy - no Session -

i use hibernate create rest api. create method items in table. public list<language> getalllanguages(session session) { list<language> languages=(list<language>)session.createquery("from language").list(); return languages; } this language.java public class language implements java.io.serializable { private integer idlanguage; private string language; private set<patient> patients = new hashset<patient>(0); public language() { } public language(string language) { this.language = language; } public language(string language, set<patient> patients) { this.language = language; this.patients = patients; } public integer getidlanguage() { return this.idlanguage; } public void setidlanguage(integer idlanguage) { this.idlanguage = idlanguage; } public string getlanguage() { return this.language; } publi

angularjs - angular ui select prevent model removing -

i'm trying prevent item removed in case if backspace or delete pressed. thing user can remove current element in ui-select if ui-select got focus , user pressed backspace or delete button. prevent scenario. 1 know how this? seems lement can not out of box. thanks. upd unfortunately can't post code because there nothing spetial in case. if 1 want try behavious exmple go here , select thing in select 2 theme , press backspace or delete.

F# Creating function for comparing two lists containing lists -

i'm trying create program allows user check if person interested in going arrangement. have types type interestlist = { interest : string; } type description = { name : string; phone : int birthdate : int interests : list<interestlist> } type register = { regid : list<description> } type arrangement = { year : int arrinterests : list<interestlist> } if use register containing people i'd check let reg = [ ("steven", 11111111, 1991, (["soccer", "flowers", "jazz"])) ("carl", 22222222, 1842, (["animals", "shopping", "soccer"])) ("karen", 33333333, 2005, (["animals", "volleyball", "jazz"])) ];; and have 2 arrangements let p1 = [ (1982, (["soccer", "jazz"]))

c# - Error: 'device not Configured' when Sending Email in .NetCoreApp V1.0 using Mailkit -

i'm developing asp .net core application using vs code on mac. researched on how send email since system.net.mail not supported, came across mailkit. added following dependencies json file: mailkit v1.6.0 , mimekit v1.6.0. but error on: var certificate = new x509certificate2 (@"c:\path\to\certificate.p12", "password", x509keystorageflags.exportable); var credential = new serviceaccountcredential (new serviceaccountcredential .initializer ("your-developer-id@developer.gserviceaccount.com") { scopes = new[] { "https://mail.google.com/" }, user = "username@gmail.com" }.fromcertificate (certificate)); using (var client = new smtpclient()) { client.connect("smtp.gmail.com", 587); // error occurs here. client.authenticate ("mymail@gmail.com", credential.token.accesstoken); client.send(message); client.disconnect(true); } i searched solution online couldn't find anything. has ever

http - Uploading File using Advanced Rest Client Google Chrome Api -

i'm trying work advanced rest client. have configured settings follows. http://postimg.org/image/bmfeus19l/ as may see in image creates file in container desired. file when opened contains original text , foreign text show below. ------webkitformboundaryqljkbuyuxttziqka content-disposition: form-data; name="note1s"; filename="note1.txt" content-type: text/plain test file , uploaded... test file , uploaded... test file , uploaded... ------webkitformboundaryqljkbuyuxttziqka-- please me, new using tool. appreciate in advance. i've faced same problem , opened issue . this not answer but guess should consider using postman . i've tried 1 , works fine... check out how to: tool sending multipart/form-data request [closed]

Azure Portal Error: Failed to start virtual machine 'xxxx'. Error: The Key Vault secret referenced with the URL 'xxxx' does not exist -

Image
i have deleted key vaults resource manager after assuming not used anywhere in configuration , leftovers testing. can't start virtual machines , error message appears. failed start virtual machine 'xxxx'. error: key vault secret referenced url 'xxxx' not exist. could please advise me how put virtual machines on track since can't afford time building them again? thanks lot. i suggest re-creating vm existing vhd file. i reproduce same error in lab. when try re-upload certificate, find guid of certificate has been changed. need edit configuration of vm. then find "windowsconfiguration.winrm.listeners" property can not changed if vm has been deployed. therefore, in conclusion, may need recreate vm same vhd file.

regex - Awk/ Perl regular expression to match space with hyphen -

i have following 2 lines in sample.txt aia - 1000 aia integrations e-business suite - 5544 now want see following output: column1 | column2 aia 1000 aia integrations e-business suite 5544 i tried: awk -f "-" sample.txt it filters hyphen "-" near "e-business suite" how make filter last hyphen instead of intermediate ones. you can use: awk -f ' - ' -v ofs=';' 'begin{print "column1", "column2"} {print $1, $2}' file | column -s ';' -t column1 column2 aia 1000 aia integrations e-business suite 5544 -f ' - ' uses " - " input field separator -v ofs=';' uses ; output field separator column -s ';' -t formats data in tabular format using ; delimiter

python - rpy2 unable to load shared object when import package of stats from R -

operation system: windows xp python version: 3.4.3 r version: 3.3.0 rpy2 version: 2.7.8 http://www.lfd.uci.edu/~gohlke/pythonlibs/ picture of running message as showed in picture, rpy2 package has been installed , packages of r, base, tools, can imported. however, stats package can not described errors message. does have point this? lot.

php - Is it possible to rollback function action in CodeIgniter -

suppose wan't insert data 2 different tables, in codeigniter, for example : insert userprofile table: name , mail (get id , use in next table) insert employees table : userprofile_id, shifts , position. up now, working good, can if want commit action if both insertions commited...how can rollback in case first insertion went , don't want empty profile.... problem once first insertion committed ,suppose went wrong in next insertion - data 1 table... ideas? see transactions in codeigniter. syntax(given in document well): $this->db->trans_begin(); $this->db->query('an sql query...'); $this->db->query('another query...'); $this->db->query('and yet query...'); if ($this->db->trans_status() === false) { $this->db->trans_rollback(); } else { $this->db->trans_commit(); } make sure use $this->db->trans_begin() when running manual transactions, not $this->db-

PHP Murmurhash3 and MySql Murmurhash3 sometimes don't match -

i'm using murmurhash3 create unique hashes text entries. when text entries created, i'm using this php implementation , returns 32 bit hash integer, hash value. hash stored in binary(16) database column. need update our existing database i'm using this mysql implementation update database. in order match php created hash, i'm base converting , lower-casing it. update column set hash=lower(conv(murmur_hash_v3(concat(column1, column2), 0), 10, 32)); it matches php version 80% of time, isn't going cut it. example, hashing string 'engtest' creates 15d15m in php , 3uqiuqa in mysql. however, string 'engtest sentence' creates same hash in both. doing wrong? figured out. php's integer type signed , murmurhash producing negative hash values didnt match positive mysql values. solution format php's hash value using sprintf format set "%u" before base conversion. $hash = murmurhash3_int($text); return base_convert(sprintf

javascript - How to make the distance from nodes in d3.js force layout larger? -

i trying represent data d3js force layout. have following code: <script> var svg = d3.select("svg"), width = +svg.attr("width"), height = +svg.attr("height"); var color = d3.scaleordinal(d3.schemecategory20); var simulation = d3.forcesimulation() .force("link", d3.forcelink().id(function(d) { return d.id; })) .force("charge", d3.forcemanybody()) .force("center", d3.forcecenter(width / 2, height / 2)); var jsondata = json.parse(data); var totalamount=jsondata.total; d3.json("mydata.json", function(error, graph) { if (error) throw error; var nodes = json.nodes; var link = svg.append("g") .attr("class", "links") .selectall("line") .data(graph.links) .enter().append("line") //.attr("stroke-width", function(d) { return math.sqrt(d.value); }); .attr("stroke-wi

Gitlab - Build docker images from within docker shared runner -

trying build docker image withing shared runner, below ci configuration image: osrg/dind-ubuntu-vivid services: - docker:dind stages: - build - test - release variables: container_test_image: registry.gitlab.com/somasundaramsekar/ci-test:$ci_build_ref_name container_release_image: registry.gitlab.com/somasundaramsekar/ci-test:latest before_script: - apt-get update -y >/dev/null 2>&1 - apt-get install -y --fix-missing software-properties-common python-software-properties >/dev/null 2>&1 - apt-get update -y >/dev/null 2>&1 - apt-get install -y openjdk-8-jdk >/dev/null 2>&1 - apt-get install apt-transport-https -y >/dev/null 2>&1 - wget www.scala-lang.org/files/archive/scala-2.11.7.deb >/dev/null 2>&1 - dpkg -i scala-2.11.7.deb >/dev/null 2>&1 - scala -version - echo "deb https://dl.bintray.com/sbt/debian /" | tee -a /etc/apt/sources.list.d/sbt.list - apt-key adv

swift - How to change text of navigation bar (UISearchController)? -

Image
i have created navigation bar uisearchcontroller . below code: @ibaction func showsearchcontroller(sender: anyobject) { let searchcontroller = uisearchcontroller(searchresultscontroller: searchresultcontroller) searchcontroller.searchbar.delegate = self /* searchcontroller.searchbar.placeholder = "hhhhhhhhhhh" searchcontroller.navigationitem.title = "hhhhhhhhhhh" searchcontroller.navigationcontroller?.navigationbar.topitem?.title = "hhhhhhhh" -->i try these codes change*/ self.presentviewcontroller(searchcontroller, animated: true, completion: nil) } but can't change text. var searchtextfield = searchcontroller.searchbar.valueforkey("_searchfield") as! uitextfield searchtextfield.placeholder = "your custom text" use change place holder text

python - Error: django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet -

i'm trying write importer csv file. here minimal example csv_filepathname="/home/thomas/downloads/zip.csv" your_djangoproject_home="~/desktop/projects/myproject/myproject/" import sys,os,csv sys.path.append(your_djangoproject_home) os.environ['django_settings_module'] = 'settings' django.db.models.fields.related import manytomanyfield myapp.models import zipcode,state datareader = csv.reader(open(csv_filepathname), delimiter=',', quotechar='"') def import_so(item, crit,val): debug = 1; obj_state=type(item).objects.filter(crit=val) <...some other stuff...> return row in datareader: st=state(statecode=row[2],statename=row[3]) import_so(st,"statename",row[3]) and here model class state(models.model): statecode = models.charfield(max_length=2, default='xx') statename = models.charfield(max_length=32, default='xxxxxxxxxxxxx') when execute

mysql - Stored Procedure not visible in MAMP -

im facing weird problem trying resolve since last couple of hours, i have created database via migrations in laravel 5.2, when trying create stored procedure migration runs migration when try view stored procedure in phpmyadmin under routines says "there no routines display" , when try run migration again gives me error routine name exists. then tried manually create stored procedure through phpmyadmin, when press go shows me procedure has been created, when try view procedure under routines again says "there no routines display" , if try create same stored procedure via phpmyadmin shows me same error routine name exists. to see if stored procedure ever gets created exported database there no sign of procedure in .sql file, not know why shows me error stored procedure exists.

r - predicted values for glmer AICcmodavg -

i know 1 can predicted values (in original scale ~ probability) , se fixed effects aiccmodavg, i'm trying without success... can me that? in advance library(lme4) (gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial)) fixef(gm1) library("aiccmodavg") predictse(gm1, newdata=as.data.frame(period=c("period1","period2","period3","period4")), type="response", se.fit=true, level=0, print.matrix=f) it better read levels(cbpp$period) , , not as.data.frame() data.frame() levels(cbpp$period) # [1] "1" "2" "3" "4" predictse(gm1, newdata = data.frame(period=c("1", "2", "3", "4")), type = "response", se.fit = true, level = 0, print.matrix = f) [edited

sql - How to select top N salaries for each person? -

i have table user_id salary month 1 100 1 1 150 2 1 200 3 1 180 4 1 140 5 2 10 1 2 40 2 2 20 3 2 15 4 2 45 5 i want select top 2 salaries each people. i try understand cross apply. looks invented task conform cross apply. now have following query select distinct(s.user_id) salary s cross apply ( select top 2 * salary sal order sal.salary desc )sal look enough far expected result. expected result: 1 180 1 200 2 40 2 45 you can use outer apply top 2: select distinct y.[user_id], d.salary, d.[month] yourtable y outer apply( select top 2 * yourtable y.[user_id] = [user_id] order [user_id], salary desc ) d order [user_id], salary desc will return: user_id salary month 1 200 3 1 180 4 2 45 5 2 40 2 another way: ;with cte ( sele

angularjs - HTML Page Select All Angular issue or NWJS issue? -

i have issue navigate around html angular app, when page renders renders on page "selected". i using latest angular 1.x version, along angular material (latest). should add running in nwjs 0.12, factor i have yet identify exact behavior pattern makes occur, enough annoying users. let selector = document.queryselectorall("h1"); for(let = 0; < selector.length; i++){ let ng = selector[i].getattribute("ng-model"); if(ng != null){ console.log(selector[i].classlist.add("selected")) } } .selected{ background: skyblue; display: block; } <h1>20% cooler</h1> <h1 ng-model="cooler">20% cooler</h1> <h1 ng-model="cuteoctocat">githubr</h1>

php - How to test the order of parameters passed to an object constructed by a method -

i'm testing simple factory class single method returns tagmodel . class tagfactory { public function buildfromarray(array $tagdata) { return new tagmodel( $tagdata['t_id'], $tagdata['t_promotion_id'], $tagdata['t_type_id'], $tagdata['t_value'] ); } } i can test method… public function testbuildfromarray() { $tagdata = [ 't_id' => 1, 't_promotion_id' => 2, 't_type_id' => 3, 't_value' => 'you valued', ]; $tagfactory = new tagfactory(); $result = $tagfactory->buildfromarray($tagdata); $this->assertinstanceof(tagmodel::class, $result); } if change order of parameters in new tagmodel… test still pass. if prophesize tagmodel … $tagmodel = $this->prophesize(tagmodel::class); $tagmodel->willbeconstructedwith( [ $tagdata['

json - JavaScript - XMLHttpRequest overrideMimeType in IE -

take code: let jsonrequest = new xmlhttprequest(); jsonrequest.overridemimetype("application/json"); jsonrequest.open('get', './js/settings.json', true); ie doesn't support overridemimetype , , html has been set utf-8 . there risk leaving overridemimetype line out? seems work fine without it. this question has pretty same issue, answer isn't clear. ie started supporting mime-type overriding v11. never necessary in practice, discussed on other post you've linked. from security point, concerned - answer no. not using can't impose security issue, using alone won't make better secure. if you're concerned response validity, example - if it's valid json before parsing , using, there better choice of using getresponseheader method, facilitate aborting request in case of invalid header headers arrived; see https://developer.mozilla.org/en-us/docs/web/api/xmlhttprequest/getresponseheader

AFNetwoking with swift 3.0 & xcode 8 : POST Request & GET Request -

Image
i trying parse data using afnetworking & swift 3.0 , xcode 8.0 getting error below.below code works fine swift 2.3 not working in 3.0 or if there know afnetworking & swift 3.0 using xcode 8.0 post & request please tell me. simple example. in advance you can see below error. func callapi(apiname: string, param: [string : anyobject]?, data: nsdictionary?, withmethod type: string, completionhandler:@escaping (_ code: int, _ error:nserror?, _ response:anyobject?) -> void) { mbprogresshud.showadded(to: appdelegateobj.window, animated: true) let str_url : string = khostpath+apiname let manager: afhttpsessionmanager = afhttpsessionmanager() if (type == kreq_post) { manager.post(str_url, parameters: param, constructingbodywithblock: { (formdata: afmultipartformdata!) in if data?.allvalues.count != 0 && data != nil { let fileurl = nsurl(fileurlwithpath:

sql - The fastest way to fill table using data from other tables -

i've read conception behind functional programing , makes me reconsider way of doing things. for example, there table: - client, date, trial, full - client1, 14.11.2012, 1, 1 - client1, 06.02.2013, null, 1 - client1, 27.03.2013, null, 1 - client1, 15.05.2013, null, 1 the table contains millions records , half million clients. goal transform data status of client: - client, date, status - client1, 14.11.2012, 'mixed' - client1, 01.12.2012, 'unprocessed' - client1, 01.01.2012, 'unprocessed' - client1, 13.01.2013, 'slept' - client1, 01.02.2013, 'slept' - client1, 06.02.2013, 'processed' - client1, 01.03.2013, 'unprocessed' - client1, 27.03.2013, 'processed' - client1, 01.04.2013, 'unprocessed' - client1, 01.05.2013, 'unprocessed' - client1, 15.05.2013, 'processed' - client1, 01.06.2013, 'unprocessed' - client1, 01.07.2013, 'unprocessed' - client1, 23.

boolean - Using True False with Ansible When Clause -

i'm running silliest issue. cannot figure out how test boolean in ansible 2.2 task file. in vars/main.yml , have: destroy: false in playbook, have: roles: - {'role': 'vmdeploy','destroy': true} in task file, have following: - include: "create.yml" when: "{{ destroy|bool }} == 'false'" i've tried various combinations below: when: "{{ destroy|bool }} == false" when: "{{ destroy|bool }} == 'false'" when: "{{ destroy|bool == false}}" when: "{{ destroy == false}}" when: "{{ destroy == 'false'}}" when: destroy|bool == false when: destroy|bool == 'false' when: not destroy|bool in above cases, still get: statically included: .../vmdeploy/tasks/create.yml debug output: - debug: msg: "{{ destroy }}" --- ok: [atlcicd009] => { "msg": true } the desired result, skip include. to run task

Extend maatwebsite package method in laravel -

i'm using maatwebsite package data import, want extend setitem() method of cellcollection class of package. don't know how it. till i've tried is: created serviceprovider importserviceprovider in service folder inside app. in importserviceprovider's register() method defined function public function setitems($items) { foreach ($items $name => $value) { $value = !empty($value) || is_numeric($value) ? $value $config=config::get('excel.import.empty_cell'); if ($name) { $this->put($name, $value); } else { $this->push($value); } } } but not succeed.

ios - UITableView lags when implementing infinite scrolling -

Image
my table scrolls smoothly when data has been loaded on screen , not loading more, however, trying figure why table lags when new data loaded onto table approximately 0.5 sec. have performed time profiler hoping see blocking main thread when more data loaded. the time profiler indicated main thread took 399ms whilst other function implemented took 49ms in total. leaves me no clue hunt down cause of lag. why time profile give me 399ms on main function instead of giving me call tree how 399ms came about? i wondering if there way track down cause of lag while loading more data?

javascript - How to count the number of certain element in an array? -

if have array [1, 2, 3, 5, 2, 8, 9, 2] , check how many 2 s there in array. elegant way in javascript without looping for loop? very simple: var count = 0; for(var = 0; < array.length; ++i){ if(array[i] == 2) count++; }

Finding minimum distance between two raster layer pixels in R -

i have 2 thematic raster layers r1 , r2 same area each following same classification scheme , has 16 classes. need find minimum distance between cell of r1 , cell of r2 same value. e.g. nth cell in r1 has value 10 , coordinates x1,y1 . , in r2 , there 2 cells value 10 , coordinates x1+2,y1+2 , x1-0.5,y1-0.5 . value need cell 0.5,0.5. i tried distance raster package gives distance, cells na, nearest cell not na. confused how can include second raster layer this. so, use rastertopoints extract spatialpoints object unique thematic class. use sp::spdists function find distance between points. library(raster) r1 <- raster( nrow=10,ncol=10) r2 <- raster( nrow=10,ncol=10) set.seed(1) r1[] <- ceiling(runif(100,0,10)) r2[] <- ceiling(runif(100,0,10)) dist.class <- null for(i in unique(values(r1))){ p1 <- rastertopoints(r1, fun=function(xx) xx==i, spatial=t) p2 <- rastertopoints(r2, fun=function(xx) xx==i, spatial=t) dist.class[i] <- min(spdi

javascript - Search Firebase for Child -

i building url shortener in node.js , firebase , functioning @ moment if shorten url , gets shortened again uses link. here data in firebase looks like: database --> (short link) --> (long url) --> (views) --> q0 --> http://google.co.uk/ --> 10 --> g7 --> http://google.co.uk/ --> 3 i when makes new link checks existing entry. i'm not sure if in-efficient or not. i'm not sure how go around doing grateful help. fetch long url each of entries , check them new 1 being created. when adding shortened url can check see if exists: dbref.once("value", function(snap) { snap.foreach(function(shortlink) { //let's field "long url" called "longlink" if(newurl === shortlink.val().longlink) { return true; //cancel loop, newurl in db } }); }); you can add flag indicates whether duplicate found or not, , add url db if nothing found based o

How to use PowerShell to batch call Update-Database -

we use azure elastic pool resulting in multiple client databases , 1 master database references client database. we have multiple databases , working on new version of code. use ef6 code-first. when make change our model (add property) create migration file , need call update-database existing client databases. monkey work want skip. i have powershell script connect master database , execute query on table. returns names of child databases. can change web.config , replace template database name proper name of child database. now need call update-database execute migration scripts. last part i'm struggling because i'm running ps1-script outside visual studio , command update-database unknown. tried using migrate.exe lots of errors. i think easiest solution run script within package manager console can't figure out how that. you may want take @ azure elastic database jobs . designed work elastic database pools. the elastic database jobs sdk include

lucene - Search by exact words in a phrase using Umbraco Examine -

i have description field per content , are: for content1 : the quick brown fox jumps on lazy dog. , lazy dog good.   for content2 : the lazy fog crazy. now, when use keyword = lazy dog , want give result content1 , not content2 i tried like: basesearchprovider searcher = examinemanager.instance.searchprovidercollection["mysearch"]; isearchcriteria criteria = searcher.createsearchcriteria() .groupedand( new list<string> { "description" }, "lazy dog") ) .compile(); isearchresults result = searcher.search( criteria ); but didn't gave me desired results, give me results: content1 , content2 . what should in order content1 result ? by default examine compiling query to: +(+description:lazy dog) and based on it's returning results both: lazy , dog words. what want achieve is: +(+description:"lazy dog") first of need try escape phrase. in case be:

android - Unable to get DatabaseReference and FIrebaseAuth currentUser on a remote(separate from main thread) process -

i want create separate process receive , update firebase database using separate process keep running application(main thread) stopped or killed. returns me exception below. error 09-22 22:39:02.229 1669-1669/com.tradesomev4.tradesomev4:remote e/androidruntime: fatal exception: main process: com.tradesomev4.tradesomev4:remote, pid: 1669 java.lang.runtimeexception: unable create service com.tradesomev4.tradesomev4.m_helpers.locationservice: java.lang.illegalstateexception: firebaseapp name [default] doesn't exist. @ android.app.activitythread.handlecreateservice(activitythread.java:3005) @ android.app.activitythread.access$1800(activitythread.java:178)

php - Slim Framework Optional Params Routes -

i'm new php , i'm using slim framework develop simple rest api. according docs, slim uses fastroute . i have route optional params (vendor , quantity) that: path/items/{id}/{name}/{price}[/{vendor}[/{quantity}]] the problem if leave vendor blank value of quantity goes vendor , quantity not filled. understand fast routes can't achieve that. but, how can it? can fast routes? can slim? is there framework can achieve want? should use query strings? (i think answer, need more knowledge). thank you. if going have optional parameters, of same types , can sent in order, either use query strings, or have fixed format add 0 instead of omitting it. example "vendor" isn't set: /10/somename/15/0/12 then parameters aren't optional in url/route can handle in controller instead, ignoring them if param zero.

bash - Need help achieve a file viewing script -

i need make bash script file viewing. i have files 30 minute, automatic ranges in folders named date ex: /data/ operator/20160515/exploit/ /data/ operator/20160516/exploit/ /data/ operator/20160517/exploit/ /data/operator/20160518/prod/ /data/operator/20160518/prod/ /data/operator/20160518/prod/ each folder contains files of day in format "datehour-toto.tz" in script type eg "send.sh 201605151530 201605171300" automatically list files between these 2 dates in ls example ? i not know start because made me tough air achieve? because takes every file checker in 2 dates , times i found might start, not know how tell exploit subdirectory directory="data/" find ${directory} -type f | awk -vstart=$1 -vstop=$2 ' { t = substr($0, length("'${directory}'")+10, 12) } t > start && t < stop { print }' ./send.sh 201508190810 201508190900 data/20150819/201508190821-toto.tz data/20150819/201508190823-toto.tz dat

windows - View requests between Comm server and client? -

is there anyway view actual content of request sent between client , service? know server uuid , process id , able view requests client makes corresponding various client side actions. i thought 2 communicated via http, i've been trying view info using wireshark , haven't found relation between requests made on client side , caught wireshark. suggestions or reading material appreciated, i'm new this.

python - How to install psycopg2 for django on mac -

i have postgresql installed (with postgresql app). when try "pip install psycopg2", "unable execute gcc-4.2: no such file or directory. how fix? you need xcode compile gcc on macos. install command in terminal: xcode-select --install or cold install app store.

ios10 - iOS 10 Simulator LayerKit connection failed -

Image
after moving latest mac os sierra , xcode 8, layerkit(version 0.22.0) stop working on simulator. return error: error domain=com.layer.layerkit.security code=-34018 "generation of key pair failed result code -34018." userinfo={nslocalizeddescription=generation of key pair failed result code -34018., parameters={ atag = <63657274 732d7472 75737465 642e6c79 72382e6e 65743a43 46363431 3046342d 42383546 2d313145 342d4134 42452d34 37424235 46303235 444534>; bsiz = 1024; pdmn = ck; perm = 1; type = 42; }} does have same problem? enable "keychain sharing" fix issue. thread https://forums.developer.apple.com/thread/60617

python - Random Odd Numbers -

my professor gave our first assignment (cs315), involves dealing huge (odd) integers , determining if prime. started in c++ until realized long long ints not hold numbers needed, left choices of making class of vectors in c++, or learning python in few days. simple piece of python code supposed spit out odd 256 bit random number. spits out random numbers, both , odd, , don't know why, guess is simple syntactical error not seeing. import random x = random.getrandbits(256) if x % 2 == 0: x + 1 print x you need assign x + 1 x . can either this: x = x+1 or this: x += 1

javascript - Angular 2 App scrolls to top on its own -

since app big try simplify below: tagcomponent : @component({ selector: "tag", template: `<div *ngfor="let of arr">{{a}}</div>` }) export class tagcomponent{ @input() arr: string[]; add(){ this.arr.push("abc"); } } appcomponent : @component({ template: `<p><tag [arr]="data"></tag></p>` }) export class appcomponent{ data: string[]; //some other code } so, when add() called, first time app scrolls top automatically , occurs in outlook desktop running modified version of ie 11. bit difficult understand problem , give solution hints might cause count answer.

R installing OpenCL via install.packages with options -

i´m trying install package opencl in r on windows. installed opencl , have header files (i.e. cl\opencl.h). it's in c:\program files (x86)\intel\opencl sdk\6.1\include . however, when try install opencl via: install.packages("opencl", type = "source", # tried many variations on without luck install_opts = "c:/program files (x86)/intel/opencl sdk/6.1/include") then following error: ocl.c:6:23: fatal error: cl/opencl.h: no such file or directory #include <cl/opencl.h> ^ to me means r not know cl/... folder is. how can tell install.packages is? similarly, how install package via command prompt? in advance!

postgresql - Python can open file, PL/Python can't -

connected mydb in postgresql: mydb=# create function file_test () returns text $$ if open('mydir/myfile.xsl'): return 'success' $$ language plpythonu; create function mydb=# select file_test(); error: ioerror: [errno 2] no such file or directory: 'mydir/myfile.xsl' context: traceback (most recent call last): pl/python function "file_test", line 2, in <module> if open('mydir/myfile.xsl'): return 'success' pl/python function "file_test" over python: >>> if open('mydir/myfile.xsl'): print 'success' ... success >>> an absolute path didn't seem pl/python. i'd use postgres's query_to_xml() , run xslt transformation on return. i'll need read xsl file... at @hruske's suggestion used plpy.notice(os.path.abspath('mydir/myfile.xsl')) see how pl/python trying resolve path. /var/lib/postgresql/9.5/main/mydir/myfile.xsl , not had in mind.

Java SQL Querying With TextFields -

i wrote sql query , used textfield getting data. when textfield empty, gives data. how can stop that? here code: string sql = "select * boek naam '%" + txtnaam.gettext() + "%' or auteur '%" + txtauteur.gettext() + "%' or categorie '%" + txtcategorie.gettext() + "%' or opleiding '%" + txtopleiding.gettext() + "%' not opleiding '%" + txtopleiding.gettext() + "%' "; i guess looking query text field(s) has value , ignore rest empty. my suggestion be: 1) write java logics determine inputs program first. e.g. author, category selected fields , not empty. 2) run dedicated sql queries facilitate search inputs selected. e.g. in case, select using author , category so, there few sql queries there. not 1 handles everything. less confusing in opinion. hope helps :)

Dynamic row height for NSTableView in Swift/Cocoa -

edit: question not answered linked reply. i'm still stuck on this... i've got table use chat messages. each message variably-sized box including text. want row height in table dynamically change depending on size of message box. if tick 'automatic' size style in ib, makes of rows have tiny heights. looks ios have uitableviewautomaticdimension automatically scales table, can't find nstableview. i know there's option create following function: func tableview(_ tableview: nstableview, heightofrow row: int) -> cgfloat { return 50 // ???? } and able set row height using (the above sets of rows height 50), don't know how make dependent on size of text in box. how can efficiently? here's 1 solution first set nstextfield in code. "virtual" field in never drawn var fakefield = nstextfield() // set fontsize etc use in table then in heightofrow function func tableview(tableview: nstableview, heightofrow row:

Creating a dynamic form inputs in android with ability to add an remove text fields -

Image
i create form in android in fragment in user can add , remove form inputs below image describes mean as can see there option add new row or remove could guide me on way implement this, if possible code snippets or external reference. have researched , samples provided arent clear the provided resource not clear because, take instance on button click add new edit text , set id 1, next instance id supposed set 2......without limit user how implement such

jsr356 - Websocket used in Servlet, is "public static void main(final String[] args)" needed? -

this first time working java websockets (not using jetty, using jsr-356 instead), , of examples have seen utilize "public static void main(final string[] args)" map websocket client , server endpoints. if creating app based in java servlet, method necessary connect 2 socket endpoints? if necessary, how called perform method in connecting class? your servlet code not have have "public static void main(string[])" method. method entry point used when invoke application command line interface. on other hand, servlet started in different way servlet container , method (public static void main(string[])) not entry point servlets.

atmosphere.js - Meteor check available versions available for atmosphere js package -

is possible check available versions of atmospherejs package? example, trying install twbs:bootstrap@=4.0.0-alpha.4 following github page but not install giving error: no such version twbs:bootstrap@=4.0.0-alpha.4 hence looking find way check versions available given atmospherejs meteor package. you can use meteor show twbs:bootstrap or meteor show --show-all twbs:bootstrap for older or pre-released versions. latest available version 4.0.0-alpha2

swift - Ambiguous use of DispatchQueue on trying to use main thread -

Image
this weird issue , can't seem find help. on swift 3, trying make call on main thread try use dispatchqueue.main.async, doesn't compile. any ideas helpful. try code instead, swift 3.0 syntax: dispatchqueue.main.async(execute: { () -> void in })

vba - Find and delete text within a cell in excel -

Image
i have pasted text in cell a1 may this: "vanguard - total market - composite" or "vanguard - total market - commingled" i want cut off " - composite" or " - commingled" , return rest in cell b1. i'm using formula in b1: =left(a1,find(" - composite",a1)-1) however, can't figure out how multiple terms (i.e. composite or commingled). there formula accomplish this? if not, how in vba? thanks help! if understand correctly, you're looking strip past second occurrence of - , i.e. returning trimmed (extra whitespace removed) text left of first - character. adapting this solution locate last word in string, it: =trim(substitute(left(a1,len(a1)-len(mid(a1,find(char(1),substitute(a1,"-",char(1),len(a1)-len(substitute(a1,"-",""))))+1,len(a1)))),"-","",2)) this formula work or without spaces around - , , regardless of follows: if spacing important, can w