

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.
1951. |
Solve : I want to look at the source code for calculator.? |
Answer» ...for windows. Can I do this? I'm curious to see what it looks like. But, don't I have to download a special program to view this code?Quote from: Doug on April 26, 2010, 09:00:10 PM ...for windows. Can I do this? I'm curious to see what it looks like. But, don't I have to download a special program to view this code? You can't view the source code. but you can dissassemble it. Calculator, like most of windows, was written in C/C++; the C/C++ is translated to machine code by the compiler; all that is left in the result is machine code, no trace of the source. If you REALLY want to see the source you could try to get a development job WORKING at Microsoft. The nest best thing is the disassemble it. while debug is included with most Windows installations, I was unable to automate the disassembly and make it display the whole problem. a better idea is to download the windows SDK (don't worry, that one will still work with XP) and use the "dumpbin" tool. Once you have it installed, issue the following command at the prompt: Code: [Select]dumpbin /disasm %systemroot%\system32\calc.exe >> calc.asm this will dissassemble the file to calc.asm. you can now peruse calc.asm at your leisure, but unless you have some experience with assembly it will just look like a mash of numbers and a few instruction names. Quote from: Doug on April 26, 2010, 09:00:10 PM ...for windows. Can I do this? I'm curious to see what it looks like. But, don't I have to download a special program to view this code?calc.exe is closed source. you can't really look at it. A calculator can be easily done with a programming language. Most programming language already is capable of doing maths. What you just need is to learn how to do up the GUI INTERFACE. Then tie each button you create to do arithmetic at the back end. here's something. try to turn HTML into vb. go to javascriptkit.com and look for graphical calculatorIt's quickly gotten over my head. I was hoping by seeing something small and simple like calculator that maybe I could get some insight into windows. There was a learning version of calc that looked like calc. It was bundled with a version of Visual Basic. Here is one that looks like how I remember it. http://groups.engin.umd.umich.edu/CIS/course.des/cis400/vbasic/vbcalc.html |
|
1952. |
Solve : Please, help me with OpenGL and textures...? |
Answer» This C++ OPENGL program: texture.zip should DRAW a texture, but all I get is a white rectangle. What am I doing wrong? Thanks.Nevermind, I figured it out. |
|
1953. |
Solve : Visual C#: Can't figure out array of picture boxes!? |
Answer» I've been trying to figure this out for days and can't get it. I've tried looking up on google how to do it but nonetheless, I can't seem to find a solution that works. |
|
1954. |
Solve : Help with some questions about batch/vbs.? |
Answer» Hello everyone! [emailprotected](James Smith);[emailprotected](James Smith);[emailprotected](James Smith);[emailprotected](James Smith); You can use this little script to extract the student names from your data file: (just don't tell me all the students are named James Smith) Code: [Select]Const ForReading = 1 Const ForWriting = 2 Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("C:\temp\ch.txt", ForReading) 'Change input file label Set objRegEx = CreateObject("VBScript.RegExp") objRegEx.Global = True objRegEx.Pattern = "\(+[A-Za-z ]+\);" strSearchString = objFile.ReadAll objFile.Close Set objFile = objFSO.OpenTextFile("c:\temp\Test.txt", ForWriting, True) 'Change output file label Set colMatches = objRegEx.Execute(strSearchString) If colMatches.Count > 0 Then For Each strMatch in colMatches objFile.Write Mid(strMatch.Value, 2, Len(strMatch.Value)-3) & vbCrLf Next End If objFile.Close If you need the email address, the regex pattern can be tweaked. Batch code has the findstr command but the regex options are limited although the one in the script is about as simple as they come. Save the script with a vbs extension and run from either the command prompt or within a batch file as: cscript //nologo scriptname.vbs Good luck. Quote from: The_Valkyrie on APRIL 29, 2010, 06:59:01 AM so 34+ views and no help................... This kind of post is, in general, a bad idea.Quote from: Sidewinder on April 29, 2010, 11:15:24 AM I'm not understanding the question. The batch file does not seem to match your original post.The bat has been tweaked out of boredom, but the original script is: for /f "tokens=1-3 delims=() usebackq" %%a in ("%userprofile%\Desktop\student_name.txt") do @mkdir C:\test\%%b_%%c This allowed me to take the formatted file and create the folders. But thank you tons Sidewinder. (haha and no, all the students are not named "James Smith") |
|
1955. |
Solve : Calling user input results in vbs?? |
Answer» Hi, I'm making a web 'client' through vbs, but i'm having problems with the code syntax. Here's the code: |
|
1956. |
Solve : Get open windows vb? |
Answer» I need help. please tell me an api to get all open windows. it is urgent(not really) i use vb 2008 expressQuote from: BC_Programmer on April 28, 2010, 04:43:13 PM EnumWindows()it does NOT workQuote from: glaba on April 28, 2010, 04:49:30 PM it does NOT work works fine for me. Code: [Select]Module Module1 Delegate Function EnumWindowsProc(ByVal HWND As Integer, ByVal lParam As Integer) As Integer PRIVATE Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Int32) As Int32 Private Declare Function GetWindowTextAPI Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32 Private mPendingList As List(Of Integer) Private Function EnumWnd(ByVal hWnd As Integer, ByVal lParam As Integer) mPendingList.Add(hWnd) Return 1 End Function Public Function GetTopLevelWindows() As List(Of Integer) mPendingList = New List(Of Integer) CALL EnumWindows(New EnumWindowsProc(AddressOf EnumWnd), 0) Return mPendingList End Function Private Function GetWindowText(ByVal hwnd As Int32) As String Dim retstring As String = Space$(32768) GetWindowTextAPI(hwnd, retstring, Len(retstring)) Return retstring.Replace(vbNullChar, "").Trim() End Function Sub MAIN() Dim windowhandles As List(Of Integer) = GetTopLevelWindows() Dim currtitle As String For Each currhandle As Integer In windowhandles currtitle = GetWindowText(currhandle) If currtitle.Length > 0 Then Console.WriteLine(currtitle) Debug.Print(currtitle) End If Next End Sub End Module Edited- added FindWindowsLike() and FindWindowsLikeRegExp()... Code: [Select]Imports System.Text.RegularExpressions Module Module1 Delegate Function EnumWindowsProc(ByVal hWnd As Integer, ByVal lParam As Integer) As Integer Private Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Int32) As Int32 Private Declare Function GetWindowTextAPI Lib "user32.dll" Alias "GetWindowTextA" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32 Private Declare Function GetParent Lib "user32.dll" (ByVal hwnd As Int32) As Int32 Private Declare Function GetDesktopWindow Lib "user32.dll" () As Int32 Private mPendingList As List(Of Integer) Private Function EnumWnd(ByVal hWnd As Integer, ByVal lParam As Integer) If lParam <> 0 Then If IsTopLevelWindow(hWnd) Then mPendingList.Add(hWnd) End If Else mPendingList.Add(hWnd) End If Return 1 End Function Private Function IsTopLevelWindow(ByVal HwndTest As Long) As Boolean Return GetParent(HwndTest) = 0 OrElse GetParent(HwndTest) = GetDesktopWindow() End Function Public Function GetTopLevelWindows(Optional ByVal OnlyTopMost As Boolean = True) As List(Of Integer) mPendingList = New List(Of Integer) Call EnumWindows(New EnumWindowsProc(AddressOf EnumWnd), OnlyTopMost) Return mPendingList End Function Private Function GetWindowText(ByVal hwnd As Int32) As String Dim retstring As String = Space$(32768) GetWindowTextAPI(hwnd, retstring, Len(retstring)) Return retstring.Replace(vbNullChar, "").Trim() End Function Public Function FindWindowsLike(ByVal LikeString As String, Optional ByVal OnlyTopMost As Boolean = False) As List(Of String) Dim foundwindows As List(Of Integer) = GetTopLevelWindows(OnlyTopMost) Dim loopwindow As Int32, wndtext As String Dim returntitles As New List(Of String) For Each loopwindow In foundwindows wndtext = GetWindowText(loopwindow) If wndtext Like LikeString Then returntitles.Add(wndtext) End If Next Return returntitles End Function Public Function FindWindowsLikeRegExp(ByVal LikeString As String, Optional ByVal regexoptions As RegexOptions = Text.RegularExpressions.RegexOptions.IgnoreCase, _ Optional ByVal OnlyTopMost As Boolean = False) As List(Of String) Dim foundwindows As List(Of Integer) = GetTopLevelWindows(OnlyTopMost) Dim loopwindow As Int32, wndtext As String Dim usereg As Regex Dim returntitles As New List(Of String) usereg = New Regex(LikeString) For Each loopwindow In foundwindows wndtext = GetWindowText(loopwindow) If usereg.Matches(wndtext).Count > 0 Then returntitles.Add(wndtext) End If Next Return returntitles End Function Sub Main() Dim windowhandles As List(Of Integer) = GetTopLevelWindows(True) Dim currtitle As String Console.WriteLine("Enumerating all top-level windows...") For Each currhandle As Integer In windowhandles currtitle = GetWindowText(currhandle) If currtitle.Length > 0 Then Console.WriteLine(currtitle) Debug.Print(currtitle) End If Next Console.WriteLine("finding windows like ""A*""...") Dim windowslike As List(Of String) = FindWindowsLike("A*", True) Console.WriteLine("Found " + Str(windowslike.Count) + " matching items...") For Each LoopTitle As String In windowslike Debug.Print(LoopTitle) Console.WriteLine(LoopTitle) Next End Sub End Module |
|
1957. |
Solve : findwindowlike vb 2008? |
Answer» how do i USE findwindowlike in a recent version of vb how do i use findwindowlike in a recent version of vb stick to a single THREAD on this subject please. |
|
1958. |
Solve : Hate? |
Answer» Just would like to SAY I hate programming because: Just would like to say I hate programming because: Well... If you don't like doing that, then I would suggest that you buy some books. Better yet, take some classes. Good luck!JJ, I've already studied 5,5 years of programming and my closet is filled with fat 600 page books on programming from top to bottom. I'll just review them. =) Problem is time. ^^ Yes, time. Have to make a game and 2 months left. Huge stress. Got to make analysis charts, plan stuff, make OO classes, qsmkfdjqsmldfjqlkmsjfskljf. k. Actually, to help you understand my frustration, let me just illustrate this: Imagine if you had any QUESTION or problem with your studies and everyone you asked, co-students included, tells you to go f* yourself and that you ask dumb questions. How would you feel, all alone, frustrated on your heaps of debugging errors? Yeah. Quote Imagine if you had any question or problem with your studies and everyone you asked, Even your teachers? What SCHOOL is that?Well, the professors generally don't answer to my questions on the college forums. I was lucky once, last year, a prof who was really interested in what he taught. He even wrote a book on programming. He answered most of my questions. This happens in some colleges. You post on the forum, you wait. No one answers, no one cares. Well, the profs generally don't have the patience to go figure out some debugging that you should do in the end. rofl... Also the co-students: very selfish. Ever been in a all-math-people class? Those are some real arrogant ego-people. I'm also referring to IRC.Quote from: Treval on April 14, 2010, 03:34:21 PM Well, the professors generally don't answer to my questions on the college forums.You really take your teahers for granted, don't you? How many students do you think your teachers have daily? I am in highschool, where I bet they have smaller classes than yours, my teachers have about 100-120 students. So, think about how long it would take to mark all that homework? Teachers don't often have free time, be thankful some take the time to ASSIST a few people with their issues. And if someone has an obvious issue, it takes ten seconds (or less) to type out: Your program has issues at lines 1, 27, and 35. Programming is not that easy. It often involves deep rooted, sequential, layered logical errors. Especially in big programs. =PTreval, you seem to be tied up in many languages. How about sticking to just one for a while, like the one you're writing your assignment in. When you have free time, continue expanding your knowledge of only one. If it bothers you that much, as it seems to be indicated in other threads you've posted, then it's not worth it.. This topic was named, "HATE", for crying outloud..Rofl. Yeah. I'm sticking to one language though.. which is C# and the XNA Framework. It's just frustrating that one has to deal with his own problems of programming. You know what, the guys over at medicine (the doctors, yeah) they are the luckiest. If you see their discussion boards, it's filled with information and essays and everything, of thousands of contributing students. I just happen to be in the 'asocial outcasts' sector. Rofl. I'm just frustrated also because I've forgotten like 90% of C# which is a painnnnnnnnn and I have to master a new framework in a very short amount of time (2 months left). I'm going crazy every day (ok not every day lol). Anyway, I guess I'll just start reading my book again and read up on as much info as I possibly can. There's a lot of hard work ahead.. (Also frustrating is working on something as simple as a self-made dialog box system (yeah it's harder than it sounds) and being stuck on it for an entire week (which is pretty much untolerable for project progress)). I'm gonna do my best!!! lol. Quote from: Treval on April 14, 2010, 04:56:30 PM
Because your trying to learn too many things.. cut back When I learn, I stick to a schedule, although I deviate from that schedule at times, because my curiosity cannot resist.. So far in my experience with computers, I've stuck with the things I consider the highest priority. Like Windows for instance. It's the dominant operating system in the world, and the one I'm most likely to encounter when helping someone. I've chosen to put off Linux/MAC until I have a solid understanding of Windows and it's functions... Yes, Windows and a thorough understanding of hardware and Network basics. These things I've stuck to exclusively, priming myself up for learning programming, which I have finally started, recently.. Bottom line is, priority. My priorities just happen to be as described above.ahh, this is that game assignment is it not? Treval, why not ask the questions in the programming forum here? |
|
1959. |
Solve : helped needed with .BAT? |
Answer» Quick intro: HELLO, my name is jory 18 years old and doing an Education in the netherlands |
|
1960. |
Solve : help .bat -> MySQL? |
Answer» Hi there, FOR %%f IN(*.sql) DO SQLCMD -S %1 -d %2 -U %3 -P %4 -I -i "%%f" A bit of hax-tips if you ask me, use it for good not evil... lol |
|
1961. |
Solve : Data base (SQL) online course? |
Answer» Hello guys |
|
1962. |
Solve : help with C++ code? |
Answer» The advantage of 2x3i5x's version is it is actually C++, not C pasted into C++. Thanks, 2x3i5x @ 2x3i5x |
|
1963. |
Solve : Perl cardiac computer emu'? |
Answer» [emailprotected]:~/Desktop/cardiac$ PERL pe.pl Can't locate Tk.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at pe.pl LINE 4. BEGIN failed--compilation aborted at pe.pl line 4. [emailprotected]:~/Desktop/cardiac$ what is WRONG with the perl program source of program http://dale-miller.com/cardiac-cardboard-illustrative-aid-to-computation/ [recovering disk space - old attachment deleted by admin]your missing the perl/tk module, or more precisely, it hasn't been part of the default perl install for a while. try installing the module through CPAN: Code: [Select]cpan -i Tk you might need to run that as root: Code: [Select]SUDO cpan -i Tk That might not work though- CPAN sometimes has issues and reports errors, in that case, you can do it the "hard" way: download the archive straight from CPAN: http://search.cpan.org/CPAN/authors/id/S/SR/SREZIC/Tk-804.028.tar.gz Extract/untar and enter the DIRECTORY, and run the following: Code: [Select]perl Makefile.PL make make test make install |
|
1964. |
Solve : help with java pragram? |
Answer» i am USING eclipse to make my java program and it is showing me some errors. i try to fix them but it STILL shows errors. |
|
1965. |
Solve : Problem with build.xml file? |
Answer» The ant jar file is included in sub-project and its used only within this sub-project, But it giving the error : nested exception is java.io.FileNotFoundException: class path resource [org/apache/tools/ant/types/Path.class] cannot be opened because it does not exist If i copy the jar file in master project it WORKS fine. but it need not to be added in master project as it is used only within sub-project. Please comment and help to find solution. ThanksGot the solution of the problem . we are RUNNING a SHELL script which call all the program , so before CALLING any master or sub project we copy all the jar file at ONE common lib path , which solves the issue. Thanks |
|
1966. |
Solve : Writing a Batch File to Copy and Open File on CD? |
Answer» Quote from: Salmon Trout on April 19, 2010, 11:30:34 AM Actually you're not; if you read the code, fsutil is called once for each drive letter that exists.ONE don't normally (normal circumstances) have that much drives letters being used up , but however it that does occur, you would still NEED to go through that loop and test for each one. ie (if "Z" is really the drive letter for CDROM). I really should have said that he need to exit the loop once the CDROM drive letter is found so that he won't go through the rest of the letters.Quote from: ghostdog74 on April 19, 2010, 10:16:56 PM one don't normally (normal circumstances) have that much drives letters being used up , but however it that does occur, you would still need to go through that loop and test for each one. ie (if "Z" is really the drive letter for CDROM). My CD-ROM drive letters are X on one machine and Z on another. If 26 letters take AROUND 250 mS, why worry? Quote from: Salmon Trout on April 20, 2010, 12:16:04 AM If 26 letters take around 250 mS, why worry?well, that's fine if you are measuring against a simple task such as find a drive letter and that's all. In general if there are other intermediate tasks inside the for loop that needs to be performed, its still better to use a more efficient approach. I know, not everyone is a speed freak like me... Quote from: ghostdog74 on April 20, 2010, 01:00:45 AM well, that's fine if you are measuring against a simple task such as find a drive letter and that's all. In general if there are other intermediate tasks inside the for loop that needs to be performed, its still better to use a more efficient approach. I know, not everyone is a speed freak like me... a Speed freak that prefers interpreted languages? Quote from: BC_Programmer on April 20, 2010, 01:32:47 AM a Speed freak that prefers interpreted languages?almost what we do involves interpretation. You write a batch file, and its interpreted by cmd.exe. same as vbscript, Python ,Perl. etc. When i mention "speed freak" i am talking about doing things in the most efficient way, short of writing a real C program (or what the heck, assembly) myself. I want the power and fast development time of an interpreted language as well. got that?Quote from: ghostdog74 on April 20, 2010, 02:39:15 AM doing things in the most efficient way That phrase is capable of so many differing interpretationsQuote from: Salmon Trout on April 20, 2010, 11:04:32 AM That phrase is capable of so many differing interpretationslike?think about it. Quote from: Salmon Trout on April 21, 2010, 12:05:11 AM think about it.i have ALREADY stated my case. doing thing the most efficient way, 1) speed of development. with good data structures and ease of use of my tools, i can create programs to do my task in less than a few minutes. 2) with a good TOOL, I can have better control of the things i want to do, reducing the chances of writing redundant code. With less redundant code, my program/script will run faster. If you are not going to say what you meant, then what's your point in posting? Quote from: ghostdog74 on April 20, 2010, 01:00:45 AM well, that's fine if you are measuring against a simple task such as find a drive letter and that's all. That's what this thread is about. Quote from: Salmon Trout on April 21, 2010, 12:03:54 PM That's what this thread is about.yes, this thread is about that. But my replies all started with TC's comment on his batch's slowness, not directly meant for the OP, trueparadox. |
|
1967. |
Solve : generic programming? |
Answer» What is it ?Generic programming is a style of computer programming in which algorithms are written in terms of to-be-specified-later types that are then instantiated when needed for specific types provided as parameters. |
|
1968. |
Solve : HTML with remarks added and not showing up in HTML itself? |
Answer» How do you add remarks to a HTML document without having them interfer with the running of the HTML document itself, and/or showing up on/or in the HTML document when viewing it? pointless pollIf you don't understand the question, don't vote!MUST have just started the poll lately didn't quit know what to put in those boxes without understang the situation.Internet Explorer 6 has a puzzling bug involving multiple floated ELEMENTS; text characters from the last of the floated elements are sometimes duplicated below the last float. This bug is a real headbanger because there seems to be nothing triggering it. However, by now everyone should know that IE needs no excuse to misbehave. The direct cause is nothing more than ordinary HTML comments, such as, , sandwiched between floats that come in sequence. Apparently, the comments are HARD for IE to digest when they occupy those positions, resulting in a kind of "SCREEN diarrhea". HTML comments inside the floats do not cause the bug, nor do comments before or after the float series. Only comments residing between floats cause the bug. ========================================= windows 7 exams Seems like neither internet 6 and 7 work good any more, so I use firefox. John1397Quote from: John1397 on April 19, 2010, 07:18:06 AM Seems like neither internet 6 and 7 work good any more, so I use firefox.Yes, but everyone viewing your website might not. |
|
1969. |
Solve : Endianess dependency of package.? |
Answer» BUILD environment: Debian LENNY; POWERPC(32) GCC 4.3 gnumake g3/750 400mHz 374M RAM. Package gpart has an endianess "dependency" such that it will not build on current processor. Is there a WAY of forcing a build? |
|
1970. |
Solve : help understanding C++ code? |
Answer» This is a sample program out of a book I have (C++), demonstrating the use of the "continue" statement, in a FOR LOOP. The program asks you how many "items" you want to buy and charges 3 dollars per item, but the 13th item is free. For example, if you enter that you want 12 items, you'll be charged 36 dollars. If you enter that you want 13 items, you're still charged only 36 dollars. When you enter "14" the "total" BEGINS to increment again, and you would be charged $ 39 in that case. (EVERY 13th item is free) You could also read up on the difference between i++ and ++i. =) HAHA! I know that! Code: [Select]#include <iostream> using namespace std; int main() { int a,b,y,z; z=y=5; a=z++; b=++y; cout << a << " " << b << " " << y << " " << z; } would print: 5 6 6 6 basically, ++ or -- the variable will increment/decrement the value RETURNING it's value, so if you did something like cout << x++; it would print the current value of x and then increment it by one, whereas cout << ++x would increment it and then print that value. } I don't get the z=y=5 part. =P EEVIAC, through my own experience, I'd say take the basics book first. However it's fine how you're doing.Quote from: Treval on April 17, 2010, 11:29:09 AM I don't get the z=y=5 part. =P assignment- think of it this way: z=(y=5) of course, = is assignment, so y is assigned 5, but assignment also "returns" (as a rval) the assigned value- so 5 is returned, and then the other assignment assigns it to z. the end! |
|
1971. |
Solve : designing of operating system? |
Answer» hi |
|
1972. |
Solve : New to the concept of creation of Batch Files? |
Answer» Hi all, Hi all, if you REALLY want to learn about batch, you can SEARCH google for references. there are plenty. this is just one of them. However, SINCE you are just starting, my recommendation is to try to learn a programming language such as Perl or Python. They can do what batch can do and a lot more that batch can't do (easily). |
|
1973. |
Solve : The XNA thread? |
Answer» I really, really need help with this framework because I'm doing my final on it. =P So I'll ask questions here whenever needed! Here's my first: 1) Does one really need to use XNA's pre-built methods such as LoadContent(), Initialize(), UnloadContent(), to simply draw SOMETHING on the screen? Sure, you need a spriteBatch, which needs a GraphicsDevice, but can't I just throw in all needed variables in one line without using these methods? Here's something strange: Code: [Select]public General() { GraphicsDeviceManager graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; sprites = new SpriteBatch(GraphicsDevice); } Why is my compiler complaining that GraphicsDevice is null? woah, XNA is certainly one of those new, complex things... give me a little while to learn about it, then I'll see if I can be any help. I've heard a lot about XNA and it's about time I see what it's all about. Also, it might help in my quest at making a version of one of my games in a .NET language. And of course I can't really help unless I learn it, right? ATM, I don't really know what you're doing in that code segment; I assume "GraphicsDevice" is either a global static in XNA or defined elsewhere? It's certainly not being set here. (you didn't mean to use new SpriteBatch(graphics), did you?)... OK, got XNA working. From what I can gather, you aren't supposed to initialize the sprites and so forth in the constructor, but rather in the "loadcontent" routine. Actually I just opened the template This is the template it gave me; it doesn't do anything, but it doesn't crash. THis was with XNA 3.1 and Visual Studio 2008: Code: [Select]using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; namespace mygame { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <summary> /// Allows the game to run logic such as UPDATING the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing VALUES.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here base.Update(gameTime); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); // TODO: Add your drawing code here base.Draw(gameTime); } } } Rather hefty... But here's the kicker- as you may have read, XNA is based on DirectX.... well, I've used DirectDraw and Direct3d 7 and 8 from VB6, and a lot of the basics here look pretty similar- they just have a helpful framework (XNA) that makes the whole process a lot easier. For example, I wanted to actually Draw something, something fun an interactive! the goal was simple- this is my first ever use of XNA, so I decided, to simply draw a string. I immediate dove in- the SpriteBatch had a "DrawString" method that looked suitable. but it needed a SpriteFont! No problem, let's see if new SpriteFont() works... Nope, it doesn't have any constructors. So I made a quick google for SpriteFont, which led me to a article about how to draw text: http://msdn.microsoft.com/en-us/library/bb447673.aspx This explained that I needed to add a "SpriteFont" item to my "Content" Area. Fair enough, I figured. So I did so; in the interest if using my favourite font, Consolas, I called it Consolas and changed the name appropriately as well. Now, I assumed that the stuff in Content was being loaded by the suitably NAMED "LoadContent()" routine that the template had already created for me, so I created a class level SpriteFont variable, which I named Consolas, and then added this to the LoadContent() routine: Code: [Select]Consolas = Content.Load<SpriteFont>("Consolas"); then, in the Draw() routine I added: Code: [Select]spriteBatch.DrawString(Consolas, "Test string", new Vector2(50, 50), Color.Black); Oh the excitement! ATM I have this, which changes the background and moves the text as you move the mouse around the window: Code: [Select]using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.GamerServices; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using Microsoft.Xna.Framework.Media; using Microsoft.Xna.Framework.Net; using Microsoft.Xna.Framework.Storage; namespace mygame { /// <summary> /// This is the main type for your game /// </summary> public class Game1 : Microsoft.Xna.Framework.Game { GraphicsDeviceManager graphics; SpriteBatch spriteBatch; SpriteFont Consolas; Color mBackColor; int mmouseX, mmouseY; public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; } /// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here base.Initialize(); } /// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); Consolas = Content.Load<SpriteFont>("Consolas"); // TODO: use this.Content to load your game content here } /// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { // TODO: Unload any non ContentManager content here } /// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { // Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed) this.Exit(); // TODO: Add your update logic here UpdateMouseData(); base.Update(gameTime); } protected void UpdateMouseData() { MouseState current_mouse = Mouse.GetState(); // The mouse x and y positions are returned relative to the // upper-left corner of the game window. mmouseX = current_mouse.X; mmouseY = current_mouse.Y; // Change background color based on mouse position. mBackColor = new Color((byte)(mmouseX / 3), (byte)(mmouseY / 2), 0); } /// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(mBackColor); spriteBatch.Begin(); spriteBatch.DrawString(Consolas, "Test string", new Vector2(mmouseX, mmouseY), Color.Black); // TODO: Add your drawing code here spriteBatch.End(); base.Draw(gameTime); } } } I have to say... I was doubtful but XNA really is awesome, and it's easy too... at least it is if you've worked with DX before YES... that's correct. If you've worked with DirectX before. =P I've been since september working on XNA and I know just about as much as you did in one day. LOL! Yeah. No, I've never worked with XNA. A lot of veteran programmers think XNA is a piece of cake. Well, not for me, even though it has all pre-built methods and classes in the framework. Here's a nice starter's game you can make: XNA 2D space invaders Have fun making it. =P |
|
1974. |
Solve : Blackberry App help!? |
Answer» Hi, I just CREATED my very first APP for my Blackberry Pearl 8100. It is a very simple "Helloworld" app that will obviously, just display the phrase, "HelloWorld!". I was able to find it in the Options/Advanced Options/APPLICATIONS list, but I cannot find it in the main menu where all the other applications and icons are. I'm pretty sure I just forgot to do something. What I did was first, created the JAVA program with Eclipse, then used javaloader.exe in command prompt to load the .cod and .jax file, then used Blackberry Desktop Manager 5. something to do the actual installing of the app, but in the app list is the only place where I can find it. Any help is greatly appreciated. THANKS |
|
1975. |
Solve : for vs foreach? |
Answer» When would one use for and when foreach? What are the pros and cons for each of these CONDITION structures? foreach enumerates through a collection faster then using for and accessing that collection by index. for is for looping when you KNOW the STARTING and ending CONDITIONS, or for more general purpose looping. everything you can do with a for() loop, you can do with a do....while loop, it's really just a shorthand. in the same way that foreach is a shorthand for a for loop something like this (psuedocode): ENUMERATOR = collection.GetEnumerator(); for(loopvalue=enumerator.GetFirst();!Enumerator.HasItems();loopvalue=enumerator.GetNext()) { } instead of foreach(loopvalue in collection) { } the second one is a little easier to read |
|
1976. |
Solve : ListBox - visual studio 2005? |
Answer» Hi, I created a project with multiple forms using visual studio 2005. 1 of the forms has a listbox that is supposed to display data from a linked list. The linked list is working fine cos i tried to display data using MessageBox.Show() and it was ok. The problem is when i try to display it into the listbox, i get an exception error. How can i get it to display the items from the linked list? |
|
1977. |
Solve : C compiler, graph.h.? |
Answer» Java can be run on nearly every platform with only minor changes... C#, F#, VB.NET, and managed C++ can run on Windows and Linux, as well. "code" then all computers would be at risk of every virus. This idea has some merit. However, it is not enough reason to have many kinds of OS. It is very possible to put up resistance to a virus with just one OS. The one OS can have several 'strains", not mutations, RATHER variations in the low-level structure which would make it hard for a virus to identify the build of the OS. Windows, as well as other OS, already hae DLL programs. This can be extended to that a hostile program can not 'crack' the DLL, it a proper program would have no problem with the DILL. The hostile code wants to find a weak sport inside the DLL. The friendly program only wants to use the DLL, not pick it apart. Microsoft has already hinted they may do something that that in the future. Thus you will have hundreds of different 'builds' for just one release of Windows, All the API is the same. Just he binaries vary in some detail. Enough to make it very had for a virus to attach itself to a bit of code without bringing the system down. Is this off topic? Well, I am trying to say that just as you can have many flavors of Linux, that can also be done with Windows without really making any visible changes. Which is even better. Quote from: Geek-9pm on April 11, 2010, 11:14:32 PM This idea has some merit. err... a DLL is an In-process LIBRARY. It's loaded in the same process as the caller. malware doesn't change this. What malware does is install a global hook on certain DLL functions, for example, they usually hook CreateFile and other file access functions to hide files. AV programs do this too to detect when a f ile is being opened. There is no "weak spot" in a dll. it's in process; you LOAD it, and it belongs to your process. the DLL allocates data in address space. it uses stack, it uses heap. It uses process memory so you can do what you please with it, including changing jumps and ordinals. Most "hook" malware is written via a early-loaded DLL, often a winlogon notify hook. this sets it up so that every process will be implicitly bound to a malware-designed DLL, which, when it's DllMain() is called, can hook the functions that would otherwise go to kernel32 or user32 or whatever and do what it pleases with them instead. Quote rather variations in the low-level structure which would make it hard for a virus to identify the build of the OS. That's ridiculous. the very same "variations" and randomness that would make malware writing difficult also makes diagnostic utilities and process analysis difficult. What we need is a better heuristic that can better detect malicious use of those functions, not obscurity of those functions. it a proper program would have no problem with the DILL. The hostile code wants to find a weak sport inside the DLL. The friendly program only wants to use the DLL, not pick it apart. Microsoft has already hinted they may do something that that in the future. Thus you will have hundreds of different 'builds' for just one release of Windows, All the API is the same. Just he binaries vary in some detail. Enough to make it very had for a virus to attach itself to a bit of code without bringing the system down. Is this off topic? Well, I am trying to say that just as you can have many flavors of Linux, that can also be done with Windows without really making any visible changes. Which is even better. [/quote]Quote from: Geek-9pm on April 11, 2010, 11:14:32 PM it a proper program would have no problem with the DILL. There's the problem. Somebody has a pickle in their compiler.Quote from: rthompson80819 on April 11, 2010, 11:39:10 PM There's the problem. Somebody has a pickle in their compiler. A pickle?WARNING. Do NOT search on 'Pickle Compiler' as those keywords lead to sites that will infect your system. Do NOT use the pickle library unless you know exactly what it is.Quote from: Geek-9pm on April 12, 2010, 01:18:44 PM WARNING. Do NOT search on 'Pickle Compiler' as those keywords lead to sites that will infect your system. Do NOT use the pickle library unless you know exactly what it is.It is a good thing I have a backup plan. HAHA. What is the deal with this pickle compiler/bad for computer thing?Quote from: Boozu on April 12, 2010, 05:17:09 PM What is the deal with this pickle compiler/bad for computer thing? I have absolutely no idea. I know rthompson mentioned it because of a typo in one of geek's posts. (dill)Lame joke, sorry.Here a safe place to dload pickle for C++ http://linux.softpedia.com/get/Programming/Widgets/Perl-Modules/Pickle-55831.shtml We are talking about Linux -Right? Just be careful about where you get Pickle.Geek-9pm you mentioned: STATIC void CGContextSetTextPosition( IntPtr context, float x, float y ) Can you please ELABORATE? I have stared building my program in a proper C compiler so I need a new way to set x,y coordinates.Quote from: Boozu on April 14, 2010, 01:49:10 AM Geek-9pm you mentioned: Well, I can tell you right off that that segment of code geek said is C#, not C.k. There must be some way of setting x,y in C. I have googled the *censored* out of it and I am not finding anything. |
|
1978. |
Solve : admin services? |
Answer» every time i turn on computer i have to go to administrative tools, services and start my wmi performance ADAPTER and my WIRELESS zero configuration for my wireless internet to start. how do i make it start automatically when i turn on computerIf this was a programming challenge I'd say it can be done using AutoIt, VB Script, or Powershell easily. I'm assuming your post needs to be moved and the solution will be made available. Meanwhile, I SUGGEST looking at the setting for your WMI performance adapter and the wireless zero configuration. WMI should be set to "manual" Startup Type and Wireless Zero should be set to "AUTOMATIC". If those are the settings already present then it must be something else. I also suggest a wireless helper utility could be the culprit, but more info is needed. What model of computer you GOT there? |
|
1979. |
Solve : Programming Elegance? |
Answer» Alright, so the other day I was talking to C# programmers about C#. Treval , you have style. I read a very good book in the 1980s, still a classic, and often used in programming courses - "The Elements of Programming Style" by Kernighan and Plauger. Brian Kernighan is the famous Unix (he coined the name) and C pioneer (He is the K in AWK). P. J. Plauger is an author. He founded Whitesmiths, the first company to sell a C compiler and Unix-like operating system (Idris). He is also a science fiction writer; he won the John W. Campbell Award for Best New Writer in 1975, notably beating John Varley for the award. The book is well worth acquiring. There is a PDF extract containing 56 "rules of programming style" available on many college websites including here http://cs.boisestate.edu/~amit/teaching/handouts/style.pdf some apt quotes... Quote 1. Write clearly don't be too clever. Quote 11. If a logical expression is hard to understand, try transforming it. So, I have style according to points 5 & 6? =P Then I still have to work on the rest of the points because I have too many temp vars. What if it's the case that you have no other choice but to choose temp vars (for example, you need a variable to be initialized with a particular value according to a particular item in a foreach)? Using library functions? You mean the .NET framework funcs? Such as Math.Floor()? What's an example of point 5? Thanks for the book.Quote from: Treval on April 11, 2010, 04:32:56 AM
I should think point 5 maybe covers situations where the programmer gets "clever" and writes code which gets the desired result maybe in one line instead of ten, but which is not immediately understandable to anybody else, (or, often, the same programmer six months later!) I believe the author put the word "efficiency" in quotes to point up the idea that code can be efficient in a trivial sense, i.e. in terms of machine resources, source code size, memory/cpu usage, etc, but be a horror to maintain and debug, thus consuming more than its proper share of human time and resources.Yes that is a good point. I also try to be firm and clear about my commenting the code. =)Quote from: Treval on April 11, 2010, 05:44:50 AM Yes that is a good point. This is one thing I am trying to do more; sometimes I write the comments first. I use temporary variables all the time. But not too many of them. I use them to store the result of a function when I need to refer to that result in multiple conditions. A prime example is, for example, a function in my Expression Evaluator called "GetOperator" My first iteration of the code for some reason was calling the function with the same parameters multiple times to decide what to do, so I replaced it with a single call that assigned it to a temporary variable and used that result instead. I did this as well with a few other intensive functions in various locations of the code, and caused a noticable speed improvement. I think it's important to simply not use too many of them at the same time. I often use the Code: [Select]foreach(typename varname in collection) { } syntax myself in C#, I don't consider it a "temporary" variable, but rather a variable local to the foreach() block, since outside the block it isn't defined. Re: comments: needless to say, they are important. USUALLY, when I start any non-trivial function, I try to write some sort of "preamble" comments that indicate what it will do, and possibly how that will be done. This is especially useful in that I can decide wether certain portions might be better served as separate functions, as well as prevent errors. I just checked and most of my projects have around 25% of their lines as comment lines. some of those are commented out code though. |
|
1980. |
Solve : Launching a batch file from qbasic? |
Answer» Does anybody know the statement to run a batch file from Qbasic? I've been trying with SHELL, or RUN... but none of them worked. I would appreciatte an EXAMPLE!!! (the Qbasic version I'm USING is 4.5). Thks in advance!!!Quote I've been trying with SHELL, or RUN... but none of them worked. QuickBasic code:Code: [Select]Shell "c:\batfile.bat" works for me. The QB SHELL command requires a string as a parameter. Both these work Code: [Select]SHELL "C:\TEST.BAT" SH$="C:\TEST.BAT" SHELL SH$ Won;t work as advertised. Quote from: Geek-9pm on April 10, 2010, 03:35:02 PM Won;t work as advertised. Whatever that means, (?) it worked for us; your task is to work out what you are doing wrong. Quote from: Geek-9pm on April 10, 2010, 03:35:02 PM Won;t work as advertised. Please post QuickBasic and batch scripts which "won't work as advertised" Quote from: Salmon Trout on April 10, 2010, 05:11:21 PM Whatever that means, (?) it worked for us; your task is to work out what you are doing wrong.Yes, it works for you and maybe me. However, you could have mentioned that there has to be a valid batch file in the directory specified. Perhaps a more transparent example would be to use the shell for a directory commands like this: SHELL "DIR C:*.* /B" in which should work properly unless he does not have a C: drive. Also there is a version of the Quick Basic that is just simply called QBASIC which I believe was on the Windows 95 CD. That version of basic will not do some shell commands properly. Just to make things clear for the newcomers. Actually, I tried the example you gave and could not understand why it did not work and why it did not give an error message that made sense. Also, QB does not exit after the SHELL command. Does the OP want QB to quit after the batch files starts? Quote from: Geek-9pm on April 10, 2010, 10:15:38 PM However, you could have mentioned that there has to be a valid batch file in the directory specified. But that is obvious even to a little child. I do not understand why you wrote that. That is so deeply trivial that I wonder at your sanity and common sense. A tip, Geek, when you are in a hole, stop digging! Quote Perhaps a more transparent example would be to use the shell for a directory commands like this: Again, why did you write that? Are you stoned or SOMETHING? Quote Also there is a version of the Quick Basic that is just simply called QBASIC which I believe was on the Windows 95 CD. That version of basic will not do some shell commands properly. Really? Are you sure? How do you know? How can we believe you? Which shell commands? Did you just make that up? Quote Just to make things clear for the newcomers. A laudable target, but one which you have entirely failed to hit. Quote Actually, I tried the example you gave and could not understand why it did not work and why it did not give an error message that made sense. Don't blame us for your comprehension problems. Quote Also, QB does not exit after the SHELL command. Whoever said or implied that it did? WTH are you blathering on about? Quote Does the OP want QB to quit after the batch files starts? I shouldn't THINK so, otherwise they would have said so. Geek - I would still like to see the QuickBasic and batch script codings which failed for you. |
|
1981. |
Solve : Thanks for the effort? |
Answer» Hi, |
|
1982. |
Solve : Javascript function help? |
Answer» So I am doing this tutorial on w3schools, and this is the code: Okay so the variables have to be declared before you can use them in an operation like that? No- your missing what I mean. If you had something like this: Code: [Select]var a, b; a=34; b=12; c=a*b; the "var" line is unneeded; it will work either way. However, if you have a function like that you described above, but WITHOUT parameters: Code: [Select]function product() { return a*b; } then it would be necessary to assign values to a and b before CALLING the function. Code: [Select]a=13; b=5; c=product(); the "definitions" as you call them, in the parameter list of the function, tell the calling procedure how many arguments can be passed AND also tells the interpreter what they are to be referred to as in the function body. |
|
1983. |
Solve : c# treeview? |
Answer» I have CREATED a tree view, I wont GET into details about it, but I would like, when the program is opened, to have the tree view MINUS/plus to start out as showing minus. In other words, the tree view expanded at startup. Can anyone help me with this?I GUESS you will put your code in the form load event. I did find two treeview methods which may be helpful: ExpandAll and CollapseAll. |
|
1984. |
Solve : Is it legal or illiegal?? |
Answer» Hi EVERYONE, |
|
1985. |
Solve : HOW TO SEARCH SITES WITH A DESKTOP APPLICATION? |
Answer» Hi to all of you, I want to make a desktop application that can search databases of search engines Search engines offer web interfaces to search their databases, but I'm fairly very certain the search companies are not going to allow direct connections to their databases with homegrown code. You can write your own front-end but you'll still need to go through the website for the actual search. You can also write your own back-end and scrape the web data for analysis. Get back to us on how you see your application in action. thanks sidewinder for you response. I want to make a desktop application which has a user input for keyword typing. then the user will press the search button and the application begin search all the websites such as google,yahoo,msn etc. After SEARCHING the websites, application should be able to display rank of a keyword on different site. Can I do so ? thanks.You could utilize web services to accomplish this. Here is a small tutorial on using the Google Search web service. http://blogs.msdn.com/coding4fun/archive/2006/10/31/912079.aspx And here is Google's own reference guide for the SOAP API. http://code.google.com/apis/soapsearch/reference.html Then you just need to find out if the other search engines you want to utilize provides similar APIs. Here is ONE for Yahoo. http://developer.yahoo.com/search/well if you are talking about what i think you are talking about(getting the input on a seach resoult page) then you should do this(you need a text box and a command button), Code: [Select]Private Sub Command1_Click() Dim Website As String 'Dim the variable website as a string Dim s As String s = Text1.Text Website = "http://www.google.com/search?hl=en&q=" & (Text1.Text) & "&btnG=Google+Search" 'store the information from text1 text into the variable Webiste ShellExecute Me.hwnd, "open", Website, vbNullString, vbNullString, vbNormal 'Open your default BROWSER and 'call the Api. End Sub this will just start your default web browser and find what you typed in google, when someone presses search on google, it goes to this Code: [Select]"http://www.google.com/search?hl=en&q=(What ever you typed in the search box)&btnG=Google+Search" its basic input. hope this helped but all you do is go to a search engine, type in whatever, and press search. check the address BAR, and copy it except what you typed in.thank you Batchfilebasics, But, i want to search on google and other search engines to get ranking for keywords, that I will type in a text box. And get the ranking of a keyword on a search site.oh, hmmm....why dont you try makeing a web browser? they are pretty easy to makehi, I can make a web browser, but how can I check the rankings of keywords? can you help me. thanks |
|
1986. |
Solve : Visual Basic or C++ Programming, which is easier?? |
Answer» I like to know which is easier to program and to use Visual Basic Programming or C++ Programming. I am THINKING about taking a CLASS on Programming. Also do you need to download any software to use with Visual Basic and/or C+? Also, if you've never heard of Paint .net, I suggest you look it up. It was developed in VB .NET (hence its name) and is an absolutely astounding program. Ever heard of Photoshop? It is developed in C++. But don't get me wrong I'm all for the .NET framework. It is a joy to develop in and probably one of the easiest ways to begin programming since you get so many things handed to you. But if you're going to start with a .NET language I would strongly recommend you go with C#. 1.) It is a more powerful language than VB and a more modern language. (Object oriented like C++) 2.) The langauge syntax in C# and Java is almost identical. So when you know C# you pretty much know Java as well. 3.) Both C# and Java have gotten a lot of inspiration from C++, so the move from either one to C++ is not very big.I suppose we aren't going to agree on this... |
|
1987. |
Solve : batch file for pc autoshutdown? |
Answer» jst wana ask f ders any way to shutdown,restart or LOG off PC on a specified time using batch file?for example i want to shutdown my pc after 2hrs after log on or shutdown it on a specified pc time EXMPLE shutdwon on 12:30am..tnx n advance.. Code: [Select]run AVyou can do that, but if you want a more...exact time then do Code: [Select]at (time) shutdown -s -t 10and it should WORK |
|
1988. |
Solve : Sending email in visual basic 6.0? |
Answer» i know it is possible and EVERYTHING and that you need chilkat mail, but i can't find it anywhere. can somone help? or if you know where to find something better, that'll be greatI've always MANAGED to use the Microsoft CDO Library by creating a reference in the PROJECT. Just setup up the properties and use the send method. |
|
1989. |
Solve : create/add users in batch file? |
Answer» How do you add a user in a batch file to a group? What do you start off with ? I know only a little, but help me out, @echo off :dan set input= set /p input="type your password" if %input%==12345 goto logon :logon [/quote] etc... ~Simitra BTW i wouldnt go completely on that... im still not that good at batch spent too much time on c++ Quote from: tommy gusack on January 24, 2008, 01:30:15 PM How do you add a user in a batch file to a group? What do you start off with ? I know only a little, but help me out, yea, you have it right but instead of just putting only one user choice, do sumthing like this: Code: [Select]@echo off color a echo please insert password to use set /p password= if '%password%' == 'password' goto accepted Else false goto false :false echo im sorry but that was incorrect!!! pause goto start :accepted echo insert name and press enter set /p name= pause echo same for password set /p password= echo name = %name% echo password = %password% pause cls echo would you like to create account? echo press any key to create account pause net user %name% %password% /add echo press any key to make it an administrator pause net localgroup administrators %name% /add pause echo account made! pause echo This is a program from Stealth485! pause i made this about 2 years ago so its not that advanced, but it is decent |
|
1990. |
Solve : vba convert from string? |
Answer» I have a series of loops that determine the inputs into equations (the loop counter arrays are used) and I have another function that identifies the input conditions which chooses which loop counter array to used to define some variables. What I would LIKE to do is to be able to say that when some condition exists the loops will pick the right set of equations to use for the variables and then plug them in with out having to loop each time to redetermine the functions to be used. |
|
1991. |
Solve : Displaying the output file after compiling a program? |
Answer» RE: Using Dec-C++ compiler on Windows XP |
|
1992. |
Solve : C# application Drag and Drop? |
Answer» I have searched, with GOOGLE, how to drag and drop onto a C# console application, but with no luck. If ANYONE KNOWS any links, or ideas that would help me ACHIEVE this, that would be helpful. thanks.Try http://blogs.msdn.com/oldnewthing/ |
|
1993. |
Solve : Quines? |
Answer» Can SOMEONE tell me how to make a QUINE in VB .net? I have tried several TIMES now, but the problem is I just don't get them... I did make one in batch though... doesn't work very wellWell I FIXED the batch one, but I can't translate it into vb .Net. any ideas? |
|
1994. |
Solve : Programming lang news and tips? |
Answer» FRIENDS where/how can i get latest news/tips on DIFFERENT programming languages ESPECIALLY C,c++,JAVA,xmlhttp://www.codeguru.com/forum/ | |
1995. |
Solve : Vb6 scanning .txt files for a word...? |
Answer» ok im MAKING a program... very simple purpose but im stumped on this part of code. |
|
1996. |
Solve : maximum memory supported my visual basic 6.0? |
Answer» hi everyone, i need some help..i would to know if visual BASIC 6.0 supports a 4GB memory machine with WIDNOWS xp sp2. |
|
1997. |
Solve : Does Visual Basic 6.0 supports 4 gb memory machine? |
Answer» can somebody help me on this ONE, the MACHINE is having a 4gb memory with windows xp sp2.While you COULD possibly have an array with the MAXIMUM 32-bit value of 2147483648, your program would RUN out of memory on Windows NT/2K/XP/Vista because they only support 4GB of memory in a single process. |
|
1998. |
Solve : C# and batch files? |
Answer» I have a batch file that when a file is dragged and dropped on to it, it creates a txt file that has the location of the file that was dragged on to it. Afterwards, the batch file is suppose to run a c# console application, which is suppose to, well, do its own thing. But, instead the console application opens up as if I were to go to cmd (command prompt) starting at the location of "E:\documents and settings\jim\" where I can proceed to type "dir" and see all files and so on. The c# console application works fine if i just double click on it normally though. Any ideas thanks? I made a batch file like yours and dropped a file on it, it did what you described when the batch worked properly.well, thanks for the suggestion but, none of those have helped and I have 4 antivirus/spyware/worms scanners that I run daily, and 2 firewalls, and a realtime scanner. Any more ideas? If it comes down to it, I might just make the program into a visual C# program.After a while of PLAYING around with the batch file, I decided to pause it at the end rather than exit. I found that it was printing the : Code: [Select]Start "HtmlLinker.exe" with exactly that....quotations and all. So I removed the quotations from it and found that I needed to create a path to it so this is what I came up with, and now my console program runs correctly. Code: [Select]echo %1 echo %1>"c:/Program Files/HtmlLinker/address.txt" Path=c:\Program Files\HtmlLinker;%PATH% DOSKEY /insert START HtmlLinker.exe exit |
|
1999. |
Solve : Visual programming? |
Answer» I want to create a program that doesn't require anything to actually run. For EXAMPLE: visual C#, visual C++, and visual BASIC ( i believe, haven't worked with VB) all require .net framework to run your program. Distributing .Net Framework redistributable (22 mb) to those who do not have it, and/or dont have the connection speed is quite POINTLESS unless distributing it on a cd. I can't help to notice that many programs, like antivirus, instant messengers and everyday programs do not require you to have something installed on the computer. This may be the case because what it REQUIRES is already on there? What programming language would I be looking for, if any? Or how do I MAKE my programs require a later version of .net Framework? thanks.This is a question of what APIs you choose to use. |
|
2000. |
Solve : Optional Closing Tags in HTML? |
Answer» For as long as I've been validating web pages, I never realized that the closing tag was optional in HTML. I feel as if I've missed the BOAT at times. |
|