Posts

Showing posts from July, 2010

asp.net - Stored procedure takes too much time in if statement when i pass @ip='' and takes 0 sec with some value to @IP -

i have below sp , taking time , stopped exec memberlisting 1,20,'','','regdate','desc',0 while works if pass value @ip parameter. don't know why. create procedure memberlisting @pagenum int, @perpageresult int, @username nvarchar(50), @ip varchar(50), @sortcolumn varchar(50), @sortorder varchar(4), @totalcount int output begin declare @temp table(rownum int, id bigint, username nvarchar(50), email nvarchar(50), regdate datetime, country varchar(25), lastlogin datetime, isgoldmember varchar(1)) declare @sort varchar(50) if @ip = '' begin print 'if' set fmtonly off; insert @temp select row_number() on (order case when @sortorder <> 'asc' 0 when @sortcolumn = 'id' id end asc , case when @sortorder <> 'asc' 0 when @sortcolumn = 'username...

html - How to add many functions in ONE ng-change? -

how add more 1 function in ng-change? sample code: <div class="col-md-2"> <select id="sel2" ng-model="updateuser.user.state" name="state" ng-change="change(); updateuser.user.city=''" data-role="listview" required> <option value="">select state</option> </select> </div> you can following <div class="col-md-2"> <select id="sel2" ng-model="updateuser.user.state" name="state" ng-change="change1(); change2(); updateuser.user.city=''" data-role="listview" required> <option value="">select state</option> </select>

c# - Listbox SelectedIndices of wpf window -

how can use following code on wpf listbox window . works fine on normal win form listbox , wanted test on wpf window, im getting error saying 'system.windows.controls.listbox' not contain definition 'selectedindices' , no extension method 'selectedindices' accepting first argument of type 'system.windows.controls.listbox' found (are missing using directive or assembly reference?) this original code have private void listbox1_selectionchanged(object sender, selectionchangedeventargs e) { try { this.textbox1.text = people[listbox1.selectedindices[0]].name; this.connectbox.text = people[listbox1.selectedindices[0]].ipaddress; } catch { } this example of mean "wpf mentality", differs lot archaic winforms mentality of mashing logic , ui: <window x:class="wpfapplication4.window11" xmlns="http://schemas.microsoft.com/win...

Unable to pull events in spark streaming application from flume -

i trying integrate flume spark streaming application. running spark scala sample flumepollingeventcount pull events flume. running spark job on single machine. i have following configuration. avro source -> memory channel -> spark sink a1.sources = r1 a1.sinks = k1 a1.channels = c1 a1.sources.r1.type = avro a1.sources.r1.bind = 192.168.1.36 a1.sources.r1.port = 41414 a1.sinks.k1.type = org.apache.spark.streaming.flume.sink.sparksink a1.sinks.k1.hostname = 192.168.1.36 a1.sinks.k1.port = 41415 a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactioncapacity = 100 a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1 i sending events @ 41414 using avro client , spark streaming not able receive event. i following error when start spark example warn flumebatchfetcher: did not receive events flume agent due error on flume agent: begin() called when transaction open! at flume conso...

xcode - Build Xcarchive with Developer certificate in Appcelerator Titanium -

i developing ios application subcontractor customer specific deployment process. for security reasons, can not provide me production certificate, deployment process following : 1 - provide me developper certificate (and matching provisioning profile) ; 2 - build xcarchive signed certificate ; 3 - deploy xcarchive production certificate. this works fine when developing native application in xcode, because there no restriction signing archive developper certificate. but appcelerator studio/cli, way i've found generate xcarchive via package deployment studio. require production certificate, , don't have any. is there way create archive developper certificate, can provide company i'm working ? thanks, not sure after. if run app on device generate ipa file (in /build/iphone/build/.... directory). use that? that use upload installrapp distributing tests :-) /john

vb.net - Cannot update Data in mySQL database -

what want is, check first if id number exist, if exist updating process, problem is, not update. problem ? sqlconn = new mysqlconnection sqlconn.connectionstring = "server=localhost;userid=root;password='';database=innovative" try sqlconn.open() query = "select full_name employee id='" & txt_id_number.text & "'" cmd = new mysqlcommand(query, sqlconn) reader = cmd.executereader if reader.hasrows = false msgbox("invalid id number please secure id number exist" & vbnewline & "take note:" & vbnewline & "you cannot update or change existing id number primary key employee, if want change it, better delete employee add again." & vbnewline & "other can change full name, age, contact , etc.", vbcritical) else reader.close() sqlconn.open() query1 = "update employee set full_name ='" & txt_fullname.t...

javascript - AngularJS routeProvider redirecting doesn't work -

Image
i have index page, looks this: <!doctype html> <html ng-app="libraryapp"> <head> <meta charset="utf-8"> <title>angular library</title> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="page/js/angular-route.js"></script> <script src="page/js/app.js"></script> <script src="page/js/controllers.js"></script> <script src="page/js/services.js"></script> </head> <body> <div ng-view></div> </body> </html> i have app.js: var app = angular.module('libraryapp', ['ngroute', 'librarycontrollers']); app.config(['$routeprovider', function($routeprovider){ $routeprovider .when('/', { templateurl: 'page/bookslist.html', controller: 'bookslistco...

c# - Throwing exceptions from Linq Query exception -

lets have input string need format list of keyvaluepair<string,float> entries. format of input string key:value;key:value;... lets have linq code it var orr = pco in (overrrides ?? string.empty).split(new char[] { ';' }, stringsplitoptions.removeemptyentries) let pair = pco.split(new char[] { ':' }, stringsplitoptions.removeemptyentries) select new keyvaluepair<string, float>(pair[0], float.parse(pair[1])); now, if input string not formated linq fail on 2 possible points, index out of range on pair[] , format exception on float.parse . both of these exceptions bobble , mean absolutely nothing caller. i know have 2 workarounds (not use linq , loop 1990s or grab above exceptions , repackage), wondering if can somehow inject validation steps linq query throw own exceptions if detect anomaly ( pair.length<2 or pair[1] not number)? one simple option change to: // don't think i'd use ?? this, that's n...

php - How to set image map in a portion of the background image? -

Image
i know how set image map foreground image.but time want set image map portion of image,which set background image of div.how can this.i have searched lot in web,couldn't got solution.please help.for example, html <div class="header full" style="background:url('/hdr.jpg';?>) no-repeat; height:492px"> the entire image set background image,i want click nestle oval portion , redirected url. please try following code use image , rename test.jpg please put in same folder testing , change code needs (this example) **css** (style.css) .image{ background: url("test.jpg") repeat scroll 0 0 transparent; height: 185px; width: 266px; border: 1px solid; } .link{ padding-left: 26px; padding-top: 23px; position: absolute; } .link a{ padding-left: 0; display: block; height: 48px; width: 67px; } .container{ position: relative; } html...

javascript - R2D3's QUnit tests fail out of the box - what am I doing wrong? -

Image
i've checked out r2d3 github, , want run tests. new repo, , not expert on js testing, think correct way @ tests/index.html in web browser, , see whether qunit tests pass. however, when try this, 41 out of 52 tests fail straight out of box (in chrome, firefox , safari on osx): i can see developer tools files loading correctly, isn't path wrong. looking @ code suggests .append() failing. first 2 errors @ line 16 in tests/core/append-tests.js : var el = svg.append('image') , line 20 : var el = svg.append('line') . tracing problem back root in r2d3.v2.js , seems these 2 functions problem: raphael.fn.appendchild = function(childnode) { var node = this.buildelement(childnode); if (node) { this.shadowdom.appendchild(childnode); node.updatestyle(); // apply css styles } return node; }; raphael.fn.buildelement = function(childnode) { var type = childnode && childnode.nodename, node = type ? this[type.tolowercase()]()...

Embed jquery.corner.js in Wordpress? -

i embed jquery.corner.js in wordpress theme, had no luck... what proper way embed script in wordpress theme , use it? this script's url, in case: http://www.malsup.com/jquery/corner/ thank you! :) you should use wp_register_script , wp_enqueue_script . add file theme folder. function include_jquery_corner(){ wp_register_script( 'jq_corner', get_template_directory_uri() . 'path js file' ); wp_enqueue_script( 'jq_corner' ); } add_action( 'wp_enqueue_scripts', 'include_jquery_corner' );

xml - Layout in Android issue -

i trying view : listview http://leyth.dk/upload/server/php/files/newscreen.png problem how can put zip label same line @ textview ? i tried linearlayout both couldn't work, hope can me it. ** update --> forgotten code** <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <linearlayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <!-- name label --> <textview android:id="@+id/name" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="#43bd00" android:textsize="16sp" an...

javascript - D3: How to implement horizontally responsive SVG elements? -

Image
it quite straight forward implement responsive svg elements below. <div id="chartid"/> var svg = d3.select("#chartid") .append("svg") .attr("preserveaspectratio", "xminymin meet") .attr("viewbox", "0 0 600 400"); svg.append("rect") .attr("fill","blue") .attr("x", 10) .attr("y", 10) .attr("width", 500) .attr("height", 500); jsfiddle the following takes place when window size shrank. before shrinking after shrinking as can seen rect angle horizontally , vertically responsive. but, how can implement svg element horizontally responsive , following takes place? one option redraw svg element every time window size changed, know if there more sophisticated solution available. the preserveaspectratio attribute determines scaling , alignment used fit viewbox i...

jquery - Can it possible injecting javascript to dom which is loaded after using ajax call? -

i have div id #id1 contains links. whenever click on links, make ajax call returns other links server. now doing replacing old links new ones in #id1 using jquery replacewith() method. doing so, maintain id of div #id1 . what trying achieve here bunch of links server clicking in newly occupied links on div #id1 , continuously so. is possible write script that? <div id = "id1"> <ul> <li><a href ="test/show/1">link1</a></li> <li><a href ="test/show/2">link1</a>link2</li> .... </ul> </div> <script> $('#id1 a').on(click, function(){ $.ajax({ url: '/test/test_now?page=' + page, datatype: 'json', success: function(response) { $('#id1').repalcewith(response.links); }, error: function() { alert('an error occurred'); ...

vb.net - This error is misleading compared to the User Interface -

Image
error: update requires valid updatecommand when passed datarow collection modified rows. now that's popular question managed find online. have answers, doesn't. here issue. did following tutorial in book microsoft press .. connect sql server database via windows authentication, pull 2 fields table form textboxes showed in screen shot. has add, delete, update buttons (automatically created). then generates following code, , points error @ update line. tried do, update id = 2 id = 3 . there no primary key in table trying out ado.net side compoents(connections/display , on). private sub testdbtable1bindingnavigatorsaveitem_click (byval sender system.object, byval e system.eventargs) handles testdbtable1bindingnavigatorsaveitem.click me.validate() me.testdbtable1bindingsource.endedit() me.tableadaptermanager.updateall(me.testcmddbdataset) //-------<< error end sub so what's real reason of ha...

javascript - Google Chart setAction: how to change TextStyle? -

screenshot playing around google chart (pie), , have setaction written below. code adds button on tooltip. knows how change textstyle of button? not copying format of tooltip itself. chart.setaction({ id: 'sample', text: 'drill down', action: function() { selection = chart.getselection(); switch (selection[0].row) { case 0: alert('downdrill a'); break; case 1: alert('downdrill b'); break; case 2: alert('downdrill c'); break; } } });

c# - Why can't service host from Unity.Wcf resolve service's instance correctly? -

this question has answer here: unity.wcf , instancecontextmode.single 1 answer i have unity container: var unitycontainer = new unitycontainer(); configured follows: unitycontainer.registertype<iexampledomainservice, exampledomainservice>(); unitycontainer.registertype<iexamplewebservice, examplewebservice>(); examplewebservice type , constructor follows: [servicebehavior(instancecontextmode = instancecontextmode.single)] public class examplewebservice { public examplewebservice(iexampledomainservice exampledomainservice) { this.exampledomainservice = exampledomainservice; } // ... and exampledomainservice has no constructor defined (the problem same when explicitly define parameterless constructor type). next, explained in unity.wcf's documentation : if hosting wcf service within windows service using servic...

Assigning a variable based on existence of other variables in ruby 1.9 -

i got job fix webistrano installation , stuck in situation have receipt wherein following assignment broke after update ruby 1.8 ruby 1.9.3 if defined? var_one != nil var_to_be_used = var_one else $logger.info(var_one) var_to_be_used = var_two end i have made sure (by adding above log-entries) var_one , var_two hold expected values. example when expect var_one hold value got following log: ** value in var_one *** undefined local variable or method `var_two' #<capistrano::configuration::namespaces::namespace:0x000000032a6040> the first case never reached. script goes else case - when var_one holds string. how can fix it? i solved with var_to_be_used ||= var_one rescue var_to_be_used ||= var_two rescue nil accessing via var_one.nil? caused undefined local variable or method 'var_one' again.

android - Get child view inside a Listview Adapter -

inside getview method want specific child view. know adapter holds several items, doing calling getcount: getcount(); according javadoc: public abstract int getcount () added in api level 1 how many items in data set represented adapter. now in getview method: public view getview(final int position, view convertview, viewgroup parent) { view lastaddeditem = parent.getchildat(getcount()-1); if(lastaddeditem == null) { log.w("listadapter", "view null"); } } this message appears in logcat , means view try grab null . i've tried this: view lastaddeditem = parent.getchildat(parent.getchildcount()-1); so how can grab specific view viewgroup object? i know adapter holds several items, doing calling getcount: yes does, getcount() (returning items in adapter ) method of adapter has nothing getting children of listview getchildat() (where should use getchildcount() return views present in viewgroup ). lasta...

html - HTML5 Pattern Regex failing -

i'm trying use following pattern prevent users submitting non-alphanumeric characters, reason pattern rejects alphanumeric entries. <input id="service_desk_id" type="text" class="form-control" id="stuckreportsfixsd" name="stuckreportsfixsd" placeholder="sd id" data-toggle="popover" data-trigger="focus" data-placement="right" data-trigger="focus" data-content="if have one, enter service desk id service desk ticket." pattern="[a-za-z0-9]" title="no non-alphanumeric characters." /> i don't understand why reject following entry: "sdds2020" does, saying doesn't match pattern. fails print title, leaving explanation blank. causing , how can fix it?

jquery - positioning images at top right of a div -

my question how can place image or span on top right of div. searched in google , found that /* div contains image or span */ #div{ position:relative;} /* image or span */ #span{ position:absolute; top:0px; right:0px;} but not finding. not take space , other things goes down or of this. please give me solution this. use position:relative , absolute html <div class="wrap"> <span>right aligned</span> </div> css .wrap{ position:relative; width:150px; height:150px; background:yellow } span{ display:inline-block; position:absolute; right:0; top:0; background:red } demo method 2 use float:right instead of position:absolute .wrap{ width:150px; background:yellow; display: inline-block; } span{ background:red; float:right; display: inline-block; } demo 2

Separate data encryption -

i store sensitive data. data divded parts , want have separate accees each part. let's assume have 1000 files. want encrypt each file same symetric encryption algorithm. guess breaking key easier when hacker has got 1000 cryptogram has 1 cryptogram, think should use separate key each file. question following: should use separate key each file? if should, there problem storing 1000 keys. want have 1 secret key , use own algorithm calculate separate key each file secret key. idea? if consider passive adversary , use cpa-strong cipher (like aes), sufficient use 1 key files. supposing adversary knows cipher use, , knows plaintexts, cannot reconstruct key non-negligible probability. here more detailed answer. if consider active adversary (which can replace ciphertexts) should use authenticated encryption. understand not case. so want have 1 secret key , use own algorithm calculate separate key each file secret key. idea? in general, developing own algorithm...

jquery - Submit button doesnt do anything -

when clicking on submit button after completeing form, doesnt go controller post method, issue caused jquery, dont know why. remove script submit button works. @section scripts { @scripts.render("~/bundles/jqueryval") <script type='text/javascript'> $(document).ready(function () { $("#brand_brand_id").change(function (e) { e.preventdefault(); // call when brand dropdown select change var brandid = parseint($("#brand_brand_id").val()); if (!isnan(brandid)) { var ddmodel = $("#model_id"); ddmodel.empty(); // line clear items model dropdown ddmodel.append($("<option></option").val("").html("select model")); // here call controller action via jquery load model selected brand $.ajax({ url: "@url.action("getmodels","...

html - Wrap two specific elements with jquery -

i have elements like <div id="one">one</div> <div id="two">two</div> <div id="three">three</div> <div id="four">four</div> <div id="five">five</div> now want wrap div tag around 2 elements id "two" , "three" this: <div id="one">one</div> <div class="wrapped"> <div id="two">two</div> <div id="three">three</div> </div> <div id="four">four</div> <div id="five">five</div> with "wrapall" function can target elements same class think like: $(document).ready(function(){ $( "div" ).wrapall( "<div class='wrapped' />"); }); i know give 2 divs same class jquery first , wrap them i hope there more elegant way . you can $('#two, #three').wrapall('...

java - Run a runnable JAR file in a folder / Directory with a UTF-8 style name -

when create jar file in ordinary way this: c:/myfolder/program.jar run without problem, when create abnormal name (utf-8 languages) folder this: c:/پوشه/program.jar program cannot run , os (windows me) says this: title: java virtual machine launcher context: error: unable access jarfile c:/پوشه/program.jar is possible solve problem? this problem solved solution: error: unable access jarfile. encoding issue however, exe files don't need these additional settings , files execute in case.

Rails 3: Instance variable inaccessible in .js.erb file -

i'm trying build simple page, need generate dynamic javascript photo gallery. intuitively simple, i'm struggling greatly. in controller building list of photo @photos , need iterate out javascript each photo in photo.js.erb file. however, whenever reach .js.erb file, @photos variable becomes nil... missing? controllers/photos_controller.rb file: class photoscontroller < applicationcontroller layout "application_photos" def category @photos = ...(generates collection of photos)... end end views/photos/category.html.haml file: = content_for :head // @photos still initialized @ point = javascript_include_tag "photos" // partial loads more markup, it's inconsequential. = render :partial => 'default_slideshow' javascripts/photos.js.erb file: jquery(function($){ // throws nilclass error <% puts 'photos: ' + @photos %> }); i know question has been asked dozen times, none of accepted an...

Function call to declare object property in JavaScript -

is possible use function call set object property in js? tried didn't work. var name = "richard"; function showname() { var name = "jack"; // local variable; accessible in showname function​ console.log(name); // jack​ } console.log(name); // richard: global variable var myobj = { name: showname(); }; console.log(myobj.name); is possible use function call set object property in js? yes, right-hand side of property initializer can contain expression, including function call. expression evaluated , resulting value assigned property. (and if have multiple property initializers in object initializer, they're executed in source-code order.) your example didn't work because didn't return name showname (and because has ; ): var name = "richard"; function showname() { var name = "jack"; snippet.log(name); return name; // <== added return name; } snippet....

struct - I need help shuffling integers in blackjack, C -

i have 3 different functions, 1 fill deck, 1 shuffle , 1 deal cards. have implemented int value in function filldeck , that's working fine. when shuffling value in same function deck not working, don't errors when debug visual studio says it's unable read memory. doing wrong? filldeck function void filldeck(card * const deck, const char *suit[], const char *deck[], const int *value[]){ int s; (s = 0; s < 52; s++){ deck[s].suits = deck[s % 13]; deck[s].decks = suit[s / 13]; deck[s].value = value[s % 13]; } return; } shuffle function void shuffle(card * const deck, const int *value[]){ int i, j; card temp; (i = 0; < 52; i++){ j = rand() % 52; temp = deck[i]; deck[i] = deck[j]; deck[j] = temp; value[i] = value[j]; // <-- not working } return; } deal function void deal(const card * const deck, int size, int size_1, int size_2){ int i, j, length; char anothercard[2]; char name1[30]; char name2[30]; printf("name ...

printf - Using two arguments in sprintf function in gnuplot -

i've been trying graph several files on same gnuplot graph using sprintf read in filenames. can read in 1 argument o.k. if write: filename(n) = sprintf("oi04_saxs_%05d_ave_div_sub.dat", n) plot [i=1:10] filename(i) u 1:2 then graph o.k , files argument plotted on same graph. have string of characters changes near end of filename , when try reflect in filename(n,m) = sprintf("oi04_saxs_%05d_0001_%04s_ave_div_sub.dat",n,m) plot [i=1:10] filename(i,m) u 1:2 i following error message: 'undefined variable m'. i've tried removing loop , running plot filename(m) and results in same error message. in understanding what's going wrong , how fix appreciated :) this full script: unset multiplot reset set termoption enhanced set encoding utf8 set term pdf size 18cm,18cm font 'arial' set pointsize 0.25 set output 'stoppedflowresults.pdf' set logscale set xlabel '{/:italic r} / [q]' set ylabel '{/:italic i...

ruby on rails - CSS doesn't work when deploy to Heroku [Solved] -

this question has answer here: heroku not compile files under assets pipelines in rails 4 15 answers css doesn't work when deploy rails application heroku. my application.css.scss has: @import 'normalize'; @import 'skeleton'; @import 'animate.min'; @import 'froala_editor.min.css'; @import 'froala_style.min.css'; @import 'font-awesome'; @import 'plugins/char_counter.min.css'; @import 'plugins/code_view.min.css'; @import 'plugins/colors.min.css'; @import 'plugins/emoticons.min.css'; @import 'plugins/file.min.css'; @import 'plugins/fullscreen.min.css'; @import 'plugins/image_manager.min.css'; @import 'plugins/image.min.css'; @import 'plugins/line_breaker.min.css'; @import 'plugins/table.min.css'; @import 'plug...

javascript - using $.each jquery to create html select option in ajax success -

i have bootstrap modal contains form. form using lot of data database, use php them : public function get_view_for_inspection_report_belum_eor(){ $q = $this->inspection->get_view_for_inspection_report_belum_eor(); echo json_encode($q); } it gives me new json code : [{ "no_inspection": "5", "no_surat": "00005", "date_of_description": "2016-01-04 21:00:37", "nama_surveyor1": "surveyor", "nama_surveyor2": "surveyor", "insulation": "3", "vessel": "mv wan hai 171", "prefix": "eolu", "serial_number": "1111111", "nama_clean_item": "surfonic agm 550", "tariff": "0.00", "comments": "test surveyor 1\r\n\r\ntest surveyor 2" }, { "no_inspection": "4", "no_surat": "00004", "date_of_description...

javascript - protractor unable to click input='button' value -

i'm new protractor , learning , struck in place. i'm having form submit shown below. <input type="button" value="sign up" class="btn btn-success btn-small" data-ng-click="chceckme()" /> i tried following ways not figure out element(by.css('.btn-form')).click(); element(by.css('.btn .btn-success .btn-sm .btn-form')).click(); element(by.css('[ng-click="redirectregister()"]')).click(); element.getattribute('login').submit(); all of them throws error.....please me out , appreciated.thanks in advance. nothing has .btn-form class, or ng-click="redirectregister()" attribute, or 'login' attribute. none of selectors correspond remotely element. expect happen? '.btn .btn-success .btn-sm .btn-form' not list of elements, it's parent > child > child > child selector. want '.btn.btn-success.btn-sm.btn-form' instead. and chceckme(...

java - Anyway to have undertow path template with wildcards -

i need handle requests may have number of sub path elements (that can ignore), e.g. following map same handler: /abc?type=a /abc/foo?type=a /abc/foo/bar?type=a the code have come is: handlers.pathtemplate().add("/{id}", handler).add("/{id}/foo", handler).add("/{id}/foo/bar", handler); but not ideal need define each possible path, there anyway allow (and ignore) number of paths following prefix e.g. handlers.pathtemplate().add("/{id}*", handler) handlers.path().addprefixpath allows sort of matching lose path template variables.

dynamo local - Whats the best way to query dynamodb based on date range? -

as part of migrating sql dynamodb trying create dynamodb table. ui allows users search based on 4 attributes start date, end date, name of event , source of event. table has 6 attributes , above 4 subset of other attributes being priority , location. query described above makes mandatory search based on above 4 values. whats best way store information in dynamodb me in querying based on start date , end date easy. thought of creating gsi hashkey startdate, rangekey end date , gsi on rest 2 attrributes ? inshort: table in dynamodb have 6 attributes eventname, location, startdate, end date, priority , source. query have 4 mandatory attributes startdate, enddate, source , event name. thanks help. you can use greater than/less comparison operators part of query http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/queryandscan.html so try build table schema: (eventname (hashkey), "startdate-enddate" (sortkey), other attributes) in case sort-key...

python - Directory issues within Pycharm (free version) & Perforce -

ok, i'm looking switch pycharm pyscripter os independent development. wanted mention i'm using perforce version control. so double click .py editing in perforce, , pyscripter opens , edit hearts desire. can click on imported function, , it'll open corresponding .py file , bring me right function. awesome. so have yet able achieve on pycharm. i'm using community version should fine want, editor python checking & built in console. when set default .py program use in perforce pycharm, click on .py , pycharm fires up. far. problem arises when try "ctrl + click" function or method. "cannot find declaration go to." import associated class & file. (just example, not actual code). in transportation.py have "import cars", .py. cars.numberofdoors() , above error. folder structure is: scripts (folder) population.py (general support script) citybudget.py (general support script) masstransit (folder) transportation.py cars...

php - select count 3 tables -

this question has answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 resource or mysqli_result, boolean given 33 answers i trying query 3 tables returning error. want code check 3 tables whether user registered in 1 of these tables if tries log in. please me i'm php beginner. i following error: warning: mysql_result() expects parameter 1 resource, boolean given in this code: //check user if exist function user_exists($username){ $username = sanitize($username); return (mysql_result(mysql_query("select count(`user_id`) `users`,`admin`,`guest` `username` = '$username'"), 0) == 1) ? true : false; it appears attempting grab 3 different tables using single select , cannot work. i'd suggest trying use join , if unfamiliar (and in worst case), using 3 separate selec...

networking - SSH from Virtualbox Guest to DynDNS address -

i have windows 10 host manjaro installation guest on virtualbox. have set debian server on house ssh installed. have setup dyndns on debian's network can access remotely. for example.. from address 12.34.56.78 ssh foo.dyndns.org:1234. port redirects me 192.168.1.5:22 debian machine , connection established. able windows 10 android , other device in 12.34.56.78 or 3g. but.. when try this $ ssh foo.dyndns.org:1234 from manjaro guest in virtualbox following error: ssh: not resolve hostname foo.dyndns.org:1234: name or service not known so did ifconfig , saw inet address 10.0.2.15. changed virtualbox's network adapter nat bridged can lan ip , got host's ip, 192.168.2.4. gave try , still didn't work. also, if try connect vm server while i'm in same network $ ssh user@192.168.2.5:22 it works. in case virtualbox's network adapter nat. this command works if try android (connectbot). i can connect same way putty windows. so questions are: ...

linux - Laravel - Connection could not be established with host smtp.gmail.com -

i've tried possible solutions available here in stackoverflow, nothing... think problem related firewall, can send mail using smtp gmail on local machine, not in server, following message: connection not established host smtp.gmail.com [connection timed out #110] i've tried following commands: ufw allow 587/tcp iptables -i output -p tcp --dport 587 -j drop iptables -i output -d smtp.gmail.com -p tcp -m tcp --dport 587 -j accept iptables -l output -n however not worked... this .env email settings: mail_driver=smtp mail_host=smtp.gmail.com mail_port=587 mail_username=*****@gmail.com mail_password=***** mail_encryption=tls my controller sending emails: public function postemail(postemailrequest $request) { if ($request){ mail::send('app.pages.contato.email', $request->all(), function($message) use ($request) { $message->from($request->email , config('settings.website_title')); $message-...

Go Build tag - getting timestamp on Windows -

i have seen following command set build version go build -ldflags "-x main.minversion `date -u +.%y%m%d%.h%m%s`" service.go but cant timestamp part work on windows ! i using go 1.5 following arguments... build -i -ldflags "-x main.server_name=mffp -x main.version=1.0.0 -x main.build_date=`date -u +.%y%m%d%.h%m%s`" the error date part is error system related? tried on windows? thanks! the command on *nix systems using backtick command substitution. date built-in on posix, , inside ` s interpreted shell command , replaced value. cmd.exe doesn't command substitution inside backticks @ all, there's ways accomplish same thing using for /f delims="" , aka powerful command in windows shell, it's pretty hacky. maybe use powershell instead, supports $(command) syntax? ps c:\users\adsmith> go build -i -ldflags "-x main.server_name=mffp -x main.version=1.0.0 -x main.build_date=$(get-date -uformat .%y%m%d%.h%m%s)...

android - How to set Am/Pm? -

i using date picker plugin android application. got plugin link https://github.com/brodyspark/phonegap-plugins/tree/master/android/datepicker . can tell me how set meridian time picker? you have change last parameter in timepickerdialog's constructor (which named is24hourview ) true false . it's line 101: final timepickerdialog timedialog = new timepickerdialog(currentctx, timesetlistener, mhour, mminutes, true); should be final timepickerdialog timedialog = new timepickerdialog(currentctx, timesetlistener, mhour, mminutes, false);

javascript - Getting Ajax error when invoking Servlet -

i'm brand new ajax , servlet. i'm trying call servlet ajax function.its not working. here javascript file: ajaxs.js var xmlhttp; function ajaxfunction() { xmlhttp=getxmlhttpobject(); if (xmlhttp==null) { alert ("your browser not support ajax http"); return; } var numberlist = document.getelementbyid("inputstring"); var kth = document.getelementbyid("nthhighest"); xmlhttp.open('post','/hellohalozen/highestnumber',true); xmlhttp.onreadystatechange = handleserverresponse; xmlhttp.setrequestheader('content-type', 'application/x-www-form-urlencoded'); xmlhttp.send("inputstring=" + numberlist.value + "&nthhighest="+kth.value); } function getxmlhttpobject() { if (window.xmlhttprequest) { return new xmlhttprequest(); } if (window.activexobject) { return new activexobject("microsoft.xmlhttp"); } return null; } fu...

difference between two dates in java in 'EST' time zone -

i have parse string date, let givendate , est timezone. also, have take current date, let currentdate in est timezone. current timezone ist (gmt+5:30). if currentdate greater givendate need add day currentdate. here solution have implemented. simpledateformat df = new simpledateformat("mm/dd/yyyy"); calendar givendate = calendar.getinstance(timezone.gettimezone("est")); givendate .settime(df.parse("01/08/2016")); calendar currentdate = calendar.getinstance(timezone.gettimezone("est")); if(currentdate.get(calendar.year) > givendate .get(calendar.year) || currentdate.get(calendar.day_of_year) > givendate.get(calendar.day_of_year)){ currentdate.add(calendar.date, 1); } system.out.println("final date : "+df.format(currentdate.gettime())); is there better solution this? also, following has been tickling mind. consider code snippet simpledateformat df = new simpledateformat("mm/dd/yyyy...