|
|
Hello All,
I am a current college student that is back in school for a second career. I am well behind the curve (48 yrs old.) as far as programming is concerned, so every minute I spend wasted is one more that I fall behind.
I know that I am probably opening up a Pandora’s box, but I have heard about the certifications but yet I cannot find much information – such as which ones are the important certifications to have. If you could start it over and do your learning, training again – How would you do it? I wanted to ask those in the field, as none of my friends are in the field.
Any help would be greatly appreciated.
Matt
|
|
|
|
|
Certifications do not necessarily have great value, as most employers are looking for people with experience, or a college/university degree. And which subject to choose is always a difficult question to answer, as it depends on your interests and the requirements of the job market that you are targeting. You should talk to your professor about it as (one hopes) he/she has a good understanding of the market.
|
|
|
|
|
Am trying to make a java program that displays random letters till the letters make one of the words at, is, he, we, up, or on. I think am on the right track, just not sure how to stop when i reach one of those words. This is what i have so far.
public class main {
public static void main (String[] args) {
final int NUMBER_OF_CHARS = 100000;
String[] words = {"at","is","he","we","up","on"};
for (int i = 0; i < NUMBER_OF_CHARS; i++) {
char ch = main.getRandomLowerCaseLetter();
if ((i + 1) % 40 == 0)
System.out.println(ch);
else
System.out.print(ch);
}}
public static char getRandomCharacter(char ch1, char ch2) {
return (char)(ch1 + Math.random() * (ch2 - ch1 + 1));
}
public static char getRandomLowerCaseLetter() {
return getRandomCharacter('a', 'z');
}}
|
|
|
|
|
Just add some logic inside your loop to check every two characters to see if they match any of the words in the list. This would mean another loop that iterates through that list and does a string comparison[^] with your new 'word'.
|
|
|
|
|
hi
i am trying to use java to iterate thru the window desktop element.
does anyone know the API in java?.
i would like to print out in java the whole tree of my current desktop GUI elements.
|
|
|
|
|
|
Hi! I've been trying to implement Markov's algorithm, but I've only had partial success. The algorithm is fairly simple and can be found here.
However, my project has an added difficulty, I have to use rules that include markers and variables.
A variable represents any letter in the alphabet and a marker is simply a character that is used as a reference to move the variables around (It doesn't have a real value).
This example duplicates every character in a string:
Alphabet: {a,b,c}
Markers: {M}
Variables: {x}
Rule 1: Mx -> xxM
Rule 2: xM -> x
Rule 3: x -> Mx
input: abc
abc //We apply rule 3
Mabc //We apply rule 1
aaMbc //We apply rule 1
aabbMc //We apply rule 1
aabbccM //We apply rule 2
aabbcc
This is my recursive function that implements a markov algorithm that only works with string inputs for example: Rule 1: "apple" -> "orange", Input: "apple".
public static String markov(String input, LinkedList<Rule> rules) {
for (Rule rule : rules) {
if (!input.equals(input.replace(rule.getFrom(), rule.getTo()))) {
if (rule.isTerminating()) {
input = input.replaceFirst(Pattern.quote(rule.getFrom()), rule.getTo());
System.out.println(input);
return input;
} else {
input = input.replaceFirst(Pattern.quote(rule.getFrom()), rule.getTo());
System.out.println(input);
return markov(input, rules);
}
}
}
return input;
}
I can't figure out how to implement variables and markers into this logic so perhaps someone can educate me on the best way to implement this logic? any advice is welcome.
Thank You!
GitHub
|
|
|
|
|
|
A type of coffee.
If you can find your way to CodeProject, then you should be able to find your way to Google, for such an elementary question. Or try your local library/bookstore.
|
|
|
|
|
I need to do a program with 2d array.
- it should ask the amount of columns and rows from the user
- print the array
- add numbers 1,2,3...
- print the array
- calculate every rows averige and print it after the row
- calculate every columns sum and print it after the column
Here is what i have (after two days )
import java.util.Scanner;
public class matrix {
private static Scanner scanner;
public static void main(String[] args) {
scanner = new Scanner(System.in);
System.out.println ("Create matrix AxB");
System.out.println ("Set rows (A)");
int A = Integer.parseInt(scanner.nextLine());
System.out.println("A = " + A);
System.out.println(" ");
System.out.print("Set columns (B)");
int B = Integer.parseInt(scanner.nextLine());
System.out.println("B = " + B);
System.out.println(" ");
int X = A * B;
int[][] matrix = new int[A][B];
for (int row=0; row<matrix.length; ++row)
for (int column=0; column<matrix[row].length; ++column) {
System.out.println("Set element "+row+", "+column);
matrix[row][column] = scanner.nextInt();
}
System.out.println("Your matrix:");
for (int row=0; row<matrix.length; ++row) {
for (int column=0; column<matrix[row].length; ++column)
System.out.print(matrix[row][column]+"\t");
System.out.println();
}
}
}
So Please someone help me
|
|
|
|
|
OK, that seems to work quite well, so all you need is to add the calculations of the averages and sums. You can do these as you print the rows and columns, althugh you will need an extra array for the column sums, and a variable for the averages. Something like:
int[][] matrix = new int[A][B];
int sums[] = new int[B];
int average;
for (int row=0; row<matrix.length; ++row)
for (int column=0; column<matrix[row].length; ++column) {
System.out.println("Set element "+row+", "+column);
matrix[row][column] = scanner.nextInt();
}
System.out.println("Your matrix:");
for (int row=0; row<matrix.length; ++row) {
average = 0;
for (int column=0; column<matrix[row].length; ++column) {
System.out.print(matrix[row][column]+"\t");
average += matrix[row][column];
sums[column] += matrix[row][column];
}
System.out.println("- average: " + (average / B));
}
for (int column=0; column<matrix[0].length; ++column) {
System.out.print("----\t");
}
System.out.println();
for (int column=0; column<matrix[0].length; ++column) {
System.out.print(sums[column]+"\t");
}
System.out.println();
}
You could also improve the accuracy of the averages by using a float type rather than integer.
|
|
|
|
|
Thank you very much Richard!!
|
|
|
|
|
|
Hi,
I am playing around with the idea of using hashing algorithms to store private data in the cloud. I recon it should be doable on most client platforms, because of the availability of hashing algorithms.
- Each blob of data will have its own unique salt associated.
- A password + salt is used to create a hash (only salt leaves the client).
- The hash is used to encode the data in a rather simple manner.
- The encoded data + salt + algorithm version is to be stored in the cloud.
The hash can be used to decode the encoded data again.
The algorith implementation is here: ARosettaStoneV1.java[^]
Here is a unit test: RosettaStoneV1Test.java[^]
As an example the unit test can produce:
quebird.brokenclouds.core.unit.stones.v1.RosettaStoneV1Test@37bba400.testEncodeAndDecode():
#0: MD5 + UTF-8 on 'Hello World! Hellø Wørld! 0123456789 §$!#€%&/()=?+´`¨^*'-_.:,;<>'
encode: --- START --- [algorithm=BC1+MD5]
encode: salt[length=36] = 49 52 102 50 53 99 102 101 45 48 50 101 56 45 52 50 53 97 45 97 48 52 50 45 100 98 50 98 50 52 100 97 49 51 57 53
encode: data[length=71] = 72 101 108 108 111 32 87 111 114 108 100 33 32 72 101 108 108 -61 -72 32 87 -61 -72 114 108 100 33 32 48 49 50 51 52 53 54 55 56 57 32 -62 -89 36 33 35 -30 -126 -84 37 38 47 40 41 61 63 43 -62 -76 96 -62 -88 94 42 39 45 95 46 58 44 59 60 62
encode: hash[length=16] = 37 5 88 33 -2 -28 58 -32 71 27 119 -120 22 -87 -91 -2
encode: padding[length=16] = 84 24 -28 -92 25 61 -97 -27 125 -98 71 -57 43 24 -98 100
encode: output[length=88] = 0 0 0 0 0 0 0 71 -87 79 10 -37 4 109 54 -115 -15 -121 106 109 -71 -60 106 -111 -88 82 -41 -104 -89 85 70 65 -38 127 49 -111 -77 16 -56 -14 -85 -94 81 -104 29 54 -8 88 43 63 35 89 -18 -114 58 90 48 -94 -52 57 35 59 116 74 -45 123 43 75 -5 -128 52 101 -95 52 -118 27 32 57 83 77 72 -1 123 -124 95 -110 51 120
encode: --- END --- [algorithm=BC1+MD5]
decode: --- START --- [algorithm=BC1+MD5]
decode: salt[length=36] = 49 52 102 50 53 99 102 101 45 48 50 101 56 45 52 50 53 97 45 97 48 52 50 45 100 98 50 98 50 52 100 97 49 51 57 53
decode: data[length=88] = 0 0 0 0 0 0 0 71 -87 79 10 -37 4 109 54 -115 -15 -121 106 109 -71 -60 106 -111 -88 82 -41 -104 -89 85 70 65 -38 127 49 -111 -77 16 -56 -14 -85 -94 81 -104 29 54 -8 88 43 63 35 89 -18 -114 58 90 48 -94 -52 57 35 59 116 74 -45 123 43 75 -5 -128 52 101 -95 52 -118 27 32 57 83 77 72 -1 123 -124 95 -110 51 120
decode: hash[length=16] = 37 5 88 33 -2 -28 58 -32 71 27 119 -120 22 -87 -91 -2
decode: output[length=71] = 72 101 108 108 111 32 87 111 114 108 100 33 32 72 101 108 108 -61 -72 32 87 -61 -72 114 108 100 33 32 48 49 50 51 52 53 54 55 56 57 32 -62 -89 36 33 35 -30 -126 -84 37 38 47 40 41 61 63 43 -62 -76 96 -62 -88 94 42 39 45 95 46 58 44 59 60 62
decode: --- END --- [algorithm=BC1+MD5]
I am by no means a crypto-guru, so I would appreciate any comments you might have on the idea, the algorithm, etc. References on the subject are also appreciated.
Kind Regards,
Keld Ølykke
|
|
|
|
|
import java.lang.*;
import java.awt.*;
import java.awt.event.*;
public class Post extends Frame
{
public Post()
{
this.addWindowListener(new MyWinAdap());
}
public void paint(Graphics g)
{
g.setColor(Color.black);
Dots d = new Dots();
Text t = new Text();
d.start();
t.start();
}
public static void main(String[] args)
{
Post dtd = new Post();
dtd.setTitle("Dots and Displaying text");
dtd.setSize(500,500);
dtd.setVisible(true);
}
}
class Dots extends Thread
{
public void run()
{
int x,y;
Graphics g;
for(;;)
{
x=(int)(Math.random() * 500);
y=(int)(Math.random() * 500);
g.drawLine(x,y,x,y);
try
{
Thread.sleep(20);
}
catch(Exception ex)
{
}
}
}
}
class Text extends Thread
{
public void run()
{
Graphics g;
g.drawString("Hello!",100,100);
}
}
class MyWinAdap extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}
It gives an error - "variable g might not have been intialised".
I want two or more threads working on the same frame displaying different kind of data.
How can I do this??
Is there any solution to this??
I'm a beginner please guide me..
|
|
|
|
|
|
Graphics is a class. so we are creating an object for that class.g variable is not a problem.
create multiple threads and pass POST object to threads which extends FRAME class.
|
|
|
|
|
I installed the sun java application server and am have a big problem. After I installed the application a menu option folder "Sun Microsystems" was added to my All Programs. After the installation it seemed that all of the options were installed except for the actual application server. I ran the uninstall menu option and now the "Sun Microsystems" menu option folder is still on the All Programs list and except the main folder no menu items appear except for the sub folder "Application Server PE" and in it the contents display (empty). Also, after reading several posts it indicated I need several key values from the registry should be removed. After looking at the registry the options key value indicate (default), (value not set). Now when I go back and retry to install the application server again I receive the error "Could not find the required version of the java(TM) Runtime Environment.
I am really stuck and need help bad. Can someone help?
|
|
|
|
|
Install the Java Runtime as suggested by the error message. You may first need to ensure that everything related to both packages is removed from your system first. You also may get better support for the application server issue at the Oracle support forums.
|
|
|
|
|
I am getting the following exception while upgrading the axis2 version from 1.5.4 to 1.6.1.Note i am using OSGi 3.8.2,jetty server version 8.1.3
2015-09-04 19:21:42.250:WARN:oejs.ServletHandler:/services/WebServiceReceiver java.lang.RuntimeException: Undefined 'Security policy namespace cannot be null.' resource property at org.apache.rampart.RampartException.getMessage(RampartException.java:81) at org.apache.rampart.RampartException.(RampartException.java:41) at org.apache.rampart.RampartException.(RampartException.java:57) at org.apache.rampart.RampartMessageData.setWSSecurityVersions(RampartMessageData.java:373) at org.apache.rampart.RampartMessageData.(RampartMessageData.java:261) at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:61) at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:65) at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340) at org.apache.axis2.engine.Phase.invoke(Phase.java:313) at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:262) at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:516) at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:433) at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:216) at javax.servlet.http.HttpServlet.service(HttpServlet.java:755) at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:598) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:486) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111) at org.eclipse.jetty.server.Server.handle(Server.java:350) at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454) at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:900) at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:954) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:851) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:77) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:606) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:46) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:603) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:538) at java.lang.Thread.run(Thread.java:744) [2015-09-04 19:21:42,292] 637744 [Thread-95] ERROR errors - ERROR:CONNECTOR:webserviceconnector:Attempted read on closed stream. [2015-09-04 19:21:42,294] 637746 [Thread-95] ERROR errors - CONNECTOR:webserviceconnector:webservice:Attempted read on closed stream.
Rohit
|
|
|
|
|
This is not a Java programming issue. You should go to the axis2 website for help.
|
|
|
|
|
I need assistant in developing java application student's result transcript
|
|
|
|
|
|
book examples of procedure stored for sqlserver
|
|
|
|