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.

1051.

Solve : What type of VM or interpreter would this be??

Answer»

I was just thinking about possibly designing a new version of my scripting language. I know that there are two types of programming language interpreters. There's the kind the decodes the syntax in real time as it's executing (like mine) and then there is the kind like Java or .NET that compiles to byte code. I am also aware that there are two types of byte code interpreters (stack based and register based). My question is what would you call an interpreter that uses byte code, but does not use a stack or registers? It would simply have a byte or two to represent each command and then each command would have a few bytes after it that represent the location in memory of the parameters for that command. If the command had math in the parameters, then it would just point to a string containing the math and then the interpreter would execute it. To me it seems like this type of interpreter would be a lot faster than the ones that use an actual virtual machine code. Would this be better, or is there something I'm overlooking? I hope you understand what I mean because it's pretty hard for me to explain this stuff clearly.Quote from: Linux711 on FEBRUARY 01, 2013, 03:25:52 PM

To me it seems like this type of interpreter would be a lot faster than the ones that use an actual virtual machine code.

You are overlooking this:

Quote
then it would just point to a string containing the math and then the interpreter would execute it.
And how does it "execute" the string? By interpreting it. Your method only really 'compiles' the highest level, where everything LOWER down is STILL in the original form, and needs to be interpreted later.

So you don't think there'd be any added speed by using this method? Why would an actual VM be faster than this? Isn't reading the syntax and then deciding what to do the slowest part? I figured by eliminating that step, it would make it much faster.My idea is that if you condense the actual syntax into a byte code that I explained, and then use the interpreter to execute that, then most of the actual processing is done on the real CPU itself and only the big picture concepts (the commands) are emulated. With an actual VM every little step has to be interpreted any finally executed as native code rather than just the 'big picture' commands.Quote from: Linux711 on February 01, 2013, 03:25:52 PM
a string containing the math and then the interpreter would execute it.

*censored*! If only I had KNOWN it was that simple!
Quote
*censored*! If only I had known it was that simple!

Yes, I could have been more specific on that, but it doesn't matter because that's not the point. (Not trying to be mean if you were just pointing that out for fun.)

My latest post most accurately describes my point.Quote
With an actual VM every little step has to be interpreted any finally executed as native code rather than just the 'big picture' commands.
First, the .NET CLR as well as the JVM use a of JIT(Just in Time) Compilation. That is, once it executed a block of code, that piece is compiled and that compiled bit is used from then onwards if that code is executed again. And that isn't to touch on the other optimizations that they both make, such as Sealed methods in public classes no longer requiring virtual dispatching, which would normally be required to call the appropriate method implementation.

I think you are seriously underestimating just how much experience and understanding the people that work on these Virtual Machine implementations have. Very few languages today- with the possible exception of ruby and PHP- are truly interpreted 'in place'. Otherwise, the most "basic" implementation is generally to build an Abstract Syntax Tree for the language tokens. This is almost exactly what you are describing.

Quote from: Linux711 on February 01, 2013, 04:31:04 PM
So you don't think there'd be any added speed by using this method? Why would an actual VM be faster than this? Isn't reading the syntax and then deciding what to do the slowest part? I figured by eliminating that step, it would make it much faster.
"reading the syntax and deciding what to do" are two completely disparate tasks. "reading the syntax" would consist of building an Abstract Syntax tree. Deciding what to do involves executing that tree. Of course Virtual Machines also compile to Native code on the fly as they execute the Bytecode (Implementations of bytecode interpreters in other languages sometimes take this approach as well).

The reason I pointed out the "a string containing the math and then the interpreter would execute it." You are basically saying "I think the easiest way to interpret some script is to have it in a string and then have an interpreter execute it"... it doesn't actually say anything but what you plan to do. It's not an algorithm. It's like saying "I think the best way to sort a list is to have a list and have a function sort it".Quote from: BC_Programmer on February 01, 2013, 05:39:53 PM
The reason I pointed out the "a string containing the math and then the interpreter would execute it." You are basically saying "I think the easiest way to interpret some script is to have it in a string and then have an interpreter execute it"... it doesn't actually say anything but what you plan to do. It's not an algorithm. It's like saying "I think the best way to sort a list is to have a list and have a function sort it".

This is what I was getting at.
1052.

Solve : How to go to previous directory form current working directory?

Answer»

Hi,

I have directory like "C:/Program File/Adobe/Acrobat Reader/"

I need a batch script to go to the previous directory "C:/Program File/Adobe/"

Please help me..

Thank You,
JackkQuote

cd "C:\Program File\Adobe\"
This would do it...btw your slashes are WRONG way for windows/dos


To go up to the parent directory, you want to USE "cd ..". When navigating directories ".." represents the parent directory and "." represents the directory you are currently in.

Hope this helps.Hi,

Thanks for the reply,
I tried the script like this

setlocal ENABLEEXTENSIONS

echo %CD%
echo %CD..%

endlocal

it is printing only cd path as "D:\PROJECTFILES\Scripts"
But not cd..
I need to get the the parent path by the batch script.. Please send the batch script.

Thank You,AH! When you said you wanted to "go" to the previous directory PEOPLE understandably thought you wanted to change the current directory to that one. Now it seems you want to obtain the drive & path name of that folder, i.e. obtain the path of the current folder with the final item (this folder name) removed.

Echo the path to the folder above the current one:

for %%A in ("%cd%") do echo %%~dpA
Quote from: jackk on April 26, 2013, 11:19:57 PM
Hi,

Thanks for the reply,
I tried the script like this

setlocal ENABLEEXTENSIONS

echo %CD%
echo %CD..%

endlocal

it is printing only cd path as "D:\PROJECTFILES\Scripts"
But not cd..
I need to get the the parent path by the batch script.. Please send the batch script.

Thank You,
You are confusing a command with a variable.
CD is a command.
%CD% is a variable.Thank you for reply ..

Now it is WORKING..

Thank you
1053.

Solve : help with python invalid syntax?

Answer»

#prompt for name then subsequent MILE runs then add mile runs.


(name)= input("please enter DRIVER name")
(wage)= (int(input('please enter dollars/mile'))


if x=='y':<--- it keeps saying invalid SYNTAX and idk why
print('name')
print('wage' * 'tripticket')



else:
tripticket=input('drivers total miles')
'x'=input('continue y or n')

THERES PROLLY DOZENS OF OTHER MISTAKES IN THIS BUT I WAS GUNNA FIX IT ALL AFTER I COULD AT LEAST GET IT TO RUN. ANY HELP. THIS IS JUST AN EXERCISE TO HELP LEARN PYTHONThe second line has an unclosed parentheses.Quote from: BC_Programmer on MAY 07, 2013, 10:27:21 AM

The second line has an unclosed parentheses.

Parenthesis?
1054.

Solve : forgotton VBA Document password (Excel , VBA)?

Answer»

i was working on abit of CODE in VBA, in excel, i added a passsword and mispalced it, i have read around and seen theorys about EDITING abit of the code in a HEX editor, for me this just corrupts the VBA and replaces it with a blank one
any one any ideas how to regain accsess?

thanks
HI. No need to ask the same question more than once. I DELETED the duplicate topic.

1055.

Solve : Bat file help!?

Answer»

Before reading i want you to know that my english is not good...
Hey i made a easy transolater like this:

echo off

:trans
echo off
cls
echo Welcome to Haslien Transolater

echo.
set /p word=Enter english word:
if %word%==hello goto hello
goto account

:hello
cls
echo hello = Hellu
pause
cls
goto trans

----

But when i type a word that have not been added it close itself and i want it to say "This word has not been aded to this transolator
Press anny key to contiue" <--- by pressing a key i want it to go to the start again....IF-THEN-ELSE statements are not a batch strong point, thats one reason why I use C++ or ANOTHER similar language type that can interact at the command shell /console level for stuff like this, but here pasted below is a suggestion to make it WORK in batch.

Code: [Select]@echo off

set answer=one
if not "%1" == "1" (
set answer=two
if not "%1" == "2" (
goto bad_argument
)
)

echo Argument %1 is %answer%
goto end


:bad_argument
echo Bad Argument

:end
From: http://forums.codeguru.com/showthread.php?377124-RESOLVED-batch-IF-ELSE-STATEMENTQuote from: DaveLembke on May 10, 2013, 04:11:13 PM

IF-THEN-ELSE statements are not a batch strong point

If "%condition%"=="TRUE" (
echo Yes
) else (
echo No
)
@echo off
cls
echo Welcome to Haslien Transolater
:trans

REM The word English starts with a capital E

set /p word="[0 to quit] Enter English word: "
if "%word%"=="0" goto end

REM I use English / French word pairs because
REM I don't know what language you are using

REM Use /i to ignore case
if /i "%word%"=="cat" goto cat
if /i "%word%"=="dog" goto dog
if /i "%word%"=="man" goto man
if /i "%word%"=="hat" goto hat
if /i "%word%"=="pig" goto pig

REM if you get here then word not in list
Echo Error: %word% not in list
goto trans

:cat
echo %word% = chat
goto trans

:dog
echo %word% = chien
goto trans

:man
echo %word% = homme
goto trans

:hat
echo %word% = chapeau
goto trans

:pig
echo %word% = cochon
goto trans

:end
echo Finished
Pause

Screen output:

Welcome to Haslien Transolater
[0 to quit] Enter English word: cat
cat = chat
[0 to quit] Enter English word: hat
hat = chapeau
[0 to quit] Enter English word: man
man = homme
[0 to quit] Enter English word: pig
pig = cochon
[0 to quit] Enter English word: dog
dog = chien
[0 to quit] Enter English word: TAP
Error: tap not in list
[0 to quit] Enter English word: 0
Finished
Press any key to continue . . .

This is much shorter

@echo off
cls
echo Welcome to Haslien Transolater
:loop
set /p word="[0 to quit] Enter English word: "
if "%word%"=="0" goto end
set trans=$$$$

REM You only have to EDIT here to add / remove word pairs
if /i "%word%"=="cat" set trans=chat
if /i "%word%"=="dog" set trans=chien
if /i "%word%"=="man" set trans=homme
if /i "%word%"=="hat" set trans=chapeau
if /i "%word%"=="pig" set trans=cochon

if "%trans%"=="$$$$" (
Echo Error: %word% not in list
goto loop
)
echo %word% = %trans%
goto loop
:end
Echo Finished
Pause Suggestion:

if "%word%"=="" (
Echo You entered a blank string
goto loop
)another WAY:

(1) words.txt

cat,chat
dog,chien
man,homme
hat,chapeau
pig,cochon
horse,cheval
sheep,mouton
cow,vache
mouse,souris
bird,oiseau
girl,fille


(2) Batch program in same folder

@echo off
cls
echo Welcome to Translater
:loop
set /p word="[0 to quit] Enter English word: "
if "%word%"=="0" goto end
set trans=$$$
for /f "tokens=1,2 delims=," %%A in (words.txt) do if /i "%word%"=="%%A" set trans=%%B
if "%trans%"=="$$$" (
Echo Bad input or word not in list
goto loop
)
echo %word% = %trans%
goto loop
:end
Echo Finished
Pause
1056.

Solve : Monitoring Log Files with Perl?

Answer»

I am attempting to write a program that takes INPUT from /var/LOG/auth.log and PARSES all of the successful/attempted logins on this server. I have been able to write the logs files that I want to keep to another log (formatted in columns for date time user success/failure and ip). The problem that I am having a hard time figuring out is how I can write just the new logs when I schedule the script with crontabs. I'm fairly new at Perl, but I KNOW there is a WAY to do this.

Any help would be appreciated.

Dan

1057.

Solve : just a small question about a python program?

Answer»

this is just a small learning excercise I'm doing. Im attempting to make this and combine a number of skills i have learned to see how it WORKS and learn some things. im self teaching myself python and how to use TERMINAL and a few other subjects as i am taking pre recs now for SCHOOL and WANT to have an edge when i start taking computer programming classes
I know the code is amateurish but im self teaching


class budgettracker:
def namebudget(self, budgetname):
self.budgetname=budgetname

def accountbalance(self, acbalance, weekincome, moneyspent):
self.acbalance=acbalance
self.weekincome=weekincome
self.moneyspent=moneyspent

def calculations(self):
currentbalance=(self.acbalance - self.moneyspent)
weeklyallow=(self.weekincome - self.moneyspent)
print ('account name: %s' % self.budgetname)
print ("current balance is $%s" % currentbalance)
print ("this weeks allownace is $%s" % weeklyallow)


currentuser=budgettracker()


currentuser.namebudget=input('account holders name:')
currentuser.accountbalance=input('account balance, weekly income, moneyspent?')
#MY PROBLEM LIES HERE. THE CLASS METHODS FUNCTION PERFECTLY HOW DO I
# DEFINE THE VARIABLES OF THE METHODS WITH AN INPUT?

1058.

Solve : RGB to Long and Back?

Answer»

It's quite easy to CONVERT RGB colour to Long as used in the Property Sheet EVEN without the RGB function, but what about the other WAY around? I managed to work it out, so I'll reproduce it here for anyone who is interested. I've also shown the RGB to Long formula for reference.

RGB to Long
L = R + (G * 256) + (B * 65536)

Long to RGB
R = (L Mod 65536) Mod 256
G = Int(L Mod 65536 / 256)
B = Int(L / 65536)

1059.

Solve : text file into rich text box in vb?

Answer»

Hello,

I started not so long ago with vb so i'm not really good with it yet,
I got the assignment to insert a productcode like"12345A"(if it's not 6 character it shouldn't work either) and after pushing 1 button it NEEDS to show the price and how many there are in stock(this is 1 line STORED in the txt.file)
this is what I got so far(oh yeah I only need to put in 10 lines of products into the txt.file)

Public Class Form1
Dim strartikel(10) As String
Dim intteller As Integer
Dim intteller1 As Integer

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
FileOpen(1, "E:\toi\bestanden\artikelen.txt", OpenMode.Input)

Do Until EOF(1)

strartikel(intteller) = LineInput(1)


intteller = intteller + 1
Loop
FileClose(1)
End Sub

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim strartikelnummer As String

strartikelnummer = CType(txtartikel.Text, String)


if strartikelnummer = strartikel(intteller1)
rtxtartikel.Text &= strartikel(intteller1) & vbCrLf
intteller1 = intteller1 + 1
else
msgbox("wrong CODE")
end if


End Sub


End Class
spend some time SEARCHING everything up and found it myself (always looks like it's so easy afterwards)


Public Class Form1
Dim strartikel(2) As String


Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim strartikelnummer As String
Dim intteller1 As Integer

strartikelnummer = CType(txtartikel.Text, String)
intteller1 = 0
rtxtartikel.Text &= "artikelnummer " & "prijs " & "aantal stukken" & vbCrLf
Do While intteller1 < 3
If Mid(strartikel(intteller1), 1, 6) = Mid(strartikelnummer, 1, 6) Then

rtxtartikel.Text &= Mid(strartikel(intteller1), 1, 6) & " " & Mid(strartikel(intteller1), 7, 7) & " " & Mid(strartikel(intteller1), 14, 4)

End If
intteller1 = intteller1 + 1
Loop

End Sub

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim intteller As Integer

FileOpen(1, "G:\toi\bestanden\artikels.txt", OpenMode.Input)
intteller = 0
Do While Not EOF(1)

strartikel(intteller) = LineInput(1)

intteller = intteller + 1
Loop

End Sub
End Class

1060.

Solve : Lenovo recovery question??

Answer»

I have a Lenovo H430 desktop that i am going to work on this sunday. APPARENTLY after the windows logo loads there is just a black screen and will go no further. The pc came with a disk labeled Lenovo Win7 Drivers pack v2.7. Is this the recovery disc or do i need to order them from lenovo? Any tips would be appreciatedI'm gonna say that it's just the drivers, I think you may need to contact them to GET a Win 7 disc.
Unless there's a recovery partition.Last MONTH my wife bought a Lenovo H430. She did not have the same problem as you but we called Lenovo at 1-877-453-6686 (USA) for help. With our permission, the tech took the PC back to the factory settings using the recovery partition. You do not need a Win 7 recovery disk.

We must have spent an hour on the PHONE and at the PC keyboard. What the tech didn't know, she asked a co-worker about. The PC now works perfectly.

You could go to consumersupport.lenovo.com to look for help but I think you'll still wind up calling, as we did.

1061.

Solve : Get between two strings VB.NET function?

Answer»

I need to modify a VB function that gets a substring from between a starting string and ending string. The problem is that I need it to be able to ACCEPT multiple parameters for the ending string and stop when it finds the first instance of one of those strings. Can anyone (BC_Programmer) help me with this? Anyone who helps me with this, I will send the full SOURCE of the application when it's done if you'd like.

Here is the function:
Code: [Select] Private Function GetBetween(ByVal sSearch As String, ByVal sStart As String, ByVal sStop As String, Optional ByVal lSearch As Integer = 1) As String
Dim lTemp As Long

lSearch = InStr(lSearch, sSearch, sStart)
If lSearch > 0 Then
lSearch = lSearch + Len(sStart)
lTemp = InStr(lSearch, sSearch, sStop)
If lTemp > lSearch Then Return Trim(Mid$(sSearch, lSearch, lTemp - lSearch))
End If
Return vbNullString
End Function
uses Linq:

Code: [Select] ''' <summary>
''' Searches for the first string delimited by any entry in sStart and any entry in sEnd.
''' </summary>
''' <param name="sLookin">String to look in</param>
''' <param name="sStarts">Enumerable of Strings that are valid "starts"</param>
''' <param name="sEnds">Enumerable of Strings that are valid ends</param>
''' <param name="sStart">Optional starting string location.</param>
''' <returns></returns>
''' <remarks></remarks>
Private Function GetBetween(sLookin As String, sStarts As IEnumerable(Of String), sEnds As IEnumerable(Of String), Optional sStart As Integer = 0) As String

'starting from sStart, find the first occurence of any item in sStarts.

Dim firstfound As Integer = (From q In sStarts Let ttc = sLookin.IndexOf(q, sStart) Order By ttc Select ttc).First()

'we FOUND the first instance at firstfound. look for the first instance of an entry in sEnds starting there.
Dim secondfound As Integer = (From q In sEnds Let tqc = sLookin.IndexOf(q, firstfound + 1) Order By tqc Select tqc).First()


Return sLookin.Substring(firstfound + 1, secondfound - firstfound - 1)


End Function


Private Function GetBetween(sLookin As String, strStart As String, strEnd As String, Optional sStart As Integer = 0) As String
Return GetBetween(sLookin, New String() {strStart}, New String() {strEnd}, sStart)
End Function
Example of usage:


Code: [Select] Dim angletest As String = "this is a TEST of < angle brackets! > as well as some ( parentheses!)"

Console.WriteLine("-" + GetBetween(angletest, New String() {"<", "("}, New String() {">", ")"}, 0) + "-")


It's supposed to find the first instance of any of the items in the first list and then find the first instance of any element in the second list that occurs afterward, and then return the text in-between those occurences.

1062.

Solve : Need (SIMPLE?) Program for Artwork?

Answer»

Hi All. I am working on a new work of art that is titled IT IS BETTER TO BURN OUT THEN FADE AWAY. It consists of a new computer with a program that will visually count down from 27 days (Based on the 27 Club...those famous people that have died at 27...and the planned obsolescence of technology) and then overheat the unit causing it to "burn up" or at least shut down. I have yet to purchase the computer, so I can get any operating system needed. Is this possible? How difficult would it be? Can anyone write it for me? At what cost?The 27 day count down until the computer shuts down is your safest option although not as impressive to onlookers as a computer that burns up. It would basically use a shutdown -f -s to force the computer into a shutdown. Any real triggered burn up event would be flagged as bad by homeland security as potential computer based bomb making plans.

I could create a program that displays the count down and shuts the system down in 27 days, but I am not good at graphics programming and you wont want normal text counting down at 12 font, but likely big NUMBERS on the display showing the count down. And while I am ok at console programming, programming for windows is my weakness and that is what you really need is someone to program it with a count down that is done up nice and professional and this program triggers a shutdown -f -s to shut the system down at 0 time left.or, just use
Code: [Select]shutdown -f -s -t 2332800

As to the OP I find the actual purpose a bit... odd... in the end all you've done is destroy an otherwise perfectly working machine. Nonetheless, the BEST thing I can think of would be to have barely adequate cooling and then have a task scheduled or set to run after 27 days that will peg the CPU or appropriate peripheral components to cause an overheat. Though systems aren't designed for the purpose of being destroyed for specious dramatic purposes, so it would probably just shut-down. I think you can disable thermal protections somehow.

Or, you could just have a large anvil or other comically large weight suspended dangerously above it, with a ROPE that under normal tension grinds against a SHARP corner. With appropriate calculations you can get it to fall on the 27th day. If people use the machine, though, you should get them to sign a waiver.

Thanks for answering!

The computer in question would be purchased with the express purpose of destroying it. Nobody would use it. The first time it is booted would be in a gallery with it on a pedestal. I would be there (part out of necessity, part out of theatrics) when it does "burn up" with a fire extinguisher. The best option for me as an artist would be to have it actually overheat. This would mean shutting the fan down and "spamming" the processor? As a second option, a simple countdown with a shut down (seemingly permanent) would work. I am a professional artist...See my art here: noprogram.orgDoes your kind of Art require you to really destroy a computer?
Why not first study some footage of Personal Computers that have really caught on fire. n Then prepare a mock computer using wax or a similar materiel as the external case. The wax model should be hollow and have some lamps, a heater element and a small device inside that will countdown and display the count on a video screen. At the end of the count, the lamps and a heating element star to melt the wax. After a bit, the speaker will emit a destructive sound and go silent while the wax case forms a puddle in basin.
container.
It would be a symbolic demise. The controller will likely SURVIVE the hot wax treatment. You may be able to use it again.

Just a thought.
A you tube e PC collection. http://www.youtube.com/watch?v=nd266kl0rs0
Even MACs can burn. http://www.youtube.com/watch?v=iethJvyYOu8



1063.

Solve : c problem?

Answer»

first i download c++ and install, after install when i oen msg
aear ((( system does not suort full screen mode. choose close to terminate))
when i ignore msg small screen of c++ aear. lz hel how to maximize itYou MUST TELL the forum what OS you are using.
Is it LINUX?
And what band of C++ do you have?
OS WIN 7 32 BIT. if band is a version then 3.0. i download freeware

1064.

Solve : vnc like software programming general question?

Answer»

Hey Guys,

Im looking at creating a VNC application like realVNC and tightVNC and not sure where to start. I usually progam in VB and C++

any ideas?Hey there,

I tried looking and couldn't find the programming language that is constructed with. However, there is one you could try and it's browser BASED. I haven't tried this but here is the link.

http://engineering.linkedin.com/javascript/vncjs-how-build-javascript-vnc-client-24-hour-hackday

Regards,
B2Source Code for Real VNC has been open source for years. Curious as to why you are trying to reinvent the wheel with your own? For connecting to other peoples computers for free, other then VNC and RDP I have also used Crossloop, but haven't used crossloop in a couple years. The link below claims to be source code for VNC, I have not verified this, so download with caution. The original source code around version 3.7 was used to make a hack tool called Black VNC which took advantage of password exploit where no password was necessary to connect to password protected systems/servers online with the server service running READY to accept incomming connections. I had my Vent Server get hit by BlackVNC exploit. This no password required exploit was corrected in version 4.1 and newer. I never thought about digging into the source code of VNC, never needed to reinvent or modify the wheel etc.
http://www.afterdawn.com/software/source_codes/realvnc.cfm

I worked on a project a bunch of years ago in college to pass display from one computer to another using the PrintScreen function and pass this information over network from one computer to another using C++ 6.0 to write my code pre .Net. But the problem was that it was extremely memory and network bandwidth consuming and laggy since it was grabbing the screenshots as bitmaps and passing the bitmap data across the network to the other computer where it had to constantly refresh between 2 bitmap files. I had to use 2 bitmap files because of file-in-use errors. Using 2 bitmap files for screenshots allowed for one of the files to be updated while the other was loaded by the client program and in use. The client program alternated between these 2 bitmap files to UPDATE the video display on the viewer program. Due to very poor performance, I gave up on this program. But I was thinking originally that I might be able to pass keyboard and mouse controls across to it, but I gave up on it when it behaved so poorly with the design that I used to sort of exploit PrintScreen and Clipboard in the way that I did. My professor gave me 100% on this project even though it wasnt performing as WELL as I had wanted it to. I was hoping to get faster screen refreshes but when doing so WOULD run into race conditions. He said that my code was flawless and it was just a poor design, so he gave me 100% for effort, creativity, and flawless C++ sourcecode. If I could have passed the data back as a smaller format such as JPG vs BMP it would have improved the performance some I suppose, but with inexpensive PC Anywhere and free ways to do this VNC etc, I gave up on writing my own. All the books I had on handling images with C++ referred to how to display bitmaps, none showed how to handle JPG's. That and none showed how to capture display and store the capture, so I sort of cheated by using a PrintScreen keyboard macro routine that was called out to repeatedly in a loop and passing that to clipboard and another routine to grab from clipboard and write to bitmap files 1 image per 3 seconds to avoid a race condition and allow 6 seconds for each bitmap image to make it to the viewing computer and be displayed etc. It was a slow and poorly constructed way to do this, but it worked for displaying the remote systems entire display at full window on the system viewing the remote system.

1065.

Solve : c# splitting string into separate strings.?

Answer»

Hello all im trying to split a string into multiple strings for INSTANCE im trying to send an email with a string.

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.Net;
using System.Net.Mail;
using System.Threading;

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

string SaveEmail = null;
string SavePassword = null;
SmtpClient Mail = new SmtpClient();
MailMessage Message = new MailMessage();


private void Form1_Load(object sender, EventArgs e)
{
Email.Text = Properties.Settings.Default.Email;
Password.Text = Properties.Settings.Default.Password;
}

private void Email_TextChanged(object sender, EventArgs e)
{
string SaveEmail = Email.Text;
Properties.Settings.Default.Email = Email.Text;
Properties.Settings.Default.Save();
}
private void Password_TextChanged(object sender, EventArgs e)
{
string SavePassword = Password.Text;
Properties.Settings.Default.Password = Password.Text;
Properties.Settings.Default.Save();
}

private void Keybox_TextChanged(object sender, EventArgs e)
{
if (Keybox.Text.ToLower().Contains("sendmail"))
{
THREAD SendingMail = new Thread(SendMail);
SendingMail.Start();
}
}

public void SendMail()
{
String StringTest = "sendmail [emailprotected] TestSubject This is what I would type in a message";
char[] Characters = {' '};
string[] StringSplit = StringTest.Replace("sendmail", "").Split(Characters);

foreach(string s in StringSplit)
{
Testbox.Text = s;
}


return;

string SmtpInfo = "";
INT SmtpPort = 0;
if (Email.Text.ToLower().Contains("@live.com"))
{
SmtpInfo = "smtp.live.com ";
SmtpPort = 587;
}
else if (Email.Text.ToLower().Contains("@hotmail.com"))
{
SmtpInfo = "smtp.live.com ";
SmtpPort = 587;
}
MailMessage msg = new MailMessage();
msg.To.Add("USERSEMAIL");
msg.From = new MailAddress(Email.Text);
msg.SUBJECT = "A subject.";
msg.Body = "Hello, this is my message.";
NetworkCredential cred = new NetworkCredential(Email.Text, Password.Text);
SmtpClient client = new SmtpClient(SmtpInfo, SmtpPort);
client.Credentials = cred;
client.EnableSsl = true;
client.Send(msg);
MessageBox.Show("Your message has been sent.", "NOTICE", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}

So basically I want to send an email by using a text command so I would write: sendmail UsersEmail MessageSubject MessageBody


Any help would be great.Split on another character.

1066.

Solve : VB .Net get focused process title?

Answer»

Hi and Happy New Year:D
I'm in this SITUATION when I have to code a program that sends some text with sendkeys to specific programs. Like writing "Hello World" in NOTEPAD, and if I close/minimize Notepad to stop sending. So, how can I get the Title of the process that is on focus?GetForegroundWindow can be used to retrieve the handle of the WINDOW that currently has the focus. GetWindowText can be used to retrieve the foreground window title. IsIconic can be used to determine if a window is minimized.
Code: [Select] Private Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextW" (ByVal hwnd As Int32, ByVal lpString As String, ByVal cch As Int32) As Int32
Private Declare Function GetForegroundWindow Lib "user32.dll" () As Int32
Private Declare Function GetWindowTextLength Lib "user32.dll" Alias "GetWindowTextLengthW" (ByVal hwnd As Int32) As Int32

Private Declare Function IsIconic Lib "user32.dll" (ByVal hwnd As Int32) As Int32

Private Function GetForegroundText() As String
Dim CurrentWindow As IntPtr = GetForegroundWindow()
If CurrentWindow = IntPtr.Zero Then Return String.Empty
Dim Tlength As Int32 = GetWindowTextLength(CurrentWindow)
Dim getTitle As String = New String(Enumerable.Repeat(" "(0), Tlength + 1).TOARRAY())
GetWindowText(CurrentWindow, getTitle, getTitle.Length - 1)
Return getTitle.Replace(vbNullChar, "").Trim()
End Function

GetForegroundText, pasted in with the other declarations, will retrieve the full text of the Window that has the focus.

However this won't fix your problem, because Minimized Applications can still have the focus, so you'll need to ALSO use IsIconic().

1067.

Solve : Batch - Using IF/Else statement with system info?

Answer»

Here is the code that i have so far

Code: [Select]@Echo off
REM set system32=SYSTEM Type: x32-based PC
REM set system64=System Type: x64-based PC

for /f "tokens=* delims=:" %%a in ('systeminfo ^| find /i "system type"') do (
set systemtype=%%a
)

echo %systemtype%

REM echo %system32%

pause

What I am looking to do is IF %systemtype% is = to x64 then regeditfile.reg else regeditfile2.reg
havnt found a way to do that yet, i have searched but its looking like the output text of %systemtype% cant be matched against my set variables....
any help would be appreciated

Thank you for your time
Would the "PROCESSOR_ARCHITECTURE" variable be usable for this? It would avoid needing to run systeminfo (which can take a while).

One caveat: it returns the architecture the calling program is using (if you just run the batch file from windows explorer it shouldn't be an issue).
More specifically, a 32-bit program will get 'x86' even on a 64-bit OS. There is a separate PROCESSOR_ARCHITEW6432 that can be used. Windows Explorer and CMD by default run as 64-bit so that's not an issue. You might have problems if you run a 32-bit program that calls the batch file though.Hrmm I see what your saying, actually to get around the x86 part I could just
Code: [Select]@Echo off

for /f "tokens=* delims=:" %%a in ('set ^| find /i "AMD64"') do (
set systemtype=%%a
)

echo %systemtype%

pause

IF %systemtype%==AMD64 (
echo hello
) else (
echo Hello2
)

pause



but for some reason its throwing errors "PROCESSOR_ARCHITECTURE=AMD64==PROCESSOR_ARCHITECTURE=AMD64 was unexpected"
so how would we separate the AMD64 from the PROCESSOR_ARCHITECTURE variable......nvm that was really dumb of me...



Code: [Select]if %PROCESSOR_ARCHITECTURE%==AMD64 (
regfile.reg
) else (
Regfile2.reg
)

sometimes i hate coding.....
Thank you TechnoGeek, you woke me up alrighty, i have another question but this time i am really stumped

Code: [Select]c:
cd c:\sccm_temp\sap
echo "Copying Saplogon File"
xcopy "c:\sccm_temp\sap\saplogon.ini" "%appdata%\SAP\Common\" /Y
echo "Setting up NWBC client"
type c:\windows\system32\drivers\etc\services | findstr /v sapmsEDV | findstr /v sapmsEPR | findstr /v sapmsEQA > c:\windows\system32\drivers\etc\servicesOld
type c:\windows\system32\drivers\etc\servicesOld > c:\windows\system32\drivers\etc\services
echo sapmsEDV 3600/tcp >> c:\windows\system32\drivers\etc\services
echo sapmsEPR 3600/tcp >> c:\windows\system32\drivers\etc\services
echo sapmsEQA 3600/tcp >> c:\windows\system32\drivers\etc\services
regedit /s c:\sccm_temp\sap\DEV_SETTINGS_NWBC.reg <-----------Line 16
If %PROCESSOR_ARCHITECTURE%==AMD64 (
regedit /s c:\sccm_temp\sap\NWBC_Sec_64bit.reg
) else (
regedit /s c:\sccm_temp\sap\NWBC_Sec.reg
)

Here is the scenario:
I am pushing a program, via SCCM 07, to remote clients to be installed without physical touch. When the package is pushed the above batch runs and completes without error. But notice line 16 (this reg is the config for the program's login screen), this line acts like it runs but it never does. The contents of that .reg file are below (some info removed for security reasons). The reg file can be ran by itself no problem, as admin, but not when the batch if fired off. Even running the bat on the local PC wont kick of that line 16 reg edit.

Should add that the computers are:
Lenovo M91ps
Win 7 Pro x64
4 GB RAM
500 GB HDD

Dell Optiplex 380
Win 7 Pro
4 GB RAM
250 GB HDD

Dell Optiplex 745/755
Win XP
4GB RAM
250 GB HDD

tl;dr:
Line 16 doesn't run
Contents of .reg below
Needs to run when above batch is fired off
Any ideas?

Code: [Select][HKEY_CURRENT_USER\Software\SAP\NWBC\Settings\Pages\RuntimeConnections]

[HKEY_CURRENT_USER\Software\SAP\NWBC\Settings\Pages\RuntimeConnections\BAG_237068FB26CD984E8D81962775127D57]
"NAME"="Solution Manager Development"
"URL"=""
"CLIENT"=""
"LANGUAGE"="EN"
"SAPLOGON_DESCR"="Solution Manager Development (SDV)"
"USER"=""

[HKEY_CURRENT_USER\Software\SAP\NWBC\Settings\Pages\RuntimeConnections\BAG_2E49B71D0C4ACC4F89522E865D3E62F1]
"NAME"="Solution Manager Production"
"URL"=""
"CLIENT"=""
"LANGUAGE"="EN"
"SAPLOGON_DESCR"="Solution Manager Production (SPR)"



As always, I appreciate your time looking and wait patiently for a reply
also "Thank you" in advance
Quote from: The_Valkyrie on November 27, 2012, 04:16:25 PM

alrighty, i have another question but this time i am really stumped
(code removed from quote for brevity)

Here is the scenario:
I am pushing a program, via SCCM 07, to remote clients to be installed without physical touch. When the package is pushed the above batch runs and completes without error. But notice line 16 (this reg is the config for the program's login screen), this line acts like it runs but it never does. The contents of that .reg file are below (some info removed for security reasons). The reg file can be ran by itself no problem, as admin, but not when the batch if fired off. Even running the bat on the local PC wont kick of that line 16 reg edit.

Are you running the batch file as administrator? It should be necessary already if you're accessing system32, but I wanted to make sure.

Another suggestion (see around where I put the REM commands/comments):
Code: [Select]c:
cd c:\sccm_temp\sap
echo "Copying Saplogon File"
xcopy "c:\sccm_temp\sap\saplogon.ini" "%appdata%\SAP\Common\" /Y
echo "Setting up NWBC client"

REM this will save a backup of services to services.bak and the new version to 'services'
REM previous code would save two copies of the modified file and no backup
copy c:\windows\system32\drivers\etc\services c:\windows\system32\drivers\etc\services.bak
type c:\windows\system32\drivers\etc\services.bak | findstr /v sapmsEDV | findstr /v sapmsEPR | findstr /v sapmsEQA > c:\windows\system32\drivers\etc\services


echo sapmsEDV 3600/tcp >> c:\windows\system32\drivers\etc\services
echo sapmsEPR 3600/tcp >> c:\windows\system32\drivers\etc\services
echo sapmsEQA 3600/tcp >> c:\windows\system32\drivers\etc\services
regedit /s c:\sccm_temp\sap\DEV_SETTINGS_NWBC.reg <-----------Line 16
If %PROCESSOR_ARCHITECTURE%==AMD64 (
regedit /s c:\sccm_temp\sap\NWBC_Sec_64bit.reg
) else (
regedit /s c:\sccm_temp\sap\NWBC_Sec.reg
)
Quote from: TechnoGeek on November 27, 2012, 05:32:28 PM
Are you running the batch file as administrator? It should be necessary already if you're accessing system32, but I wanted to make sure.

Another suggestion (see around where I put the REM commands/comments):

Your REM/Comment code is a nice touch, but why are you looking at the .bak to overwrite the original without the EDV/EPR/EQA?

No the batch file is ran as a local user (granted all users have admin rights) so it baffles me that the reg file wont run IN the batch.
I have tried nesting the other reg files in the DEV_SETTINGS_NWBC and vice versa; both resulting in the reg file RUNNING but the DEV_SETTINGS_NWBC info never gets DUMPED into the registry. Not sure if it has to do with that its adding things to "HKEY_CURRENT_USER" or that the batch suppresses something that it shouldn't.
Quote from: The_Valkyrie on November 28, 2012, 08:49:05 AM
Your REM/Comment code is a nice touch, but why are you looking at the .bak to overwrite the original without the EDV/EPR/EQA?
If you read your original code carefully, you save two copies of the same file, both with those particular entries removed. The one I wrote *should* save the original, unmodified file as services.bak. The reason I copy from services.bak (original file) to services is to avoid any file-in-use errors from copying services (with lines removed) to itself.

Quote
No the batch file is ran as a local user (granted all users have admin rights) so it baffles me that the reg file wont run IN the batch.
I have tried nesting the other reg files in the DEV_SETTINGS_NWBC and vice versa; both resulting in the reg file RUNNING but the DEV_SETTINGS_NWBC info never gets dumped into the registry. Not sure if it has to do with that its adding things to "HKEY_CURRENT_USER" or that the batch suppresses something that it shouldn't.

Try this: edit the registry to match what you want it to become, then export those keys. See if there are any differences between the generated .reg file and yours (which could have an error somewhere).Quote from: TechnoGeek on November 28, 2012, 10:41:30 AM
If you read your original code carefully, you save two copies of the same file, both with those particular entries removed. The one I wrote *should* save the original, unmodified file as services.bak. The reason I copy from services.bak (original file) to services is to avoid any file-in-use errors from copying services (with lines removed) to itself.
Oh I see!

Quote from: TechnoGeek on November 28, 2012, 10:41:30 AM
Try this: edit the registry to match what you want it to become, then export those keys. See if there are any differences between the generated .reg file and yours (which could have an error somewhere).

Tried that, the export and the .reg file are the same down to the ordering of entries.
I am super baffled so i found a fix, kinda weird but its a start:
create another batch with the following
Code: [Select]reg add "HKCU\Software\SAP\NWBC\Settings\Pages\RuntimeConnections\BAG" /v "URL" /t "REG_SZ" /d "http://"
Then use the original batch above to call this batch and BAM! you have yourselves an EDITED registry in the HKCU area.
Now i MUST make it all in one cause im lazy and RATHER push 1 file than 4 files.

Quote
IF %systemtype%==AMD64

iI believe you need quotes sine you're matching a variable to a string

Try:Code: [Select]IF '%systemtype%'=='AMD64'
dont know if thats still a problem, but that should fix it. im no expert, but have had the same problem before with batch files. Quote from: TechnoGeek on November 28, 2012, 10:41:30 AM
If you read your original code carefully, you save two copies of the same file, both with those particular entries removed. The one I wrote *should* save the original, unmodified file as services.bak. The reason I copy from services.bak (original file) to services is to avoid any file-in-use errors from copying services (with lines removed) to itself.

found an issue with your code:

Code: [Select]copy c:\windows\system32\drivers\etc\services c:\windows\system32\drivers\etc\services.bak
type c:\windows\system32\drivers\etc\services.bak | findstr /v sapmsEDV | findstr /v sapmsEPR | findstr /v sapmsEQA > c:\windows\system32\drivers\etc\servicesThe first line returns an "access denied" when running it.
Yes, the line works when its ran as admin but i cant specify to run as admin in SCCM's task sequence.
I CAN, however, issue commands that can start this batch as admin or execute the batch that contains admin escalation....just dont know how to do that right now.

Warning: this topic has not been posted in for at least 30 days.
Unless you're sure you want to reply, please consider starting a new topic.

^I'm use to using 1 thread as to be respectful and tidy^


anyways!!!!!

Anyone of you Ladies and Gentleman know the best way to write data to the C:\windows\systems32\drivers\etc\services file without being phycially near the computer (ie. remote)

Currently I have this batch (see parts above) that needs to write to the services file. Well that needs to be ran as admin.....can't log onto all 857 computers to do this so i rather make a script. KICKER: the admin password is the same but with different variations (ie. password, Password, PassWord, passw0rd, etc)

thank you

1068.

Solve : How to let the user select a path f a file and delete it in batch?

Answer»

Hey im not sure how to let the user of a batch file select a file and delete it using batch. My computer keeps getting ERRORS although i cannot find out what i programmed wrong. PLEASE help.Quote

My computer keeps getting errors although i cannot find out what i programmed wrong. please help.

What errors? Syntax? Logic? You would do yourself a world of good if you posted what you have programmed.

How do you see this working? List the files in a folder and allowing the user to select ONE for deletion? Allowing the user to manually input the label of the file to be deleted?

Well, I want to let the user type in the path of the file and delete it.Code: [Select]@echo off
setlocal

set /p file=Enter File Name:
if exist %file% (
echo del %file% && echo %file% has been deleted
) else (
echo Incorrect File Name: %file%
)


I dislike writing destructive scripts, so this script performs a whatif SCENARIO. When you're satisfied remove the first echo instruction from line 6.

Thanks alot sidewinder! I had found the MISTAKE i made and i had successfully made this batch file that can dlete files. thx!
1069.

Solve : PHP - exporting to .xls file?

Answer»

Hello, I'm working with PHP + CODEIGNITER + PHPExcel library and am having trouble trying to perform a certain function.

I'm working on a web reporting interface and need to export an HTML table that LISTS a select number of IDs generated with javascript. My problem is that I only WANT to export the table itself, and nothing else. I only know how to export the PAGE as a whole and that's it.

I'm already familiar with the MVC framework and PHP, but this is my first time using PHPExcel, so I'm thinking that most likely I'm calling a function wrong or not calling the right functions. All I want to happen is that the user clicks a button that says "Export to Excel (.xls)" and the file gets downloaded to their hard drive. Thank you!Please, I really need help on this GUYS.

1070.

Solve : Zip.vbs script?

Answer»

Quote from: Sidewinder on May 24, 2013, 09:29:11 AM

OK, this has become a quest.

I modified the script to do some error processing. Run the VBScript standalone from the command prompt. Do not use the batch file and do not double click the script from explorer.

Code: [Select]Set objShell = CreateObject("Shell.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

If objArgs.Count <> 2 Then
WScript.Echo "Two Arguments Required ... Job Fail"
WScript.Quit
End If

If Not fso.FileExists(objArgs(0)) Then
WScript.Echo "Input File Not Found ... Job Fail"
WScript.Quit
End If

If Not fso.FolderExists(Mid(objArgs(1), 1, (InStrRev(objArgs(1), "\")))) Then
WScript.Echo "Output Folder Not Found ... Job Fail"
WScript.Quit
End If


Set f = fso.CreateTextFile(objArgs(1), True)
f.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
f.Close

Set objFile = objShell.NameSpace(objArgs(1))
objFile.CopyHere objArgs(0)
WScript.Sleep 1000

Please post the results. Also please post the arguments actually used, not the placeholders.



OK well Here is the error when I run from command prompt

Input Error: There is no file extension in "C:\dir\dir with space but first part of the dir with space". I also What i provided above is all I have I an new to scripting so still learning So not sure about arguments or place holders but i did give you all the code. Is there way to run the script on command with a dir that has a space? Like "Program files" cause when i run it in cmd it says Input Error: There is no file extension in "C:\dir\Program" and doesn't show the word files. Hope that makes senseWhen the command is executed from the command line, the paths which CONTAIN spaces must be enclosed in quotes, as stated by Sidewinder.
i.e.
Quote
cscript "C:\dir\dir with space\dir\Backup\zip.vbs" "C:\dir\dir with space\dir\Backup\file.bak" "C:\dir\dir with space\dir\Backup\file.zip"

When using the batch file, (or manually setting the variable MY_PATH in cmd), you need to:
EITHER change "SET MY_Path=C:\PATH\DIR\" to "SET MY_Path=C:\PATH\DIR" (NOTE: No trailing backslash)
OR change every occurrence of "%MY_PATH%\DIR\..." to "%MY_PATH%DIR\..." (NOTE: No backslash after %MY_PATH%"
ok I fixed the set path portion of the script and it ran with no errors but the zip file is empty. Thanks again.New and Improved Script v4.

Code: [Select]Set objShell = CreateObject("Shell.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

If objArgs.Count <> 2 Then
WScript.Echo "Two Arguments Required ... Job Fail"
WScript.Quit
End If

If Not fso.FileExists(objArgs(0)) Then
WScript.Echo "Input File: " & objArgs(0) & " Not Found ... Job Fail"
WScript.Quit
End If

zipFolder = Mid(objArgs(1), 1, (InStrRev(objArgs(1), "\")) - 1)
If Not fso.FolderExists(zipFolder) Then
WScript.Echo "Output Folder: " & zipFolder & " Not Found ... Job Fail"
WScript.Quit
End If

Set f = fso.CreateTextFile(objArgs(1), True)
f.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
f.Close

Set objFile = objShell.NameSpace(objArgs(1))
objFile.CopyHere objArgs(0)
WScript.Sleep 1000

Quote
ok I fixed the set path portion of the script

What does this mean? Do not use the batch file, run from the command prompt by typing:

cscript "scriptname.vbs" "drive:\path\file.bak" "drive:\path\file.zip"

Replace drive and path with the proper values. Use the quotes,

If you do not get the results you're looking for, post back the script you used, the command line exactly as you typed it at the prompt, and any error messages you received.



Quote from: Sidewinder on May 28, 2013, 01:02:40 PM
New and Improved Script v4.

Code: [Select]Set objShell = CreateObject("Shell.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

If objArgs.Count <> 2 Then
WScript.Echo "Two Arguments Required ... Job Fail"
WScript.Quit
End If

If Not fso.FileExists(objArgs(0)) Then
WScript.Echo "Input File: " & objArgs(0) & " Not Found ... Job Fail"
WScript.Quit
End If

zipFolder = Mid(objArgs(1), 1, (InStrRev(objArgs(1), "\")) - 1)
If Not fso.FolderExists(zipFolder) Then
WScript.Echo "Output Folder: " & zipFolder & " Not Found ... Job Fail"
WScript.Quit
End If

Set f = fso.CreateTextFile(objArgs(1), True)
f.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
f.Close

Set objFile = objShell.NameSpace(objArgs(1))
objFile.CopyHere objArgs(0)
WScript.Sleep 1000

What does this mean? Do not use the batch file, run from the command prompt by typing:

cscript "scriptname.vbs" "drive:\path\file.bak" "drive:\path\file.zip"

Replace drive and path with the proper values. Use the quotes,

If you do not get the results you're looking for, post back the script you used, the command line exactly as you typed it at the prompt, and any error messages you received.




Ok so I ran the script from the command line and from the zip.vbs. No errors were shown. It did create a zip folder but the zip folder was empty there was no file in it.


.vbs code is


Set objShell = CreateObject("Shell.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Set objArgs = WScript.Arguments

If objArgs.Count <> 2 Then
WScript.Echo "Two Arguments Required ... Job Fail"
WScript.Quit
End If

If Not fso.FileExists(objArgs(0)) Then
WScript.Echo "Input File: " & objArgs(0) & " Not Found ... Job Fail"
WScript.Quit
End If

zipFolder = Mid(objArgs(1), 1, (InStrRev(objArgs(1), "\")) - 1)
If Not fso.FolderExists(zipFolder) Then
WScript.Echo "Output Folder: " & zipFolder & " Not Found ... Job Fail"
WScript.Quit
End If

Set f = fso.CreateTextFile(objArgs(1), True)
f.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
f.Close

Set objFile = objShell.NameSpace(objArgs(1))
objFile.CopyHere objArgs(0)
WScript.Sleep 1000


Batch code is

@echo Compressing your Database now.
SET MY_Path=C:\dir\dir with space
cscript "%MY_PATH%\Dir\Backup\zip.vbs" "%MY_PATH%\dir\Backup\file.bak" "%MY_PATH%\dir\Backup\file.zip"
@pause


and where you asked "What does this mean? Do not use the batch file, run from the command prompt by typing:ok I fixed the set path portion of the script.

I was referring to what oldun suggested which worked. Thanks again.Quote
I was referring to what oldun suggested which worked. Thanks again.

OK. So if you have a method that works, is this thread closed?

Here is a script I found on the web and adapted.

Usage:
cscript //nologo Scriptname.vbs "file to zip.ext" "zip file name.zip"
cscript //nologo Scriptname.vbs "folder to zip" "zip file name.zip"

(use quotes in either parameter if they have spaces)

examples

create a zip and add a file to it
cscript //nologo MyZip.vbs "u:\Text-to-Phone\Bus Girona-Aeropuerto.txt" d:\testme.zip

add another file to an existing zip
cscript //nologo MyZip.vbs "u:\Text-to-Phone\2-Bus Girona-Aeropuerto.txt" d:\testme.zip

create a zip and add a folder (and SUB folder tree) to it
cscript //nologo MyZip.vbs "D:\Virtual Machines\ST62K\caches\GuestAppsCache" "s:\Folder with spaces\test.zip"

Notes:
No error checking; will fail silently if the zip already contains a top level object the same name (i.e. files with the same name must be in different folders)
Tested on Windows 7 Professional 64-bit and XP Professional 32-bit
Files are compressed

Set oFSO = CreateObject("Scripting.FileSystemObject")
ToZip = oFSO.GetAbsolutePathName(WScript.Arguments.Item(0))
ZipName = oFSO.GetAbsolutePathName(WScript.Arguments.Item(1))

d=WindowsZip(ToZip, ZipName)

Function WindowsZip(sFile, sZipFile)
Set oZipShell = CreateObject("WScript.Shell")
Set oZipFSO = CreateObject("Scripting.FileSystemObject")
If Not oZipFSO.FileExists(sZipFile) Then
NewZip(sZipFile)
End If
Set oZipApp = CreateObject("Shell.Application")
sZipFileCount = oZipApp.NameSpace(sZipFile).items.Count
aFileName = Split(sFile, "\")
sFileName = (aFileName(Ubound(aFileName)))
sDupe = False
For Each sFileNameInZip In oZipApp.NameSpace(sZipFile).items
If LCase(sFileName) = LCase(sFileNameInZip) Then
sDupe = True
Exit For
End If
Next
If Not sDupe Then
wscript.echo "Adding " & sfile
oZipApp.NameSpace(sZipFile).Copyhere sFile
On Error Resume Next
Do Until sZipFileCount < oZipApp.NameSpace(sZipFile).Items.Count
Wscript.Sleep(100)
Loop
On Error GoTo 0
End If
End Function

Sub NewZip(sNewZip)
Set oNewZipFSO = CreateObject("Scripting.FileSystemObject")
Set oNewZipFile = oNewZipFSO.CreateTextFile(sNewZip)
oNewZipFile.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
oNewZipFile.Close
Set oNewZipFSO = Nothing
Wscript.Sleep(500)
End Sub

Quote from: Salmon Trout on May 28, 2013, 01:33:40 PM
Here is a script I found on the web and adapted.

Usage:
cscript //nologo Scriptname.vbs "file to zip.ext" "zip file name.zip"
cscript //nologo Scriptname.vbs "folder to zip" "zip file name.zip"

(use quotes in either parameter if they have spaces)

examples

create a zip and add a file to it
cscript //nologo MyZip.vbs "u:\Text-to-Phone\Bus Girona-Aeropuerto.txt" d:\testme.zip

add another file to an existing zip
cscript //nologo MyZip.vbs "u:\Text-to-Phone\2-Bus Girona-Aeropuerto.txt" d:\testme.zip

create a zip and add a folder (and sub folder tree) to it
cscript //nologo MyZip.vbs "D:\Virtual Machines\ST62K\caches\GuestAppsCache" "s:\Folder with spaces\test.zip"

Notes:
No error checking; will fail silently if the zip already contains a top level object the same name (i.e. files with the same name must be in different folders)
Tested on Windows 7 Professional 64-bit and XP Professional 32-bit
Files are compressed

Set oFSO = CreateObject("Scripting.FileSystemObject")
ToZip = oFSO.GetAbsolutePathName(WScript.Arguments.Item(0))
ZipName = oFSO.GetAbsolutePathName(WScript.Arguments.Item(1))

d=WindowsZip(ToZip, ZipName)

Function WindowsZip(sFile, sZipFile)
Set oZipShell = CreateObject("WScript.Shell")
Set oZipFSO = CreateObject("Scripting.FileSystemObject")
If Not oZipFSO.FileExists(sZipFile) Then
NewZip(sZipFile)
End If
Set oZipApp = CreateObject("Shell.Application")
sZipFileCount = oZipApp.NameSpace(sZipFile).items.Count
aFileName = Split(sFile, "\")
sFileName = (aFileName(Ubound(aFileName)))
sDupe = False
For Each sFileNameInZip In oZipApp.NameSpace(sZipFile).items
If LCase(sFileName) = LCase(sFileNameInZip) Then
sDupe = True
Exit For
End If
Next
If Not sDupe Then
wscript.echo "Adding " & sfile
oZipApp.NameSpace(sZipFile).Copyhere sFile
On Error Resume Next
Do Until sZipFileCount < oZipApp.NameSpace(sZipFile).Items.Count
Wscript.Sleep(100)
Loop
On Error GoTo 0
End If
End Function

Sub NewZip(sNewZip)
Set oNewZipFSO = CreateObject("Scripting.FileSystemObject")
Set oNewZipFile = oNewZipFSO.CreateTextFile(sNewZip)
oNewZipFile.Write Chr(80) & Chr(75) & Chr(5) & Chr(6) & String(18, 0)
oNewZipFile.Close
Set oNewZipFSO = Nothing
Wscript.Sleep(500)
End Sub



This is what I was looking for thank you. Thank you to as well sidewinder and oldun I APPRECIATE you guys taking the time to assist me.
1071.

Solve : recovery disc /flashdrive?

Answer»

Morning i have just got a new laptop i have already INSTALLED some programmes.then i read that i should make a recovery disc or flash drive.
the laptop is a TOSHIBA OS windows 8.(didn't realise this until i got it) anyway thought I'd persevere.the problem is READING about how to create
one i get conflicting amounts of GB i need.from 256mb to 32 gb.can somebody please help.

1072.

Solve : VBA Error index 33 string, Argument exception was unhandles?

Answer»

Public Class Form1
Dim con As New OleDb.OleDbConnection
Dim da As OleDb.OleDbDataAdapter
Private Sub Form1_Load(BYVAL sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim dbprovider As STRING = "Provider=Microsoft.Jet.OLEDB.4.0;
Dim dbsource As String = "DATA SOURCE:=C:\Users\Finance\Desktop\Test\data.mdb"
con.ConnectionString = dbprovider & dbsource
con.Open()
MsgBox("database OPENED")
End Sub
End Class

i get this error :

Argument excpetion was unhandled
Format of the initialization string does not conform to specification starting at index 33.I think it needs to end with a semicolon.

1073.

Solve : MS SQL get max values for a join?

Answer»

I've struggled with a MS SQL QUERY for a while and realize that I have to get help from someone who knows MS SQL (much) better than I do.

Environment: MS SQL 2008

Code: [Select]SELECT
Levfaktura.LfhAnm AS [SUPPL.ORDERNO],
SUBSTRING(ISNULL(CAST(Orderhuvud.OrhOnr AS VARCHAR), ''), 1, 8) AS [OUR ORDER],
SUBSTRING(ISNULL(CAST(Faktura.FahFnr AS VARCHAR), ''), 1, 7) AS [CUST.INVOICE]
FROM Levfaktura

LEFT OUTER JOIN Orderhuvud
ON Levfaktura.LfhAnm = Orderhuvud.OrfAnm5

LEFT OUTER JOIN
Faktura ON Orderhuvud.OrfAnm5 = Faktura.FahAnm5

GROUP BY Levfaktura.LfhAnm, Orderhuvud.OrhOnr, Faktura.FahFnr
ORDER BY [SUPPL.ORDERNO],[CUST.INVOICE]

This is the result I get with this query:

SUPPL.ORDERNO OUR ORDER CUST.INVOICE
------------------------------ --------- ------------
143914 64228 179890
143914 64228 179935
143914 64228 179995
143914 64228 179999
143914 64228 180067
143914 64228 180148
326042
326052 64549 180219
326086 64633

(9 row(s) affected)


I get multiple 'CUST.INVOICE' for each 'SUPPL.ORDERNO' and 'OUR ORDER' combination but I only want to return the latest 'CUST.INVOICE' (=largest invoice number).


This is the result I want to return:


SUPPL.ORDERNO OUR ORDER CUST.INVOICE
------------------------------ --------- ------------
143914 64228 180148
326042
326052 64549 180219
326086 64633

(4 row(s) affected)

  • if there are more than 1 CUST.INVOICE for the combination of 'SUPPL.ORDERNO' and 'OUR ORDER' I want to show only the 'CUST.INVOICE' with the largest number
  • if there is no 'OUR ORDER' and no 'CUST.INVOICE' I want to it to be shown as empty
  • if there is an 'OUR ORDER' and no 'CUST.INVOICE' I want to it to be shown as empty

Any help would be appreciated!
1074.

Solve : Kill wscript.exe without WMI service permission?

Answer»

Greetings all. I'm on Windows 7 professional, and I do not have admin rights. I use many VBScript files, and have no issue there. My issue is that every time I run one of them, the WSCRIPT.exe process is left running. If there gets to be several instances of it the cpu usage spikes, the fan goes into overdrive, and my laptop sounds like a jet about to take off until I manually kill them all using the task MANAGER. This is what I have TRIED.

- Put wscript.quit at the end of the script: does not seem to do anything.

- call the script files from a batch file, using both cscript.exe and wscript.exe. I read several posts on this issue, and there seemed to be some success for some folks, but both cscript.exe and wscript.exe are left running.

- call the script files from the command prompt, and same as above.

I found http://technet.microsoft.com/en-us/library/ee692847.aspx#EGAA, and was hopefull when reading the section "Listing 2: Terminating Processes". However, I do not have the ability to access WMI. At this point I am at a total loss as to what else I can do. I sure would appreciate any other method anyone could offer. Thank you.

GregGreg, If it is your laptop, why don't you have admin rights?Quote

My issue is that every time I run one of them, the wscript.exe process is left running

Please post one of the scripts giving you problems. Your problem can be recreated by using the RUN method to start a secondary program/script and waiting for a return that never happens.

Does this only happen with WScript/CScript?

Just a thought. Quote from: Geek-9pm on May 29, 2013, 03:47:09 PM
Greg, If it is your laptop, why don't you have admin rights?

Sorry for the lack of info. It is a work laptop, and once we transitioned to W7, all admin rights gone. Most people had them with XP, but now I cannot rely on it if I am writing a script for others. Thank.Quote from: Sidewinder on May 30, 2013, 04:10:11 AM
Please post one of the scripts giving you problems. Your problem can be recreated by using the RUN method to start a secondary program/script and waiting for a return that never happens.

Does this only happen with WScript/CScript?

Just a thought.

Sidewinder, here is a SAMPLE script that just pulls some data from a database. Note, I changed the DSN name and query and all that, not that it would mean anything to anyone, but just covering my rear. Anyhow, this script works exactly as it should, but leaves wscript.exe running after it is done.
Code: [SELECT] Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")

userid = inputbox("Enter EID")
password = inputbox("Enter password")

strSQL = "SELECT SomeColumn FROM SomeTable"

cn.Open "DSN=SomeDSN;Password=" & Trim(password) & ";User ID=" & Trim(userid) & ";"

Set rs = cn.Execute(strSQL)
With rs
.movefirst
While Not (.EOF AND .BOF)
On Error Resume Next
MsgBox "Col1 = " & .fields(0) & vbcrlf & _
"Col2 = " & .fields(1)
.MoveNext
Wend
End with

rs.close
Set rs = nothing
Set cn = nothing

Wscript.quit

Just for grins, I put 'MsgBox "Hello"' in a script, with nothing else, and it did not leave an instance of wscript running, so I wonder if it has something to do with the objects. Just to test, here is another simple one that *does not* leave wscript.exe running.
Code: [Select]
Set wshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

strFilePath = wshShell.ExpandEnvironmentStrings("%temp%") & "\Test.txt"

If objFSO.FileExists(strFilePath) Then
'Delete the file if it exists
objFSO.DeleteFile(strFilePath)
End if

set WriteText = objFSO.CreateTextFile(strFilePath)
WriteText.WriteLine("Hello")

Set objFSO = nothing
Set WriteText = nothing
I got it now.

I had "While Not (.EOF AND .BOF)" where I should have had only "While Not (.EOF)". I copied from one of my Access VBA scripts without thinking. Thanks all.
1075.

Solve : Help with iterating through cells in datagrid?

Answer»

I need help on a program I am currently CREATING as all I am trying to do is read all the cells in the DATAGRID to see if there are any null values and then display a message. I have racked my head around this for ages and I just cant find any CODE to help. Below is the code I am trying to use to search through each cell but this throws an exception that datatable cannot be converted to dataset. Any help would be appreciated.

Code: [Select]
string CellVal = null;
INT Rowcount = 0;
CurrencyManager cm = (CurrencyManager)this.BindingContext[this.dataGrid1.DataSource];
int rowCount = cm.Count;
int colCount = ((DataTable)this.dataGrid1.DataSource).Columns.Count;
for (int row = 0; row < rowCount; row++)
{
for (int COL = 0; col < colCount; col++)
{
CellVal = this.dataGrid1[row, col].ToString();
}
}

1076.

Solve : HTML5 canvas doesn't work?

Answer»

This is my first time trying to write a "game" in HTML5. I'm following CODE from this: http://www.slashgame.net/2011/06/video-intro-to-html5-game-dev.html

I didn't copy & paste it, I wrote it myself with a few changes.

Here it is:

Code: [Select] <script type="text/javascript">
const FPS= 30;
var canvas= null;
var context2D= null;


var playerImg = new image ();
playerImg.src = "http://i46.tinypic.com/25k5y7t.jpg";


var playerPosX = 0;
var playerPosY = 0;


var keys = new Array ();

window.addEventListener('keydown', keyDown, true);
window.addEventListener('keyup', keyUp, true);
function keyDown(evt) {
keys[evt.keyCode] = true;
}
function keyUp(evt) {
keys[evt.keyCode] = false;
}



window.onload = init;

function init() {
canvas = document.getElementById('canvas');
context2D = canvas.getConext('2d');

setInterval(DRAW, 1000/FPS);
}


function draw() {
update();

context2D.ClearRect(0, 0, canvas.width, canvas.height);
context2D.drawImage(playerImg, playerPosX, playerPosY);
}


function update() {
if ((37 in keys && keys[37]) || (65 in keys && keys[65])){ //left
playerPosX -= 2;
}

if ((39 in keys && keys[39]) || (68 in keys && keys[68])){ //right
playerPoslX += 2;
}

</script>
I can't get the player to show up. I'm using Google Chrome.
I have the image on my computer, so I put it in the same directory as the HTML file and just said "player.bmp". That didn't work so I said C:\blah\blah\player.bmp. That didn't work so I uploaded it to Tinypic and did the full URL of that. And that doesn't work either. I don't know what's wrong.

Also, Google Chrome's "inspect element" thing had an error that said "unexpected end of INPUT" at the end. A little bit ago when I was still working on the code it had another error that said something like "image undefined" on the playerImg thing, but now that I've finished the code it doesn't ANYMORE (the only thing I've changed about the image is the image source I think.

The link I have at the top's code has playerVel stuff, I got rid of that on mine. Could that be it?

Thanks.

1077.

Solve : .csv to .xls conversion using VBS?

Answer»

Hello.

So I'm trying to automate a .csv to .xls conversion. I have this little snippet (below) that works to GET the data into an .xls file, the problem is that it doesn't actually utilize the "," delim. So, while this opens the .csv in Excel and re-saves it, I need it to actually use the "Get External Data -> Text File..." method. Anyway, any help is appreciated.

Code: [Select]Dim myXL
Set myXL=CreateObject ("Excel.Application")

myXL.WorkBooks.Open "C:\DIR\file.csv"

myXL.DisplayAlerts=False 'To keep Excel hidden
myXL.ActiveWorkbook.SaveAs "C:\DIR\file.xls", -4143 'IDK what the "-4143" does
myXL.DisplayAlerts=True

myXL.ActiveWorkbook.Close False
myXL.Quit

Set myXL = Nothing

NOTE: If there are any TYPOS, know that they are correct in the actual .vbs. Alright, I fixed it.

This works:

Code: [Select]Dim myXL
Const xlDelimited = 1
Const xlWorkbookNormal = -4143

Set myXL=CreateObject("Excel.Application")
myXL.Visible=False
myXL.WorkBooks.OpenText "C:\DIR\file.csv", , , xlDelimited, , , , , True 'Change the source path as needed.

myXL.DisplayAlerts=False
myXL.ActiveWorkbook.SaveAs "C:\DIR\new_file.xls", xlWorkbookNormal 'Change the destination path as needed.
myXL.DisplayAlerts=True

myXL.ActiveWorkbook.Close False
myXL.Quit

Set myXL = Nothing
So if anyone needs something SIMILAR, here you go!

NOTE: This is also for Excel 2000. Don't know how it integrates with newer VERSIONS of Excel or newer VB and/or .NET Frameworks. Also, was built on XP Pro SP3, but that shouldn't matter much. Anyway, ENJOY!

1078.

Solve : How to search a file in the whole drive and take action-batch?

Answer»

Hey guys i know i asked questions a lot, but IM new to batch. So i want to make a batch file find a file anywhere in the drive and take action(eg, delete it, rename it.)
will IF EXIST work?
thanksExcept for automation scripts, I am a big fan of batch file PROMPTS. It eliminates remembering COMMAND line arguments and which order they are expected.

Code: [Select]@echo off
setlocal

set /p drive=Enter Drive:
set /p arg=Enter SEARCH String:

if .%arg%==. (
for /f "tokens=* delims=" %%i in ('dir %drive%:\ /a-d /s /b') do (
echo %%i
)
) else (
for /f "tokens=* delims=" %%i in ('dir %drive%:\ /a-d /s /b ^| find /i "%arg%"') do (
echo %%i
)
)

User is prompted for both the drive letter and the file name. File names are searched to match the string entered by the user. Partial file names can be used.

Thanks alot sidewinder. this is very helpful., its exactly what i was trying to do.

1079.

Solve : Modifying Notepad?

Answer»

So I want to modify notepad to double as a batch compiler. I am having trouble finding source code. I was wondering if anyone new where I might find some (that I can easily compile). Thanks in ADVANCE. (I looked into Notepad++, but can't open most of the files for some reason)Microsoft Windows Notepad is proprietary software (and thus, you will NOT find source code for it).
What do you mean by 'batch compiler'? Notepad already edits and saves batch files, and you don't need to compile those.Quote from: TechnoGeek on December 10, 2012, 05:11:34 PM

Microsoft Windows Notepad is proprietary software (and thus, you will NOT find source code for it).
What do you mean by 'batch compiler'? Notepad already edits and saves batch files, and you don't need to compile those.
I was hoping to make a notepad like program that would have an option (like save or save as) that would say something AKIN to "Compile and run" that way I would not have to open Windows Explorer after saving and find my batch file. I started to write my own, but I know so little of any other language (than batch) that I'm running into some difficulty. I figured it would be simpler to get someone else's code and work my way though making a few edits than to write it from scratch.

EDIT: So far (in c++) i have a window, with a menu bar (that doesn't do anything yet), and a giant text box. Still working on saving.Notepad++ has options (from the Run menu) to open the folder containing the file or a cmd prompt in the current folder (which I think may be the containing folder as well).
Another option is to Run -> Run... (F5) this command:
Code: [Select]$(FULL_CURRENT_PATH)
(You can save it and add a hotkey, I used Shift-F5, if you use it a lot)


Again, compiling literally does not make any sense with batch files by themselves. There are some third-party tools that 'convert' bat files to exe files (not that one should necessarily use one).

What is the end goal? To write your compiled programs from source? I use VISUAL Studio for that. Downloading an IDE/compiler to compile c++ to make your own IDE/compiler is... how do I say... a lot of extra (and IMHO unnecessary) work.Quote from: TechnoGeek on December 10, 2012, 06:53:34 PM
Again, compiling literally does not make any sense with batch files by themselves. There are some third-party tools that 'convert' bat files to exe files (not that one should necessarily use one).

I guess I wasn't exactly using "compile" correctly. What I ment was that I wanted it to save it as a .bat (directly from my text editor) and run that .bat. That way I could eliminate Windows Explorer all together and overall save TIME.

Quote from: TechnoGeek on December 10, 2012, 06:53:34 PM
Notepad++ has options (from the Run menu) to open the folder containing the file or a cmd prompt in the current folder (which I think may be the containing folder as well).
Another option is to Run -> Run... (F5) this command:
Code: [Select]$(FULL_CURRENT_PATH)
(You can save it and add a hotkey, I used Shift-F5, if you use it a lot)

This is pretty much what I was looking for. Thanks for the help.Glad I could help and that the solution met your needs I believe N++ has a plugin that puts an icon on your toolbar. You just click it and it runs your batch file. I used it on my Windows XP computer with N++ but I just got SWITCHED over to Windows 7 and haven't gotten everything loaded back on at work.
1080.

Solve : turning on my pc automatically?

Answer»

Hey guys ! i wanna turn on my PC at night and download some stuff but i can't figure out how to turn it on automatically (win 7, 32bit, SP1 ) ! Help please! Some bios's have the ability to schedule when to turn a computer on etc, does your bios have this?

Also if you have another system running on your network which can send this other computer a WOL request, you could use that to boot it. http://www.smallnetbuilder.com/lanwan/lanwan-howto/29941-how-to-wake-on-lan-wake-on-wan

Most bios's also support POWER on after power fail. You might be able to use an outlet timer to turn the computer on at a set time, but I wouldnt allow this timer to just KILL power to the system, I'd have a scheduled task to power it down safely/properly. When the power supply registers a power loss later in the day when the system is off, and power is reapplied to the system by the electromechanical outlet timer it might bring the system to life at that time. (*I say might because I have not tested this. Its worth a TRY at $5 for a timer or if you already have an outlet timer to test with. Biggest concern is to ADD scheduled task to have this system shut down properly before the outlet timer kills power to avoid crashing system. )

1081.

Solve : dll problem?

Answer»

'The procedure entry POINT _Z21qRegisterResourceDataiPkhS0_S0_ COULD not be LOCATED in the dynamic link library QTCore4.dll'. What can i do?
When i want to open the exe file its COME out
Have you DOWNLOADED the newest version of the QT Framework?

1082.

Solve : _Z9qBadAllocv problem?

Answer»

The PROCEDURE ENTRY point_Z9qBadAllocv COULD not be LOCATED in the DYNAMIC link library QtCore4.dll".

1083.

Solve : Help debugging VBA for Excel 2000?

Answer»

Hey,

So I've been working for a bit on a little project in VBA for excel 2000. I believe there are easier ways to achieve the goal that is DESIRED, but I need to get more familiar with VB anyway, so bare with me.

Basically, this Macro (group really), adds a level of security to the worksheet. It starts by hiding Sheet1, then calling more stuff.

Code: [Select]Private Sub Workbook_Open()
Sheet1.Visible = xlSheetVeryHidden
Call Sheet1.Initialize_Authorization
End SubThis is in the workbook section.

There's a bit more than I want to type or paste here, so I'll add some links to my pastebin soon for reference, but the main problem that I'm running to now, is passing a value from a Sub in my UserForm to a Sub in the Sheet1 code...

UserForm2
Code: [Select]'Code 1
Public PermLevel As Integer

Public Sub OKBtn2_Click()
Select Case UserForm2.PasswordBox1
Case "12345"
PermLevel = 1
Call Perm_Processing
Case "67890"
PermLevel = 2
Call Perm_Processing
Case "kyle"
Perm Level = 3
Call Perm_Processing
Case Else
MsgBox "Error assigning permissions.", vbExclamation, "ERROR!"
End Select
End Sub

This all works fine for Perm_Processing, however, Sheet1 contains,

Code: [Select]'Code 2
'This is a test to debug further.

Public Sub Permission_Assignment
MsgBox "PermLevel is currently set to " & PermLevel, vbOKOnly, "Status"
PermiLevel = PermLevel
MsgBox "PermiLevel is currently set to " & PermiLevel,vbOKOnly, "Status"
End Sub
This returns PermLevel as being no value at all, not even 0.

Again, Code 1 is in UserForm2, and Code 2 is in Sheet 1.

Anyway, in the mean TIME, if anyone can tell me what I'm doing wrong, that'd be cool.

Otherwise, I'll put the whole pastebin together and probably have it linked in the next day or so.

Thanks!
-kyle_engineer
Permlevel is a public instance field of the UserForm. If you want a global variable, you need to declare it in a MODULE.

As a side note, if you put "Option Explicit" at the top of the Sheet's VBA Code it will flag Permlevel as not being declared. What it is doing is creating a new Variant variable when you use it. Ok. Cool. Thanks BC_Programmer.

I'll try all that, but it's unlikely that I won't be back with more questions. So, if I were to define each of the variables that I want to be globally shared, I could just define them in a module (under the Modules folder), then make the other sections of code Option Explicit?

Would this allow me to reference them whenever? Because I was reading something about variables being destroyed once their respective instance is stopped... Would this work, or am I thinking of this all wrong?

Most of my scripting/coding background is .bat, so even though VB is pretty old, I'm taking a big leap forward I think. And I've never been pro with .bat either. Lol! So sorry if I'm a little slow following.Quote from: kyle_engineer on December 05, 2012, 11:37:16 AM

So, if I were to define each of the variables that I want to be globally shared, I could just define them in a module (under the Modules folder), then make the other sections of code Option Explicit?
Yes and No. I'm basing this on Visual Basic 6, which is very similar to the VBA used in Word/Excel. My Experience with macros says it's exactly the same for this; and in Visual Basic 6, global variables had to be declared in a module, using either the "Public" or the "Global" keywords. (They ACTUALLY work the same).

Option Explicit is not required, however, it will flag when you use a variable you don't declare. In this case the use of the variable you thought would be publically accessible but wasn't would be flagged as undefined.



Quote
Would this allow me to reference them whenever? Because I was reading something about variables being destroyed once their respective instance is stopped... Would this work, or am I thinking of this all wrong?
Modules do not have "instances"; That is part of why they are required. With userForms, you can have two of the same UserForm present; if you declare a variable within that UserForm, those two instances are going to have distinct copies of that variable that are not the same. With modules, a publically accessible variable is accessible everywhere.

Ok. Cool.

So that worked for that part of the code. Now I have this properly passing from the userform to sheet1.

The next but is on this:

Code: [Select]'This ASSIGNS ranges to be used based on credentials.
Private Sub Range_Assignment()
Select Case PermLevel
Case "1"
Set ProtectedCells1 = Range("A:N")
Set ProtectedCells2 = Range("AT:AZ")
Case "2"
Set ProtectedCells1 = Range("K:M")
Set ProtectedCells2 = Range("AT:AZ")
Case "3"
AdminPerm = True
Case Else
MsgBox "There has been an error establishing your permissions. Please exit immediately.", vbExclamation, "WARNING!"
End Select
End Sub

'This block cells designated to be restricted based on user perm.
Private Sub Worksheet_SelectionChange1(ByVal Target As Range)
If Not AdminPerm = True Then

'This is the beginning of the first limited range.
If Not Intersect (Target, Range(ProtectedCells1)) Is Nothing Then
Application.ScreenUpdating = False
Set ProtectedCell = Target
MsgBox "You do not have permission to access this cell.", vbExclamation, "Insufficient Permissions"
Application.ScreenUpdating = True
Else
Set OriginalCell = Target
End If

Basically, it checks each time a selection change is made, to see if the new cell is in a restricted range, and bounces back if it is.

However, the range assignment is the part I'm having trouble with. The columns that I need to block are infinite, in that there will always be additions to them. So how do I tell it to use a bottomless range? :s

I did find a little snippet that will return the last row number of a column/range, but it's just a number (like "14"). So it's not too helpful at the moment either...

I'll have to modify a copy of this project, but I think I can probably post it so that you can see a little more what it's all about... (If wanted.)Try using Sheet1.Range instead of just range and use the Union method.
Code: [Select] Set ProtectedCells = Union(Sheet1.Range("A:N"), Sheet1.Range("AT:AZ"))
for example

I was able to do this code:
Code: [Select]Option Explicit
Sub test()
Dim r As Range
Set r = Union(Sheet1.Range("A:C"), Sheet1.Range("E:G"))
r.Select
End Sub

And it selected A:C and E:G properly

(untested) Modification of your code you could try:

Code: [Select]'This assigns ranges to be used based on credentials.
Private Sub Range_Assignment()
Select Case PermLevel
Case "1"
Set ProtectedCells = Union(Sheet1.Range("A:N"), Sheet1.Range("AT:AZ"))
Case "2"
Set ProtectedCells = Union(Range("K:M"), Range("AT:AZ"))
Case "3"
AdminPerm = True
Case Else
MsgBox "There has been an error establishing your permissions. Please exit immediately.", vbExclamation, "WARNING!"
End Select
End Sub

'This block cells designated to be restricted based on user perm.
Private Sub Worksheet_SelectionChange1(ByVal Target As Range)
If Not AdminPerm = True Then

'This is the beginning of the first limited range.
If Not Intersect (Target, ProtectedCells) Is Nothing Then
Application.ScreenUpdating = False
Set ProtectedCell = Target
MsgBox "You do not have permission to access this cell.", vbExclamation, "Insufficient Permissions"
Application.ScreenUpdating = True
Else
Set OriginalCell = Target
End If
Thanks Techno.

I'll slap this in my code and see how it runs.

If you feel like having another look at the script as a whole, I'll PM you the link to my pastebin.

THANKS!
kyle_engineer
1084.

Solve : Java is dead. What now??

Answer»

Given that Java is dead, what do you do now?
I want to write portable applications for mobile DEVICES. They told me you do it inn Java. Then I look into the stuff Google has for the Android. GUESS what? It is not PURE Java. It is more like Mocha with Irish whiskey.

So my question is: What do I do now? http://www.coronalabs.com/products/corona-sdk/
Cannot deal with the effectiveness of the above as an ALTERNATIVE. But it has been suggested as one.Given the lawsuit between oracle/sun and Google/java/android you may have to wait until that is resolved. Java is NOT dead it is only it's USE with Android that has been curtailed.truenorthQuote from: Geek-9pm on December 16, 2012, 02:52:26 PM

Guess what? It is not pure Java.
So?
1085.

Solve : How to write a batch file?

Answer»

Hello all, I am trying to write a batch file that will read the files in a folder on my computer. The path is O:/CustomerInvoices. Inside this folder there are 1000's of folders and each folder has three columns. What I want to do is find all records in the folder that have a date, which is in the third column, that is LESS than or equal to year 2010. I want to take the files that are in each folder and zip them with winrar and place the zip'ed files in separate folder. How do I do this? Please keep in mind that I know very little about batch files.Maybe vb, perl or powershell would be a better solution for you?definitely not a tak for batch. it might be possible... (doubtfully) but it would take a lot of work. im sure there is a better language for this.What type of files are they?Honestly, I don't have much of an idea. Since the number of records pre-2011 isn't going to change, it may be SIMPLER to just do it manually. All of the files should have a modified date..., so you may be able to use that ASSUMING that it wasn't changed since 2010. But there are a lot of variables that come into play with something like this. What I do know, is that building a script/program to do that could BECOME quite time consuming and complicated, and if it's not going to have significant benefit in the FUTURE, it doesn't sound like the right solution.

But, just in case someone feels like giving you different advice, you should tell us what kind of files these are (e.g. .txt, .rtf, .xls etc.) because that would also change the playing field a lot.

1086.

Solve : YouTube Throttling Buffer?

Answer»

There are many youtube video downloading programs and plugins. I really want to program one that downloads videos at the full speed provided by the ISP. If you load a youtube video, you will notice that it will start downloading/buffering really FAST and then begin to slow once it gets a CERTAIN percent buffered. I've never found a video downloader that circumvents this, so I was thinking of making one. There is one site, youtubemp3pro, that converts youtube videos to mp3s and it somehow is able to do this. The only problem is that that site is only used for mp3s and often has other issues. I know that if I keep clicking ahead in the video, I can force it to finish buffering much faster. How is flash player telling the server to do this? Would it be possible to make a flash program to do this? Can anyone help me figure out how this can be accomplished? Does that site have a partnership with youtube or something?

I know this is a lot of questions, but I am REALLY interested in making this happen because there is a real DEMAND for this type of program now.

EDIT: I know there are a few download accelerators, but none of them seemed to work for me.Quote

There is one site, youtubemp3pro, that converts youtube videos to mp3s and it somehow is able to do this.

Unless these videos are free for all, uncopyright, etc, this is illegal and I wouldnt do it. Taking full albums or even single music videos and making a MP3 collection out of them for free is no different than stealing MP3's thru a torrent.

Most the videos on youtube are free for listening/viewing only because advertising pays for them, and others are promo's to get you to buy the CD's or buy the music digitally. As long as its streamed with the painful 30 sec commercials its free for listening/viewing. Once downloaded if its copyright, its illegal because you are now in posession of something you didnt buy to pay royalties on as well as severed the revenue that the identity would get for each time its played and COMMERCIAL pops up that pays them for number of viewings.

To answer your question, many ISP's throttle your bandwidth depending on the source and so there might not be a WAY to avoid the slow down that you are having. Such as i had an FTP server and was getting throttled badly. I used this for sending large files between work and home on projects I was working on. I then switched to port 8077 after reading some information on some ISP's blocking or throttling FTP ports and no longer was throttled by my ISP when I used an alternate port. I doubt that you'd be able to use an alternate port to bypass the throttling in this case though.
1087.

Solve : quality of code?

Answer»

what is the quality of code for efficient?What are you ASKING/saying? Can you rephrase this?how efficient is a GOOD quality of code? hope this is better to understand
There are many ways to code and many THINGS to code in/for

I don't get the point of your questionYou SEEM to be asking a number of homework questions. I STRONGLY suggest you do some research on your own.

1088.

Solve : Switching from Notepad++ to Sublime (Custom language: PAWN)?

Answer»

Helllo.

I have encountered issues with Notepad++ due the fact I like dark themes and someone i know MENTIONED Sublime.
( See: http://postimage.org/image/tj1c709j5/ why N++ doesn't co-operate )

I like Sublime and I have managed to port the compiler shortcut from notepad++ which works fine.


The main issue is porting the syntax highlighting and auto-complete.

Highlight definition:
Code: [Select]<NotepadPlus>
<UserLang name="PAWN" ext="pwn inc own">
<Settings>
<Global caseIgnored="no" escapeChar="\"/>
<TreatAsSymbol comment="yes" commentLine="yes"/>
<Prefix words1="no" words2="no" words3="no" words4="no"/>
</Settings>
<KeywordLists>
<Keywords name="Delimiters">"'0"'0</Keywords>
<Keywords name="FOLDER+">{</Keywords>
<Keywords name="Folder-">}</Keywords>
<Keywords name="Operators">' - ! " % &amp; ( ) , : ; ? [ ] ^ { | } ~ + &lt; = &gt;</Keywords>
<Keywords name="Comment">1/* 2*/ 0//</Keywords>
<Keywords name="Words1">@receivepacket @receivestring AddMenuItem AddPlayerClass AddPlayerClassEx AddStaticPickup AddStaticVehicle AddStaticVehicleEx AddVehicleComponent AllowAdminTeleport AllowInteriorWeapons AllowPlayerTeleport ApplyAnimation Attach3DTextLabelToPlayer Attach3DTextLabelToVehicle AttachObjectToObject AttachObjectToPlayer AttachPlayerObjectToPlayer AttachTrailerToVehicle Ban BanEx CallLocalFunction CallRemoteFunction ChangeVehicleColor ChangeVehiclePaintjob ClearAnimations ConnectNPC Create3DTextLabel CreateExplosion CreateMenu CreateObject CreatePickup CreatePlayer3DTextLabel CreatePlayerObject CreateVehicle Delete3DTextLabel DeletePVar DeletePlayer3DTextLabel DestroyMenu DestroyObject DestroyPickup DestroyPlayerObject DestroyVehicle DetachTrailerFromVehicle DisableInteriorEnterExits DisableMenu DisableMenuRow DisableNameTagLOS DisablePlayerCheckpoint DisablePlayerRaceCheckpoint EnableStuntBonusForAll EnableStuntBonusForPlayer EnableTirePopping EnableZoneNames ForceClassSelection GameModeExit GameTextForAll GameTextForPlayer GangZoneCreate GangZoneDestroy GangZoneFlashForAll GangZoneFlashForPlayer GangZoneHideForAll GangZoneHideForPlayer GangZoneShowForAll GangZoneShowForPlayer GangZoneStopFlashForAll GangZoneStopFlashForPlayer GetAnimationName GetDistanceFromMeToPoint GetMaxPlayers GetNetworkStats GetObjectPos GetObjectRot GetPVarFloat GetPVarInt GetPVarNameAtIndex GetPVarString GetPVarType GetPVarsUpperIndex GetPlayerAmmo GetPlayerAnimationIndex GetPlayerArmedWeapon GetPlayerArmour GetPlayerArmour GetPlayerCameraFrontVector GetPlayerCameraPos GetPlayerColor GetPlayerDrunkLevel GetPlayerFacingAngle GetPlayerFightingStyle GetPlayerHealth GetPlayerHealth GetPlayerInterior GetPlayerIp GetPlayerKeys GetPlayerMenu GetPlayerMoney GetPlayerName GetPlayerObjectPos GetPlayerObjectRot GetPlayerPing GetPlayerPos GetPlayerScore GetPlayerSkin GetPlayerSpecialAction GetPlayerState GetPlayerSurfingVehicleID GetPlayerTargetPlayer GetPlayerTeam GetPlayerTime GetPlayerVehicleID GetPlayerVehicleSeat GetPlayerVelocity GetPlayerVirtualWorld GetPlayerWantedLevel GetPlayerWeapon GetPlayerWeaponData GetPlayerWeaponState GetServerVarAsBool GetServerVarAsInt GetServerVarAsString GetTickCount GetVehicleComponentInSlot GetVehicleComponentType GetVehicleDamageStatus GetVehicleHealth GetVehicleModel GetVehiclePos GetVehicleRotationQuat GetVehicleTrailer GetVehicleVelocity GetVehicleVirtualWorld GetVehicleZAngle GetWeaponName GivePlayerMoney GivePlayerWeapon HTTP HideMenuForPlayer IsObjectMoving IsPlayerAdmin IsPlayerConnected IsPlayerInAnyVehicle IsPlayerInCheckpoint IsPlayerInRaceCheckpoint IsPlayerInRangeOfPoint IsPlayerInRangeOfPoint IsPlayerInVehicle IsPlayerNPC IsPlayerObjectMoving IsPlayerStreamedIn IsPlayerStreamedIn IsTrailerAttachedToVehicle IsValidMenu IsValidObject IsValidPlayerObject IsVehicleStreamedIn IsVehicleStreamedIn Kick KillTimer LimitGlobalChatRadius LimitPlayerMarkerRadius LinkVehicleToInterior MoveObject MovePlayerObject OnClientMessage OnDialogResponse OnEnterExitModShop OnFilterScriptExit OnFilterScriptInit OnGameModeExit OnGameModeInit OnNPCConnect OnNPCDisconnect OnNPCEnterVehicle OnNPCExitVehicle OnNPCModeExit OnNPCModeInit OnNPCSpawn OnObjectMoved OnPlayerClickMap OnPlayerClickPlayer OnPlayerCommandText OnPlayerConnect OnPlayerDeath OnPlayerDeath OnPlayerDisconnect OnPlayerEnterCheckpoint OnPlayerEnterRaceCheckpoint OnPlayerEnterVehicle OnPlayerExitVehicle OnPlayerExitedMenu OnPlayerGiveDamage OnPlayerInteriorChange OnPlayerKeyStateChange OnPlayerLeaveCheckpoint OnPlayerLeaveRaceCheckpoint OnPlayerObjectMoved OnPlayerPickUpPickup OnPlayerRequestClass OnPlayerRequestSpawn OnPlayerSelectedMenuRow OnPlayerSpawn OnPlayerStateChange OnPlayerStreamIn OnPlayerStreamIn OnPlayerStreamOut OnPlayerStreamOut OnPlayerTakeDamage OnPlayerText OnPlayerUpdate OnRconCommand OnRconLoginAttempt OnRecordingPlaybackEnd OnVehicleDamageStatusUpdate OnVehicleDeath OnVehicleMod OnVehiclePaintjob OnVehicleRespray OnVehicleSpawn OnVehicleStreamIn OnVehicleStreamIn OnVehicleStreamOut OnVehicleStreamOut PauseRecordingPlayback PlayAudioStreamForPlayer PlayCrimeReportForPlayer PlayerPlaySound PlayerSpectatePlayer PlayerSpectateVehicle PutPlayerInVehicle RemoveBuildingForPlayer RemovePlayerFromVehicle RemovePlayerMapIcon RemoveVehicleComponent RepairVehicle ResetPlayerMoney ResetPlayerWeapons ResumeRecordingPlayback SendChat SendClientMessage SendClientMessageToAll SendCommand SendDeathMessage SendPlayerMessageToAll SendPlayerMessageToPlayer SendRconCommand SetCameraBehindPlayer SetDeathDropAmount SetGameModeText SetGravity SetMenuColumnHeader SetMyFacingAngle SetMyPos SetNameTagDrawDistance SetObjectPos SetObjectRot SetPVarFloat SetPVarInt SetPVarString SetPlayerAmmo SetPlayerArmedWeapon SetPlayerArmour SetPlayerCameraLookAt SetPlayerCameraPos SetPlayerChatBubble SetPlayerCheckpoint SetPlayerColor SetPlayerDrunkLevel SetPlayerFacingAngle SetPlayerFightingStyle SetPlayerHealth SetPlayerInterior SetPlayerMapIcon SetPlayerMarkerForPlayer SetPlayerName SetPlayerObjectPos SetPlayerObjectRot SetPlayerPos SetPlayerPosFindZ SetPlayerRaceCheckpoint SetPlayerScore SetPlayerShopName SetPlayerSkillLevel SetPlayerSkin SetPlayerSpecialAction SetPlayerTeam SetPlayerTime SetPlayerVelocity SetPlayerVirtualWorld SetPlayerWantedLevel SetPlayerWeather SetPlayerWorldBounds SetSpawnInfo SetTeamCount SetTimer SetTimerEx SetVehicleAngularVelocity SetVehicleHealth SetVehicleNumberPlate SetVehicleParamsForPlayer SetVehiclePos SetVehicleToRespawn SetVehicleVelocity SetVehicleVirtualWorld SetVehicleZAngle SetWeather SetWorldTime ShowMenuForPlayer ShowNameTags ShowPlayerDialog ShowPlayerMarkers ShowPlayerNameTagForPlayer SpawnPlayer StartRecordingPlayback StartRecordingPlayerData StopAudioStreamForPlayer StopObject StopPlayerObject StopRecordingPlayback StopRecordingPlayerData TextDrawAlignment TextDrawBackgroundColor TextDrawBoxColor TextDrawColor TextDrawCreate TextDrawDestroy TextDrawFont TextDrawHideForAll TextDrawHideForPlayer TextDrawLetterSize TextDrawSetOutline TextDrawSetProportional TextDrawSetShadow TextDrawSetString TextDrawShowForAll TextDrawShowForPlayer TextDrawTextSize TextDrawUseBox TogglePlayerClock TogglePlayerControllable TogglePlayerSpectating Update3DTextLabelText UpdatePlayer3DTextLabelText UpdateVehicleDamageStatus UsePlayerPedAnims acos asin atan atan2 clamp db_close db_field_name db_free_result db_get_field db_get_field_assoc db_next_row db_num_fields db_num_rows db_open db_query deleteproperty existproperty fblockread fblockwrite fclose fexist fgetchar flength float floatabs floatadd floatcmp floatcos floatdiv floatfract floatlog floatmul floatpower floatround floatsin floatsqroot floatstr floatsub floattan fmatch fopen format fputchar fread fremove fseek ftemp funcidx fwrite getarg getdate getproperty gettime heapspace ispacked listenport max memcpy min numargs print printf random sendpacket sendstring setarg setproperty strcat strcmp strdel strfind strins STRLEN strmid strpack strunpack strval swapchars tickcount tolower toupper uudecode uuencode valstr AttachObjectToVehicle SetPlayerAttachedObject RemovePlayerAttachedObject IsPlayerAttachedObjectSlotUsed ManualVehicleEngineAndLights SetVehicleParamsEx GetVehicleParamsEx</Keywords>
<Keywords name="Words2">SPECIAL_ACTION_NONE SPECIAL_ACTION_DUCK SPECIAL_ACTION_USEJETPACK SPECIAL_ACTION_ENTER_VEHICLE SPECIAL_ACTION_EXIT_VEHICLE SPECIAL_ACTION_DANCE1 SPECIAL_ACTION_DANCE2 SPECIAL_ACTION_DANCE3 SPECIAL_ACTION_DANCE4 SPECIAL_ACTION_HANDSUP SPECIAL_ACTION_USECELLPHONE SPECIAL_ACTION_SITTING SPECIAL_ACTION_STOPUSECELLPHONE SPECIAL_ACTION_DRINK_BEER SPECIAL_ACTION_SMOKE_CIGGY SPECIAL_ACTION_DRINK_WINE SPECIAL_ACTION_DRINK_SPRUNK FIGHT_STYLE_NORMAL FIGHT_STYLE_BOXING FIGHT_STYLE_KUNGFU FIGHT_STYLE_KNEEHEAD FIGHT_STYLE_GRABKICK FIGHT_STYLE_ELBOW WEAPONSKILL_PISTOL WEAPONSKILL_PISTOL_SILENCED WEAPONSKILL_DESERT_EAGLE WEAPONSKILL_SHOTGUN WEAPONSKILL_SAWNOFF_SHOTGUN WEAPONSKILL_SPAS12_SHOTGUN WEAPONSKILL_MICRO_UZI WEAPONSKILL_MP5 WEAPONSKILL_AK47 WEAPONSKILL_M4 WEAPONSKILL_SNIPERRIFLE WEAPONSTATE_UNKNOWN WEAPONSTATE_NO_BULLETS WEAPONSTATE_LAST_BULLET WEAPONSTATE_MORE_BULLETS WEAPONSTATE_RELOADING PLAYER_VARTYPE_NONE PLAYER_VARTYPE_INT PLAYER_VARTYPE_STRING PLAYER_VARTYPE_FLOAT MAX_CHATBUBBLE_LENGTH SPECTATE_MODE_NORMAL SPECTATE_MODE_FIXED SPECTATE_MODE_SIDE PLAYER_RECORDING_TYPE_NONE PLAYER_RECORDING_TYPE_DRIVER PLAYER_RECORDING_TYPE_ONFOOT _objects_included _samp_included PLAYER_RECORDING_TYPE_NONE PLAYER_RECORDING_TYPE_DRIVER PLAYER_RECORDING_TYPE_ONFOOT PLAYER_STATE_NONE PLAYER_STATE_ONFOOT PLAYER_STATE_DRIVER PLAYER_STATE_PASSENGER PLAYER_STATE_WASTED PLAYER_STATE_SPAWNED PLAYER_STATE_SPECTATING MAX_PLAYER_NAME MAX_PLAYERS MAX_VEHICLES INVALID_PLAYER_ID INVALID_VEHICLE_ID NO_TEAM MAX_OBJECTS INVALID_OBJECT_ID MAX_GANG_ZONES MAX_TEXT_DRAWS MAX_MENUS INVALID_MENU INVALID_TEXT_DRAW INVALID_GANG_ZONE WEAPON_BRASSKNUCKLE WEAPON_GOLFCLUB WEAPON_NITESTICK WEAPON_KNIFE WEAPON_BAT WEAPON_SHOVEL WEAPON_POOLSTICK WEAPON_KATANA WEAPON_CHAINSAW WEAPON_DILDO WEAPON_DILDO2 WEAPON_VIBRATOR WEAPON_VIBRATOR2 WEAPON_FLOWER WEAPON_CANE WEAPON_GRENADE WEAPON_TEARGAS WEAPON_MOLTOV WEAPON_COLT45 WEAPON_SILENCED WEAPON_DEAGLE WEAPON_SHOTGUN WEAPON_SAWEDOFF WEAPON_SHOTGSPA WEAPON_UZI WEAPON_MP5 WEAPON_AK47 WEAPON_M4 WEAPON_TEC9 WEAPON_RIFLE WEAPON_SNIPER WEAPON_ROCKETLAUNCHER WEAPON_HEATSEEKER WEAPON_FLAMETHROWER WEAPON_MINIGUN WEAPON_SATCHEL WEAPON_BOMB WEAPON_SPRAYCAN WEAPON_FIREEXTINGUISHER WEAPON_CAMERA WEAPON_PARACHUTE WEAPON_VEHICLE WEAPON_DROWN WEAPON_COLLISION KEY_ACTION KEY_CROUCH KEY_FIRE KEY_SPRINT KEY_SECONDARY_ATTACK KEY_JUMP KEY_LOOK_RIGHT KEY_HANDBRAKE KEY_LOOK_LEFT KEY_SUBMISSION KEY_LOOK_BEHIND KEY_WALK KEY_ANALOG_UP KEY_ANALOG_DOWN KEY_ANALOG_RIGHT KEY_ANALOG_LEFT KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT HTTP_GET HTTP_POST HTTP_HEAD HTTP_ERROR_BAD_HOST HTTP_ERROR_NO_SOCKET HTTP_ERROR_CANT_CONNECT HTTP_ERROR_CANT_WRITE HTTP_ERROR_CONTENT_TOO_BIG HTTP_ERROR_MALFORMED_RESPONSE _time_included _string_included _Float_included _file_included _datagram_included _core_included _vehicles_included CARMODTYPE_SPOILER CARMODTYPE_HOOD CARMODTYPE_ROOF CARMODTYPE_SIDESKIRT CARMODTYPE_LAMPS CARMODTYPE_NITRO CARMODTYPE_EXHAUST CARMODTYPE_WHEELS CARMODTYPE_STEREO CARMODTYPE_HYDRAULICS CARMODTYPE_FRONT_BUMPER CARMODTYPE_REAR_BUMPER CARMODTYPE_VENT_RIGHT CARMODTYPE_VENT_LEFT _sampdb_included _samp_included MAX_PLAYER_NAME MAX_PLAYERS MAX_VEHICLES INVALID_PLAYER_ID INVALID_VEHICLE_ID NO_TEAM MAX_OBJECTS INVALID_OBJECT_ID MAX_GANG_ZONES MAX_TEXT_DRAWS MAX_MENUS MAX_3DTEXT_GLOBAL MAX_3DTEXT_PLAYER MAX_PICKUPS INVALID_MENU INVALID_TEXT_DRAW INVALID_GANG_ZONE INVALID_3DTEXT_ID DIALOG_STYLE_MSGBOX DIALOG_STYLE_INPUT DIALOG_STYLE_LIST DIALOG_STYLE_PASSWORD PLAYER_STATE_NONE PLAYER_STATE_ONFOOT PLAYER_STATE_DRIVER PLAYER_STATE_PASSENGER PLAYER_STATE_EXIT_VEHICLE PLAYER_STATE_ENTER_VEHICLE_DRIVER PLAYER_STATE_ENTER_VEHICLE_PASSENGER PLAYER_STATE_WASTED PLAYER_STATE_SPAWNED PLAYER_STATE_SPECTATING PLAYER_MARKERS_MODE_OFF PLAYER_MARKERS_MODE_GLOBAL PLAYER_MARKERS_MODE_STREAMED WEAPON_BRASSKNUCKLE WEAPON_GOLFCLUB WEAPON_NITESTICK WEAPON_KNIFE WEAPON_BAT WEAPON_SHOVEL WEAPON_POOLSTICK WEAPON_KATANA WEAPON_CHAINSAW WEAPON_DILDO WEAPON_DILDO2 WEAPON_VIBRATOR WEAPON_VIBRATOR2 WEAPON_FLOWER WEAPON_CANE WEAPON_GRENADE WEAPON_TEARGAS WEAPON_MOLTOV WEAPON_COLT45 WEAPON_SILENCED WEAPON_DEAGLE WEAPON_SHOTGUN WEAPON_SAWEDOFF WEAPON_SHOTGSPA WEAPON_UZI WEAPON_MP5 WEAPON_AK47 WEAPON_M4 WEAPON_TEC9 WEAPON_RIFLE WEAPON_SNIPER WEAPON_ROCKETLAUNCHER WEAPON_HEATSEEKER WEAPON_FLAMETHROWER WEAPON_MINIGUN WEAPON_SATCHEL WEAPON_BOMB WEAPON_SPRAYCAN WEAPON_FIREEXTINGUISHER WEAPON_CAMERA WEAPON_PARACHUTE WEAPON_VEHICLE WEAPON_DROWN WEAPON_COLLISION KEY_ACTION KEY_CROUCH KEY_FIRE KEY_SPRINT KEY_SECONDARY_ATTACK KEY_JUMP KEY_LOOK_RIGHT KEY_HANDBRAKE KEY_LOOK_LEFT KEY_SUBMISSION KEY_LOOK_BEHIND KEY_WALK KEY_ANALOG_UP KEY_ANALOG_DOWN KEY_ANALOG_LEFT KEY_ANALOG_RIGHT KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT CLICK_SOURCE_SCOREBOARD floatround_round floatround_floor floatround_ceil floatround_tozero floatround_unbiased seek_start seek_current seek_end EOS cellbits cellmax cellmin charbits charmin charmax ucharmax __Pawn debug overlaysize radian degrees grades MAX_PLAYER_ATTACHED_OBJECTS VEHICLE_PARAMS_UNSET VEHICLE_PARAMS_OFF VEHICLE_PARAMS_ON</Keywords>
<Keywords name="Words3">#assert #define #else #elseif #endif #endinput #error #file #if #include #line #pragma #tryinclude #undef #emit</Keywords>
<Keywords name="Words4">DB DBResult File Float Menu PlayerText3D Text Text3D _ anglemode assert bool break case char const continue default defined do else enum exit false filemode floatround_method for forward goto if library native new operator public return seek_whence sizeof sleep state static stock SWITCH tagof true while</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="FFFFFF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="FFFFFF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="FFFFFF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="KEYWORD1" styleID="5" fgColor="000080" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="KEYWORD2" styleID="6" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="KEYWORD3" styleID="7" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="1"/>
<WordsStyle name="KEYWORD4" styleID="8" fgColor="0000C0" bgColor="FFFFFF" fontName="" fontStyle="1"/>
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="NUMBER" styleID="4" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="OPERATOR" styleID="10" fgColor="FFFFFF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="DELIMINER1" styleID="14" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="DELIMINER2" styleID="15" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0"/>
<WordsStyle name="DELIMINER3" styleID="16" fgColor="FFFFFF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
</Styles>
</UserLang>
</NotepadPlus>
Autocomplete: http://pastebin.ca/2252634
(Does not fit in post)

Help would be greatly appreciated.

1089.

Solve : What is this? in lay terms please?

Answer»

/*1351386131,173213487*/

if (self.CavalryLogger) { CavalryLogger.start_js(["Z3urS"]); }

if(!Array.isArray)Array.isArray=function(a){return Object.prototype.toString.call(a)=='[object Array]';};
if(!Array.prototype.map)Array.prototype.map=function(a,b){if(typeof a!='function')throw new TypeError();var c,d=this.length,e=new Array(d);for(c=0;c===a)return b;return -1;};
if(!Date.now)Date.now=function(){return new Date().getTime();};
window.__DEV__=window.__DEV__||0;
if(!Function.prototype.bind)Function.prototype.bind=function(a){if(typeof this!='function')throw new TypeError('Bind must be called on a function');var b=this,c=Array.prototype.slice.call(arguments,1);function d(){return b.apply(a,c.concat(Array.prototype.slice.call(arguments)));}d.displayName='bound:'+(b.displayName||b.name||'(?)');d.toString=function e(){return 'bound: '+b;};return d;};

var JSON;if(!JSON)JSON={};(function(){function a(j){return j<10?'0'+j:j;}if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(j){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+a(this.getUTCMonth()+1)+'-'+a(this.getUTCDate())+'T'+a(this.getUTCHours())+':'+a(this.getUTCMinutes())+':'+a(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(j){return this.valueOf();};}var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,d,e,f={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},g;function h(j){c.lastIndex=0;return c.test(j)?'"'+j.replace(c,function(k){var l=f[k];return typeof l==='string'?l:'\\u'+('0000'+k.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+j+'"';}function i(j,k){var l,m,n,o,p=d,q,r=k[j];if(r&&typeof r==='object'&&typeof r.toJSON==='function')r=r.toJSON(j);if(typeof g==='function')r=g.call(k,j,r);switch(typeof r){case 'string':return h(r);case 'number':return isFinite(r)?String(r):'null';case 'boolean':case 'null':return String(r);case 'object':if(!r)return 'null';d+=e;q=[];if(Object.prototype.toString.apply(r)==='[object Array]'){o=r.length;for(l=0;l<o;l+=1)q[l]=i(l,r)||'null';n=q.length===0?'[]':d?'[\n'+d+q.join(',\n'+d)+'\n'+p+']':'['+q.join(',')+']';d=p;return n;}if(g&&typeof g==='object'){o=g.length;for(l=0;l<o;l+=1)if(typeof g[l]==='string'){m=g[l];n=i(m,r);if(n)q.push(h(m)+(d?': ':':')+n);}}else for(m in r)if(Object.prototype.hasOwnProperty.call(r,m)){n=i(m,r);if(n)q.push(h(m)+(d?': ':':')+n);}n=q.length===0?'{}':d?'{\n'+d+q.join(',\n'+d)+'\n'+p+'}':'{'+q.join(',')+'}';d=p;return n;}}if(typeof JSON.stringify!=='function')JSON.stringify=function(j,k,l){var m;d='';e='';if(typeof l==='number'){for(m=0;m<l;m+=1)e+=' ';}else if(typeof l==='string')e=l;g=k;if(k&&typeof k!=='function'&&(typeof k!=='object'||typeof k.length!=='number'))throw new Error('JSON.stringify');return i('',{'':j});};if(typeof JSON.parse!=='function')JSON.parse=function(j,k){var l;function m(n,o){var p,q,r=n

  • ;if(r&&typeof r==='object')for(p in r)if(Object.prototype.hasOwnProperty.call(r,p)){q=m(r,p);if(q!==undefined){r[p]=q;}else delete r[p];}return k.call(n,o,r);}j=String(j);b.lastIndex=0;if(b.test(j))j=j.replace(b,function(n){return '\\u'+('0000'+n.charCodeAt(0).toString(16)).slice(-4);});if(/^[\],:{}\s]*$/.test(j.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){l=(eval)('('+j+')');return typeof k==='function'?m({'':l},''):l;}throw new SyntaxError('JSON.parse');};}());

if(!JSON.stringify.__fb)JSON.stringify=function(a){function b(){var c=a.apply(this,arguments);if(!c)return c;return c.replace(/[%\u2028\u2029]/g,function(d){var e=d.charCodeAt(0).toString(16);return '\\u0000'.substring(0,6-e.length)+e;});}b.__fb=true;return b;}(JSON.stringify);
if(!Object.create)Object.create=function(a){var b=typeof a;if(b!='object'&&b!='function')throw new TypeError('Object prototype may only be a Object or null');var c=new Function();c.prototype=a;return new c();};if(!Object.keys)Object.keys=function(a){var b=typeof a;if(b!='object'&&b!='function'||a===null)throw new TypeError('Object.keys called on non-object');var c=[];for(var d in a)if(Object.prototype.hasOwnProperty.call(a,d))c.push(d);var e=!({toString:true}).propertyIsEnumerable('toString'),f=['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','prototypeIsEnumerable','constructor'];if(e)for(var g=0;g<f.length;g++){var h=f[g];if(Object.prototype.hasOwnProperty.call(a,h))c.push(h);}return c;};

if(!String.prototype.trim)String.prototype.trim=function(){if(this==null)throw new TypeError('String.prototype.trim called on null or undefined');return String.prototype.replace.call(this,/^\s+|\s+$/g,'');};
var undef,nativeSplit=String.prototype.split,compliantExecNpcg=/()??/.exec("")[1]===undef;String.prototype.split=function(a,b){var c=this;if(Object.prototype.toString.call(a)!=="[object RegExp]")return nativeSplit.call(c,a,b);var d=[],e=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),f=0,a=new RegExp(a.source,e+"g"),g,h,i,j;c+="";if(!compliantExecNpcg)g=new RegExp("^"+a.source+"$(?!\\s)",e);b=b===undef?-1>>>0:b>>>0;while(h=a.exec(c)){i=h.index+h[0].length;if(i>f){d.push(c.slice(f,h.index));if(!compliantExecNpcg&&h.length>1)h[0].replace(g,function(){for(var k=1;k<arguments.length-2;k++)if(arguments[k]===undef)h[k]=undef;});if(h.length>1&&h.index<c.length)Array.prototype.push.apply(d,h.slice(1));j=h[0].length;f=i;if(d.length>=b)break;}if(a.lastIndex===h.index)a.lastIndex++;}if(f===c.length){if(j||!a.test(""))d.push("");}else d.push(c.slice(f));return d.length>b?d.slice(0,b):d;};
var console;if(!console)(function(){function a(){}console={log:a,info:a,warn:a,debug:a,dir:a,error:a};})();
function bagofholding(){}function bagof(a){return function(){return a;};}Array.prototype.reduce=null;Array.prototype.reduceRight=null;document.documentElement.className=document.documentElement.className.replace('no_js','');
(function(a){if(a.require)return;var b={},c={},d={},e=0,f=1,g=2,h=Object.prototype.hasOwnProperty;function i(t){var u=b[t],v,w,x;if(!b[t]){x='Requiring unknown module "'+t+'"';throw new Error(x);}if(u.waiting&&u.special&g)l();if(u.waiting){x='Requiring module "'+t+'" with unresolved dependencies';throw new Error(x);}if(!u.exports){var y=u.exports={},z=u.factory;if(Object.prototype.toString.call(z)==='[object Function]'){var aa=[],ba=u.dependencies,ca=ba.length;if(u.special&g)ca=Math.min(ca,z.length);for(w=0;w<ca;w++){v=ba[w];aa.push(v==='module'?u:(v==='exports'?y:i(v)));}var da=z.apply(u.context||a,aa);if(da)u.exports=da;}else u.exports=z;}if(u.refcount--===1)delete b[t];return u.exports;}function j(t,u,v,w,x,y){if(u===undefined){u=[];v=t;t=n();}else if(v===undefined){v=u;u=t;t=n();}var z=b[t];if(z){if(y)z.refcount+=y;return;}else if(!u&&!v&&y){d[t]=(d[t]||0)+y;return;}else{z={id:t};z.refcount=(d[t]||0)+(y||0);delete d[t];}z.factory=v;z.dependencies=u;z.context=x;z.special=w;b[t]=z;o(t);}function k(t,u,v){j(t,u,undefined,f,v,1);}function l(){var t={},u;for(u in c)if(h.call(c,u))if(b&&!t&&b.special&g)m({},u,t);}function m(t,u,v){v=1;var w=c,x;if(!w)return;t=1;for(x in w)if(h.call(w,x)){if(!b
  • .special&g)continue;if(t
  • ){delete w
  • ;b
  • .waiting--;if(!b
  • .waiting)p(x);}else m(t,x,v);}t=0;}function n(){return '__mod__'+e++;}function o(t){var u=b[t],v=0;for(var w=0;w<u.dependencies.length;w++){var x=u.dependencies[w];if(!b
    • ||b
    • .waiting){c
    • ||(c
    • ={});if(!c
    • [t])v++;c
    • [t]=1;}}u.waiting=v;if(!v)p(t);}function p(t){var u=b[t];if(u.special&f)i(t);var v=c[t];if(v){delete c[t];for(var w in v)if(h.call(v,w))if(!--b[w].waiting)p(w);}}function q(t,u){b[t]={id:t};b[t].exports=u;}q('module',0);q('exports',0);q('define',j);q('global',a);q('require',i);q('requireDynamic',i);q('requireLazy',k);j.amd={};a.define=j;a.require=i;a.requireDynamic=i;a.requireLazy=k;i.__debug={modules:b,deps:c};var r=false,s=function(t,u,v,w){j(t,u,v,w||g);if(b[t].waiting&&!r)r=setTimeout(function(){l();r=false;},9);};a.__d=function(t,u,v,w){u=['global','require','requireDynamic','requireLazy','module','exports'].concat(u);s(t,u,v,w);};a.__e=a.__d;})(this);

    __d("lowerDomain",[],function(a,b,c,d,e,f){if(document.domain.toLowerCase().match(/(^|\.)facebook\..*/))document.domain=window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1');});
    __d("hasArrayNature",[],function(a,b,c,d,e,f){function g(h){return (!!h&&(typeof h=='object'||typeof h=='function')&&('length' in h)&&!('SETINTERVAL' in h)&&(Object.prototype.toString.call(h)==="[object Array]"||('callee' in h)||('item' in h)));}e.exports=g;});
    __d("createArrayFrom",["hasArrayNature"],function(a,b,c,d,e,f){var g=b('hasArrayNature');function h(i){if(!g(i))return ;if(i.item){var j=i.length,k=new Array(j);while(j--)k[j]=i[j];return k;}return Array.prototype.slice.call(i);}e.exports=h;});
    __d("function-extensions",["createArrayFrom"],function(a,b,c,d,e,f){var g=b('createArrayFrom');Function.prototype.curry=function(){var h=g(arguments);return this.bind.apply(this,[null].concat(h));};Function.prototype.shield=function(h){if(typeof this!='function')throw new TypeError();var i=this.bind.apply(this,g(arguments));return function(){return i();};};Function.prototype.defer=function(h,i){if(typeof this!='function')throw new TypeError();h=h||0;return setTimeout(this,h,i);};},3);
    __d("copyProperties",[],function(a,b,c,d,e,f){function g(h,i,j,k,l,m,n){h=h||{};var o=[i,j,k,l,m],p=0,q;while(o[p]){q=o[p++];for(var r in q)h[r]=q[r];if(q.hasOwnProperty&&q.hasOwnProperty('toString')&&(typeof q.toString!='undefined')&&(h.toString!==q.toString))h.toString=q.toString;}return h;}e.exports=g;});
    __d("Env",["copyProperties"],function(a,b,c,d,e,f){var g=b('copyProperties'),h={start:Date.now()};if(a.Env){g(h,a.Env);a.Env=undefined;}e.exports=h;});
    __d("ErrorUtils",["Env"],function(a,b,c,d,e,f){var g=b('Env'),h=[],i=[],j=10,k=window.chrome&&'type' in new Error();function l(q){if(!q){return {};}else if(q._originalError)return q;var r={line:q.lineNumber||q.line,message:q.message,name:q.name,script:q.fileName||q.sourceURL||q.script,stack:q.stackTrace||q.stack};r._originalError=q;if(k&&/(\w{3,5}:\/\/[^:]+)\d+)/.test(q.stack)){r.script=RegExp.$1;r.line=parseInt(RegExp.$2,10);}for(var s in r)(r==null&&delete r);return r;}function m(q,r){q=l(q);!r;if(i.length<j)i.push(q);for(var s=0;s<h.length;s++)try{h(q);}catch(t){}}function n(q,r,s,t){if(g.nocatch||(/nocatch/).test(location.search))return q.apply(r,s||[]);try{return q.apply(r,s||[]);}catch(u){var v=l(u);if(t)t(v);v.callee=q.toString().substring(0,100);if(s)v.args=String(s).substring(0,100);m(v);}}function o(q,r,s){m({message:q,script:r,line:s},true);}window.onerror=o;function p(q,r){h.push(q);if(!r)i.forEach(q);}e.exports={history:i,onerror:o,reportError:m,normalizeError:l,applyWithGuard:n,addListener:p};});
    __d("ServerJS",["function-extensions","ErrorUtils","copyProperties"],function(a,b,c,d,e,f){b('function-extensions');var g=b('ErrorUtils'),h=b('copyProperties');function i(){this._moduleMap={};this._relativeTo=null;}h(i.prototype,{handle:function(n){g.applyWithGuard(function(o){if(o.__guard)throw new Error('ServerJS.handle called on data that has already been handled');o.__guard=true;k(o.define||[],this._handleDefine,this);k(o.markup||[],this._handleMarkup,this);k(o.elements||[],this._handleElement,this);k(o.instances||[],this._handleInstance,this);k(o.require||[],this._handleRequire,this);},this,[].concat(n));},handlePartial:function(n){(n.instances||[]).forEach(l.curry(this._moduleMap,3));(n.markup||[]).forEach(l.curry(this._moduleMap,2));this.handle(n);},cleanup:function(){var n=[];for(var o in this._moduleMap)n.push(o);d.call(null,n,m);this._moduleMap={};},setRelativeTo:function(n){this._relativeTo=n;return this;},_handleDefine:function(n,o,p){define(n,o,function(){this._replaceTransportMarkers(p);return p;}.bind(this));},_handleRequire:function(n,o,p,q){var r=[n].concat(p||[]);d(r,function(s){q&&this._replaceTransportMarkers(q);if(o){if(!s
    • )throw new TypeError('Module '+n+' has no method '+o);s
    • .apply(s,q||[]);}}.bind(this));},_handleInstance:function(n,o,p,q){var r=null;if(o)r=function(s){this._replaceTransportMarkers(p);var t=Object.create(s.prototype);s.apply(t,p);return t;}.bind(this);define(n,o,r,0,null,q);},_handleMarkup:function(n,o,p){define(n,['HTML'],function(q){return q.replaceJSONWrapper(o).getRootNode();},0,null,p);},_handleElement:function(n,o,p,q){var r=q?[q]:[];define(n,r,function(s){var t=j(o,s);return t;},0,null,p);},_replaceTransportMarkers:function(n,o){var p=(typeof o!=='undefined')?n
    • :n,q;if(Array.isArray(p)){for(q=0;q<p.length;q++)this._replaceTransportMarkers(p,q);}else if(p&&typeof p=='object')if(p.__m){n
    • =b(p.__m);}else if(p.__e){n
    • =j(p.__e);}else if(p.__rel){n
    • =this._relativeTo;}else for(var r in p)this._replaceTransportMarkers(p,r);}});function j(n,o){var p,q,r;if(o){if(o.id==n){p=o;}else if(o.getElementsByTagName){q=o.getElementsByTagName('*');for(r=0;r<q.length;r++)if(q[r].id==n){p=q[r];break;}}else{q=o.childNodes;for(r=0;r<q.length;r++){p=j(n,q[r]);if(p)break;}}}else p=document.getElementById(n);return p;}function k(n,o,p){for(var q=0;q<n.length;q++)o.apply(p,[].concat(n[q]));}function l(n,o,p){var q=p[0];if(!(q in n))p
    • =(p
    • ||0)+1;n[q]=true;}function m(){return {};}e.exports=i;});

    __d("Arbiter",["ErrorUtils","copyProperties","createArrayFrom","hasArrayNature"],function(a,b,c,d,e,f){var g=b('ErrorUtils'),h=b('copyProperties'),i=b('createArrayFrom'),j=b('hasArrayNature');if(!window.async_callback)window.async_callback=function(m,n){return m;};function k(){h(this,{_listeners:[],_events:{},_callbacks:{},_last_id:1,_listen:{},_index:{}});h(this,k);}h(k,{SUBSCRIBE_NEW:'new',SUBSCRIBE_ALL:'all',BEHAVIOR_EVENT:'event',BEHAVIOR_PERSISTENT:'persistent',BEHAVIOR_STATE:'state',LIVEMESSAGE:'livemessage',BOOTLOAD:'bootload',FUNCTION_EXTENSION:'function_ext',subscribe:function(m,n,o){m=i(m);var p=m.some(function(x){return !x||typeof(x)!='string';});if(p)return null;o=o||k.SUBSCRIBE_ALL;var q=k._getInstance(this);q._listeners.push({callback:n,types:m});var r=q._listeners.length-1;for(var s=0;s<m.length;s++){var t=m;if(!q._index[t])q._index[t]=[];q._index[t].push(r);if(o==k.SUBSCRIBE_ALL)if(t in q._events)for(var u=0;u<q._events[t].length;u++){var v=q._events[t],w=g.applyWithGuard(n,null,[t,v]);if(w===false){q._events[t].splice(u,1);u--;}}}return new l(q,r);},unsubscribe:function(m){m.unsubscribe();},inform:function(m,n,o){var p=j(m);m=i(m);var q=k._getInstance(this),r={};o=o||k.BEHAVIOR_EVENT;for(var s=0;s<m.length;s++){var t=m,u=null;if(o==k.BEHAVIOR_PERSISTENT){u=q._events.length;if(!(t in q._events))q._events[t]=[];q._events[t].push(n);q._events[t]._stateful=false;}else if(o==k.BEHAVIOR_STATE){u=0;q._events[t]=[n];q._events[t]._stateful=true;}else if(t in q._events)q._events[t]._stateful=false;a.ArbiterMonitor&&a.ArbiterMonitor.record('event',t,n,q);var v;if(q._index[t]){var w=i(q._index[t]);for(var x=0;x<w.length;x++){var y=q._listeners[w
    • ];if(y){v=g.applyWithGuard(y.callback,null,[t,n]);if(v===false){if(u!==null)q._events[t].splice(u,1);break;}}}}q._updateCallbacks(t,n);a.ArbiterMonitor&&a.ArbiterMonitor.record('done',t,n,q);r[t]=v;}return p?r:r[m[0]];},query:function(m){var n=k._getInstance(this);if(!(m in n._events))return null;if(n._events[m].length)return n._events[m][0];return null;},_instance:null,_getInstance:function(m){if(m instanceof k)return m;if(!k._instance)k._instance=new k();return k._instance;},registerCallback:function(m,n){var o,p=0,q=k._getInstance(this),r=false;if(typeof m=='function'){o=q._last_id;q._last_id++;r=true;}else{if(!q._callbacks[m])return null;o=m;}if(j(n)){var s={};for(var t=0;t<n.length;t++)s[n[t]]=1;n=s;}for(var u in n){try{if(q.query(u))continue;}catch(v){}p+=n;if(q._listen===undefined)q._listen={};q._listen
      • =(q._listen
        • ||0)+n;}if(p===0&&r){g.applyWithGuard(m);return null;}if(!r){q._callbacks
          • .depnum+=p;}else q._callbacks
          • ={callback:window.async_callback(m,'arbiter'),depnum:p};return o;},_updateCallbacks:function(m,n){if(n===null||!this._listen[m])return;for(var o in this._listen[m]){this._listen[m]
          • --;if(this._listen[m]
          • <=0)delete this._listen[m]
          • ;this._callbacks
          • .depnum--;if(this._callbacks
          • .depnum<=0){var p=this._callbacks
          • .callback;delete this._callbacks
          • ;g.applyWithGuard(p);}}}});function l(m,n){this._instance=m;this._id=n;}h(l.prototype,{unsubscribe:function(){var m=this._instance._listeners,n=m[this._id];if(!n)return;for(var o=0;o<n.types.length;o++){var p=n.types
          • ,q=this._instance._index[p];if(q)for(var r=0;r<q.length;r++)if(q[r]==this._id){q.splice(r,1);if(q.length===0)delete q[p];break;}}delete m[this._id];}});e.exports=k;});

          __d("ArbiterFrame",[],function(a,b,c,d,e,f){var g={inform:function(h,i,j){var k=PARENT.frames,l=k.length;for(var m=0;m<l;m++)try{if(k[m]&&k[m]!=window&&k[m].require)k[m].require('Arbiter').inform(h,i,j);}catch(n){}}};e.exports=g;});
          __d("Plugin",["Arbiter","ArbiterFrame"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('ArbiterFrame'),i={CONNECT:'platform/plugins/connect',DISCONNECT:'platform/plugins/disconnect',ERROR:'platform/plugins/error',connect:function(j,k){var l={identifier:j,href:j,story_fbid:k};g.inform(i.CONNECT,l);h.inform(i.CONNECT,l);},disconnect:function(j,k){var l={identifier:j,href:j,story_fbid:k};g.inform(i.DISCONNECT,l);h.inform(i.DISCONNECT,l);},error:function(j,k){g.inform(i.ERROR,{action:j,content:k});}};e.exports=i;});
          __d("PluginPrelude",["lowerDomain","ServerJS","Plugin"],function(a,b,c,d,e,f){b('lowerDomain');b('ServerJS');b('Plugin');});
          __d("Cookie",["Env"],function(a,b,c,d,e,f){var g=b('Env'),h={set:function(i,j,k,l,m){if(g.no_cookies&&i!='tpa')return;document.cookie=i+"="+encodeURIComponent(j)+"; "+(k?"expires="+(new Date(Date.now()+k)).toGMTString()+"; ":"")+"path="+(l||'/')+"; domain="+window.location.hostname.replace(/^.*(\.facebook\..*)$/i,'$1')+(m?"; secure":"");},clear:function(i){document.cookie=i+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; "+"path=/; domain="+window.location.hostname.replace(/^.*(\.facebook\..*)$/i,'$1');},get:function(i){var j=document.cookie.match('(?:^|;\\s*)'+i+'=(.*?)(?:;|$)');return (j?decodeURIComponent(j[1]):j);}};e.exports=h;});
          __d("DOMEvent",["copyProperties"],function(a,b,c,d,e,f){var g=b('copyProperties');function h(i){this.event=i||window.event;this.target=this.event.target||this.event.srcElement;}g(h.prototype,{preventDefault:function(){var i=this.event;i.preventDefault?i.preventDefault():i.returnValue=false;return this;},stopPropagation:function(){var i=this.event;i.stopPropagation?i.stopPropagation():i.cancelBubble=true;return this;},kill:function(){this.stopPropagation().preventDefault();return this;}});e.exports=h;});
          __d("DOMEventListener",[],function(a,b,c,d,e,f){var g,h;if(window.addEventListener){g=function(j,k,l){j.addEventListener(k,l,false);};h=function(j,k,l){j.removeEventListener(k,l,false);};}else if(window.attachEvent){g=function(j,k,l){j.attachEvent('on'+k,l);};h=function(j,k,l){j.detachEvent('on'+k,l);};}var i={add:function(j,k,l){g(j,k,l);return {remove:function(){h(j,k,l);j=null;}};},remove:h};e.exports=i;});
          __d("ge",[],function(a,b,c,d,e,f){function g(h){return typeof h=='string'?document.getElementById(h):h;}e.exports=g;});
          __d("$",["ge"],function(a,b,c,d,e,f){var g=b('ge');function h(i){var j=g(i);return j;}e.exports=h;});
          __d("CSS",["$"],function(a,b,c,d,e,f){var g=b('$'),h='hidden_elem',i={setClass:function(j,k){g(j).className=k||'';return j;},hasClass:function(j,k){j=g(j);return (' '+j.className+' ').indexOf(' '+k+' ')>-1;},addClass:function(j,k){j=g(j);if(k&&!i.hasClass(j,k))j.className=j.className+' '+k;return j;},removeClass:function(j,k){j=g(j);if(i.hasClass(j,k))j.className=j.className.replace(new RegExp('(^|\\s)'+k+'(?:\\s|$)','g'),'$1').replace(/\s+/g,' ').replace(/^\s*|\s*$/g,'');return j;},conditionClass:function(j,k,l){return (l?i.addClass:i.removeClass)(j,k);},toggleClass:function(j,k){return i.conditionClass(j,k,!i.hasClass(j,k));},shown:function(j){return !i.hasClass(j,h);},hide:function(j){return i.addClass(j,h);},show:function(j){return i.removeClass(j,h);},toggle:function(j){return i.toggleClass(j,h);},conditionShow:function(j,k){return i.conditionClass(j,h,!k);}};e.exports=i;});
          __d("UserAgent",[],function(a,b,c,d,e,f){var g=false,h,i,j,k,l,m,n,o,p,q,r,s,t,u;function v(){if(g)return;g=true;var x=navigator.userAgent,y=/(?:MSIE.(\d+\.\d+))|(??:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(x),z=/(Mac OS X)|(Windows)|(Linux)/.exec(x);r=/\b(iPhone|iP[ao]d)/.exec(x);s=/\b(iP[ao]d)/.exec(x);p=/Android/i.exec(x);t=/FBAN\/\w+;/i.exec(x);u=/Mobile/i.exec(x);q=!!(/Win64/.exec(x));if(y){h=y[1]?parseFloat(y[1]):NaN;if(h&&document.documentMode)h=document.documentMode;i=y[2]?parseFloat(y[2]):NaN;j=y[3]?parseFloat(y[3]):NaN;k=y[4]?parseFloat(y[4]):NaN;if(k){y=/(?:Chrome\/(\d+\.\d+))/.exec(x);l=y&&y[1]?parseFloat(y[1]):NaN;}else l=NaN;}else h=i=j=l=k=NaN;if(z){if(z[1]){var aa=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(x);m=aa?parseFloat(aa[1].replace('_','.')):true;}else m=false;n=!!z[2];o=!!z[3];}else m=n=o=false;}var w={ie:function(){return v()||h;},ie64:function(){return w.ie()&&q;},firefox:function(){return v()||i;},opera:function(){return v()||j;},safari:function(){return v()||k;},chrome:function(){return v()||l;},windows:function(){return v()||n;},osx:function(){return v()||m;},linux:function(){return v()||o;},iphone:function(){return v()||r;},mobile:function(){return v()||(r||s||p||u);},nativeApp:function(){return v()||t;},android:function(){return v()||p;},ipad:function(){return v()||s;}};e.exports=w;});
          __d("createObjectFrom",["hasArrayNature"],function(a,b,c,d,e,f){var g=b('hasArrayNature');function h(i,j){var k={},l=g(j);if(typeof j=='undefined')j=true;for(var m=i.length;m--;)k[i[m]]=l?j[m]:j;return k;}e.exports=h;});
          __d("DOMQuery",["CSS","UserAgent","createArrayFrom","createObjectFrom","ge"],function(a,b,c,d,e,f){var g=b('CSS'),h=b('UserAgent'),i=b('createArrayFrom'),j=b('createObjectFrom'),k=b('ge'),l={find:function(m,n){var o=l.scry(m,n);return o[0];},scry:function(m,n){if(!m||!m.getElementsByTagName)return [];var o=n.split(' '),p=[m];for(var q=0;q<o.length;q++){if(p.length===0)break;if(o[q]==='')continue;var r=o[q],s=o[q],t=[],u=false;if(r.charAt(0)=='^')if(q===0){u=true;r=r.slice(1);}else return [];r=r.replace(/\./g,' .');r=r.replace(/\#/g,' #');r=r.replace(/\[/g,' [');var v=r.split(' '),w=v[0]||'*',x=w=='*',y=v[1]&&v[1].charAt(0)=='#';if(y){var z=k(v[1].slice(1),true);if(z&&(x||z.tagName.toLowerCase()==w))for(var aa=0;aa<p.length;aa++)if(u&&l.contains(z,p[aa])){t=[z];break;}else if(document==p[aa]||l.contains(p[aa],z)){t=[z];break;}}else{var ba=[],ca=p.length,da,ea=!u&&s.indexOf('[')<0&&document.querySelectorAll;for(var fa=0;fa<ca;fa++){if(u){da=[];var ga=p[fa].parentNode;while(l.isElementNode(ga)){if(x||ga.tagName.toLowerCase()==w)da.push(ga);ga=ga.parentNode;}}else if(ea){da=p[fa].querySelectorAll(s);}else da=p[fa].getElementsByTagName(w);var ha=da.length;for(var ia=0;ia<ha;ia++)ba.push(da[ia]);}if(!ea)for(var ja=1;ja<v.length;ja++){var KA=v[ja],la=ka.charAt(0)=='.',ma=ka.substring(1);for(fa=0;fa<ba.length;fa++){var na=ba[fa];if(!na)continue;if(la){if(!g.hasClass(na,ma))delete ba[fa];continue;}else{var oa=ka.slice(1,ka.length-1);if(oa.indexOf('=')==-1){if(na.getAttribute(oa)===null){delete ba[fa];continue;}}else{var pa=oa.split('='),qa=pa[0],ra=pa[1];ra=ra.slice(1,ra.length-1);if(na.getAttribute(qa)!=ra){delete ba[fa];continue;}}}}}for(fa=0;fa<ba.length;fa++)if(ba[fa]){t.push(ba[fa]);if(u)break;}}p=t;}return p;},getText:(function(){var m=document.createElement('div'),n=m.textContent!=null?'textContent':'innerText';return function(o){if(l.isTextNode(o)){return o.data;}else if(l.isElementNode(o)){return o[n];}else return '';};})(),getSelection:function(){var m=window.getSelection,n=document.selection;if(m){return m()+'';}else if(n)return n.createRange().text;return null;},contains:function(m,n){m=k(m);n=k(n);if(!m||!n){return false;}else if(m===n){return true;}else if(l.isTextNode(m)){return false;}else if(l.isTextNode(n)){return l.contains(m,n.parentNode);}else if(m.contains){return m.contains(n);}else if(m.compareDocumentPosition){return !!(m.compareDocumentPosition(n)&16);}else return false;},getRootElement:function(){var m=null;if(window.Quickling&&Quickling.isActive())m=k('content');return m||document.body;},isNode:function(m){return !!(m&&(typeof Node=='object'?m instanceof Node:typeof m=="object"&&typeof m.nodeType=='number'&&typeof m.nodeName=='string'));},isNodeOfType:function(m,n){var o=i(n).join('|').toUpperCase().split('|'),p=j(o);return l.isNode(m)&&m.nodeName in p;},isElementNode:function(m){return l.isNode(m)&&m.nodeType==1;},isTextNode:function(m){return l.isNode(m)&&m.nodeType==3;},getDocumentScrollElement:function(m){m=m||document;if(g.hasClass(m.documentElement,'wrapped')){var n=m.getElementById('body');if(n)return n;}var o=h.chrome()||h.safari();return !o&&m.compatMode==='CSS1Compat'?m.documentElement:m.body;},getDocumentBodyElement:function(m){m=m||document;if(g.hasClass(m.documentElement,'wrapped')){var n=m.getElementById('body');if(n)return n;}return m.body;}};e.exports=l;});
          __d("DOMDimensions",["DOMQuery"],function(a,b,c,d,e,f){var g=b('DOMQuery'),h={getElementDimensions:function(i){return {width:i.offsetWidth||0,height:i.offsetHeight||0};},getViewportDimensions:function(){var i=(window&&window.innerWidth)||(document&&document.documentElement&&document.documentElement.clientWidth)||(document&&document.body&&document.body.clientWidth)||0,j=(window&&window.innerHeight)||(document&&document.documentElement&&document.documentElement.clientHeight)||(document&&document.body&&document.body.clientHeight)||0;return {width:i,height:j};},getDocumentDimensions:function(i){i=i||document;var j=g.getDocumentScrollElement(i),k=j.scrollWidth||0,l=j.scrollHeight||0;return {width:k,height:l};}};e.exports=h;});
          __d("PopupWindow",["DOMDimensions","DOMQuery","UserAgent","copyProperties"],function(a,b,c,d,e,f){var g=b('DOMDimensions'),h=b('DOMQuery'),i=b('UserAgent'),j=b('copyProperties'),k={_opts:{allowShrink:true,strategy:'vector',timeout:100,widthElement:null},init:function(l){j(k._opts,l);setInterval(k._resizeCheck,k._opts.timeout);},_resizeCheck:function(){var l=g.getViewportDimensions(),m=k._getDocumentSize(),n=m.height-l.height,o=m.width-l.width;if(o<0&&!k._opts.widthElement)o=0;o=o>1?o:0;if(!k._opts.allowShrink&&n<0)n=0;if(n||o)try{window.console&&window.console.firebug;window.resizeBy(o,n);if(o)window.moveBy(o/-2,0);}catch(p){}},_getDocumentSize:function(){var l=g.getDocumentDimensions();if(k._opts.strategy==='offsetHeight')l.height=document.body.offsetHeight;if(k._opts.widthElement){var m=h.scry(document.body,k._opts.widthElement)[0];if(m)l.width=g.getElementDimensions(m).width;}if(window.Dialog&&Dialog.max_bottom&&Dialog.max_bottom>l.height)l.height=Dialog.max_bottom;return l;},open:function(l,m,n){var o=typeof window.screenX!='undefined'?window.screenX:window.screenLeft,p=typeof window.screenY!='undefined'?window.screenY:window.screenTop,q=typeof window.outerWidth!='undefined'?window.outerWidth:document.body.clientWidth,r=typeof window.outerHeight!='undefined'?window.outerHeight:(document.body.clientHeight-22),s=parseInt(o+((q-n)/2),10),t=parseInt(p+((r-m)/2.5),10),u=('width='+n+',height='+m+',left='+s+',top='+t);return window.open(l,'_blank',u);}};e.exports=k;});
          __d("goURI",[],function(a,b,c,d,e,f){function g(h,i){h=h.toString();if(!i&&a.PageTransitions&&PageTransitions.isInitialized()){PageTransitions.go(h);}else if(window.location.href==h){window.location.reload();}else window.location.href=h;}e.exports=g;});
          __d("URI",["copyProperties","goURI"],function(a,b,c,d,e,f){var g=b('copyProperties'),h=b('goURI');function i(j){if(!(this instanceof i))return new i(j||window.location.href);this.parse(j||'');}g(i,{getRequestURI:function(j,k){j=j===undefined||j;var l=a.PageTransitions;if(j&&l&&l.isInitialized()){return l.getCurrentURI(!!k).getQualifiedURI();}else return new i(window.location.href);},getMostRecentURI:function(){var j=a.PageTransitions;if(j&&j.isInitialized()){return j.getMostRecentURI().getQualifiedURI();}else return new i(window.location.href);},getNextURI:function(){var j=a.PageTransitions;if(j&&j.isInitialized()){return j.getNextURI().getQualifiedURI();}else return new i(window.location.href);},expression:/(((\w+):\/\/)([^\/:]*)(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/,arrayQueryExpression:/^(\w+)((?:\[\w*\])+)=?(.*)/,explodeQuery:function(j){if(!j)return {};var k={};j=j.replace(/%5B/ig,'[').replace(/%5D/ig,']');j=j.split('&');for(var l=0,m=j.length;l<m;l++){var n=j[l].match(i.arrayQueryExpression);if(!n){var o=j[l].split('=');k[i.decodeComponent(o[0])]=o[1]===undefined?null:i.decodeComponent(o[1]);}else{var p=n[2].split(/\]\[|\[|\]/).slice(0,-1),q=n[1],r=i.decodeComponent(n[3]||'');p[0]=q;var s=k;for(var t=0;t<p.length-1;t++)if(p[t]){if(s[p[t]]===undefined)if(p[t+1]&&!p[t+1].match(/^\d+$/)){s[p[t]]={};}else s[p[t]]=[];s=s[p[t]];}else{if(p[t+1]&&!p[t+1].match(/^\d+$/)){s.push({});}else s.push([]);s=s[s.length-1];}if(s instanceof Array&&p[p.length-1]===''){s.push(r);}else s[p[p.length-1]]=r;}}return k;},implodeQuery:function(j,k,l){k=k||'';if(l===undefined)l=true;var m=[];if(j===null||j===undefined){m.push(l?i.encodeComponent(k):k);}else if(j instanceof Array){for(var n=0;n<j.length;++n)try{if(j[n]!==undefined)m.push(i.implodeQuery(j[n],k?(k+'['+n+']'):n));}catch(o){}}else if(typeof(j)=='object'){if(('nodeName' in j)&&('nodeType' in j)){m.push('{node}');}else for(var p in j)try{if(j[p]!==undefined)m.push(i.implodeQuery(j[p],k?(k+'['+p+']'):p));}catch(o){}}else if(l){m.push(i.encodeComponent(k)+'='+i.encodeComponent(j));}else m.push(k+'='+j);return m.join('&');},encodeComponent:function(j){return encodeURIComponent(j).replace(/%5D/g,"]").replace(/%5B/g,"[");},decodeComponent:function(j){return decodeURIComponent(j.replace(/\+/g,' '));},INVALID_DOMAIN:'invalid.invalid',sanitizeDomain:function(j){var k=new RegExp('[\\x00-\\x2c\\x2f\\x3b-\\x40\\x5c\\x5e\\x60\\x7b-\\x7f'+'\\uFDD0-\\uFDEF\\uFFF0-\\uFFFF'+'\\u2047\\u2048\\uFE56\\uFE5F\\uFF03\\uFF0F\\uFF1F]');if(k.test(j)){return i.INVALID_DOMAIN;}else return j;}});g(i.prototype,{parse:function(j){var k=j.toString().match(i.expression);g(this,{protocol:k[3]||'',domain:i.sanitizeDomain(k[4]||''),port:k[6]||'',path:k[7]||'',query_s:k[9]||'',fragment:k[11]||''});return this;},setProtocol:function(j){this.protocol=j;return this;},getProtocol:function(){return this.protocol;},setQueryData:function(j){this.query_s=i.implodeQuery(j);return this;},addQueryData:function(j){return this.setQueryData(g(this.getQueryData(),j));},removeQueryData:function(j){if(!Array.isArray(j))j=[j];var k=this.getQueryData();for(var l=0,m=j.length;l<m;++l)delete k[j[l]];return this.setQueryData(k);},getQueryData:function(){return i.explodeQuery(this.query_s);},setFragment:function(j){this.fragment=j;return this;},getFragment:function(){return this.fragment;},setDomain:function(j){this.domain=i.sanitizeDomain(j);return this;},getDomain:function(){return this.domain;},setPort:function(j){this.port=j;return this;},getPort:function(){return this.port;},setPath:function(j){this.path=j;return this;},getPath:function(){return this.path.replace(/^\/+/,'/');},isEmpty:function(){return !(this.path||this.protocol||this.domain||this.port||this.query_s||this.fragment);},toString:function(){var j='';this.protocol&&(j+=this.protocol+'://');this.domain&&(j+=this.domain);this.port&&(j+=':'+this.port);if(this.domain&&!this.path)j+='/';this.path&&(j+=this.path);this.query_s&&(j+='?'+this.query_s);this.fragment&&(j+='#'+this.fragment);return j;},valueOf:function(){return this.toString();},isFacebookURI:function(){if(!i._facebookURIRegex)i._facebookURIRegex=new RegExp('(^|\\.)facebook\\.com([^.]*)$','i');return (!this.domain||i._facebookURIRegex.test(this.domain));},isQuicklingEnabled:function(){var j=a.Quickling;return j&&j.isActive()&&j.isPageActive(this);},getRegisteredDomain:function(){if(!this.domain)return '';if(!this.isFacebookURI())return null;var j=this.domain.split('.'),k=j.indexOf('facebook');return j.slice(k).join('.');},getUnqualifiedURI:function(){return new i(this).setProtocol(null).setDomain(null).setPort(null);},getQualifiedURI:function(){var j=new i(this);if(!j.getDomain()){var k=i();j.setProtocol(k.getProtocol()).setDomain(k.getDomain()).setPort(k.getPort());}return j;},isSameOrigin:function(j){var k=j||window.location.href;if(!(k instanceof i))k=new i(k.toString());if(this.getProtocol()&&this.getProtocol()!=k.getProtocol())return false;if(this.getDomain()&&this.getDomain()!=k.getDomain())return false;if(this.getPort()&&this.getPort()!=k.getPort())return false;return true;},go:function(j){h(this,j);},setSubdomain:function(j){var k=new i(this).getQualifiedURI(),l=k.getDomain().split('.');if(l.length<=2){l.unshift(j);}else l[0]=j;return k.setDomain(l.join('.'));},getSubdomain:function(){if(!this.getDomain())return '';var j=this.getDomain().split('.');if(j.length<=2){return '';}else return j[0];},setSecure:function(j){return this.setProtocol(j?'https':'http');},isSecure:function(){return this.getProtocol()=='https';}});e.exports=i;});
          __d("bind",[],function(a,b,c,d,e,f){function g(h,i){var j=Array.prototype.slice.call(arguments,2);if(typeof i!='string')return Function.prototype.bind.apply(i,[h].concat(j));function k(){var l=j.concat(Array.prototype.slice.call(arguments));if(h)return h.apply(h,l);}k.toString=function(){return 'bound lazily: '+h;};return k;}e.exports=g;});
          __d("PluginConfirm",["DOMEvent","DOMEventListener","PopupWindow","URI","bind","copyProperties"],function(a,b,c,d,e,f){var g=b('DOMEvent'),h=b('DOMEventListener'),i=b('PopupWindow'),j=b('URI'),k=b('bind'),l=b('copyProperties');function m(n){l(this,{plugin:n,confirm_params:{},return_params:j.getRequestURI().getQueryData()});this.addReturnParams({ret:'sentry'});delete this.return_params.hash;}l(m.prototype,{addConfirmParams:function(n){l(this.confirm_params,n);},addReturnParams:function(n){l(this.return_params,n);return this;},start:function(){var n=new j('/plugins/error/confirm/'+this.plugin).addQueryData(this.confirm_params).addQueryData({secure:j.getRequestURI().isSecure(),plugin:this.plugin,return_params:JSON.stringify(this.return_params)});this.popup=i.open(n.toString(),320,486);return this;}});m.starter=function(n,o,p){var q=new m(n);q.addConfirmParams(o||{});q.addReturnParams(p||{});return k(q,q.start);};m.listen=function(n,o,p,q){h.add(n,'click',function(r){new g(r).kill();m.starter(o,p,q)();});};e.exports=m;});
          __d("PluginConnection",["Plugin","Arbiter","CSS","copyProperties"],function(a,b,c,d,e,f){var g=b('Plugin'),h=b('Arbiter'),i=b('CSS'),j=b('copyProperties'),k=function(){};j(k.prototype,{init:function(l,m,n,event){event=event||g.CONNECT;this.identifier=l;this.element=m;this.css=n;h.subscribe([g.CONNECT,g.DISCONNECT],function(o,p){if(l===p.href)i[o===event?'addClass':'removeClass'](m,n);return true;});return this;},connected:function(){return i.hasClass(this.element,this.css);},connect:function(){return h.inform(g.CONNECT,{href:this.identifier},h.BEHAVIOR_STATE);},disconnect:function(){return h.inform(g.DISCONNECT,{href:this.identifier},h.BEHAVIOR_STATE);},toggle:function(){return this.connected()?this.disconnect():this.connect();}});k.init=function(l){for(var m,n=0;n<l.length;n++){m=new k();m.init.apply(m,l[n]);}};e.exports=k;});
          __d("PluginError",["DOMEvent","DOMEventListener","PopupWindow"],function(a,b,c,d,e,f){var g=b('DOMEvent'),h=b('DOMEventListener'),i=b('PopupWindow'),j={listen:function(k,l){h.add(k,'click',function(m){i.open(l,300,445);new g(m).kill();});}};e.exports=j;});
          __d("PluginOptin",["DOMEvent","DOMEventListener","PopupWindow","URI","bind","copyProperties"],function(a,b,c,d,e,f){var g=b('DOMEvent'),h=b('DOMEventListener'),i=b('PopupWindow'),j=b('URI'),k=b('bind'),l=b('copyProperties');function m(n){l(this,{return_params:j.getRequestURI().getQueryData(),login_params:{},optin_params:{},plugin:n});this.addReturnParams({ret:'optin'});delete this.return_params.hash;}l(m.prototype,{addReturnParams:function(n){l(this.return_params,n);return this;},addLoginParams:function(n){l(this.login_params,n);return this;},addOptinParams:function(n){l(this.optin_params,n);return this;},start:function(){var n=new j('/dialog/optin').addQueryData(this.optin_params).addQueryData({display:'popup',app_id:127760087237610,secure:j.getRequestURI().isSecure(),social_plugin:this.plugin,return_params:JSON.stringify(this.return_params),login_params:JSON.stringify(this.login_params)});this.popup=i.open(n.toString(),420,450);return this;}});m.starter=function(n,o,p,q){var r=new m(n);r.addReturnParams(o||{});r.addLoginParams(p||{});r.addOptinParams(q||{});return k(r,r.start);};m.listen=function(n,o,p,q,r){h.add(n,'click',function(s){new g(s).kill();m.starter(o,p,q,r)();});};e.exports=m;});
          __d("sprintf",[],function(a,b,c,d,e,f){function g(h,i){i=Array.prototype.slice.call(arguments,1);var j=0;return h.replace(/%s/g,function(k){return i[j++];});}e.exports=g;});
          __d("Log",["sprintf"],function(a,b,c,d,e,f){var g=b('sprintf'),h={DEBUG:3,INFO:2,WARNING:1,ERROR:0};function i(k,l){var m=Array.prototype.slice.call(arguments,2),n=g.apply(null,m);if(j.level>=k&&window.console)console[l in console?l:'log'](n);}var j={level:-1,Level:h,debug:i.bind(null,h.DEBUG,'debug'),info:i.bind(null,h.INFO,'debug'),warn:i.bind(null,h.WARNING,'debug'),error:i.bind(null,h.ERROR,'debug')};e.exports=j;});
          __d("event-form-bubbling",[],function(a,b,c,d,e,f){a.Event=a.Event||function(){};Event.__inlineSubmit=function(g,event){var h=Event.__getHandler&&Event.__getHandler(g,'submit');return h?null:Event.__bubbleSubmit(g,event);};Event.__bubbleSubmit=function(g,event){if(document.documentElement.attachEvent){var h;while(h!==false&&(g=g.parentNode))h=g.onsubmit?g.onsubmit(event):Event.__fire&&Event.__fire(g,'submit',event);return h;}};},3);
          __d("DataStore",[],function(a,b,c,d,e,f){var g={},h=1;function i(l){if(typeof l=='string'){return 'str_'+l;}else return 'elem_'+(l.__FB_TOKEN||(l.__FB_TOKEN=[h++]))[0];}function j(l){var m=i(l);return g[m]||(g[m]={});}var k={set:function(l,m,n){var o=j(l);o[m]=n;return l;},get:function(l,m,n){var o=j(l),p=o[m];if(typeof p==='undefined'&&l.getAttribute){var q=l.getAttribute('data-'+m);p=(null===q)?undefined:q;}if((n!==undefined)&&(p===undefined))p=o[m]=n;return p;},remove:function(l,m){var n=j(l),o=n[m];delete n[m];return o;},purge:function(l){delete g[i(l)];}};e.exports=k;});
          __d("Parent",["CSS"],function(a,b,c,d,e,f){var g=b('CSS'),h={byTag:function(i,j){j=j.toUpperCase();while(i&&i.nodeName!=j)i=i.parentNode;return i;},byClass:function(i,j){while(i&&!g.hasClass(i,j))i=i.parentNode;return i;},byAttribute:function(i,j){while(i&&(!i.getAttribute||!i.getAttribute(j)))i=i.parentNode;return i;}};e.exports=h;});
          __d("getObjectValues",["hasArrayNature"],function(a,b,c,d,e,f){var g=b('hasArrayNature');function h(i){var j=[];for(var k in i)j.push(i[k]);return j;}e.exports=h;});
          __d("isEmpty",[],function(a,b,c,d,e,f){function g(h){if(h instanceof Array){return h.length===0;}else if(h instanceof Object){for(var i in h)return false;return true;}else return !h;}e.exports=g;});
          __d("CSSLoader",["isEmpty"],function(a,b,c,d,e,f){var g=b('isEmpty'),h=20,i=5000,j,k,l={},m=[],n,o={};function p(u){var v=Array.prototype.slice(arguments,1);for(var w=0;w<u.length;w++)u[w].apply(null,v);}function q(u){if(k)return;k=true;var v=document.createElement('link');v.onload=function(){j=true;v.parentNode.removeChild(v);};v.rel='stylesheet';v.href='data:text/css;base64,';u.appendChild(v);}function r(){var u,v=[],w=[];if(Date.now()>=n){for(u in o){w.push(o.signal);v.push(o.error);}o={};}else for(u in o){var x=o.signal,y=window.getComputedStyle?getComputedStyle(x,null):x.currentStyle;if(y&&parseInt(y.height,10)>1){v.push(o.load);w.push(x);delete o;}}for(var z=0;z<w.length;z++)w[z].parentNode.removeChild(w[z]);if(!g(v)){p(v);n=Date.now()+i;}return g(o);}function s(u,v,w,x){var y=document.createElement('meta');y.id='bootloader_'+u.replace(/[^a-z0-9]/ig,'_');v.appendChild(y);var z=!g(o);n=Date.now()+i;o={signal:y,load:w,error:x};if(!z)var aa=setInterval(function ba(){if(r())clearInterval(aa);},h,false);}var t={loadStyleSheet:function(u,v,w,x,y){if(l)throw new Error('CSS component '+u+' has already been requested.');if(document.createStyleSheet){var z;for(var aa=0;aa<m.length;aa++)if(m[aa].imports.length<31){z=aa;break;}if(z===undefined){m.push(document.createStyleSheet());z=m.length-1;}m[z].addImport(v);l={styleSheet:m[z],uri:v};s(u,w,x,y);return;}var ba=document.createElement('link');ba.rel='stylesheet';ba.type='text/css';ba.href=v;l={link:ba};if(j){ba.onload=function(){ba.onload=ba.onerror=null;x();};ba.onerror=function(){ba.onload=ba.onerror=null;y();};}else{s(u,w,x,y);if(j===undefined)q(w);}w.appendChild(ba);},registerLoadedStyleSheet:function(u,v){if(l)throw new Error('CSS component '+u+' has already been requested.');l={link:v};},unloadStyleSheet:function(u){if(!u in l)return;var v=l,w=v.link;if(w){w.onload=w.onerror=null;w.parentNode.removeChild(w);}else{var x=v.styleSheet;for(var y=0;y<x.imports.length;y++)if(x.imports[y].href==v.uri){x.removeImport(y);break;}}delete o;delete l;}};e.exports=t;});
          __d("Bootloader",["function-extensions","Arbiter","CSSLoader","Env","createArrayFrom","isEmpty"],function(a,b,c,d,e,f){b('function-extensions');var g=b('Arbiter'),h=b('CSSLoader'),i=b('Env'),j=b('createArrayFrom'),k=b('isEmpty'),l={},m={},n={},o=null,p={},q={},r=false,s=[];function t(x,y,z,aa){var ba=w.done.curry([z],x=='css');if(x=='js'){var ca=document.createElement('script');ca.src=y;ca.async=true;var da=p[z];if(da&&da.crossOrigin&&i.crossorigin_attribute)ca.crossOrigin='anonymous';ca.onload=ca.onerror=ba;ca.onreadystatechange=function(){if(this.readyState in {loaded:1,complete:1})ba();};aa.appendChild(ca);}else if(x=='css')h.loadStyleSheet(z,y,aa,ba,function(){ba();});}function u(x){if(!p
          • )return;if(p
          • .type=='css'){h.unloadStyleSheet(x);delete l
          • ;g.inform(g.BOOTLOAD+'/'+x,null,g.BEHAVIOR_STATE);}}function v(x,y){if(!r){s.push([x,y]);return;}x=j(x);var z=[];for(var aa=0;aa<x.length;++aa){if(!x[aa])continue;var ba=n[x[aa]];if(ba){var ca=ba.resources;for(var da=0;da<ca.length;++da)z.push(ca[da]);}}w.loadResources(z,y);}var w={configurePage:function(x){var y={},z=w.resolveResources(x),aa;for(aa=0;aa<z.length;aa++){y[z[aa].src]=z[aa];w.requested(z[aa].name);}var ba=document.getElementsByTagName('link');for(aa=0;aa<ba.length;++aa){if(ba[aa].rel!='stylesheet')continue;for(var ca in y)if(ba[aa].href.indexOf(ca)!==-1){var da=y[ca].name;if(y[ca].permanent)m[da]=true;delete y[ca];h.registerLoadedStyleSheet(da,ba[aa]);w.done([da],true);break;}}},loadComponents:function(x,y){x=j(x);var z=[],aa=[];for(var ba=0;ba<x.length;ba++){var ca=n[x[ba]];if(ca&&!ca.module)continue;var da='legacy:'+x[ba];if(n[da]){x[ba]=da;z.push(da);}else if(ca&&ca.module){z.push(x[ba]);if(!ca.runWhenReady)aa.push(x[ba]);}}v(x,z.length?d.curry(z,y):y);},loadModules:function(x,y){var z=[],aa=[];for(var ba=0;ba<x.length;ba++){var ca=n[x[ba]];if(!ca||ca.module)z.push(x[ba]);}v(x,d.curry(z,y));},loadResources:function(x,y,z,aa){var ba;x=w.resolveResources(j(x));if(z){var ca={};for(ba=0;ba<x.length;++ba)ca[x[ba].name]=true;for(var da in l)if(!(da in m)&&!(da in ca)&&!(da in q))u(da);q={};}var ea=[],fa=[];for(ba=0;ba<x.length;++ba){var ga=x[ba];if(ga.permanent)m[ga.name]=true;var ha=g.BOOTLOAD+'/'+ga.name;if(g.query(ha)!==null)continue;if(!ga.nonblocking)fa.push(ha);if(!l[ga.name]){w.requested(ga.name);ea.push(ga);window.CavalryLogger&&window.CavalryLogger.getInstance().measureResources(ga,aa);}}if(y)y=g.registerCallback(y,fa);var ia=document.documentMode||+(/MSIE.(\d+)/.exec(navigator.userAgent)||[])[1],ja=w.getHardpoint(),ka=ia?ja:document.createDocumentFragment();for(ba=0;ba<ea.length;++ba)t(ea[ba].type,ea[ba].src,ea[ba].name,ka);if(ja!==ka)ja.appendChild(ka);return y;},requestResource:function(x,y,z){var aa=w.getHardpoint();t(x,y,z,aa);},done:function(x,y){w.requested(x);if(!y){var z={sender:this};g.inform(g.BOOTLOAD,z,g.BEHAVIOR_EVENT);}for(var aa=0;aa<x.length;++aa){var ba=x[aa];g.inform(g.BOOTLOAD+'/'+ba,true,g.BEHAVIOR_STATE);}},requested:function(x){x=j(x);for(var y=0;y<x.length;++y)l[x[y]]=true;},enableBootload:function(x){for(var y in x)if(!n[y])n[y]=x[y];if(!r){r=true;for(var z=0;z<s.length;z++)v.apply(null,s[z]);s=[];}},getHardpoint:function(){if(!o){var x=document.getElementsByTagName('head');o=x.length&&x[0]||document.body;}return o;},setResourceMap:function(x){if(!x)return;for(var y in x){if(!x[y].name)x[y].name=y;p[y]=x[y];}},resolveResources:function(x){if(!x)return [];var y=[];for(var z=0;z<x.length;++z)if(typeof x[z]=='string'){if(x[z] in p)y.push(p[x[z]]);}else y.push(x[z]);return y;},loadEarlyResources:function(x){var y;w.setResourceMap(x);var z=[];for(y in x)z.push(p[y]);w.loadResources(z);for(y in x){var aa=p[y];if(!aa.permanent)q[aa.name]=aa;}},isDisplayJS:function(x){if(typeof x=='string')x=p
          • ;return x.displayjs;}};e.exports=w;});

          __d("OnloadEvent",[],function(a,b,c,d,e,f){var g={ONLOAD:'onload/onload',ONLOAD_CALLBACK:'onload/onload_callback',ONLOAD_DOMCONTENT:'onload/dom_content_ready',ONLOAD_DOMCONTENT_CALLBACK:'onload/domcontent_callback',ONBEFOREUNLOAD:'onload/beforeunload',ONUNLOAD:'onload/unload'};e.exports=g;});
          __d("EagleEye",["Arbiter","Bootloader","Env","OnloadEvent"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('Bootloader'),i=b('Env'),j=b('OnloadEvent'),k=i.eagleEyeConfig||{},l='_e_',m=(window.name||'').toString();if(m.length==7&&m.substr(0,3)==l){m=m.substr(3);}else{m=k.seed;if(window==window.top)window.name=l+m;}var n=(window.location.protocol=='https:'&&document.cookie.match(/\bcsm=1/))?'; secure':'',o=l+m+'_',p=new Date(Date.now()+604800000).toGMTString(),q=window.location.hostname.replace(/^.*(facebook\..*)$/i,'$1'),r='; expires='+p+';path=/; domain='+q+n,s=0,t,u=k.sessionStorage&&a.sessionStorage,v=document.cookie.length,w=false,x=Date.now();function y(da){var ea=2166136261;for(var fa=0,ga=da.length;fa<ga;++fa)ea=(ea^da.charCodeAt(fa))*16777619;ea+=ea<<13;ea^=ea>>7;ea+=ea<<3;ea^=ea>>17;ea+=ea<<5;return (ea|0)+2147483648;}function z(da){return o+(s++)+'='+encodeURIComponent(da)+r;}function aa(){var da=[],ea=false,fa=0,ga=0;this.isEmpty=function(){return !da.length;};this.enqueue=function(ha,ia){if(ia){da.unshift(ha);}else da.push(ha);};this.dequeue=function(){da.shift();};this.peek=function(){return da[0];};this.clear=function(ha){v=Math.min(v,document.cookie.length);if(!w&&(new Date()-x>60000))w=true;var ia=!ha&&(document.cookie.search(l)>=0),ja=!!i.cookie_header_limit,ka=i.cookie_count_limit||19,la=i.cookie_header_limit||3950,ma=ka-5,na=la-1000;while(!this.isEmpty()){var oa=z(this.peek());if(ja&&(oa.length>la||(w&&oa.length+v>la))){this.dequeue();continue;}if((ia||ja)&&((document.cookie.length+oa.length>la)||(document.cookie.split(';').length>ka)))break;document.cookie=oa;ia=true;this.dequeue();}var pa=Date.now();if(ha||!ea&&ia&&((ga>0)&&(Math.min(10*Math.pow(2,ga-1),60000)+fa<pa))&&g.query(j.ONLOAD)&&(!this.isEmpty()||(document.cookie.length>na)||(document.cookie.split(';').length>ma))){var qa=new Image(),ra=this,sa=i.tracking_domain||'';ea=true;qa.onload=function va(){ea=false;ga=0;ra.clear();};qa.onerror=qa.onabort=function va(){ea=false;fa=Date.now();ga++;};var ta=i.fb_isb?'&fb_isb='+i.fb_isb:'',ua='&__user='+i.user;qa.src=sa+'/ajax/nectar.php?asyncSignal='+(Math.floor(Math.random()*10000)+1)+ta+ua+'&'+(!ha?'':'s=')+pa;}};}t=new aa();if(u){var ba=function(){var da=0,ea=da;function fa(){var ia=sessionStorage.getItem('_e_ids');if(ia){var ja=(ia+'').split(';');if(ja.length==2){da=parseInt(ja[0],10);ea=parseInt(ja[1],10);}}}function ga(){var ia=da+';'+ea;sessionStorage.setItem('_e_ids',ia);}function ha(ia){return '_e_'+((ia!==undefined)?ia:da++);}this.isEmpty=function(){return ea===da;};this.enqueue=function(ia,ja){var ka=ja?ha(--ea):ha();sessionStorage.setItem(ka,ia);ga();};this.dequeue=function(){this.isEmpty();sessionStorage.removeItem(ha(ea));ea++;ga();};this.peek=function(){var ia=sessionStorage.getItem(ha(ea));return ia?(ia+''):ia;};this.clear=t.clear;fa();};t=new ba();}var ca={log:function(da,ea,fa){if(i.no_cookies)return;var ga=[m,Date.now(),da].concat(ea);ga.push(ga.length);function ha(){var ia=JSON.stringify(ga);try{t.enqueue(ia,!!fa);t.clear(!!fa);}catch(ja){if(u&&(ja.code===1000)){t=new aa();u=false;ha();}}}ha();},createLogger:function(da,ea){ea=(ea===undefined)?1:ea;var fa=function(ga,ha){if(fa.enabled)ca.log(da,ga,ha);};fa.enabled=false;fa._key=(i.user||Math.random())+da;fa.enabled=(y(fa._key)%65535/65535)<=ea;return fa;},getSessionID:function(){return m;},hash:function(da){return y(da);}};a.EagleEye=e.exports=ca;},3);
          __d("debounce",[],function(a,b,c,d,e,f){function g(h,i,j,k,l){i=(i!=null)?i:100;var m,n;function o(){var p=arguments;!l&&o.reset();if(!l||!m||(n+i<Date.now())){m=setTimeout(function(){m=null;h.apply(this,p);}.bind(j||this),i,!k);n=Date.now();}}o.reset=function(){m&&clearTimeout(m);m=null;};return o;}e.exports=g;});
          __d("userAction",["Arbiter","EagleEye","copyProperties","debounce"],function(a,b,c,d,e,f){var g=b('Arbiter'),h=b('EagleEye'),i=b('copyProperties'),j=b('debounce');function k(t,u,v){var w=t+'/'+u;i(this,{ue:w,_ua_id:null,_ts:t,_ns:null,_start_ts:t,_prev_event:'s',_ue_ts:t,_ue_count:u,_context:v,_data_version:1,_event_version:2,_info_version:1});this._log('uan',[1,w]);this._report=j(function x(){var y=[this._info_version,this.ue,this._ns,this._ua_id];this._log('uai',y);},100,this);}var l=[],m={},n={};i(k.prototype,{_log:function(t,u){var v=m[t]!==undefined?m[t]:true,w=n[t],x=w?w[this._ns]:{},y=x?x[this._ua_id]:undefined;if(y!==undefined?y:v)h.log(t,u);},coalesce_ua_id:function(t){if(this._ua_id===null)this.set_ua_id(t);return this;},set_ua_id:function(t){this._ua_id=t;this._report();return this;},coalesce_namespace:function(t){if(this._ns===null)this.set_namespace(t);return this;},set_namespace:function(t){this._ns=t;this._report();return this;},add_event:function(t,u){u=u||0;var v=(Date.now()-u),w=v-this._ts,x=v-this._ue_ts,y=[this._event_version,this.ue,this._ns,this._ua_id,this._prev_event,t,w,x];if(!this._ua_id)return;this._log('uae',y);this._ts=v;this._prev_event=t;return this;},add_data:function(t){var u=[this._data_version,this.ue,t];this._log('uad',u);return this;}});var o=0,p=0,q=null,r=null;function s(t,u,event,v,w){var x=Date.now(),y=x+'/'+o;w=w||{};if(!u&&event)u=event.getTarget();var z=50;if(u&&q)if(x-p<z&&u==q&&v!="FORCE")return l[l.length-1];if(!window.addEventListener&&document.createEventObject)event=document.createEventObject(event);q=u;r=event;var aa=new k(x,o,t);l.push(aa);while(l.length>10)l.shift();g.inform("UserAction/new",{ua:aa,node:u,mode:v,event:event,extra_data:w});p=x;o++;return aa;}s.setUATypeConfig=function(t){i(m,t);};s.setCustomSampleConfig=function(t){i(n,t);};e.exports=s;});
          __d("event-extensions",["event-form-bubbling","DataStore","DOMQuery","ErrorUtils","Parent","UserAgent","$","copyProperties","getObjectValues","userAction"],function(a,b,c,d,e,f){b('event-form-bubbling');var g=b('DataStore'),h=b('DOMQuery'),i=b('ErrorUtils'),j=b('Parent'),k=b('UserAgent'),l=b('$'),m=b('copyProperties'),n=b('getObjectValues'),o=b('userAction');Event.DATASTORE_KEY='Event.listeners';if(!Event.prototype)Event.prototype={};function p(y,z,aa){this.target=y;this.type=z;this.data=aa;}m(p.prototype,{getData:function(){this.data=this.data||{};return this.data;},stop:function(){this.cancelBubble=true;this.stopPropagation&&this.stopPropagation();return this;},prevent:function(){this.returnValue=false;this.preventDefault&&this.preventDefault();return this;},kill:function(){this.stop().prevent();return false;},getTarget:function(){var y=this.target||this.srcElement;return y?l(y):null;}});function q(y){if(y instanceof p)return y;y=y||window.event||{};if(!y._inherits_from_prototype)for(var z in Event.prototype)try{y[z]=Event.prototype[z];}catch(aa){}return y;}m(Event.prototype,{_inherits_from_prototype:true,getRelatedTarget:function(){var y=this.relatedTarget||(this.fromElement===this.srcElement?this.toElement:this.fromElement);return y?l(y):null;},getModifiers:function(){var y={control:!!this.ctrlKey,shift:!!this.shiftKey,alt:!!this.altKey,meta:!!this.metaKey};y.access=k.osx()?y.control:y.alt;y.any=y.control||y.shift||y.alt||y.meta;return y;},isMiddleClick:function(){if(this.which)return this.which===2;return this.button&&this.button===4;}});m(Event.prototype,p.prototype);m(Event,{listen:function(y,z,aa,ba){if(typeof y=='string')y=l(y);if(typeof ba=='undefined')ba=Event.Priority.NORMAL;if(typeof z=='object'){var ca={};for(var da in z)ca[da]=Event.listen(y,da,z[da],ba);return ca;}if(z.match(/^on/i))throw new TypeError("Bad event name `"+event+"': use `click', not `onclick'.");if(y.nodeName=='LABEL'&&z=='click'){var ea=y.getElementsByTagName('input');y=ea.length==1?ea[0]:y;}else if(y===window&&z==='scroll'){var fa=h.getDocumentScrollElement();if(fa!==document.documentElement&&fa!==document.body)y=fa;}var ga=g.get(y,s,{});if(u[z]){var ha=u[z];z=ha.base;aa=ha.wrap(aa);}v(y,z);var ia=ga[z];if(!(ba in ia))ia[ba]=[];var ja=ia[ba].length,ka=new x(aa,ia[ba],ja);ia[ba].push(ka);return ka;},stop:function(y){return q(y).stop();},prevent:function(y){return q(y).prevent();},kill:function(y){return q(y).kill();},getKeyCode:function(event){event=q(event);if(!event)return false;switch(event.keyCode){case 63232:return 38;case 63233:return 40;case 63234:return 37;case 63235:return 39;case 63272:case 63273:case 63275:return null;case 63276:return 33;case 63277:return 34;}if(event.shiftKey)switch(event.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null;}return event.keyCode;},getPriorities:function(){if(!r){var y=n(Event.Priority);y.sort(function(z,aa){return z-aa;});r=y;}return r;},fire:function(y,z,aa){var ba=new p(y,z,aa),ca;do{var da=Event.__getHandler(y,z);if(da)ca=da(ba);y=y.parentNode;}while(y&&ca!==false&&!ba.cancelBubble);return ca!==false;},__fire:function(y,z,event){var aa=Event.__getHandler(y,z);if(aa)return aa(q(event));},__getHandler:function(y,z){return g.get(y,Event.DATASTORE_KEY+z);},getPosition:function(y){y=q(y);var z=h.getDocumentScrollElement(),aa=y.clientX+z.scrollLeft,ba=y.clientY+z.scrollTop;return {x:aa,y:ba};}});var r=null,s=Event.DATASTORE_KEY,t=function(y){return function(z){if(!h.contains(this,z.getRelatedTarget()))return y.call(this,z);};},u={mouseenter:{base:'mouseover',wrap:t},mouseleave:{base:'mouseout',wrap:t}},v=function(y,z){var aa='on'+z,ba=w.bind(y),ca=g.get(y,s);if(z in ca)return;ca[z]={};if(y.addEventListener){y.addEventListener(z,ba,false);}else if(y.attachEvent)y.attachEvent(aa,ba);g.set(y,s+z,ba);if(y[aa]){var da=y===document.documentElement?Event.Priority._BUBBLE:Event.Priority.TRADITIONAL,ea=y[aa];y[aa]=null;Event.listen(y,z,ea,da);}if(y.nodeName==='FORM'&&z==='submit')Event.listen(y,z,Event.__bubbleSubmit.curry(y),Event.Priority._BUBBLE);},w=function(event){event=q(event);var y=event.type;if(!g.get(this,s))throw new Error("Bad listenHandler context.");var z=g.get(this,s)[y];if(!z)throw new Error("No registered handlers for `"+y+"'.");if(y=='click'){var aa=j.byTag(event.getTarget(),'a'),ba=o('click',aa,event).coalesce_namespace('evt_ext');if(window.ArbiterMonitor)window.ArbiterMonitor.initUA(ba,[aa]);}var ca=Event.getPriorities();for(var da=0;da<ca.length;da++){var ea=ca[da];if(ea in z){var fa=z[ea];for(var ga=0;ga<fa.length;ga++){if(!fa[ga])continue;var ha=fa[ga].fire(this,event);if(ha===false){return event.kill();}else if(event.cancelBubble)event.stop();}}}return event.returnValue;};Event.Priority={URGENT:-20,TRADITIONAL:-10,NORMAL:0,_BUBBLE
Javascript run through a Minifier. Javascript being a programming language used primarily on websites and a minifier being used to make it as small as possible.
1090.

Solve : some questions regards Jade & Jess and others?

Answer»

Hi guys,

I have many QUESTIONS & I am looking for help

I am looking for a built-in dictionary to USE in my java code, any suggestions ?

I am using a jade and Jess.. when I run my example code, it did not show me the box as says in the example, any one can help ??

plz guys reply


P.S : my project generates DIALOGUE that's why I am looking for a dictionary to help me and identify each token as v, N, adj. ... ETC.

1091.

Solve : Start a program that uses cmd then enter commands and rename text displayed. VB?

Answer»

Ok so basically what im trying to do is have my program start an exe that uses command prompt. This exe will display text after the commands have been entered. I want to CHANGE the text that is displayed. something like .replace("The program is unable to connect to the default blablabla", "The program is unable to connect") but the thing is I'm using streamwriter to display this text within my program. Here have a look.

CODE: [Select]Imports System.IO

Public Class Form1

Dim SW As System.IO.StreamWriter
Dim Process As New Process

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


DevkitName.Text = My.Settings.DevkitNameSave
SaveLocation.Text = My.Settings.FolderPathSave

Dim filepath64 As String = "Program Files (x86)\Microsoft Xbox 360 SDK\bin\win32\xbmovie.exe"
Dim Filepath32 As String = "Program Files\Microsoft Xbox 360 SDK\bin\win32\xbmovie.exe"
Dim Path As String = My.Computer.FileSystem.CurrentDirectory.Substring(0, 3)
Dim drivespace As String = My.Computer.FileSystem.GetDriveInfo(Path).TotalFreeSpace / 1024 / 1024 / 1024

If My.Computer.FileSystem.FileExists(Path & filepath64) Then
ElseIf My.Computer.FileSystem.FileExists(Path & Filepath32) Then
Else
MessageBox.Show("The directory or file for xbmovie does not exist, make sure you have XBOX360 SDK aka Xbox 360 Neighborhood installed.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Label1.Text = "Drive Space Available: " & drivespace.ToString.Replace(".", " ").Substring(0, 4) & " GB"
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
FolderBrowserDialog1.Description = ("Select a place to save your VIDEO file.")
FolderBrowserDialog1.ShowDialog()
Dim save As String = FolderBrowserDialog1.SelectedPath
SaveLocation.Text = save
End Sub

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
My.Settings.DevkitNameSave = DevkitName.Text
My.Settings.FolderPathSave = SaveLocation.Text
MessageBox.Show("Your save location and console name/ip settings have been saved.", "Settings Saved", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Command As String = "/X:" & DevkitName.Text & " /F:6 " & SaveLocation.Text & "\" & VideoName.Text
Dim xbmovie As String = "xbmovie.exe "

If VideoName.Text = "" And DevkitName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You didn't enter any information", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf DevkitName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Devkit Name and Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Video Name and Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" And DevkitName.Text = "" Then
MessageBox.Show("You need to enter a Video Name and Devkit Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" Then
MessageBox.Show("You need to enter a Video Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf DevkitName.Text = "" Then
MessageBox.Show("You need to enter a Devkit Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If
'Cmd process start
AddHandler Process.OutputDataReceived, AddressOf DisplayOutput
Try
Button1.Enabled = False
Process.StartInfo.CreateNoWindow() = True

Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden

Process.StartInfo.UseShellExecute = False

Process.StartInfo.RedirectStandardInput = True

Process.StartInfo.RedirectStandardOutput = True

Process.StartInfo.RedirectStandardError = True

Process.StartInfo.FileName = "Cmd"

Process.Start()

Process.SynchronizingObject = InfoBox

Process.BeginOutputReadLine()

SW = Process.StandardInput

SW.WriteLine("Test")

Catch ex As Exception
Return
End Try

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Button1.Enabled = True
End Sub



Private Sub DisplayOutput(ByVal sendingProcess As Object, ByVal output As DataReceivedEventArgs)

InfoBox.AppendText(output.Data() & vbCrLf)

End Sub



Private Sub InfoBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles InfoBox.KeyPress

Static Line As String

If e.KeyChar = Chr(Keys.Return) Then

SW.WriteLine(Line & vbCrLf)

Line = ""

Else

Line = Line & e.KeyChar

End If

End Sub
'cmd process end
End Class

Ok i have most code in place, here is a picture for reference.


All i want to do is not show the user the original text and change it.
I want the program to not show this text:
Code: [Select] Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Daniel\Desktop>"C:\Program Files (x86)\Microsoft Xbox 360 SDK\bin\win32\xbmovie.exe" /X:DaftHacker /F:6 C:\Users\Daniel\Desktop\Test.wmv

and change:
Code: [Select]Unable to connect to the runtime on target machine DaftHacker.

to something else, this part is written by the executed exe and not my program.

And here is the updated code

Code: [Select]Imports System.IO

Public Class Form1

Dim SW As System.IO.StreamWriter
Dim Process As New Process
Dim Path As String = My.Computer.FileSystem.CurrentDirectory.Substring(0, 3)

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


DevkitName.Text = My.Settings.DevkitNameSave
SaveLocation.Text = My.Settings.FolderPathSave

Dim filepath64 As String = "Program Files (x86)\Microsoft Xbox 360 SDK\bin\win32\xbmovie.exe"
Dim Filepath32 As String = "Program Files\Microsoft Xbox 360 SDK\bin\win32\xbmovie.exe"
Dim drivespace As String = My.Computer.FileSystem.GetDriveInfo(Path).TotalFreeSpace / 1024 / 1024 / 1024

If My.Computer.FileSystem.FileExists(Path & filepath64) Then
My.Settings.propath = filepath64
ElseIf My.Computer.FileSystem.FileExists(Path & Filepath32) Then
My.Settings.propath = Filepath32
Else
MessageBox.Show("The directory or file for xbmovie does not exist, make sure you have XBOX360 SDK aka Xbox 360 Neighborhood installed.", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Label1.Text = "Drive Space Available: " & drivespace.ToString.Replace(".", " ").Substring(0, 4) & " GB"
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
FolderBrowserDialog1.Description = ("Select a place to save your video file.")
FolderBrowserDialog1.ShowDialog()
Dim save As String = FolderBrowserDialog1.SelectedPath
SaveLocation.Text = save
End Sub

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
My.Settings.DevkitNameSave = DevkitName.Text
My.Settings.FolderPathSave = SaveLocation.Text
MessageBox.Show("Your save location and console name/ip settings have been saved.", "Settings Saved", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Dim Command As String = " /X:" & DevkitName.Text & " /F:6 " & SaveLocation.Text & "\" & VideoName.Text & ".wmv"

If VideoName.Text = "" And DevkitName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You didn't enter any information", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf DevkitName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Devkit Name and Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" And SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Video Name and Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" And DevkitName.Text = "" Then
MessageBox.Show("You need to enter a Video Name and Devkit Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf VideoName.Text = "" Then
MessageBox.Show("You need to enter a Video Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf DevkitName.Text = "" Then
MessageBox.Show("You need to enter a Devkit Name", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
ElseIf SaveLocation.Text = "" Then
MessageBox.Show("You need to enter a Save Location", "Notice", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return
End If




AddHandler Process.OutputDataReceived, AddressOf DisplayOutput
Try
Button1.Enabled = False
Process.StartInfo.CreateNoWindow() = True

Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden

Process.StartInfo.UseShellExecute = False

Process.StartInfo.RedirectStandardInput = True

Process.StartInfo.RedirectStandardOutput = True

Process.StartInfo.RedirectStandardError = True

Process.StartInfo.FileName = "Cmd"

Process.Start()

Process.SynchronizingObject = InfoBox

Process.BeginOutputReadLine()

SW = Process.StandardInput

SW.WriteLine(My.Settings.codepart & Path & My.Settings.propath & My.Settings.codepart & Space(1) & Command)


Catch ex As Exception
Return
End Try

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Button1.Enabled = True
End Sub



Private Sub DisplayOutput(ByVal sendingProcess As Object, ByVal output As DataReceivedEventArgs)

InfoBox.AppendText(output.Data() & vbCrLf)

End Sub



Private Sub InfoBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles InfoBox.KeyPress

Static Line As String

If e.KeyChar = Chr(Keys.Return) Then

SW.WriteLine(Line & vbCrLf)

Line = ""

Else

Line = Line & e.KeyChar

End If

End Sub
End Class

If you don't want to show output from the Command Prompt, then don't use the Command Prompt. No reason to start CMD when all you want to do is run xbmovie. As a console application it will create it's own console and you can easily hook into the standard output streams as you are doing with cmd.

meanwhile, if the program fails it MIGHT return an error code that you can check for. Process.Start() gives you a Process instance, and the ExitCode property will tell you the exitcode. Most programs will use non-zero to indicate a PROBLEM and 0 to indicate success.Quote from: BC_Programmer on November 12, 2012, 05:52:20 AM

If you don't want to show output from the Command Prompt, then don't use the Command Prompt. No reason to start CMD when all you want to do is run xbmovie. As a console application it will create it's own console and you can easily hook into the standard output streams as you are doing with cmd.

meanwhile, if the program fails it might return an error code that you can check for. Process.Start() gives you a Process instance, and the ExitCode property will tell you the exitcode. Most programs will use non-zero to indicate a problem and 0 to indicate success.
Well it's a form application and it's suppose to run cmd because xbmovie is a console application.Quote from: DaftHacker on November 12, 2012, 07:22:29 AM
Well it's a form application and it's suppose to run cmd because xbmovie is a console application.
cmd has nothing to do with console applications. cmd IS a console application, but it isn't used(inherently) for executing other console applications.


Quote from: BC_Programmer on November 12, 2012, 05:52:20 AM
As a console application it will create it's own console and you can easily hook into the standard output streams as you are doing with cmd.
1092.

Solve : Audio Thread Question C++?

Answer»

One of my friends came to me for assistance with a game he is making. He wants to have BACKGROUND audio for his game that is written in C++ that will loop, but he is having problems.

While I know how to tell C++ to load and play an audio file as a wave file ( in an older C++ book ), this is an aspect of C++ that I have very little knowledge with as for almost all books I have used touch on EVERYTHING really well to understand the concepts etc, and what loops are better than others for the desired END result etc, except for Sound and Graphics are always a weak subject in all the books that I have. I have one book that shows examples on how to load and play wave files, but getting the wave files to loop is something the book doesnt touch on, as well as how to have this audio RUN as a thread off of the main program without the main program waiting for the audio file to end before moving on to the next instruction is something I have never done myself.

Anyone know of any good books or website references for dealing with Audio Playback and C++, other than playing a wave file only once or making the computer beep that I can share with him?

Thanksuse a library.

Either that or use another low LEVEL library such as OpenAL or DirectSound. Looping would then be implemented by a callback method that is invoked when the Sound Buffer is about to be exhausted, and logic would place the correct data into the buffer to continue playing sound. Thanks for info BC... I shared link to this forum with him to check out and read further at un4seen.com

1093.

Solve : C# Foreach statement not working on datagrid?

Answer»

I need help on a program I am currently creating as I am trying to use a foreach statement on a DataGridView & loop through the rows & cells. I have tried the dataview but this doesn’t seem to have the properties to count through cells. I have therefore tried to use a for each statement on a datagridview to loop through the rows, then the cells & count the cells. However, when I run the code & press the BUTTON to execute the loop, the code just bypasses the foreach statement & does not count the rows. I have looked through lots of examples but can’t seem to get this working and its really frustrating. Below is the code with the loop. I need help please

Code: [Select][

Dv = new DataView(Movset1.Tables[0]);
DataGridView Dgv1 = new DataGridView();
Dgv1.DataSource = this.Dv.Table;

int CellCount = 0;
foreach (DataGridViewRow dr in Dgv1.Rows)
{
foreach (DataGridViewCell dc in dr.Cells)
{
ROWCOUNT++;
}
}
MessageBox.Show(" there are " + CellCount + " Cells ");

/code]What is Rowcount ?
What gives it a start value?sorry, Rowcount should be cellCount & start value was nil. Ive corrected the code below

Code: [Select]Dv = new DataView(Movset1.Tables[0]);
DataGridView Dgv1 = new DataGridView();
Dgv1.DataSource = this.Dv.Table;

int CellCount = 0;
foreach (DataGridViewRow dr in Dgv1.Rows)
{
foreach (DataGridViewCell dc in dr.Cells)
{
CellCount ++;
}
}
MessageBox.Show(" there are " + CellCount + " Cells ");



Ive see the same code used in another example and it's worked for them, so am fluxed why the code doesnt work for me, as the cell loop just gets bypassedQuote from: markyjj on June 11, 2013, 04:45:06 PM

sorry, Rowcount should be cellCount & start value was nil. Ive corrected the code below
nil isn't a value....

Have you tried setting a breakpoint and inspecting locals?Can you show us the ORIGINAL code.
It looks like there should be another statement. You have only one statement inside a compound for loop. I think C# requires both loops to have statements. Maybe I am wrong. It should not hurt to add a null statement.Quote from: Geek-9pm on June 11, 2013, 07:29:47 PM
Can you show us the original code.
You have only one statement inside a compound for loop. I think C# requires both loops to have statements. Maybe I am wrong. It should not hurt to add a null statement.
What are you on about?Quote from: BC_Programmer on June 11, 2013, 08:31:50 PM
What are you on about?
I am wrong. Sorry.Below is the full code for that section when the update button is pressed. The rows show in the table in DV when I check the debugger but not in Dgv1 when the DV is set as the datasource for the Datagridview (Dgv1)


Code: [Select] private void UpdateSavebtn_Click_1(object sender, System.EventArgs e)
{
Mcon.Open();
Dv = new DataView (Movset1.Tables[0]);
Dgv1.DataSource = Dv;

int CellCount = 0;
int Rowcount = 0;
foreach (DataGridViewRow dr in Dgv1.Rows)
{

foreach (DataGridViewCell dc in dr.Cells)
{
CellCount++;


}
Rowcount++;

}
MessageBox.Show(" there are " + CellCount + " cells ");


Yeah, That makes sense.
There are two statements inside the compound loop.
CellCount++; // inside loop
Rowcount++; // outside loop

I think both are required.set AutoGenerateColumns to true on the DataGridView.
AT the moment ive got Cell count and Row count and the data source of the datagridview(DGV1) is set as dataview. The table & rows show in Dataview.

I am unable to FIND why the data source is not showing in DGV1 which is why the foreach loops are not beng triggered. The reason am doin this is because I want to loop through the cells of the datagrid and see if there are any null cells. Am using the foreach loop at the moment to see if the cells can be picked up.

Ive tried using a Dataview but this doesnt seem to have a property to loop through the cells of the grid. Is is it really that hard to loop through a datagrid & check the values?
Quote from: BC_Programmer on June 12, 2013, 03:20:28 PM
set AutoGenerateColumns to true on the DataGridView.
I have managed to get it going by looping through the datatable & counting the blank cells. I loop through the datarows & then the datacells. The code for this is below. Thanks again for your help


Code: [Select] int CellCount = 0;
int Blk_Cell = 0;


DataTable MovTable = Movset1.Tables[0];
foreach (DataRow row in MovTable.Rows) // Loop over the rows.
{

foreach (var item in row.ItemArray) // Loop over the items.
{
CellCount++;

if (item.ToString() == "" && CellCount != 4)
{

MessageBox.Show(" This cell is blank ");
Blk_Cell++;

}
MessageBox.Show(item.ToString());
}
CellCount = 0;
}


MessageBox.Show(" there are " + Blk_Cell + " Blank Cells ");

So you never tried AutoGenerateColumns, I take it.

When I tested I found the DataGrid was empty from code, and a foreach iterator would skip- the same issue you were having. I changed the AutoGenerateColumns to true and the foreach iteration worked as intended.

I was using a BindingList rather than a Database-backed DataTable, though.I did try the AutoGeneratecolumns on the datagirdview but this still DIDNT work. But this is probably because I didnt use a binding list as you mentioned
1094.

Solve : How to use QT Creator??

Answer»

Please tell me tutorials and more.Welcome to CH. I see you have Windows 7. Does this mean you want to use MS C++ compiler to make a QT thing for a smartphone? Not sure want you want.
Is this of any help?
How to use Qt Creator with Visual C++ compiler on windows?
Quote

I INSTALLED Visual Studio 2008, Qt 4.8 libraries for vs2008 and Qt add in. I can build Qt projects in VS2008. But it's very inconvenient for me. When I open Qt project in Qt creator it can't compile because can't find qmake.
Or maybe this is what you mean.
http://www.developer.nokia.com/Community/Wiki/How_to_use_Qt_Creator_IDE
Quote
Qt Creator is a new lightweight cross-platform IDE that comes in combination with Qt SDK. Qt Creator IDE package is very easy to INSTALL which offers fast and RAPID application cross-platform development. Qt Creator IDE v4.5 includes several new features, but sees the greatest improvement via a concerted effort to increase performance across the entire framework. It's also the first release of Qt under the LGPL.
Please provide details.
1095.

Solve : Trying to make a remote app that you can change code anytime, need help. VB?

Answer»

So I'm kind of interested to experiment with this, what I'm trying to do is make the program read the code off an uploaded text file that I'm able to change anytime. Well I'm kind of stuck, here is what i got.



Code: [Select]Imports System.Net
Imports System.IO

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("the link to the text file with all the code")
Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim stream As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
stream.ReadToEnd()
End Sub
End Class

Uploaded text file can be any code for example:
Code: [Select] Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
messagebox.show ("Hello")
End Sub
End Class


It will end up being a sub within a sub or something like that, i haven't gotten that far in the programming language. Anything to help would be great, Thanks.A couple (a lot of) problems with this:
1. This isn't exactly a good idea -- someone can just watch the network requests and download all your source code -- do you really want that?
2. Are you really going to download the source code at every program run? You'll have a LOT of downloading to do when your program gets to be bigger (and trust me, it eventually will)
3. What about other files you need? 3rd party libraries? Images? How will it download or know to download those?
4. How on earth are you going to execute this? You'll basically have to either re-compile the program every run (takes time to do, requires every PC the program is run on to have the proper SDKs/tools, and will frustrate users) OR interpret it (.NET is not optimized for direct interpretation).
5. Your 'sample' won't work in any case because types are immutable -- you can't add part of a class at runtime; about the closest you can get is a class in an external library that implements some common interface.
6. What if the internet is down?
7. There are many ways to deliver and check for updates (assuming that's what you're doing) that are better than this.

If I may ask, what are you trying to accomplish by being able to edit the code in this way? It's a really good way to frustrate users when you make changes to the user interface without warning.Quote from: TechnoGeek on November 09, 2012, 10:18:58 PM

A couple (a lot of) problems with this:
1. This isn't exactly a good idea -- someone can just watch the network requests and download all your source code -- do you really want that?
2. Are you really going to download the source code at every program run? You'll have a LOT of downloading to do when your program gets to be bigger (and trust me, it eventually will)
3. What about other files you need? 3rd party libraries? Images? How will it download or know to download those?
4. How on earth are you going to execute this? You'll basically have to either re-compile the program every run (takes time to do, requires every PC the program is run on to have the proper SDKs/tools, and will frustrate users) OR interpret it (.NET is not optimized for direct interpretation).
5. Your 'sample' won't work in any case because types are immutable -- you can't add part of a class at runtime; about the closest you can get is a class in an external library that implements some common interface.
6. What if the internet is down?
7. There are many ways to deliver and check for updates (assuming that's what you're doing) that are better than this.

If I may ask, what are you trying to accomplish by being able to edit the code in this way? It's a really good way to frustrate users when you make changes to the user interface without warning.
It's just something to simply try out, there is really no point to the program I'm making other then running code from an uploaded file. It's just for fun and not for a serious program.here's some stuff that may help: https://duckduckgo.com/?q=compile+vb.net+dynamically
The thing about re-compiling in #4 and #5 isn't quite accurate, I didn't know about the dynamic compilation libraries available .NET before. But the performance considerations still stand, I think.Quote from: TechnoGeek on November 09, 2012, 11:02:57 PM
here's some stuff that may help: https://duckduckgo.com/?q=compile+vb.net+dynamically
The thing about re-compiling in #4 and #5 isn't quite accurate, I didn't know about the dynamic compilation libraries available .NET before. But the performance considerations still stand, I think.
I am using visual studio if that helps at all, I'm not using any old VB 6.0 or anything.Quote from: DaftHacker on November 09, 2012, 11:14:37 PM
I am using visual studio if that helps at all, I'm not using any old VB 6.0 or anything.

VB6.0 was part of visual studio. I can see from your screenshot that you're using VS2012 (running as admin for whatever reason), and maybe not the express version either given some of the menus you have available (unless those are VB specific). I think you'll find if you look that ONE of the first results in that link I posted has a zip file of sample code you can look at, which should work on any recent version of VB.NET.Not having a GOAL on what to specifcially achieve with such a program, and to achieve anything within the limitations of VB itself or any other language you chose to use, with the dynamic creation remotely, I would think that you would want to create a web interface by which to authenticate against, and create your code with, then have a routine on the web server side process and compile your code, and then offer you up a dynamic hyperlink pointing to your finished compiled product for download to the workstation etc that your on.

Only catch in this and VB is that I am not aware of any command line compilers for VB where there are numerous ones available for C++ which I work with. On the server side you would need to have a routine that takes your program and compiles it and then references to the compiled product and to do this, you would need to be able to execute a command via command line to compile from within say the Perl script which can interface with the command prompt on the fly and run an external process to that of the Perl CGI etc.

Personally this is A LOT OF WORK to create a program through a remote web interface, when its easiest to create the code locally. And would be even more involved if you made a WYSIWYG type interface that makes it so that a person who doesnt even know VB could assemble objects and create VB programs similar to WYSIWYG HTML creation tools.

The only programs I have ever created that were changed remotely, where controlled in a way that the code itself did not change. I had a program with a purpose, and within my program I had all the bells and whistles I needed. The program would read in a config file and that config file gave the program the variable inputs to process the correct routines based on simple IF,THEN,ELSE and loops in the functionality. So I wouldnt have to send a new EXE to a workstation or server to perform different tasks, the tasks could be changed by changing the config file and sending that config file over the private network to the systems/servers, and upon scheduled task, trigger and run the way I wanted it to following DIRECTIONS from the Config.TXT file that was in the root of the EXE.VB.NET,C#, and even FSharp expose their compilers as part of the .NET Framework, as part of the System.CodeDom.Compiler namespace. the C# Compiler is the CSharpCodeProvider class; the VB.NET compiler is the VBCodeProvider. These can both be used to compile files or strings into full Assemblies.

The compilation unit of .NET is the assembly. The best way to work with an assembly is with either concrete classes or interfaces. Create a class definition that implements that known interface or derives from a known concrete class, and then use the CodeDOM to compile that file into an assembly, using one of the language code providers.

The compilation is the same as that performed by Visual Studio. The resulting Assembly is not interpreted anymore than something compiled from Within Visual Studio. The only catch is that you cannot unload dynamically compiled Assemblies unless you load them in a separate AppDomain, but that should only be an issue if your program runs for very long periods and loads a lot of separate assemblies. This can usually be mitigated by simply doing all the compilation needed during application startup.

One important piece is that you need a consistent interface. That is, Something that the main program knows to look for in the resulting compiled assembly.
Thankfully, you can implement a simple interface in your external file, and use that.


Eg. ICodeRunner interface:

Code: [Select]Public Interface ICodeRunner


Sub Run()

End Interface



and a program that reads .cs and .vb files and compiles them into Assemblies, which it stores in a List. It then iterates through each assembly and then each Type in each Assembly and looks for classes that Implement the ICodeRunner interface defined in the project, and when it does it instantiates them and runs the interface method.


Code: [Select]Imports System.Reflection
Imports System.IO
Imports System.CodeDom.Compiler
Imports Microsoft.CSharp

Module Module1

Sub Main()

Dim PathUse As String = Assembly.GetExecutingAssembly().Location
PathUse = PathUse.Substring(0, PathUse.LastIndexOf(Path.DirectorySeparatorChar))
Dim di As New DirectoryInfo(PathUse)
Dim AssemblyResults As New List(Of Assembly)()

Dim fi As FileInfo
For Each fi In di.GetFiles()
Dim result As Assembly = CompileScriptToAssembly(fi.FullName)
If Not result Is Nothing Then AssemblyResults.Add(result)

Next
Dim Runthese As New List(Of ICodeRunner)()
For Each iterate As Assembly In AssemblyResults

For Each looptype As Type In iterate.GetTypes()
If looptype.GetInterfaces().Contains(GetType(ICodeRunner)) Then

Runthese.Add(Activator.CreateInstance(looptype))

End If



Next


Next


'now run them...
For Each looprun As ICodeRunner In Runthese
looprun.Run()
Next

Console.ReadKey()

End Sub

Public Function GetTempPath() As String
Dim tpath As String = Path.GetTempPath()
tpath = Path.Combine(tpath, Assembly.GetExecutingAssembly().GetName().Name)
If Not Directory.Exists(tpath) Then Directory.CreateDirectory(tpath)
Return tpath
End Function
Public Function CompileScriptToAssembly(ByVal ScriptFile As String) As Assembly
Try
Dim readfilein As New FileStream(ScriptFile, FileMode.Open)
Dim sr As New StreamReader(readfilein)
Dim allcode As String = sr.ReadToEnd()
sr.Close()
Dim ExtensionTest As String = Path.GetExtension(ScriptFile).ToLower()
Dim AssemblyNames As String() = New String() {"system.dll", "system.Design.dll", "System.Xml.dll", "system.data.dll", "system.windows.forms.dll", "system.drawing.dll", Assembly.GetExecutingAssembly().Location}
Dim cp As New CompilerParameters(AssemblyNames)
cp.GenerateExecutable = False
cp.GenerateInMemory = TRUE
Dim outfile As String = Path.Combine(GetTempPath(), "script_" + Path.GetFileNameWithoutExtension(ScriptFile))
If File.Exists(outfile) Then File.Delete(outfile)
cp.OutputAssembly = outfile
Dim result As Assembly
Dim cr As CompilerResults = Nothing
Select Case ExtensionTest
Case ".cs"
Dim Prov As New CSharpCodeProvider()
cr = Prov.CompileAssemblyFromFile(cp, New String() {ScriptFile})
Case ".vb"
Dim Prov As New VBCodeProvider()
cr = Prov.CompileAssemblyFromFile(cp, New String() {ScriptFile})
Case Else
Return Nothing
End Select

If cr.Errors.HasErrors OrElse cr.Errors.HasWarnings Then
'Errors occured during compilation...



Else
Return cr.CompiledAssembly
End If
Catch
Return Nothing


End Try

End Function

End Module


As a console project- then put the following in the Bin/Debug folder, in a file called "RunExample.vb":

Code: [Select]imports System
imports dynamicrunner

Public Class RunExample
Implements ICodeRunner
Public Sub Run() Implements ICodeRunner.Run
Console.WriteLine("Executing from outside the program!")


End Sub



End Class

The End result is the output "Executing from outside the program" indicating that the "text file" was compiled and run.


This example uses files as the main source, but the requisite functions (CompileToAssembly) Can also accept plain strings. You could always use a WebClient to download a file to a local path before compiling, as well.

This simple implementation doesn't do anything special in the case of errors. (The C# Code that I derived it from uses a special Exception class to represent the aggregation of compiler errors, but I've removed it for brevity in this VB.NET implementation).



1096.

Solve : mini project for MCA?

Answer»

Iam persuing my final YEAR MCA i want MINI project in JAVA .I choosen my project as "Weather Report" i wnat IDEA to do my project please hehp me please its urgent.I worked on a similar project in a C# programming book which used RSS feeds in which the C# application was merely just a RSS READER that was getting a weather feed for info to display. Here is some that pertain to Java and RSS http://www.vogella.com/articles/RSSFeed/article.html

1097.

Solve : Variables, and meaningful names?

Answer»

I can figure these out to save my life and I only have 45 minutes left

Please help


1.Write ASSIGNMENT STATEMENTS that perform the following operations.

Store the value 42 in variable theQuestion

2.Write assignment statements that perform the following operations.

Multiply decPrice by intCount and place the result in decTotal

3. Write assignment statements that perform the following operations.

Store the "A" in the variable gradeTwo issues I can see off the bat are you didn't name the programming language you were using, and more importantly, you never provided any of what you've tried so far.i am in this logic and DESIGN class i have not gotten anything yet.

Pseudocode

1098.

Solve : ms access relationships diagram?

Answer»

Hi i am new to ms access databases, really struggling with my tables relationships

my database has more than one many-to-many relationships, for example one instructor can have many classes, one CLASS can have different instructors, one client could have different instuctors, one instructor could have many clients and all at different times, on different days

eg: 18/06/2013 Time: 8:00, Instructor: Steven, Class :Pilates, Clients: Bob,
Andrew,
Jess,
Alex

Time: 9:30, Instructor: Thomas, Class :Yoga, Clients: Alexis,
Kerry,
Alex,
Bob

22/06/2013 Time: 10:00, Instructor: Greg, Class :REFORMER, Clients: Bob,
Harry,
Jess,
Alex

Time: 16:30, Instructor: FRED, Class :Yoga, Clients: Alexis,
Kerry,
Alex,
ALEXANDRA
(Each day can have many of these at any times)

really struggling on this one, its probably really though any help on relationship DIAGRAM would be greatly appreciatedyou need another relation table.

that will contain the instructor id, the time and the class id.

based on that you will have 3 tables. one for class, one for instructor and one for the relation between them.

1099.

Solve : Help with while statement in a vb 2010 program?

Answer»

Hello everyone,

I'm WORKING on a program that will allow me to send a single email multiple times to the same recipient. To do this I'm using a while statement, but it doesn't seem to work. Here's what I have.

Code: [Select]Dim i As New Integer

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
i = 0
dim e as new integer
e = Textbox16.text
Try
While Not i = e
SendMail()
i = i + 1
End While
MsgBox("All Mail Sent")
Catch ex As Exception
e = 0
i = e
MsgBox(ex)
End Try
End Sub
The SendMail() sub is here:

Code: [Select]Private Sub SendMail()
Try
Dim SmtpServer As New SmtpClient
Dim mail As New MailMessage
SmtpServer.EnableSsl = True
SmtpServer.Credentials = New Net.NetworkCredential(TextBox1.Text, TextBox2.Text)
SmtpServer.Port = TextBox3.Text
SmtpServer.Host = TextBox4.Text
mail = New MailMessage
mail.From = New MailAddress(TextBox3.Text)
mail.To.Add(TextBox10.Text)
mail.Subject = TextBox9.Text
mail.Body = TextBox8.Text
SmtpServer.Send(mail)
Catch ex As Exception
End Try
End Sub
When will the statement i = e be true?
Quote from: Salmon Trout on October 22, 2012, 12:50:59 PM

When will the statement i = e be true?

In the while statement it has:
Code: [Select]i = i + 1This should add 1 to i until i = eAnd is that happening?
Quote from: Salmon Trout on October 24, 2012, 07:17:40 AM
And is that happening?

No, it completely skips the while statement and goes straight to the messageboxAnd what is i?

Even if it is a form-level variable, the code won't compile. e is declared as a local variable but it already exists as a PARAMETER to the event method.

Ignoring those two problems, The code seems to work mostly as intended. Though if the input value was 50 it actually iterates 51 times.

I also wonder why you would use a While Loop to begin with. For...Next seems to do what you are after and more concisely:

Code: [Select] Private Sub Button1_Click(ByVal sender As System.Object, ByVal ev As System.EventArgs) Handles Button1.Click

Dim e As Integer
If Not Integer.TryParse(TextBox1.Text, e) Then
MessageBox.Show("Please Enter a Number")
End If
e = TextBox1.Text
For i = 1 To e
SendMail()
Next i
MessageBox.Show("All Mail Sent")

End Sub
I changed the parameter name to ev, and I used the equally indescriptive name for the textbox, TextBox1. Just has a better ring than TextBox16. I was going to go overboard and call it "txtSendAmount" but then somebody might be able to make sense of what it is for, and we wouldn't want that. I also used Integer.TryParse() simply because I never liked the IDEA of implicit type coercion at least as implemented in Visual Basic. Too unreliable. And more importantly, it can throw an exception which in the original code would have been unhandled. Best to make Exceptions EXCEPTIONAL and avoid causing them to begin with.

Another point is that The Try...Catch block in the Button event routine is moot. The only thing that could throw an exception within the try...catch would be the call to SendMail(), but that method already silently catches all exceptions anyway. More importantly, "Pokemon" exception handling ("Gotta catch em all") is not generally a good idea.


1100.

Solve : programming language tutorials-C,C++,MATLAB,LABVIEW,Simulink and more?

Answer»

The TUTORIALS section covers RF and wireless tutorials. It include zigbee tutorial,antenna tutorial,GSM tutorial and tutorial on CDMA,satellite,LTE,WiMAX,DSP,Wireless LAN,GPRS,RF measurements,WAVEGUIDE,SCADA,GPS,TD-SCDMA,VSAT,UMTS,microcontroller,Test and Measurement, speech coding,C programming,C++ programming,Labview tutorial,simulink tutorial,Matlab tutorial,VHDL,tutorial,AMPS tutorial,DECT tutorial,software testing tutorial and more topics.
http://www.rfwireless-world.com/Tutorials/

Well, it is free. Thanks.
Zigbee protocol stack is a software standard used in some wireless hardware.