Go to advanced search

by addeswe
Wed Jan 15, 2020 7:12 pm
Forum: Java
Topic: Selenium & webdrivers
Replies: 1
Views: 1952

Re: Selenium & webdrivers

Yupp. But I think you need to provide a bit more details if you want help.

What is not working?
by addeswe
Wed Jan 08, 2020 12:50 pm
Forum: Java
Topic: How to decrypt a .class file
Replies: 7
Views: 546

Re: How to decrypt a .class file

Use jadx. With that you can decompile both dex, jar and class-files.

Download at https://github.com/skylot/jadx
by addeswe
Mon Dec 09, 2019 2:19 pm
Forum: Java
Topic: TCP Connection Refused
Replies: 1
Views: 277

Re: TCP Connection Refused

Instead of Socket, use ServerSocket. Short but easy answer. :-)
by addeswe
Thu Nov 14, 2019 8:40 am
Forum: Java
Topic: Unable to read cmd line from sh file using Java
Replies: 19
Views: 1141

Re: Unable to read cmd line from sh file using Java

Usually I don't really like to post bad code. However, I have no idea what you want to do with this. So I'll just show you an easy way to do it. List<String> load = new ArrayList<String>(); ProcessBuilder pb = new ProcessBuilder("uptime"); Process p = pb.start(); Pattern pattern = Pattern.compile("\...
by addeswe
Thu Oct 17, 2019 11:27 am
Forum: Java
Topic: array values not printing
Replies: 1
Views: 1833

Re: array values not printing

Code: Select all

import java.util.Arrays;

public class Main {

	static String[] values = new String[] { "a", "b", "c", "d", "e" };

	static void print() {
		System.out.println(Arrays.asList(values));
	}

	public static void main(String[] s) {
    print();
	}

}
Here is a working example. :-)
by addeswe
Wed May 30, 2018 8:34 pm
Forum: Java
Topic: Sending terminal commands using Java
Replies: 1
Views: 2076

Re: Sending terminal commands using Java

Short example: import java.io.BufferedReader; import java.io.InputStreamReader; public class process { public static void main(String args[]) { String tmp; String s = new String(); Process p; try { p = Runtime.getRuntime().exec("ls -aF"); BufferedReader br = new BufferedReader(new InputStreamReader(...
by addeswe
Wed May 30, 2018 10:38 am
Forum: Java
Topic: Need some help with program
Replies: 1
Views: 1255

Re: Need some help with program

Don't get me wrong. I feel that if it's a task given, you should do it yourself. However, I'll be happy to point you in (imho) the right direction. If you have set time values you can always use currentTimeMillis(). This is a Long that displays time since January 1, 1970 UTC (read up on epoch) in Mi...
by addeswe
Sun Feb 25, 2018 9:07 pm
Forum: Python
Topic: [Python3] Parsing Json with json
Replies: 2
Views: 642

Re: [Python3] Parsing Json with json

I don't wanna be that guy, but I always hope that you are the one to answer since you always know the answers. :-) Does not work in Python3, however. You pointed me in the right direction. So I managed to find the solution myself. Putting my answer here in case anyone else needs help with this subje...
by addeswe
Sun Feb 25, 2018 8:37 pm
Forum: Python
Topic: [Python3] Parsing Json with json
Replies: 2
Views: 642

[Python3] Parsing Json with json

So I've done some projects with json but then I came across this bastard creation and I honestly have no clue how to parse it. {"client1":{"percent":56},"client2":{"percent":53},"client3":{"percent":23},"client4":{"percent":60},"client5":{"percent":9}} If I use json.loads, the client-key returns as ...
by addeswe
Tue Nov 07, 2017 3:32 pm
Forum: Java
Topic: About How to Create Executable file in Raspberry Pi
Replies: 3
Views: 1611

Re: About How to Create Executable file in Raspberry Pi

What you can do is create a shellscript with the following code: #!/bin/sh MYSELF=`which "$0" 2>/dev/null` [ $? -gt 0 -a -f "$0" ] && MYSELF="./$0" java=java if test -n "$JAVA_HOME"; then java="$JAVA_HOME/bin/java" fi exec "$java" $java_args -jar $MYSELF "$@" exit 1 After that, just cat the jar-file...
by addeswe
Tue Oct 17, 2017 2:49 pm
Forum: Python
Topic: I need some direction!!
Replies: 6
Views: 1456

Re: I need some direction!!

This is how I would write it. A list of ports that gets activated one by one. Set as output and then be set to high for 3600 seconds (1 hour). Then it loops back to the next gpio and runs again. With a little luck. This is what you wanted. import RPi.GPIO as GPIO import time # Set relay ports used a...
by addeswe
Tue Oct 03, 2017 2:49 pm
Forum: Java
Topic: Javafx with old version of JDK(1.8.0) error
Replies: 2
Views: 1907

Re: Javafx with old version of JDK(1.8.0) error

In your error. It says: Caused by: java.lang.UnsatisfiedLinkError: /opt/armv6hf-sdk/rt/lib/arm/libjavafx_font_pango.so: libpangoft2-1.0.so.0: cannot open shared object file: No such file or directory . I guess that the compiler is not finding the shared library. Check to see if libpangoft2-1.0-0 is ...
by addeswe
Mon Jul 17, 2017 6:24 am
Forum: Java
Topic: Background task, Async?
Replies: 3
Views: 2284

Re: Background task, Async?

Thanks for the reply. However I've come to the conclusion to run the led in a threaded task. :-)
by addeswe
Thu Jul 13, 2017 8:40 am
Forum: Java
Topic: Background task, Async?
Replies: 3
Views: 2284

Background task, Async?

First of, I'm pretty new with Java. So this will be a stupid question most likely. However... My parents live where there is a lot of thunder. And they need a good way to shut down the pi without logging into the pi itself. So my idea was to write an application. And this is what I would want. Appli...
by addeswe
Wed May 11, 2016 2:57 pm
Forum: Python
Topic: Capture screen of Firefox
Replies: 6
Views: 1155

Re: Capture screen of Firefox

My intention was never to sound ungrateful. However phantomjs won't really be the solution to my problem since i read pixeldata. If I offended anyone by saying that "I guess that I'm semi satisfied with the help", I apologize. It was my way of saying that it is a solution but not really the one I wo...
by addeswe
Wed May 11, 2016 1:15 pm
Forum: Python
Topic: Capture screen of Firefox
Replies: 6
Views: 1155

Re: Capture screen of Firefox

I don't really have any problems with subprocess and I've used it for other projects, but thanks anyways! My only problem with this is that i need to use tmpfs where I save the imagefile if I use it for my project. The software is running checks more then once a second. So that is why I wanted to pu...
by addeswe
Wed May 11, 2016 8:14 am
Forum: Python
Topic: Capture screen of Firefox
Replies: 6
Views: 1155

Re: Capture screen of Firefox

Thanks for the reply MarcScott. At the moment, I'm using pyscreenshot. What I am doing is to capture part of the screen with a bbox. Then reads the r,g,b-values of the pixels. The problem is that sometimes a terminal window gets in the way or I have to swap to another fullscreen application. And the...
by addeswe
Wed May 11, 2016 6:41 am
Forum: Python
Topic: Capture screen of Firefox
Replies: 6
Views: 1155

Capture screen of Firefox

Hi. So I'm trying to capture the screen of a firefox (this can actually be changed to chrome, libre office whatever). Is there a library that allows you to do this? (pid-based or whatever) And is it possible also to this while the window is minimized? With a little luck, somebody has done this befor...
by addeswe
Tue Mar 29, 2016 7:07 pm
Forum: Beginners
Topic: Alternative to at scheduler
Replies: 5
Views: 933

Re: Alternative to at scheduler

Well ain't that a treat. Thanks DougieLawson for setting me on the right path. Answer if somebody else experience the same problem: You can't write it on one line: at 21:12 -M -f /tmp/whatever.py. This throws an error since it uses /bin/sh to execute whatever the shebang is. Solution: See previous p...
by addeswe
Tue Mar 29, 2016 3:46 pm
Forum: Beginners
Topic: Alternative to at scheduler
Replies: 5
Views: 933

Re: Alternative to at scheduler

Well... that's not really true. :-( [adde@vanille][/tmp] more test.py #!/usr/bin/python3 with open('/tmp/thisisanewfile.txt','w') as file: file.write('This is working?!') [adde@vanille][/tmp] at 17:38 -M -f /tmp/test.py warning: commands will be executed using /bin/sh job 2 at Tue Mar 29 17:38:00 20...
by addeswe
Tue Mar 29, 2016 1:08 pm
Forum: Beginners
Topic: Alternative to at scheduler
Replies: 5
Views: 933

Alternative to at scheduler

Hi. I want to run a software at random times and for this, at would be the perfect solution. My only problem is that it runs all scripts with the shell /bin/sh. And most stuff I write is in Python3. So is there a way to set Python3 as the shell, or is there any alternative? And no. I don't want to u...
by addeswe
Tue Jun 03, 2014 1:29 pm
Forum: Python
Topic: Writing to google calendar from console.
Replies: 4
Views: 2108

Re: Writing to google calendar from console.

Well, my problem is that i now get a 400-error. And since I get that, it doesnt write my credentials to calendar.dat. Also, it ignores my redirect_uri variable... Obviously im doing something really wrong. :roll: cli_ID = '****.apps.googleusercontent.com' FLOW = OAuth2WebServerFlow( client_id=cli_ID...
by addeswe
Tue Jun 03, 2014 12:31 pm
Forum: Python
Topic: Writing to google calendar from console.
Replies: 4
Views: 2108

Re: Writing to google calendar from console.

Thanks for the reply.

There is no way to make the call without having to type in your user&pass(&2-way auth) every time?
And when do i send the json parameters to the event?

I know this sounds stupid, but I've never made code for google apis. Only others and they don't use Oauth2.0...
by addeswe
Tue Jun 03, 2014 11:29 am
Forum: Python
Topic: Writing to google calendar from console.
Replies: 4
Views: 2108

Writing to google calendar from console.

Hey. I'm doing a project to automate my calendar with my work schedule. For this, I have a python script that parses an .xlsx. My problem is when I want to write this to a calendar. I have no clue how to use Oauth2 to get verified and be able to make the api-call. Anyone feel like taking some time a...
by addeswe
Mon Apr 07, 2014 10:10 am
Forum: HATs and other add-ons
Topic: Reading S-Video signal
Replies: 2
Views: 885

Re: Reading S-Video signal

Thanks for the reply. I've tried with a easycap but got a distorted image. Do you know where I could find a usb input device with (for example) STK1160 chipset that makes a ok picture? I have no worries about framerate. If I get i pic every 5 seconds, Im ok with that. :-)

Go to advanced search