Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Jeremy Botha

Ranch Hand
+ Follow
since Feb 16, 2005
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 Jeremy Botha

I wrote a key-based licensing system for an application several years ago. The concept was that we used our company private key to generate a SHA1 hash of parts of an xml license file, particularly the bits that governed which modules were installed and what options the client had available.

It worked well, from the point of view that someone without any knowledge of cryptography would be unable to modify the license file without rendering the hash invalid.

this didn't solve the main problem, though - someone skilled enough would quickly have been able to decompile the license manager classes and simply alter the code so that all license checks returned true. Also, issuing new licenses was a PITA.

I've come to the belief that crippleware is evil. If you don't want people using your software without paying licensing fees, enforce this via a valid contractual agreement (not a EULA) and make it clear to them that if they violate the terms of the contract they will be sued.

No matter how 'secure' you make your application, at some point it is possible to get around the security. Whether it's by monitoring OS memory to get passwords, decompiling the source, or simply reverse-engineering the licensing scheme; if your application serves a useful purpose someone, somewhere is going to 'fix' it.

Far better to channel your energy into other projects.
J
12 years ago
Why not simply extend the class in A.jar ?

protected methods are available to subclasses.

J
12 years ago
base state : you have to move the goat first, it's the only legal first move.

For every subsequent move:
select an object O to ferry from A to B.
- if O is an unsafe choice, terminate this branch and return to the level above
- if O can be removed from A leaving a safe combination behind, move it to B
- if B is now an unsafe configuration, select an object other than O and bring it back to A.
- repeat / recurse / do a little dance

J
12 years ago
The wolf / cabbage / goat problem is a 3 disc towers of hanoi problem.

That is to say there's probably an elegant recursive solution to it.

J

Edit - my mistake, it's not tower of hanoi, but it has some similarities.

[ December 07, 2007: Message edited by: Jeremy Botha ]
[ December 07, 2007: Message edited by: Jeremy Botha ]
12 years ago
Hi, guys

Our client (a foreign telecoms company) requires us to write a module which will perform what looks like IP address provisioning on a Cisco 3800 series router; they are not prepared to pay for the Cisco java API so it looks like we're going to have to do it via Telnet.

Before I start, I'm trying to research any other possible cleaner configuration options. I've heard rumours that Cisco routers support JMX, but I can't find any useful documentation, and from what I can work out SNMP support is purely for monitoring.

Anyone have any experience doing this sort of stuff? I've got zero experience configuring routers bigger than my ADSL router at home
Any docs / sites / apocryphal stories / commiserations are welcome

thanks for your time
Jeremy
12 years ago

Originally posted by rinke hoekstra:
[QB]

Hi Jeremy,

I think that is a bad idea. A record in the urly bird database represents a ROOM. Why wouldn't a hotel owner be allowed to offer several rooms in his hotel? It could even be that a hotel has several rooms in the offering with exactly the same specs (size, smoking/non, etc).




Hi, Rinke.

I was dealing with B&S, not UrlyBird. Sorry, I should have made that more clear.

J
Hi, Yogesh.

What XML API are you using? JDOM? NanoXML? Xerces?

I suspect you need to look for a method called setText(String) or addContent(String) on the Element object you're referencing.

J
Why not,as your first step when receiving a message, check whether a duplicate exists in the database; if so, disregard the incoming message.

You should be able to do a simple select based on the criteria of the message; I assume you're using some form of compound key based on message properties.

This is probably simpler than trying to get a transactional rollback system working.

Failing that, I believe there are several distributed transactional systems for JMS. What JMS Server are you using?

Jeremy
13 years ago
I've lost count of the number of times we've had to kill -9 rogue JBoss processes at my current place of work. If we were caching data, that would be hundreds, if not thousands, of customer transactions lost into the void.

Persistent data storage (be it a flat text file, DB, or quantum entangled crystal lattice ( ) is designed to store persistent data. Any performance loss should always be carefully evaluated against the possibility of data corruption. I'd rather have slow performance than irate customers, personally.

J
This has been covered before.

In short, it's because most people like the ability to use objects that are not direct subclasses of Thread as lock objects for synchronization. If you take the time to think the issues through, you'll realise that an object like a Database connection pool store might not need to run in a thread, but still requires synchronization on its getConnection and releaseConnection methods.

Rather than creating a new Thread to synchronize off; doesn't it make sense to just be able to call dbConnectionPool.wait() and dbConnectionPool.notifyAll()?

J
Write out the various integers as binary strings, then apply the operators above, then return them to hexadecimal representation.

You'll soon see why f is correct.

J
Hi, Shankar.

To simplify what others have listed here, your ternary expression is of the format:

integer expression ? double value : integer value

Since one of the result values is a double, the other will be treated as a double. If your expression was of the format

int i = 5;
if(i > 5) ? 10 : 9;

Then you would see 9 printed out.

J
13 years ago
I would have killed someone over the above mock question

J
The first thing I did was write a data file parser. I read the various fields in, made a schema object, and then dumped the read fields to STDOUT. Once I was getting meaningful data values there, I knew that I was interpreting the file correctly.

Honestly, the file format is easy - it's a flat file; no indexes or anything nasty like that, and once you've worked out how to read data from it you're more than 50% of the way there.

J
Hi, Pandu.

Given that you're trying to relate word counts, the first thing I'd suggest is a Map object, keyed by the word of interest, and containing a Integer or Long as the value.

Maps are generally the most efficient way to store data when you need quick access by key. You can probably find a faster method with Google, but the sort of speedup you might gain will be counteracted by much greater complexity.

Jeremy
13 years ago