These are chat archives for gwydirsam/DickGrayson

27th
Apr 2015
Martin Fracker, Jr.
@Towerism
Apr 27 2015 00:17
I added an exception system to dgtype. It can be seen in dgtype/exception.hh

Basically you edit exception.hh and define your exception like so

DEFINE_DGTYPE_EXCEPT(Invalid_input)

Then you can throw it like so

throw dgtype::Invalid_input_exception("Munchkin-rsa")

When caught, if you call the function what() like so

catch (dgtype::Exception e) {
  std::cerr << e.what() << std::endl;
}

It will print:

Munchkin-rsa: Invalid_input_exception
Martin Fracker, Jr.
@Towerism
Apr 27 2015 00:22
You can include either <dgtype/dgtype.hh> or <dgtype/exception.hh> to use it; preferrably the latter, but dgtype.hh should include all of our types for you
Sam Gwydir
@gwydirsam
Apr 27 2015 00:48
It's a macro?
Sam Gwydir
@gwydirsam
Apr 27 2015 00:59
i'm close to going through dgtype and adding a line
#pragma not even once
is __DEFINING_EXCEPTIONS a gcc extension?
@Towerism
Kyle Wilson
@bluyam
Apr 27 2015 01:41
So firstly I would like to apologize to you guys for making you wait on Friday, I fell asleep and didn't mean to inconvenience you
and secondly
I'm trying to make install-ceps after pulling develop
and it says no rule to make target
*deps
help
Sam Gwydir
@gwydirsam
Apr 27 2015 01:54
what directory are you in
I guess asleep is better than what we thought. We thought you were getting coffee or something...I forget
But 9 days is a hell of a nap
Sam Gwydir
@gwydirsam
Apr 27 2015 02:01
@Towerism you get my text?
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:01
Just now, yes. Let me go look at it
Sam Gwydir
@gwydirsam
Apr 27 2015 02:01
yo @bluyam why are you running install-deps anyway? When did you last run it?
@Towerism if you have a sec I'm just wondering why it's a macro
and is __DEFINING_EXCEPTIONS a compiler extension or gtest or what?
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:03
Oh yea it's a macro. So that it's easy to add another exception. It allows you to include exception_util.hh
Sam Gwydir
@gwydirsam
Apr 27 2015 02:04
you created it?
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:04
I didn't want DEFINE_DGTYPE_EXCEPT polluting the namespace so I make sure that it gets undefined ASAP
Sam Gwydir
@gwydirsam
Apr 27 2015 02:04
don't have the two underscores in front
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:04
the macro __DEFINING_EXCEPTIONS..
Sam Gwydir
@gwydirsam
Apr 27 2015 02:04
that's for extensions and other things
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:04
oh yea just remembered that
Sam Gwydir
@gwydirsam
Apr 27 2015 02:04
that's why I thought it was like a gcc extension
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:04
I'll fix it
lol
Sam Gwydir
@gwydirsam
Apr 27 2015 02:05
Also I'm not sure why have a macro....it seems to me it's just dangerous
why not just have like a template or something
or nothing at all actually
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:05
It wasn't originally a macro
Originally it was just a base class and exception classes that extended it
Sam Gwydir
@gwydirsam
Apr 27 2015 02:06
did someone reccomend a macro somewhere or did you just get carried away? haha
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:06
I was making the exceptions that I wrote for BMP accessible to WAV but also more abstract so I could append WAV: or BMP: at the beginning depending on who is throwing the exception
I tried a few ways to accomplish it but ultimately the easiest way to achieve code a greater level of code reuse was to introduce the macro
Sam Gwydir
@gwydirsam
Apr 27 2015 02:07
just have a generic exception for both
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:07
I got carried away haha, only way to explain why I didn't do that
Sam Gwydir
@gwydirsam
Apr 27 2015 02:08
there is such thing as dry to a fault
think old ass leather skin people
their skin is TOO DRY
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:08
It is nice though, isn't it?
Sam Gwydir
@gwydirsam
Apr 27 2015 02:08
It's terrifying on many accounts haha
Kyle Wilson
@bluyam
Apr 27 2015 02:08
I'm just trying to get OpenSSL installed
Sam Gwydir
@gwydirsam
Apr 27 2015 02:08
I could make macros so I don't have to use semi-colons but I'm not crazy
Kyle Wilson
@bluyam
Apr 27 2015 02:09
Oh let me go to the home dir
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:09
Just leave your exceptions in my hands >:)
Sam Gwydir
@gwydirsam
Apr 27 2015 02:09
@bluyam just do pwd
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:10
Also sam, that is a brilliant idea. Let me create a new library called dgshortcuts
Sam Gwydir
@gwydirsam
Apr 27 2015 02:10
Just shoot me
Also cancel your tests in post
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:11
So instead of using semicolons you would type APPEND_SEMICOLON_TO(statement)
what do you mean?
Sam Gwydir
@gwydirsam
Apr 27 2015 02:11
it seems like you're getting carried away with that
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:11
I'm jk
Are you talking about travis?
Sam Gwydir
@gwydirsam
Apr 27 2015 02:11
or at least if you cancel something -- make sure before you're done you have a test that either passes or fails
yeah I was talking about [ci-skip]
Obviously I'm totally behind APPEND_SEMICOLON_TO(this_is_my_statement_that_is_in_need_of_semi_colons)
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:12
Oh yea there were a lot of related commits, and commit mistakes due to rushing that a lot of my pushes were unnecessary
Sam Gwydir
@gwydirsam
Apr 27 2015 02:12
Just let them go
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:13
alright
Sam Gwydir
@gwydirsam
Apr 27 2015 02:13
only cancel if it will only stop when it times out (infinite loops, things like that)
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:13
Oh okay
Sam Gwydir
@gwydirsam
Apr 27 2015 02:13
@blue
@bluyam you figured out where you are yet?
Kyle Wilson
@bluyam
Apr 27 2015 02:24
so I successfully installed the things
but when I compile I still get that openssl/md5.h cannot be included
but I guess as long as it works on travis that's ok
Sam Gwydir
@gwydirsam
Apr 27 2015 02:25
no it has to work where you work
are you on build?
Kyle Wilson
@bluyam
Apr 27 2015 02:25
ys
Martin Fracker, Jr.
@Towerism
Apr 27 2015 02:26
Travis takes a long time to build, you'd be waiting several minutes to know if your build was successful
Let me rephrase, travis takes a while before it gets to the build step
Sam Gwydir
@gwydirsam
Apr 27 2015 02:26
and if use it as a compiler... you'll end up hogging it
Kyle Wilson
@bluyam
Apr 27 2015 02:27
so what to does
Sam Gwydir
@gwydirsam
Apr 27 2015 02:27
checking if it works on my account quick
Kyle Wilson
@bluyam
Apr 27 2015 02:27
thumbs up emoji
Sam Gwydir
@gwydirsam
Apr 27 2015 02:28
you're stego-attack?
Kyle Wilson
@bluyam
Apr 27 2015 02:31
yes
let me push rq
Sam Gwydir
@gwydirsam
Apr 27 2015 02:31
works perfectly for me
you'll have to pull first
I ran make clean-force; make all; make -k test-all
Sam Gwydir
@gwydirsam
Apr 27 2015 02:38
@bluyam I'm going to bed. You need tests, btw.
Kyle Wilson
@bluyam
Apr 27 2015 02:43
ty
Sam Gwydir
@gwydirsam
Apr 27 2015 02:45
no problem. I took a look and openssl needs to be installed explicitly with make install-openssl
Kyle Wilson
@bluyam
Apr 27 2015 02:49
that might help
Kyle Wilson
@bluyam
Apr 27 2015 03:37
welp I broke everything
(jk)
It should be a simple fix
Martin Fracker, Jr.
@Towerism
Apr 27 2015 10:30
I don't understand why. Embeadding and extracting should be nearly 100% tested.
Sam Gwydir
@gwydirsam
Apr 27 2015 14:01
are there certain cli args needed?
@Towerism coverage works by running the binary, if the binary doesn't go through that path ( you can run it multiple times) it isn't covered
Though we should have decent coverage just with tests
Martin Fracker, Jr.
@Towerism
Apr 27 2015 18:40
Yea most of the args have sanity checks and certain args depend on others.
The binary doesn't do anything I dont think if no args are given
Sam Gwydir
@gwydirsam
Apr 27 2015 19:38
aaah...find run-debug-stego-crypt and run it enough times to cover all the different option combinations
@Towerism if that isn't reasonable, just do a reasonable set
oh and those are in the makefile
Kyle Wilson
@bluyam
Apr 27 2015 19:50
rafs and i are in lab A
Kyle Wilson
@bluyam
Apr 27 2015 23:13
So, I only included the file openssl/md5.h once, but I still get a similar error. SO seems to think I should include -lssl in the linker options, which requires that we install libssl. What do you think Bubba? If I can't fix this within the next half hour I'm just going to move on to the next card
This message was deleted
The error I'm getting:
kdw0134@build stego-attack-lib $ gcc  stego-attack-lib.cc -o stego-attack-lib  -lcrypt -w
/tmp/ccmMzbzc.o: In function `getMD5Hash(char*, unsigned char*, bool)':
stego-attack-lib.cc:(.text+0x15f): undefined reference to `MD5'
collect2: error: ld returned 1 exit status
Sam Gwydir
@gwydirsam
Apr 27 2015 23:19
it doesn't work with make?
I thought it worked.
Kyle Wilson
@bluyam
Apr 27 2015 23:20
Let me make clear and such.
The thing is, it broke when I tested, which I thought meant that the compiler was having the above issue.
Sam Gwydir
@gwydirsam
Apr 27 2015 23:22
No that's probably just because when you build manually you're not linking ssl. make does.
Kyle Wilson
@bluyam
Apr 27 2015 23:22
How so? Doesn't -lcrypt link ssl?
Sam Gwydir
@gwydirsam
Apr 27 2015 23:23
no idea
use make
Kyle Wilson
@bluyam
Apr 27 2015 23:23
Lol ok.
What is the threefold command again?
Sam Gwydir
@gwydirsam
Apr 27 2015 23:23
even I don't know how to manually build this thing...it's too large and complicated
Kyle Wilson
@bluyam
Apr 27 2015 23:23
I can't seem to find it on here.
Sam Gwydir
@gwydirsam
Apr 27 2015 23:23
I usually run:
make clean-force; make all; make -k test-all
Kyle Wilson
@bluyam
Apr 27 2015 23:24
Perf, thanks
Sam Gwydir
@gwydirsam
Apr 27 2015 23:24
That's my go to check
generally you can just do make all
and then make test-debug-stego-attack
Kyle Wilson
@bluyam
Apr 27 2015 23:24
Gotcha.
Sam Gwydir
@gwydirsam
Apr 27 2015 23:25
Here's what I get:
======================================
Starting Debug Build
======================================
-- The C compiler identification is AppleClang 6.1.0.6020049
-- The CXX compiler identification is AppleClang 6.1.0.6020049
-- Check for working C compiler: /usr/local/opt/ccache/libexec/cc
-- Check for working C compiler: /usr/local/opt/ccache/libexec/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++
-- Check for working CXX compiler: /usr/local/opt/ccache/libexec/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- GMP libs: /usr/local/lib/libgmp.dylib /usr/local/lib/libgmpxx.dylib
-- Found GMP: /usr/local/include
-- Found OpenSSL: /usr/lib/libssl.dylib;/usr/lib/libcrypto.dylib (found version "0.9.8}")
Found rsa-crypt-lib. Adding dependency: rsa-crypt depends on rsa-crypt-lib
Found rsa-crypt-lib. Linking rsa-crypt with rsa-crypt-lib
Found rsa-attack-lib. Adding dependency: rsa-attack depends on rsa-attack-lib
Found rsa-attack-lib. Linking rsa-attack with rsa-attack-lib
Found stego-crypt-lib. Adding dependency: stego-crypt depends on stego-crypt-lib
Found stego-crypt-lib. Linking stego-crypt with stego-crypt-lib
Found stego-attack-lib. Adding dependency: stego-attack depends on stego-attack-lib
Found stego-attack-lib. Linking stego-attack with stego-attack-lib
Coveralls: Using alternate CMake script dir: /Users/sam/Code/C++/CSCE315/Project4/DickGrayson/share/cmake
COVERALLS UPLOAD: ON
Found rsa-attack-lib. Linking rsa-attack-test with rsa-attack-lib
Found rsa-crypt-lib. Linking rsa-crypt-test with rsa-crypt-lib
Found stego-attack-lib. Linking stego-attack-test with stego-attack-lib
Found stego-crypt-lib. Linking stego-crypt-test with stego-crypt-lib
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/sam/Code/C++/CSCE315/Project4/DickGrayson/debug
Scanning dependencies of target dgcrypto
Scanning dependencies of target dgtype
Scanning dependencies of target rsa-attack-lib
Scanning dependencies of target dgimg
Scanning dependencies of target dgsnd
Scanning dependencies of target rsa-crypt-lib
Scanning dependencies of target stego-attack-lib
Scanning dependencies of target stego-crypt-lib
[  2%] Scanning dependencies of target gtest
[  5%] [  7%] [ 10%] [ 12%] [ 15%] [ 17%] Building CXX object lib/CMakeFiles/dgtype.dir/dgtype/dgtype.cc.o
[ 20%] Building CXX object lib/CMakeFiles/dgcrypto.dir/dgcrypto/dginteger.cc.o
[ 23%] Building CXX object lib/CMakeFiles/rsa-attack-lib.dir/rsa-attack-lib/common_modulus.cc.o
Building CXX object lib/CMakeFiles/stego-attack-lib.dir/stego-attack-lib/stego-attack-lib.cc.o
Building CXX object lib/CMakeFiles/dgsnd.dir/dgsnd/dgsnd.cc.o
Building CXX object lib/CMakeFiles/dgcrypto.dir/dgcrypto/dgrandominteger.cc.o
[ 25%] Building CXX object lib/CMakeFiles/dgsnd.dir/dgsnd/wav.cc.o
Building CXX object lib/CMakeFiles/rsa-attack-lib.dir/rsa-attack-lib/factorization_attack.cc.o
Building CXX object lib/CMakeFiles/dgcrypto.dir/dgcrypto/dgrandomprime.cc.o
[ 28%] Building CXX object lib/CMakeFiles/rsa-attack-lib.dir/rsa-attack-lib/known_totient.cc.o
[ 30%] Creating directories for 'gtest'
[ 35%] [ 35%] [ 38%] [ 41%] Building CXX object lib/CMakeFiles/rsa-crypt-lib.dir/rsa-crypt-lib/rsa-crypt-lib.cc.o
[ 43%] Building CXX object lib/CMakeFiles/stego-crypt-lib.dir/stego-crypt-lib/embedding_agent.cc.o
[ 46%] Building CXX object lib/CMakeFiles/stego-crypt-lib.dir/stego-crypt-lib/extracting_agent.cc.o
[ 48%] Building CXX object lib/CMakeFiles/dgimg.dir/dgimg/bmp_data.cc.o
Building CXX object lib/CMakeFiles/dgimg.dir/dgimg/bmp.cc.o
Building CXX object lib/CMakeFiles/dgimg.dir/dgimg/EasyBMP.cc.o
Building CXX object lib/
Oh it truncated it
Kyle Wilson
@bluyam
Apr 27 2015 23:26
Where did it truncate?
Sam Gwydir
@gwydirsam
Apr 27 2015 23:27
here's the errors/warnings
wait
I'm just going to put a file on here
Kyle Wilson
@bluyam
Apr 27 2015 23:31
Ok.
@Towerism do you have an example original/encrypted file set that I can run more tests on?
Kyle Wilson
@bluyam
Apr 27 2015 23:37
Oh, I accidentally added the main back in so it's flippin' shit.
Sam Gwydir
@gwydirsam
Apr 27 2015 23:37
oh @bluyam just checkout travis
Kyle Wilson
@bluyam
Apr 27 2015 23:38
Let me fix that.
Sam Gwydir
@gwydirsam
Apr 27 2015 23:38
you realize you're not breaking anyone elses stuff right? haha we have no idea if you fuck up
Kyle Wilson
@bluyam
Apr 27 2015 23:39
Yeah I understand lol. Keeping you up to date I guess...? ¯_(ツ)_/¯
Sam Gwydir
@gwydirsam
Apr 27 2015 23:39
haha ok just checking
at first I thought when you were merging these things into develop and I was like WHUT
Yeah but just use make. I think the problems are not linking related.
Try commenting out stuff until it works then adding back until you can isolate
Kyle Wilson
@bluyam
Apr 27 2015 23:47
Bueno.
Also @ralphie9224 please move your cards from Backlog to Sprint 3 when you can.
Martin Fracker, Jr.
@Towerism
Apr 27 2015 23:56
Linking CXX executable dgimg-test
CMakeFiles/dgsnd-test.dir/dgsnd/dgsnd-test.cc.o: In function `Wav_InvalidFormatException_Test::TestBody()':
dgsnd-test.cc:(.text+0xe6): undefined reference to `sf_close'
CMakeFiles/dgsnd-test.dir/dgsnd/dgsnd-test.cc.o: In function `Wav_InaccessibleFileException_Test::TestBody()':
dgsnd-test.cc:(.text+0x2c6): undefined reference to `sf_close'
CMakeFiles/dgsnd-test.dir/dgsnd/dgsnd-test.cc.o: In function `Wav_SampleSetMask_Test::TestBody()':
dgsnd-test.cc:(.text+0x5f2): undefined reference to `sf_close'
CMakeFiles/dgsnd-test.dir/dgsnd/dgsnd-test.cc.o: In function `Wav_SampleUnsetMask_Test::TestBody()':
dgsnd-test.cc:(.text+0xa02): undefined reference to `sf_close'
CMakeFiles/dgsnd-test.dir/dgsnd/dgsnd-test.cc.o: In function `DG::Sound::WAV::~WAV()':
dgsnd-test.cc:(.text._ZN2DG5Sound3WAVD2Ev[_ZN2DG5Sound3WAVD5Ev]+0x9): undefined reference to `sf_close'
../lib/libdgsnd.a(wav.cc.o): In function `DG::Sound::WAV::open(std::string const&)':
wav.cc:(.text+0x25): undefined reference to `sf_open'
collect2: error: ld returned 1 exit status
test/CMakeFiles/dgsnd-test.dir/build.make:94: recipe for target 'test/dgsnd-test' failed
make[3]: *** [test/dgsnd-test] Error 1
libsndfile isn't linking to dgsnd-test.cc
@gwydirsam