1,150 Forum Posts by "polym"
At 5/2/13 02:26 PM, triplenoob wrote: I can't tell you if your cousin if going to grow into a douchebag, because all I needed to read was the title. You didn't even try to explain in what way your aunt mistreats her kids.
You've -never- seen a parent scold their kid in an exaggerated or unnecessarily negative way?
Boy, oh boy. Kids are great. It means you're getting serious in the relationship and it's time to prove to your friends and parents what you're all about. I'm sure some of you have that one person who's a complete douchebag to their kids and are completely oblivious about it. And these are the same type of people that bother other people too, so you can't comment on their lack of proper parenting skills without backlash.
In particular, my aunt is one nasty bitch. It's one thing being somebody everyone knows and loves and being a bad parent. She's a bitch and a bad parent. Doesn't know the first thing about parenting, so she piggybacks on her friends who are also parents in the loving Christian community. And yes, they all do the same shit to their kids.
How do you people feel about this? Do you think my cousin is going to grow up to be a spiteful, emotionally unstable person because of somebody's bad decisions? Or do you think that she's gonna be jus' fine? It's interesting because we're all past the angsty age, and we get to watch somebody grow up, whether in glee, or in disgust.
At 4/23/13 08:16 AM, Tediisan wrote: It seems kind of pointless to use the internet with only a keyboard, it would be a lot easier with only a mouse and no keyboard
Not really. its clearly a lot faster to type than it is to point and click. just look at video games, terminals and mobile devices
Hey, I'm currently accessing newgrounds using only a keyboard. I just unplugged my mouse to take it somewhere else I'm going to be sitting for an hour. Now, this isn't a -real- issue, just an interesting observation. First off, I commend newgrounds for being keyboard-only friendly.
Everyone knows you can use CTRL-L to get to the location bar. Most websites will auto-focus their login forms/etc which is a plus. I can easily navigate newgrounds using TAB and SHIFT-TAB and BACKSPACE (to get to the previous page if I make a mistake.) The only problem is that the URLs are kind of unfriendly. For example, bbs/post/topic/1 and forum/1 make it difficult to know what link you have selected with TAB. Second, the images in the nav-bar don't get highlighted, but luckily you can just tell from the URL.
Honestly, newgrounds does it better than 90% of websites out there because it's run by people who actually know what they're doing, and cares about its users. Good job newgrounds for not catering to shareholders behind the scenes (looking at you Youtube). Good job on staying relevant and still being the best it can be for its users.
TAB -> post.
I strike again... This useless program randomly generates 100 twenty-length strings, and searches for consecutive characters of an input string. For example:
string to search for: Charlie bit me.
%MLB3Xf"P4X~7xlO?t&\ : !?;&D-:JFXh\g=5d.0 $oh[ZuTzQ4n[k&zI+4oO
S@{RL@w6.(AYu!j)p$]\ 1QQkpb>9rl;Rg21|@V@* r.S$~"S08+3ALYsK_umi
Q8z@K!En@Do^s-E%h&f- Z}J!]k9`vm2bLIo=5h"j >d6znBdY#zt$6z1LHz|G
RNTI.TWWPd#\I^*05kZ: ,O8oB1*d)uVf`Ds.#go> [V4rHiB.CDN7MS<K[i%R
~~~~~~~~^
cNMVOFo5b\79@*S6TVp' }02I+LRX=%g*Z7$576QP I=MLiCBLmz%*D^\UMEY3
RmV W#:v<Z3o.CUNn;ZN '@p4tyT2a)B/mn+IQBoB -G`<g)I+^V7ykOI0evu+
W X~&$0fys,))dS6+'DR eLXGAv6tz$R`%Cm!qG}m x";z}0*(~L2$v9dmw+^-
mV^0'T.h+[InozBNFg[h 9dDVUn,$D5bpaF^I`BRG "FNqCP%sj 4oMnz^^=VM
~~~~~~~^ ~~~~~~~~~~~~^
Then at the end, it formats it in a nice column of all the strings it pulled:
--------------------v
[V4rHiB.CDN7MS<K[i%R
mV^0'T.h+[InozBNFg[h
9dDVUn,$D5bpaF^I`BRG
PQ=H6g]Lm9<;9r%T/tgg
8lK*i/uPB1?:+0D7%yw{
WwY@iV.%F.jOG5Ipq;7H
.&MAe`S8~*%v$+QV:aX-
+Ly2/mE 49`Z+"EmWm'b
C:Wt&-?jPbb/*P`ETAm$
[ILMaNi]ytvE~yEr[0(!
[6.6hj:a1Ept|H]<E(mR
6s0TNT,tY+ w=)/<9dtM
d5^Eu0ZGmbZ%,V<#Ut:2
?*Awj3&&*&eP~lE9zuLj
zgenQw;\.K8y#0M4w ;F
--------------------^
Since I'm not so confident of newground's formatting, here's the ideone link: https://ideone.com/xmih7f
And the code incase you're too lazy to click on the link:
#include <iostream>
#include <algorithm>
#include <random>
#include <sstream>
#include <cctype>
#include <vector>
namespace Utility
{
bool only_contains_spaces(std::string s)
{
return all_of(s.begin(), s.end(), isspace);
}
int random_number(int min, int max)
{
std::random_device rd;
std::uniform_int_distribution<int> dist(min, max);
return dist(rd);
}
std::string random_string(int length = 10)
{
std::string s = "";
for (int i = 0; i < length; ++i)
s += (char)random_number(32, 126);
return s;
}
};
int main()
{
std::string stsf;
std::getline(std::cin, stsf);
std::cout << "string to search for: " << stsf << std::endl << std::endl;
int index = 0;
std::vector<std::string> words;
std::string cursorline = "";
int column = 0;
for (int i = 1; i <= 100; i++)
{
std::string input = Utility::random_string(20);
std::cout << input << " ";
if (index < stsf.size())
{
auto f = std::find(input.begin(), input.end(), stsf[index]);
if (f != input.end())
{
std::string tilda = std::string((int)(f - input.begin()), '~');
cursorline += tilda + std::string("^") + std::string(20 - (int)(f - input.begin()), ' ') ;
input = std::string(20 - (int)(f - input.begin()), ' ') + input;
column = std::string(20 - (int)(f - input.begin()), ' ').size() + (int)(f - input.begin());
words.push_back(input);
index++;
} else
cursorline += std::string(20, ' ') + std::string(" ");
}
if (i % 3 == 0)
{
std::cout << std::endl;
if (!Utility::only_contains_spaces(cursorline))
{
std::cout << cursorline << std::endl;
}
cursorline = "";
}
}
std::cout << std::endl << std::endl;
std::cout << std::string(column, '-') << std::string("v") << std::endl;
for (const auto& s : words)
std::cout << s << std::endl;
std::cout << std::string(column, '-') << std::string("^") << std::endl;
return 0;
}
This really was just an experiment in using the STL library, and demonstrating how powerful iterators are.
At 4/4/13 08:20 AM, PMMurphy wrote:At 4/3/13 11:35 PM, polym wrote: http://bromosapien.net:8080/~tom/i like it lol
Here I published it to my website. It has geshi syntax highlighting, and compiles it using gcc.
Speaking of which, I -just- fixed it. Now it takes the randomly generated variables and puts them into random expressions themselves, before adding them to the vector. Then it prints the final values.
http://bromosapien.net:8080/~tom/
Here I published it to my website. It has geshi syntax highlighting, and compiles it using gcc.
At 4/3/13 12:43 AM, PMMurphy wrote: Mine is gonna take a while to debug.
Currently at around 1300 lines of code.
I'm coding a massive example so people have ideas and inspiration to work from. I won't do this for every contest.
Every program I write is the 'worst possible code' ever. Take a look at what I just wrote:
http://ideone.com/hLHmHP#view_edit_box Written in PHP, generates a C++ program with random float constants
http://ideone.com/6GsglI#view_edit_box The resulting C++ program compiled, and shows correct results
Basically I switched over to PHP as to avoid dealing with pointers, since I kept getting runtime errors. The features:
- The generateRandomString() function spits out a valid identifier (doesn't start with a number, proper amount of underscores)
- It computes the expressions it generates and writes it as comments to compare to the output
- It spaces the expressions with newlines and tabs, but you can change the calls to printnv to make it on one line
- The one caveat is that if $b is 0, it returns 1 instead of throwing an exception
At 4/1/13 11:24 PM, PMMurphy wrote: ahahahahahahahhhh
refactor that code and switch those if-elses to switches.
I think it would be so much more readable.
Do you plan on taking this a step further and adding pattern recognition and reasoning?
Like, (enter in a math equation). Then it evaluates the math equation by generating potential solutions and such.
Looks like fun though. But do you really need this many classes to get the job done?
Your just making mathematical expressions with appropriate values in a random order right?
If I was -solving- equations, the code would be much different. This just generates them, and so it's much different.
This is a pretty simple program. All it does is create expressions like (12 + 18). They can be nested, which is the beauty of it. Right now, it doesn't actually compute itself, but it can easily be adjusted to do so. I just haven't gotten around the problem of recursive computation because the Expr object can take a string in its constructor. You can easily dissect the string into an Expr object, but I haven't had much success so far.
Here's the code:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <random>
using namespace std;
class Value
{
public:
int _val;
Value() { }
Value(int val) : _val(val) { }
operator string() const
{
return to_string(_val);
}
};
class Oper
{
public:
char _op;
Oper() { }
Oper(char op) : _op(op) { }
operator string() const
{
return string(1, _op);
}
};
class Expr
{
public:
Value _left;
Value _right;
Oper _op;
string _leftexpr;
string _rightexpr;
int type;
Expr() { }
Expr(Value left, Oper op, Value right)
: _left(left), _op(op), _right(right) { type = 0; }
Expr(string left, Oper op, Value right)
: _leftexpr(left), _op(op), _right(right) { type = 1; }
Expr(Value left, Oper op, string right)
: _left(left), _op(op), _rightexpr(right) { type = 2; }
Expr(string left, Oper op, string right)
: _leftexpr(left), _op(op), _rightexpr(right) { type = 3; }
operator string() const
{
if (!type)
return string("(") + (string)_left + string(" ") + (string)_op + string(" ") + (string)_right + string(")");
else if (type == 1)
return string("(") + _leftexpr + string(" ") + (string)_op + string(" ") + (string)_right + string(")");
else if (type == 2)
return string("(") + (string)_left + string(" ") + (string)_op + string(" ") + _rightexpr + string(")");
else if (type == 3)
return string("(") + _leftexpr + string(" ") + (string)_op + string(" ") + _rightexpr + string(")");
}
};
int main()
{
random_device rd;
char ops[] = {
'+', '-', '*', '/', '%', '^'
};
auto gen_rand_expr = [&] ()
{
Expr expr;
int dice = 0 + (rd() % ((4 - 0) + 1));
int num1 = 1 + (rd() % ((100 - 1) + 1));
int num2 = 1 + (rd() % ((100 - 1) + 1));
int op_dice = 0 + (rd() % ((5 - 0) + 1));
expr = Expr(Value(num1), Oper(ops[op_dice]), Value(num2));
return expr;
};
const int depth = 2;
for (int k = 0; k < 10; k++) {
int op_dice = 0 + (rd() % ((5 - 0) + 1));
int dice = 0 + (rd() % ((4 - 0) + 1));
Expr expr = Expr((string)gen_rand_expr(), Oper(ops[op_dice]), (string)gen_rand_expr());
for (int i = 0; i < 1 + (rd() % ((depth - 1) + 1)); i++)
{
op_dice = 0 + (rd() % ((5 - 0) + 1));
dice = 0 + (rd() % ((4 - 0) + 1));
if (dice == 0)
expr = Expr((string)expr, Oper(ops[op_dice]), (string)gen_rand_expr());
else if (dice == 1)
expr = Expr((string)gen_rand_expr(), Oper(ops[op_dice]), (string)expr);
else if (dice == 2)
expr = Expr((string)expr, Oper(ops[op_dice]), (string)expr);
else if (dice == 3)
expr = gen_rand_expr();
}
cout << (string)expr << endl;
}
return 0;
}
And example output:
(((54 ^ 49) % (57 / 92)) * (49 ^ 19))
((((8 * 83) - (37 ^ 4)) ^ ((8 * 83) - (37 ^ 4))) * (83 / 83))
(((42 * 18) / (78 / 49)) / ((42 * 18) / (78 / 49)))
((63 * 64) - (69 + 76))
((17 ^ 45) * (17 ^ 45))
(12 / 18)
(((39 - 29) ^ (96 / 69)) % ((39 - 29) ^ (96 / 69)))
((31 ^ 3) - (48 - 85))
((76 - 82) ^ (64 + 33))
((74 % 100) / (((70 + 42) - (6 - 19)) / (24 / 60)))
So my friend has a series of servers across the country, and I have ssh access with gcc 4.7.2. I thought it would be hilarious to write a program to eject the server's cd drive and write 'jihad' to the screen (especially since it's located in the laundry room.) To be specific, he has a hub server called 'redirect', and I ssh into the specific server that has gcc 4.7.2 (the servers have different package configurations.) It's centos/fedora.
#include <sys/types.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/cdrom.h>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <getopt.h>
using namespace std;
void print_usage() {
printf("-h, --help Displays this text.\n");
printf("-o, --open, -e, --eject Opens the tray.\n");
printf("-c, --close Closes the tray.\n");
}
int main(int argc,char **argv)
{
string prefix = "/dev/";
string devices[] = { "sr0", "cdrw1", "dvd1", "dvdrw1", "cdrom1" };
int cdrom; /* CDROM device file descriptor */
int next_option;
const char* const short_options = "hoec";
const struct option long_options[] = {
{ "help", 0, NULL, 'h' },
{ "open", 0, NULL, 'o' },
{ "eject", 0, NULL, 'e' },
{ "close", 0, NULL, 'c' },
{ NULL, 0, NULL, 0 }
};
long cdrom_option = CDROMCLOSETRAY;
next_option = getopt_long (argc, argv, short_options,
long_options, NULL);
if (next_option == -1) {
print_usage();
return 0;
}
do {
switch (next_option)
{
case 'h':
print_usage();
return 0;
break;
case 'c':
cdrom_option = CDROMCLOSETRAY;
break;
case 'o':
case 'e':
cdrom_option = CDROMEJECT;
break;
case -1:
break;
default:
return 1;
}
next_option = getopt_long (argc, argv, short_options,
long_options, NULL);
}
while (next_option != -1);
for (int i = 0; i < 5; i++) {
if ((cdrom = open((prefix+devices[i]).c_str(),O_RDONLY | O_NONBLOCK)) < 0) {
perror("open");
exit(1);
}
if (ioctl(cdrom,cdrom_option,0)<0) {
perror("ioctl");
exit(1);
}
if (ioctl(cdrom,CDROM_DRIVE_STATUS) == CDS_TRAY_OPEN) {
printf("%s%s", (prefix+devices[i]).c_str(), " is open.\n");
} else {
printf("%s%s", (prefix+devices[i]).c_str(), " is closed.\n");
}
printf("jihad\n");
close(cdrom);
}
return 0;
}
tom is awesome : ~ $ ./ot -o
/dev/sr0 is open.
jihad
/dev/cdrw1 is open.
jihad
/dev/dvd1 is open.
jihad
/dev/dvdrw1 is open.
jihad
/dev/cdrom1 is open.
jihad
Not really a practical or impressive example, just wanted to share it with you guys.
Ramen sucks. The only good kind of noodles are the expensive spicy ones, since
1) Spicy is good
2) The spicy ones are better quality
3) You get more bang for your buck
I really don't understand why a broke college student buys mac and cheese and ramen when he could gorge himself on a value buy: spicy food. Then again, if you have a room mate, you'd probably stash your expensive food somewhere where he can't find it, and leave all the ramen lying around in the open. But I luckily have the luxury of enjoying 100% of it to myself.
What's worse is, they're all inconsistent. Some have foil on the inside of the cover in order to help it cook, but then you can't microwave it. Some have styrofoam (which is a godsend when you're talking about boiling hot water.) Some taste watery no matter how you cook it. And some specifically are microwaveable.
There needs to be a dominant brand of spicy noodles that will overtake the shit ramen.
Yeah it's common sense when you scale an image, it's going to blur. This is especially noticable in XNA if the image is too small and you try to scale it using the spritebatch function. You can try to replicate the image programmatically by looping through the image and redrawing it pixel by pixel, except expanding it, then store it in a texture variable. This would is not the same thing as resizing it in an image program so you wouldn't 'stretch' it, you're simply expanding it.
At 1/6/13 02:57 AM, yurgenburgen wrote:At 1/6/13 02:56 AM, polym wrote: Nasty.are you some sort of bitch
I just want somebody to convince me to huff some dust off because I had to endure the poison that is nail products :(
At 1/6/13 02:54 AM, yurgenburgen wrote:At 1/6/13 02:45 AM, polym wrote: I'm just saying man...do you like them
Nasty.
At 1/6/13 02:04 AM, yurgenburgen wrote: my nails are fabulous
that's all I care about
I'm just saying man...
ok so I have no problem with barber shops, I have an issue with nail salons. basically where you'd normally have a breathable environment to get a hair cut, a nail salon suffocates you with the smell of nail products. the worst part is you have to tolerate the smell while you get your hair cut, AND before you wait. unless you wait outside, but that's just rude.
so i did some 'research' on huffing. basically people deliberately inhale this stuff to get high. i mean it's poison, because it smells bad enough and makes me sick to the stomach when i -don't- deliberately in hale it. but who in their right fucking mind does that shit?
at least computer dust sprays are odorless. which brings me to my point: if i can tolerate sitting in a nail salon for an hour breathing poison, how bad is deliberately inhaling odorless spray? c'mon, someone tell me what the difference is before i go insane.
At 12/31/12 01:57 AM, Jakehinojo wrote: (^)_(^)
(O - O)
\____/
i love you you get me man you're fantastic thanks baby
At 12/31/12 01:56 AM, Armour wrote:At 12/31/12 01:56 AM, polym wrote:how about noAt 12/31/12 01:55 AM, hiddeninthecrowd wrote: how about nofuck you you don't know me
wtf why is everyone against me motherfuckers
At 12/31/12 01:55 AM, hiddeninthecrowd wrote: how about no
fuck you you don't know me
hey ngers
i'm bored
how 'bouts you entertains me
tell me a funny joke
show me your tits
suggest some good entertainment
ANYTHING
o_o
At 12/13/12 01:50 PM, swiftstylerX wrote: At least it wasn't Justin Bieber.
You're right. Justin Bieber wouldn't make as much money.
Anyone interested in the old school Resident Evil games? That is, 1, 2, 3 and Code Veronica. Zero, Remake, 4, 5 and 6 deviate from the series a bit, although Zero and Remake are more akin to the originals. I've been practicing Resident Evil 2 lately on the emulator and my gamecube, and 1 on my emulator. I've managed to get a time of about 2 hours for both scenarios with B ranks, which is pretty good for a non-speed run. However with some practice and a route the goal would be to achieve a score closer to sub 1:30.
Right now though getting a good time and rank is more for unlocking stuff.
Anyone else think 2005 was the year of the explosion of everyone's favorite cop shows on CBS? Criminal minds and Numb3rs come to mind. Unfortunately the latter was eventually cancelled, but it was one of the highest rated shows on Friday nights. They're both FBI shows, the former focusing on looking into the minds of serial killers, with Numb3rs throwing math jargon at you while taking a successful approach on the generic cop show drama.
At 11/27/12 12:33 AM, Phobotech wrote:At 11/27/12 12:23 AM, polym wrote:Without food poop is poop. Let me show you with drawing.Why you saucy dingleberry!
For you.
At 11/27/12 12:19 AM, Phobotech wrote:At 11/27/12 12:18 AM, PonRaulTrollSwag420 wrote: yester4day i smoked 4 pots and ate food would you like some???YÃOE¶oÃOE¶uÃOE¶'ÃOE¶rÃOE¶eÃOE¶ ÃOE¶nÃOE¶oÃOE¶tÃOE¶ ÃOE¶eÃOE¶vÃOE¶eÃOE¶nÃOE¶ ÃOE¶aÃOE¶ ÃOE¶tÃOE¶rÃOE¶oÃOE¶lÃOE¶lÃOE¶,ÃOEÂ
¶ ÃOE¶yÃOE¶oÃOE¶uÃOE¶'ÃOE¶rÃOE¶eÃOEÂ
¶ ÃOE¶jÃOE¶uÃOE¶sÃOE¶tÃOE¶ ÃOE¶oÃOE¶bÃOE¶nÃOE¶oÃOE¶xÃOE¶iÃOEÂ
¶oÃOE¶uÃOE¶sÃOE¶.ÃOE¶
...sure why not.
None of you eat food. You all poop but food you eat not.
Without food poop is poop. Let me show you with drawing.
At 11/27/12 12:12 AM, SeekerFang17 wrote: What is this... food of which you speak? I have never heard of something that you... eat? What is that action? All I have been doing is taking tables full of vitamins to keep me alive because materials taken from the earth or animals are the devil and should not be taken into the body.
My food is poop from my body given to the world contributing to nature's cycle.
At 11/26/12 10:57 PM, tox wrote: filler text
no u
food is the greatest thing in the world. it tastes good, it makes you feel good, it's good. food is delicious in many ways. food can be prepared aesthetically or practically. food can be eaten in a recreational manner or for survival. without food there is no emotional eating.
fun
ordering
omelets
do it

