Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: Open Python with TProcess and send Input, get Output
« Last post by Renat.Su on Today at 08:08:16 pm »
By default Python interpreter, works with a TTY or PTY console, not the stdin/stdout. But you can work using the -i option.
Using my library: https://github.com/t-edson/UnTerminal you can interact with Python, using events and prompt detection.
Cool repository!
It is a pity that there is no description in English. I wrote the simple Shell terminal emulator via telegram. Can you tell if there is any way to emulate sending Ctrl+C to the terminal? I use TProcess.Input and TProcess.Output
2
Databases / Re: SQL UNION problem
« Last post by BSaidus on Today at 08:07:11 pm »
try this


Code: Pascal  [Select]
  1. select * from (
  2.     SELECT  Airport.ID,  Airport.APCity,  Airport.APName,  Country.Country,  Airport.APCode,  Airport.APLat,  Airport.APLong
  3.         FROM Country INNER JOIN Airport ON (Country.ID = Airport.APCountry) AND (Country.ID = Airport.APCountry)
  4.     UNION SELECT 0 ID ,"Add new" APCity,0 APName,0 Country ,0 APCode ,0 APLat ,0 APLong FROM Airport
  5. )ORDER BY Country, APCity;
  6.  
3
Graphics / Re: The scaled image opens in Image2 instead of Image1
« Last post by kolbjoern on Today at 08:03:07 pm »
Thank you wp.
I thought the contents of Image2 was copied into img and then I could manipulate img independently of the content of Image2 just like b := 3;a := b + 1 with the result a = 4; b = 3. I am new to image handling and obviously have lots to learn :-).
Kolbjørn
4
Databases / SQL UNION problem
« Last post by daveinhull on Today at 07:39:28 pm »
Hi,

I'm trying to add a static text line to a drop down query with Access as the DB. I'm using this SQL which works fine in Access
Code: SQL  [Select]
  1. SELECT Airport.ID, Airport.APCity, Airport.APName, Country.Country, Airport.APCode, Airport.APLat, Airport.APLong
  2. FROM Country INNER JOIN Airport ON (Country.ID = Airport.APCountry) AND (Country.ID = Airport.APCountry)
  3. UNION SELECT 0,"Add new",0,0,0,0,0 FROM Airport
  4. ORDER BY Country.Country, Airport.APCity;

But When I use it from in Lazars SQL as
Code: SQL  [Select]
  1. SELECT * FROM <query above>
I get an error about there being too few parameters.

Can anyone see where I'm going wrong

Thanks
Dave
5
LCL / Re: Stringgrid InsertRowWithValues: auto add columns?
« Last post by jamie on Today at 07:36:52 pm »
Its all done within the COLS/ROWS which are Tstrings where you can insert,add as you do with stringlist.

and I think you can also just set the rows/cols and it will also do the same but be blank

I stand corrected..

you need to set the ROW count to add a new one.but it can be done in Delphi with access to the main string pool..
6
Third party / Re: Online Package Manager
« Last post by lainz on Today at 07:32:05 pm »
Download is slow, i'm downloading at 200 kb/s when I regularly download between 3 and 4 mb/s from GitHub.

Maybe we can mirror it at github with github downloads in a project, also you can get the number of downloads from each package.

I will investigate the GitHub API if we can build an automatic mirror.
7
LCL / Re: After drawing Shapes on a canvas How can one clear the canvas.
« Last post by jamie on Today at 07:31:13 pm »
Although I've never used the CLEAR method of the canvas, it does work for me on 1.8.4 Windersssss

8
General / Re: Redirect problems downloading web file.
« Last post by sash on Today at 07:24:39 pm »
In the https sections
A site being discussed is not encrypted, it is plain-text http.

specifically because of the password/cookie issue.

As I said before, there's no cookie issue, there's Redirect location issue.
Specifically, this site uses relative redirect url (which is not common, but valid since 2014).

My bad, I overlooked comments in Synapse and said
Quote
Synapse's one does not return Response Headers

which is wrong, because it uses Headers as Request, and replaces same StringList with Response values. So Location is available.

Quote
I was hoping there might be some way to PIPE the output from the user's monitor to a file.
Forget it (OpenURL). The best you can do with this approach: TProcess + specific commandline.

UPD: The only foreseeable problem, that you're (probably) requesting an url that is normally accessible to logged-in users (normally, logins are executed by POST (via html-form-variables) requests) and it seems like you're missed that step, so you're getting redirects to a Login form.

But actually you always should handle "login required" situation (f.e. in case of session has been expired, or whatever other reason) in the middle of your data exchange process.

Summary: try login first and there are chances you won't get any 302s at all (for the first time :-)).
9
Graphics / Re: The scaled image opens in Image2 instead of Image1
« Last post by wp on Today at 06:54:38 pm »
You (unnecessarily) assign the Image2 to a variable img - this is just am abbreviation for typing. So, whenever you write img you mean Image2. You set img.Proportional to true - because img=Image2 this sets Images2.Proportional to true. This scales the raw image to the size of image2 (I thought that it is required also to set Stretch to true, but this seems to be wrong).

Then you set Image1.Picture := img.Picture. This does not copy the scaled image, it copies the raw data which are in Img = Image2.

Therefore, you have the unscaled image im Image1 and the scaled image in Image2.
10
General / Re: Open Python with TProcess and send Input, get Output
« Last post by penpen on Today at 06:48:49 pm »
By default Python interpreter, works with a TTY or PTY console, not the stdin/stdout. But you can work using the -i option.

That was it. Thank you very much :) Finally its working as expected.

Thanks everyone.
Pages: [1] 2 3 ... 10