August 09, 2014
On Saturday, 9 August 2014 at 02:53:34 UTC, Era Scarecrow wrote:
>  But naturally before i can do anything i need to re-familiarize myself with Git and GitHub... and immediately remember why i pretty much rage-quit 18 months ago...
>
>  Is there anyone who i can refer to via IM/PM or some quick method when i start using this stuff to get it sorted out (rather than these forums)?
>
>  Although it's pretty likely i'll either start a brand new fork/repository of phobos or destroy my current saved changes (commits, fixes, everything) as they will be a pain to figure out since i never could get it to work last time... even after i rebased it last time...

I am not a heavy github user and I use git basically only for myself and collaboration outside my workplace (there, we use the "professional" ClearCase...), but for git, I could recommend you these resources:

https://rogerdudler.github.io/git-guide/
https://try.github.io/levels/1/challenges/1

If you have at least 30 minutes to read about git, then this:

http://git-scm.com/book/en/Getting-Started-Git-Basics

About branching (but a bit complex) for large projects, there is this much acclaimed resource:

http://nvie.com/posts/a-successful-git-branching-model/

But that may wait till later.

One word of caution about git: once you learn it, you'll pretty much dump anything else and you'll become addicted to it to the point that you'd dream to git-ify all your projects and stuff. Personal experience speaking here. I went through CVS (just a little), then quite heavily SVN (wow, what a wonder, I thought!), had an attempt at bazaar...

All these were missing one crucial feature at that time and, one day, I stumbled upon git (I was avoiding git on purpose, just to not join the acclaiming chorus) and had the "a-ha" moment. I have found it. The feature was:

"so I can change the version of the code that I work on without having to change my folder, paths, put in plae symbolic links for my IDE and stuff? It takes just a 'git checkout the_other_branch' and it is exactly at the point where I did left it? and I am able to switch branches for just 2 minutes, every 3 minutes, just to compare results and so on? WOW!"

I forgot how the world was looking before the advent of git. I forgot on purpose.
August 09, 2014
On Saturday, 9 August 2014 at 07:12:45 UTC, eles wrote:
> On Saturday, 9 August 2014 at 02:53:34 UTC, Era Scarecrow wrote:

> "so I can change the version of the code that I work on without having to change my folder, paths, put in plae symbolic links for my IDE and stuff? It takes just a 'git checkout the_other_branch' and it is exactly at the point where I did left it? and I am able to switch branches for just 2 minutes, every 3 minutes, just to compare results and so on? WOW!" (*)

(*) yes, there is a cobazaar or some plugin like that for bazaar, but basically they try to replicate what is for me the truest feature of git (yes, I am aware of its power, but this one is *the* feature).
August 09, 2014
On Saturday, 9 August 2014 at 07:12:45 UTC, eles wrote:
> I am not a heavy github user and I use git basically only for myself and collaboration outside my workplace (there, we use the "professional" ClearCase...), but for git, I could recommend you these resources:

 I'm watching a few tutorials on GitHub and i have a book on Git. Still doesn't explain about the problems i had. I'm sure Git will sink into my brain very soon at the rate i'm consuming the material.

 Clearcase... i remember that... used it once...

> One word of caution about git: once you learn it, you'll pretty much dump anything else and you'll become addicted to it to the point that you'd dream to git-ify all your projects and stuff.

 Yeah thought about that myself. Most of my personal project are 'duplicate the entire directory and rename the new one to reflect the version' and use diff and patch... it works... although it's not pretty and uses a lot of space... thankfully 7zip does a good job compacting all of them together.

> All these were missing one crucial feature at that time and, one day, I stumbled upon git (I was avoiding git on purpose, just to not join the acclaiming chorus) and had the "a-ha" moment. I have found it. The feature was:
>
> "so I can change the version of the code that I work on without having to change my folder, paths, put in plae symbolic links for my IDE and stuff? It takes just a 'git checkout the_other_branch' and it is exactly at the point where I did left it? and I am able to switch branches for just 2 minutes, every 3 minutes, just to compare results and so on? WOW!"
>
> I forgot how the world was looking before the advent of git. I forgot on purpose.

 Things will be easier when it clicks for me i'm sure. Re-reading part of the book, a portion of it, the designs behind Git makes sense, but there's no 'ah ha!' moment, not yet. I think mostly it's the terminology i'm confused on since i'm often a blank state (self taught).

 I'm seriously tempted to set up a VM or separate machine with a linux distro and programming environment. My main computer doesn't feel like a programming station anymore.
August 09, 2014
On Saturday, 9 August 2014 at 07:21:28 UTC, Era Scarecrow wrote:
> On Saturday, 9 August 2014 at 07:12:45 UTC, eles wrote:

>  Things will be easier when it clicks for me i'm sure. Re-reading part of the book, a portion of it, the designs behind Git makes sense, but there's no 'ah ha!' moment, not yet. I think mostly it's the terminology i'm confused on since i'm often a blank state (self taught).


That's because many git tutorial start with praising its distributed repository model and bragging about why that feature is cool (which is very true, but it is confusing for beginners). Ignore that part for the time being, it will click in later.

For now, just consider that your current folder has some source code in it and that executing

$ git init

it transforms it in a "git-managed project". That's all

$ git add -A
$ git commit -m "added files"

will add all files to that project (why two commands, it will become clear later)

$ git branch test_idea01
$ git checkout test_idea01

will put you in a new git-subproject (also known as "branch") called "test_idea01" where you wan to test your new idea

Subsequent

$ git add -A
$ git commit -m "these modifications are added to the test_idea01 subproject"

will add modifications to the test_idea01 subproject.

once you finish with test_idea01, you go back to the original state with:

$ git checkout master

(the initial sub-project in git it is just called "master")

and start, maybe, a new idea with:

$ git branch test_idea02
$ git checkout test_idea02

then etc., then back to the original to master

This will allow you to switch between several versionas and to test them in the same folder, with all the rest on your computer being equal.

Then, you will discover merging (you could bring the modifications from test_idea01 and test_idea02 back t master) and so on, but to start, this is it.

It will succesfully replace your archive-and-rename strategy.

Not to even tell that

$ git diff master test_idea01

will give you a nice view of the differences...
August 09, 2014
On Saturday, 9 August 2014 at 07:48:28 UTC, eles wrote:
> On Saturday, 9 August 2014 at 07:21:28 UTC, Era Scarecrow wrote:
>> On Saturday, 9 August 2014 at 07:12:45 UTC, eles wrote:

> will give you a nice view of the differences...

Oh, yes, and your subprojects "master", "test_idea01" and "test_idea02" won't be lost.

You could bring any of them back to life in the current folder by executing:

$ git checkout <subproject name here>

and start from where you left it.

Just note that no longer need the command

$ git branch <subproject name here>

if the subproject (well, maye i should be called "version" or something like that, but the proper name is "branch") already exists.
August 09, 2014
On Saturday, 9 August 2014 at 07:48:28 UTC, eles wrote:
> That's because many git tutorial start with praising its distributed repository model and bragging about why that feature is cool (which is very true, but it is confusing for beginners). Ignore that part for the time being, it will click in later.

 Yeah, when it starts getting into non-changing data the SHA1 and 160bit hashing makes perfect sense, even for identifying renamed/moved files based on how much matching code they have.

 I understand every line you entered because i just ended up watching 2-3 hours of Github help videos regarding the various features, otherwise i'd be completely lost, even with a book to guide me. But perhaps what we lack is sorta this nice introduction into D using GitHub. My first experience is still very jarring.



 I'd like to see offered a standard environment i can download and run as a LiceCD on a VM that contains all the tools and everything ready-to-use. Recommended or ready-to-use doesn't mean it's the only way to use it :P

 Course i'd also like to see some videos. Andrei and Walter talking about phobos and the approaches to design and why they took various directions. Talking about how to use phobos, and the various tools or development steps to contribute. Sure you can read from the documentation but sometimes a good explanation of why things are named or how they are named and their use would make it a lot easier as a type of tutorial of the library and language.

 I believe Channel-9's videos on the C++ STL taught me more of how to use it than i could get from a book due to the huge jarring and confusing differences between C and C++'s approach to it. I'd hope Facebook or Google could provide a public green-room where some of these informational videos could be captured.

 Of course i'd also like to see Richard Stallman give his blessing and provide some of his skills and support as well. But most of this is wishful thinking...
August 09, 2014
On Saturday, 9 August 2014 at 09:15:10 UTC, Era Scarecrow wrote:
> and run as a LiceCD on a VM that contains all the tools and

  LiveCD LIVE!!!.... Wish i had an edit button for quick edits...
August 09, 2014
On Friday, 8 August 2014 at 22:43:38 UTC, Andrei Alexandrescu wrote:
> On 8/7/14, 12:40 PM, Era Scarecrow wrote:
>>  As for being able to find x number of bits that are 0 or 1 in a row, that both sounds easy and hard at the same time (easy if you don't mind it being slow). In my rewrite there was a bulk template I created that was intended to do huge speedups with binary data (when the data was naturally aligned correctly and large enough to use the binary operators on normal types). Some of the unittests and example code also used them in a read-only fashion that could be specialized for finding a certain type of pattern...
>
> A thought: if whatever work on bit arrays you do isn't fast, it's probably not worth doing; people who opt for that kind of packing are most often performance motivated.
>
> Alignment is often not an issue - you handle the setup/teardown misalignments separately and to the bulk 64 bits at a time.

What kind of performance are you looking for? I have some very basic bit-manipulation code written in C++ that operates on whole words at a time, not sure if it's what you need but if it is then it should be trivial to port this to D:

template<class Diff, class It>
It setbits(It i, Diff j, Diff n)
{
	typedef typename std::iterator_traits<It>::value_type T;
	T ones = static_cast<T>(~T());
	Diff const bits = static_cast<Diff>(sizeof(*i) * CHAR_BIT);
	i += j / bits;
	j %= bits;
	if (j)
	{
		*i |= (ones << j) &
			(ones >> max(0, static_cast<int>(bits - j - n)));
		++i;
		n -= min(n, bits - j);
	}
	fill_ni, n / bits, ones);
	i += static_cast<ptrdiff_t>(n / bits);
	n %= bits;
	if (n)
	{
		*i |= ones >> max(0, static_cast<int>(bits - n));
		++i;
	}
	return i;
}
August 09, 2014
On Saturday, 9 August 2014 at 09:34:38 UTC, Mehrdad wrote:
> On Friday, 8 August 2014 at 22:43:38 UTC, Andrei Alexandrescu wrote:
>> Alignment is often not an issue - you handle the setup/teardown misalignments separately and to the bulk 64 bits at a time.
>
> What kind of performance are you looking for? I have some very basic bit-manipulation code written in C++ that operates on whole words at a time, not sure if it's what you need but if it is then it should be trivial to port this to D:

 Glancing at it, it looks like it would probably do what i'd want. Although i'd have to study it closer while converting it. But these would probably only take effect when you have at least a certain number of bits or more to make it worth it. Probably as a guess, 8 bits or more.

 Most of the speedup would probably be seen while doing matrix operations. Still if they don't align perfectly the penalty based on that C++ algo is probably 8x-64x slower (mostly do to modulus/division, if it's a power of 2 than it drops to 4x-8x slower) but it would be considerably faster than doing each bit individually.
August 09, 2014
On Saturday, 9 August 2014 at 09:34:38 UTC, Mehrdad wrote:
> (snip)

Sorry, just to clarify, that was just one example of what I had, not the only one. I also have another (monstrous) function

long long GetRunLength(
	void const *bitmap, unsigned long long bitmap_bits,
	long long start, long long end,
	bool reverse, /*out*/ bool *bit);

but before I'd post it I'd need to make sure it's bug-free (I even SIMD'd this one at one point, but it's been a long time since I last used it and I don't remember if it's buggy or not, so I'd have to check first). If these are the types of bit operations you're looking for let me know if you're interested and I can try to fix any bugs in my implementation and post them here so you can port them to D.