Explore topic-wise InterviewSolutions in .

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.

401.

Solve : Generating pseudo-random integers programming language?

Answer»

Hello,

I have time seeking to learn a programming language to make a project that I have some time thinking. I would like to get language that allows me to generate random (pseudo) integers and according to the numbers generated, generate an image e.g. the numbers 1 gets generated then PICTURE number 1 will get generated and so on. I would like to do that in different patterns. Right now I'm trying to do that with Python, but I'm facing some issues. Which program would you recommend? I'm a total beginner regarding computer languages. Thanks,

PS: I also would like to get the number deleted after generated to avoid getting run out of memory. You want to create integer numbers in a short range - right?
Do you want SERIES that never repeats?
For showing images, it should not matter if it repeats after awhile
A method often used is to use a fraction that does not repeat when expressed as a decimal.It does not take much memory. The numbers are not huge. Just the decimal expression goes on forever.
Look here:
https://docs.python.org/2/library/random.html
Quote

This module implements pseudo-random number GENERATORS for various distributions.

For integers, uniform selection from a range. For sequences, uniform selection of a random element, a function to generate a random permutation of a list in-place, and a function for random sampling without replacement.

On the REAL line, there are functions to compute uniform, normal (Gaussian), lognormal, negative exponential, gamma, and beta distributions. For generating distributions of angles, the von Mises distribution is available.

Almost all module functions depend on the basic function random(), which generates a random float uniformly in the semi-open range [0.0, 1.0). Python uses the Mersenne Twister as the core generator. It produces 53-bit PRECISION floats and has a period of 2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographic purposes.
Most of that is way beyond what you need.  Just a simple random number is all you need. The other stuff is for people doing deep statistical studies.
You will not run out of memory. And if you do, Python will let you know.
You'll need to explain what you are trying to do in more detail.  Are these images premade and you'll just pick them at random or are you wanting to generate images by using the random data to define the colours of each pixel at random?
402.

Solve : turn caps lock off with batch codes without using external program?

Answer»

turn  CAPS LOCK  off with  batch  codes without using external  program
=====================================================

hi
i found some program  that turn caps lock off or on if we need
and found some .com program  and scripts for this job
my question= is there a way to  turn  caps lock  off without using any  external  program?
just using batch  codes?
is it possible?
if its so  please let me know
thanks Quote

my question= is there a way to  turn  caps lock  off without using any  external  program?
Yes, on the keyboard, called Caps Lock.

Quote
just using batch  codes?
No. Quote
Yes, on the keyboard, called Caps Lock.

really?
even  with  using registery  codes?
i  found some reg  code that we can  use them  with a .bat file
but unfortunatly  it needs restart to  work !!
is there any  way?Tried google? Because I found this:
http://answers.google.com/answers/threadview/id/411459.htmlno  i  found this one
echo off
regedit /s [caps.reg]


Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Keyboard]
"InitialKeyboardIndicators"="0"

but it needs restart windows to  work
is there a way  to  activate it without restarting windows?
The registry is a database- it stores DATA. It doesn't store OPERATING instructions in the traditional sense, but rather settings for programs to use. The keyboard state can be changed- but it requires ACTUAL code that isn't possible through pure batch script.

there is NO way to set the state of these keys. Additionally, I might add that to do so is somewhat presumptious. The state of these keys should be determined by the user via their pressing of the keys- not by a batch script, regardless of wether it is convenient.

This is one of the reasons why, with windows, if capslock is ON when your putting your password in, it doesn't automatically change it- even though it could- rather it warns the user that capslock is on. It's a user-defined input state, changing it through a program changes the input and there is a large chance that that change in the input will make it invalid or at the very least not be the desired input of the user.ok thanks for your complete answer
403.

Solve : C# Help with Random Command.?

Answer»

I WENT to msdn.com to find a command that would pick a random number for a project I'm working on, but when I read through the command methods It confused me... all I want it to do is pick a random number from 1 - 12 so it's like rolling dice.

Can I have some help? A random number generator must always be initialized with a seed.  From then on the number is generated based upon a mathematical FORMULA using the seed value and successive values.  In C# you have two constructs for the Random class.  The first one has no arguments and uses a time value (always different) for a seed.  The second one allows you to specify an int value as a seed.  Easiest to use the first.  Next you retrieve the random number.  In this case the number will be between 0.0 and 1.0.  This means you've got to scale your number from there, so...

        float obj = new Random();
        int random_value = (int) ((obj.Sample() * 11) + 1);

This was not tested but should fly.Ok I'll try it thank you!
(EDIT)
Nope didn't work for me thank you for trying.Ooops.  It's simpler than I first explained...

Random rand = new Random();
int random_value = rand.Next(1,12);

That's it.  Instantiate "rand" only once but execute "rand.Next(1,12)" over and over...Ok I'll try this out thank you for correcting it. 
(EDIT)
YAY IT WORKS!!! Thank you Thank you Thank you! (I really NEEDED this!)
And now I understand the random command too.

404.

Solve : Newbie question regarding C programming?

Answer»

Salutations all. I admit I'm SOMEWHAT hesitant to ask this, but it's the sort of problem where the answer is TUCKED away or simply non-existent because of it's rarity and lack of severity.

I wrote the standard "hello world" program in Dev-C++ version 4 and compiled it as per the instructions (I'm reading from the book, "Teach Yourself C in 21 Days") and it compiled and ran without errors. I'm using Windows XP, if that helps.

The problem isn't the fact that it worked, but the fact that the cmd.exe window, which it printed to, opened and closed within a split second. The book doesn't say anything about it, simply stating "Now you've printed 'hello world' to your SCREEN!". I know it can't be a problem with the code, so I'm wondering if it's a problem with either the settings on my operating system or the compiler.

Any help would be tremendously appreciated. It'll be hard to learn C without being able to view the results of my work.

Thank you.The problem comes from the program finishing right to the return 0; command. It's been so long since I've used Dev-C++ that I had to google it

so

Code: [Select]system("pause");
or use include conio.h and use the getch() method.
Code: [Select]#include <conio.h>
....
getch();Thank you very much, the system("pause"); did the trick.

Should have realized it would be something similar to that. I've worked a little bit with .bat files before, but being new to C I haven't yet fully realized the LEVEL in which a program works with the command line. And if that sounds like a really stupid newbie statement, well, I'm a really stupid newbie ^^'

Thanks again for the tip, odds are I'll never forget it ^.^You're welcome

405.

Solve : PERL --- How do you pass system echo'd information directly to variable?

Answer»

I wrote a perl script that reads in the date from file from system("echo %date%>>date.txt") because I cant find a way to pass it directly to a string variable such as $string

I am looking for a way to pass directly echo'd content from system commands to variable instead of having to write to hard drive as a transport of this information from shell to perl. Would like to pass directly through RAM if possible the contents directly to variable from shell.

Below is an attempt to make it work that doesnt work as intended, but runs without error on WINDOWS platform.

Code: [Select]# -- Below Compiles but with wrong results displays date but does not pass date to string variable.

$string = system("echo %date%"); 
print $string;                                     # -- Prints 0 instead of SAY Tue 06/02/2009
** I have this working by writing to a txt file and having perl open the text file and read the contents into a list array, but would like to avoid constant read/write of DATA to hard drive and instead find a better way to do this.

   And instead of using a built in COMMAND in perl to get the date, I also want to find out how to get the echo'd content passed directly to a variable for other dos function ascii string outputs to be able to be passed to a variable so that this information can be read by the program and perform accordingly based on the GIVEN output from system read in.

   This can be done writing to a file like I already have working, but i am looking for a way to do this without writing to hard drive. If it has to write to a drive...maybe I should look into creating a RamDrive to trick it into writing the file to memory.

Suggestions and solutions greatly appreciated!I haven't used perl in ages, but I believe that if you enclose then command in "backticks" (`) that perl will execute the command and return the output.

Just have to install activePerl again and confirm this...


yep!

here, this one seems to work:

Code: [Select]#!/usr/bin/perl
# -- Below Compiles but with wrong results displays date but does not pass date to string variable.

$string = `echo %date%`; 
print $string;



anything in backticks is run and the output saved to the variable! Cool, huh?

"""NICE""" Easier than I expected... Many Thanks!!! you are using Perl, so use Perl.
you don't need to use system command to put the date into a string. Use Perl's own date functions.  eg localtime
type perldoc -f localtime to see examples.

there are also various modules you can use , DateTime, Date::Calc, Date::ManipQuite true.

406.

Solve : How do I change my zip-file back??

Answer»

I clicked on a "open with" button by ACCIDENT and it CHANGED the PROGRAM my zip-file (which is a comic-FOLDER) is to be opened with and now I don't know how I change it back to be opened as a normal folder again D: Please help!     If You are running Windows XP, try this link. If not - please post more detailed info
                          (or try the System Restore)are you using xp, or are you using vista, whichever operating system it is, you need to go in under the file associations, and you need to revert the association for zip files back to explorer.exe, which you might need to browse for, it will be in the windows directory.

for vista, you need to go to the control panel and default programs, set associations to change the association, on xp i believe it is under tools folder options.

hope this helps
start->Run ENTER:

Code: [Select]regsvr32 zipfldr.dll

This should restore the whole "compressed folder" metaphor that I myself love to hate.

407.

Solve : Learning Raptor Programming basic fundamentals (I am a beginner)?

Answer»

Thank you for this opportunity to discuss a subject that is important to me. Learning Rapor Programming.

Because this is my first effort at programming, I believe you can help me. Would you assist me to LEARN at a BASIC LEVEL?

I am taking a CLASS at Grand RAPIDS Community College, and the instructor is teaching at a level I do not understand.

Would you please help me.

CLFThis link can help:
http://librdf.org/raptor/api/tutorial.html

408.

Solve : [Sloved] Wait for an EXE to be launched and used?

Answer»

While playing around as theoretical publisher, I have several times been stuck in this situation, I need some kind of script that does this:

  • Launch Installer.EXE (Setup Wizard)
  • Wait for it to close after install finishes
  • Launch UPDATE.EXE (Update Wizard)

At this moment I have a some "half" working batch file:
Code: [Select]echo off
seccd.exe "Installer.EXE"
UPDATE.EXE
exit
seccd.exe is a tool that checks if itself is stored on a harddrive or CD, if it's not on a CD it will not run "Installer.EXE", it will just show you "You must install this software from the original CD!.  Process terminated"

How do I get it working?

PS. (As in my sig.)
Sometimes, C++, Batch, PAWN, HTML and GML is not enough Quote from: Ryder17z on May 22, 2009, 02:56:02 PM
While playing around as theoretical publisher, I have several times been stuck in this situation, I need some kind of script that does this:

  • Launch Installer.EXE (Setup Wizard)
  • Wait for it to close after install finishes
  • Launch UPDATE.EXE (Update Wizard)

At this moment I have a some "half" working batch file:
Code: [Select]echo off
seccd.exe "Installer.EXE"
UPDATE.EXE
exit
seccd.exe is a tool that checks if itself is stored on a harddrive or CD, if it's not on a CD it will not run "Installer.EXE", it will just show you "You must install this software from the original CD!.  Process terminated"

How do I get it working?

PS. (As in my sig.)
Sometimes, C++, Batch, PAWN, HTML and GML is not enough
Run "CMD /k help start" for more information.Oops, I forgot something:

Installer.exe installs main components, then executes another EXE that contains current updates

I found something, might useful, in VB:
Code: [Select]Set objWMI = GetObject("winmgmts:\\.\root\cimv2")

strStopQuery = "SELECT * FROM __InstanceDeletionEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process' " &_
"AND TargetInstance.Name = 'setup\setup.exe.exe'"
strStartQuery = "SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_Process' " &_
"AND TargetInstance.Name = 'update.exe.exe'"

' Catch process when it starts
' Or alternatively you check if a process is running rather than catching it when it starts
' by querying Win32_Process
Set objEventSource = objWMI.ExecNotificationQuery(strStartQuery) ' Event query
Set objEventObject = objEventSource.NextEvent() ' Wait for the event to occur
WScript.Echo("Process has started, waiting...")

' Catch process when it stops
Set objEventSource = objWMI.ExecNotificationQuery(strStopQuery) ' Event query
Set objEventObject = objEventSource.NextEvent() ' Wait for the event to occur
Wscript.Echo("Process stopped, do stuff")But it doesn't want to work with the path's usedthis is easy, but i am not in the mood to tell you. good luck in googling...  Doesn't seem so easy, I haven't found a way to do it, TASKLIST gives me ERRORS about wrong syntax, VB does something that is equal to zero and so on

Do I need to spend another week, trying to find a sulotion?have you read the "start /?" output? namely the portion about the /WAIT switch?


Also in the VBSCRIPT why are you using "setup\setup.exe.exe" and "update.exe.exe" instead of just .exe? why two ".exe"s?Typos, BC

And the wait parameter won't work since it only waits for the program it started, but as mentioned: Installer.EXE runs, then if properly used, it launches a tool to check if it was installed properly and if so, install current updates by starting another EXE

After that tool is launched, only then, the batch file should run UPDATE.EXE, because it's highly unlikely you want to install updates for a software that isn't even installed, or am I missing something ?


I hope I have explained enough now..

EDIT:
The first EXE updater contains what we would call "Official" and the second installs "Unofficial" updates Quote from: Ryder17z on May 23, 2009, 12:19:10 PM
Typos, BC

And the wait parameter won't work since it only waits for the program it started, but as mentioned: Installer.EXE runs, then if properly used, it launches a tool to check if it was installed properly and if so, install current updates by starting another EXE

After that tool is launched, only then, the batch file should run UPDATE.EXE, because it's highly unlikely you want to install updates for a software that isn't even installed, or am I missing something ?


I hope I have explained enough now..

EDIT:
The first EXE updater contains what we would call "Official" and the second installs "Unofficial" updates
Start /wait will wait for the program to TERMINATE before continuing on with the batch script.No, it doesn't, I have checked it on 3 PC's, all WinXP SP3

Sure, it waits, but not for the correct program to close Quote from: Ryder17z on May 25, 2009, 06:24:29 AM
No, it doesn't, I have checked it on 3 PC's, all WinXP SP3

Sure, it waits, but not for the correct program to close
It doesn't wait for GUI APPS to close...just read that now.I found a way to do it, with some help from PrcView and one batch file


Sample used to see if it worked: Code: [Select]echo off
:BEGIN
pv.exe notepad.exe >nul
if ERRORLEVEL 1 goto Process_NotFound
:Process_Found
echo Process notepad.exe is running
goto BEGIN
:Process_NotFound
echo Process notepad.exe is not running
pause
exit
I'm gonna change it, so it won't check every 1/50 seconds (or whatever the processing SPEED is)


So, I guess, you should NEVER give up something, not even the slightest possible (as long as someone can support it)
409.

Solve : Bat file to unzip a file?

Answer»

Hi,
I have tried to use this code but get the following error:

C:\Documents and Settings\A79678\Desktop\NewFolder\uz.vbs(9, 1) MICROSOFT VBScri
pt runtime error: Object required: 'objShell.NameSpace(...)'

Can anyone tell me what the (9, 1) means?

code for uz.vbs is:

Set WshShell = CreateObject("Wscript.Shell")
user = WshShell.ExpandEnvironmentStrings("%UserName%")


strZipFile = "image_043009.zip"         
outFolder = "NewFolder"
   
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptions





Any one can help me to unzip file through batch
File format is sauch...........
00_BAN_AP_DISC_20090526.txt.gzthe error is because you dont specify the fullpath-name for the fle.

alternative:
you can opt to use fso.getabsolutepathname() method
Code: [Select]set fso=createobject("scripting.filesystemobject")
strZipFile=fso.getabsolutepathname(strZipFile)Hi all,

I am running this SCRIPT and does not give any output also in test sheet, no comment generated (i.e TEST11.txt)..

ANY ONE HELP ME?


strZipFile = "E:\Batch\01_BAN_TN_ADJM_20090601.zip"         
outFolder = "E:\Batch\"

set fso=createobject("scripting.filesystemobject")
strZipFile=fso.getabsolutepathname(strZipFile)


Set addon_fso = CreateObject("Scripting.FileSystemObject")
Set addon_sftp = addon_fso.CreateTextFile("TEST11.txt")
   
Set objShell = CreateObject( "Shell.Application" )
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptions
what are you trying to ACHIEVE?

how to use CreateTextFile method, from wscript documentation:
Code: [Select]Sub CreateAfile
   Dim fso, MyFile
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set MyFile = fso.CreateTextFile("c:\testfile.txt", True)
   MyFile.WriteLine("This is a test.")
   MyFile.Close
End Sub

410.

Solve : Autorun program folders?

Answer»

Hi,

I need help with a small issue. The issue is that I want to have my program run when I click on the folder that it is in. I have been looking into '.inf' and '.ini' configuration files and so far I haven't FOUND much other than changing the folder icon, but that's not new information. I am running windows xp and this has to be written in either an '.inf' or a '.inf' type file.

Thank you for any help,
Tan_ZaWhy, may I ask?At my school the government has just put in the new systems and they are not secure. So in other words I have full control over every bodies accounts, so I can delete all of their work, and they can delete all of mine. I'm not the type of person who would go deleting other peoples work but I know a few people who will. So what I have done is made a security program that what I want this '.inf'/'.ini' file is to load it when they access my directory. My program will ask for a password and if they get it wrong then they get booted out of the directory. Sounds fair to me.

Thanks for replying anyways,
Tan_Za....And to access your stuff, all they would have to do is Right Click --> Explore.

Tell your school about the problem.I did and the school said that they had no power over the issue, it is all the government and if the government say they want it they want it.

Even if they go right click - explore the '.inf'/'.ini' file would still run. It is a config file so it runs when it detects a user ENTERING the directory. I know that because I have done it before just not with running PROGRAMS, only displaying messages and other sorts of display.

I just need to know how to do it and if you can't help then there is no point you replying any more,
Tan_Zainf or ini files usually open in Notepad. Right click it, and choose Open With.So exactly what do you want to do? Write a configuration or autorun to start a program?

Are you sure the school is aware of the problem? If so, they would definitely be able to do something about it.
Having complete access to everyone's files is something that should be dealt with immediately. Think about the data privacy, copyright and security issues.
Would you want your essay copied by someone else for them to hand in as their own?

This thing you are working on may help you, but not everyone else. I don't think your school understands the problem, and I'm also curious how these files are stored on the network.Does any body have an answer, I thank you all for your input though.

The section that our account data is located in can't be easily access but you can if you do some simple steps. The School does care but they can't do anything with out government approval  because it is the governments system. So we have to wait till next semester before anything will be done.

I just need to know how to do this for the time being.

Thank you for your help so far though,
Tan_ZaThe command for the autorun should simply be open=file.exe or open=path\to\file.exe

Not sure about the configuration file though.Well maybe this comment will make it easier to answer the question. How can I get my program to run once I have clicked on the folder that the program is in. That is basically what I need to know. I don't care how it is done, as long as it is not done with batch or anything related to that.

Thanks for your help so far. Also autorun.inf doesn't do anything in this case.

Tan_ZaDude why the *censored* don't u hide the folder somewhere in the windows and add Hidden from properties? U can also try do delete the search from start and from right click menu so others can't search for it...or u can just save ur data on a Stick... Dude, why don't you watch your language.network drives have autorun disabled by default and folders don't have autorun abilities, only drives. Quote from: Carbon Dudeoxide on May 29, 2009, 09:07:39 PM

Dude, why don't you watch your language.

"*censored*" is bad language? I guess I misread the calendar. I thought it said 2009, not 1899.
What the *censored* are you talking about, Dias?

PERHAPS it was BETTER to say 'watch your attitude'?
411.

Solve : where to start....??

Answer»

Hey everyone.
    i am fairly new to all this programming stuff, i have a pretty good understanding on how computers work and programs. anyways...get to buisness. my dilema is i am trying to create a program that will allow users to check-in and check-out equipment that i am in charge of at work, at the time being we are using log books inwhich is a big waste of paper. my GOAL is to have a program that has selectable buttons which are the Equipment category IE Tow Tractor, once this button is clicked it will list more buttons for each serialized PIECE of equipment, IE S/N UAS177 (this is a serial number of a tow tractor) if this button is selected i'd like it to open up and the personell can enter specific information on themselves so i know who its checked out to... if anyone can help or needs to know any more kinds of information to help me let me know.    Hello, scoobz1234.
It sounds to me like You are trying to build a database. Well there are number of programs to do it, such as MS Access, Fox Pro, Sybase... I like FoxPro, but the choise is up to You i know that its going to have to refer to a database in some sort, but rather just a basic database im looking for a little more INTERACTION, I.E the Buttons and windows n such.

http://img268.imageshack.us/my.php?image=program.jpg
here is a picture of what im kind of looking for...You're going top need a full-up application.   Either a web-forms app or a web-app.  Forms means writing code that handles all of the windows stuff with text boxes, buttons, etc and a database that it talks to.  A web-app is something that is activated by a browser and runs some code in the fore-ground that shows the text boxes, buttons, etc and a database that it talks to in the background.

The language that you write this system in can be Visual Basic, Visual C#, Basic, C#, C++, PhP, and many more.  The databases are listed above and there are also many more.

If you are new to computer programming I'd suggest learning how to write programs before attempting to write a program from scratch.  Some people do programming for a living.i wrote my program and it works awesome! Thanks guys

412.

Solve : Generate All 17,576 combinations for 3 alpha places?

Answer»

Trying to find an easy way to generate all 17,576 combinations of __A thru ZZZ. Such as __A, __B, __C ......... _AA, _AB, _AC ...... AAA, AAB, AAC all the way to ZZZ. *With _ shown to indicate spaces for single and double combinations A-Z and AA to ZZ, and then all combinations of AAA thru ZZZ. The actual character '_' is not required and the list can be A, B, C ..... AA, AB, AC ..... AAA, AAB, AAC ....all the way to ZZZ.

My code will be either C++ or Perl (which ever makes more sense) which will read in this list of 17,576 combinations into an array list which will access all combinations 1 thru 17576 incremental for a process that runs and will take about 12 hours to complete all 17,576 repetitious routines to process data related to all cominations.

17,576 combinations is insane to have to manually code into a list for an array so I am here checking to see if there is an easy way to create this list or address all combinations in some other manner.

Even if there was a list already available that can be saved as a list.dat ( raw ascii text file ) that would work as for I can open this file and read in the contents into an array for incremental processing for all combinations.

Hoping there is an easy way to BUILD this list -or-come up with this list of all cominations.  I'm not so good with C++ or perl, but VB is my forte.

Code: [Select]Public Function GetPermute() As String
Dim Chars As String
Chars = "_ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Dim currpermute As String
Dim outstr As String

Dim Char1 As Byte, char2 As Byte, char3 As Byte


For Char1 = 1 To Len(Chars) - 1
    For char2 = 1 To Len(Chars) - 1
        For char3 = 1 To Len(Chars) - 1
            outstr = outstr & Mid$(Chars, Char1, 1) & Mid$(Chars, char2, 1) & Mid$(Chars, char3, 1) & vbCrLf
           
   
        Next
    Next
   
Next
 'uncomment following line of you don't want underscores.
'outstr = replace$(outstr,"_","")
GetPermute = outstr

End Function


ahh yes, and if you want it to be in an array, split at the crlf's:

Code: [Select]Dim strreturn as String
Dim valArray() as String
Strreturn = Getpermute()
valarray = Split(Strreturn,vbcrlf)
if you have Python....
Code: [Select]import string
alpha = string.uppercase
x=(a+b+c for a in alpha for b in alpha for c in alpha)
y=(a+b for a in alpha for b in alpha)
z=(a for a in alpha )
for i in [x,y,z]:
    for k in i:
        print k

With Perl
Code: [Select]for $x ( "AA" .. "ZZ"){
 print $x . "\n";
}
do the same with the rest.Hey Cool... Thanks both of you for your posts. I have many to pick from now and all will do what I need.

 Last night scribbling it on paper I was thinking that I was going to have to have a counter 1 to 26  to count to 26 and when 26 is reached increment the next alpha from 0 to 1, and when that variable incremented to 26 increment the next alpha variable place. Then of the numbers 0 - 26 where 0 = space, and 1 = A and 26 = Z, IF statements would be used to convert the numbers to the correct letters so 3,14,26 would be C,N,Z concatonated as CNZ into a list.

The code you both provided shows that there was a far easier way to do this than my incremental x 26 shift register that would have been a huge beast to achieve the same results with nested for loops for each alpha place around a while loop that tested for Z,Z,Z or 26,26,26 to be met and exit the count process.

MANY THANKS in saving me hours of troubles and pointing the best ways out!Playing with the Perl FOR STATEMENT that you provided it actually works in a single routine without need for others by A to ZZZ .... I am amazed at how simple this is with Perl...what an eye opener to simplicity. ha ha

Going to save all your work to a PDF in case I find myself having to do this in the other languages. Suppose I should learn VB and Python as my next languages. The more you know the better off you are.

Never knew that a FOR statement could increment Alpha like this, thought just Numeric and then a conversion would have to happen to switch the numerics to alpha A-Z or in this case A to ZZZ. Wonder if this is just a feature of Perl or if other languages also have been able to Alpha increment like this all along. Perl has many extra features to avoid reinventing the wheel and maybe this is one of them.

Code: [Select]for $x ( "A" .. "ZZZ"){
 print $x . "\n";
}read perldoc perldscwell... considering how much shorter the perl version is to my VB version (notwithstanding my VB version doesn't even work properly). Turns out my BCScript can churn this out pretty easily, too!

Code: [Select]STORE(X,CHR(SEQ(X,X,65,65+25)))
STORE(Y,flatten(X+X+X))

I wish my assignment operators worked. would make that look less messy.what's BCscript ? never heard of it.Of course not, I haven't released it yet  what can it do?I'm still exploring that myself, actually  , it basically started as a Expression evaluator for use in my programs- but the way I had it structured, I was able to simply add statement separators for the ability to treat it as a script language.


Right now, it's not exactly a "secure" script language like VBScript, in that it can access  the filesystem (through either the filesystemObject or my BCFile library) as well as the ability to call DLLs, a feature which was not easy to implement, let me tell you!


Basically, after I had the basics down, I wanted to make it easier to perform calculations- so I made an "SEQ" function, that created an array (or, in BCScript terms, a "List") of numbers. the CHR$() function, as implemented by the Evaluator, doesn't support arrays. However, the Evaluator notices this, and instead performs the function for each element, creating a new element for each one. (Actually, it does this for any function with a single argument that doesn't have certain flags set)

The same holds true for most operators- including the + operator. the evaluator, again, notices that it will not be able to simply tell VB to add the two together, so it essentially permutes both arrays, using that operator. For example:

Code: [Select]{1,2,3}*{6,7,8}


gives me:

{{6,7,8},{12,14,16},{18,21,24}}

or, a three element array of three element arrays- a matrix, of sorts. Because I found I often wanted to work with these types of results as a single scalar array, I created the "flatten" function which- flattens the array into a one-dimensional array. In the previous output, running the flatten function would result in:


{6,7,8,12,14,16,18,21,24}

Originally, I was working with a evaluator I had found on the net, and trying to change it. It was full of hacks and kludges. I eventually lost the code, so I started from scratch, knowing exactly what I wanted- a plugin based architecture for both operators and functions. It worked- once I had the framework down, it became quite a fun ENDEAVOR to think of new operators and functions. I quickly added all sorts of operators from a number of programming languages, such as "in" from delphi and pascal, the SPACESHIP operator from Perl, etc etc. And from there it was a simple step to add a statement separator. I already had a robust "variables" and "Functions" collections that were easily programmable from the host program.

the only downside keeping me from releasing it with too much enthusiasm is my lack of documentation.

413.

Solve : Batch file to rename a header field in a .csv file?

Answer»

I need to learn how to set up a .bat to change a header field name in a .csv file.

My batch file experience is limited to basic DOS cmds but I've seen some amazing stuff done with variables and "setLocal EnableDelayedExpansion" which I wish I understood how to do myself, haven't found a goo site to learn it on yet...

Txs!how does your file look like and what are you changing..describe CLEARLY with examples!Change the header? Fairly straightforward!

echo off
setlocal enabledelayedexpansion
set num=0
for /f "delims=" %%A in ('type File.csv') do (
set /a num+=1
if !num!==1 (echo Newheader > temp.txt) else (echo %%A >> temp.txt)
)
type temp.txt > File.csv
del temp.txtmore straightforward way in XP
Code: [Select]echo newheader >>temp
more +2  file >> temp
ren temp file
Quote from: gh0std0g74 on June 05, 2009, 05:39:06 PM

more straightforward way in XP
Code: [Select]echo newheader >>temp
more +2  file >> temp
ren temp file

I don't think that my solution wouldn't work in any OS other than XP...and I recently learned how to use FOR (not PERFECTLY mind you), so I was GLAD to do it with that.Since "for" didn't get any SWITCHES until at least WINDOWS 2000, your script would have difficulty working on, say, windows 98.

the "More" solution would work from DOS 3.22 upwards. Quote from: BC_Programmer on June 05, 2009, 05:55:11 PM
Since "for" didn't get any switches until at least windows 2000, your script would have difficulty working on, say, windows 98.

the "More" solution would work from DOS 3.22 upwards.
Ohh...ok...
414.

Solve : Display "expiry" text in warranty field of a database file in Access 2002 by VB6?

Answer»

Dear Sir

I have designed a program in VB 6.0 and have used Microsoft Access 2002 as database.
In my database table there is a field named as “warranty void” where data is being saved as “purchase date+365” i.e. I have fixed warranty date 1 year. Please see my code in below. In that table there is another field named as “warranty” where it stores YES or NO i.e. YES is for warranty available and NO for non-availability.

Now I want that, when date in field “warranty void” WOULD be greater than CURRENT date, automatically “warranty EXPIRED” text would be displayed in “warranty” field.

For example, “purchase date” is 5/25/2009. Then from my above equation, data in “warranty void” field is being saved as “purchase date+365” which equals to 5/25/2010. On 5/26/2010, “warranty expired” text would be displayed in “warranty” field as it has already crossed 1 year and that’s what I want. To save data, I have used below coding and it is working well.

Private Sub cmdsave_Click()
On Error Resume Next
DBconnect
If rst.State = adStateOpen Then rst.Close
rst.Open "tblpurchasesupplyqty", cnt, adOpenDynamic, adLockOptimistic
With rst
    .AddNew
    .Fields(0) = cmbitem.Text
    .Fields(1) = cmbbrand.Text
    .Fields(2) = cmbpurchaseqty.Text
    .Fields(3) = purchasedt.Value
    .Fields(4) = cmbpurchaseqty.Text
    .Fields(5) = cmbsuppliername.Text
    .Fields(6) = cmbitemrefno.Text
    .Fields(7) = cmbsupplierrefno.Text
    .Fields( = chkwarrenty.Value
    .Fields(9) = warrentyvoiddt.Value
   
     If chkwarrenty.Value = 1 And warrentyvoiddt.Value = Date Then
        MsgBox "WARRENTY Date can't be equal to current date", vbCritical, "Incorrect Warrenty Selection"
        Exit Sub
        ElseIf chkwarrenty.Value = 1 And warrentyvoiddt.Value < purchasedt.Value + CDate(365) Then
        MsgBox "PLEASE SELECT DATE UPTO 1 YEAR WARRENTY PERIOD", vbCritical, "INVALID WARRENTY PERIOD"
     ElseIf chkwarrenty.Value = 1 And warrentyvoiddt.Value >= purchasedt.Value + CDate(365) Then
   
    MsgBox "Data Saved Successfully....", vbInformation, "SAVED DIALOG BOX"
    .Update
    End If
    End With
End Sub

Please help by providing the necessary solution.

Regards
Pervez

415.

Solve : Help needed Word Marco to insert second doc to orginal?

Answer»

Hi

I am currently creating a macro to insert a standard LETTER to an existing letter, however when I do so the margins and formants change:

Is it possible to insert a second letter with its own formats and margins, without affecting the orignals

This is what I have so far:

Sub AttachLetter()
'
' AttachLETTER Macro

'
    Selection.EndKey UNIT:=wdStory
    Selection.InsertBreak TYPE:=wdPageBreak
    With ActiveDocument.Styles(wdStyleNormal).Font
        If .NameFarEast = .NameAscii Then
            .NameAscii = ""
        End If
        .NameFarEast = ""
    End With
    With ActiveDocument.PageSetup
        .LineNumbering.Active = False
        .Orientation = wdOrientPortrait
        .TopMargin = CentimetersToPoints(2.54)
        .BottomMargin = CentimetersToPoints(2.54)
        .LeftMargin = CentimetersToPoints(3)
        .RightMargin = CentimetersToPoints(3)
        .Gutter = CentimetersToPoints(0)
        .HeaderDistance = CentimetersToPoints(1.27)
        .FooterDistance = CentimetersToPoints(1.27)
        .PageWidth = CentimetersToPoints(21)
        .PageHeight = CentimetersToPoints(29.7)
        .FirstPageTray = wdPrinterDefaultBin
        .OtherPagesTray = wdPrinterDefaultBin
        .SectionStart = wdSectionNewPage
        .OddAndEvenPagesHeaderFooter = False
        .DifferentFirstPageHeaderFooter = True
        .VerticalAlignment = wdAlignVerticalTop
        .SuppressEndnotes = False
        .MirrorMargins = False
        .TwoPagesOnOne = False
        .BookFoldPrinting = False
        .BookFoldRevPrinting = False
        .BookFoldPrintingSheets = 1
        .GutterPos = wdGutterPosLeft
    End With
    Selection.TypeParagraph
   
' Attaches FORM
        Selection.InsertFile FileName:="C:\Templates 2009\Template.doc", Range:="", _
         ConfirmConversions:=False, Link:=False, Attachment:=False
         
             Selection.delete Unit:=wdCharacter, Count:=1
    Selection.delete Unit:=wdCharacter, Count:=1
    Selection.delete Unit:=wdCharacter, Count:=1
End Sub

416.

Solve : (C++) Never return the same integer in three "for" statements?

Answer»

If i have this:

Code: [Select] for ( int z = 1; z < 10; z++ ){
for ( int y = 1; y < 10; y++ ){
for ( int x = 1; x < 10; x++ ){

//LOOKY HERE! You'll need this spot in a second

}
}
}
What MATHEMATICAL action can i do between X, Y, and Z that will never return the same integer?

ex (i = total when multiplying):
x = 1;
y = 2;
z = 1;
i =  2;

but then when

x = 1;
y = 1;
z = 2;
i = 2;

it returns the same integer... i have tried all i can think of (at least mentally) and they have not worked. Any ideas?
x+(y*10)+(z*100)I...

wait... are we allowed to curse?

I -ing love you!

but i don't swing that way.

so this conversation never happened =)LOL

it actually took me a minute or so to REALIZE, that since your only GOING from 1 to 9 in the loops, you can just use the numbers as different place values. 

Another thing you could do is simply use another variable, and increment it in the innermost loop and use that.Well... i don't know what you mean... here is the main part of my code i was focused on...

Code: [Select]for ( int z = 1; z < 10; z++ ){
for ( int y = 1; y < 10; y++ ){
for ( int x = 1; x < 10; x++ ){
int i = x+(y*10)+(z*100);
dbMakeObjectCube( i, 1 );
}
}
}
In DarkGDK (the framework i am using) each object is given a numerical ID to identify it, REPRESENTED by 'i' in the above code. i would have repeat integers and not get more than 30 of them on screen (i think it is thirty, didn't count, didn't BOTHER to do the math [i typed mouth at first =D ] )


i am practically trying to make a clone of http://www.minecraft.net (typed that from head, if it doesn't work just google minecraft) next thing i think i can find in the documentation, figuring out the on-screen coordinate of an object.

thanks, =)

417.

Solve : Python code help moved from mac to windows not working now?

Answer»

from psychopy import visual, core, misc, event
import numpy #for maths on arrays
from numpy.random import random, shuffle #we only need these two commands from this lib
from random import *
import math

win = visual.Window([1024,768], units='pix', monitor='testMonitor',RGB=(-1,-1,-1))

numbers = range(100) #range of stimuli to be generated or how many to generate

#Choose N, elementsize and filenames

for x in numbers:

N=85 #number to generate0
#To choose which stimuli to generate uncomment the appropriate line
#Contour length
#elemSize = 2000/((N)*math.pi*2)#contour lentgth
#elemSize = 2000/((50)*math.pi*2)#50CLcontrol

#Brightness controls
# elemSize=math.sqrt(70000/((N)*math.pi))#...
elemSize=math.sqrt(70000/((50)*math.pi...

#create empty list of locations
locations=[]

i=1
while i<=N :
locations.append([randrange(int(elemSi...
i=i+1

#build an array of circles according to the parameters
globForm = visual.ElementArrayStim(win, nElements=N, units='pix',sizes=elemSize,fieldShape='s...

globForm.draw()
win.flip(clearBuffer=False)#REDRAW the buffer
win.getMovieFrame()
win.flip(clearBuffer=True)

#adjustfilename as appropriate
win.saveMovieFrames('B085.jpg')
core.quit()
event.clearEvents()#keep the event buffer from overflowing




The error message im getting,

Running C:\Documents and Settings\Administrator\Desktop\NumberStu...
configured pyglet screen 0
Exception in thread Thread-3:
Traceback (most recent call last):
File "threading.pyc", line 460, in __bootstrap
File "PsychoPyIDE.py", line 181, in __run
File "threading.pyc", line 440, in run
File "PsychoPyIDE.py", line 1687, in _runFileAsImport
File "", line 1, in
File "C:\Documents and Settings\Administrator\Desktop\NumberStu... line 36, in
File "psychopy\visual.pyc", line 2519, in draw
AttributeError: Window instance has no attribute '_progSignedTexMask'

To provide as much information as possible im using a script editor i think that what they would be called i know almost nothing about programming, called PsychoPy IDe which can be found here. Ive downloaded the windows VERSIONS of the psychopy ide and all the dependiences for python and python and im still gettting the same error message. Can anyone tell what is wrong with the code or possible a place that could "debug" it and tell me which line is causing the problem my professor wrote the code but knows only enough to write it and could possible fix it if someone could tell mewhat line is causing the error. Code: [Select] from psychopy import visual, core, misc, event
import numpy #for maths on arrays
from numpy.random import random, shuffle #we only need these two commands from this lib
from random import *
import math

win = visual.Window([1024,768], units='pix', monitor='testMonitor',rgb=(-1,-1,-1))

numbers = range(100) #range of stimuli to be generated or how many to generate

#Choose N, elementsize and filenames

for x in numbers:

    N=85 #number to generate0
    #To choose which stimuli to generate uncomment the appropriate line
    #Contour length
    #elemSize = 2000/((N)*math.pi*2)#contour lentgth
     #elemSize = 2000/((50)*math.pi*2)#50CLcontrol

    #Brightness controls
   # elemSize=math.sqrt(70000/((N)*math.pi))#brightness
    elemSize=math.sqrt(70000/((50)*math.pi))#50BRcontrol

    #create empty list of locations
    locations=[]

    i=1
    while i<=N :
        locations.append([randrange(int(elemSize)-512,512-int(elemSize)),randrange(int(elemSize)-389,389-int(elemSize))])
        i=i+1
               
     #build an array of circles according to the parameters
    globForm = visual.ElementArrayStim(win, nElements=N, units='pix',sizes=elemSize,fieldShape='sqr',fieldSize=(1024-elemSize,768-elemSize),sfs=0,elementMask='circle',xys=locations)
   
    globForm.draw()
    win.flip(clearBuffer=False)#redraw the buffer
    win.getMovieFrame()
    win.flip(clearBuffer=True)

#adjustfilename as appropriate
win.saveMovieFrames('B085.jpg')
core.quit()
event.clearEvents()#keep the event buffer from overflowing

sorry just came to my attention code was distorted from how i COPIED and pastedwhy don't you post your query to psychopy's mailing list or comp.lang.python? you will get more response there. Anyway, the error message is very clear... an instance doesn't have an attribute. to put it across very simply, for example
eg
Code: [Select]"mystring".split().split()
this will give you error because the first split will split your string to a list, then when you split again on that list, as LISTS don't have split() method...so it gives you error...same principle with your code.

418.

Solve : Command Prompt -- redirect output of program to variable?

Answer»

I'm trying to PIPE the OUTPUT of a program (a string) into a variable. When I try the below code, the command RUNS but the variable isn't created:

Code: [Select]C:\Programlocation\program.exe | set /p variable=

This seems like it should be pretty STRAIGHTFORWARD...

Thanks,

JWelcome to the CH forums.

Try this:
Code: [Select]for /f "delims=*" %%1 in ('C:\ProgramLocation\Program.exe') do (
    set variable=%%1
)

Good luck

419.

Solve : Code to automatically add date & time to a file name (revisted)?

Answer»

Hi all,
First off, GREAT site, a lot of helpful information available!  My experience is very limited
when it comes to writing code.

As the TOPIC indicates, I need to add a DATE and time stamp to pdf files that are auto saved
to a folder via a scanner.  CURRENTLY, I scan a page into a scanner that is configured to auto
name the file using current date and time and auto save it in a specified folder.  However, I
need to add more information to the name for search purposes.  It does not have an option
to prompt for text in ADDITION to the date & time.

So what I would like to do is reconfigure the software so it prompts for a name only and then
after it is saved to a folder have a batch file auto rename it adding the date and time stamp as
soon as it is saved to the folder.

Is this possible?   In topic 78932, the batch file is written to rename a specific file named catalog.mbd.  In
this case, the initial file name would be a variable but not sure what the variable would be.  Any help would
be greatly appreciated

Thanks in advance

Five-alarm



give examples. how does your final file name look like? (ie the format of the date and time + filename)After the document is run through the scanner, I will get a prompt asking for a name. 

I will type in "wo5000"

It will then be auto saved in D:\scans\wo5000.pdf

After this happens I would like a batch file to then auto rename it with the
the current date and time as follows:

wo5000_06-11-09_04.22.55.pdf

Every time a file is saved into the folder I want this to occur.

420.

Solve : how to do vbscript?

Answer»

I was wondering if there is a tutorial on vb-script here on CH.
but if not could you reffer me to a WEBSITE?

thankyou."on HC"?

Goooooooooooooooogle QUOTE from: batchmaster60 on June 07, 2009, 07:41:22 AM

I was wondering if there is a tutorial on vb-script here on HC.
but if not could you reffer me to a website?

thankyou.
you should just GET the manual. Quote from: batchmaster60 on June 07, 2009, 07:41:22 AM
I was wondering if there is a tutorial on vb-script here on HC.
but if not could you reffer me to a website?

thankyou.

http://msdn.microsoft.com/en-us/library/sx7b3k7y(VS.85).aspx
421.

Solve : [Batch] Scan a .txt file for a string?

Answer»

I would like to scan a file, "banned.txt", for a specific string, ex, "LIAM". How do I do this, as I am PRETTY sure there is a command?

Liam

EDIT: Also, how do i delete this text. I remember a command in VB.NET that i used, Replace(
file,
QUERY,
replacewith)what have you tried? i will give you a hint. USE findstr on the commandline if your requirement is that simple."findstr /?" in cmd.exe seems like plenty, will post again if more HELP is needed.

422.

Solve : C# & VB compile issue for serial communication Program?

Answer»

I bought a Serial COMMUNICATION RELAY Control on ebay and am having issues compiling the C# code they supplied.

Code: [Select]private void button1_ON_Click(object sender, EventArgs e)
{
serialPort1.Write(new byte[] { 0xFF, 0x01,0x01},0,3);
}
private void button1_OFF_Click(object sender,EventArgs e )
{
serialPort1.Write(new byte [] { 0xFF, 0x01,0x00},0,3);
}
When compiling it complains about 'serialPort1' is there a handler I am missing such as a .h include or?

This board can also be CONTROLLED via command line in a BATCH via setting up the mode for com3 9600,n,8,1,p and sending  copy on.data com3 where the contents of on.data are passed to com3, but I have yet to send the correct input to the device. I see the communication handshaking with the led TX/RX, but am passing it the wrong info so it just sits there without latching the relay for 1 VS 0 bit.

Any suggestions ... btw the board was bought and shipped from Bulgaria and it appears it may become functional if I pass the correct string of data to the controller.

They also supply VB, but it also complains when compiling

Code: [Select]Private Sub cmdOff_Click()
With MSComm1
'make sure the serial port is open
If .PortOpen = False Then .PortOpen = True
'send the data
.Output =Chr$(255)
.Output =Chr$(1)
.Output =Chr$(0)
End With 'MSComm1
End Sub

Private Sub cmdOn_Click()
With MSComm1
'make sure the serial port is open
If .PortOpen = False Then .PortOpen = True
'send the data
.Output =Chr$(255)
.Output =Chr$(1)
.Output =Chr$(1)
End With 'MSComm1
End SubOk I found the solution. And got this to work in Batch... MS Windows XP decided that it knew the correct drivers for the USB/Serial Relay Driver Detected as a Virtual RS-232 Serial Device.

Got correct drivers from mfr and now its working by passing FF 01 01 to it to enable relay and FF 01 00 to disable relay at Com3

423.

Solve : Is Qbasic 4.5 the latest (last) release of Qbasic?

Answer»

I found Qbasic 4.5 on my one 21MB IDE Hard Drive ( yes 21 MB from the days when that was a lot of storage...lol )  that I SAVED as a paperweight and decided to fire up for the first time since about 1994 when I got rid of my 8088 for a 486. Just curious as to if Qbasic 4.5 is the latest ( last ) release or not? Surprised it had no issues reading the drive after 15 years of no use and knocked around a few times and the Pentium 4 read it fine as a very SMALL slave drive...lol

Also didnt KNOW that it had the built in compiler to make EXEs. Wish i would have known that about 15+ years ago when writing Basic and Qbasic Programs...lol

Yes QuickBasic VER 4.5 is the latest release although MS Basic PDS was released after QuickBasic 4.5.  See this Wiki..

As well as creating stand-alone and lib dependent exe's QuickBasic 4.5 can produce an Assembler list of the QuickBasic prog. 

 Hey Cool...Thanks for the info and links

424.

Solve : packaging?

Answer»

I have designed a VC++ project. How can I make a PACKAGE? In visual studio the 'package and deployment WIZARD' is giving the option of making
package of VB PROJECTS.
Is it not possible to make package of VC++ projects?

425.

Solve : Bitmapping Qbasic?

Answer»

I am TRYING to figure out how to CREATE a character, map, and mask and be able to use them in a game. Can anyone help me?Code: [Select]
restore
for j=1 to whatever
read a$
for q=1 to len(a$)
if mid$(a$,q,1)="x" then
it's a 1
else
it's a 0
ENDIF
next q
next j

data "xxxxxxxxxxxx"
data "x          x"
data "x  x    x  x"
data "x     x    x"
data "x     x    x"
data "x          x"
data "x  x    x  x"
data "x   xxxx   x"
data "x          x"
data "xxxxxxxxxxxx"

Find the surce code tto this game. It was written in QBAISC
http://www.youtube.com/watch?v=UDc3ZEKl-Wc

EDIT:
Source code in TEXT
http://library.thinkquest.org/19436/downld.htm

Go down the page and find Gorilla.basI found this a useful TUTORIAL for bitmaps:

http://www.geocities.com/mister_jack_dawson/tutorial5.txtThanks guys but im familiar with both creation and movement.
What im looking for is how to integrate backgrounds and masks into my programBLOADExplain please.i remember to use 2 bitmaps to create transparancy:
1 bitmap containing the character, and another bitmap is a mask for character bmp which only contain 2-color.

when bitblt-ing to screen, first bitblt the mask bmp, then the character.bmpyou had to use specific Raster operations with the mask and the source bitmaps, too.

I don't believe there was a direct equivalent to bitblt for QBASIC.I think this should explain it well:

http://www.qbasicnews.com/tutorials.php?action=view&id=7Thanks. I'll look into this stuff and see what i can come up with.
If you have any more suggestions please reply or email me at
[email protected]
with a subject of QB Bitmapping

426.

Solve : finding duplicate names in a .dbf file?

Answer»

Can anyone suggest a freeware program that enables the user to
check through a .dbf table and find DUPLICATE records?

Just one lookup field will be enough for my purpose

regards fred evans


(ntambomvu means "red neck" in Xhosa)you can search google for that, else, use a programming language that provides modules to read dbf files. eg Here's a Python code, USING the module dfbpy
Code: [Select]import dbfpy,sys
filename = sys.argv[1]
from dbfpy import dbf
db = dbf.Dbf(filename)
for REC in db:
    print rec
save as myscript.py and on commandline
Code: [Select]C:\TEST> python myscript.py test.dbf

427.

Solve : Need help creating HTML headline?

Answer»

Can you show me how to create the headline (shown in the attached jpg) in html?

Here are other criteria need to be included in the headline:

the EXACT indentation shown in the attachment

font:20px Tahoma-Bold

color:#CC0000

highlight the words:   hidden traps

highlight the words:   is “tilted” in your favor

highlight the words:   that benefit will go to you



[attachment DELETED by admin]Your homework will be easier if you BOOKMARK these two references:

HTML 4.0 Reference (see UL and LI)
CSS 2.1Its not hard, do I what I did read.  There are lots of helpful sites out there.

428.

Solve : Oracle DBA books and websites?

Answer»

Friends i have recently joined for Oracle DBA course in Hyderabad, i have just completed my SQL,Unix Basics and my DBA classes are commencing from july 20th.I came to KNOW that as a DBA person learning Shell SCRIPTING, PL/SQL will be a plus point.So friends can u please sugest me some GOOD books for PL/SQL and Shell Scripting and also suggest me some good websites for Oracle DBA.

429.

Solve : batch file to emulate Unix cat comand?

Answer»

i'm doing some massive data analysis and need to concatenate the contents of many .txt files into one BIG .txt file.
nothing fancy, just add them one after another.

i've tried 2 approaches, but neither has worked:
-------------------------------
1)
::**
echo off &GT; agreagate.txt

for %%F in (*.txt) do call :eleven %%F

goto :eof

:eleven

set FILEVAR=%1

echo %FILEVAR:~0,13%
::**


%FILEVAR:~0,13%
-------------------------------------------
2)
for %%f in (*.txt) do type “%f” >> aggregate.txt

does anyone have any suggestions how this can be done? it must be really easy, but the exact syntax escapes me at the time. i am not a batch file expert, by any means.the "copy" command can be made to emulate cat.

Code: [Select]copy /b file1.txt+file2.txt+file3.txt bigfile.txt

unless you are restricted in any way , why do you WANT to emulate cat? Download the GNU tools for windows (see my sig).
Code: [Select]c:\TEST> cat file*.txt > newfile.txt
i'm stuck on a windows without administrative privilege=> installing stuff is a pain=> i can't do the emulator.

about the copy, i've tried

for %%f in (*.txt) do copy “%%f” >> aggregate.txt

i know that what you wrote works, for a few files, but i have hundreds of files, and can't type them all out by hand.
so i'm trying to write a for loop that takes all the .txt files in a folder and concatenates their text together.

my for loop almost works, except i get hundreds of

"The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified."

it's the right number, but i have the syntax wrong somehow on finding the files. can anyone help out with that?
i CANNOT type all the file names...it would take forever.copy /a *.txt aggregate.txt

is the solution i was LOOKING for. found it on a different blog. hope it helps someone here also.

430.

Solve : Windows Vista - I want to print files in code Hexadecimal and binary?

Answer»

What command or tool can be USE to print files in CODE hexadecimal and binary.To which code do you refer? Quote from: AEGIS on June 20, 2009, 09:50:49 PM

To which code do you refer?
When you reply one character on keyboard example , you can reply by special code decimal in two POSITIONS in this case type 64
431.

Solve : Delphi 2005 Personal installing components from .pas file?

Answer»

Hello,
I cannot INSTALL any addidtional components in Delphi 2005 Personal... At all tutorials what I found on internet is wroted to install from Components -> Install Component...
I have only New VLC Component and Install Packages... ;/



It should LOOKS like that:


On Personal is turn off Install Component... option?
How to install on D2005PERSONAL?
thxNot being a Delphi user, I wouldn't know a correct solution if I tripped over it. But I did STUMBLE upon this. You can decide if it's helpful.

Good luck.  I know this and it doesn't working on 2005...Then there is this. Try the section under all delphi versions.

Try asking your question on a Delphi forum where other users are more familiar with this. You can't be the only one with this problem.

 I want only use one function from this component but don't know how to paste this function from this component to my program. I want use SetAlignment on TEdit in my program... MAY you know how to add to my own program only this function from .pas component. I tried to add this .pas file like new unit in my project but it doesn't working
this component:
CODE: [Select] unit AlignEdit;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TEditAlign = class(TEdit)
  private
    { Private declarations }
  f_alignment: TAlignment;
  protected
    { Protected declarations }
    procedure CreateParams(var params:TCreateParams); override;
  procedure SetAlignment(value: TAlignment);
 public
    { Public declarations }
constructor Create(AOwner: TComponent); override;
  published
    { Published declarations }
 property Alignment:TAlignment read f_alignment write SetAlignment;
 
  end;

procedure Register;

implementation
constructor TEditAlign.Create(AOwner: TComponent);
begin
  inherited create(AOwner);
  end;

procedure TEditAlign.SetAlignment(value: TAlignment);
begin
  if value<>f_alignment then begin
    f_alignment:=value;
    recreatewnd;
    end;
  end;

procedure TEditAlign.CreateParams(var params:TCreateParams);
const
    Alignments : array[TAlignment] of Longint = (ES_LEFT, ES_RIGHT, ES_CENTER);
begin
 inherited CreateParams(Params);
 Params.Style := Params.Style or Alignments[F_Alignment] or ES_MULTILINE;
  end;
procedure Register;
begin
  RegisterComponents('Samples', [TEditAlign]);
end;

end.
Standard BiDiMode bdRightToLeft from Tedit gui doesn't working after compile(only on project workspace).

edit: sry BiDiMode doesn't working only on XPManifest... but i want to use this manifest so must be possible to change it...Is the process of one function had delivered a great installing components from the file?


________________
plastic training

432.

Solve : How do you hide a Console in C#??

Answer»

Hello I made a file that is ment to work like cmd.exe but in a form, but I don't WANT it to show the console... is there a way to hide it?

My code:

using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Test
{
public class Forma
{
[DllImport("msvcrt.dll")]
public static extern int system(string cmd);
public void CreateMyForm()
{
int go = 1;
while (go == 1)
{
Form form1 = new Form();
Button button1 = new Button ();
TEXTBOX textbox1 = new TextBox ();
button1.Text = "Use";
textbox1.Text = "";
textbox1.SuspendLayout();
textbox1.AcceptsReturn = true;
textbox1.AcceptsTab = true;
textbox1.Dock = DockStyle.Fill;
button1.Location = new Point (0, 20);
button1.Size = new Size(170, 23);
textbox1.Location = new Point (button1.Left, button1.Height + button1.Top + 10);
form1.ClientSize = new Size(170, 42);
form1.Text = "Command Prompt";
form1.HelpButton = false;
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.CancelButton = button1;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);
form1.Controls.Add(textbox1);
form1.ShowDialog();
system(textbox1.Text);
}
}
public static void Main()
{
system("Title CMD");
Test.Forma F = new Test.Forma();
F.CreateMyForm();
}
}
}create it as a GUI APPLICATION, not a console application.Ok i'll try this out thank you for the help.
[EDIT]
Sorry I'm a noob(bit better now) at c# but how would I use GUI in this file?Fixed ok I figured it out and added some extra things If you could I would like it if you would test out this code now I made hide the console, I'm happy 

I aslo put my own COMMANDS in there they are... show console, hide console, preset, reset. you can only use reset when you use preset and can't reuse preset untill you use reset! 

To close the program use the show console command and press the X button on the Console!

Code:

using System;
using System.IO;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace Test
{
public class Forma
{
[DllImport("msvcrt.dll")]
public static extern int system(string cmd);
[DllImport("user32.dll")]       
public static extern IntPtr FindWindow(string lpClassName,string lpWindowName); 
[DllImport("user32.dll")]     
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
public static void setConsoleWindowVisibility(bool VISIBLE, string title)
{
IntPtr hWnd = FindWindow(null, title);
if (hWnd != IntPtr.Zero)
{
if (!visible)
{
ShowWindow(hWnd, 0);
}
else
{
ShowWindow(hWnd, 1); 
}
}
}
public void CreateMyForm()
{
int go = 1;
while (go == 1)
{
Form form1 = new Form();
Button button1 = new Button ();
TextBox textbox1 = new TextBox ();
button1.Text = "Use";
textbox1.SuspendLayout();
textbox1.AcceptsReturn = true;
textbox1.AcceptsTab = true;
textbox1.Dock = DockStyle.Fill;
button1.Location = new Point (0, 20);
button1.Size = new Size(170, 23);
textbox1.Location = new Point (button1.Left, button1.Height + button1.Top + 10);
form1.ClientSize = new Size(170, 42);
form1.Text = "Command Prompt";
form1.HelpButton = false;
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.CancelButton = button1;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);
form1.Controls.Add(textbox1);
form1.ShowDialog();
if (textbox1.Text == "show console")
{
setConsoleWindowVisibility(true, "CMD");
}
if (textbox1.Text == "hide console")
{
setConsoleWindowVisibility(false, "CMD");
}
if (textbox1.Text == "preset")
{
string NF = "PreSetting.Pre";
if (File.Exists(NF))
{
StreamReader SS = new StreamReader(NF);
string Seta = SS.ReadToEnd();
SS.Close();
string Preset = Forma.CreateMyFormP(Seta, NF);
}
else
{
setConsoleWindowVisibility(true, "CMD");
Console.Write("Presetting = ");
string Seta = Console.ReadLine();
StreamWriter SS = new StreamWriter(NF);
SS.Write(Seta);
SS.Close();
setConsoleWindowVisibility(false, "CMD");
string Preset = Forma.CreateMyFormP(Seta, NF);
}
}
system(textbox1.Text);
}
}
public static string CreateMyFormP(string Preset, string NF)
{
string S = " ";

int goo = 1;
while (goo == 1)
{
Form form1 = new Form();
Button button1 = new Button ();
TextBox textbox1 = new TextBox ();
button1.Text = "Use";
textbox1.Text = Preset+S;
textbox1.SuspendLayout();
textbox1.AcceptsReturn = true;
textbox1.AcceptsTab = true;
textbox1.Dock = DockStyle.Fill;
button1.Location = new Point (0, 20);
button1.Size = new Size(170, 23);
textbox1.Location = new Point (button1.Left, button1.Height + button1.Top + 10);
form1.ClientSize = new Size(170, 42);
form1.Text = "Command Prompt";
form1.HelpButton = false;
form1.FormBorderStyle = FormBorderStyle.FixedDialog;
form1.MaximizeBox = false;
form1.MinimizeBox = false;
form1.CancelButton = button1;
form1.StartPosition = FormStartPosition.CenterScreen;
form1.Controls.Add(button1);
form1.Controls.Add(textbox1);
form1.ShowDialog();
if (textbox1.Text == "show console")
{
setConsoleWindowVisibility(true, "CMD");
}
if (textbox1.Text == "hide console")
{
setConsoleWindowVisibility(false, "CMD");
}
if (textbox1.Text == "reset")
{
File.Delete(NF);
Test.Forma F = new Test.Forma();
F.CreateMyForm();
}
system(textbox1.Text);
}
return Preset+NF;
}
public static void Main()
{
system("Title CMD");
setConsoleWindowVisibility(false, "CMD");
string NF = "PreSetting.Pre";
if (File.Exists(NF))
{
StreamReader SS = new StreamReader(NF);
string Seta = SS.ReadToEnd();
SS.Close();
string Preset = Forma.CreateMyFormP(Seta, NF);
}
Test.Forma F = new Test.Forma();
F.CreateMyForm();
}
}
}

433.

Solve : copying dynamic folders to one location...?

Answer»

Hi all,

Am running Windows 2003 server.

I use an SFTP service to download mysql dumps to an analysis server, I have no control over the SFTP downloading service.

The data is DOWNLOADED daily, each day a new FOLDER with the days date as its name is created and the dumps contained within for downloading -

\2009-06-01\*.bz2
\2009-06-02\*.bz2
\2009-06-03\*.bz2
... etc etc

I sync the data to my server as -

\2009-06-01\*.bz2
\2009-06-02\*.bz2
\2009-06-03\*.bz2
... etc etc
 
Issue is I NEED to copy the contents of the latest folder I downloaded to a temp location so that it can be extracted and imported into mySQL (all automated).  I can't however work out how to script a copy process (using dos commands as my vbs is very poor) to identify the latest folder using 12hr time parameters to then copy without copying its root folder as well (IE the 2009-06-01 folder that they are saved to on the DESTINATION which I don't want).

Can anyone help please, I looked at XCopy but it won't copy the files without creating the folder they originally sat in.  If I can get xcopy to copy folder contents to destination without creating source folder they originally resided in then problem is solved).

Ideally looking for vbs script to identify a folder located in d:\datadumps\.. that was  created within 24hrs and copy its contents to another folder on OS without creating source folder on destination as well.

IE
one day copy -  D:\datadumps\2009-06-01\* to d:\ddextraction\*
next day copy - D:\datadumps\2009-06-02\* to d:\ddextraction\*
etc etc

Many thanks!If you an download GNU findutils, coreutils(see my sig), use the find command to find the latest folder
Code: [Select]c:\test> find_gnu.exe c:\path -type d -mtime -1 | xargs -i cp "{}"  c:\tmp
the above finds your folder that is 1 day old and copy to c:\tmp

434.

Solve : I need to print a Word document from my application?

Answer»

I have achieved the most important goal, which was to POPULATE some WORD documents with data from my application. I MANAGED this with the aid of Bookmarks in Word, and the OLEServer in Delphi.

Now what I would like as the TOPPING on the cake, is being able to print the same document from the program. From what I understand, the program connects to the document to fill the data in, it doesn't actually load the doc. Therefore, is there a way to connect to the doc file and print it? Ideally I would like the printer dialog displayed so that I can select the printer, pages, etc.

I'm USING Delphi 2009.

Thanks in advance.

435.

Solve : how to share memory from ram to video card??

Answer»

what are the procedures on ohow to share memory from ram to video card? and isn't possible to do it?Depends. If it's an onboard video card (one built into the motherboard) chances are it already does. Go through the BIOS at startup and ALLOCATE more or less shared memory as desired.

Otherwise, if you have a graphics card with dedicated memory, then you can't share memory from the ram sticks to the video card 'cuz although the ram sticks and video card both have "memory" but they're not the same thing (i.e., not compatible). Quote from: 2x3i5x on JUNE 18, 2009, 11:50:56 PM

Depends. If it's an onboard video card (one built into the motherboard) chances are it already does. Go through the BIOS at startup and allocate more or less shared memory as desired.

Hmmm... Is there a limit on doing the allocation? Example if I have 5GB of RAM, can I allocate a 2GB from my RAM into the onboard video card?Yes the onboard GPU is limited by the BIOS maximum memory address range. The max you can set in BIOS is the Max you can get. It will likely max out at 256 or 512MB of that Ram or less than 256MB if a lower end or older system.If your bios supports DVMT (dynamic video memory technolgoy)  mode, it may allocate a little BIT extra video ram for your video apps,  IF you are not using a video card...However, I think there is a minimum RAM requirement before DVMT would do you any good..Either way.... an on-board card often gives sub-par performance. Although the on-board offerings of ATI and NVidia are often pretty good.there is the thing from nvidia where if you have a low end graphics card like 8400GT, you could boost it with the onboard video card for enhanced performance (forgot the name, but it's sort of like the NVidia's SLI but with low end graphics)
436.

Solve : fix a xp64 no boot problem please help?

Answer»

I have a xp64 Boxx tech PC that will not BOOT up. My question is there a way to hook up my xp32 Dell thru ETHERNET or USB and try to fix the bootless Boxx  I have not got the set up DISC to run XP 64 What happens when you boot up?

437.

Solve : how can i build a basic os using visual basic?

Answer»

is there any  tutorial on building a basic os using visualbasic 1.0?no there isn't.

because you can't.You can't build an os in visual basic, but I think you can in freebasic. It's probably not worth it though because it would be very slow. If you are really serious about making an os than you should USE assembly.

Here is a tutorial on how to make an os in freebasic: http://wiki.osdev.org/FreeBasic_Barebones Quote from: stonefoxnick on JUNE 16, 2009, 09:02:44 AM

is there any  tutorial on building a basic os using visualbasic 1.0?
you can use Cdude you cannot with visual basic

you have to learn assembly language
with

nasm complier Quote from: aloksaini on June 21, 2009, 07:00:22 AM
dude you cannot with visual basic

you have to learn assembly language
with

nasm complier

Visual Basic DOS maybe, but only because I've seen it DONE with QuickBASIC.

you definitely don't need to learn ASM... and even if you did you wouldn't need to use the NASM assembler
438.

Solve : C++ Triangle?

Answer»

Hello I have a problem I have to make a triangle that look like this
*****
  ****
    ***
      **
        *

I create the program for the triangle that look like this

*
**
***
****
*****

The program that I have for that triangle is
#include
using namespace sd;

void mai ()
{
int i=0;
while (i<10)
{
int j=10;
while (j>=i)
{
COUT<<"*";
j--;
}
j=0;
while (j<=i)
{
cout<<"*";
j++;
}
cout<i++;
}
}

Can somebody show me or help me to fix this one so it would look like the first triangle figure

PleaseYou only need one loop...

make "i" for EXAMPLE, go from 1 to 5, and output 5-i spaces and i asterisks for each iteration.I am sorry I am really new ith c++ could you show me how to corrected in my code please.we don't DO homework for you.

However I will give you VB code. that way at least you'll need to do some work to convert it.


Code: [Select]Dim I as Integer
For I = 1 to 5
    Print Space$(5-i) + STRING$(i,"*")
Next I
Is this what you want?

#include
#include
using namespace std;

int main()
{
int i = 0;
int j = 5;
while (j > 0)
{
while (i < j)
{
cout << "*";
++i;
}
cout << endl;
i = 0;
--j;
}
system("pause");
return 0;
}What is it with PEOPLE and While() loops? for() loops were designed for a reason...

Code: [Select]#include <stdio.h>
#include <iostream.h>

int main(int argc, char* argv[])
{





for(int i=1;i<=5;i++)
{
for (int j=i+1;j<=5;j++)
cout << " ";


for (j=i;j>0;j--)
cout << "*";

cout << endl;

}






getchar();
return 0;
}
I'm sure we get asked how to do C++ triangles at least once a month. I know. It is almost surely some form of assignment somewhere.

Normally I don't like helping people fail courses but if they're going to be given an answer it's probably best for it to be completely in C/C++ and DONE with the more appropriate control structures. This way at least they can fail admirably, or something.

439.

Solve : .net?

Answer»

Hi every body

what is the different between
1- VB and VB.net
2- asp and asp.net
3- c++ and c

Thank you  1. VB.NET uses the microsoft net framework and VB does not. Also VB is GOOD and .NET sucks.

2. Same as above

3. C++ is an object oriented and C is not.

=================================

Links:

1. http://www.thescarms.com/vbasic/vb6vsvbnet.aspx, http://excessive.wordpress.com/2008/08/03/why-net-sucks/

2. http://en.wikipedia.org/wiki/Active_Server_Pages

3. http://unthought.net/c++/c_vs_c++.html Sigh, I was going to write a post about why .NET doesn't suck. But then I realized how pointless that would be.
1. Arguing with a someone who's opinion about something is that it "sucks" is about as useful as banging your head against a brick wall.
(And btw. Linux711, VB also relies on a separate framework just like VB.NET.)
2. It wouldn't do you, feras, any good.

So instead I'll post a few links that can, hopefully, answer your questions.
VB vs VB.NET
http://www.sqlmag.com/Article/ArticleID/21050/sql_server_21050.html

ASP vs ASP.NET
http://www.w3schools.com/aspnet/aspnet_vsasp.asp

C++ vs. C
http://en.wikipedia.org/wiki/C%2B%2B Quote from: feras on July 01, 2009, 12:21:43 PM

Hi every body

what is the different between
1- VB and VB.net
2- asp and asp.net
3- c++ and c

Thank you 

Do your own homework.VB6 (often referred to as VB classic) as stated uses it's own run-time objects & procedures. MS decided with the first installment of .NET to completely revamp the language- get rid of all that silly stuff from the old, MS-DOS BASIC's.

Visual Basic .NET is a good language, in my opinion, it isn't really Visual Basic anymore- it's close, but it feels different. It is, however, a great language in and of itself.

Personally, I do most of my development in VB6; I barely touch .NET at the current time. It doesn't suck, though- it's just different. Some people resist change fiercely  )

I am a Linux person, so it is hard for me to say that anything Microsoft is good. But I think that VB6 was one of the better things they made.

pragma
I know that both VB and VB.NET rely on a framework to operate. I think the VB framework is better than .NET because it is SMALLER and faster. I also have heard that Microsoft created .NET to make programs harder to port to other operating systems. Quote from: Linux711 on July 05, 2009, 10:29:30 PM
I am a Linux person, so it is hard for me to say that anything Microsoft is good. But I think that VB6 was one of the better things they made.

pragma
I know that both VB and VB.NET rely on a framework to operate. I think the VB framework is better than .NET because it is smaller and faster. I also have heard that Microsoft created .NET to make programs harder to port to other operating systems.

And VB6 is easier ()

Quote from: Linux711 on July 05, 2009, 10:29:30 PM
pragma
I know that both VB and VB.NET rely on a framework to operate. I think the VB framework is better than .NET because it is smaller and faster. I also have heard that Microsoft created .NET to make programs harder to port to other operating systems.

Yeah that's right. They spent millions of dollars and thousands of man hours just to spite the Linux community, because Microsoft is super villain evil. Right now Bill Gates is laughing his *censored* of in his fortress of doom.

I really hate having to be the one defending Microsoft here, because I'm really not that big of a fan. They have done plenty of things wrong, but lets at least get the facts straight.

The truth is that Microsoft created the .NET framework to make it easier and faster to develop software for the Windows platform, and perhaps most importantly, make it easier to port software between different Windows platforms.
Is software that relies on .NET harder to port to another platform? No not really, .NET code is compiled to byte code, just like Java. In theory this can be execute on any platform with a .NET virtual machine, again just like Java.

It is not an evil scheme, just good business sense, to only support it on their own platforms. Microsoft have no interest in creating another Java. But Microsoft have done absolutely nothing to stop other people from PORTING the .NET framework. Ever heard of Mono? In fact Microsoft is indirectly sponsoring Mono through their partnership with Novell. IMO it would be easier to port a .NET APPLICATION then it would a application made with VB6... So that whole "They did it to make it harder to port" nonsense doesn't really work. VB6 compiles to either P-Code or Machine code; either way, it always outputs a windows executable. .NET programs compile, as pragma said, to bytecode.

All that's needed is a CLR for the other OS's- and given the fact that WINE essentially duplicates the windows API itself I don't see the task of creating a CLR for Linux or mac as too difficult for the Linux people.
440.

Solve : Tollbar moved to secondary computer and we need it back!?

Answer»

So I'm at work but it's sunday and a holiday weekend so i cant get intouch with my boss or manager. I don't know the operating system or anything. I just know this: We have 2 comps on the same network or something. ONE , the main, is for us to access everything. The second is for our members to check in and see basic details about their PROGRESS. The toolbar somehow, i dont know how as I wasn't here, moved to the member screen. we can access the running programs through the ctrl/alt/del thing but we really need this to get back to its regular screen. we can partially access it by USING the tab button when i hit the shortcut button
 that puts the taskbar and start menu properties on the 2ND screen,but thats it, cant use the mouse. I looked for this topics but though some were about the toolbar it was about moving it on the 1 screen. Thanks for any HELP : )
441.

Solve : IIS 5 or 6 in windows XP Home, Is it Possible??

Answer»

Hi, I would like to install on my PC (Windows XP Home Edition SP2) the Internet Information Service 5 or 6, but I don't find the best solution to do it!!. Did you know something about this or an alternative way to install ISS 5 or 6 without the Windows 2000 Installer? Could I install ISS 6 from the Windows Server 2003 CD?

RegardsDon't even attempt it.  If you must run a web server on a non-server O/S, try Apache.  XAMPP is one of your EASIEST options for this purpose.Thanks for your REPLY, I know the Apache Web service, But I need ISS because the Application I would like to install (MS SQL Server 2005), and I have to run some ASP DEVELOPED projects on my PC.

Regards!!Apache can run ASP.


And there's no REASON why Apache would prevent you from connecting to an MS SQL server (not that I would want to do it personally - ugh).

442.

Solve : can any1 guide me about Autocad 2000i???

Answer»

if any of you know a GOOD website of AUTOCAD 2000i,that STARTS from the basic..so PLEASE do tell me.
thanks!!!

443.

Solve : IC Tester?

Answer»

Hello,
 I do not NEED to know at the moment, throughout the SUMMER I am hoping to build an IC (Integrated Circuit) TESTER, a thing that tests IC's up to 24 pins, my question is this, if I am able to connect it to computer via USB port, is their a way that I can program software to show an image of the IC in question and once diagnositcs have complete highlight the area that is broken?This is a GOOD one for westom to ANSWER.

444.

Solve : outlook - send from?

Answer»

Hi Guys,

Not sure if Ive posted this in the right section but here it goes...

I have to SEND an email after a CERTAIN task everyday (can do at least 15-20 of these per day).
I currently have an outlook macro(s) set up that works the following way.

Within main outlook screen click macro... this then generates a new email with the correct subject text - FINE

Within the new email I click another button which then populates the new email with all the relevant text I need it to say.

The only thing I need to add to this SEQUENCE is a macro that when pressed populates the 'From' field with a certain address.

*Note* The 'To' address will always be different.

Any help APPRECIATED.  hi for all.....
                    i am aman.i want your helps.i studying in B-Tech information technology in india.so what extra curricular activities are most usable for jobs(USA) in 2010,2011.I was hoping this would be an answer to my question.

Sorry amanulla I THINK you may have posted this in the wrong thread.Instead of scripting Outlook, have you looked at a command line mailer like MAPISend, blat for Windows or bmail.exe?

445.

Solve : program to monitor a file size then preform an action?

Answer»

Ok basically im looking for a program/source that can monitor a file, when the file expands then I need it to preform an action. Its only ONE file that I am monitoring. I really want source code since id rather add it to my own apps, crediting the author of course. Im not using it for anything phishy, im just about to leave so I dont have time to type what i need it for right now. I can do that later if someone needs me to. If anyone needs more info then please say so and i will reply back.Here is some VB6 code. Make a form with a timer. Give the timer an interval of how often you want to check for a change in the file.

Code: [Select]Option Explicit

Const THE_FILE As String = "B:\readme.txt"
Dim fSize As Long

Private SUB Form_Load()
fSize = FileLen(THE_FILE)
End Sub

Private Sub Timer1_Timer()
Dim newFSize As Long
newFSize = FileLen(THE_FILE)

If fSize <> newFSize Then
    MsgBox "It changed. Replace this with your code."
    fSize = newFSize
End If
End Sub
anyway that i can do that in c++? And thanks, if i can't do it in c++ then ill try to use that. CUS when i make the form I need it to run in the background withought it showing anything, and i dont know how to do that in vb6.don't have to specifically code in C++. here's  a vbscript
Code: [Select]Set objFS = CreateObject("Scripting.FileSystemObject")
strFileToMonitor = "c:\test\file.txt"
Set objFile = objFS.GetFile(strFileToMonitor)
indicator = 0
While True
strFileSize = objFile.Size
WScript.Echo strFileSize
If strFileSize > indicator Then
indicator = strFileSize
WScript.Echo "filesize change: " & strFileSize
                ' Do your actions here...
End If
WScript.Sleep 10000

Wend


FindFirstChangeNotification() and FindNextChangeNotification() are easily accessible VIA C/C++.ok thank you guys, i just decided to GO with the vbscript, I think it will work best in that case.

446.

Solve : [VB.Net] Create panels when in While() loop?

Answer»

Code: [Select]Public Class Form1

    Private Function RandomNumber(ByVal min As Integer, ByVal max As Integer) As Integer
        Dim random As New Random()
        Return random.Next(min, max)
    End Function 'RandomNumber

    Private SUB Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim planetcount = RandomNumber(1, 10)
        While (planetcount > 0)
            planetcount -= 1

            'Code here =D

        End While
    End Sub
End Class

I figured since there wasn't much code yet, might as well put it all.

where it says " Code here =D " I want to put the panel, but if i do this
Code: [Select]...
dim panel as panel
...
the next time the program LOOPS it will create a panel with the SAME NAME giving a code conflict.

I want the code to be modifiable in the future so i can have many more, so i cannot do it manually "planet1, planet2, Etc"

So how would i make a loop that would name the panels with ("Planet"+ planetcount)= Planet1, Planet2, etc.? or something LIKE that so that the names become unique, no matter how many loops the program goes through.

Thanks for reading,
Liam
try
Code: [Select]dim panel as new panel
with panel
.location...
.name...
end with
Something like that should work, although I normally just use arrays. What are you trying to do?

I was trying to make 10 unique panels each with uniquely modifiable statistics. How i set it up in the main post, whenever I tried to change an attribute, it would apply to -ALL- the panels.

447.

Solve : creating threads in C#?

Answer»

Can someone please break down a simple statement for a relative newbie?

Code: [SELECT]Thread firstThread = new Thread (new ThreadStart (Method1));
In other words, what is happening at each stage here:

Code: [Select]new ThreadStart (Method1)
Code: [Select]new Thread (new ThreadStart (Method1))
Code: [Select]Thread firstThread = new Thread (new ThreadStart (Method1));
Thanks for any help you can give.Is this homework?No, this is not homework. I'm trying to get back into an industry I was in years ago. I used to program in C before .Net existed.the keep programming in C... it's still a prominent language.

C#... well, if you know C there's no need to learn C#.If it's all the same to you, I'll set my own career path, thank you very much.

What a friendly, helpful, reasonable response. Quote from: BobLewiston on July 20, 2009, 11:52:25 AM

If it's all the same to you, I'll set my own career path, thank you very much.

What a friendly, helpful, reasonable response.

heh, on the other hand, C# would be a forward thinking investment... (assuming that .NET manages to take off, which wouldn't be an unfair assumption).

In either case... that wasn't relevant... my response I mean... to your question My apologies.

Code: [Select]Thread firstThread = new Thread (new ThreadStart (Method1));

As I'm sure your aware, unlike C, C++ and C# deal with Objects. Quite a departure from the Structured Programming of C and Pascal.

This line, as you know, creates a new thread. the "new" keyword is used to create a new thread. However, in order to create a new thread, you must pass in a "ThreadStart" object to the Thread's constructor, a special function that is called when you create an instance of the class. In this case, a new ThreadStart Object is created right in the parameter list to the Thread Constructor.

But oh Dear! the ThreadStart() Constructor also needs a bit of information- the METHOD that will comprise this thread. In your example, this is the function "method1".

If I am CORRECT, this code would create the thread- but would not START it, the firstThread object can of course be told to start,suspend, terminate, etc via it's methods.






448.

Solve : Help with C++?

Answer»

Im trying to MAKE a tetris game and i get this error "type int unexpected". It happens at the function that randomizes some numbers and returns a tetris piece, in this case, a pointer to a 2-dimensional int array.


CLASS Board
{
public:
    // some FUNCTIONS
    *int[5][5] GetNextPiece();
    // some other functions
private:
    // private data MEMBERS
};

whats wrong and how can I fix that?I tried to fix it here is the code,

Code: [Select]#include <iostream>

using namespace std;

int main();
class Board
{
public:

    int name[5][5], GetNextPiece();

private:
};

449.

Solve : ADOBE hole headache?

Answer» http://voices.washingtonpost.com/securityfix/2009/07/attackers_target_new_adobe_fla.html?wpisrc=newsletter

in case ANYONE gets a headache from TRYING to figure out what is going on with their system (like i did) - this MAY be your PROBLEM...

thought i'd pass it along...No need to tell US twice...
450.

Solve : Outlook - Subject Field?

Answer»

Hi guys,

I had this set up on a previous system (of which I dont have access to now) that when composing and email Id PRESS the BUTTON that I set up that would populate the subject field with a certain phrase.

I know that a basic macro button cannot create this and wondering if someone knows the VB code?

Ive searched GOOGLE and no ANSWERS