Paul.Esson 53 Junior Poster

Switched to Firefox at work, Simply because Chrome is yet to implement Wayland support. Firefox is great, To be honest I don't notice the difference really apart from the when I use the dev tools.

Firefoxes push for privacy is really cool though, I think chrome is (or soon) blocking traking cookies, but Firefox has been doing this for a while.

rproffitt commented: FF also blocks FingerPrinting. More at https://blog.mozilla.org/security/2020/01/07/firefox-72-fingerprinting/ +15
Paul.Esson 53 Junior Poster

Does anyone know of a good SVG editor that allows you to easily edit the document in text as well as visually.

I have been using Inkscape, but the XML viewer/editor component is less then ideal, plus it adds alot of crud to the resulting XML.

I attempted SVG Editor for VS Code, but that was quite slow and also didn't easly allow editing of objects that are inside of groups.

Paul.Esson 53 Junior Poster

I don't know if you made any mistakes, but my advice would be to log the exceptions to the event log so that it's known when it doesn't successfully run and why.

Paul.Esson 53 Junior Poster

Technically me can be correct as well :

The gift was for him and me.

He and I were given a gift.

If you would use him, you should use me, if you would use he you should use I.

Actully it's simpler then that, if you remove the other noun and the conjunction the sentance should still make sense.

"I was given a gift" is correct while "Me was given a gift" is clearly incorrect.

"The gift was for me" is correct while yet again "The gift was for I" is clearly incorrect.

This entire topic has just served to remind me of Henry Higgins. Good musical :)

Paul.Esson 53 Junior Poster

Two word's that get used quite commonly in our industry, route and data are quite interesting.

The USA have drifted away from the English pronunciation, and due to the proliferation of American TV a great deal of Australians also use the American pronunciation of route.

Traveling 200 miles in the UK would bring you to not only very different accents, but also a different pronunciation of the word iron.

So while there may be a correct pronunciation of a word, I would pose that the incorrect pronunciation is only incorrect until a large enough group adopt it.

Paul.Esson 53 Junior Poster

I must admit I would struggle with that a little as well, In London we just have people mispronouncing Southwark and Thames.

Couple of weeks ago I mispronounced Surrey Quays.

Paul.Esson 53 Junior Poster

Some members have left SeaOrg, so either the contracts arn't legally binding or Scientology is the one true religon and they have found the elixir to eternal life.

I think it may be the former....

Paul.Esson 53 Junior Poster

It would be a lie if I said I knew, What do you get when D is close to 0?

Paul.Esson 53 Junior Poster

Matrix algebra is the possibly the best way of doing this.

You can either write code to do the matrix inversion and multiplication or alterativly use a library that already supports matrices ( such as OpenCV ).

http://www.mathsisfun.com/algebra/systems-linear-equations-matrices.html

http://en.wikipedia.org/wiki/Cramer%27s_rule

Curious, what's the error when using determinats

Paul.Esson 53 Junior Poster

Nice one Paul, you requoted wikipedia, and along the way made a citation from Ohm's law. However, in all of that I didn't see an ACTUAL answer from you and you alone.

Sorry for the Wikipedia definition, but I thought it would be good to agree on what sound is before trying to ascertain if the tree makes one.

The actual answer from me and me alone along with the explanation of why it is indeeed the answer, referencing both wikipedia and Ohms law was in that post.

Yes, it does make a sound, it's unreasonable to think it does not.

Paul.Esson 53 Junior Poster

If it's for non commercial then MBROLA has Aribic support, I think its a command line application, so while it does not support .NET as such it should be easy enough to incorporate it into a .NET application by just launching the MBROLA binary from within your .NET application.

http://tcts.fpms.ac.be/synthesis/

Paul.Esson 53 Junior Poster

is sound only sound if a person hears it?

Taking the wikipedia definition, yet again

Sound is a mechanical wave that is an oscillation of pressure transmitted through some medium

If a tree falls in the wood there will be an oscillation of pressure transmitted, regardless of if an observer exists or not.

Clearly you can never truly know it existed, although the mind is a fickle thing, even if you could hear the sound you could never really truly know it existed ( hence why the question is posed ).

The resonable assumption that we make is that if a rigid object falls on another with a large enough force there will be a large oscillation of pressure. This is a resonable assumption thats based on prior experience.

It's also a demonstraton of how sciance works, Ohm's law states V = IR, we can say this law hold true with resonable certainty although since we have a infinite spectrum of numbers there is no possibly way we have ever observed Ohm's law for all possible values of I and R.

This also stands true for evolution, Some criticism is placed on it since we don't have a complete lineage in the fossil record, but as with Ohms law the theory adequately explains what we can and have observed.

Paul.Esson 53 Junior Poster

Perhaps use a char, and not an int, initalize them all your chars to the numbers you have been using, if it's x's turn and he picks 1, change the 1 to an x.

Then after each turn print the result.

Also I have a feeling you might want to use a switch statement not an if.

Paul.Esson 53 Junior Poster

Could you expand on that a little?

Paul.Esson 53 Junior Poster

If you're using UDP 65,507 bytes is the largest size, for TCP it's 1GB.

If you're using TCP there is very little reason not to send the data in smaller chunks, then combining the buffers again at the other end. TCP should deal with the order of the packets, but if you're going to take this approch you may also want to have 4 bytes at the start describing how long the message is.

If your using UDP and you plan to send in multiple chunks you either have to add a sequence number ( such as in tcp ) or send in such a way that you don't spit any of the data.

http://pic.dhe.ibm.com/infocenter/tpfhelp/current/index.jsp?topic=%2Fcom.ibm.ztpf-ztpfdf.doc_put.cur%2Fgtpc2%2Fcpp_send.html

Paul.Esson 53 Junior Poster

If you press the code button you should be able to insert your code into a code block in your message.

Paul.Esson 53 Junior Poster

According to Google glid is a swedish word for glide.

I figure if you just use a word enough, get it in a couple of books, then slowly those crazy dictionaries will catch up.

I like glid, It's quite logical.

Paul.Esson 53 Junior Poster

Lol, I didn't know a dictionary could be "authoritarian".

Why not, bloody thing is always telling me how and how not to spell.

As an example, When I was in high school I used to use the word 'gradiate', but the dictionary, smacked me down and advised me that it wasn't a word.

I say revolt against the system spell the way you feel :).

Gradiate:

Example: The colour ( correct spelling with a u) gradiates from blue to red.

as opposed to:

The colour's gradient transverses from blue to red.

or

The colour's gradient is -1b,1r,0g in the range [0,255] where at x=0, r=0, b=255, g=0.

Paul.Esson 53 Junior Poster

PSUDO code would look something like this:

create 6 random numbers
for 0 to 6
    ask the user for a number
         \if ( number => 1 && number <= 30 )
              store input
              (this is where you may want to increment your varible for iteration )
         \else tell them they are doing the wrong thing

then

 \if ( 5 correct ) you will print lucky five <-- condition in your flowchart
 \if ( 4 correct ) print lucky four 
 \else try again

So represent the steps above as a flowchart

http://en.wikipedia.org/wiki/Flowchart

then attempt to program it, the flow chart should help you figure out the program logic.

Paul.Esson 53 Junior Poster

I was thinking in regard to a webservice, you could write a webservice that was unhackable with enough time and effort, although as mike point's out, it does not stop someone from writing a fake website and stealing your users passwords, or a rouge sys admin from modifying the service.

While not a technically a hack:

A great example of both a great scam to get money from people and also a service that you don't have access to the encryption keys would be the Cryptolocker virus.

The files on your system are encrypted, they keys do not exist on your computer, unless you give the friendly folks who have sent you the email 3 bitcoins, you are unable to unencrypt the files.

RikTelner commented: One of best answers. +1
Paul.Esson 53 Junior Poster

So on a system that requries encrypted signed binary, and will only run encrypted signed binarys is there anyway of either unencrypting the binarys or executing unsigned encrypted code.

With enough time and processing power you could brute force the encryption, although unless you get quite lucky or have the patience to wait years, that will probably not yield results.

You would then look at what executes the files, is it the OS, can you somehow modify it and remove the encryption check allowing you to run unsigned code, is it some custom hardware
can you write what that hardware does in FPGA skipping the encryption check and solder that bad boy in.

If it's a programmable chip on the board you could, reflash it.

Assuming you have the tools for the job you could easily read what's written to the memory and get the unencrypted binary from there, writing to the memory I suspect would be damn hard, but I guarantee not impossible, this may also allow you to write to binarys that are executing.

So in conclusion, If someone has access to the physical hardware, they will always, with enough time, knowlage and patience be able to get around any form of signed code requirement.

Although with out access to the physical hardware, I am convinced you can write a system that cannot be compromised.

RikTelner commented: One of best answers. +1
Paul.Esson 53 Junior Poster

I generally set such things to MAX_INT for that exact reason.

Paul.Esson 53 Junior Poster

You may want to encode and decode from some form of linked list, if you need anymore type information ( for instance, some messages may go to controller x and some to controller y, then just add a byte to dictate that as well ).

Paul.Esson 53 Junior Poster

Personally I would send the type followed by 2 bytes for the size ( unless the type dictated size )

For instance

If :

INT = 1;
STRING = 2;

Then sending the int 5 followed by the string HELLO would result in the following message

01 00 00 00 05 02 00 05 48 45 4C 4C 4F

If you use the terminiating char for the string then you don't have to include the size for the string, although this means you can't simply jump it if you want to ignore it.

Paul.Esson 53 Junior Poster

Might be easier to use the getRGB(int x, int y) so that you don't have to attempt to support all 14 image types that the that ImageIO supports.

cwarn23 commented: This was the answer. Thanks +12
Paul.Esson 53 Junior Poster

At a guess I would say the database is changing the UTC formatted time into localtime.

The Z specifies that the time is in UTC format.

http://en.wikipedia.org/wiki/ISO_8601

Paul.Esson 53 Junior Poster

Hey,

I just run the code and can confirm it works fine.

On my mac the "Video" window was hiding behind my IDE and the "ball" window was visible.

Paul.Esson 53 Junior Poster

You could create an int to store the age and an int to store the index.

Set the age int to something unrealistically high ( 100 perhaps ) then as you loop compare the persons age with the stored current min age, if it's smaller store the age and the index.

Then print the person in the index.

Paul.Esson 53 Junior Poster

Also, there are a few problems with this idea in general, you are not able, from just the number of miles the car has travelled during 2013 ascertain the amount of fuel it has used, the average fuel consumption, and the amount spent on petrol.

If you know the amount of miles, the average cost of fuel that year and the average fuel consumption of that car you can give an estimate of how much may have been used on fuel throughout the year.

But the way you have worded it describes what is an essentially an impossible problem.

Paul.Esson 53 Junior Poster

Ah woops, I misread some documentation on std:cin the language suggested it was the case..

Although it appears they where attempting to describe that the operator only takes the chars to the next whitespace.

If you're correct and the names contain spaces, then using std::getline should resolve the situation.

Paul.Esson 53 Junior Poster

Your issue may be that std::cin >> name; does not remove the newline char from the resulting string.

Replacing std::cin with the following may work for you :

std::getline( std::cin, name);
Paul.Esson 53 Junior Poster

You can seperate the function declarations and implementations into different files without stdafx.

Just create a file YourClass.h as well as YourClass.cpp then include your .h file in your .cpp file using the #include preprocessor directive.

Paul.Esson 53 Junior Poster

I'm guessing that you wan to look at OpenGL then http://www.opengl-tutorial.org/ , I suspect may be helpful.

Paul.Esson 53 Junior Poster

True.

Paul.Esson 53 Junior Poster

System.out.println does not throw a RandomExc.

What you need to do is change SomeExc(); so it takes an int i, then calls the System.out.println method if i!=0 as well as throwing the Exception if i==0.

After that replace where the println in the main method with SomeExc(i), I suspect it will then work.

Paul.Esson 53 Junior Poster

You could either sort the students into corresponding times before you start ( a little faster )

or iterate through the array of students 24 times, checking the time each time.

You want to sort the students into there corresponding times

so create arrays of students[24][MAX_STUDENTS]
Then iterate all students and then put each into there corresponding hours.

then you want to iterate through the times in the array 0 - 23 
 print the time index +1 
 then iterate through each student in that array (until no more students  are left )
 and print the name
Paul.Esson 53 Junior Poster

sorry posted in wrong thread

Paul.Esson 53 Junior Poster

"Windows 7 will be the last Windows product."

Do you have a reference for this statement, Did Steve Balmer tell us in a recent keynote I missed.

Or are you just speculating and attempting to pass it off as fact ?

Paul.Esson 53 Junior Poster

I know what your thinking, You and everyone else has always wanted a clock that sits at the top of your command prompt and tells you the time.

Why ?

I made this in first year when i spent countless hours programming and little in bed. I decided i needed somthing that told me all the things i needed to know in one easy location, the top of the screen.. So here it the pauls magical clock of sit on top of my screen.

Sorry about the lack of comments and meaningful varible names, its quite a hacked together little clock

Paul.Esson 53 Junior Poster

My second C++ lab, bit of fun if i do say so my self.

Its a stack that uses a linked list in C++ alot of debugging stuff still in here, but I like the debugging output anyway.

Sorry about the lack of comments and

Paul.Esson 53 Junior Poster

i have a few days to design a system(payroll) using C++.
does anyone have the source code
thank you

You have to write the source code before anyone will have it.

Paul.Esson 53 Junior Poster

For the sake of debugging you can change it, Just have to change it back afterwalds.

Anyhow, It will take you 78 iterations and each time it will ask for an employee name, You don't want that I think. I think you are trying to get the pay for 26 of those iterations, now your not going to be able to store the name and the pay amounts in your array, to do that you will need COL+1 elements not COL ( Unless you want to store 25 pays )

String[][] employees = new String[ROWS][COLS];
for(int row=0; row<ROWS;row++){
	System.out.println("Please enter Employee Name :");
	String name = input.nextLine();
	employees[row][0]=name;

        for(int col=1; col<COLS; col++){
		System.out.println("Please enter Employee: " + row + " Pay: " + col);
		String number = input.nextLine();
		employees[row][col]=number;
	}
}

if you do somthing like that you will use the first col of each row for the name, The next COL-1 elements will then become the 'number' or pay.

Anyhow this is prolly not the best way of doing it, You really should have the pay as doubles and the names as Strings.

I think what your teacher is asking you to do when he says

1. Create an instance array called employees that will hold Employee elements.

is make a class called Employee ( that would have a name and an array of pays ) and create an array of type Employee that holds the employees.

I know if thats what he means …

Paul.Esson 53 Junior Poster

Its going to ask for the employee name 78 times. so only after that will it print out your array. I would try changing COL's to 3 or something so you don't have to enter in so many numbers before getting them printed out.

1. Create an instance array called employees that will hold Employee elements.
2. Modify your loop to create a new element in the employees array for each employee entered by the user.
3. Create an input loop that allows the user to enter up to 26 payments per employee.
4. Allow the user to request a list of payments for a requested employee.
My code just keeps asking for employee name and I am trying to populate the array. I know I am missing it somewhere, can someone help me out? Here's my code

the way you describe it you want to enter the employee name in the outside loop and the payments in the inside loop.

Paul.Esson 53 Junior Poster

I found this thread on the xml gnome mailing list that may be of help. It does appear that there is nothing similar to atoint for an xmlChar *, but I guess you can do it the way that this guy describes or alternatively format a char* from your number (using sscanf) then create a xmlChar* from that then compare those two strings.

Post I found is http://mail.gnome.org/archives/xml/2003-April/msg00060.html

Paul.Esson 53 Junior Poster

I guess if your not doing this for a class and therefor do not want to reinvent the wheel you should take a look at opencv its a neat open source computer vision library.

Paul.Esson 53 Junior Poster

As far as I know there is

int xmlStrEqual(const xmlChar * str1, 			 
                          const xmlChar * str2)

function in xmlstring module (and other xmlChar string handling functions). For example, you can convert xml-string to ordinar C-string then use atol to get integer value of attribute - and so on...

I don't use libxml now then can't present ready-to-use code. Look at libxml2 manual...

Yea, There is hence the reason I posted about it 58 minutes ago :)

Paul.Esson 53 Junior Poster
case 3:
                        // output = " \tWithdraw";
                        //UnderConstruction(output);
                        WithDraw(balance);

should read

case 3:
                        // output = " \tWithdraw";
                        //UnderConstruction(output);
                        balance = WithDraw(balance);
Paul.Esson 53 Junior Poster

Everytime you enter the Deposit() method you are setting the deposit amount to 94.37 :. its not really ever going to change. I mean you will return a different balance from that method but as soon as you attempt to deposit again you will be starting at 94.37$ again.

You have to pass around the deposit amount as a parameter to the method

static double Deposit(double balance)

do that and keep track of the balance in the main method, Is
perhaps the simplest way.

What you really should do is split the problem up into classes etc. but anyhow.

Also there are no global variables in c# but you can create a class static public class var and then use that ( MyClassName.staticVarName)

But it is nicer ( i think ) to pass it around.

For multiple reasons, One being that the problem its self does not lend its self IMHO to a static var, If you assume that more then one person will use your ATM then you will be managing multiple balances :. you wouldn't expect that the balanace would be one global var but would be a variables attached to a class that contains that persons account information.

So in conclusion you could say

namespace ATMMachine
{
    class MyClass
    {
     public static double balance;              //each time i use this now I have to type MyClass.balance;
     ......
     }
}

then only set it to 94 in the main method …

Paul.Esson 53 Junior Poster

You want to use

xmlStrEqual(resource_id, event_id)

it will return 1 if equal and 0 if different.

so

if(xmlStrEqual(resource_id, event_id))
       std::cout << "parada 1" << std::endl;

should do the trick.

http://xmlsoft.org/html/libxml-xmlstring.html#xmlStrEqual

also resource_id == event_id does not work since you are just comparing two addresses, not what the values are at the addresses your looking at.

Paul.Esson 53 Junior Poster

I don't know if this is the problem, but on the post request you have the terminating empty line after you have the post data.

Strcat(szSendBuffer,"/r/n);//the terminating empty line