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.

1101.

Solve : Displaying my website on all devices / browsers. (ADULT CONTENT WEBSITE)?

Answer»

It has taken me over 1 year to DEVELOP my website. I'm self taught.

Currently I am TRYING anything and everything to try and get the display php/css/java or however else correct so it will just diaplay on all devices, RESOLUTIONS and browsers.

I hoped not to ask for help as i love figuring stuff out for myself. It's the BEST way to learn!

But alas....my HEAD hurts and im at the point of tears.

link removed by Allan

-Ayumi

1102.

Solve : VB .NET Comnectivity check and error handling?

Answer»

Hello again.
I'm working on a project and I need to check if the computer has internet access.
The Network.IsAvailable is not good for the project since many computers connect through routers and some routers might not be connected.
I tried with the Ping method, if it's connected it WORKS fine, but i'm getting an unhandled EXCEPTION "cannot connect to host" if not connected.

My question is: how can I check if the computer is connected and when it is online to start executing the rest of the code.
Also, how can I disable unhandled exceptions? If an exception occurs then the program continues executing without ERROR or "not responding".

Thank you!use Ping. The way to "disable" unhandled exceptions is to handle them.Another option: since ping only really tests if a machine is responding and doesn't ALWAYS correspond with the availability of HTTP requests, we can do the same thing that win Vista/7 do to check the network connection:


Code: [Select]public bool ConnectionAvailable()
{
try
{
var result = new WebClient().DownloadString("http://www.msftncsi.com/ncsi.txt");
return true;

}
CATCH (Exception exx)
{
return false;
}


}

Which I think would translate to something like the following for VB.NET:

Code: [Select]Public Function ConnectionAvailable() As Boolean
Try
Dim Result As String = (new WebClient).DownloadString("http://msftncsi.com/ncsi.txt")
return true
Catch exx As Exception
return false
End Try
End Function

1103.

Solve : Perl grep help?

Answer»

Im using a perl script to monitor the status of 25 VPN tunnels on a Fortigate firewall. The script checks the status on all tunnels en warns me when there's something wrong (Nagios).

This is my output when everything is ok: Fortigate: OK, Active SSL-VPN Connections/Tunnels: 0/0, IPSEC Tunnels: Configured/Active: 25/25
This is my output when 1 tunnel is down: Fortigate: WARNING, Active SSL-VPN Connections/Tunnels: 0/0, IPSEC Tunnels: Configured/Active: 25/24 , VPN-CUST1-CUST2 down

I would like to filter the VPN's per customer in this script, let's say i only want to see the output of VPN's containing the word CUST1. Im definitely not a perl hero, any help on this one?

Code: [Select][size=8pt]#!/usr/bin/perl
# This Plugin checks the VPN states of Fortigate Firewalls running v4MR3P1 or n EWER
# TESTED on FG200A, FG200B, FG80C, Software v4MR2P2, v4MR3P1
#
# Copyright (c) 2009 Gerrit Doornenbal, g(dot)doornenbal(at)hccnet(dot)nl
# Many thanks to Sascha Tentscher , who provided a very good example
# with his 3com plugin!
#
# Changelog:
# 23 jan 2009 Initial Release, monitoring IPSEC and SSL-VPN
# 25 mar 2009 Added feature to disable monitoring, just for counting
# number of IPSEC connections
# 10 nov 2010 Numerous perl coding errors solved, added SNMP availabity check
# and VPN type choice for ipsec and ssl.
# 8 jul 2011 Heavily modified by Brantley Hobbs to work with Fortinet firmwar e v4.0MR2 and higher.
# 2 aug 2011 Minor mods + added feature to get performance data
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# If you wish to receive a copy of the GNU General Public License,
# write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-130

use strict;
use Net::SNMP;

# Check for proper args....
if ($#ARGV <= 0){
&print_help();
}

# Initialize variables....
my $net_snmp_debug_level = 0x0; # See http://search.cpan.org/~dtown/Net-SNMP-v6.0.1/lib/Net/SNMP.pm#debug()_-_set _or_get_the_debug_mode_for_the_module
# for more information.
my %status = ( 'UNKNOWN' => '-1', # Enumeration for the output Nagios states
'OK' => '0',
'WARNING' => '1',
'CRITICAL' => '2' );
my %entitystate = ( '1' => 'down', # Enumeration for the tunnel up/down states
'2' => 'up' );
my ($ip, $community, $modus, $type, $performance) = pars_args(); # Parse out the arguments...
my ($session, $ERROR) = get_snmp_session($ip, $community); # Open an SNMP connection...
my $oid_unitdesc = ".1.3.6.1.2.1.1.1.0"; # Location of Fortinet device description...
my $oid_ActiveSSL = ".1.3.6.1.4.1.12356.101.12.2.3.1.2.1"; # Location of Fortinet firewall SSL VPN Tunnel connection count
my $oid_ActiveSSLTunnel = ".1.3.6.1.4.1.12356.101.12.2.3.1.6.1"; # Locati on of Fortinet firewall SSL VPN Tunnel connection count
my $oid_ipsectuntableroot = ".1.3.6.1.4.1.12356.101.12.2.2.1"; # Table of IPSec VPN tunnels
my $oidf_tunstatus = ".20"; # Location of a tunnel's connection status
my $oidf_tunndx = ".1"; # Location of a tunnel's index...
my $oidf_tunname = ".3"; # Location of a tunnel's name...
my $ActiveSSL;
my $ActiveSSLTunnel;
my $string_errors="";
my $ipstunsdown=0;
my $ipstuncount=0;
my $ipstunsopen=0;
my $state = "OK";
my $oid;
my $value;


# Check SNMP connection and get the description of the device...
my $unitdesc = get_snmp_value($session, $oid_unitdesc);

# Unless specifically requesting IPSec checks only, do an SSL connection check
if ($type ne "ipsec"){
$ActiveSSL = get_snmp_value($session, $oid_ActiveSSL);
$ActiveSSLTunnel = get_snmp_value($session, $oid_ActiveSSLTunnel);
}

# Unless specifically requesting SSL checks only, do an IPSec tunnel check
if ($type ne "ssl"){

# Get just the TOP level tunnel data
my %tunnels = %{get_snmp_table($session, $oid_ipsectuntableroot . $oidf_ tunndx)};
while (($oid, $value) = each (%tunnels)) {
#Bump the total tunnel count
$ipstuncount++;


#print "Tunnel name (" . $oid_ipsectuntableroot . $oidf_tunname . "." . $ipstuncount . ") is: " . get_snmp_value($session, $oid_ipsectuntableroo t . $oidf_tunname . "." . $ipstuncount) . "\n";
#print "Tunnel status (" . $oid_ipsectuntableroot . $oidf_tunsta tus . "." . $ipstuncount . ") is: " . get_snmp_value($session, $oid_ipsectuntabl eroot . $oidf_tunstatus . "." . $ipstuncount) . "\n";

#If the tunnel is up, bump the connected tunnel count
if ( $entitystate{get_snmp_value($session, $oid_ipsectuntableroo t . $oidf_tunstatus . "." . $ipstuncount)} eq "up" )
{
$ipstunsopen++;
} else {
#Tunnel is down. Add it to the failed counter
$ipstunsdown++;
# If we're counting failures and/or monitoring, put toge ther an output error string of the tunnel name and its status
if ($modus >= 1){
$string_errors .= ", ";
$string_errors .= get_snmp_value($session, $oid_ ipsectuntableroot . $oidf_tunname . "." . $ipstuncount)." ".$entitystate{get_snm p_value($session, $oid_ipsectuntableroot . $oidf_tunstatus . "." . $ipstuncount) };
}
}
}
}

# Close the connection
close_snmp_session($session);

#Set Unitstate
my $unitstate="OK";
if (($modus >= 2 ) && ($type ne "ssl"))
{
if ($ipstunsdown == 1)
{
$unitstate="WARNING";
}
if ($ipstunsdown >= 2)
{
$unitstate="CRITICAL";
}
}

# Write an output string...
my $string = $unitdesc . ": " . $unitstate;
if ($type ne "ipsec") {
#Add the SSL tunnel count
$string = $string . ", Active SSL-VPN Connections/Tunnels: " . $ActiveSS L."/".$ActiveSSLTunnel."";
}
if ($type ne "ssl") {
#Add the IPSec tunnel count and any errors....
$string = $string . ", IPSEC Tunnels: Configured/Active: " . $ipstuncoun t . "/" . $ipstunsopen. " " . $string_errors;
}

# Create performance data
my $perfstring="";
if ( $performance eq "yes" )
{
$perfstring="| ActiveSSL-VPN=".$ActiveSSL." ActiveIPSEC=".$ipstunsopen;
# print $perfstring."\n";
}
$string = $string.$perfstring;

# Check to see if the output string contains either "unkw", "WARNING" or "down", and set an output state accordingly...
if($string =~/uknw/){
$state = "UNKNOWN";
}
if($string =~/WARNING/){
$state = "WARNING";
}
if($string =~/down/){
$state = "CRITICAL";
}

#Emit the output and exit with a return code matching the state...
print $string."\n";
exit($status{$state});

########################################################################
## Subroutines below here....
########################################################################
sub get_snmp_session{
my $ip = $_[0];
my $community = $_[1];
my ($session, $error) = Net::SNMP->session(
-hostname => $ip,
-community => $community,
-port => 161,
-timeout => 1,
-retries => 3,
-debug => $net_snmp_debug_level,
-version => 2,
-translate => [-timeticks => 0x0] #schaltet Umwandlung von Timetick s in Zeitformat aus
);
return ($session, $error);
}

sub close_snmp_session{
my $session = $_[0];

$session->close();
}

sub get_snmp_value{
my $session = $_[0];
my $oid = $_[1];
my (%result) = %{get_snmp_request($session, $oid) or die ("SNMP service is not available on ".$ip) };
return $result{$oid};
}

sub get_snmp_request{
my $session = $_[0];
my $oid = $_[1];
return $session->get_request($oid);
}

sub get_snmp_table{
my $session = $_[0];
my $oid = $_[1];
return $session->get_table(
-baseoid =>$oid
);
}

sub pars_args
{
my $ip = "";
my $community = "public";
my $modus = "2";
my $type = "both";
my $performance = "no";
while(@ARGV)
{
if($ARGV[0] =~/^-H|^--host/)
{
$ip = $ARGV[1];
shift @ARGV;
shift @ARGV;
next;
}
if($ARGV[0] =~/^-C|^--community/)
{
$community = $ARGV[1];
shift @ARGV;
shift @ARGV;
next;
}
if($ARGV[0] =~/^-M|^--modus/)
{
$modus = $ARGV[1];
shift @ARGV;
shift @ARGV;
next;
}
if($ARGV[0] =~/^-T|^--type/)
{
$type = $ARGV[1];
shift @ARGV;
shift @ARGV;
next;
}
if($ARGV[0] =~/^-f|^-F/)
{
$performance = "yes";
shift @ARGV;
next;
}
}
return ($ip, $community, $modus, $type, $performance); }

sub print_help() {
print "Usage: check_fortigate_vpn -H host -C community\n";
print "Options:\n";
print " -H --host STRING or IPADDRESS\n";
print " Check interface on the indicated host.\n";
print " -C --community STRING\n";
print " Community-String for SNMP.\n";
print " -M --modus default = 2\n";
print " 0: Just counting, no alarms\n";
print " 1: Just counting, failed tunnels will be showed\n";
print " 2: Monitoring, failed tunnels cause failed status. \n";
print " -T --type default = both\n";
print " ssl: only SSL VPN connections wil be monitored\n";
print " ipsec: only IPSEC VPN connections wil be monitored\n";
print " both: monitoring all types of VPN connections \n";
print " -F Also giving performance data output.\n\n";
print "This plugin checks all configured IPSEC tunnels, and gives\nthe number of current IPSEC tunnels and SSL-VPN tunnels.\n\n";

exit($status{"UNKNOWN"});
}
[/size]

1104.

Solve : Begining my first C# project, need pointers (no pun intended)?

Answer»

So I've finally decided to start working more in C# instead of VB.NET and VB6. I am starting my first major project and it's going good so far, but I need help with deciding how to structure the program. My idea is to eventually make an above view game (3rd person) LIKE the old Command and Conquer series. To start I am going to use GDI+ graphics because the API seems much easier than DirectX or OpenTK which were inherently designed for 3D purposes. I am probably going to lower the screen resolution if it becomes too CPU intensive.

This question is mainly targeted towards BC_Programmer because of his BaseBlock game that I'm pretty sure also uses GDI+. So my questions are: How are the classes laid out? How do you update the OnPaint event? Is it double buffered? How do you make the GDI+ more efficient? Do you have a new class for each different type of object?

What I have right now:

The form:
Code: [Select]namespace TankGame
{
public partial class frmMain : Form
{
public frmMain()
{
InitializeComponent();

Graphics dc = this.CreateGraphics();
Game g = new Game(dc, this);
}
}
}

The game class:
Code: [Select]namespace TankGame
{
class Game
{
private Sprite tank;

public Game(Graphics screen, Form frm)
{
frm.Paint += new PaintEventHandler(DrawScreen);
LoadObjects(screen);
}

private void LoadObjects(Graphics screen)
{
tank = new Sprite("tank.bmp", 0, 0, screen);
}

private void DrawScreen(object sender, PaintEventArgs pea)
{
tank.Update();
}
}
}

The object:
Code: [Select]namespace TankGame
{
class Sprite
{
public Bitmap objImg;
public int X;
public int Y;
private Graphics screen;

public Sprite(STRING initName, int initX, int initY, Graphics s)
{
objImg = new Bitmap(initName);
s.DrawImageUnscaled(objImg, initX, initY);
X = initX;
Y = initY;
screen = s;
}

public void Update()
{
screen.DrawImageUnscaled(objImg, X, Y);
}
}
}
Quote from: Linux711 on June 07, 2013, 04:26:57 PM

This question is mainly targeted towards BC_Programmer because of his BaseBlock game that I'm pretty sure also uses GDI+. So my questions are: How are the classes laid out? How do you update the OnPaint event? Is it double buffered? How do you make the GDI+ more efficient? Do you have a new class for each different type of object?

BASeBlock runs game logic on a separate thread, This separate thread runs the gameproc() routine, (which is ridiculously gigantic). Essentially, the thread constantly repeats, and basically does:

1. Update all Game Objects
2. force the display to refresh

The second step is performed with something like this:
Code: [Select]PicGame.INVOKE((MethodInvoker)(() =>
{
PicGame.Invalidate();
PicGame.Update();
}));

Since the GameProc() routine is running on a separate thread, it cannot access UI Controls without causing an exception. The code uses Invoke on a UI control (in this case PicGame) to run a piece of code on the UI thread itself. This logic invalidates the picturebox and updates it, which results in the Paint Event of the Picturebox being fired. The Paint event is more complex, because for performance REASONS Blocks that don't need to be redrawn aren't. The result is that there is a buffer for the background, one for blocks, and one for animated blocks. the block bitmap is only changed if a block has changed. Since most blocks are static and don't move or change very often, this is a rather big improvement speed-wise.

The GameProc thread sleeps for a set period of time every iteration, which is calculated based on how fast the FPS currently is. Sadly I forget most of the logic involved. It's not much different from the core idea behind the GDI+ Particle "tutorial" I posted to youtube. BASeBlock's source, though not 100% up to date, is available on my github. In order for the project to open,Build, you need VS2012 (not sure if it will open in express, either), as well as the BASeBlock RESOURCES installed (which are installed by the game installer in the desired location). You will also need BASS.NET and of course BASS itself for Sound support. (optionally, it also supports IrrKlang but I've not used that particular "driver' class in a long time)

As for how the classes are laid out...

Basically there are some base classes, Block, GameObject, cBall, and cParticle. Each Block in the game can trace it's inheritance tree to Block; for example, BrickBlock derives from TexturedBlock which derives from ImageBlock which derives from Block, EllipseBlock derives from PolygonBlock which derives from Block, etc. Each one naturally simply adds special behaviours to it's parent; ImageBlock makes a Block draw from an Image, TexturedBlock makes that Image a Texture, and BrickBlock uses Textures as well as a special destruction behaviour that spawns certain Particles/GameObjects, etc.

Powerups are implemented via interfaces, and the Paddle can have a set of PaddleBehaviours Applied to it. Over time I've added a lot of utility methods and classes to make certain things easier.

For your current implementation, I would probably make a few changes. The first would be to move your startup code into the Load Event handler for the form; the second would be to change the Game object to not accept a Form, but instead an implementation of an interface that your Form can implement. In BASeBlock, I used a interface called "iGameClient", which is implemented by the Form. The purpose of this is to provide the capability for changing what implements the interface, and prevent strong coupling with the Form itself.

One of the issues originally was preventing cross-thread calls, and most importantly preventing blocks from being removed while the collection was being enumerated, since that would throw an exception. Originally I had a very gross hack that basically passed by reference lists of objects to remove, but I changed that to allow for a collection of delegates to be called before the next frame "tick" occurs. Removing blocks, balls, GameObjects/etc are usually done within the logic for them, but now they defer actual removal until the beginning of the next frame's logic. Also because I was using multiple threads, I had the paint routine working with the game's objects and the "tick" routine as well, so I had to perform some locking to prevent the game "updates" from removing or adding elements (such as in the previous delegate listing) while the painting routine was iterating over them.


Slowdown: With logs of stuff on the screen, the game simply cannot necessarily process each tick as fast as would be ideal. As a result, I've implemented logic that prevents the entire game from slowing down; basically 30fps is the desired speed; if the FPS is higher than that, movement will be smoother but still travel the same distance in the same timescale. if the FPS is 15fps, then objects will move about twice as fast per frame to make up for it. There are of course some issues with this. I f ound heavy particle usage also caused performance issues so I cap the number of particles that can exist, using a Queue. Some particles are tagged as "critical" and won't be removed in this manner, but most particles are used for aesthetic purposes so most are able to be removed if this limit is reached.

Anyway, the most common approach to this I've seen seems to always employ a Timer of some sort, and use the Timer event to handle each tick. But the problem is that that tick logic is occuring in the UI thread and while it operates the UI is completely blocked, so it's almost always best to keep everything that isn't drawing related outside of the UI thread.





Thanks for all the info. I watched your video and looked at the diagram. I've kind of put this project on hold until I get more used to programming in C#. I have other smaller projects that I am working on now, so this has gotten pushed to the end of my list.Quote from: Linux711 on June 26, 2013, 11:28:31 PM
I've kind of put this project on hold until I get more used to programming in C#.

Sounds reasonable. Technically my first C# Application was a Hijackthis/DDS style tool clone.
1105.

Solve : Which programming language can I start with,Am a beinginer?

Answer»

Am jst new to programming language but which programming language should i start with.ThanksI wrote this almost a year and a half ago on the question:
What is the best programming language for beginnersI would try Visual Basic Express 2010. As good as C (++, etc). As a former system programmer I've enjoyed this language.Why do you want to know how to program?
Are you going to make Web Sites? Is so, learn PHP.
Quote

PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP is now installed on more than 244 million websites and 2.1 million web servers.[2]
PHP - From Wikipedia, the free encyclopedia

However, if you do not want to do web sites, then you should study a general purpose language that is widely used and well documented and freely available.
Such as PHP.
This post looks like it was satisfied with BC's response...

I started with Basic in the 1980s, played with Fortran, Cobol, Assembly, VB6, VC++ 5 & 6, Borland C, Perl, PHP, Python, Ruby, and liked Perl and C++ the most so 99% of everything I write is in those two. Then tried out the Visual Studio Express 2008 and 2010 and liked those a lot which also introduced me to C#.

Of everything I tried out the languages Most favorite to Least favorite are:

C++, Perl, C#, PHP, Python, Basic, VB, Ruby, Fortran, Cobol, and Assembly.

So my top 3 languages are C++, Perl, and C# for what I need to program up.

Reasons why I like these top 3:

C++ - is powerful, fast at just about any task you throw at it. The cons for a new programmer are that this language is more complex than others to grasp and without someone to guide you when you get compile errors you can go crazy trying to find the problem if you dont know how to use the debugger or you forget to add a required include etc. So you need to know dependencies etc as well as there are many various ways that C++ is written DEPENDING on the programmers structure preference. I can only relate this difference in structure to that of writing in Print and Script. It says the same message written in the same language, but looks far different from each other in how its written.

Perl - I use mainly for very quick down and dirty console ( DOS shell ) programming. So VS writing a C++ program that would be way more keystrokes, if I have a program that I am writing up quickly to read in and write information back to files for example, I will use Perl which is strong at this and requires far less typing. Basically the same program that Perl can achieve in say 6 lines of code, C++ could take 20 lines of code to achieve. The drawback to Perl though is that its not compiled, its executed from its source file. So if you have a program that you want to share with others and run independently without the Perl interpreter installed on each machine it runs on, you will want to write it in C++ INSTEAD. Perl is also more geared towards Server Side Execution and creating Dynamic HTML for web servers etc, even though I use it mostly for quick down and dirty programming.

C# - 2008 and 2010 with Visual Studio Express I like because of that its perfect for rapid development of creating Windows Applications in a WYSIWYG and it automatically populates sections of code so you dont have to type the whole program source from scratch etc. C# replaced C++ for writing Windows Applications with GUI interface. *Many people have asked me why I didnt just go with Visual Basic for Windows Application development, and all I can say is that I just never liked VB much. I started off with VB6 and there is just something about it that I didnt like so I went the route of C++ and then C# for Windows Application development with GUI interfaced programs.


Lastly, as far as books go to learn by example, which is the best for people who like to learn hands on. I would suggest getting one of the Microsoft books that comes with the DVD on the back page with Visual Studio Express 2010 or newer and source files for all projects contained in the book. I Bought these books as a guide to changes between 2008 and 2010 as well as to learn C# from by example, and it was the best $25 book I ever bought for a programming language since I learn best by example either typing the code up out of the book and compiling and troubleshooting or loading up other peoples source code and observing how they did what they did, and whenever in question, altering a section of the code with a comment tag of XXXX to find it quickly in the source etc when dealing with large programs etc.

When learning Basic a long time ago on a TRS-80 Model 1 with 16k RAM, I typed in programs out of magazines from the TRS-80 Magazines, and many times either I made a typo or the magazine was printed with a typo and so it was hours of programming and troubleshooting to eventually have sprites go crazy on the MONOCHROME display etc, and usually taking programs to use and program by example and bending them to be something different using the concepts that were shared to make programs of your own such as turning a Calculator program into a Point of Sale Program etc, or a Stock Market simulation game etc introducing random generators, and then learning to seed the random number generators with a time seed etc so that the same random numbers dont occur upon future execution to where what is random is not really random, but the pattern the algorithm follows in which a die ROLL from 1 to 6 if run without a seeded timer could be 4,3,1,6 and each time the game is run without the seeded timer its always 4,3,1,6 until you add the seeded timer and then the time delay in keystroke from the user alters the output to be more random so you will get 4,1,2,6 the first time the program runs and then say 5,2,3,1 the second time it runs etc in which 4 die are rolled or a single die is rolled 4 times and the output no longer follows a predictable pattern with the seeded timer to the random generator etc.

1106.

Solve : Simple request for Perl programmer from an ESL teacher?

Answer»

I once had a word list in which the words were spelled backward (e.g., yranoitcid), but it got left on an old computer. I would love to have such a list again, so that I can do things like find a lot of examples of words that end in -ate. A word list spelled correctly but sorted from end to beginning would be equally nice.

I understand that in Perl a one-line program can do this, (my Google search FOUND a forum from 2005 where someone had answered a similar request: http://ask.metafilter.com/16262/Where-to-find-a-dictionary-of-words-that-are-spelled-backwards, but the link to the output was dead) so I'm wondering if someone could take a moment and generate one for me, since I am not a programmer. A .txt document of the result would be greatly appreciated. Reversed Dictionary words:

http://bc-programming.com/misc/dictreverse.txt

Words that end with ate:

http://bc-programming.com/misc/endate.txt


The dictionary itself is from the dictionary file that was included with Linux Mint 11, I believe.Exactly what I wanted! Thank you so much!Could you do one more favor for me? I tried to do this myself, but the file is too big for Word to handle. If you could do a simple alphabetic sort on the complete list (with the sort starting from what is now the first letter), that will give me all the words with -ate TOGETHER, all the words with -tion together, all the words with -ify, all the words with -IZE, etc. I'm sorry I wasn't QUITE clear about that. Thank you.

I've attached a sort as an example, but it only includes the first three pages.

[YEAR+ old attachment deleted by admin]Quote from: lisapaloma on October 21, 2012, 09:46:23 PM

Could you do one more favor for me? I tried to do this myself, but the file is too big for Word to handle. If you could do a simple alphabetic sort on the complete list (with the sort starting from what is now the first letter), that will give me all the words with -ate together, all the words with -tion together, all the words with -ify, all the words with -ize, etc. I'm sorry I wasn't quite clear about that. Thank you.

I've attached a sort as an example, but it only includes the first three pages.

So, sort based on the reverse of the word?

http://bc-programming.com/misc/sortreverse.txtBeautiful! Thank you so much!
1107.

Solve : C++ site tutorial?

Answer»

anyone who knows?
please i NEED it. THANKS a lot! )http://www.cplusplus.com/can you be more specific LIKE just syntax and the standard library or a specific library and COMPILER?Quote from: TechnoGeek on OCTOBER 18, 2012, 08:15:09 AM

http://www.cplusplus.com/

thanks men.
Quote from: TheWaffle on October 18, 2012, 04:43:37 PM
can you be more specific like just syntax and the standard library or a specific library and compiler?


just a site where i can learn more about C++.wikipedia doesn't look like a bad place to start
http://en.wikipedia.org/wiki/C%2B%2B
1108.

Solve : Link google maps with MS Excel VBA?

Answer»

I want to make a DISTRICT map of Hoimachal Pradesh,INDIA based on excel data and FILL different colours in each district boundary according to some data range...That means i want my map to be dynamic...Can I do it using excel vba???
Can I link excel vba to google MAPS and make changes in it using vba???
Or is there any software that can do my task???
PLEASE help..i would really appreciate...
Thanks in advance..

1109.

Solve : Need advice on complicated programming.?

Answer»

I'm in the process of making a app that I'm attempting to try and detect Bluetooth devices, which I want this app to store data from these devices and store it on a server host, so I would need to make a program that host and RECORDS data as well, also I would like to have a website that can share information to the app, for instance you could go to the forums from the app other than having going to the website. So essentially I need to know what programs I need and what program languages I need to use for the app, and program. Also if anyone knows how to get all these communicating please share.Thats a large project.

You will need a Web Server such as Apache for the devices to connect to in which you write your application interface in say PHP programming language for the interface, as well as a Database in which I would suggest MYSQL which integrates well with PHP and some good books are out there on the subject. You can have 1 computer acting as a Database Server as well as Web Server. You can also have PHP code that goes out to websites, executed at the server side out of view from the client connection that requests the info, in which information requested / farmed from websites of choice are populated to your own dynamic HTML application layout with information harvested off the web from as many sources as you want to have all data on 1 page for example etc.

As far as detecting Bluetooth devices and and storing data from these devices.... ( I haven't played with this yet to advise to much specifics on this. ) But I know that Bluetooth devices have addresses that are unique and so you can use that as the ID for the device to keep track of what device is which with this unique ID. You would also need to have a service running at the same computer that runs as a web server/database server that is polling looking for NEW Bluetooth devices to establish a connection with etc. This service can be written in a number of languages of your choice some EASIER than others depending on what you are doing and personal preference if you happen to me familiar with any of these languages. I have edited/created serviecs for the following languages ( not for bluetooth but other reasons ) and can see this performed with .Net languages like ( Visual Basic, C++, C# ) as well as Python, and Delphi, but once again I have never made or edited services that interface with Bluetooth to assist in any helpful depth other than my limited knowledge.
Appreciate it. Your advice was very helpful GOT a huge jump into the project today thanks to you.

1110.

Solve : How do i open a Data Base File (.db) SQLite format 3 ? | C# ??

Answer»

I was wondering how I can OPEN a Data Base File (.db) if POSSIBLE COULD it be opened with c# ?

Im trying to edit a game file that stores characters, only reason I want to open it so I can edit character names and possibly character level and some other things.

Here is the file if anyone needs to look deeply into it:
https://www.dropbox.com/s/yu1oim6e51sv5rj/characters.dbCube world uses SQLite but it uses it in an immensely stupid way which includes storing binary data in the various table fields.

I don't actually know if this is cube world but it is consistent with the filename as WELL as what you said.Quote from: BC_Programmer on July 14, 2013, 03:00:35 AM

Cube world uses SQLite but it uses it in an immensely stupid way which includes storing binary data in the various table fields.

I don't actually know if this is cube world but it is consistent with the filename as well as what you said.
Indeed this is cube world I don't have any coding skill with sql so I there any way I can edit this file ?
1111.

Solve : LNK2019 error - a vague question...?

Answer»

OK, the scenario…

I have a VS C++ program (a dll) that calls a static library (the static library uses Multibyte Character set)…

The static library calls a method from another dll (this dll uses Unicode Character set)…

I have the dll linked to the calling application through the linker property “Additional Dependencies”.

If I run the code, it will work as expected (which is unfortunately broken)… Now, I try to add a new method to the dll. I add the method prototype/declaration, rebuild it successfully, and move the new library to the path where the “Additional Dependencies” property expects it to be.

I then add a CALL to the new method and rebuild the static library. The static library BUILDS successfully.

I then rebuild the calling application. It fails with a LNK2019 error, unresolved symbol on the new method. Why could this be? The method added in the dll is modeled after an existing method so its form should be correct. The path for the dependencies has not changed and the new library is in that folder.

Any ideas? Thanks.
I guess I could add for clarity:

The function in the dll looks like this -

Code: [Select]

MyObj* MYCLASS::funct1(std::string str1, std::string str2, long var1, long var2, std::string str3)
{
MessageBox(0, s2ws(str1).c_str(), L"String 1 Value", 1);
MessageBox(0, s2ws( str2).c_str(), L"String 2 Value", 1);
MessageBox(0, s2ws(str3).c_str(), L"String 3 Value", 1);

// Code to return the object is here.

}


where function s2ws is defined as (found online) -

Code: [Select]
std::wstring s2ws(const std::string& s)
{
int len;
int slength = -1;

len = MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, 0, 0);

wchar_t* buf = new wchar_t[len];
MultiByteToWideChar(CP_ACP, 0, s.c_str(), slength, buf, len);

std::wstring r(buf);

delete[] buf;
return r;
};


This results in mangled names being displayed for the string values even though they are correctly passed into the function. I was wondering if this was due to the differences in the character sets being used between the static and dynamic libraries. The next thing I wanted to try was to convert the strings to wide string before passing them into the dll.

So on the static side I took the strings and passed them to the s2ws function before passing them in and checked both versions there. They were correct. So next I needed a new function in the dll to take wstring values. It is pretty much the same as above -

Code: [Select]
MyObj* MyClass::funct1(std::wstring str1, std::wstring str2, long var1, long var2, std::wstring str3)
{
MessageBox(0, str1.c_str(), L"String 1 Value", 1);
MessageBox(0, str2.c_str(), L"String 2 Value", 1);
MessageBox(0, str3.c_str(), L"String 3 Value", 1);

// Code to return the object is here.

}


That gets me back to the scenario I described first. After rebuilding everything, I am getting the LNK2019 error.

Thanks...I can't say much to help, but I can say that changing the parameter types will change the mangled name that the compiler generates for a function, which will result in unresolved externals.

Aside from that I just wanted to post so at least you know you weren't being completely ignored...Thanks for the post BC... I just noticed the error in my post that may have led to your comment. The second function that I CREATED was not supposed to look like I was overloading the original. The prototype for that one is actually -

Code: [Select]
MyObj* MyClass::funct2(std::wstring str1, std::wstring str2, long var1, long var2, std::wstring str3);


- with a funct2 name and not funct1. And the mangling was coming before this. I was merely passing a std::string into the dll and trying to use it in a message box (which because it is a Unicode dll defaults to MessageBoxW).

1112.

Solve : hey anyone good with vbscript / c++ that could help me through with a lab?

Answer»

Question stated above, I use aim / msn or skypeGenerally we don't HELP with homework, but if we can ANSWER the question, hey, you never KNOW.

Not SURE what VBScript and C++ have in common other than you can use EITHER or both to have your computer perform some work. Do you have a specific question?

1113.

Solve : Help with Excel Formula?

Answer»

Hi. I am trying to create a spreadsheet to calculate compensation. Since there are 5 different possible payouts I have been trying to combine the "IF","AND" and "OR" funcitions. My forumula looks like below, except I need to add 3 more layers and it is not working. I also provided a key for reference.

=IF(OR(AND(J6>=C9),J4*D9)=IF(AND(J6>=C8,J6
Key:
C8=90%
C9=100%
D8=$5
D9=$20
J4=number of sales
J6=J4/days worked in month



So if you exceed 100% of your goal the payout is $20*number of sales, and if you hit between 90% and 100% of your goal the payout is $15*number of sales.
What are the 5 possible payouts?

Where is the goal?


Solomon thanks for he reply. The goal is 60 sales per month. Hope this all makes sense. I changed some of the numbers around for simplicity.

Scenario 1: hit less than 50% of the goal and there is no BONUS
Scenario 2: hit between 50% and 60% of the goal, the payout is $20 x number of sales
Scenario 3: hit between 60% and 90% of the goal, the payout is $30 x number of sales
Scenario 4:hit been 90% and 100%, the payout is $40 x number of sales
Scenario 5: meet our exceed goal of 100%, the payout is $50 x number of sales

Key:
Column C is percentage of goal
C5=<50%
C6=50-60%
C7=60-80%
C8=90%
C9=100%

Column D is payout per sale
D5=$0
D6=$20
D7=$30
D8=$45
D9=$50


J4=number of sales
J6=% of goal met (or J4/60)
Which payout do the boundary VALUES get? (i.e. 60% 80% 100%) Are they the lower or higher? e.g. do 50% to 59% get $20 and 60% to 89% get $30 and 90% to 99% get $40 and 100% plus get $50?


Quote from: Salmon Trout on July 14, 2013, 12:49:44 PM

Which payout do the boundary values get? (i.e. 60% 80% 100%) Are they the lower or higher? e.g. do 50% to 59% get $20 and 60% to 89% get $30 and 90% to 99% get $40 and 100% plus get $50?

Yes that is correct. Anything over 50% but less than 60% gets $20 per sale. Anything between 60-89% is $30 per sale. 90-99% gets $40. 100%+ of the goals get you $50 per sale.So, starting at 50% there is a minimum of $20, with $10 steps at 60%, 90% and 100%

Expressions such as A2>=50 evaluate to TRUE (1) or FALSE (0). Thus we can calculate the dollars per sale.

I not sure how to post my spreadsheet into the forum like you did, but i have attached an IMAGE of my spreadsheet. Hopefully you can see it.

Attachment removed at request of posterK6 through K9 are the formula's I am using to calculate payout. I basically want to combine all of them into 1 cell so that I only have to enter in the number of sales and it will automatically calculate the payout.

K6 =IF(AND(J6>=C6,J6K7 =IF(AND(J6>=C7,J6K8 =IF(AND(J6>=C8,J6K9 =IF(J6>=C9,J4*D9)Non-commercial use?
This is just so that I can calculate my monthly income. The terms and numbers have been changed.
1114.

Solve : Using Windows API?

Answer»

Hello everyone,
I need help as i am new to this.
What i WANT is someone to help me out how to use windows api functions(function in dll files provided by windows) in a sample c program.

also if there are some good and illustrative web links or books regarding my question above, please do post it.

thank you. Quote from: HardwareTwitch on October 10, 2012, 12:44:22 AM

also if there are some good and illustrative web links or books regarding my question above, please do post it.

http://msdn.microsoft.com/en-us/library/windows/desktop/hh447209%28v=vs.85%29.aspxcan an1 help me with simple sample program in c(not using gui mainly but any other api function that can be implemented without gui) so i can see its output console based or anything
thank youQuote from: HardwareTwitch on October 13, 2012, 12:51:43 AM
can an1 help me with simple sample program in c(not using gui mainly but any other api function that can be implemented without gui) so i can see its output console based or anything
thank you

Code: [SELECT]
#include "stdafx.h"

#include <windows.h>
#include <VdmDbg.h>

BOOL WINAPI ProcessVDMs( DWORD, DWORD, LPARAM );
BOOL WINAPI ProcessTasks( DWORD, WORD, WORD, PSZ, PSZ, LPARAM );

#pragma comment( lib, "vdmdbg.lib" )

void main()
{
// Enumerate VDMs
VDMEnumProcessWOW(
(PROCESSENUMPROC)ProcessVDMs,
(LPARAM)NULL
);

}

BOOL WINAPI ProcessVDMs( DWORD dwProcessId, DWORD dwAttrib,
LPARAM t )
{
printf("VDM Process ID: %d\n", dwProcessId);

// Use process ID of VDM to enumerate through its tasks
VDMEnumTaskWOWEx(
dwProcessId,
(TASKENUMPROCEX)ProcessTasks,
(LPARAM)NULL
);

// Keep enumerating
return FALSE;
}

BOOL WINAPI ProcessTasks( DWORD dwThreadId, WORD hMod16, WORD hTask16,
PSZ pszModName, PSZ pszFileName, LPARAM lParam )
{
// Print task's information
printf("ThreadID: %d\n", dwThreadId);
printf("Module: %d\n", hMod16);
printf("Task: %d\n", hTask16);
printf("ModName: %s\n", pszModName);
printf("File: %s\n", pszFileName);

// Keep enumerating
return FALSE;
}




Source and Binary graciously provided by the handsome fellow that runs this site.


I think you might be tripping over standard HEADER file stuff; the Windows API for C is not USED much differently than other APIs, you include the header file (#include ) and then you call functions to interact with the Windows OS.Quote from: BC_Programmer on October 13, 2012, 03:57:01 AM
Code: [Select]
#include "stdafx.h"

#include <windows.h>
#include <VdmDbg.h>

BOOL WINAPI ProcessVDMs( DWORD, DWORD, LPARAM );
BOOL WINAPI ProcessTasks( DWORD, WORD, WORD, PSZ, PSZ, LPARAM );

#pragma comment( lib, "vdmdbg.lib" )

void main()
{
// Enumerate VDMs
VDMEnumProcessWOW(
(PROCESSENUMPROC)ProcessVDMs,
(LPARAM)NULL
);

}

BOOL WINAPI ProcessVDMs( DWORD dwProcessId, DWORD dwAttrib,
LPARAM t )
{
printf("VDM Process ID: %d\n", dwProcessId);

// Use process ID of VDM to enumerate through its tasks
VDMEnumTaskWOWEx(
dwProcessId,
(TASKENUMPROCEX)ProcessTasks,
(LPARAM)NULL
);

// Keep enumerating
return FALSE;
}

BOOL WINAPI ProcessTasks( DWORD dwThreadId, WORD hMod16, WORD hTask16,
PSZ pszModName, PSZ pszFileName, LPARAM lParam )
{
// Print task's information
printf("ThreadID: %d\n", dwThreadId);
printf("Module: %d\n", hMod16);
printf("Task: %d\n", hTask16);
printf("ModName: %s\n", pszModName);
printf("File: %s\n", pszFileName);

// Keep enumerating
return FALSE;
}




Source and Binary graciously provided by the handsome fellow that runs this site.


I think you might be tripping over standard header file stuff; the Windows API for C is not used much differently than other APIs, you include the header file (#include <windows.h>) and then you call functions to interact with the Windows OS.

thank you very much and 1 more question..
the microsoft link you gave me in above have those functions which you provided in the example?
1115.

Solve : Learning PHP?

Answer»

After watching the lynda.com videos on html/css I've downloaded 100 html/css templates and am getting more flexibility and power from looking at how other people did it than the lynda.com tutorials that I found quite basic. Where can I find PHP source or what strategies should I use to try and learn PHP

thankyouHow much experience do you have with programming in other LANGUAGES?

I taught myself the basics of PHP from: http://www.tizag.com/phpT/ but other great resources are http://www.youtube.com/phpacademy and http://www.youtube.com/playlist?list=PL442FA2C127377F07

What I did when learning PHP was to just play about learning the syntax for basic concepts such as 'if statements' and loops (Using tizag.com) - I had already programmed in other languages so this was PRETTY easy. What I then did was learn how to work with simple MySQL databases - From there I built a very simple blog-type application, From there I just began to expand as I learned more constructs. Once you get more advanced or want to develop bigger applications you may want to then look into using a framework but I'd advise against doing this until you have a good UNDERSTANDING of the basic language.My background is knowing only the very fundamentals of html and cssIn that case I would recommend you focus on learning the basic programming concepts before TRYING to build anything huge. You may also want to look into SQL databases (MySQL is probably the easiest for PHP) as you'll likely end up needing a database in your applications.

1116.

Solve : Question for an older friend of mine that I couldnt find answer to?

Answer»

Co-worker was TALKING with me about computing 30 years AGO, and I was talking about the DAYS when I was using my TRS-80 in the 1980s and programming in Basic with cassette load/saves etc. He said that he really MISSES programming in Basic with line numbers and asked me if Basic advanced but to still include support for Basic with line number programming. I told him that I programmed in GW-Basic and QBasic and that the last one to support programming in Basic with line numbers was QBasic. QBasic wasn't really meant to be the old line number format but it was backwards compatible to run older format programming in Basic, but I dont believe line numbers continued to be supported from then on. I told him that OOP did away with need for line numbers as well as GOTO's and GOSUB's...LOL and everything these days is more like C. I told him that if he wants I could get him GW-Basic or QBasic off of Microsofts website, but he was wondering if there was any newer interpreter for Basic with Line Numbers to where it may have support for more modern functionality like windows etc vs being stuck in 1980's STYLE ascii and pixel blocks. I told him that I would check, but I believe the world moved on away from Line Number Basic programming in the late 1980s and early 90's when QBasic came out. I also said that it would be lacking many features like .Net etc if there was a modern interpreter. 99.999% of the world of programmers moved on to more modern languages and that there are only a few that have a desire to program in the older languages that are out of date. And that those who still program Basic with Line Numbers either use GW-Basic or QBasic. Told him I'd post the question here and get back to him. I didnt find anything on google as for I believe there is very little demand for a modernized Basic with Line Numbers interpreter/compiler.Off the top of my head, I can think of two BASICs that are more modern than GW-BASIC or QBASIC and support line numbers

QB64 which is an attempt at a modernized QBasic: http://www.qb64.net/

and Chipmunk Basic: http://www.nicholson.com/rhn/basic/

Thanks Salmon.... printing this out to give him a copy =)This is an old-style Chipmunk Basic program


1 cls
5 gosub 100 : rem random coord generators
10 graphics window 100,100,200,200 : call "wintitle","Random Image"
20 for l1 = 1 to 200
25 for l2 = 1 to 200
27 cr = rnd(100) : cg = rnd(100) : cb = rnd(100)
30 graphics color cr,cg,cb
32 gosub 150
35 pset l1,l2
40 next l2
45 next l1
50 for p = 1 to 10
55 sound 2000,0.07,90
60 sound 3050,0.13,90
65 next p
67 get qon$
68 if qon$ = "s" then call "savepicture",inputbox("Name of picture?","Save Image","Pict 1",0)
70 graphics -1 : cls : end
100 rem random coord genorators
105 nrc = rnd(100)
107 dim crdx(nrc) : dim crdy(nrc)
110 for gl = 1 to nrc
115 crdx(gl) = rnd(200) : crdy(gl) = rnd(200)
120 next gl
122 print "x";tab (20);"y"
125 for pc = 1 to nrc
130 print crdx(pc);tab (20);crdy(pc)
135 next pc
140 return
150 rem coord checker/changer
155 for nt = 1 to nrc
157 ad = rnd(75)
158 sa = rnd(11)
160 if (l1 > crdx(nt)-sa and l1 < crdx(nt)+sa) and (l2 > crdy(nt)-sa and l2 < crdy(nt)+sa) then gosub 180
170 next nt
175 return
180 rem color changer
185 cr = cr-ad : if cr < 1 then cr = 0
187 cg = cg-ad : if cg < 1 then cg = 0
189 cb = cb-ad : if cb < 1 then cb = 0
190 graphics color cr,cg,cb
195 return

1117.

Solve : Neural Network C++?

Answer»

The following code for a neural network, for some infuriating reason, outputs 50 if I use any number above two. Is this just my computer, or my code?

Code: [Select]#pragma region "Stuff behind the scenes that I don't feel like looking at"
inline double sigmoid(double input)
{
double tmp = 0;
double in = -1 * (input - 5);
double e = 2.718281828459045;
tmp = pow(e, in);
tmp++;
tmp = 1 / tmp;
return tmp;
}
class neuron
{
public:
double current_value;
};

class layer
{
public:
neuron *NEURONS;
int neurons_length;
~layer()
{
delete neurons;
}
};

class CONNECTION
{
public:
neuron *previous, *next;
double weight;
~connection()
{
delete previous;
delete next;
}
};

connection *ReDimPreserve(connection *ptr, int size, int newsize)
{
connection *temptr = new connection[newsize];
for (int i = 0; i < size; i++)
{
*(temptr + i) = *(ptr + i);
}
return temptr;
}

class neural_network
{
public:
int inputs_length, outputs_length, layers_length, connections_length;
layer *layers;
connection *connections;
neuron *inputs;
neuron *outputs;
neural_network() {}
neural_network(int inputs_size, int outputs_size, int layers_size, layer *lyrs, neuron *inpts, neuron *outpts, double initial_connection)
{
this->inputs_length = inputs_size;
this->outputs = outpts;
this->outputs_length = outputs_size;
for (int i = 0; i < outputs_length; i++)
{
outputs[i].current_value = 0;
}
this->layers_length = layers_size;
this->layers = lyrs;
for (int i = 0; i < layers_length; i++)
{
for (int B = 0; b < layers[i].neurons_length; b++)
{
layers[i].neurons[b].current_value = 0;
}
}
this->inputs = inpts;
this->connections_length = 0;
int counter = 0;
//connections
for (int i = 0; i < layers_length + 1; i++)
{
if (i == 0)
{
if (layers_length != 0)
{
int tmp = inputs_length * layers->neurons_length;
connections = new connection[tmp];
for (int b = 0; b < tmp + connections_length; b++)
{
(this->connections + b)->previous = inputs + (b % inputs_length);
(this->connections + b)->next = layers[i].neurons + (b % layers[i].neurons_length);
(this->connections + b)->weight = initial_connection;
}
this->connections_length = tmp;
}
}
else if(i == layers_length)
{
int tmp = (layers + layers_length - 1)->neurons_length * outputs_length;
connections = ReDimPreserve(connections, this->connections_length, tmp + this->connections_length);
for (int b = connections_length; b < tmp + connections_length; b++)
{
(this->connections + b)->previous = layers[i - 1].neurons + (b % layers[i - 1].neurons_length);
(this->connections + b)->next = outputs + (b % outputs_length);
(this->connections + b)->weight = initial_connection;
}
this->connections_length += tmp;
}
else
{
int tmp = layers[i - 1].neurons_length * layers[i].neurons_length;
connections = ReDimPreserve(connections, this->connections_length, tmp + this->connections_length);
for (int b = connections_length; b < tmp + connections_length; b++)
{
(this->connections + b)->previous = layers[i - 1].neurons + (b % layers[i - 1].neurons_length);
(this->connections + b)->next = layers[i].neurons + (b % layers[i].neurons_length);
(this->connections + b)->weight = initial_connection;
}
this->connections_length += tmp;
}
}
}
inline double sigmoid(double input)
{
double tmp = 0;
double in = -1 * (input - 5);
double e = 2.718281828459045;
tmp = pow(e, in);
tmp++;
tmp = 1 / tmp;
return tmp;
}
void run()
{
double previous_one = 0;
for (int i = 0; i < this->connections_length; i++)
{
double tmp = 0;
tmp = sigmoid(connections[i].previous->current_value) * connections[i].weight;
connections[i].next->current_value += tmp;
}
}
private:
~neural_network()
{
delete inputs;
delete outputs;
delete connections;
delete layers;
}
};
#pragma endregion

int main()
{
layer *layers = new layer[2];
neuron *l1neurons = new neuron[50];
neuron *l2neurons = new neuron[50];
neuron *in = new neuron[60];
neuron *out = new neuron[3];
layers->neurons = l1neurons;
(layers + 1)->neurons = l2neurons;
layers->neurons_length = 50;
(layers + 1)->neurons_length = 50;
for (int i = 0; i < 60; i++)
{
(in + i)->current_value = 10000000;
}
neural_network *stockpicker = new neural_network(60, 3, 2, layers, in, out, 1);
stockpicker->run();
cout << out->current_value << ", " << (out + 1)->current_value << ", " << (out + 2)->current_value;
cin.ignore();

return 0;
}Its the code! .... but I haven't found where the typo is yet. You have a few locations where variable is sent to = 50. So this is a good place to start and work backwards from.

Quote

layers->neurons_length = 50;
(layers + 1)->neurons_length = 50;
Well, that's the section where I chose arbitrary values just to test it. For some reason, it works perfectly with small numbers of neurons, but not with larger ones.I found it. The limits of double (and long double) cause the sigmoid FUNCTION to output 1 for large inputs, which occurs in the run function when all the inputs from previous neurons are summed and run through. Thanks, anyway.
1118.

Solve : Check for missing attribute in xml node element?

Answer»

Greetings all. I have just had a need to WORK with a small xml file in a vbscript program, and after a bit of head scratching I was able to do what I needed to do. However, I am wondering if there is a better way. The xml file has only one node, with four elements, three of which have an attribute called "default". I need to load the node text and the default attribute in a 2d array for later processing. I should note, that I am not even sure if I am using the correct terminology with "node", "element", and "attribute". I am hoping that someone will be able to look at the xml file, and maybe point out some areas of improvement. As I said, the objective is to load the array, *exactly* as it is being loaded, but maybe without relying on "On Error Resume Next". Thanks for any advice or tips.
Code: [Select]
<user_config>
<ftp_map>
<fname default="u:\vbscript\downloads">download</fname>
<fname>pwq</fname>
<fname default="u:\vbscript\downloads\somo">somotwo</fname>
<fname default="u:\vbscript\downloads\mrdr">mrdr</fname>
</ftp_map>
</user_config>

and now the vbscript...
Code: [Select]
' This array will be used to map a file name to a default
' LCD directory value for ftp later in the script
Dim arElements()

Set xmlDoc = CreateObject( "Microsoft.XMLDOM" )
xmlDoc.async=false
xmlDoc.Load("U:\xml\xml_test.xml")

set nodes = xmlDoc.selectNodes("/user_config/ftp_map/*")

' Here I want to loop through all the elements in the "ftp_map" node,
' pull out the fname value, and the default attribute, if it exists.
' The only way I COULD get it to work is by using the trusty
' "On Error Resume Next". Is there a better way to determine if
' any of the node elements are missing the "default" attribute?
ReDim arElements(nodes.length,1)
On Error Resume Next
For i = 0 to nodes.length - 1
arElements(i ,0) = nodes(i).text

' How can I check for the one missing attribute in element "pwq"?
arElements(i,1) = nodes(i).getAttribute("default")
Next

' This is not PART of the solution, it is only here so I
' can verify that what I think is in the array is REALLY there.
strAr = ""
For i = 0 to UBound(arElements) - 1 Step 1
strAr = strAr & "fname = " & arElements(i,0) & Chr(9) & " default = " & arElements(i,1) & vbCrLf
Next
msgbox strAr
This little snippet demos method and might give you some ideas. As written it will list the nodes that have a default attribute. You can replace this (WScript.Echo - line 10) with your existing code to load the array.

Code: [Select]Set xmlDoc = CreateObject("Microsoft.XMLDOM")
xmlDoc.async = False
xmlDoc.load("U:\xml\xml_test.xml")

Set colNodes = xmlDoc.selectNodes("user_config/ftp_map/*")
For Each node In colNodes
Set colAttribs = node.attributes
For Each strAttr in colAttribs
If strAttr.baseName = "default" Then
WScript.Echo node.baseName & ":", node.text, strAttr.baseName & ":", strAttr.text 'replace with array load
End If
Next
Next

Thank you Sidewinder, I like that method much better, as I'm not having to generate errors. I can see there is much much more to xml that I had thought.

[Edit] I am amazed at how perceptibly faster your solution is than having to load and read the array. Thank you so much!

1119.

Solve : C++ Question regarding MFC?

Answer»

I have a program that is written using Standard Windows Libraries (an old VC++ 6 project converted to VS2010).
I have a THIRD party dll written to use the MFC in a shared dll.

I reference the dll and the headers in the project and try to build. When I do, I get errors in the dll's header files when IMPLEMENTING CObject in the constructor and the DECLARE_DYNAMIC macro is not resolved either (along with many other MFC objects).

I THOUGHT I had read once where MIXING PROJECTS of the two types was not possible but I don't believe that. Any insight here?

Thanks.Is the dll file present so that all dependencies are met? I brought a C++ program forward from 6 to 2008 and just needed to drop my dll in the root of where my exe executed to get it to run without error.

1120.

Solve : need help with visual basic/studio please?

Answer»

I don't really KNOW the best way of explaining my situation but i'll try my best.

So I have made a auto typer and a web browser in visual studio 2012, both the auto typer and the browser are in the same application/form. I want the auto typer to only type in the web browser that I have made in visual studio and not else where. so for example, currently when I start the auto typer and OPEN another application like notpad, the auto typer will start typing in the notepad because my mouse is active on the notepad.

Is there any way to make the auto typer uonly type in the web browser that I made in visual studio, even when the mouse CURSOR is active elsewhere or when the application CONTAINING the auto typer and the browser is minimised?

Thanks in advance I imagine you are using the 'SendKeys' method in your auto typer. Unfortunately this will only work on the focused text box, no way around it that I can see.

If you describe what the program should actually do, it would make it easier to suggest ALTERNATIVE approaches.

1121.

Solve : [b]Unknown property '-moz-box-shadow'. Declaration dropped[/b].?

Answer»

Hi there,

could anyone help me solve this problem?
i surf to FIND some KIND of design stuffs and was becoming a member for learning and fun. recently i was requested to update windows and its runs more than 48 hours automatically when i connected to internet, then in turn i got this since then. i am UNAWARE of any malware or spyware or being computer INFECTED. and i wonder i cannot open any of this website starting with "designs", i guess. could any one figure out how to stop this so i can watch/surf these sites again and running to search normally on WEB for any, and my computer wont get stuck just for running to see these pages?

p.f. the attached below is the latest one i found, the others has many more like this one.

thank you in advance...

please see the redundant "unknown property ..." in the web console tag, below:




[11:24:21.804] Unknown property '-moz-box-shadow'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:21.804] Unknown property '-moz-border-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:21.805] Unknown property 'zoom'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:21.811] Unknown property 'user-select'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:21.814] Unknown property 'transition'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.677] Unknown property 'transform'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.679] Unknown property 'transition-property'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.681] Unknown property '-moz-border-radius-topright'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.682] Unknown property 'transition-duration'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.690] Unknown property 'box-sizing'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.695] Unknown property 'border-color-bottom'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:9
[11:24:22.818] Unknown property '-moz-opacity'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
[11:24:24.730] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:1
[11:24:24.730] Unknown property '-moz-border-bottom-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a:1
--
[11:25:33.119] Unknown property '-moz-box-shadow'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=what+happens+with+99designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.119] Unknown property 'user-select'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.122] Unknown property '-moz-border-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.124] Unknown property 'transition'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.124] Unknown property 'transform'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.125] Unknown property 'transition-property'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.128] Unknown property '-moz-border-radius-topright'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=99designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.129] Unknown property 'transition-duration'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.137] Unknown property 'box-sizing'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:9
[11:25:33.147] Unknown property 'zoom'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326
[11:25:34.372] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
[11:25:34.372] Unknown property '-moz-border-bottom-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=C33&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=designs.com%3F&oq=designs.com%3F&gs_l=serp.3...65010.65133.1.65762.3.3.0.0.0.1.1496.1496.7-1.1.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.jXgmpgNP0ZQ&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
--
[11:27:13.698] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=2Oj&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=computer&oq=computer&gs_l=serp.3...69275.70683.2.100470.11.10.0.0.0.0.2515.4550.9-2.2.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.HjzIL_HyE-U&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
[11:27:13.698] Unknown property '-moz-border-bottom-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=2Oj&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=computer&oq=computer&gs_l=serp.3...69275.70683.2.100470.11.10.0.0.0.0.2515.4550.9-2.2.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.HjzIL_HyE-U&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
--
[11:28:27.304] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=LlO&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=design&oq=design&gs_l=serp.3...39682.72935.3.73476.21.18.3.0.0.0.7467.40628.2j9-7.9.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..2.0...1c.1.qUgcMctCRIo&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
[11:28:27.304] Unknown property '-moz-border-bottom-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=LlO&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=design&oq=design&gs_l=serp.3...39682.72935.3.73476.21.18.3.0.0.0.7467.40628.2j9-7.9.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..2.0...1c.1.qUgcMctCRIo&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
--
[11:28:50.774] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=963&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=design.com&oq=design.com&gs_l=serp.3...13864.20836.4.21150.8.8.0.0.0.1.1755.6278.6-1j3j1.5.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.z7ET1Yar2c4&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
[11:28:50.774] Unknown property '-moz-border-bottom-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=963&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=design.com&oq=design.com&gs_l=serp.3...13864.20836.4.21150.8.8.0.0.0.1.1755.6278.6-1j3j1.5.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.z7ET1Yar2c4&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
--
[11:31:09.368] [11:28:50.774] Unknown property '-moz-border-top-right-radius'. Declaration dropped. @ https://www.google.com/search?q=designs.com%3F&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=963&rls=org.mozilla:en-US%3Aofficial&sclient=psy-ab&q=design.com&oq=\design.com&gs_l=serp.3...13864.20836.4.21150.8.8.0.0.0.1.1755.6278.6-1j3j1.5.0.les%3Bcqn%2Cfixedpos%3Dfalse%2Cboost_normal%3D40%2Cboost_high%3D40%2Ccconf%3D1-0%2Cmin_length%3D2%2Crate_low%3D0-030%2Crate_high%3D0-030%2Csecond_pass%3Dfalse%2Cignore_bad_origquery%3Dtrue..0.0...1c.1.z7ET1Yar2c4&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.&fp=77e2ea00abe9a264&biw=1024&bih=326:1
--
[11:31:26.499] find unknown property
--
[11:31:56.588] find unknown property

1122.

Solve : examresult?

Answer»

Hi all..

I am trying to search a data from the database and trying to display( similar to that of displaying exam result, one will enter his registration number, he will be showed his results)

Pls help me how to do this.

I have a Wamp server with database

i have to search using column name called rollno

want to display colums called dob, name , email, phone no . All datas i have in database


Pls help me
Is this homework?
Are you using MySQL ?
Have you used it before?
Have you seen this:
HTTP://www.youtube.com/watch?v=DqEdTWjSnAQ
I have wamp server and database already.

i have used search.php

its code as follows

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

if(isset($_POST['submit'])) {
$srollno = $_POST['srollno'];

$sql1 = mysql_query("SELECT srollno FROM tbl_slamrec WHERE srollno = $srollno");
$row1 = mysql_num_rows($sql1);

if($row1 == 0) {
echo 'Error, ID does not exist';
} ELSE {
header('Location: show_result.php?srollno='.$srollno);
}
}
?>



Search











and show_result.php

its code

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


$srollno = $_GET['srollno'];

$sql1 = mysql_query("SELECT * FROM tbl_slamrec WHERE srollno = $srollno");
$row1 = mysql_fetch_array($sql1);
$rme = $row1['name'];
$mailme = $row1['marks'];
?>



Show Results



echo 'Name = '.$rme.'

Marks = '.$mailme;
?>







but i am getting an error

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\result\search.php on line 8

whatt should I do now?sorry, but I can not help you on this one.
But, I thin k yhou ought to make some comments about whkat the following line means.
Quote

$row1 = mysql_num_rows($sql1);
Placing comment in our code can help both others and yourself. Six months from now you might forget what it means. In particular, what is $sql1 -Is it a string or a scalar or a Boolean? Something else?
You do not use mysql_connect() to connect to a database, so mysql_query() returns false, and that result get's passed into mysql_num_rows which expects a resource rather than a boolean and you get the error you are receiving.



Quote from: Geek-9pm on July 24, 2013, 09:18:33 PM
But, I thin k yhou ought to make some comments about whkat the following line means.
Placing comment in our code can help both others and yourself. Six months from now you might forget what it means. In particular, what is $sql1 -Is it a string or a scalar or a Boolean? Something else?
It's common in the older PHP database functions. the variable is created as the result from mysql_query. This is normally a loosely typed value that is only used as a 'cookie' for other functions, such as mysql_num_rows. In this case mysql_query() is returning FALSE to INDICATE failure because the code hasn't opened a database connection.What should I do now to make the code to work?You need to call mysql_connect() before you start working with the database to connect to the database server. Documentation on this function can be found here: http://php.net/manual/en/function.mysql-connect.php

This function is deprecated so while it will work fine for now, if you plan on building any large applications you should look into using MySQLi as detailed here: http://www.php.net/manual/en/book.mysqli.php

You should ALSO get into the habit of escaping any user provided values (e.g. $_GET, $_POST) before adding them into your queries, otherwise you are WIDE open for SQL InjectionThank you sir,

But I dono exactly how to modify the line.

Can anyone please modify and give me that line?Quote from: Geek-9pm on July 24, 2013, 07:33:42 PM
Is this homework?

I'm thinking the answer to this question is "yes".Dear All Repliers,

I am basically from Electrical Engineering Background. I have interest in webdesigning, so I am learning this,. ,

Who from Electrical Engineering Gives Web designing as a homework? Quote from: gowthamprabhus on July 27, 2013, 07:10:01 PM
Dear All Repliers,

I am basically from Electrical Engineering Background. I have interest in webdesigning, so I am learning this,. ,

Who from Electrical Engineering Gives Web designing as a homework?
I am basically Santa Claus, I have an interesting in Programming and IT, so I often assist in a volunteer fashion on this forum.

Who from the North Pole gives MySQL advice?

Point being, you didn't negate anything that was claimed. You can make any number of wild claims. Replace "Electrical Engineering" with "Oval Office" and you see the problem. Even so, it's quite possible to verify what you are saying, rudimentarily, through a Google search. However, from what I found, you already claim to know PHP, and I find it difficult to imagine a case where somebody could "know" PHP but not know how to use mysql.

We have already provided you the means to help yourself. If you want somebody else to write the code for you, you should hire somebody else to do so; otherwise, you will have to invest in learning what you are doing. You cannot "hire" volunteers and ask for one line of code at a time.

You need to connect to the database. Look up what you are learning and using. Learn how it works. learn WHY you need to use db_connect(), and how you would do so. Otherwise, me, or anybody else telling you what line to write wouldn't help you, because you won't know what you need it. (And I don't know where you database server is, whether it's localhost, how your webhost has it configured, what the database name is, or any of those things, which would be needed to create the appropriate db_connect() call.)

If this is for a Freelance project I worry for the client.Thank you for your Reply @ B C Programmer

1123.

Solve : VBS Pause/Resume music WMPlayer.OCX?

Answer»

hey, I know how to play music in VBS like so:
Code: [Select]Set wmp = CreateObject("WMPlayer.OCX")
wmp.settings.autoStart = True
wmp.settings.volume = 50
wmp.URL = "Music.mp3"
while wmp.Playstate <&GT; 1
WSH.Sleep 100
wendbut how would I pause/resume music?

(I'm using Windows 7 FYI)Script will play first 20 seconds of song, pause for 5 seconds and then resume playing the song. Change the timings as needed.

Code: [Select]Set wmp = CreateObject("WMPlayer.OCX")

wmp.settings.autoStart = True
wmp.settings.volume = 50
wmp.URL = "Music.mp3"
PauseAndResume()

While wmp.Playstate <> 1
WScript.Sleep 100
Wend

Function PauseAndResume()
WScript.Sleep 20000
wmp.controls.pause()
WScript.Sleep 5000
wmp.controls.play()
End Function

WSH was not defined. Changed to WScript.

How would I pause music that was playing from a different vbs script, like 1 file to play a song and 1 to pause it and 1 to resume ITYOU want two scripts to control the same object instance (WMP)? I think you would have to create an out-of-process COM object. Don't know if this would work, but it sure sounds promising.

An alternative would be to RUN WMP in a window. While the media is playing, give the WMP window focus and you can use CTL-P to control pause/resume operations. See this post for ideas.

Quote from: Sidewinder on September 10, 2012, 10:23:56 AM

You want two scripts to control the same object instance (WMP)? I think you would have to create an out-of-process COM object. Don't know if this would work, but it sure sounds promising.

An alternative would be to run WMP in a window. While the media is playing, give the WMP window focus and you can use CTL-P to control pause/resume operations. See this post for ideas.


what I'm doing is programming MS-DOS Batch and occasionally using vbs files to do things batch can't so the second option isn't going to work, I'm not very familiar with vbs and don't know what an out of process COM object is, its rather hard to get batch to communicate with the vbs maybe an option would be to create a text DOCUMENT with the value of the time the music was at then kill the process and then RESTART the process later with the music starting at that point in timeI don't think this is going to happen. Giving focus to Win7 WMP from an external script for some reason does not work. I could only give focus from within the script that launched WMP. That would eliminate having seperate scripts for pause and resume.

The Script Component also fizzled out. I could get the music to play but could not pause/resume it. The WMP object and the script run asynchronous, which explains the while/wend loop in your script and the sleep in my script. VBScript is single threaded, so interrupting the loop might not be possible.

My suggestion is to manually start the music, and use CTL-P to toggle between pause and resume. Make sure the WMP window has focus when using CTL-P.



To add insult to injury, I found that giving focus to WMP on WinXP works just fine. alright thanks for trying though
1124.

Solve : SQL Query for Previous Month?

Answer»

I have come up with the following query which gives me a summary of my help desk for the previous MONTH. The only issue that I run into is when January rolls around the it will be looking for the month which will end up as 0 and the YEAR will be 2013. It should be looking for 12/2012. This is my first attempt at SQL scripts and I'm not sure if conditional statements are possible in SQL. I don't want to have to worry about changing the code every January. Any help would be appreciated.

Code: [Select]
Select "* Tickets in the system (Since " || min(created_at) || ") *" as "Category",COUNT(id) as "Total"
from tickets
union
Select "1 - Tickets opened this month" as "Category",count(id) as "Total"
from tickets t
where strftime('%m',t.created_at) = strftime('%m','now','-1 month')
and strftime('%Y',t.created_at) = strftime('%Y','now')
union
Select "2 - Tickets closed this month" as "Category",count(id) as "Total"
from tickets t
where strftime('%m',t.closed_at) = strftime('%m','now','-1 month')
and strftime('%Y',t.closed_at) = strftime('%Y','now')
union
Select "3 - Tickets currently open" as "Category",count(id) as "Total"
from tickets t
where (closed_at is null)
union
Select "4 - Tickets open more than 5 DAYS" as "Category",count(id) as "Total"
from tickets t
where (closed_at is null) and (created_at<=date('now','-5 days'))
union
Select "5 - Tickets average days open" as "Category", round(avg((julianday(closed_at) - julianday(created_at))),2) as "Total"
from tickets t
where (status='closed')
union
Select "6 - Incident Counts This Month" as "Category",count(id) as "Total"
from tickets t
where (c_type='Incident') and strftime('%m',t.created_at) = strftime('%m','now','-1 month')
and strftime('%Y',t.created_at) = strftime('%Y','now')
union
Select "7 - Request Counts This Month" as "Category",count(id) as "Total"
from tickets t
where (c_type='Request') and strftime('%m',t.created_at) = strftime('%m','now','-1 month')
and strftime('%Y',t.created_at) = strftime('%Y','now')
union
Select "8 - Change Counts This Month" as "Category",count(id) as "Total"
from tickets t
where (c_type='Change') and strftime('%m',t.created_at) = strftime('%m','now','-1 month')
and strftime('%Y',t.created_at) = strftime('%Y','now')
They do Batch files? SQL?

Good LuckI'm not quite sure what you are asking me?Um - why not USE SQL's date diff functions? Which flavour of SQL is this?

1125.

Solve : [HELP] VB.net with batch commandy?

Answer»

Here is my VB.Net code :

DIM NameOfFile As String = ""

If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
Try
Dim fnPeices() As String = OpenFileDialog1.FileName.Split("\")
NameOfFile = fnPeices(fnPeices.Length - 1)
MsgBox(NameOfFile) 'Here it display the file name correctly

Shell("cmd.exe /c" & "ECHO NameOfFile & PAUSE") ' HERE, IT WILL EXECUTE BATCH COMMAND (echo NameOfFile & pause)

Catch ex As Exception
MessageBox.Show(ex.Message, My.Application.Info.Title, MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End If


When it execute shell program, INSTEAD of echoing/displaying the file name it just display the WORD "NameOfFile", how can i display the actual filename?
Please help and thanks in advance..Since you want to pass to the Shell command a string containing the value held by the variable NameOfFile, and not the variable's name, you will have to do something like this:

Shell("cmd.exe /c" & "echo " & NameOfFile & "& pause")
it works.... thank you so much Salmon Trout

1126.

Solve : how to use GREP command to group lines?

Answer»

What I have is a folder full of Protein Database FILES (.pdb) that are code in the following pattern:

HEADER OXIDOREDUCTASE 27-FEB-12 4DXH
TITLE HORSE LIVER ALCOHOL DEHYDROGENASE COMPLEXED WITH NAD+ AND 2,2,2-
TITLE 2 TRIFLUOROETHANOL
COMPND MOL_ID: 1;
COMPND 2 MOLECULE: ALCOHOL DEHYDROGENASE E CHAIN;
COMPND 3 CHAIN: A, B;
COMPND 4 EC: 1.1.1.1
SOURCE MOL_ID: 1;
SOURCE 2 ORGANISM_SCIENTIFIC: EQUUS CABALLUS;
SOURCE 3 ORGANISM_COMMON: DOMESTIC HORSE,EQUINE;
SOURCE 4 ORGANISM_TAXID: 9796;
SOURCE 5 STRAIN: DOMESTIC HORSE;
SOURCE 6 ORGAN: LIVER;
SOURCE 7 OTHER_DETAILS: LIVER
KEYWDS ALCOHOL DEHYDROGENASE, NAD+,TRIFLUOROETHANOL, MICHAELIS COMPLEX
KEYWDS 2 ROSSMANN FOLD, OXIDOREDUCTASE
EXPDTA X-RAY DIFFRACTION
AUTHOR B.V.PLAPP,S.RAMASWAMY
REVDAT 4 27-JUN-12 4DXH 1 JRNL
REVDAT 3 16-MAY-12 4DXH 1 JRNL
REVDAT 2 02-MAY-12 4DXH 1 TITLE
REVDAT 1 11-APR-12 4DXH 0

What I want to do is GREP out the title, author, compound, realease date (HEADER), and the source. As you can see the SOURCE for example is on multiple lines, what I want to do is create a table listing the categories mentioned above to generate a table with columns telling me the information. I cannot figure out how to group all the SOURCE (and any other category with multiple lines) into one line....Er... use awk.

1127.

Solve : Programming with python?

Answer»

Hi I am STUDING python programming language does anyone KNOW of a WEBSITE that will explain python language in simple terms ?The official python tutorial is a good place to start. Keep in MIND that 'simple' can become 'complicated' pretty quickly with programming languages.

1128.

Solve : [Help] String/plain text to byte array?

Answer»

Im trying to convert a STRING/plain text from a textbox to a byte array.

For example:
byte[] BYTES = new byte[] {0x00, 0x00, 0x00};

I want to do
byte[] Bytes = new byte[] {Textbox.Text};
And what I will put in the textbox will be 0x00 0x00 0x00You should probably specify the language you're using, but I'm going to assume that's C# and that you're using Visual Studio. I also don't fully UNDERSTAND what you're trying to do, but I'm pretty sure you want to get a byte array that CONTAINS the ASCII values of characters in a text box.

Code: [Select]using Microsoft.VisualBasic;
char[] Characters = Textbox.Text.ToCharArray();
byte[] Bytes = new byte[Characters.Length - 1];
for (int i = 0; i < Characters.Length; i++) {
byte[i] = String.Asc(Characters[i]);
}Code: [Select]byte[] results = (from p in str.ToCharArray() select (byte)p).ToArray();

It looks like DaftHacker WANTS to go a bit further and actually have the textbox contain the Hex codes of each byte. Not a problem:

Code: [Select] String[] results = (from p in TextBox1.Text.ToCharArray() select String.Format("0x{0:X2}",(byte)p)).ToArray();
TextBox1.Text = String.Join(" ", results);

1129.

Solve : Best way to achieve this??

Answer»

So every week I have a schedule of employees. Every week I have to manually assign employees to machines and print out a projection of the weeks machine coverage as well as use this as a checklist when manually assigning work to employees on worksheets. This has up until now been a very manual process involving dumb excel spreadsheets requiring redundant data entry and using a web interface to assign and print daily employee worksheets.

I took on this job recently as supervisor of maintenance for USPS and want to correct for the inefficiency of the process. One area that will make a big impact is being able to create the employee work schedule and then have that spit out this machine coverage projection which gets populated on Sheet 2 based on information on Sheet 1.

Biggest handicap is that this has to be done in Excel since no custom programming can be done and brought in on a thumb drive etc. I can think of so many better ways to achieve this WITHOUT Excel importing a .csv and spitting it out etc.

I am operating as a 'user' and have to work within the limited permissions. I know that Excel can be a solution to this, but I feel that my approach to this might make for an unnecessarily large list of logic rules of for example creating a bunch of IF statements that test to see who is working and what hours and then populate Sheet 2 with the best predetermined match up. To do this I have to account for EVERY Combination of employee coverage of 16 employees on 3 shifts.

In something other than Excel I would assign weights to the list of qualifications to have a program place the best suited employee as a match up per equipment that needs servicing, and process through in an order that loops through PLACEMENT until all machines and employees are accounted for placement of, but not sure if that can be done in Excel or if I have to account for All Combinations to make the 'IF' logic work?

Is there a way to avoid having to create a list of every combination in Excel and achieve this? I'd hate to create every combination of staffing with preselected staffing to machinery if there is an easier way such as using a weights like feature or something else.

Open to all suggestions.
Excel has VBA macros. Can you use those?Hmm ... NEVER played with VBA macros before but if thats the best direction to go I should dive into it if its going to make this far easier than creating every combination of scheduling to create every output desired.

Is there a simple way to test if VBA macros would work? Such as a "Hello World"

If so I'll give it a try.Quote from: DaveLembke on September 06, 2012, 12:50:44 PM

Hmm ... Never played with VBA macros before but if thats the best direction to go I should dive into it if its going to make this far easier than creating every combination of scheduling to create every output desired.

Is there a simple way to test if VBA macros would work? Such as a "Hello World"

If so I'll give it a try.

I'm not 100% sure how you'd go about it, but it should be better than the alternative.

Alt-F11 opens it. You can add a new module and create a Public Sub (eg. "Public Sub AssignWorkers()") then use VBA code to work with the ActiveSheet, add items to cells, etc. Then you would run the macro by that name in the Macros dialog.


When I first started reading your post it sounded like a program I wrote for a freelance client a few months ago was exactly what you needed, but when I read the details it doesn't seem like it. I thought I'd mention it here anyway; It's designed to manage the time spent by employees on "Orders" (in my client's case, this was automotive repair, but it would work just as well for PC repair and stuff too); Employees clock into orders (repair orders, that is), do the work, and then clock out. This is useful for both payroll as well as for- (where applicable) charging for the labour cost of the repair. Not relevant to this particular problem but seems tangentially related and I've not done anything with the program in ages so thought I'd throw that out there too.Yah the cooperative food store chain that I use to be head of IT for had a service center and I supported their NapaTracks and Mitchel Ondemand ( web based subscription service for technical INFO ). NapaTracks allowed for customer database with tracking tech times etc, and inventory control. I also had to support their NHOST http://www.nhinspect.com/whatToExpect.html although the state contractor who had 1 to 2 day ETA on repair of this system didnt like when I got involved and fixed the problems on a kiosked OS which i hacked once to add printer drivers for a HP printer vs the Canon that failed. When you have a list of cars needing inspection and a printer fails and inspection could not be performed without printing documentation if your a crafty IT individual like myself you come up with a quick solution to make something work. I was able to hack in with a custom AUTORUN CD that triggered control.exe to bring up control panel which gave me access to installing the printer driver. The kiosk was made with stripped down interface profile, but fortunately it appeared that they left it as admin privileges vs user so I was able to install the drivers with no problems

Will give VBA macro a try tomorrow when i am getting paid for my time working on this As for now time to relax and game
1130.

Solve : VB.Net - How to GET file name without opening it using OpenFileDialog??

Answer»

I try to get a file name using OpenFileDialog

The PROBLEM is : I cannot get the file name i want because the file that I want to get its name have no permission to open/read.
(I can get the name of the other file that have read/open permission)

So, in order to get the file name that have no open/read permission, Is there a way to get the name without opening the file.
OR
Is there any other METHOD?

I will be very glad if you can help me..Does something like this not work:

Code: [Select]Dim ofd As New OpenFileDialog()
Dim AcquiredFile As String
ofd.Filter = "Text FILES (*.txt)|*.txt|All Files (*.*)|*.*"
If ofd.ShowDialog(Me) = DialogResult.OK Then
AcquiredFile = ofd.FileName
End If

Also what happens when you select a file that you have no permission for in the Dialog?Here is my problem:
when i try to open the file that i don't have a permission to open/read it, it gives an error saying that i don't have a permission to open the file. If i can get that file name it will be enough...



I attach the screenshot of my error message

[recovering disk space, attachment deleted by admin]hmm, interesting. I wonder if maybe you could use a Save File Dialog instead?

Otherwise the only thing I can think of might require you to actually use the low-level GetOpenFileName() function.Not easy at all....

[recovering disk space, attachment deleted by admin]I could not do it using save file dialog, If there is GetNameDialog it would be very easy

I try many times, different ways but still.... I can't do it..

I also try the following code:

Dim ff As OpenFileDialog = New OpenFileDialog()
Dim strFileName As String

ff.Filter = "All files (*.*)|*.*|All files (*.*)|*.*"

If ff.ShowDialog() = DialogResult.Cancel Then
strFileName = ff.FileName
MsgBox(strFileName) ' Here it does not return anything if i USED DialogResult.Cancel
End If



I give-up on this one


Why is not possible to get the filename without opening the file ?
"That's the Question" If you are targeting Vista or Later, you can use the Windows API Code pack. The "CommonFileDialog" seems to work:

Code: [Select]Dim cofd As New CommonOpenFileDialog
Dim AcquiredFileName As String
If cofd.ShowDialog = CommonFileDialogResult.Ok Then
AcquiredFileName = cofd.FileName
End If

I was able to reproduce the original issue by changing some perms on a file. I have set global deny permissions on the file but this now works (with the API code pack) to get the filename.

It's worth noting that the the OpenFileDialog a SaveFileDialog do not open or save EITHER. They just don't allow the selection of items for which the user has no permissions to perform any action on, because the assumption is that the application is going to do something with the file. how do i make use of the run command

1131.

Solve : [Question] How do I send a packet using visual studio?

Answer»

So I am making a program using Visual Basic also known as Visual Studio now. My question is how do I send a PACKET from my program to a game. An example of one packet I would like to send is this. QUOTE

%xt%zm%tryQuestComplete%122869%2171%-1%false%wvz%
That packet I want to send by just the click of a button. The program is simple really since the game is a flash. Can you give me any HELP on finding the game's SERVER and how to send a packet to it. Some help would be greatly appreciated. No. Neither I or anyone else can know the address since you didn't give it to us.

If your program is so simple (since the the game is developed in flash?? huh) why can't you consult the API?

If you are trying to cheat, at least do the things required yourself.In Visual Studio one uses MS Silver light to work with video presentations.
However, there is material from Adobe for doing C# INTERFACING with Flash.

Hoverer, sending packet to a server may be much more than you anticipate. Without more specific information, it is hard to answer your question.

1132.

Solve : [Help] C# delete file unauthorized access exception?

Answer»

Im trying to make an updater for my application but I keep getting exceptions when trying to delete the file or download the new file.

unauthorized access exception for file delete or webclient error for downloading new file. Ive tried setting the program to run as admin, the program that needs deleting is all normal, nothing set to read only or anything else that would make the update throw an exception. The file set to update is another app made in c#

This is what is suppose to happen:

Login System - prompt to update
Login System - download updater
Login System - exit or have update program exit
Updater - make SURE all processes with name: Login System are not running
Updater - Delete Login System - Error - File access exception
Updater - Download LATEST version - Sometimes error usually if the file doesn't delete
Updater - start Login System
Updater - Exit
Login System - CHECK for updater.exe and delete on startup


Code: [Select]using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Diagnostics;

namespace Update
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

//Set program name and program download.
string ProgramName = "Login System.exe";
string DownloadLocation = "";

WebClient WC = new WebClient();

private void Form1_Load(object sender, EventArgs e)
{
//Check if the program is in the same folder as the update
if (File.Exists(ProgramName))
{

//Try to stop all running processes
Process[] RunningProcess = Process.GetProcessesByName(ProgramName.Replace(".exe", ""));
foreach (Process CurrentProcess in RunningProcess)
{
if (!CurrentProcess.HasExited)
{
try
{
CurrentProcess.CloseMainWindow();
CurrentProcess.Close();
CurrentProcess.Kill();
}
catch { }
}
}
}
else
{
MessageBox.Show("Unable to Access: " + ProgramName, "Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}

//Delete old program
try
{
if (File.Exists(ProgramName))
{
File.Delete(ProgramName);
}
}
catch (Exception EX)
{
MessageBox.Show("Delete File " + EX.Message, "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}

//Download new updated program
try
{
WC.DownloadFile(DownloadLocation, ProgramName);
}
catch (Exception EX)
{
MessageBox.Show("Download file " + EX.Message, "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}

//Start program
try
{
if (File.Exists(ProgramName))
{
Process.Start(ProgramName);
}
}
catch (Exception EX)
{
MessageBox.Show(EX.Message, "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}

//Close Updater
this.Close();
}
}
}
You aren't passing a URI to the DownloadFile method, it's an empty string.

Quote from: BC_Programmer on July 07, 2013, 01:58:01 AM

You aren't passing a URI to the DownloadFile method, it's an empty string.
Yeah I know, I removed my DROPBOX link. It just points to a direct download of my application.Two things:

Process.CloseMainWindow and Process.Kill is asynchronous. You would need to call .WaitForExit() if you don't want your code flow to proceed until the Application actually exits.

However, Close() is for closing the handles itself; after the Close() call the Process instance is no longer valid, since the resources used locally for handling process information were cleaned up, so the Kill() call doesn't do anything.

You probably shouldn't be using Kill anyway. CloseMainWindow() and then wait for it to exit should work.

Quote from: BC_Programmer on July 07, 2013, 12:14:57 PM
Two things:

Process.CloseMainWindow and Process.Kill is asynchronous. You would need to call .WaitForExit() if you don't want your code flow to proceed until the Application actually exits.

However, Close() is for closing the handles itself; after the Close() call the Process instance is no longer valid, since the resources used locally for handling process information were cleaned up, so the Kill() call doesn't do anything.

You probably shouldn't be using Kill anyway. CloseMainWindow() and then wait for it to exit should work.
I finally had the time to fix this, thanks.
1133.

Solve : Building an efficent sql text search method.?

Answer»

I have a table with about 15000 records.

And it looks like this:
Code: [Select]# Column Type
1 Model int(11)
2 Name varchar(64)
3 Comment varchar(64)
4 CATEGORY varchar(64)
5 MTA varchar(64)
6 IDE varchar(64)
The first column is indexed as unique.

I need an efficient method of searching using the user input from e.g. a php textbox in "columnX" where "ocweeg" would actually match "procweegrs".

Also the number of records that match needs some limits, e.g:
Quote

* Results Page 1: "LIMIT 0, 30"
* Results Page 2: "LIMIT 20, 30"
* Results Page 3: "LIMIT 40, 30"
And so on...


So what would be a proper and efficient way to do this?Quote
I need an efficient method of searching using the user input from e.g. a php textbox in "columnX" where "ocweeg" would actually match "procweegrs"

You can use the LIKE CLAUSE and wildcards. This might help.

Quote
Also the number of records that match needs some limits

The LIMIT clause is vendor specific and not a standard SQL clause. What database are you using?

Quote from: Sidewinder on August 24, 2012, 02:50:48 PM
You can use the LIKE clause and wildcards. This might help.

The LIMIT clause is vendor specific and not a standard SQL clause. What database are you using?



I'm using InnoDB. And i will take a look at that tomorrowAfter some trial and error i came up with something that should have worked;

Code: [Select]SELECT *
FROM `objects`
WHERE 'Model' LIKE '%plant%'
OR 'Name' LIKE '%plant%'
OR 'Comment' LIKE '%plant%'
OR 'Category' LIKE '%plant%'
OR 'MTA' LIKE '%plant%'
OR 'IDE' LIKE '%plant%'
LIMIT 0 , 21
Unfortunately i get this response:
Quote
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0004 sec )
APPARENTLY the message indicates the SQL is fine, you simply did not select any records. Have you tried limiting the scope of the SQL? Something like this:

Code: [Select]SELECT *
FROM `objects`
WHERE 'Model' LIKE '%plant%'
LIMIT 0 , 21

Showing us some of the OBJECTS table might also help. Question: why the back ticks wrapping the table name?



Sorry Sidewinder, but it all works now

This is the new syntax:

Code: [Select]SELECT *
FROM objects
WHERE Model LIKE '%plant%'
OR Name LIKE '%plant%'
OR Comment LIKE '%plant%'
OR Category LIKE '%plant%'
OR MTA LIKE '%plant%'
OR IDE LIKE '%plant%'
LIMIT 0 , 21
I don't know why but apparently MySQL did not like that i encased field names or the table name.
1134.

Solve : Finding the cell of a column which is located in a row defined by two values?

Answer»

This a typical sample:

A B C

4 1 10
4 2 22
3 1 25
4 5 30
AND is 2 in column b


Thank for your help
Clean is not said you what.
OR,
Please say it another way.
2 is located at B2 if copy pasted just the data into excel. B is the Row Location and 2 is the Line Location. So @sum(B2+B3) would show 3 in whichever cell the formula is located in and @sum(C1:C4) would show 87 in whichever cell it is located in. ( : ) is used to select a RANGE of data to sum up without having to say @sum(C1+C2+C3+C4)

2 is in fact in column B to answer your question.

* Easier way to REPRESENT your data would be to show the Line and Column indicators as shown below:

A B C D E
1 4 1 10
2 4 2 22
3 3 1 25
4 4 5 30
5
6
7

*I learned how to do all this on Lotus-123 many many years ago, and continued to use Lotus @sum instructions with Excel in which Excel will understand it and flip it to =sum. You can use EITHER as long as its interpreted in future releases of Excel etc. Even Open Office understands @sum to be =sum. It's probably more correct to use =sum, however by habbit I am quick with using @sum even though it REQUIRES extra shift-hold +2 to type the @ sign.DaveLembke, how did nyou do that?
I mean, how did you know what he wanted?

1135.

Solve : PHP -Contact Form error?

Answer»

I need help on "CONTACT Form", when I click submit, I am prompted to download the form, instead of SENDING it, what could be causing this error?
The Html code is:

Contact Form






* Name





* Email







Subject







* Your message



* Are you human?



   3 + 1 =












The PHP code is:

if(!$_POST) exit;

// Email address verification, do not edit.
function isEmail($email) {
return(preg_match("/^[-_.[:alnum:]][emailprotected]((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)
+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo
|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm
|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs
|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|
kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu
|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk
|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su
|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi
|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}
([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email));
}

if (!defined("PHP_EOL")) define("PHP_EOL", "\r\n");

$name = $_POST['name'];
$email = $_POST['email'];

$subject = $_POST['subject'];
$comments = $_POST['comments'];
$verify = $_POST['verify'];

if(trim($name) == '') {
echo 'Please enter your name.';
exit();
} else if(trim($email) == '') {
echo ' Please enter a valid email address.';
exit();
} else if(!isEmail($email)) {
echo ' You have enter an invalid e-mail address, please try again.';
exit();
}

if(trim($comments) == '') {
echo ' Please enter your message.';
exit();
} else if(!isset($verify) || trim($verify) == '') {
echo ' Please enter the verification number.';
exit();
} else if(trim($verify) != '4') {
echo 'The verification number you entered is incorrect. Please enter it again';
exit();
}

if(get_magic_quotes_gpc()) {
$comments = stripslashes($comments);
}



$address = "[emailprotected]";




$e_subject = 'You\'ve been contacted by ' . $name . '.';




$e_body = "You have been contacted by $name with regards to $subject, their additional message is as follows." . PHP_EOL . PHP_EOL;
$e_content = "\"$comments\"" . PHP_EOL . PHP_EOL;
$e_reply = "You can contact $name VIA email, or $email";

$msg = wordwrap( $e_body . $e_content . $e_reply, 70 );

$headers = "From: $email" . PHP_EOL;
$headers .= "Reply-To: $email" . PHP_EOL;
$headers .= "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL;
$headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL;

if(mail($address, $e_subject, $msg, $headers)) {

// Email has sent successfully, echo a success page.

echo "";
echo "";
echo "Email Sent Successfully.";
echo "

Thank you $name, your message has been submitted to us.

";
echo "";
echo "";
echo "";

} else {

echo 'ERROR!';

}
1136.

Solve : PLS HELP ON THIS!?

Answer»

I just bought an HP PAVILION G4-1318DX NOTEBOOK WITH D FOLLOWING SPECS,....2GB RAM,320GB HARD DISK,2.1GHz,INTEL PENTIUM WINDOWS 7 ETC,..AM A FIRST YEAR STUDENT IN D UNIVERSITY STUDYING COMPUTER ENGINEERING AND WE HAVE STARTED PROGRAMMING,PLS I WANT TO KNOW IF I CAN USE D NOTEBOOK FOR PROGRAMMING.,I ALREADY FEEL AS IF AV WASTED MONEY,..,PLS CAN I USE IT 4 PROGRAMMING?TANX 4 UR RESPONSES IN ADVANCEDepends on the programming tools you need to use, but you should probably be fine as long as you don't RUN too much other things at once. If I didn't have the 4GB of RAM that I have, I'd probably be closing Spotify, SugarSync, Skype, and similar memory HOGGING applications while I programmed. VS2010 USES upwards of 200MB of RAM, NetBeans sometimes even more.tanx so much

1137.

Solve : Looking for best method - Disable/Enable internet with C++?

Answer»

So its summer and my daughter wants to use her computer a lot, but I dont want her brain turning to mush.

She forgot a good portion of her multiplication tables and so I wrote up a quick C++ program that randomizes with a seed for 0 thru 12 for 2 places and asks for her to solve the problems any combination of 0x0 thru 12x12. In the program I have two counters that show how many correct and incorrect, and I am going to also add to the source to write to text file the ones that she gets wrong so that I know which ones to work with her on remembering.

So after I created this last night I was thinking, I should add this multiply12.exe program to the startup of her Windows XP computer and have her have to get 30 answers correct before she can surf the web.

Now there are a number of ways to go about disabling/enabling internet, however I was curious as to which method is best with C++ and Windows XP Pro SP3 OS.

Her computer is a Pentium 4 3Ghz with 1GB RAM and GeForce 6200 8X AGP video card with 256MB RAM and 40GB IDE HDD with single DVD-Rom, and Linksys USB Wireless G NIC, and the beige tower has been painted hot pink and is loaded with hello kittie stickers all over it which was her favorite theme 2 years ago when I gave it to her at age 6.

Methods I was considering were:

#1 - Swapping HOSTS file so that when the system boots it is on a HOSTS file that redirects everything to 127.0.0.1 , but then when she answers 30 problems correctly, the HOSTS file is swapped back with one that allows her to go out onto the web to PBSkids, Nick.com etc.

#2 - Disabling the Linksys USB WIFI adapter until 30 problems are answered correctly, and then enable the USB WIFI adapter.

# 3 - Changing the Gateway to something other than the gateway so it never gets outbound until 30 are answered correctly and then switch the gateway back to the correct gateway IP so that she can go outbound.

# 4 - Set a Service to Manual in computer config with it always booting to Disabled and when 30 are answered correctly issue a NET START servicename via system(" "); instruction within C++.

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

Concerns with these listed:

Method #1 - Windows Security will likely protect the HOSTS file from being swapped by a C++ program instruction.

Method #2 - Have never enabled/disabled USB devices via command line. I am sure it should be able to be done, but would need someone to show me how.

Method #3 - While changing IP addresses are easy within the windows GUI, I have never done this from command line, and would need INFO on how to do this.

Method #4 - This is probably the easiest method, but would require passing a NET START servicename via system(" "); instruction within C++ to run the command to enable the service. *Havent decided yet which service is best to enable/disable, but was thinking maybe the Linksys Service that is associate with the USB wifi adapter possibly which would be the same as method#2, however maybe there is a better service to have set to disable at boot and enable via the C++ program to allow internet access. The system(" "); method while it works, I have been told is a poor method to be used to pass commands out to command prompt, and maybe there is a better way that I am unaware of.

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

Open for suggestions on other methods or examples of ways to go about doing this?

The good thing is that my daughter hasnt complained yet. I just want her to exercise her brain before she surfs web and earn the internet access daily by going through this process. Later on I was thinking of building on from this as her skills in school become more complex etc.

*** The only thing though is at some point she might get sneaky and just use the calculator built into windows or one in a desk drawer, but until she figures that out, I plan on using this reward system in which she solves the problems and is rewarded with computer internet access.

Have also considered adding a timer that limited the time she had on the computer, but thats a whole different project, and I have considered just putting a router on a electric timer that is commonly used for turing lamps on/off when not home etc to enable wifi for SAY just 2 hours a day for her computer between 6pm and 8pm for example etc.

I have been programming using Bloodshed C++ IDE for console programming, but also have the 2010 and 2012 express for visual C++. With console programming being far faster than nice looking windows programming, I GENERALLY go the path of least resistance with console programming for projects like this. I also have Visual C++ 6.0 if I need to use features that are missing from Bloodshed C++ as well as the Express editions of C++. Personally I haven't had to use VC++6 in a long time.Check documentation for your router. It should have some way to disable a user for a short time. It then becomes just a script your send to the router. Np need for a compiled program. Unless you just want to. Thanks for input on this Geek-9pm ... I will have to check into the router I have that is wireless to see if it has a feature to do this. All I know is that its a DLink N150 that I bought about 2 years ago for around $20 through a CLOSEOUT deal at newegg. I set it up secure, but haven't checked into the advanced features portion that might have this ability.

1138.

Solve : vbs to play mp3?

Answer»

So I was writing a vbscript to run from command line and take the input and PLAY the corresponding mp3 file. I used some code I found online and tested it, and it worked perfect for running a set file, but when I tried to replace that part with a string, it doesn't do anything. Can anyone point out what's wrong? Thanks in ADVANCE!

Code: [Select]dim mp3
dim mp3name
mp3name = WScript.Arguments.Item(0)
mp3 = Chr(34) & WScript.Arguments.Item(0) & ".mp3" & Chr(34)
CreateObject("WScript.Shell").Run "wmplayer " & Chr(34) & mp3 & Chr(34), 0
WScript.echo("Playing " + mp3name + ".mp3 - " + mp3)
It might be easier to pass the quotes on the command line instead of trying to resolve them in the script:

Code: [Select]Set wmp = CreateObject("WMPlayer.ocx")

wmp.URL = WScript.Arguments.Item(0)
wmp.openPlayer(wmp.URL)

You will probably have to fix-up the paths to the songs.

Run example: cscript scriptname.vbs "n:\multimedia\audio\sting-all this time.mp3"

An alternative would be to use a batch file:

Code: [Select]
@echo off
setlocal

"C:\Program Files\Windows Media Player\wmplayer.exe" "%*"

You will probably have to fix-up the paths to the wmplayer and the songs.

Run example: scriptname.bat n:\multimedia\audio\sting-all this time.mp3Thanks a lot! Although I didn't use all of your code, it got me on the right track. (semi-)finshed code below.

Code: [Select]mp3name = WScript.Arguments.Item(0)

set wmp = CreateObject("WMPlayer.ocx")

wmp.URL = WScript.Arguments.Item(1)

CreateObject("WScript.Shell").Run "wmplayer " & mp3 ,0

WScript.echo("Now playing " + mp3name + ".")

sample Input: mp3 "Question of Fate" "C:\...pathway...\Question of Fate.mp3"

Quick question, is there a way to run the sound without opening a window?
i've tried it, but it doesn't seem to do anything without WScript.echo in it.Ok, not so much solved as worked around. I put a WScritp.sleep after I open the file and set it to WScript.Arguments.Item(1) so I have to enter the length as well, but now I have no annoying window.

Code: [Select]'Syntax: mp3v2 "<Name of File>" <time in sec>00
'Example Input: mp3v2 "Question of Fate.mp3" 184000

set wmp = CreateObject("WMPlayer.ocx")
wmp.URL = WScript.Arguments.Item(0)
dim time
time= WScript.Arguments.Item(1)


CreateObject("WScript.Shell").Run "wmplayer " & mp3 ,0
Wscript.sleep(time)
I'm not sure what is GOING on here. Part of your code is scripting the WMP object and then the switch to the run method. Also the mp3 variable is undefined and time is a reserved word.

This is for your CONSIDERATION. Before you panic at the sight of the code, WMP runs asynchronous to the script so most of the script is spent calculating how much time to wait for the song to play.

Code: [Select]Set fso = CreateObject("Scripting.FileSystemObject")
Set wmp = CreateObject("WMPlayer.ocx")
Set objShell = CreateObject("Shell.Application")
Set WshShell = CreateObject("WScript.Shell")

' Prompt for song
'
Do
WScript.StdOut.Write("Enter Song Name: ")
strSong = WScript.StdIn.ReadLine
Loop Until fso.FileExists(strSong)

' Calculate song length (milliseconds)
'
Set f = fso.GetFile(strSong)
folder = f.ParentFolder
file = f.Name

Set shellFolder = objShell.NameSpace(folder)
Set shellFile = shellFolder.ParseName(file)

duration = Split(shellfolder.GetDetailsOf(shellfile, 27), ":")
sleeptime = ((duration(1)*60) + duration(2)) * 1000

' Play the song
'
wmp.openPlayer(strSong)
WScript.Sleep sleeptime

' Shutdown the player
'
WshShell.AppActivate("Windows Media Player")
WshShell.SendKeys "%{F4}"

The user is prompted for the song name. A fully qualified path is required; do not use quotes. Win7 does not seem to have a shortcut key to minimize a window. For XP you can add the following code after the wmp.openPlayer line:

Code: [Select]WScript.Sleep 2000
WshShell.AppActivate("Windows Media Player")
WshShell.SendKeys "% n"

If nothing else, this may give you some ideas. Quote from: Sidewinder on August 26, 2012, 08:18:34 AM

Also the mp3 variable is undefined and time is a reserved word.

Time isn't a reserved word in VBScript. It's a reserved word in Visual Basic.

That said, their script still doesn't make SENSE. First it starts using OLE Automation and then it uses shell. it uses a variable that has no value (mp3), too (as you noted)

Either way, absolutely none of the provided ProgIDs works for me :/ They all throw a "ActiveX Component cannot create Object" Error in both VBScript as well as in VB6.
1139.

Solve : Script for adding a printer?

Answer»

Hey i need a pro to help me program a script that will run and add a printer to out network

I work for a university and i in charge of imaging the computers in the labs, so having a script that will auto install for us would be amazing

This is what it needs to do

Go to Start --> Printers and Devices --> Add Printer.

Select Add a local printer

Create a new port > type of port: local port

Now assuming the print station name is CORRECT Changing Printstation NAMES. Then for the port name type in: \\yourlabvp\vpinput (Ex. \\comstockvp\vpinput) --> OK.

Select the printer driver under Manufacturer: HP, Printer: HP LaserJet 4250 PCL6

Name the printer something like "YOURLABNAME printer"


So it looks like

Install
- local port
- port name "blah blah i can add that"
- HP printer
- name the printer "blah"
Your imaging .... have you ever played with RIS or WDS?

An ability to create a image template of how builds are to be and push these to machines through MS Server 2003 or 2008 over PXE Boot? This can be used to roll out preconfigurations such as printers, mapped drives, and more.

Server 2003 has RIS while Server 2008 RIS was changed to WDS

I used this at the last job I had with over 300 workstations instead of Ghost. Only catch to using RIS is that you have to activate Windows Keys each TIME, but this is a good thing to avoid using say a Ghost image on like machines all running an ACTIVATION prior to image on like hardware that doesnt break and your then in questionable hot water for duplicate BOXES etc running the same keys.

Also while ghost or another imaging software is nice that you can push an image from say a DVD or 2 to build the systems, RIS and WDS works over the network so some consideration has to be made whether its the tool for you or not as for if you only have one network, you will be a bandwidth hog while its imaging which can impact users on the network. I ran a seperate network to avoid being a hog and impacting users with RIS.

1140.

Solve : Net Objects Fusion PDF question?

Answer»

I am using Net OBJECTS FUSION and I wish to know of a way to have a PDF VIEWABLE, but not downloadable?

HELP!!

1141.

Solve : Favorite programming language??

Answer»

MFC C++Pythonc++ and xml (although xml is not technically a programming language, before anyone else points it out!)C++ Definitely. Better for hardcore low level programming The topic is:
Quote

Favorite programming language?
One could have a favorite without finding what is better. There is always better and the is always favorite. Bit they may not be the same.

For myself, ushering C++ for low-level programming would e the worst thing ever for me personally. I was a seasoned commercial assembly language programmer and would find the structure of C++ to be stifling.

But if C++ goes on to become the favorite and the best, it will not be because of any work I ever did.

Intel at one time, long, long AGO, had a PL/M compiler. Now Intel favors C++ for its current products. The PL/M was rather good, but it lost popularity for reasons that are hard to understand.This could lead one to the idea that someday C++ will be considered just too old-fashioned for the new machines yet to appear.

If I live forever I will become one of the few who remember what assembly language is was. Assembly is still the only true low-level language. C++ is hardly low-level; when companies write a game in C++, they use OpenGL and DIRECTX and Boost and who knows what other libraries. They don't write their own 3-D rendering code that directly programs VGA registers to switch to the undocumented higher resolution 256 color modes, and they certainly don't directly program video card registers for the myriad of available architectures.

With DOS, this was the standard- that is, it was more low level. if you wanted to deal with video, you grabbed a book like Michael Abrash's "Graphics Programming Black book" and learned how to directly program the VGA registers and got to understand how the four bit planes were used. Back then even drawing a Line would require you learn a rather sophisticated algorithm (Bresenham was the standard).

The change was more because of the switch over to protected mode Operating Systems, and with the increasing networking, it just didn't make sense to trust a program to deal with absolutely every detail of the system. Besides, it got pretty silly, what with all the different programs needing their own special drivers for different graphics cards.

Now you essentially say "hey, OS, draw a line from here to here, and use this pen information" and the OS delegates that to the driver, which does it. THe driver is low level- they are usually programmed in Assembly or at least C, and they implement things like the Bresenham algorithm with line-balancing as well as a myriad of other things.

A C++ program draws a circle with OpenGL something like this:
Code: [Select]void Circle( Float x, Float y, Float r)
{
glBegin( GL_TRIANGLE_FAN );
glVertex2f( x, y );
for( Float i = 0; i <= 2 * PI + 0.1; i += 0.1 )
{
glVertex2f( x + sin( i ) * r, y + COS( i ) * r );
}
glEnd();
}

The equivalent code in Java:

Code: [Select]void Circle( Float x, Float y, Float r)
{
int NUM_ITERATIONS=64;
GL11.glPushMatrix();
GL11.glTranslatef(x, y, 0);
GL11.glScalef(radius, radius, 1);

GL11.glBegin(GL11.GL_TRIANGLE_FAN);
GL11.glVertex2f(0, 0);
for(int i = 0; i <= NUM_ITERATIONS; i++){
double angle = Math.PI * 2 * i / NUM_ITERATIONS;
GL11.glVertex2f((float)Math.cos(angle), (float)Math.sin(angle));
}
GL11.glEnd();

GL11.glPopMatrix();
}

The C++ version doesn't look any "lower level" to me! Now, on the other hand, if you want to draw a line in Assembly by programming a VGA directly, that's nearly 10 pages of Assembly code. THAT is low-level; setting resetting bit mask registers, setting up pixel masks with in-byte pixel addresses, all that fun stuff.

Low-level programming is now pretty much confined to embedded systems where, like the 8088, 286, 386, and other early CPUs, optimization made huge impacts on performance. Today, with multiple cores, and all sorts of different instructions, multiple instruction pipes that have rules about what instructions can go in them, as well as a myriad other issues and gotcha's related to instruction branching and pre-fetching, optimization to the level of assembly is no longer something that is a SANE practice on modern desktop machines; compilers can produce far better code, or, to be more precise, the amount of time it would take an expert assembly programmer to do better than the compiler is no longer cost effective. Back in the day it might take 2-3 times longer to re-implement a complex algorithm in assembly and then work to eliminate as many jumps and cycle eaters as possible, but the gain would often make the result at least twice as fast. Of course even then the most important thing was to use the right algorithm first; trying to squeeze speed out of bubble-sort using assembly would be pretty stupid. On any modern machine (P2 or newer) I've yet to notice any appreciable difference in speed based on what language a program is written in.

Embedded systems, on the other hand, which don't have a bajillion megabytes of memory or display adapters that can push out 5 trillion triangles a second or whatever is the norm on desktops today, can and benefit from that sort of tweaking. But they don't get quite as much benefit from C++, unless you take a lot of precautions such not using new/delete, avoiding exceptions, avoiding virtual classes with inheritance (and maybe inheritance altogether) be very careful with templates (or ideally don't use them at all as they bloat the code size, which is pretty important when we're talking about 8K of RAM), etc. with Embedded systems, cycle eaters and knowing exactly what is going to run- which means knowing exactly what will be emitted for any given higher level language is critical. C is pretty easy to "mind translate" into assembly for a learned C programmer; C++ not so much.


Thanks for the replay. You can understand why I am not eager to spend a lot of time on C++. When In need something above assembly, I can do it in C or a similar language.
One option I have used is a Macro Assembler. The Macro assembler lets you have external files, macros and libraries and can even hide adjustments that haven to be made to the code.

One programmer had a HABIT of putting macros in many different source files and making them public to other files. When he left, two of use worked over his code and put all the macros into one file; We called is ''BigMac'.
Having huge macro definitions does not blot the output code.

You might have a macro for a circle with center point x-y, diameter, thickness and optional color.

The invocation might be:
circle 24. 385, small , fine, blue
(first two numbers are the absolute co-ordinates.)
and it would call a procedure that would do all that, but the print out of the program list would hide it from you.
But you had to first create the macro yourself. Once you had it in a file, other programmers could use it. Programmers in a project would have to make a in-house handbook of what macros definitions are available.

But, as you say, now there is so much more to worry about. With networking, you have to have permissions all that stuff.

Yes, embedded systems are taking over. I once make a joke about my household garbage can having two IP addresses. Maybe it will someday not be an joke.
I have used other languages including C++, Java and various dialects of BASIC, but the fact is that C is the best programming language of all time.Quote from: JohnChapman on July 12, 2012, 07:56:36 AM
I have used other languages including C++, Java and various dialects of BASIC, but the fact is that C is the best programming language of all time.
ALL Time? No, it is not.
There was a time C was not available for a PC. And when it did become available, it was terrible.
I was writing communications programs for PCs back in the late 80s. Then C was no help and was overpriced and under performing. I wrote routines in assembler. Of course my earlier training was in assembler and PL/M.

C++
1142.

Solve : php help?

Answer»

$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$gender = $_POST["gender"];
$food = $_POST["food"];
$QUOTE = $_POST["quote"];
$education = $_POST["education"];
$TofD = $_POST["TofD"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>


Personal INFO



First Name:

Last Name:

Gender:

Male:

Female:

PLEASE choose type of residence:

Steak:

Pizza:

Chicken:

Enter your favorite quote!

Select a Level of Education:


Jr.High
HighSchool
College

Select your favorite time of day:


Morning
Day
Night



} else {
echo "Hello, ".$Fname." ".$Lname.".
";
echo "You are ".$gender.", and you like ";
foreach ($food as $f) {
echo $f."
";
}
echo "".$quote."
";
echo "You're favorite time is ".$TofD.", and you PASSED ".$education."!
";
}
?>




...I'm a beginner in php programming, this is the 1st sample that I copied from http://www.tizag.com/phpT/examples/formfinale.php
but when I try to see the outputt using XAMPP. there is an error and i can't figure it out what is missing? thanks in advanceWhat error are you getting from XAMPP, that would be helpful to know!Parse error: syntax error, unexpected end of file in the LINE 49added php before else...
now the error is
undefined index on line 2 to 8

here's the code

$Fname = trim ($_POST["Fname"]);
$Lname = trim ($_POST["Lname"]);
$gender = trim ($_POST["gender"]);
$food = trim ($_POST["food"]);
$quote = trim ($_POST["quote"]);
$education = trim ($_POST["education"]);
$TofD = trim ($_POST["TofD"]);
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
?>


Personal INFO



First Name:

Last Name:

Gender:

Male:

Female:

Please choose type of residence:

Steak:

Pizza:

Chicken:

Enter your favorite quote!

Select a Level of Education:


Jr.High
HighSchool
College

Select your favorite time of day:


Morning
Day
Night



added php
} else
{
echo "Hello, ".$Fname." ".$Lname.".
";
echo "You are ".$gender.", and you like ";
foreach ($food as $f) {
echo $f."
";
}
echo "".$quote."
";
echo "You're favorite time is ".$TofD.", and you passed ".$education."!
";
}
?>Your issue is that you are trying to access elements of the $_POST array when the form hasn't been submitted. You need to move the first block of lines:
Code: [Select]$Fname = trim ($_POST["Fname"]);
$Lname = trim ($_POST["Lname"]);
$gender = trim ($_POST["gender"]);
$food = trim ($_POST["food"]);
$quote = trim ($_POST["quote"]);
$education = trim ($_POST["education"]);
$TofD = trim ($_POST["TofD"]);To be inside your else statement so these variables are only created if the form has actually been submitted. thanks much!

1143.

Solve : How can I remove an ugly image in an EXE file??

Answer»

Thee is a free ISO burner PROGRAM I like to use. But I don't like the ugly little image that looks like a DEMON child. Can I remove / replace r it?
(Don't tell me to use white out. I heard that one already. I am not that dumb.)
I don't have the source code, I don't even know how it was written. It is a simple EXE file that runs in Windows with no option to remove the ugly little icon in the upper left.
I don't mean a shortcut icon; that I have done before.
It would seem impossible, but on another forum somebody asked almost the same question and were told to use resource hacker. I did find it and downloaded it. But before I do anything, I want to ask:
Has anybody done this?
Can your replace a small image embedded in a form of an n EXE file?
Anybody? Quote from: Geek-9pm on August 23, 2013, 07:50:28 PM

Thee is a free ISO burner program I like to use. But I don't like the ugly little image that looks like a demon child. Can I remove / replace r it?
(Don't tell me to use white out. I heard that one already. I am not that dumb.)
I don't have the source code, I don't even know how it was written. It is a simple EXE file that runs in Windows with no option to remove the ugly little icon in the upper left.
I don't mean a shortcut icon; that I have done before.
It would seem impossible, but on another forum somebody asked almost the same question and were told to use resource hacker. I did find it and downloaded it. But before I do anything, I want to ask:
Has anybody done this?
Can your replace a small image embedded in a form of an n EXE file?
Anybody?

It depends entirely on how the image was added to the program.

usually you can. With Resource hacker, you should be ABLE to find the bitmap in the resources. If so, you can safely replace it.

I've used Resource Hacker to hack dialogs in a few applications. for example, I found Visual Basic 6's References and Components dialogs to be annoying small. So I opened VB6.EXE in resource hacker and simply made them larger. I also added a Common Controls manifest so it would use Visual Styles.

Again THOUGH, this depends entirely on how the Application was written. I could be more specific if you provide the Application Name.Wow, you did that to VB6!
ISO Image Burner 1.1 is the file I want to change.
It is on softpedia and other places.
http://www.softpedia.com/get/CD-DVD-Tools/Data-CD-DVD-Burning/ISO-Image-Burner.shtml
Below are the child I don't want.
And the bird I do want.



[recovering disk space, attachment deleted by admin]It's written in Delphi. it doesn't look like it has the image as a resource, so you cannot remove it that way.

However, opening it in resource hacker, it does jave a RCDATA\TIMAGEFORM resource. That has a entry that appears to set a picture.

It is however a set of HEX digits, so if you want your image you'd probably need to replace it with the appropriate Hex for it.

I did so and it no longer has the image.



Thank you BC. I will enjoy planning with it.
Quote from: Geek-9pm on August 23, 2013, 10:58:16 PM
Thank you BC. I will enjoy planning with it.

You can't miss the entry- it takes up about 99% of the resource.
1144.

Solve : Run .exe (made from python script) without cmd?

Answer»

Hi all,
I was wandering if ANYONE knew how to RUN a exe i made using py2exe without opening cmd. The original python script was a .pyw, HOWEVER when i converted it to an exe it keeps opening the cmd...
Any ADVICE?In your setup script where it says this
setup ( console=[ 'yourfile.py' ])
Change the console to windows

1145.

Solve : Visual Basic Codes?

Answer»

i need help finding the codes to MAKE these questions work on visual basic

http://s1260.photobucket.com/albums/ii575/aidanheartsbread/?action=view&current=picture.jpgIt's a scan of a school test.
if thats your question then no,its more of an assignment and its alright for us to get help.The idea of a programming assignment is that you don't "find" the code by asking or searching on the web, you write it yourself. I expect if you post the code you have written people might offer suggestions to IMPROVE it.

Also, very few people are going to click on a bare link. Why didn't you paste the image code like this:



I still say this is homework (that's another word for a school assignment). We don't write people's homework assignments for them. I suggest you look on the Web for Visual Basic tutorials. Also, what kind of programming teacher does not know that you spell Visual Basic with initial capital letters?I'm sorry Im new to this form thing and didn't know u can directly post the image. i thank you for ur input however if i do find some codes will u be willing to correct any mistakes and check that they do what the question asked. THX in advanceQuote from: breadlover on May 21, 2012, 12:59:31 PM

if i do find some codes

Don't "find" them, write them yourself. Have you had any programming lessons? Have you got any course material? have you studied it?
what the heck is a "For- Next Sentence"?

HERE is one answer.

Oh you wanted Visual Basic? Oh darn. I'm actually better with VB then python but this will make things far more frustrating until you actually do the work yourself.

1. I ignored the "insert" thing and pretended it meant input.
Code: [Select]#!/usr/bin/env python
import math
inputresult = raw_input("Enter Number:")
inputresult = float(inputresult)
print "Negative Number" if 0 > inputresult ELSE "number " + str(inputresult) + " has " + str(int(round(math.log10(inputresult),0))) + " DIGITS."

Also sadly I think you are actually expected to determine the number of digits in the number by just looking at the length of a string. I was going to do the other ones but I lost interest.
1146.

Solve : Java problem?

Answer»

Guys i have an assignment that i don't know how to do it so help me PLEASE !!

notice that

1) i USE J creator LE 4.50
2) the code must be done in " clases and objects "
3)CLASSES should be public so it can be manipulated by a user


A)
IMPLEMENT a class Message. Each message must have a user-name of a sender, a user-name of a receiver, a subject and a
body.
• Implement a class Message with the above attributes.
• Augment your class with a constructor that takes four parameters and initializes the attributes accordingly.
• A message without a sender or a receiver is an invalid message. Further, a message cannot have an empty subject and
body (or there would not be much information in the message). Therefore, at least one of these two attributes must
be a non-empty string. Implement a method isValid() that returns true only if
– the Message object on which the method is invoked has a non-empty sender and receiver, and
– at least one of the body or subject must be a non-empty string.
• Implement a method toString() that returns a string representation of the Message object that the method was
invoked on. For example, the return value of toString() may look as follows:
From: kareem
To: Solver
Subject: CS Assignment
Body: Thanks
What have you done so far?nothing !!
Talk to your tutor, we dont do homework.Quote from: kareem eltanahy on May 23, 2012, 03:35:06 PM

nothing !!

I'm pretty sure the instructor is supposed to be grading YOUR work, not SOMEBODY else's work.


I personally have no problem helping people who at least try. You didn't even do that.How much will pay for it ?
1147.

Solve : Beginners C# question... Using Try Catch exceptions to detect non numeric inputs?

Answer»

I'm doing a project for my CS116 where the program has to generate an error message in a label when a user inputs a non numeric character in a text box and then presses a button. I've spent hours googling this on top of using my textbook and I just can't figure it out. I would do SOMETHING like

try
{
quantityinteger = int.Parse(quantityTextBox.Text);
QuantityTextBox.Text = quantityInteger.ToString();
}
catch
{
label1.Text = "Error";
}


but I get a 'FormatException was unhandled' error. I don't really know what I'm doing, I'm just copying this out of my book.. I've tried to understand try catch for quite a while and it still is really confusing to me.

Teacher recommends try catch, but doesn't care as long as it will work. And I can't make the textbox only be able to input numbers, it has to be SET up to fail.

Thanks in ADVANCE.. If you can't tell I'm very very new at C# and programming in general, so I might need some more explanation than the average computer programming forum user

This may help: http://msdn.microsoft.com/en-us/library/b3h1hf19.aspxcorrect code like this

try
{
int quantityinteger;
quantityinteger = int.Parse(quantityTextBox.Text);
quantityTextBox.Text = quantityinteger.ToString();
}
catch
{
label1.Text = "Error";
}

'FormatException was unhandled' - should learn about exceptions first

http://csharp.net-informations.com/statements/csharp-exceptions.htm

Basics of exceptions explain in the above link

Merca
Try and catch blocks are not that hard to be understood, when code which is written inside a try block ( try block means the code written between {} parenthesis) raises an error (something like giving a text value for a numeric one lets say you want "ana" kilograms of apples) an error is raising and your program will automatically run form code which is inside the catch block ( in your case giving an error on user interface (Number of kilograms must be a numeric value ! for instance ). Woah. Talk about thread necromancy.
Actually, in this case using an Exception to deal with it is silly. the .Parse() functions were an API design blunder because
they shouldn't be throwing exceptions in the first place.

Code: [SELECT]int quantityinteger=0;
QuantityTextBox.Text = int.TryParse(quantityTextBox.Text,out quantityinteger)?quantityinteger.ToString():"Error";

with the type.Parse() methods, you pay the Exception TAX. Usually when you use the method you just end up catching the error and setting a default, returning false, etc. so unless this Parse failure will cause code to throw it's own exception- such as an argument exception- TryParse() is the better choice.BC_Programmer is right.

1148.

Solve : Plz help c++ Plz Plz?

Answer»

include
#include
using namespace std;
int main()
{
unsigned long int birthmonth,birthyear,birthhour;
unsigned long int currentmonth,currentyear,currenthour;
unsigned long int agey,agem,aget,ages;
double agemils,agemics,agens,ageps,agefs;
char ans;
top:
cout<<"\n\n\t\t\t WELCOME TO AGE CALCULATOR\n\n";
cout<<"Enter Your BIRTH Year(Eg:1989):";
cin>>birthyear;
cout<<"\n\nEnter Your Birth Month(Eg:7):";
cin>>birthmonth;
cout<<"\n\nEnter your birth hour(eg:3):";
cin>>birthhour;
cout<<"\nEnter The Current Year(Eg:2010):";
cin>>currentyear;
cout<<"\nEnter The Current Month(Eg:7):";
cin>>currentmonth;

cout<<"\nEnter The Current Hour(Eg:6):";
cin>>currenthour;
agey=currentyear-birthyear;
if(currentmonth>birthmonth)
{
agem=((currentyear-birthyear)*12)+(curre…
}
else
{
agem=((currentyear-birthyear-1)*12)+(cur…
}

aget=agem*30*24;
ages=aget*60;
agemils=aget*60*1000;
agemics=agemils*1000;
agens=agemics*1000;
ageps=agens*1000;
agefs=ageps*1000;
cout<<"\n\nYour Age in years= "<cout<<"\n\nYour Age in Milliseconds= "<cout<<"\n\nYour Age in Picoseconds= "<cout << "\n Do you want to TRY Again? (Y/N)" <<

endl;

cout << "Option: ";

char runAgain;

cin >> runAgain;



if (!(runAgain == 'N' || runAgain == 'n'))
{
goto top;
}

if (!(runAgain == 'Y' || runAgain == 'Y'))

{
cout<<"Thanks For Trying";
}


getch();
}


Question:
I am doing a c++ project to check age from years,months.....femtoseconds. The problem is i am not getting the output required. i am getting correct
results upto agemils(age in milli seconds) then i get something e+xxxxx(x= number) like that. so i tried cout.precision() statement. then i dont get e+(exponential form(i guess!!)
but still i am not getting correct results. for conversion of milli to micro,micro to nano,nano to pico,pico to femto i just need 3 zeroes extra at every successive outputs keeping numbers same. but i am getting different numbers . this is quite strange i changed all data types. please help me with this problem soon.


Point out my mistakes and give new ideas (if any)

I am beginner to c++ so please explain me in detail

sorry for such a long questionQuote

then i get something e+xxxxx(x= number)
the output is correct. It is in scientific notation.Yes its the correct output however if you want a long long number vs scientific notation, you could take a number like 284,000,000,000,000,000,000 and divide it to use the 284 and concatonate your 0's on the tail of the output.

such as

Code: [Select]int After_Division;

cout<<After_Division<<",000,000,000,000,000,000\n";to get 284,000,000,000,000,000,000

You can use your existing output from ages below and include that in every cout<Quote
aget=agem*30*24;
ages=aget*60;
agemils=aget*60*1000;
agemics=agemils*1000;
agens=agemics*1000;
ageps=agens*1000;
agefs=ageps*1000;
Code: [Select]double someval=40E120;
cout<<fixed<<someval<<endl;
BC can you explain

double someval=40E120;
cout<
I dont see any scale to this concationation of an INT and DOUBLE for each ms, ns, ps etc?

Also

aget=agem*30*24;
ages=aget*60;
agemils=aget*60*1000;
agemics=agemils*1000;
agens=agemics*1000;
ageps=agens*1000;
agefs=ageps*1000;

is easier to follow if you change agemils=aget*60*1000; to agemils=ages*1000; and the calculation is partially redundant to the prior formula above it. It looks much cleaner as below even though you will end up with same output.

aget=agem*30*24;
ages=aget*60;
agemils=ages*1000;
agemics=agemils*1000;
agens=agemics*1000;
ageps=agens*1000;
agefs=ageps*1000;


Quote from: DaveLembke on August 16, 2012, 11:27:46 AM
Looking at this conversion formula I think there is a typo too

Code: [Select]aget=agem*30*24;
ages=aget*60;
agemils=aget*60*1000;

if Agem starts as 12, we end up with:

aget=12*30*24=8640
ages=8640*60=518400
agemils=8640*60*1000=518400000

AND; for the 'fixed' version:

Code: [Select]aget=12*30*24=8640
ages=8640*60=518400
agemils=518400*1000=518400000

The results are the EXACT same.

After I submitted it I realized it wasnt typo just a longer than needed formula... was editing my post then got pulled away from my lunch and came back and you beat me to the correction to my original post that I corrected.

I should have eaten my lunch to increase blood sugar = better thinking, before posting that, and corrected it sooner than later...LOL

Hypoglycemia is not fun Quote from: DaveLembke on August 16, 2012, 10:43:26 AM
Yes its the correct output however if you want a long long number vs scientific notation, you could take a number like 284,000,000,000,000,000,000 and divide it to use the 284 and concatonate your 0's on the tail of the output.

such as

Code: [Select]int After_Division;

cout<<After_Division<<",000,000,000,000,000,000\n";to get 284,000,000,000,000,000,000

You can use your existing output from ages below and include that in every cout<<ages then for agemils have cout<<ages<<"000\n"; and have cout<<ages<<"000000\n"; for agemics, then cout<<ages<<"000000000\n"; for agens and then cout<<"000000000000\n"; for ageps outputs and stack your 0's on the end.

Good idea to suffix with 0'sWas looking back and noticed that you are using a goto statement.

goto top;

I'd wrap it all within a while loop and do away with the goto. If this is school work, which I am thinking it may be, an instructor might complain with that goto's lead to spaghetti code. Having started with GW-Basic as my first programming language with line numbers, when I referred to goto's when we were discussing loops and redirection, I was scolded with NEVER USE GOTO's its poor programming technique and spaghetti code.

Maybe you haven't played with loops yet and will soon. They are lots of fun. C/C++ is one of my favorite languages and powerful. PERL is my 2nd favorite.

Personally since then, I have used goto's as a quick fix at times than to nest everything within loops, but when creating programs I try to avoid them whenever possible vs making sloppy code with goto here, goto there, goto this_alternative_object, goto beginning_to_restart

There's also another issue with goto: it's not usually implemented well (or at all) in other programming languages, decreasing portability.

An example is TI-BASIC (Used on the TI-83/84 series of calculators), where if STATEMENTS and loops used a stack mechanism to remember the beginning of the statement until it was ended. Goto could be used to jump out of one of these structures, possibly starting another loop. Eventually, an ERR: MEMORY would come up because of how much memory was used by the stack mechanism and how many loops had piled up unended. Needless to say, that was a pretty serious problem.Quote from: TechnoGeek on August 17, 2012, 09:44:02 AM
There's also another issue with goto: it's not usually implemented well (or at all) in other programming languages, decreasing portability.

An example is TI-BASIC (Used on the TI-83/84 series of calculators), where if statements and loops used a stack mechanism to remember the beginning of the statement until it was ended. Goto could be used to jump out of one of these structures, possibly starting another loop. Eventually, an ERR: MEMORY would come up because of how much memory was used by the stack mechanism and how many loops had piled up unended. Needless to say, that was a pretty serious problem.

Its implementation in C++ can also be confusing. Especially if used within loops, in fact, although one would hope you wouldn't mix goto with loops.

his111, don't feel like there's something terribly wrong with using goto in a small program like yours, it's just we try to avoid it for the reasons described and it's a PRACTICE that can quickly make programs far harder to read. I'm sure Dave identified it because you're new and it's something a new programmer should know. And I too hope you enjoy learning C++, it is a very nice language sometimes.Quote from: DaveLembke on August 16, 2012, 11:27:46 AM
BC can you explain

double someval=40E120;
cout<<fixed<<someval<<endl;

I dont see any scale to this concationation of an INT and DOUBLE for each ms, ns, ps etc?
casting from a int to a double does not result in any concatenation. Only narrowing conversions need a cast.



Quote
and the calculation is partially redundant to the prior formula above it.
There is no redundancy. Any compiler worth using will optimize the operations at compile time anyway.

Quote
It looks much cleaner as below even though you will end up with same output.
This is true.

1149.

Solve : WinAPI Using starting console?

Answer»

How does one detect and attach itself to the console window it was started from (if it was started from a console window)?You don't, at least not as I understand it.

Only way to be part of an EXISTING console is to have the EXECUTABLE set as a Console program. Otherwise, it doesn't get a console, and the console that it started from oesn't BELONG to it's process so you couldn't AttachConsole() to it anyway. So no WINDOWS applications can use their starting console? That's a shame...

It's no massive deal, it's simple enough to AllocConsole.

Okay, thanks then.How do you thank people for a POST with the 'thanks' system?

1150.

Solve : Need Help With Vb 2010?

Answer»

I Want A Text box To Display: $0.00. Which it gets from a website.
Source Code For That Bit:
Code: [Select]<tr>

<TD class="summary3"><b>Today</b></td>

<td class="summary2">$0.00</td>

<td class="summary2"><b>Today</b></td>

<td class="summary2">$0.00</td>

</tr>

The First $0.00 Is Relevant, The Second Is SOMETHING else.
[Full]Source Code (Website) - http://mibpaste.com/SpZy8U

Any HELP? Im Really ConfusedI Tried This Code: TextBox1.Text = WebBrowser1.Document.Body.GetElementsBy TagName("tr")(3).InnerText

but in the text box it shows "Today$0.00Today$0.00"

When i want it to show only "Today $0.00"Nvm Go It

Code: [Select]TextBox4.Text = WebBrowser1.Document.Body.GetElementsByTagName("td")(6).InnerText
Works FINE With That