Posts

Showing posts from August, 2012

Java 8 flatmap , stream,collect -

i have situation have class { private b b; public b getb() { return b; } } and class b class b { private list<c> c; public list<c> getlistc() { return c; } } now class c contains 2 instance variables class c { private int id; private string name; public int getid() { return id; } public string getname() { return name; } } now want achieve below using java 8 list<c> newlistc = a.getb().getlistc(); map<integer, string> map = new hashmap<>(); for(c c : newlistc) { map.put(c.getid,c.getname()); } i have tried many time every time face different problems. code: optional<a> a=optional.of(new a()); map<integer, string> map= a.map(a::getb) .flatmap(b -> b.getlistc() .stream()

jsf - CSS does not apply to table rows -

Image
i trying make odd , rows having different color. here code: <h:head> <h:outputstylesheet library="css" name="styles.css" /> <title>facelet title</title> </h:head> <h:body> <h:form> <h:datatable id="accountstable" value="#{currentcustomer.accounts}" var="accounts" styleclass="accountstable" headerclass="accountstableheader" rowclasses="accountstableoddrow,accountstableevenrow" > <h:column> <f:facet name="header">account number</f:facet> #{accounts.accountnumber} </h:column> <h:column> <f:facet name="header">currency</f:facet> #{accounts.accountcurrency} </h:column> <h:column> <f:facet name="header"&g

How to control KML icon drawing order, top to bottom -

i'm displaying many overlapping icons in google earth tour. i'd control (or @ least understand) order in icons drawn (which 1 shows on "top"). thanks! ps. non solutions attempted: using gx:draworder (it applies overlays, not icons). using animatedupdate establish order chronologically. using order in introduce placemarks establish drawing order. apparently google earth draws features in groups type: polygons, ground overlays, followed lines , point data draworder applied within group. screenoverlays drawn last on top. if define gx:draworder or draworder on collection of features, applies features of same type (polygon , other polygons) not between different types. that behavior if features clamped ground. if features @ different altitudes lower altitude layers drawn first. note tilt angle affects size of icon , tilt approaches 90 degrees, size of icon gets smaller. icon @ largest size when viewed straight-down 0 degree tilt angle.

java - Auto-update JTable that is populated using a List<T> -

Image
the program allow user make search. search result shown in jtable. user can select row , hit button called "edit" editing on "item". once info edited , hits ok, jtable not being updated. table before editing: user clicks on button "edit" , edits last field jtable still showing old info, it's not being updated here's code: public void paneltable(){ paneltable = new jpanel() paneltable.setsize(400, 80); paneltable.setopaque(true); table = new jtable(); modele = new defaulttablemodel(); } public string getdata(int colonnb ,int index){ string datatab = data[colonnb][index] + ""; return datatab; } public void creerjtable(list<pneu> liste){ string[] head= {"a", "b", "c"}; this.liste = liste; data = new object[liste.size()][3]; iterator<pneu> = liste.iterator(); int index = 0; while(it.hasnext()){ pneu unpneu = it.ne

Best Approach to Generate Unique Order Number with concurent inserts in Sales Application - Mysql/PHP -

we have sales application generating unique order number adding increment in previous value. since using unique combination based on orderid , store id, can not use auto increment. sometime getting duplicate order ids if request submitted multiple client devices. can please advise better way handle order id generation based on order id , store id? using php scripting language. this have of now. // table structure salesorders (order_id, store_id) $generatenextorderid = "select max(order_id) + 1 salesorders store_id = 1"; any suggestions?

amazon web services - Parse Push to AWS SNS -

i in process of migrating ios app parse aws , stuck on parse push -> aws sns. message published through aws never arrives on device (tried multiple devices). working aws person unfamiliar mobile thinks should work. else experienced this? thanks in advance!!! aws sns weird when comes message formats. sending json object? if yes, have add attribute message payload. in python - sns.publish(targetarn= <your-endpoint>, message= json.dumps(<your-message-dictionary-object>),messagestructure = 'json') i'm assuming system wide notification settings turned on on ios device. another helpful thing subscribe delivery failures application in sns dashboard. goto applications -> choose application -> actions -> configure events -> delivery failures. here can specify arn lambda function, sns topic(which sends emails you) etc. example of delivery failure email - {"deliveryattempts":1,"endpointarn":"< mobile end

Get my current path using a python script as a command -

i put python script /usr/local/bin use command in bash. i want use bash working directory, current directory script executed. is there way use current directory command does? e.g. convert2ogg (as python script in /usr/local/bin) $ cd ~/music $ convert2ogg *.mp3 import os,sys print("cwd: "+os.getcwd()) print("script: "+sys.argv[0]) print(".exe: "+os.path.dirname(sys.executable)) print("script dir: "+ os.path.realpath(os.path.dirname(sys.argv[0]))) pathname, scriptname = os.path.split(sys.argv[0]) print("relative script dir: "+pathname) print("script dir: "+ os.path.abspath(pathname)) this code clear me. os.path not solution problems ;) answer, , seems ask before. first line os.getcwd() solved problem.

sql server - SQL Distinct Sum -

select distinct e.firstname + ' ' + e.lastname [full name], p.productname, od.quantity employees e, products p, [order details] od, orders o e.employeeid = o.employeeid , o.orderid = od.orderid , od.productid = p.productid in northwind gives duplicate fullnames , productnames because of quantity changed (because of date shipped each time). i want present name specific productname total quantity , not divided. you need use group by sum : select e.firstname + ' ' + e.lastname [full name], p.productname, sum(od.quantity) [quantity] employees e inner join orders o on o.employeeid = e.employeeid inner join [order details] od on od.orderid = o.orderid inner join products p on p.productid = od.productid group e.firstname + ' ' + e.lastname, p.productname note, need stop using old-style join syntax.

swift - Two NSDates created next to each other do not compare equal -

this code, comparing 2 nsdate s created 1 after other, not enter .orderedsame case expect. import uikit let chosendate = nsdate() let currentdate = nsdate() let formatter = nsdateformatter() formatter.dateformat = "eeee" let day = formatter.stringfromdate(chosendate) var result = string() switch chosendate.compare(currentdate) { case .orderedsame: result = "today \(day)" break case .orderedascending: result = "that \(day)" break case .ordereddescending: result = "that \(day)" break } print(result) whenever run (in playground or [i pulled playground project file test stuff] in simulator) gives me "that was (insert day here) instead of " today (insert day here). why this? the values of chosendate , currentdate not same. if print values of dates, see different, few milliseconds. if want check if days same, need try nscalendar method comparedate:todate:tounitgranularity: you can us

arrays - Conditional Json Schema validation based on property value -

i have input json below, { "results": [ { "name": "a", "testa": "testavalue" } ] } the condition is, if value of 'name' 'a', 'testa' should required field , if value of 'name' 'b', 'testb' should required field. this json schema tried , not working expected, { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "required": [ "results" ], "properties": { "results": { "type": "array", "oneof": [ { "$ref": "#/definitions/person" }, { "$ref": "#/definitions/company" } ] } }, "definitions": { "person": { "type": "object", "required"

php - Multi-Threading in Laravel -

i running problem database calls slowing page load significantly. populating multiple charts elections data, , table contains around 1 million rows, , have query data multiple times in each methods inside getcharts() method. i'am using this pass return data javascript. these charts gets re-populated when click on data point. if click on point i.e ('democrat) reload page , call these methods again. what asking wether possible in native php. server running php 5.2 on linode. foreach(function in getchartsmethod){ start child thread process function. } join threads. reload page. public function getcharts(){ $this->get_cast_chart(); $this->get_party_chart(); $this->get_gender_chart(); $this->get_age_chart(); $this->get_race_chart(); $this->get_ballot_chart(); $this->get_county_chart(); $this->get_precinct_chart(); $this->get_congressional_district_chart();

powershell - PowerPoint to PDF: Minimum size option -

i attempting convert powerpoint files pdf using powershell , able so. however, trying take 1 step further , select 'minimum size (publishing online)' option through script. is there property needs set happen? i'm guessing $ppqualitystandard variable not sure. edit: using currently: function ppt_to_pdf ($folderpath, $pptname) { add-type -assemblyname office $ppformatpdf = 2 $ppqualitystandard = 0 $p = new-object -comobject powerpoint.application $p.visible = [microsoft.office.core.msotristate]::msotrue $ppt = $p.presentations.open("$folderpath\$pptname") $ppt.savecopyas("$folderpath\$pptname", 32) $ppt.close() $p.quit() $p = $null [gc]::collect() [gc]::waitforpendingfinalizers() } i suspect need use .exportasfixedformat rather .savecopyas . it takes, among other parameters, intent type ppfixedformatintent , can either: ppfixedformatintentscreen (=1) or ppfixedformatintentprint

recursion - Create a Python recursive function that prints all the integers less than or equal to the value provided in the original call -

i=0 def recursiveintegers(n): if n==1: return 1; else: reqval= n-1; print("less or equal original -->",reqval); return recursiveintegers(reqval) uservalue = int(input("enter value ")) recursiveintegers(uservalue) what missing print out equal values..? print 'n' first ... 'reqval = n-1'

java - Does this code pass a value to var? -

there following code https://github.com/nanohttpd/nanohttpd/blob/master/webserver/src/main/java/fi/iki/elonen/simplewebserver.java . does code static {mimetypes(); ...} pass value var licence? valid java syntax? when var licence passed value? runtime or compile-time ? /** * distribution licence */ private static final string licence; static { mimetypes(); string text; try { inputstream stream = simplewebserver.class.getresourceasstream("/license.txt"); bytearrayoutputstream bytes = new bytearrayoutputstream(); byte[] buffer = new byte[1024]; int count; while ((count = stream.read(buffer)) >= 0) { bytes.write(buffer, 0, count); } text = bytes.tostring("utf-8"); } catch (exception e) { text = "unknown"; } licence = text; } the static { static initializer block. code run once when class loaded. license set value of text , obtained b

php - group messages by same users -

i have 2 tables .. 1- users,,2-messages i wrote query doesn't show last subject , need last subject select ( case when messages.sender = 68314 messages.receiver else messages.sender end ) user_id, max(messages.added) last_added,messages.subject, max(messages.id) last_id,users.username messages inner join users on users.id = if(messages.sender = 68314, messages.receiver, messages.sender) (messages.sender = 68314 or messages.receiver = 68314) , messages.sender!=0 group ( case when messages.sender = 68314 messages.receiver else messages.sender end ) order last_added desc it shows first subject, not last one. please give query try. first select max(id) of messages of people talking id 68314 assuming created last...and joins messages, , joined users other person's name. select last_messages.user_id, m.added last_added, m.subject, last_messages.last_id, u.username messages m inner join (

mysql - Need help in improving performance of SQL query -

take @ sqlfiddle made http://sqlfiddle.com/#!9/4b903/2/0 . simplified version of database. have million records in history , problem query seems slow. takes minute result. i'm not in sql stuff. guess there columns need index im not sure those. update: i tried explain sql id | select_type | table | type | possible_keys | key | key_len | ref | rows | 1 | primary | t1 | range | created_reason,created_reason_2 | created_reason_2 | 6 | null | 91136 | using where; using temporary; using filesort 2 | dependent subquery | t2 | ref | history_table1_id_foreign,table1_id,table1_id_2 | table1_id_2 | 4 | t1.table1_id | 11 | using where; using index; using filesort you haven't created indexes on of columns. please read linear , binary searches before write heavy queries. add indexes table1 alter table `test_delete`.`table1`

eclipse - Selenium webdriver with JAVA -

**when run code. getting error exception in thread "main" java.lang.nullpointerexception .can tell me how fix it? package insights; import java.util.concurrent.timeunit; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.chrome.chromedriver; public class test_getinsights { static webdriver driver; public static void main(string[] args) throws exception { system.setproperty("webdriver.chrome.driver", "c://selenium-2.53.0/chromedriver.exe"); webdriver driver = new chromedriver(); driver.get("https://getinsights.co"); driver.manage().window().maximize(); //login// driver.findelement(by.xpath("html/body/div[1]/div/nav/div/div[2]/ul/li[7]/a")).click(); //login_page// driver.findelement(by.xpath(".//*[@id='form']/div[1]/input")).sendkeys("testgetinsight@gmail.com"); driver.findel

Android convert int timestamp to human datetime -

hi have android app using webrequest return timestamp of type int (or long) want convert human reader date time (according devices timezone) for example 1175714200 convert gmt: wed, 04 apr 2007 19:16:40 gmt time zone: 4/5/2007, 3:16:40 gmt+8:00 i have use function convert seem not return correct result (all result (15/01/1970 04:04:25) not correct time.settext(new simpledateformat("dd/mm/yyyy hh:mm:ss"). format(new date(topstory.gettime() * 1000))); anything wrong above code? i have warning message: to local formatting use getdateinstance(), getdatetimeinstance(), or gettimeinstance(), or use new simpledateformat(string template, locale locale) example locale.us ascii dates. less... (ctrl+f1) callers should use getdateinstance(), getdatetimeinstance(), or gettimeinstance() ready-made instance of simpledateformat suitable user's locale. main reason you'd create instance class directly because need format/parse specific machine-readable

user interface - How to display a value from children window to parent window in python tkinter? -

i have parent window text , button. on clicking button in parent window child window opens contains entry box , button. when enter in entry box of child window , click submit of child window data entered in entry box of child window should appear in text box of parent window, how can this? code below. from tkinter import * class application(frame): def __init__(self, master): super(application,self).__init__(master) self.grid() self.create_widgets() def create_widgets(self): self.t1=text(self,width=10,height=2) self.t1.grid(row=1,column=1) self.b1=button(self,text="create",command=self.onclick) self.b1.grid(row=2,column=1) def onclick(self): self.top = toplevel() self.top.title("title") self.top.geometry("300x150+30+30") self.top.transient(self) self.appc=demo(self.top) class demo: def __init__(self, master): self.master = m

android - How to use youtube API? -

my class: public class mainactivity_for_youtube extend youtubebaseactivity implements youtubeplayer.oninitializedlistener { private static final int recovery_dialog_request = 1; private youtubeplayerview playerview; string fbid=""; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // called modify window feature , resize full screen requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); setcontentview(r.layout.youtubevideo); fbid = getintent().getstringextra("urls"); playerview = (youtubeplayerview) findviewbyid(r.id.player_view); // initializes youtube player view playerview.initialize(config.api_key, this); } // called when youtube player initialization failed @override public void oninitializationfailure(youtubeplayer.provider provider,

java - How to design a class for REST api and pagination, and hiding the internal DB? -

maybe i'm thinking wrong. trying figure out how pagination rest api. say have data database has tables animals cats , dogs , have owners labeled ------ -------- -------- |cts | |dgs | | ownr | |----- | |------| |------| |c_id | |d_id | |id | |c_nme | |own_id| |nm | |own_id| |d_nme | -------- ------- |d_bn | -------- i using hibernate , want provide rest service @ "/owners" display owner information pets. mean need return json object both human readable, , has page data. { "data":[ {"owner":"joe", "cats_name": "whiskers", "dogs_name": "fido"}, {"owner":"julie", "cats_name": "furry", "dogs_name": "buster"} ], "page_data":{"page":"2", "total_pages": "12"}} i

javascript - Rails 4 - jQuery conflicts and function error -

i'm having rotten time trying figure out how resolve conflicts between javascript , jquery in rails 4 app. my original problem conflict between javascript in dependent-fields gem , jquery in application.js. question here: rails - conflicts between jquery , javascript i couldn't find solve problem, tried figure out how write jquery myself. problems had attempt here: rails 4 - jquery hide initially, toggle click now, can't @ anything, because when load page, error: syntaxerror: [stdin]:1:2: reserved word 'function' the error message identifies line of show: <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => false %> the steps took in trying approach remove dependent-fields gem gem file, comment out underscore.js , delete underscore-min.map app/assets/javascripts folder (and delete function shown in application.js -see first posted link) required dependent-fields work. now can'

javascript - How to grab part of JSON string? -

this.on('success', function(file, responsetext) { var theid = json.stringify(responsetext); alert(theid); window.location.href = ('want put here'); }); the alert giving me: {"message":"success","fileid":399} and grab fileid value, in case 399. thank you. simply window.location.href = responsetext.fileid; will since responsetext json

javascript - How request and response event are different from each other in node js? -

i tried simple server in nodejs. expected output of program server console - request recieved 0 request recieved 1 request recieved 2 request recieved 3 client expected response you have visited site many times - 0 you have visited site many times - 1 you have visited site many times - 2 you have visited site many times - 3 client actual response you have visited site many times - 1 you have visited site many times - 3 i couldn't understand behavior. , following code ran //dependencies var http = require('http'); //variables var counter = 0; //callbacks , functions var requesthandler = function( request , response ) { console.log('request recieved ' + counter++); response.writehead(200); response.end('you have visited site many times - '+counter); }; //objects var server = http.createserver(requesthandler); //executions server.listen('8080'); what possible reason behavior ?

time series - R isn't recognizing the date field I have sent as an input to Rstudio in .csv format -

[this sample data.] what had been trying achieve forecasting in r dates csv input via r studio. when i've tried change data type of data field in input using as.date ( my_date_field , "%y-%m-%d"), class ( my_date_field ) results in date printing values of my_date_field results in "na"s. so, unable forecast on timeline basis @ all. please me out sorting out issue. the code i've used forecasting is: library(forecast) library(lubridate) fitdata <- read.csv("~//power bi//fit.csv") fitdataset <- aggregate(fitdata$metric ~ fitdata$ped, data = fitdata, fun= sum) fitdataset$ fitdata$ped <- as.date(fitdataset$ fitdata$ped , format="%y-%d-%m") ts_fitdata <- ts(fitdataset$ fitdata$metric , frequency=12, start=c(fitdataset$ fitdata$ped` 1 ,1)) decom <- stl(ts_fitdata, s.window = "periodic") pred <- forecast(decom, h = 7) plot(pred) `

android - Date string dose not get parse -

i have string in date format want parse in date object. want set time string in calendar object , want set alert @ same time. for tried parse string date nothing happens. time dose not set. when did debug check if time get's set in calendar or not, found goes directly @ end of method after parsing. date date = df.parse(alertdatetest); i tried parse string format : simpledateformat df = new simpledateformat("d mmm yyyy"); but gives invalid format exception. format should use parse string? string format : d mmm yyyy code: malertdate 25 apr 2016 alertdatetest 25 apr 2016 public void updatenotification() { try { string alertdatetest = i.getstringextra("taskalertdate"); string alerttimetest = i.getstringextra("taskalerttime"); simpledateformat df = new simpledateformat("yyyy-mm-dd"); date date = df.parse(alertdatetest); if (alertdatetest.equals(

javascript - When passing number with comma to text box why getElementById truncate the number after the comma -

please check code : function calcpm() { var nv = document.getelementbyid('txtviews').value; var nc = document.getelementbyid('txtcost').value; var result =parsefloat(nc) / parsefloat(nv)/1000; if(!isnan(result)) { document.getelementbyid('cpm').value = result.tofixed(4); } } it work fine expect when put comma in number, means if put in txtviews 1000000 , in txtcost 3000 correct result 3.000 however if use commas in of numbers problem starts, like if put in txtviews 1,000,000 , in txtcost 3,000 then result 0.000003 or if start putting value txtcost first result 3000.0000 which not correct value either way, idea problem?? i believe you'd have strip them out, , add them in (the commas, is).. function calcpm() { var nv = document.getelementbyid('txtviews').value.replace(',',''); var nc = document.getelementbyid('txtcost').value.replace(',','');

amazon web services - Unit testing activities marked as @ManualActivityCompletion -

i have been working on creating unit tests run local versions of workflow. followed guide initial setup. setup, have been able execute , test workflow. issue arises when attempt unit test activity implementation marked @manualactivitycompletion. appears manual completion activities return within unit tests (not waiting completion/failure call). i'm wondering if possible unit tests manual completion activities in way. guess is not since have seen no mention of , don't see way create test manualactivitycompletionclient. in case, i'm wondering if has suggestions on how unit test manual completion activities in local workflow. have attempted create workarounds using different threads , synch points, useful test actual behavior of completing/failing activities (exceptions thrown, etc.). may worth mentioning have been able write successful integration unit tests manual completion activities. any appreciated. to test workflow logic invokes activity marked @manual

python - searching a string pattern from a Data-frame column in pandas -

continuing last question in stack searching matching string pattern dataframe column in python pandas suppose have dataframe name genre satya |action|drama|ic| satya |comedy|drama|social|music| abc |drama|action|biopic| xyz |action||romance|darma| def |action|sport|comedy|ic| ghj |ic|actiondrama|noaction| from answer of last question , able search 1 genre (ex ic) if independently exist in genre column , not part of other genre string value (music or biopic). now want find if action , drama both present in genre column not in particular order , not part of string individually. so need rows in output row[1,3,4] name genre satya |action|drama|ic| # both adjacently present #row 2 not come # drama present not action abc |drama|action|biopic| ### both adjacently present in diff. order xyz |action||romance|darma| ### both present not adjacent ##row 5 should not present drama

java - Unable to drop table via Jackcess using getSystemTable and findFirstRow -

why can't cursor findfirstrow when try use jackcess find row need delete in order drop table? private static void deletetable(database db, string tablename) throws ioexception { table table = db.getsystemtable(tablename); if (table == null) { return; } cursor cursor = table.getdefaultcursor(); map<string, object> criteria = new hashmap<string, object>(); criteria.put("name", tablename); criteria.put("type", (short) 1); if (cursor.findfirstrow(criteria)) { table.deleterow(cursor.getcurrentrow()); log.e(tag, "delete " + tablename + " success!"); } else { log.e(tag, "can't find table");//run here } db.flush(); db.close(); } p.s.: no reported exception your mistake opening table want delete, not system table holds list of database objects. instead of table table = db.getsystemtable(tablename); you need use table ta

scala - Wait for element with Selenium - what is the different of using pollingEvery -

consider this: fluentwait fluentwait = new fluentwait[webdriver](driver) .withtimeout(timeout, timeunit.seconds) .pollingevery(10, timeunit.seconds) fluentwait(120).until(expectedconditions.elementtobeclickable(element)) what different of using fluentwait pollingevery , without pollingevery ? pollingevery going ? in fluent wait, if specify pollingevery , driver check availability particular element, every n (10 in case) seconds (frequency) specified pollingevery(10, timeunit.seconds) . if not specify same, default check frequency of 500 milliseconds. hope helps

Understanding connection between RFID reader and PC -

i new rfid transmission , love help! in setting rfid system, questions have are: 1.) can rfid reader transmit data remote online server/cloud? (e.g. tag read in texas , transmitted vermont) 2.) can multiple servers hooked individual reader (e.g. if tag meets criteria 1, query server 1, if tag meets criteria 2, query server 2) 3.) if yes 1 or 2, require specific type of reader? any supporting materials appreciated -- resource has been particularly useful far link in general yes. advanced (and expensive) readers have linux onboard , allow run apps inside reader. technically can achieve it. usually readers not smart, track tags , store info inside reader's memory read external client (com, usb or ethernet) most readers don't allow multiple client connections. primary scenario place 1 server close reader , make poll reader nearby tags. once server receive tag data reader share other servers. yes.

table - MySQL Divide two rows and add into new column -

i have mysql table in want perform following operation. id com com_sub year parameter value 6 a1 2010 profit 33766.18 20 a1 2010 revenues 2793617.12 30 a1 2011 profit 84310.73 54 a1 2009 profit 129129.5284 60 a1 2011 revenues 2049157.294 70 b b1 2010 profit 3753765490 76 b b1 2010 revenues 217326.7561 now need manipulate , make dis id com com_sub year parameter value new value 6 a1 2010 profit 33766.18 0.0123 20 a1 2010 revenues 2793617.12 30 a1 2011 profit 84310.73 0.0252 54 a1 2009 profit 129129.5284 60 a1 2011 revenues 2049157.294 70 b b1 2010 profit 3753765490 1.235 76 b b1

Java Lambda in Intellij: Expected not null but the lambda body is not value-compatible -

trying filter collection using stream, , trying pass following lambda filter() set, gives arcane error in title: unmatchedincomingfields.stream().filter(s-> s.matches(fieldmatchpattern)) meanwhile, creating predicate object works: unmatchedincomingfields.stream().filter(new predicate<string>() { @override public boolean test(string s) { return s.matches(fieldmatchpattern); } }); according jls, lambda body "value-compatible" if every control path returns value. matches() gets called , returns boolean, don't understand problem is. i've tried kinds of variations of same lambda- , without parentheses , argument types , using expression , block-with-return bodies. the issue looks incorrect, or @ least misleading, error highlighting within intellij, confusing actual error was. the filter occurs within lambda map() operation had not specified return yet, , reason, intellij highlights inner lambda filter, making 1 error.

aptana3 - Aptana Studio 3 installation error: Error reading from file -

while trying install aptana first time, faced following error. failed correctly acquire installer_nodejs_windows.msi file: crc error. then searched file windows , installed it. trying install aptana fails error. error reading file: ..\feature.properties. verify file exists , can access it. i installing aptana admin access. struck error. can me resolve issue? thank you. depending on functionality need: cannot install aptana studio 3.6 on windows it force install.

html - Why do we use overflow:hidden; -

why use these 3 properties on menu. unsure why need these 3 properties. love know technical side of ? margin: 0; padding: 0; overflow: hidden; html: <ul> <li><a class="active" href="#home">home</a></li> <li><a href="#news">news</a></li> <li><a href="#contact">contact</a></li> <li><a href="#about">about</a></li> </ul> css: ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } the default values of padding , margin zero(browser dependent). don't think there difference if remove them. overflow : hidden property make text going out of div hidden i.e. not shown on screen , clipped. overflow : a

qt - QWidget::showMinimized() doesn't work -

on ubuntu 13.04, if using qwidget::showminimized() minimize window, found after restoring clicking app icon system taskbar, recalling qwidget::showminimized() cannot work. connect(minimumbtn,signal(clicked()),this,slot(minimumwin())); minimumwin(){ showminimized(); } showminimized() in minimumwin() doesn't work anymore if has been called before (even window showed). i can reproduce linux mint , qt 5.1. bug in qt. found if call shownormal() right after showminimized() , window minimizes , after restored taskbar, possible minimize window again. example: void mainwindow::on_pushbutton_clicked() { showminimized(); shownormal(); }

How to structure/coordinate multiple databases? -

imagine large corp dozens of companies, each own website , each website have own unique functional requirements most data on each website specific website each website can edit own data some data shared across websites there central cms allowed edit data, other websites can read , use data e.g. you're planning infrastructure company owns multiple sub-companies make different kinds of products, in same category (cereal, food), others in different categories (books, instruments). marketing websites, crm, online stores there list of regulatory requirements affect products each company should manage status of compliance of own products each requirement when new requirement surfaces, details regarding requirement should entered once how multiple databases coordinated? edit: added more info per bob's suggestions thanks incredibly insightful questions! compliance data not shared, silo'd within each site shared data on 1 enterprise-wide database

ios - Push view-controller twice -

i have 3 view controllers 2 buttons each one. first view: next (go 2 view controller) end (go 3 view controller) second view: back (go 1 view controller) end (go 3 view controller) third view: back (go 2 view controller) start (go 1 view controller) the problem "back" button of third view controller do: self.navigationcontroller?.popviewcontrolleranimated(true) so when come second view, there no problem, return second view, when come first view , press button, app returns first view controller, , want navigate second view. is there way push 2 view controller when press "end" button in first view controller, when press button in third view controller returns second? thanks! you can push multiple view controllers executing navigationcontroller.pushviewcontroller(viewcontrollern, animated: false) multiple times , set animated last one.

java - Spring data jpa FINDALL with SQL Server -

i migrated mysql sql server, , had following error : the column "statut_ndf_tb.sortid" not valid in order clause because not contained in aggregate function or group clause here function : @override public list<ndf> rechercherndfs(demande<ndf> demande) { final list<specification<ndf>> specificationlist = specificationshelper.choosespecifications(ndfspecification.class, demande); final specifications<ndf> specifications = specificationshelper.buildwhereclause(specificationlist); final pageable page = specificationshelper.buildpage(demande); final page<ndf> resultat = ndfrepository.findall(specifications.where(specifications), page); return resultat.getcontent(); } i call function following : demande<ndfdto> demande = new demande<ndfdto>(); demande.addvariable("statutnoequal", "an"); demande.setconverterid(enummapper.mapping_ndf_info.tostring()); ndfservicessilo.rechercherndfs(

nginx - How to replace odoo address with domainname -

hello made odoo website, added addres dns, whenever browses www.mycompany.com they're redirected odoo server, address port 8069 still displayed. any ideas how can hide this? thanks you must use reverse proxy nginx : http://www.schenkels.nl/2014/12/reverse-proxy-with-odoo-8-nginx-ubuntu-14-04-lts/

onclick - Android onCreate flow -

i'm new android development , working these days on first app. in activity, in oncreate function make 2 function calls , each of 2 functions has different onclicklistener different buttons. everything works fine , question why? i mean how possible both of listeners functions "work" on same time app runs in parallel way? in head thought once app reach onclicklistener stop , wait buttonclick event can see can click on button1 , happens , click on button2 , else happens (as should). i want explaination, in general, way (flow) app work/ handles functions of listeners , click events. thank you, noam i totally understand mean. button.setonclicklistener(this) means button tells activity has click event. app won't pause or wait until button event executed. when different widget clicked, it's own click event executed.

titanium - Android Sharing Intent -

Image
is there way can add/list app other apps facebook, gmail, whatsapp , viber in sharing intent on android .? here sample image i don't how done using titanium, in conventional way (using eclipse), how in 1 of apps: code: in manifest xml file, add tag shown below. done activity handle data shared user. example, if activity named composer , structure be: <activity android:name=".composer" android:exported="true" android:windowsoftinputmode="statehidden|adjustresize" > <intent-filter> <action android:name="android.intent.action.send" /> <category android:name="android.intent.category.default" /> <data android:mimetype="text/plain" /> <data android:mimetype="image/jpeg" /> <data android:mimetype="image/png" /> </intent-filter> </activity> explanation of code: the key he

php - why I get 405 on POST with gulp connect -

everything working fine, start using gulp connect on post 405, it's seem's server configuration issue, can 1 on please my gulp file code var config = {port: 9217,devbaseurl: 'http://localhost', paths: { css:[ 'node_modules/bootstrap/dist/**/*.css', 'src/**/*.css'], dist: 'dist/' } } gulp.task('connect', function() { connect.server({ root: ['dist'], port: config.port, base: config.devbaseurl, livereload: true, headers: { allow: 'get, head, post, options' } }); }); and js file post $scope.no_login = function(x, y) { var request = $http({ method: "post", url: "log.php", data: { user_name: x,

python - Tkinter loop function -

i new gui programming , i'm trying python program work. correct way call function start() updates 2 canvases. code looks this. from tkinter import * class tkinter_test(frame): def __init__(self,parent): frame.__init__(self,parent) self.parent = parent self.initui() user_reply = 0 def accept(self): self.user_reply = 1 def decline(self): self.user_reply = 2 def initui(self): btnframe = frame (self.parent) btnframe.place(y=450, x=20) canvasframe = frame(self.parent) canvasframe.place(y = 200) canvas_1 = canvas(canvasframe, width = "220", height ="200") canvas_2 = canvas(canvasframe, width = "220", height ="200") canvas_1.pack(side = left) canvas_2.pack(side = right) textfield_1 = canvas_1.create_text(30,50,anchor = 'w', font =("helvetica", 17)) textfield_2 = canvas_2.create_text(30,50,anchor = &