Re: Creating a file in ~/.config (ubuntu)

2012-04-13 Thread Bystroushaak
Use std.path.expandTilde() -> http://dlang.org/phobos/std_path.html#expandTilde On 13.4.2012 18:02, Minas wrote: > I am trying to create a file in ~/.config > My code is: > > [code] > import std.stdio; > > void main() > { > auto f = File("~/.config/minas.txt", "w"); > } > [/code] > > Howeve

Re: Reading web pages

2012-01-22 Thread Bystroushaak
[Excepció: std.conv.ConvException@/usr/include/d2/4.6/std/conv.d(1640): Can't convert value `HTT' of type string to type uint] 2012/1/20 Bystroushaak: On 20.1.2012 18:42, Xan xan wrote: Thank you very much. I should invite you to a beer ;-) Write me if you will be in prag/czech republic

Re: Reading web pages

2012-01-21 Thread Bystroushaak
2012/1/20 Bystroushaak: On 20.1.2012 18:42, Xan xan wrote: Thank you very much. I should invite you to a beer ;-) Write me if you will be in prag/czech republic :) For the other hand, I get this error: [Excepció: std.conv.ConvException@/usr/include/d2/4.6/std/conv.d(1640): Can't convert valu

Re: Reading web pages

2012-01-20 Thread Bystroushaak
On 20.1.2012 18:42, Xan xan wrote: Thank you very much. I should invite you to a beer ;-) Write me if you will be in prag/czech republic :) For the other hand, I get this error: [Excepció: std.conv.ConvException@/usr/include/d2/4.6/std/conv.d(1640): Can't convert value `HTT' of type string

Re: Reading web pages

2012-01-20 Thread Bystroushaak
rawWrite(): stdout.rawWrite(cast(ubyte[]) navegador.get(a)); On 20.1.2012 18:18, Xan xan wrote: Mmmm... I understand it. But is there any way of circumvent it? Perhaps I could write to one file, isn't? 2012/1/20 Bystroushaak: Thats because you are trying writeln binary data, and th

Re: Reading web pages

2012-01-20 Thread Bystroushaak
/std/conv.d(1640): Can't convert value `HTT' of type string to type uint] The code: //D 2.0 //gdmd-4.6 => surt el fitxer amb el mateix nom i .o //Usa https://github.com/Bystroushaak/DHTTPClient import std.stdio, std.string, std.conv, std.stream; import std.socket, std.sockets

Re: Reading web pages

2012-01-20 Thread Bystroushaak
in this case: image/png Here is full example: https://github.com/Bystroushaak/DHTTPClient/blob/master/examples/download_binary_file.d On 20.1.2012 18:00, Bystroushaak wrote: It is unlimited, you just have to cast output to ubyte[]: std.file.write("logo3w.png", cast(ubyte[])

Re: Reading web pages

2012-01-20 Thread Bystroushaak
It is unlimited, you just have to cast output to ubyte[]: std.file.write("logo3w.png", cast(ubyte[]) cl.get("http://www.google.cz/images/srpr/logo3w.png";)); On 20.1.2012 17:53, Xan xan wrote: Thank you very much, Bystroushaak. I see you limite httpclient to xml/html

Re: Reading web pages

2012-01-20 Thread Bystroushaak
First version was buggy. I've updated code at github, so if you want to try it, pull new version (git pull). I've also added new example into examples/user_agent_change.d On 20.1.2012 16:08, Bystroushaak wrote: There are two ways: Change global variable

Re: Reading web pages

2012-01-20 Thread Bystroushaak
There are two ways: Change global variable for module: dhttpclient.DefaultHeaders = dhttpclient.IEHeaders; // or your own This will change headers for all clients. --- Change instance headers: string[string] my_headers = dhttpclient.FFHeaders; // there are more headers than just User-Agent

Re: Reading web pages

2012-01-20 Thread Bystroushaak
This module is very simple, only for HTTP protocol, but there is way how to add HTTPS: public void setTcpSocketCreator(TcpSocket function(string domain, ushort port) fn) You can add lambda function which return SSL socket, which will be called for every connection. FTP is not supported - i

Re: Reading web pages

2012-01-20 Thread Bystroushaak
Client' spider.o:(.data+0x24): undefined reference to `_D11dhttpclient12__ModuleInfoZ' collect2: ld returned 1 exit status with the file spider.d: //D 2.0 //gdmd-4.6 => surt el fitxer amb el mateix nom i .o //Usa https://github.com/Bystroushaak/DHTTPClient import std.stdio, std.string

Re: Reading web pages

2012-01-19 Thread Bystroushaak
You can always use my module: https://github.com/Bystroushaak/DHTTPClient On 19.1.2012 20:24, Timon Gehr wrote: On 01/19/2012 04:30 PM, Xan xan wrote: Hi, I want to simply code a script to get the url as string in D 2.0. I have this code: //D 2.0 //gdmd-4.6 import std.stdio, std.string

Re: MX records

2012-01-15 Thread Bystroushaak
Bump with tits: (o )( o) On 5.1.2012 23:00, Bystroushaak wrote: Hi. Is there any way how to get MX records for given domain? I don't want to implement whole RFC 1034/5. I've looked at std.net.isemail, but it doesn't looks like what I need :/

MX records

2012-01-05 Thread Bystroushaak
Hi. Is there any way how to get MX records for given domain? I don't want to implement whole RFC 1034/5. I've looked at std.net.isemail, but it doesn't looks like what I need :/

Re: Download file via http

2011-12-18 Thread Bystroushaak
I've created HTTP client module. It's just http module, no cookies, no https, so if you need something small, try it. https://github.com/Bystroushaak/DHTTPClient On 13.12.2011 18:29, Kai Meyer wrote: > I've been trying to modify the htmlget.d example for std.socketstre

Re: Restrict access to "critical" functions

2011-12-18 Thread Bystroushaak
Yep. Useful google dork: sandbox. On 14.12.2011 19:55, mta`chrono wrote: > Maybe you should use a VM to run your restricted applications. Or have a > look a chroot, dchroot or schroot, to setup such stuff. The Programming > Language will not help you in this case!

Re: IDE with renaming possibility

2011-11-10 Thread Lishaak Bystroushaak
I'm using linux too. I tried all IDEs for D, but all of them was pretty lame, so I'm using Kate/Geany. > I don't find an important feature: renaming variables/functions/etc. BTW: It's called refactoring.

Re: Formatted date

2011-11-04 Thread Lishaak Bystroushaak
Oh, ok, thanks for your answer. 2011/11/4 Jonathan M Davis : > On Thursday, November 03, 2011 16:58 Lishaak Bystroushaak wrote: >> Hello. >> >> Is there any way how to format date with formating strings? Something >> like strftime in python; >> http://docs

Formatted date

2011-11-03 Thread Lishaak Bystroushaak
Hello. Is there any way how to format date with formating strings? Something like strftime in python; http://docs.python.org/library/datetime.html#strftime-and-strptime-behavior