The main problem I have with regex and specifically this is that there's too many non-compatible syntaxes.When I was presenting my own app and a user wanted to search for something specific I told him to just type regex into the search field.
The main problem I have with regex and specifically this is that there's too many non-compatible syntaxes.When I was presenting my own app and a user wanted to search for something specific I told him to just type regex into the search field.
The main problem I have with regex and specifically this is that there's too many non-compatible syntaxes.
[...]
[...]
I'd recommend passing along an instance of TerrainGradient to the generateVoxelColor method.
public static TerrainGradient classic = new TerrainGradient(210, 185, 175, 70, 120, 25, 64);
public static TerrainGradient mountain = new TerrainGradient(245, 240, 235, 45, 40, 35, 64);
private static class TerrainGradient {
float Ra;
float Rb;
float Ga;
float Gb;
float Ba;
float Bb;
private TerrainGradient(float Rmax, float Gmax, float Bmax, float Rmin, float Gmin, float Bmin, float maxTerrainHeight) {
this.Ra = (Rmax - Rmin) / (maxTerrainHeight - 0);
this.Rb = Rmax - (this.Ra * maxTerrainHeight);
this.Ga = (Gmax - Gmin) / (maxTerrainHeight - 0);
this.Gb = Gmax - (this.Ga * maxTerrainHeight);
this.Ba = (Bmax - Bmin) / (maxTerrainHeight - 0);
this.Bb = Bmax - (this.Ba * maxTerrainHeight);
}
}
public static float generateVoxelColor(TerrainGradient gradient, float voxelYCoordinate) {
return Color.toFloatBits(
(int)(gradient.Ra * voxelYCoordinate + gradient.Rb),
(int)(gradient.Ga * voxelYCoordinate + gradient.Gb),
(int)(gradient.Ba * voxelYCoordinate + gradient.Bb),
(int)255
);
}
Regex is super powerful.
When I was presenting my own app and a user wanted to search for something specific I told him to just type regex into the search field. Apparently they didn't think this was a very good solution even if it's the best solution.
Telling an end user to use regular expressions is a terrible idea. Regex can be confusing to developers, let alone the average user.
This is it. At retro, they showed a graph of our velocity over time. Somebody said that velocity is not a measure of productivity, then the CTO said "good point. We need to find ways to increase our velocity."That's just bastardizing it into a classic business style. Points are just a means of tracking velocity so you don't overload and overcommit, you aren't trying to optimize them.
And you should be tracking longer meetings and refactoring (whether anyone wants to do that though...)
Ideally you would cross-compile on a workstation rather than compiling directly on the device. It takes maybe an hour on a desktop.Passed here just to comment that I'm porting Qt5 for an embedded device and the compilation process already surpassed 1,5 hour...
Fuck...Stucked at work 4:00 a.m
You can always increase velocity by assigning larger point values to your stories.This is it. At retro, they showed a graph of our velocity over time. Somebody said that velocity is not a measure of productivity, then the CTO said "good point. We need to find ways to increase our velocity."
Why not? Is there a better technique than regexes?
I take a lot of notes simply using the Windows NotePad and would love to replace it with something similarly lightweight, but capable of Markdown.
Any tips for Win10?
I really like Notepad++ (well, I really like Scite, and Notepad++ is mostly a variation), it's a good editor for anything (including Markdown), but I understood he wanted a notepad with the capability of portable, light text formatting. Notepad++ won't render the result itself...Sublime Text is a fairly sophisticated text editor, but it's super fast. Has some nice Markdown plugins. That's what I use for Markdown files. Notepad++ might be good as well.
I would compute intersections and do a modified Graham scan, which is, if I'm not mistaken, what you're doing, so I think that's right. Pretty sure I've looked for better solutions in the past and found nothing more convincing...The approach I have in mind:
test each edge against every edge extended as a line. Split edges at intersections.
Now I choose some point then walk the edge clockwise. If I run into a point with multiple edges, I always choose the edge that is moset "outward". When I'm back at the first point I'm done.
I think this should work but maybe I'm missing something or there's a more efficient way to do it?
There's plently of free quality stuff (also obviously great books for a couple dozen bucks, if you're interested in a specific subject).Are those books any good, especially for someone starting with programming and who wants to get a good look into different languages?
I need an algorithm to trace the resulting outline of axis aligned rectangles that are either adjacent or overlap. I guess another way to put it is that I want to merge several adjacent or overlapping rectangles into a single polygon while removing duplicate and interior points.
The approach I have in mind:
test each edge against every edge extended as a line. Split edges at intersections.
Now I choose some point then walk the edge clockwise. If I run into a point with multiple edges, I always choose the edge that is moset "outward". When I'm back at the first point I'm done.
I think this should work but maybe I'm missing something or there's a more efficient way to do it?
Out of curiosity, what algorithm do you use to compute efficiently the intersections? Bentley-Ottman?1.) Create 2 lists of points that include the original points and all intersected points in the order you traverse them (CCW or CW)
Pretty sure it'll be quicker to do everything at once, since there's log complexity involved, unless you're doing something clever with your set (prior knowledge of what touch what)Thanks! I'm gonna try and implement it now. Are there any advantages/disadvantages to adding one shape at a time instead of doing it all at once? I'm thinking that might reduce the number of intersection tests in my case.
Out of curiosity, what algorithm do you use to compute efficiently the intersections? Bentley-Ottman?
It's slightly easier with axes-aligned rectangles, even if the algorithm is mostly the same...
And you're doing this in 3D? Your points are coplanar, or how do you handle points out of the plane?
Isn't this O(n²)?Pretty much just iterate through each all points creating vectors and then calculating the intersection points of the vectors and then making sure that the calculated point lines on the line segment (prevents false positives on shapes with more than 4 points).
All you programmers pro out there, let me ask for some experience. Have you ever rolled out a tool or so for your company that definitely made the work process better for all the other colleagues. Then, you tried to get them to use it and there will be some who will stubbornly refuse? The tool in question is extremely user friendly and cuts down on many manual method in which some work is done. Now, with a click of a button, it is all done. It doesn't get any easier than that. Why do some people refuse to use when other colleagues have used it to great satisfaction and success? Do you ever feel like crap like you are not trusted by those who refuse to use your tool? Right now I am feeling pretty down about it because it makes me wonder if those people maybe don't trust my tool, and by extension, my own skill/value/worth.
To be more precise, I work in a small company so it is really just one person who is refusing to use my tool even after I showed him how and asked for his opinion. Straight up still won't use it.
Yeah true I understand. The problem is, it does affect other people's work. Basically, people in my company do their work and then send it to a server farm to get processed. The farm generally prioritize each job on a first come first serve basis if the job's "priority" value are the same. If a job comes into the farm at a higher priority, then it pauses all previous jobs to process the new higher priority job. Generally this is fine for emergency stuff but that doesn't happen often. Previous to the launch of my tool, colleagues will have to manually input in various stuff in order for the server to start processing the job. Well, I made a tool that automates that process so with a click of s button, your job gets sent to the farm for processing without having to manually put in other data. I have set my tool so that when it submits a job to the farm, it doesn't have the max priority setting because I want to leave room for emergency jobs like I've mentioned before. Well, this guy not only refuse to use my tool, he also always submit his job at max priority so everybody else's work gets paused when he submits his job. How selfish and rude do you have to be to always think your job is the most important and deserves all that priority? I've tried explaining this to him before too and he won't listenMy goal in life when I created tools was to make my life easier. Other people could or could not use it, that's on them, but it was really all about me. Is my life easier? Then I'm satisfied.
Now, if it turns out that your colleague not using the tool is actually making your life harder, then beat him or her with the nearest blunt object. That's my recommendation. Use violence to beat them into submission.
(Do not actually use violence.)
All you programmers pro out there, let me ask for some experience. Have you ever rolled out a tool or so for your company that definitely made the work process better for all the other colleagues. Then, you tried to get them to use it and there will be some who will stubbornly refuse? The tool in question is extremely user friendly and cuts down on many manual method in which some work is done. Now, with a click of a button, it is all done. It doesn't get any easier than that. Why do some people refuse to use when other colleagues have used it to great satisfaction and success? Do you ever feel like crap like you are not trusted by those who refuse to use your tool? Right now I am feeling pretty down about it because it makes me wonder if those people maybe don't trust my tool, and by extension, my own skill/value/worth.
To be more precise, I work in a small company so it is really just one person who is refusing to use my tool even after I showed him how and asked for his opinion. Straight up still won't use it.
I made a tool that let project managers specify project requirements and automaticaly generate all code architecture including unit tests. This was right before we all got laid off in a hostile takeover.All you programmers pro out there, let me ask for some experience. Have you ever rolled out a tool or so for your company that definitely made the work process better for all the other colleagues. Then, you tried to get them to use it and there will be some who will stubbornly refuse? The tool in question is extremely user friendly and cuts down on many manual method in which some work is done. Now, with a click of a button, it is all done. It doesn't get any easier than that. Why do some people refuse to use when other colleagues have used it to great satisfaction and success? Do you ever feel like crap like you are not trusted by those who refuse to use your tool? Right now I am feeling pretty down about it because it makes me wonder if those people maybe don't trust my tool, and by extension, my own skill/value/worth.
To be more precise, I work in a small company so it is really just one person who is refusing to use my tool even after I showed him how and asked for his opinion. Straight up still won't use it.
:O sorry to hear that. I promise though that this tool won't be killing jobs. It is a very standard tool used in my industry and the only reason my current company doesn't have it is the lack of expertise. It is a small company and people are just so used to doing this manually. However, go to any other companies within my industry and this part is automated like what I've just implemented. The real bulk of the work that we do isn't this particular step, hence why I am in favour of automating it so we can concentrate on the real work instead. All the big work is done and then sent to the server farm for processing. I am just making the submission part easier which is only good for us employees.I made a tool that let project managers specify project requirements and automaticaly generate all code architecture including unit tests. This was right before we all got laid off in a hostile takeover.
Are you new to programming? Just about anything is good when you're starting out.Hey yall, friend of mine says don't use LPTHW b/c 2.7 is outdated and should just jump into a tutorial with python v 3.x. Is this good advice? If so, any recommended tutorials?
Newish? I've done a bit of python and Javascript before, taken a couple college classesAre you new to programming? Just about anything is good when you're starting out.
As I said a couple days ago (and before), I think LPTHW is just bad... but that may be just me (well, not just me, apparently). And yes, I'm talking about *beginner* ressources. I'd say the official tutorial is better, but there may be better ressources.Hey yall, friend of mine says don't use LPTHW b/c 2.7 is outdated and should just jump into a tutorial with python v 3.x. Is this good advice? If so, any recommended tutorials?
You probably can just type "pip install firetv" in a shell (if you have both Python and Python3k installed, there may be issues, but if both are installed, 2 is probably the default)HI haven't the slightest what this means. How do I find this "environment"? I'm running Home Assistant on a Raspberry Pi 3 and would like to control my various media players, but have been stuck. Any help would be greatly appreciated
You probably can just type "pip install firetv" in a shell (if you have both Python and Python3k installed, there may be issues, but if both are installed, 2 is probably the default)
Which OS do you run on your raspi?
(Beware, pip is handy, but I don't trust this system at all, I think it's a huge security hole...
fn file_to_bytes(path: &Path) -> Result<Vec<u8>, std::io::Error> {
File::open(path).and_then(|mut file| {
let mut bytes = Vec::new();
try!(file.read_to_end(&mut bytes));
Ok(bytes)
})
}
What about it, the union return?https://www.reddit.com/r/rust/comme...jpeg_decoder_in_rust_part_2/d6obz7r?context=2
Code:fn file_to_bytes(path: &Path) -> Result<Vec<u8>, std::io::Error> { File::open(path).and_then(|mut file| { let mut bytes = Vec::new(); try!(file.read_to_end(&mut bytes)); Ok(bytes) }) }
Every time I think about picking up Rust I see code like this and get turned off. This makes enterprise Java look good.
Thanks for the response. I have Python 2.7. Pretty sure my OS is just Raspbian. I'm a complete noob with all this stuff, unfortunately. What exactly is a shell and how do I find it? Thanks again.
The shell is the DOS-like* command prompt*. It's one of the cores of a good operating system.
I haven't used raspbian so I'm going off of google images...so forgive me if this is off:
You'll want to open up the Terminal from this image. Looks like it is located in Menu --> Accessories --> Terminal
I'm assuming you used this to confirm your python version (using the python --version command)
Just paste that command in the terminal.
AHAHAHAHAHhttps://www.reddit.com/r/rust/commen...bz7r?context=2
Every time I think about picking up Rust I see code like this and get turned off. This makes enterprise Java look good.Code:fn file_to_bytes(path: &Path) -> Result<Vec<u8>, std::io::Error> { File::open(path).and_then(|mut file| { let mut bytes = Vec::new(); try!(file.read_to_end(&mut bytes)); Ok(bytes) }) }
Shell = command line (in a terminal), where you can enter commands to install things.Thanks for the response. I have Python 2.7. Pretty sure my OS is just Raspbian. I'm a complete noob with all this stuff, unfortunately. What exactly is a shell and how do I find it? Thanks again.
It's C++? Only standard lib includes?1). I just send source code, right?
I'd say that it depends on which kind of job you're applying for. If it's for software development, I'd say style and possibly tests plays a role. If computing is a tool in the job, just a sane algorithm will probably be sufficient.2). Is there a programming style for these sorts of questions? This is basically a Project Euler level question and doesn't require the full machinery of C++. Should I be putting in consistency checks, etc.?
https://www.reddit.com/r/rust/comme...jpeg_decoder_in_rust_part_2/d6obz7r?context=2
Code:fn file_to_bytes(path: &Path) -> Result<Vec<u8>, std::io::Error> { File::open(path).and_then(|mut file| { let mut bytes = Vec::new(); try!(file.read_to_end(&mut bytes)); Ok(bytes) }) }
Every time I think about picking up Rust I see code like this and get turned off. This makes enterprise Java look good.