1,185 karma · joined Nov 2, 2011 (15y ago) · 275 submissions
comment 1w ago · link · parent
Null-terminated requires that you have sentinel (null) at the end, instead of a length at the beginning.
Having a length (encoded as a byte at the beginning), means they are very easy and efficient to copy and concatenate, because unlike the null-terminated variant, you don't have to search for the terminator which requires a conditional branch on each character until the length.
Conditional branches were really expensive on old CPUs, compared to the 8086's rep movsb instruction, that could just copy a specific length of bytes. On the other hand, I suppose, other string-operations are more tricky, because you need to keep track of your position in the string as you iterate over it.
I've never thought null-terminated strings were a particularly neat design or easy to work with (there are pros and cons) -- But the 255 string limit was annoying, and I wished they would have had pascal strings up-to 64K in length (they could have used a word as length instead of a byte).
Malloc is by no means a 'C' specific thing -- Turbo Pascal had getmem() to allocate memory on the heap.
comment 1w ago · link · parent
The generated code wasn't perfect, but you could always use assembler for short routines that needed faster code (e.g. loop-unrolling, tighter register usage, or 80386 32-bit register code, which I think TP never supported). There were also tricks that would improve performance (I seem to remember that 'repeat'/'until' was faster than standard 'for' loops).
To be honest, it was a very fast tool to work with (even on a 80286) -- The integrated debugger was a dream to work with for the time too.
I remember switching to C (both Turbo C and later gcc via DJGPP on both a 80386 and 80486). Compiling even standard C was agonizingly slow in comparison to TP, and you couldn't iterate as fast as TP. It was like moving from having fun programming to plain torture.
I moved on to fully embrace C later (and C++). As the computers got more RAM and got faster, it became a lot better experience, but I never fully understood why C was popular as a general purpose language in the 80s and 90s. I doubt C was optimal for development time.
TP was a really balanced compromise in a lot of ways.
comment 1mo ago · link · parent
comment 1mo ago · link · parent
Even the EU is a lot of different countries. Some of them quite poor, and some of them wealthier also with high GDP per capita.
GDP per capita does also not give you the whole picture. It is a number. Other numbers are median life expectancy, shootings per capita, PPI, median income, average vacation days, average distance to nearest high-speed rail station, physicians per capita, average number of pupils in a school class. Unemployment rate. Air quality.
GDP per capita is one indicator among many that says something about the country’s or region’s inhabitants, but in itself it is just a measure of how much money is being moved around annually. And it is potentially quite misleading. You could have a high GDP per capita and a poor population, if all the money went to large cooperations and billionaires.
I am not saying that everything is rosy in the EU, but just that there are also other important indicators and that it is a lot more complicated than just looking at GDP per capita across the entire EU.
comment 5mo ago · link · parent
It is so long, with so many unnecessary sentences. And it feels like everything is said at least twice; First a generic statement about the new feature. Then a specific example, or a deeper explanation of what the first generic statement was. Then a demo. And then a conclusion to the future.
The old Steve Jobs keynotes focused on the most interesting things, but now it feels like they are afraid not to include everything. So everything gets diluted.
It would help a lot if they would stop saying the same lines:"And now...", "We cannot wait for you to try our new XXXX ... ", or "We could not be more excited to...", "We are excited to... ".
"With that, now over to person-X"
comment 6mo ago · link · parent
https://github.com/vllm-project/vllm/pull/41745
("Add Gemma4 MTP speculative decoding support")
comment 6mo ago · link · parent
I am old enough to remember the iPod nano -- Especially the 2nd generation. They were effectively low-priced and smaller iPods.
Apple sold millions of these much much quicker than the iPods and iPod minis (which came right before). Especially in 2006, it was _the_ "Christmas gift" just before the iPhone, iPod touch and later iPad mini took over. Possibly Steve Jobs' demo where he showed how they fit into the otherwise useless small jeans pocket helped convince the world.
The iPod nano effectively wiped out the competing music player market.
The Neo reminds me of the iPod nano and iPad mini. It is smaller and cheaper version of an existing successful product.
I think the iPhone SE and E are the outliers.
comment 9mo ago · link · parent
However, Win32s was introduced in 3.11 which a subset of the Windows 32-bit API from NT.
3.11 also introduced 32-bit disk access and 32-bit drivers.
Microsoft did 32-bit in steps -- it was confusing already back then.
comment 10mo ago · link · parent
I really don't know much of what is happening in China or India or how you would ever measure something as subjective as morality. The point was, that it isn't just European (or EU) nations that don't stand up to the US. Nobody really dare -- Even those other heavy-weights. So it doesn't seem fair to me to single Europe (European nations) out for not doing anything.
I would say that Europe has a lot of bad history and guilt and we know it. And there is an aspiration in many of the European countries to be better and do "the right thing" now, but it is definitely debatable whether those countries actually do it, or if we even know what "right" is.
comment 10mo ago · link · parent
Btw. as far as I remember neither China, India, Russia, nor practically any other nation stopped trading with the US over the war in Iraq. Maybe I am wrong about that.
Small detail on casualties in Iraq: the estimates listed on Wikipedia range from 150K to about 1 million (1).
[1] https://en.wikipedia.org/wiki/Casualties_of_the_Iraq_War
comment 10mo ago · link · parent
You mention that Asia was suspicious, but the "coalition of willing" actually included Asian countries such as Phillippines, South Korea, Japan, Uzbekistan, Singapore.
I believe the current overarching feeling in Europe is that we were mislead by the US administration more than our own politicians. Already back then, there was quite a lot of skepticism and significant doubt in the media all over Europe about the justification of that war. Also in the coalition countries.
And Indeed, there were no consequences later. But what should have been done and by whom at that point? How do you prove that it was deliberately misleading? Why would it be the job of nations of Europe or EU?
I agree that it wasn't pretty, and that the European nations and EU should have opposed more, but even as it was back then, it was not a clear "cheering on" moment. I remember having discussions about Iraq with people from Scandinavia, Italy, Spain, Germany, and France back when the invasion started. Although a large group did support the war (I think many were still emotionally affected by 9/11), I actually don't remember talking to any one of them.
The reality is that the US is the most powerful geopolitical entity and Europe is a continent consisting of many individual countries. Even the EU is a divided group of nations, and even if united would not be as powerful as the US is currently.
comment 10mo ago · link · parent
Greenland and Denmark are not the same. Greenland is a self-governed territory under the Kingdom of Denmark. The US administration wishes to take over Greenland from Denmark completely. So you should replace your headlines with "Greenland" and "Greenlanders".
Note: There have already been discussions about making Greenland independent from Denmark, but there is uncertainty over how to handle economic and defense situations. Greenland currently receives significant support (about $10000-15000 per capita yearly) from Denmark. So it is not clear how the country would run without that.
comment 10mo ago · link · parent
The Europeans I know (from all over) have generally been opposed to American geopolitics both in the Middle East, South East Asia, and South America. The US has traditionally been seen as an ally, but that doesn't mean we "cheer on" its actions.
Because there are many financial and military interests, it is very hard to do much for e.g. the EU, and the politicians are very careful with their words. Just as it is for the rest of the world...
Note: Europe is not a single entity but a continent full of different countries including (part of) Russia. Even the EU doesn't really have one single foreign policy.
comment 10mo ago · link · parent
It could be about leaving NATO.
US (Trump) feels they need Greenland for "security".
They currently have (almost complete) access to use Greenland via NATO and the existing agreements with Denmark. So there is no need to extend this.
However, if the US would want to leave NATO, they would no longer have access to Greenland under existing agreement.
Therefore, if the US wants to leave NATO and still use Greenland (both militarily and for resources), they need to acquire Greenland.
Acquiring Greenland would allow the US to control the entire western hemisphere, leave NATO, and abandon the eastern hemisphere entirely.
comment 11mo ago · link · parent
https://machinelearning.apple.com/research/exploring-llms-ml...
"Exploring LLMs with MLX and the Neural Accelerators in the M5 GPU"
comment 1y ago · link · parent
The current longest is in Turkey at 2023 meter.
Each of the pylons of the Messina Bridge will be around 400 meters tall. Which is taller than the Empire State Building.
The strait is too deep, with too much current and seismic activity to place the pylons in the water. So they have to be on the shore, as I understand it.
comment 1y ago · link · parent
https://www.best-selling-cars.com/europe/2025-half-year-euro...
This gives a much much more nuanced look, and it doesn't look as completely clear cut as the headline implies.
For example: Spain saw an increase of 83.9% and France a decline of 6.9%
... And then you see that Denmark bought as many EVs as spain, although Spain has 10x population.
comment 1y ago · link · parent
It is bizar to listen to.
Robert F. Kennedy Jr. claimed that windmills had killed 100+ whales. I tried to find out what he referred to, but couldn't find anything but articles debunking any claim that windmills affect whales (after construction).
He also claimed that the price per kWh of wind energy is above $0.30, which is quite a bit from the $0.03 ($0.12 offshore) price per kWh listed in Wikipedia [1] for United States.
At the same meeting Trump stated that the only viable solution is fossil fuel."... and maybe a little nuclear, but mostly fossil fuel.". And that wind is about 10x more expensive than natural gas (again contradicting the prices listed in the Wikipedia reference where the prices for onshore wind and natural gas are almost identical).
[1] https://en.wikipedia.org/wiki/Cost_of_electricity_by_source
comment 1y ago · link · parent
We process several million pages from Newspapers and Magazines from all over the world with medium to very high complexity layouts.
We built the PDF parser on top of open source PDF libraries, and this gives many advantages: • We can accurately get headlines other text placed on top on images. OCR is generally hopeless with text placed on top of images or on complex backgrounds • Distinguish letters accurately (i.e. number 1, I, l, "o", "zero") • OCR will pick up ghost letters from images, where OCR program believes there is text, even if there isn't. We don't. • We have much higher accuracy than OCR because we don't depend on the OCR programs' ability to recognize the letters. • We can utilize font information and accurate color information, which helps us distinguish elements from each other. • We have accurate bounding box locations of each letter, word, line, and block (pts).
To do it, we completely abandon the PDF text-structure and only use the individual location of each letter. Then we combine letter positions to words, words to lines, and lines to text-blocks using a number of algorithms.
We use the structure blocks that we generated with machine learning afterwards, so this is just the first step in analyzing the page.
It may seem like a large undertaking, but it literally only took a few months to built this initially, and we have very rarely touched the code over the last 10 years. So it was a very good investment for us.
Obviously, you can achieve a lot of the same with OCR -- But you lose information, accuracy, and computational efficiency. And you depend on the OCR program you use. Best OCR programs are commercial and somewhat pricy at scale.
comment 1y ago · link · parent
So if it is scanned it contains just a single image - no text.
OCR programs will commonly create a PDF where the text/background and detected images are separate. And then the OCR program inserts transparent (no-draw) letters in place of the text it has identified, or (less frequently) place the letters behind the scanned image in the PDF (i.e. with lower z).
We can detect if something has been generated by an OCR program by looking at the "Creator data" in the PDF that describes the program use to create the PDF. So we can handle that differently (and we do handle that a little bit differently).
PDF->image->text is 100% not lossless.
When you rasterize the PDF, you losing information because you are going from a resolution independent format to a specific resolution: • Text must be rasterized into letters at the target resolution • Images must be resampled at the target resolution • Vector paths must be rasterized to the target resolution
So for example the target resolution must be high enough that small text is legible.
If you perform OCR, you depend on the ability of the OCR program to accurately identify the letters based on the rasterized form.
OCR is not 100% accurate, because it is computer vision recognition problem, and • there are hundrends of thousands of fonts in the wild each with different details and appearances. • two letters can look the same; simple example where trivial OCR/recognition fails is capital letter "I" and lower case "l". These are both vertical lines, so you need the context (letters nearby). Same with "O" and zero. • OCR is also pretty hopeless with e.g. headlines/text written on top of images because it is hard to distinguish letters from the background. But even regular black on white text fails sometimes. • OCR will also commonly identify "ghost" letters in images that are not really there. I.e. pick up a bunch of pixels that have been detected as a letter, but really is just some pixel structure part of the image (not even necessarily text on the image) -- A form of hallucination.
comment 1y ago · link · parent
We have algorithms that combines the individual letters to words, words to lines, lines to boxes all by looking at it geometrically. Obviously identify the spaces between words.
We handle hidden text and problematic glyph-to-unicode tables.
The output is similar to OCR except we don't do the rasterization and quality is higher because we don't depend on vision based text recognition.
The base implementation of all this, I made in less than a month 10 years ago and we rarely, if ever, touch it.
We do machine learning afterwards on the structure output too.
comment 1y ago · link · parent
We also parse millions of PDFs per month in all kinds languages (both Western and Asian alphabets).
Getting the basics of PDF parsing to work is really not that complicated -- A few months work. And is an order of magnitude more efficient than generating an image in 300-600 DPI and doing OCR or Visual LLM.
But some of the challenges (which we have solved) are:
• Glyphs to unicode tables are often limited or incorrect • "Boxing" blocks of text into "paragraphs" can be tricky • Handling extra spaces and missing spaces between letters and words. Often PDFs do not include the spaces or they are incorrect so you need to identify gaps yourself. • Often graphic designers of magazines/newspapers will hide text behind e.g. a simple white rectangle, and place new version of the text above. So you need to keep track of z-order and ignore hidden text. • Common text can be embedded as vector paths -- Not just logos but we also see it with text. So you need a way to handle that. • Dropcap and similar "artistic" choices can be a bit painful
There are lot of other smaller issues -- but they are generally edge cases.
OCR handles some of these issues for you. But we found that OCR often misidentifies letters (all major OCR), and they are certainly not perfect with spaces either. So if you are going for quality, you can get better results if you parse the PDFs.
Visual Transformers are not good with accurate coordinates/boxing yet -- At least we haven't seen a good enough implementation of it yet. Even though it is getting better.
comment 1y ago · link · parent
Low demand in the US, means less sales to US, so they may try to make up for the loss of profit on the US market by increasing prices on other markets... So global price increase.
E.g. Apple likely to increase prices on iPhones world wide to make up for the loss in US.
This feels completely unpredictable.
comment 1y ago · link · parent
I have a feeling they are not really that competitive in this market segment, but were helped by a strong brand.
Anyone know if they actually make money on Solar at all, and have an idea what their profit margin is?
And what does the the competition look like (also for e.g. PowerWall)?
comment 1y ago · link · parent
And why do you feel Leyen was unelected? As I understand it, she was elected by the Members of European Parliament [1], and the MEPs were elected by the people of EU last year during the election. And Leyen herself was elected as a MEP.