Omar Al Kababji

Ranch Hand
+ Follow
since Jan 13, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Omar Al Kababji

use static variables, so the same instance is shared between all classes ;-)
What variable is supposed to be shared???

and there is only one thread running (except the main thread) so how could a racing condition happen?
I have to say that back that days, working on compiler and system programming projects was more interesting than developing web applications, you go deep to the bottom of the computer architecture, you write less code, but coding is much more difficult to write, you need to think a lot to find a good performing solution.

you are welcome Campbell.
11 years ago

drawing the tree was very difficult



I meant drawing the tree correctly in the editor with all the correct spacing, not drawing the real tree

back to the days of my Engineering studies I remember we studied these stuff in a course named "compilers" and I think we encountered stuff like this in "system programming" too.
11 years ago
Which by the way can be implemented simply by a stack, having only one result at the termination of the process.

For each item in the postfix expression from the left:
if the item is a number push it on the stack
if the item is an operator (PAIR) then pop two operands off the stack
if the item is an operator (SET) then pop one operand off the stack
make the calculation
push the result on the stack
When the loop is done the answer is the only item remaining on the stack.
11 years ago
Yes you are completely right, I think we need a tree to maintain the structure, and insert to the tree in a depth first order from left to right (while reading from right to left from the expression), keeping in mind that a parent node can have "n" childs where "n" is the number of operands the operator can have, and operands can't have childs.

for example for the second expression:

baz PAIR biz PAIR boz PAIR buz bez PAIR SET ”

we start parsing from right to left


we reached to an end because we have only operands at the bottom (buz and bez) left that can't have childs and there are still tokens in the expression so it is ill-formed.



for the first expression:
foo bar PAIR baz PAIR biz PAIR boz PAIR buz bez PAIR SET PAIR SET


we could build a full tree structure and consumed all the expression tokens, so its well-formed.

what about this solution??

drawing the tree was very difficult
11 years ago
yes but you have to consider the number you are getting when adding up operands, so you have to add two new rules:

1) before a PAIR operator your operand counter should be 2 (because its a binary operator)
2) before a SET operator your operand counter should be 1 (because its a unary operator)

so when you reach the sequence

bez PAIR SET
3 2 2

you have a bez count of 3 before a PAIR operator which is required to have only an operand count of 2, but its 3 so this means something is going wrong, and the expression is ill-formed.



did this help??
11 years ago
Yes cheating is something that you can't stop and that will never be stopped no matter what, we will always live with cheating. But we are missing something important having a certification doesn't mean you are an expert, even if you have a certification in your resume you may pass a recruiter filter and get an actual job interview, but once you are in a technical interview it will be noticed if you are what you claim to be or not.

I have read many excellent CVs but once they get to an interview they can't even answer a simple question like inverting an array. So you can lie and you can cheat but those lies can be discovered very easily.

Omar.
11 years ago
impossible, you can use it as much as you want:



two things, you didn't try it, or I don't understand what you mean by multiple messages on a JSP.
11 years ago
Yes you are both right you don't need persistence.xml if your EJB jar will contain only session beans, its needed only if you want to use JPA. but I supposed that since its EJB3 it would need JPA sooner or later.
11 years ago
Ok so the big circle is 100 pixel diameter and the orbiting ones should be 25 of diameter and a 5 pixels separation which leads that the orbiting circles should be placed on the circumference of a helping circle (lets named it X-circle) of a radius of 100/2 + 25/2 + 5 = 67.5 and concentric with the 100 pixel circle.


now you know where to place the orbits, but you need to put them at equal distances between each others to do this you need to make the following calculation where "n" is the number of orbiting circuits required. you could use the following pseudocode




if you try it on a piece of paper by hand you will get a clear idea, have fun with that
11 years ago
if it accepts <bean:message> once it will accept it 100000 times

just try it and everything will be fine, but check out how to use it first
11 years ago
Aaaaah internet latency sometimes it really kills me... glad you solved the problem
11 years ago
I suppose that you are using Eclipse:

1. Create an EJB3 project
2. Write an ANT file that will compile your EJB classes and deploy them to JBoss




for the persistence.xml file you should provide something like this:




finally you need a Data Source to connect to the Database, you could find most Database data sources under the directories of JBoss for JBoss 5 its under you will find them under the directory <JBoss>/docs/examples/jca

choose the appropriate data source for you database and modify it.

11 years ago