gusano79 247 Posting Shark

its still only running the first line of the method and skipping back to the form

This doesn't make sense... under normal execution, code isn't just skipped like that. If it's doing what you say, there must be an exception being thrown. Are you really not seeing an unhandled exception? What IDE are you using?

gusano79 247 Posting Shark

In the interest of getting your code working soon, this seems to be a problem:

loadTblStaff();
loadTblCars();
con.ConnectionString = dbProvider + dbSource;

You're creating the connection string after calling methods that need to use it. Try moving that last line above the load* method calls.

I think you should be seeing an unhandled exception at line 54 up there, where you try to open a connection that has an empty connection string. Is that what you mean by "never does anything other than call the first method"? Because if there's no exception, loadTblCars should always be called after loadTblStaff.

gusano79 247 Posting Shark

Oh, I almost forgot... while developing regular expressions, I find tools like The Regulator to be extremely helpful.

gusano79 247 Posting Shark

In addition to Mr. Waddell's comments...

An immediately obvious problem: the source has green.png, but you're looking for red.png.

A less obvious problem: You have a space at the end of the first part of the regular expression, but the input looks like it has a newline there. As it's inside the tags, you probably don't want to match it explicitly, so get rid of the space. It still won't match, though. You need to set the SingleLine option so your .* will match the newline as well.

A non-problem that in other cases would be one: Where you're matching red.png, the . still has its special "match any character" meaning, which isn't what you want. It works when matching the literal text red.png, but only because the literal . appears where you're matching anything. the regex red.png would also match other literal text, like redipng or red$png. If you want to match a special regex character as a normal character, escape it with \, like this: red\.png

So a corrected version of your regular expression would look like this:

<img class='stat_icon' src='/images/green\.png'>(.*)</a>

I recommend that whenever possible, don't break a regex across multiple literal strings (like you have above with &); it's easy to miss subtle errors that way.

Why not use Instr to get the start and end positions of the data then mid to get the actual data

Because it takes ten times as much code to match text, which is …

gusano79 247 Posting Shark

Hm... Makefile:31: *** missing separator is suspicious; what's in cmTryCompileExec2791379885\fast?

gusano79 247 Posting Shark

You have double backward slashes, which will confuse a Windows machine. Change \\ to \ both places it appears.

When troubleshooting batch files like this, you should remove or comment out echo off; then you'll be able to see exactly what commands are being executed.

gusano79 247 Posting Shark

Have you looked at using the Microsoft Office Primary Interop Assemblies?

gusano79 247 Posting Shark

Assemblies Overview on MSDN

Short version: They're how .NET applications are organized.

gusano79 247 Posting Shark

Side note: Also consider Path.Combine for creating the final path.

gusano79 247 Posting Shark
gusano79 247 Posting Shark

Does this model have a touchpad below the spacebar? I've had similar problems with laptops before; my hands tend to brush against the touchpad, which causes all sorts of weird cursor movement.

gusano79 247 Posting Shark

Rather than try and guess what's wrong, let's see what SQL is getting executed. Set a breakpoint on the line command.CommandType = System.Data.CommandType.Text and run the project... when it stops, see what the value of command.CommandText actually is. That should be illuminating.

Also, do get into parameterized queries sooner rather than later; I would require that of anyone writing ADO.NET on the job.

gusano79 247 Posting Shark

That would do it.

gusano79 247 Posting Shark

Are you sure it's stopping with the first frame, or is it possible that it's looping all the way around once and stopping on the first frame? That's what your code looks like it's doing. It will always reset currentFrame to zero, even if we're not looping.

Try changing this:

if (currentFrame > totalFrames - 1) {
    currentFrame = 0;
    //if not looping for ever than stop
    if(!loop) 
    {
        stopped = true;
    }
}

...to this:

if (currentFrame > totalFrames - 1)
{
    if(loop)
    {
        currentFrame = 0;
    }
    else // if not looping forever then stop
    {
        stopped = true;
        currentFrame -= animationDirection; // undo the movement
    }
}

...just to see what happens. This isn't the best way to handle not-looping, but it's the smallest change to the code that would help you check that behavior with a "forward" animation.

Better would be to rewrite the inner portion update to check currentFrame before adjusting it.

gusano79 247 Posting Shark

As for #1, it looks like it's supposed to be "factorial"; that's what n! usually means. #4 makes sense that way, too.

gusano79 247 Posting Shark

What have you tried so far? Showing us what you've tried will help us understand better where your problem is.

In this case, you want count(/library/book). The query /library/book returns all of the book elements, which you should pass as a parameter to the count function so it can do what it does.

Are you using an XML editor that lets you perform XPath queries while you work? I've found it to be extremely helpful; I normally use XMLPad.

gusano79 247 Posting Shark

What's the value of DS when this error happens?

gusano79 247 Posting Shark

Here's a discussion on a few ways to implement paging; that's the closest I can think of to get what you want.

gusano79 247 Posting Shark

sir, I have already written that my data is in number form. Can you tell some algod related to that ?

All data are "in number form." Watermarking relies on you being able to slightly modify your data while not losing anything important. There is no generic "watermark these numbers" algorithm like you seem to be asking for; what is important to a given set of numbers depends on what they represent.

So the next question is: What do your numbers represent?

@ David, you haven't got what am asking about. thanks.

Actually, you seem a little confused yourself about watermarking. I think DavidB's response is reasonable given how you asked your question. Specifically, this:

want to save that watermark which i will get so as to verify it in future.

Watermarking modifies data. There is nothing separate to save and use for later verification; that would be a digital signature.

Are you able to restate your needs without naming specific techniques or solutions? In other words, what purpose do you think a watermark will fulfil for you? If watermarking is a hammer, your problem may not actually be a nail.

gusano79 247 Posting Shark

From the Wikipedia article on digital watermarking:

A digital watermark is a kind of marker covertly embedded in a noise-tolerant signal

What algorithm you use depends on what kind of data you're watermarking. For example, if it's an image, you can usually add a watermark by replacing low bits at each pixel with a different image.

If your data aren't noise-tolerant, then you may want something like a digital signature instead.

gusano79 247 Posting Shark

I think that makes sense. So if loginName doesn't carry quotes, you'd end up with:

SELECT Type FROM users WHERE Name = someName AND Password = xxxx

...which is where I think your syntax error is coming from. String values need quotes:

SELECT Type FROM users WHERE Name = 'someName' AND Password = xxxx

You'll have to add them:

...WHERE Name = '"+loginName+"' AND...

Try that and see what happens.

gusano79 247 Posting Shark

I use Visual Studio at my day job; it's a decent IDE (though there are a few things I'd have had it handle differently, especially around autogenerated code). Haven't used Eclipse for .NET development, so I can't comment on that. You may also want to look at SharpDevelop; I use it for my .NET projects at home.

gusano79 247 Posting Shark

Have you tried writing this yourself yet? Show us some work, and we'll help you get moving in the right direction.

gusano79 247 Posting Shark

Does loginName come with quotes already?

gusano79 247 Posting Shark

Okay, have fun! Post more questions if you have any.

gusano79 247 Posting Shark

Do you have any requirements, or are you free to design the file system however you want?

I'd start with basic design (folders, files, &c.), and from there, design the API that consumers of your file system will use (or if you want to be more formal, start with use cases). From there, you can start implementing it at a high level first; for example, just stick file contents in a tree structure to represent folders.

The API (or use cases) will also inform any UI design you do--methods in the API (actions in the use cases) should translate to actions in the UI.

Once you have that working, then you can look at emulating some sort of physical disk (sectors, &c.) if you want that level of detail.

gusano79 247 Posting Shark

Solved it.

Good news! For anyone who runs across this thread later (and my own curiosity), what was the final issue?

gusano79 247 Posting Shark

Hm. localhost is the same as 127.0.0.1 so I'd expect the same result. If it couldn't connect to your server (for example if it was off), you'd get a different error... Hmmmmmm.

I was able to get a similar command to run for my local MySQL over here...

Unknown MYSQL Server host '127.0.0.1'--databases

Notice that there is no space between the host name and --databases in the error as reported; are there appropriate spaces in your manual command line?

savedlema commented: thanks. please check my reply. +2
gusano79 247 Posting Shark

This also might indicate that a background thread is still running.

gusano79 247 Posting Shark

First step is to see what the console output says; open up a command window and run it manually.

gusano79 247 Posting Shark

Are you looking for this kind of algorithm?

gusano79 247 Posting Shark

What behavior are you expecting and what are you actually seeing? It's easier to help if you give specifics.

Meanwhile, here are some comments:

trying to use recursion

Is there a specific requirement that you use recursion? If not, there are other approaches I'd recommend exploring first.

to find the occurence of a specific character in an array of characters

Do you mean a) find the first occurrence, b) find the last occurrence, c) find any occurrence, or d) count the number of occurrences?

From the name characterCounter, I imagine it's d), but the code doesn't actually count occurrences of the given character.

characterCounter(test, searchChar, test.length-1)

I generally find starting at the beginning results in code that is easier to understand.

if(t.length < 0)

Arrays never have a length less than zero; not sure what you're trying to do with this.

gusano79 247 Posting Shark

Changing the file extension doesn't do anything to the contents of the file. It looks like this is what's causing your "corruption"--you're asking Excel to load a CSV file, but its contents are still Excel format.

What you'll want to do is load the XLS or XLSX file as an Excel file (i.e., don't change the extension), then have Excel export it to CSV--have a look at SaveAs or SaveCopyAs.

gusano79 247 Posting Shark

I agree that fall-through can be handy, and I do occasionally lament its absence at my day job. But Microsoft seems to have been interested in lowering barriers to entry for a long time now, and AFAICT, this was just a decision the language designers made to prevent foot-shooting. My guess is that they required the last block to have a break as well just for consistency--they already assume we can't handle fall-through; why confuse us further? Eh, nichevo. =P

gusano79 247 Posting Shark

I'm not familiar with the term "client" used this way; that usually indicates some kind of network connection to me. For what I think you're asking, I usually use "consumer"--that is, a consumer of class A is any class B that uses class A.

If that's what we're talking about, then your Employee class is a consumer/client of EmployeeClass because the former uses the latter, but not the other way around.

Does that make sense?

gusano79 247 Posting Shark

Comment #1:

for(int x = i+1

but

x+=30;

I don't think that will do what you think it will do... are you trying to increase an x-coordinate there?

Comment #2:

but this way x+= 30 can still move enemy on top of each other.

So the next thing to do is check to see if the enemies are not actually overlapping, but would collide if you moved them like this.

gusano79 247 Posting Shark

"Don't work" isn't enough information for us to help... please post the code you have so far.

gusano79 247 Posting Shark

What do you mean by "can't get them to work"? Please provide specific examples of what you expect to see and what is actually happening. It makes it much easier to help you find what's wrong.

gusano79 247 Posting Shark
  1. NSLog works much like printf; %d is for integers, %f and %F work for both floating point types, and BOOL is just an integer, so use %d.

  2. double can handle more precision; try a number with more digits.

  3. That's how the language works; you have to write NSString *personOne, *personTwo;. It might help to think of "pointer-ness" as a property of the variable, not the type.

  4. Any integer type will do, like int i = 23; i <<= 2; should leave 92 in i.

MareoRaft commented: if %d is for integers, what is %i for? +3
gusano79 247 Posting Shark

To sort as part of your query, use an ORDER BY clause.

Does that help? If not, please post some code so we can get at specifics more easily.

gusano79 247 Posting Shark

You could generalize the point generation you have in initPoints to a method that takes an angle and returns the point at that angle; it would look something like Point CreatePoint(double theta), and would make use of the code inside your for(int theta... loop. Then get points for 45, 235, 225, and 315 degrees and draw little rectangles centered on those points.

Does that sounds like what you're looking for?

gusano79 247 Posting Shark

The wxWidgets folks keep a list of IDEs. I'd probably look at Code::Blocks first; it's worked well for me in other areas. I'm not sure how fancy or easy wxSmith is, though.

gusano79 247 Posting Shark

What does "didn't work" mean? What results did this code give you?

gusano79 247 Posting Shark

Have you looked at these methods?

gusano79 247 Posting Shark

Also: wxWidgets, which is supported by various GUI designer tools.

gusano79 247 Posting Shark

SQL INSERT doesn't use the WHERE clause. I'm not sure what you want to do here... can you post a "before" and "after" table to show us what you want to happen? Please include column names too.

gusano79 247 Posting Shark

Decryption is the same as shifting by (26 - shift)

gusano79 247 Posting Shark

It might help to visualize the constructed tree. For your example sequence [5, 3, 9, 7], I get:

  5
 / \
3   9
   /
  7

I'm not aware of "binary search cost" as a standard term, but it appears to be the element's tree depth plus one. This makes sense; this is how many node traversals (including the root) you have to make to find the element.

EDIT: Ah, reading your post more closely, we know this already. Sorry.

For each node, count and store the number of comparisons required when searching for the node

I'd store this in another field in BinaryNode, and the easiest way to get it is to keep track of tree depth when you're inserting nodes. In BinarySearchTree::insert, insert the root node with depth 1; then, for every other node, assign its depth as 1 higher than its parent.

gusano79 247 Posting Shark

For the PHP thing I linked, you'll need to install PHP, download the source (all of it), and run php test2.php from the shell. Note you'll have to change this line: define('FILENAME', 'test.flv'); to reflect your filename.

Not the prettiest, but I couldn't really find anything nicer. Perhaps your Google-fu is stronger than mine.

gusano79 247 Posting Shark

Like this? Are you looking for a standalone tool, or do you mind writing a little code?