Select your region
and interface language
We’ll show relevant
Telegram channels and features
Region
avatar

Programming ∀

programming_everyone
Ushbu kanalda dasturlashga aloqador turli expriementlarim, g'oyalarim, hulosalarimni ulashaman.
Subscribers
1 321
24 hours
30 days
5
Post views
244
ER
18,47%
Posts (30d)
52
Characters in post
635
Insights from AI analysis of channel posts
Channel category
Technology and Apps
Audience gender
Male
Audience age
25-34
Audience financial status
Middle
Audience professions
Technology & Software Development
Summary
September 10, 18:30

https://gist.github.com/bahrom04/9c03a17f278eebc599a5b3d31abc95ef

September 10, 18:30

https://gist.github.com/bahrom04/9c03a17f278eebc599a5b3d31abc95ef

September 09, 06:12

Korporativ portal loyihasiga 2 ta tajribasi bor (middle) backendchilarni UZINFOCOM'ga ishga olamiz. Rust o'rganish va WASM bilan ishlash talabi bilan.
Iltimos, CV'ni
@aeshakhzod
ga yuboring.

September 09, 05:47
Media unavailable
1
Show in Telegram

Concurrent requst sending and connection pool done.
Gulini guliga qo'yib tashladim
😎
Applega notificaiton send qilish uchun APNs bor va u Http2 da ishlaydi. Biz matrix notification getway yozish doirasida apple/google notificationlar send qilish uchun driverlarni ham o'zimiz ishlab chiqdik.
Apple notificaitonlar http2 da ishlaydi va bilamizki http2 connection pool ham support qiladi. Shundan foydalanib, apns driverda har bir requestga alohida emas balki bitta poolga request yozadigan mexanizm qildim.
Shunda connectionda requestlar queuega tushadi va o'zini statesiga ega. State responseni yozish uchun kerak.
runSession
qilinganida esa queuega kelgan APN requestlarni o'qiydi va bittalab yozib chiqadi.
Endi buni prikol tarafi biz buni Poolinga ulab turib concurrent requestlarni nazorat qila olamiz. Ideya xozircha shunchaki proof of concept ammo o'zimga yoqib ketdi :)

September 08, 03:50
Media unavailable
3
Show in Telegram

Mikkimauslar bitta modulda
71ta if
14 ta else
14 ta elif
Qiziq bo'lsa:
https://github.com/matrix-org/sygnal/blob/main/sygnal/apnspushkin.py
Shuncha conditionlar shuncha checking. Adashib qolasiz edge caselarda.
Odamlar o'ziga gemaroy yasab olib shundan kayf qilsa kerak. Bu yerda muammo tilda ham emas ko'proq shu modulni shunaqa dizayn qilgan odamlarda. Endi bunaqa narsani to'liq redesign ham qilaman desangiz clientda ham shu yangi designga integratsiya kerak.
Umuman olganda biror loyiha boshlayotgani o'zida juda ham ko'p narsani oldindan decide qilish kerak. Loyihaga mos mindset qurish kerak. Bilmayman bu project nega bunaqa axvolga kelgan ammo aniq biladiganim technical dept bilan yomon ishlashgan. Buning sababi esa matrix protocoli ham asosan feauture oriented refactoring qiladi. Yani bug, feauture chiqmasa ishlayabtimi tegma deydi.

September 08, 01:37
Media unavailable
2
Show in Telegram

Haskell versiya tokeni o'zi normalize qiladi contentga qarab.
Piton versiya esa configa qaraydi.
Which better ?

September 08, 01:32
Media unavailable
1
Show in Telegram

tushunarsiz tilda tushunarsiz kod bilan tushunarsiz config fieldlarni tekshirilgan.

September 07, 20:00

Hiding text inside an image Recently I was assigned with really interesting task, hiding some data inside photo. Well, basically, image is just an matrix of pixels, and matrix is just 2D array. Now we have a question, wth is a pixel? Normally, pixel is consisted…

September 07, 19:59

Hiding text inside an image
Recently I was assigned with really interesting task, hiding some data inside photo. Well, basically, image is just an matrix of pixels, and matrix is just 2D array.
Now we have a question, wth is a pixel?
Normally, pixel is consisted from 3 colors: red, green, blue and sometimes it even has alpha channel which defines the transparency level of the color.
How is the pixel represented in a display?
To put it simply, we just tell the computer how much red/green/blue we want in particular pixel in the range
0..255
each, and they are merged together to create one new unique color.
For example purple is
rgb(191,0,255)
which has 74.9% red, 0% green and 100% blue in it.
Now imagine, if we just increase the red channel from 191 to 192, will it be noticable to human eye? Of course no.
And we are talking about just 1 pixel here, how much would actual photo would change if we change its some pixels color to just 1% more or less? Almost none right?!
Okay, but why do we even need this information?
If we can change that one color channel, can’t we just change it to some meaningful thing, letter for example. And can’t we change more pixels the same way? We can!
So we can technically
hide a text inside an image
!
I know you are all interested so let’s just move to code then) I use Rust for this case. First of all, let me show you the code so u can grasp the full picture.
Encoding:
static SRC: &str = "Reze.png";
static DEST: &str = "result.png";
static TEXT: &str = "Denji";
static PATTERN: &str = "!@#$";
let text: Vec<_> = format!("{PATTERN}{TEXT}{PATTERN}").into();
// load the image
let mut image = open(SRC)?;
image
.clone()
.pixels() // take pixels
.enumerate() // add indexing behaviour
.take(text.len()) // only take starting pixels
.for_each(|(i, (x, y, Rgba([r, _g, b, a])))| {
// replace green channel with hidden text
image.put_pixel(x, y, Rgba([r, text[i], b, a]));
});
// save the image
image.save(DEST)?;
So we load the source file, extract the pixels, take only reasonable amount pixels we need to hide the text.
Every pixel contatins x,y coordinates and rgba value. We replace the green channel in that pixels with our hidden text’s characters one by one.
Congratulations, you successfully hided the text inside image!
If you’ve noticed, there is also alpha channel (transparency), since I am using
.png
image format it is supported, but it might not be supported in other types like
.jpg
/
.jpeg
or
.bmp
You might be wondering,
what is the PATTERN constant doing here?
We just need it to successfully extract the hidden text. Because if we just use the indexes to indentify the hidden text, we may not be able to decode it if image saving logic does some magic behind the scenes. So using patterns before & after the data is more reliable option.
Decoding:
let pattern = PATTERN.as_bytes();
let image = open(DEST)?;
// getting only green channels of pixels
let pixels = image
.pixels()
.map(|(_, _, Rgba([_r, g, _b, _a]))| g.clone())
.collect::>();
// creating text-length chunks from pixel array, and searching for a chunk that satisfies our hidden data
let result = pixels
.chunks(text.len())
.find_map(|x| x.strip_circumfix(pattern, pattern));
println!(
"Hidden text is: {:?}",
String::from_utf8_lossy(result.unwrap_or_default())
);
Now, you successfully decoded the hidden text too. I hope it was fun and helpful post that can also encourage you to learn more about programming.
🔗
Code on
GitHub
Credits to
@programming_everyone
for giving me this idea.

September 07, 10:32
Media unavailable
1
Show in Telegram

Agar biror kodni imperativ tildan tog'ri haskellga olib o'tsang....
Nu interfacelardagi backward capability sababli manashunaqa narsalar qolishi kerak.
Lekin haskellda redesign qilish ham uncha oson emas aynan qayerdadir nimadirni check qilish qolib ketsa shu bilan cooked bo'ladi.
Hullas rewrite doyim ham chiroyli, oson bo'lmaydi...