Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - DreX

Pages: [1] 2 3
1
Can I just ask where must i put this sample file.
When I enter
python olevba.py <sample> > vba_extracted
I first get
> was unexpected at this time
When I remove it it says it can't find the file. Even if I specify the files location.

2
Web Oriented Coding / $_POST trouble
« on: April 27, 2015, 02:13:23 pm »
As a practice I made a simple Bank.
http://pastebin.com/YzVMRui4
I have a couple of problems:

1. I can't withdraw money. The program recognizes that there is something inside $_POST['deposit']. So it executes the if for deposit which puts the "withdraw" to 0 at the end (this line is there because without it i couldnt make a deposit).
But the default value of deposit is set to FALSE (tried with NULL and 0 also). So why does it sense a value when there is non?

2. If i deposit some money it goes through and the $_POST['deposit']=0 at the end. But when I refresh the deposit is changed back to the value previously inserted.

There probably many ways I could make this code cleaner (radio button), but I just want to understand why things are this way for future.

3
Web Oriented Coding / Re: PHP function problem
« on: April 17, 2015, 08:09:49 pm »
NVM, no return command in the sub and add functions.

4
Web Oriented Coding / PHP function problem
« on: April 17, 2015, 08:05:38 pm »
http://pastebin.com/FRHQSXq5
Can anyone tell me why this wont echo:
-the first three arrays are doing nothing since I wanted to test functions out on something simpler first.

add function: 8
sub function: 2

Instead I get:

add function: 
sub function:

Also, is there a way I can track my code line by line and check the values like I can in NetBeans with Java?

5
"name" is a tag HTML property, so if you change it to "name4444" then HTML will not understand it.
And it's not like a $ sign in PHP. The two cannot even be compared... HTML works in a key-value mode, meaning HTML has defined tags/keys and special words, like any normal programming language does, to which you assign values.

Thank you for answering.

6
Web Oriented Coding / PHP form handling, need an explenation of a line
« on: April 05, 2015, 11:40:52 am »
I just want to know what this lines do:

Code: [Select]
<form method="post" action="formtest2.php">
<input type="text" name="name2">

http://pastebin.com/TBDjEMt2

The way I "understand" this is:
1.st line: the form is set to send the data using POST method to the PHP program formtest2.php -> when I press submit it will realod formtest2.php and it will carry with it anything that has been written in, under $_POST array.

2.nd line: creates an input field. Input type is "text"->meaning it will show what you write in etc...  What you write in is them saved under "name2". If you want to reference it you will call it by "name2" ($_POST[name2]).
      I don't fully understand that "name= ". Is this like $ sign in PHP? Does it always have to be 'name= ' or can it be 'name4444= '...?
     

7
Web Oriented Coding / Re: MySQL enter as user problem
« on: March 22, 2015, 09:53:21 pm »
Solved it with friends help.
I was issuing the command:
-u jim -p
from the mysql.exe directly and not from cmd (which when opened immediately loged me in as root).

So i had to navigate with cmd to my mysql.exe first. Once there I put in:
mysql -u jim -p
and then password

And now it works.

8
Web Oriented Coding / Re: MySQL enter as user problem
« on: March 22, 2015, 06:42:51 pm »
See if these help

http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064

http://stackoverflow.com/questions/23515347/how-can-i-fix-mysql-error-1064

Nope, I don't see the solution here.

My problem is that I don't know the command line for logging in as a user.
here is a pic.

9
Web Oriented Coding / MySQL enter as user problem
« on: March 22, 2015, 03:46:57 pm »
First of all, I'm completely new to MySQL.

I had installed ZendServer before (following my pdf guide) but have then uninstalled it and installed wampserver 2.5.
In my guide I created a new user:
GRANT ALL ON publications.* TO 'jim'@'localhost' IDENTIFIED BY 'password';

Then I quitted and tried to see if it worked with:
D:\wamp\bin\mysql\mysql5.6.17 -u jim -p;
But i get ERROR 1064...

What must I enter to get this right?

10
Java / Re: Can't read some txt file
« on: March 09, 2015, 09:22:21 pm »
It is an issue with the characterset that the scanner applies implicitly. Has nothing to do with the size of your files, but whether they happen to have the correct charset. If any character of your file is outside of the applied charset's range, the scanner's hasNextLine will return false.
Specify the correct characterset and you are fine, e.g. with

Code: (Java) [Select]
Scanner fileHandler = new Scanner(newFile, "latin1")
your test.txt will work fine.


Yp, it works.
Thank you very much.

11
Java / Re: Can't read some txt file
« on: March 07, 2015, 05:53:25 pm »
I'm awful in java but why are you using fileHandler.hasNext() but then you're trying to get line. Has next it's about token, not about line. Try to use hasNextLine()

And it would be great if you could describe what errors you have

changing it doesn't fix the problem and the program doesn't crash or anything. It just doesn't bring up the txt file.

Here is an example.
When I open "mapmaking.txt" it displays both links but when I open "test.txt" it doesn't show anything (as if i did nothing).

12
Java / Can't read some txt file
« on: March 07, 2015, 03:59:12 pm »
http://pastebin.com/rDD90Nnb#

 
I don't know why some files can be read and some can't.

The main difference I can see, is that small files (2 lines) can be read while larger files can't be.
Is there some sort of limitation on this?

13
Java / Re: Simple equation totaly wrong
« on: December 24, 2014, 05:56:45 pm »
If you want to stay with your int x, you would need to do this:

Code: (Java) [Select]
public static void main(String[] args) {
      int buyCost = 4321;
      int sellCost = 4252;

      int profit = 1000;

      int x = (int) (1000 * profit * (sellCost / (double) buyCost));
      profit = x / 1000;

      System.out.println(profit);
}

Otherwise you are performing an integer division of this part:
(sellCost / buyCost)
which will result in 0, because decimal places are just cut.

See the output of this:

Code: (Java) [Select]
int buyCost = 4321;
int sellCost = 4252;
int x = sellCost / buyCost;
System.out.println(x);
Result: 0

This even happens if your x is of the type double, because the right part is evaluated first. So it performes an integer division and converts the 0 int to a double afterwards.

Code: (Java) [Select]
int buyCost = 4321;
int sellCost = 4252;
double x = sellCost / buyCost;
System.out.println(x);
Result: 0.0

Only this works as you might expect:

Code: (Java) [Select]
int buyCost = 4321;
int sellCost = 4252;
double x = sellCost / (double) buyCost;
System.out.println(x);
Result: 0.984031474195788

This works.
Thank you very much.

14
Java / Re: Simple equation totaly wrong
« on: December 24, 2014, 05:27:42 pm »
doesn't work. I assume because he first devides and from that I can only get 1 or 0 and not a decimal %.

15
Java / Simple equation totaly wrong
« on: December 24, 2014, 02:31:06 pm »
Code: [Select]
int buyCost=4321;
       int sellCost=4252;
       
       int profit=100;
       
       int x=100*profit*sellCost/buyCost;
       profit=x/100;

       System.out.println (profit);
profit=98 and this is the limit.

The next one (100 into 1000)
Code: [Select]
int buyCost=4321;
       int sellCost=4252;
       
       int profit=1000;
       
       int x=1000*profit*sellCost/buyCost;
       profit=x/1000;

       System.out.println (profit);
X=-9

And the further up i go the more it misses.

I am trying to get somewhere at least 4+ digits and because I don't know how to make decimal points I was going this way.

Pages: [1] 2 3