JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Aren't we having fun trying to guess what the real scope and spec of the OP's problem really is!
Anyway, my 2p's worth:
I don't worry about OR. I happy to guess that both the input and output formats follow the usual precedence riule (AND higher than OR), so simply copying is OK.
I would be very worried about the possibility of extra bracketing. There isn't any visible or implied in the OPs posts, but if it were possible then the current solution is a non-starter and he will need a proper parser.
I too have no idea why the input format seems to have a redundant boolean operator, and it worries me. Why would someone design a syntax like that? It's one of those loose ends that when pulled can unravel the whole thing.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

To drop the last boolean you could use strrpos to find the position of the last space (ie the character before the last boolean) and substr to extract all the string up to that last space.

alan.davies commented: Just saw this after I posted :) +2
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Just to be sure... is it the last boolean you want to drop or is it the first boolean?

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

the additional AND at the end of the string.

Yes, I was curious about that as well. The input string has n boolean ops but the output string has n-1. How does that work? (I mean "what's the logic?" not "how do you code it?".)

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

You need to loop through that array processing one line at a time. Each line can be exploded into the 3 words so you can put them all back together in the desired order with the desired punctuation.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

No. Not Blu-ray for dvds, and not iso for a DVD player. There are apps for that, eg see https://www.howtogeek.com/howto/3061/burn-any-video-file-type-to-play-on-a-dvd-player/
Using a ChromeCast or similar is much easier and faster.

rproffitt commented: Excellent. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

There are quite a few programs that will burn a video file into a standard DVD, but the process is tedious and slow.
Why not get a ChromeCast or equivalent and beam the video directly from the pc to the tv?

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

The obvious JavaFX way to display a ResultSet is a TableView. You will find lots of examples with a quick Google, such as this one from GitHub
https://github.com/seifallah/Dynamic-TableView--Java-Fx-2.0-/blob/master/DynamicTable.java

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Don't know if something similar exists in Java

How could you doubt it?

https://docs.oracle.com/javase/10/docs/api/java/util/regex/package-summary.html

ddanbe commented: Yes, how could I ever doubt that +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

In a java string literal the backslash is an escape char, so to enter an actual backslash you need to code two backslashes

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Not sure exactly what behaviour you want, but if you set the editor but leave the default renderer then the combo box only shows when a cell is being edited and all the other cells just show their current value. That would be a normal behaviour in my opinion.

ps. Not dumb at all. We've all done stuff like that. Fortunately you could harness the power of castle DaniWeb.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

OK, I've loaded and run your code.
The problem definitely seems to be in the shared renderer.
If you simply comment out the line (~135) that sets the renderer then the table uses a default text field renderer and everything works correctly.

When swing refreshes the table it uses your renderer (of which there is only one instance) to paint all the cells in col 0 that are not currently being edited. That renderer paints exactly the same thing into each of those cells.
You need the renderer to use the actual value from the table model, which is passed into the getTableCellRendererComponent method, but ignored in your code.

Just for fun I added a setSelectedItem(value);call into that method. That way the combo box has the right item selected when the renderer is called for each cell.

However it does not work when the cell hasn't had a value set yet. In that case you just get the value left over from the previous call, so to make it work you need to initialise each cell to a valid value from the combo box when the new row is added.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Sorry, I don't have the time to set up a multi-file project to try that...
Can you strip it down to a single small file that demonstrates the problem?

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

At a quick look it seems that all the cells in Col 0 share exactly the same renderer and editor , so they should all look exactly the same all the time!

rproffitt commented: That's how clones are made! +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

What method/algorithm do I need to use?
or
I know the logic

Which?

rproffitt commented: Which logic! +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I've been trying my very, very best to convey the benefits I see in Dazah for many years now. No one seems to fully grasp the concepts. Time for telling is over. Now it's time to actually redevelop everything and demonstrate the benefits by forcing everyone to use them

You have an audience here who are expert practitioners in IT, web services, etc etc. Hundreds of man-years experience in designing, developing, supporting exactly this class of software/service. We don't need pretty pictures. But you think we are too thick to grasp your concepts and need to be forced for our own good, like children with spinnach. And no, we won't be "forced" to do anything except make a choice...

You insult us all.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

5hubham, hibathir:

I'm sure you are trying to be helpful but this topic is FOUR YEARS OLD!
And, the problem was reported as having been SOLVED FOUR YEARS AGO!

Do you really think that the original poster is still waiting for an answer from you?
Please think before posting.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

The previous posts are pre-JavaFX, which wold be vastly better for video display. A quick Google will give you lots of JavaFX video examples. Capturing the video from a webcam is the hardest part, but once again there are examples and projects on the web to support that. JMF is a dead duck since JavaFX was released.

rproffitt commented: Seems that folk are digging up old posts. Time for new discussions. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

To make room for "encoding" and "error" perhaps? (Personally I'm not familiar with either language.)
Not to mention "thermalprint" which appears in every single sub-heading.

rproffitt commented: Ah, thermalprint. Nothing like a hot stamping in the morning. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I should use == operator to compare the equality of two strings

Hopefully that's just a slip of the keyboard, but just in case...

Yes, use == to test for equality ( = is assignment).
== works exactly as you would expect for primtives (int, boolean, char etc) but not for Objects, eg Strings
== tests that two object references are exactly the same object (are both at the same address in memory).
Eg if you read a String s from the console, and the user types "yes" then
s == "yes" will be false.
To test if two Strings are equal in the ordinary everyday sense you need the equals method, eg
s.equals("yes")

rproffitt commented: So true. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Here is the code i have

Joking aside - we can't see any code, so cannot comment on it!

rproffitt commented: It appears we are commenting on it. Besides it's also free of bugs. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I think you'll find the shift in the opinion of those in power is about

as long as something isn't rich it's ok to enslave it.

"Worker's rights" vs "Employer's rights" .. who has the power?

Reverend Jim commented: Basically, them that has the gold makes the rules. +0
Agilemind commented: It is worrying how many people think Employers should be treated as royalty already. +0
rproffitt commented: If it's rich, take the riches too. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Please never never ban by ip address unless you know for certain that it’s a fixed ip.
A few years ago I had all my emails blocked because someone else had sent a ton of spam and I was the next person to get that ip from Orange’s shared pool.

happygeek commented: Agreed - rarely ends well +0
rproffitt commented: Yes. A fixed IP ban should expire quickly. These are tools in the anti-spam war. Choose wisely. +0
ernie.cordell commented: I had a fixed IP and was banned by a robot for using a "commercial phrase." IP ban + robots = broken. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

... the least of my worries right now because that's all cosmetic

... and there is what's wrong. It should be the greatest of your worries. What the user sees is what matters. Nobody gives a flying stuff about the underlying technology. You know that there's a pain point, you say it "can be easily changed at any time, so what do you do? You ignore it.

You are so obsessed by Dazah that you are failing to hear what everyone is telling you.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Is there anything that could be done to encourage you... to post tutorials or code snippets instead?

Yes, sure.

A while back assertnull and I built and published a Java utility that could be useful to beginners (here)

Within a few days it had shifted off the first page so I tried to sticky it to maintain its visibility. A bit later it was un-stickied by an admin for perfectly sound reasons.

My conclusion is that there's no point publishing tutorials or snippets as long as they will get buried in the normal Q&A traffic. They need to be a top-level entity in DaniWeb, that people see BEFORE they get to post or view ordinary discussions. Eg like consumer product support sites require you to go through the FAQs before you reach the mail/chat links.

If I believed they would be seen I have a ton of tutorial and sample code snippets that I would be happy to contribute over time.

Edit: The more I think about it the more I like the idea of an FAQ page for each language/technology that would be the landing page for any new member. The content could be tutorial, code snippet, or advice on how to ask questions. That could also remove one complete layer of bad posts that get shot down in the first reply.
eg (Java, because thats my bag) here are some questions that I have answered more than a few times:

Give me the codes …

rproffitt commented: Nod to where Forums work. Tags? I'm not sold. +0
ernie.cordell commented: Agreed: Drill down works when search engines fail. You learn to come back because you find solutions. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

what need or requirement exists that DaniWeb is well placed to satisfy

I see DW as a resource primarily for learners. Unlike S.O. we are beginner friendly, and will spend time discussing options and providing guidance. This is surely a huge need that we have met well in the past and can do again.

There are three things wrong with DaniWeb: no traffic, no traffic and no traffic

I agree 100%. If we don't get DW in front of potential members then nothing else matters. Questions like "how can I best use <some particular technology>?" or "what problems do existing comitted members have?" are irrelevant. There are three things that need to be fixed: SEO, SEO and SEO.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

3/3 should be 1, not 0

Nightocoder201 commented: @JamesCherrill, I made a typo it suppsoe to say 3 / 5 not 3 / 3. my bad +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Hi XRJ
Are you sure you’re teaching OP rather than just giving code he can copy/paste imperfectly?
The index of 99 suggests to me that he’s still running the original code where he set the index values to 100

rproffitt commented: Bending the curve at school. Do everyone's homework, you move up the ranks on tests. They learned nothing. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

99% certain it’s an error in your brackets.
Line 79 is formatted as if it should be a close bracket, but it’s an open bracket. Suspicious!

rproffitt commented: That's likely it. Unbalanced brackets. For each left there shall be a right. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

AWT was replaced nearly 20 years ago! You should be using Swing, or JavaFX.
Swing was the direct replacement for AWT, and is very similar.
JavaFX is the newest GUI and is supposed to replace Swing, but it’s very different to work with, so most people are still using Swing.

The official Java tutorials are on Oracle.com. They have very good Swing tutorials and examples, including displaying grids of data in JTable controls.

rproffitt commented: I get it. But then I'm fixing a VB6 app this week too. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I dont speak php, but since nobody else has answered...
is php like oher languages where the scope of a variable is its immediately containing block? Because if so $sql is only in scope thru lines 16-19. If not, please ignore this.

ryantroop commented: If I recall, PHP does not hoist like JavaScript. This is the problem. +9
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Given all that you have said... suppose Dazah were bringing in loads of money, how exactly would you change DW's business model?

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

i do want to develop the program using a powerful (ide).
i do want versions of the program to work on windows, linux, and apple desktop pcs.

Java/Netbeans would be an obvious choice.

JC (newbie, only programming since 1969)

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Congratulations on a really interesting question!

maybe what’s going on is in the String.format you process a l-r string, then a r-l and after that the direction is still r-l when the third argument is processed.

There are Unicode chars to override the direction, but more than that I don’t know. They are

left-to-right mark: 0x200e
right-to-left mark: 0x200f

I think you insert them in the string, but I don’t know where exactly. Maybe that’s enough info for you to find more details?

Cheers
JC

stephen84s commented: Yea this is one I've never seen before +11
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

May I ask what results you see?

I looked at all the first 10 pages, and found more discussion threads after the first page.

But anyway, if what you say is the whole story it's all academic. If there's no way for people to discover that DaniWeb exists and provides the kind of services it does, then we're all wasting our time.

More constructively...
Page 2 of that Google search has treehouse community, rapid miner, modelio, java forums, github, atlassian community.
I look closer at the first four, and they all seemed be the same as us. Except they are on page 2 of Google's results.

What are they doing that we are not?

rproffitt commented: I am reading folk that want Page One results. That means cash to Google for well, you know. Placement. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Search engines don't send traffic to forums anymore ... especially any tech forums. It's not like other forums started outranking us and we can just work on our SEO.

I'm calling bullshit on that.

I just tried the kind of search a Java learner is likely to make when seeking help:
"java problem null pointer"

In the first 10 pages of results maybe 1/4 were some kind of forum or community discussion site, starting with hit number 2 None of them was DaniWeb.

ryantroop commented: I also view StackOverflow as a forum with threads... but I don't think that was her point entirely. I do, however, agree with yours. +0
rproffitt commented: I wonder if Google has changed search yet again. For a time I didn't get forum hits. Now I do. +0
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

There is no universal standard for writing pseudo-code. It's up to you to chose whatever words you like to explain the algorithm or process you are trying to document. Use brackets where they help make things clear.
A lot depends on the level of detail... if you are explaining some technical detailed thing (eg compressing audio data into an mp3) the you will probably be careful about showing all the exact scope of loops and if tests. If you are explaining a business process that going to be automated, then a much higher-level syntax would be appropriate.

In this case you are getting hair color from a photo. You don't need to explain how to do that yet, but it helps if you show what kind of detail you need... just quick blond/brown/black categorisation, or much finer detail... what about people with streaks of a different color... etc By saying one of black/brown/blondyou are telling the reader all they need to know for the moment. Exactly how you say that doesn't matter as long as its clear to the reader.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Definitely better.
Pseudo-cde is for explaining algorithms, flow of control etc, so you don't need quite so much detail, and you can make up you own "syntax", eg:

GET passenger photo 
get eye color from photo (one of blue. brown, green, unknown)
get hair color from photo (one of etc
if eye color and hair color both match the id then passenger is matched, otherwize passenger is denied

details like switch don't belong here unless you are making a point about exactly how to get the color.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I feel embarrassed having to bother my peers about programming issues that they don't seem to face

Why? Asking someone for their advice is the sincerest form of flattery.

The trick is to keep the questions short and specific, because most people don't have time for a long discussion. Try questions like
I used this <code construct> but it seems tacky. Is there a better way?
Where can I find info on <API>?
Is it better to do <concrete example 1> or <concrete example 2>

Sure, some people are jerks and won't help you, but most people are pretty decent, just give them the chance.

Finally, when people spend time helping you don't forget to say "thanks"

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I never saw DW as just another vanity self-publishing social media timewaste. Real people with real problems came seeking answers and real people with real expertise spent real time answering them. You say that's "old hat". I disagree. There are just as many people struggling with IT courses as there always were. I can't see a single reason why the demand should have declined.
OK, so the problem is Google. So isn't the response 100% effort in SEO?
If it turns out that we can get better exposure by adding some particular feature (language-specific forums anyone?), and that Dazah API is best way to do it, then OK. Otherwize it just sounds like a solution seeking a problem.
If the real problem is that it's hard to make enough profit from a service like DW then it's time for some existential soul-searching.

<personal note> Dani: I seem to be your main, even only, critic on this. It's not personal. For the record I'm a huge fan of you and what you have done. I'm arguing a side that I believe needs to be argued, but only because I really want to see DW continue. I have no doubt that you are the solution, not the problem. JC </personal note>

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

If you want to view & merge them online then The first page of a Google search will give you about a dozen options, all free.

If you really mean offline, the I found this which you can execute via the command line after 20-30 seconds of Googling.

Did you bother to do even the simplest research before posting?

ryantroop commented: Thank you kind sir +9
rproffitt commented: Seek and you shall find a +1. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Do provide evidence of having done some work yourself if posting questions from school or work assignment.

DaniWeb Community Rules

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Pseudo code

loop function (array):
   for each element in array
       if its the one you're looking for exit loop

recursive function (array):
   if the first element is the one you're looking for return it
   return recursive function(array with the first element removed)

ps you don't need to create a new array - just pass a ref to the new "first" element

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

First: I congratulate you on your honesty and bravery in making that post.

Second: You have already taken at least three giant steps where most others will have already failed:
You recognise that you need to improve
You believe that you are capable of improving
You are willing and able to invest time and effort into improving

I'm out of time right now, but I'll get back to you later today with some thoughts on asking for help, doc vs video, and debugging.

Finally:

I don't have any developer friends I can talk to about this.

Yes you do now, you just joined DaniWeb.

happygeek commented: 100% agreement +16
ddanbe commented: All but true +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

The php experts seem to be stil in bed, so I'll have a go...

The & defines a reference. References in PHP are a means to access the same variable content by different names. Its like creating an alias for a file (or more like a Unix hardlink) http://php.net/manual/en/language.references.php

$b = &$a; makes $b an alias for $a

$b = "2$b"; evaluates the literal 2 followed by the value of $b, which is the same value as $a, which is 1, so it evaluates to 21.
$b is updated with that new value.
$b is an alias for $a, so $a is also now 21

echo $a. ", " .$b ; -> 21,21 simples!

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

rproffitt: ...over 100 years. First computer program for me was 1972

Well. yes way over 100 then. I joined IBM as a trainee programmer in 1969 and I'm pretty sure the Rev is a similar vintage...

rproffitt commented: Would be interesting to add up active member programming yerars. All active folk have been very nice, even to the new folk. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

I don't think there's anyone here who can do that for you. You should contact Apple directly.

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Just a reminder for everybody....

Do provide evidence of having done some work yourself if posting questions from school or work assignments

(DaniWeb User Rules)

JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

Hi KeyWizard.

Don't let the people who can do nothing but judge and ASSume get you down... haters, they are going to hate

I think you may have gotten the wrong idea from the various posts in this thread. The people who posted have about 100 years programming experience between them, and have taught or assisted hundreds of learners. We were not saying that OP should give up. We were saying that he has to do the work, not copy code blindly, and understand each stage, otherwize he may as well give up because that's not going to work.

Your own experience confirms that - you had to spend time and effort at the beginning to understand it from the most basic level upwards. But it paid off and you have enjoyed real success.

Just check out a few other topics here - you will see that DaniWeb is an outstanding support resource for anyone who genuinely wants to learn, and our contributors will go to great lengths to help people who are willing to make the necessary effort.

JC

rproffitt commented: I bet over 100 years. First computer program for me was 1972. Ouch. +15
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster

This is an odd conversation...
We do get people posting here who obviously don’t have what it takes to be a software wiz. But with A’s in math you clearly have the necessary mental equipment, and the code you posted is is high quality stuff which means either (a) you just copied it or (b) you have far more programming ability than you think. If it’s (a) then we’re all wasting our time here. If it’s (b) then you have a confidence problem, not a programming problem.
Let’s assume it’s (b). You are looking at the assignment in a state of funk and blind panic. You don’t know where to start.
So start with stuff you feel comfortable with. Get some paper and pen. Play tic-tac-toe a few games. Start to write down what you are thinking as you chose moves. After a bit you will have written down some rules about how to chose moves. Now go back to your pc and think about how to turn those rules into code. Start some easy cases, eg there is a winning move available... how do you identify that winning move? Get that working. It’s not quick, but then it was never going to be quick.
There’s a common mistake that learners make, which is to try to solve the whole program in one magnificent try. They type in hundreds of lines of hopeful code before even trying to compile it. When it doesn’t work they don’t …

rproffitt commented: I worry this isn't the OP's code. I'm reading http://www.cs.utexas.edu/users/mckinley/305j/lectures/BlueJExamples/22-2Darrays/TicTacToe.java +15