Win a copy of liveProject: Build an ML Recommender System this week in the Artificial Intelligence and Machine Learning forum!

stelios papamichael

Ranch Hand
+ Follow
since Jul 29, 2016
stelios likes ...
Eclipse IDE C++ Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by stelios papamichael

Liutauras Vilda wrote:Ah, sorry for not understanding right away.

Try similar to this approach:

This is amazing and was just what i was looking for thanks so much!
4 years ago

Liutauras Vilda wrote:

stelios papamichael wrote:...i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it..

Please give an example, don't understand it.

I mean if you run it, an encrypted text will be displayed.The problem is that you cannot highlight it by clicking and dragging on it in order to copy that text!
4 years ago
Here is my code: i am doing something like an encryption program so i would like to present the encrypted msg to the user but i want the user to be able to copy it not just see it:

4 years ago
Hey there people,i built a program which involves me printing a text as output to the user but i want the user to be able to copy that text but using JOptionPane.ShowMessageDialog doesn't do that for me.Is there a way to fix this?Thanks in advance!
4 years ago

Paweł Baczyński wrote:A Locale object represents a specific geographical, political, or cultural region.
In different languages and regions "to lower case" operation might mean different things.

For example.
In Turkish language (represented by new Locale("tr", "TR") in the example) the lower case of I is ı and not i as one might except.

Suppose, one writes a code like this:... and the person from Turkey wants to execute it typing "I" for input.
What do they see?
Illegal choice...

Because their I was converted to ı which was not matched by any case.

I mentioned this because one must be aware of this behaviour when using "shortcuts" (as toLowerCase)

I had no idea about such things wow.Thanks a ton, however i won't use this since my program will be used by me and my friend only and we both live in the same country.Despite all of this, this info is amazing thanks a lot!
4 years ago

Paweł Baczyński wrote:You can do:

Beware, toLowerCase() can act "strange" on some locales.[code=java]System.out.println("I".toLowerCase(new Locale("tr", "TR")));

Don't quite get what you mean by that!
4 years ago
Hello there! I am using a switch statement for my program which works like a charm but i was wondering, can i have 2 options in 1 case? This is what i have :

and it goes till "z" but i would like to know if i can somehow have the first case work for both "a" and "A"?!
4 years ago
The only errors i get when running my app are these two but nowhere i could find a solution :

09-09 20:42:24.101 10348-10348/comspdesign.wixsite.httpsteliospapamichael0.flashlight E/Camera-JNI: android_hardware_Camera_native_setup Error: -1
09-09 20:42:24.101 10348-10348/comspdesign.wixsite.httpsteliospapamichael0.flashlight E/Camera: Camera new cameraInitNormal:-1

Any ideas?I tried a ton of things that i saw on youtube but could not find anything on google!
4 years ago

Dave Tolls wrote:Instead of having two ImageButtons you'd have a ToggleButton.
Instead of using onClick you'd use the onCheckChanged (I think that's the method) which gives you the View (ie ToggleButton) and the new value (on or off).

You can remove the isOn flag.
Inside the listener (now onChange) you'd not worry about the visible/invisible stuff (so throw that away) you'd just worry about the flash bit:

Note that that is not copy/paste code!

I read the documentation, show some other examples and tutorials on youtube about togglebuttons and switches but didn't find out if you can use images for this.As you saw i do wanna use my custom images and not just a pre-made toggle switch.
4 years ago

Dave Tolls wrote:Why aren't you using a ToggleButton?
That would get rid of the whole logic around visible/invisible and the isOn flag.
You could then also use onCheckedChange instead of onClick.

Any ideas on what i should change in my app to use a tohhlebutton or switch without re-writting the whole app?
4 years ago
NVM, i cannot edit the post so here are the updated files :



As you can see,i decided to play around with the images visibility instead of the resource of the image as that was causing my app to crash previously.But for some weird reason this setup does not seem to work even though it looks fine to me.I click on the off button when i launch the app and it crashes and the log files don't tell me much.Any ideas?Have i done something wrong in my code in general or in the order that my code is layed out?
4 years ago

Brian Tkatch wrote:I'm no expert. Still learning myself!

When using Android Studio, though, you can see the logs. Also, using Log.d() to specify a tag, and then filter on that tag to see what is going on. You can check if you are making it to onCreate(), at the very least.

Ok, i fixed the issue that was causing the app to close but i came up to another problem that seems to crash the app again.Please check the post again since i will update the code files MainActivity.xml and if you are willing to help me again ! Thanks in advance!
4 years ago
Hello there, i am a complete amateur as far as android application development goes but i have experience with java.I managed to build a flashlight application but when i run it it does not open and i do not know why that is,below i will post some of my scripts .java and .xml and i hope you can help figure it out.

NOTE : Android Studio was used



Hope you can help me figure this one out!
4 years ago

Paul Clapham wrote:. . .  just save the underlying data . . ..

So i can somehow grab the underlying data from the current model and pass it into a new dlm?\\How do i get that data though?I will do my own research too!

[edit]Cr removed most of quote as unnecessary.
4 years ago

Norm Radder wrote:

it created a Test.txt file on my desktop!

THere are two constructors used in that test program (line 9 and line 13).  How do you know which one created the file?  It's better to test one thing at a time so you know which one creates a file and which one does not create a file.

You stand correct once again, turns out the : line creates the actual file :P ! So i need to control that line right?
4 years ago