[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 43
Old: >>47023148
>>
Just programming a meme xd so random on da 4chins
>>
trying to revamp my build system for my library I'm building. So far it works on wangblows but the tests won't build on linux
>>
Which does Wosniak approve of?

app.directive('helloWorld', function() {
return {
restrict: 'AE',
replace: 'true',
template: '<h3>Hello World!!</h3>'
};
});


or

App.directive('helloWorld', function() {
var directive = {};
directive.restrict = 'AE';
directive.template = "<h3>Hello World!!</h3>";
return directive;
});


Also, how the fuck do you pass parameters to directives?
>>
File: 1425302375079.png (290 KB, 680x680) Image search: [Google]
1425302375079.png
290 KB, 680x680
>>47031276
>animeme picture
>>
Is it possible to create an Android app with only C++ compiled with the NDK?
>>
>wanting to be a programmer
>when you can be an astronaut
>>
>>47031554
By the way, is anyone familiar with CMake?
>>
>>47031601
Technically, sure... maybe.

Realistically, No, you're still gonna need to write a bunch of glue code in java.
>>
>>47031609

>wanting to be an astronaut
>when you can invent immortality and be a billionaire

Seriously, I feel like my life is just a lost ship in a storm being thrown about. I never wanted to be a programmer. It just fucking happened. Any time I try to direct the ship, it just find a shithole it has to run from.
>>
>>47031679
>wanting to invent inmortality
>more humans that can't die
>not joining the illuminati in the plan to reduce the human population
>>
what does /g/ think about static imports?
>>
File: fucked_up_vbo.png (9 KB, 241x277) Image search: [Google]
fucked_up_vbo.png
9 KB, 241x277
And now we play the good old "have fun trying to find out why your vertex buffer is fucked up" game. At least it's not a black screen.
>>
>>47031640
only slightly
>>
>>47031739
Zalgo mode is a feature
>>
Can programming take me to NASA?
>>
File: Screenshot-2.png (112 KB, 1270x796) Image search: [Google]
Screenshot-2.png
112 KB, 1270x796
Made a simple R web application for playing around with the Jacobi method.
>>
>>47031732
Well you are are suppose to programming in an OO style, so they should be avoided when possible.
>>
Asked this in the old thread but it died.

I'm thinking about becoming a programmer. Don't know too much about it, but I teach myself a little bit everyday. Soon I will be going to school for software engineering.

My only question is, is this a good field to get in to? Is the pay good, job security, flexible work schedule (as opposed to the standard 9-5), etc.? I know every position will be different, I'm just asking those who do work in this field what it's generally like. Sorry if this is the wrong thread to be asking in.
>>
>>47031747
nevermind I got it to work. Kind of... The library isn't built but the CMake system is in place
>>
>>47031808
*are suppose to be
>>
>>47031812

Yes, fucking do it. Med, engineering, and comp sci are master race. End of story. Finance + math/stats only works if parents have connections or ivy league.
>>
File: 1425731809772.jpg (121 KB, 662x807) Image search: [Google]
1425731809772.jpg
121 KB, 662x807
I fucking hate modern computers.
Every single level of computers today is just layers and layers of retardation and terrible decisions, from circuit board design all the way up to high level applications.
I wish i could go to some far away land where computers don't exist yet, and then build my own computer from scratch, CPU architecture, peripherals, kernel, operating system, userland and internet protocol exactly how i fucking like it.
It depressed me that i'll never be able to achieve that.
Fuck everything.
>>
>>47031905
Fuck off autist
>>
I've asked this before (I think on Friday) but I'll ask again.
Is anyone interested in contributing to either a bit manipulation library or path recognition/comparison/prediction library?
>>
>>47031924
No, YOU fuck off.
>>
I have a file with entries that start all with @<, so like
@<A
//data
//data
@<B
//data
//data
//data
@<C
//data

etc. What would be the best way to read in all the entries into different class objects? I tried to iterate over the file and create objects as I hit @< but then I fucked something up with the iterators and it just kept getting stuck at one before EOF.
>>
>>47031609
being an astronaut is vastly overrated. what are you, five years old?

>>47031905
get help, and make sure you get your autism bux if you don't get them already
>>
>>47031947
Post the code that you have done so far.
>>
>>47031905
>I wish i could go to some far away land where computers don't exist yet, and then build my own computer from scratch, CPU architecture, peripherals, kernel, operating system, userland and internet protocol exactly how i fucking like it.
Why would you need to go to a far away land?
Just start building it right now.
>>
>>47032008
Because if he did go to a faraway land then he would actually have to commit himself to the task he supposedly wants to do.
>>
Anybody know any good SDL learning resources?
>>
>>47031905
Nothing is stopping you from building your own computer:

http://www.bigmessowires.com/bmow1/

>Big Mess o’ Wires 1 is an original CPU design. It does not use any commercial CPU, but instead has a custom CPU constructed from dozens of simple logic chips. Around this foundation is built a full computer with support for a keyboard, sound, video, and external peripherals.

Check out the other projects on that site too.

Now get to work.
>>
Not quite programming, but can you check with a query whether or not you have access to a certain table in mysql?
>>
>>47032008
>>47032067
I've actually been writing a virtual machine since new years that simulates my ideal computing platform, I've gotten tons of progress on it, i recently implemented a framebuffer, and plan to tackle persistent storage next.
But that's the most i can do, i can't do hardware shit, only software.
I plan to study CE and EE in uni.
>>
>>47031992

It's broken and shitty because i've been moving shit around but I'm trying something like this. Got it half-working before but only with the first row of the data...

void readFile(std::ifstream& ifs, std::string& filename) {
//Read the file containing molecules in, and store each individual molecule in a vector until further processing
//std::cout << "Reading in " << filename << "...\n";
std::string line, state;
std::istream_iterator<std::string> begin(ifs);
std::istream_iterator<std::string> end;
std::istream_iterator<std::string> it = begin;

std::vector<Molecule*> molecules;

while (it != end) {
if ((*it).find("@<TRIPOS>MOLECULE") != std::string::npos) {

//Create a Molecule object and store it in "molecules" vector
Molecule* comp = new Molecule();
molecules.push_back(comp);

std::cout << "First if " << *it << '\n';
comp->addLine(*it);
while ((*(++it)).find("@<TRIPOS>MOLECULE") != std::string::npos || it != end) {
comp->addLine(*it);
std::cout << "Second if " << *it << '\n';

}
}
}
}
>>
>>47032123

I'm not worried about fixing the code, I just can't get the logic down.
>>
>>47032076
SHOW TABLES;
will list all tables you have any rights on iirc.

SHOW GRANTS;
will list all permissions for the user that issues the query.
>>
>>47032101
if you don't do hardware shit then who are you to judge that everything is retardedly designed?
>>
>>47032150
That works, thank you
>>
File: 6.png (1 MB, 1267x885) Image search: [Google]
6.png
1 MB, 1267x885
adding perlin noise gives some nice results to the dla procedural terrain
>>
>>47032204
>Static image
I'm a little disappointed.
>>
>>47031798
Is that Shiny?
>>
Does anyone write Java code outside of an IDE?
>>
>>47032230
webgl a shit
>>
>>47032189
Maybe not, but i am rather experienced in software development and i have a right to say that everything relating to software is fucking retarded.
>>
>>47032265
i pity the fool who writes java code outside of an IDE
>>
>>47032265
Unless you're using some other tool to compile the classes, not a chance in hell. Have you ever tried compiling a multi-package project from the command line?
>>
>>47032265
Maybe?
>>
>>47032265
I write Java in Emacs, but I consider that a OS.
>>
>>47032291
Yes, I have. Just learn to reformat errors into a log and there you go.
>>
>>47032288
http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
>>
>>47031276
Why the fuck is she holding the book upside down?
>>
>>47032236
Yes, it is.
>>
>>47032339
So that you can read the title anon.
>>
File: out.png (3 MB, 1920x1200) Image search: [Google]
out.png
3 MB, 1920x1200
My image processor i am working on went a little screwy
>>
>>47032265
Indians
>>
>>47032358
looks like a wrong stride
>>
>>47032340
Looks nice. I might have to try it out sometime; R evangelists sure love to talk it up. Are you a statistician or some sort of analyst, by chance? Always nice to see projects in these by people who aren't just developers.
>>
>>47032446
yep, off by one error... again
>>
>>47032358
fuck yeah tornado evangelion
>>
File: out.png (2 MB, 1920x1200) Image search: [Google]
out.png
2 MB, 1920x1200
>>47032526
Ok, got it done now
:D
>>
Doing some windows phone app development
>>
>>47032578
http://en.wikipedia.org/wiki/Glitch_art
>>
>>47032578
That's neat. Thanks anon.

>>47032608
This art is pretty nice.
>>
File: out.png (2 MB, 1920x1200) Image search: [Google]
out.png
2 MB, 1920x1200
>>47032640
If you want the script, i can put it up. I have 2 things you change for different banding effects. I am about to make it so that you can do negative band shifting to shift in the other direction (go right and not left)
>>
>>47032640
I remember I made a bunch of these glitched pictures and gifs with many anons at [spoiler]420chan[/spoiler], melting effects on gifs are pretty cool, writing an algorithm to make these effects shouldn't too hard.
>>
>>47032668
Yes, I want it.
>>
>>47032668
Now animate it.
>>
>>47032483
Actually I was just testing out the Shiny development environment. I attended an R course a year ago during my exchange studies and have been doing small stuff with it, such as reading xml files, using databases and such. I only recently found Shiny. I don't have any other experience with web development.
>>
>>47032692
You guys use Matlab, I guess?
>>
Does
sudo apt-get install git

Install everything I need on my end for github or even on my own network git work?
>>
File: out.png (2 MB, 1920x1200) Image search: [Google]
out.png
2 MB, 1920x1200
>>47032708
challenge accepted, though the runtime is gonna suck. Currently, it takes 1.3 seconds on my computer for the single image. Now i got the negative shifting to work.

One last thing before animation, more than one imagewidth fo rthe band rotation
>>
>>47032123

I think I've fixed it...is this okay or am I doing something very redundant?

void readFile(std::ifstream& ifs, std::string& filename) {
//Read the file containing molecules in, and store each individual molecule in a vector until further processing
//std::cout << "Reading in " << filename << "...\n";
std::string line, state;
std::istream_iterator<std::string> begin(ifs);
std::istream_iterator<std::string> end;

std::vector<Molecule*> molecules;

std::vector<std::string> tempStorage;

for (std::istream_iterator<std::string> it = begin; it != end; ++it) {
if (state == "") {
if ((*it).find("@<TRIPOS>MOLECULE") != std::string::npos) {
std::cout << "Found a molecule...\n";
state = "READING";
tempStorage.push_back(*it);
}
}
else if (state == "READING") {
if ((*it).find("@<TRIPOS>MOLECULE") != std::string::npos) {
std::cout << "Found a new molecule, saving old one...\n";
Molecule* comp = new Molecule(tempStorage);
molecules.push_back(comp);
tempStorage.clear();
state = "";
}
else {
tempStorage.push_back(*it);
}
}
}
}
>>
>>47032710
With Microsoft's purchase of revolution analytics we're probably going to see R# in the future, which will enable Shiny-like web applications in asp.net, exciting.
>>
Am I doing this right?

if worldcollision( objHB ) then
x = x - ( varxSpeed * dt() )
setHB()
end


int luaWorldCollision( lua_State* L ) { 
strHitbox lHitbox; /* initialize temp hitbox */

lua_getglobal(L,"objHB"); /* grab hitbox */
lua_getfield(L,-1,"x"); /* set hitbox x */
lHitbox.x = lua_tointeger(L,-1);
lua_pop(L,1);
lua_getfield(L,-1,"y"); /* set hitbox y */
lHitbox.y = lua_tointeger(L,-1);
lua_pop(L,1);
lua_getfield(L,-1,"w"); /* set hitbox w */
lHitbox.w = lua_tointeger(L,-1);
lua_pop(L,1);
lua_getfield(L,-1,"h"); /* set hitbox h */
lHitbox.h = lua_tointeger(L,-1);
lua_pop(L,1);

if( WorldCollision( &lHitbox ) == true ) {
return true;
} else {
return false;
}
}


Do I need that parameter in the lua file? I would prefer to use it, as I know getglobal doesn't need it. I want to get what I have no fully working before I move onto metatable stuff. Also, I haven't tried it, but say the function in C has getglobal and setglobal, but those items dont exist in the lua script, would this cause a crash, or is there a way to set it up so that there is no crash? Thanks
>>
File: 1420623292094.png (115 KB, 850x800) Image search: [Google]
1420623292094.png
115 KB, 850x800
>>47032873
>>
>>47032940
//this is bridge
>>
So graphics programmers have SIGGRAPH, what do web devs have?
>>
>>47032969
canvas and javascript
>>
>>47032977
I mean a equivalent conference
>>
>>47032733

Anyone?
>>
How would I use gethostbyname() in C++ for IRC? For example, I want to connect to irc.rizon.net. How would I do this?
>>
>>47033002

nm ill just install it and see what happpens.
>>
>>47033002
Are you seriously asking that?
>>
I have this code

char charray[] = { "ur", "a", "dong" };
cout << chararray[2] << endl;


How do I split this into an actual array by delimiter?
>>
>>47033066

Was wondering more if there were additional things to install.

Never touched it before thought it might be multi part or use a different program with it.
>>
File: out.png (2 MB, 1920x1200) Image search: [Google]
out.png
2 MB, 1920x1200
Got the multiple width of the image done

#!/usr/bin/python
numberOfBands=1200/42
unshiftRatio=-.25

from PIL import Image
from math import floor

image=Image.open("image.jpg");
pixelsOriginal=list(image.getdata())

print type(pixelsOriginal),len(pixelsOriginal),image.size[0]
print image.size[0],'x',image.size[1]

pixels=[]
count=0
while(len(pixelsOriginal)>count):
pixels.append(pixelsOriginal[count:count+image.size[0]])
count+=image.size[0]
del pixelsOriginal

#move the bands
def rotateLeft(line,number): #rotates the bands to the side. Dont let the name fool you as a negative unshiftRatio will shift it right
number=int(number)
negativity=1 #assume we are doing a positive shift
if not number==0:negativity=abs(number)/number #is it negative
while(abs(number)>len(line)): # if too big then change the shift
number-=len(line)*negativity # make it smaller (also, if negative, add to make it smaller)
return line[number:]+line[:number]

bandHeight=image.size[1]/numberOfBands
shiftDistance=int((image.size[0]/numberOfBands)/unshiftRatio)
if bandHeight==0:
print "Height Issue, your number of bands is likely too large"
bandHeight=1

for num in xrange(len(pixels)):
pixels[num]=rotateLeft(pixels[num],floor(num/bandHeight)*shiftDistance)

#recombine the pixels and save
pixelsShifted=[]
for line in pixels:
pixelsShifted+=line

image.putdata(pixelsShifted)
image.save('out.png')
>>
>>47033026
Have you read Beej's guide to network programming? I did and really liked it, it's a good book to get into C++ network programming
>>
Why haven't you joined yet? https://github.com/The-Feminist-Software-Foundation
>>
>>47032940
i should remove the squiggly brackets, but I am returning either 0 or 1 to lua, thats the simplest thing to do
>>
>>47033330

I wonder if there is some quiet majority that just wants to kick all the fucks out of feminism.
>>
>>47033330
>This repository has been disabled.
>>
>>47033104
T h a n k s !   
T h a n k s !
! T h a n k s
s ! T h a n k
k s ! T h a n
n k s ! T h a
a n k s ! T h
h a n k s ! T
T h a n k s !
>>
>>47033334
>thats the simplest thing to do
No it's fucking not, returning WorldCollision(&lHitbox) is.
>>
>>47033104
seems like this could be done a lot more succintly with
http://docs.scipy.org/doc/numpy/reference/generated/numpy.roll.html
>>
wtf my post disappeared

>>47033104
seems like this could be done a lot more succintly with
http://docs.scipy.org/doc/numpy/reference/generated/numpy.roll.html
>>
File: uakari.jpg (148 KB, 500x500) Image search: [Google]
uakari.jpg
148 KB, 500x500
>>47033532
>my post disappeared
>>47033509
>>
>>47033461
almost got animated somethings.....
maybe........

>>47033532
that is really neat. Doesn't scipy require extra stuff. I am trying to keep it as vannila as possible.
>>
>>47033554
>implying that's 100% the same poster
>>
>>47033554
i swear it did. i was on this page and the little [deleted] thing showed up next to it and it wasn't there when i refreshed. that's really fucking strange.
>>
wtf my post disappeared

>>47033554
>implying that's 100% the same poster
>>
>>47033571
it's just numpy you've got two imports anyway
>>
>>47033508
okay Xr.GNUOCD
>>
This function is big and ugly, how do I make it small and pretty?

def getAvgPos(posList):
sumx = 0
sumy = 0
for x,y in posList:
sumx += x
sumy += y
avgx = sumx/len(posList)
avgy = sumx/len(posList)
if (avgx, avgy) not in successor.getWalls().asList():
return (avgx, avgy)
else if (avgx, avgy+1) not in successor.getWalls().asList():
return (avgx, avgy+1)
else if (avgx, avgy-1) not in successor.getWalls().asList():
return (avgx, avgy-1)
else if (avgx-1, avgy-1) not in successor.getWalls().asList():
return (avgx-1,avgy-1)
>>
>>47033936
You don't need to call getWalls().asList() so many times. Just save the result of the operation in variable.
Also, isn't '/' a float division? Seems like you want integers, not floating point numbers.
>>
Can anyone tell me why the
 install TARGETS ${samplename}... 


fails

project(bitmanip c)
cmake_minimum_required(VERSION 2.6.2)

#bitmanip folders
set(bitmanip_base ${basepath}/bitmanip)
set(bitmanip_src ${bitmanip_base}/src)
set(bitmanip_samples ${bitmanip_base}/samples)

#head file inclusions
include_directories(${BASEPATH}/include)

#libraries
link_directories(${BASEPATH}/lib)

#make the library
file(GLOB bitmanip_sources ${bitmanip_src}/*.c)
add_library(bitmanip ${bitmanip_sources})

#make the samples
file(GLOB bitmanip_samples ${bitmanip_samples}/*.c)
foreach(samplesourcefile ${bitmanip_samples})

string(REPLACE ".c" "" samplename ${samplesourcefile})
add_executable(${samplename} ${samplesourcefile})
target_link_libraries(${samplename} bitmanip)
install(TARGETS ${samplename} DESTINATION bin)

endforeach(samplesourcefile ${bitmanip_samples_sources})


install(TARGETS bitmanip DESTINATION lib)
>>
I'm new to programming and need some help understanding OOP.

I have an object (game), in which I have two objects (room, player).

Is there a way to use a method of 'room' from inside 'player'?

Basically, I'm trying to ask the room if the space I want to walk to is free, from inside a player method.

Example:

[Code]class Game():
def __init__(self):
room = Room()
player = Player()

class Room():
def check_space(space):
stuff

class Player():
def action():
if room.check_space(space) == 'empty':
self.move()[/Code]

Programming language is Python (+ PyGame).
>>
>>47033071
char chararray[][]

That's what you mean right?
>>
>>47034175
whelp

class Game():
def __init__(self):
room = Room()
player = Player()

class Room():
def check_space(space):
stuff

class Player():
def action():
if room.check_space(space) == 'empty':
self.move()
>>
>>47034200
fuck me

class Game():
def __init__(self):
room = Room()
player = Player()

class Room():
def check_space(space):
stuff

class Player():
def action():
if room.check_space(space) == 'empty':
self.move()


really sorry
>>
>>47034144
figured it out. Nevermind
>>
>>47034216
Just don't confuse classes and instances of those classes.
Also, if you make an instance of Room class inside an instance of Game class, you'd need to assign it with self.room = Room() in order to be able to call its functions like this:
g.room.check_space(space)
Assuming you created "g" instance of the Game.
>>
>>47034324
Yeah, I omitted self. to keep it as simple as possible.

Can't I access an instance of something from an instance of something else?
>>
>>47034407
Sure. In this case, if the instance of the game is assigned to a global variable g, you can call g.room from g.player.

Also, don't forget to add "self" as the first argument when defining functions that belong to a class.
>>
I know I'm not supposed to ask /g/ for help with projects and such, but I'm desperate. What do these functions mean and how do I implement them? Specifically, lines 56 through 66. It's C++ by the way.
>>
>>47034608

IS that just Matrix stuff? Comparing MAtrixs adding them subtraction?

Scaler means instead of multiplying two matricies your scaleing them as in lets say int = 2 then that would double the size of the matrix.

I dont know c++,
>>
>>47034586
It's not working for me, not sure what I'm doing wrong.

This is the actual code:
https://github.com/Nanen/Shinri-Denki/tree/Remake

And this is the line I'm wondering about if such a thing exists:
https://github.com/Nanen/Shinri-Denki/blob/Remake/player.py#L77

I tried game.self.room.METHOD and room.METHOD, but it's not working.
>>
>>47034608
http://en.cppreference.com/w/cpp/language/operators
>>
Man, mixing INotifyPropertyChanged and multi-threaded applications is an enormous pain in the ass. For every class you have to make sure the UI notifications are raised in the right thread...
>>
>>47034199

Great, now I understand how to use char arrays now. I need to split a string from a delimiter into a char array now.
>>
>>47034608
i wish more languages had user-defined operators.
>>
File: tep.png (5 KB, 626x345) Image search: [Google]
tep.png
5 KB, 626x345
Not precisely "programming", but I'm taking a break from programming in order focus on the website that I wanted to build.

>inb4 drugs are for degenerates
>inb4 tables, what is this? 1996?
>>
>>47034997
Said no one, ever, since the emergence of C++.
>>
>>47034748
Well, I didn't go through all the code, but maybe it'd be best if you created player with room as argument and stored the room as self.room? Then the player could use the room like this: self.room.check_space(self.target_space)
>>
>>47034705
Yes, but my question is how would I implement them? I don't understand the syntax in the header and how to implement it. Thanks, anyways.

>>47034800
Thanks, anon. I think I now understand.
>>
Yeah!
I think that will work, thanks!

self.room wouldn't just be a copy, but the actual, changing thing, right?
>>
>>47035156
Yes. You'd have to make a deep copy in order to copy the instamce.
>>
File: 1325360328216.jpg (43 KB, 640x480) Image search: [Google]
1325360328216.jpg
43 KB, 640x480
>CS student doesn't know why creating, simulating and destroying tens of thousands of objects is resource intensive
>>
>>47035746

Why the fuck doesnt that degree have more programming in it?

What do people egt that degree for besides programming?
>>
>>47035760
Wanking around. Any degree which builds on a base should teach that base first or inform the students they need to get it.
>>
File: 1327282004736.gif (1 MB, 200x113) Image search: [Google]
1327282004736.gif
1 MB, 200x113
>>47035760
I don't know Anon, I'm convinced they don't teach them anything, I've heard some of the most retarded shit in my life from CS students.
>>
>>47035832

Its math right?

Like some post calc probably. And then just what physics?
>>
>>47035746
>student doesn't know something

I wonder why
>>
>>47035853
>Its math right?
not according to /g/.
someone posted Santiago Gonzalez's mathematical outline for some program and they shit all over it because they couldn't understand it.
>>
>>47035746
I wouldn't blame the programme as much as the person.

You are retarded if you don't know that whether you have an education or not.
>>
>>47035853
I don't think so? they don't know linear algebra in their 3rd year, I've literally seen some maths major shitting all over them.
>>
>>47035916
We had linear algebra here in the first year.

The professor was a sleeping pill though, one of the worst courses I've taken so far.
>>
>>47034175
Python is one of the worst OOP languages there is. If you're going to use a game, just use Java or C or something.
>>
>>47035916
At my school linear algebra was required in second year, along with either multivariable calculus or a stats course. Most of the math you do in CS is of a different sort than linear algebra or calculus, though. Mostly proving that such and such algorithm has some property.
>>
>>47035905
I can't choose to believe that any more, I've met too many people from different computer science departments and universities and they're all equally as retarded.
>>
>>47035967
Granted, it's not really meant to be used in games and other heavy tasks.
Otherwise it's a great language if you just want to get shit done quickly and with ease.
Why are so many people here shitting on Python?
>>
>>47036068
What I think is actually happening is that people who don't really care are getting degrees and jobs, so you're more exposed to retards with degrees than retards without degrees since it's easier to get a job with a degree. And some confirmation bias.
>>
>>47036090
>Why are so many people here shitting on Python?
They're the same people that learnt it back when interpreted languages were all the hype and thought everything would be rewritten in them, now their former stewardesses are abandoning them they've turned to self-hatred.
>>
>>47036090
python is a scripting language. It's very useful if you want to write small scripts for useful things
but any real program should be written in a real language
>>
>>47035746

But it sure feels amazing. And this is 2015, after all.
>>
>>47036090
Because, like you said, it really is just a language meant to do small little things, hence why it's so valuable in other tasks like pen testing.
But you get all these fags trying to lern 2 code lululululul Xb compter scic! using python it's become a manifestation of "shut up kid, I'll hack you."
It's simplicity is it's own downfall in that way, in that in most areas, the language is weak. It's basically the opposite of Perl, where everything is super powerful, but it looks like it just came out of RSA.
>>
>>47036121
And vice versa, since the retards will teach other people one day.
>>
>>47036145

That sort of shit really pisses me off. It happened to lua as well, just in a different way.

Now lua is the official "u progrm for gawy's mawd, too? xDDD le g-man maymay"

I bet Roberto Ierusalimschy contemplates suicide daily for creating the language that would drive garry's mod.
>>
>>47036090
Python is the new BASIC. As long as you treat it as such, there's no problem.
>>
Does anybody kind of wish more language would come with built in interpreters for RPN? It would make compilation easier and it would make math, for me at least, a lot easier.
>inb4 we go back to assembly
>>
Anyone help me with
>>47036221
>>
>>47036145
>It's basically the opposite of Perl, where everything is super powerful, but it looks like it just came out of RSA.
I'm really curious, what are the main differences? Why is Perl more powerful than Python?
I personally dropped Perl and chose to learn Python because of the tons of modules available for it. I consider it kind of a "jack off all trades but masturbate none" scripting language.
>>
these threads are big enough that we should start making separate threads for each language
>>
>>47036320
A lot of conversations aren't specific to languages, and some discussion would be restricted if comments had to be kept to one language. Thinking of programming as restricted to language is not a good way of thinking
>>
File: 福原遥12.jpg (17 KB, 432x243) Image search: [Google]
福原遥12.jpg
17 KB, 432x243
>>47036320
Dude no.
>>
>>47036309
One major reason is that Perl has built-in regular expressions, It's at its very core, Perl is fucking regular expressions.

in Python it's just a tacked on half-developed library.
>>
>>47036309
Personally, I haven't used Perl in a long time (or python for that matter,) but from what I remember, Perl was better for security reasons; no buffer overflow possibilities as all variable types are allocated post assignment, hence the $ for string, @ for array, you get the idea. If I remember correctly, php was even made based off of perl because of it's usage in server side computations, because once again, it's unique allocation style allows for minimal processing power for computations. It's basically really complicated, but really useful for managing a lot of different requests at once. However, the downside is your code looks like you just sat on the toilet and took a huge shit all over your computer.
>>
>>47036309
Almost forgot about hash support. Perl does hashing really well.
>>
>>47031905
Start reading, autist.
http://www.amazon.com/Fundamentals-Digital-Logic-Microcomputer-Design/dp/0471727849/ref=sr_1_2?s=books&ie=UTF8&qid=1426466175&sr=1-2&keywords=Rafiquzzaman
>>
>>47036320
it's not like /agdg/ where the threads last minutes or something crazy like that. we used to have lisp and graphics programming generals sometimes but they weren't popular.
>>
>>47036373
>>47036381
>>47036409
Thanks. I really loved built-in regex in Perl too. That's where I learned to use it, and basically that's all I remember from Perl.
>>
>>47036454
we still have lisp
>>
>>47036476
The last thread died with like 27 replies in it though.
>>
I know C#. I want to get into developing android apps. Should I bother with learning java? It's all as a hobby, so I don't care how employable it makes me [or doesn't]. I see a lot of people say C# is just java but better, which puts me off wanting to learn it, and I know C# is perfectly fine for android apps with shit like xamarin. Would there be any benefit to offset the opportunity cost of learning java to make android apps?
>>
Why I feel uncomfortable with almost any language except C++/C or C#
>>
>>47031905

I'm sorry we failed you, RMS.
>>
>>47036578
because you don't have enough experience with other languages to feel comfortable with them
start a project in a different language and work on it on your own time by yourself, but make sure it's somewhat challenging
>>
>>47036572
>Should I bother with learning java?

You pretty much already know it. For a hobby, at least start learning C++ or something, at least that's different enough.
>>
>>47036572
If you plan to make any program, even as a hobby, you really should be multi-lingual. If you know C#, java is like picking up a spoon. It might take you a couple days at most to get an almost complete grasp of it.
>>
>>47036572
xamarin seems like such a round-about way of doing it and you'd still have to learn xamarin. C# is just a shitty clone of java, you'll learn java in a breeze.
>>
>>47036622
>C# is just a shitty clone of java

You take that back, you.. you.. DOUBLE NIGGER.
>>
>>47036622
>shitty copy of java
>>
>>47036622
see >>47036628, you disgusting kike.
>>
I just installed curl for linux. Seems like it needed to transfer url's to git for downloads.

Anything I need to know security wise? Just dont click on links I dont know?
>>
File: 1327777453576.jpg (72 KB, 800x450) Image search: [Google]
1327777453576.jpg
72 KB, 800x450
>>47036622
>C# is just a shitty clone of java
>>
>>47031555

Why TF would you pass parameters to directives. They aren't supposed to do anything except use the controller's scope.

Use $scope in function($scope) if you have to ya lazy fuck.

http://stackoverflow.com/questions/13725938/angularjs-how-to-pass-arguments-functions-to-a-directive
>>
File: 2000px-XMPP_logo.svg.png (152 KB, 2000x2057) Image search: [Google]
2000px-XMPP_logo.svg.png
152 KB, 2000x2057
Where do I go or what do I read to understand XMPP and everything surrounding it like STUN and all that shit? Would learning this be beneficial for human communication over the network or should I learn about IRC instead?
>>
But if I'm honest, I do love C# and Java very much. I should make an effort to get back into C++, because I haven't used it since I took an advanced C++ concepts class (or whatever the fuck it was called then).
>>
>>47036707
For your own sanity, I recommend IRC unless you think your problem has needs that IRC cannot address. I've looked at both protocols. IRC is clean, elegant, and easy to implement. You can even just implement a subset of IRC and still get pretty good functionality. XMPP is very "Enterprise" in comparison.
>>
>>47036707
You won't learn anything from reading about IRC, the protocol was considered dumb and dated when it was created.
>>
>>47036740
Good to know, thanks.
>>
I posted too quick.
>>47036748
Do you suggest any alternative protocol?
>>
File: church-curry.png (225 KB, 596x600) Image search: [Google]
church-curry.png
225 KB, 596x600
(defun kekify (string)
"Kekify the string to copy-pasteable output"
(format t "~a~%" string)
(let ((kek-collection))
(setf kek-collection
(loop for a across string
for b across (reverse string)
:with len = (length string)
:with padding =
(concatenate 'string
(loop for i below (- len 2) collect #\space))
:collecting
(concatenate 'string (string a) padding (string b))))
;; remove first element
(pop kek-collection)
(loop for n below (1- (length kek-collection))
:do
(format t "~a~%" (nth n kek-collection)))
(format t (reverse string))))

it's all yours
>>
I'm looking to make an image tagger with mysql or postgresql.
For the gui I'd like to enter tags and lookup them and display thumbnails.
What gui toolkit should I use? I like gtk or qt so I think I'll go with one of those, using python or c++ or both.
>>
>>47036868
https://hydrusnetwork.github.io/hydrus/
>>
File: 1419581720718.png (80 KB, 600x565) Image search: [Google]
1419581720718.png
80 KB, 600x565
For anyone that's worked with Android using the NDK, are you supposed to use an OpenGL function loader before using OpenGL?

What about for iOS?

And in general, how the fuck am I supposed to find this kind of information out because Google isn't helping at all
>>
>>47036748
I don't think the IRC protocol is dumb or dated. There are some oddities or things it doesn't handle as well. Things like authentication (nickserv), channel ownership; network splits, etc. IRC isn't perfect from that standpoint, but it does have solutions even if they aren't directly part of the protocol. If you need strict authentication rules, worry about the security of nickserv, require more fine grained permissions, need VoIP support, then IRC probably isn't the best for the job. IRC isn't "infinitely extensible" the way XMPP brags about, but that's also why the core functionality is so much more easier to implement. For fucks sake, I've heard of people typing IRC protocol commands directly into fucking telnet on machines which didn't have an IRC client available. If someone is asking /g/ of all places for advice, then I'm going to strongly suspect they're not working for a Fortune 50 and implementing an internal corporate messaging system. They're probably just dicking around. In that scenario, IRC is much better for them.
>>
>>47036916
You're missing the point, there's literally nothing to learn about IRC, It's that simple, literally just netcatting strings simple.
>>
Where is $HOME in linux? As in Vim says my vimrc file is located in $HOME/.vimrc
>>
>>47037007

ignore that

there is no .vimrc file in my home directory should I create it?
>>
Anyone knows about this library http://oglplus.org/? I need to do some shit in raw OpenGL and I'm not really with time to write all the boilerplate on top of OGL.
>>
>>47036899
People actually comment like that?
>>
Hey /dpt/

for some reason,
    for (i = 0; i < lim; i++) {
while (ch1 = getc(first) != '\n')
putchar(ch1);
putchar('\n');
while (ch2 = getc(second) != '\n')
putchar(ch2);
putchar('\n');
}

only prints the newlines, and then I have to kill it with ^C. lim is found like this:
    fseek(first, 0L, SEEK_END);
fseek(second, 0L, SEEK_END);
fsize = ftell(first);
ssize = ftell(second);
// rewind(first);
// rewind(second);
fseek(first, 1L, SEEK_SET);
fseek(second, 1L, SEEK_SET);
if (ssize > fsize)
lim = ssize;
else
lim = fsize;

yet, if i set lim to say, 200, manually, i still have to kill it. How else can I do this so it actually works? Thanks
>>
File: 1425767449150.jpg (43 KB, 512x512) Image search: [Google]
1425767449150.jpg
43 KB, 512x512
>Tfw you have Perl and C++ assignments to do and you're just shit posting on /g/.
>>
>>47037022
If you want a vim profile yeah
>>
>>47037090
Use Qt if LGPL is okay
It just werks
>>
>>47037120
shit
Also, I've uncommented the rewind()s and gotten rid of the latter pair of fseek()s, still same thing.
>>
File: 1382502212856.jpg (62 KB, 396x385) Image search: [Google]
1382502212856.jpg
62 KB, 396x385
>>47037123

>Spring break starts tomorrow
>Professor wants me to go see him to finish a lab experiment
>>
>>47036899
>For anyone that's worked with Android using the NDK, are you supposed to use an OpenGL function loader before using OpenGL?
i'm wondering this too. i'm relying on calling OpenGL functions from java via libGDX instead of from my native code but for my next more ambitious game i should really be calling them directly from the native side if possible.
>>
>>47037007
It's pretty self-explanatory, but you can check it yourself:
echo $HOME
>>
>>47036899
>>47037184
btw you can check out libGDX's internal code in Gdx.gl20 and see how they do it
>>
Here to ask more questions. What a surprise. Anyway, I am making a IRC bot. I started this project on Saturday and I think I've made a lot of progress on it. It currently connects to the IP I specify it to connect to and then says "hey niggers". It then sits there and sends a PONG back to the PING that the IRC server sends. What I'm having a problem with is this, I want to say .help and then have my bot PRIVMSG the sender of the message and then prompt a list of commands available. How would I do it, and if you don't mind, show me how? My code is here

http://pastebin.com/SfvuhDM2

If you help me, thanks in advanced. I greatly appreciate any support/feedback I can get on this journey I'm embarking on.
>>
>>47036889
>https://hydrusnetwork.github.io/hydrus/
> It is developed mostly for Windows, but fairly functional builds for Linux and OS X

nope.jpg (need to make a nope tag)
>>
I dont under stand why would this be 49?
int x = 10;
int y = 10 + x--;
y = y * 2;
System.out.println(x + y);
>>
>>47037327
post vs pre increment. The x isn't set to 9 until after the rest of statement is evaluated.
>>
>>47037327
line 1: x = 10
2: y = 20; x = 9 (added x to y before decrementing)
3: y = 40;
4: x + 7 = 40 + 9
>>
>>47037350
 
int x = 10;
int y= 10 + --x;
y = y * 2;
System.out.println(x+y);

Is what you're thinking it is doing.
>>
Hey I am completely lost on how this works and doesn't crash.
http://pastebin.com/3TXGaw2
It's from this video.
https://www.youtube.com/watch?feature=player_embedded&v=HQYsFshbkYw
I've laid out a few comments in the pastebin but I'll just address my main one and you can refer to the pastebin for greater clarity (if you need or please).

int* num = NULL;
sscanf(ptr += n, "%f%f%n", &sect->floor, &sect->ceil, &n);
//Ignore the '#' and the 'x' below, they represent something not used in map-clear txt (a simpler version of the real file)
for(m=0; sscanf(ptr+=n, "%32s%n", word, &n) == 1 && word[0] != '#'; )
{
num = realloc(num, ++m * sizeof(*num)); num[m-1] = word[0]=='x' ? -1 : atoi(word);
/* Upon extiting num should be allocated to sizeof(int) * m bytes of space */
}
sect->npoints = m /= 2;
sect->neighbors = malloc( (m ) * sizeof(*sect->neighbors));
sect->vertex = malloc( (m+1)* sizeof(*sect->vertex));
->>>>>!!! for(n=0;n<m;++n) sect->neighbors[n] = num[m + n]; /* Shouldn't this be out of bounds, since
num is only allocated to m elements?
This seems to start from the end of the array
and go over, never touching the beginning.
(specifically it assumes num is of
m*2 size but I don't see how that could be)
*/
for(n=0; n<m; ++n) sect->vertex[n+1] = vert[num[n]]; /* This one goes from 0 to n, why the
hell does the above work? */

How does that work? Am I being an idiot?
>>
File: 1422331360809.png (49 KB, 744x612) Image search: [Google]
1422331360809.png
49 KB, 744x612
>>47032959
>>
Any good books, or blogs on software testing?
>>
>>47037237
How is this different from responding to PING request or writing a message to the channel?
The bot checks if the string is in the line it received from the server, and if it is it sends the corresponding line.

I suggest you let the bot print every line it receives from the server and then type shit in the channel for a while, just to see how IRC commands work, or search all the available commands.
>>
>>47037370
It might go out of bounds and not crash, run it under valgrind.
>>
File: 1366280347616.jpg (5 KB, 119x164) Image search: [Google]
1366280347616.jpg
5 KB, 119x164
>>47037237
I don't know how to say this, but you need to completely go back to the drawing board, firstly learn how sockets work.
>>
>>47037370
Wait I left out some critical information.
     //Looks like sector 0 20     3 14 29 49         -1 1 11 22
//in map-clear.txt
sectors = realloc(sectors, ++NumSectors * sizeof(*sectors));
struct sector* sect = &sectors[NumSectors-1];

The declaration of sector looks like this in the map-clear.txt file this function is reading.
I guess the m just represents the vertices and the neighbors (-1 1 11 22) are represented by m + offset? But I still don't understand why that works because the for function should have read the neighbors too so m should be 8 in the example
sector 0 20    3 14 29 49 -1 1 11 22

so if I did m + n I should still go past the bounds of the array for n right?
What the fuck?
>>47037497
Valgrind says 0 errors from 0 contexts and it crashes if I change it any way I've tried.
>>
>>47037359

>x+7
>>
File: javascript.jpg (15 KB, 269x321) Image search: [Google]
javascript.jpg
15 KB, 269x321
>>47037429
Bamp
>>
>>47037558
Now do PHP.
>>
>>47037370
>m /= 2
Halves m.
>>
>>47037485

if (charSearch(buf,"hi scooby")) {
sendData("PRIVMSG #niggersack :hows it going\r\n");
}


Doesn't work. This error is returned

root@linux:~# g++ -w main.cpp -o main
main.cpp: In function 'int main(int, const char**)':
main.cpp:124:63: error: too few arguments to function 'bool sendRawPacket(char*, int)'
sendRawPacket("PRIVMSG #niggersack :hows it going\r\n");
^
main.cpp:14:6: note: declared here
bool sendRawPacket(char *msg, int sockfd){
^
root@linux:~#



>>47037499

No thanks.
>>
File: skeleton explosion.gif (952 KB, 500x197) Image search: [Google]
skeleton explosion.gif
952 KB, 500x197
>>47037621
Goddammit gg.
>>
>>47037623
Why are you root?
>>
>>47037623
Read the error?
>too few arguments
it isn't cryptic in any way.
sendRawPacket("blah", sockfd);
>>
>>47037645

Problem was fixed by including sockfd.

The bot successfully connects to the channel but when I say "hi scooby". Nothing returns

if (charSearch(buf,"hi scooby")) {
sendRawPacket("PRIVMSG #niggersack :watch it fag\r\n", sockfd);
}


ragar!KiwiIRC@Rizon-AD81A4BC. PRIVMSG #niggersack :hi scooby


That's whats in the console. So it sees the message but doesn't reply for some reason.
>>
File: php.jpg (121 KB, 1436x856) Image search: [Google]
php.jpg
121 KB, 1436x856
>>47037602
too lazy to do all the tests
>>
>>47037645
Probably a haxor liveUSB?
>>
>>47037714

It's a dedi I'm logging to and it's a saved session so I don't have to type in the host name everytime. :~)
>>
>>47037723
>Logging into your dedi as root
>ever
>>
Anyone know anything about Vim want to talk about whats in their vimrc file?

set nocompatible              " be iMproved, required
filetype off " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line


Is what vundle starts you with going to pull the plugins I dont want out of it now.
>>
File: 1420434983725.gif (3 MB, 460x306) Image search: [Google]
1420434983725.gif
3 MB, 460x306
>>47037558
anyone do software testing?
>>
>>47037729

>giving a shit about a junk dedi

it's literally just for development. i have nothing useful on it.
>>
>tfw I don't think in traditional OOP anymore
kek, thank you Go
>>
>>47037811
Go shill detected
>>
>>47037687

a-anyone?

>>47037669

see
>>
>>47037811
>tfw I think only in cache friendly code now with C/C++

I only really use sepples now for namespaces
>>
>>47031905
>>>/loper-os/
>>>/cat-v/

dont come back
>>
>>47037687

Weird how this doesn't work. It literally makes total sense to work. If it receives the word "hi scooby", it sends a packet to #niggersack saying "watch is fag". Makes absolutely no sense.
>>
File: 1425360871826.gif (311 KB, 500x559) Image search: [Google]
1425360871826.gif
311 KB, 500x559
Not sure what I'm doing wrong.. Cant figure out this loop

import java.util.Scanner;

public class CurrencyBankTester {

public static void main(String[] args) {


double money= 0;
double dollar=0;
double euro=0;
double yen=0;
String currency;
char c;

CurrencyBank curbank = new CurrencyBank();


Scanner in = new Scanner(System.in);
System.out.println("Welcome to the CurrencyBankTester! ");
System.out.println("What type of currency to add (Y, E, D or X to exit)?");
currency = in.next();
c= currency.charAt(0);
c= Character.toUpperCase(c);

while (c !='X'){




System.out.println("What value do you wish to add?");
money = in.nextDouble();




if (currency.equals("Y"))
{
money=yen;
curbank.AddYen(yen);
}
else if (currency.equals("E"))
{
money=euro;
curbank.AddYen(euro);
}
else if (currency.equals("D"))
{
money=dollar;
curbank.AddYen(dollar);
}
System.out.println("What type of currency to add (Y, E, D or X to exit)?");
currency = in.next();
c= currency.charAt(0);
c= Character.toUpperCase(c);

}//end while

System.out.println(curbank.CountMoney());


}

}
>>
>>47038131
Can you be more specific? Are you saying you are stuck inside the while loop? Does the program always ask the user to input something or does it go dead?
>>
>http://stackoverflow.com/questions/22591544/performance-advantages-of-an-array-of-function-pointer-over-if-blocks
interdasting if anyone of you guys is still curious about my poopy way of avoiding branching

>Some pretty confused code coming from the OP, however I approve of the general advice to favour virtual functions
>A cache miss results in 250% penalty of performance on an arm processor. Safer to say that a good practice is to avoid if statments if possible
>>
What am I doing wrong here?
>>
File: 1424930408051.gif (495 KB, 920x673) Image search: [Google]
1424930408051.gif
495 KB, 920x673
>>47038330
Its going through the loop but the System.out.println(curbank.CountMoney());
prints 0.0

this is the other class

public class CurrencyBank {

double dollar=0;
double euro=0;
double yen=0;

public CurrencyBank()
{

}

public double countMoney()
{
dollar += (yen * 0.0084);
dollar += (euro * 1.13);
return dollar;
}

public void addDollar(double dollar)
{
this.dollar+=dollar;
}

public void addEuro(double euro)
{
this.euro+=euro;
}

public void addYen(double yen)
{
this.yen+=yen;
}


//end of program
}
perhaps I miss worded,
I cant figure out why the return value keeps showing up zeros
>>
>>47038411
try printing out different variables in different parts of the program and see which value doesn't match your expectation.
>>
if (charSearch(buf, "hey")) {
sendRawPacket("PRIVMSG #niggersack :hey there!\r\n", sockfd);
}


I need to parse the PRIVMSG string sent to the channel or directly to the bot for the user nick, parse the message to see if it contains ".help", and if it does, send back a raw PRIVMSG command to that nick with the list of commands as the message string.

How would I do this?
>>
>>47038573

So i'd have to parse 'userid', and 'PRIVMSG' to see that it's a channel message. Channel isn't really relevant, but the message at the end would be, because I have to parse this to see if it matches ".help"
>>
>>47038573
The ".help" needs to be at the start in the string or could be anywhere within?
>>
>>47038131
Look at this part carefully. Firstly, you're calling addYen everywhere instead of the proper currency. Secondly, you read the user input into "money" and right before the add method, you immediately overwrite it.

money = in.nextDouble();


if (currency.equals("Y")) {
money = yen;
curbank.addYen(yen);
} else if (currency.equals("E")) {
money = euro;
curbank.addYen(euro);
} else if (currency.equals("D")) {
money = dollar;
curbank.addYen(dollar);
}
>>
>>47038595

The start
>>
Im sure this is a pretty basic fix for you guys, but I'm not sure what im doing wrong.
 

switch (word)
{

case 'a' :
case 'A' : cout << "Alpha ";

case 'b' :
case 'B' : cout << "Bravo ";

case 'c' :
case 'C' : cout << "Charlie ";

case 'd' :
case 'D' : cout << "Delta ";

case 'e' :
case 'E' : cout << "Echo ";

case 'f' :
case 'F' : cout << "Foxtrot ";


case 'g' :
case 'G' : cout << "Golf ";

case 'h' :
case 'H' : cout << "Hotel ";

}


The breaks arent there, but when I was putting them in, i would get only the first value. Without them, I get all of them. I want one for each letter entered.
>>
>>47038609
Then mantain an array of pointer to string, then compare that string with every element of the array using strncmp(), if returns 0 you have found that command.
>>
>>47038613
Then you need to call the switch for each character in word, not on the whole word.
>>
>>47038613
What is the data type of "word"? It should probably be called "letter" or "c". Otherwise, it sounds like a String.
>>
>>47038613
I think you just need to put 'break;' every 2 cases

And that's assuming 'word' in the variables is only a character variable.
If it's a string, just separate it into individual letters and then pass each through the switch in a loop.
>>
>>47038659
char.

Basically, if I type in kek, I would get a word for each first letter of each word.


>>47038656
I'm sorry, what would that look like?
>>
>>47038633

Something like this?

if(!strncmp(buf, ".help", 4)){
sendRawPacket("PRIVMSG #niggersack :hey there!\r\n", sockfd);
}
>>
>>47038670
Same poster here. This book is kind of bad. I never really feel prepared to do my assignments for this class. The examples have been less than helpful.
Thread replies: 255
Thread images: 43

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.