another code sample
Aug. 11th, 2014 06:06 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
def parameters(href): Map[String, String] = href split("\\?",2) toList match { case url::params::Nil => params.split("&") map (_ split "=" toList) collect { case k::v::Nil => k->v } toMap case otherwise => Map.empty }
Or?...
no subject
Date: 2014-08-12 04:27 am (UTC)also & will break everything
I'd suggest to use URL from Apache HttpClient.
no subject
Date: 2014-08-12 04:31 am (UTC)And I despise the whole Apache HttpClient anyway.
no subject
Date: 2014-08-12 04:34 am (UTC)as for & - this is a valid code block for encoding the ampersand in the parameter name or value.
no subject
Date: 2014-08-12 05:06 am (UTC)no subject
Date: 2014-08-13 01:00 am (UTC):)
no subject
Date: 2014-08-12 04:32 am (UTC)no subject
Date: 2014-08-12 05:44 am (UTC)Только без "to". Можно говорить "suggest (you) use" или "suggest using", а "suggest to use" -- нельзя.
Я это говорю только потому, что когда исправляют, лучше запоминается.
no subject
Date: 2014-08-12 09:45 pm (UTC)no subject
Date: 2014-08-12 08:53 pm (UTC)no subject
Date: 2014-08-12 09:13 pm (UTC)no subject
Date: 2014-08-12 10:29 pm (UTC)which you functionalistz are (very) usually tend to fall into
everything is to be sacrificed to the that notorious "expressiveness" again
PS even if you're personally very aware of what exactly is going on in this particular case and are pretty 100% sure that the data structures won't exceed the reasonable size of that 1K (and the number of that stuff processed in parallel would also be reasonable) - it is STILL a wicked thinking
no subject
Date: 2014-08-12 11:37 pm (UTC)no subject
Date: 2014-08-13 12:21 am (UTC)no subject
Date: 2014-08-13 01:07 am (UTC)no subject
Date: 2014-08-13 01:56 am (UTC)no subject
Date: 2014-08-13 11:38 am (UTC)no subject
Date: 2014-08-12 09:37 pm (UTC)not sure how lazy the "split" thing is in scala. the sample goes through all iterators sequentially
no subject
Date: 2014-08-12 10:18 pm (UTC)so, that happened to be the full copy of data, no reuse
no subject
Date: 2014-08-12 11:05 pm (UTC)no subject
Date: 2014-08-13 12:24 am (UTC)no subject
Date: 2014-08-13 12:30 am (UTC)no subject
Date: 2014-08-13 12:47 am (UTC)