« first day (1000 days earlier)      last day (3117 days later) » 

12:49 AM
0
Q: Getting a reader for a byte array

viraptorI'm trying to test some code which takes a reader. I've got a function: fn next_byte<R: Read>(reader: &mut R) -> ... How can I test it on some array of bytes? The docs say that there's a impl<'a> Read for &'a [u8], which would imply this should work: next_byte(&mut ([0x00u8, 0x00][..])) But...

 
@LightnessRacesinOrbit yeah... I had to close out of the channel quick at work when this popped up...
 
1:40 AM
0
Q: Is it possible to have safe mutable aliasing to non-overlapping memory?

DougI'm looking for a way to take a large object and break it into smaller mutable child objects, which can be processed in parallel. Something like: struct PixelBuffer { ... } struct PixelBlock { ... } impl PixelBuffer { fn decompose(&'a mut self) -> Vec<Guard<PixelBlock>>> { ... } } Whe...

 
 
4 hours later…
5:53 AM
0
Q: Rust & Serde JSON deserialization examples?

vegaiI'm trying to figure out how to deserialize JSON into a structure using Serde. For instance, the example JSON on serde_json's own documentation at https://serde-rs.github.io/serde/serde_json/serde_json/index.html contains the following data: { "FirstName": "John", "LastName": "Doe", ...

 
 
2 hours later…
7:28 AM
$('.checkboxitem').each(function() {
var purchased = $(this).closest('.renderedItem').find('.purchased input').val();
if(purchased==0 ){
$(".addselected, .removeselected").addClass("active");
}
 
1 message moved from JavaScript - Zoom Zoom Zoom!
 
$('.checkboxitem').each(function() {
var purchased = $(this).closest('.renderedItem').find('.purchased input').val();
if(purchased==0 ){
$(".addselected, .removeselected").addClass("active");
}});
 
1 message moved from JavaScript - Zoom Zoom Zoom!
 
 
2 hours later…
9:28 AM
function parse(el) {
container.insertAdjacentHTML('beforeend', el);
}
for (i = 0; i < 100; i++) {
parse(someElement);
}
 
1 message moved from JavaScript
 
10:28 AM
i did var maxLength = 5;
Event.observe('myTextArea', 'keydown', function (event) {
if ($('myTextArea').value.length == maxLength) {
Event.stop(event);
return false;
}
});
 
1 message moved from JavaScript
 
10:40 AM
@Mgetz hmm sorry didnt think of that
in fact, bollocks that means I can only Bar from my mobile today... lulz...
www.youtube.com/watch?v=LIiwBNvTllk
hjff
jjutvgd
that should get us started
1 message moved from Bar ♻️
12 messages moved from Bar ♻️
 
 
2 hours later…
12:58 PM
@Squiggle santorum The sometimes frothy, usually slimy, amalgam of lubricant, stray fecal matter, and ejaculate that leaks out of the receiving partner's anus after a session of anal intercourse. Named, by popular demand and usage, after legislator Rick Santorum because of his homophobic political statements.
 
1 message moved from C#
 
 
4 hours later…
4:36 PM
0
Q: How to store recursive ref inside of a struct

Kalita AlexeyLet's assume the following struct struct Item<'a> { items: Vec<&'a Item<'a>> } Let's assume the following variable contains many Item objects with empty items field. let mut items: Vec<Item<'a>> = get_items(); Let's assume I have the task to add to items field of each Item the reference...

 
 
5 hours later…
9:59 PM
0
Q: Returning a type, not an instance

HernanIs there a way in Rust to return a type that implements certain trait from a function (I do not want the instance, but the type). Something like this (which does not work in its current form): trait MyTrait { fn sum(&self, val: i64) -> i64; } #[derive(Debug)] struct X { x: i64, } impl ...

 
39 messages moved from Rust
 

« first day (1000 days earlier)      last day (3117 days later) »