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.
| 901. |
Solve : Need help with Java - GUI? |
|
Answer» I am just playing around with Java GUI. Here is a simple code, it has no main method because I haven't got to there yet but I am getting this ERROR: And if anyone can explain to me what @Override is for, is that for override ActionPerformed method? It just points out to anyone reading the code that the next method is over-riding the original. It is not necessary for the code to work. I think the problem is that txtFirstName etc are only declared within the scope of the constructor; ie. can only be accessed from the constructor. If you want them to be accessed from outdiee the constructor's scope (and you do, you want to access them in ButtonHandler), then put them as properties. Usually there is this structure: Code: [Select]public class MyClass.....{ //properties here ... ... ... //constructors here .. .. .. //methods and nested classes here ... ... .. } //end class Hope this shed a little light, Two-eyes %Sorry for not replying for a while the forum banned me for no reason. Thank you Two-eyes for pointing that out. I've spent about four hours on Thursday trying to figure things out and now I have a general understanding of how to use GUI and laying it out using GridLayout. Thank you guys. |
|
| 902. |
Solve : clearing all textboxes in a form? |
|
Answer» I have googled to find a code in VB2008 to clear all textboxes in a form. I can't seem to GET a code to work. If your textbox its badly name as txtbox1 txtbox2, 3, 4, 5 and so on then you can use this code |
|
| 903. |
Solve : PHP and Javascript, need help!? |
|
Answer» Hey guys, |
|
| 904. |
Solve : Starting Programming? |
|
Answer» Hi, I want to get started programming. I have been told to start with PYTHON, so that is what I am doing right now. I am almost done going through this TUTORIAL, but I would like to know where to go from there. Hi, I want to get started programming. I have been told to start with python, so that is what I am doing right now. I am almost done going through this tutorial, but I would like to know where to go from there.wrong. you should go here to read the tutorial. AND then surf the entire site to read the DOCUMENTATIONS. |
|
| 905. |
Solve : high card game c++? |
|
Answer» For schoo we have to make a program that outputs 5 cards and says what the highest is like |
|
| 906. |
Solve : Just tell me what to do?? |
|
Answer» I can't even guess how many times this questions has been asked but I think I have to ask in my own words to get satisfaction. Mainly, I want to understand how my computer(computers in general work) and want to know what language I should start with. I know there's hardware and software and they all communicate through channels and something controls those channels and that there's a CPU that does basic comparisons of data in machine code and that has to be translated into machine code by , is it assemblers, from high level language written by a person. I think that dll's in windows are common parts of software that all the programs share to make code shorter and I think that has something to do with batch programming. I still do not understand what windows is "sitting on" in my Dell laptop that it is running on. I know there's different layers that OS run on like the KERNAL, that I think MANAGES, I don't know something. But, my question is- to help tie this all together for me, what language should I start with. Quote from: Doug on November 04, 2009, 10:32:48 AM what language should I start with.Python.Quote from: gh0std0g74 on November 04, 2009, 04:30:32 PM Python.That is a good answer. No ot satisfied? Here are some other languages that are like Python.. in a very broad sense. PHP Perl Ruby Java In addition, there are code systems based on ht e .NET framework from Microsoft. I program in Assembler, but I do not recommend it. Quote from: Geek-9pm on November 04, 2009, 04:49:26 PM in a very broad sense.Java is does not fall into this category.I use VLC media player alot. I what to see what the program looks like. So, I notice that there is a place on the download site for the player to LOOK at the source code. Well, I tried to look at it but could not get it open. Would someone please help me to look at this program. I want to see what a program that alot of people are using looks like. The file is a zip with the B2Z file something. How could I look at this on my computer. I downloaded the file and downloaded some PZ unzipping file and tried to look using wordpad and notepad and could not. http://www.videolan.org/vlc/download-sources.html. I'm using Windows XP if that info is revelant.pascal c C programming javaQuote from: gh0std0g74 on November 04, 2009, 04:53:05 PM Java is does not fall into this category.Why not?Quote from: Geek-9pm on November 05, 2009, 05:21:28 PM Why not?Java, simply is not designed to be a scripting language. Can you imagine you need to do a class and byte compile just for printing hello world? Quote from: gh0std0g74 on November 05, 2009, 08:37:19 PM Java, simply is not designed to be a scripting language. Can you imagine you need to do a class and byte compile just for printing hello world?I respect that. The original question was: Quote But, my question is- to help tie this all together for me, what language should I start with.Python was given as a answer. I added there are other languages like it in a broad sense. I included Java. Python is often compared to Java and people make arguments as to their merits. Both are wildly used. Both are somewhat easy to learn. Both open up a lot of computer power. That was the basis for my earlier statement. Then there is java script. But LET us with not go there now. The OP wanted a SIMPLE answer to a very broad study. Namely, to lean more about computers. Quote from: Doug on November 05, 2009, 03:22:56 PM I use VLC media player alot. I what to see what the program looks like. So, I notice that there is a place on the download site for the player to look at the source code. Well, I tried to look at it but could not get it open. Would someone please help me to look at this program. I want to see what a program that alot of people are using looks like. The file is a zip with the B2Z file something. How could I look at this on my computer. I downloaded the file and downloaded some PZ unzipping file and tried to look using wordpad and notepad and could not. You tried to use VLC to look at the binary data of the program. The source code is the code before it is compiled. For example: C++ would have a source code with such as FileName.cpp - After you compile it, it would become FileName.exe. Unless you decompiled the .exe file you were just viewing the binary data of the .exe file. If you want to look at source code for a program, they usually won't give it to you (for free). If it is open source you may be able to download the code itself. An example of a program that has source code that I used for some C++ reference would be PeerGuardian 2. You do need Microsoft Visual Studio 2005 to be able to open the project however. |
|
| 907. |
Solve : JavaScript to Read & Write to Cookies? |
|
Answer» I am working with a friend to make a web page based video game where he is going to do the artwork etc and I am going to do the programming and I hit a wall with saved game state information. |
|
| 908. |
Solve : Sprite? |
|
Answer» HI there folks i am trying to create a game on VB.NET but lately i been using picture box. The thing is that when using an image with transparent background with picturebox you cannot see the transparent background but instead some colour that is set on the forms. But the transparent background do SHOW up if you put the setting to transparent but it doesn't work to the background form images. I believe that picture box is not a way to create images for games. I heard from my friends, he said that to LOOK up using sprite, but the TUTORIAL that i found on google doesn't work as there is no declaration code! Doesn't anyone here know how to use sprite or can you point me to a correct direction on the internet? I only found a proper tutorial on C# but not VB. Thou the concept is the same but not with sprite! Thank youDoest anybody know how to make picturebox transparent, i MEAN fully transparent so when i overlap two pictureboxes i shouldn't have a square boarder?use the image control. |
|
| 909. |
Solve : How i can use usb wirless (bluetooth) in car ?? |
|
Answer» Hi, |
|
| 910. |
Solve : To make sure !? |
|
Answer» Hi all .. Face it, DOS cant do what you want it to. For more information on what dos CAN'T do, please go here.Umm, I think another factor is that DOS is not a language... DOS is actually quite good for hacking windows system. (BTW that one thing where it says access denied, well that's stupid, because if you can right click you'll understand). I can change any of the accounts passwords. Well, that's not really hacking, that's just type a few commands. I can also see the I.P. Addresses of the other people connected to my modem (example: brothers). Meaning, if I can get on there account I can probably find out there password, meaning I have access to their computer. You know, DOS does have a few tricks up it's sleeve once in a while. I told them they shouldn't make accounts on my computer .Quote from: BatchFileCommand on November 04, 2009, 07:16:33 PM DOS is actually quite good for hacking windows system. No. It isn't. It's useless for that. Quote (BTW that one thing where it says access denied, well that's stupid, because if you can right click you'll understand).Not even sure what your talking about. Quote I can change any of the accounts passwords.No. you cannot. Not without the current password. Quote I can also see the I.P. Addresses of the other people connected to my modem (example: brothers). you can see this in a router/modem config page too. nothing special about it. Oh, except you can see the same thing in Network Neighborhood/network, by right-clicking on the computer. It gives you the IP address. There is nothing "hidden" or "secret" about them. Quote Meaning, if I can get on there account I can probably find out there password,How? You cannot get the current users password through any "DOS" command (I put DOS in quotes because I doubt you've actually used a computer that was actually running DOS because if you had you would realize how useless it is and how it is merely a method of performing tasks using commands, rather then using the windows GUI. Nearly everything you can do in the Command Prompt you can do with the windows GUI; and those thigns you cannot do in the GUI are nowhere near cracking the password. (warranted, I'm sure there are third party applications that crack the LM hash or something, but just because the programmer is too inept to make a proper GUI application (which is good, because like most "haxxors" they'd probably embed some terribly awful music into it) has nothing to do with Command Prompt, and even less to do with DOS. There are applications that do the same thing within the windows GUI, does this make the GUI good for hacking? No. it's a GUI, a vessel to run programs. I tried to search for it, but there was already a long rant (not by me) about this subject. The fact that wannabe's hear about the "power of the command prompt" and don't hear the rest of it means they have to paint the picture for themselves. to they invent all sorts of fantastic tales about how they haxxored their principals "box" using find /i, or something equally fallacious. the problem is their friends, being wannabe haxxors as well, adopt the principal of "make it up as you go along" so pretty soon the school is a murmur with the ramblings of 3l33t haxxors telling their stories of how they trained the class gerbil to run through a maze, eat some cheese, and then school n00bs in a game of doom before it haxxored the bunny's box, took a nap and then haxxored ebay and paypal and got some oreo's DELIVERED to it's house and subsequently died of a heart attack. The above is unfortunately no less ridiculous then the various "stories" I heard while in school by what were supposedly my peers: "I totally schooled him with a DOS command" "I hacked his box when I was at his house, I totally unplugged it, he was so pwned" Yes. It's true. And this is only the tip of the iceberg; adding to this issue is the fact that teachers and other school staff are PARANOID about what the students are doing online. A Prime example being when I was working with QuickBASIC on several occasions. The librarian insisted that I couldn't use QuickBASIC because any program that uses a DOS window is bad. I didn't realize it at the time, but this attitude is universally ubiquitous with almost any staff member, aside from those who actually know that a mouse port is not a cute little van built for rodents. This only makes things worse, as otherwise smart students are led to believe the same paranoid, delusional crap that the uneducated teachers do. Quite a sad state of affairs. This is not to mention the complete pervasion of games like "world of warcraft" a world where computer nerds can try to recluse, and at least pretend they have 500 pounds of pure muscle and can crush a lemurs skull with one hand , when in fact they have trouble crushing a grape with both hands. the problem is said "nerds" (who are actually a lesser sub-species called the "wanna-be" nerd, who only thinks that they are a nerd. They, without realizing it, try to learn as much as possible about computers in order to appear "cool" to their nerd friends, of whom a majority are also wanna-be nerds who are doing the exact same thing. this is in fact where these conversations sprout up from, as the wanna-be's mix terms without abandon. "Yeah, I so totally SQL'd him so bad, he was such a WYSIWYG" "Oh, I know who you mean, I bet I schooled him with PERL* the other day" *Perl Quote haxxored ebay and paypal Hi, BC. Nice to see someone on CH who is not a complete p***k. It sure has gone downhill lately. doctor hack I understand your question to be simply you want to do an Anti-Virus program that can start and report at the command prompt. Yes, there are some advantages to that. (Ask me if you want me to expand on that point.) But first, let me say that if you do not already have two years of experience in any kind of computer programming, it will be a hard job. But it is not beyond the ability of someone who is very STRONGLY motivated. You will need to learn the C language, which can run from the command line. You will later make a library of functions that give you low-level access to all the files in the system. And you must have a database of Virus SIGNATURES. You may be able to borrow a database from the Open Source Community. The above, I think, is the best short general answer to your question. Quote doctor hack Thanks for ur advice , I have another question How can run DOS environment under any operating system thanxThere are two problems with your idea. DOS is an operating system. Therefor there is no DOS, other than in an old computer RUNNING DOS. The second problem is that what you think is DOS, is actually CMD.EXE, a command-line interpreter. It is in WINDOWS OS computers, so if you had a batch file, and you made it in XP, it will work in VISTA (if it works in the first place). Macs don't have CMD.EXE, so they can't run batch files. And cmd.exe is NOT "DOS". Quote from: doctor hack on November 16, 2009, 12:47:29 AM How can run DOS environment under any operating systemyou can't just run DOS within an already INSTALLED operating system. What you can do is run it via a virtual machine. eg vmware. |
|
| 911. |
Solve : COM object? |
|
Answer» Hi Next step is to register your component with regsvr32 path\componentname.wsc where do we write this syntax? Thanks for help. The default location of regsvr32 is the system32 directory. You can RUN the utility from either the command prompt or the start==>run box. There is a /s switch to eliminate any message boxes. You can GET the offical information here. description="My Test Component" progid="Component.TestScript" version="1" classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}" Function factorial(n) If isNumeric(n) Then If n <= 1 Then factorial = 1 Else factorial = n*factorial(n-1) End If Else factorial = -2 ' Error code. End If End Function ]]> I copied this as a wsc file and stored it in d drive. in cmd when i am typing regsvr32 d:\component.wsc I am gettin the following error: [3,2]A required attribute is missing : progid, clasid, or classid. I don't see any thing missing? then what's the problem? Thanks for helping me. There was a name property I COULD find no reference to. There were also some missing tags and a missing parameter for the factorial function. Code: [Select]<?xml version="1.0"?> <component> <registration description="My Test Component" progid="Component.TestScript" version="1.00" classid="{2154c700-9253-11d1-a3ac-0aa0044eb5f}" > </registration> <public> <method name="factorial"> <PARAMETER name="n"/> </method> </public> <script language="VBScript"> <![CDATA[ Function factorial(n) If isNumeric(n) Then If n <= 1 Then factorial = 1 Else factorial = n*factorial(n-1) End If Else factorial = -2 ' Error code. End If End Function ]]> </script> </component> Good luck. |
|
| 912. |
Solve : need help with scriping languages? |
|
Answer» dear friends, |
|
| 913. |
Solve : MS -DOS and GWBASIC? |
|
Answer» Is there a way to change a GWBASIC program so it will run in windows? It is used to program a machine.Does the program access ports (com1 etc)? I have tried to run it in Win 98, Win xp,and yes it uses com port in fact it uses a serial port connection to machine ( 9 pin 25 pin) which is hard to find, I have used USB but run into CONFLICTS. After interring the information in the machine it writes back to the disk to save the info and this is where it hangs. I have taken two older comm and just put IBM DOS 5.0 on the hard drive and it works on the Dell Latitude CP 233XT, but the Dell is about to die, the other is a Toshiba 325CDS and this is where I am having the problem. That is why I need to be able to run in windows. Thanks for the reply and any help I thank You for. Shannon In the Win 98 system have you tried amending Config.sys to boot to DOS and run the program on there? Most versions of Basic cannot access ports when running within Windows XP and need specific additional routines (THIRD party utilities and the like) to do this. One of these specific to NT/XP is Porttalk which might suit your purpose.. Porttalk is discussed here.. |
|
| 914. |
Solve : Javascript Loading Sign? |
|
Answer» I want to use these symbols as a Javascript loading sign (In other WORDS it animates the text so that it looks like a turning line): I want to use these symbols as a Javascript loading sign (In other words it animates the text so that it looks like a turning line):http://http://ftp://Code: [Select]Quote you could also possibly, if there was a way to clear whats being shown on screen.....for example in c++ (just an idea) you could: Code: [Select]cout << "|"; //prints to screen system("cls"); //clear screen cout << "/"; system("cls"); cout << "-"; system("cls"); etc. between each, you could EVEN have in a timer, or sleep time of so many seconds before it turned. |
|
| 915. |
Solve : Realy stuck whid programming in VB6 (external start of the funktion)? |
|
Answer» Well i hawe trided most things but i cant seem to get it to wurk. |
|
| 916. |
Solve : c#sharpdevelop window size? |
|
Answer» How would I go about checking the mainform window size? I am wanting to write an if then state that more or LESS SAYS that |
|
| 917. |
Solve : c# sharpdevelop keydown event/ drag window? |
|
Answer» Im creating a search bar that doesnt have a button. So im figuring i NEED a keydown event to take whats in the search. How would I go about creating: |
|
| 918. |
Solve : c# sharpdevelop taglib mp3 header tags? |
|
Answer» HEY, IM trying to incorporate the the dll, taglib, known to be useful to retrieve mp3 HEADER tags. Everything is fine until I run the program, and I get this. Code: [Select]Exception TagLib.CorruptFileException was thrown in debuggee: First MPEG header could not be found. I have the code set to only effect mp3's, and the code im trying to use is. Code: [Select]string path = @"" + info.Root + "Documents and Settings\\" + System.Environment.UserName + "\\My Documents"; foreach (string str2 in Directory.GetDirectories(path)) { foreach (string str3 in Directory.GetFiles(str2)) { if (str3.Contains(".mp3")) { TagLib.File file = TagLib.File.Create (str3); //<---------says error occurs here this.libraryGrid.Rows.Add(file.Tag.Title, "", "", "", "" ); Any ideas? THANKS. |
|
| 919. |
Solve : msdos programming? |
|
Answer» more|more >>>here.http://www.perl.com/Here a little code that runs under a DOS and prompt for a operation to compute (works fine only without comas and small numbers :-/ ) UnAssembler, i am glad to see that there are still some people who know about proper programming!what is "proper programming" , by your definition. just curiousQuote from: ghostdog74 on April 12, 2008, 08:31:57 PM Quote from: Dias de verano on April 07, 2008, 03:39:58 PMUnAssembler, i am glad to see that there are still some people who know about proper programming!what is "proper programming" , by your definition. just curious Don't folks do irony where you come from? u guud at programming?? cos i got this assignment n i'm really finding it hard to solve it....... task 3...20 marks the administration staff and manager will access this system via an initial system entry screen with a PASSWORD- this will give access to a main menu screen. the main menu will provide a choice of access to the following screens: a. add /delete nurse b. update nurse details c. add nursing hours worked d. add/delete institution e. update institution details f. add request for nurse g. search available staff/ complete request h. print report (manager only) i. exit (i) using pseudocode, write the top level code for a module showing how the various screens can be accessed. note the pseudocode for add, delete, update , search, print and exit procedures is not required. (ii) Draw a flowchart for the above module in part (i) |
|
| 920. |
Solve : VB Script help? |
|
Answer» HELLO, If we want to enter some data in a text file using VBScript we use: with objectname .writeline "abcd" .writeline "efgh" but what if we want to MAKE entries in database, say an excel sheeet? what is the syntax for that? Please help. :)Thankyou.Excel spreadsheets can be ACCESSED EITHER through the Excel object (see snippet) or with an ADO connection. Code: [Select]Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.Workbooks.Add() xlApp.Visible = True xlApp.Cells(1, 1).Value = "Test value" xlBook.SaveAs "c:\scripts\foobar.xls" xlApp.Quit Where is the data coming from? Each cell: cells(1,1) is addressed with row, column coordinates. By using variables for the coordinates, it should be easy enough to READ a file and place the data in the spreadsheet. |
|
| 921. |
Solve : Java Questions? |
|
Answer» Its been about two years since I learned java BASIC's. But I dont know what complier they where using. What are some good ones?? Also if I want to use an image would it have to be an applet an would I use system.println I forgot but I have my notes to put the images in.I was able to find a complier but is that how you code an image into java? Like if i wanted it to display.You should use Sun's compiler. You get it when you download the Java SDK. |
|
| 922. |
Solve : Javascript asp's? |
|
Answer» I am not a noob!!! |
|
| 923. |
Solve : pls help me!? |
|
Answer» can someone teach me how to DISPLAY this... |
|
| 924. |
Solve : vba help? |
|
Answer» hi all, |
|
| 925. |
Solve : Programing?? |
|
Answer» Hi I would like to start PROGRAMING I have already learned Quick Basic but I'm looking a windows based beginner programing language thats easy to learn. Preferably for Windows XP, Thanks. Visual BasicPython. If you know QBASIC then learn Visual Basic. Google 'Visual Basic 2008 EXPRESS Edition download' and go to the microsoft link. |
|
| 926. |
Solve : Strangeee? |
|
Answer» I wrote a C program, I DEBUGGED it and everything, and it worked fine. Then I created the executable and when I ran it, the program behaved differently than when it was in debugging mode. |
|
| 927. |
Solve : nid help( thesis project)? |
| Answer» NID help,..i am a student,..my thesis project is sales and inventory system,...i have a problem in my Point of Sales,..my system is accepting a check for PAYMENT,..how can i handle this situation,...the payment should not reflect as a cash in the database,...YES i do that,...but how if the check is incash to the BANK,..what should i do???this is easy to all of U,..plss help me,...thanks in advance | |
| 928. |
Solve : user previliges---help? |
|
Answer» what is the concept of,..user access level in the system??i make it in VISUAL BASIC,..i do check boxes and every check box have the name of modules one's it is check the module can access by the user,....it is OK,...please give me the BEST thing in MAKING a nice way of user access level forms |
|
| 929. |
Solve : c++ win api questions? |
|
Answer» im learning c++ win api.....and trying to add nodes to the treeview box it created.......this is what i have so far more or less: |
|
| 930. |
Solve : Problem with .vbs cutting off words? |
|
Answer» I have a script that I am working on for my internship. What it does is it searches the hard drive for GIVEN file names, and then if it FINDS the file names, it deletes the folder. Well the only problem is that if the filename is under a folder like C:\windows or C:\program files I don't want it to delete the entire folder, just the folder names and the individual files I list. CURRENTLY I am working with this code a few WScript.Echo things might be missing, but it is mostly complete. Maybe I'm just tired but I can't for the life of me see where the literal ">folder to delete" is generated. On the other hand you may actually have folders with those names. Could you point out where that message originates? realized what it was, I took 1 character off of the string for the ENDING / that was never there because I copied and pasted from below. Would that make this line look something like this Code: [Select]strFolder = Left(objFile.Drive & folderPath, Len(objFile.Drive & folderPath) - 1) Code: [Select]strFolder = objFile.Drive & folderPath Yeah, that works. Nice thing about VBS is you can use unnamed objects to slice and dice data without ever changing the underlying source data. Quote from: Sidewinder on April 24, 2008, 04:33:55 PM Yeah, that works. Nice thing about VBS is you can use unnamed objects to slice and dice data without ever changing the underlying source data. Not unique to VBS by any means. |
|
| 931. |
Solve : Batch scripting help? |
|
Answer» I'm trying to write a batch file that will display a list to the user, have them enter their choice, and then do something. Here's what I have now: echo %errorlev%' always prints 1. There is a reason for this. Errorlevel 1 means "errorlevel 1 or greater" so the test will always be true, so gotos are needed if 3 or 2 are chosen @echo off echo 1. BL (main) echo 2. BL (sound) echo 3. MS-DOS choice /C:123 /N if errorlevel 3 goto choice3 if errorlevel 2 goto choice2 if errorlevel 1 goto choice1 :choice3 echo you chose 3 goto next :choice2 echo you chose 2 goto next :choice1 echo you chose 1 :next Sorry, I had a brain malfunction... Reverse the order of the IF statements to be 1 2 3 not 3 2 1 Here's another version with a couple of embellishments: Code: [Select]@echo off cls echo. echo. echo 1. BL (main) echo 2. BL (sound) echo 3. MS-DOS echo. echo. choice /C:123 /N " Enter your choice..... " cls if errorlevel 1 set errorlev=1 if errorlevel 2 set errorlev=2 if errorlevel 3 set errorlev=3 echo. echo. echo Return Code = %errorlev% Hope that fixes it.Great, that worked. Thanks!You're welcome & again sorry about giving you FALSE INFO to start with. Good luck |
|
| 932. |
Solve : Help with easy programming project? |
|
Answer» Hello, my name is Angel, and I'm currently in a class at the UNIVERSITY of Phoenix. This will be my first experience with programming, so I am not very knowledgeable in this subject. (I need how to write a program for dummies) My assignment today is to list the application-level requirements for a currency conversion program Can somebody please help me get this info down. As a general PRINCIPLE we do not do HOMEWORK. Suggest you approach your tutor. Good luck So the university of Pheonix is real??? I LIVE in Australia and have been recieving SPAM emails weekly from them. U get me off their mailing list and ill do your homework |
|
| 933. |
Solve : Automated creation and naming folder on the fly by using batch program? |
|
Answer» Hi all, |
|
| 934. |
Solve : Novice: How do I control a stepper motor with a rs232 port interface? |
|
Answer» I have a step motor with rs232 communication. I know c++ , but programmed only in CLASS years ago, I have no experience with visual basic. The sw I have is Vstudio 6 with Vbasic and Vc++ student edition from quite a while ago, I don't know if downloading the new express edtions are any better for a novice to work with. For now, I woudl just like to see the freaken motor move lol! Looking for the most vanilla procedure in C++ and/or Visual Basic. I hear VB is easier to use? Any help appreciated. I want to Configure Ports Move motor Seria Port Settings: I. configure serial port •Baud Rate: 38400 •Parity: None •Data Bits: 8 •Stop Bits: 1 •Flow Control: none 'Here is the command to move motor 500 counts: but how do I pass this command to motor? II. Send index to motor: "@0N1_500” & Chr$(13) I'll get this later but first, I want to see the motor move. III. loop ‘where 0=address,N=Index Command 500=IndexTravel chr$(13)=carriage rtn For count = 0 to 4449 ‘Set Direct = cw "@0+” & Chr$(13) ‘Move Motor * Index Number - move motor up position "@0G1” & Chr$(13) ‘Set Direct = ccw‘ "@0+” & Chr$(13) ‘Move Motor * Index Number – move motor down position "@0G1” & Chr$(13) Count = count+1 write (count, pc date & TIME) stamp to text file Next Count Brief overview of cammands and a very brief VB code, but I just get errors if I try to perform anything, I don't really know anything much about the structure of VB: N - Index Number Format: N#_[value] - where # is the motion profile number 1 or 2 Sample: N1_10000 Index number of profile 1 equals 10000 Description: This command sets the number of pulses to index for the motion profile. This value must be set before motion begins. These values are saved in the EEProm for stand-alone use. Range: 0 - 8,388,607 Unit Selection In order to select a unit the @ command followed by 0 (address of the unit) must be sent. NOTE: There should be no spaces between the @ and the 0. How to select the unit: @0 (Unit is selected) How to get a response from the unit: @0$ (Carriage Return) After the $ command, the pulse generator will return a SMSI30 + the current version number. Note: In direct talk mode each command is followed by a carriage return. The unit communicates in half duplex mode, therefore proper setup of hyper terminal is necessary to view characters, if characters are to be echoed back to the screen. Instructions All instructions require that no spaces be sent between the command and the parameter followed by a carriage return. The commands are also case sensitive and are all sent as capitals. Command Summary: A - Acceleration/Deceleration B - BASE Speed G - Go (Index) H - Hard Limit M - Max Speed N - Index Number R - Microstep Resolution S - Soft Limit T - Complete Time V - Verify + - Clockwise Direction - - Counterclockwise Direction $ - Version Number Register ! - Error Codes Register % - Verify Controller Address ~ - Set Controller Address Visual Basic Direct Mode Programming Example This Example is for Axis=0, and Profile=1 DimConst DefaultTimeout As Single = 0.5 frmMain.MSComm1.Output = "@0A1_100000. & Chr$(13) .Set Acceleration Pause DefaultTimeout frmMain.MSComm1.Output = "@0B1_1000. & Chr$(13) .Set Base Speed Pause DefaultTimeout frmMain.MSComm1.Output = "@0M1_4000. & Chr$(13) .Set Maximum Speed Pause DefaultTimeout frmMain.MSComm1.Output = "@0N1_500. & Chr$(13) .Set Index Number Pause DefaultTimeout frmMain.MSComm1.Output = "@0T1_100. & Chr$(13) .Set Complete Time Pause DefaultTimeout frmMain.MSComm1.Output = "@0R8. & Chr$(13) .Set Microstep Resolution Pause DefaultTimeout frmMain.MSComm1.Output = "@0+. & Chr$(13) .Set Direction CW Pause DefaultTimeout frmMain.MSComm1.Output = "@0G1. & Chr$(13) .Start the Index Pause DefaultTimeout Wadzilla, you are making things far to difficult, and you want instant results. I tried to work with this RS232 communications, but that stuff is enough to drive anyone nuts. Here are some basics to get things going, but maybe this is not what you want: -Use VB for programming and Excel for layouts, Binary values etc. -Download InpOut_32 dll and write a few VB Procs. -Dissect an old CD drive, it has mostlikely a 3 phase and a 4 phase Bi-Directional stepper motor. The 3 phase is more interesting and more difficult to get the correct Sequences. -Use LPT1 port and Printer cable and use pin D0 to D7 and pin #25, using InpOut_32 to which you need to pass 4 (step) Binary values for a 4 Phase or 9 (step) Binary values for a 3 phase. -Search the Internet, after a few 100 pages you will have collected dozens of of sample diagrams, and electronics to buy. -Be prepared to blow your power supply if you don't send the proper binary values to the LPT1 port, or incorrectly hook-up things. -For fun you can add an old Analog Joystick to control your treasure (an other dll download is required). Now, isn't this a giveaway? The motor is fullt integrated already has a rs-484 interface built in (I have a rs232 to RS485 converter) and it has to run for 600,000 rotations = 800 up/down cycles in a 120 degree environment to pass a reliability test. The Motor also has a language set of 16 commands. I was pretty much told that it has to work with this interface directly to a laptop.. Here is it's user guide: http://www.anaheimautomation.com/manuals/L010273%20-%2023MDSI%20Series%20Users%20Guide.pdf Wish I could do it as a leisure hobby but part of a larger project |
|
| 935. |
Solve : Quick Over view of my code for errors please? |
|
Answer» I believe I have this finished, but I just want to make sure that I didn't make any stupid mistakes that are not easy for me to spot, as I don't really know vbs. thanks for looking and I hope I did everything correctly. But this script is going to be used in a major school system and only having to reimage like 1 out of every 15 or 30 computers isn't bad compared to the original plan which was reimage each computer If the alternative to the script is a re-imaging, then go for it! If it fails, you do the re-image, tweak the script and move on. If it works you'll be a hero. Good luck. Just curious, but aren't there ways to prevent students from installing software on school computers?its not really installing, what they are doing is copying files over, then logging off. Once that is done everybody can play the game, except it can't be deleted as the owner has "changed" according to Novell and the only ones who can delete the files are administrators and most don't have the time to go and clean each computer. So this way, they can log in on an entire lab, run this script and call it a day. But to make their life more difficult, I am going to ask if they want to SHOW the owner of a file. Now I am running this test Code: [Select]if (showName == "yes") OR showName == 'y' OR showName == 'Y') Then WScript.Echo "Yes" Else If (showName == "no") OR showName == 'n' OR showName == 'N') Then WScript.Echo "No" End If But there is a syntax ERROR and I am not sure. It says like 14 (first line shown) column 15 which is the second = sign. Now I could probably open a new topic, but its the same general concept here. I made a mistake and am not sure what it is. and that line that you highlighted was from your original code. I left that part intact. I trust that part.At first I thought I was looking at batch code. Code: [Select]If (showName = "yes" OR showName = "y" OR showName = "Y") Then WScript.Echo "Yes" Else If (showName = "no" OR showName = "n" OR showName = "N") Then WScript.Echo "No" End If End If The code aligns better in an editor than in the forum. ya i learned, fixed my program on my own and turned it in. Thanks for your help my "boss" i say that loosely was really pleased with how it works. I added a question in the batch that says display file owner and it works like a charm. |
|
| 936. |
Solve : I need one program.? |
|
Answer» Hi all, |
|
| 937. |
Solve : Active directory script? |
|
Answer» hello, i need a script that will open an active directory users and COMPUTERS mmc. how can i do this?On a SINGLE computer? On a network? What kind of operating system or network environment? Have you attempted to WRITE ONE? |
|
| 938. |
Solve : Batch file - How to process multiple arguments?? |
|
Answer» Hello, |
|
| 939. |
Solve : Copier Batch File? |
|
Answer» Ok, I recently made a batch file to copy files from my hard drive to my flash drive but I need a possible way to save and import a text letter so I only need to put the drive letter in once. @echo off tr.bat Quote @echo offThanks man! It should work but I forgot something: In the first batch in this command line: Quote cd C:\Program Files\loggerOk, the text in the blue is the problem. It won't read Program Files correctly as it needs _ in place of a space. But I can't change it without messing up other programs. Is there a macro (example %time%, %username%) for Program Files that will shorten it?Quote from: HypercamJ on May 04, 2008, 05:32:45 PM It won't read Program Files correctly as it needs _ in place of a space. What do you mean? You have a folder called Program_Files? Or you didn't know about quoting paths with SPACES like this "C:\Program Files?" Or you never heard of %ProgramFiles%? Or none of these? |
|
| 940. |
Solve : Manifest file Information? |
|
Answer» MANIFEST’s files are created by DEFAULT during linking in VS 2005. Is the creation of these mandatory? These manifest FILE’s are not created in some cases, any ideas what is the REASON for this? |
|
| 941. |
Solve : C++ and Java acquaint? |
|
Answer» I am starting UNIVERSITY next year and will be doing C++ and Java. Can anyone suggest ways I can get better acquainted with them to GIVE me a head start, and what programs would I write them in as I'm not really sure how it WORKS? |
|
| 942. |
Solve : GUI's in C? |
|
Answer» I am not a noob!!! |
|
| 943. |
Solve : Windows programs in "C"? |
|
Answer» At the moment I'm trying to create some WINDOWS programs in "C"(not C++, clear C). I mean not console applications, but windows programs. Could you recommend me some e-books or other sources that may help me...?www.freecomputerbooks.com |
|
| 944. |
Solve : Expression Evaluator (what features would YOU want?)? |
|
Answer» OK first off: The answer IS NOT using the Microsoft ScriptControl! I don't WANT to use that! The goal is a custom built Expression Parser/Evaluator. using curly brackets, as in {1,2,3}. Those are called 'braces.' I think it's a good project.thanks! I kind of got the algorithms and stuff down pat since I had to write it twice. My first one was just a MODIFICATION of an existing library, but then my working USB drive failed. I still had it and was working of my E:\ backup drive, and went to flash my CD burner's firmware, woops! sent it to the HD! Thankfully since I got to redesign it from scratch I actually KNOW what is going on in the code (most of the time), and I managed to implement something that was impossibly kludged in my first version, plugin-managed operators. Then I found the old library on my Laptops Hard Drive. There is a problem though, I've simply added too much! I can't keep track of all the "progress points",(what I have to do in separate "domains" of the code) I already have a configuration dialog that shows a tab for each plugin, and loads a Custom Control that that plugin designated it's Settings Page- the dialog itself looks polished, but the controls I made are kind of elementary, almost seem like a tech demo. This project has been in the works for 2 years, and the original one 6 years. Quote from: Aegis on May 08, 2008, 12:03:24 PM Quoteusing curly brackets, as in {1,2,3}. I had the name on the tip of my fingers as I typed! I couldn't remember the name though, so I just stuck in what they looked like. One thing that might cause people to avoid it: It's programmed in VB6. I attempted a .NET conversion, but that will have to wait- I've written it twice already. I think I'll freeze new features until I can iron out the bugs (all known bugs are in GUI code, not surprising to me), and release it with a "calculator" program. At some point I'll use it for it's intended purpose of a graphing program (again my second one- my first versions are always monolithic and full of gross hacks and kludges). That will be interesting, pair the features of the parser with a 3-D Z= graph. |
|
| 945. |
Solve : please HELp me with this project? |
|
Answer» hi every body |
|
| 946. |
Solve : how to view database data in data grid view? |
|
Answer» Hi everyone, |
|
| 947. |
Solve : Creating an interactive menu in JAVA? |
|
Answer» Hey, I'm trying to create an interactive menu in JAVA and I can't FIGURE out if it's even possible. |
|
| 948. |
Solve : NSIS Installer? |
|
Answer» Im not how into using NSIS are the people here but im having a problem... Im creating a software for a newly developed application and i cant get the background of the software that was given to me to show throughtout the entire installation. It only shows when installing and i dont want that. The script for the Background image is highlighted. |
|
| 949. |
Solve : how to make softwares work on more that 1 system.? |
|
Answer» hi everyone, |
|
| 950. |
Solve : Permission Batch file? |
|
Answer» GOOD Day, I am running windows XP Professional in an active directory environment. On each computer I have a t:\ drive which is used to allow students and faculty to save there work while the other area of the computers are frozen with a program called deep freeze. what I would like to do is right script VBS or Batch file that would give the everyone group read and write permission to the t:\ drive. any one have any advice . THANKS for your help Well, you can try use some "hidden" commnads in CMD - I have only ued them once, and that was to set J:\ to be like a ROM drive I can't remember where I found it....Quote from: Ryder17z on May 14, 2008, 11:03:04 AM Well, you can try use some "hidden" commnads in CMD - I have only ued them once, and that was to set J:\ to be like a ROM drive That's such a very helpful reply! I've gotten this to work on my computer, but I'm not 100% sure if it is what you want: Code: [Select]Echo Y| cacls %1 /t /e /c /g %2:F place in a batch file, and call that batch file like so: Code: [Select]batch <folder> <username> in your case would be "everyone". two reasons I think it doesn't meet your requirements: - it PROCESSES files, not the entire drive -it also seems to only work with the files in the ROOT dir (when given a root dir) I'll use my physic powers: T:[$TEACHERS$], J:[CLASSES], W:[WINOLDAP] and more was I right? do I win a cookie? |
|