rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is your WiFi secured? If secured with WEP, change the security to WPA and select a strong passphrase. If not secure, change it to WPA and select a strong passphrase. If already WPA, change the passphrase to a strong one that is difficult to guess.

Also, go into your router web interface and disable remote access/monitoring, and change the admin password.

Finally, what is the make/model of your router/wifi-access-point?

RikTelner commented: Good that you tried to answer. +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you want to know exactly how to create an operating system from scratch, there are a number of texts out there to help teach you, such as Andrew Tanenbaum's "Operating Systems: Design and Implementation" - where he shows how the Minix operating system works. This was, as I understand it, the inspiration for Linus Torvalds to create Linux. Since all Linux source code is available to study and adapt, that is another source (so to speak) to draw from.

In any case, to integrate operating system code to various processor architectures, you will need to also be able to write some (not a lot) of assembler language for the target processors. Some things require very low-level access that higher-level languages, even C, don't provide.

The process of getting code onto the hardware is called "bootstrapping".

Your questions are good, but the answers are too complex to cover here in a single post. :-) Try to keep your questions focussed/narrow and they will be easier to answer in a reasonable frame.

BTW, another open source operating system is FreeDOS, an MS-DOS clone. That may be another place to start in your OS explorations!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Swap space is used as virtual memory. IE, if your system and applications need more memory than you physically have, then the swapper will move the least-recently used memory blocks to the swap space, freeing that physical memory for active processes. This can be expensive, since it entails physical I/O to move the memory blocks from RAM to disc. When your process that is using a lot of memory is is done, then memory that has been swapped out but still in use by other processes will remain in the swap space until needed, then they will be swapped from disc into RAM. This is an "on-demand" operation. IE, don't mess with it until needed!

So, it may "lag" (show some latency), but unused memory won't "hang around" if that is what you are asking. Myself, I usually allocate a swap partition at least as large as my physical memory, and sometimes larger "just in case". Example: on my personal workstation, I have 8GB of RAM, but I have a 16GB swap partition. This allows me to have up to 24GB of memory for those rare occasions when I may need it for some memory-intensive computations.

Also note that the Linux system agressively caches frequently used file system data, assuming that you are going to ask for it again. That avoids the need to access it on disc, since physical I/O is VERY expensive as compared to RAM memory access. Since I do a lot of disc I/O, on my …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@AD & tinstaafl
:-) Goes to show - any three good programmers will generally come up with 3 valid approaches to any programming problem! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, it is an instance variable, and only affects the instance you set it in. Make it a class static variable, and that should do what you want.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"Never mind - God I why do I always figures this crap out right after I post?"

Probably because we all figure out our errors right after we ask someone about them - having a bit of time to rethink what we did... Welcome to the Homer Simpson Society "Doh!". :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You want us to help you cheat on your assignment? Do we get your degree when you graduate also? :-(

Post your code, and we may help you, but you haven't started on a good foot.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do I hear an echo, echo, echo? We don't do your homework for you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I use ffmpeg for this sort of work, exclusively. There are Windows builds available (it is free, open source software) here: http://ffmpeg.zeranoe.com/builds/

I have used Windows-specific tools in the past, but nothing has the options and effectiveness of ffmpeg. You can also change the audio from mp3 to other encodings as necessary, change the aspect ratio, etc. The options are massive and take some time to sort out (it is a command-line tool). Mostly I do this: ffmpeg -i inputfilename -target ntsc-dvd -q 0 -async 20 outputfilename.mpg

These options are to encode the video into mpeg2 suitable to burn to a DVD, keep the natural resolution of the source, and sync the sound every 20 milliseconds (helps when the sound is out-of-sync with the video). This is suitable about 99.9% of the time.

FWIW, ffmpeg can transcode just about any known format into any other as desired.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use a web-enabled pdf plugin? Why re-invent the wheel?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For C++, there isn't much of a problem. With C, it is preferable to use malloc/realloc to resize arrays. The nice thing about realloc is that that data in the old array will end up in the new one. You only need to zero out the new elements. I have used this in C++ code for resizable collections of stuff, to great effect.

Note that in Moschops example, the elements of a[n] are not initialized and can be any value held by an int, which in this case is whatever is in memory on the stack at the time of construction. He uses scanf() to initialize the members, but it is usually appropriate (and safer) in such a case to simply zero out the array members before use. IE, memset((void*)a, 0, sizeof(a));

If 0 is a valid value, then use -1 for the value, as in memset((void*)a, -1, sizeof(a));

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For a system drive (read-mostly, write occasionally) then an SSD is a good choice (mirrored drives for reliability). For data storage (a lot of writing and over-writing, database, etc) then you want spinning media in a RAID-5 or RAID-10 configuration. The reason for this is that current generation SSD's have a limited number of cell writes before the cell becomes useless. Current SSD controller software mitigates this by trying not to write updates to the same cell, and if you are using well less than 50% of the drive, this is good and gives decent life to an SSD, but not all are created equal. For SSD's, get "industrial" strength devices (pricey). For hard-drive RAID's, get commodity (but good quality) devices. There is always the tradeoffs between price, performance, and longevity.

Ketsuekiame commented: Agreed. I typically use SSD for OS drives and magnetic storage for everything else. My last SSD has lasted 3 years like this and shows no signs of failure yet. However, the Vertex 2 I used for write-heavy operations and it died within 14 months +11
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Question. Is this on a Linux system, or is it Windows? The standard Linux/Posix C/C++ libraries have some common interval timer functions that can get you down to millisecond to microsecond or nanosecond intervals. Not sure about Windows. I use these in Linux frequently in order to determine if stuff (network operations and such) is taking too much time in order to trigger off retry / reconnect logic.

As for the sorting/merging code, read Knuth's Volume 3 "Sorting and Searching". He covers most of this stuff pretty darned well. In any case, make an attempt to solve the coding problem and we can help with issues you may run into. That said, we do not do your homework for you! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Explain yourself! :-) You obviously fixed it, but others may benefit from your "discovery"...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good thread! Best laugh all day! :-) Thanks folks. My company has been purchased by MS (the deal hasn't cleared yet, but will soon), and WE are confused by the change. 1/2 of our discussions mention "SkyDrive" and 1/2 "OneDrive". Begs the question, just who's on first (sic)?

FWIW, here is a great description of the term SIC: http://en.wikipedia.org/wiki/Sic
So, I think it is apropros in this context. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, since the function returns a reference to an object, returning 0 (null) is not valid! This function should ALWAYS return os.

cambalinho commented: thanks +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The open source MySQL database can handle this sort of load very easily. There is also PostgresSql which is more "Enterprise" capable. I use both, as well as Sybase and Oracle. For small Linux database loads, MySQL works very well! I use it to store system performance data in large data centers.

As far as distros, for this sort of system, use a Red Hat Enterprise Linux, or a clone such as CentOS or Scientific Linux. We run CentOS on thousands of systems. It is reliable, cheap (0$), and performs very well.

Routers? Well, I am not an expert on that. Depending upon your requirements, you can go cheap (for small businesses - mine came from my ISP - a Motorola Netopia router - nice, small, inexpensive, capable), or expensive (such as Cisco - suitable for larger businesses), or you can go into the "cloud" and rent time on Amazon AWS servers. Then you have a lot more options.

Connection speeds depend entirely upon your needs. My small consulting business gets along with 5-6mbps (megabits / sec), but my day job requirements are MUCH higher than that (gigabits / sec). With Amazon, you only pay for outgoing data. Incoming is free.

If I were in your position, I would definitely look into Amazon's cloud services. Buying hardware and software is today just so "retro"... :-)

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

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

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

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

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

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

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

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you want to understand this stuff, you need to study formal logic! Boolean predicate logic for sure! In my engineering studies in the mid-1960's I had to take a philosophy class as a requirement. I took the formal logic course (part of the philosophy dept), which has stood me in good stead for a 30+ year career in software engineering... :-) There are good links for learning this stuff on the internet, but you need to do some serious Google searching to find them. Start with Wikipedia: http://en.wikipedia.org/wiki/Predicate_logic

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Gah! If you are getting that far along in your "education" and can't think of a project that gets your juices flowing, then you don't deserve to graduate! Just my humble opinion... :-(

So, what do you know or have done with web design? What about working with Android (Dalvik/Java)? What about WebApps (Javascript based applications)?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Very much different. Android runs stuff in a virtual machine that takes java code and compiles it into Dalvik virtual machine code. Apple apps are more machine-level and use (I think) Objective-C (an object-oriented language similar in some respects to C++) which is then compiled into native code. IE, if you have an application or game that you want to run on both systems, you will have to port it from one to the other. There is a tool called webapps (I think it is Javascript) that both may support, but I'm not sure. If so, then that may be your best option. In any case, webapps is a browser-based language. It will only run in the confines of your mobe's web browser.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you need portability, get a Macbook Pro - prices start at $1199. If you have a nice monitor and don't need portability, get a Mac Mini - prices range from $599 to $999. Then there is the integrated iMac - 21" models start at $1299. Here is a link to the Apple Store: http://store.apple.com/us?cid=oas-us-domains-applestore.com

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try to work out some sort of deal with her that if you succeed at your end of the deal, she will help you buy a new Mac.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good exercise! Get started, and then we may help you. We don't do your homework for you. Think about the problem. Your professor has already broken the work down into manageable chunks. Look at each first in isolation, and then as a gestalt of all the parts. Thats how real software works. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, take each point that he wants you to consider, and state what that means to you in simple terms, as well as how you migh accomplish that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The terms of use for these forums is that we don't do your homework for you. Make a reasonable attempt and we will try to help you understand where you went wrong, but YOU have to start the process.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

64-bit system? Run a 64-bit OS. Yes, 64-bit pointers in your software take more space, but not enought to make any significant difference. In any case, your system can take better advantage of available memory, and swap (virtual memory) space, and will perform better since the CPU is designed to handle 64-bit operations more efficiently. In such a case, smaller is NOT better! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Bit-wise comparison != numerical comparison. In a your comparison it is only looking to see if the fourth bit is set.. For -8 the top bit is set for the negative, as is the fourth bit, hence your problem. For a bit comparison of two numbers do this:

if ((a&b) == a) // a==b

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, for this pseudo code (pseudo code is NOT standardized), I think it is the dimension of an array. IE, the C code for DIM EmpName = 1 would likely be const char* EmpName[1];

Since I don't have your professor's definition to be sure, this would be my best guess.

ddanbe commented: Very possible +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try this:
if "%2" == "" goto end
It has been a long time since I have written any complex DOS/Windows batch commands, so I may be mistaken... :-)

theashman88 commented: Thanks for your help it worked +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What distribution/version of Linux are you running?

In any case, you will need to fully reinstall the xorg and gnome software, or install kde, xfce, et al and try running one of those first.

Finally, when you try to run startx manually, what errors are you getting? Please post them here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This shows that your computer is trying to boot from the network. Go into the BIOS and disable PXE (network) booting.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Time to go back to the book! There are plenty of stats texts (hard copy and online) to help you with this, and wikipedia may help as well.

Just remember, there are lies, damned lies, and then there are statistics! In any case (joke not-withstanding), statistical correlations require pretty simple maths, but all stats require a good body of data, otherwise value-skew is inevitable, and that will throw your game off significantly. IE, you can't just take a few points and extrapolate a likely outcome.

Yeah, not the answer you wanted, but the best I could come up with in 2 minutes! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

GPS is a satellite-based location tool that gives you your coordinates to within a specified error factor. If you want to orient yourself to a specific set of coordinates (Longitude+Latitude), then you need to compute your GPS location in relation to the specified (base) coordinates, and use that to orient the "compass".

As an aside, normal compasses point to magnetic north, which varies and is NOT at the "North Pole". You could align your GPS compass with the actual North Pole (coordinates 0,0) for real location accuracy. Then, adjusting the locator to point to any arbitrary location on the globe becomes a trivial exercise in mathematics.

So, good luck with your app!

<M/> commented: thanks for the info! +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please provide the source for your "graphics.h" and "graphics.c" (or .cpp).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, array indices in C/C++ are zero-based, not 1 based like some languages we won't mention here, UNLESS you want to skip over the first element...
Secondly, you need to remove the semi-colon from then end of line 1. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sigh...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of good compression tools out there, but remember that better compression usually == more time and other computer resources (memory, CPU, etc). Also, some files, such as mp3 audio files and most video formats are already compressed, so you won't get much reduction in size. Here is an example: a 1.5GB mkv (Mastroika) video file compressed with bzip2 only resulted in a resulting file of, oh yes, 1.004x larger than the input file, and bzip2 is one of the more efficient tools out there... :-)

Now, for text files, executables, shared libraries and other standard OS files, then these tools can result in very significant reductions in size, sometimes to the 90% you are looking for, but again, it all depends upon the original file format.

FWIW, I use gzip when I make a bit image backup of my system drive. It is almost as good as bzip2 (a little less compressed), but it is much more efficient in terms of time to compress the output. So, my 320GB system drive will compress to 10% or less of the drive size so I can easily store multiple copies on my external Sata-II backup drive (2TB).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Usually flex and bison are installed by default on Linux systems. Try the commands "which flex" and "which bison" to see if they are already installed.

And to help your education, Lex is short for "Lexical Analyzer", and YACC is short for "Yet Another Compiler Compiler"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume you are using Windows of some sort? Linux has a tool called rsync which can periodically make backup copies of new or changed files, even across the network.

adil.ghori commented: I'm using windows xp and 7 for this purpose. +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That is what our friends Google, Yahoo!, and Bing are for! :-)

JeffGrigg commented: Quite true. +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As an interesting side note, here is a recent TED talk about Fibonacci numbers. :-)

http://www.ted.com/talks/arthur_benjamin_the_magic_of_fibonacci_numbers.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One of the rpm files in the set that you got will have the gui components for kde, gnome, or other window managers. Installing that rpm will get you where you want to be. I'll have to tell you later when I get home from work what directory they are in in that set you downloaded.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The comments that turboscrew put in your code should help. Computing fibonacci sequences is typically done with a recursive algorithm. IE: fib(x) = fib(x-1) + fib(x-2) with x==1 being the limiting factor that causes the loop to terminate. IE, fib(1) == 1, and fib(0) == 0, so fib(2) == 1 (fib(1) + fib(0)), and fib 3 == 2 (fib(2) + fib(1)), and fib(4) == 3 (fib(3) + fib(2)), fib(5) == 5, fib(6) == 8, fib(7) == 13, etc. ad infinitum... :-)

Here is a link to the wikipedia page about fibonacci numbers: http://en.wikipedia.org/wiki/Fibonacci_number

FWIW, stack overflow is not usually an issue with computing fibonacci numbers, but the usual limiting factor is the size of integer you are using. A 32-bit number will overflow after computing fib(24) or thereabouts (I don't remember exactly - my last coding of fibonacci was almost 30 years ago). A 64-bit value will give you a few more iterations before overflowing, although there are arbitrary precision math packages, such as boost, that will overcome this limitation, at a performance price. :-)