rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The system shutdown and sleep/hibernate/wakeup stuff is a known issue with some Linux 3.x kernels. This has been an ongoing work in progress. I think that some of the newest kernels have pretty much cleared this up, but I run Scientific Linux 6 (a Red Hat Enterprise Linux clone, much like CentOS) on my old Dell D630 laptop (a 2.6.32 kernel) and it has no problems with that stuff. It was a bug introduced in some of the 3.x kernels (major changes from 2.6.x). Do some Googling now that you have the system running well - you will find out what is what in that regard and can act accordingly.

BTW, have you tried shutting it down via the command line? IE, "sudo shutdown -h now", or "reboot" and then hitting the power button when it gets to the BIOS/POST?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. That may help narrow the possibilities somewhat. It is getting late here now. I will look at this again tomorrow.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Huh? What are you getting at? In Intel processor assembler code, DS represents the "Data Segment". I have no clue if that is what you are looking for.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not C++. What are the '^' tokens doing in the argument list? Also, is rbFromInches->Checked a member variable, or a method. You are using it as a variable. Finally, this is not enough code and context to know what you are doing. :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you post code, but ask no question. What is it?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need a Java native code compiler. Java normally compiles to JVM byte code, and can use the Just In Time (JIT) internal compiler of the JVM to convert your code to native code, but that code only exists until the program terminates. IE, you compile your code to Java .class files, put them into JAR files, and those are passed to the JVM to be executed. So, .EXE's are not part of the equation, unless as I said, you have a Java native code compiler available. Such are available on Linux as part of the GCC compiler suite. That is gcj. The native Windows Ming GCC compiler suite also has GCJ which CAN generate native Windows .exe files. Here is a link that will help: http://www.thisiscool.com/gcc_mingw.htm

FWIW, Ming is free and open source - no cost to you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Alan, you are on a roll here! See my other reply to your posting about shell programming. Once again, we don't do your homework for you, but will help you once you have made some progress in writing the program. FWIW, this problem is not trivial. Complete the other one first, and then try to tackle this one.

Your professor is challenging you. Are you up to the task? This is a serious learning experience.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

From your post it appears that you are running Linux/Unix, right? You are writing a bash script? If this is so, study the bash man page: man bash - that should provide you enough information to get started. We don't do your homework for you, but will help you sort out your problems once you have made a reasonable attempt to solve the problem and write the code.

FWIW (this is a hint), to write the data to the appropriate file name means you need to use the "date" command to format the date+time properly in order to generate the file name, and you will need to understand how backquoted commands work in bash.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are plenty of programs to do that. Programming from scratch something like this is NOT an exercise for a "noob"... :-) Remember, Google is your friend! You also do not mention whether you are running Windows, Linux/Android, or what. That will make a BIG difference in the tools and techniques you will need.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this a school project? We won't write your code for you, but we will help you sort it out if you make a reasonable attempt at solving the problem.

Your first problem is to model the system. Java is object-oriented. Before you even get into the code, think about the entities you need, such as Ticket, Reservation, WaitingList, Passenger, FlightSchedule, etc. These are your classes. Then, think about the behavior of each class, and write in plain language how each behavior should work. Example for Ticket - reserve the ticket, book the ticket, etc. Example for Reservation - confirm the reservation, cancel the reservation, etc. Finally, think about how each class of item reacts with the others. Methods from one class will likely interact with other classes.

Be thorough and complete. Once you have done this, you will be ready to code. FWIW, I have written very complex systems in Java and C++, and 80-90% of my time is spent in modelling the system, and 10-20% in actually writing the code. Why? Because once I understand the system and how it has to behave, the coding is just a matter of implementing what I have created, but in another language.

As for learning Java, the language itself, there are tonnes of books and tutorials out there, many of which are available online. Remember, Google is your friend! :-) Here is a link to the java classes/api's for Java 7: http://docs.oracle.com/javase/7/docs/api/ - I have found this resource invaluable …

অসীম commented: Thanks for replying. Indeed,it is a school project and I don't need the code written. I just needed a heads up and your comment helped me that way. I will follow your directions and if I want to do this on GUI, will that be too hard to implement? +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Once you have read the target word and written the replacement into the output file, you can read/write the rest of the source file into the output file, in chunks, for efficiency's sake.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Generally I agree with gerbil; however, I do set my update policies to inform me when updates are available. Then, I go to the MS update site, and individually decide if I want to install them. Usually I will install some, or even most of them, but RARELY (never) will I install all of them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. It may be some other thing. Is the code talking to the database, but you are just getting empty columns there, or is it the php code that has empty fields and can't send them to the database?

FWIW, and not particularly relevant here, is that this is an old version of php 5. I'm not recommending an upgrade as yet, but that is something to consider, especially for performance and security concerns.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'll have to look closely at the code later. Exactly what IS the problem? Why should logging care whether test mode is true or false? You definitely want to log errors/warnings/etc no matter whether or not you are in test mode.

At least the author wrote clean code, and commented it appropriately.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you have backup copies of all of your web pages and application files, then run a checksum (cksum, md5sum, etc) on both the backups and the ones that are active in your web server directories, and then compare them. My guess is that you have been infected with a malware that has modified some of your pages. This can be a serious issue, and you need to sort it out PDQ before your users are totally pwned... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this Win 7, or 8? That will probably make a difference. Have you tried booting the recovery partition to reinstall the OS (after backing up all your data, of course)? My guess is that the installation put a new DLL on the system that replaced one of the standard ones, and that is causing the problem, yet the uninstall did not restore the original.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Clearer now... I was just trying to give you my best advice based upon what you had said. Time is an issue, but that wasn't clear in your post. What I said about configuration and reliability still stands. Intel does sell fully configured systems, available many places. Look there and see if anything they are offering is appropriate - I like their hardware for highly-reliable systems better than most. They will also point you to resellers where you can get gear quickly.

If you were using Linux I'd recommend someone like ZaReason.com in California, but you say you are using Windows - they are a Linux/BSD house entirely, but great people and support.

I take it your aren't interested in rack-mount gear? Nah. The comment about "headless" systems tells me that. I used to be a big Dell customer, but I haven't been too happy with them in recent years. Ditto HP at least for their current laptop offerings, though their server gear may be good for your needs.

In any case, this is the kind of mobo I was talking about in my last post: http://www.rakuten.com/prod/intel-workstation-system-p4304cr2lfkn-barebone-system-4u-pedestal/234873044.html

I'm still looking for systems I would recommend for your needs. Most are pretty pathetic. Small power supplies are the least of the issues. Just remember, Google is your friend! :-)

Ok, they may be a Linux shop, but they have good gear and can ship with no OS installed. Look here - this meets my requirements pretty well, and …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Google Maps, Nokia Here, etc. Google Maps is pretty ubiquitous. Nokia maps are more for the mobile domain such as cell phones, GPS devices, and automotive navigation systems. FWIW, Nokia maps were able to navigate me to some pretty obscure places in foreign countries where Google was clueless! They have extensive maps for several hundred countries... :-)

Disclaimer: I work for Nokia Mobile Phones, and Nokia Here is in the same building where I work. My wife prefers Google Maps. I prefer Nokia Here. Go figure! Anyway, she will have to admit that the Here maps kept us from getting lost in the nether regions of Mexico last year.

All of that aside, I agree 100% with L7Sqr. Use what is there. Most of your work will be integration and presentation, but that is still a good university project exercise.

Final comment. If you are determined to "roll your own", then consider the OpenStreetMap project data to use (good street map data), and learn how to use it to display what you want. Here are a couple of good links: www.openstreetmap.org and http://wiki.openstreetmap.org/wiki/API

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On most current 64-bit systems, a long int is 64 bits and an int is 32 bits. However, as AD said, look in /usr/include/limits.h (Unix/Linux), or wherever limits.h is found on your system. You can also use the sizeof(int) and sizeof(long int) in your code to determine what they are at run time, just in case your code can run on different architectures. Example:

#include <stdio.h>
int main(void)
{
    printf("sizeof(int) == %ld, sizeof(long int) == %ld\n",
            sizeof(int), sizeof(long int));
    return 0;
}

Note that this is vanilla C code. It works just as well in C++, and you could use cout << "sizeof(int) == " << dec << sizeof(int) << ", sizeof(long int) == " << sizeof(long int) << endl; just as easily.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is because the function "threadfunc()" is not a member of the class test. You need to pass threadfunc() an argument to fun. Example:

void test :: start()
{
    pthread_create(...,threadfunc, (void*)fun);
}
void static threadfunc(void *pFun)
{
    Fptr fun = (Fptr)pFun;
    fun(¶m); // getting error here
}

I don't know if this will run since I don't have the time right now to test it out, but it should be pointing you in the right direction. Note that the last argument of pthread_create() is NOT the thread function, but the ARGUMENT that is passed to it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Topics - there is not just one.

  1. Cloud computing
  2. Large scale distributed systems and computations
  3. Big Data and complex analytics
  4. Mobile computing
  5. Computer and network security
  6. IoT (Internet of Things, such as sensor arrays, smart appliances, etc).

I'm sure the list goes on, but this should get you started... :-)

FWIW, I am professionally involved in at least items 1-5, and have been for years. There is an old saying - the more things change, the more they stay the same. These problems / domains have been around for quite awhile, but current Internet and tech developments have morphed them into something quite new.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As moschops said. Also, in modern compilers you would use either stdout, or stderr. One other thing. It is good practice to initialize external variables such as page and line where they are declared. IE:

int line = 1;
int page = 0;

Uninitialized variables tend to cause many sleepless nights! The way you are using them is ok since you initialize them in main() before they are used, but this is "best practices" I am talking about, and how to minimize bugs in your code, especially after other people get their hands on it! :-)

Also, modern compilers require that you declare that main() will return an int explicitly. IE: int main( int argc, char *argv[] ). Do note that I changed the argument names. The term int argc refers to the argument count (number of entries in argv[]) and argv[] the vector (array) of arguments. Your usage will likely cause a downgrade by your instructor since it is very non-standard.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not clear enough. If you have C++ code to run, of course you need to compile it before using it. What do you mean by a pdf viewer embedded in a webpage? Do you just want to view the source? Or do you want to run the C++ program in the browser? Or view the output in the browser? There are many approaches to the last one, including using php on the server, javascript in the browser, etc. Those tools would have to execute the C++ program and capture its output, and then render it as html for the browser.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"STATEMENTS IN THE FUNCTION ARE SUBSTITUTED WHENEVER THE FUNCTION IS CALLED."

This is very true, but the only thing on the stack would be automatic variables in the function. The function itself is turned into machine (or intermediate) code when compiled. It can expand the size of the translation unit's object code significantly, but you eliminate the overhead of a function call, including all the stack pushing and popping that goes on. In any case, these functions can be very large, but for best effect, keep them as small as possible. This is why in C++ classes, inline methods are generally small getter/setter or other trivial functions. Others should be implemented in the source file instead of the class definition header file. This is a trade off between speed and size. If the function is large and/or complex, then the function call overhead is probably only a small part of the total time taken to execute it.

One final thing, statements are inserted into the function when compiled, not when it is called. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I agree with Mike that the preferable construct is int* var - indicating that it is an integer pointer, which is an actual type. Moving the * to either next to the variable name, or between the int and variable name as your last example shows, kind of obfuscates that distinction.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Moschops said, for C++, but you CAN use a C construct, const char* for the variables, and then assign a new string to them. Example:

const char* FileToInject = "File_Name.xxx";
const char* ProcessName = "Process_Name.exe";

// Do stuff with file and process names, and now change them.
FileToInject = "Another_File_Name.xxx"
ProcessName = "Another_Process_Name.exe"

// Do stuff with new file and process names.

The advantage of std::string class instances for these things is that they are much more dynamic and can deal with auto deleting the internal data when the string goes out of scope. Of course as long as your const char* items are string literals as the example shows, you don't have to worry about that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Why the backslash? Linux file names can have spaces in them. However, when you invoke the name, place double quotes around the $SCHOOL variable. IE:

SCHOOL="/home/stephen/Steve's Stuff/School"
mkdir "$SCHOOL"
cd "$SCHOOL"

If you don't use the double quotes when you create the directory, the single quote will make bash take data until it sees another single quote.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would recommend building a whitebox. Get a good case with lots of cooling, a 1000watt power supply, an Intel workstation/server motherboard, one or two 6 core CPUs, 8-16GB of ECC fully buffered RAM (reliability - one stick fails, and the system falls back to the others without stopping), and a bunch of 7200rpm WD discs (I have found them more reliable than Seagate - they run a LOT cooler and I have experienced a lower failure rate). The Intel board may have built in video, but you can also install a nice nVidia card (workstation, not gaming quality) for very little $. I did this 6 years ago, and the system is still running 24x7. It is dated, but still kicks serious butt! I've had to replace a few discs, but the basic hardware has been faultless. Check out the Intel website - they have a lot of options and good documentation on the specs for you. I've found that their gear can be had at buy.com (now Rakuten.com, but still can access via the buy.com address) for good discounts and free shipping. I've been buying a lot of my tech gear there for about 10 years, and they have always been good about dealing with the occasional failure - especially disc drives where early failure is not uncommon.

About the video. nVidia's mid-range cards (in the $100-200 retail range) can handle dual HD videos and have enough horse power to run multiple HD video streams at the same …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That port may be blocked by your company's firewall. Check with your network operations people. You may need to go through a proxy server to get to it, and they will need to white-list it with the proxy server.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good luck! This is a non-trivial problem, and requires significant pattern analysis and statistical skills to solve. You can never say with 100% certainty that a particular fingerprint matches a specific person - only that there is some % of probability that it does. IE, if the pattern has a 90%+ match, then it is "good"...

Next point. Doing this in VB is probably an exercise in futility - possible, but REALLY slow! The computational overhead of this work is very high. Using a compiled language such as C or C++ is much more reasonable, at least for the low-level stuff, where you can take advantage of the system CPU math processing abilities.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What operating system are you running? This is critical because each has functions to do this, but they are very different in approach. What you would do with Windows is NOT what you would do with Linux.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

SQL Server is basically Sybase with warts. Please provide examples - input and subsequent output. Also, provide information about the API's that your are using, language (C, C++, C#, whatever), and the functions you are using to store the data.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I hope you have a good (great) attorney. If you sold an app that does A to Google (or whoever) for a gazillion $$, then write one that does something entirely different! If it is as great as the first one, then Google (or whoever) will probably pay you 2 gazillion $$ since you have a proven track record!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Seems clear to me. Set up array of 3 files to read. Fork 3 child processes (see fork/exec man pages), each of which reads one of the files. Each sleeps for 3-10 seconds (random time I would assume), at which point they send 50 characters (are they 8-bit, or 16-bit chars?) to the parent process using a pipe. The parent/father process reads the pipes, and writes the data into the output file. Not a major problem. Your issues are to understand how fork/exec works, and how pipes work. Everything else is noise. The random sleep factor may be an issue, but learn about using random numbers to deal with this stuff - I have to do it all the time in my work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@richieking is being sarcastic. What he is saying, in plain English, is that we do not do your homework for you. We will help you, point out obvious errors, and such. Make an attempt to solve the problem, post the code here (if it isn't working), and if it isn't TOO brain-dead we will be happy to help you work it out.

There is no short path to knowledge and enlightenment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. We don't do your homework for you. Do you understand C++ passing function arguments by value vs. passing them by reference? If not, let's start there. If you do, tell me what YOU think they mean (with illustration code), so if you are falling into the deep end I might be able to help you get back to shore! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C# is, like C++ and Java, an object-oriented language. Think about classes (things), methods (how to affect those things), and member variables (bits of the thing). Then, use a modeling language such as UML to model your system - classes, methods, members. A good place to start with that is www.sparx.com's Enterprise Architect. They have a good trial period (full functionality), and very good tutorials. It is a Windows app, but it runs well on Linux under Wine. I have been using it for about 8 years, and it is worth every bit of the $195 cost for a professional license. It also takes your models and turns them into source code (to the language of your preference), or vice-versa! IE, suck up source code and turn it into a visual model! Very neat stuff!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I vote for subtropical gardening! At least it is warmer there than where I am right now (minus 3 F).

That said, shell scripting is important if you are going to do system admin cruft. Most of my work is in the Linux environment, so PowerShell is pretty much a non-entity, but bash, perl, and python are important. I would equate PS with bash most likely. Most of my scripting uses bash. Perl and Python give me a headach - especially Python's stupid indenting rules! Perl tries to do too much (as does Python). When I need to get that complex, I would rather code in C++.

DeanMSands3 commented: Thanks! +5
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not doing your homework for you, but will give a clue, think bit-wise comparisons based upon some bit of information in your "truth table".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Don't bother with the expense of building your own gear. Rent time on a large Amazon cloud system to do the analysis. When you are don't, you shut it down and aren't being charged for resources you don't need. If this is an occasional need, then it can be a LOT cheaper than building your own gear! Example, an m2.4xlarge image costs about $1.35USD / hour - and gives you 8 virtual cores, 68.4GB RAM, and about 1.7TB of local data. To build something like you want you would be looking at $3000-5000USD - a lot of time on the cloud! $1K? I doubt it. The RAM and OS are the expensive bits. I have a 3GHz, 8 Core, 8GB RAM, 2.3TB disc system that I built 6 years ago. It cost me $5000. It is still my primary home workstation. Now, I would get a decent laptop, and when I need extra computing power, I would push it to the cloud.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Did you read this first? http://opendedup.org/quickstart

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your example gets those that start with an even number, not the ones that have an even number at the end of the number string. IE, it will properly return "cp2.enc" as well as "cp4.enc", "cp6*.enc", etc. So, that would include "cp211.enc" and such.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You mean their IP addresses? You can use the nslookup tool to do that, such as "nslookup att.net".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Besides having compatible frequencies, they also need to support the same protocols, such as 802.11a (5.2GHz), 802.11n (both 2.4 and 5.2 GHz), 802.11b (2.4GHz), etc. Most 802.11n products also support a/b protocols. 802.11a-only devices don't support b/n protocols.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Agile, in my opinion, is just the hot process of the day. Not much more useful than the outdated waterfall technique. We use it at my company, but it doesn't get any more work done than the less "structured" methods we used in my previous position (principal engineer in a tier-one software company). Combining Agile with waterfall? A road to disaster, IMO!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Looks sort of like Windows DOS shell code. Gah...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Another option is to not use Windows for this... :rolleyes: Sorry, sarcastic genes showing here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Google is your friend! Also, we don't do your homework for you! If this isn't homework, then re-read the first sentence...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you have a static IP address and that is associated with a registered domain name, then it is available 24x7, assuming the system is running and visible to the internet. I have had friends who provided hosting services to rural towns in Massachusetts in the past doing this - otherwise the town's libraries and schools would have been unable to have a real internet presence.

Domain names normally require a static IP address. This is not an absolute requirement, but if the systems in question have dynamic addresses, then dealing with the address changes instigated by your ISP is a problem. Not insurmountable, but a real PITA (pain in the ass).

Ok. I see that Daniweb fuzzes out "nasties" such as 'a.s.s'... :-)
After editing it, the term seems to be restored... Go figure!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Send it into Dell for repair. If it is under warranty, you can request a pre-paid shipping box for it. When you get it (takes a day usually) then send the computer back to Dell for repair. If it isn't under warrany, you can box and ship it yourself (your expense to ship it), but they will ship it back on their dime.

Advice: remove the hard drive(s) before shipping since they may either be replaced or wiped during service. IE, you will lose all of your data... :-(