Assembly Guy 72 Posting Whiz

EDIT: It's not looking for a new line character, it's looking for a DC3 character.

It's what's known as a regular expression.

Basically, the two /s merely indicate the start and end of the regex. Just ignore them for now. \x13 is an escape sequence, basically meaning that instead of trying to find x13, PHP should try and find the character with the ASCII code of 13 (in hex). The same principle applies for the \x00 part - it's not trying to find \ and x00, but instead the character with the ASCII value of 0. The asterisk (*) means 'zero or more characters'. The '$' just means 'end of the line'.

So when this regular expression is put together, PHP will be searching for the entire pattern, in that order. I'm not very good at explaining this in an understandable manner, maybe someone else can clarify it. Or you might prefer to read about regular expressions on the web..

Assembly Guy 72 Posting Whiz

For the transparency, Read up on Opacity.
I achieve blur by giving the text within the elements which I want to blur a text shadow and no text colour (ie, no alpha in an rgba() set), for example:

.blurred
{
    color: rgba(0,0,0,0);
    text-shadow: 0px 0px 4px #000;
}

You could trigger this class to be applied to an element using Javascript.

Assembly Guy 72 Posting Whiz

What's your question? What have you achieved with the task so far? What are you stuck on?

Assembly Guy 72 Posting Whiz

See the PHP preg_replace Manual for the full synopsis of that function. But in a nutshell, the code you've provided uses a regular expression to delete any instance within $plain_text of a new-line character which is followed by a null character (end-of-string), which in turn is followed by any amount of characters and another new line character.

Assembly Guy 72 Posting Whiz

system ("pause");

Don't ever do this. It's not cross-platform at all.

Assembly Guy 72 Posting Whiz

As far as I am aware, <header> and <footer> are to be used inside <body>.

Assembly Guy 72 Posting Whiz

No. Python is a scripting language, which means that it requires an external program to interpret the python source code for it to be executed. To be able to execute Python, you require the Python Interpreter to be installed. This interpreter only runs in an existing operating system, such as Windows or Linux. On top of that, Tkinter requires a window manager to be present. On Windows, the window manager is part of the OS.

This renders it impossible to write an OS directly in python.

ddanbe commented: Yes. +14
Assembly Guy 72 Posting Whiz

I wonder how it would stack up today.

Yeah, a lot of things you thought were awesome just don't have the same feel in the present.

In relation to Sublime Text, I like the look of the colours on the black background, but like others have said, I'd prefer if it stuck to my Gtk theme.

Assembly Guy 72 Posting Whiz

Too bad those aren't for the PC.

Someone's bound to have ported to PC. Surely?

Assembly Guy 72 Posting Whiz

The header() function is exactly what you need here. To redirect, simply use it like:

header("Location: xyz.php");

To redirect to the example page xyz.php. If you have a fair amount of pages, then you could store their filenames in an array in a file called go.php:

$pages = array(
    'index.php',   // ID 0
    'contact.php', // ID 1
    'about.php'    // ID 2
);

And simply accept an ID through as a GET value, say $_GET['id'], so to pass this ID to the page, it'd just be a simple matter of redirecting the user to whichever page has the ID which matches the ID specified. So go.php might become:

$pages = array(
    'index.php',   // ID 0
    'contact.php', // ID 1
    'about.php'    // ID 2
);
// If no ID specified, default to ID 0
$id = isset($_GET['id']))? $_GET['id'] : 0;

// If the ID is an existing index of $pages, redirect. Else, display error message
if ($id >= 0 AND $id < sizeof($pages))
{
    header("Location: ".$id);
} else {
    echo("Page not found!")
}

Then, for example, you'd simply have to link to go.php?id=0 to go to the homepage. You could of course expand this to use an associative array (dictionary) to give each page a purposeful ID instead of a number. For example:

$pages = array(
    'home'    => 'index.php',   // ID 'home'
    'contact' => 'contact.php', // ID 'contact'
    'about'   => 'about.php'    // ID 'about'
);

So you could link to go.php?id=home for the homepage. However, this means you'd …

Assembly Guy 72 Posting Whiz

Never throw computers out - there's bound to be a local geek who will use it for something. If it's too old to use for anything, then it's probably museum material ;)

But seriously, keep Windows on it while you can. You could partition the hard drive and try some Linux distributions.

Assembly Guy 72 Posting Whiz

Hooray, I'm normal!

Assembly Guy 72 Posting Whiz

Yeah, Mike's idea's pretty good.

Assembly Guy 72 Posting Whiz

Very nice, Dani. I was unsure about some of the stats and had to half-guess what they were. I'm sure lots of other people will find these useful! :)

Assembly Guy 72 Posting Whiz

Nice. Does it work? You could probably write a function to print a question, get an answer and say correct or incorrect. You would just have to pass the question and correct answer as pointers.

Assembly Guy 72 Posting Whiz

Sweet, sounds reasonable. Can they be edited after publication?

Assembly Guy 72 Posting Whiz

Tedmorrow, please leave this thread alone, it's old and it wants to rest in peace.

happygeek commented: ignore him, he's a spammer +12
Assembly Guy 72 Posting Whiz

Someone enlighten us on the specifics of tutorial drafts - are they publicly visible? I take it they're editable until published or something?

Assembly Guy 72 Posting Whiz

Nice. Years ago I was writing some PHP and I used a crappy method whereby I selected all rows, buffered them into an array, then selected some random elements from the array... it was horrible. It took me a lot of searching back then to find the same method that you've used here.

Good to see someone's spreading the better, cleaner solution.

Assembly Guy 72 Posting Whiz

Would people please stop reviving this thread? Can we get a mod to lock it or something?

Assembly Guy 72 Posting Whiz

I wouldn't read too much into what people say on those types of sites anyway. They all know they are anomonyous posters so they say almost anything that pops into their sick minds. Would they do it in real life? Changes are, no.

True. There are many troll sites on the web, where all of the posters may be one person.

Assembly Guy 72 Posting Whiz

Are you using MS Visual C++? If not, have you had a look at SQLAPI++?

Assembly Guy 72 Posting Whiz

Nice going on the PHP, in my opinion (and many others'), it's the best language for generating hypertext.

Assembly Guy 72 Posting Whiz

If it's on the 'Deep Web' (ie if it's a hidden ToR service) then no. Otherwise, you might as well have a try at getting it shut down - talk to local authorities.

Assembly Guy 72 Posting Whiz

I also opted for MinGW back when I used Windows. It's good if you're going to expand into C++ someday.

Assembly Guy 72 Posting Whiz

In that case, it is a lot of data to store! Just a fun, half-relevant fact: they also use BitTorrent to move some of their data between servers

Assembly Guy 72 Posting Whiz

They use things like Data Warehouses and services provided by Akamai Technologies. So a lot of their storage isn't on-site, it'll be distributed around the world, as will the trucks bringing HDDs in ;)

the social networking website generates over 500 Terabytes of data every day.

Does this mean that they collect and store that amount, or that the pages they generate and send out to clients total 500TB?

Assembly Guy 72 Posting Whiz

I'm pretty much the same as pritaeas:

If I get a good topic I may. But it won't be one after the other.

Assembly Guy 72 Posting Whiz

Hey, welcome!

Assembly Guy 72 Posting Whiz

As gusano79 said, hash functions are one-way, which makes them perfect for encrypting things like passwords. They are never decrypted, but instead the password a user enters when logging in is hashed. This hash is then comapred with the hash of the correct password which is on record.

If you want to reverse a hash, you'll have to do it indirectly, by undergoing a painstaking operation of brute-forcing it. For example generating strings in a predictable order (a,b,c,d,e,f ... aa,ab,ac .. ba,bb,bc etc.) and hashing each string until the produced hash matches the hash you wanted to reverse. This is extremely expensive (time, electricity used by the computer) so there's really no point.

Assembly Guy 72 Posting Whiz

Wordpress.

Or if you'd rather write your own software, take a look at learning a server side language like PHP or ASP, as well as a database platform such as MySQL or SQLite

Assembly Guy 72 Posting Whiz

for todays trend c++ or SAP...

Which programming language you use for a certain task is not defined by what the 'in-thing' or popular, trendy thing seems to be. It comes down to the task at hand, the languages the people who are going to be completing the task/project know, and a bunch of other variables.

Don't let this evolve into one of the age-old programming language debates.

Assembly Guy 72 Posting Whiz

cliff

Assembly Guy 72 Posting Whiz

There might be something built-in, but I'm not familiar enough to give a definitive answer. You might like to look at having a crack at writing your own function to convert an integer into a binary number, stored as a string so you can print it. Wikipedia sums it up nicely https://en.wikipedia.org/wiki/Binary_number#Decimal

Assembly Guy 72 Posting Whiz

Well to make it do another question, you would just use the same process you used to check the first question, except printing a different question. So instead of using msga, you might write another, such as msgb and print that to the screen instead.

Assembly Guy 72 Posting Whiz

Ah right, gotcha

Assembly Guy 72 Posting Whiz

Non-forum pages? What exactly does that mean?

But either way, it appears to be working. Awesome :)

Assembly Guy 72 Posting Whiz

You might want to post the solution in case someone else has the same problem - it's up to you :)

Assembly Guy 72 Posting Whiz

I did witness that once, but this is happening every day - is Daniweb really spammed that much?
If so, would it be too intensive to recompute the read/new status when a post is deleted?

Assembly Guy 72 Posting Whiz

Sscanf doesn't do octadecimal; it'll do decimal, binary, hexadecimal and octal.
Octa and dec implies 8 and 10, so digits 0-9, A-H. CProgrammmmer, do you mean octal (digits 0-7) or octadecimal (0-H)?

Assembly Guy 72 Posting Whiz

so , if n is not useful then don't declare it.

This is why I believe -Wall (and other compilers' equivalents) shouldn't be optional.

ddanbe commented: Indeed! +14
Assembly Guy 72 Posting Whiz

Is this a C++ question? If so, you'll have to give more details about your intentions. What have you achieved towards this goal so far?

Assembly Guy 72 Posting Whiz

I won't hand the whole answer to you, as that wouldn't be helping you in the long term.
As a starting point, how many minutes are there in every hour? You'll need to divide the number of minutes by that number (ensuring it's stored or cast as an integer so as to truncate any decimals) to get the number of hours. This'll be your HH
You could then use the modulo operator to find out how many minutes are left over at the end. That will become your MM

Assembly Guy 72 Posting Whiz

Keep in mind that many people are in a different timezone than you and are sleeping. Wait a few days or so before bumping the thread.

Assembly Guy 72 Posting Whiz

I've noticed some poor accuracy in the little read/new icon to the left of each forum on the homepage. I've seen a 'NEW' message for the assembly forum quite a few times over the past few weeks, only to find there were no new posts there. AFAIK, ususally after visiting the forum, the icon on the homepage tells me I've read everything in the forum, as it should, but in the next few days, it says 'NEW' again when indeed there are no new topics.

Is this a known problem?

Assembly Guy 72 Posting Whiz

What's your question? We can't help you if you don't explain your situation.

Assembly Guy 72 Posting Whiz

If you have sed and tr then you could use to delete all instances of '\r' to convert from Dos to Unix, or to replace the end of each line with '\r\n' to go from Unix to Dos.

Dos2Unix: tr -d '\r' < dosfile > unixfile
Unix2Dos: sed -e 's/$/\r/g' unixfile > dosfile

Assembly Guy 72 Posting Whiz

Congratulations Myronz, you have successfully hijacked this thread. Sarcasm aside, this thread was about running Windows Executables on Linux, whereas your question regards driver issues. Please start your own thread in the Linux and Unix Board

Assembly Guy 72 Posting Whiz

Good pointing that out - I adapted this code from some old kernel code I'd written years ago, and the context in which it was being used meand that it couldn't be optimised that way. That aside, I agree, that would certainly make the algorithm more efficient.

Assembly Guy 72 Posting Whiz

The C++ code is giving me the expected result, was it your MIPS assembly which gives the problem?