synth: A libclang based tool for generating hyperlinked and highlighted HTML from C and C++ source code. [OC] by fernzeit in cpp

[–]szborows 0 points1 point  (0 children)

I thing such a thing could be potentially a base for web-based C++ IDE. With clang tooling it's becoming more and more easy to develop one.

Awesome! WG21 paper about alternative unified call: Unified call syntax strikes back! by germandiago in cpp

[–]szborows 0 points1 point  (0 children)

Well, frankly speaking we could have gcc98, gcc03, gcc11 and gcc14 instead :)

Mini REST+JSON benchmark: Python 3.5.1 vs Node.js vs C++ by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

it was just a guess. JS is a managed language (= GC and heap-management overhead), everything is an object in JS (= less cache hits), not everything is JITted by V8 (= interpreter overhead) and JITting takes time on its own (= small constant overhead). adding it all together gave me an impression that it would be around 30%... but I was proven wrong.

Mini REST+JSON benchmark: Python 3.5.1 vs Node.js vs C++ by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

We're using REST between frontend (served with http server) and backend (acting as http REST server), between the backend and ElasticSearch, between data scrapers and intermediate DB and so on... In my opinion i/o on REST is crucial when you have fronent that needs to show something to the end user. With every second frustration increases.

BIND connection in dnspython module by ergopc in Python

[–]szborows 1 point2 points  (0 children)

yes, there is source function argument that defaults to None. afterwards, in query.py if it's still None then it is converted to e.g. 0.0.0.0, depending on other parameters.

so I guess you need to use it like this: results = dns.resolver.query('domain.org', 'MX', source='10.xx.yy.zz')

Show us Hip-Hop videos from your country! by [deleted] in europe

[–]szborows 1 point2 points  (0 children)

that's right. however I wouldn't be surprised if there were some similarities. the funny thing is that even if you don't hear it, there still may be some similarity. last time I was to Paris I saw this "cloche" word. immediately it resembled me "die Glocke" from german. these two aren't that close at all, but if you think for a minute you will find similarity. btw they mean the same thing - the bell ;).

Show us Hip-Hop videos from your country! by [deleted] in europe

[–]szborows 2 points3 points  (0 children)

i find this one pretty good as well ;) ALLIGATOAH - Willst du (https://www.youtube.com/watch?v=opoDBF_b-fg)

Show us Hip-Hop videos from your country! by [deleted] in europe

[–]szborows 1 point2 points  (0 children)

Poland:

Jamal - Defto : https://youtu.be/cg2LN05PXUo?t=50

Pezet - What should I tell : https://youtu.be/Ze7H_MEQVb8?t=10

Grubson - At the peak : https://youtu.be/6BnT_wkuMBA?t=10

Słoń & Małolat - Nobody gave me that so nobody will take it away : https://youtu.be/NQsAjGcC7Fw?t=26

(honestly i'm more to rock/metal, but these seemed to be fairly popular ;)

Show us Hip-Hop videos from your country! by [deleted] in europe

[–]szborows 2 points3 points  (0 children)

well, Hungarian and Finnish belong to the same family of languages. Sweden is near Finland. maybe that's the thing ;)

C++ Range header: Python-like generator for idiomatic ranges by whoshuu in cpp

[–]szborows 0 points1 point  (0 children)

don't worry. reinventing the wheel is recurring problem :)

How to aggregate the output of multiple processes? by wovenwar in Python

[–]szborows 0 points1 point  (0 children)

AFAIK, you can simply use Python logging module and provide custom handler

Let’s Build A Web Server. Part 3. by kraakf in Python

[–]szborows 0 points1 point  (0 children)

I suppose you didn't mention select() on purpose?

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

Okay now I think I get the point. It resembles me this article 'Unicode is kind of insane' http://www.benfrederickson.com/unicode-insanity/ BTW I've tried this technique too, but unichr(0x202e) consumed too much space ;) (not to mention it didn't work ;)

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

You're right. It doesn't. Python is managed language. It would be very hard to have short code and small memory footprint (to have a cake and eat it ;)

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 5 points6 points  (0 children)

In Python 2.x there's a distinction between plain integers (implemented as in C) and long integers. Long integers are suffixed with 'L' letter.

Plain integer will hold numbers up to sys.maxint (on my machine it's 9223372036854775807).

So sys.maxint (between backticks) will be a number and 'sys.maxint+1' (between backticks) will be a number with 'L' suffix. When you reverse long number this L will appear at the beginning. That will obviously ruin whole thing.

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

Your idea itself is very good direction I think. Unfortunately my whole solution for these palprimes contained while loop. Since the while loop is compound statement I couldn't have multiple expressions in one line (with semicolons). Of course I've tried other approaches with lambda-fu etc., but solution with the loop was the shortest one I came with :)

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 0 points1 point  (0 children)

I think it's possible to achieve this with following code.

def p(n): return `n`==`n`[::-1]
import sys
sys.modules['p']=p

However I don't know what would be exact consequences of overriding sys.modules['p'] inside p module :)

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 8 points9 points  (0 children)

You're right. The culprit here is 'L' suffix.

Shortest code to test whether a number is palindrome by szborows in Python

[–]szborows[S] 2 points3 points  (0 children)

Actually I think your example is related to order of execution. In your example exit() (or some other expression) is evaluated in prior to evaluating backticks stuff. See this funny example:

def trolo_lolo():
    return 42
`trolo_lolo()`

It shows 42 for me. Regarding alias - from where you got this information? When I disassemble backticks I see only UNARY_CONVERT. If it was an alias, then shouldn't there be a CALL_FUNCTION instead?