

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.
2151. |
Solve : Redisplaying a JList in Java? |
Answer» I have JList filled with names and a JButton which when clicked deletes the selected item in the JList. The item is now longer in the array that fills the JList because the array is written out and the item is missing but the missing item is still on the screen. How do I GET the item to disappear from the screen? |
|
2152. |
Solve : Choosing a programing language? |
Answer» I NEED something to make a GUI program but that doesn't require any downloads on USER's computers and that can access files (modifying and displaying contents). I think all the current Microsoft Visual Studio stuff requires the dot NET. There has been a public statement the NET has security flaws, so you request is very reasonable.Visual Basic 6 has stopped being made, so I think the same goes for VB5 (and I'm not pirating anything!) But size isn't an EXTREME issue...although the smaller the better.VB6 you probably still can buy a copy of it on Ebay. But .NET apps always require .NET framework.Quote from: macdad- on April 22, 2009, 03:05:53 PM VB6 you probably still can buy a copy of it on Ebay. I'm sorta looking for something that doesn't require payment (free versions are ok though, not demos please). A while ago Dias was talking about FreeBasic and QBasic...do these require .NET and where can I get them if they don't?if you have excel, you can use VBAQuote from: Helpmeh on April 22, 2009, 03:08:48 PM I'm sorta looking for something that doesn't require payment (free versions are ok though, not demos please). FreeBasic and QBasic(plus JustBasic, use it myself) don't require .NET, they're completely seperate. All three are free: FreeBasic Download\ Just Basic DLoad And QBasic you can get free with MS-DOS 6.22, I believe on MS's website.not to go off topic too much but I'm wondering, is python a useful language? I found a book in my garage that details how to program in python but probably it's something my dad left there.... Quote from: x2543 on April 25, 2009, 06:42:43 PM is python a useful language?of course. Quote from: gh0std0g74 on April 25, 2009, 07:22:33 PM of course. Thought so, but where is it being used? Quote from: x2543 on April 25, 2009, 10:38:50 PM Thought so, but where is it being used?Its a general purpose programming language. you can do a lot of stuffs with it. 1) system administration task eg copy/move files, rename files, etc 2) string manipulation and text processing. 3) With libraries/modules written for it, you can do stuffs like creating PDFs , reading Word/excel documents, crawling the web etc 4) Creating GUIs and many more you might want to read the Python wiki on where its being used.Quote Thought so, but where is it being used? In the places where people use it. Network administrators, system integrator, software engineers, department managers and anybody who needs to get a JOB DONE with information and a computer on a network or off. But python is not used for basket-weaving. But you already knew that after you finished basket-weaving 101.HTAs are quite interesting |
|
2153. |
Solve : memory map and address values? |
Answer» Could anyone tell me how I could find out all about my memory within my motherboard and hard drive so that I can use the pointers I learned about in C++? Also, could you tell me, besides the ASCII values, what the other values in the memory addresses mean, especially how I can access graphics and sound? Thanks. You have some interesting observations. |
|
2154. |
Solve : Function Call argument list parsing...? |
Answer» Over the course of it's development, my Expression evaluator has consistently had issues with it's "ParseArguments" routine, shown below. The idea is, given a string such as "X,14,Sin(12)*56/i,12", which has already been ripped out of a function call parameter list elsewhere in my code, to parse it and return a array of strings representing each argument. In this case, the return would be an array:
I'm not using split because it doesn't work. tell me what the string "34,Sin(1),RANDOM(1,4)" returns. the desired output is {"34","Sin(1)","RANDOM(1,4)"}, but split decides otherwise. the reason is of course that it cares not for brackets, so I keep track of the number of open brackets as I proceed through, and also the number of quotes (again- Split cares not for quotes) Quote from: Geek-9pm on April 22, 2009, 03:39:20 PM As usual, I have no idea of what you are doing. I do better with 'top down' programming. Perhaps you are using queue/stack solution. My parser was originally a Stack-based solution but upon reflection it really ends up as a recursive descent parser. Support for complex numbers and a number of interfaces one can implements plugins through (Ioperable objects that support operations/functions on their instances), and "IEvalEvents" implementors that can add new Functions/Operators to the evaluator as well. The Stack created initially to store the parsed expression is really just a list of tokens (functions, operators, literals) which have all the data they need. The Function and SubExpression types (IT_FUNCTION and IT_SUBEXPRESSION) are most interesting, because they perform no real parsing of the arguments/contents themselves. The SUBEXPRESSION type (with parentheses) simply creates another parser object, setting it's expression to the contents of the paretheses. Same for the Function parameters (Except the function parameters store a number of "CParser" objects in the Linked List that "RipFormula" creates. Because of this, it can Optimize far better. The parser stores each Stack created into a global collection, keyed by the expression used to build it. It consults this collection to determine wether another parser object hasn't already parsed it. If it has, it simply retrieves the stack as stored; otherwise, it rips the formula itself, and then stores the resulting stack. executing, for example: Code: [Select]"Sin(RANDOM(1,10*STORE(X,5))*{1,2,3}" will end up in a grand total of 9 stacks being CACHED. This means that if, for example, a later execution of: [code] 10*STORE(X,5) is performed, anywhere- there will be no need to perform the expensive task of ripping the stack from the string, instead it will just grab it from the stack. Of course, storing all these stacks can me hard on RAM with longer runs, so each "configuration set" (a name given to a set of Plugins and settings; useful for applications that always want to have the parser load plugins specific to the app) each one can specify the maximum number of Cached Parse Stacks. the Purges are performed by deleting old entries from the collection until the count is acceptable. Additionally, it has intrinsic support for method calls on object-type variables. For example, the following would start word and display it, if it's installed: Code: [Select]STORE(Word,CREATEOBJECT("Word.Application"); [emailprotected](True); STORE(Word,Nothing); the @ operator implements eventually) a set of queries to the objects type information and then performs InvokeHook with the appropriate parameters, after inspecting wether the member is a method or property. In any case, I had to fix a few subtle issues with the previous incarnation: Code: [Select]Public Function ParseArguments(ByVal FromString As String, Optional ByVal BracketStart As String = DefaultBracketStart, _ Optional ByVal Bracketend As String = DefaultBracketEnd, Optional ByVal ARGUMENTSEP As String = ARGSEP, Optional ByRef startpos As Long = 1) As String() 'NOTE: this routine REALLY needs to be rewritten! 'full of hacks and kludges... 'ParseArguments Function: 'assumes the given string is a parameter lists. 'keeping track of parentheses and quotes, it finds the next ARGSEP that is not part of some other token. 'Added May 06 2008 10:50 PM: 'recognize the use of a "To" keyword between two arguments. Dim CurrPos As Long Dim SplMake() As String Dim CurrArgument As Long, Char As String Dim inquote As Boolean, BracketCount As Long Dim ArgStart As Long 'If there isn't even a separator in the string, at all, return the string as the single argument If InStr(FromString, ARGUMENTSEP) = 0 Then ReDim SplMake(0) SplMake(0) = FromString ParseArguments = SplMake Exit Function End If If Len(FromString) <= 0 Then Erase SplMake() ParseArguments = SplMake Exit Function End If CurrArgument = 0 CurrPos = startpos ArgStart = CurrPos Do Char = Mid$(FromString, CurrPos, 1) Select Case True Case Char = """" inquote = Not inquote Case inquote And CurrPos < Len(FromString) 'IGNORE!> 'ignore as long as we are in a string. Case InStr(BracketStart, Char) <> 0 And Char <> "" BracketCount = BracketCount + 1 Case InStr(Bracketend, Char) <> 0 And Char <> "" BracketCount = BracketCount - 1 If BracketCount < 0 Then 'Sigh. BracketCount = 0 End If Case InStr(CurrPos, FromString, ARGUMENTSEP) = 0 And BracketCount = 0 And Trim$(Mid$(FromString, CurrPos)) <> "" ReDim Preserve SplMake(CurrArgument) SplMake(CurrArgument) = Mid$(FromString, CurrPos) Exit Do Case Char = ARGUMENTSEP, (CurrPos >= Len(FromString)) 'Stop 'If ((Not Inquote) Or _ (CurrPos >= Len(FromString))) And BracketCount = 0 Then If ((Not inquote) And BracketCount = 0) Or (CurrPos >= Len(FromString)) Then 'wow, that is very strange, heh? 'This will only be true when inquote=false (0) and bracketcount=0 as well. ReDim Preserve SplMake(CurrArgument) SplMake(CurrArgument) = Mid$(FromString, ArgStart, Abs(CurrPos - ArgStart)) If right$(SplMake(CurrArgument), 1) = ARGUMENTSEP Then SplMake(CurrArgument) = Mid$(SplMake(CurrArgument), 1, Len(SplMake(CurrArgument)) - 1) End If CurrArgument = CurrArgument + 1 ArgStart = CurrPos + 1 If CurrPos >= Len(FromString) Then ' If InStr(1, Bracketend, right$(SplMake(CurrArgument - 1), 1), vbTextCompare) <> 0 And BracketCount <= 0 Then ' SplMake(CurrArgument - 1) = Mid$(SplMake(CurrArgument - 1), 1, Len(SplMake(CurrArgument - 1)) - 1) ' End If Exit Do End If End If End Select CurrPos = CurrPos + 1 Loop If UBound(SplMake) = 0 Then If SplMake(0) = "" Then 'there weren't any arguments- return an actual "Empty" array to denote this to the caller. Erase SplMake End If End If startpos = CurrPos ParseArguments = SplMake End Function The core itself implements support for Complex arithmetic, (heh, all I had to do was create an "IOperable" implementing object for Complex numbers, handle the appropriate interface functions and add a variable "i" to a complex number with it's imaginary part set to 1 and the realpart set to 0, and then set that variable as read-only.),Arrays (for example, {1,2,3}*{5,6,7} will work fine). quite an interesting library. [/code]Quote from BC programmer Did you really do that on stone tablets? So, complex numbers is not a FORTRAN thing? NO, IT WAS JUST NOW INVENTED BY INTEL l! http://software.intel.com/en-us/articles/using-sse3-technology-in-algorithms-with-complex-arithmetic-1/ AAahh. The Tylenol was not enough, and I just ran out of Advil. I realize fortran implemented complex numbers as part of the core. Name one Expression evaluator, that I can get for FREE that can do half of what Mine is capable of and you get- well, nothing, I guess. It's the thought that counts. Also, Complex numbers existed in mathematics long before fortran or any computers existed.BC programmer, you need some FORTRAN. Now every day, but once a month may be enough. Just this year the FREE source code for FORTRAN 77 was released. http://www.thefreecountry.com/compilers/fortran.shtml It this is of any value, let me know. I am curios to see how they did the parser way back then. The say there was a FORTRAN interpreter. Huh? I was taught the FORTRAN is NEVER done that way. Did they deceive me? |
|
2155. |
Solve : C++ programing? |
Answer» I can't FIGURE out how to write this program. |
|
2156. |
Solve : How to: I have a file whose filename contains blanks...? |
Answer» I have a file whose filename contains blanks... I am ATTEMPTING to CHECK for the existance of this file using a DOS script... and have not been ABLE to find the proper delimiters so that I can test for the existance of the file. Sample would be: |
|
2157. |
Solve : java JOptionPane? |
Answer» Hello guys, |
|
2158. |
Solve : Find path in the Win Registery? |
Answer» Yes, but if we look at your code: Code: [Select]@echo off & setlocal & set sim=Nothing tells it to USE "The Sims\GameData\Userobjects\filename\filename.iff" When I read your code, something tells me the path "The Sims\filename\filename.iff" would be used, which I don't get why isn't I mean, Where does it get "GameData\UserObjects\" from? It's not even in the script, or defined in the win registeryQuote from: Ryder17z on April 18, 2009, 11:14:38 AM Yes, but if we look at your code:Nothing tells it to use "The Sims\GameData\Userobjects\filename\filename.iff"how would i know where it get the value, why dont you tell me. i am not the one who makes the sim. and i even never play the sims. i only post code based on your description, assuming %installpath%\gamedata\userobjects\filename\ is the default folder for iff files. ( see below ) Quote from: Ryder17z on April 18, 2009, 05:03:34 AM It copies "filename.iff" to "The Sims\GameData\Userobjects\filename\finename.iff" - which is the correct folderHow can I tell you if I don't know the answear? The path in the script is different than the actual path used /\ /\ | | | | "The Sims\filename.iff" | || || "The Sims\GameData\Userobjects\filename\filename.iff" I feel confused change the path in the script to be the actual path used. No need to do since it works already, but it works like MAGIC, nobody knows how, they just know it works Code: [Select]set q="HKLM\software\maxis\the sims" /v installpath this takes it from the registry. |
|
2159. |
Solve : Hardware and ASM? |
Answer» Due to some reasons, I had to LEARN Assembly urgently.
with ASM. I would like to have example code. Thanks in advance. Sure looks like school work. Why USE ASM? How do I MAKE you guys believe that it is not school work. If it was school work, why would I take the PITA to get here, was it not simpler to refer the textbook? (AND.. AND.. WE ARE JUST TAUGHT S**KING QBASIC IN SCHOOL) I went forward to C/C++, and Assembly just because of my interest. Have I made it sure that it iS NO SCHOOLWORK?? If you display such an attitude, you will get very little help. a school that teaches QBASIC? the Open/CloseCD can be done through MCI commands. of course you'll need to set up the parameters and so forth and call the procedure itself in mmsystem or whatever the dll is. the second one is impossible in any language as far as I know. I imagine being able to disable a router remotely would be a fairly big security flaw even if it only COULD occur from within the local LAN.Sorry for getting late. Dias De Verano: Sorry, I was too irritated (due to some other people around in here) while making that post. BC_Programmer: Thanks for help. I can reboot the router from its configuration page. So I thought that it should be possible to do so with Assembly as well. Quote from: Ashutosh32 on February 27, 2009, 07:57:10 AM I can reboot the router from its configuration page. So I thought that it should be possible to do so with Assembly as well. well you can, but it won't be easy. you'll literally need to send the router specific packets that would mirror those sent by a PC- this includes keeping track of a open TCP/IP connection, and usually a security layer to boot. So you would need to be able to program the network card to send those packets and parse any replies back from the router as well in order to determine the current state of the router. Really by "impossible" I meant "prohibitively time consuming", it would take a long time to perfect- and that portion of the program would only work with a specific model of router, and maybe even only a specific firmware revision. |
|
2160. |
Solve : Logging in failing (batch)? |
Answer» I am TRYING to make get a user to log in, to use the batch script, but the login is failing in the second FOR loop... I did not see that... |
|
2161. |
Solve : Need Visual c# help? |
Answer» Hello, i'm new to this forum and I have a question. USING Microsoft visual c# how do I make a new window POP up. |
|
2162. |
Solve : Batch script to check files? |
Answer» Experts Thanks Ghostdog, but i need script which needs to be scheduled and hence looking for some batch scriptopen your editor, type in perl myscript.pl save as mybatch.bat. Use the task scheduler to run it periodically. Otherwise, wait for other solutions to come by.i tried to save the perl script to mybatch.bat and ran that script, didnt work. No- he means you save the perl file as a perl file (.pl) and then create a small batch file that invokes the perl interpreter with t hat perl code. you can then set up an automated task using the batch just as you would have given a pure batch solution.ok got it , i installed active perl to run this. Anyways i need a batch script that does the same. Thanks ghostdog for the perl script. can i have text file that has list of file names and then pass each file name as parameter to check for timestamp and move to destination folder.Quote from: satya85 on April 21, 2009, 10:08:20 AM ok got it , i installed active perl to run this. Anyways i need a batch script that does the same. Thanks ghostdog for the perl script.sure Code: [Select]use File::stat; use Time::localtime; use File::Copy; my $destination = "some path"; open(FH,"<", "file") or die "Cannot open file:$!"; while (<FH>){ CHOMP; #get rid of newline my $st = stat($_) or die "No $_: $!"; my $timestamp = $st->mtime; #get file modified time in SECS since epoch # depending on how you want to check time stamp ..code here move($_,$destination); } close(FH); please read up the documentation to get started. perldoc perl. |
|
2163. |
Solve : Run multiple files sequentially using Batch file commands? |
Answer» I have problem regarding autorun. Thanx for giving such name to me. if you r get it ur SELF dickw33d. This is not script kiddy help site. Quote from: Reno on April 15, 2009, 05:05:43 AM no, it cannot be done in batch. PERIOD.Actually it can...but the maliciousness that would befall if I said it here would get it removed if I did say it.It's easy. I already gave them a hint. But chances are they won't follow it anyway.Quote from: BC_Programmer on April 19, 2009, 10:58:03 AM It's easy. I already gave them a hint. But chances are they won't follow it anyway.Even then it doesn't always work...my computer requires you to start something else then CALL the batch file. |
|
2164. |
Solve : C# Help, How do I find the amount of letters in a string?? |
Answer» I would like to know how I can know how MANY letters are in the string with out KNOWING the word? if you want to know how long it is, there is a method for that. If you literally need to count the letters A-Z as they appear in the string, then you'll need to loop through the characters in the string, and each one that is A-Z increments the count..I'm not interested in the letters A - Z just how long the word is... How do I use the method you suggest? BTW thanks for the quick reply!Quote from: hibyy on February 27, 2009, 08:22:58 PM Quote from: BC_Programmer on February 27, 2009, 08:16:23 PMif you want to know how long it is, there is a method for that. If you literally need to count the letters A-Z as they appear in the string, then you'll need to loop through the characters in the string, and each one that is A-Z increments the count..I'm not interested in the letters A - Z just how long the word is... In VB6 it is the "LEN" function- for .NET it is the string method, "length". For example; if your variable was strval, the length would be "strval.Length()" Thanks this will help me a lot! ERROR? Fixed public class word { public static void Main() { string EW = Console.ReadLine(); char o = EW[0]; string L = EW.Length(); if ( EW.Length == 2) char t =EW[1]; } } I got an error! (7,15): error CS0118: 'string.Length' denotes a 'property' where a 'method' was expected How do I fix this? |
|
2165. |
Solve : how can i do paging in vb6 using msaccess2003?? |
Answer» good day guys!, |
|
2166. |
Solve : Intel 8086 Processor for external hardware? |
Answer» I'm working on kinda robotics with no A-B-Cs of it. |
|
2167. |
Solve : Masking user input. (Batch+VBS)? |
Answer» I posted this in the MS-DOS section, but this STRAYS from batch, and I need more help. I need to mask the user's input, with an asterisk or a dot thing. I TRIED the other solutions, which accept 1 letter at a time, but that can't work because there can be over 30 possible passwords, listed in a file. Here is what I am trying to do, but hiding the password from prying eyes. why not start learning some other languages and using already made modules. eg Perl Ghostdog, you have to pay to see a solution on Experts Exchange! Even for the "free 7 day trial" you need a credit card, and I wouldn't bother. Unless you remember to cancel, they'll hit you for $12.95 per month. Googling for scripts and "solutions" , and passing them off as your own work, is all very well, if you do it with more care. Anyhow, I didn't get this via Googling, I wrote it myself, it shows the general principles. This sort of thing is, you may as well say, impossible in either batch or VBS. Qbasic / FreeBasic The calling batch could read the entered password from the text file, and then delete the file at once. Code: [Select]' password collector password$ = "" mask$ = "*" PRINT "Enter password : "; DO DO k$ = INKEY$ LOOP UNTIL k$ <> "" kval = ASC(k$) IF kval = 13 THEN EXIT DO ELSE PRINT mask$; password$ = password$ + k$ END IF LOOP OPEN "Password.txt" FOR OUTPUT AS #1 PRINT #1, password$ CLOSE #1 SYSTEMQuote from: Dias de verano on April 19, 2009, 02:42:58 AM Ghostdog, you have to pay to see a solution on Experts Exchange!don't think you need to pay. long ago i created a user with a valid email address without paying anything. however if the paying scheme is just recently implemented, then too bad. Quote Googling for scripts and "solutions" , and passing them off as your own work, is all very well, if you do it with more care.wow, I didn't say its my own work, did i? I am only helping providing him a link, just like everyone else is doing. Quote from: gh0std0g74 on April 19, 2009, 02:52:24 AM don't think you need to pay. You need to pay. Standard is $12.95 a month. Quote long ago i created a user with a valid email address without paying anything. however if the paying scheme is just recently implemented, then too bad. Yeah right. Like I really believe that! I've been aware of EE for at least 5 years, they are usually high up in Google searches for scripting solutions, and it has always been a pay site. Quote wow, I didn't say its my own work, did i? You didn't say otherwise. Quote I am only helping providing him a link, just like everyone else is doing. Not "everyone". Quote from: Dias de verano on April 19, 2009, 03:03:20 AM You need to pay. Standard is $12.95 a month.too bad. maybe the scheme for solution provider(free) is different than the one asking for solution. Quote Yeah right. Like I really believe that! I've been aware of EE for at least 5 years, they are usually high up in Google searches for scripting solutions, and it has always been a pay site.i am not paying. Period. |
|
2168. |
Solve : tcl bot help please?? |
Answer» Hey everyone. I'm VERY new to programming, and my first little project is playing AROUND with a bot i have on aMSN. I'm trying to get it to respond to specific phrases rather than single keywords, but I'm not sure exactly what I have to do. |
|
2169. |
Solve : For a newbie, C++ or Java or what?? |
Answer» meh. I'm in no position to judge it anymore; heck I discarded my first project. My second project, I still have. a Spaceship game called "blackspace"... except it's mostly programmed in VB2 and a few things won't load properly... I seem to get a "Statement too complex" error when trying to load almost all of my old projects. (64 projects in my VBPROJ directory- and 165 within a "OLDSTUFF" folder beneath that. my "gravgame", a few projects I made for printing passwords on labels for the start of a school year... which fell through because the goofs higher up in the school district didn't send the excel spreadsheet on time. This is all very interesting. And it could illustrate why a Microsoft language is not a good place for a newbie to start out. you can still use ASM with VB6- in fact I use it to subclass windows without crashing. The trick is in the API call- you are "supposed" to pass in a pointer to a procedure that windows will call- but if you instead point it to a string VARIABLE with assembled ASM then it will actually execute the machine code that is present in the string variable. But why the slimy hack? VB has an "AddressOf" operator, after all. The idea is to make it possible for CLASS instances to subclass window MESSAGES, rather then require a Module to contain the WindowProc() and route the message to the proper Class instance based on the hwnd or something. Additionally it prevents the VB6 IDE from crashing during testing, since the ASM code remains in memory and is thus a valid JMP location throughout; before this "hack" the addressOf method was unstable during debugging, since pushing the stop button would mean that the module containing the windowproc is unloaded- but windows still calls it for messages on the window, such as the WM_CLOSE message; it calls nonexistent code and crashes. HARD... As far as "outperforming" the standard routines- this is generally quite easy via API routines. For example, instead of using DIR$, one can use the FindFirstFile(),FindNextFile() and FindClose() functions. This has the benefit of allowing recursive calls which aren't directly possible with DIR$() without cacheing folder names and recursing on them at the end of the procedure. After dabbling with ASM for the subclassing code... well I THINK any future ASM work will avoid the windows platform...Visual basic just seems to have added alot more that it's ancestor and smaller dialects of it. |
|
2170. |
Solve : programe for keypressing in keyboard? |
Answer» can any ONE tell me the coding for automatically press key in keyboard Tell us more about what you're trying to accomplish, please.i am now trying to install more than one software on a single CLICK by clicking one batch file, usually we need to click next and next for installing software through keyboard, if i know the coding for key pressing its very useful for me thats whyBatch files cannot do these magical things.ok guide me how to do those things. bcos i am working as a system engg this is HELPFUL for me if i know. pls help meBy the time you write this PROGRAM according to all the software you need to install (right amounts of Enters, Tabs, ect), you would have already installed them. Batch files cannot do these magical things.Did the OP specify batch? You can do this with Sendkeys. http://lmgtfy.com/?q=Sendkeys+MSDNI wonder if the old escape codes for ASCII characters still work? |
|
2171. |
Solve : help with php string please.? |
Answer» Hi, know in php substr() does something similar, but it takes the int as the starting reference, but I want the starting reference to be a string. Find the substring (word) to be used as the starting reference. Add the length of the word to the integer location of the word. Add 1 for the space. The result should be the integer starting point of the identified string. On the back end, find the starting location of the word used as the ending reference. Subtract 1 for the space. The result should be the ending point of the identified string. Good luck. Can you post the strings you have?Thanks SIDEWINDER for the reply. sorry for being out for some time. Actually the reference word keeps changing. But I can identify it easily using the '_xx' where xx is any two chars. For example, I want to read the below string. So I need to store the sub string from '_ab' to '_ti' into one variable and from '_ti' to '_li' into another variable and so on... example string: "_ab One-year-ahead forecasts _ti national institutes of GDP growth _li European _ab Secondary information _ti exponential forecasting _ab"... This is just one example of the kind of strings I will be using. Thanks kpac for help in advance. |
|
2172. |
Solve : C program is not working? |
Answer» RECENTLY, I have downloaded C PROGRAM from www.bestsoftware4download.com/software/t-free-c-free-download-bonbwrdh.html. AND i WROTE the program as instructed but program is not working . Is it a problem with C or C COMPILER? Do i have to download C Compiler too? Please help.You downloaded an C 'IDE' and not a C 'Program'. Assuming that you have installed it right, and are able to atleast run it, and are getting errors when trying to compile a program, it would be better to list the errors or look up the help section (most IDEs have it) for the error. |
|
2173. |
Solve : pls check it out? |
Answer» #include
I might not have listed all the errors.. but I have put up the corrected code which runs... Code: [Select]#include<iostream> #include<math.h> using namespace std; class calc { private: public : double add(double ,double ); }; double calc::add(double x ,double y) { double sum=0; sum=x+y; return sum; } int main() { calc c1; int x; double a,b; do { cout<<"1. add"; cout<<"enter ur choice ::::;"; cin>>x; switch(x) { case 1: double sum=0; cout<<"enter 1st value::::"; cin>>a; cout<<"enter the 2nd no.:::;"; cin>>b; sum=( c1.add(a,b)); cout<<"value of sum is ::::"<<sum<<endl; } } while(1); } There should be a way to exit the do-while loop. Looking at the code, it SEEMS that you have JUMPED too fast to understand the basic concepts correctly and this is not good. |
|
2174. |
Solve : Script writing in Macromedia Flash? |
Answer» Dear |
|
2175. |
Solve : Batch script how to check a variable if all letters and/or numbers? |
Answer» I need to check a variable in my dos batch script if it contains all letter and/or all numbers. |
|
2176. |
Solve : Message show in network user's PC? |
Answer» Dear pls anybody of my query.Please don't bump your own thread, we'll get to you soon... You COULD use net send...but I have no idea how to use net send in VB6. |
|
2177. |
Solve : permutation of a string in c++? |
Answer» formulate an algorithm(pseudocode) that PERMUTES and displays the permutations of a string of consisting of up to 20 words.Write a program that implements your algorithm.use your program to investigate the number of acceptable phrases that may be generated from the phrase;The good COLLEGE is worth BELONGING to and so we will be part of it.Homework?heh, your SIGNATURE reads great as part of that post. He could have atleast REPHRASED it so that it would be harder to understand that it is homework. help her pliz |
|
2178. |
Solve : excel programming macro on web change event? |
Answer» I need to write a macro to capture the data from one SHEET, and write to another sheet with time stamp. |
|
2179. |
Solve : stuck in Start up DOS? |
Answer» I don not know if this is the right place but I gotta start somewhere |
|
2180. |
Solve : VB.Net string analysis? (search for keyword in string)? |
Answer» SAY: (This code is imperfect, writing it in the message BOX =D) Code: [Select]Dim str as string = "The apple fell from the apple tree" How do I, under x-event, to search the string 'str' for the WORD apple and return how many occurances were found? Can't you USE system.IO.Streamreader? I remember something about that from a while back, but I'm not sure. TIA, :Liami think you can use BCProgrammer logic, he posted it somewhere pseudocode: n = (str.length - Replace(str,"apple","").length) / 5 |
|
2181. |
Solve : Need to create a simple batch. Any help?? |
Answer» Hi, |
|
2182. |
Solve : Splash Screen on Loading VB08? |
Answer» In VB 2008 |
|
2183. |
Solve : Stupid Noob in C++ be me, help me out?? |
Answer» I am new to C++ having switched over from batch. I am trying to make a number counter to, but dont seem to be having much luck. Every time i try to compile it says i have an EXPRESSION syntax error. Dont give me a new program, just tell me what is wrong with mine. the loop: too many << operators... I would guess you picked those up from batch lol thank you so much! Quote from: BC_Programmer on March 01, 2009, 09:37:28 PM Quote from: dirt1996 on March 01, 2009, 06:12:01 PMbut how do i fix this? Code: [Select]count << x << endl;the loop: Can you put it in the code for me. So the loop part isnt necessary is what ur saying? Again I am so sorry for being DIFFICULT that would just be the one line- I believe the reason it isn't working is the lack of spaces Even with that one line I typo'd Code: [Select]#include <IOSTREAM> using namespace std; int main(int argc, char* argv[]) { int tminus; cout << "Please enter number to count to:"; cin >> tminus; cin.ignore(); for ( int x = 0; x <= tminus ; x++ ) { cout << x <<endl; } cin.get(); } that code compiles and runs with Microsoft Visual C++ 6.Sorry for being stupid, thank you so much! |
|
2184. |
Solve : Type mismatch error VB8? |
Answer» This is my code Never mind I found it ( couldn't delete message ) Do share. wow, such intuitive control names... Check1, text5, text7... If text5 was bound to a data SOURCE then the recordset would need to be commited to see a CHANGE in the resulting file. And if it wasn't bound at all then controls revert to their design time state when the program is run.What do you mean? I always call my variables Variable1 Variable2 Variable3 etc. Once I got up to Variable2377. That was a real big program. pah, numbers? what about Code: [Select]variabletwothousandthreehundredseventyseven +=variabletoaddtovariabletwothousandthreehundredseventyseven; Now that's what I call programming. By the way, do you agree that arrays are for wimps? pah, Arrays. Arrays are for wimps, definitely. Why, these kids today, with their fancy "arrays" and their Silly "objects" and "Frameworks". Fiddlesticks, I say why, they cheat at Quicksort by using these "arrays", real quicksort means to iteratively sort properly named variables, none of this arySort() business. no sir, real sorting algorithms look like this: Code: [Select]Public Sub SortValues(A as Integer, B as Integer, C as Integer, _ E as Integer, F as Integer, G as Integer, _ H as Integer, I as Integer,J as Integer, K as Integer, _ L as Integer, M as Integer,N as Integer, O as Integer, P as Integer, _ Q As Integer, R as Integer, S as Integer, T As Integer, U As Integer, V as Integer, _ W as Integer, X as Integer, Y as Integer, Z as Integer) Which should sort the 26 values passed. Of course wimpy programmers will whine "but what if I want to sort more then 26 values" Then you are too picky! there is no reason to sort more then 26 letters since there can only be 26. And of course they go on, "and why must it be integer" PAH to you newbies and your fancy "Arrays" and your "Data types" Integer is a mans data type, use LONG and you MUST be compensating for SOMETHING, and if you use a "String" type you may as well lay claim to a wet noodle. No Sir, just Integer, and Byte, for the hardcore.WOW !!!!!! I can't believe how much flame I got for this post. It was an example of what I was doing. I AM NOT A PROGRAMMER. I wrote in VB4 many years ago. Now I need a complex program for the company I work for. I am writing it because no one else offers it. Besides I'm a company man. I have never had any schooling and I am doing my best. GIVE ME A BREAKwe're not flaming you... |
|
2185. |
Solve : Duplicate Folders/Files;? |
Answer» I recently bought a HP 4gb laptop from Best Buy that has been causing me huge problems with duplicate files. When I go to My Computer/C:Users/Michael there are 13 files like Contacts, Desktop, Docs, Links, etc. They SOUND more like folders to me. |
|
2186. |
Solve : Need a Java Applet to utilize Java Script Functions? |
Answer» I want my applet to use java script funcions and code. I have been researching this forever and can not find an answer. It use to be able to be done in NETSCAPE USING import netscape.javascript.*; or something along this line. |
|
2187. |
Solve : Date and time in batch file? |
Answer» I have a small PROBLEM: I use a batch file that runs an AUTOMATIC backup of a software and FILLS a log-file of backup process. At the moment I use date /t and time /t commands with a pre-typed strings of text to monitor different sub processes in the backup, but it writes the time and string on SEPARATE row whereas I would like them on the same row, like this: |
|
2188. |
Solve : BCStreams- alternate data streams utility? |
Answer» Yet another ADS enumerator tool |
|
2189. |
Solve : How to send email in visual basic 6? |
Answer» Hello, |
|
2190. |
Solve : help create memory gamein javascript? |
Answer» I need to create a MEMORY game in JAVASCRIPT and have no clue as to where I should beginOkay, start with the BASICS first. HTTP://www.w3schools.com/js/default.asp |
|
2191. |
Solve : file batch? |
Answer» How execute to a client a batch lile who include commands like "attrib" that doesn't work from client in an WINDOWSXP with ADMINISTRATOR and clients. Thanks to all by readybornNot sure what you're looking for. What code do you have now?I edit a file_batch like administrator that, clients can't use. Precisely the command "attrib" (to CHANGE a FILE from hidden mode), don't work for the client so the batch don't run correctly.How come it doesn't work? |
|
2192. |
Solve : DOS Batch File Programming Question? |
Answer» I need to add a command to automatically burn a file on to a dvd, using a program called CommandBurner, to a backup batch file we currently have. Anyway, I just need to know how to fix this IF statement so it does what I need. If the date is either 01-07 AND the day is Tuesday, then execute this command. This is ambigous. Do you know what "either" means? I presume you meant "both". I also presume you are getting the day of the week from somewhere. Code: [Select]set day=%date:~3,2% set num=0 if "%day%"=="07" set /a num=1 if "%dayoftheweek%"=="Tuesday" set /a num=%num%+1 if %num% EQU 2 goto burn goto noburn :burn cd d:\Autoback\CommandBurner\ CmdBurn burn /d d:\Autoback\Daily\ /l %today% /eject goto end :noburn echo not burning :end Thanks for the response. In your statement 'if "%day%"=="07" set /a num=1', what I'm trying to do with the numbers 01-07 is make sure it's the first Tuesday of the month. That's why I use the first 7 days of the week. Is your statement covering all 7 days, or is it only covering the 7th? Will it work if I do this: Code: [Select]if "%day%"<="07" set /a num=1Quote from: Barnicle on January 14, 2009, 07:41:36 AM Thanks for the response. In your statement 'if "%day%"=="07" set /a num=1', what I'm trying to do with the numbers 01-07 is make sure it's the first Tuesday of the month. That's why I use the first 7 days of the week. Is your statement covering all 7 days, or is it only covering the 7th? Will it work if I do this: no. No, it won't work, or no your original statement covers on the 7th day? If so, how can I cover the days from 01, 02, 03...07 You cannot use <= to test for "less than or equal to", is what I meant. That is not correct batch language syntax.Code: [Select]@echo off REM Clearly, you are using US date format REM That is mm/dd/yyyy REM You need to do a numeric test, so use set /a to make the REM day variable a numeric one BUT... REM set /a interprets numbers beginning with a 0 as being octal REM so we have to filter out any leading 0 since 08 and 09 are REM (obviously!) not valid octal numbers and will cause an error and the REM batch will halt. REM test if first digit of day is a zero REM if yes just use 2nd digit if "%date:~3,1%"=="0" ( set /a day=%date:~4,1% ) else ( set /a day=%date:~3,2% ) REM You don't get AND in batch, so we REM have to simulate it. REM set num to 0 set /a num=0 REM if day is less than or equal to 7, add 1 to num if %day% LEQ 7 set /a num=%num%+1 REM if today is Tuesday, add 1 to num if "%dayoftheweek%"=="Tuesday" set /a num=%num%+1 REM if num now equals 2 then both tests are satisfied if %num% EQU 2 goto burn goto noburn :burn echo Day is Tuesday and date is 7th or earlier echo Therefore burning... echo I sure hope there's a writable disk in that burner! echo Press a key when ready... pause > nul cd d:\Autoback\CommandBurner\ CmdBurn burn /d d:\Autoback\Daily\ /l %today% /eject goto end :noburn echo not burning :endExcellent. You the man!Code: [Select]echo Day is Tuesday and date is 7th or earlier Note that I changed this line because I think that <= symbols may screw with the batch execution. Sorry, but I don't see where "dayoftheweek" is getting set. Can that be extracted from %DATE% somehow? Thanks.Quote from: swgivens on March 04, 2009, 03:40:04 PM Sorry, but I don't see where "dayoftheweek" is getting set. Can that be extracted from %DATE% somehow? It isn't being set in that script. The original poster has some way of getting the day of the week which was not specified. Visual Basic Script has a method of getting the day of the week name. to swgivens, here is one of the many methods to get dayoftheweek. Code: [Select]@goto start o70 06 i71 o70 07 i71 q :start @echo off & setlocal enabledelayedexpansion for /f "skip=1" %%a in ('debug ^< %~f0^|find /v "-"') do set x=!x!%%a for /l %%a in (301,1,307) do if 0%%a==%x% goto:burn echo %x%:no burn for today goto:eof :burn echo %x%:its tuesday and date^<^=07, put burn code here note: 03 for tuesday, 01 for sat. maybe someone might find this code useful in the future. |
|
2193. |
Solve : AI Layout Codeing.? |
Answer» is there any layout that i can follow to creat an AI i want to make it so that i can use it with windows. Sad isnt it. Doesnt have to be but dont know enough linux.First off, you should create a command Database for all the commands for it. |
|
2194. |
Solve : VB 2008? |
Answer» I need some help with VB, I am new to programming and feel like I lost too many brain cells as teenager when I try to write my code. /sigh Ohhh I get it. That make sense as the ones that I can't open have been the ones I hit Save Project As to my desktop. You're Welcome! Glad to be of some use! |
|
2195. |
Solve : Set up iPhone deving on Linux? |
Answer» How do I set up a Linux-based machine (Running Fedora 10 and have a Linux Mint ISO on my HD somewhere, could VM or burn it) to develop HOMEBREW for Cydia or Installer? |
|
2196. |
Solve : Visual Basic Help? |
Answer» Hello like Visual Basic 5 is better as a learning tool. Agree completely. Visual Basic 5 has a free "Control creation" edition, and VB6 has a "Learning edition". There are ways to compile the programs as WELL, since- strangely enough, they use the very same C/C++ compiler that VIsual C++ uses(which also has a free version... probably hard to find now, though)! |
|
2197. |
Solve : graphics in dos?? |
Answer» Is there any way to use 2d GRAPHICS in a dos console?Real BIT map graphics? DOS itself does not provide it. But programmers would have to WRITE their own or use a library from a third-party software frim.additionally, the Windows NT platform adds additional "gotchas" for full-screen DOS APPLICATIONS. |
|
2198. |
Solve : Visual FoxPro9 - Variable Declaring...? |
Answer» Greetings EveryOne (Or Should I Say AnyOne?___)! |
|
2199. |
Solve : Batch to Run only on XP machines? |
Answer» I'm looking for batch file command have it run only on XP machines. I'm a bit new to Win management and have looked all over but have not found a line that WORKS. Much thanks!What other operating systems might it run on? Are Windows 95/98/ME a possibility? is NT 3.51 or 4? or are we talking about just 2000 / XP / Vista? What other operating systems might it run on? Are Windows 95/98/ME a possibility? is NT 3.51 or 4? or are we talking about just 2000 / XP / Vista? Just XP and Vista only. I've gotten this far: Quote Ver | Find "XP" > Nul Which works on XP but not Vista. So I think I'm close enough to get it now.@echo off ver | find "Microsoft Windows XP">nul || ( echo This script should only be run on Windows XP pause goto END ) Your code here :end Thanks!! |
|
2200. |
Solve : Programming environments? |
Answer» Just thought I'd make something like the "Show your desktop" threads we see all the time... but for those of us that are programmers... how about development environment? It resets the variables to nothing. It's the code i posted in the batch programs section not long ago. If there is a better way of doing it, please tell me It looks FINE. I just wondered why you were using && and not &. They do different things. action1 & action2 means "do action1 and then do action2" action1 && action2 means "do action1 and if the errorlevel is 0 [i.e. if action1 succeeds] then do action2" I know that && means something different in some other languages. && has a companion, || action1 || action2 means "do action1 and if the errorlevel is 1 or greater [i.e. if action1 fails] then do action2" I use && out of habit, because of the error checking. though in this particular case it doesn't make a difference to the code. FbWhen IBM turned Object REXX over to the open source community, the IDE was discontinued due to 3rd party code considerations. Having had a copy of the IBM IDE, I was able to integrate the old IDE with the new open source code. There is no code autocomplete and minimal color coding. It does allow execution of the script from within the environment, so I guess it qualifies as an IDE. I've also written a few things in C++ using Emacs. This particular screenshot was from a while ago i told Carbon dudeoxide I'd write a process called Carbon.exe so he could run it through the process analysing tool here on CH. But Nathan didn't give it the go ahead. FB [attachment deleted by admin]Quote from: fireballs on January 22, 2009, 04:17:41 AM I've also written a few things in C++ using Emacs. This particular screenshot was from a while ago i told Carbon dudeoxide I'd write a process called Carbon.exe so he could run it through the process analysing tool here on CH. But Nathan didn't give it the go ahead. tssk tssk... look at all those System() calls! You should have used the proper windows API routines to do all those things- mostly the Console Window API routines, which I believe could be used for most of the things you've used "System()" for. Although it was a quick & dirty type of program, not really meant for distribution- just curious as to the existence of all those system() calls, so I thought, "ahhh, he's probably just avoiding including the windows header!" and then it was there...I never said i was any good at it! FBWell I just use NetBeans IDE for Java and for some quick editing I use TextPad(not Notepad or Wordpad lol), and I think I have TrueBasic Bronze some were on my PC. Will try to post pics soon! |
|