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.
| 1651. |
Solve : Using cURL to connect to IRC in PHP? |
|
Answer» I don't have the option of using fsockopen at my host, so I am wondering if there is a way to use cURL instead to connect and talk to an IRC server. |
|
| 1652. |
Solve : Java program not looping as intended.? |
|
Answer» Note: My teachers (intelligible) advice was "There is garbage in the buffer. Read another line before reading the employee name." Which I can make no sense from.Interestingly, their solution to read another line is correct, though they do poorly at explaining why. There isn't really "Garbage" in the buffer. What is happening is that nextFloat() and similar functions don't read passed the next carriage return, so they 'leave it' in the input buffer. So when you enter the number of hours worked that Carriage return is still there; nextLine() will have input to read right away. You can either call nextLine() immediately after reading via nextFloat() each time to swallow the carriage return or use nextLine() to read in a string for the numeric inputs and use Float.parseFloat() to TRY to convert them. The latter will require exception handling so the former would probably be easier for this instance. Thank you both very much. I got the program to start repeating correctly thanks to you guys, and I understand much better now! YAY! Thanks again! |
|
| 1653. |
Solve : Flash and xml? |
|
Answer» i have this CODE |
|
| 1654. |
Solve : Perl help "permission denied" when reading files from directory.? |
|
Answer» I'm getting a "permission denied" error from the local computer,(WinXp), when I try reading files to upload to my FTP server. |
|
| 1655. |
Solve : Need help with program language C (Using Arduino)? |
|
Answer» I want to make a password security system with the help of buttons on my arduino. We NEED to use 3 buttons and the password should have 4 numbers in it. If you get the code right it should light up the green light if you get it wrong it should light up the red one |
|
| 1656. |
Solve : Java program to pass input from textfield to a process? |
|
Answer» I am trying to write a java program to act as an interface for PocketMine. |
|
| 1657. |
Solve : W7 Run Xcopy as administor? |
|
Answer» Why are you moving a .BMP into the SYSTEM folder? I can't find any in mine.Code: [Select]runas /USER:%COMPUTERNAME%\ADMINISTRATOR cmd /c xcopy "File.txt" "C:\windows\system32" |
|
| 1658. |
Solve : Perl FTP problem Can't list files? |
|
Answer» I'm getting a "Bad file descriptor" error when I try and LIST the files on my FTP server. |
|
| 1659. |
Solve : Perl help with chdir in WinXp? |
|
Answer» In C, you can use '%usrename%' when changing directories. use the $ENV hashtable... Thanks BC_, thats just what I needed. I REALLY like the last one: Code: [Select]use File::HomeDir; $path=home()."\\dir1\\dir2"; |
|
| 1660. |
Solve : AutoHotkey GUI? |
|
Answer» I'm just wondering how to get variables from GUI elements. I tried ADDING vFkey before the coordinates for a dropdown box, but that makes the location of the dropbox change (I need it where it is). Here is the code for the creation of all my elements. I really, really think that you would get better results on an Autohotkey forum. I have used AutoIt which is better, and there are forums dedicated to both. The Autoit forum has a fearsome admin who gives out bans with hesitation.I'll check the AHK forum then! |
|
| 1661. |
Solve : SQL Server Trigger? |
|
Answer» I need to create a Trigger for when a ROW is updated to automatically SET the UPDATER and udate_date to the current user and the current date respectively, but I am having trouble doing this. The following is what I currently have: |
|
| 1662. |
Solve : Joomla Coding? |
|
Answer» Hi All newbie to HTML CODING here so need some help. I am teaching myself some basic coding to set up a basic input screen to assist in data collection in cottage industry bushiness IE very very SMALL ( Just 2 people) I am trying to write a code to add 3 input vales TOGETHER and average the result ( to 3 decimal places). |
|
| 1663. |
Solve : Help needed for a batch file please? |
|
Answer» Hi guys, |
|
| 1664. |
Solve : VSPVBA.exe for netmanage 3270 emulator? |
|
Answer» Greetings all. At work we use a 3270 emulator that comes with a VBA script player called VSPVBA.exe. I am wondering if anyone has heard of it, and if so, if anyone knows of a way to run it from a command prompt and have it execute a vba file passed in the command, rather than it opening a "OPEN Script File" dialog at which point I have to navigate to the VBA file I want to run. I know this is probably grabbing at straws, but I SURE would appreciate any help. We all use Windows 7 32 bit. Thank you. |
|
| 1665. |
Solve : C# Thread safe bitmaps in timer? |
|
Answer» Hi. I'm guessing BC programmer can help me with this engine = new GameEngine(); Here is the engine code: Quote class GameEngineUntil BC shows up, you may want to read t his over: http://stackoverflow.com/questions/11623039/how-to-make-objects-threadsafe-on-c Also: http://stackoverflow.com/questions/17975884/c-sharp-variable-thread-safety More: http://stackoverflow.com/questions/22229702/threadsafe-over-bitmap-in-c-sharp Quote Any public static (SHARED in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.I don't understand why it wouldn't be able to compile. Threading problems such as this usually result in an InvalidOperationException at run-time. Quote now it won't compile because I guess the bitmap and graphics objects are not thread safeIf it doesn't compile, it emits compile errors. Those would be useful to know. At any rate, you shouldn't be drawing in the timer procedure anyway. My game's 2-D "engine" loaded all bitmap assets at startup. the Bitmap constructor accepting a filename is unreliable, for what it's worth- to load Image data I used what is found here: Basically, instead of using the file, it read the entire file into a Memory Stream, and then used Image.FromStream(). It didn't use Bitmaps for assets, since they did not need to be changed. The actual game logic was in a separate thread. Which can be seen here (side note, If I was writing it now I would probably use an interface-based approach to "gamestates" rather than simply using an enum and a large switch statement). The separate Thread does absolutely no drawing- it simply performs the game logic. However, each frame it will also attempt to invoke a repaint: Code: [Select]PicGame.Invoke((MethodInvoker)(() => { PicGame.Invalidate(); PicGame.Update(); })); The Invoke is required because the GameProc() thread is not on the UI thread. only the UI thread can call the methods of Win Forms controls (otherwise, we get the aforementioned InvalidOperationException- "Cross-thread operation not valid" or something to that effect). In this case it simply invalidates the PictureBox being used to display the game and forces it to Update. In turn, this will cause the Picturebox's Paint event to be called- it get's called on the UI thread. Both the gameproc as well as the drawing routine however lock on certain things to prevent them both from accessing things simultaneously, which could cause problems. It paints to a backbuffer and then that backbuffer get's drawn to the Graphics object provided to the event (e.Graphics). I would never use a Timer for this sort of thing, since Timers are EXCEEDINGLY unreliable. I base this on having used Timers before, and finding them to be unreliable. This holds especially true if you are using the System.Windows.Forms.Timer. Quote I don't understand why it wouldn't be able to compile. Threading problems such as this usually result in an InvalidOperationException at run-time. You are correct. I was being inaccurate. What I meant to say was it has a run-time error with a message like you described. I see what your saying, but I don't understand why your game doesn't just run at full CPU speed if you're not using a timer to update your frames. Could you explain to me how I should do this instead of using a timer? If you know of any examples of rendering bitmaps using GDI at a specific speed, that would be useful. I'll take a look at the code for your game when I have some time.Quote from: Linux711 on May 12, 2014, 10:08:09 PM I see what your saying, but I don't understand why your game doesn't just run at full CPU speed if you're not using a timer to update your frames.It does run at full CPU speed. That is the entire point of not using Timers. The game logic runs as fast as it POSSIBLY can, if it goes faster than the desired framerate it will interpolate; if slower, than it will move objects faster. Whether the game receives CPU cycles is up to the Thread scheduler. Quote Could you explain to me how I should do this instead of using a timer? If you know of any examples of rendering bitmaps using GDI at a specific speed, that would be useful. I'll take a look at the code for your game when I have some time.Referring back to my game (I opened it for the first time in maybe a year and a half now...). Basically it tracks the FPS and if it's below 30 all movement and changes will be scaled appropriately; at 15fps for example an object will move faster each tick in order to keep up with what would be a normal rate. This prevents objects from actually moving slower, with the side effect of causing jerky motion (which also screws with other stuff such as hittesting, but that's another topic). A Timer is designed for- as it says on the tin- something you want to happen at a repeating rate. But more importantly no Timer implementation is particular stringent about that actual rate. It takes your 100ms as a guideline, not a rule. Additionally, using a Timer introduces idle time, which is what you want to avoid. It should run as fast as possible to make the experience as smooth as possible. |
|
| 1666. |
Solve : [help needed] Error in batch to check md5 and patch with xdelta or bsdiff? |
|
Answer» I've made a batch file and using few tricks I've made it work quite well but didn't realized that script will generate quite long command and many variables to work with, which generates error. |
|
| 1667. |
Solve : Find and then run executable via batch file?? |
|
Answer» I am trying to build computers, and I am writing a batch file to remove the junk. |
|
| 1668. |
Solve : Classic ASP: error '800a000d' Type mismatch? |
|
Answer» Hello Microsoft VBScript runtime error '800a000d' 'maria' refers to my chosen password. Line 23 is this: if username = "" or password or fullname or strEmail = "" then strEmail corresponds to the email column in my MS Access 2003 database. The rest of my CODE looks like this: Code: [Select]<% username = "" password = "" ErrorMessage = "" strEmail = "" fullname = "" if request.form <> "" then username = Request.Form("username") password = Request.Form("password") fullname = Request.Form("fullname") strEmail = Request.Form("strEmail") if username = "" or password or fullname or strEmail = "" then [color=red]<---- where the error occurs[/color] ErrorMessage = "You must specify a username, password, your full name and email address." else set conn = Server.CreateObject("ADODB.Connection") conn.Provider = "Microsoft.Jet.OLEDB.4.0" conn.Open("E:\myDatabase.mdb") set rs = Server.CreateObject("ADODB.recordset") rs.Open "Select * FROM Users WHERE strEmail = '" & username & "'" & fullname & "'", conn if rs.EOF = false then if rs.fields("password") = password then Response.Redirect("Default.asp") end if end if ErrorMessage = "Login failed" end if end if if ErrorMessage <> "" then response.write("<p>" & ErrorMessage & "</p>") response.write("<p>Please correct the errors and TRY again.</p>") end if %> <h1>Login</h1> <form method="post" action=""> <fieldset> <legend>Log In to Your Account</legend> <ol> <li> <label>Username:</label> <input type="text" id="username" name="username" /> </li> <li> <label>Password:</label> <input type="password" id="password" name="password" /> </li> <li> <label>Full name:</label> <input type="text" id="fullname" name="fullname" /> </li> <li> <label>Email:</label> <input type="text" id="strEmail" name="strEmail" /> </li> <li> <p><input type="submit" value="Login" /></p> </li> </ol> </fieldset> </form> </div> </body> </html> What am I doing wrong, please? High1Quote Code: [Select] if username = "" or password or fullname or strEmail = "" then Or cannot be used on two strings. You are missing ="" COMPARISONS for password and fullname.Hello mastermind Many thanks for your reply. So I would have to use if username = "" or password = "" then only? How would I include 'fullname' and 'strEmail', if I may ask? Thank you High1I'll try using this (and abandon fullname as it's not really essential): if username = "" or password = "" or strEmail = "" then High1 |
|
| 1669. |
Solve : How do I reboot ?? |
|
Answer» How do I REBOOT my Computer ? What computer? What OS?Quote from: MINIM on June 09, 2014, 10:13:39 PM How do I reboot my Computer ? Windows 8.1 IntelFrom the desktop, right-click on the Windows icon in lower LEFT, select Shutdown or sign out->RESTART |
|
| 1670. |
Solve : Super Help!! Coding for a pure C++ OS - how to make a timer?? |
|
Answer» I just landed in a excessive pile of C++. If the OP is using Microsoft libraries, he would need to look into the reference materiel.Well, given the FACT that they stated that they are wanting this for a "Pure C++ OS" this would kinda rule out the idea of there being Microsoft libraries! This is also backed up when they said "All I've found is Windows and *nix ways of doing it." which is what you have just given them again.That still raises the question of what a "Pure C++ OS" is, though. Particularly considering I find it doubtful they re-implemented the standard library for their system.Quote from: BC_Programmer on June 19, 2014, 09:23:39 AM That still raises the question of what a "Pure C++ OS" is, though. Particularly considering I find it doubtful they re-implemented the standard library for their system.That is what I thought too. The most widely used C++ libraries on a small computer are from Microsoft.Quote from: Geek-9pm on June 19, 2014, 10:06:12 AM That is what I thought too. The most widely used C++ libraries on a small computer are from Microsoft. I'd EXPECT glibc to have far more use. But neither is built to run on the OP's special OS, which is what makes me quizzical. |
|
| 1671. |
Solve : help for c progrm in array? |
|
Answer» hello guys, i want help in c program. |
|
| 1672. |
Solve : Want to start working with C#;BUt dont know the right resources? |
|
Answer» I was hoping to get down to programming in c# but really google is showing so many IDE and softwares and stuff.. Visual C# resources That will POINT you in the right direction. If the links don;t work, try this: http://msdn.microsoft.com/en-us/library/dd831853.aspx Thanks buddy so which one am i to download there are so many.. i want to work on pc for .NET framework and a little bit pc GAME programming ...If you have the bandwidth, just download the whole package and burn it to a DVD. (But a DVD is optional. Just download and install.) You can get a free trail, in which case you have to buy it later. Or use the Expres version which is for students and hobbyists w ho w ant to learn. Even the Express version will make useable game programs. Just not will all the commercial features needed fort making a powerful retail game. The express versions are free. So just start whit one, and if you like, try another. http://www.visualstudio.com/en-us/products/visual-studio-express-vs.aspx Express 2013 for Windows Download the FIRST one. You can just do a direct download and kt install directly. No need to burn a DVD. Personally, I prefer Visual BASIC. But that is because I am so old. I have experience using MS Basic in a commercial setting. A long time ago. All the Visual Stdio tools have the same core foundation. So once you learn the IDE it is easy to move on to another tool. Thank you very much for your help... really appreciate the help man,,.. wibit.net is a cool site! |
|
| 1673. |
Solve : need a lil help in VBA? |
|
Answer» Good day all, |
|
| 1674. |
Solve : Kmplayer? |
|
Answer» Hi |
|
| 1675. |
Solve : [VBScript] restart a service? |
|
Answer» with this, i can get the result ACCORDING to the state of WebClient, that means we can find the Service and get its state correctly |
|
| 1676. |
Solve : [Help] Could you identify the errors in the code ?? |
|
Answer» Hello guys!
If you type or copy paste this into a fully functional program layout. When you go to compile it or run it, the compiler debugger will point out to you where the problems are. You should get very accustomed to using the debug messages. While sometimes it doesnt point out an exact problem such as ( ; missing or unexpected ) and you find a ; missing or an extra, and an error message can sometimes state that ( unhandled exception error ) because your missing a specific preprocessing directive. Given that you are at this level of PROGRAMMING you should already be familiar with debug messages.It might seem that way, but this wasn't a homework. I've got my school exams coming up and I wanted to be prepared in the best possible way. So, I decided to look through some pretty high end programs. This one was way above me. To camerongray - Thanks, your post was pretty useful. Quote from: DaveLembke on June 26, 2014, 01:24:44 PM While I cant give away the answer... I can point you in a direction to finding the answers... I wouldn't be able to run it in a theory exam. When paper troubleshooting I try to go through the code methodically: 1st: Stupid checks, First I go through and check for proper semi colons, and correct number of and matching brackets 2nd: Scope and variable errors, next I check for proper scoping and declaration of variables 3rd: I run through the program line by line and "run" it in my head line by line. That should get you to get most of the answers, if not all. -Mal |
|
| 1677. |
Solve : Java - Catch input other than yes/no?? |
|
Answer» Hello all! |
|
| 1678. |
Solve : Need help on Insert data to phpMyAdmin? |
|
Answer» Hi guys, I would like to seek help on inserting data whenever the switch is on or off to my sensor mySQL database in phpMyAdmin from my control.php. I'm using Raspberry PI as my hardware and follow a few tutorials to create my own Web Control Interface, it works perfectly without insert method. After I implemented insert method to my control.php and execute it, it cannot works and cannot store. |
|
| 1679. |
Solve : [C++]copy text from command prompt? |
|
Answer» Hello everyone. It has been LONG time. I am trying to make a program to copy a mac address from the command prompt to the clipboard so I can easily ctrl-v it were I need. My first hurdle is finding a way to put the output of the command prompt into a string so I can fiddle with the info and find exactly what I need. Does anyone know a way to get the info from the cmd to a string?Tell more about you objective from a huger level. Why not just use what is already in the C++ library?I did intend to only use c++ of this program. Perhaps my earlier explanation of what I am trying to do will clarify that. I am not familiar with any of the languages you mentioned. Any suggestions or if you need more info please let me know.There are a number of ways to get MAC address using C++ along with other tools. If you are using Windows, this link may NOT help: How to get MAC Address in Windows with C++ The moderator did not think it was a good question. But here is a link where a more generalized answer was given. Three ways to get your MAC address. Here is one that tries to use a function. How to get mac address of pc via c++ function? Does that help any? You can capture the standard output of a program by redirecting it to your own handle. C++ and C libraries do not, as far as I'm aware, expose this capability. You would need to directly access the Windows API functions. In this case, the applicable function is CreateProcess(). You pass in a PROCESS_START_INFO structure, and that structure can include setting a handle on the standard output. The usual approach is to create a new stream and redirect the standard output of the child process to that stream. Then the parent can read from that stream until the EOF and it will have the standard output of the program. If the program requires standard input (eg text-based prompts or something) those can be written to a redirected standard input. I don't have an example in C/C++ and personally think it would take far too long for me to come up with one that actually works to make it worth it. Here is a C# example though: Code: [Select]using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Security.Principal; using System.Text; using System.Windows.Forms; namespace testredirection { class Program { [STAThread] static void Main(string[] args) { String strFile = "getmac.exe"; String strarguments = "/v"; ProcessStartInfo psi = new ProcessStartInfo() { FileName = strFile, Arguments = strarguments, RedirectStandardOutput = true, WindowStyle=ProcessWindowStyle.Hidden }; psi.UseShellExecute = false; Process p = Process.Start(psi); String stdouttext = p.StandardOutput.ReadToEnd(); Console.WriteLine("Standard output retrieved:\n" + stdouttext); Clipboard.SetText(stdouttext); } } } After I run the above C# code I end up with getmac /v output on my clipboard. Obviously a program that does additional parsing can easily parse that string and only set the appropriate text, as per the instructions you gave. If it needs to be or would be preferred to be in C++/C, you would need to include Windows.h and you would use the PROCESS_START_INFO structure in combination with CreateProcess. You would then create a pipe (using CreatePipe) and set the hStdOutput member of PROCESS_START_INFO to point at the pipe you created, the nread from the Pipe until EOF and use that as the process output. Once you have the output you would then open the clipboard and set the text to it. as we can see here doing the same THING in C or C++ is a bit more complex, but perhaps you can use that as a starting point.I work with C++ regularly. What I would do is the following: You can run getmac /v >whatismacaddress.txt This will write the information that is normally given to display to a text file. You can then have the C++ program read in the text file and parse out the unnecessary info and have a clean mac address to work with. You can then pass that mac address to your program, however as BC stated and offered a C# alternative, C++ is more complex. If I was given this situation I would actually use a keyboard/mouse macro that is compiled as an EXE that can be called from the batch file you already created. However personally I'd use BC's method that uses C# as for the macro method that I would do would cost money for the macro software. For stuff like this that is something that I wouldnt want to spend a whole day coding up, i would create a simple macro in 15 seconds and compile it and use that to achieve the same goal. The macro software I use is JitBit Macro Recorder http://www.jitbit.com/macro-recorder/ If this was going to be something created for a client though, I'd charge and take the time to do it as clean and professional as possible, but for a down and dirty quick low cost method, i'd just go with this macro software that I already own a license of and create the macro and call that compiled macro from a batch file etc. Here is the whatimacaddress.txt file that my Windows 7 64 bit system created, and you would get a similar output to the text file. Quote Connection Name Network ADAPTER Physical Address Transport Name |
|
| 1680. |
Solve : Misconception of Languages? |
|
Answer» Hi there, So, a machine language can be worked directly by a hardware ( processors , etc ) without further translation or compilation.This is correct. "Machine code" is the data used directly by the processor. Assembly Language is a symbolic representation of this machine code- you didn't mention Assembly, but I think it's worth mentioning. Assembly is the closest a PERSON should get to machine code unless they have no choice. Quote Since machine language differs for different hardware, does this means I can't compile a program that can run on every computer?You are correct. a program compiled for an x86 CPU will not run on a ARM; a program compiled for a ARM will not run on an x86, etc. However there is a case that may be worth mentioning- some languages are compiled not to machine code, but rather to an Intermediate language or bytecode, and that intermediate language or bytecode get's run by a "Virtual Machine", rather than being run directly by the hardware. Quote Or maybe I need to recompile the program on other computers just to make sure they can run?Essentially, yes. Excepting when you are compiling to a intermediate language as described above (Java or .NET, for example). Quote Does C++ and other High-Level languages specially engineered such that it could compile a written program into many other kinds of machine language and how does it make the right choice?When you run a C++ Compiler, it compiles for the architecture it is running on or a compatible architecture, typically. At any rate compilers need to be written specifically for every single architecture that is intended to be compiled to. This is why C is so ubiquitous across different platforms- it is a fairly simple language and it's control structures and capabilities are easier to create compilers for. Quote What kind of file extension is used for the machine language? Is it .exe? Or is it different for different Operating System?machine language doesn't have a file extension. It can be present in any number of files. an .exe for example could include machine code, or it could include bytecode, or P-Code, or any number of things. Quote Since a machine language is used for targeted hardware only, why would a machine language extension being effected by Operating System?I'm not sure what you are referring to, but the best I can guess is perhaps referring to how you cannot run 64-bit programs when you are running a 32-bit OS? A modern x86 processor is, in some ways, REALLY several processors in one. the latest i7 is fully software compatible with the original IBM PC 8088 instruction set- you can boot from a DOS floppy just like you did in 1983. Effectively what Intel (and AMD) do is add new enhancements into new operating modes. As an example, 32-bit Protected mode is the mode of operation required to run 32-bit programs. So when you run a 32-bit OS, Windows switches the CPU into 32-bit protected mode, allowing it to run 32-bit code as well as utilize the FEATURES of the 32-bit Processor. running 64-bit code requires that the CPU be in what is referred to as "64-bit Long mode" but may as well just be called 64-bit protected mode. It's basically the same idea as 32-bit protected mode, with enhancements and new features added to the new mode to prevent introducing possible compatibility problems with old software. It should be obvious now why running a 32-bit OS on a 64-bit platform prevents 64-bit programs from being run. It is because in that case even though the hardware is 64-bit, because it is running a 32-bit operating system and that 32-bit operating system switches to 32-bit protected mode and assumes and uses the system as if it is in fact just 32-bit, no 64-bit code can be run. A history of the development of the computer will show that the purpose of a hug-level language was to make it easier for humans to program machines. This FIRST computer I built did not have a loader in ROM. Instead, I have to enter the code with a row of switches that represented the binary code for each instruction. Unable to memorize the sequence e, I have to use a written list of numbers to help me set the binary codes. So the loader in programmed by hand would then read a high-level language from a tape. The high-level language let me use a console to write programs in BASIC. Those were the old days. |
|
| 1681. |
Solve : login to telnet from batch script? |
|
Answer» I was able to set up a batch file to open a telnet session, but I still have to type in my username and password for the session to actually start. Is there any way to set up the batch file to automatically enter my username and password? Hello friend Try using some Telnet switches:Like a phoenix rising from the ashes, old posts spring forth to haunt us. You do realize this post is over 2 years old, right? You may need a working knowledge of how telnet prompts for parameters. Try combining the two responses above: echo password | telnet -l username IPaddress Be aware that putting unencrypted passwords into scripts/batch files is a security breach. Many programs will choke on the pipe; let's hope MICROSOFT followed their own standards. Good luck. Thanks for the reply.. I'm not too sure where this comes in... I have created a ".BAT" file inside it has this commands ---------------------------------------- c:\windows\system32\telnet.exe ---------------------------------------- this will open the telnet. Where do I go from here? I would like to login the username and password using the BAT file. is this possible? Did you run what was posted? echo password | telnet -l username IPaddress What were the results? Can you post the console output. If telnet cannot accept input from the pipe, it may be possible to redirect input from a file, but it will be necessary to see the sequence telnet requests the input. Of course telnet may only take the password from the keyboard in which case you will be SOL. Let us know. If the telnet userid and password are the same ones you use for Windows, try using the -a switch: Code: [Select]telnet -a IPaddress alternatively you can use other languages such as Perl that has telnet modules to do this task. eg Code: [Select] use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $t->open("hostname"); $t->login($username, $passwd); @lines = $t->cmd("who"); print @lines; more information here if you are interested.Yes. It is possible with help of another executable called telnetd.exe. I have developed this executable to automate telnetd.exe(http://myresearchdev.blogspot.sg/) session using windows batch file. Usage telnetd.exe script.txt scripts.txt -> for the telnet commands After the execution of the batch file you can seelogs from telnetlog.txt. This telnetlog.txt will help you to troubleshoot the commands and responses. |
|
| 1682. |
Solve : Powershell Capture Result? |
|
Answer» PS C:\> $a = [string]"This string CONTAINS a number of letters" |
|
| 1683. |
Solve : Mapped Network Printer and Network Drive? |
|
Answer» Dear All, |
|
| 1684. |
Solve : Host automation via MS Access 2007 VBA? |
|
Answer» Greetings all. I currently use a 3270 terminal emulator made by NetManage to connect to our mainframe. It comes with a VBA SCRIPT editor that can automate tasks with VBA. As long as I have the 3270 emulator open and connected, the VBA editor can control the screen. I noticed there is a reference in MS Access for "NetManage WinHLL Automation Server". After some googling, what I GATHER is that the underlying dll, 'NMWhll.dll' is there for the purpose of host automation via any supporting COM container, such as MS Access' VBA editor, and I am gathering this library is how the NetManage VBA editor connects to the host. I can peruse the object PROPERTIES of NMWhll, but I can't figure out how to connect to the host. I'm thinking that from MS Access, I could use the automation object to do things like 'sendkey', 'readscreen', etc that are possible from within the VBA editor provided by NetManage. I realize this is grabbing at straws, but I was wondering if anyone out there knows anything about emulation via MS Access VBA. Thank you. |
|
| 1685. |
Solve : HELP FOR C++ BEGINNER? |
|
Answer» I just started learning C++ and i got this assignment to write a program that writes: |
|
| 1686. |
Solve : Help Adding 'Move To' Option To The Right-Click Context Menu? |
|
Answer» I want to add an option to my context menus, to be able to MOVE folders and files that I choose, by right-clicking on them, to a specific folder on my DESKTOP. |
|
| 1687. |
Solve : How to do pagination in ms-access 2007 using VBA? |
|
Answer» How to do PAGINATION in ms-access 2007 USING VBA |
|
| 1688. |
Solve : Welcoming the new intern? |
|
Answer» So we have a new intern at our design firm. I came up with this code so far, what I would like is when he clicks SOLID Works 2014 it ACTIVATES my script. How do i achieve my goal? |
|
| 1689. |
Solve : No Files Command Via MS DOS For A Memory Stick (Help Needed)? |
|
Answer» Hi Everyone Any Suggestions Salmon Trout If is newly purchased and does not work it could be a fake. Often very large size flash sticks at tempting prices on eBay are fakes or manufacturing rejects. Alternatively it could be genuine but defective. Thanks for your response Salmon Trout yeah the said stick is certainly defective for example when I type the following syntax line in MS DOS which is:-FORMAT E: /FS:NTFS /Q It comes back with a response stating it can't carry out the second NTFS format because the that said part is Un-write-able which is annoying also I'm having problems finding my PC's Recovery Council because I READ on the Microsoft Website that if I can get my MS DOS into Recovery Council Mode there is a command named 'Boot-Fix' which might rectify said problem on said stick. When I plug said stick in my PC recognizes it, it states that said disk/stick is @ present is in Raw Mode it states it's 125 GB in size yet the Pie Chart in Properties shows that said Pie Chart is full up (All Blue) instead of being Free (Pink Color) & as mentioned before it has no Files whatsoever @ present associated with it. So it's certainly a defective drive. There is a Windows utility called Chkflsh which I use to test flash drives http://mikelab.kiev.ua/index_en.php?page=PROGRAMS/chkflsh_en Thanks for the Info Salmon Trout I've checked out that Link you mentioned & downloaded Check Flash Version 1.6 I'll let you know in due course how I get on with running the said utility program. Hopefully it will eradicate the flaw which it was stuck in & I will be able to retrieve the defective drive. It also takes a few hours to run so I will leave another comment over the next few days Once again thank you very much for your very valuable help & As mentioned I'll leave a response over the next few days until then I hope you have a pleasant week ahead Sincerely JJM1920 :-) :-) Quote from: JJM1920 on August 25, 2014, 06:21:41 AM Hopefully it will eradicate the flaw which it was stuck in As far as I know, Check Flash just does what its name suggests: it checks flash drives and tells you if they are working or not. I do not think it can fix broken or fake drives. |
|
| 1690. |
Solve : Moving a object in Java for Android? |
|
Answer» I'm developing a SMALL Android app and I've encountered such a problem. I WANT to move a object across the screen in a particular amount of time (1 second), regardless of the screen size or density. I TRIED moving the object with DPI, but I don't get the same result on different SCREENS |
|
| 1691. |
Solve : help w/procedure? |
|
Answer» I'm coding up a billing doc. If an ACCOUNT# owes for several purchases this month, |
|
| 1692. |
Solve : Excel VB script to change sheet over certain period? |
|
Answer» Hello, |
|
| 1693. |
Solve : Assembly language Loop (Debug.com)? |
|
Answer» You could use cx, requjiires more PUSH and pop. |
|
| 1694. |
Solve : Maybe this is right? |
|
Answer» To start If I am in the wrong place I am sorry..I will keep short if for some reason you want me else where..For about three years I have had a problem that know one will look past face value..So I have been noseing around in PLACES probobly should not have been.. My experiance on a computer is what I have learned in this quest.. Three diffrent computers and installs of windows more times then I can count.. I loose authority I can not access programs after a while graphics and desktop BACKGROUND change can not get proper use out of audio.. Just to name a few.. Did a complete supposeabley clean a couple days ago..I uunderstand windows.old. I do not understand $inplace~tr or $windows~Q..I ran accross a "SI" file sometimes plural attached to a recyclebin..If I could open would be empty..One day I thought i would try something new.. I was useing a Maxthon cloud browser. I dragged the file into browser found a complete system,,I think comple with templetesscripts mannyy manny things all those files that when you run a program to scan for degraded reg entries .. Will always show but when you try and clean they cant FIND..I have tryed antivirus sites and forums..Bleeping computer ,windows 7 forum to many to name.. Trying to get UVK ultra virus killer to look at things but like everywhere else know one will look pasr saying thats a legit program.. My therory is what ever it is call started as maybe a trojan now is using legitimate programs like system restore windows update maintenance programs imui files netframework.. and rewriteing or adding to use triggers to install very fast do ther thing then with another trigger UNINSTALL very quick..I dont understand all this tohkens for authoriyu.. But I would think that a microsoft certifacate would be up to date.. I would like to thank anyone that has read threw to this point.. Any help would be very much appreciated.. Again Thankyou. Bill I will attach a log file from a service that uvk offers that I did not install or setup I use portable http://en.wikipedia.org/wiki/MalwareAnd that is only part of the story. I would really like to thank you for takeing the time to respond.. I was checking to see maybe this was the way to go about it.. Like I said about the other forums and malware techs.. There advisewas to go to folder options and make it so I could not see the stuff. I hope yours is diffrent three years you are the first to say I MAY have a problem..I can not remember the authors name. But in the sixties he wrote "This country would be taken over,Without a shot being fired".. Again thankyou.. If you ever get bohred.. and want to see a well thought out plan that I think was used by the indians.. Apache I beleive |
|
| 1695. |
Solve : Visual Studio 2013 - cannot find specific file? |
|
Answer» Hello there, ...Please read over the ARTICLE above and come back here. I will not be able to help you personally, but somebody else will. Quote from: HitsugayaHisagi on September 24, 2014, 09:54:48 AM building was successNot if it was the code you provided. -getX() is declared as returning an int in the class definition, but your implementation has it defined as returning void. -you define an implementation for getY(), but the class has no definition. -Both the implementation getY/GetY methods have no return value, but you are trying to return values. -you reference cout and cin, but they are out of scope because you do not specify the std:: namespace either when you use them or in a "using namespace" statement. -the "#include" should be #include, because according to the C++ specifications standard C++ library header files do not have a .h file extension. I got it to compile by fixing these errors (fixing the getX() and getY() implementations, adding the getY() method to the class definition, adding "using namespace std;" after the includes, and changing iostream.h to iostream. Thank you so much for replying! I did some fixing on the program, but the problem is still there. Saying that... unable to start program, system cannot find specific file. Here's the edited one. //this serves as driver (main) for class Point //initiates the class Point and call methods from class Point #include using namespace std; int main() { //create a new instance of a class Point Point apoint; int x,y; cout<<"Type a nunmber for x:"; cin>> x; cout<<"Type a number for y:"; cin>> y; //invoke methods apoint.setX(x); apoint.setY(y); //display output via methods getX & getY cout<<"\n The numbers from the Point object are x = "<cout<<"\n y = "< return 0; } // program declares a class Point for var x & y class Point { private: int x,y; //point coordinate public: void setX(int val); void setY(int val); int getX(); int getY(); }; // class Point void Point::setX(int val) {x=val;}; void Point::setY(int val) {y=val;}; int Point::getX() {return x;}; int Point::getY() {return y;}; No building error. No warning. I did ask my friends about this problem too, but they weren't sure either. Some one suggested it could be the setting problem. Any suggestions on it? Or is it still the coding? Thank you again!! That doesn't build either. Code: [Select]Error 1 error C2065: 'Point' : undeclared IDENTIFIER testpoint.cpp 15 1 testPoint Error 2 error C2146: syntax error : missing ';' before identifier 'apoint' testpoint.cpp 15 1 testPoint Error 3 error C2065: 'apoint' : undeclared identifier testpoint.cpp 15 1 testPoint Error 4 error C2065: 'apoint' : undeclared identifier testpoint.cpp 24 1 testPoint Error 5 error C2228: left of '.setX' must have class/struct/union testpoint.cpp 24 1 testPoint Error 6 error C2065: 'apoint' : undeclared identifier testpoint.cpp 25 1 testPoint Error 7 error C2228: left of '.setY' must have class/struct/union testpoint.cpp 25 1 testPoint Error 8 error C2065: 'apoint' : undeclared identifier testpoint.cpp 29 1 testPoint Error 9 error C2228: left of '.getX' must have class/struct/union testpoint.cpp 29 1 testPoint Error 10 error C2065: 'apoint' : undeclared identifier testpoint.cpp 30 1 testPoint Error 11 error C2228: left of '.getY' must have class/struct/union testpoint.cpp 30 1 testPoint The Point class is declared AFTER you are using it. That doesn't work. If I move the class definition such that it appears before the main ROUTINE it works. |
|
| 1696. |
Solve : Found a bug in the ShuntingYard function(with functions)!? |
|
Answer» Hi everyone , "At the comma it finds a ( immediately so never executes the loop body." so is this my mistake or did i followed the example from Wikipedia right?: Quote If the token is a right parenthesis: Quote it also throws a subscript out of range error when POP() is called and the array only has one item. tried it with just one item and it works fine here: input = split("function") |
|
| 1697. |
Solve : visual basic script out of bounds? |
|
Answer» So I'm attempting to LOOP through a text file in vbs. The problem seems to be occurring when I'm grabbing the line of text. If someone more versed in visual basic could help me spot the error, it would be much appreciated. |
|
| 1698. |
Solve : Command Prompt script to transfer files from Win 7 to Win XP? |
|
Answer» Code: [Select]dir c:\data -r | ? {!($_.psiscontainer) -AND $_.lastwritetime -gt (get-date).date} | Somebody else will help with your script.Umm. Do you not RECOGNIZE that as PowerShell code? Yes, I bought a book on Power Shell. Maybe I will read it when there is something that I can not do with stuff that is already in a figurative box. |
|
| 1699. |
Solve : Can someone please help explain this javascript function in your own words?? |
|
Answer» http://jsbin.com/ruzurorokofu/1/edit If anyone could be a great help and help me understand what this javascript function is trying to accomplish? Any brief explanation would be great Code: [Select]/* Engagement Score */ s.eVar5=s.engagementScore('event31','s.pageName|products|1>s.events|event6|1>s.eVar3|competitiveMatrix.pdf|1>s.pageName|webLeadsForm:complete|1>s.events|purchase|1>s.events|event4|1>s.events|scView|1'); /* Engagement Score Tracking */ s.engagementScore = new Function("e","l","c",""); var A,B,C,D,E,F,G,H,I,J; I=J=''; A=s.split(l,'>'); B=A.length; E=c?c:'s_ES'; //D=value of cookie with name 'E' D=s.c_r(E); if(!D){ for(C=0;C<B;C++){ D=D+'0,'; } } D=s.split(D,','); for(C=0;C<B;C++){ F=s.split(A[C],'|'); G=eval(F[0]); if(D[C]==1){ I=I+'1,'; } else if(G!=undefined){ if(G.indexOf(F[1])>-1&&D[C]!=1){ s.events=s.apl(s.events,e,',',2); s.products=s.apl(s.products,';;;;'+e+'='+F[2],',',2); I=I+'1,'; J='+'+F[2]; } else { I=I+'0,'; } } else{ I=I+'0,'; } } s.c_w(E,I,0); return J; s.split=new Function("l","d",""+"var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x"+"++]=l.substring(0,i);l=l.substring(i+d.length);}return a");We are going to need more CONTEXT about what you are trying to do but to me that file looks like it's for Adobe Analytics/Sitecatalyst/Omniture based on the name of some of the variables used.camerongray, It is for SiteCatalyst , which is supposed to track engagement score. Seeing the different variables: pageName|Products, eVar3(matrix.pdf), webleads form COMPLETION page and purchase. What is the newFunction constructor doing with the variables? Is it adding a score value? or is it just seeing if you made a purchase, see if you also engaged with the form completion page, .pdf, or other products? I just need to verify if I am sort of reading this correctly. Not needing a solution, but more what the function is doing to get the engagementScore.Here is some info on the score weights etc: http://blogs.adobe.com/digitalmarketing/analytics/summit-topic-1-visitor-scoring-in-sitecatalyst/ |
|
| 1700. |
Solve : mysql Command line client help? |
|
Answer» Hello |
|