Praznje marnje.

petek, maj 24, 2019

Concurrency Conflicts in the Entity Framework

_context.Entry(tableToUpdate).Property("RowVersion").OriginalValue = rowVersion;

Then when the Entity Framework creates a SQL UPDATE command, that command will include a WHERE clause that looks for a row that has the original RowVersion value.
If no rows are affected by the UPDATE command (no rows have the original RowVersion value), the Entity Framework throws a DbUpdateConcurrencyException exception.


petek, oktober 26, 2018

Angular.js web-api MVC MVVM

Angular Tutorial
https://code.visualstudio.com/docs/nodejs/angular-tutorial

Visual Studio 2017: Tutorial: Create a Node.js and Express app in Visual Studio
https://docs.microsoft.com/en-us/visualstudio/javascript/tutorial-nodejs?view=vs-2017

MongoDB, Express, Angular, Node.js (MEAN) stack - Getting Started

MEAN stack - Ted Neward

Nice introduction to Single-Page Application from end of 2013
ASP.NET - Single-Page Applications: Build Modern, Responsive Web Apps with ASP.NET
https://msdn.microsoft.com/en-us/magazine/dn463786.aspx


ponedeljek, maj 14, 2018

7z differential archive/backup

With use of the -u switch one can create differential archive file.

To Create Differential Archive File

1. full archive

This creates base for tracking file change.

7za a archive.7z  path_to_folder  -ms=off -mx=9 -t7z

2. differential archive

This will write updates to diffarch.7z. Original archive.7z will not be changed.
7z does not issues warning if full archive does not exist when running differential. The differential holds all files (it behaves as 'a' command).

7za u archive.7z  path_to_folder  -ms=off -mx=9 -t7z -u- -up0q3r2x2y2z0w2!diffarch.7z

This will update original archive.7z.

7za u archive.7z  path_to_folder  -ms=off -mx=9 -t7z -up0q3r2x2y2z0w2


To Restore From Differential File

1. full archive

7za x archive.7z -oc:\recovery_path\

2. last differential archive

7za x diffarch.7z -aoa -y -oc:\recovery_path\


Explanation

Make sure to disable solid mode -ms=off as, according to 7z manual, "the updating of solid 7z archives can be slow, since it can require some recompression". Other switches are for compression rate, archive format, overwrite all existing files without prompt, and confirm all questions. Some features are supported by 7z format only.

-u switch

The letters:

p – File exists in archive, but is not matched with wildcard.
q – File exists in archive, but doesn't exist on disk.
r – File doesn't exist in archive, but exists on disk.
x – File in archive is newer than the file on disk.
y – File in archive is older than the file on disk.
z – File in archive is same as the file on disk
w – Can not be detected what file is newer (times are the same, sizes are different)


The numbers:

0-  Ignore file (don't create item in new archive for this file)
1 - Copy file (copy from old archive to new)
2 - Compress (compress file from disk to new archive)
3-  Create Anti-item (item that will delete file or directory during extracting). This feature is supported only in 7z format.

7za

7za / 7za.exe  - is contained in extra download:  7z<version>-extra.7z

Caveat

Do NOT use the 7z, gz, or zip for system backup purposes, because those programs do not store the owner/group of the files.

On Linux/Unix use tar for backup.

To backup a directory
tar cf – directory | 7za a -si directory.tar.7z

To restore your backup :
7za x -so directory.tar.7z | tar

Original two blogs

sobota, december 23, 2017

sreda, april 20, 2016

O spolu in spremembi spola

"(...) se uporablja izraz potrditev oz. priznanje spola, ki je bilo prisotno že ob rojstvu, pa ga zdravnice_ki niso prepoznale_i kot takega, saj se spol novorojenčku običajno določa le na podlagi ene same informacije – izgleda zunanjih genetalij, in ne sprememba spola, ko govorimo o posegih v telo. Pravno priznanje spola pa, ko govorimo o spremembi EMŠO, spolnega označevalca in/ali imena v dokumentih. Edino merilo za določitev spola osebe pa je samoidentifikacija – torej, kako oseba sama doživlja svoj spol."

Opomba iz raziskave https://www.1ka.si/a/93350

sreda, april 13, 2016

Outcome of Koran Teaching

"Sam Harris is out there saying that ISIS is the inevitable outcome of fundamentalist Islam."
Hey, let's be fair. It's not necessarily ISIS. It could be Boko Haram, Al Quaeda, Muslim Brotherhood, Hamas, Ansar al Sharia, Al Shabaab, Islamic Jihad Union, Harkat al Jihad al Islami, Hezbollah, Islamic Revolutionary Guard Corps-Quds Force, Haqqani Network, DO I NEED TO GO ON? There are literally hundreds of these fucking groups...

torek, marec 22, 2016

This is Why We Should Worry

"a distinct shift in the dominant ideologies of these terrorist groups over time, with the proportion of emerging ethnonationalist/separatist terrorist groups declining and the proportion of religious terrorist groups increasing"

sobota, marec 12, 2016

Simple geometry and mathematics

"Let me give you an example: It's noon in your corner of disc-world and the sun is directly overhead. Let's say it's 3000 km overhead, though you can use any distance at all, and the final result proves the same fact. (and stands by itself)
Now, some time later (any amount of time, again, this has no effect on what we are proving here with this math that stands alone) the sun is directly overhead for someone 1000 km away. It's no longer overhead for you, and appears lower in the sky. Do the math. The sun now appears 71.57 degrees above the horizon. So...what about if it were mid-day for someone 10,000 km away... The sun now appears at 16.7 degrees above the horizon. Gotta be sunset soon, right? What about 20,000 km away? 8.53 degrees... will this day never end? Okay, what about 100,000 km away? Damn! The sun is still 1.27 degrees above the horizon. What if it were noon a billion km away? Well, damn! That sun is still above the horizon. 0.00017 degrees in fact. And now it's mid-day at some point in flat-space that's nowhere near any part of the planet and everyone on earth is looking at a sunset. I was being generous and allowing the sun to keep moving in a straight line. The problem for the flat earth fantasy gets even worse, when you have it circling overhead within the confines of the surface of the earth. In fact, one can prove, using math, that the sun never goes below the horizon on disc-world. And, since it's 100% irrelevant how high the sun is or how far away it goes, the math does not depend on us knowing or finding out any other value. No measurement needs to be taken. The math stands alone. drops mic"