Posts for arflech

arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Netscape was the first browser to support Javascript so I'm sticking with it
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
I still wonder...what components of Cygwin do I need installed to see the animation?
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
FODA wrote:
That day chrome came out it was crashing on 90% of the computers I've seen it running (or trying to). Also, it didn't have plugins for ogame. I never touched it again.
Chrome has since gone from version 0.8 to version 3, becoming more usable in the process. As you might guess from my avatar, my favorite browser is Opera, because of its low memory usage and high speed despite the number of features built in, and especially because it is the most secure browser. Then again it isn't compatible with a lot of sites, and although it does a good job of following current standards, it isn't particularly innovative in implementing the upcoming CSS3 and HTML5 standards the way Firefox and Chrome and Safari are.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Well I know an annoying thing about Mozilla is how involved the build process is; one time I tried to make an optimized build of Camino, similar to Swiftfox for Linux or the Pigfoot builds for Windows, but it took a long time and failed anyway (then I found rpm-mozilla.org.uk) I still start thinking about trying to make an -O3 PGO build of SeaMonkey 2 for Windows with jemalloc and all those other speed improvements, and then I notice you need to install the "mozilla-build" system:(
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
^I know; all you said was that you tested in Linux and Cygwin, so I tested in native Windows. :-D Also that property of "HTML is ON" is odd; I figured out that was why .h kept disappearing in include directives, but I wonder why the code tag isn't treated as a pure CDATA section or like a pre element or something, where no tags inside the code tags will be parsed.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
I think there is an even more important issue to consider: loading speed. Chrome and Opera load quickly, while Firefox and IE do not...but maybe that's because of all of the extensions and toolbars I use. By the way, the earlier poster referred to "plugins" as something that Chrome lacks, when in reality it supports NPAPI plugins just like nearly every other browser, even IE to a small extent; plugins are like small programs that are called by the browser, while extensions alter the behavior of the browser itself. Plugins can be made cross-browser (it's the same NPSWF32.dll or .so or .dylib or whatever for all non-IE browsers on your computer), but at least as of now extensions are not cross-browser. I should also mention that extensibility is not a property of the rendering engine but instead of the user interface (the "browser chrome"); most of the loading time of Firefox can be blamed on XUL (XML User interface Language), which allows extensions to be written, while XUL-less Gecko browsers like K-Meleon, Camino, and old versions of Epiphany (since switched to WebKit) load quickly. I have noticed that Chrome is not loading as quickly as it used to; maybe it's the fault of the experimental extensibility support? EDIT: I almost forgot to comment on Nach's rant against Firefox: In your opinion, does it still suck that bad (and it sure did suck, I switched to Opera during the Firefox 2 era when Opera became both free and ad-free), now that two impressive upgrades (3 and 3.5) have been released, with 3.6 soon to come, and with the latter of the two focused on speed? (I'll admit the built-in Ogg codecs are slow but still...)
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Bisqwit wrote:
(Tested, compiles and runs on at least Linux and Cygwin.)
The code needs some serious hacking before it can compile with TCC or MinGW GCC in Windows, because Windows uses a slightly different implementation of sockets. I tried compiling TCC in Cygwin (because I love that compiler so much), and then I learned that you should never run UPX on Cygwin binaries. (the same goes for Java, AbiWord, Recuva, Defraggler, and Google Chrome...even though Java runs after UPX, I couldn't upgrade it without un-compressing it) Then after that I found TCC still wouldn't compile, probably because Cygwin puts all the good stuff in /usr/local and for some reason the TCC configure script couldn't find it, so I bit the bullet and used GCC...but I did not get to see the magic. What other components do I need to see the animated image?
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Would it be too hacker-ish to test for an odd integer with n&1, or to replace n%2 with (n>>1)<<1, or to pepper your functions with inline asm?
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Bisqwit wrote:
Warp wrote:
<...> the "std::" prefixes actually make the code easier to read, not harder. For example, suppose you have a line of code like this:
search(i1, e1, i2, e2);
Is that calling some local function, perhaps some member function of the current class, a function defined in some of the header files included in this file, or maybe a function in the standard library? It's impossible to say from that line alone. However, suppose the line was written as:
std::search(i1, e1, i2, e2);
Now there isn't even a shadow of a doubt what this function is: A function in the C++ standard library.
In my opinion, the same rationale could be used to justify putting an explicit this-> before all references to the current class's methods and properties, such as:
this->copy(this->elem1, this->elem2);
Or perhaps:
this->myClass::copy(this->myClass::elem1, this->myClass::elem2);
We all just have to draw the line somewhere(Note: I do use std:: prefixes in my code, but I try to write my code such as to avoid scattering them throughout, especially from having many on the same line.)
"->" is a cop-out, be a truly elite hacker by saying "(*this).myClass::elem1" etc. of course the most elite hackers just code in assembly, and not with assemblers like HLA and MASM that provide macros and even (in the case of HLA) allow object-oriented programming, I mean a low-level assembler, like FASM
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
mindnomad, please get a smaller avatar: you are breaking the tables and compressing the posts in this forum
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
How powerful does a PC need to be to run PCSX2-RR?
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Kitsune wrote:
I'd love to see anything but another Shining Force game. Shining in the Darkness was good, but the later RPG/Strategy games are just so boring.
Those strategy games are the best parts of the series, although i'll admit that first dungeon-crawler and the Shining Soul sub-series are better than Shining Wind etc.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
opps all I remembered was to optimize to the fullest (-O3, which I realize does make larger executables than -Os) and build for my processor (-march=pentium4)
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
It is not a good idea to put a using declaration in the global scope, like right after the include directives, because it is then too easy for namespaces to clash. Also the ANSI-C version of Bisqwit's code can at least be compiled into a much smaller executable with TCC; I got 3KB with TCC, while compiling the C++ programs with GCC (TCC does not support C++) and then compressing with UPX yielded half a megabyte.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Perhaps you can put the nasm folder in your PATH ooh, another idea is to put a copy of the win32 version of NASM in the folder where your Visual C++ executables reside (like C:\Program Files\Microsoft Visual Studio 9.0\VC\bin) and put the special rules file in VCProjectDefaults (like C:\Program Files\Microsoft Visual Studio 9.0\VC\VCProjectDefaults) and then set up the project to use NASM; the relevant files can be downloaded here: http://sourceforge.net/projects/nasm/files/ (get the zip file for nasm 2.07 under win32 binaries, and also download nasmVS.zip to get the rules file)
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
This is also another good example of a tutorial best done as a video: http://www.youtube.com/watch?v=twxEVeDceGw It's about using gdb to step through a program, starting with writing and compiling a simple C program using wide characters, so the viewer gets an idea of what the program is supposed to be doing. Also this video shows why SciTE is so awesome (the secret is Lua): http://www.youtube.com/watch?v=OWYdVmULKW0 He has some good Linux software development videos, including using Glade, the GNOME GUI designer. Also youhakim is good at making legible videos, like this one about making assembly code from C with GCC and then using OllyDbg on it in Windows: http://www.youtube.com/watch?v=Jt3aUqDxW_8
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
showing what it looks like when you compile and then run programs Also this guy (Michael Hall) does have articles in HTML format to accompany the videos (which are usually less than 5 minutes each and not fast-paced), and they are not mere transcripts of the videos. The lessons involving more complicated programs refer to downloadable source code, while the articles for some other lessons do have copy-pastable source code, although again it is not always exactly the same as the code shown in the videos.
i imgur com/QiCaaH8 png
Post subject: Re: Flashget to download from archive.org
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Sir VG wrote:
ShinyDoofy wrote:
p0rtal_0f_rain wrote:
I don't know how Linux users can see this
As easy as wget -c URL
And if I remember correctly, there's a version of this for Windows.
There is an especially convenient GUI front-end for Windows: http://www.khomsanph.net/visualwget/
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
ohh ok As an aside, I just finished watching every single programming tutorial on http://xoax.net/ and those are probably the best-made tutorials on YouTube. It would be nice if the owner of the site also made a series on C (perhaps as a companion to the big one on C++ console applications), but he appears to be stretched thin with all of the series recently started already. The main issue I have is that he uses Visual Studio even for the general C++ tutorials, giving the impression that he is not writing cross-platform code, even though it looks as if he is. (For the Win32 and MFC series it is necessary to use Visual Studio though). Among the topics covered so far in his main series, Console C++, (not in this order) are preprocessor directives, data types, enums (but not structs or unions), branching (using if and switch), looping (while, do-while, and for, including how for is expressed using while), pointers and references (including function pointers and passing arguments by reference), namespaces, scope, arrays (including treating strings as char arrays and using pointer arithmetic), dynamic memory allocation, and object-oriented programming, which most of the newer videos are covering. That series just gave me the idea to make a video series on programming in C using TCC, a simple compiler for simple programs (now if only dietlibc could be ported to Windows or OS X...). I'm not sure I'm going to follow through with that idea though, because it takes a lot of work to make videos that are as clean and legible as XoaX.net's offerings. I sure won't do what most of the amateur "tutorial" makers do, running a screen-capture program, speaking into the microphone as I do it, and encoding at a horrendously low quality that makes it hard to read the code or understand what I say.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
If Bisqwit was able to swap the locations in memory of two functions for his "gruu" code, why can't a function be copied? Also, I forgot to post earlier a strange thing I read about arrays in C: C89 actually requires the notation a[n] to mean the same thing as *(a+n), where pointer arithmetic is used, so "int a[2]={1,2};" followed by "printf("%i",1[a]);" would print "2" because 1[a]=*(1+a)=*(a+1)=a[1]=2. I'm not sure when that would ever be useful, except perhaps when writing and using some macro to make it that much harder for people to understand your code.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
The meanings of "void" are confusing... "void func(){}" indicates a function with no return value "int func(void){}" is a function explicitly indicated to have no arguments "void* f" is a generic pointer, which usually must be cast to a specific pointer type before it can be used, and the confusing thing of course is that there is no void type for variables. Another confusing thing is that "int *p" is a pointer to an int, while if you use "*p" anywhere else, that's actually the int that p points to; IMO the symbol to indicate a pointer should have been a different symbol, like &, because for "int i", "&i" is the address of i. C++ references aren't that confusing though; "int &p=i;" is a reference to "int i", and then "&p" is the address of that int (because whenever you use p, it's exactly the same as i and you do not explicitly dereference). References are also less confusing (and less powerful) because there is no analogue to pointer arithmetic, references cannot be made to refer to any other variables, and there are "no references to references, no arrays of references, and no pointers to references." (ISO standard for C++98) Oh, Derakon didn't mention that making functions that take "callback functions" as parameters is much less resource-intensive when you pass functions by reference, by making function pointers, because like all variables, if functions are not passed by reference, the whole function must be copied during the function call.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Comicalflop wrote:
Look at Tompa's post again. 9+1+2+2+4+3+3+3+6+5=38. (And that's without exact calculations.) So yes, the TAS is 40 in-game minutes faster.
You misunderestimated my ability to take a second look...guess where I got "but not 48" from.
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
I was about to try something cooler with the rand() function, but I didn't feel like putting in one of the many pseudo-random number generators available on the Internet and I wasn't aware it was in stdlib.h Also I am aware of various improper things still working, like one time when I included a header in a .c file, I used the C++ name for the header and it still compiled because I guess GCC allows you to do that.
nfq wrote:
Swedishmartin wrote:
Hello, I suck at computers :)
not really. compare to me, i hardly even know what "compile" means.
I know this was said more than a year ago, but I don't think it was answered in this thread: A program is compiled when it is transformed from human-readable source code into machine code, which is a set of numbers indicating instructions, memory locations, and values that is directly executed by a processor; more generally, a program can be said to be compiled by being translated into a "lower-level" language, which requires less abstraction to parse and execute, like when Java is compiled into Java bytecode, the .NET languages are compiled into CIL, Python is compiled into .pyc or optimized .pyo files, or one of many experimental languages is compiled into C (the further down-level you compile, the harder it is to write a compiler, and although C has its flaws, it's simple enough to translate another language into in a cross-platform manner). Some code is merely parsed and interpreted as it is, not compiled; Java bytecode is interpreted by the Java Runtime Environment, Javascript is interpreted by your browser's JavaScript engine (like Windows Script Host, JScript, Rhino, TraceMonkey, JavaScriptCore, KJS, or Futhark), batch files and bash scripts are interpreted by the command processor, and Lua and Lisp are interpreted by a variety of programs. It is possible to run some "compiled" languages as scripts, like C (as CScript), Scheme, and Python, and it is possible to compile some "interpreted" or "scripting" languages, as V8 (in Google Chrome) does with Javascript, because for many modern Web applications, the speed gain from running a compiled script outweighs the cost of compiling the script. I should mention that for most purposes, after a program is compiled, it needs to be linked to any external libraries before it can be run, such as the Windows system libraries, DirectX, OpenGL GLUT, or the external libraries for whatever GUI framework you use, like MFC, WTL, GTK, Qt, FLTK, wxWidgets, the last of which is recommended because it easily allows the creation of cross-platform code for GUI applications with a native look and feel and without a heavy runtime. This is done by a linker, and most IDEs and compiler toolchains will automatically do this immediately after compiling, because the bare object file is not useful by itself.
Bisqwit wrote:
Tub wrote:
s/works/depends on random factors/
Well, deterministic random factors. Those being the assumption that the two functions are placed adjacently in the code -- which they are when compiled with current versions of GCC or CL. (ICC untested) I'm not planning to use it for anything serious, though.
Your function-altering "gruu" code also works in the latest TCC: http://bellard.org/tcc/ I heartily recommend this compiler for making cute little programs like the ones in this thread; it doesn't compile C++ though...
i imgur com/QiCaaH8 png
arflech
He/Him
Experienced Forum User
Joined: 5/3/2008
Posts: 1120
Also I think you need to add in the include statement, as in
#include <stdio.h>
int main(){char s[]="#include <stdio.h>\nint main(){char s[]=%c%s%c;printf(s,34,s,34);return 0;}";printf(s,34,s,34);return 0;}
because printf is defined in stdio.h somewhat less convoluted yet also less awesome is a quine in Windows batch scripting or in Bash scripting, etc. BAT/CMD
@more %0
Bash
#!/bin/sh
more $0
Now I would like to know, what would likely happen when you try to compile and run this code?
int main(){for(int i=0,int *p=&i;p>0;*p=(int)p,p--);return 0;}
EDIT: I now know why the .h was getting removed from my posts.
i imgur com/QiCaaH8 png