Open Side Menu Go to the Top
Register
Programming homework and newbie help thread Programming homework and newbie help thread

05-27-2015 , 08:36 AM
Quote:
Originally Posted by plx
How do i install pokereval in C? I installed it with cygwin using ./configure and make commands. Now what do i do? I need to use the #includes in the C program, what do i write? And then if it works suceffully where can i get the functions available?
No offense, it appears to me that you have little to no experience in programming. This thread is about programming homework for people taking classes in programming. What programming classes does this apply to that you are taking?
Programming homework and newbie help thread Quote
05-27-2015 , 08:47 AM
I actually study computer science. I don't need this for any project just wanted to get access to the library so i then apply what i've been learning in something more pratical for me. That way i'am more involved and i learn better than with examples that don't say as much to me.

I'd just like to make this work, get access to the functions and don't have to worry about that again.
Programming homework and newbie help thread Quote
05-27-2015 , 01:24 PM
Quote:
Originally Posted by adios
No offense, it appears to me that you have little to no experience in programming. This thread is about programming homework for people taking classes in programming. What programming classes does this apply to that you are taking?
and newbie help thread

no?
Programming homework and newbie help thread Quote
05-27-2015 , 02:52 PM
Quote:
Originally Posted by Alobar
and newbie help thread

no?
You are correct fair enough.
Programming homework and newbie help thread Quote
05-27-2015 , 02:59 PM
Quote:
Originally Posted by plx
I actually study computer science. I don't need this for any project just wanted to get access to the library so i then apply what i've been learning in something more pratical for me. That way i'am more involved and i learn better than with examples that don't say as much to me.

I'd just like to make this work, get access to the functions and don't have to worry about that again.
I will try to help you. Again no offense but this doesn't make any sense to me when you write "how do I install pokerval in C?" C is a programming. You might install a compiler. Maybe you mean the pokerrval package that was developed in C that has libraries you can link to is what you are installing. Is that what you mean?

Building programs compiled in C isn't necessarily a snap. So we should take this one step at a time and use small steps.
Programming homework and newbie help thread Quote
05-27-2015 , 03:08 PM
Yes saying install pokereval in C doesnt make much sense, i will try to be more precise on what i say.

But can you help me with this? it's something i never did before, apart from the usual #include lines ofcourse. What do i have to do in order to link it to my program in C? I already have this files on a folder https://github.com/v2k/poker-eval
Programming homework and newbie help thread Quote
05-27-2015 , 04:00 PM
Quote:
Originally Posted by plx
Yes saying install pokereval in C doesnt make much sense, i will try to be more precise on what i say.

But can you help me with this? it's something i never did before, apart from the usual #include lines ofcourse. What do i have to do in order to link it to my program in C? I already have this files on a folder https://github.com/v2k/poker-eval
Ok, given what is in the read me file and what you posted earlier, I think you should look for files with .so and/or .a extensions. The .so extension is for dynamically link libraries and .a is for statically linked. Tell me what you find. My take is that the make file should have built those. According to the readme file they should be in /user/local/include/poker-eval. Tell me which ones you see if any.
Programming homework and newbie help thread Quote
05-27-2015 , 04:36 PM
Yes i have two files with extension .a in Documents\pokereval\lib\.libs:
libpoker-eval.a and libpoker-eval.dll.a
Programming homework and newbie help thread Quote
05-27-2015 , 05:00 PM
Quote:
Originally Posted by plx
Yes i have two files with extension .a in Documents\pokereval\lib\.libs:
libpoker-eval.a and libpoker-eval.dll.a
Cool beans. I am pretty sure you are going to want to link to libpoker-eval.dll.a since you are running cygwin. If you were running in a native Linux environment you would link to libpoker-eval.a.

Ok in attempt to reduce a little bandwidth. I assume you want to call one of the libpoker-eval.dl.a functions. Find the correct signature of the function that you want to call and keep it handy.

At this point I believe you have 4 different ways you could go:

1) Create your own source file, a .c or .cpp source file that includes the .h file that contains the signature of the poker-eval function you want to call. Create a command line that will compile and link your source file and the library file. If you are going this route I recommend a bash script that has the command and just run the script. I don't recommend this route because you'll eventually be adding more code I would think. This might be ok for a quick and dirty way to see how things are working for you.

2) Create your own make file that builds your application. You will have to learn how they work. I don't recommend this either but this is a better way than 1) in the long run.

3) Install Eclipse-CDT on cygwin and create a project that will include your source code and the library. Create a HelloWorld type application and replace the code Eclipse generates with your code.

I do recommend this way for a few reasons. The first is that it is handy and makes it easy to build your app. The second reason is that Eclipse-CDT will actually create a make file for you and you can copy it to another folder at a later time and use it as a model if you want to put it on GitHub for instance. I always understood the concept of make files but often when I looked at them they were incomprehensible. I read up on them a little bit and realized how many implied settings there are and thus it became clear as to why they were often incomprehensible. If you look at the way Eclipse constructs the make file infrastructure, it is really easy to figure out what is going on and easy to modify. So you get that benefit as well as getting up and running fairly easily. There are some quirky things about Eclipse-CDT but I can get through enough to build the application.

4) Switch to Visual Studio. I did notice in the GitHub link that there are some VS project files in there but the stuff about DOS and nmake didn't give me a warm fuzzy. Since you already have the libraries built, no need to go down that path at this time.

Go ahead and post any code your are in doubt about or what the assignment I've given you .
Programming homework and newbie help thread Quote
05-27-2015 , 05:42 PM
I think i will go with options number 3... :P
I already have the program what do i do with it now? Where does the file .a extension comes in?
Programming homework and newbie help thread Quote
05-27-2015 , 07:52 PM
Quote:
Originally Posted by plx
I think i will go with options number 3... :P
I already have the program what do i do with it now? Where does the file .a extension comes in?
The .a extension is the poker-eval library that contains the poker-eval function(s) you are calling in your program. You have to take the compiler output for your code that calls the poker-eval functions and link it with the library via the gcc linker. Eclipse will take care of all that when you create a project and build it. You will have to set up the compiling and linking options. When you get to that point I can help you.
Programming homework and newbie help thread Quote
05-28-2015 , 08:13 PM
why is this a syntax error? it was added by pythons pip. Is it a dash vs bash thing?

found in .xsession-errors
Code:
~/.profile: Syntax error: "(" unexpected (expecting "}")
found in .profile
Code:
# pip bash completion start
_pip_completion()
{
    COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \
                   COMP_CWORD=$COMP_CWORD \
                   PIP_AUTO_COMPLETE=1 $1 ) )
}
complete -o default -F _pip_completion pip
# pip bash completion end

Last edited by e i pi; 05-28-2015 at 08:14 PM. Reason: on ubuntu14
Programming homework and newbie help thread Quote
06-03-2015 , 06:44 PM
docked 10% on an assignment for using loops before they're introduced in class o.O
Programming homework and newbie help thread Quote
06-03-2015 , 06:50 PM
Too dangerous to let beginners use super advanced **** like loops bro. Theyll hurt themselves.
Programming homework and newbie help thread Quote
06-03-2015 , 07:20 PM
gonna be a painful two months
Programming homework and newbie help thread Quote
06-04-2015 , 02:05 AM
Lol what class is this? Maybe they docked you points because they wanted you to use recursion not loops bro!
Programming homework and newbie help thread Quote
06-04-2015 , 09:47 AM
no, it's not more advanced, it's less advanced

java 1

basically starting over so i don't have to deal with c++ (as much) when i get a job

plus side is it doesn't set my graduation date back at all, and it keeps me busy over the summer
Programming homework and newbie help thread Quote
06-04-2015 , 09:58 AM
Quote:
Originally Posted by TheDuker
What's in the bin/ directory? According to this page, there should definitely be one in the Windows install.

If your installation doesn't have a bin directory that contains all the expected executables, you may have excluded them during your Custom install. But I suspect that's not really possible.

This is my bin directory on mac (45 items). I imagine Windows might be slightly different but probably not much:
Code:
$ ls /usr/local/mysql/bin/ | wc -l
      45
$ ls /usr/local/mysql/bin/
innochecksum			mysql_client_test_embedded	mysql_setpermission		mysqlbug			mysqlimport
msql2mysql			mysql_config			mysql_tzinfo_to_sql		mysqlcheck			mysqlshow
my_print_defaults		mysql_config_editor		mysql_upgrade			mysqld				mysqlslap
myisam_ftdump			mysql_convert_table_format	mysql_waitpid			mysqld-debug			mysqltest
myisamchk			mysql_embedded			mysql_zap			mysqld_multi			mysqltest_embedded
myisamlog			mysql_find_rows			mysqlaccess			mysqld_safe			perror
myisampack			mysql_fix_extensions		mysqlaccess.conf		mysqldump			replace
mysql				mysql_plugin			mysqladmin			mysqldumpslow			resolve_stack_dump
mysql_client_test		mysql_secure_installation	mysqlbinlog			mysqlhotcopy			resolveip
Many thanks TheDuker, I seem to be getting somewhere now
Programming homework and newbie help thread Quote
06-04-2015 , 11:05 AM
Quote:
Originally Posted by Low Key
gonna be a painful two months
I just took intro to Java, thankfully it was an online course so I didn't have to sit through lectures, but it was still excruciating. I feel your pain
Programming homework and newbie help thread Quote
06-04-2015 , 11:11 AM
Was really funny and annoying taking java after C++ and going over most basic things possible. Somehow like half the group managed to "not get it" anyway.
Programming homework and newbie help thread Quote
06-04-2015 , 11:33 AM
i wouldn't care so much if they would, say, turn on all the online portions and let me work ahead a bit. I'm almost done with the full semester's reading, and that was before class even started.

Really sucks to have the full week's work done an hour into the first of two three-hour classes, particularly with a crabby professor who doesn't want anyone to leave early.
Programming homework and newbie help thread Quote
06-04-2015 , 12:57 PM
just use it as a 3 hour study hall and do your homework for all your other classes, lol

IDGAF and leave at any point in a lecture if I want. It's college not high school. I'm doing CC tho to get all the basic **** done, and its annoying as **** that teachers actually take attendance, wtf?

I really wish more teachers would just let you test out of their class. Like if I can pass the final, please just let me do it, so we dont waste each others time.

I dunno, college seems like a pretty giant waste in this day and age, especially for something like computer science.
Programming homework and newbie help thread Quote
06-04-2015 , 01:10 PM
i was worried that i'd had this professor before, and it turns out i was right. Had him for a math class that I dropped because, I kid you not, the classes devolved into him spending most of the time yelling at the class for either not reading the texts or not remembering enough stuff from algebra.

CS needs a huge overhaul at most colleges, i do agree with that. it's definitely taught more like this is the early 90s and not the year 2015.
Programming homework and newbie help thread Quote
06-04-2015 , 06:28 PM
Quote:
Originally Posted by Low Key
i was worried that i'd had this professor before, and it turns out i was right. Had him for a math class that I dropped because, I kid you not, the classes devolved into him spending most of the time yelling at the class for either not reading the texts or not remembering enough stuff from algebra.

CS needs a huge overhaul at most colleges, i do agree with that. it's definitely taught more like this is the early 90s and not the year 2015.
The whole collegiate system needs an overhaul imho.
Programming homework and newbie help thread Quote
06-09-2015 , 12:59 PM
I definitely agree. And to that end, I propose the following question from an academic point of view:

When does it all come together?

What I mean by this is, when does on in some sort of college attain the required knowledge and skills to be able to make something that reflects real-life programming.

Yes, it's nice messing around with command prompt-based programs and such, but at what point should I be worrying about being able to make UI-based programs, or programs that interact with databases, or god knows whatever else kind of functionality I feel like I should be learning?

I know our school has one or two sort of capstone courses, related to app development & programming and such. It leaves me wondering if this is when it all gets tied together or what.

I'm sure these are questions best posed to our school's staff, but I thought I'd ask here first. Hopefully the question is posed in a way that sorta makes sense. It only partially does in my head, because since I don't know what I don't know, it's hard to ask questions about what I don't know, ya know?
Programming homework and newbie help thread Quote

      
m