Posts

Showing posts from June, 2012

java - how to convert S3ObjectInputStream to PushbackInputStream -

i uploading excel(xls) file s3 , application should download file s3 , parse using apache poi reader. reader accepts inputstream type input proper parsing of excel expects pushbackinputstream . inputstream file downloaded s3 of type s3objectinputstream . how convert s3objectinputstream pushbackinputstream ? i tried directly passing s3objectinputstream (since inputstream ) pushbackinputstream , resulted in following exception : org.springframework.batch.item.itemstreamexception: failed initialize reader @ org.springframework.batch.item.support.abstractitemcountingitemstreamitemreader.open(abstractitemcountingitemstreamitemreader.java:147) @ org.springframework.batch.item.support.compositeitemstream.open(compositeitemstream.java:96) ..... ..... caused by: java.lang.illegalstateexception: inputstream must either support mark/reset, or wrapped pushbackinputstream @ org.springframework.batch.item.excel.poi.poiitemreader.openexcelfile(poiitemreader.java:82) ..... i tried...

node.js - error TS2304: Cannot find name 'Promise' -

hello guys went through solution avaialble on stackoverflow. none of work me. hence posting question. tsconfig.json { "version":"2.13.0", "compileroptions": { "target": "es5", "module": "commonjs", "sourcemap": true, "emitdecoratormetadata": true, "experimentaldecorators": true, "removecomments": true, "noimplicitany": false }, "exclude": [ "node_modules" ] } package.json { "name": "anguapp", "version": "1.0.0", "description": "angular2 gulp typescript , express", "main": "dist/server.js", "scripts": { "test": "echo \"error: no test specified\" && exit 1", "postinstall": "gulp build" }, "keywords": [], "...

WCF performance issues - weird slowdown -

i have video-processing engine i've written while ago, combination of c# , c++, processes video file on disk @ 10 frames per second... c# part of spawns threads, , c++ bits of instantiate reader , video processing routines… there 1 main thread created when main c# object created, , main thread spawns off c++-based reader thread , video processing threads. threading verifiably correct. there no blocking or deadlock issues in it. code is/was stable. now, if wrap whole thing inside wcf service, , use wcf set file process, tell (the video engine) “go”, individual frames process @ same speed, except once in while, every few seconds, threads stall out while, they're being suspended. it's weird!! doesn't happen when don't run through wcf. this has nothing wcf calls themselves, because make few initialization calls wcf service running, don’t call wcf longer!!! service “persession”, concurrencymode = multiple, what’s going on not multithreading (locking/blocking) iss...

javascript - Server response time in browser -

Image
after searches in google cant found answer. have requested data server. takes time load in browser. don't know whats happening. have pasted browser network time. want is, server response slow or browser rendering slow. please describe things in image, helpful. the server slow 1.5 seconds wait request sent small answer being returned. there initial delay setting connection ok being reused. however, picture not show details of browser delay. i focus on improving server response.

fullcalendar - Fullcalender load static event on ajax call -

i want current event on ajax call when calender load. how can possible? tried $(document).ready(function() { console.log(event.title); $.ajax({ url: 'ajax_call1.php', //data: {vv:vv}, type: 'post', success: function( response ) { $("#result").html(response); alert("you click --"+response); } }) } but can not event title on ajax call please me.

ios - Xcode - warning "Method definition not found". Call Method from Category file -

i have created method in category file. want reuse methods in view controllers. have imported category file in view controllers , declared method in header file also. calling this: category class: @interface uiviewcontroller (headerview) -(uilabel *)somemethod; @implementation uiviewcontroller (headerview) -(uilabel *)somemethod{ } homeviewcontroller: @interface homeviewcontroller : uiviewcontroller -(uilabel *)somemethod; @implementation homeviewcontroller [self somemethod]; iam getting warning message in line: @implementation homeviewcontroller its working. want clear warning. how can it? if want category in view controller that your category @interface uiviewcontroller (extendedmethods) - (void)somemethod; @end @implementation uiviewcontroller (extendedmethods) - (void)somemethod { nslog(@"some method"); } @end myviewcontroller.m #import "myviewcontroller.h" #import "uiviewcontroller+extendedmethods.h" @impleme...

javascript - es6 code broken in es5 -

i have been trying translate code es6 es5 because of framework restrictions @ work... although have been quite struggling locate problem is. reason code not work quite same, , there no errors either ... can tell me if have translated ? this es6 code : function filterfunction(items, filters, stringfields = ['title', 'description'], angular = false) { // filter keys of filters parameter const filterkeys = object.keys(filters); // set mutable filtered object items let filtered; // angular doesn't deep clones... *sigh* if (angular) { filtered = items; } else { filtered = _.clonedeep(items); } // each key in supplied filters (let key of filterkeys) { if (key !== 'textinput') { filtered = filtered.filter(item => { // make sure have filter by... if (filters[key].length !== 0) { return _.intersection(filters[key], item[key]...

python - Getting an error as var5 is undefined ? but it runs fine without class -

class roger: root1 = tk() frame1 = frame(root1, width=100, height=100) frame1.pack(side=top) label5 = label(frame1, text="x1=") label6 = label(frame1, text="x2=") label7 = label(frame1, text="x3=") label8 = label(frame1, text="x4=") label5.grid(row=0) label6.grid(row=1) label7.grid(row=2) label8.grid(row=3) var5 = stringvar() var6 = stringvar() var7 = stringvar() var8 = stringvar() textbox1 = entry(frame1, textvariable=var5, bd=10, width=10, font=30) textbox1.grid(row=0, column=1) textbox2 = entry(frame1, textvariable=var6, bd=10, width=10, font=30) textbox2.grid(row=1, column=1) textbox3 = entry(frame1, textvariable=var7, bd=10, width=10, font=30) textbox3.grid(row=2, column=1) textbox4 = entry(frame1, textvariable=var8, bd=10, width=10, font=30) textbox4.grid(row=3, column=1) hoo = entry(frame1, width=20, bd=10) hoo.grid(row=5, column=0)...

ios - Universal link - The domain has some validation issue -

im working on universal link open application while tap url. using https server , done steps apple ( apple doc ). apple universal link validator show below error, your file's 'content-type' header not found or not recognized. enter image description here the apple-app-site-association file uploaded server , file below, { "applinks": { "apps": [], "details": [ { "appid": "j2hbf9a3pz.com.aors.speaku", "paths": [“*”,”/“] } ] } } and apple said no need sign apple-app-site-association file whether domain has https. if file unsigned, should have content-type of application/json. otherwise, should application/pkcs7-mime. so query how mention content type(application/json) in apple-app-site-association file??? please me on this. don't know mean exactly.

http - can azure service bus (for a topic) send notification to a rest end point (POST) -

i need azure service bus notify end point (rest - post) whenever message comes particular topic. in aws, done way aws llink what equivalent in azure. note: dont want write code receive message , call end point. azure service bus messaging service, not notifications service. such, deals solely messaging, , doesn't create notifications you. aws combines sqs (simple queuing service) sns (simple notification service) behind scenes allow functionality you're describing. allow sqs have behaviour of events. azure service bus has native support topics , subscriptions (if that's you're looking for). i.e. rather sending messages queue, message sent topic , appropriate subscriber(s) it. so short answer question in case don't want receive message , trigger notification "no". saying that, if you're ok "serverless" functions (similar aws lambdas), use azure functions achieve goal.

python - Export button is not visible with django-import-export package -

Image
i trying use django-import-export module in admin , here settings admin.py from import_export.admin import importexportmixin, importmixin, exportactionmodeladmin, importexportactionmodeladmin class registrationadmin(importexportactionmodeladmin): list_display = ('user', 'activation_key_expired') raw_id_fields = ['user'] search_fields = ('user__username', 'user__first_name', 'user__last_name') admin.site.register(registrationprofile, registrationadmin) with above code, can able see import button in admin below but can't able see export option, what's problem missing here ? i have seen ticket export button permission here https://github.com/django-import-export/django-import-export/issues/38 ? can please let me know need done in order export appear ? by way using django suit admin theme you need use importexportmodeladmin importexportactionmodeladmin adds export list of things can sele...

java - Setting timeout on webservice -

i new webservices, call webservice through wrapper provided party. need wait amount of time after calling webservice, if response not received, should shoot time out response. remember not call webservice directly. below psuedo code. string responsexml = pro.sendtocustomer("https://india.com/clientgatewayv2/gatewayclientinterfacev2", asaxml); pro.sentocustomer present in jar provided third party. how handle session time out on this?

html - CSS: How to align table data -

Image
how align bds education? without using white-space:nowrap. <div class="doc-schedule clearfix"> <p> <table style="border: 0px;border-style: none"> <tr> <td><strong>speciality</strong></td> <td class="tdpadding"><span>{{ page.dentist_specialty }}</span></td> </tr> <tr> <td><strong>education</strong></td> <td class="tdpadding"><span>{{ page.dentist_education }}</span></td> </tr> <tr> <td><strong>work days</strong></td> <td class="tdpadding"><span>{{ page.dentist_workdays }}</span></td> </tr> </table> </p> </div> ........ tr vertically aligned middle default add tr { vertical-align:top } demo

jasper reports - Require.js javascript file format -

i trying load js file through require having structure following. though loading , working expected, want ask whether file format right loaded require? !function(global){ //js content }(this) visualize.__jrsconfigs__["userlocale"] = "en"; visualize.__jrsconfigs__["avaliablelocales"] = ["de", "en", "es", "fr", "it", "ja", "ro", "zh_tw", "zh_cn"]; if (typeof define === "function" && define.amd) { define(["reporting"], function () { return visualize; }); } var currentthemepath = "_themes/aefcb57d/theme.css".split("/").slice(0, -1);

android - Error - "Gradle DSL method not found: compile()" while adding recyclerview -

this question has answer here: gradle dsl method not found: 'compile()' 8 answers i want use recyclerview in app. added "complie 'com.android.support:recyclerview-v7:23.3.0'" in app level build.gradle file. getting error - error:(26, 0) gradle dsl method not found: 'complie()' possible causes: the project 'rview' may using version of gradle not contain method. open gradle wrapper file the build file may missing gradle plugin. apply gradle plugin here build.gradle file- apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.3" defaultconfig { applicationid "com.sid.rview" minsdkversion 15 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefau...

android - ColorPrimary,colorAccent replaced in Eclipse -

i have style in android studio project want use eclipse project make error <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- customize theme here. --> <item name="colorprimary">@color/colorprimary</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="coloraccent">@color/coloraccent</item> </style> and want use sdk <uses-sdk android:minsdkversion="8" android:targetsdkversion="21" /> error is error: error: no resource found matches given name: attr 'colorprimarydark'. error: error: no resource found matches given name: attr 'coloraccent'. update project.properties file of appcompat v7, has:target=android-19 target=android-21 also update google play services library (by update mean update in sdk manager , re-import etc) fixed issue...

python - Cython: fatal error: 'numpy/arrayobject.h' file not found, using numpy -

i trying move ipython notebook code python. have error fatal error: 'numpy/arrayobject.h' file not found #include "numpy/arrayobject.h" , though have included numpy in setup my setup.py: from distutils.core import setup, extension cython.build import cythonize import numpy setup( ext_modules=cythonize("trajectory.pyx"), include_dirs=[numpy.get_include()] ) the trajectory.pyx file cimport numpy np import numpy np i running on osx, python 2.7.10 it gives me information before error, hope identifying issue: clang -fno-strict-aliasing -fno-common -dynamic -isysroot /applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.11.sdk -i/applications/xcode.app/contents/developer/platforms/macosx.platform/developer/sdks/macosx10.11.sdk/system/library/frameworks/tk.framework/versions/8.5/headers -dndebug -g -fwrapv -o3 -wall -wstrict-prototypes -i/usr/local/include -i/usr/local/opt/openssl/include -i/usr...

machine learning - Are Gaussian clusters linearly separable? -

imagine have 2 gaussian probability distributions in two-dimensions first centered @ (0,1) , second @ (0,-1). (for simplicity, assume have same variance.) can 1 consider clusters of data points sampled these 2 gaussians linearly separable? intuitively, it's clear boundary separating 2 distributions linear, namely abscissa in our case. however, formal requirement linear separability convex hulls of clusters not overlap. cannot case gaussian-generated clusters since underlying probability distributions pervade of r^2 (albeit negligible probabilities far away mean). so, gaussian-generated clusters linearly separable? how can 1 reconcile requirement of convex hulls fact straight line conceivable "boundary"? or, perhaps, boundary ceases linear once non-equal variances come in pictures? the gaussian cluster instances might separable or not. depends on outcome, not on process generating it. linear separability can defined a existence of plane separating 2 set...

Call Ruby from a VBScript -

hey have been working ruby , vbscript lately. there scenario need call ruby script vbscript , stuck there. tried code, set newobj = createobject("wscript.shell") obj = newobj.run("ruby e:\rubyfile.rb > d:\newdoc.txt",1,true) but ruby script not giving result. doing right or there other way it? if ruby script executed separately results generated, problem not ruby script. you need shell ( %comspec% /c ) shell's feature > redirection. change obj = newobj.run("ruby e:\rubyfile.rb > d:\newdoc.txt",1,true) to nret = newobj.run("%comspec% /c ruby e:\rubyfile.rb > d:\newdoc.txt",1,true) (study docs .run see reason nret instead of obj , spend thought on lousy-ness of name "newobj")

linq - MySql.Data.MySqlClient.MySqlException Timeout Expired c# -

i'm getting error mysql.data.mysqlclient.mysqlexception timeout expired in in mysqlreader my code public mysqlreader(mysqlcommand command) { if (command.type == mysqlcommandtype.select) { _dataset = new dataset(); _row = 0; using (mysql.data.mysqlclient.mysqlconnection conn = dataholder.mysqlconnection) { conn.open(); using (var dataadapter = new mysqldataadapter(command.command, conn)) dataadapter.fill(_dataset, table); ((idisposable)command).dispose(); // in line } } } what can fix this? full error: [04:46:58] mysql.data.mysqlclient.mysqlexception (0x80004005): timeout expired. timeout period elapsed prior completion of operation or server s not responding. ---> system.timeoutexception: connection attempt failed beca use connected par...

matrix - Large block coefficient-wise multiplication fails in Eigen library C++ -

i've read through lot of documentation , if find i've missed can explain away issue i'll pleased. background, i'm compiling on x86 windows 10 in visual studio 2015 using 3.2.7 eigen library. 3.2.7 version may , while there have been releases since then, haven't seen in changelog indicate issue has been solved. the issue seems appear matrices above size. don't know if byproduct of specific system or inherent eigen. the following code produces access violation in both debug , release mode. int mx1rows = 255, cols = 254; {//this has access violation @ assignment of mx2 eigen::matrixxd mx1(mx1rows, cols); eigen::matrixxd mx2(mx1rows + 1, cols); eigen::block<eigen::matrixxd, -1, -1, false> temp = mx2.toprows(mx1rows); mx2 = temp.array() * mx1.array();//error } i believe assignment of coefficient-wise multiplication safe since result should aliased . this issue becomes interesting when mx1rows reduced value 254, acc...

objective c - Add an NSButton programmatically and then adjust an existing button position -

here code when click button: nsrect btnframe = nsmakerect(92, 70, 60, 15); newbutton = [[nsbutton alloc] initwithframe:btnframe]; [[_window contentview] addsubview:newbutton]; btnframe = [alert1 frame]; btnframe.origin.y -= 100; [alert1 setframe:btnframe]; but result new button added, , existing button not change position. what's wrong? check origin.y value. , second time taking alert1s frame , change origin.y check final frame assign alert1. may goes beyond visible area. , check needs new button frame or alert1 frame

How can I make a Swift enum with UIColor value? -

i'm making drawing app , refer colors through use of enum. example, cleaner , more convenient use colors.redcolor instead of typing out values every time want red color. however, swift's raw value enums don't seem accept uicolor type. there way enum or similar? i (basically using struct namespace): extension uicolor { struct mytheme { static var firstcolor: uicolor { return uicolor(red: 1, green: 0, blue: 0, alpha: 1) } static var secondcolor: uicolor { return uicolor(red: 0, green: 1, blue: 0, alpha: 1) } } } and use like: uicolor.mytheme.firstcolor so can have red color inside custom theme.

excel - Automatically copy a cells colour to another cell -

this simple problem can't seem find solution. use 3 different cell styles (good,neutral , bad). want want cell adjacent 1 colour coded same colour. example cell o11 selected (green colour), hence cell m11 should automatically change cell style according cell o11. any suggestions? p.s o11 set manually (no conditional formatting) to solve problem need create variable hold cells color value , set value cell. use following example: sub copy_color() dim icolor long dim long for = 11 20 icolor = worksheets("sheet name").range("m" & i).interior.color worksheets("sheet name").range("o" & i).interior.color = icolor next end sub

c++ - .build_release/lib/libcaffe.so: undefined reference to `boost::python::import(boost::python::str)' -

i error python2.7 , ubuntu15.10: jalal@klein:~/computer_vision/py-faster-rcnn/caffe-fast-rcnn$ make -j8 && make pycaffe cxx/ld -o .build_release/tools/compute_image_mean.bin cxx/ld -o .build_release/tools/upgrade_net_proto_binary.bin cxx/ld -o .build_release/tools/convert_imageset.bin cxx/ld -o .build_release/tools/upgrade_net_proto_text.bin cxx/ld -o .build_release/tools/caffe.bin cxx/ld -o .build_release/tools/extract_features.bin cxx/ld -o .build_release/tools/upgrade_solver_proto_text.bin cxx/ld -o .build_release/examples/cpp_classification/classification.bin /usr/bin/ld: warning: libboost_system.so.1.58.0, needed .build_release/lib/libcaffe.so, may conflict libboost_system.so.1.61.0 /usr/bin/ld: warning: libboost_thread.so.1.58.0, needed .build_release/lib/libcaffe.so, may conflict libboost_thread.so.1.61.0 .build_release/lib/libcaffe.so: undefined reference `boost::python::throw_error_already_set()' .build_release/lib/libcaffe.so: undefined reference `boost::py...

coffeescript - If...then in JSX for Javascript -

i've been writing coffeescript/cjsx , valid syntax: <div> <input type={if @state.name == "test" "checkbox"}/> </div> how do same plain javascript? there no if...then clause , don't think can inline if checks can in coffee? taking answer how write inline if statement in javascript? you can use syntax 10 < 11 ? : that ? then , : else .

placing a button on each row (in a cell) in Google Sheet that, when pressed, gets system time and places in adjacent cell in that row -

i directed here gafe engineers scripting wasn't directly supported google. i've started looking @ script editor , thought need direction want be. i have time dropoff, adjustment, time pickup, & total time cells in each row there button next total time cell when clicked system time , place in row's time dropoff cell. calculate total time ((time pickup - time drop off) - adjustment) . what easiest way this? you can workaround making menu on spreadsheet , using current active cell, script add current time on adjacent row: create spreadsheet , paste code script. function onopen(e) { spreadsheetapp.getui() .createmenu("utils") .additem('generate system time', 'time') .addtoui(); } function oninstall(e) { onopen(e); } function time(){ var ss = spreadsheetapp.getactive().getactivesheet(); var row = ss.getactivecell().getrow(); var column = ss.getactivecell().getcolumn(); var date= new date(); ...

javascript - Angular 2 calling Web Api with json results not displaying -

my call angular 1.5.x needed have devices added result.data result.data.devices thus angular 1.x $http call this: var vm = this; var dataservice = $http; dataservice.get("http://localhost:42822/api/device") .then(function (result) { vm.devices = result.data.devices; my angular 2 code bit different, i'm calling same web api if call .json file works display private _producturl = 'api/devices/devices.json'; but i'm not understanding of code of not see add "devices" private _producturl = 'http://localhost:42822/api/device'; constructor(private _http: http) { } getproducts(): observable<idevice[]> {//observable<iproduct[]> { return this._http.get(this._producturl) .map((response: response) => <idevice[]>response.json()) .do(data => console.log("all: " + json.stringify(data))) .catch(this.handleerror); } wouldn't add in "device" or ...

java - Menu Item onClickListener for fragments -

i have following menu: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".mainactivity"> <item android:id="@+id/action_settings" android:orderincategory="100" app:showasaction="never" android:title="settings" /> <item android:id="@+id/menu_share" android:icon="@drawable/ic_heart_outline_white_24dp" app:showasaction="always" android:title="favorite" /> </menu> how set onclick listener this? bearing in mind class extends fragment: public class my_profile extends fragment implements ....{} ...and not know if makes difference have inflated layout in java file too. @override public view oncreateview(layoutinflater inflater, viewgroup container, bu...

html - CSS not loading in Firefox or IE. Works in Chrome -

Image
i've created simple church directory in edited css change 1 of default map markers 1 of own. issue having map marker displayed correctly on chrome , safari not firefox ie or edge. copticchurch-directory.org code /* theme name: listify child theme uri: http://astoundify.com/themes/listify template: listify version: 1.0 */ .job_listing-rating-wrapper, .map-marker-info .rating, .single-comment-rating, .star-rating-wrapper { display: none !important; } .type-job_listing.style-grid .job_listing-entry-footer { display: none; } .ion-information-circled { content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/map-marker1.svg); } .ion-ios.information-circled { content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/map-marker1.svg); } .ion.md.information-circled { content: url(http://copticchurch-directory.org/wp-content/uploads/2016/08/map-marker1.svg); } the problem use of content property ...

java - View object not clickable - using OnClickListener -

i created basic class called listitem, stores 2 strings , integer. this container items sit in recyclerview. i tried make listitems clickable, made listitem extend view class. , added onclicklistener , set it. hasn't worked. tested creating short message using toast nothing displays. have idea why? listitem class: public listitem(string title, string date, int url, context context, attributeset attrs){ super(context, attrs); this.title = title; this.date = date; this.url = url; } ...class listitems created..... private attributeset attrs; listitem y = new listitem(title, date, a, this.getcontext(), attrs); view.onclicklistener mfan = new view.onclicklistener() { public void onclick(view v) { toast.maketext(getactivity(), "test" , toast.length_short).show(); } }; y.setonclicklistener(mfan); implementing item click listener in recyclerview bit different. i assume h...

Is it possible to transfer files using Kafka? -

i have thousands of files generated each day want stream using kafka. when try read file, each line taken separate message. i know how can make each file's content single message in kafka topic , consumer how write each message kafka topic in separate file. you can write own serializer/deserializer handling files. example : producer props : props.put(producerconfig.key_serializer_class_config, org.apache.kafka.common.serialization.stringserializer); props.put(producerconfig.value_serializer_class_config, your_file_serializer_uri); consumer props : props.put(consumerconfig.key_deserializer_class_config, org.apache.kafka.common.serialization.stringdeserializer); props.put(consumerconfig.value_deserializer_class_config, your_file_deserializer_uri); serializer public class filemapserializer implements serializer<map<?,?>> { @override public void close() { } @override public void configure(map configs, boolean iskey) { } @override public byte...

python - Constructing Zipf Distribution with matplotlib, trying to draw fitted line -

i have list of paragraphs, want run zipf distribution on combination. my code below: from itertools import * pylab import * collections import counter import matplotlib.pyplot plt paragraphs = " ".join(targeted_paragraphs) paragraph in paragraphs: frequency = counter(paragraph.split()) counts = array(frequency.values()) tokens = frequency.keys() ranks = arange(1, len(counts)+1) indices = argsort(-counts) frequencies = counts[indices] loglog(ranks, frequencies, marker=".") title("zipf plot combined article paragraphs") xlabel("frequency rank of token") ylabel("absolute frequency of token") grid(true) n in list(logspace(-0.5, log10(len(counts)-1), 20).astype(int)): dummy = text(ranks[n], frequencies[n], " " + tokens[indices[n]], verticalalignment="bottom", horizontalalignment="left") at first have encountered following error reason , not know why: indexerror: index 1 out of bound...

osx - How to write a bash script using Mac to take files with the same date and put them in a folder with that date -

i have hundreds of datalogger files in directory , want write bash script take files same date in filename (an example file name "2016-06-15t170000_smartflux.data", 2016-06-15 date) , store them in folder date name. using mac terminal window, believe linux (i apologize ignorance in computer terminology) so far have: #type of file (extension) process: files=*.data #get date string file name use newly created file date=`ls $files|head -n 1|cut -c 1-10` any appreciated. have modified bash script combines these types of files text, , have not created folders or moved files. assuming script in same dir data files: #!/bin/bash filename in *.data; target_dir=${filename:0:10} if [[ ! -d $target_dir ]]; mkdir $target_dir fi mv $filename $target_dir done

java - Service unavailable issue only from Mac -

i trying access soap web service . keep getting error java.io.ioexception: unable tunnel through proxy. proxy returns "http/1.1 503 service unavailable". i tried possible solutions, added authenticator class. same works in windows without additional classes. can please help.

java - POI apache next row if not empty -

i wrote in excel file poi , if line completed passes row after not erase in xls file! i can not find effective method. currently code is: private static boolean saveexcelfile(context context, string filename) { // check if available , not read if (!isexternalstorageavailable() || isexternalstoragereadonly()) { log.w("fileutils", "storage not available or read only"); return false; } boolean success = false; //new workbook workbook wb = new hssfworkbook(); cell c = null; //cell style header row cellstyle cs = wb.createcellstyle(); cs.setfillforegroundcolor(hssfcolor.lime.index); cs.setfillpattern(hssfcellstyle.solid_foreground); //new sheet sheet sheet1 = null; sheet1 = wb.createsheet("myorder"); // generate column headings row row = sheet1.createrow(0); c = row.createcell(0); c.setcellvalue("item number"); c.setcellstyle(cs); c = ...

c# - Problems with Razor to render a view -

when i'm entering in specific module of system, i'm receiving following error: httpcompileexception: c:\windows\microsoft.net\framework64\v4.0.30319\temporary asp.net files\root\f9a69f24\bf43f34d\app_web_search.cshtml.5571bf69.aspbf3uv.0.cs(35): error cs0234: type or namespace name 'customwebviewpage' not exist in namespace 'project.areas.shared.code.viewpage' (are missing assembly reference?) this class: customwebviewpage, not exist in project, searched class in projects , web.config(s) , did not found her. i cleaned .net temp folder, reset iis, , problem still happens. does have idea how solve problem?

security - Should you combine an API key and Oauth? -

so i'm building data hub. want store large amounts of data in database. in order there these pipes of data data providers have make using apis. i want secure apis know who's making streams , can limit makes them. can send them. make sense oauth non-ingestion api methods , use api key ingestion methods? oauth tokens tend expire , ingestion of data long running process. doesn't feel right solution since there's 2 separate security protocols being used. the other option see right force users check expiration time of tokens , try refresh them if it's expire , still need send data. oauth 2.0 allows clients long-running offline processes via usage of refresh token allows client new access token when current 1 expires. user doesn't need involved since proper oauth 2.0 client should able deal expired tokens on own.

ios - How to place variables inside button target selector -

i have button add target to, selector contain variable. can add variable selector without receiving error? thank in advance. //this cause selector error when run self.save.addtarget(self, action: #selector(self.saveitems(datatosave)), forcontrolevents: .touchupinside) create additional function use action selector argument func helperfunc() { self.saveitems(datatosave) } and add it self.save.addtarget(self, action: #selector(self.helperfunc), forcontrolevents: .touchupinside)

html - Background image stays after removing tag -

i learning webdev designing webpage , want landing page have background image subsequent page not to. index.html page extends base.html template. used body tag apply background image cover page. want removed results.html view in results.html extend header view using header.html . , in header.html layout eliminate body tag, background image remains somehow. any beginner appreciated. base.html {% load staticfiles %} <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- above 3 meta tags *must* come first in head; other head content must come *after* these tags --> <meta name="description" content=""> <meta name="author" content=""> <link rel="icon...

objective c - IOS Obj-C extracting latitude from CLLocation -

i'm updating obj-c project, , model "upload model" made cllocation of similar this: nslog output: <+38.03744507,+122.80317688> +/- 0.00m (speed -1.00 mps / course -1.00) @ 8/23/16, 9:44:41 pm central european summer time so assume extract data this: cllocation *lat = self.currentuploadpackage.placelocation.coordinate.latitude; i placelocation , xcode claims doesn't contain coordinate nor latitude (/users/user/development/app/sharedescriptionviewcontroller.m:92:37: property 'latitude' cannot found in forward class object 'cllocation') how go getting long/lat data cllocation mentioned above? or hints. (ps: not objc, focused on swift) note error mentions "forward class object 'cllocation'". this means use @class cllocation somewhere (probably in .h file). doesn't provide details cllocation other class. to fix code need import proper .h file in .m file tries access properties of clloca...

Copy entire directory in Gradle -

i have directory structure this: file1.txt file2.txt dir1/ file3.txt file4.txt i want use gradle copy entire structure directory. tried this: task mytest << { copy { "file1.txt" "file2.txt" "dir1" "mytest" } } but results in following: mytest/ file1.txt file2.txt file3.txt file4.txt see, copy dir1 copied files in dir1 , whereas want copy dir1 itself . is possible directly gradle copy ? so far, have been able come solution: task mytest << { copy { "file1.txt" "file2.txt" "mytest" } copy { "dir1" "mytest/dir1" } } for simple example there's not it, in actual case there many directories want copy, , i'd not have repeat much. you can use . directory path , include specify, files , directories want copy: copy { '....

Resolving 2 Python version in Mac OSX -

i running mac os x 10.11.5 . have 2 python versions on machine: python 2.7 (inbuilt python in osx) , python 3.5 (anaconda version- 4.1.1) the path set shown: $path -bash: /users/usernms/anaconda/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: no such file or directory the problem when trying install few packages pandas, theano etc., using anaconda. error: failure: importerror (no module found) by default python path points 1 i.e (python version- 2.7) > whereis python /usr/bin/python but actual path want work python 3.5 (anaconda version): > python /users/usernms/anaconda/bin/python the python site packages path follows: /users/usernms/anaconda/lib/python3.5/site-packages the packages site-packages ( pandas, theano etc., ) not getting retrieved above path, giving away import error please me on !! in advance :) my approach create new conda enviornment , install packages there. avoid issues if still want use 2.7. example be...

P146 example from the book "R in action" -

from book "r in action" page 146 has example of group descriptive statistics by vars <- c("mpg", "hp", "wt") ... > dstats <- function(x)(c(mean=mean(x), sd=sd(x))) > by(mtcars[vars], mtcars$am, dstats) but when input r > error in is.data.frame(x) : >(list) object cannot coerced type 'double' >in addition: warning message: >in mean.default(x) : argument not numeric or logical: returning na i not know happens here. can gives me help. thanks. please ?by() in r console. in help, you'll find following mentioned fun by(data, indices, fun, ..., simplify = true) fun function applied (usually data-frame) subsets of data. update this more has way mean() , sd() defined. both on support vector, not data frames. checkout examples below, , see difference comes mean() , without vectorize() : x <- data.frame( = c(1, 2, 4), b = c(1, 2, 4)) now, if do: by(x, 1:3, mean) you following ...

how twitter rolled out night mode without updating ios client -

i noticed twitter last updated on 18th august , rolled out night mode on 22nd august. how feature popped in ios client. please enlighten me if missing on something. there multiple potential options, it's feature implemented , turned on , off server setting.

mysql - Php sql DISTINCT row id without duplicate -

select distinct buyer,caseid,subject,service s_support order id desc result is buyer subject service caseid abel@gmail.com ---- need ---- other ---- 438613 bani@gmail.com ---- urgent ---- other ---- 438612 rony@gmail.com ---- ---- other ---- 438611 i want view id in distinct how? wants hide duplicates keep 1 row per buyer/subject/service/case keep row id. id buyer subject service caseid 9 abel@gmail.com ---- need ---- other ---- 438613 7 bani@gmail.com ---- urgent ---- other ---- 438612 6 rony@gmail.com ---- ---- other ---- 438611 the question unclear looking this. try both of in mysql_query() , keep 1 fits need (if any) eliminate duplicates , keep lowest id select min(id) id, buyer,caseid,subject,service s_support group buyer,caseid,subject,service order id desc eliminate duplicates , keep highest id select max(id) id, buyer,caseid,subjec...

Java Multiple comparision in java -

pardon me if stupid question.. wondering if there support following comparison in java: (a, b, c .... != null) in place : (a != null && b != null && c != null && d ! null , on ..) i trying make code more readable code unreadable due multiple condition in single statement. code : variable = (rest.host != null && rest.payload != null && rest.lockqueue != null && rest.endpoint != null ) || rest.default.setstate || rest.scheduler.locked && rest.scheduler.queue.isfull() && lastpayload.getactivity.status.executing ? onexecute(rest.payload) : wait(time); if elements in collection, use collection.stream().allmatch(x -> x != null) . actually, there's predicate that: collection.stream().allmatch(objects::nonnull) . if elements aren't in collection, can still use arrays.aslist() create ad-hoc list them. so, in case: arrays.aslist(rest.host, rest.payload, rest.lockqueue, rest.en...

html - Navigation Bar won't extend to edge of webpage -

i'm trying navigation bar extend rest of page somehow looking this: current navigation bar . additionally, can see there's white border on top , sides, there way fix? i've tried various ways not changing. appreciated! html & css code: <html> <head> <style> @import url(https://fonts.googleapis.com/css?family=lora); <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"> <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=roboto+slab"> body { margin: 0px; padding: 0px; } .nav-bar-block { margin: 0px; padding: 0px; overflow: hidden; background-color: #f8f8f8; background-size: cover; border-bottom: 1px; border-bottom-color: dimgray; display: inline-block; } .nav-bar-...