Re: A safer File.readln

2017-01-25 Thread Jens Mueller via Digitalmars-d
On Wednesday, 25 January 2017 at 14:18:15 UTC, Andrei 
Alexandrescu wrote:

On 01/25/2017 12:58 AM, TheGag96 wrote:
On Monday, 23 January 2017 at 13:18:57 UTC, Andrei 
Alexandrescu wrote:

On 1/23/17 5:44 AM, Shachar Shemesh wrote:
If, instead of increasing its size by 100%, we increase it 
by a smaller
percentage of its previous size, we still maintain the 
amortized O(1)
cost (with a multiplier that might be a little higher, but 
see the trade

off). On the other hand, we can now reuse memory.


Heh, I have a talk about it. The limit is the golden cut,
1.6180339887498948482... The proof is fun. Anything larger 
prevents

you from reusing previously used space. -- Andrei


Andrei, could you link this talk? Thanks!


Not public. -- Andrei


Have you done measurements on the matter? Because I'm not sold on 
the idea. To me at this point this is just a theoretical 
observation. There are also arguments indicating it is less 
useful. Any numbers on how it affects e.g. memory usage?


Jens


Re: Always false float comparisons

2016-05-09 Thread Jens Mueller via Digitalmars-d
Walter Bright via Digitalmars-d wrote:
> Don Clugston pointed out in his DConf 2016 talk that:
> 
> float f = 1.30;
> assert(f == 1.30);
> 
> will always be false since 1.30 is not representable as a float. However,
> 
> float f = 1.30;
> assert(f == cast(float)1.30);
> 
> will be true.
> 
> So, should the compiler emit a warning for the former case?

Since

assert(f == 1.30f);

passes I find the root cause lies in the implicit type conversion from
float to double. Warning for those comparisons should be fine. Shouldn't
mix them anyway.
I wonder what's the difference between 1.30f and cast(float)1.30.

Jens


Re: Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-25 Thread Jens Mueller via Digitalmars-d
Mike Parker via Digitalmars-d wrote:
> On Monday, 25 April 2016 at 08:43:34 UTC, Jens Mueller wrote:
> >
> >More questions?
> >
> 
> I'll be getting out of the airport probably around 10:00 pm or so. I've seen
> online the subways run into the early am, but would I be better off grabbing
> a taxi at that time?

I assume you arrive at Tegel. Then you go by bus 109 to U
Jakob-Kaiser-Platz. This should be safe. I never heard of much crime in
that area of the city. From U Jakob-Kaiser-Platz you take the U7 (light
blue on the BVG maps) for about half an hour to U Grenzallee. So you
never leave the metro in between. The less safer places of the ride are
actually towards its end. That's my impression. But I'd say it's safe.

Nothing ever happened to me. Even when I went to the Berlin D meetups
(third Friday of a month at 7p.m.) to U Kottbusser Tor and back around
10p.m. Though Kottbusser Tor has a reputation for being unsafe.

Try to not look like a rich tourist. It's fine to carry a bag. Berliners
also travel and need to get home, too. Be careful when strangers
approach you to avoid pick pocketing. Not that this ever happened to me.

Jens


Re: Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-25 Thread Jens Mueller via Digitalmars-d
Walter Bright via Digitalmars-d wrote:
> On 4/25/2016 1:43 AM, Jens Mueller via Digitalmars-d wrote:
> 
> Thanks!
> 
> >More questions?
> 
> Does the AB ticket cover the subway as well as the bus?

It covers everything (metro/subway, urban railway, bus, trolley, ferry)
inside zone A and B for two hours.

Jens


Re: Directions to Ibis Hotel in Berlin from Tegel Airport

2016-04-25 Thread Jens Mueller via Digitalmars-d
Walter Bright via Digitalmars-d wrote:
> On 4/24/2016 10:56 AM, Iain Buclaw via Digitalmars-d wrote:
> >On 24 April 2016 at 10:44, Walter Bright via Digitalmars-d
> > wrote:
> >>The hotel emailed them to me, I presume they know what they're doing :-) so
> >>I thought I'd share:
> >>
> >>Bus 109 to Jakob-Kaiser-Platz
> >>Subway U 7 in the direction of Rudow to Grenzallee
> >>Cross the street at the traffic light and turn left. The next street on the
> >>right is Jahnstraße.
> >>On the left side you will find our hotel.
> >
> >Conveniently, also the directions to Berghain.  :-)
> >
> 
> What's the best way to buy a ticket? On the bus itself, or is there a kiosk?
> Credit card?

Buy an AB ticket from the driver or a ticket machine for 2.70 Euro in
cash. Don't forget to validate your ticket if you didn't buy it from a
bus driver.

Read on for more details.

When you enter the bus buy a ticket from the driver (only cash
preferably coins). See here
https://www.bvg.de/en/Tickets/Other-ways-to-buy/On-trams-and-buses
And keep your fingers crossed he speaks English. Say "AB ticket" see
below. These tickets are already validated.

If you use the metro it's usually convenient to use a ticket machine
(colored white and yellow with the letters BVG). They can be operated in
English.
https://www.bvg.de/en/Tickets/Other-ways-to-buy/At-ticket-machines
You have to punch these tickets yourself.

These are the single tickets
https://shop.bvg.de/index.php/group/73
You'll be fine with a "Single ticket Berlin AB" for 2.70 Euro from the
airport to you hotel. This is usually the ticket you buy for riding up
to two hours in the zones A and B. I'll guess you will never need a ABC
ticket.
https://shop.bvg.de/index.php/product/234/show/0/0/0/0/buy

You cannot pay by credit card. Only EC card which is like credit card
without credit.

You can buy four for 9.00 Euro but I believe not from a bus driver.

There are also day tickets. There are tourists tickets for up to 6 days.
Whether buying is makes sense depends on how often you are going to use
public transportation.
There are also short-trip tickets (up to 3 stations on the metro or
rail) - one for 1.70 Euro and four for 5.60 Euro. Might be convenient
for getting to the venue and back instead of a 20 minutes walk.

More questions?

Jens



Re: D Meetup in Berlin

2015-01-23 Thread Jens Mueller via Digitalmars-d
Andrej Mitrovic via Digitalmars-d wrote:
> On Thursday, 4 December 2014 at 12:57:59 UTC, Ben wrote:
> >Hi All,
> >
> >I am a Berlin based D developer who has been working with D for about 2
> >and a half years. Like other more well known names in these forums I work
> >for a company called Sociomantic.
> >
> >I am interested in organizing some meetups for D programmers in the nearby
> >area. The first of these will be very informal and involve a social
> >meeting at a cafe or bar to chat and gauge any interest in future events
> >and in what direction people think these should head. I was thinking of
> >arranging this for mid January next year but am very flexible on the
> >dates.
> >
> >Let me know if you are interested in taking part in this or any future
> >Berlin based events.
> >
> >Thanks,
> >Ben.
> 
> Just curious how many non-Sociomantics will show up in this meeting. Let us
> know in the replies (if you can) if you're coming! (non-obligatory to
> respond) :)

I'm non-Sociomantic and coming.

Jens


Re: GSOC Summer 2015 - Second call for Proposals

2014-11-05 Thread Jens Mueller via Digitalmars-d
Craig Dillabaugh via Digitalmars-d wrote:
> This is my second Call for Proposals for the 2015 Google Summer of
> Code. Anyone interested in mentoring, or who has good idea's for a
> project for 2015 please post here.  So far I have the following
> people who have expressed interest in mentoring:
> 
> Mentor's with specific projects in mind:
> 
> Mentor Project Area(s)
> Amaury Sechet (Deadalnix): SDC - D Compiler as a library
> Martin Nowak ARM Support and Bare Metal D
> Iain Buclaw  GDC
> 
> I have a pretty good set of specific idea's from Deadalnix, but I
> could use more specific project ideas for Martin and Iain.
> 
> A few others have volunteered to mentor, and have given general
> areas of interest, but I don't really have specific project
> suggestions from:
> 
> Andrei Alexandrescu   Phobos
> Rikki Cattermole  Web Development
> Russel Winder Phobos/QML: std.parallelism, std.benchmark
> Jacob Ovrum   std.i18n
> Jens Mueller  std.socket, std.log, std.benchmark,
> std.numeric.matrix

Remove std.log from that list (as it is almost finished by Robert).
I still mentor for improving std.socket (though I would need community
input from what the community likes to be changed (preferably though
issues.dlang.org)) and std.benchmark (together with Russel if he
wants to share the work), and still interested in having
std.numeric.matrix (I believe others too).
Arguably the descriptions on http://wiki.dlang.org/GSOC_2014_Ideas are
very short.



> A few other questions for the community (and possible mentors).
> 
> 1. I was thinking that as a way of making our idea's/mentor's lists
> to stand out I would like to post short Bio's on each mentor -
> pictures would be nice too, but maybe some potential mentors would
> be put off by that.  If possible I would also like to post a link to
> the mentor's talks at DConf (espcially if the talk is related to the
> project idea(s)).   This should set our idea's list apart from most
> I have seen so far.  Of course I would only post a bio/picture with
> the potential mentor's consent.

Fine with me.

> 2. I am supposed to have a backup GSOC administrator, in case I pass
> away unexpectedly or become otherwise incapacitated.  Any volunteers
> !
> 
> 3. We also should have backup mentors - if you feel comfortable
> serving as a backup mentor for one of the posted project ideas then
> please let me know.
> 
> 4. I am supposed to summarize our involvement and the successes and
> challenges of our participation for previous years, and  list our
> pass/fail rate for each year.  Can anyone on the forum fill me in on
> some of this information, especially if you have mentored in the
> past, or better yet are a past GSOC student still involved with D.

I believe you should get access to the past GSOC's on
http://www.google-melange.com/gsoc/homepage/google/gsoc2015?PageSpeed=noscript
Andrei should have access to these. You should find there everything.

I'd like to add that I firmly believe that we should strive for a short
list of important projects than a long list of anything. I say no more
than seven projects that the community likes to see addressed that allow
students getting involved in D. Make it few but exceptional strong.
It's fine to brainstorm now and cut down later. But I want to see that
cut down before polishing the project's description etc.

Thank you very much for the effort you are putting into it - invaluable.

Jens