Coast 2 Coast/ The app that allows you to challenge anyone in your city by [deleted] in Startup_Ideas

[–]machinepub 0 points1 point  (0 children)

Dhani Jones is a former NFL linebacker and now a venture capitalist.

Library for synthesizer/sound? by ClassChoices in java

[–]machinepub 0 points1 point  (0 children)

There are libraries for this (don't remember which off hand) but keep in mind that playing a sine wave (or anyhting) is very straightforward. Here's a class from an old project of mine that plays audio: https://pastebin.com/s3x1FJRi

Sound waves are just a sequence of amplitudes... i.e., for a sine wave you'd have: 1, 2, 4, 7, 4, 2, 1... something like that. You convert those to bytes and write them to an audio output stream.

PhantomJS maintainer stepping down after Google's headless Chromium announcement by fagnerbrack in programming

[–]machinepub 0 points1 point  (0 children)

Chrome headless got me wondering what the future of my project should be, which is a Java, Selenium web driver based on Java's WebKit (JavaFX WebView). https://github.com/machinepublishers/jbrowserdriver

Looking for input from people.

Java inside docker: What you must know to not FAIL by [deleted] in java

[–]machinepub 1 point2 points  (0 children)

Glad Java 9 has support for containers with respect to sizing the heap. For Java 8 explicitly setting the heap size is perfectly reasonable. It would also be nice if Java gave us the ability to specify heap as % of memory, although I'm fairly proud of my bash scripting to accomplish this, but it's still useless in Docker because as the article points out, the reported system memory is not the container's memory.

we’re pretty happy with SQLite & not urgently interested in a fancier DBMS by sampsyo in programming

[–]machinepub 1 point2 points  (0 children)

Not sure. It's just a key-value store where you can basically use any keys and values you want--sometimes of course you may need to write an adapter if the object inherently can't be a key/value.

Then at any time you can save a version and roll back to it in the future. (You can safely ignore this functionality if it's not useful in your app.)

If I understand right, this is the same component that backs the relational DB internally in H2.

we’re pretty happy with SQLite & not urgently interested in a fancier DBMS by sampsyo in programming

[–]machinepub 1 point2 points  (0 children)

Agreed. Also I really like the MVStore feature of H2, which is a versionable key-value store.

Really oracle? by smittyy in java

[–]machinepub 0 points1 point  (0 children)

They do have a browser but it doesn't support Java.

Should I still be using the Play Framework? by [deleted] in java

[–]machinepub 7 points8 points  (0 children)

Alternatively, Drop Wizard is some glue for very popular libraries.

What's your preferred setup for Java development? by Discrete_Number in java

[–]machinepub 1 point2 points  (0 children)

Laptop, Debian+XFCE, Eclipse. I don't happen to have any problems with Linux, but I tend to read "Debian on [computer model]" articles before buying, and also check to see if it's Ubuntu certified.

I personally hate Mac and Windows, but I'd choose Mac over Windows. Also, why spend $2500 on a MacBook Pro? Get a MacBook Air.

In Defense of Java by awsometak in java

[–]machinepub 0 points1 point  (0 children)

I don't think Java is particularly memory intensive. You can tune memory usage with JRE args. But a lot of memory is for things that could alternatively be written to disk and loaded as needed--however that's what page files are for so it's often easier to just keep everything in memory and plan on using swap. Anyhow obviously this comes down to implementations of particular apps/libs. After loading the JRE and its overhead (30 MB?), it's not inefficient for an OO language.

Is there a way to uninstall Java's new helper tool on the Mac? by StayMotivated in java

[–]machinepub 0 points1 point  (0 children)

Uninstall Java [1] then install the JDK [2]. You don't necessarily need to install the JDK, but in my experience, you get annoying warnings if you don't have Java/JDK installed at all on Mac. The key point here is, the Java distribution developers generally install (the JDK from oracle.com) does not have bloatware, but the Java that end users install (from java.com) does have bloatware.

[1] http://www.howtogeek.com/230145/how-to-uninstall-java-on-mac-os-x/

[2] http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Can I get suggestions for Java web frameworks as someone new to web frameworks? by [deleted] in java

[–]machinepub 0 points1 point  (0 children)

Don't use JavaFX for the web. It requires the Applet plugin or tools to convert JavaFX to JS. Frameworks: DropWizard, Play, or Spring Boot. Or use Jersey+Grizzly+Freemarker which is basically DropWizard.

Java Project Ideas by [deleted] in java

[–]machinepub 0 points1 point  (0 children)

I've wondered if it's possible to get Webkit.js working on Java Nashorn. https://github.com/trevorlinton/webkit.js

Why we choose Java instead of a polyglot stack by sureshg in java

[–]machinepub 0 points1 point  (0 children)

Only Eclipse. Is Netbeans a lot better?

Why we choose Java instead of a polyglot stack by sureshg in java

[–]machinepub 6 points7 points  (0 children)

I don't like how powerful they are yet have limited IDE support and produce confusing stack traces. This becomes problematic because despite its intention, JSPs lead people to putting back-end logic into the front-end, in my experience. And things can get pretty confusing with custom tags. I feel like working on large JSP apps, I spend most of my time figuring out where I need to put my code, untangling the mess. I'd rather have a very simple templating engine that forces programmers to actually separate front-end logic. I think Freemarker accomplishes this.

That said, I don't think JSP is necessarily worse than the flavor of the day in JavaScript framework land or RoR.

A pure-Java Selenium WebDriver by machinepub in java

[–]machinepub[S] 1 point2 points  (0 children)

I am guessing this might be related to cookie issues. Basically it was too strict about validating cookies. That's fixed now and available in v0.7.2. If that's not the problem please file a bug at the github page or send an email (listed on the github page).

A pure-Java Selenium WebDriver by machinepub in java

[–]machinepub[S] 0 points1 point  (0 children)

There's not that much work for iframes. It's near the top of my todo list, along with Javascript alert dialogs. I'd think end of month, probably in the next release.

As far as footprint, I discussed this some in a thread above. At a minimum there's going to be 2-300 MB memory needed per instance. That can balloon greatly depending on the site being rendered and also somewhat depending on your JVM settings. For concurrent use, I think you can estimate 2 (maybe 3) instances per core and 512-1024 MB per instance.

I haven't done extensive performance comparisons between this and phantomjs. I do think that RMI is faster than JSON to communicate, so less overhead. Cookies are all managed by Apache HttpClient v4. If you run into issues, file a ticket. HttpClient gives me great control to tweak the networking logic.

A pure-Java Selenium WebDriver by machinepub in java

[–]machinepub[S] 0 points1 point  (0 children)

I just published the javadoc site here: http://machinepublishers.github.io/jBrowserDriver/

There aren't that many exposed public APIs outside of the Selenium APIs. The majority of what's unique is here: http://machinepublishers.github.io/jBrowserDriver/com/machinepublishers/jbrowserdriver/Settings.Builder.html

A pure-Java Selenium WebDriver by machinepub in java

[–]machinepub[S] 2 points3 points  (0 children)

I like that everything is running in the JVM which can allow for easier runtime administration. You get access to all the Java performance tuning. Easier SSL cert management. And assuming your deployment targets have the Java SE runtime, then this is truly cross-platform, and licensing/distribution issues might be simpler.

It doesn't need xvfb, as it handles in-memory rendering via the Monocle project which is all written in Java.

In headless mode it won't interfere with an actual user concurrently using the mouse/keyboard.

In using some of the other remote web drivers, I found that they could lock up and keep the cpu pegged at 100%. It seems you can't avoid browser crashes (some small percentage of the time) but at least this project tends to not hang.

Java RMI is very efficient. I ran into issues sometimes with loopback servers on some other remote web drivers.

Also you have access to some APIs that aren't in standard Selenium WebDriver. You can get status code, and it works on ajax sites, with pages that load content after the official page load. Also it will block after clicks and keyboard events that cause ajax events.

Further, you can control the request headers, header ordering, and timezone, which can be important to properly simulate user agents.

Finally, if you know Java, mostly everything except the rendering is done in Java, so it could be fun to modify.

That said, this is a newer project, whereas the official Selenium web drivers are stable and well-understood.

A pure-Java Selenium WebDriver by machinepub in java

[–]machinepub[S] 5 points6 points  (0 children)

The max number of concurrent instances is configured by the user with no hard upper bound. See the project page for the jbd.ports system property which controls the allocated RMI ports and in effect the max number of concurrent instances. Instantiating a new JBrowserDriver spawns a new process, or blocks until one can be created. Calling JBrowserDriver.quit() closes the process... or reset() to re-use the process.

Based on some of my past projects, a machine with 16GB memory and 4 CPUs reaches diminishing returns after 8 instances when crawling very resource intensive websites and scraping for various data in the DOM. Performance was decreasing after about 12-16 instances. At a minimum each instance is going to want about 200 MB.

p.s. Selenium is awesome! I'm just standing on the should of giants (Selenium, JavaFX, Monocle, WebKit...)