programming and technology thread (130)

1 Name: Anonymous : 2021-07-04 17:36 ID:Heaven

When /tech/ is too slow for you

2 Name: Anonymous : 2021-07-04 17:38 ID:Heaven

Do you backup your game saves on windows? I spent months on some of the games, losing this progress would be troublesome.

Do you backup anything at all?

3 Name: Anonymous : 2021-07-08 09:23 ID:qhru9pz3

What's up with catalogue in /general/ not showing post count? Everywhere else you see the number of posts, but not here for some reason? I wanted to make a client for 4-ch to check for updates.

4 Name: Anonymous : 2021-07-10 02:42 ID:Heaven

>>3
Looks like ssz saw your post. Nice catch.

5 Name: Anonymous : 2021-07-10 07:44 ID:Heaven

Or maybe I just didn't scroll all the way to the right or something.

6 Name: Anonymous : 2021-07-15 13:19 ID:eECg4vTd

I don't back up anything, I just trust in my computer.

7 Name: Anonymous : 2021-07-15 15:45 ID:jVsxmdSC

Thesis: all programmers are faggots.

8 Name: Anonymous : 2021-07-16 06:04 ID:Heaven

I'm not a faggot, just very very annoying.

9 Name: Anonymous : 2021-07-22 09:55 ID:dpUCJVoE

10 Name: Anonymous : 2021-08-04 08:55 ID:Pn5rzXZT

https://www.sljfaq.org/afaq/encodings.html
Encodings of Japanese

http://www.rikai.com/library/kanjitables/kanji_codes.unicode.shtml
Japanese-style punctuation ( 3000 - 303f)
Hiragana ( 3040 - 309f)
Katakana ( 30a0 - 30ff)
Full-width roman characters and half-width katakana ( ff00 - ffef)
CJK unifed ideographs - Common and uncommon kanji ( 4e00 - 9faf)
CJK unified ideographs Extension A - Rare kanji ( 3400 - 4dbf)

0x20000-0x2A6DF CJK unified ideographs Extension B - Very rare kanji

So, I guess, most kanji can fit in 2 bytes of UTF16 codepage. Except some very very rare ones.

The unused 11th bit (0x0400) is used to increase the robustness of UTF-16 text. In the first 16-bit code, the 11th bit is always 0, and in the second 16-bit code, it is always 1. That way, if a file is truncated in the middle of a higher-plane character, a program can tell that it is reading the second half, and not corrupt the character after it.

11 Name: Anonymous : 2021-08-04 09:27 ID:Heaven

shift-jis to utf16 C
https://gist.github.com/takamin/2752a45c5cb4d0f9d1ff

#include "stdafx.h"
#include <string>

//VC++ SJIS string を utf-8のstringに変換する
string sjis2utf8(const string& sjis) {

string utf8_string;
//一旦SJISからutf-16へ変換
LPCCH pSJIS = (LPCCH)sjis.c_str();
int utf16size = ::MultiByteToWideChar(CP_ACP, MB_ERR_INVALID_CHARS, pSJIS, -1, 0, 0);
if (utf16size != 0) {
LPWSTR pUTF16 = new WCHAR[utf16size];
if (::MultiByteToWideChar(CP_ACP, 0, (LPCCH)pSJIS, -1, pUTF16, utf16size) != 0) {
//次にutf-16からutf-8へ変換
int utf8size = ::WideCharToMultiByte(CP_UTF8, 0, pUTF16, -1, 0, 0, 0, 0);
if (utf8size != 0) {
LPTSTR pUTF8 = new TCHAR[utf8size + 16];
ZeroMemory(pUTF8, utf8size + 16);
if (::WideCharToMultiByte(CP_UTF8, 0, pUTF16, -1, pUTF8, utf8size, 0, 0) != 0) {
utf8_string = string(pUTF8);
}
delete pUTF8;
}
}
delete pUTF16;
}
return utf8_string;

}

12 Name: Anonymous : 2021-10-05 10:58 ID:LJmj1GtX

I want to setup my own little text or imageboard, where can I get free hosting?

13 Name: Anonymous : 2021-10-06 02:00 ID:dnXMOnrx

at kuz.com

14 Name: Anonymous : 2021-10-06 05:40 ID:tXcTWGzM

>>13
All I see there is eyewear by David Beckham.

15 Name: Anonymous : 2021-10-06 05:40 ID:Heaven

        ∧_∧
      (`・ω・´)
   γ⌒" ̄ `Y" ̄`⌒ヽ
  /´  、   ¥   ノ  ヽ.
 / ,-ュ人` -‐´;`ー イ` ェ-、 ヽ
 l 「  } i 彡 i ミ/ {  `ノ
 ` `ー' .}    {  `ー'´/ ̄ ̄\
     /      \||  |  >>13  |
    /   /`ヽ、 i |i  \  _/
   /  ノ    l| | i|   //
   \  `ヽ    |    ||  /
     \ \  l|| l|i | ,,
      ノ  _>‘、|l  |・i/
     <.,,_/~,-・i |゚;・li。i,・'

16 Name: Anonymous : 2021-10-06 13:24 ID:Heaven

>>12
Heliohost seems to be the standard choice, but if you're a little more serious about it you should really get a $5 vps, or just use an old computer for self-hosting.

17 Name: Anonymous : 2021-10-09 15:42 ID:eGj7ke6C

>>12
fka.cx

18 Name: Anonymous : 2021-10-09 16:31 ID:aBODQchZ

>>17
cy.krypka.veggiepierrogi.blyatt

19 Name: Anonymous : 2021-10-15 08:10 ID:GfGjCEK3

I'm learning to use the Godot development platform. I do this by working through the 'Nature of Code' book.

20 Name: Anonymous : 2021-10-16 14:36 ID:Heaven

Cool. I have no opinion on Godot, I know nothing about it. I'm learning winapi and gdi right now.

21 Name: Anonymous : 2021-10-19 02:39 ID:Heaven

>>16
$5? But I'm a NEET.

22 Name: Anonymous : 2021-10-19 05:42 ID:Heaven

neets worldwide, unite!

23 Name: Anonymous : 2021-10-19 16:13 ID:Heaven

My hdd seems to have died, any way I can fix it? Should've made at least the list of all files on it.

24 Name: Anonymous : 2021-10-19 17:09 ID:LJmj1GtX

25 Name: Anonymous : 2021-10-19 21:47 ID:j4f+nYp1

Planes are tech too especially drones
https://www.youtube.com/watch?v=E_A_rEZoXSg

26 Name: Anonymous : 2021-10-21 16:43 ID:myW7qTo/

Do you know why windows that run with administrator privileges show up on top of other windows? This is annoying as hell, I can't alt-tab out of them anymore, I have to minimize them instead. This happens with cheat engine for example, or with vmware. This is probably a windows 10 thing, after some update.

27 Name: Anonymous : 2021-10-21 19:35 ID:Heaven

This guy has the same problem, but damn it's hard to google something even remotely related. Of course no replies.

https://superuser.com/questions/1414298/switching-focus-away-from-windows-with-admin-rights

28 Name: Anonymous : 2021-10-22 15:05 ID:Heaven

The other most annoying part of C, besides; semicolons; everywhere;, is not being able to goto over variable declarations.

29 Name: Anonymous : 2021-10-23 06:23 ID:Heaven

>>25
Well, world war 2 is hopefully the last war to be fought with humans. Downside is that rich now have even less motivation to give a fuck about what people think.

30 Name: Anonymous : 2021-10-25 05:21 ID:myW7qTo/

char* from = (char*)from;
wow, compiler actually let me compile this.

31 Name: Anonymous : 2021-10-27 09:20 ID:Heaven

Pseud0ch and Boon themes are so similar. Red nicknames with Boon sure look threatening.

32 Name: Anonymous : 2021-11-12 08:38 ID:09RCGnjR

Thinking of writing a greasemonkey/violentmonkey script for this site. Here is the hello world for it, hides the "Board look" selection.

===========================start===========================
// ==UserScript==
// @name New script - 4-ch.net
// @namespace Violentmonkey Scripts
// @match https://4-ch.net/*
// @grant none
// @version 1.0
// @author -
// @description Add description here
// ==/UserScript==

var k = document.getElementById("stylebox")
if (k) k.style.display="none"
============================end============================

I'm thinking about adding a board switcher under the header instead of using this sidebar, and some kind of notification mechanism when new posts show up. https://www.4chan-x.net could be a good reference.

33 Name: Anonymous : 2021-11-12 08:55 ID:Heaven

I don't like how it flickers on loading now. But maybe once I'll add another line in its place it will be less of an issue.

34 Name: Anonymous : 2021-11-13 06:01 ID:Heaven

In some styles catalogue looks horrible, in some it looks somewhat bearable. It feels like some styles were written for the older version of this site and just weren't ever updated.

35 Name: Anonymous : 2021-11-13 06:33 ID:Heaven

Wasn't sure what would make a good separator for thread titles, but \n is perfect for it. There will never be newlines in thread titles.

Greasemonkey doesn't seem to be smart enough to let me store just any objects in it, only strings. So, I need to parse catalogue and store it as a string using https://wiki.greasespot.net/GM.setValue . I need that to be able to get notifications on which threads were updated.

36 Name: Anonymous : 2021-11-13 07:46 ID:Heaven

Man, I'd really love a way of returning more than one value out of a function, there is no technical reason for them to not being able to. Math fucked with people's brains, because mathematical functions indeed result in one value, but real world not always works like math models, and "functions" are more like procedures anyway.

Golang actually allowed that, bless it, but it added garbage collection in its language too.

I know the standard workaround for it is either passing a pointer to a function, or just using global variables, but that's not quite the same.

37 Name: Anonymous : 2021-11-13 09:03 ID:Heaven

I wrote this

for (var j = ii; j>0; j--) {
//something
}

But then rewrote it into this

{
var j = ii;
if (j > 0) do {
//something
} while (--j > 0)
}

I imagine "for" has one conditional jump at the start and one unconditional jump at the end, and "if do while" has two conditional jumps. I like the latter more, especially in cases where the first "if" isn't needed.

38 Name: Anonymous : 2021-11-14 04:44 ID:kZkkg+mu

CSS question, how can I stop links from being wordwrapped? I have this thing:

/general//hobby//personal//req//tv//japan//games//music//literature//ascii//dqn//tech//iaa//language//nihongo//current/

And each is a link. They wrap like this:

/general//hobby//personal//req//tv//japan
//games//music//literature//ascii//dqn
//tech//iaa//language//nihongo//current/

But I want them to wrap like this:

/general//hobby//personal//req//tv//japan/
/games//music//literature//ascii//dqn/
/tech//iaa//language//nihongo//current/

If I'll do white-space:nowrap for each link, this entire thing stops wrapping.

39 Name: Anonymous : 2021-11-14 17:16 ID:Heaven

Eh, fuck it, I'll just drop those // altogether.

40 Name: Anonymous : 2021-11-14 18:14 ID:Heaven

There was a site, it worked just fine. But they just had to update it, now it takes about 2 minutes to load, shits ads everywhere, and has an audacity to say "Your browser is too old! Please update your browser so that it will (((work faster)))!". No update ever made things faster, it's always the opposite.

41 Name: Anonymous : 2021-11-14 18:39 ID:Heaven

Interesting, so, to remove an element from a webpage in javascript you can either use element.remove(), which works since firefox 23, or element.parentNode.removeChild(element), which works since firefox 1. I guess I'll use the latter.
https://developer.mozilla.org/en-US/docs/Web/API/Element/remove
https://developer.mozilla.org/en-US/docs/Web/API/Node/removeChild
https://www.geeksforgeeks.org/how-to-remove-an-html-element-using-javascript/

42 Name: Anonymous : 2021-11-16 18:45 ID:kZkkg+mu

In C/C++/C#, conditional breakpoints are very slow, I like to do this instead
if (something) {
do {} while(false); //set breakpoint here
}

It is only noticeable in loops that iterate a whole lot, like 100000 iterations.

43 Name: Anonymous : 2021-11-17 03:45 ID:aI47xbKr

>>40
Vote with your feet.
Use politics to encourage others to vote with you.

44 Name: Anonymous : 2021-11-19 00:13 ID:Heaven

Almost done the "check which boards have new posts" greasemonkey script. 400 lines of code.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: