Posts

Showing posts from January, 2010

http - Jmeter close connection before my test finish -

Image
i use jmeter http sampler test sequence of http requests , choosed "use keepalive". few threads jmeter closed connection tcp fin before requests send out. as picture shown, 172.19.0.101 jmeter,172.19.0.111 server. rest of requests can send in new connection , out of session. it can of 2 reasons: first reason - timeout whether timeout reached (default value 60 seconds, , configurable. if not configured, uses connectiontimeout parameter value in tomcat server). the default connection timeout of apache httpd 1.3 , 2.0 little 15 seconds , 5 seconds apache httpd 2.2 , above i observed request got response after 10 seconds (15 -> 29 seconds) before sending fin signal terminate connection. references: https://tools.ietf.org/id/draft-thomson-hybi-http-timeout-01.html#p-timeout https://en.wikipedia.org/wiki/http_persistent_connection https://tomcat.apache.org/tomcat-7.0-doc/config/http.html second reason - 'max' parameter may re

csv - powershell - empty list of group's members -

i'm trying export csv file list (or table doesn't matter) members of group . after many searches , tried : get-adgroupmember -identity **genericgroupname** -recursive | select name | export-csv output.csv -notypeinformation i tried change things in command- remove -recursive . i tried find problem in command , remove -export-csv output.csv -notypeinformation but showed nothing (in nothing mean - show command , nothing) my problem got output.csv , empty. if matters : genericgroupname : $group = (get-aduser -identity username -properties memberof | select memberof).memberof and genericgroupname --> $group[0] this command works well. i fixed problem (accidentally) closing powershell ise , open it. still don't know problem somehow fixed closing powershell

javascript - Is selected option selected if attribute is in DOM or not -

Image
to create dual listbox bootstraps needed remove default gray color of selected option. way remove gray color change selected state of element false. no other trick worked remove gray background color of selected option. now if so, attribute selected still remains in dom seems false. thought if have element like: <option value="1" selected>1: lorem ipsum</option> if selected there means option selected true same as: <option value="1" selected="selected">1: lorem ipsum</option> or <option value="1" selected="true">1: lorem ipsum</option> but seems not so. shed light on me? i've created fiddle https://jsfiddle.net/npm6tn0m/ trying demonstrate scenario. css option[selected] { background-color: orange; } only works selected option set false still has selected attribute in dom. cause may vary across different browsers here image see in osx chrome browser: all code i

ios - FacebookSDK - Loginscreen has wrong layout size -

Image
i using cocos2d-x (c++) & soomlaprofile game. i want login facebook via facebooksdk. if click on fb-login-button popup-window facebook appears, layout wrong.

java - Non-static variable cannot be referenced from a static context -

i've written test code: class myprogram { int count = 0; public static void main(string[] args) { system.out.println(count); } } but gives following error: main.java:6: error: non-static variable count cannot referenced static context system.out.println(count); ^ how methods recognize class variables? you must understand difference between class , instance of class. if see car on street, know it's car if can't see model or type. because compare see class "car". class contains similar cars. think of template or idea. at same time, car see instance of class "car" since has properties expect: there driving it, has engine, wheels. so class says "all cars have color" , instance says "this specific car red". in oo world, define class , inside class, define field of type color . when class instantiated (when create specific instance), memory reserved color

Python xml ElementTree findall returns empty result -

i parse following xml file using python xml elementtree api. <?xml version="1.0" encoding="utf-8" standalone="yes"?> <foos> <foo_table> <!-- bar --> <fooelem> <fname>bbbb</fname> <group>somegroup</group> <module>some module</module> </fooelem> <fooelem> <fname>aaaa</fname> <group>other group</group> <module>other module</module> </fooelem> <!-- bar --> </foo_table> </foos> in example code try find elements under /foos/foo_table/fooelem/fname findall doesn't find when running code. import xml.etree.celementtree et tree = et.elementtree(file="min.xml") in tree.findall("./foos/foo_table/fooelem/fname"): print root = tree.getroot() in root.findall("./foos/foo_table/fooelem/fname"): print i not experienced elementtree api, i've used example under https://

json - Is a batch operation to save a set of navigation properties possible? -

for example: company has employees. posting odata.svc/company(1)/employees/$ref, can save company-employee relation. can save multiple company-employee links way using odata.svc/company(1)/employees/$ref/$batch ? tried didnt work. if incorrect way, there other alternative ? odata support batching, i'm not sure version of odata using here documentation v3 (v4 same) http://www.odata.org/documentation/odata-version-3-0/batch-processing/ in example batch url, adding $batch end of url using, instead have post odata.svc/$batch request contains details of of operations want perform. example, here 1 of request taken link: post /service/$batch http/1.1 host: host content-type: multipart/mixed; boundary=batch_36522ad7-fc75-4b56-8c71-56071383e77b --batch_36522ad7-fc75-4b56-8c71-56071383e77b content-type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 content-length: ### --changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621

Fortran arrays in Julia callbacks -

i trying write wrapper twpbvpc (ode bvp remeshing) fortran-77 solver. solver needs input function signature subroutine fsub(ncomp, x, u, f, rpar, ipar) where ncomp integer (length of vector), x (in) float, u (in) vector of length ncomp , f (out) location result, vector of length ncomp rpar , ipar arrays of float , integer external parameters; julia's closure more preferred way, apparently there difficulties (see the blog post here ). moment can ignored. in julia, write fsub use signature function fsub_julia(x :: float64, y :: vector{float64}, dy :: vector{float64}) dy[1] = ... dy[2] = ... ... end ncomp doesn't seem necessary can length via length or size (however, can julia detect size of passed arrays fortran? test code, know ncomp explicitly, it's not problem). so, comply twpbvpc format wrote wrapper: function fsub_par(n :: int64, x :: float64, y :: vector{float64}, dy :: vector{float64}, rpar :: vector{float64}

Customizing xml drawable resource with image for background in Android -

Image
i developing android app. in app, opening activity dialog. activity background, want set image whole background, border radius. created background xml resource this. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/match_background_image" /> <item> <shape android:shape="rectangle" android:padding="10dp"> <corners android:bottomrightradius="5dp" android:bottomleftradius="5dp" android:topleftradius="5dp" android:toprightradius="5dp"/> </shape> </item> </layer-list> i set resource background of linearlayout. when open activity, this as can see there no border radius @ corners. besides, want want set scaletype cropcenter image.

c# - Inside Grid view Image Button is not firing using an ASP.NET Web form -

inside grid view image button not firing using asp.net web form. if use asp button, working button , easy adding. below design code of grid view button. <footertemplate> <asp:imagebutton id="imgbtnadd" runat="server" commandname="addnew" imageurl="~/imgs/grid_add.png" tooltip="click here add" causesvalidation="true" validationgroup="team_involved_directly" /> <%-- <asp:button id="button1" runat="server" text="add" commandname="addnew" causesvalidation="true" validationgroup="team_involved_directly" tooltip="click here add" />--%> </footertemplate> if use above commented button working fine, image button giving issue. , used !page.ispostback in page load. have tried 'onclick' method button tag?

ios - UITapGestureRecognizer working on UIImageView but not on UILabel -

i have uitableviewcell class named commentstableviewcell among other things includes uiimageview , uilabel . code i'm using: let tapgesture = uitapgesturerecognizer(target: self, action: #selector(commentstableviewcell.showuserviewcontroller)) namelabel.userinteractionenabled = true avatarroundimageview.userinteractionenabled = true namelabel.addgesturerecognizer(tapgesture) avatarroundimageview.addgesturerecognizer(tapgesture) as can understand have function shows uiviewcontroller whenever uiimageview or uilabel tapped. what buffles me tapgesture works correctly on uiimageview not on uilabel . any ideas? you need different gesture control let tapgesture = uitapgesturerecognizer(target: self, action: #selector(commentstableviewcell.showuserviewcontroller)) avatarroundimageview.userinteractionenabled = true avatarroundimageview.addgesturerecognizer(tapgesture) let tapgesture2 = uitapgesturerecognizer(target: self, action: #selector(commentstableview

php - What are the cases where a registration ID of GCM changes? -

i developing web push notification system using google cloud messaging ( only web ). using gcm registration id send push notification in android device. can tell me if there cases or scenarios gcm registration id changed device? fyi, share current knowledge: the gcm registration id changed if application updated or re-installed. if device os updated. my system design follows: first, register registration id of device in database ? ( this 1 time client access site , able registration id , save it ). then, send notification after month or later ( it depends, maybe after 3 months ). here questions: if device os updated in during duration, device id change? if chrome browser updated or reinstalled, device registration id change? if registration id change (because of 1 of reasons above), how can send push notification desired device? appreciate help. in advance.

java - Redirect traffic to particular instance from load balancer -

i using amazon ec2 elastic load balancer application. testing purposes, need hit particular application instance. there way hit specified instance ec2 load balancer? for example, load balancer http://myloadbalancer.com have 2 instances attached, ec21 , ec22. if need hit ec22, there way achieve this? in management console, under particular load balancer , instances section delete ec22 list. once completed tests - add instance behind lb. is meant?

javascript - 'font-awesome/less/font-awesome.less' wasn't found -

Image
i writing task application using gulp minify css gulp.task('handle-styles', function () { return gulp.src('app/styles/*.less') .pipe(less()) .pipe(cleancss()) .pipe(concat('main.css')) .pipe(gulp.dest('./dist/')) }) getting error : [14:46:54] starting 'handle-styles'... potentially unhandled rejection [2] 'font-awesome/less/font-awesome.less' wasn't found. and showing error in main.less file line no.2 main.less: @import 'font-awesome/less/font-awesome'; @fa-font-path: 'font-awesome/fonts'; @import '~bootstrap/less/bootstrap'; @icon-font-path: '~bootstrap/fonts/'; font-awesome version 4.2.0 any following screenshots:

c# - Microsoft azure web apps not listing in publish target list -

Image
i have search here , various smiler post rid of issue facing last 2 days, have post this. here getting when going publish project: i don't know why option of azure web app not listing in list 2 day back. i have updated azure sdk installed have updated visual studio 2015. please let me know if needed other information side. microsoft azure app service == web apps / api apps / logic apps / mobile apps.

Java EE + Spring + Hibernate can't save UTF-8 characters into MySQL Database -

this question might marked duplicate, however, none of stackoverflow answers didn't me. i'm making website using java ee, spring , hibernate, other technologies, however, these relevant ones. website web store, , admin should able add product, it's name, price, manufacturer, etc... working, on website working except saving utf-8 characters in database. problem not in database, it's set utf-8, , if go phpmyadmin, can change characters in desired format, , display properly. here's relevant product adding code... admin product @controller @requestmapping("/admin") public class adminproduct { private path path; @autowired productservice productservice; @requestmapping("/product/addproduct") public string addproduct(model model) { product product = new product(); product.setproductcategory("toys"); product.setproductstatus("available"); model.addattribute("pr

android - Pass a listener to a method that creates View with this listener issue -

this situation: want pass listener view generator using it. problem in listener want use view data. how twisted... way pre-define view interface listener should attach to? adapterview.onitemselectedlistener listener = new adapterview.onitemselectedlistener() { @override public void onitemselected(adapterview<?> adapterview, view view, int pos, long l) { //but can not , use spinner cause not defined string text = spinner.getselectedstrings().tostring(); } @override public void onnothingselected(adapterview<?> adapterview) {} }; generatespinner(attributes, listener); i'm working on mvc project in android , issue come out there, cause should separate creation , logic view , presenter. presenter force view generate spinner given logic. you have answered more half of question yourself. make interface this: public interface myviewcallback {

html - Center an unordered list of boxes -

i have unordered list of boxes. want attracted towards center of window instead of left side of window are. is there function can use this? have attached css , html below reference. #ul_1 { box-sizing: border-box; color: rgb(102, 102, 102); display: inline-block; height: 216px; text-align: center; text-size-adjust: 100%; width: 790px; column-rule-color: rgb(102, 102, 102); perspective-origin: 395px 108px; transform-origin: 395px 108px; border: 0px none rgb(225, 225, 225); font: normal normal normal normal 15px / 24.75px verbregular; margin: 0px; outline: rgb(102, 102, 102) none 0px; padding: 0px; } /*#ul_1*/ #li_2 { box-sizing: border-box; color: rgb(25, 25, 25); display: block; float: left; height: 39px; text-align: center; text-size-adjust: 100%; width: 156.656px; column-rule-color: rgb(25, 25, 55); perspective-origin: 78.3281px 19.5px; transform-origin: 78.3281px 19.5px; background: rgb

node.js - react-router cannot resolve module history, missing lib folder -

i'm creating new react project , have dependency issue between react-router , history : error in ./~/react-router/lib/match.js module not found: error: cannot resolve module 'history/lib/actions' in /app/node_modules/react-router/lib @ ./~/react-router/lib/match.js 15:15-45 error in ./~/react-router/lib/userouterhistory.js module not found: error: cannot resolve module 'history/lib/usequeries' in /app/node_modules/react-router/lib @ ./~/react-router/lib/userouterhistory.js 6:18-51 error in ./~/react-router/lib/creatememoryhistory.js module not found: error: cannot resolve module 'history/lib/usequeries' in /app/node_modules/react-router/lib @ ./~/react-router/lib/creatememoryhistory.js 6:18-51 error in ./~/react-router/lib/userouterhistory.js module not found: error: cannot resolve module 'history/lib/usebasename' in /app/node_modules/react-router/lib @ ./~/react-router/lib/userouterhistory.js 10:19-53 error in ./~/react-router/lib/create

java - Efficient way to find who allocates direct memory -

i working on java project integrates many components many teams. today, observe strong direct-memory consumption unable find allocated. i looking efficient way (tool) investigate such problem thank philippe on top of head remember use jprofiler or jvisualvm, maybe 1 of option you. jvisualvm shipped java vm. jprofiler can downloaded here: https://www.ej-technologies.com/products/jprofiler/overview.html

php - How to streamline Laravel ORM -

excuse me, stupid question.. i use controller, has many orm , want streamline code. my contorller public function news(request $request) { $history = recruitments_status::where('recruitments_status.status',1)->get(); $history_a = recruitments_status::where('recruitments_status.status',2)->get(); $history_b = recruitments_status::where('recruitments_status.status',3)->get(); $history_c = recruitments_status::where('recruitments_status.status',4)->get(); $history_d = recruitments_status::where('recruitments_status.status',5)->get(); $history_e = recruitments_status::where('recruitments_status.status',6)->get(); return view('pl_sidebar/news',[ 'history' => $history, 'history_a' => $history_a, 'history_b' => $history_b, 'history_c' => $history_c, 'history_d' => $histor

css - images to the center of the div in bootstrap -

all images should center aligned irrespective size. have tried below code, doesn't work me. appreciated .border-class{ border:1px solid #ddd; padding:5px; min-height:160px; } <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <div class="container"> <div class="col-xs-3"> <div class="border-class"> <img src="http://www.w3schools.com/bootstrap/cinqueterre.jpg" class="img-responsive" alt="cinque terre"/> </div> </div> <div class="col-xs-3"> <div class="border-class"> <img src="https://cdn2.iconfinde

excel - How to hide shape/chart in VBA? -

i tried find solution on internet, none of them worked situation. i have following chart , want hide it, don't know how: dim cht chart sub createpie() arrcolors = array(rgb(183, 212, 117), _ rgb(0, 93, 172)) set cht = sheets("dashboard").shapes.addchart(left:=600, width:=160, top:=290, height:=90).chart cht .setsourcedata source:=sheets("data").range("m5:n6") .charttype = xlpie .chartarea.format.fill.solid .chartarea.format.fill.transparency = 1 .chartarea.border.linestyle = xlnone end cht.seriescollection(1) .points(1).format.fill.forecolor.rgb = arrcolors(0) .points(2).format.fill.forecolor.rgb = arrcolors(1) end cht.visible = xlsheetveryhidden end sub cht.visible = false doesn't work either. deleting option, cht.delete doesn't work either. you need modify parent (the chartobject ) in order hide whole chart. in

java - Constraining method in generic class to specific type -

the code snippet below not compile; have generic class map maps generic key k floats. of methods deal map in generic way. additionally, want allow initialising map ascending integer values. clearly, requires me constrain method k=integer only. unfortunately, following error: the method put(k, float) in type map not applicable arguments (k extends integer, float) any here highly appreciated! public class myclass<k> { map<k,float> mymap; <k extends integer> myclass(int size){ distribution = new hashmap<k,float>(); integer bar = 0; while(bar<size){ float rnd = threadlocalrandom.current().nextfloat(); mymap.put(bar,rnd); bar++; } } } you can extend class , specify parameter type base class: class myclass<k> { map<k,float> mymap; } class derived extends myclass<integer>{ void sparsepdt(int size){ mymap = new hashmap<integer,float&g

java - Testfx 4 Getting started -

i want implement simple gui test using testfx 4 on adjusted oracle 'hello world' javafx tutorial. based on testfx tutorial, git website unclear have start, , need. could please guide me in right direction? side note, have added necessary dependencies in pom.xml <repositories> <repository> <id>maven-central-repo</id> <url>http://repo1.maven.org/maven2</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependencies> <dependency> <groupid>org.testfx</groupid> <artifactid>testfx-core</artifactid> <version>4.0.1-alpha</version> <scope>test</scope> </dependency> <dependency> <groupid>org.testfx</groupid> &l

ssl - Powershell certificate authentication on standalone server? -

i've tried searching solution half day , decided need ask question myself. my goal remotely control standalone windows servers via powershell on our internal network. our environment based on microfocus edirectory instead of ms active directory our servers not connected via gpos. since powershell have existed such long time , can control commandline installs via assumed there solution in form of certificate authentication client server i've yet find resembling this. i'm aware of workarounds including creating private keys store decrypt in scripts not want risk losing such information , wish able create certificates both new clients , servers without having include form of credentials in scripts. is there no way use certificates authenticate in place of credentials? you should take @ chapter in ps remoting book, describes need. https://devopscollective.gitbooks.io/secrets-of-powershell-remoting/content/manuscript/accessing-remote-computers.html the cer

heroku - Password-Reset / Parse-Server -

Image
i moved app parse.com parse-server. has users , have issue send password-reset mails. getting message: i read on net need change index.js. have no index.js @ point. need make password-reset mails work? have account on mailgun, needed far have read, solve issue. in order support password reset need define email adapter inside index.js file. index.js file located under root folder of parse-server project. index.js file parseserver being initialized. email adapters supported parse-server sendgrid , mailgun adding email adapter pretty simple: install relevant email adapter module. enter npm install {email_module_name} --save in parse-server project folder open index.js file , go parseserver being initalized , add property verifyuseremails: true add emailadapter parseserver being initialized emailadapter: { module: 'parse-server-simple-mailgun-adapter', options: { // address emails come fromaddress: &#

javascript - I want to compare 2 decimals to see which one is greater -

i want compare 2 decimals see 1 greater. this doesn't seem working decimals , works integers (e.g. 1 > 2) , doesn't work floats (1.67 > 1.98). this example doesn't work: this.testorder = (vala, valb): boolean => { const radix = 10; return parseint(vala, radix) > parseint(valb, radix); }; use parsefloat instead of parseint . parseint takes integer part of string.

c# - How to post data to jQuery from ASP.NET page? -

i see lots of information posting data jquery asp.net page using ajax call, nothing other way around. how call jquery method asp.net page? i think want call jquery server side , here example calling jquery c#. scriptmanager.registerstartupscript(this.page, this.gettype(), "script", "postfunction();", true);

ruby - Generate attendance view/form in rails for all students -

i new rails , struggling on sounds easy can not work. have 2 models students , attendances. student model: name lastname classroom_id attendance model: present:boolean absent:boolean halfday:boolean attnd_date:date student_id students has_many :attendances , attendance belongs_to :student . i can make entry individual student , take attendance want generate view show students (or show students given classroom) , next each student name show 3 checkboxes can mark present , absent in 1 go rather 1 one , submit form. any here appreciated. using rails 4 , ruby 2.2.0 thanks you can make edit action, find classroom want mark attendances. class attendancescontroller < applicationcontroller def edit @classroom = classroom.find(<classroom-id>) end def update end end in view edit.html.erb <%= form_for(@classroom, url: '/attendances/:id', method: :put) |f| %> <table> <%- @classroom.students.each |student| %>

jQuery Datepicker minDate getDate not working correctly -

i have 4 datepickers used record dates of paternal leave. datepicker 1 expected due date. datepicker 2 actual date of birth. datepicker 3 start date of paternal leave. datepicker 4 end date of paternal leave. the mindate in datepicker 3 should equal greater of dates entered in datepickers 1 & 2. the code have written appears work ok... until date in datepicker 2 spans across 2 months prior date entered in datepicker 1. example 1: datepicker 1: 03/11/16 datepicker 2: 01/11/16 - mindate = 03/11/16 - correct. example 2: datepicker 1: 03/11/16 datepicker 2: 30/09/16 - mindate = 30/09/16 - incorrect. this results in mindate in datepicker 3 defaulting date entered in datepicker 2. i need getdate method greater date either datepicker 1 or 2 , use date set mindate datepicker 3. here code datepickers 1 – 3 code in datepicker 4 works fine. i reckon mindate method needs tweaking , grateful if shed light on this.... // datepicker 1 $("#paternityleavede

date - Pandas - Convert HH:MM:SS.F string to seconds - Caveat : HH sometimes goes over 24H -

i have following dataframe : **flashtalking_df =** +--------------+--------------------------+------------------------+ | placement id | average interaction time | total interaction time | +--------------+--------------------------+------------------------+ | 2041083 | 00:01:04.12182 | 24:29:27.500 | | 2041083 | 00:00:54.75043 | 52:31:48.89108 | +--------------+--------------------------+------------------------+ where 00:01:04.12182 = hh:mm:ss.f i need convert both columns, average interaction time, , total interaction time seconds. the problem total interaction time goes on 24h. i found following code works part. however, when total interaction time goes on 24h, gives me valueerror: time data '24:29:27.500' not match format '%h:%m:%s.%f' this function using, grabbed stack overflow question, both average interaction time , total interaction time: flashtalking_df['time'] = flashtalking_df[

parsing - How to solve, finding two of each link (Beautifulsoup, python) -

im using beautifulsoup4 parse webpage , collect href values using code #collect links 'new' page pagerequest = requests.get('http://www.supremenewyork.com/shop/all/shirts') soup = beautifulsoup(pagerequest.content, "html.parser") links = soup.select("div.turbolink_scroller a") allproductinfo = soup.find_all("a", class_="name-link") print allproductinfo linkslist1 = [] href in allproductinfo: linkslist1.append(href.get('href')) print(linkslist1) linkslist1 prints 2 of each link. believe happening taking link title item colour. have tried few things cannot bs parse title link, , have list of 1 of each link instead of two. imagine real simple im missing it. in advance this code give result without getting duplicate results (also using set() may idea @tarum gupta) changed way crawl import requests bs4 import beautifulsoup #collect links 'new' page pagerequest = requests.get('http://w

C# SQL Server - save information about user on item when user has been deleted -

i have database need advice on how proceed in situation. assuming have table called tasks. each task has property called createdby need store information user created task. i can store example id of user , when fetch task fetch info user specific task createdby field value john smith example instead of id. far. or how should handle scenario let's user john smith has been removed/deleted system , task still exists, how show name of user created task? still need show john smith in there rather id. in situation, use 'soft deletes' user table. add column user table , name 'active' default value of 1. when wish delete user, set value 0. allow continue enforcing referential integrity users.

php - keep old value in form laravel 5.3 -

i have form have 2 buttons 1 save , add another , 2nd save , exit have field list in form want if user click on save , add list should same saved last time.in db have list_id field list here create method public function create() { $lists = db::table('lists')->select('id', 'name')->get(); $page_data = [ 'title' => trans('mumara.subscribers.add_new_sub.title'), 'action' => 'add' ]; $list_id = isset($_get['list_id']) ? $_get['list_id'] : null; return view('subscriber.create')->with(compact('page_data', 'lists', 'list_id')); } here id list field <div class="form-group"> <label class="control-label col-md-3">add list <span class="required"> * </spa

java - How to calculate 1 month ago in milliseconds? -

i want calculate 1 month ago current time in milliseconds. example if date 25.11.2016 want 25.10.2016 milliseconds format. how can calculate date milliseconds? below code not working think. system.currenttimemillis() - 1000*60*60*24*30 you can use way: calendar c = calendar.getinstance(timezone.gettimezone("utc")); c.add(calendar.month, -1); long result = c.gettimeinmillis(); note system.currenttimemillis() using utc, need create instance of calendar using same timezone.

actionscript 3 - How to remove preloader of Flash? -

Image
i getting loader beofre flash application shows , how remove ? have preloader application , still couldnt find why 1 shows , want remove this. you have extend sparkdownloadprogressbar mx.preloaders.sparkdownloadprogressbar then use preloader property of main application tag; example: <s:application preloader=”com.riagora.loader.preloader”> take @ building custom flex preloader

swift - iOS Table Views -

using thetable views, added label first cell, tried drag view controller ad code, didn't work. (still new programming) this that's in view controller now. import uikit class viewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate { override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } func tableview(_ tableview: uitableview, numberofrowsinsection section: int) -> int { return 3 } func tableview(_tableview:uitableview, cellforrowatindexpath index, path: nsindexpath) -> uitableviewcell{ return } } also this, "parameter requires explicit type error func tableview(_tableview:uitableview, cellforrowatindexpath index, path: nsindexpath) -> uitableviewcell { return } provide c

javascript - jQuery Validate using onclick handler not working? -

i want use jquery validate validate form fields using anchor onclick handler follows doesn't seem work? <input type="text" id="startdate" name="startdate"> <input type="text" id="enddate" name="enddate"> <a class="btn btn-primary js-add" href="#">add</a> <script> $(document).on('click', '.js-add', function (e) { e.preventdefault(); var validator = $("form").validate({ rules: { startdate: { required: true }, enddate: { required: true } }, messages: { startdate: "the start date required", enddate: "the end date required" } }); if (!validator.valid()) { console.log("invalid"); return; }

regex - AHK - How to use dynamic hotstring with a barcode scanner -

i need trigger subroutine when serial number of product has been scanned in barcode scanner. serial number looks this: 11nnnn22334. need use scanned in serial number variable. i tried dynamic regular expression hotstrings library include below, can't make work reliably using barcode scanner (it's fast). don't want slow down barcode scanner. either not trigger subroutine @ or leaves first digit of serial number behind after subroutine been triggered. ideas? test: msgbox, %$1% ; string triggered subroutine return hotstrings("([0-9][0-9]nnnn[0-9][0-9][0-9][0-9][0-9])", "test") /* function: hotstrings dynamically adds regular expression hotstrings. parameters: c - regular expression hotstring - (optional) text replace hotstring or label goto, leave blank remove hotstring definition triggering action examples: > hotstrings("(b|b)tw\s", "%$1%y way") ; type 'btw' followed

javascript - How do I chain multiple selects? -

i'm trying chain selects according mika tuupolas' guide chained selects . here code: ! function(a, b) { "use strict"; a.fn.chained = function(c) { return this.each(function() { function d() { var d = !0, g = a("option:selected", e).val(); a(e).html(f.html()); var h = ""; a(c).each(function() { var c = a("option:selected", this).val(); c && (h.length > 0 && (h += b.zepto ? "\\\\" : "\\"), h += c) }); var i; = a.isarray(c) ? a(c[0]).first() : a(c).first(); var j = a("option:selected", i).val(); a("option", e).each(function() { a(this).hasclass(h) && a(this).val() === g ? (a(this).prop("selected", !0), d = !1) : a(this).hasclass(h) || a(this).hasclass(j) || "" === a(this).val() || a(this).remove()