Delphi – Extract multiple substrings from a string

Uncategorized
Question: I have a string like this ";;;Caption=C:;FreeSpace=103571001344;Size=162527178752;;;Caption=D:;FreeSpace=129889742848;Size=336805752832;;;Caption=V:;FreeSpace=516807241728;Size=1000207282176;;;; How can I extract each partition data into a variable so that I obtain something like this:partition_1:='Caption=C:;FreeSpace=103571001344;Size=162527178752'; partition_2:='Caption=D:;FreeSpace=129889742848;Size=336805752832'; partition_n:='Caption=V:;FreeSpace=516807241728;Size=1000207282176'; Thank you! Answer: This question applies to you as well. Basically, use TStringList, set LineBreak property to 3 semicolons (;;;) and Text property to your string. Read more
Read More

Start two activities simultaneously one in foreground other in background

Uncategorized
Question: I have two activities SplashScreen and MainActivity. MainActvity download some data and show it. Now I want to start both activities on application start, MainActivity in background and SplashScreen in foreground and when the data of MainActivity download complete I want to make MainActivity foreground and finish SplashScreen. I have seen many solution but no one is going good in my situation. Please give me some suggestion or example . Answer: I think it's better to make splash screen to download data and when it completed show new activity (MainActivity). In onStart metod use downloaded data stored on phone. Your example: The only way You can have resolve this your way is by start MainActivity first and from onStart start SplashScreen: class SplashScreen extends Activitiy { public void onStart()…
Read More

github desktop push issue with .git file

Uncategorized
Question: I'm using github desktop to push all my code on github. I was able to push all the original code, files when I created a new repo. Now I want to push all the updated files to the github site. I already committed on the local repo, all the repo is only 2 MB, but github desktop created a hidden .git file which is 200 MB, larger than the limit of github. So I can not push my code on my github repo. Answer: Read more
Read More

RedShift – CSV load with line Break

Uncategorized
Question: Im trying to load a CSV file while loading I got the error Delimited value missing end quote CSV file Error line REDSHIFT ERROR:line_number | 13 colname | Comment col_length | 250 raw_line |"123"|"123"|"xyz"|"2009-06-25 21:00:14.660000000"|"0"|""|""|""|""|""|"HI, raw_field_value | HI, err_code | 1214 err_reason | Delimited value missing end quote Answer: Read more
Read More

How can I let the a tag vertical center to the footer tag?

Uncategorized
Question: How can I let the tag vertical center to the tag? This below is my css:.header-article-list a { width:50%; color: #000000; } .header-article-list .prev-btn { float:left; } .header-article-list .next-btn { float:right; } It did not let the tag vertical center to the tag. This is the in browser: This is the tag in browser: This is the tag: EDIT I set css to below:.header-article-list a { overflow:hidden; width:50%; color: #000000; } .header-article-list .prev-btn { /** float:left; **/ } .header-article-list .next-btn { /** float:right;**/ } Get the below effect: EDIT-2 There is text-align:center inherit from header-article-list, I uncheck it in browser: Answer: You can use this code in css:footer { background-color: #FFF; position:fixed; bottom: 0px; width: 100%; text-align: center; } HTML: March 25, 2 You can show the example here:http://jsfiddle.net/9yNT3/3/…
Read More

Is there a way in phpunit that I could possibly assert two values for a key in an array?

php
Question: $array = [a => '1', b => '2'] For example, I want to check if a was either 1 or 3. I thought using this would work. $this->assertThat( $this->assertContains('1',$array), $this->logicalOr( $this->assertContains('3',$array) )); Answer: If you want to assert that $array["a"] ("I want to check if a...") contains 1 or 3, then this will work:$array = ["a" => "1", "b" => "2"]; $this->assertThat($array["a"], $this->logicalOr( $this->equalTo("1"), $this->equalTo("3") )); Read more
Read More