InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1851. |
Solve : Wordpress learn? |
|
Answer» my own websites that will teach me everything about www.From understanding the parts to knowing how they WORK. Lectures, classes, interactive, whatever. Any good references would be greatly appreciated. The LINK does not work. |
|
| 1852. |
Solve : SQL database fix? |
|
Answer» We have a legal program that USES SQL express 2005. Somehow the company is saying our database has become corrupted and needs to be sent to a company to be rebuilt or fixed. The database sits on an external hard drive. We had to reload windows on the machine that it sits on. when we tried to reattach the database afterwards, we couldn't. Is there a cheap or software out there that I can use to fix it? I can't help you in regards to fixing the database but would suggest regular backups in the future to guard against this happening again. If the database gets updated frequently, it may need to be backed up daily in ORDER to prevent losing data. |
|
| 1853. |
Solve : Debugging Scripts? |
|
Answer» got this message concerning |
|
| 1854. |
Solve : Which language would suit my reguirement?? |
|
Answer» What programming LANGUAGE would allow me to create a utility where i can open up and USE WINDOWS applications within that program? |
|
| 1855. |
Solve : Create headers in a CSV file using Clarion 6.3? |
|
Answer» I have written a ROUTINE in CW 6.3 to create a CSV file and it works fine. I, HOWEVER, have to add a header and footer to the CSV file. |
|
| 1856. |
Solve : Need help with UNIX script? |
|
Answer» I'm writing a UNIX shell script and I need to WRITE a code USING a text file. For each LINE in the text file, the third field ranges from 2 through 6. |
|
| 1857. |
Solve : Adobe issues? |
|
Answer» I suddenly have ASK installed as homepage. Which I don't want. I believe I must have installed some version of Adobe to cause that ? |
|
| 1858. |
Solve : how can i become a programmer? |
|
Answer» my name is dsymaryon, All of these suggestions are good, but it is really hard to learn to program reading a book or books.Books/ Programmer's guides make a good reference, but I agree, one cannot merely read them and know how to program. I myself taught myself with the Visual Basic 2.0 manuals over a summer break- but I did this by deciding what to make (a straightforward HTML color selector for the tag) and using the books as a reference for how to do so. That is- the Programmer's Guide had "tutorials" of sorts but I didn't see the value in animating a butterfly across a window. Nowadays I try to get more familiar with programming languages I've not used much by using the problems on Project Euler or by creating an Anagram search program to find algorithms in a dictionary file. Which is pretty useless, but I already know how to program in other languages. I agree that when first learning to program it is very useful to create something useful because then the programmer is a user of their own software. Quote You can download a free version of Visual Studio from Microsoft and there you have C++, C#, and BASIC all in one package. It should be noted that Visual Studio does not support BASIC; rather the language it supports is Visual Basic .NET. It shares syntax and keywords with many BASIC dialects but it is quite a different platform and language. The reason I mention this is that BASIC tends to be associated with, uh, it's acronym, but realistically I don't think the language supported by .NET for Visual Basic is really intended for Beginners- not in the same sense as with BASIC. Kemeny and Kurtz would probably be rolling in their grave to hear the two associated. That is not to suggest that it is a bad idea to use Visual Studio- C# and Visual Basic are as good as any other language, IMO. My advice to those who are trying to "choose" which language/platform to start with is that what they start with is less important then the fact that they actually get started. Quote But I found something that will help make it easier, there is a free program called QB64, a Quick BASIC clone.FreeBASIC is another good alternative. I believe it might be a better option for Linux as (iirc) it can be run natively under Linux as well. Quote It is unfortunate that today we don't have the constraints that we had back in the late 70s and early 80s when you had to create a powerful application and it had to fit on a 360k floppy. Today many programmers will go crazy with needless code because there is no limits on what you can put on a disc. When OS/2 was released along with the IBM /2, Bill Gates bragged about it took 3 million lines of code to create OS/2, 3 million. All of us programmers standing in the back of the room shook our heads at 3 million lines of code.I can't find a reasonable source for the quote but I don't doubt that somebody said it. How many lines of code a product had was some weird chest-beating in the 90's. Even nowadays anything older than a few years "should be upgraded"- but it makes no sense to do that if it already works. The software I work on is a C#, Windows equivalent to the old BASIC product. It worked well enough since the 80's and while it's hardly perfect, it was enough for them to do business. The reason we are making a new version is that it stopped serving that task because the OS vendor won't INVESTIGATE, let alone patch a serious network stack problem. Any time I mention my work on a programming forum, it's all "Dude, you should use WPF" and "OMG, Windows Forms, you poor *censored*!" or "So you are accessing Postgres directly? You should be using Entity framework". It's just a litter of pointless buzzwords. Using those new technologies doesn't make the product better! Usually it just adds a bunch of pointless busiwork. Almost makes you think it's a conspiracy by developers so they can expand their estimates! . "Oh, yeah, FINE, Mr. Manager, sure we COULD just read the value from the database, but the proper way is to create a data adapter intermediary segmented accessor class, and construct instances using a multipattern segmented assembly factory. Then we can utilize jQuery and pattern-swap over the NoSQL MONGODB while asynchronously AJAXing a nearby Universal platform. And I'm not going to be responsible for problems that ARISE because we didn't write an appropriate universal segmented multipattern buffered adapter." This thread just keeps going on. Now about books and computers. Long before productive computers were built, books existed and laid the foundation for the ideas that led to computers. If you go to a public library you will see a well organized collection of information that humans have acquired over the years. For a single individual, or even a group of persons, this would take many many years to acquire. Books help you understand the reasons that people can either hate or love computers. There are books about computers that are not really about computers, but about why people want computers. Here are a couple of books about computers that are not programming textbooks. Computer power and human reason. https://en.wikipedia.org/wiki/Computer_Power_and_Human_Reason The Soul of a New Machine. https://en.wikipedia.org/wiki/The_Soul_of_a_New_Machine Anybody interested in computer science can benefit by reading either of the two publications listed above. Quote from: BC_Programmer on January 12, 2016, 08:32:26 PM It should be noted that Visual Studio does not support BASIC; rather the language it supports is Visual Basic .NET. It shares syntax and keywords with many BASIC dialects but it is quite a different platform and language. The reason I mention this is that BASIC tends to be associated with, uh, it's acronym, but realistically I don't think the language supported by .NET for Visual Basic is really intended for Beginners- not in the same sense as with BASIC. Kemeny and Kurtz would probably be rolling in their grave to hear the two associated. The fella asked a question and I did not see a really good answer to it. I gave some suggestions, he is a beginner. I'm sure you have your favorite software just as I have my favorites but that means nothing to a beginner. If you started programming in 85 or somewhere around there you had 1.44 & 1.2 meg floppies to work with. When I started in 80 my best had to go in a 160k floppy. Even working in the 90s and early 2000 anything I wrote I made to fit on a 360k floppy, and had to fit within 1.2meg with program, manuals, data structures, and any drivers. I taught some programming classes in the junior college and kids just went wild, redundant code or routines that did nothing. I'm sure you have seen some of that. As far as the message that Bill Gates gave, I was there when Microsoft and IBM brought out OS/2 and the new IBM /2 computers systems with a new bus that did not last long.Perhaps I've misunderstood- I was merely trying to engage in friendly discussion on the subject.Visual Studio is free for educational and personal use. It does require some time to learn how to use it, *censored* is worth the effort. The OP hasn't been back since October. I'd suggest you are talking to yourselves at this point. |
|
| 1859. |
Solve : Install a Reg edit by script? |
|
Answer» Hi All, In Windows XP and in Windows Server 2003, you must enclose the value in quotation marks. For example, you could use the FOLLOWING script to call AUoptions.txt. I am not sure if this will work on systems that are not already logged in. I was expecting there to be a user/password line in this to authenticate with the remote system. Maybe as long as your system admin on the one system you start this from and all other systems have the same system admin account on them with same password it will pass thru authenticate without need for a runas instruction. Be very careful as for this can mess up a registry fast if you mess up info tp pass to it. If you have 2 computers that are not important, I'd perfect the script on the 2 unimportant systems first to make sure it works and then make it for all 30 and run it. You could also be careful and save a backup copy of the registries of all 30 systems too to revert back if there are PROBLEMS after running the script. |
|
| 1860. |
Solve : php radio button link? |
|
Answer» I want to select a row from mysqli dropdown, |
|
| 1861. |
Solve : Crypt & UnCrypt - C++ Programming - Sharing Project? |
|
Answer» Decided to share a project I was playing with. During the cold winter months I like to dive into programming and had been thinking about playing around with scrambling and crypting info for a while. These Crypt and unCrypt programs are not complex and are very basic crypt with character substitution. This is pretty easy to crack to decrypt because its just substitution and repeat characters also show as repeats in the crypted form. Crypt Version 1.02 Quote unCrypt Version 1.02 Crypt Version 1.02 source code Code: [Select]#include <cstdlib> #include <iostream> #include <algorithm> #include <string> // 12/30/2015 - Added string random shuffle // 12/31/2015 - Added custom seed for random shuffle so seed acts a crypt key // 1/4/2016 - Added ability to enter string and have while loop process // 1/5/2016 - Added characters , and ; to supported characters which were missing from v1.00 // 1/8/2015 - Source code trash cleanup & offset band aid removed for IF statement logic +1 array offset using namespace std; int main(int argc, char *argv[]) { int seed1=0; int code1=0; int run=1; char ch1; cout<<" Crypt Version 1.02\n\n"; cout<<"XXXXXXXXXXXXXXXXXXXXX\n"; cout<<" Enter Integer Seed: \n"; // Asks user to input integer seed cout<<"XXXXXXXXXXXXXXXXXXXXX\n\n"; cin >> seed1; // Input user seed cout<<"\n\n"<<"Crypt String Key =\n\n"; //Initialize Valid Characters for String Shuffle Output //Note Bug corrected with blank space for \ by use of escape character proceeding string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;"; srand(seed1); // Allows user custom seeded starting algorithm position for random random_shuffle(str.begin(), str.end()); // Shuffle the string cout << str << "\n\n\n"; // Output the shuffle sequence //Pass String Output into an array to pair up pointer value with associated character string tmp = str; //Pass str output to string tmp char tab2[128]; // Memory Allocation for array population strncpy(tab2, tmp.c_str(), sizeof(tab2)); //string copy tmp into tab2 array tab2[sizeof(tab2) - 1] = 0; cout<<"Enter Info to Crypt in correct case\n"; cout<<"To Exit Program Close Window or enter ` \n\n\n"; while(run==1){ cin>>ch1; if (ch1=='A'){ code1=0; } else if (ch1=='B'){ code1=1; } else if (ch1=='C'){ code1=2; } else if (ch1=='D'){ code1=3; } else if (ch1=='E'){ code1=4; } else if (ch1=='F'){ code1=5; } else if (ch1=='G'){ code1=6; } else if (ch1=='H'){ code1=7; } else if (ch1=='I'){ code1=8; } else if (ch1=='J'){ code1=9; } else if (ch1=='K'){ code1=10; } else if (ch1=='L'){ code1=11; } else if (ch1=='M'){ code1=12; } else if (ch1=='N'){ code1=13; } else if (ch1=='O'){ code1=14; } else if (ch1=='P'){ code1=15; } else if (ch1=='Q'){ code1=16; } else if (ch1=='R'){ code1=17; } else if (ch1=='S'){ code1=18; } else if (ch1=='T'){ code1=19; } else if (ch1=='U'){ code1=20; } else if (ch1=='V'){ code1=21; } else if (ch1=='W'){ code1=22; } else if (ch1=='X'){ code1=23; } else if (ch1=='Y'){ code1=24; } else if (ch1=='Z'){ code1=25; } else if (ch1=='a'){ code1=26; } else if (ch1=='b'){ code1=27; } else if (ch1=='c'){ code1=28; } else if (ch1=='d'){ code1=29; } else if (ch1=='e'){ code1=30; } else if (ch1=='f'){ code1=31; } else if (ch1=='g'){ code1=32; } else if (ch1=='h'){ code1=33; } else if (ch1=='i'){ code1=34; } else if (ch1=='j'){ code1=35; } else if (ch1=='k'){ code1=36; } else if (ch1=='l'){ code1=37; } else if (ch1=='m'){ code1=38; } else if (ch1=='n'){ code1=39; } else if (ch1=='o'){ code1=40; } else if (ch1=='p'){ code1=41; } else if (ch1=='q'){ code1=42; } else if (ch1=='r'){ code1=43; } else if (ch1=='s'){ code1=44; } else if (ch1=='t'){ code1=45; } else if (ch1=='u'){ code1=46; } else if (ch1=='v'){ code1=47; } else if (ch1=='w'){ code1=48; } else if (ch1=='x'){ code1=49; } else if (ch1=='y'){ code1=50; } else if (ch1=='z'){ code1=51; } else if (ch1=='1'){ code1=52; } else if (ch1=='2'){ code1=53; } else if (ch1=='3'){ code1=54; } else if (ch1=='4'){ code1=55; } else if (ch1=='5'){ code1=56; } else if (ch1=='6'){ code1=57; } else if (ch1=='7'){ code1=58; } else if (ch1=='8'){ code1=59; } else if (ch1=='9'){ code1=60; } else if (ch1=='0'){ code1=61; } else if (ch1=='!'){ code1=62; } else if (ch1=='@'){ code1=63; } else if (ch1=='#'){ code1=64; } else if (ch1=='$'){ code1=65; } else if (ch1=='%'){ code1=66; } else if (ch1=='^'){ code1=67; } else if (ch1=='&'){ code1=68; } else if (ch1=='*'){ code1=69; } else if (ch1=='('){ code1=70; } else if (ch1==')'){ code1=71; } else if (ch1=='_'){ code1=72; } else if (ch1=='-'){ code1=73; } else if (ch1=='+'){ code1=74; } else if (ch1=='='){ code1=75; } else if (ch1=='?'){ code1=76; } else if (ch1=='<'){ code1=77; } else if (ch1=='>'){ code1=78; } else if (ch1==':'){ code1=79; } else if (ch1=='\\'){ // Escape Character \ needed to allow \ check code1=80; } else if (ch1=='/'){ code1=81; } else if (ch1=='~'){ code1=82; } else if (ch1=='.'){ code1=83; } else if (ch1==','){ code1=84; } else if (ch1==';'){ code1=85; } else if (ch1=='\`'){ //Escape Character \ before ` to exit run=0; //Run = False at 0 and leaves while loop } else { cout<<"Invalid Input = No Match\n\n"; } cout<<tab2[code1]; } system("PAUSE"); return EXIT_SUCCESS; } unCrypt Version 1.02 source code Code: [Select]#include <cstdlib> #include <iostream> #include <algorithm> #include <string> // 12/30/2015 - Added string random shuffle // 12/31/2015 - Added custom seed for random shuffle so seed acts a crypt key // 1/4/2016 - Added ability to enter string and have while loop process // 1/5/2016 - Added inverse unCrypt array pairing between Alpha and Seeded Key // 1/6/2015 - Added characters , and ; to supported characters to crypt // 1/8/2015 - Source code trash cleanup & IF logic Array offset correction to remove -1 band aid using namespace std; int main(int argc, char *argv[]) { int seed1=0; int code1=0; int run=1; char ch1; cout<<" unCrypt Version 1.02\n\n"; cout<<"XXXXXXXXXXXXXXXXXXXXX\n"; cout<<" Enter Integer Seed: \n"; // Asks user to input integer seed cout<<"XXXXXXXXXXXXXXXXXXXXX\n\n"; cin >> seed1; // Input user seed cout<<"\n\n"<<"unCrypt String Key =\n\n"; //Initialize Valid Characters for String Shuffle Output //Note Bug corrected with blank space for \ by use of escape character proceeding string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;"; //String random comparison 1 for 1 match //Pass static string list to array prior to shuffle string tmp1 = str; //Pass str output to string tmp char tab3[128]; // Memory Allocation for array population strncpy(tab3, tmp1.c_str(), sizeof(tab3)); //string copy tmp into tab3 array tab3[sizeof(tab3) - 1] = 0; srand(seed1); // Allows user custom seeded starting algorithm position for random random_shuffle(str.begin(), str.end()); // Shuffle the string cout << str << "\n\n\n"; // Output the shuffle sequence //Pass String Output into an array to pair up pointer value with associated character string tmp = str; //Pass str output to string tmp char tab2[128]; // Memory Allocation for array population strncpy(tab2, tmp.c_str(), sizeof(tab2)); //string copy tmp into tab2 array tab2[sizeof(tab2) - 1] = 0; cout<<"Enter Info to unCrypt in correct case\n"; cout<<"To Exit Program Close Window or enter ` \n\n\n"; while(run==1){ cin>>ch1; if (ch1==tab2[0]){ code1=0; } else if (ch1==tab2[1]){ code1=1; } else if (ch1==tab2[2]){ code1=2; } else if (ch1==tab2[3]){ code1=3; } else if (ch1==tab2[4]){ code1=4; } else if (ch1==tab2[5]){ code1=5; } else if (ch1==tab2[6]){ code1=6; } else if (ch1==tab2[7]){ code1=7; } else if (ch1==tab2[8]){ code1=8; } else if (ch1==tab2[9]){ code1=9; } else if (ch1==tab2[10]){ code1=10; } else if (ch1==tab2[11]){ code1=11; } else if (ch1==tab2[12]){ code1=12; } else if (ch1==tab2[13]){ code1=13; } else if (ch1==tab2[14]){ code1=14; } else if (ch1==tab2[15]){ code1=15; } else if (ch1==tab2[16]){ code1=16; } else if (ch1==tab2[17]){ code1=17; } else if (ch1==tab2[18]){ code1=18; } else if (ch1==tab2[19]){ code1=19; } else if (ch1==tab2[20]){ code1=20; } else if (ch1==tab2[21]){ code1=21; } else if (ch1==tab2[22]){ code1=22; } else if (ch1==tab2[23]){ code1=23; } else if (ch1==tab2[24]){ code1=24; } else if (ch1==tab2[25]){ code1=25; } else if (ch1==tab2[26]){ code1=26; } else if (ch1==tab2[27]){ code1=27; } else if (ch1==tab2[28]){ code1=28; } else if (ch1==tab2[29]){ code1=29; } else if (ch1==tab2[30]){ code1=30; } else if (ch1==tab2[31]){ code1=31; } else if (ch1==tab2[32]){ code1=32; } else if (ch1==tab2[33]){ code1=33; } else if (ch1==tab2[34]){ code1=34; } else if (ch1==tab2[35]){ code1=35; } else if (ch1==tab2[36]){ code1=36; } else if (ch1==tab2[37]){ code1=37; } else if (ch1==tab2[38]){ code1=38; } else if (ch1==tab2[39]){ code1=39; } else if (ch1==tab2[40]){ code1=40; } else if (ch1==tab2[41]){ code1=41; } else if (ch1==tab2[42]){ code1=42; } else if (ch1==tab2[43]){ code1=43; } else if (ch1==tab2[44]){ code1=44; } else if (ch1==tab2[45]){ code1=45; } else if (ch1==tab2[46]){ code1=46; } else if (ch1==tab2[47]){ code1=47; } else if (ch1==tab2[48]){ code1=48; } else if (ch1==tab2[49]){ code1=49; } else if (ch1==tab2[50]){ code1=50; } else if (ch1==tab2[51]){ code1=51; } else if (ch1==tab2[52]){ code1=52; } else if (ch1==tab2[53]){ code1=53; } else if (ch1==tab2[54]){ code1=54; } else if (ch1==tab2[55]){ code1=55; } else if (ch1==tab2[56]){ code1=56; } else if (ch1==tab2[57]){ code1=57; } else if (ch1==tab2[58]){ code1=58; } else if (ch1==tab2[59]){ code1=59; } else if (ch1==tab2[60]){ code1=60; } else if (ch1==tab2[61]){ code1=61; } else if (ch1==tab2[62]){ code1=62; } else if (ch1==tab2[63]){ code1=63; } else if (ch1==tab2[64]){ code1=64; } else if (ch1==tab2[65]){ code1=65; } else if (ch1==tab2[66]){ code1=66; } else if (ch1==tab2[67]){ code1=67; } else if (ch1==tab2[68]){ code1=68; } else if (ch1==tab2[69]){ code1=69; } else if (ch1==tab2[70]){ code1=70; } else if (ch1==tab2[71]){ code1=71; } else if (ch1==tab2[72]){ code1=72; } else if (ch1==tab2[73]){ code1=73; } else if (ch1==tab2[74]){ code1=74; } else if (ch1==tab2[75]){ code1=75; } else if (ch1==tab2[76]){ code1=76; } else if (ch1==tab2[77]){ code1=77; } else if (ch1==tab2[78]){ code1=78; } else if (ch1==tab2[79]){ code1=79; } else if (ch1==tab2[80]){ // Escape Character \ needed to allow \ check code1=80; } else if (ch1==tab2[81]){ code1=81; } else if (ch1==tab2[82]){ code1=82; } else if (ch1==tab2[83]){ code1=83; } else if (ch1==tab2[84]){ code1=84; } else if (ch1==tab2[85]){ code1=85; } else if (ch1=='\`'){ //Escape Character \ before ` to exit run=0; //Run = False at 0 and leaves while loop } else { cout<<"Invalid Input = No Match\n\n"; } cout<<tab3[code1]; // output } system("PAUSE"); return EXIT_SUCCESS; }Looks cool although you would be much better off using some sort of map data structure instead of that massive block of else ifs. Alternatively you may be able to get creative with the character's ASCII value. This would make the code a lot neater and more compact.Good suggestion ... Prior to coming up with what I came up with I was toying around with all sorts of dynamic methods of scrambled character substitution to try to make it work with less code, but while its really easy to scramble information with not many lines of code needed, being able to inverse that scramble and bring it back to its original form was tricky. So using 2 arrays one static and the other dynamic was the way to decrypt it back to its original form. I almost went with SWITCHES instead of IF THEN ELSE, but from years of IF THEN ELSE logic, that method flows easy from brain to keys. Tonight I was playing around with it writing a single lined entry to 2 files appended... a Key File and a Data File. And I thought all was well, BUT when looking further for some reason I am getting an additional write to file for the scrambled output so instead of an output of say 7*hY I am getting 7*hYY. My solution to fix this might be to have a counter that counts how many characters were entered and only allows the while loop to run equal to the character count. Or have a routine that reads in the last line and TRIMS off 1 character place. But these both seem like sloppy band aids. Its really strange that the output to display is correct without the extra character at the tail end, but the file write instruction processes writing the last character TWICE. This one has me slightly stumped because programmatically I dont see a flaw, but there is one. Code: [Select]#include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <fstream> // 12/30/2015 - Added string random shuffle // 12/31/2015 - Added custom seed for random shuffle so seed acts a crypt key // 1/4/2016 - Added ability to enter string and have while loop process v1.00 // 1/5/2016 - Added characters , and ; to supported characters which were missing from v1.01 // 1/8/2015 - Source code trash cleanup & offset band aid removed for IF statement logic +1 array offset v1.02 // 1/8/2015 - Added write to file for coded data storage eliminating need to copy/paste output to a text file v1.03 using namespace std; int main(int argc, char *argv[]) { int seed1=0; int code1=0; int run=1; int again=1; int test=1; char ch1; char ch2; while(again==1){ cout<<" Crypt Version 1.03\n\n"; cout<<"XXXXXXXXXXXXXXXXXXXXX\n"; cout<<" Enter Integer Seed: \n"; // Asks user to input integer seed cout<<"XXXXXXXXXXXXXXXXXXXXX\n\n"; cin >> seed1; // Input user seed cout<<"\n\n"<<"Crypt String Key =\n\n"; ofstream myfile; myfile.open ("Crypt103Key.txt", ios::out | ios::app); myfile <<seed1<<"\n"; myfile.close(); //Initialize Valid Characters for String Shuffle Output //Note Bug corrected with blank space for \ by use of escape character proceeding string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;"; srand(seed1); // Allows user custom seeded starting algorithm position for random random_shuffle(str.begin(), str.end()); // Shuffle the string cout << str << "\n\n\n"; // Output the shuffle sequence //Pass String Output into an array to pair up pointer value with associated character string tmp = str; //Pass str output to string tmp char tab2[128]; // Memory Allocation for array population strncpy(tab2, tmp.c_str(), sizeof(tab2)); //string copy tmp into tab2 array tab2[sizeof(tab2) - 1] = 0; cout<<"Enter Info to Crypt in correct case\n"; cout<<"To Exit Inner Program enter ( ` ) \n\n\n"; while(run==1){ cin>>ch1; if (ch1=='A'){ code1=0; } else if (ch1=='B'){ code1=1; } else if (ch1=='C'){ code1=2; } else if (ch1=='D'){ code1=3; } else if (ch1=='E'){ code1=4; } else if (ch1=='F'){ code1=5; } else if (ch1=='G'){ code1=6; } else if (ch1=='H'){ code1=7; } else if (ch1=='I'){ code1=8; } else if (ch1=='J'){ code1=9; } else if (ch1=='K'){ code1=10; } else if (ch1=='L'){ code1=11; } else if (ch1=='M'){ code1=12; } else if (ch1=='N'){ code1=13; } else if (ch1=='O'){ code1=14; } else if (ch1=='P'){ code1=15; } else if (ch1=='Q'){ code1=16; } else if (ch1=='R'){ code1=17; } else if (ch1=='S'){ code1=18; } else if (ch1=='T'){ code1=19; } else if (ch1=='U'){ code1=20; } else if (ch1=='V'){ code1=21; } else if (ch1=='W'){ code1=22; } else if (ch1=='X'){ code1=23; } else if (ch1=='Y'){ code1=24; } else if (ch1=='Z'){ code1=25; } else if (ch1=='a'){ code1=26; } else if (ch1=='b'){ code1=27; } else if (ch1=='c'){ code1=28; } else if (ch1=='d'){ code1=29; } else if (ch1=='e'){ code1=30; } else if (ch1=='f'){ code1=31; } else if (ch1=='g'){ code1=32; } else if (ch1=='h'){ code1=33; } else if (ch1=='i'){ code1=34; } else if (ch1=='j'){ code1=35; } else if (ch1=='k'){ code1=36; } else if (ch1=='l'){ code1=37; } else if (ch1=='m'){ code1=38; } else if (ch1=='n'){ code1=39; } else if (ch1=='o'){ code1=40; } else if (ch1=='p'){ code1=41; } else if (ch1=='q'){ code1=42; } else if (ch1=='r'){ code1=43; } else if (ch1=='s'){ code1=44; } else if (ch1=='t'){ code1=45; } else if (ch1=='u'){ code1=46; } else if (ch1=='v'){ code1=47; } else if (ch1=='w'){ code1=48; } else if (ch1=='x'){ code1=49; } else if (ch1=='y'){ code1=50; } else if (ch1=='z'){ code1=51; } else if (ch1=='1'){ code1=52; } else if (ch1=='2'){ code1=53; } else if (ch1=='3'){ code1=54; } else if (ch1=='4'){ code1=55; } else if (ch1=='5'){ code1=56; } else if (ch1=='6'){ code1=57; } else if (ch1=='7'){ code1=58; } else if (ch1=='8'){ code1=59; } else if (ch1=='9'){ code1=60; } else if (ch1=='0'){ code1=61; } else if (ch1=='!'){ code1=62; } else if (ch1=='@'){ code1=63; } else if (ch1=='#'){ code1=64; } else if (ch1=='$'){ code1=65; } else if (ch1=='%'){ code1=66; } else if (ch1=='^'){ code1=67; } else if (ch1=='&'){ code1=68; } else if (ch1=='*'){ code1=69; } else if (ch1=='('){ code1=70; } else if (ch1==')'){ code1=71; } else if (ch1=='_'){ code1=72; } else if (ch1=='-'){ code1=73; } else if (ch1=='+'){ code1=74; } else if (ch1=='='){ code1=75; } else if (ch1=='?'){ code1=76; } else if (ch1=='<'){ code1=77; } else if (ch1=='>'){ code1=78; } else if (ch1==':'){ code1=79; } else if (ch1=='\\'){ // Escape Character \ needed to allow \ check code1=80; } else if (ch1=='/'){ code1=81; } else if (ch1=='~'){ code1=82; } else if (ch1=='.'){ code1=83; } else if (ch1==','){ code1=84; } else if (ch1==';'){ code1=85; } else if (ch1=='\`'){ //Escape Character \ before ` to exit run=0; //Run = False at 0 and leaves while loop } else { cout<<"Invalid Input = No Match\n\n"; } cout<<tab2[code1]; myfile.open ("Crypt103Data.txt", ios::out | ios::app); myfile <<tab2[code1]; myfile.close(); }// end inner while loop //Add line return in file to seperate the data per line myfile.open ("Crypt103Data.txt", ios::out | ios::app); myfile <<" "<<"\n"; myfile.close(); test=1; while(test==1){ system("CLS"); cout<<"Enter Y to continue or N to end \n\n\n"; cin>>ch2; if (ch2=='N'||ch2=='n'){ again=0; test=0; } else if (ch2=='Y'||ch2=='y'){ again=1; test=0; run=1; system("CLS"); } else { cout<<"Invalid Input, please choose Y or N \n\n"; test=1; } } } // end outter while loop system("CLS"); system("PAUSE"); return EXIT_SUCCESS; } It would be possible to replace the else if portions dealing with alphabetic characters with some math. Upper case characters are codes 65 to 90. Your codes start at 0, so all the blocks testing capital characters can be replaced: Code: [Select]if(ch >= 65 && ch <= 90) { code1 = ch-65; } for lowercase characters, they span from 97 through 122, and your cipher maps them at 26: Code: [Select]else if (ch1 >= 97 && ch1 <= 122) { code1 = ch1 - 71; } Thanks BC for your input on this... that got me thinking of back in the days many years ago with GW-Basic I used Chr$(ascii_value). http://www.antonis.de/qbebooks/gwbasman/chrs.html And I guess I am reinventing the wheel by assigning my own values to the characters, when I should just be using their already existing ascii identifier which I can get from casting char to an int. Found this info here that is a big help too, and will correct for the fact that spaces are not accounted for on entry of what is to get scrambled and character substitution. http://stackoverflow.com/questions/6405137/asc-and-chr-equivalent-in-c-c output is: Quote string = "Hello, World!" Also found more info here on the code example you gave me: http://stackoverflow.com/questions/5029840/convert-char-to-int-in-c-and-cFound and fixed the additional character write problem I had. I thought of suppressing the write to file until the start of the first iteration of the loop in which write enable is enabled for the write function. This fixes the issue where upon exit by use of the ( ` ) key it does not write the last character twice appended to the text file. Now that I have this fixed I can go back and clean up the IF logic mess. And make this program about 80% smaller in size. The double write bug was really driving me up the wall when it made no sense as to why it was happening. So I decided to force the write to file prior to the ( ` ) exit instruction so that it will exit the loop without passing the write to file instruction before leaving the while loop in which its writing the last input from the input buffer and that idea worked. However I had to suppress writing to file until the characters processed went through the logic otherwise I had a leading array[0] value write to file and it added the first character within the array at the beginning of the file appended. So by this write to file only being enabled after the input was processed through the IF logic, but not after the exit instruction, by use of a write enable flag to start the write enable for the write to file instruction. That fixed it. Prior to bug fix if you used a seed key value of 43 and entered Hello_World you would get AW\\^nY^H\22 and now with bug fix I get the correct information written to file of AW\\^nY^H\2 ( single last character appended vs double last character appended ) Quote //supress write to file until 1 loop run ( bug fix for double character write ) Code: [Select]#include <cstdlib> #include <iostream> #include <algorithm> #include <string> #include <fstream> // 12/30/2015 - Added string random shuffle // 12/31/2015 - Added custom seed for random shuffle so seed acts a crypt key // 1/4/2016 - Added ability to enter string and have while loop process v1.00 // 1/5/2016 - Added characters , and ; to supported characters which were missing from v1.01 // 1/8/2016 - Source code trash cleanup & offset band aid removed for IF statement logic +1 array offset v1.02 // 1/8/2016 - Added write to file for coded data storage eliminating need to copy/paste output to a text file v1.03 // 1/15/2016 - Fixed Loop writing duplicate character on ( ` ) loop exit with write delay until loop processed prior to write // - seed of 43 with Hello_World was producing AW\\^nY^H\22 prior when it should only be AW\\^nY^H\2 with a single 2 // - at tail end of write process. using namespace std; //int main(int argc, char *argv[]) int main () { int seed1=0; int code1=0; int run=1; int again=1; int test=1; int writeenable=0; char ch1; char ch2; while(again==1){ cout<<" Crypt Version 1.04\n\n"; cout<<"XXXXXXXXXXXXXXXXXXXXX\n"; cout<<" Enter Integer Seed: \n"; // Asks user to input integer seed cout<<"XXXXXXXXXXXXXXXXXXXXX\n\n"; cin >> seed1; // Input user seed cout<<"\n\n"<<"Crypt String Key =\n\n"; ofstream myfile; myfile.open ("Crypt104Key.txt", ios::out | ios::app); myfile <<seed1<<"\n"; myfile.close(); //Initialize Valid Characters for String Shuffle Output //Note Bug corrected with blank space for \ by use of escape character proceeding string str="[emailprotected]#$%^&*()_-+=?<>:\\/~.,;"; srand(seed1); // Allows user custom seeded starting algorithm position for random random_shuffle(str.begin(), str.end()); // Shuffle the string cout << str << "\n\n\n"; // Output the shuffle sequence //Pass String Output into an array to pair up pointer value with associated character string tmp = str; //Pass str output to string tmp char tab2[128]; // Memory Allocation for array population strncpy(tab2, tmp.c_str(), sizeof(tab2)); //string copy tmp into tab2 array tab2[sizeof(tab2) - 1] = 0; cout<<"Enter Info to Crypt in correct case\n"; cout<<"To Exit Inner Program enter ( ` ) \n\n\n"; while(run==1){ cin>>ch1; //supress write to file until 1 loop run ( bug fix for double character write ) if(writeenable==1){ myfile.open ("Crypt104Data.txt", ios::out | ios::app); myfile <<tab2[code1]; myfile.close(); } else{ //do nothing and continue } writeenable=1; //enable write to file if (ch1=='A'){ code1=0; } else if (ch1=='B'){ code1=1; } else if (ch1=='C'){ code1=2; } else if (ch1=='D'){ code1=3; } else if (ch1=='E'){ code1=4; } else if (ch1=='F'){ code1=5; } else if (ch1=='G'){ code1=6; } else if (ch1=='H'){ code1=7; } else if (ch1=='I'){ code1=8; } else if (ch1=='J'){ code1=9; } else if (ch1=='K'){ code1=10; } else if (ch1=='L'){ code1=11; } else if (ch1=='M'){ code1=12; } else if (ch1=='N'){ code1=13; } else if (ch1=='O'){ code1=14; } else if (ch1=='P'){ code1=15; } else if (ch1=='Q'){ code1=16; } else if (ch1=='R'){ code1=17; } else if (ch1=='S'){ code1=18; } else if (ch1=='T'){ code1=19; } else if (ch1=='U'){ code1=20; } else if (ch1=='V'){ code1=21; } else if (ch1=='W'){ code1=22; } else if (ch1=='X'){ code1=23; } else if (ch1=='Y'){ code1=24; } else if (ch1=='Z'){ code1=25; } else if (ch1=='a'){ code1=26; } else if (ch1=='b'){ code1=27; } else if (ch1=='c'){ code1=28; } else if (ch1=='d'){ code1=29; } else if (ch1=='e'){ code1=30; } else if (ch1=='f'){ code1=31; } else if (ch1=='g'){ code1=32; } else if (ch1=='h'){ code1=33; } else if (ch1=='i'){ code1=34; } else if (ch1=='j'){ code1=35; } else if (ch1=='k'){ code1=36; } else if (ch1=='l'){ code1=37; } else if (ch1=='m'){ code1=38; } else if (ch1=='n'){ code1=39; } else if (ch1=='o'){ code1=40; } else if (ch1=='p'){ code1=41; } else if (ch1=='q'){ code1=42; } else if (ch1=='r'){ code1=43; } else if (ch1=='s'){ code1=44; } else if (ch1=='t'){ code1=45; } else if (ch1=='u'){ code1=46; } else if (ch1=='v'){ code1=47; } else if (ch1=='w'){ code1=48; } else if (ch1=='x'){ code1=49; } else if (ch1=='y'){ code1=50; } else if (ch1=='z'){ code1=51; } else if (ch1=='1'){ code1=52; } else if (ch1=='2'){ code1=53; } else if (ch1=='3'){ code1=54; } else if (ch1=='4'){ code1=55; } else if (ch1=='5'){ code1=56; } else if (ch1=='6'){ code1=57; } else if (ch1=='7'){ code1=58; } else if (ch1=='8'){ code1=59; } else if (ch1=='9'){ code1=60; } else if (ch1=='0'){ code1=61; } else if (ch1=='!'){ code1=62; } else if (ch1=='@'){ code1=63; } else if (ch1=='#'){ code1=64; } else if (ch1=='$'){ code1=65; } else if (ch1=='%'){ code1=66; } else if (ch1=='^'){ code1=67; } else if (ch1=='&'){ code1=68; } else if (ch1=='*'){ code1=69; } else if (ch1=='('){ code1=70; } else if (ch1==')'){ code1=71; } else if (ch1=='_'){ code1=72; } else if (ch1=='-'){ code1=73; } else if (ch1=='+'){ code1=74; } else if (ch1=='='){ code1=75; } else if (ch1=='?'){ code1=76; } else if (ch1=='<'){ code1=77; } else if (ch1=='>'){ code1=78; } else if (ch1==':'){ code1=79; } else if (ch1=='\\'){ // Escape Character \ needed to allow \ check code1=80; } else if (ch1=='/'){ code1=81; } else if (ch1=='~'){ code1=82; } else if (ch1=='.'){ code1=83; } else if (ch1==','){ code1=84; } else if (ch1==';'){ code1=85; } else if (ch1=='\`'){ //Escape Character \ before ` to exit run=0; //Run = False at 0 and leaves while loop } else { cout<<"Invalid Input = No Match\n\n"; } // Display output cout<<tab2[code1]; }// end inner while loop test=1; while(test==1){ system("CLS"); cout<<"Enter Y to continue or N to end \n\n\n"; cin>>ch2; if (ch2=='N'||ch2=='n'){ // line return to file ( formatting purposes ) myfile.open ("Crypt104Data.txt", ios::out | ios::app); myfile <<"\n"; myfile.close(); again=0; test=0; } else if (ch2=='Y'||ch2=='y'){ // line return to file ( formatting purposes ) myfile.open ("Crypt104Data.txt", ios::out | ios::app); myfile <<"\n"; myfile.close(); again=1; test=0; run=1; writeenable=0; //reset write enable to start of 0 system("CLS"); } else { cout<<"Invalid Input, please choose Y or N \n\n"; test=1; } } } // end outter while loop system("CLS"); system("PAUSE"); //return EXIT_SUCCESS; return(0); } |
|
| 1862. |
Solve : Powershell Regular expression to replace part of a file name? |
|
Answer» Rename FILES using regex in powershell I need a REGULAR EXPRESSION to identify the season and episode. I'm horrible with regular expressions |
|
| 1863. |
Solve : need help w/captcha? |
|
Answer» Quote I need help with this Captcha code. when I try it, all I get is code, Code: [Select]<?PHP // simple-captcha.php class FGSimpleCaptcha extends FG_CaptchaHandler; { var $error_str; var $captcha_varname; var $uniquekey; function FGSimpleCaptcha($captcha_var_name) { $this->captcha_varname='$captcha_var_name'; // ? $this->uniquekey='abc12fghijkl34mno; } /*Add more simple QUESTIONS here.*/ function GetSimpleCaptcha() { $arrQuestions = array( "Which of SOCK, library, cake or red is a color? "=>"red", "Enter the number thirteen thousand THREE hundred and SIXTY eight in digits: "=>"13,368"); $question = array_rand($arrQuestions); $answer = $arrQuestions[$question]; $_SESSION['FGCF_Captcha_Answer'] = $this->Md5CaptchaAnswer ($answer); return $question; } function SetFormKey($key) { $this->uniquekey = $key; } function GetKey() { return $this->uniquekey; } function Validate() { $ret=false; if(empty($_POST[$this->captcha_varname])) { $this->error_str = "Please answer the anti-spam question"; $ret = false; } else { $scaptcha = trim($_POST[$this->captcha_varname]); $scaptcha = strtolower($scaptcha); $user_answer = $this->Md5CaptchaAnswer($scaptcha); if($user_answer != $_SESSION['FGCF_Captcha_Answer']) { $this->error_str = "Failed the anti-spam check!"; $ret = false; } else { $ret = true; } } //else return $ret; } function Md5CaptchaAnswer($answer) { return md5($this->GetKey().$answer); } function GetError() { return $this->error_str; } } ?>[/b]First: captcha https://en.wikipedia.org/wiki/CAPTCHA Quote "Completely Automated Public Turing test to tell Computers and Humans Apart") is a TYPE of challenge-response test used in computing to determine whether or not the user is human.Also: http://www.captcha.net/ Rather than do it yourself, you can get an code thing from Google or others that lets you put a GOTCHA in your web page. Are you doing this inside of a specific application? |
|
| 1864. |
Solve : LIFE SIMULATION? |
|
Answer» I would like to be able to MAKE a simulation of the town I live in. |
|
| 1865. |
Solve : Long Long INT - maxes out at 999,999,999 ?? |
|
Answer» Found an interesting problem with a program I wrote. If I use a value greater than 999,999,999 for a long long int it acts like an overflow to the int and the program freaks out. long long int has/(should have) a range of: –9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 ..... 19 digit places, whereas the program is failing as if there is an overflow with more than 9 digits.
Geek thanks for sharing what you shared, it pointed me to LL suffix which helped point out the issue. http://stackoverflow.com/questions/1458923/long-long-in-c-c Now its going to be interesting with a counter++; as to if I need to concatenate the LL suffix before use. The counter starts at 0 and at 1,000,000,000 was when the program would fail going past the last value of 999,999,999 which was ok without the LL suffix. The while loop might be ok with it since its looking for a constant before exiting, but value passed to SRAND(seed) I wonder if I will need to concatenate and then cast it to seed to retain the LL suffix as for obviously the language itself doesnt do this automatically at 1,000,000,000, and I would need an IF statement that when the counter value reached 1,000,000,000 it is required that it add the LL suffix. WOW What a mess! Quote counter++; //This works until 1,000,000,000 is reached Might need to add code to add the LL suffix for a dynamic value... Quote IF(counter>=1000000000LL){Ok found my problem.... Typo in code. You dont need to add suffix to counters dynamic value. It works beyond 999,999,999 now with the LL used for while loop constant that its looking to reach Code: [Select]long long int = 999999999; while(counter<=1000000010LL){ counter++; COUT<<"Counter = "<<counter; } And this warning below is seen if tying to set the while loop to 1,000,000,000 or larger without the LL suffix and compiling. Quote 13:20 C:\cpp\run1.cpp [Warning] integer constant is too large for its type Quote counter = 999999999 |
|
| 1866. |
Solve : Batch - Match files and folders by filename? |
|
Answer» Hi experts, Have you already seen this? Oh yea - as far as I can see he moves the files based on the file extension. This is not possible for me as I need to move them by filename. Now this would require me to create 210 rules and im not so glad about that solution |
|
| 1867. |
Solve : powershell hash table editing? |
|
Answer» I'm WORKING on a powershell script that will walk through my network and get file version info on a few programs and want to add the computer name to the hash table for easier reviewing. |
|
| 1868. |
Solve : Batch file help - Start /w does not continue? |
|
Answer» I am not a programmer, however I am a technical writer and understand "some" code. ECHO ON OR Quote ECHO ONAnswered on Dostips. http://www.dostips.com/forum/viewtopic.php?f=3&t=6943 |
|
| 1869. |
Solve : Just sharing a test project as part of my other project? |
|
Answer» Decided to share a test project which is part of the crypt project. I was curious if there was a SEED value that would spit out the same output as the input, since its possible but not very probable for a shuffle to be shuffled back to its original form. If the output matches the original input the program will stop at that value in which a match was found. So far no matches up to 100 Billion seed keys. I will probaby also have no matches as well to 1 Trillion. I am not going to GO beyond 1 Trillion seed values. After that its just a waste of electric. |
|
| 1870. |
Solve : Memory Leak?? |
|
Answer» Well I ran a test against my code to throw 1 Trillion keys at it to make sure that I would not have a key that when used would output the same characters as the input for a crypto program I have been playing with and building upon. The AMD-FX-8350 at 4000Mhz took 7 days to complete 1 Trillion key tests with string compares with each core crunching 125 Billion Key tests, but what caught my eye is that the system memory showed that only 260MB was free of 8GB DDR3 1600mhz RAM. When I started the program last week only about 1.5GB of 8GB was in use, and the system was offline just used to crunch the project that I threw at it with 8 programs running 12.5% of 1 Trillion keys each to make use of all cores as 8 individual threads. I think you have much too much time on your handsYes this time of year I generally have too much time on my hands. Every winter I generally dive into a project of some sort. I like programming, but there have been so many times that I have felt an urge to write a program of my own and its like, what can I make that isn't completely pointless and would be useful to me. Making a program that scrambles text became this winters project as for I have a small notebook that I use to keep in my trunk of my car so that in case of a fire or same notebook in home was lost, I'd still have passwords and private info readily available... BUT its very dangerous having it all in a small notebook where if it fell out of my trunk or someone got their hands on it they would have "EVERYTHING" in clear text to use. My plans with the program I have is its a 2 part. A file is created with a key listing, and another file is created with the scrambled data. The key file and scrambled data file are kept separate so its like a key and a lockbox. But the lockbox is like a box of scrabble squares in it with the squares all different colors. It could be any message, but without the key and program to reassemble the message its almost pointless. Then a USB stick or a CD or DVD is burned with this data only without the program and keys needed to decrypt it. The program and key file is then kept in 2 locations, but never in the trunk of car, where odds of both locations having a fire for example at same time to destroy it are unlikely and the data and the tool and key to decrypt it are always kept appart with exception to when I need to look up a complex password that I dont use every day. The program I have now is not perfect and it needs to be strengthened. For now with it in its weak form words that have duplicate characters such as Hello World I enter into it as HeLlo World so that a duplicate character output is not seen in the scrambled output which is what a crypto cracker would probably use as a means to brute force it back to its original form. But passwords that are case sensitive unfortunately if there is a Password of YellowDog5$ the scrambled output would be something like &577*xH*+qU and that 77 pairing in there is a weakness! Hoping to implement later more complexity to it so that you could get pairing but pairing would not likely ever be substitution for the same character by use of multiple shuffled strings in use and based on the character placement within the full message to crypt its scrambled that much more complexly. Including an idea to salt the message with extra characters to add noise to it so Hello_World would not be always a scrambled output of 11 characters, but could be greater than 11 characters such as an output of G6*[emailprotected]?>0pZ&$Bvd3L# ( 20 characters ). The good thing is that my wife of 20 years knows my Winter Cycle of diving into programming heavily winters when daylight is short and too cold outside TV is boring and I get burnt out on video games. She has learned not to ask what I have been up to. Although she asked the other day and then after I started spilling out what i was doing and this algorithm doing this and the probability of a string match and running 1 Trillion iterations to test for the slim possibility of an exact match absolute worst key to use scenario she told me to shut up. ha ha ha Then I had an idea and started writing it onto paper as a brain dump and she told me she doesnt want to see me even writing code or flow charts at the dinner table as my brain is still going. I told her as long as she doesnt see me wallpapering the room in source code and flow charts that I'm still sane. She also SAID you should have married a computer nerd girl who gets turned on by code talk. I then reminded her of a girl that matched well with me at work 16 years ago and how if I wasnt married to my wife, I suppose that would have been the one since we were both heavily flirting with geek speak and very into each others conversations, as well as she was very nice on the eyes, but being true to my wife, I didnt leave her or cheat. She just looked at me and shook her head and I laughed. I said so they say opposites attract. And your telling me that likes attract then. She then said that you should have been a character on the tv show big bang theory and I laughed and said thank you for that compliment. Thanks BC for that info on Windows 7 memory leak. I wasnt aware of that and this system hasnt been CONNECTED for Windows updates in a while. I will update it tonight. Also interesting that my IDE didnt complain about the #include missing, not even a warning in the compile log. Also I dont run systems for days on end anymore other than some laptops that are crunching for BOINC in my basement. I either shut down my systems or have them processing data that is CPU intensive such as online gaming events with others that i record with Fraps and then use virtual dub to take the raw 40GB video file and process it down to a more manageable 1GB video file when I am sleeping and they are completed with processing by the time I wake up in which I check e-mail, delete the massive 40GB file and then shut it down and head to work. |
|
| 1871. |
Solve : make [ Batch file to execute program ]? |
|
Answer» Admin can you please delete this message for me please, because i moved this subject to |
|
| 1872. |
Solve : distorted view? |
|
Answer» hi, my computer screen has been DISTORTED lately and i dont KNOW why. this happened once before but it went away.the colors have changed one the screen and it is hard to read worlds..help please!! |
|
| 1873. |
Solve : How to access Windows AutoDetect.exe? |
|
Answer» Hi- |
|
| 1874. |
Solve : Small program won't compile... what is this error message?? |
|
Answer» Compiler shows me this, but I can't seem to see what I'm MISSING. |
|
| 1875. |
Solve : need a list of lua programming codes? |
|
Answer» I need a list of LUA programming codes for lua script. I can't seem to FIND any. I WOULD like a COMPLETE list of lua codes so I can learn it better.Googled and found this which led to this and there's lots more... |
|
| 1876. |
Solve : C# Help please...? |
|
Answer» I decided I WANT to make a FILE that can make other files... |
|
| 1877. |
Solve : UPDATED with additional info. Need to rename file as previous Sunday date? |
|
Answer» I have a vbs SCRIPT to rename a file with the previous Sunday's date. This script works perfectly fine on my windows XP machine, however, I am getting a runtime error when trying to execute on a windows VISTA machine. I attached the error MESSAGE as well as the syntax of the script. Do I need to change a setting somewhere on my vista machine to get this work? The VBScript functions Now, Date, and Time rely on the Regional Settings in the computer for their formats. Regional Settings change, depending on the user who is logged on (or not logged on) to the computer. As a result, there is no way to guarantee that date and time formats will always be the same. |
|
| 1878. |
Solve : c++ in highschool? |
|
Answer» i am going into 9th grade and I want to know if that class would be too hard? Is c++ very hard? I dont know wether c++1 and 2 would be too much for 9th grade? Thanksif their offering it for your grade they probably aren't going to do anything beyond your abilities. BC Programmer: goodness no! actually... it doesn't even really work, since I couldn't be bothered to learn how to use a VARIANT in C++. So if the expression ends up returning a string or object it causes a PAGE fault. Oh well. As confusing as that may look, I have VB6 code that looks even worse... Public Sub InvokeDynamic(ByVal onObj As Object, ByVal memberName As String, Arguments As Variant, retval As Variant) Dim ArgsPass() As Variant Dim AccessMode As InvokeKinds Dim i As Long Dim Current As Long Dim TryEm(10) As InvokeKinds, TryCount As Long Dim MemberInf As TLI.SearchItem Dim FuncFlags As InvokeKinds Dim IntInfo As TLI.InterfaceInfo, Getfirst As Boolean On Error Resume Next Set IntInfo = TLI.InterfaceInfoFromObject(onObj) 'Set MemberInf=IntInfo.Members.GetFilteredMembers(False).Item( Set MemberInf = FindSearchItem(IntInfo.Members.GetFilteredMembers(False), memberName) If MemberInf Is Nothing Then ' 'check for existence of Get and Set prefixed names of this one... for example, if we were passed "Name" look for getName and setName. ' If StrComp(left$(memberName, 3), "Set", vbTextCompare) = 0 And StrComp(left$(memberName, 3), "Get", vbTextCompare) = 0 Then ' 'check for set/Get permutations. ' If Not IsArray(Arguments) Then ' 'try Get first. ' Getfirst = True ' Else ' Getfirst = False ' ' End If ' If Getfirst Then ' On Error Resume Next ' InvokeDynamic onObj, "Get" & memberName, Arguments, retval ' ' ' End If ' If Not Getfirst Or Err <> 0 Then ' Err.Clear ' InvokeDynamic onObj, "Set" & memberName, Arguments, retval ' ' ' ' ' ' End If ' 'Execution Error: METHOD or Data member not found. On Error GoTo 0 Err.Raise ExecuteErrors.Exec_UnsupportedOperation, "ModParser::InvokeDynamic", "Interface member name " & memberName & " Not present in class name " & TypeName(onObj) Else 'The method DOES exist. good. 'if we have an array of arguments, put them in reverse order for the InvokeHook... If IsArray(Arguments) Then ReDim ArgsPass(UBound(Arguments)) For i = UBound(Arguments) To 0 Step -1 If IsObject(Arguments(i)) Then Set ArgsPass(Current) = Arguments(i) Else ArgsPass(Current) = Arguments(i) End If Current = Current + 1 Next i End If 'OK, if we have no parameters, it is POSITIVE that, if it is a property, it will be the retrieval of it. 'with parameters, however, is a different story. we'll need to try a Put first, then a get if an error occurs. ' If IsArray(Arguments) Then 'An Array/ 'possibly Get/Put/PutRef/Function. 'INVOKE_PROPERTYPUT and INVOKE_PROPERTYPUTREF require arguments. If MemberInf.InvokeKinds And INVOKE_PROPERTYPUT And IsArray(Arguments) Then 'try Good ol' put first... TryEm(TryCount) = INVOKE_PROPERTYPUT TryCount = TryCount + 1 End If If MemberInf.InvokeKinds And INVOKE_PROPERTYPUTREF And IsArray(Arguments) Then TryEm(TryCount) = INVOKE_PROPERTYPUTREF TryCount = TryCount + 1 End If If MemberInf.InvokeKinds And INVOKE_PROPERTYGET Then TryEm(TryCount) = INVOKE_PROPERTYGET TryCount = TryCount + 1 End If If MemberInf.InvokeKinds And INVOKE_FUNC Then TryEm(TryCount) = INVOKE_FUNC TryCount = TryCount + 1 End If End If Dim CurrTry As Long 'Final Stage- Iterate through each item in TryEm from 0 to trycount and attempt an InvokeHook. For CurrTry = 0 To TryCount On Error Resume Next If UBound(ArgsPass) < 0 Then Err.Clear Call Assign(retval, CallByName(onObj, memberName, TryEm(CurrTry))) Else Call Assign(retval, TLI.InvokeHookArray(onObj, memberName, TryEm(CurrTry), ArgsPass)) End If If Err = 0 Then Exit For Err.Clear Next End Sub -reduced in size to keep from taking up the whole page. the PROJECT that this is in clocks in at 15,000 lines, but I'm pretty sure there's a bit of dead-code in there somewhere. Ahem... anyway... As long as you stay away from COM, C++ is really no trouble at all. It's when you start doing gross STUFF like my silly little sample that it get's tricky. In fact, I gave up on that one ages ago- I found it easier to find out how to make a console program in VB6...i just found my vb book. Take only one class, they'll teach you the basics starting from scratch. Because you're in grade nine they know there is no prerequisites to take before that, so you'll start with the basics. You're lucky you have C++ class in your high school, I only had Pascal and Java which became available a little bit to late for me.You're lucky to have any programming courses in your school. We don't have any - I have had to self-teach myself since i was seven. Useless northland schools...my school had "Information technology" for grades 10,11, and 12- (11 and twelve were mostly in Visual Basic, with some Flash thrown in for good measure), as well as AP CS 12, which I myself took in grade 11, and did nothing at all in and got 100%. Actually, come to think of it, I didn't do anything in any of those computer courses after the first day or so of IT11... technically I was silently upgraded to IT12 and even then I was far better at VB then anybody else in the school of 1400. I credit all this to my 386 and VB2 during summer holidays one year... Now the poor bastards there are using VS .NET... I actually visited there once, and I had to supress sarcastic laughter when they asked wether I used VB .NET. "As my main language. I find the .NET framework clunky and an unnecessary distributable, and the CLR to be a cheap copy of the Java VM. I prefer VB Classic. yourself?" That person spent the rest of that period trying to think of something that .NET could do that I not only couldn't do in VB6 but also hadn't done - didn't go over in his favour... |
|
| 1879. |
Solve : C# Help!? |
|
Answer» I'm Trying to make a Program that will start another program if you type in the correct password and user name... |
|
| 1880. |
Solve : RE: programming ro detect a specific change on screen? |
|
Answer» Hi all, |
|
| 1881. |
Solve : Perfered Programming Language? |
|
Answer» Another bump?batch is good, but its even better when you add VBScriptWho said this: Who said this: I think I did. Quote they don't want to rewrite in C++ are any other languagec++ or java or computer apps for school. What do you guys thinkQuote QuoteWhat I meant was that a project may have built several apps in C ++ and each APP has its own main thing and the apps are not integrated together. So the project leader says the apps have to be integrated. Oops. They have conflictual thing sin them and they do not really work together. What the boss wants is a package that makes it loot like one big application. So the programmers do not want to re-write the apps so that can all be in one big EXE. So they use a script language like TCL to do a GUI that gives a look and feel of a kind of integrated app. The TCL is just a user interface that lets the user pick an app from a list. Do you understand what I mean? The advantage of TCL is it can do a simple GUI that looks nice in windows. I may have exposed a inside secret. Sorry. I can't keep my beak shut.OK -- cool -- I'll have to keep that in mind.Snit looks fun... Quote from: Wikipedia Snit is intended to HELP build applications out of the code at hand.I've voted C++. I think that C is the de-facto standard in UNIX but the ORIGINAL C language lacked many features (reference, template, STL, string, overloading, class, etc.). I currently use lots of these features in C++ now.C, not C++, is the de-facto standard of UNIX and is what UNIX is written in, as well as most of it's user-based derivatives, such as Ubuntu, GNU,Fedora, and so forth. in my opinion C++ is a somewhat rushed implementation of OOP into the existing C language. The fact that one needs to define the class interface and the concrete class itself in separate HEADER and cpp files makes file management a unnecessary pain in the but. Additionally, although simply using classes in C++ is workable, a completely different set of difficulties arises when trying to implement COM classes via C++. with requirements to implement IUnknown, IDispatch, IPersistFile, IObjectSafety, and goodness knows how many other COM interfaces, many of which contain basic boilerplate code (which can be easily wrapped into templates as shown by ATL). of course this isn't really a design flaw on the part of C++ but rather the lack of anything higher-level to the C++ programmer for COM components. As an example, Visual Basic and Delphi can both implement COM classes without requiring the programmer to manually implement the various required classes (IClassFactory and so forth) |
|
| 1882. |
Solve : More C# Help...? |
|
Answer» Hello I need some more help... xD when I turn it on. what does this mean? When you turn what on?when I activate the dll in another application so I can use it in that application. |
|
| 1883. |
Solve : menu tree and grid control? |
|
Answer» I'm LOOKING for a good portable control for menus and navigation. also a good grid. Any one have any experiences with some of those on the MARKET, old or new, i'd APPRECIATE it. Coding for desktop, and web, SEPARATE apps. |
|
| 1884. |
Solve : Good c++ complier? |
|
Answer» Looking for a GOOD C++ complier. I GOT a dummies book on C++ but it only goes up too WInd ME an I am USING xp not sure were to find this stuff since I'm starting out an all ready having issues.Googlefigures, there a thousands of ones that may do SOMETHINGS an not OTHERS I just want one that is fairly well.http://en.wikipedia.org/wiki/List_of_C%2B%2B_compilers#C.2FC.2B.2B_compilersshould have thought of that I dont really wiki but any way I got vsual c++ 05 version but dont know if its limited an if it will work an all that. |
|
| 1885. |
Solve : Formula in Microsoft Excel? |
|
Answer» Hello, |
|
| 1886. |
Solve : batch file on cd to autorund a sellection of programe exe files? |
|
Answer» Hi can anyone help me. I have not written a batch file in a very long time @18 years and never had to do what I now need to do. I am trying to prepare a batch file for burning onto a cd/dvd that will allow me to offer the cd/dvd user a selection of programs to install. I have a code that will make the batch file executable. I suppose I am trying to product a file much like you will see on the free cd/dvd's given out with many mags these days. I use xp as my os but the file would have to be capable of executing on almost any windows based system from say 2000 to vista. Is there any one who can help. My request is genuine and I have just had a web site built at www.cadireland.com I am trying to put together a cd/dvd with all of the demo files on it. I am new to this field as you have probably guessed. If anyone knows of an business who could write this program for me that would also be an acceptable solution depending on cost and time taken to produce. I really appreciate your help thanks.This could be as elaborate or a simple as you want. I use xp as my os but the file would have to be capable of executing on almost any windows based system from say 2000 to vista Choice is not installed on WinNT machines only Win9x (yes, they are still out there) although I hear they brought it back from the dead for Vista. You may have to query what OS the user is running and write another segment of code for WinNT, Win2000, and WinXP USERS that will use set /p Quote Again my problem is how to tie all of these together Provided the compiled version of the batch file is NAMED master.exe, everything is tied together. Be sure to put the exe and the jpg icon in the root directory of the CD. Each of the support files for each selection can be in their own directory, but use relative paths as the CD drive letter will be different on different machines. Quote still show a welcome message and disclaimer and if possible a little bit of artwork Forget the artwork. Batch files are text only and do not support graphics. You could create a splash screen with multiple echo commands and use ping to leave visible for say 5 seconds. If you decide to go with a HTML solution let us know. Note: During testing I used a USB thumb drive which is not supported for autoplay without some smoke and MIRRORS so my autorun.inf was a bit different than yours. The autorun.inf file you posted should work fine for a CD. Hi Sidewinder Sorry for long delay in thanking you for your help with code. It was a neater solution. I decided having looked at the limited nature of the result to write a html code. It has been very difficult and I am only now nearing completion. I did not ask for help as the pages of code were in some cases large and complex although I have through trial and error started to slim all of this down. It turned out to be quite a project linking all the pages of code in a similar manner to a web site. When finished I may publish on these forums the code pages should anyone else like to give it a try or offer some improvements. Once again thank you |
|
| 1887. |
Solve : in need of debugging help? |
|
Answer» i'm using Microsoft Visual .Net Studio 2003 |
|
| 1888. |
Solve : Please help with batch file problem? |
|
Answer» Hi, FOR /F "tokens=*" %%R IN ('md5sums -u c:\windows\system32\drivers\tcpip.sys') DO SET curver=%%R I think it must be something to do with the IF PART. Welcome to the CH forums. Try this (UNTESTED): IF "%curver%" equ "%ver18000%" (GOTO gotmatch) ELSE GOTO nomatchYou don't really need an ELSE IF [test] goto true echo test failed! goto end :true echo test passed! :end WHat are you trying to do and y r u putting quotationmarks around VARIABLES? Why are you resurrecting the dead? Check the post dates... |
|
| 1889. |
Solve : How can i make a batch file start once it is copied?? |
|
Answer» I need to know how to make a batch FILE START itself once it is copied. I am fairly knew to this and really need to know(its on a test, but no one needs to know) We're not supposed to help with tests or homework, because it leads to your teacher thinking you understand something you don't, and then they move to something mroe complicated which MAY be based on the thing you don't understand, which just means you end up coming back here again and again and we end up doing your qualification for you. Approach your teacher for help. Sorry.dirt1996 how is it you know enough to get into the forum and you do not know how to start a batch file? At the top of this page there is a search box.Just type in BAT or BATCH and see the TUTORIALS on this site. |
|
| 1890. |
Solve : Help creating my first vbscript? |
|
Answer» I found a way to manually stop the wuauserv from running in our testing lab and I have been ASKED to create a script to put on the DC so when they LOG students in for a a test the pop up to restart does not bother the student. I have no EXPERIENCE with PROGRAMMING and need a little help. I need to create the script so it runs this command: |
|
| 1891. |
Solve : VB Constant Height/Width? |
|
Answer» Hi am I making a program in VB. |
|
| 1892. |
Solve : problem with simple chat program programmed with visual basic? |
|
Answer» :(Hi, I have an error that keeps coming up when I try to run a simple chat program from the Mastering Visual Basic series. this is the error I get: Run-time error 10054, the connection is reset by remote side. Here is the code that the debugger sends me to: SYMPTOMS Code: [Select]RESOLUTION To work around this problem, use the Microsoft Visual Basic Standard Error Handling MECHANISM to catch the error. This workaround is illustrated in the following code snippet: Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long) Dim szData As String On Error Resume Next Winsock1.GetData szData If ERR Then ' handle the error here End if End Sub :)Thanks for your help. I'll try that. |
|
| 1893. |
Solve : using arccos(x) function - Visual Basic? |
|
Answer» hey everybody, |
|
| 1894. |
Solve : Using Visual Basic? |
|
Answer» How I can create a program using visual Basic. My Idea is to count the number of pages from a "PDF" file .which code i can use to create this type of program?This sub procedure LETS you get the page count for a given PDF file. The page count usually appears somewhere in the last 50 lines of the file. Simply open the file in binary mode and parse through the content searching for "/count". To test this, simply add a command button and label control to your Winform. Be SURE to update the path to your PDF file in the command button control's event handler. |
|
| 1895. |
Solve : Is there away to do this...? |
|
Answer» I was wondering if there is a program that can do certain steps that I program it to do, lets say something like hitmanpro (hitmanpro.nl), which updates, scans and cleans your pc using other antispyware programs WITHOUT you doing anything, so what I NEED is something like that so I can save myself alot of steps that I do over and over again on my pc. |
|
| 1896. |
Solve : Name that instruction set!? |
|
Answer» Name that Instruction set. |
|
| 1897. |
Solve : Searching a book? |
|
Answer» I'm searching the book of David Kruglinski - Visual C++ 5.0/6.0. Can anyone help me - I've been searching in all bookstores and many sites for e-books but I can't find it. PLEASE GIVE a LINK...Maybe these will help? |
|
| 1898. |
Solve : Looking for ideas for network troubleshooting with a VBS? |
|
Answer» I am working on a VBS script to help troubleshoot an intermittent network / internet PROBLEM, and I was hoping to get some ideas from PROGRAMMERS who may have done something similar. |
|
| 1899. |
Solve : delphi help? |
|
Answer» I NEED somme help to a program. I am working in Delphi to a project and there i need to insert somme text, but i don't know how .I need an exemple for the picture that i had atached . |
|
| 1900. |
Solve : Hide File in picture? |
|
Answer» How is it done. I really don't think we should be discussing this here. Although your intentions may not be malicious, this sort of information could be used to do a lot of damage. Every bit of information and code given on here could do damage in the wrong hands even the delete command so why not give advice on this subject?. I have figured out how to do this through hard searching all i can say is that i am disappointed in this site. I came here to learn and that i cannot because of people like you who wont help others because you fear that the information will get in to the wrong hands. Just delete my account and forget it. I will find another forum where i can learn from real programmers. Quote I came here to learn and that i cannot because of people like you who wont help others because you fear that the information will get in to the wrong hands.You could hide a keylogger in a picture and send it to someone. When they open the file, the keylogger would be active and it could send keystrokes via email. Or you could hide a batch file that would delete c:\ and when they open the picture, their computer is useless. This is why we don't discuss these topics here. Most of us aren't real programmers, we are just good troubleshooters and we help people with problems, not give other people new problems. If you want to become a programmer that makes viruses and spyware, go ahead. I couldn't care less. Even though it could throw you in court. Quote Every bit of information and code given on here could do damage in the wrong handsYeah, and I don't think this post can be used to destroy a computer. Quote from: kentguy07 on June 22, 2007, 05:34:26 PM I have figured out how to do this through hard searching all i can say is that i am disappointed in this site. Obviously, you're fully capable of finding the information on your own, so I suppose you didn't need us in the first place. Keep in mind that this is a free help site and we have certain guidelines that we abide by. It won't break my heart to see you leave, but if you change your mind, you're still more than welcome to stop by for advice. Just keep in mind that certain subjects may be a bit on the touchy side.I personally don't see that discussion of steganography is any more DANGEROUS than discussing sticking down an envelope before mailing a letter, or password protecting rar or zip files. Carbon DudeOxide, if an executable file were "hidden" steganographically in an image file, simply opening that image file in a viewer would most definitely ***NOT*** cause the executable file to be run. You would have to choose to run the image file through a program that would retrieve the buried file and write it out to disk. There are no image viewers that are capable of dong this. What kentguy seems to want is, ie, open the image and extract & execute the hidden file is, I agree, potentially capable of malicious mischief and I very much doubt his motives in asking about it. If steganography is so dangerous, why do so many people concerned with their privacy use Steganos to communicate securely via email, protect passwords, and do quite a few other perfectly legitimate things? man, this is interesting ......... what did you say ?If an image file uses 24 bits per pixel, 8 each for red, green, and blue, you can throw away the lowest-order bit of each pixel R,G,B value and the picture won't look much different to the naked eye. Those bits could be replaced by the bits of a message. A one million pixel image could therefore hide 3 million bits or nearly 400 Kbytes of information, quite a big text file. If you only needed to hide a short text file, say 1 Kbyte, you could get quite imaginative with where you put the bits. The only trouble is, you can't do this with jpeg images which are compressed. You'd need a bmp type image. Other possibilities are the wav files that make up audio CDs. (but not mp3s for the same reason) This is called "steganography". The word "Steganography" is of Greek origin and means "covered, or hidden writing". Its ancient origins can be traced back to 440 BC. Herodotus mentions two examples of Steganography in The Histories of Herodotus . Demeratus sent a warning about a forthcoming attack to Greece by writing it on a wooden panel and covering it in wax. Wax tablets were in common use then as re-usable writing surface, sometimes used for shorthand. Another ancient example is that of Histiaeus, who shaved the head of his most trusted slave and tattooed a message on it. After his HAIR had grown the message was hidden. The purpose was to instigate a revolt against the Persians. Later, Johannes Trithemius's book Steganographia is a treatise on cryptography and steganography disguised as a book on black magic. The CIA has computers capable of finding hidden MESSAGES in image and audio files, I read somewhere. "I'm glad your around" * nice reads !!!!!!!!!!!! |
|