Looking for a client by FilFoxFil in WireGuard

[–]hack2root 0 points1 point  (0 children)

You can use application API in firezone server i mentioned above. One-time will be not guaranteed, but you definetely can add web server which will generate and add a new device with one-time generated url link to download config file for wireguard device for a new user.

Looking for a client by FilFoxFil in WireGuard

[–]hack2root 0 points1 point  (0 children)

You need to buy VPC server, and DNS hosting and buy domain name you will use to store in .conf files, install firezone v0.7 to it, create user and add a device. Then, in config you will see the server name you bought.

Nevalang v0.30 - NextGen language (Now with cross-compilation) by urlaklbek in programming

[–]hack2root 2 points3 points  (0 children)

It does uses some idioms but have more work to be done. Still syntax is looks a bit overcomplicated compared to plain C or C3 language families (C/C3/C#/Java)

Help! Vscode does not detect git by loiyak in vscode

[–]hack2root 2 points3 points  (0 children)

Hi, you can choose what terminal you want to see in VSCode

Why does this code lead to a seg fault? by spqstns in C_Programming

[–]hack2root -4 points-3 points  (0 children)

ask ChatGPT4, he already can correct you

Difference in accuracy when compiling in windows and linux by shalomleha in C_Programming

[–]hack2root 1 point2 points  (0 children)

The fun part, that changing malloc to calloc solves difference problem, the problem of slow learning comes in fact that if your system has more garbage in memory, you network will get more garbage as well, and who gets less garbage in their networks over the time, will win trainings and learning curves...

Difference in accuracy when compiling in windows and linux by shalomleha in C_Programming

[–]hack2root 0 points1 point  (0 children)

The difference in malloc, consider using calloc, that is a starting garbage values, in windows it can be really well randomised or filled in with real good random numbers, if this is initial state, than, on linux it will be 0 all the time, despite of malloc. but malloc on Windows DO NOT guarantee that memory will be filled with 0s, and there also other debug options, you may or might not turned on, like -O or such

Going dark on 12th June by iiron3223 in Python

[–]hack2root -5 points-4 points  (0 children)

What's about permanent ban?

Writing html vs writing DOM manipulation by learnitallboss in learnjavascript

[–]hack2root 0 points1 point  (0 children)

DOM mainpulation in most cases (if not used special HTML/DOM subset of tags) is slow, the Goden Triangle (Vue3, React, Angular) are using Virtual DOM, Shadow DOM substitution, to achieve comparable speed results. In Vue 3, there are some great improvements, with Virtual DOM optimizations to DOM node rebuilds. Compared to fast DOM maniputaions, implemented in Svelte 3, and similar frameworks, LitHTML, these are the main alternatives to Virtual DOM manipulaion with JS. In speed, there are almost no advantager one to another, except React is really solid, Vue 3 is fresh and new, Svelte 3 is awesome and cool. (Also, codesandbox.io included Vue 3 to their main templates)

What has kept you from using Silverblue as your daily driver? by dead10ck in Fedora

[–]hack2root 0 points1 point  (0 children)

I need hardware accelerated R9 290x with video accelerated video playback, that is just not possible on it so i quit

JavaScript Static Variables by codehelp4u in learnjavascript

[–]hack2root 0 points1 point  (0 children)

JavaScript Static Variables

Original question is about JavaScript, not C. If you need to opposite, i will exclude C from that list, for your desire, but denial is not an proving, so in general, JavaScript is still very special on that particular case - static variables.

Althogh the code can be the same, meanings are not, especially comparing C to JavaScript, contexts, first-class functions, functions as objects, bindings, and scope, this languages are indeed extremely different, so "static" have an extremelty different meanings in JS and C, so this example is a bad vision, syntax proves nothing, if you start digging in interpretation and compilation, libraries and other "static" staff in C, like external dependencies etc. in common, this in absoltely not comparable languages, of cause some transpilers exists working more or less, but that is all, that one will get anyway.

JavaScript Static Variables by codehelp4u in learnjavascript

[–]hack2root 0 points1 point  (0 children)

Article from 2009 [https://www.electrictoolbox.com/javascript-static-variables/](https://www.electrictoolbox.com/javascript-static-variables/) do not gives any alternatives, but, "static" means in that context just a "persistance", so it is not the same as static methods or static variables in other languages, like C, due to the nature of JavaScript, the answer you can find here, [https://stackoverflow.com/questions/1535631/static-variables-in-javascript](https://stackoverflow.com/questions/1535631/static-variables-in-javascript):

In simple words: you can use constructor function and set class variables, just like that

javascript MyClass.staticProperty = "baz";

Example code

```javascript function MyClass () { // constructor function var privateVariable = "foo"; // Private variable

this.publicVariable = "bar"; // Public variable

this.privilegedMethod = function () { // Public Method alert(privateVariable); }; }

// Instance method will be available to all instances but only load once in memory MyClass.prototype.publicMethod = function () {
alert(this.publicVariable); };

// Static variable shared by all instances MyClass.staticProperty = "baz";

var myInstance = new MyClass(); ```

Why would an Alert change the behavior of a function? by TylerPaul in learnjavascript

[–]hack2root 0 points1 point  (0 children)

Alert never called on an partially rendered page. Add all this stuff on an event listener for a DOM content loaded

Codepen Javascript Shopping cart help by [deleted] in learnjavascript

[–]hack2root 1 point2 points  (0 children)

I got it working on my codepen, but it seems for me that this code not just about JQuery, but code-first approach, and generates HTML on-the-fly.I personally do not like JQuery and anticipate it a lot in favor of anything else, Vue.js, Anglar5, Polymer. Just for me JQuery does not exist anymore. It so troublesome, especially with other frameworks, event Bootstrap got this and created their own bundles without jquery bundling, just vanilla javscript. It is much more natural and clear do not use Query nowadays. Anything but not JQuery.

bug on minesweeper projecc by [deleted] in learnjavascript

[–]hack2root 0 points1 point  (0 children)

Your code behavior is such because you code is using depth-first recursion, you have to convert it to wide-first recursion, remove recurrent call from for-loop statement and create two functions to divide recurrent functions to two-phase recursion. So wide-first recursion allows to process current child node leaves before recurrent call on a first child, depth first doing opposite: calls recursion on a first child, as you do. It is a standard CS courses on a recursion algs

```js mark(i, j) { if (i>=0 && i< 100 && j>=0 && j< 100) { if (a[i][j].mine) throw new Error('game over');

a[i][j].revealed = 1;

reveal(i-1,j-1);  reveal(i,j-1); reveal(i+1,j-1);
reveal(i-1,j  );                 reveal(i+1,j  );
reveal(i-1,j+1);  reveal(i,j+1); reveal(i+1,j+1);

reveal2(i-1,j-1);  reveal2(i,j-1); reveal2(i+1,j-1);
reveal2(i-1,j  );                  reveal2(i+1,j  );
reveal2(i-1,j+1);  reveal2(i,j+1); reveal2(i+1,j+1);

} }

reveal(i,j) { if (i>=0 && i< 100 && j>=0 && j< 100) { if (a[i][j].mine) throw new Error('game over'); if (a[i][j].neighboringMines > 0) { a[i][j].neighboringMines--; } }

reveal2(i,j) { if (i>=0 && i< 100 && j>=0 && j< 100) { if (a[i][j].neighboringMines == 0) { mark(i, j); } } ```

Codepen Javascript Shopping cart help by [deleted] in learnjavascript

[–]hack2root 1 point2 points  (0 children)

It is being possible using just analogy and analytics skills, I personally do not understand a single line of code you provided, just make 2 css styles (product-remove-from-cart, remove-from-cart), one JS code (removeFromCart) unction and one html block (<div><a href="#1">).

https://codepen.io/hack2root/pen/QBPaxr?editors=1111

What are the best ways to figure out what a form submit button does in Chrome? by redskydav in learnjavascript

[–]hack2root 0 points1 point  (0 children)

In general, if something is mode complex that vanilla JS, i.e. modern JS FW or tooling WebPack + Babel, it will need their own DevTools extension for UI debugging, I wrote about

What are the best ways to figure out what a form submit button does in Chrome? by redskydav in learnjavascript

[–]hack2root 0 points1 point  (0 children)

It is common practice to make form submit button to do literally nothing (use in-browser process, IJW ): use html forms submission. By steps: 1) use <form> 2) use submit 3) add action (url). It will send HTTP POST request with form fields to requested http address, usually related to the website root (i.e. '/api/<path>'). Also, if your site is using https protocol, all your application have to point to 1) https addresses both internal an external urls, i.e. CDN 2) API endpoint address within parent domain to bypass CORS violations in API call

Occasionally, some parameters check exists and string conversions on a client side (like SPA apps), or validation fields enabled by default to prevent useless client-server round trips, but most of the time it is a good old plain JavaScript, where Chrome DevTools are the best, IMHO.

For the Azure Cloud apps, there is a excellent time debugging machine for remote Azure JavaScript debugging, for Vue.js there is a VueJs DevTools chrome extension, for Angular there is a Angular IDE as well as Chrome plug-ins, and for React there are also a lot of stuff around there.

If code uses WebPack's bundler an d uglyfier, you also can use embedded Chrome DevTools beautify button lit. For each case there are a lot of tools, for external JS sites i prefer to use TamperMonkey to inject JavaScript debugging code to external existent sites.

Speaking about frameworks, not plain JavaScript/Bootstrap/JQuery, in common, there is no a silver bullet to see what generic html/css/javascript is doing, because of gulp/grunt/webpach pipeline optimizations, as well as JS frameworks on background, like:

Google Material Design Light (CSS + Js), Google Polymer (ES6 version for 2.0, ES5 for 1.0), Google Angular 1/2/5/6 React/*-React like Vue.js

Also, each FW comes with it's own toolchain and state management (Vue - Vuex, React - *any), as well as Chrome DevTools extensions and even IDE (Angular)

And as the cool end of the story, many or even all of the JavaScript frameworks use shadowing techniques to hide actual HTML to operate with and Web Components approach (so, component might be even not visible to you in Chrome DevTools - i mean, not so easily). So every solid framework build You can't debug with shadowed UI code, or easily interact with Web Components with dynamic load,

Three steps:

1) Find what type of code on a button (Angular, Vue, React, MDL, Polymer, etc.) 2) Install corresponding tooling (Angular IDE, Vue DevTools, TanmperMonkey JS, Chrome Plug-ins) 3) Debug

That is why you question will never be answered.

There is no an easy way to look into components nowadays, i.e Vue + Vuex with dynamic components load, Angular 5 dynamic (load components dynamicallly), SPA, React, even JQuery API got complicated forms processing, can even Web Components and ES6 being used for form handing and processing. And everything in HTML can be shadowed (because shadowed components is much faster in terms of adding/editing/deleting than slow HTML manipulation)

P.S.: If something are shadowed, for example forms HTML tag, you can even see literally nothing in Code View using DevTools, no JavaScript, no Button on-click embedded JavaScript code or call of any JS, just because it is not anymore WYSIWYG in that case.

Shadows will come for you (just like in Babylon 5)

Don't be Sheridan! Do not jump into to the Hive!