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.

1801.

Solve : Small issue with using PHP with bootstrap forms.?

Answer»

I feel like I am so close to it working but for some reason it isnt.
I can't seem to get the button to run the PHP code, with a basic form (not using bootstrap) my php works but just not with this bootstrap.
Any help would be greatly appreciated.

Code: [Select]<?php
$host="localhost";
$USER="root";
$pass="pass";
$db="SheetPal";
mysql_connect($host,$user,$pass);
mysql_select_db($db);

if(isset($_POST['submit'])){
$username=$_POST['username'];
$password=$_POST['password'];
$sql="SELECT*FROMusersWHEREusername='".$username."'ANDpassword='".$password."'LIMIT1";
$res=mysql_query($sql);
if(mysql_num_rows($res)==1){
echo"Youhavesuccessfullyloggedin.";
EXIT();
}
else{
echo"Invalidlogininformation.";
exit();
}
}
?>

<!DOCTYPE html>
<html >
<head>
<meta charset="UTF-8">
<title>Login Form</title>
<link rel="stylesheet" href="css/login.css">

</head>

<body>

<body>
<div class="login">
<div class="login-screen">
<div class="app-title">
<h1>Login</h1>
</div>

<div class="login-form" role="form" method="post" action="test.php">
<div class="control-group">
<INPUT TYPE="text" class="login-field" value="" placeholder="username" name="username">
<LABEL class="login-field-icon fui-user" for="login-name"></label>
</div>

<div class="control-group">
<input type="password" class="login-field" value="" placeholder="password" name="password">
<label class="login-field-icon fui-lock" for="login-pass"></label>
</div>

<div class="control-group">
<input id="submit" name="submit" type="submit" value="Login" class="btn btn-primary">
</div>

<!-- <a class="btn btn-primary btn-large btn-block" href="test.php">login</a>
<a class="login-link" href="#">Lost your password?</a> -->
</div>
</div>
</div>
</body>




</body>
</html>

1802.

Solve : c++ programming?

Answer»

Please am facing challenges with two dimensional arrays, especially passing it as an argument to a function. I'll need your help guys.Quote

And a two-dimensional array looks like this: int[][] myArray = { {0,1,2,3}, {3,2,1,0}, {3,5,6,1}, {3,8,3,4} }; For our purposes, it is better to THINK of the two-dimensional array as a matrix. A matrix can be thought of as a grid of numbers, arranged in rows and columns, kind of like a bingo board.
https://processing.org/tutorials/2darray/
Which version of C++ ?
If Visual Studio Express - C++ there are LOTS oof free tutorials.
Fir a specific answer, look here:
http://stackoverflow.com/questions/9446707/correct-way-of-passing-2-dimensional-array-into-a-function
Quote
You are doing in wrong way. You can pass 2-d array with the help of pointer to an array, or simply pass an array or through Single pointer.

I worked on a program that will accept the HIGH and low temperatures of the month of the year, and the output the AVERAGE high and low temperatures and also the INDEX of the highest of the high temperatures and also the index of the lowest of the low temperatures. But it refused to run, code blocks instead alerted me of the wrong use of the "operator << std::". Please can you help me with ideas of what to do or to give me a working program to achieve that. Please your help will be appreciated.
1803.

Solve : Call Matlab script from Ansys?

Answer» HELLO,
For my project I need to CALL a Matlab script to Ansys. In the project the part is created and INNER side is emptied by using Matlab. After that I would like to call this part to Ansys in order to make a STRESS analysis. Is this possible. Thank you in advance.
1804.

Solve : Creating weebly app?

Answer» HI,
we are trying to create a website for our company which needs a demand page. The page would CONTAIN a form which the customer has to fill in like name, email or phone NUMBER, and the link of the item they want us to purchase for them. We don't mind using Godaddy, or weebly. But they don't have the service of sending a confirmation email or message to the customer to NOTIFY them of their submission, and also send a unique number of their order.

Now as I searched around, only the option of creating our own app would work. My question, if you guys can help, is what do I require to create this app (I have some programming skills and web design knowledge)? Also anyone knows of a hosting service that has that feature?
I understand that we will need a DB and java CODING. Also, can't we use yahoo mail to generate this email?

Thank you.

Note: no, customers in our country can't purchase things online, so our company would purchase the item for them and then deliver it.
1805.

Solve : Linux shell bash- unexpected end of file error?

Answer»

I can see two simple syntax errors that I need to correct, but my big question is why do I have an unexpected end of file error? I was able to use this SCRIPS to end a DIFFERENT program:

#!/bin/bash
until [ "$userIn" = "j" ]
or main menu
do
echo "Command Menu"
echo
echo "a. Emailer Program"
echo "b. Users Currently Logged On"
echo "c. Current Date and Time"
echo "d. This Months Calendar"
echo "e. Name of the Current Working Directory"
echo "f Contents of the Working Directory"
echo "g. Find the IP of a Web address"
echo "h. See your Fortune"
echo "i. Print a File on the Screen"
echo "j. Exit"
echo
echo -n "Please SELECT a letter: "
case "$userIn" in
a|A) echo
echo "This program will allow you to send an email,"
echo "with file attached."
echo
echo -n "Please enter the subject of yout message: "
read userMessage
echo
echo -n "Please enter the email address: "
read userAddress
echo
echo -n "Please enter the file to attach: "
read emailFile
mail -s "$userMessage" "$userAddress"<"$emailFile"
echo
;;
b|B) echo
echo "This menu selection shows who is currently logged on";

echo "which is: "
echo
who
echo
;;
c|C) echo
echo "This menu selection gives the current date and time;"

echo "which is: "
echo
date
echo
;;
d|D) echo
echo "This menu selection shows the current months calendar"
echo "which is: "
echo
cal
echo
;;
e|E) echo
echo "This selection shows the current working directory"
echo "which is: "
echo
pwd

echo
;;
f|F) echo
echo "This menu selection shows the contents of the current working directory"
echo "working directory; which is: "
echo
ls
echo
;;
g|G) echo
echo "This menu selection looks up an IP address using a web address"
echo
echo -n "Please Enter the Web Address to Look Up: "
read userAddress
echo
host "$ userAddress"
echo
;;
h|H) echo
echo "This menu selection outputs one of many fortunes. "
echo
fortune
echo
;;
i|I) echo
echo
echo "This menu selection outputs a chosen file to print on the screen"
echo "page by page if it is a large file. "
echo
echo -n "Please Enter a File to See: "
read userFile
echo
if [ -f "$userFile" ]

then
more "$userFile"
else
echo "The file is INVALID or cannot be found. "
fi
echo
;;
j|J) echo
echo "Thank you for trying this program"
echo
;;
esacAre you sure your code is free of typos/syntax errors?

Looking at the shell script, maybe its correct, but my eyes are picking up on syntax/typo issues possibly. However because I dont code in Linux shell environment maybe its correct. My thoughts on this are that for some porgrams its probably fine because it takes an alternate IF, THEN route and for what your running your now at an IF, THEN route that may have a typo.

Quote

if [ -f "$userFile" ]

then
more "$userFile"
else
echo "The file is invalid or cannot be found. "
fi
echo
;;
j|J) echo
echo "Thank you for trying this program"
echo
;;
esac
There is no exit for the program if the user hits the WRONG key?
1806.

Solve : need help writing a script to run a restore program?

Answer»

i am trying to write a script to do a restore. can i use a batch FILE to load scr files in an order. is this possible? any help will be greatly appreciated thanks wiz98
Why not just use a FREE imaging, BACKUP, or clone utility AVAILABLE? Also havent seen SCR files in ages. They stand out to me because people use to use them to push malware/virus's.

1807.

Solve : Regex pattern for grep?

Answer»

I'm trying to write a regular expression that matches "one or more non-tab characters anywhere before the FIRST visible(0x21-0x7E) character in a given line."

I'm using GNU GREP. I'd like to stay POSIX compliant if at all possible.

Any help is appreciated.I came up with this:

Code: [Select]'^ *[^ [:graph:]]\{1,\}.*[[:graph:]]'
There are two literal tab characters in the above.

It seems to WORK. If anyone COULD provide any verification/optimizations, that would be great.

Edit:
Further optimized.
Code: [Select]'^ *[^ [:graph:]].*[[:graph:]]'

1808.

Solve : 486 packardbell restore?

Answer»

I am TRYING to do a restore on a 486 packardbell Axcell 2018 but lost the password to unlock the restore SCRIPT. Any idea how i can get the script to do the restore. Any help will be greatly
appreciated thanksHave you already been to:
http://pbclub.pwcsite.com/wiki/index.php?title=Packard_Bell_Models
https://www.youtube.com/watch?v=0vNHnNHMAaQ

1809.

Solve : Batch execution question?

Answer»

I have a number of NAS disks attached to my windows 10 desktop. For some strange reason, some of them go offline. I have a batch file to re-connect them, issuing "Net Use" commands. If I click on the file "Upnet,bat" I just get a flash of the command prompt window and no results. If I open the editor on the same file and use cntrl-a, cntrl-c then open a command prompt window and paste the results into the command prompt window, it works fine. This two-step process is fine for the task but I was wondering how to get it to run with a one click on the shortcut to the batch file.

Thanks

[attachment deleted by admin to conserve space]If you want to see the results use the PAUSE command at the end of your batch file.I had a PROBLEM with Buffalo NAS drives going to sleep on us and this was breaking mapped drives for users. My solution was to have an automated routine that every 15 minutes would as I called it "TICKLE" the NAS to keep it awake. I had a batch that ran with a 15 minute delay and it would transfer a small text file from the NAS to the server that was keeping the DRIVE awake. I used SLEEP to have 15 minute delay and a goto loop in the batch file to have it xcopy the file from a specific DIRECTORY of each NAS drive over the network and then a clean up process that would delete the very small less than 1KB file after it was transferred, this way every iteration at 15 min intervals caused it to work the NAS storage systems that we had and problem solved.

I contacted Buffalo about this and they didn't have a CURE for the sleep state issue that their NAS drives had. We had about $8000 worth of NAS devices and couldn't return them, so this was the quick band aid to keep them from going into a sleep state and causing users with mapped drives to the NAS drives to break. I guess this is one of the problems with buying Green Power Efficient NAS drives that shut off, put the drives in sleep state not spinning and then spin back up when needed.

If this is the case with the NAS Sleep State then this could be a valid fix for your site as well.

1810.

Solve : C++ IDE Suggestion??

Answer»

Looking for a replacement C++ IDE other than Microsoft Visual C++ \ Express.

My history of IDE's for programming in C++ are:

Borland C++ 4.02
(VC6) MS Visual C++ 6.0
BloodShed Dev 5.0

I tried out Netbeans C++ IDE on a healthy Windows 7 64-bit system and when compiling good code it fails and the debug output is just about worthless. Going into Debug it gives options to configure the debugger as if the IDE is not ready after installation to just code something up and be able to compile and debug it right away as I guess I was spoiled with in all prior IDEs I have ever used to have a functional and very valuable debugger right at the get go and netbeans lacks that or isnt user friendly... https://netbeans.org/features/cpp/index.html

I liked BloodShed Dev C++ 5.0, BUT it has so many bugs and some bugs are causing grammatically and syntax correct code to compile successfully but completely malfunction such as within a while loop of recent code each iteration of the loop flips a value between 0 and 1 and back to 0 again in a flipflop, and the value starts at 0 as the integer is initialized before the loop and then the variable++; increments by 1 to value of 1, it runs an IF STATEMENT that if the variable is = 1 run a process different than if the variable was 0 and before exiting the IF logic to set the value back to 0 so the next iteration of the loop the value is now 0 and so it does the other logic for if the value is not equal to 1. The value gets stuck at 1 so it runs as 0111111111 instead of 0101010101. I dug out of storage my old Borland 4.02 and opened my CPP project and compiled it without any issues, ran the program and it runs correctly with 0101010101 so there is an issue with Bloodshed Dev C++ 5.0 in that the compile result from the source code is flawed and so it must be a bug that I ran into with it. I dont want to go back to using Borland 4.02 on my old Windows XP system because it is so out of date. So looking for a modern IDE that will work the same as Borland 4.02, VC6, and Bloodshed Dev C++ 5.

Reason for avoiding Microsoft Visual C++ Express is 2 reasons...

#1 - I want to use one that is FREE that is completely FREE and so I have all Dev Features as well as no restrictions of HOME vs Corporate Use
#2 - Might be nonsense, but I dont want to program based around MS VC++ because I want my source code to be less dependent on Microsoft and more flexible cross platform into Linux etc. I guess I am saying that I dont want to have a SITUATION where I paint myself into a corner with programming for Windows if MS VC++ uses Windows ONLY libraries etc. *Sure I could always run it through Linux in a WINE environment, but I just want to avoid the potential to paint myself into a corner by creating more universal non OS platform specific code. (** I also have never programmed in C++ before for Linux but would like to and so you might see something in this part that I am wrong about and maybe I dont have to worry about MS VC++ created code migrating to Linux OS use. )

** I feel the issue with #2 is because back in the day with Borland C++ 4.02 my code was proper for Borland and compiled and ran with no issues, and yet with VC6 I would get compile errors until I tweaked the code to be to VC6 syntax such as i had to be specific with VC6 to specify #INCLUDE on one of them and the other wanted it as #INCLUDE without the .h . Quick search online shows that .h use is depreciated. http://stackoverflow.com/questions/2976477/difference-between-iostream-and-iostream-h so I guess as standards came to be and Borland 4.02 is before many standards of today that would be why that is that issue between them however I have a feeling that that latest Visual C++ IDE has features that are not cross platform friendly for OS and so i am trying to avoid getting snagged if there is a snag into programming only for around MS Windows and trying to remain universal if at all possible.

Visual Studio Express is 4 years old. They re-branded the Express editions to Community Editions. #1 is now irrelevant because the Community Edition is free for both personal and corporate use and furthermore is identical to the Professional Edition. It's only limitation is that it cannot be used in ENTERPRISE environments. (Well it can, but it would break the license).

Most Open Source C++ software uses Microsoft Visual C++ for building their Windows Binaries. Avoiding MS-specific extensions is fairly easy. You can change compiler options to use g++ to avoid language extensions (or, know how to recognize them), and bind to GTK or TCL/TK or some other cross-platform toolkit if you make any User-Interface software.

Thanks BC ... gonna give the Community Edition a try. Surprised the ISO is 7.1GB

https://www.visualstudio.com/downloads/

1811.

Solve : Command Line?

Answer»

Hello,

I had ONE of my class substituted with my current class which focuses on command line.....I have zero clue about this type of stuff can ANYONE help with some lab QUESTIONS?

1.Navigate to the user account home directory. Use the command line to create a file named test.txt with the text “HI I AM A TEST FILE”. Output the contents of the file using a command line program to verify that the file contains what it should. I deleted the duplicate threads. Please only post once. Thanks.We aren't going to do your work for you by simply giving the exact commands to run. Instead I'll give you hints and let you work the rest out.

Break the instructions into chunks, each will map to one command:

Navigate to the user's home directory
To change directory you should use the "cd" command, you can find the man page for it here: http://linuxcommand.org/lc3_man_pages/cdh.html I'll leave you to figure out how to get the home directory (hint, that page explains it if you read carefully enough)

Use the command line to create a file named test.txt with the text “HI I AM A TEST FILE”
If you use the "echo" command such as:
Code: [Select]echo “HI I AM A TEST FILE”You will see that it will print the message to the screen, this is known as stdout. You can then "redirect" the contents of stdout to a file which is explained here: http://www.cyberciti.biz/faq/bash-script-output

Output the contents of the file using a command line program to verify that the file contains what it should.
For this you would use the "cat" command: http://linux.die.net/man/1/cat

I'd strongly recommend learning more about the command line as once you master it it can be a lot easier and faster to use than using a regular file browser. For example, if you want to batch rename a bunch of files or even search a bunch of text files for a word and store the names of the files that contain it in another file, you can do it with a single command rather than having to manually do it with the graphical interface or find a THIRD PARTY program to do what you need. Nowadays I don't even have a file browser installed on my system, I can do all file browsing/manipulation through the command line. Just force yourself to use it more and you'll soon figure it out.

1812.

Solve : VB6 need some help with console events please?

Answer»

Hi ,

I saw this nice article:
http://www.developer.com/net/vb/article.php/10926_1538861_7/Writing-Console-Mode-Applications-in-Visual-Basic.htm

First of all, it HELPED my understanding of the console functions a lot!

Second, Would you guy's bother to help me out with something related?

I am trying to make the console print something after I CLICK it..

I need some simple example, I don't know a THING about c++ and
the one example I found that somewhat does what I'm looking for is in c++:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms685035(v=vs.85).aspx

in the attachments you can find my current test modules.

Hopefully someone reads this and want to help me!

REGARDS,
Tom

[attachment DELETED by admin to conserve space]

1813.

Solve : Perl is a socially-acceptable form of Visual Basic?

Answer»

Raymond Chen says on The Old NEW Thing:

https://blogs.msdn.microsoft.com/oldnewthing/20160927-00/?p=94395

Quote

Worf noticed that a number of developer tools are written in perl and wonders what's up with that.

Simple: Perl is a socially-acceptable form of Visual Basic.

In other words, just like how Visual Basic is a great way to throw together a quick little GUI program, perl is a great way to throw together a quick little developer tool. In both cases, the language is loose enough to let you get away with a lot of sloppy coding techniques, and a lack of discipline can result in an unreadable mess.¹

The difference is that whereas people look down on Visual Basic programmers as talentless hacks who couldn't code their way out of a paper bag, people look at perl programmers as wizards who can perform miracles with their arcane incantations that to the uninitiated are indistinguishable from line noise.²

¹ I'm not saying that the developer tools are an unreadable mess. Just that it's easy to write an unreadable mess in perl.

² You can tell I'm an old timer because I said "line noise". Kids these days have never experienced line noise.

For years I have been using a tool called Get_iPlayer to download radio and TV programming from the BBC iPlayer service. The engine of this is a perl script with 12,211 lines, and i must say I have felt quite happy HACKING around with it to customise various aspects. Even with no prior exposure I soon felt happy with the syntax, especially as there is a lot of perl guidance out there for the hard bits.

Love the second comment in this snippet I just noticed:

Code: [SELECT]# Clear all the PVR searches in %{$pvr}
sub clear_list {
my $pvr = shift;
# There is probably a faster way
delete $pvr->{$_} for keys %{ $pvr };
return 0;
}
Microsoft Basic has been around for a long time. It and other Basic dialests did a lot to develop the Personal Computer legacy.

Recent versions of Visual Studio can be adapted to serve as a IDE for other computer languages.

Quote
Search Results
Built-in languages include C, C++ and C++/CLI (via Visual C++), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual Studio 2010). Support for other languages such as Python, Ruby, Node.js, and M among others is available via language services installed separately.
https://en.wikipedia.org/wiki/Microsoft_Visual_Studio
and...
https://msdn.microsoft.com/en-us/library/aa292164(v=vs.71).aspx
Quote
Microsoft partners with many companies to bring their languages to the .NET Platform. In addition to the languages provided by Microsoft, there are many alternative languages that target the .NET Platform, including:
COBOL for Microsoft .NET.
Perl for Microsoft .NET.
Eiffel for Microsoft .NET.
Python for Microsoft .NET.
Pascal for Microsoft .NET.
Mercury for Microsoft .NET.
Mondrian for Microsoft .NET.
Oberon for Microsoft .NET.
Salford FTN95 (Fortran) for Microsoft .NET.
SmallTalk for Microsoft .NET.
Standard ML for Microsoft .NET.
Dyalog APL for Microsoft .NET.
Notice there is an implementation of Perl.
This is not new information, But many are not aware of how people are using Visual Studio to do unusual things.

It's interesting that the very first comment there does precisely what Raymond Chen says, and starts slagging off Visual Basic developers!

I think the comparison falls apart somewhat after .NET, though. With earlier versions of Visual Basic and the comparable tooling it was PRETTY cut and dried that Visual Basic was much faster- it was pretty much called a Rapid Application Development tool, after all. But once we jump to Visual Basic .NET I'm not entirely sure the analogy continues, or if it does it isn't really restricted to Visual Basic, as the "RAD" element applies to almost all .NET languages. I'd argue that the looked-down-upon technology that contributes to fast development of GUI programs on Windows could probably be Windows Forms. It's very poorly regarded because it doesn't properly fellate enterprisey developer methodologies.

Fitting into the idea, though, I have a Command-line tool that is about 8 years old now that I use regularly for evaluating math expressions at the Windows command line. It's hardly the only program that does it but I sometimes make use of features like lists and sets whereas most other tools of the same sort are restricted to more standard arithmetic. At any rate, I wrote it in Visual Basic 6 and haven't bothered to replace it. I did rewrite it but I simply don't trust the new version even if it does pass all the unit tests. No unit test can replace 8 years of reliable results, after all.


1814.

Solve : Regedit string value data prefixes?

Answer»

Hi, I want set adobe reader "print as image" for all printer by default.
How to do it? For one printer I can do with this string:
reg ADD "HKCU\Software\Adobe\Acrobat Reader\11.0\General\cPrintAsImage" /V t1 /t REG_SZ /d "HP LaserJet 1018 (redirected 1578)" /f

I want to set from 1578 to any value, like this: HP LaserJet 1018 (redirected "*")So your looking for code to read in a value from a parameter within that local system and pass that value to a registry change replacing xxxx with the value read in, specific to that system?

Quote

reg add "HKCU\Software\Adobe\Acrobat Reader\11.0\General\cPrintAsImage" /v t1 /t REG_SZ /d "HP LaserJet 1018 (redirected xxxx)" /f

If so, where does this value reside that you need to read it in from at the local system, and is this value to be read in always at that target location or could it be in different places depending on the printer model or driver etc? More info needed!

I am assuming you are system admin as well so you wont be running this from a user privilege, but as admin at each of the systems to implement?Hi thank you for your reply.
Yes, I'm system ADMINISTRATOR and I solved it.
People working on terminal and when they login to server always changing "redirect value" so I can't to write all.. can be hp laser jet 1020 (redirected 19) or hp laser jet 1020 (redirected 1900) and etc..
So I wrote a script which copy all printers names to file, next step script read from file and copy names to registry.
I put this script on group policy log on and every time, when user login to server, it get new value in registry
Sorry, my english isn't perfect, but I hope you understood me
1815.

Solve : Java beginner needs a little help?

Answer»

Hey im new to java and i just need a little ADVICE. have to make a program that CALCULATES the perimeter and AREA of a TRIANGLE and the area of and ELLIPSE. I have to have a main class that takes in user inputs a triangle and an elipse class that does the computing and a report class with a method that takes the values returned from triangle and ellipse and displays them with a format for 2 decimals. Whats the best way to pass the values to the report class and display them with proper formatting? Any help is greatly appreciated!We do not do homework here.
But here is a hint. You need to use real numbers. That means floating point for calculations. Haha yeah i got that i just needed help displaying the values returned with the right decimal format. But you dont do homework sorry i didnt know thanls anywayFor more information about java from users, go to this place:
http://stackoverflow.com/questions/17060285/java-double-how-to-always-show-two-decimal-digits
There you can find many posts about how others do decimals in Java.

1816.

Solve : Bloodshed Dev C++ lagging out on a 24,947 line program?

Answer»

Working on a C++ project that is 24,947 lines and was created using Bloodshed Dev C++, as the program started getting larger I noticed that going into the code and making a change, if i backspace to change something I am able to make the change, but get a cartwheel for 5 seconds and then bloodshed dev c++ acts fine. This wasnt happening when the program was smaller and to avoid typing all that code mostly switch case statements I copy pasted to replicate the source and then am going back in and editing the logic manually line for line on what to do for each case. Its almost like the change of anything in the program of this size its having to accept the change to the IDE and then run something maybe a cached copy of the 24,947 lines of code before it unfreezes. The freeze lasts about 5 seconds and happens only when editing/altering code. If I create a new line of code there is no lag.

Anyone out there work with Bloodshed Dev C++ to know the cause and fix for this "cache lag"? or another Free C++ IDE that works well with large programs. The majority of the lines of source are long switch statements with a vast quantity of matching cases and what to do upon a match etc. Unfortunately there is no way to reduce the size of the program due to the logic complicity of it all. Logic can only be reduced so far before you lose the functionality and I have been using my own functions to REUSE routines to try to make it manageable.

Right now I am able to program and debug the program, but its an annoyance more than anything else to have a 5 second pause when I am use to programming quickly as its brain dumping from my brain through my fingers to the IDE.

The system I am using Bloodshed Dev C++ on is a modern 3.4Ghz Core i3 with 4GB RAM running Windows 7 Home Premium fully patched. So it has plenty of processing power and resources. No other programs act up on the system and it otherwise runs healthy. I know that Bloodshed Dev C++ is an old IDE, and maybe there is a better Free one out there if no one knows of a fix for this lag issue every time I edit a line.Can you not break into smaller chunks?You could disable syntax highlighting or autocomplete features. These would require static analysis of the source file which would need to be redone every time the source file changes.

Quote from: DaveLembke on September 21, 2015, 11:58:07 AM

Unfortunately there is no way to reduce the size of the program due to the logic complicity of it all.

I cannot see the code. I can only go off of what you have shared.

If you really have a irreducibly complex, 24,947 line program, It could be the subject of a thesis.

More likely is that it is quite reducible. The use of Copy paste during construction seems to make that clear.Quote
You could disable syntax highlighting or autocomplete features. These would require static analysis of the source file which would need to be redone every time the source file changes.

Thanks BC I will check into disabling these features.

Program is pretty much playing with crypto for fun and a use to keep passwords and private data safe.

I have a small notebook at home that I made a copy of and use to keep a copy of it in trunk of car in case home ever had a fire etc, I'd still have my many user/password and security questions available to me. However like a diary anyone getting their hands on it has EVERYTHING at their FINGERTIPS. However what looks like pages of random characters if worthless to anyone without the program to decrypt it.

I wrote a simple C++ program a while back that looked like an innocent game, but with the correct input it gave access to all my user/password and security info for all the many websites I belong to etc, BUT I dont like having an EXE with this data on a thumb drive that could get lost and someone could say why is this simple game so large in size and decompile to gain access to the private info.

So I decided to crypt my information in a book which is worthless without the correct key and program that spits out the correct information. The book alone is garble to anyone if anyone got a hold of it as well as the program is a simple tool that asks for each character and spits out an output for each character based on the key and character location in what is being decrypted. There might be crypto tools already out there, but decided to make my own and go complex with it and use switch and case statements in which each switch function is a separate key value with different combinations of output for upper/lower case letters, numbers, special characters, and spaces.

Going with a mathematical crypto solution I didnt like because the world of computing is full of patterns, so while I do not have every combination possible in my crypto, I have ENOUGH of them that without the program, key, and book of what to enter into the crypto decryptor its pretty much worthless information for anyone that gets their hands on it. So thats why it has this many lines of code.

If someone was to go with a mathematical crypto, you would just reference an array with all the characters to be used, but for the fact that I am using switch statements its large.

Random Generators for anyone who has worked with them are flawed, and your best option to get rid of predictability is to seed the timer. But you dont want to seed a random generator if you want to place piece of data in and get an output that you can then take that output and put it back in to get the original data as for the seeded timer if not executed at the same time interval at the same location in the algorithm cycle you end up with garbage as the output.

If you really need a better random generator, you can find one.
http://www.rambus.com/intel-random-number-generator/
Quote
Good cryptography requires good random numbers. This paper evaluates the hardwarebased Intel Random Number Generator (RNG) for use in cryptographic applications.
It uses the Johnson ThermalNoise Source
https://en.wikipedia.org/wiki/Johnson%E2%80%93Nyquist_noise
Quote
Thermal noise in an ideal resistor is approximately white, meaning that the power spectral density is nearly constant throughout the frequency spectrum (however see the section below on extremely high frequencies). When limited to a finite bandwidth, thermal noise has a nearly Gaussian amplitude distribution.[
Search for Gaussian amplitude distribution
1817.

Solve : What language should I use??

Answer»

I want to build a front end desktop application that will be able to start Windows applications within it, it needs to be able to manipulate file structures.

Any ideas?So you want a GUI shell wrapped around Windows so the user doesnt use the Windows GUI but your own?

C++ would be able to do this. Its quite the project though. LOTS of programming! You would be working with OpenGL probably for your rendering of the GUI. http://www.opengl-tutorial.org/

If wrapped around Windows, it would be part of the startup and so the user would see Windows logo and Windows booting up, and as soon as the startup path triggers, your program would take over full control of the GUI.

Is this what your looking for or are you trying to hide Windows completely, but base it around Windows?

Your also going to be likely tapping into API calls to Windows. http://www.dreamincode.net/forums/topic/207581-intro-to-the-windows-api/

If you dont want to hide the Windows GUI environment the programming would come much easier running your program within a Window with Windows Desktop GUI not hidden. You then wouldnt be having to mess with OpenGL and able to use the IDE such as Visual C++ Studio Express 2013 https://www.microsoft.com/en-us/download/details.aspx?id=44914 in which you can build the layout and add BUTTONS and text boxes and have your code tied to buttons to perform specific tasks as well as information typed into a text box could be part of a search function etc.

Have you programmed in any other languages before or is programming new to you? (This project may be way far and above anything you ever imagined in complexity and time needed to program it all. Not to scare you away, but just the facts. )

My programming in C++ is usually short and sweet programs which sometimes can take a week to create. They are generally less than 20 pages of 8.5x11 when code is printed out. I am not a master of C++ but also not new to it. I took 3 YEARS in college on it ( Intro C++, Intermediate C++, Advanced C++ ) and I dabble in it as a hobby to make small programs to solve needs I have. I started programming in the 1980s with Basic and then dabbled in QBasic, then C, then Visual Basic in the mid 90s, and then took C++ in college because it was considered the harder language not bound to just the Windows platform and C++ would help me better in my career path in which back in the late 1990s I wanted to GET into making Video games and mastering C++ was the ticket to that. However getting into it, I soon REALIZED why game manufacturers have teams of master programmers and graphic artists and computer/network engineers. A game I wanted to make as a project in college that was going to be on the lines of Quake like graphics i was dreaming up I soon realized I dont have the time and knowledge to make this happen before the semester is over, so the game I created called Moon Escape which was a linear progression game of choices, the graphics were that of something you would see on a Shareware DOS title of the 1980s with bitmap manipulation of if the person bushes a button, then load up this next bitmap that shows the change as a result of pushing the button. I got a A+ on my project, but it was almost embarassing showing this very CRUDE game to the class, standing up there with the game shown on the projector on the wall, and another older glass platen projector with code on it to show the class what I used for code and how it affected the game. The professor was very good and didnt say you are crazy to take on such a project, you would sink or swim, and you would know you bit off more than you can chew and adjust and learn from it.It would help if you could explain what you are trying to do in more detail. For Windows your best bet would probably be using .NET with a language like C# or Visual Basic. The free versions of Visual Studio would be good for this. Doing it in raw C++ seems like it would just overcomplicate the issue.What do you mean by "start Windows applications within it"?

Do you mean that it will launch other applications or that those applications will need to somehow be "integrated" into the same program? For example- having multiple programs launch and somehow appear as "tabs" in your program?

"it needs to be able to manipulate file structures" is rather vague. Pretty much all software needs to "manipulate file structures" so I suspect you have more specific "file structures" in mind.

If you just want a launcher interface, that is reasonably straightforward. Most programming languages expose ways of starting and even monitoring launched processes.

In the latter case, where they need to be integrated, that's not reasonably possible without being responsible for the applications themselves and designing them with the "launcher" in mind- eg being a Control or DLL that is interfaced with the Menu/launcher.

Tomwatts,

What they say is true.
Learning a formal computer programming method is not an easy task for anyone.
It takes years of work and the help of others to become skilled.

1818.

Solve : crowdfunding website?

Answer»

Hi,
I need to CREATE a crowdfunding website. I have basic knowledge of css, html. I have created small websites using css and html. Should I need any programming language to create this website? and what are the things to know before starting (eg. coding languages, paypal, or any other). Is wordpress crowdfunding site could be used for crowdfunding? Kindly let me know. Also please provide me the knowledge how exactly the crowd funding works.
Thanks in advance.
Regards,First of all, why? UNLESS your idea is somehow much better than the other crowd funding sites out there then there is no point.

To answer your question- you will need good programming ability in both JAVASCRIPT and some sort of backend language such as Python, PHP or Ruby. You will also need very good Database knowledge and knowledge about writing a secure site, particularly since you are dealing with real money. HTML and CSS ALONE are nowhere near enough to do what you are planning to do.

Don't go using a random WordPress plugin... That way there is no way your site is going to be unique and blindly using a plugin for your entire site WITHOUT the technical knowledge of how it works is just setting yourself up for trouble.

1819.

Solve : radio button link?

Answer»

Hi, another fun project:
I'm printing a list from a table ALTERNATING line colors. I'm including
a radio button on each line to link to the URL "target". I've greatly
edited offerings from the net and all is well except that the buttons
do nothing. I don't understand the line:
echo "";
Thanks for any help!



Code: [Select]<!DOCTYPE html><html>
<head>
<title>Email Visits</title>
</head>
<body><center>
<form id="testform" name="testform" action="" method="post"
accept-charset="UTF-8">

Code: [Select] <?php
$host="localhost";$USERNAME="root";$password="cookie";
$db_name="homedb";$tbl_name="emailtbl";

/*Connecttoserverandselectdatabse*/
mysql_connect("$host","$username","$password")ordie("cannotconnect");
mysql_select_db("$db_name")ordie("cannotselectDB");

//Define$count
$count="";

$sql="SELECT*FROMemailtblORDERBYtargetASC";
$result=mysql_query($sql);

echo'<tableborder="1"cellspacing="0">';
while($res=mysql_fetch_assoc($result))
{
//Add1totherowcount
$count=$count+"1";

/*-------------If$count==1tablerowcolor=#FFC600----------*/
if($count=="1")
{echo"<trbgcolor='#FFC600'>";}

/*-------------If$count==2tablerowcolor=#ccffff----------*/
if($count=="2")
{echo"<trbgcolor='#ccffff'>";$count=$count-"2";}

echo"<td>";
echo"<inputtype=\"radio\"name=\"select\"value=\"{$res['target']}\">";
echo"</td>";
echo"<td>";echo$res['target'];echo"</td>";
echo"<td>";echo$res['username'];echo"</td>";
echo"<td>";echo$res['password'];echo"</td>";
echo"<td>";echo$res['emailused'];echo"</td>";
echo"<td>";echo$res['lastused'];echo"</td>";
echo"<td>";echo$res['purpose'];echo"</td>";
echo"<td>";echo$res['visits'];echo"</td>";
echo"<td>";echo$res['saved'];echo"</td>";
echo"</tr>";

}
echo'</table>';
mysql_close();
?>

Code: [Select] </table> </form></body></html>
What is your local host?
Do you see the code connecting to the local host?
explain your post pleaseDo you have a local host?
For example, the local host might be:
127.0.0.1
But a jump to that IP will GENERATE an error unless there is a service at location.

Why Is the Localhost IP 127.0.0.1?


The above is a tutorial that explains in more detail.

Meanwhile, you could TRY code that does not require a local host.

1820.

Solve : how to show comment on every post without looping the same comment in php?

Answer»

Well, am currently working a on posts and comment system using php language.... when never I comment of a post... comments tend to REPEAT on other post...

[attachment deleted by admin to conserve space]First of all, you'd be best off using a service like http://pastebin.com/ or https://gist.github.com/ to share code rather than using screenshots.

Looking at your code, you don't appear to have any sort of post ID column in your comments table. You need this so that each comment can be linked to the post that it refers to, you would then need to update the query that retrieves comments to restrict it to comments where the post ID is the ID of the post you are loading.

Also, if you are planning on actually launching this site, you need to look into preventing SQL injection and cross site scripting (XSS) attacks. XSS is where people can put HTML/Javascript code into a comment, this will then run on the PAGE for people who visit the site which can be pretty nasty, you should use a function like http://php.net/manual/en/function.htmlentities.php to sanitise any input from the user before putting it into HTML that is sent to the browser.

To prevent SQL injection you need to use a function like http://php.net/manual/en/mysqli.real-escape-string.php to escape/sanitise any input from the user before CONCATENATING it into a database query string, otherwise people can inject carefully crafted strings and manipulate database queries. You could also look at using PDO prepared statements as this would generally be the best option.http://pastebin.com/bnt9bTD2

Am aware of injection... I was just working with post & comment as the way of learn.... thank you for reminding me that!....
I'll TRY using PDO in advanced but for now I just need to solve this problem

I would be glady if you solve it for me!...
Now I dd this! http://pastebin.com/0qwiNC4h

I used if statement in line 55!.... but this shows no comment...
another problem encountered!

[attachment deleted by admin to conserve space]Please STOP posting links and asking us to go see what you did. Cut and paste into this thread.Not sure what you are trying to do in line 55. You're comparing the $post_id variable to the string of "comment_id".

At the moment you aren't storing which post each comment relates to in the database, it is impossible to do what you are trying to do with your current database schema. You need to change your database schema so the comment table has a post_id column then update the INSERT query to include the ID of the post that the comment relates to then update the query that gets the comments and add a WHERE clause to only get comments where the post_id column is the same as the current post ID.

Quote from: Allan on September 26, 2016, 02:17:14 PM

Please stop posting links and asking us to go see what you did. Cut and paste into this thread.

To be fair it was me that suggested using pastebin. I prefer it as it gives line numbers/syntax highlighting and stops the thread getting full of massive blocks of code. However, if using code tags are preferred on here then that's fine.line 55 it was worth trying.... it tends to duplicate every comment in my database

let me work on that.. cause you're the second one telling me to do that!!... ill keep you posted it works

...My bad about pastebin linksI failed man... I would be glad if you send me some scripts that I need to work with....
1821.

Solve : Coding Test Ransomware Help?

Answer»

Greetings,

I am doing a project for school and I am making a test RANSOM ware.
I have the form itself done in visual BASIC but I have questions on how to PERFECT it.
What do I add to let them be able to pay and then get their decryption key, and how do I add something that ENCRYPTS all files and the only way to be decrypted is with a key.

I'm making this in Visual Basic, if you could also tell me how to do the same thing but like in an inclosable browser session that would be great.Really? I mean really?

1822.

Solve : vb program not searching?

Answer»

i have thisprogram working on 3 computers but wont work on this one. it is windows 10 and is a vb program short and has worked PREVIOUSLY quite well. when I search I input the file name where all names are stored. e.g. horse.dat and then a name it then vanishes off the screen this extract is from one that works on windows 10 on one computer and transferred to the one that doesn't work it is not working on the computer that I want it to work. any clues it seems to find horse.dat it allows the input of the name to search and then it vanishes.
Const ForReading = 1
Wscript.StdOut.Write "Please input FILENAME: "
FileName = Wscript.StdIn.ReadLine
Do Until UCase(SearchHorseName)="XXX"
Wscript.StdOut.Write "Search Name or XXX to end: "
SearchHorseName = Wscript.StdIn.ReadLine
e=0
q=0
R=0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objInputFile = objFSO.OpenTextFile(FileName, ForReading)
Do until objInputFile.AtEndofStream
strHorseData = objInputFile.ReadLine
q = q + 1
strHorseData = Replace(strHorseData, Chr(34),"")
If Left(strHorseData,LEN(SearchHorseName))=SearchHorseName Then
wscript.echo strHorseData & " " & q
Fstring = Left(Strhorsedata,9)
strHorseData = Replace(strHorseData, ")(",",")
strHorseData = Replace(strHorseData, "(",",")
strHorseData = Replace(strHorseData, ")",",")
ArrData=split(strHorseData,",")
HorseName = ArrData(0)
EndNumber = Val(ArrData(5))
e=e+1
If EndNumber > 0 Then EndNumber = 9- EndNumber
R=R+EndNumber
wscript.echo R & " " & e
End If
Loop
objInputFile.Close
wscript.echo Fstring & " " & R
Loop
Wscript.Quit

Function Val(vValue)
If len(vValue) = 0 then
lResult = 0
else
if isnumeric(vValue) then
lResult = cdbl(vValue)
else
lCount = 1
do until (isnumeric(mid(vValue,lCount,1))=false) or (lCount > len(vValue))
strResult = strResult & mid(vValue, lCount, 1)
lCount = lCount + 1
loop
if len(strResult) = 0 then
lResult = 0
else
lResult = cdbl(strResult)
end if
end if
end if
Val = lResult
End Function

I assume it is finding horse.dat as it allows the input of the name but as soon as I hit return it vanishes.Did you get error messages?
First guess is the run time library was not installed.
What is the name of the VB program?
Is it a script or an EXE file?
Which version of Visual Basic? It matters.

Most often Visual Basic programs have to be installed with the same libraries as C++ or else the .NET library. And there are different .NET libraries.

Just knowing it is a VB program is not enough information.

Visual Basic .NET (VB.NET or VB .NET) definition
Quote

Visual Basic .NET (VB.NET or VB .NET) is a version of Microsoft's Visual Basic that was designed, as part of the company's .NET product group ...

Geek, read the code. It's VBScript.

OP, try running it in a console under Cscript.exe and report any error messages
Thanks for responding. I am not a vb programmer so cant answer some of what you are saying.

this is the story. i have this program running on 2 other computers. it used to run on this one now windows 10 but was running on 7 and stopped running on 7.
When i run it and ask it to search e.g. put in the name to search and hit enter it flashes off the screen and disappears. It gives me the impression it the data file to search is not in the right FOLDER but I am of the impression that it is.

I have copied a working copy of the vbprogram to the computer and still the same result. it was working but now it just flashes off the screen. the series that I conduct is click the program (VB) it asks for the data file. i enter the data file hit enter and it then asks for a name to search. I put in the name to search and hit enter and it all disappears. would be INTERESTED on your thoughts.sometimes it gives a wrong filehandle error if i try to run it from the folder but from the BATCH file it behaves as i have said it asks for the datafile name then the name to search and vanishes. I feel it is searching the wrong folder and not finding the target datafile. even if you confirm this i will go back to the drawing board and keep moving it.solved changed horse.dat to horse.txt and it now works. this works with horse.dat on my other computers go figure.changed file to txt and it now searches. wouldn't find dat file.
I think what you have got is not a "VB program"; it is a Visual Basic Script (VBScript) script. Possibly the problem you had is that the extension .dat is used by Windows for system data files and possibly on the problematic computer a permission setting or file association setting has resulted in your vbs script being denied access. Or .dat files are hidden by default on that system. To confirm this, try renaming the horses.dat file to any other extension, not just .txt and see if it works. I previously suggested running the script from a command prompt in a console window using the cscript engine e.g. cscript //nologo scriptname.vbs. This might cause an error message to be shown. If you just click on the script you may miss this, especially if the default script engine on the system is wscript.exe.

all my computers search for .dat file. so did this one. I changed the data file to a txt file and it now works. thank


also had trouble with toolbar not retreating. it was java trying to update. once I dealt with this it was okay.
1823.

Solve : VBS - Remove Desktop Shortcut from any user?

Answer»

Code: [Select]'http://www.tek-tips.com/viewthread.cfm?qid=1309939&page=9
Dim objShell, objFSO, sonicPath, fileFolder
Dim userFolder, desktopFolder, custFolder, extension
Dim fullname, shortcut, shortTarget

Set objArgs = WScript.Arguments
targetpath = objArgs(0)
StartDir = objArgs(1)
'MsgBox Chr(34) & targetpath & Chr(34)
sonicPath = Chr(34) & targetpath & Chr(34)
sonicDir = Chr(34) & StartDir & Chr(34)

'ON Error resume next

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

MsgBox sonicDir & " " & StartDir & " " & SonicPath

'Set fileFolder = objFSO.GetFolder("C:\Documents and Settings")
Set fileFolder = objFSO.GetFolder(sonicDir)
Set subFileFolder = fileFolder.Subfolders

For Each userFolder in subFileFolder
If objFSO.FolderExists(userFolder & "\Desktop") Then
Set desktopFolder = objFSO.GetFolder(userFolder & "\Desktop")
Set custFolder = desktopFolder.Files
'msgbox desktopFolder
For Each custFile in custFolder
extension = objFSO.GetExtensionName(LCase(custFile.name))
If extension = "url" Or extension ="lnk" then
'Find full path of shortcut
fullname = objFSO.GetAbsolutePathName(custFile)

'Find full path of target within shortcut
'See http://www.devguru.com/Technologies/wsh/quickref/wshshell_CreateShortcut.html
'for more information on how this works.
Set shortcut = objShell.CreateShortcut(fullname)
shortTarget = shortcut.TargetPath
'msgbox ShortTarget
If InStr(shortTarget, sonicPath) then
Dim myFileToDelete
Set myFileToDelete = objFSO.GetFile(fullname)
myFileToDelete.Delete
End If
End If
Next
End If
Next
I didn't write the above (LINK AT TOP) but am curious in expanding the functionality to allow for %SystemDrive%\Doc&Settings or \Users the path (VAR:StartDir). I am using a BATCH file to call the VBS passing it the full pathname of the shortcut with the %StartDir% But keeping getting path not found. I'm sure it is something SIMPLE but I'm not seeing it.

BAT FILE
Code: [Select]FOR /F "tokens=1-2 delims=\" %%A in ('ECHO %APPDATA%') do (
SET drive=%%A
SET PATH=%%B
)

REM ECHO %DRIVE%\%PATH% & PAUSE

DeleteShortCuts.vbs "http://companyaddress.com" "%DRIVE%\%PATH%"
DeleteShortCuts.vbs "https://companyaddress.com" "%DRIVE%\%PATH%"
The reason for doing this is the companyaddress.com has changed and the shortcuts no longer work. I have created a new version to drop a new URL onto the client machine using the ALLUsersDesktop special FOLDER in VBS but I want to be able to remove any old shortcut from any %USERNAME%\DESKTOP folder. Avoid confusion ... avoid clutter etc.

thanks for the assist. Looks like I waited to long to modify the code. I GOT this mostly working ....

Code: [Select]'http://www.tek-tips.com/viewthread.cfm?qid=1309939&page=9
Dim objShell, objFSO, sonicPath, fileFolder
Dim userFolder, desktopFolder, custFolder, extension
Dim fullname, shortcut, shortTarget

Set objArgs = WScript.Arguments
targetpath = objArgs(0)
StartDir = objArgs(1)
'MsgBox Chr(34) & targetpath & Chr(34)
'onicPath = Chr(34) & targetpath & Chr(34)
'sonicDir = Chr(34) & StartDir & Chr(34)
sonicPath = objArgs(0)
sonicDir = objArgs(1)

On Error resume next

Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

'MsgBox sonicDir & " " & StartDir & " " & SonicPath

'Set fileFolder = objFSO.GetFolder("C:\Documents and Settings")
Set fileFolder = objFSO.GetFolder(sonicDir)
Set subFileFolder = fileFolder.Subfolders
'On Error resume Next
For Each userFolder in subFileFolder
If objFSO.FolderExists(userFolder & "\Desktop") Then
Set desktopFolder = objFSO.GetFolder(userFolder & "\Desktop")
Set custFolder = desktopFolder.Files
'msgbox desktopFolder.Files
'MsgBox custFolder.Count
MsgBox desktopFolder
For Each custFile in custFolder
'MsgBox CustFile.Name
extension = objFSO.GetExtensionName(LCase(custFile.name))
If extension = "url" Or extension = "lnk" Then
'Find full path of shortcut
fullname = objFSO.GetAbsolutePathName(custFile)

'Find full path of target within shortcut
'See http://www.devguru.com/Technologies/wsh/quickref/wshshell_CreateShortcut.html
'for more information on how this works.
Set shortcut = objShell.CreateShortcut(fullname)
Set WshShell = WScript.CreateObject("WScript.Shell")
set oShellLink = WshShell.CreateShortcut(fullname)
shortTarget = shortcut.TargetPath
shortTarget1 = oShellLink.TargetPath

msgbox shortTarget & " " & fullname
If InStr(shortTarget, sonicPath) then
Dim myFileToDelete
Set myFileToDelete = objFSO.GetFile(fullname)
myFileToDelete.Delete
End If
End If
Next
End If
Next

....but on line 51 Code: [Select]msgbox shortTarget & " " & fullname
shortTarget sometimes reports a blank target even THOUGH if I right click on the file and go to properties to view it I can see the target. I'm wondering if it is because the LNK file is a shortcut to a webaddress instead of the LNK file being a shortcut to an application. Would there be a WAY to fix this so I can get shortTarget even if the target is a URL in a LNK file. I need this same script but need to be able to search the entire c drive and remove. Could someone possibly help me with that?

Thanks
Chad

1824.

Solve : PowerShell?

Answer»

Hi All,
I am new to powershell. I find that I will need to learn a little about it if I am going to pass MS cert tests. Can someone point me to a good site to get my feet wet?

Thanks
Did you Google?
Get Feet Wet with Powershell

https://www.ibm.com/developerworks/community/blogs/theTechTrek/entry/get_your_feet_wet_with_powershell_gui?lang=en

No I did not...good one! LOL

If you look at the link its a GUI for powershell. I will check it out but not really what I was looking for. Thanks for the help



Well, the thing now is to integrate PowerShell into a visual display. That way you can get into help FILES and still have the command screen up and running.

Microsoft expects full-time administrators to take some time to learn PowerShell. In is needed is some types of administrative tasks.

Here are some things you will find out there:

http://www.computerworld.com/article/2879205/data-center/powershell-for-beginners-scripts-and-loops.html

https://blog.varonis.com/top-10-powershell-tutorials-on-the-web/

There is no shortage of tutorials.
Since it's an MS Cert, the Official MS Documentation is likely a good place to START.

Thing is- I'm not aware of any MS Certification that involves powershell that is not a powershell specialty, like "Certified Specialist in Microsoft PowerShell Scripting".

Quote from: BC_Programmer on August 24, 2016, 07:12:13 PM

Since it's an MS Cert, the Official MS Documentation is likely a good place to start.

Thing is- I'm not aware of any MS Certification that involves powershell that is not a powershell specialty, like "Certified Specialist in Microsoft PowerShell Scripting".
...... Microsoft certification exam 70-411, Administering Windows Server 2012, which counts toward MCSA/MCSE certification.

Question 5:
You manage a set of servers for a department in the verigon.com domain. The department has servers that run Windows Server 2012 R2. You have a generation 2 virtual machine NAMED VMSRV55. The boot order for VMSRV55 is as follows: You want to make the DVD drive the first boot device. Which of the following should you type at the PowerShell prompt?

I am WORKING on a MCSA to start with. The first test is 70-410. It has questions like remote admin of servers USING powershell. I never used powershell so this is all new to me. I found a few online video training files. They help and I think that going to MS web site will also help.

1825.

Solve : Remove CR LF from standard I/O, with exception.?

Answer»

Can SOMEBODY write a simple program for me?
It will use just standard I/O, so no need to deal with file names.
As characters are read in, they will be echoed unless they are CR and LF. That is, the Carriage return and Line Feed.

An exception should be if a double CR LF pair is found. That would be an end of paragraph, which I want to keep.

I will use this to fix text fails that have UNWANTED CR LF in them. Some text files I have have unwanted word wrap and. So it is very annoying to have to reformat the text by hand to fit the width of the page.

Or, is there an easy way to fix this with and standard text editor?

Any suggestions?
Would something LIKE this help? http://www.techsupportalert.com/remove-unwanted-formatting-from-text.htmThank you! Whee did yo find that?

Quote

If you've copied text from a webpage or a PDF file to an email, you've encountered the PROBLEM associated with formatting being copied along with the text. The result can look very strange indeed, with broken lines and odd fonts.
That is the problem I have. I copy from PDF to the clipboard and lines are broken into a locum that was used in the PDF document. It seems somebody else already solved this problem and a few others that you get when trying to copy and paste from PDF.

I am going to try this now. After lunch. FIRST things first. I just Google searched for "Remove Formatting From File" https://www.google.com/?gws_rd=ssl#q=remove+formatting+from+file and its 10th one down on the search that looked like what you needed maybe. Hope this helps

I too have gone crazy trying to find something on Google... post here for help and others point me back to a Google reference that is the solution. Its all in the search criteria key words! Right! This is a great forum!
1826.

Solve : Visual basic CASE command help?

Answer»

I GET a "end of STAEMENT expected" error on all of the "to"s, any ideas?

Select Case iCharsNameValues
Case = 1 To 10
txtName.BackColor = Color.Blue
Case = 11 To 17
txtName.BackColor = Color.Pink
Case = 18 To 23
txtName.BackColor = Color.Yellow
Case = 24 To 30
txtName.BackColor = Color.Red
Case = 31 To 37
txtName.BackColor = Color.Green
Case = 38 To 45
txtName.BackColor = Color.Black
Case = 45 To 52
txtName.BackColor = Color.Turquoise
End SelectInstead of "Case = 1 to 10" use "Case 1 to 10" ( no = sign).

1827.

Solve : trouble with MYSQLi dropdown?

Answer»

Hi, I'm trying for awhile to code up a MYSQLi dropdown from a DATABASE, select a field(url, formatted as "http://www.thisurl.com) and arrive at that destination. I've tried several forums re. compatability (connection/query/output etc..Problem is I blow up at the first query (see screen shot). It's like my PHP isn't working. If someone will advise of the PHP issue maybe I can work out the app code. Any volunteers? Thanks!
--------------------------------------------------------------------- 1
Code: [Select]<!DOCTYPE html><html>.
<title>email visit info</title>
<HEAD>
</head>
<BODY>
create and display dropdown from database, url selected provides needed username and password. clicking on selected takes the user(me) to that url<br>
<center>
<form id="testform" name="testform" action="" method="post" accept-charset="UTF-8">

<?php
echo"<center>";echodate('m/d/y');echo"</center>";
$con=mysqli_connect("localhost","root","cookie","homedb");
//----------------------checkconnection------------------------
if(mysqli_errno($con))
{echo"Can'tConnecttomySQL:".mysqli_connect_error();}
else
{echo"</br>";}
$id='';$url='';$username='';$password='';$purpose='';
$emailused='';$date-time='';$count='';$saved='';

//----------Thiscreatesthedropdownboxusingrecordsinthetable-----------
echo"<selectname='url'>";
echo'<optionvalue="">'.'---selectemailaccount---'.'</option>';
$query=mysqli_query($con,"SELECTurlFROMemailtbl");
$query_display=mysqli_query($con,"SELECT*FROMemailtbl");
while($ROW=mysqli_fetch_array($query))
{echo"<optionclass=highlightvalue='".$row['url']."'>".$row['url']
.'</option>';}
echo'</select>';
?>
<input type="submit" name="submit" value="Submit"/>
</form>
{
$url = $_POST['url'];

// ----------------------- display the table ------------------------
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'
<td bgcolor="#ccffff">'.'url'.'</td>'.'
<td bgcolor="#ccffff">'.'username'.'</td>'.'
<td bgcolor="#ccffff">'.'password'.'</td>'.'
<td bgcolor="#ccffff">'.'purpose'.'</td>'.'
<td bgcolor="#ccffff">'.'emailused'.'</td>'.'
<td bgcolor="#FFD47F">'.'date-time'.'</td>'.'
<td bgcolor="#FFD47F">'.'count'.'</td>'.'
<td bgcolor="#ccffff">'.'saved'.'</td>'.'</tr>';
// while($data = mysqli_fetch_row($fetch))
while($data=mysqli_fetch_row($result))
{
echo ("<tr>
<td>$data[0]</td><td>$data[1]</td><td>$data[2]</td>
<td>$data[3]</td><td>$data[4]</td><td>$data[5]</td>
<td>$data[6]</td><td>$data[7]</td>
</tr>");
}
echo '</table>'.'</td>'.'</tr>'.'</table>';
mysqli_query($con,"UPDATE emailtbl SET
date-time = 'DATE()'; count = 'count + 1';
WHERE url=$url");
?>
</center></body></html>
------------------------------------------------------------------------
2
Code: [Select]<?php
echo"<center>";echodate('m/d/y');echo"</center>";
$con=mysqli_connect("localhost","root","cookie","homedb");
//----------------------checkconnection------------------------
if(mysqli_errno($con))
{echo"Can'tConnecttomySQL:".mysqli_connect_error();}
else
{echo"</br>";}
$id='';$url='';$username='';$password='';$purpose='';
$emailused='';$date-time='';$count='';$saved='';

//----------Thiscreatesthedropdownboxusingrecordsinthetable-----------
echo"<selectname='url'>";
echo'<optionvalue="">'.'---selectemailaccount---'.'</option>';
$query=mysqli_query($con,"SELECTurlFROMemailtbl");
$query_display=mysqli_query($con,"SELECT*FROMemailtbl");
while($row=mysqli_fetch_array($query))
{echo"<optionclass=highlightvalue='".$row['url']."'>".$row['url']
.'</option>';}
echo'</select>';
?>
<input type="submit" name="submit" value="Submit"/>
</form>
{

// ----------------------- display the table ------------------------
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'

// ======================anchor attempt=========================
// echo "<a href='".$row['url']."'>".$row['url']."</a>";
// ==========================================================

<td bgcolor="#ccffff">'.'username'.'</td>'.'
<td bgcolor="#ccffff">'.'password'.'</td>'.'
<td bgcolor="#ccffff">'.'purpose'.'</td>'.'
<td bgcolor="#ccffff">'.'emailused'.'</td>'.'
<td bgcolor="#FFD47F">'.'date-time'.'</td>'.'
<td bgcolor="#FFD47F">'.'count'.'</td>'.'
<td bgcolor="#ccffff">'.'saved'.'</td>'.'</tr>';
// while($data = mysqli_fetch_row($fetch))
while($data=mysqli_fetch_row($result))
{
echo ("<tr>
<td>$data[0]</td><td>$data[1]</td><td>$data[2]</td>
<td>$data[3]</td><td>$data[4]</td><td>$data[5]</td>
<td>$data[6]</td><td>$data[7]</td>
</tr>");
}
echo '</table>'.'</td>'.'</tr>'.'</table>';
mysqli_query($con,"UPDATE emailtbl SET
date-time = 'DATE()'; count = 'count + 1';
WHERE url=$url");
?>
</center></body></html>-----------------------------------------------
3
Code: [Select]<!DOCTYPE html><html>
<head>
<title>test 3</title>
</head>
<body><center>
<form id="testform" name="testform" action="" method="post" accept-charset="UTF-8">

<table border=1 cellpadding=2 cellspacing=2 bgcolor="#D4FFAA">
<tr>
<th>url</th><th>username</th><th>password</th><th>purpose</th>
<th>emailused</th><th>date-time</th><th>count</th><th>saved</th>
</tr>
<?php
$connect=mysql_connect("localhost","root","cookie")ordie("error");
mysql_select_db("homedb",$connect);
$sql="SELECT*fromemailtbl";
$result=mysql_query($sql,$connect);
$url='';;
while($res=mysql_fetch_assoc($result))
{
echo"<tr>";
echo"<td>";echo'<inputtype="RADIO"name="url">';echo"</td>";
echo"<td>";echo$res['username']>';echo"</td>";
echo"<td>";echo$res['password'];echo"</td>";
echo"<td>";echo$res['purpose'];echo"</td>";
echo"<td>";echo$res['emailused'];echo"</td>";
echo"<td>";echo$res['date-time'];echo"</td>";
echo"<td>";echo$res['count'];echo"</td>";
echo"<td>";echo$res['saved'];echo"</td>";
echo"</tr>";
}
?>
</table> </form></body></html>--------------------------------------------------------

1828.

Solve : Convert symbol-file to text-file?

Answer»

Hi everyone,

I'm really newbie in this thing. Currently I'm using an engineering software and the output files from that software need to be converted into another software in order the results to be display in 3D format. So there's no problem for that. But the challenge was I need to look what is inside the output files. It suppose to be in coding format (I'm not sure what types of coding been used). When I tried to open the file using text file (Notepad, Notepad++, Wordpad, Word etc...), it was in symbol-format so that I can't understand it (refer to attached file for example).

Is there any ways/tools that I can use to convert the file so that it can be readable?

Thanks in advance.

[attachment deleted by admin to conserve space]Perhaps you need to understand the disquisition of "code" and script. A code MAY not always make sense. A script is CLOSER to how people read and write.
A script is something done by human hand or can be read by the human.
But code is code. It is a set of values meaningful to a machine or device. Or maybe readable by a human.

If you want to 'see' code, you need an editor that will present code in a form that means something to the human eye. Notepad, Word and other such tools do not represent all codes. Only those codes used for word processing.

Perhaps what you expect is an editor that converts the output into a script.

Some professional programmers sometimes wish to look at the raw code and see the actual output, even if it does not make sense. To make it readable, the human may ask to see the code in hexadecimal format. one byte at a time.

Example. A man wrote a program called TEST.COM and wants to see the raw code.
Using a PC, he gives this command at the command prompt.
Code: [Select]D:\BIN>debug test.com
-d
13BF:0100 B4 01 CD 21 88 C2 88 D6-52 51 B4 02 CD 21 59 5A ...!....RQ..
13BF:0110 88 D0 FE C2 41 3C 5A 90-75 EE 90 B8 00 4C 88 E8 ....A<Z.u...
13BF:0120 CD 21 90 5A 90 76 76 76-76 76 76 76 76 76 76 76 .!.Z.vvvvvvv
The part above, the human typed "debug test.com" followed by enter ant then the letter "d" followed by enter. The rest is from the computer screen. (The debug program was once used in Windows programming.)
In this case, the code does not make much sense. But at least it does represent the output in a form the man can see. The example above is typical for the hexadecimal representation. If need be, the human could alter the code and SAVE it.
Thanks for the comment...
Yes I'm sorry for my misunderstanding about the 'code' and 'script' since I'm not in this area. So if I'm not mistaken, the problem is I tried to read the output files using Notepad, MS Word etc...which will display in funny characters. So do I need an editor to open the output files so that it will be in readable format? Any suggestion on specific editor?
The problem is that it is a binary file format. Given I can find no information based on the "Drop Velocity" part of what I WOULD expect to be the header, and you didn't mention any names for the software that created it, or any file formats that it could be, I suspect it is a proprietary and poorly documented file format which isn't uncommon for those sorts of programs.Just to update about this problem...
Actually I just tried to CHANGE in "save as" option into the text format and it works...!!! Maybe I was misslook at this option before. Anyway, thanks for your comments and advices here. Really appreciate it. Thanks...!!

1829.

Solve : java programming. need help.?

Answer»

I understand nothing about programming.
However I decided to learn java in a school. A school to let join in, requires to have UNDERSTANDING of java basics.

It OFFERS a test, who requires to program basic mathematic formula.
I even dont know where to begin to.
What software should I download, what SECTION... etc?Here's some beginner's resources from ORACLE (owner of Java): http://www.oracle.com/technetwork/topics/newtojava/gettingstarted-jsp-138588.htmlHope I will figure out.The link by Sstrollin is a good one.

Just to round things out, here is a strange paradox...
You can use Visual Studio as a simple development tool for java.
It can help you with COMMON mistakes people often make.
Java Language Support for Visual Studio
Visual Studio is a product of Microsoft.
Java is a product of Oracle.
The support extensions are from a third-party.

1830.

Solve : help== Was not expected at this time (Batch)?

Answer»

Ok, Hi! This is my first topic here, so I will go to the point directly:
I have this Batch FILE:
---------------------------------------------------------------------------------------

@echo off
:checkstage
IF "%0"=="%0" goto comparch
IF "%1" == "help" goto 1
IF "%1"=="emulate" goto 2
IF %2== goto 3

:comparch
echo Comparch v1.0
echo 2015 (C) uSoft. All Rights Reserved.
cd..
call shell.bat

:1
echo Usage Description
echo ===== ===========
echo comparch help Displays help about commands
echo comparch emulate [file] Displays help about commands
cd..
call shell.bat

---------------------------------------------------------------------------------------

That file is called by another batch file, shell.bat.
And it is like this:

---------------------------------------------------------------------------------------

@echo off
title Comparch v1.0 Shell
:shell
cd bin
set/P cli= *

IF %cli%==comparch call comparch.bat

---------------------------------------------------------------------------------------

So, my problem is that when I type, for example, comparch help, it displays:

help== was not expected at this time

And it leaves instantly.

What is wrong?

Pd: When I type "comparch" alone without any parameters, it runs correctly...Look at your test for %2TO clarify

This line:

IF %2== goto 3

will break the script if there is no second parameter passed to the script (if %2 is empty when the script is RUN) This is because you must have something on both sides of the == in an IF test. The usual way to beat this is to use quotes like this

IF "%2"=="" goto 3

Also,

When this line is run:

set/p cli= *

However if the user just hits ENTER so set /p captures an empty string, then this line:

IF %cli%==comparch call comparch.bat

will break the script because %cli% will be empty so do this:

IF "%cli%"=="comparch" call comparch.bat

This will fail if the user types the answer using any upper case characters. I am sure you can find out how to get around this, if the boast in your sig is true.

Finally, what is this line supposed to do?

IF "%0"=="%0" goto comparch
Thank you, and... "%0==%0" It was 2 AM, I didn't even wanted to think anymoreQuote from: BatchProgrammer on October 29, 2015, 04:02:49 PM

It was 2 AM, I didn't even wanted to think anymore

I've been there...
1831.

Solve : Black Debug Screen?

Answer»

I am trying to write a C program but every time I run the debugger all I get is a black screen. Personally I am not sure what's wrong, but would appreciate any help. The debugger is Visual Studio 2010 on Windows 10.

Code: [Select]#include&LT;stdio.h>
#include<stdlib.h>

void main()
{
int num;
int i,j,k;
int grd[20];

for(i=0;i<20;i++)
{
grd[i]=5+rand()%(100-5)+1;
}
for(k=0;k<20;k++)
{
num=grd[i]/5;
printf(" %d : ",grd[i]);
for(j=0;j<num;j++)
printf("X");
printf("\n");
}
}
Is it only this program that the debugger goes out to LUNCH with? Have you tried a simple program to see if it also has issues and then add an intentional typo to see if the debugger works

Code Below should execute and show Hello World!. You might have to add a system pause or an input statement to avoid it running and EXITING the console.

Code: [Select]#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
Code Below is missing ; in 2 locations and debugger should point them out on the lines

Code: [Select]#include <iostream>

int main()
{
std::cout << "Hello World!" << std::endl
return 0
}

1832.

Solve : IDA Psuedocode?

Answer»

in IDA..

signed int v1; // [emailprotected] what is the @ a reference to ?
also,

[emailprotected]


what is ST?

thanks in adv. for helping out a noob !Many here want to help you. Please clarify what you are doing and what tools your are using.
Normally IDA is use to study or DEBUG code written is some source language. Possibly JAVA, Python, C++ or almost any language that can be executed on a PC.

By chance, are you using the Hex-Rays Decompiler ?yeap using the Hex Rays decompiler and working with an unpacked dll for a game running on PCNot to overstep my bounds here but I am sure many would be hesitant to answer your QUESTION as this is a dangerous request you are making and the feeling one gets from your response leans 90% towards unauthorized disassembly/reverse engineering.

Whether for cheating, hacking the serial or whatever reason, reverse engineering any software without authorization is never acceptable and most if not all state as much when you install it.Itrenor,
Thanks for saying that. That is what I was thinking. Also, any dis assembler WORKS better with the source code. The dis dis assembly is used to debug, not to snoop.

1833.

Solve : bat volume settings?

Answer»

Hello,
I just wana know how to make bat file that can unmute and turn volume on maximum on windows 8.
What commands should I use? ThanksYou would need a 3rd party piece of software and have a MACRO that either performed a hot key combination if laptop it might have a Fn key combination to increase volume, if s desktop you would need someone elses program that calls to the windows audio configuration through an API call I would think.

I am forwarding this to the attention of a programmer who wrote some code a while back that might be of help to you on this. I had a situation where I wanted to have my audio muted for my user account because others on the computer when logging on would set the volume to max and shut off my mute. I would log on after them and have to mute it again. The audio levels are shared among all windows USERS vs user preference per profile, and so you inherit the last logons audio properties even from a different user account. It was frustrating and the work around for me was to shut off the SPEAKERS so audio was off before logging on. Then if I want audio I turn them on. Still this has me and other users fighting it out behind the scenes to where one PERSON is having to turn speakers on and I am having to turn them off. So the power button to speakers is likely to wear or break from daily on and off power to them. The programmer wrote some code that worked with an API for the windows sound audio level.
Possible answer. There is a script for auto hotkey.
http://stackoverflow.com/questions/16290463/can-i-make-a-script-for-a-macro-to-change-volume
But I do not personally know if it works.

Quote

I am forwarding this to the attention of a programmer who wrote some code a while back that might be of help to you on this.

Slapping the Windows Master Volume

Project is on github. Installer can be found here.

If you can use 3rd party apps, with the invaluable (British) NirCMD you can at the prompt or in a batch script, mute the volume, set it to max, and set it to any level between 0 and 65535.

And lots of other things, not just sound related.

http://www.nirsoft.net/utils/nircmd.html

You can have the system tray volume control slider visible and make it jump up and down from a command prompt.


Thanks BC for linking that project of yours. I'm thinking that would work for them. CREATING a new bookmark so in future I can find it and share with others who can use your solutions.

Also going to check into what geek and salmon shared.

Thanks Everyone
1834.

Solve : C++ Practical Functions Help?

Answer»

Hi there,

I've been learning C++ for awhile now and is mostly done in Windows OS. ( MinGW, no IDE just using Notepad, PREFER raw stuff... )

From my book and some online sources, most of the functions that I can access is basically just the Hard drive ( read / write file ), RAM ( assigning variables ) and CPU ( doing arithmetics and logic ).
Everything seems FINE at first, but soon I realized something is missing. From my book, every program I wrote always run in the Command Prompt.
But a practical program should have Graphical Interface, control Audio and receive input from Keyboard and Mouse and such.

I learned that in order to have those functions, I need to install extra components ( libraries ) in C++ such as SDL, OpenGL and stuff like that. ( which is not mentioned at all in my book... except and other basic stuff )

So, I would really appreciate someone to explain a bit about these "components".
How and where can you find these thing and what does it actually do to the original C++?

If possible, please provide some guides for me...
I'm trying to create a basic "Tone Generator". A simple program where you can "draw an audio wave form" and the program will "play that wave form from the speaker". It seems easy at first, but couldn't find any libraries that does that...

I don't think SDL (Simple DirectMedia Layer) and OpenGL would necessarily meet the needs of a typical User Interface program, but it would be useful for Audio functions. You would probably want to either install the Windows SDK (I have no idea how well it would work with minGW) or use a UI Toolkit such as GTK or QT.

Quote

So, I would really appreciate someone to explain a bit about these "components".
How and where can you find these thing and what does it actually do to the original C++?
You can USUALLY arrive at the appropriate project pages for them with a proper SEARCH. Typically you will want the SDK. They work effectively the same as any other header file, you use an #include and the functions and constants defined therein are available to you.
1835.

Solve : Grab batch prompt context and put it in a variable?

Answer»
favorite
i took this command to grab a profile and place its name in a variable

for /f "tokens=4 delims=: " %%A in ('netsh wlan SHOW profiles') do set "profile=%%A"
now i added this to the next line;

netsh wlan show profiles "%profile%" key=clear
then something that says "key content" (must be administrator) should appear with a WIFI password next to it, how do i get that password to also go into a variable? i TRIED doing something like this but it just DISPLAYS the word "such" for some strange reason...

for /f "tokens=4 delims=: " %%A in ('netsh wlan show profiles') do set "profile=%%A
for /f "tokens=4 delims=: " %%A in ('netsh wlan show profiles "%profile%" key=clear') do set "profile2=%%A"

echo %profile2%
1836.

Solve : Managing usb 3.0 in my 100% assembly operating system?

Answer»

Hello,

in my 100% assembly operating system, i NEED to use usb port to connect my camera. If my UEFI integrates usb boot, does that mean that it already manage usb port, i mean all its features ? If yes, are there interrupts to do that ? If not, do you know if this site http://www.usb.org/developers/docs/ allows me to write a driver with all features of USB 3.0 ?

Thanks in advance. What operating system is this? Are you making your own OS? I don't know a thing about writing device drivers, but I'm curious.Yes but i am not a competitor to Windows and others, that is intended to a robot.Would you be able to EXPAND more on this project? I really can't THINK of a reason to build your own OS for anything other than a simple learning project (which you wouldn't need USB for) when there are already so many different existing operating systems out there to fit basically every project. And even then, you wouldn't do it entirely in assembly - You would maybe have to write the EXTREMELY low level bootloader.etc in assembly but you would then write everything else in a high level systems language like C.
It has nothing to do with the topic but this OS is intended to control a humanoid robot. I know what I'm doing and assembler is my choice. Please i need the answer as soon as possible.Quote from: Block on July 31, 2016, 12:48:29 AM

I know what I'm doing and assembler is my choice. Please i need the answer as soon as possible.
Spot the contradiction...
No one ?
1837.

Solve : .bat plz?

Answer»

Hi,

Can someone tell me how to MAKE a batch to RUN ping 192.168.1.254 -t?

I need it to run at start up from task SCHEDULER.

Many thanks!

MattI was running the script as just: ping 192.168.1.254 -t but had named the file ping.bat
Apparently when you do this it just prints the line over and over in CMD prompt. Yet the same command saved with the filename ping1.bat works fine.

Why is this? Let's say you are in the directory CONTAINING ping.bat.

What would you expect to execute if you enter the command "ping"?

1838.

Solve : about video editing?

Answer»

I have a video. On that video I want to ADD picture who would move from 'angle 1' to 'angle 2' and spin slowly.
What software should I use?
Is it possible to make without sony vegas, because I never SAW more unbearable UI.

(more info in attachment)

[attachment deleted by admin to conserve space]I heard of some people using the scratch PROJECT to do EDITING of videos for free, but I havent played with it to help much on it. Not sure if this would be helpful or not. But my daughter uses scratch in school and is able to add pictures and make them move and rotate and all, and I havent seen any videos EDITED with scratch, but heard of it done and this might be a method if your looking for a free method. However it might not be that user friendly of a method or feature rich.

https://scratch.mit.edu/projects/1290024/

1839.

Solve : Help with batch file [costum message]?

Answer»

so....

I am making a "go-to-program-shortcut-file" -->[.bat] (for now still in work...)

and i need some help.
Is it possible to CHANGE the "ping message" ? ? ?


I would like it to not display


pinging google.com [ip] with . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .
Reply from [ip] bytes=32 . . .




I want it to display something like

Pinging google.com
connection status : connected (or disconnected)
your ping is [ping] (if the user has internet connection)




I appreciate any kind of help . . .
Thank you for support.


Aljax




Your output is going to be sort of worthless for troubleshooting.

Your chopping out the most important FEATURE of Ping which is latency info and failed Ping count which you want to see 0% loss. From looking at what you want. It could say that your connected but yet you could have a major network issue going on.
Quote

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\dave>ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\dave>

Trying to understand why Ping as it is is not good enough?

As far as shaping the output to say WHATEVER you want, it can be done, but not in real time. There would be a slight delay in what is measured and then what is parsed as the output to the display. To get rid of this delay would require writing your own Ping program so that the output is as you want it without having to reshape it to an alternate display layout to user.it is ok if there is a little delay . . .
goes fine with me
soooo
can you learn me something ?

[say yes XD]

if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit]
I agree with Dave, but if you must do it then try this

By the way, no PMs, whatever help you get or don't get is here in the THREAD that you started.

Code: [Select]@echo off
SET host=www.google.com
echo Pinging %host%
set status=disconnected
ping -n 1 %host%>nul && set status=connected
echo Connection status : %status%
if "%status%"=="connected" for /f "tokens=1-7 delims== " %%A in ('ping -n 1 %host% ^| find "Reply from"') do echo Your ping is %%G
The output was:

Code: [Select]Pinging www.google.com
Connection status : connected
Your ping is 21msThank you man
appreciate that . . .
Ill send you finished version
score it from 1 to 5 please and tell me what you think i should add in .
thnx again 4 reply and support
and "PMs"
what is this ?
i'm from Slovenija so i don't know much about English spech shortcustQuote from: aljax
and "PMs"???what is this ?

Quote from: aljax
if yes, is it possible to send a personal message on this forum [ill paste in my code so if you want, you can help me a bit]
Thanks everybody [two man] who replied so fast and with great support
1840.

Solve : is this vbscript code dangerous??

Answer»

I found this code on the internet but it appears to be some sort of malware, anyone entirely sure what it is? by looking at it can anyone tell me how entirely it works?


Dim objHTA
Dim cClipBoard
Dim WshShell
set objHTA=createobject("htmlfile")
cClipBoard=objHTA.parentwindow.clipboarddata.getdata("text")
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", cClipBoard, "REG_SZ"
WshShell.Run "regedit.exe -m"
Set objHTA = nothing
Set WshShell = nothingit launches registry editor, setting the VIEW to the registry key that is on the clipboard.

The source appears to be here.

and why EXACTLY does that make this malicious?
Quote from: zask on December 10, 2015, 01:51:39 PM

and why exactly does that make this malicious?

I never said it was malicious.could you maybe explain in detail what it does?
Quote from: zask on December 11, 2015, 11:19:12 PM
could you maybe explain in detail what it does?

The blog post I linked is from the original author, and provides details about what each PART of the script does.

ANTIVIRUS says its malicious?Antivirus' can come up with false positives, but this is probably getting flagged because of

Quote
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", cClipBoard, "REG_SZ"
WshShell.Run "regedit.exe -m"

I have written programs from scratch such as in C++ and while they are perfectly fine, the antivirus can show false positives based on the behavior of the code to be over protective of the system. I generally have to add exceptions to not quarantine my newly compiled programs as AVG on rare occasion will flag my newly compiled exe as a false positive.
1841.

Solve : Learn Objective C on an OSX virtual box??

Answer»

Hey friends,
I have decided to take up coding in objective C. My mac is a bit outdated and I really would prefer not to purchase another one at this point ESPECIALLY since they charge so much for flash memory and allow no upgrades. I really despise that. Anyway, my PC's are really great and I would like to know if it is possible to learn how to code on a hackintosh or unbuntu running an OSX virtual box, or if the downsides would warrant purchasing another mac. If it looks like I need a new mac, what would you recommend for BEST bang for buck? I have my PC's for raw power so this purchase would be used exclusively for coding. THANKS!

RobHere are some observations made on my personal experience.
I have worked as a professional programmer years ago. Since then my interest in the PC has been just personal for my own USE.
My feeling is that if I wish to learn something new, I do not put out any money unless it is absolutely necessary. The exception would be if somebody pays me in advance for project, then I'm willing to shell out some money. Otherwise, for my own educational needs, I make use of all the free stuff that's now available over the Internet.
You can find many good tutorials on the Internet about objective C and similar programs. One of the most important skills you need as a programmer is the ability to read somebody else's tutorial and understand what they're getting at. Of course, hands on experience is very important.. Yet you have to read the tutorials to understand what something really does. And there are lots of tutorials.
There is a bit of mystique about programs and hardware that Apple produces. I understand that. That is part of their cult, loops, I meant to say market strategy. They promote the idea that their stuff is better and maybe a little bit more sophisticated than the average person can take.
And yes, I really do like Apple products that I have had in the past. But I could not afford to keep using them.
Another avenue of approach might be to consider alternatives to Objective-C.
You can Google this key phrase and see what you come up with:
alternatives to objective C.
In my opinion, this would be easy to set up on a PC then going the virtual machine route. Furthermore, the alternatives to Objective-C are either freeware or shareware and don't cost a thing. If you get to the point where you actually have a usable program that she would like to distribute in the Apple Store, you could just fire up your old Mac and test the program out on it.
When developing programs usually speed of the processor is not really a critical issue, unless you're trying to debug a very large file. Just simple editing and compiling should not take up a lot of time. If you find your projects tend to be time-consuming, you might want to reconsider making your program more granular. More granular means that the program is a little modules that can be compiled and tested by themselves in the debugger that once you have a large part of your program debug and tested, you can make that into a library and any further testing and developing you do justly sent to the library you already created.
I suppose you already know that, but I'm surprised at how many people start out in computer programming don't understand some of the traditional tools that have been used to speed development. One of the things is the idea of divide and conquer. If you can divide up your project in a separate little pieces, and actually goes faster and easier than what you might think.
Anyhow, that's my opinion. But I do believe it is based on years of practical experience.

end of dictation



Wow thanks for that reply. I will do what I can to find an older version of Xcode that actually runs on my old macbook. I will also look into alternatives. I suppose the reason I was thinking about going the xcode route is because my friend gave me a highly acclaimed book on it that I wanted to use. Unfortunately, its almost entirely from a mac, xcode perspective. I am very new to coding, with only one introductory computer SCIENCE class under my belt. But I am very motivated to learn a new marketable skill. Thanks again.GNUStep Looks like one possible route you might consider exploring. I'm not sure if it would 100% replace XCode; XCode is in many ways to Objective C what Visual Studio is to C#. It's possible to write programs in the LATTER without the former but it's an uphill battle against convenience.

1842.

Solve : I think i made an error in the code but cant see where plz help?

Answer»

K so well yea if you look at the code you will know what it is but i tried to modify it so that you can make a choose profiles but the profiles doesnt CREATE please help

Code:

Code: [Select]:menu
cls
@echo off
title IP Changer
echo --------------------------------------------------------------------------------
echo IP Changer by Inforcer25
echo --------------------------------------------------------------------------------
echo.
echo.
echo.
echo.
echo.
echo Select a Option
echo ================
echo.
echo [1] Set Static IP [4] Make Profile
echo [2] Set DHCP [5] DELETE Profile
echo [3] Use Profile
echo.
set /p op=Enter Option:
if %op%==1 goto set_static_ip
if %op%==2 goto set_dhcp
if %op%==3 goto use_profile
if %op%==4 goto make_profile
if %op%==5 goto del_profile
goto error



:set_static_ip
cls
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=

echo "Default Gateway:"
set /p D_Gate=

echo "Subnet Mask:"
set /p Sub_Mask=

echo "Setting Static IP Information"
netsh interface ip set address "LAN" static %IP_Addr% %Sub_Mask% %D_Gate% 1
netsh int ip show config
pause
goto menu



:set_dhcp
cls
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ip set address name = "LAN" source = dhcp

ipconfig /renew

ECHO Here are the new settings for %computername%:
netsh int ip show config

pause
goto menu


:use_profile
@echo off
cd C:\IP_Changer\Profiles
cls
echo.
echo.
echo.
echo.
echo Please enter the profile name.
echo.
set /p profile=Profile name:
call %profile%.bat
goto no_profile

:no_profile
cls
echo.
echo.
echo.
echo ERROR!
echo That Profile does not exist!
echo.
echo.
ECHO Press any key to go back
pause<null
goto use_profile



:make_profile
if not exist "C:\IP_Changer" mkdir C:\IP_Changer\Profiles
cls
@echo off
echo.
echo.
echo.
echo.
echo.
set /p %make_prof%=Enter Profile name:
if exist "C:\IP_Changer\Profiles\%make_prof%.bat" goto exist
if not exist "C:\IP_Changer\Profiles\%make_prof%.bat" goto make_profile_make
:exist
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo A Profile with this name already exists
echo.
echo Press any key to continue
pause<null
:make_profile_make
cls
@echo off
echo.
echo.
echo.
echo --------------------------------------------------------------------------------
echo Setting up Profile
echo --------------------------------------------------------------------------------
echo.
echo.
echo.
echo.
echo.
echo Select a Option
echo ================
echo.
echo [1] Set Static IP
echo [2] Set DHCP
echo.
set /p op=Enter Option:
if %op%==1 goto static_batch
if %op%==2 goto dhcp_batch
goto error
:static_batch
cls
set /p %make_prof_make1%=Re-Enter Profile name:
if not exist "C:\IP_Changer\Profiles\%make_prof_make1%.bat" mkdir C:\IP_Changer\Profiles\%make_prof_make1%.bat
@echo off
echo "Please enter Static IP Address Information"
echo "Static IP Address:"
set /p IP_Addr=Static IP:

echo "Default Gateway:"
set /p D_Gate=Default Gateway:

echo "Subnet Mask:"
set /p Sub_Mask=Subnet Mask:

echo "Setting Static IP Information"
netsh interface ip set address "LAN" static %IP_Addr% %Sub_Mask% %D_Gate% 1 >C:\IP_Changer\Profiles\%make_prof_make1%.bat
netsh int ip show config
pause
goto finish_setup
:dhcp_batch
@ECHO OFF
ECHO Resetting IP Address and Subnet Mask For DHCP
netsh int ip set address name = "LAN" source = dhcp >C:\IP_Changer\Profiles\%make_prof_make1%.bat

ipconfig /renew

ECHO Here are the new settings for %computername%:
netsh int ip show config

pause
goto finish_setup



:finish_setup
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo Profile setup finish! Press enter to go to menu.
pause>nul
goto menu



:exit
@echo off
cls
echo.
echo.
echo.
echo --------------------------------------------------------------------------------
echo Thank you for using IP_Changer
echo --------------------------------------------------------------------------------
ping localhost -n 5 >nul
exit

:error
cls
echo.
echo.
echo.
echo --------------------------------------------------------------------------------
echo Error! Wrong Command
echo --------------------------------------------------------------------------------
ping localhost -n 5 >nul
goto menu

:del_profile
@echo off
echo.
echo.
echo.
echo.
echo.
echo Enter Profile name you WISH to delete!
echo.
set /p %del_prof%=Enter Profile name:
if not exist "C:\IP_Changer\Profiles\%del_prof%.bat" goto error_prof
if exist "C:\IP_Changer\Profiles\%del_prof%.bat" goto del_finish


:error_prof
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo Error! That profile does not exist!
ping localhost -n 5 >nul
goto del_profile


:del_finish
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo The profile has been delete!
ping localhost -n 5 >nul
goto menuThat's really not the way to go about asking for help with code - "My code doesn't WORK" is the same as saying "my computer is broken" - We need more information, what errors are you getting? Where about in the code is the error? What have you tried to fix it? People are generally happy to advise on general errors but much more reluctant to just fix a piece of code they are given for the person asking.Until your have get it right remove:
@echo off
You will be able to trace the progress and see the error.

1843.

Solve : batch programming?

Answer»

Hi,

I have folders named LIKE this 201601,201501,201602,201603 , basically yyyymm as the folder name. considering for today's month the folder will be 201606. I need to delete all the folders which are 6 months older than 201606. Also, I don't want to delete the folders by the modified date but by checking the month and year in the folder name and comparing it with current month's folder year and month and delete if the folder is more than 6 months old.
Are the folders all under one top folder?
Folders are inside E:\output ,
Basically like this:
E:\output\201512
E:\output\201601
E:\output\201602
......
...
E:\output\201606

Do you want to manually input the current month or have the script calculate it?
I get the current month yyyymm that is 201606 as a user specified input parameter to the batch script.The user types (e.g.) 201606 at a prompt?
Yes.
Call the script : C:\Xyz.bat 201606

Inside the script
Set date= %1

Which sets date as 201606, and I use %date% throughout as a reference to user defined yyyymm input.
Better not to use %date%, as that is a reserved system variable (also %time%).
Batch/VBscript hybrid

There should NOT be ANY other folders except those named YYYYMM

This may need changing if your system date format is not dd/mm/yyyy

@echo off
setlocal enabledelayedexpansion
echo wscript.echo datediff("m", wscript.arguments(1),wscript.arguments(0)) > monthdiff.vbs
set thismonth=%1
set thismonthdate=01/%thismonth:~4,2%/%thismonth:~0,4%

echo This month: %thismonth%
echo Using date: %thismonthdate%

for /f "delims=" %%A in ('dir /b /ad') do (
set foldername=%%A
set folderdate=01/!foldername:~4,2!/!foldername:~0,4!
for /f "delims=" %%B in ('cscript //nologo monthdiff.vbs "%thismonthdate%" "!folderdate!"') do set folderage=%%B
if !folderage! gtr 6 (set action=delete) else (set action=keep)
echo Folder %%A is !folderage! months old, action: !action!
if "!action!"=="delete" (
echo deleting !foldername!
REM To avoid "Are you sure" prompt:
REM use rd /s /q "!foldername!"

REM Test script first, and if it works OK remove ECHO
ECHO rd /s "!foldername!"

)
)
echo Complete
pause
Hey,

Thanks a lot . This works..!!!

I have one more question similar to this for the FILES deletion based on dates in the FILE name. Will post in a while. Extension: To delete the files in a specific folder :
File name is like this xyz_yyyymmdd.dat.gz

Say in a folder E:\ZippedFiles, I have files like these present
xyz_20160526.dat.gz
xyz_20160627.dat.gz
xyz_20160528.dat.gz
xyz_20160529.dat.gz
xyz_20160630.dat.gz
xyz_20160531.dat.gz
xyz_20160601.dat.gz
xyz_20160602.dat.gz
xyz_20160603.dat.gz



File xyz_20160529.dat.gz is a Sunday File and xyz_20160531.dat.gz is the last day of the previous month file.

Expectations:
To move (not copy) the Sunday file and last day of previous month file to E:\Backup

Conditions:

1. Batch file should be configurable to pick a day of week for running the script and is dependent on a user fed variable no_of_days.
Lets say I am running the script on a Friday, so if I pass a variable no_of_days==5, it will backup sunday file.
if on a thursday , then no_of_days becomes 4
basically current_day - no_of_days= Sunday (current day minus no of days should return a sunday) and backup the sunday file.

2. Also, after moving files 20160529 and 20160531. It should not delete any files for the current week but it should delete all the files of the previous week except sunday file if present.
Example: files 20160530,20160602,20160603,20160604 are left in the current folder whereas 20160526,20160527,20160528 are deleted. files 20160529(sunday) and 20160531 are moved to back up folder.

3. after running the batch script expected:

New location: E:\Backup\xyz_20160529.dat.gz and E:\Backup\xyz_20160531.dat.gz

deleted files: E:\ZippedFiles\xyz_20160526.dat.gz, E:\ZippedFiles\xyz_20160627.dat.gz ,E:\ZippedFiles\xyz_20160528.dat.gz

Not modified: E:\ZippedFiles\xyz_20160530.dat.gz, E:\ZippedFiles\xyz_20160601.dat.gz, E:\ZippedFiles\xyz_20160602.dat.gz, E:\ZippedFiles\xyz_20160603.dat.gz,



So no_of_days is the day number, counting from Monday=1?
A quick question: is this stuff for your job?
Yes . I do have this one figured out to a certain extent but the script doesn't look very neat since I have just started with batch and Vb scripting.

Answering the other question:
No of days is passed to calculate the Sunday date.

C:\xyz.bat today's_date no_of_days (2 parameters)

if today's date is 20160603 then no_of_days =5 so that 20160603 - 5 (days)== 20160529 (sunday)
if today's date is 20160602 then no_of_days =4 so that 20160602 - 4 (days)== 20160529 (sunday)


A script can know today's date, today's day number (1 to 7), and the date of last Sunday without any user input.

1844.

Solve : shell scripting - sed?

Answer»

I want to match 2 REGULAR expressions in a line, separated by some alphanumeric.
Please let me know how to use AND in sed.
For example:
In below text : aaas3435435;; AAA:name 677678777 BBB:address
I want to check if the line has string AAA:name and BBB:address

Regular Expressions (Regex) can be a challenge. If you have multiple patterns, you can simply CONTINUE the EXPRESSION to include them. I managed to test this in a Bash environment but will also work in the Windows NT prompt by changing the single quotes to double quotes. The return code ($? in Bash; ERRORLEVEL in Windows) will be zero if the input data MATCHES the Regex and 100 if it does not.

Code: [Select]bash$ echo 'aaas3435435;; AAA:name 677678777 BBB:address' | sed -s '/AAA:name.*BBB:address/!{q100}'
aaas3435435;; AAA:name 677678777 BBB:address
bash$ echo $?
0

bash$ echo 'aaas3435435;; AAA:name 677678777 CCC:address' | sed -s '/AAA:name.*BBB:address/!{q100}'
aaas3435435;; AAA:name 677678777 CCC:address
bash$ echo $?
100

Good luck.

1845.

Solve : help with my twitch script (python)?

Answer»

so IM making a bot on twitch that play pokemon when someone MAKES an input like up down left right etc.

but i want them to beable to TYPE like upx2 or upx25 so that itll press that button how ever many time they say it to so if they WANTED to press a 7 time they'd type ax7(im fairly NEW to python so bare with me) but here is my code https://gyazo.com/60869ef14af7081f29b6ed53dc28dcdd

1846.

Solve : Summarizing Data in Excel?

Answer»

Hi
I want to summarize thousands of names in a column in excel in another column without frequencies that MEANS to get rid of repetitions.
for example in A1 : A1343 I have

Alex
Alex
Alex
Roger
Alex
Ulrich
Ulrich
Tom
Ulrich
Alex
....
.....

and I want:
Alex
Roger
Tom
Ulrich

in B1 to B4.

Please help. This is how I would do it in Excel 2003

1. Click on the header for column A
2. In the menu click DATA, then Advanced Filter
3. Make sure your data range is correct.
3. Choose Action, Copy to another location, TYPE destination e.g. B1 in the BOX
4. Check Unique records only
5. Click OK

1847.

Solve : Create a bridge between phone calls and a program?

Answer»

Hello,

I would like to know if what I am about to tell you is possible. I will try to make it simple and please apology, my English isn't very good.

The idea is to create a bridge between my ip phone system (A) connected to my computer and a program (B) that contains all of my customers profile pages.
To be more specific, when I receive a CALL (A), it sends a signal to (B) and it OPENS the profile page of the customer who's calling.

1- I am able to automatically import daily the folder that contains all the .txt files (incoming call history) (A) and refresh every second the .txt files in an Excel file (1).
2- I am also able to automatically import daily all of my customers (and new customers) profile from SQL 2014 to another sheet in Excel (2).

When I receive a call (A), the phone number is written in Excel (1) and sends a ''signal'' to Excel (2) to ''MATCH'' the phone number with the customer number.

Here's the part where I need help.

3- When there is a ''match'' between the phone number (calling) and the customer number in my Excel (2), I would like to send a ''signal'' to open my program (B) and write the customer number in the search bar so that it opens automatically the profile page of my custommers.

I have been searching for an interprocess communication solution to send data (customer number) from my Excel (2) to my program (B), but didn't find any clear solution.
(I can also use Access instead of Excel)

Is it possible ?

Thank you very much
Its PRETTY involved, but you could tap into Caller ID and use that as a means to identify who it is thats calling for repeat customers. Which VOIP system are you using? Some come with features that allow for you to avoid reinventing the wheel.

I made a system a while back that integrated with ShoreTel VOIP system for example with software that monitored the corporate network for 7 locations and it would call me on my cell phone and play WAV files telling me where the problem was for example, this way I was able to deal with a problem as it happened vs having to wait for people to complain that something isnt working. There were a few things I was not able to easily integrate which required some electronics and a audio bridge where I had a set of PC speakers in a cardboard box with a shoretel handset in the box with it and I added a relay to control when the handset was off the base of the phone to simulate the phone on and off the hook. I ended up using a USB Relay control with a program written in C++ to turn on and off the relay for the handset on and off the hook. So I wasnt able to do it all through just a software integration.

Yours though at least you wouldnt need any hardware modding like I did, however depending on the VOIP system, the ability to capture that Caller ID info is key.

First of all, are you a programmer looking for advice from other programmers or new to PROGRAMMING and need someone else to do the majority of the work? Trying to assess what level of help you will require and what programming language you plan to use to integrate this?

If the VOIP system was one that has open source software that integrates with it, that would be the easiest for modifying and tapping into the Caller ID info. Once you have the Caller ID info you can then run that across a database and have that display all the info you need. I wouldnt bother with Excel and would keep it all within the database and the GUI that you use with the database such as a web based interface. To me looking at this, you would want to write a service that monitors the Caller ID info, and when the service detects a change in the Caller ID when it checks it on say a 2 second interval it runs that number against the database, and then if there is a match it displays the info you need.
Thank you very much for your answer ! I really appreciate.

I use ShoreTel VOIP system with the ShoreTel communicator (14.2) .

I am actually studying to be an IT Engineer, so I am not the greatest programmer, but I am working real hard !

I am still thinking on which language to use.

But I think I will go with Importing the data from my SQL database to Microsoft Access. So when I receive a call, I can see in Access (Interface that I created) the entire profile of my customers before I answer a call.

1848.

Solve : NBSTAT in Windows 10?

Answer»

Hi All,
I have WIN 10 enterprise 64 BIT. I am also an ADMIN on the machine. I opened a command prompt as an admin and tried to run NBSTAT The machine SAYS no such command or something like that. Has win 10 got rid of this command?

I have an IP and need to know the machine name. I was using NBSTAT to get the name. Any ideas?

Thanks
I believe you want to run NBTSTATQuote

Nbtstat is a diagnostic tool for NetBIOS over TCP/IP. It is included in several versions of Microsoft Windows. Its primary design is to help troubleshoot NetBIOS name resolution problems.
https://en.wikipedia.org/wiki/Nbtstat
Ok...it was a typo! My bad.

Got my script to work once I put in the right stuff.

Thanks!
Glad you got it sorted out.Just my two cents.
If you put nbstat into a Google search, Google will then say, "Showing results for nbtstat".
Amazing how Google reads our minds.
1849.

Solve : Alpha Odometer - Time Waster Curiosity Program?

Answer»

Just sharing a program I was messing with to generate all combinations of A thru Z for 26 character length only.

With winter storm here and an IDEA on my mind to toy with, I decided to build upon someone elses project out of curiosity as to how quickly a modern computer could process to generate all combinations of A thru Z with all letters A thru Z involved without repeat letters as for you can only have 1 of each letter type in the shuffle.

I expected it to process 26 to the power of 26 quicker for all combinations of same case A to Z, but then I realized that its single-threaded execution and so only 1/4th of my Athlon II x4 2612Mhz quadcore was being used.

So I do come here with a question though which is..... is it the IDE that compiled the source code that basically governs whether its a single-threaded execution or is it in your source code that you need to add to specify to tap into the use of all cores to get full 100% CPU utilization?

As for with the current code to get 100% utilization the trick would be to create 4 programs with 4 blocks of the alphabet range to work WITHIN and then set core affinity so that each program when executed runs on its own core.

Here is a link to see it running without having to compile and run yourself. I shared it on youtube to share with some other friends and anyone else interested in it: https://www.youtube.com/watch?v=8YrhqAhNJEc&feature=youtu.be

Here is the section that I tweaked to how I wanted it to process. If you go to the original source at the site I got this from you will see it processing far fewer letters and not logging the start and stop time with use of a system batch type execution within the program.

Quote

{
system("@echo. Started %date% at %time% >>ABC.log");
char str[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int n = strlen(str);
permute(str, 0, n-1);
system("@echo. End %date% at %time% >>ABC.log");
system("PAUSE");
return 0;
}


Code: [Select]// http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/

#INCLUDE <stdio.h>
#include <string.h>
#include <cstdlib>
#include <iostream>

/* Function to swap values at two pointers */
void swap(char *x, char *y)
{
char temp;
temp = *x;
*x = *y;
*y = temp;
}

/* Function to print permutations of string
This function takes three parameters:
1. String
2. Starting INDEX of the string
3. Ending index of the string. */
void permute(char *a, int l, int r)
{
int i;
if (l == r)
printf("%s\n", a);
// write to file here current string
else
{
for (i = l; i <= r; i++)
{
swap((a+l), (a+i));
permute(a, l+1, r);
swap((a+l), (a+i)); //backtrack
}
}
}

/* Driver program to test above functions */
int main()
{
system("@echo. Started %date% at %time% >>ABC.log");
char str[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int n = strlen(str);
permute(str, 0, n-1);
system("@echo. End %date% at %time% >>ABC.log");
system("PAUSE");
return 0;
}That code determines permutations, not combinations, does it not?
Quote from: DaveLembke on December 29, 2015, 11:43:31 AM
So I do come here with a question though which is..... is it the IDE that compiled the source code that basically governs whether its a single-threaded execution or is it in your source code that you need to add to specify to tap into the use of all cores to get full 100% CPU utilization?
You have to write code that uses threads- at least in the case of C. Other languages might work with coroutines or other parallelization options.

In a case such as this, it would make sense to have a thread pool. For example, let's say we want to have 4 threads running. In this case the best approach, at least in terms of simplicity to implement, would be to have a rather simplistic thread pool. The top-level call to permute could run four iterations of it's loop as separate threads, wait for them to complete, then run the next four. The primary disadvantage is that the generated sequence wouldn't have a predictable sequence, and it would require some additional synchronization on the output to prevent multiple threads from attempting to print to the standard output simultaneously.

While it wasn't with permutations, I took this approach with a File Search class I (re)designed a while ago. Mind you, it's a bit more complicated since it doesn't merely intend to print output, but rather make it available to other pieces of code, but it effectively follows the approach of having multiple HIGHER level Search actions be run via separate threads. (An earlier version made the mistake of spinning a new thread for every single subdirectory search which made things far, far slower)

Here's a C# version using Linq, though it is still only runs on a single thread. It's also generic so it works on sequences of any type. Strings are simply a sequence of char (IEnumerable in .NET's case):

Code: [Select]class Program
{
static IEnumerable<IEnumerable<T>> Permutations<T>(IEnumerable<T> list, int length=-1)
{
if(length==-1) length = list.Count(); //ignore that this is multiple enumeration...
if (length == 1) return list.Select(t => new T[] { t });

return Permutations(list, length - 1)
.SelectMany(element => list.Where(e => !element.Contains(e)),
(item1, item2) => item1.Concat(new T[] { item2 }));
}
static void Main(string[] args)
{
int totalcount = 0;
String Alphabet = "ABCDEFGHJKLMNOPQRSTUVWXYZ";

foreach(var loopalphabet in Permutations(Alphabet))
{
String buildresult = new String(loopalphabet.ToArray());
Console.WriteLine(buildresult);
totalcount++;
}
Console.WriteLine("Count:" + totalcount);
Console.ReadKey();
}
}
Thanks BC for the info

also..

Quote
(An earlier version made the mistake of spinning a new thread for every single subdirectory search which made things far, far slower)

Wow.... sounds like if run in a location targeting a large number of subdirectories could bring the system to its knees depending on if the routine for that thread executed and ended or stayed active and grew larger and larger until all subdirectories are targeted.

Interesting thread pool .... so you could create 4 threads and set an core affinity to each thread so that it makes use of the entire CPU, and the top level call that is running manages the 4 threads on what is processed next and plays traffic cop with it all.
1850.

Solve : lazarus (pascal)?

Answer»

i am doing a calculator

I have 2 TEXTBOX here is CALLED tedit

i have the numbers in buttons

what i want to know is that if i can for EXEMPLE select the FIRST tedit and click the buttons and write there and after that select the second tedit and click the buttons and write there

something LIKE selected.Edit1.Text := '3';