Re: What is the best practice of organization multi-threading ?

2015-03-16 Thread Suliman via Digitalmars-d-learn
Ali, please add text above to your book!

Re: What is the best practice of organization multi-threading ?

2015-03-16 Thread Suliman via Digitalmars-d-learn
Ali, again big thanks for your book, without it I was not able how to work with D. But for me now absolutely clear what difference between: auto theTask = task(someFunction); and: auto theTask = task!anOperation();

What is the best practice of organization multi-threading ?

2015-03-15 Thread Suliman via Digitalmars-d-learn
I have App that read config sections. If the section is true I want to run it in new thread. if (parseconfig.obsmpplots_load == true) { auto obsmpplots = new ObsmpPlots(db); auto theTask = task(obsmpplots.getPlots);

Need help to understand how to work with tkd

2015-02-18 Thread Suliman via Digitalmars-d-learn
Now I am trying to learn how to build GUI apps in D. But I have some troubles. http://code.dlang.org/packages/tkd 1. I can't understand how to set window size in example on page above. I looked at docs and found only how to create new window. But here I do not see any procedure that create

Re: Need help to understand how to work with tkd

2015-02-18 Thread Suliman via Digitalmars-d-learn
For my regret I need example to understand how to work with шею Could you show me at last passing fileToOpen to another instance?

Re: Why uniq do not work with array of strings?

2015-02-16 Thread Suliman via Digitalmars-d-learn
Oh I understood. It's means that it work only of two or more element's is placed one after one?

Why uniq do not work with array of strings?

2015-02-16 Thread Suliman via Digitalmars-d-learn
The question appear here http://stackoverflow.com/questions/28546572/how-to-find-duplicates-in-array-of-strings-in-d I can't understand, why uniq work for array of int but do not work with array of strings. int[] arr = [ 1, 2, 2, 2, 2, 3, 4, 4, 4, 5 ]; writeln(uniq(arr));

Re: Why uniq do not work with array of strings?

2015-02-16 Thread Suliman via Digitalmars-d-learn
Iterates unique - _consecutive_ - elements of the given range Could you explain what does it's mean? I do not understand what is _consecutive_ mean in this content... and why it's not work with strings...

Re: Dub hanging for a long time

2015-02-07 Thread Suliman via Digitalmars-d-learn
I do not use antivirus. It's floated error. I can't reproduce it. But sometime it's appears again.

Dub hanging for a long time

2015-02-07 Thread Suliman via Digitalmars-d-learn
Several times I encounter problem when DUB is hanging for a long time It's look like that when I tun DUB from folder of current project it's do not show me nothing, just move cursor on next line for a long time. http://img.ctrlv.in/img/15/02/07/54d5c37f6d3c3.png running dub from any other

Re: D + Solaris

2015-02-05 Thread Suliman via Digitalmars-d-learn
ldc supports solaris/x86 but druntime/Phobos support will most likely be lacking what does it's mean? It is not fully work or what?

D + Solaris

2015-02-05 Thread suliman via Digitalmars-d-learn
My next job will be related with prorgamming under Solaris. I dont know version but suppose it will be something pretty out of date. Once i had seen topic about D and Solaris, but i want to ask if D solaris version is ready for production or it is alpha? Does anybody have experience with it?

Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
I need to compare to DateTime. I looked at docs and found opCmp for DateTime type. The problem is that I can't understand how to use it. http://dlang.org/phobos/std_datetime.html#DateTime opCmp(in DateTime rhs); what is rhs? I am trying to do something like this: if( DateTime.opCmp(dtindb,

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
+ n.days solved my problem.

Re: Can't understand how to compare DateTime with opCmp

2015-02-01 Thread Suliman via Digitalmars-d-learn
Thanks! Could anybody say how can I use roll if I need to date to date. For example I need to plus: DateTime currentdt = cast(DateTime)(Clock.currTime()); with another DateTime var foo.

Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds

2015-01-30 Thread Suliman via Digitalmars-d-learn
foreach(f; files)) { if (canFind(to!string(f), )) { writeln(whitespace found:); writeln(f); Thread.sleep( dur!(msecs)( 50 ) ); // sleep for 50 milliseconds }

Does anybody work on std.net.curl?

2015-01-28 Thread Suliman via Digitalmars-d-learn
Just interesting is there any plans to replace net.curl on native lib? I mean not plans for long future, but some stuff on which somebody active work?

Re: vibe.d error

2015-01-27 Thread Suliman via Digitalmars-d-learn
Try to update dub. There was issue in old version with path with whitespace.

Re: Extracting Structure from HTML using Adam's dom.d

2015-01-26 Thread Suliman via Digitalmars-d-learn
On Sunday, 25 January 2015 at 22:14:09 UTC, Adam D. Ruppe wrote: On Sunday, 25 January 2015 at 21:24:06 UTC, Suliman wrote: I need extract data inside rel (somedata) string s = element.rel; Do you mean something like this? string s = element.rel; foreach(row;

Re: Extracting Structure from HTML using Adam's dom.d

2015-01-26 Thread Suliman via Digitalmars-d-learn
On Monday, 26 January 2015 at 17:24:23 UTC, Adam D. Ruppe wrote: On Monday, 26 January 2015 at 17:17:55 UTC, Suliman wrote: Do you mean something like this? I just mean to get the value of the rel=something attribute, use element.rel; assert(element.rel == something); The element is the

Re: crash on args.getopt

2015-01-25 Thread Suliman via Digitalmars-d-learn
But is it good practice to fail with exception during passing unknown parameters? Maybe std.getopt.config.passThrough should be as default? I really can't remember Apps that crush if pass to in unknown parameters.

Re: Extracting Structure from HTML using Adam's dom.d

2015-01-25 Thread Suliman via Digitalmars-d-learn
Adam, I understood how to select URLs, but how extract values of attributes from such selection? a href=/ class=post-tag title=show questions tagged 'javascript' rel=somedata I need extract data inside rel (somedata)

Re: crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
Look for Passing unrecognized options through in the documentation. Oh I see, but first part of question is still actual. And also what is benefits of using getopt instead of parsing args[] manually?

crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
First of all it's seems bug in docs: void main(string[] args) { getopt( args, length, length,// numeric file,data, // string verbose, verbose, // flag color, color);// enum ... } with args inside getopt I am getting:

Re: crash on args.getopt

2015-01-24 Thread Suliman via Digitalmars-d-learn
Ali, you are right it's my error: getopt( args, and I did: args.getopt ( args, Am I right understand that args in args.getopt is UFCS syntax style?

Re: Extracting Structure from HTML using Adam's dom.d

2015-01-22 Thread Suliman via Digitalmars-d-learn
Adam, please add more simple docs about your parser on site. Also it would be perfect to create dub, for easier including parser to project.

Why foreach do not print value during every single Insert request in SQL?

2015-01-15 Thread Suliman via Digitalmars-d-learn
void IMGsInsert(string [] fullimgurl) { foreach (url; fullimgurl) { string sqlinsert = (sqlrequest) writeln(sqlinsert);

Re: How to interface with C++ code or dll?

2015-01-12 Thread Suliman via Digitalmars-d-learn
Thanks for detail answer. I stopped at error: source\cpl_vsi.d(70): Error: module stat is in file 'std\c\stat.d' which cannot be read I do not know where I can find this module. If someone wan't to attempt to create binding, or finish my here is link of my half-done job

How to interface with C++ code or dll?

2015-01-11 Thread Suliman via Digitalmars-d-learn
I am trying to understand how to use C++ lib from D. For my App I need http://www.gdal.org I had read about using C++ libs from D, and understood that there is 2 ways: 1. Make binding - convert .H to .d (I still do not fully understand what is it) 2. Use directly C++ lib (.dll) I decided to

Re: Error: function declaration without return type.

2015-01-07 Thread Suliman via Digitalmars-d-learn
thanks! Am I right understand that in next code scope(exit) stmt.close(); occur after this execution? And it will close connection so stmt in function become unavailable. this(parseConfig parseconfig) { [] auto conn = ds.getConnection();

string concatenation with %s

2015-01-07 Thread Suliman via Digitalmars-d-learn
I need to construct complex SQL request, like: string sql = (INSERT INTO test.geomagnetic (`date`, `a_fredericksburg`, `fredericksburg`, `a_college`, `college`, `a_planetary`, `planetary`) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s');, date[i], a_fredericksburg[i], fredericksburg[i],

Re: string concatenation with %s

2015-01-07 Thread Suliman via Digitalmars-d-learn
Please show the _clean_ input, followed by an output example. Bye, bearophile to prevent visual corruption I had past it here: http://www.everfall.com/paste/id.php?ftzy9lxr6yfy Just FYI use prepared statements instead of string concatenation for SQL queries. You mean some tools, that

Re: string concatenation with %s

2015-01-07 Thread Suliman via Digitalmars-d-learn
std.string.format interpolates string with the same behavior as writefln Thanks!

Re: Error: function declaration without return type.

2015-01-06 Thread Suliman via Digitalmars-d-learn
On Tuesday, 6 January 2015 at 21:19:38 UTC, bearophile wrote: Suliman: void foo() { writeln(test); writeln(mystring); } foo(); } I guess you have to remove that line. Bye, bearophile Why? I can't call function in instance of class?

Error: function declaration without return type.

2015-01-06 Thread Suliman via Digitalmars-d-learn
class Test { string mystring; this(string mystring) { this.mystring = mystring; } void foo() { writeln(test); writeln(mystring); } foo(); } source\app.d(303): Error: function declaration

Re: How to create instance of class that get data from 2 another instance?

2015-01-04 Thread Suliman via Digitalmars-d-learn
Ali, thanks for example, I understood it, but I am still can't understand how to write code above without passing this as parameter...

Re: How to create instance of class that get data from 2 another instance?

2015-01-04 Thread Suliman via Digitalmars-d-learn
On Sunday, 4 January 2015 at 15:37:53 UTC, Suliman wrote: Ali, thanks for example, I understood it, but I am still can't understand how to write code above without passing this as parameter... But now I think that possible is mess architecture of app if I meet such problem...

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
I think it's fine to have a global config instance. Alternatively you can pass the config to both the seismoDownlead and MySqlWhatever classes. // there ist enforce(cond, msg) for this in std.exception/std.conv, dunno. if (!exists(confpath)) throw new Exception(ERROR: config.ini do not

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
class parseConfig { string dbname; string dbuser; string dbpass; string dbhost; string dbport; uint status; this() { auto checkLinkCode(string link) // we need to check all links to be sure if they are alive { return

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
Thanks! I will try! D is my first compilable language, I wrote only some scripts without OO before. So in my case your suggestion is best practice? Or there is any more simple way to pass config and data to MySQL class?

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
Anything declared in main() is local to main and not a global. Ok! So I need create multiple instances of the parseconfig? Or please suggest me any solution, I really can't understand how to be in such situation...

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
Oh mama mia! I did it! http://www.everfall.com/paste/id.php?a5pp73ns1e4k auto seismodownload = new seismoDownload(emsc_csem, this); then: auto mysql = new MySQL(parseconfig,eqs); So could anybody show me better way? As I said I did not fully understand how use global class instance...

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
I looked at my code and it's seems that I can create instance of MySQL in main. void main() { auto parseconfig = new parseConfig(); auto mysql = new MySQL(parseconfig, seismodownload); } In parseConfig I am creation instance of seismoDownload: class parseConfig { if

Re: How to create instance of class that get data from 2 another instance?

2015-01-02 Thread Suliman via Digitalmars-d-learn
What I am doing wrong? http://www.everfall.com/paste/id.php?iwh4qdcqv6zi Well, there's no `parseconfig` there. Do you expect the `parseconfig` from line 30 or line 193 to be available in line 170? From line 30. In line 193 I am get in instance of class instance of parseconfig to be able

function ... is not callable using argument types

2015-01-01 Thread Suliman via Digitalmars-d-learn
I need to pass some config to ddbc driver. When I use static const all work ok. static const string PGSQL_UNITTEST_HOST = localhost; static const intPGSQL_UNITTEST_PORT = 5432; static const string PGSQL_UNITTEST_USER = postgres; static const string PGSQL_UNITTEST_PASSWORD = Infinity8;

Re: function ... is not callable using argument types

2015-01-01 Thread Suliman via Digitalmars-d-learn
But why variant: static const int PGSQL_UNITTEST_PORT = 5432; do not require of implicit convert to!short() at connection string?

Re: Need example of usage DerelictPQ

2014-12-28 Thread Suliman via Digitalmars-d-learn
Adam, I trying to build simple app: import std.stdio; import postgres; import database; void main() { auto db = new PostgreSql(dbname = test2); foreach(line; db.query(SELECT * FROM customer)) { writeln(line[0], line[customer_id]); } } and getting next

Need example of usage DerelictPQ

2014-12-24 Thread Suliman via Digitalmars-d-learn
Could anybody provide any simple examples of usage DerelictPQ. I do not have experience of C, and I can't understand how to use this driver. I need just basics like connect, select and insert. http://code.dlang.org/packages/derelict-pq thanks!

Re: Need example of usage DerelictPQ

2014-12-24 Thread Suliman via Digitalmars-d-learn
I have done next: string connString = psql -h localhost -p 5432 -U postgres -d testdb; package PGconn* conn; @property bool nonBlocking(){ return PQisnonblocking(conn) == 1; } this(parseConfig parseconfig) { void connect() {

Re: Need example of usage DerelictPQ

2014-12-24 Thread Suliman via Digitalmars-d-learn
On Wednesday, 24 December 2014 at 14:08:53 UTC, Adam D. Ruppe wrote: I haven't used the derelict version but I have used the C library itself and wrapped it briefly in my postgres.d here: https://github.com/adamdruppe/arsd/blob/master/postgres.d Thanks! But few questions: 1. how to build it

Re: Need example of usage DerelictPQ

2014-12-24 Thread Suliman via Digitalmars-d-learn
DerelictPQ is only a binding to libpq. The only difference is the DerelictPQ.load method. Just follow the libpq documentation. http://www.postgresql.org/docs/9.1/static/libpq.html Actually, Derelict binds to version 9.3, so the proper link should be

Why call function rise exception?

2014-12-20 Thread Suliman via Digitalmars-d-learn
The problem with 31 string. http://www.everfall.com/paste/id.php?jgsdz7mdbrnm If I uncomment it, and server response is return 404 code I code at runtime throw exception with text: Can't parse config: HTTP request returned status code 404 I thought that checkLinkCode is throw any king

Re: Why call function rise exception?

2014-12-20 Thread Suliman via Digitalmars-d-learn
Oh sorry I understood where problem.

Re: SQLLite driver

2014-12-14 Thread Suliman via Digitalmars-d-learn
There is also a branch named `develop` which at least compiles, maybe it is usable. how to add to dub this branch?

Re: SQLLite driver

2014-12-14 Thread Suliman via Digitalmars-d-learn
On Sunday, 14 December 2014 at 13:33:27 UTC, Suliman wrote: There is also a branch named `develop` which at least compiles, maybe it is usable. how to add to dub this branch? Compiling using dmd... Linking... OPTLINK (R) for Win32 Release 8.00.15 Copyright (C) Digital Mars 1989-2013 All

Re: scope block do not handle failure, but try-catch does

2014-12-13 Thread Suliman via Digitalmars-d-learn
If I right understand scope is not good for checking if one of function is fail. For example: string dbpass = config.getKey(dbpass); string dbpass = config.getKey(dbpass); string dbhost = config.getKey(dbhost); string dbport = config.getKey(dbport); if I will try to add scope(failure)

Re: scope block do not handle failure, but try-catch does

2014-12-13 Thread Suliman via Digitalmars-d-learn
I reread docs and understood that scope not for such case. Next code is do what I need: try { string dbname = config.getKey(dbname); string dbpass = config.getKey(dbpass); string dbhost = config.getKey(dbhost); string dbport = config.getKey(dbport); } catch

SQLLite driver

2014-12-13 Thread Suliman via Digitalmars-d-learn
On the code.dlang.org I found SQLLite driver https://github.com/biozic/d2sqlite3 Look like it's not ready for Windows: pragma(msg, \nWARNING !!!\nDevelopped for POSIX systems only.\nNot tested on Windows.\n); I tried to add import to my project and I got next errors:

Re: SQLLite driver

2014-12-13 Thread Suliman via Digitalmars-d-learn
Yes I used 2.0.65, but after updating compiler the situation did not resolved... http://www.everfall.com/paste/id.php?apd0bfs5z4eg

File Not Found: pq.lib

2014-12-11 Thread Suliman via Digitalmars-d-learn
I am trying to start with http://code.dlang.org/packages/dpq2 But I can't understand where I should to get pq.lib and where I should to place it. In the Program Files I did not find such file...

scope block do not handle failure, but try-catch does

2014-12-11 Thread Suliman via Digitalmars-d-learn
string dbname = config.getKey(dbname1); scope(failure) writeln(look like dbname is missing); I am using dini and trying to throw exception if value can't be extract from config. If I am wrap it's in try-сефср block it's work or. But in this situation scope block do not execute and I see only

Re: curl: catching exception on connect.

2014-12-02 Thread Suliman via Digitalmars-d-learn
connect() sends a CONNECT request to the server, as defined by HTTP [1]. This method is only used when you're working with proxies and the like. What you most likely want, however, is a GET request. Use get() for that. So what is the best way to check status server response (400, 404 etc)

Re: curl: catching exception on connect.

2014-12-01 Thread Suliman via Digitalmars-d-learn
Big thanks Ali! Only the small last question: why: string link = dlang.org; writeln(connect(link)); cause crash: std.net.curl.CurlException@C:\DMD\dmd2\windows\bin\..\..\src\phobos\std\net\curl .d(779): HTTP request returned status code 400 0x00404263

Re: curl: catching exception on connect.

2014-12-01 Thread Suliman via Digitalmars-d-learn
My guess is that you have to use HTTPS for CONNECT and that you have to have credentials for it. (?) Ali dlang.org should work on HTTP, but not HTTPS. Also I do not think that when I connect to HTTPS I should have any credentials. It's mostly like issue with curl...

Re: general questions on reference types versus value types...

2014-12-01 Thread Suliman via Digitalmars-d-learn
Could anybody explain why there is opinion that stack is fast and the heap is slow. All of them are located in the same memory. So the access time should be equal.

curl: catching exception on connect.

2014-11-30 Thread Suliman via Digitalmars-d-learn
I can't understand why I am getting exception on next code: void downloadFile() { foreach(link; links) { try { writeln(connect(link)); }

Re: curl: catching exception on connect.

2014-11-30 Thread Suliman via Digitalmars-d-learn
Am I right understand all exception are derived from assertThrown http://dlang.org/phobos/std_exception.html So msg in catch(Exception msg) is from function assertThrown? Could you show me example of how to handle type of exception?

Re: Error: cannot return non-void from void function

2014-11-27 Thread Suliman via Digitalmars-d-learn
Full function look like this: auto parseConfig() { auto config = Ini.Parse(getcwd ~ \\ ~ config.ini); string txtlinks = getcwd ~ \\ ~ config.getKey(input_links); if(!exists(txtlinks)) { writeln(Can't find input file with list of links.);

Error: cannot return non-void from void function

2014-11-27 Thread Suliman via Digitalmars-d-learn
auto parseConfig() { auto lines = File(txtlinks, r).byLine; return lines; } Error: cannot return non-void from void function I can't understand the reasons of the error; Can I return auto from function?

function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
I try to compile simple example: import std.net.curl; void main() { download(ftp.digitalmars.com/sieve.ds, D:\\Project\\2014\\txt_downloader\\img\\1.foo); } but I am getting error: function app.download (string[] links) is not callableusing argument types (string, string)

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
Look like it was missed installation or so. I installed new copy of dmd and error gone away.

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
The downloading still do not work. Work only: get(dlang.org);

Re: Error: cannot return non-void from void function

2014-11-27 Thread Suliman via Digitalmars-d-learn
ah, that's it! as spec says, D determines function return value from the first 'return' statement it seen. in your case this is `return;`, so function return type is determined to be `void`. if you doing `auto` functions, try to arrange your code so the first `return` returning the actual

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
Running .\txtdownloader.exe std.stream.OpenException@std\stream.d(50): Cannot open or create file 'D:\Projec t\2014\txt_downloader\img\1.foo' 0x0041BA59 in void std.stream.File.open(immutable(char)[], std.stream.FileMode) 0x00404B75 in void

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
Is there any way to detect where collision was occurred?

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
Oh! It's work! I forgot to change path on my home PC!

Re: function app.download (string[] links) is not callableusing argument types (string, string)

2014-11-27 Thread Suliman via Digitalmars-d-learn
On Thursday, 27 November 2014 at 17:39:10 UTC, Suliman wrote: Is there any way to detect where collision was occurred? It's look like collision was with method name.

Best way to add slash to tail of the path

2014-11-27 Thread Suliman via Digitalmars-d-learn
Sometimes it's path string may do not have tail slash of the path Compare: string path = C:\\folder\\name string path = C:\\folder\\name\\ in case if I need to append file name to path to get full path I can get error like: path ~= foo.txt C:\\folder\\namefoo.txt instead of

Re: Best way to add slash to tail of the path

2014-11-27 Thread Suliman via Digitalmars-d-learn
see std.path, it contains alot of useful things. I looked there, but found only buildNormalizedPath, but it's not for such situation...

Re: Best way to add slash to tail of the path

2014-11-27 Thread Suliman via Digitalmars-d-learn
take a second look then. ;-) you'll find `buildPath()` here too. Not better: string foo = D:/code/txtDownloader; writeln(foo); foo = foo.buildPath; foo ~= config.txt; writeln(foo); Running .\txtdownloader.exe D:/code/txtDownloader

Re: Best way to add slash to tail of the path

2014-11-27 Thread Suliman via Digitalmars-d-learn
Could you quote for me part of docs where it's written? I really can't understand about what you are taking.

Re: Best way to add slash to tail of the path

2014-11-27 Thread Suliman via Digitalmars-d-learn
thanks! I understood!

Re: Error when downloading with +

2014-11-26 Thread Suliman via Digitalmars-d-learn
This is an issue with your version of dub with a buggy url encoding method. Download the latest at code.dlang.org http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/22266/

Re: print yyyy-mm-dd

2014-11-24 Thread Suliman via Digitalmars-d-learn
Is there any way to set separator? For example I want use '/' or ':'?

Re: print yyyy-mm-dd

2014-11-24 Thread Suliman via Digitalmars-d-learn
And could anybody explain me how the cast is work. How to understand which types to which may be casted?

Re: Sum informations in file....

2014-11-24 Thread Suliman via Digitalmars-d-learn
I can't understand why foreach loop produce every line by line, while it's fuctional analog print lines on one string: foreach(f; file.byLine()) { writeln(f); } auto file = File(foo.txt,r); file .byLine() .writeln; file content: - first sring second string -

Re: Sum informations in file....

2014-11-24 Thread Suliman via Digitalmars-d-learn
Thanks! But is there any way to do it with std.algorithm? Can be skipOver used for it?

write multiple lines without \n with writeln

2014-11-20 Thread Suliman via Digitalmars-d-learn
In dco source code I have found: void ShowUsage() { writeln( dco build tool ~ strVersion ~ written by FrankLIKE. Usage: dco [switches...] files... for example: dco or: dco app.d build for dfl2: dco } I do not see here any \n. Why this code is output all one by line, and not in single

dco how to specify Jpath?

2014-11-20 Thread Suliman via Digitalmars-d-learn
I am playing with dco. And it's look very helpful for tiny projects. I can't understand is it's possible to add to dco.ini Jpath? I am talking about something like: dflags=-JD:\code\d\App1\source\ but when I am trying to compile code with dco it's can't find import. I looked at source code

Re: write multiple lines without \n with writeln

2014-11-20 Thread Suliman via Digitalmars-d-learn
I understand it. I expect what concatenation symbol will stay new line in new line and not append it's to current: writeln( first string second ~ string ); I expect: first string second string but not: first stringsecondstring

print yyyy-mm-dd

2014-11-20 Thread Suliman via Digitalmars-d-learn
I can't understand how to get date in format -MM-dd from Clock.currTime auto time = Clock.currTime; And what next? Could anybody give any examples?

Re: help

2014-11-19 Thread Suliman via Digitalmars-d-learn
You need to check if remote file exist of server and only after it download шею Also add scope or try catch block to your code.

dfl2 GUI Builder

2014-11-15 Thread Suliman via Digitalmars-d-learn
I have got few questions about DFL2. 1: What is dco and in which situation I should prefer it's to dub? 2: Old DFL had easy to use GUI Builder. Does dfl2 have such tool?

Re: Can't install dub on Debian

2014-11-13 Thread Suliman via Digitalmars-d-learn
You are right, after updating Debian to 7.7 dub was installed successfully

Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
I did 2 steps from http://d-apt.sourceforge.net/ $ sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list $ sudo apt-get update sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring sudo apt-get update And now

Re: Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
root@66898:~# apt-get install multiarch-support Reading package lists... Done Building dependency tree Reading state information... Done Package multiarch-support is not available, but is referred to by another packag e. This may mean that the package is missing, has been obsoleted, or is only

Re: Can't install dub on Debian

2014-11-12 Thread Suliman via Digitalmars-d-learn
If you haven't found the problem yet, please post: 1. what is the architecture of your machine? $ lscpu 2. what is the debian version? $ lsb_release -a root@66898:~# lscpu Architecture: x86_64 CPU op-mode(s):32-bit, 64-bit CPU(s):4 Vendor ID:

Re: Instructions for compilation from multiple source files

2014-11-10 Thread Suliman via Digitalmars-d-learn
dmd a.d b.d Otherwise you can also use ddmd and let it find the module dependencies by itself. Am I right understand that if I will put all needed files at src folder and name main file App.d dub will add all needed files to App.d ?

Re: is there any reason UFCS can't be used with 'new'?

2014-11-10 Thread Suliman via Digitalmars-d-learn
I can't understand how to use UFCS with instance of class: void main() { string name = Suliman; userName username = new userName(name); /// How to use UFCS here? userName.name.sayHello(); /// } class userName { string name; this(string name) { this.name = name; }

Re: is there any reason UFCS can't be used with 'new'?

2014-11-10 Thread Suliman via Digitalmars-d-learn
Thanks! Ali Çehreli, could you add this mention and possible the example to your book?

<    1   2   3   4   5   >