sDJh 39 Posting Whiz in Training

Yeah.
If you really have assembled your above code and copied it into the mbr, than the mbr is of course corrupted. You need at very least the correct primary partitions and the magic code at the end.
Like so: https://en.wikipedia.org/wiki/Master_boot_record

sDJh 39 Posting Whiz in Training

I wouldn't.
Simply increase a counter by one each time a valid number is entered and add this value to a variable sum. After the loop you can divide the sum by the counter and you get your result.
This will be faster and lighter on ram.

sDJh 39 Posting Whiz in Training

Are you running the same .run-file over again (I confess, I have never used teamspeak)?
A .run-file should put the programme somewhere in your bin- or opt- directories (install). If your installer hasn't done so, you can then create a .desktop-file pointing to the executable.
You can then place this file into /usr/share/applications/ and run "update-desktop-database" your icon will show up in the dash. You can then simply add it to ypur favorites.

sDJh 39 Posting Whiz in Training

It strongly depends. Also on you personal preference.

1) In normal desktop or server like environments, ASM isn't widely used anymore. But compiler-developers still need a very good knowledge of ASM and machine code. I also heart that some parts of modern DBS are still based on pure ASM.

2) When it comes to microcontroller, even though times have changed as well here, you do find critical code written directly in ASM. Personally I do tend to use it there as well as you can directly influence the memory-layout of your programme. This can be very handy when you have just a few bytes of memory available.

3) In the hardware industry (or companies that write emulators) of course. They have to test their new electronics (virtual machines) and this can be done most comprehensively in ASM.

4) In education. I know a lot of students disgust it, but I believe my software has become much better once I understood the principles of machine code. And I also believe everyone who intends to do software developement outside of desktop/server should be familiar with ASM even though they're not planning to use it.

sDJh 39 Posting Whiz in Training

I'd try something like this:

1) I'd create static strings with all your written numbers, eg _zero DB 'Zero',0 etc.
2) I'd put all addresses into a look-up-table, like array DD _zero, _one, ...
3) Then, as the input (BIOS or OS) will be ASCII, you have to convert it to dezimal, which is a simple substraction (see ASCII-table).
4) Now you can simply look-up the address of the corresponding string in the table and voila.

sDJh 39 Posting Whiz in Training

Is there any particular reason you're trying to convert rather complex C-stuff to even more complex ASM stuff? If it works in C then hurray.

If you're really heading to convert it, you'll either end up rewring the whole TCP stack or link the C-functions into your ASM-project which makes the whole idea obsolete.

sDJh 39 Posting Whiz in Training

I won't read or even test your code.

This is a good start:
Have a look at an ASCII-table. The number 0...9 have a defined representation there. You need to subtract the this offset, then multiply it by 10^x and add it to your result.

sDJh 39 Posting Whiz in Training

it does involve a loop. I'd call anything else bad coding.

why don't you draw yourself a table with the actions you'd do when having to solve it by hand? this is often (and definately in this case) a good start for an algorythm:

Moving a byte into a register, then using AND to zero the bits from 0 to 7 and shift it (reverse it). You can then store it in the output. I don't know whether the zero-byte is heading or tailing so you have to try out.

sDJh 39 Posting Whiz in Training

Well these tools basically do a certain task and messure how fast it can be acomplished.

But these tasks are not that easy to make up. You have a lot of statistical invarieties, you have driver-issues you have to ensure the OS gives you the needed privileges and so on.

If you want to do it for yourself, or for school/university, you can get some reliable results. But I wouldn't hope to write a software as good as an established benchmark.

sDJh 39 Posting Whiz in Training

Haven't tried your code, but as I can find just one "form", I'd take this is your front-end for the upload.

You have forgotten to add "enctype="multipart/form-data". So the correct form'd be:

<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>" enctype="multipart/form-data">

Hope that helps.

sDJh 39 Posting Whiz in Training

Certainly doesn't help to post a question twice. Especially not when posting such long source codes.

First off, tidy up your code. The one and only hint I can give: use a look-up-table with all the characters you want to eliminate, eg

vowals db 'a','e','i','o','u',0

and then go through your string with a double-loop checking each letter with your table.

The letters right to a match need to be copied one-by-one to to left.

A clean code should handle this in maybe 25 lines.

sDJh 39 Posting Whiz in Training

Java has the benefit of being multi-platform too. You can compile it once and run it on pretty all major operating systems.

If you plan a software from scratch and can avoid system specific things like kernel-calls, than you'd be safe with C++ as well. You just have to compile it for each target platform and distribute different binaries.

sDJh 39 Posting Whiz in Training

I'm glad to hear you solved your printer-problem.

The unsupported dongle hasn't got anything to do with opensuse. It's a missing linux-driver and every distro is affected by it.

I am afraid it won't work, but you can try to update your kernel. This is safe.
Add a new repository, either via Yast or via command line like so:

zypper ar http://download.opensuse.org/repositories/Kernel:/stable/standard/ "Kernel-Stable"

and then update the sytsem via

zypper up

or alternatively via Yast or Apper.
After a reboot, check you dongle. If it works, than please report here for others who suffer the same problem.

If it's not working, then mail the producer of your dongle and ask them to provide a proper linux driver.

sDJh 39 Posting Whiz in Training

It'd be good when you post the whole error message including line-numbers etc. Otherwise finding the error is like finding the needle in a haystack.

sDJh 39 Posting Whiz in Training

Sorry, haven't coded PHP for a long time. But this is basicalyy how I did it:
1) set up a 404-page in your .htaccess-file (don't know right now without looking it up, but there's plenty of stuff on the net)
2) you 404-file reads the full URL with the $_PHP-something-variables
3) redirect with header() to the php-file with the argument from the URL
I bet facebook and so on don't do it differently

sDJh 39 Posting Whiz in Training

Accessing Windows functions from ASM is fairly difficult. But if I get you right, that's not what you want.
Interrupts are also not accessible when having an OS running between your software and the CPU.
If you intent to write your own interrupt-handler, you can test it with an emulator. I use qemu for that. It's a very simple programme, but therefor (IMO) the best thing to examine your code.

sDJh 39 Posting Whiz in Training

or

@readfile("./path/to/your/file");

to output the content of these files. Take care that you might want to manipulate the headers for the correct content, name and size.

sDJh 39 Posting Whiz in Training

that strongly depends on the features you request. You can include your sourcecode with

%include "source.asm"

during compilation time or you try to access the file in runtime via the kernel.

For then first solution, NASM should be perfectly alright. Accessing the file in runtime can be quite tricky, but this could be a good start: Click Here

sDJh 39 Posting Whiz in Training

Hi!

Clear subjective answer: NASM is the best.
Why? MASM is a Microsoft product. I've never worked with it but I can imagine that you have to stick to MS Windows.
I personally started with NASM. I still love it. The syntax is very strict and therefore clear. Once learnt you have a very good knowledge of assembler. Website and docs are under http://www.nasm.us/.
You can also look for (G)AS as (http://www.gnu.org/software/binutils/) it's AT&T-syntax. Check which you prefer.

For tutorials look out the net. There are plenty. And maybe consider buying a book. And don't bother asking here, of course =).

sDJh 39 Posting Whiz in Training

How about?

SELECT `name`, `address`, `number`, `company`, `reservation` FROM `db`
sDJh 39 Posting Whiz in Training

what have you then been looking for?

1. in your posted file you need the attribute "name" in all of your <select>-tags. this makes php reefer to that value.
2. in the file search_result.php you do something like this:

<?php
$destination=$_REQUEST["destination"];    //your array passed to your file
$year=$_REQUEST["year"];                  // -"-
$r=mysql_query("SELECT * FROM ... WHERE `destination`='".$destination."' AND ` year`=".$year);
?>

you can then output your data with mysql_fetcharray or something similar.
You may want to vary your boolean logic in the mysql-statement.

sDJh 39 Posting Whiz in Training

Hi Paul...

...and welcome to the wonderful world of multi-os-users! You know what? I'm using the same configuration as you but have also many Linux clients running. For years now, my best solution is the bare minimum: FTP. This is simple, reliable and can be accessed by all major and even minor OSs.
Have a look for a ftp-server that you like, install it and set the root directory to the same one as your smb. This should be done in a few hours time. But after that your problems will be past.

Greetings, Simon

sDJh 39 Posting Whiz in Training

@ardav: that doesn't necessarily help either. You don't know if "drink" really is an array.
Additionally, I'd suggest to check that as well:

...
if(isset($_POST['drink'])) {
	$drinks = $_POST['drink'];
	if(is_array($drinks) && count($drinks)>=2){
	...

then you can be sure not run into a memory leak.

cu, Simon

diafol commented: good spot +14
sDJh 39 Posting Whiz in Training

Hi BenzZz,

as far as I understand this is a HTML-problem. Try setting the initial value with

value=""

to an empty string.

Otherwise I can suggest:
- Open your source code in your browser and see if you have any artifacts from your php parser
- make sure you have your JavaScript deactivated

I hope that helps, Simon

sDJh 39 Posting Whiz in Training

It's "illegal" to "use" a computer properly? What's BootCamp for, then? Since when is it "illegal" to run software on "my" hardware?

The only thing I can think of, that you actually loose warranty. But that's the case width almost all manufacturers.

Anyway. Some OS's do have problems with the UEFI loader. But there's a simple solution: http://refit.sourceforge.net/. This provides an emulation of needed stuff for these OS's.

Don't know if that's illegal now, but somewhere you can't take such licences very serious.

Greetings, Simon

sDJh 39 Posting Whiz in Training

Why do you want to open it in a browser? PHP needs to be executed on a server.

Anyway: Right click on the document. If there's no item called "Open with" then try holding these keys: Shift, Ctrl, Alt and Cmd. I don't remember which one is the beste choice, but you can see some items in the menu changing. You can then access "Open with".

Or, you open the browser and choose the file via the global menu "File".

sDJh 39 Posting Whiz in Training

Hi Drugs,

first suggestion: use explode(): http://de2.php.net/manual/en/function.explode.php. This is in my opinion one of the most powerful functions in php. At least I use it every day. It helps you tu truncate the data.

If you only want to show specified dates, you can simply generate a timestamp with mktime http://de2.php.net/manual/en/function.mktime.php and do a simple eqal or greater condition to find out if the data is too old.

Hope that helps for the beginning, Simon

sDJh 39 Posting Whiz in Training

Hello siva,

first of all, if you design your website well, it shouldn't be much of a problem to do a booking directly from an android-based webbrowser. Personally, I am very satisfied with the quality and speed of displaying websites on almost any mobile devices.

If you still want to provide an app as well, you do have to write it in JAVA. I once popped into android-java and it wasn't much different to anything I learnt before. I know that in the meanwhile there are also other possibilities (eg http://www.monkeycoder.co.nz/), but I've never tried them so far.

To start, you basically have to convert your PHP output from HTML to XML. Then you truncate the information and display them via your app. Sending data to the server works the other way round.

This all may sound a bit mind boggling, but when you once started, I guess all clouds might quickly disappear.

I hope that helps, Simon

sDJh 39 Posting Whiz in Training

Hi davy_yg,

first, put a file named ".htaccess" in the folder you want to protect. Right now, I'm not sure, if you actually have to put something in it, or if apache won't let anyone access that page when the file exists. Just fish for some info if it's not working.

Then you have to give permission to each user that shall be allowed to access these page. Simply put a flag in your database and check on top of a script (put somewhere else than your protected folder) whether it is set or not. If the access is granted, you can include these file width "include" oder "require".
Apache will only deny HTTP-accesses. With PHP, you can still work with that folder like before.

I'm wondering if that all. But I can't think of anything else to do... Try it out and report if it's not working.

Hope that helps, Simon

sDJh 39 Posting Whiz in Training

Hi Mary,

did the upload work? What does the output of

echo $_FILES[p_img][name]

say? Does your form have

enctype="multipart/form-data"

? And are uploads allowed by your php.ini-settings?

~Simon

sDJh 39 Posting Whiz in Training

Hello jonsca,

Yesterday I got new headers from the former developer. Now I don't get any errors from the installation. For me it looks like that project overrides some standard-headers and redefines datastructures. But I don't know and I don't mind!

Thank you for your quick replies anyway!
Simon

sDJh 39 Posting Whiz in Training

Hi newbie,

I can't tell you if there is a library for distributed transactions in PHP/MYSQL. I think you have to write something like that yourself.
I don't know what you want to achieve with your code but it's basically nothing more than double-checking the synchronized databases on two servers. And that can be done with mysql_connect().

Simon

sDJh 39 Posting Whiz in Training

I have downloaded "QT". On setup I realized that I have already installed "QT SDK". Do I need to install "QT" anyway? Could that be the problem? If so, I have to repartition my harddisk before installing.

sDJh 39 Posting Whiz in Training

Hello jonsca,

I just double-checked my installation. QT is version 4.7.3 (up to date). But I do now remeber having had problems during the installation. I will have a look into it this week.

Are there backward compatibility issues with QT and MinGW?

Thank you anyway! Simon

sDJh 39 Posting Whiz in Training

Hi newbie14,

yes you can. You can access database via TCP virtually on every server. Have a look here: http://de.php.net/manual/en/function.mysql-connect.php

Hope that helps - Simon

sDJh 39 Posting Whiz in Training

Hi Makrand,

these messages aren't errors but warnings to force you to improve your coding style. If you don't fancy that (like I do) you can set your PHP.INI variable "error_reporting" to "E_ALL^E_NOTICE". This stops php to reports these warnings (http://de.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting).
If you don't have access to the PHP.INI have a look here: http://de.php.net/manual/en/function.error-reporting.php or here http://php.net/manual/en/function.ini-set.php. For me both works, but sometimes one of these may causes some fuzz.

Hope that helps - Simon

sDJh 39 Posting Whiz in Training

Hello altogether,

I am supposed to work through a project written in C++ and QT for Windows platforms. Now I am not an expert in window-related stuff. I installed MinGW 3.4.5 and QTSDK on Win XP SP3.

I am using the tool "qmake" to create a makefile with all dependecies and that works just nice.
Then I use "make" to do the compiling and I get massive errors like these:

C:/Programme/MinGW/Bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bi
ts/istream.tcc:973: error: `__num' was not declared in this scope

For me that looks like the installation of MinGW is somehow corrupted.

Does anybody know how to fix that? Are environment-variables missing? Or do I need to install any further libraries?

Many thanks in advance!
Simon

sDJh 39 Posting Whiz in Training

Hi MasterGBerry,

yes you can. I don't know want your plan is exactly. But I do it this way:

Redirect permanent myoldlocation mynewlocation

(or was it the other way round?) Have a look in the official manual: http://httpd.apache.org/docs/current/mod/mod_alias.html#redirectmatch

What you could also try to archive is your own redirection using PHP and the readfile-function. If a user access an old address, the server calls the 404-error-page and that sends the data to the client.

sDJh 39 Posting Whiz in Training

Hi Katana24,

You could write your code in C++ (XCode). You can then install XCode or install your environment from scratch. But I advice you to use XCode as it's very simple yet powerful and you do have all development headers already installed on your system.

But there are open source recovery tools out there. For instance http://www.cgsecurity.org/wiki/TestDisk. It's not the best, but alright for daily usage.

Greets, Simon

sDJh 39 Posting Whiz in Training

Hi masterjiraya,

never ever send user-credentials via hidden textboxes. Use cookies or even better the inbuilt Session-Management from PHP. Have a look here: http://www.php.net/manual/en/book.session.php. Don't be afraid of the massive text, it's actually very simple (Basic Examples).

Hope that helps, Simon

sDJh 39 Posting Whiz in Training

Hi Programmer12,

you have to change the php.ini. Have a look for lines with the options

post_max_size

,

upload_max_filesize

and maybe

max_execution_time

I'm not sure about the last one. Try the uploads with the default value and increase it, if you have problems.

Feel free to ask further questions, Simon

sDJh 39 Posting Whiz in Training

the best alternative is, to lock an account independently from the IP address. That's how it's done in the real world. That might be stupid for the end-user as she/he can't login after an attack, but provides the highest security.

There are two possibilities:
1) Resetting the password and sending a link to unlock the account via email.
2) Blocking any login-attempt for a defined period of time (15 mins or so).

What's best for you depends on your taste.

Regards, Simon

sDJh 39 Posting Whiz in Training

fetch the last data you saved in your database, run through them and check if they're equal to the data, the user wants to add. That combined with a short time-period, you can happily take for granted that the user hit the refresh button of the browser.

sDJh 39 Posting Whiz in Training

Hi divyakrishnan,

you CANNOT access the complete filesystem of a remote computer! If that were possible, it'd cause a mess in security policies!

fikreyes is completely right. Have a look at basic Windows networking before trying to programme such things.

Greetings, Simon

sDJh 39 Posting Whiz in Training

I can't help thinking why on earth you wanna do that.

I'm debugging websites, so I can give you some advice. Visit http://ipinfo.info/netrenderer/index.php. There you can render websites with old versions of the IE from any browser. As the output is an image it should (!) also word on an iPad.

Greetz, Simon

sDJh 39 Posting Whiz in Training

Have you guys tried Carbon Copy Cloner (

http://www.bombich.com/

)? It's free and works perfectly for me. I cloned two partitions to an external drive. After that I could even boot the system from the second HD.

For me, I just can advice that.

sDJh 39 Posting Whiz in Training

Visual Basic? Hey guy, you're in an Apple-world now!

jingda commented: Correct:) +10
sDJh 39 Posting Whiz in Training

Whole codes? Well hint's are okay, but I won't cause fuss and try to figure out a completely running programme.

Think about how you determine the length of a string? Null-terminated? Fine.
I'd start like that:
Run through the string, till \0 comes. Decrease the register (let's call it the backcounter). Now run a second loop till the \0-character. Now compare the character of your backcounter with the one of your forward-counter. After each step you're decreasing the backcounter and increase the forward-counter.

That should be all.
Hope it helps.

sDJh 39 Posting Whiz in Training

Hi,

have a look here: http://www.php.net/manual/en/function.mail.php. You can simply modify the headers.

Greetings, Simon

sDJh 39 Posting Whiz in Training

Well, simply check if the content is equal to the data already stored in your database.