Posts

Showing posts from February, 2015

css - Make div keyboard-scrollable in jQuery Mobile? -

from can tell, although jquery-mobile-powered pages can contain divs overflow set scroll or auto, , these divs can scrolled one-screen bar or mouse wheel, cannot scrolled using arrow keys, page-up/page-down, or home/end. instead, official "page" div (with data-role="page") absorbs input. perhaps other divs can't acquire focus, i'm not sure. is there way around this? edit: jsfiddle of simple example: https://jsfiddle.net/qogz0shx/ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"> </script> <link rel="stylesheet" href="https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.css"/> <style> #outer { overflow:scroll; height: 50vh; width: 50vw; } #inner { height: 500vh; width: 500vw; } &l

python - Requests: Explanation of the .text format -

i'm using requests module along python 2.7 build basic web crawler. source_code = requests.get(url) plain_text = source_code.text now, in above lines of code, i'm storing source code of specified url , other metadata inside source_code variable. now, in source_code.text , .text attribute? not function. couldn't find in documentation explains origin or feature of .text either. requests.get() returns response object ; object has .text attribute; not 'source code' of url, object lets access source code (the body) of response, other information. response.text attribute gives body of response, decoded unicode . see response content section of quickstart documentation: when make request, requests makes educated guesses encoding of response based on http headers. text encoding guessed requests used when access r.text . further information can found in api documentation, see response.text entry : content of response, in unicode.

WinAPI: set fill color of a readonly textbox -

i have program winapi (c++) complete. problem want set fill color of text box , textbox readonly. when set textbox readonly, can't fill white. , when don't, can filled white. how create textbox: createwindow(l"edit", text, ws_child|ws_visible|ws_border|es_readonly|es_right, left, top, width, height, hwnd, (hmenu)id, hinst, null) and code in winproc: case wm_ctlcoloredit: settextcolor((hdc)wparam,rgb(0,0,255)); setbkcolor((hdc)wparam,rgb(255,255,255)); setbkmode((hdc)wparam, transparent); return (lresult)getstockobject(white_brush); you'll want use wm_ctlcolorstatic read-only text boxes; see docs wm_ctlcoloredit .

encoding - Lighttpd and Python web page: Cannot not convert data into an integer -

please, making easy python web page without framework. have problem if tried value tuple #!/usr/bin/env python3 # -*- encoding: utf-8 -*- import cgitb cgitb.enable() # code here # .... # months in slovak language months = ('január', 'február', 'marec', 'apríl', 'máj', 'jún', 'júl', 'august', 'september', 'október', 'november', 'december') month = int(last_day_of_month(today).strftime("%m")) # code here # ... # print ("\t" + '<title>{0} {1}' + str(months[month-1]) + ' ' + str(year) + '</title>') here got error: cannot not convert data integer it works if months defined in ascii, like: months = ('janury', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december') this works ri

logging - Spring Integration: How to know when a work flow completes? -

Image
i working on adding logging/monitoring functionality multiple spring integration deployments. want create logger transaction @ start of workflow , close log transaction @ end of workflow. @ end of logger transaction send out logs , metrics centralized logging server. @ end of day want see logs messages went through workflows across multiple spring integration deployments. the spring integration deployments across lot of teams , cant count on each team add logging code me, want write code run across spring integration deployments. to start log transaction,the solution use global-channel interceptor on set of inbound messaging channels. workflows built across deployments use same set of inbound channels, start log transaction interceptor run. pass logger transaction details part of message headers but having trouble figuring out solution ending transaction. workflows can synchronous asynchronous. not endpoints within workflow have output channel. any strategies/ideas on how

php - SimpleXML multidimensional nodes -

i have xml this: <properties> <property>name</property><value>john</value> <property>surname</property><value>wayne</value> <property>age</property><value>33</value> <property>blaaa</property><value>blaa</value> </properties> i have parse , used this: $xle = simplexml_load_file('xml.xml'); foreach ($xle->properties $properties) {     foreach ($properties->property $property) {         echo $property, "<br />\n";     }     foreach ($properties->value $value) {         echo $value, "<br />\n";     } } i came far, need like "property = value" "name = john" my code outputs : name surname age blaa john wayne 33 blaa each value following sibling property element. can express xpath quite easily: following-sibling::value[1] will give <value> element if <property>

xaf - devexpress get field from last row in child list -

i need in this. have table (master) , table b (child). i'm using devexpress xaf. need evaluate last row in child , show users in master table a. lets table has followind fields: oid, employee, address [name] = persistent filed employee lets table b has following fields: oid, employee (references tbale a), status (open, assigned, closed), status date the child table has @ least 2 records each master record: oid employee status status date 1 mark open 2015-12-12 2 mark assigned 2015-12-13 3 mark closed 2015-12-29 so far used this: [persistentalias("tableb[status != 'closed']")] public getstatus { {return evaluatealias(getstatus)}; } i want show in master table a, each employee, last status of child list. when run code, open, because different closed, want if last line in table b status = closed, should return closed. don't know if explayned right! ideas? t

prototypal inheritance - Javascript call the base class constructor -

person base class , emp inherits person . trying use name , location properties of person in emp . function person(name, location){ this.name = name; this.location = location; } person.prototype.getname = function(){ return 'name: ' + this.name; } function emp(id, name, location){ this.id = id; person.call(this, name); person.call(this, location); } emp.prototype = object.create(person.prototype); var e1 = new emp(1, 'john', 'london'); e1.id // 1 e1.name // 'london' e1.location //undefined what causing error , why name taking value of london? why calling constructor twice single argument? function emp(id, name, location){ this.id = id; person.call(this, name, location); }

Call a python function from vba -

i trying call python function in .py file in vba. i use command open python shell : pathctrl = "c:\users\test\desktop" chdir pathctrl call shell(pathctrl & "\anaconda_python.bat ", vbnormalfocus) i don't know how write vba command run specific function within python shell. this vba question (and not related python). according @ripster, in execute command in command prompt using excel vba , can call script call shell(...) .

php - Codeigniter routes not working since changing server -

i've put production codeigniter website , i'm getting strange behaviour i'm not able debug. i'm using mod rewrite , pages points home (default route) unless use index.php in url. example. mywebsite.com/class/method -> points same page mywebsite.com/index.php/class/method -> points right page. in config: $config['index_page'] = ""; this htaccess. rewriteengine on rewritecond $1 !^(index\.php|lib|robots\.txt|upload) rewriterule ^(.*)$ /index.php/$1 [l] website has been copied 1 server other 1:1 (with different db configuration). i'm getting desperate i've no idea what's happening here. mod_rewrite enabled on hte server. thank help, you'll save me nervous breakdown. after giving found issue. the server didn't support $_server['path_info'] disabled in apache. for quick fix can change setting auto in config.php also read here: codeigniter $config['uri_protocol'] problem

jasmine - SyntaxError: Unexpected token static -

i'm trying evaluate different testing frameworks work react, , turns out jest on list. however, i'm trying use static properties outlined here: https://github.com/jeffmo/es-class-fields-and-static-properties . so, took tutorial given on jest homepage, , added static proptypes property, code looks this: import react 'react'; class checkboxwithlabel extends react.component { static defaultprops = {} constructor(props) { super(props); this.state = {ischecked: false}; // since auto-binding disabled react's class model // can prebind methods here // http://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html#autobinding this.onchange = this.onchange.bind(this); } onchange() { this.setstate({ischecked: !this.state.ischecked}); } render() { return ( <label> <input type="checkbox" checked={this.state.ischecked} onchange={this.onchange}

amazon s3 - boto3 S3 upload using aws key -

the boto3 documentation recommend configure key command line. if there anyway can put aws key python source code? below code reference. if have aws cli, can use interactive configure command set credentials , default region: aws configure follow prompts , generate configuration files in correct locations you. import boto3 s3 = boto3.resource('s3') bucket = s3.bucket('my-bucket') obj in bucket.objects.all(): print(obj.key) see under 'method parameters' in official documentation ; from boto3.session import session session = session(aws_access_key_id='<your access key id>', aws_secret_access_key='<your secret key>', region_name='<region name>') _s3 = session.resource("s3") _bucket = _s3.bucket(<bucket name>) _bucket.download_file(key=<key>, filename=<filename>)

osx - pip3 install matplotlib fails with Command "python setup.py egg_info" failed with error code 1 Mac OS X -

i new python, not programming or mac os x. have searched internet hours , i've tried every solution can find, including manually installing/uninstalling everything. exact same command works using pip, not pip3. i can't remember half solutions i've tried, here's can remember: -installed numpy manually -installed anaconda -reinstall python/python3 -installed pkg-config manually -installed numpy manually any , appreciated! full terminal output: rover-230-17:~ unwrittenrainbow$ pip3 install matplotlib collecting matplotlib using cached matplotlib-1.5.1.tar.gz complete output command python setup.py egg_info: ============================================================================ edit setup.cfg change build options building matplotlib matplotlib: yes [1.5.1] python: yes [3.5.1 (v3.5.1:37a07cee5969, dec 5 2015, 20:58:59) [gcc 4.2.1 (apple inc. build 5577)]] platform: yes [darwin] required d

dom - PHP DOMNodeList Error: Works in dev but not in production -

i have below piece of code working fine on local development server should not on production. local development environment using php 5.6.12 , production server using php 5.4.36 , i'm getting below error in production logs, no errors in local development logs. php fatal error: cannot use object of type domnodelist array in /public_html/dev_host/jobs.php on line 111 line 110 - 113: $productraw = $data->getelementsbytagname('a'); $productid = $this->parseproductid($productraw[0]->attributes[0]->nodevalue); $productattributes = (array) json_decode($productraw[0]->attributes[2]->nodevalue); $productdetails = $this->parseproductdetails($productattributes['name']); the ability treat domnodelist array added in php 5.6.3. earlier php 5.6.3, have use $productraw->item(0); instead of $productraw[0] . this bug #67949 , listed in 5.6.3 changelog , otherwise appears undocumented.

javascript - Use a mysql connection across my express js app -

i pretty new node.js , express bear me please. i wondering how can mysql instance , use in controller. have 4 files this: see comment in controller.js file server.js : var express = require('./config/express'); var app = express(); module.exports = app; app.listen(3000); console.log('server running'); express.js : var express = require('express'), bodyparser = require('body-parser'), mysql = require('mysql'); module.exports = function() { var app = express(); app.use(bodyparser.urlencoded({ extended: true })); app.use(bodyparser.json()); app.set('views','./app/views'); app.set('view engine','ejs'); //not sure here or put connection details var dbconnection = mysql.createconnection({ host : 'localhost', user : 'someuser', database : 'somedb', password : 'somepass' }); //connection.connect(); // //connection.query('select 1 + 1 so

javascript - tweenMax 'staggerFrom' and 'From' broken with requestAnimationFrame? -

for reason when use or staggerfrom requestanimationframe, animation jumps , acts if it's doing "to" tween. when use code outside of requestanimationframe, works fine. why this? need use within requestanimationframe because trigger tween when scroll @ position , need requestanimationframe determine position (i advised that's correct way instead of attaching scroll). here's tween: tweenmax.staggerfrom(".box", 1, { x:100, autoalpha: .5}, .5); i made quick codepen demonstrating issue.

javascript - If removeClass doesn't affect source code, what's the point? -

i have bunch of forms pattern: <form action="/go/special" method="post" target="_blank"> <input name="a" type="hidden" value="something"/> <input type="submit" class="general effect" value="click me"></form> for each form has special inside action, want remove effect class using jquery code: <script src="/js/colorbox.js"></script> <script> jquery(function($) { // find forms have "special" in action, find input, , add class $('form[action*="special"] input[type="submit"]').removeclass('effect'); }); </script> edit: effect class code: (jquery, document, window), $(document).ready(function() { $(".effect").click(function(t) { t.preventdefault(); var e = $(this).closest("form"); return $.colorbox({ href: e.attr(&

ruby on rails - Access to top domain cookies from subdomain application -

my vbulletin forum sets cookies on domain-name.com , , i'd read these cookies within rails app on beta.domain-name.com . how can this? if set cookie's domain to: .domain-name.com (dot @ beginning), can access it's cookies subdomains, if domain domain-name.com (withouth dot @ beginning) can access it's cookies domain.

About Javascript output in Google App Script -

i got problem output of code weird. wanna sum number. var reserve_num =0 var sheets = spreadsheet.getsheets(); for(var in sheets){ var reserve_sheet = sheets[i]; var num = reserve_sheet.getrange("d1").getvalue(); reserve_num += num; } //insert sheet("c6") 確認済 sheet.getrange("c6").setvalue(reserve_num); in code need calculation of variable 'num' got string. i'd know how fix it if line: var num = reserve_sheet.getrange("d1").getvalue(); is returning number string, can convert number string number number number() : var num = reserve_sheet.getrange("d1").getvalue(); var num = number(num); logger.log('typeof num: ' + typeof num);

python - How to convert neatly 1 size numpy array to a scalar? Numpy "asscalar" gives error when input is not a 1 size array. -

i have silly interest in how avoid following error in smart way (possibly using right numpy functions). in many ocasions need use numpy function find single item. however, item present more once, use indeces function in way in output simple variable (if appears once, either string or float) or array (if mutiple instances). of course, use len() in boolean check , perform conversion. however, know if there 1 step approach. had tought use asscalar however, function returns , error if input not 1 value array (i had hope return input value unchanged :/). here reproduction of error on second part of code import numpy np inventory = np.array(['eggs', 'milk', 'ham', 'eggs']) drinks = 'milk' food = 'eggs' index_item_searched = np.where(inventory == drinks) items_instore = np.asscalar(inventory[index_item_searched]) print 'the shop has', items_instore index_item_store = np.where(inventory == food) items_instore =

c# - How to create empty-conditional operator for collections similar to null-conditional operator? -

c# 6.0 introduced null-conditional operator, big win. now have operator behaves it, empty collections. region smallestfittingfreeregion = freeregions .where(region => region.rect.w >= width && region.rect.h >= height) .minby(region => (region.rect.w - width) * (region.rect.h - height)); now blows if where returns empty ienumerable , because minby (from morelinq ) throws exception if collection empty. before c# 6.0 solved adding extension method minbyordefault . i re-write this: .where(...)?.minby(...) . doesn't work because .where returns empty collection instead of null . now solved introducing .nullifempty() extension method ienumerable . arriving @ .where(...).nullifempty()?.minby() . ultimately seems awkward because returning empty collection has been preferable returning null . is there other more-elegant way this? imho, "most elegent" solution re-write minby make in minb

ruby on rails - Empty? fails on ActiveRecord with a default_scope( :order) -

occasionally want check whether person model has organizations. straightforward enough; use @person.organizations.empty? . however, coupled default_scope ( default_scope { order(:name) } ), error: activerecord::statementinvalid (pg::invalidcolumnreference: error: select distinct, order expressions must appear in select list line 1: ... "relationships"."person_id" = $1 order "organizat... ^ : select distinct 1 one "organizations" inner join "contracts" on "organizations"."id" = "contracts"."organization_id" inner join "relationships" on "contracts"."id" = "relationships"."contract_id" "relationships"."person_id" = $1 order "organizations"."name" asc limit 1): i'm using postgres db , (abbreviated) model setup looks follows:

Retrieve gdb option values -

is there way in gdb retrieve (not print) value of options logging file, logging redirect, etc.? why provide set command no command? why provide set command no command? rtfm . command called show , info .

while loop - im creating a c++ program where the user has 2 attempts in trying a password username combo. If they cant get it they program stops -

this error getting. moving on python c++ , huge adjustment. description of program: write program creates 3 or more valid username/password combinations, prompts user enter username , password. if combination valid, print confirmatory message. if combination invalid on first try, print warning message , let user try 1 more time (prompt them again username , password). if second try correct, print confirmatory message. if second try incorrect, print chiding message. in either case, halt program after second attempt. show output 3 cases: correct username/password on first attempt; correct on second attempt; incorrect on both attempts. $ g++ username_password.cpp -o username_password username_password.cpp: in function ‘int main()’: username_password.cpp:34:2: error: ‘else’ without previous ‘if’ else if (username != "veasy62" && username != "tveasy62" && username != "terriyon62" && password != "a65908" &&

javascript - CKEditor 4 in read only mode - removing buttons removes formatting -

i use ckeditor allow users create rich document want redisplay inside ckeditor instance other users. i want display content make control read don't want toolbars showing. if use removebuttons or of other methods remove these disabled toolbars lose formatting associated buttons. eg. if remove underline button lose underline formatting in content. is there way hide these buttons without losing formatting in content? that standard ck behaviour stated in acf documentation . when don't set allowed content ck binds toolbars in editor, removing buttons make acf strip html created such buttons. the solution is, in read-only editors, set ckeditor.config.allowedcontent allow tags you'll displaying.

java - unit testing Spring Web app with JConnect -

i having issue attempt unit test dao in webapp. have spring configuration set create datasource bean using sybase jconnect jdbc driver. problem can bean created when run app webapp. in trying run unit tests, receive: java.lang.classnotfoundexception: com.sybase.jdbc3.jdbc.sybdriver to further explain, here directory structure: src main -java - ...java files etc - resources -applicationcontext.xml -other config files - webapp -web-inf -jconn3.jar <---- putting here works, test doesn't have web-inf folder! -test -java -resources so how allow jconn3.jar recognized @ runtime unit tests? have tried putting in main/resources directoru, causes failure regardless of whether i'm running webapp or not. can see jconn3.jar gets copied target/classes directory on build, why jar not found @ runtime? seems way work keep in web-inf directory, how unit test dao depends on it. i using spring mvc , mav

go - what's the difference between decodeRuneInternal and decodeRuneInStringInternal -

in golang's std package, "func decoderuneinternal" , "func decoderuneinstringinternal" same except args, is: func decoderuneinternal(p []byte) (r rune, size int, short bool) func decoderuneinstringinternal(s string) (r rune, size int, short bool) why not define decoderuneinstringinternal as: func decoderuneinstringinternal(s string) (r rune, size int, short bool) { return decoderuneinternal([]byte(s)) (r rune, size int, short bool) } in utf8.go, decoderuneinstringinternal's implementations same decoderuneinternal. why? the 2 functions avoid memory allocation in conversion []byte(s) in case string function wraps []byte function or memory allocation in conversion string(p) in case []byte function wraps string function.

Game loop in Swift (OSX) -

all i'm wanting update method time delta previous frame, every example i'm finding either swift on ios, or objective-c osx, or uses nstimer not recommended because doesn't sync display refresh. does spritekit on osx provide simple way update method once per frame in pure swift code? way without spritekit better.

c++ - `Class::Class() : a(0), b(1)` meaning -

this question has answer here: what weird colon-member (“ : ”) syntax in constructor? 12 answers what following mean? don't know search searching : gives me nothing... server::server(int port) : listen_sock(0), current_autogen_nickname(1) where listen_sock used later in: listen_sock = socket(af_inet, sock_stream, 0); and current_autogen_nickname not used. it means defining constructor class server declared 1 int parameter. class has fields listen_sock being set 0 , current_autogen_nickname being set 1 you defining constructor , using initializer list.

android - How to restrict user to select current or previous time for Today and select any time for past dates in time picker dialog -

as have written in title wanna restrict user select current or past time today , can pick time past dates . please tell me how in android. have added restriction date picker using setmaxdate(); method unable same in time picker please tell me how should this. try setmaxdate(system.currenttimemillis());

javascript - I was stored cookies in temp file on client machine for cross domain cookie issue. Is this right way to override on cross domain cookie issue? -

actually, suffered cross domain cookie issue in safari web browser in mac & iphone devices. so, create 1 temp file on client machine , save cookies in temp file 1 domain. , when try read cookies domain file in file made changes if cookies not set fetch cookies data temp file , again set cookies domain. it's work successfully. right way overcome on issue?.

events - EventListener not working on custom component in Java -

i'm trying draw shape responsive mouse events, thought of extending awt.component can registered event listeners ain't working, although compiles no errors. import java.awt.component; import java.awt.event.*; class ball extends component{ public ball(){ this.addmouselistener(new mouseadapter(){ public void mousepressed(mouseevent e){ // event triggered } }); } } here's example i'm testing on applet using appletviewer (for learning purpose): import java.applet.applet; import java.awt.graphics; import java.awt.component; import java.awt.event.*; public class test extends applet{ ball ball; public void init(){ ball = new ball(); } public void paint(graphics g){ ball.paint(g); } } class ball extends component{ int x, y; public ball(){ x = y = 50; this.addmouselistener(new mouseadapter(){ public void mousepressed(mouseevent

android - Text align vertical doesn't work in tags -

Image
i have problem vertical alignment. codes below; <?xml version="1.0" encoding="utf-8"?> <co.hairmod.android.post.create.tokenlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="20dp" android:layout_width="wrap_content" android:orientation="horizontal" android:gravity="center_vertical"> <relativelayout android:layout_width="wrap_content" android:layout_height="20dp"> <textview android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="20dp" android:background="@drawable/catalog_tag_textview_cornered" android:textcolor="@android:color/white" android:textsize="14dp" android:paddingleft="23dp" android:paddingright="10dp" android:text="deneme&

javascript - Why jQuery hide() not work but fadeOut() works? -

jsfiddle why hide() not working? when try change hide() fadeout() it's working. why? $(document).ready(function() { $(".toggle").hover(function() { $(".submenu").hide(); $(this).find(".submenu").first().show(); $(".hlavnakategoria").removeclass("active"); $(this).addclass("active"); }); $(".submenu").mouseleave(function() { $(".submenu").hide(); // whi not work?? try change fadeout() }); }); @import url(https://fonts.googleapis.com/css?family=open+sans:400,800,600,700&subset=latin,latin-ext); html, body { margin: 0; padding: 0; font-family: 'open sans', sans-serif; font-size: 11pt; } html { width: 100%; height: 100%; background: rgb(255, 255, 255); background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(229, 229, 229, 1) 100%); background: -webkit-linear-gradient(top, rgba(255, 255, 255,

java - Cannot parse XML message with JAXB org.springframework.oxm.UnmarshallingFailureException -

Image
i using following code parse soap response receiving unmarshallingfailureexception, changed @xmlseealso @xmlrootelement problem still persists. wsdl here . caused by: javax.xml.bind.unmarshalexception: unexpected element (uri:"elsyarres.api", local:"searchflightsresponse"). expected elements <{elsyarres.api}inbound>,<{elsyarres.api}leg>,<{elsyarres.api}legs>, <{elsyarres.api}outbound>,<{elsyarres.api}request>,<{elsyarres.api}response>, <{elsyarres.api}searchflights>,<{elsyarres.api}soapmessage> code @xmlrootelement(name = "soapmessage") @xmlaccessortype(xmlaccesstype.field) public class wegolosoapmessageresponse { @xmlelement(name = "username") private string username; @xmlelement(name = "password") private string password; @xmlelement(name = "languagecode") private string languagecode;

haskell - cabal misconfiguration for tests -

my .cabal file contains following hspec configuration: -- name of package. name: mymodule version: 0.1.0.0 cabal-version: >=1.10 ... test-suite my-tests ghc-options: -wall -werror cpp-options: -dtest default-extensions: overloadedstrings type: exitcode-stdio-1.0 main-is: hspectests.hs hs-source-dirs: tests build-depends: mymodule, base >= 4.8 && < 4.9, containers >= 0.5 && <0.6, split >= 0.2 && < 0.3, hspec default-language: haskell2010 my directory structure follows: myproject | - src | - main.hs | - other.hs | - tests | -hspectests.hs | - dist | - myproj.cabal when run cabal build , source build succesfully executable ./dist/build/myproj/myproj . cabal build fails with: cabal: can't find source hspectests in dist/build/my-tests/my-tests-tmp, tests insp

intellij idea - Scala - Cannot resolve symbol - Looping through map -

i doing programming in scala looping through map. below code works fine. val names = map("fname" -> "robert", "lname" -> "goren") for((k,v) <- names ) println(s"key: $k, value : $v") when looping through map, if give (k,v) instead of (k,v), program not compiling. gives cannot resolve symbol error. below loop - for((k,v) <- names ) println(s"key: $k, value : $v") i executing program in intellij idea 15 scala worksheet. can please explain reason error. it doesn't compile same reason code doesn't compile: val (a,b) = (1,2) // error: not found: value // error: not found: value b but does compile: val (a,b) = (1,2) // a: int = 1 // b: int = 2 constant names should in upper camel case. is, if member final, immutable , belongs package object or object, may considered constant method, value , variable names should in lower camel case source: http:/

email - SMTP server not working, running on Node.js with Mailin package -

Image
i followed mailin docs haven't been able make work. my domain is: aryan.ml i'm using amazon route 53 dns configurations. here's screenshot of that: on app.js file i'm running sample code given official mailin docs well. code under "embedded inside node application" heading @ http://mailin.io/doc var mailin = require('mailin'); mailin.start({ port: 25, disablewebhook: true // disable webhook posting. }); /* access simplesmtp server instance. */ mailin.on('authorizeuser', function(connection, username, password, done) { if (username == "johnsmith" && password == "mysecret") { done(null, true); } else { done(new error("unauthorized!"), false); } }); /* event emitted when connection mailin smtp server initiated. */ mailin.on('startmessage', function(connection) { /* connection = { from: 'sender@somedomain.com', to: 'some

android studio - not able to find bugs in Log cat -

Image
i'm not able find bugs in logcat , throwing out of memory it oom problem bitmap, think need search reason problem. caused size of bitmap large think.

how to loop through gridview android -

i creating calendar in android uses gridview, have listview contains selected dates. need have compare each data every item listview gridview. how do it? here adapter: public class calendaradapter extends baseadapter { private context mcontext; private java.util.calendar month; public gregoriancalendar pmonth; // calendar instance previous month /** * calendar instance previous month getting complete view */ public gregoriancalendar pmonthmaxset; private gregoriancalendar selecteddate; int firstday; int maxweeknumber; int maxp; int calmaxp; int lastweekday; int leftdays; int mnthlength; string itemvalue, curentdatestring; dateformat df; private arraylist<string> items; public static list<string> daystring; private view previousview; public calendaradapter(context c, gregoriancalendar monthcalendar) { calendaradapter.daystring = new arraylist<string>(); loc

php - Laravel 5.2 - Session::get not working -

i want display 'falsh-message' user start redirect him in routes.php following code : route::get('/alert',function () { return redirect()->route('home')->with('message', 'this test message!'); }); in alerts.blade.php include in home view read message with: route::group(['middleware' => ['web']], function () { route::get('/alert',function () { return redirect()->route('home')->with('message', 'this test message!'); }); }); my session set under storage\framework\sessions following code : a:5:{s:6:"_token";s:40:"8304u3fjr9ehva88qmvgqngcgducwozj9lrhadph";s:7:"message";s:23:"this test message!";s:5:"flash";a:2:{s:3:"new";a:0:{}s:3:"old";a:1:{i:0;s:7:"message";}}s:9:"_previous";a:1:{s:3:"url";s:22:"http://localhost/alert";}s:9:"_sf2_meta"

java - JavaFX thread does not die although I set Platform.setImplicitExit(true)? -

in application used javafx.stage.filechooser , javafx thread start. frame i set default close operation windowconstants.dispose_on_close . when user exit application gui disappear application continue running because of javafx thread still being alive. interesting thing i set platform.setimplicitexit(true); . documentation of function says:"if attribute true, javafx runtime implicitly shutdown when last window closed;", did not happen. problem solved setting default close operation windowconstants.exit_on_close or using javax.swing.jfilechooser instead of filechooser. i have fixed it, interested , understand why javafx thread did not shutdown though set implicit exit , nothing opened. here small example program (click button->close file chooser->close application): public class jfxproblm { public static void main(string[] args) { eventqueue.invokelater(() -> { new myframe(); }); } private static class myframe exte

android - IllegalStateException: Call CookieSyncManager::createInstance() or create a webview before using this class -

i'm getting ise when call cookiemanager.getinstance().getcookie(url) i/dalvikvm( 1022): java.lang.illegalstateexception: call cookiesyncmanager::createinstance() or create webview before using class i/dalvikvm( 1022): @ android.webkit.jniutil.checkinitialized(jniutil.java:45) i/dalvikvm( 1022): @ android.webkit.jniutil.getdatabasedirectory(jniutil.java:66) i/dalvikvm( 1022): @ android.webkit.cookiemanager.nativegetcookie(native method) i/dalvikvm( 1022): @ android.webkit.cookiemanager.getcookie(cookiemanager.java:496) i/dalvikvm( 1022): @ android.webkit.cookiemanager.getcookie(cookiemanager.java:460) could please point me out why happens , how resolve it? thanks lot in advance!