## Search found 3557 matches

Mon Aug 30, 2021 7:15 pm
Forum: Coding Questions
Topic: Reading POINTs from an image, to draw on another.
Replies: 16
Views: 1889

### Re: Reading POINTs from an image, to draw on another.

The use of Start and Stop drawing is very slow here, and I cannot see a way around it, without using an array or some other way of storing to memory. Is there any reason you don't want to use an array ? You can free the source image as soon as you have read all pixel colors into an array. That way ...
Wed Aug 18, 2021 12:12 pm
Forum: Coding Questions
Topic: attempting to convert some code
Replies: 8
Views: 402

### Re: attempting to convert some code

You added a new point to the array but didn't change the dim statement to
Dim polygon.Point2D(4)
Wed Aug 18, 2021 11:43 am
Forum: Coding Questions
Topic: attempting to convert some code
Replies: 8
Views: 402

### Re: attempting to convert some code

Something like this ? Structure Point2D x.d y.d EndStructure Procedure compute2DPolygonCentroid(Array vertices.Point2D(1), *centroid.Point2D) Protected.Point2D centroid, *prev, *next Protected.d signedArea, x0, y0, x1, y1, a Protected.i i, lastdex lastdex = ArraySize(vertices()) *prev = @vertices(la...
Sun Aug 08, 2021 2:23 pm
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1063

### Re: Compare a number with list of numbers?

Otrebor wrote: Sun Aug 08, 2021 2:13 pmis this what you mean? Seems more simple than i thought...
Yes, that's both the easiest and fastest way.
Sun Aug 08, 2021 1:11 pm
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1063

### Re: Compare a number with list of numbers?

What you describe is just a flag for every possible program counter address.
Using a 8 KiB bit array (65536 bits) with a set bit, clear bit and test bit procedure is all you need.
Sun Aug 08, 2021 8:13 am
Forum: Coding Questions
Topic: Compare a number with list of numbers?
Replies: 11
Views: 1063

### Re: Compare a number with list of numbers?

I need to do this comparison as fast as possible. Since the elements in the list vary in quantity (even empty), i thought in NewList() and NewMap(). I don't know if the code you posted has anything to do with how you want to use it. If I look at the code you posted, it looks like you are using it a...
Tue Aug 03, 2021 4:35 pm
Forum: Coding Questions
Topic: Speed up processing a certain string
Replies: 15
Views: 1496

### Re: Speed up processing a certain string

I tried ReadData, but it didn't speed up (at least not for me) ReadData is great when you are working directly on the loaded content with memory pointers. PB strings are not that fast when you have to process millions of strings. Right now, the best approach seems like RegEx or using a buffer and p...
Tue Aug 03, 2021 5:56 am
Forum: Coding Questions
Topic: Speed up processing a certain string
Replies: 15
Views: 1496

### Re: Speed up processing a certain string

It's best to get the fields at the same time and not use StringField. If you would know for sure the fields never exceed a certain length like for example 20 characters, it can be made a lot faster. The code below could also be made a bit faster by using ASM if desired. DisableDebugger #MaxFields = ...
Wed Jul 28, 2021 5:58 am
Forum: Bugs - Windows
Topic: (Solved) short program dies on AllocateMemory (5.73 x64)
Replies: 3
Views: 1740

### Re: short program dies on AllocateMemory (5.73 x64)

GPI is right.
You have to allocate room for one additional character.

Code: Select all

``Define *mem=AllocateMemory(size + SizeOf(Character))``
Mon Jul 26, 2021 1:40 pm
Forum: Coding Questions
Topic: [Solved ]Multiply String / Equivalent of Space for strings?
Replies: 28
Views: 3636

### Re: [Solved ]Multiply String / Equivalent of Space for strings?

An alternative could be, to recycle the memory each time with the Static keyword. But then once a huge buffer is allocated, it will keep allocated until the program ends. Another alternative is to use a local array as a buffer. Procedure.s StringRepeat(String\$, Count.i) Protected Dim Buffer.c(Len(S...
Sun Jun 13, 2021 11:07 am
Forum: Mac OSX
Topic: Getting started with carbon or cocoa directly
Replies: 2
Views: 2919

### Re: Getting started with carbon or cocoa directly

You could take a look at this thread
http://forums.purebasic.com/english/vie ... 19&t=59589
Thu Jun 03, 2021 2:02 pm
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 37974

### Re: A small procedure asm

Thanks for the additional information. I'll try to code something capable of processing a 240 MB input and a max K of 31 with a focus on operating speed. Bigger K values like the 200 you mention require a different approach which makes it more difficult for me to optimize using asm and to support ca...
Thu Jun 03, 2021 8:34 am
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 37974

### Re: A small procedure asm

Sooraa wrote: Wed Jun 02, 2021 6:22 pmThe download is selfexplanatory. The only thing you should do is to set the file content into all upper case and remove five textual separators
I did that but the file besides A,C,G and T also contains N.
Wed Jun 02, 2021 3:49 pm
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 37974

### Re: A small procedure asm

Where can the C. elegans genome (102 MB nucleos) be found to test with ? When you output the results to a file, do you output every kmer found ? I believe I asked you before but can you give any indication on what input size you want to work with. To me, optimizing for 4.7 MB input, 102 MB or 3000 M...
Wed May 19, 2021 5:04 pm
Forum: Assembly Programming
Topic: A small procedure asm
Replies: 125
Views: 37974

### Re: A small procedure asm

I'm also still thinking about the k-mer counting subject. My main problem is deciding on what approach to use and what output should be generated. The human-genome size may be 3 Gbps but if you want every count from k=1 to 31, there's not enough system memory to hold all that information. It would h...