[QUOTE=Rohans;33722349]It's the default style. See [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx]this[/url].[/QUOTE]
I'm pretty sure he was using VB6.
[QUOTE=Rohans;33722349]It's the default style. See [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx]this[/url].[/QUOTE]
If I read it correctly, that page is referring to VB .NET? I don't think .NET was around back in 1998, when VB6 was released :v:
[editline]14th December 2011[/editline]
I swear that post wasn't there a second ago.
[QUOTE=DeadKiller987;33722552]I'm pretty sure he was using VB6.[/QUOTE]
The function doesn't exist in VB6 but the reason is still the same. Visual styles aren't enabled. Make a WinForms project and put a few controls onto it and comment out that function call, see what it does.
[QUOTE=amcfaggot;33716889]As a suggestion, I'd have an override for print that does what print normally does, but also prints to your console.[/QUOTE]
Nononono. Do not fucking override standard functions. Unless the console is going to be your SINGULAR output stream and you perfectly mimic the way it acts normally.
The proper way to handle this would be either:
printconsole() which uses the tostring metamethod, so as to print exactly like print() does, or an object oriented version that has a console object, etc, and works basically like printconsole() would.
Today task was to make a binary search witch used less comparisons than a linear search.
[cpp]
#include<iostream>
#include<algorithm>
#include<time.h>
using namespace std;
int binarysearch(int ar1[],int size,int key)
{
bool found = false;
int begin = 0;
int end = size - 1;
int mid;
while(begin <= end && !found)
{
mid = ((end + begin)/2);
if (ar1[mid] == key)
{
found = true;
}
else if (ar1[mid] > key)
{
end = mid - 1;
}
else if (ar1[mid] < key)
{
begin = mid + 1;
}
}
if (found == true)
{
return mid;
}
else
{
return -1;
}
}
int main()
{
srand(time(NULL));
int Array1[10];
for(int i = 0;i < 10; i++)
{
Array1[i] = rand() % 100;
}
sort(Array1,Array1+10);
for(int i = 0;i < 10;i++)
{
cout<<Array1[i]<<" / ";
}
cout<<endl;
cout<<endl;
int key;
int pos;
cout<<"Enter the number you want to find: "<<endl;
cin>>key;
cout<<endl;
pos = binarysearch(Array1,10,key);
cout<<" Target Found, "<<key<<" was found in index: "<<pos;
cin.get();
cin.get();
return 0;
}
[/cpp]
Output:
[code]
14 / 16 / 24 / 37 / 52 / 57 / 59 / 71 / 78 / 98 /
Enter the number you want to find:
59
Target Found, 59 was found in index: 6
[/code]
sorry for sloppy code :x
Working on an Android app now for local rooting without having to use USB debugging, through an exploit actually discovered in Feb (Android 1.X and 2.X only though), I'm not sure if its gonna work
However, compiling flat binaries for Android is a bitch, I'm guessing I'll have to download the pre-baked binaries onto my VPS and use that for compiling, since I'm on Windows
[QUOTE=Jawalt;33722693]Nononono. Do not fucking override standard functions. Unless the console is going to be your SINGULAR output stream and you perfectly mimic the way it acts normally.
The proper way to handle this would be either:
printconsole() which uses the tostring metamethod, so as to print exactly like print() does, or an object oriented version that has a console object, etc, and works basically like printconsole() would.[/QUOTE]
It's actually a fairly acceptable thing to do in Lua - you can keep the old function in a closure, and have another one that wraps around it, passing its arguments on to the original print() before doing its own stuff:
[code]
do
local oldprint = print
print = function(...)
oldprint(...)
--new code here
end
end[/code]
The chatbots in FP Programmer Steam chat were fun up until Steam decided to maintenance the friend system.
I was supposed to make a Knight's tour application for my CS class, decided to make an applet instead. I realize it's not as pretty as the stuff you guys do, but I'm just starting and I'm pretty proud of it.
[url]http://malumapplets.weebly.com/[/url]
Parsing's working for simple expressions, although it's now separate to the actual interpretation: the parser turns expressions (or, eventually, statements and blocks etc.) into a tree - so an expression is a sum of terms, a term is a product of values and so on. The neat bit is that every node has a boolean member, "fixed", which is true if the node's value is constant, or if all of its child nodes are constant. If a node is constant, it gets evaluated once, before anything is executed, and then never again - if a node's constant, I can also ignore everything beneath it, and treat it as a bottom-level node.
For instance, in the VB6 version, plotting a relation like y < sqrt(10) would require the sqrt() function to be called 400 times every time the screen was moved - now, it's only evaluated once, when it's entered.
Take a look:
[IMG]http://i.imgur.com/pDgYl.png[/IMG]
As far as any interpretation is concerned, 1 * (2 + 3) - y is exactly the same as 5 - y. Should speed things up a bit :)
[editline]14th December 2011[/editline]
Don't worry about the apparently varying constants, they're children of the actual value node so I can stuff in things like unary minuses and exponents :)
[QUOTE=Natrox;33721731]Worked some more on my galaxy generator, now has maps of the world you have selected, still working on it;
[img]http://i56.tinypic.com/ibb603.png[/img]
Everything is consistent and the same at each run. No data about the planets is stored.[/QUOTE]
Suns aren't planets.
[QUOTE=Jookia;33723914]Suns aren't planets.[/QUOTE]
I don't have suns.
(Not yet)
[QUOTE=Natrox;33723965]I don't have suns.
(Not yet)[/QUOTE]
Why do you have a galaxy full of planets with no orbit?
[QUOTE=r0b0tsquid;33722842]It's actually a fairly acceptable thing to do in Lua - you can keep the old function in a closure, and have another one that wraps around it, passing its arguments on to the original print() before doing its own stuff:
[code]
do
local oldprint = print
print = function(...)
oldprint(...)
--new code here
end
end[/code][/QUOTE]
I use Lua, and I would hate to use an environment where they redefined standard functions. I don't know where you got 'acceptable in Lua' it's common sense, have things do what they say they do/are expected to do. print() and console() or something PERFECTLY express what they do, and don't overwrite standard functions.
[QUOTE=Natrox;33721731]Worked some more on my galaxy generator, now has maps of the world you have selected, still working on it;
[img]http://i56.tinypic.com/ibb603.png[/img]
Everything is consistent and the same at each run. No data about the planets is stored.[/QUOTE]
Are you planning on making a game in outer space?
[QUOTE=Jookia;33724214]Why do you have a galaxy full of planets with no orbit?[/QUOTE]
Maybe they're locked in magnetic fields
[QUOTE=Jawalt;33724294]I use Lua, and I would hate to use an environment where they redefined standard functions. I don't know where you got 'acceptable in Lua' it's common sense, have things do what they say they do/are expected to do. print() and console() or something PERFECTLY express what they do, and don't overwrite standard functions.[/QUOTE]
Except you will run into environments where print() is expected to push to a console, and there's no Windows console. So what then? Have a useless function sit around that does nothing? No, you redefine the behavior of print internally to conform to a generalized expected behavior.
[QUOTE=Jawalt;33724294]I would hate to use an environment where they redefined standard functions.[/QUOTE]
You should take a peek at BF3. DICE did a really good job at that.
[QUOTE=Jookia;33724214]Why do you have a galaxy full of planets with no orbit?[/QUOTE]
It was a school assignment, and we are not allowed to store any data the planets might use (coordinates, color, name etc.).
This is why real programmers say "fuck you lua" and make a console using their own shit.
YEAHHHHHHHHH
[quote=amcfaggot] Except you will run into environments where print() is expected
to push to a console, and there's no Windows console. So what
then? Have a useless function sit around that does nothing? No,
you redefine the behavior of print internally to conform to a
generalized expected behavior.[/quote]
Exactly. Also, the function itself isn't modified - the reference in the global table is just changed to point to a different function, although that's largely just semantics.
I've always thought that the whole point of a scripting language is that everything should be flexible, and therefore subject to change. But yeah, I guess it depends on your background as to how far you think that should go :v:
[QUOTE=Natrox;33724600]It was a school assignment, and we are not allowed to store any data the planets might use (coordinates, color, name etc.).[/QUOTE]
..So why are there planets just floating around in space?
The point is to not store data. That is to say, he has to somehow create a set of predictable names, positions, coordinates, and colors which are never stored, but instead are procedural created and can produce the same output over and over again through a form of equally predictable patterns to produce the aforementioned values.
This is my assumed grasp of his project; if I'm correct, the overall idea is very smart. It's a type of concept that's reused everywhere.
The project could have been entirely about generating dicks with all different colors and lengths, it's not about planets or dicks, though.
[QUOTE=Jookia;33724696]..So why are there planets just floating around in space?[/QUOTE]
who cares
[QUOTE=amcfaggot;33724791]The point is to not store data. That is to say, he has to somehow create a set of predictable names, positions, coordinates, and colors which are never stored, but instead are procedural created and can produce the same output over and over again through a form of equally predictable patterns to produce the aforementioned values.
This is my assumed grasp of his project; if I'm correct, the overall idea is very smart. It's a type of concept that's reused everywhere.
The project could have been entirely about generating dicks with all different colors and lengths, it's not about planets or dicks, though.[/QUOTE]
Yes, but you don't need to store data to have a galaxy full of stars that have planets orbiting them.
[QUOTE=Jookia;33724812]Yes, but you don't need to store data to have a galaxy full of stars that have planets orbiting them.[/QUOTE]
[QUOTE=supersnail11;33724803]who cares[/QUOTE]
Furthermore, it probably wasn't in his assignment.
[QUOTE=supersnail11;33724803]who cares[/QUOTE]
Personally I do. I find space beautiful, and one of the most beautiful things in it is the concept that galaxies are full of billions of stars, that each have planets orbiting. Galaxies being just full of planets is kind of.. Meh.
Yeah, I like swirling pixels, too
[QUOTE=amcfaggot;33724858]Yeah, I like swirling pixels, too[/QUOTE]
Even if that was sarcasm, you do get what I mean. The screenshot shows a galaxy with planets. There's no order or swirls.
[editline]15th December 2011[/editline]
Gah, finally pinned down why I'm pissed off: It's a galaxy generator that doesn't generate a galaxy.
Maybe he wants to make his own style of universe where background cosmic radiation interacts with a planet's atmosphere and generates heat and light.
Or maybe he's only been assigned to procedurally generate data and the actual setting DOESN'T MATTER.
Sorry, you need to Log In to post a reply to this thread.