« first day (608 days earlier)      last day (4333 days later) » 

9:00 PM
@KillianDS doesn't the networking code in the Linux Kernel have an API that could be used to write your own kernel module? Not sure why you'd have to hack the kernel code itself.
 
@RadekSlupik worksforme
 
I'm getting this error:
 
(using libc++ and Clang 3.0 on Mac OS X)
 
> Copy assignment operator is implicitly deleted because '__compressed_pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> >' has a user-declared move constructor
 
are you sure it's that line in particular? what's the next line in your code?
 
9:01 PM
using Method = http::Request::Method;
 
ok, that shouldn't matter :D
 
oh wait damn
 
can you define std::regex r("/"); at global scope? ....ok, waiting
 
@JimNorton I was actually extending an existing GRE implementation :). Could be it was a existing (included) module though, but the details pushed back very far in my memories.
 
@Quuxplusone ideone.com/Clg3Y 2nd argument to router.map, same error.
I'm using libc++ with clang 3.1.
 
9:04 PM
hmm. What's the declaration/prototype of router.map?
 
  template<class F>
  void map(http::Request::Method method, std::regex match, F handler) {
    routes.emplace_back(std::make_tuple(method, std::move(match), handler));
  }
 
What if you pass const std::regex& match, instead?
or wait
hmm
 
> Copy assignment operator is implicitly deleted because '__compressed_pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, std::__1::allocator<char> >' has a user-declared move constructor
 
Why are you using std::move(match) at all? Doesn't make sense to me.
just use make_tuple(method, match, handler).
 
Because I pass it by value because I need to copy it.
I don't want to copy it twice.
 
9:05 PM
But make_tuple is going to copy it anyway, right?
 
It will move it if the argument is an rvalue.
 
Converting it to an rvalue reference first (via std::move) just confuses the type system.
 
@Quuxplusone No it doesn't.
 
It has nothing to do with the definition of Router::map, since std::regex r("/"); doesn't compile either.
 
Does everything work (albeit inefficiently ;)) if you change the parameter type to "const regex &" and the make_tuple to take "match" instead of std::move(match)?
 
9:07 PM
Same error.
In particular, even this gives the same error:
#include <regex>
int main() {
  std::regex r("/");
}
 
Ah. That's what I was originally asking. I thought you implied that that worked.
What operating system are you on?
 
Mac OS X.
 
clang++ --std=c++11 tes2.cc --stdlib=libc++ -c
worksforme.
clang++ --version
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.3.0
Thread model: posix
 
Full source and errors: ideone.com/nIjLm
% clang -v
clang version 3.1 (tags/RELEASE_31/final)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
 
x86_64-apple-darwin11.4.0/bin/clang++ foo.cpp -std=c++11 -stdlib=libc++
In file included from foo.cpp:1:
In file included from /usr/include/c++/v1/regex:726:
In file included from /usr/include/c++/v1/__locale:15:
/usr/include/c++/v1/string:1952:10: error: no viable overloaded '='
__r_ = _STD::move(__str.__r_);
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/string:1942:9: note: in instantiation of member function
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >::__move_assign' requested here
ah, I seeeee. Weird.
 
9:12 PM
libc++ is borken.
Damn
 
yeah, I guess
 
I'll see if I can install the latest version.
 
hey radek
you been on IRC?
 
nope
 
hop in
 
9:15 PM
@Radek You can do std::regex r; and then maybe there's a member function to set the pattern? I don't know off the top of my head.
 
[jrn] ~ > cat test.cpp
#include <regex>
int main() {
  std::regex r(/);
}
[jrn] ~ > g++ test.cpp
In file included from /usr/lib/gcc/i686-redhat-linux/4.4.6/../../../../include/c++/4.4.6/regex:35,
                 from test.cpp:1:
/usr/lib/gcc/i686-redhat-linux/4.4.6/../../../../include/c++/4.4.6/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
 
you forgot the quotes around /
also, 4.4.6 is the olds.
 
Damn, I can't install the latest libc++ because libc++ is in use or something.
 
g++ won't compile it.
 
9:19 PM
Fuck.
FUCK.
Applications won't open anymore. T_T
FUCK.
 
@RadekSlupik what did you do
 
@JimNorton Yes it does (4.7 at least, I assume 4.6 also)
 
@Pubby Tried to replace libc++ with a newer version. xD
> sudo: unable to initialize PAM: No such file or directory
WTF?
 
so you have a pam module that depends on the older libc++
 
So I cannot install libc++ now because I can't sudo.
% su
dyld: Library not loaded: /usr/lib/libc++.1.dylib
  Referenced from: /usr/lib/libauto.dylib
  Reason: image not found
lol
 
9:23 PM
so did you just delete it? Before installing a new version?
 
heh
 
my friend just did that yesterday
 
I did cp ~/Desktop/libc++.1.dylib /usr/lib. :P
I guess that will be a reinstallation. :/
 
reboot into recovery mode (hold down Apple-R during reboot) and you'll be able to do stuff... probably. In our case we saved a copy of libc++.dylib first, so recovering was just a matter of "cp old-dylib /usr/lib" and then it worked fine.
If you lost the old dylib entirely, you may be hosed, yes
 
9:25 PM
Good idea!
 
@RadekSlupik you could boot Linux and copy it back :)
 
Oh yeah I lost the old one, but I can still try to copy the new one to /usr/lib.
 
the relevant point is that "cp" didn't work for us outside of recovery mode, but it did work inside recovery mode.
 
@awoodland No need for Linux, I have a recovery partition that can give me root access.
 
@rubenvb: clang now runs about 50% of the time, and the other half it complains that gcc doesn't recognize a command line option. I'm running it from a script, so it's getting the exact same parameters every time.
 
9:26 PM
So I'll brb.
hopefully
 
good luck
 
...and Radek was never heard from again
 
@KillianDS That explains it. I have g++ 4.4.6
Why wouldn't Centos 6.2 have a newer GCC toolchain?
 
@JimNorton it's hard to QA a moving target
 
So GCC 4.4.6 is considered the latest stable version then?
 
9:29 PM
uh, no
4.7 is the latest stable version
 
@JimNorton no, but it probably was when they froze the release
(not 100% sure how Centos/RHEL release)
 
ah. Perhaps I will upgrade to the newer version then.
 
@JimNorton CentOS is all about stability and takes a long time from freeze (which is even the RHEL freeze for things like this if I'm not mistaken) until release
 
many new C++11 features in the newer versions
 
@KillianDS That sounds about right to me.
I've noticed many older packages on newer versions of Centos as compared to other distros such as Ubuntu etc.
 
9:32 PM
@JimNorton Ubuntu tends to release with unreleased versions of packages though
 
@Quuxplusone it tells me that Macintosh HD is read-only in recovery mode.
 
coordinating it so that everything you care about has a sensible, stable release with long term support all in the same place at the same point in time is damn hard
 
@Radek hm.
mount -uw /...
suggests my friend
in other words, unmount Macintosh HD and remount it as writeable.
 
9:40 PM
Ugh, Mac HD. When I worked at the IT store here in town, we spent half the time deciding if it was the software or the hardware.
Anyone used NetBeans and Code::Blocks back to back?
 
@Quuxplusone how do I remount it? I just unmounted it.
 
@RadekSlupik are you working through a Linux environment?
 
Mac OS X recovery disk.
Terminal.
 
@awoodland of that I have no doubt.
 
Ah, gotcha. I may not want to jump in, I've only used Mac for a total of about 30 minutes in my life.
 
9:43 PM
I want to mount it and writable.
It's a unix system so it should be similar.
 
true, true. What does 'ls /dev/mnt' read for you?
 
Alright, my code now compiles with GCC and clang, the two I don't use. MSVC is a work in progress
 
"MSVC is a work in progress" lol
 
@Collin a device file. :P
 
ha. Should have guessed, give me two minutes here, let me refresh myself.
 
9:46 PM
oh, because MSVC10 doesnt have declval. Interesting that the compiler error makes no mention of that
 
They left out part of the lib?
 
I never know which device to mount.
 
@CollinBiedenkapp Most of the C++11 lib was added in MSVC11
 
MAN MOUNT ??
 
@MooingDuck, true. Is VC11 using C++0x? I am not sure
@RadekSlupik hang on, 'ls /dev'
 
9:48 PM
@MooingDuck Do they support variadic templates in vc11?
 
1>f:\code\utilities\exprtemplate\exprtemplate\main.cpp(47): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'msc1.cpp', line 1420)
1>   To work around this problem, try simplifying or changing the program near the locations listed above.
1>  Please choose the Technical Support command on the Visual C++
1>   Help menu, or open the Technical Support help file for more information
 
GCC or MSVC^?
oh
 
@Collin my HDD is /dev/disk0.
 
@RadekSlupik, right, so, 'mnt /dev/disk0 /home/disk0/'
or wait
even better
@RadekSlupik 'mnt /dev/disk0 /mnt/disk0'
the second arg is the location you want it mounted to, keep that in mind.
 
mnt: command notfound
 
9:50 PM
@KillianDS no
 
The mount command requires a file system.
 
1
Q: How do manually mount hard drive on mac?

sa125My mac recently gave up and I'm trying to salvage whatever data I can from the hard drive. I was able to boot using the OSX Installation CD and fire up Disk Utility that basically told me that the drive could not be repaired and I need to format it. My question - how can I manually mount it (from...

 
mount /dev/disk0 /mnt/disk0
 
I must specify a file system with -t.
 
9:51 PM
@CollinBiedenkapp VC10 has rvalues. That's... almost like supporting C++11.
 
@MooingDuck lol. I end up writing most of my stuff in darn near C, I just recently learned how amazing vectors are.
 
@CollinBiedenkapp VC11 will have the C++11 library, but (almost) no new language features
 
@MooingDuck figures.
@RadekSlupik, hold on. Linux is different than Mac here I think. Two seconds, let me look it up.
 
Anything done is C++ can be done in C.
 
@CollinBiedenkapp no wait, I checked, the new parts of the C++11 library are in VC12
 
9:53 PM
@JimNorton but the translation makes it butt ugly in most cases
 
@awoodland agreed
 
@JimNorton pretty much. I tend to find myself habitually using char*, not std::string, I only realized I could use a vector<char> as a buffer. I almost wet myself, that made multi-receive socket stuff so much easier.
and yes it does.
@MooingDuck ah, ok. I don't know where I read it (call me what you will), but I was informed that C++0x was only available for a fee? What is that?
 
I wish std::string and std::vector had "T* ::release()" members.
 
@CollinBiedenkapp there is no reason not to use std::string as a buffer, google's protobuf does it that way
 
@KillianDS, yeah, I am now doing that sort of stuff. Utilizing the stl stuff.
I will be honest, I came from .Net originally, where the * key is a sin.
After watching the exact same code consome 8MB of memory on Windows with a form (C++ still), to 220KB on Linux (no form), I exactly what some people hate .Net and why some love it
?
 
9:57 PM
You rarely need the * key in C++. You only need it to dereference std::unique_ptr, and for mutable/nullable references.
 
@ScottW thanks
 
true, true. I used it all the time in my C/C++ mixed code. I use it primarily for structs and buffers now.
 
@Collin I got it. mount -t hfs /dev/disk0 /Volumes/Macintosh\ HD
 
So, let me ask you guys this: do you all tend to organize things into namespaces/classes or seperate headers with descriptive names?
 
I'm about to cry. Trying to get a wheel of fortune "wheel" to spin and then slowly stop at a predetermined spot on the wheel while making it look realistic... can't just suddenly stop spinning on the predetermined spot. One would think you could simply calculate the number of degrees of rotation needed and apply some increasingly smaller number of degrees to move per frame so the wheel stops where it should slowly. But I'm having a heck of a time getting it correct.
 
9:59 PM
@CollinBiedenkapp why are they mutually exclusive?
 
I tend to organize my code into C headers and C files. :-)
I don't really write C++ much.
 
@awoodland Good point.
 

« first day (608 days earlier)      last day (4333 days later) »