Write a java console application that allows the user to read, validate, store, display, sort and search
data such as flight departure city (String), flight number (integer), flight distance (integer), flight
price (double) and discounted flight price (double) for N flights. N should be declared ...
I hate it when I get really proud of an elegant and well-golfed solution, and then see that there's a really trivially obvious approach that I missed completely and my original solution is about 5x longer than a sensible non-golfed implementation of the obvious approach.
It's like making a rube-goldberg machine fit in a cubesat when you could've just used a paperweight.
Definition
Given a matrix \$M\$ of non-negative integers and a non-negative integer \$k\$ we define \$F_k\$ as the function that removes all rows and all columns in \$M\$ that contain \$k\$.
Example:
$$\begin{align}M=\pmatrix{\color{magenta}6&\color{magenta}1&\color{red}5\\1&2&\color{magenta}8...
Looks interesting. I might give it a try later if I have the time and no one beats me too it. My gut says that it likely won't get the shortest solution though :P
'A simple matrix puzzle' is not a very descriptive title... Maybe I should change that to 'Chop off the matrix and get the correct sum' or something along those lines?
@Arnauld I like that. I had Discard the intruders in a matrix to get the desired sum in mind, or something among those lines. I like yours better, though
@EriktheOutgolfer Well, I'm happy with the current title even if it's not particularly fun. Updating the title several times in a row is probably not a very good idea, so I'll make sure to ask before posting the next time. :)
Currently losing to both 05AB1E and Pyth, but my approach is rather naive right now so that should change eventually (I do think Jelly might have the advantage here, though 05AB1E might still win. Not sure yet).
@Adám I'm assuming Dyalog is trustworthy enough for me to provide it with my address... or should I just use unregistered Dyalog, or how should I run APL?
Ex i input 10.98 and i want to display .98 but the answer on my code is 0.98. Can someone help me? Thanks
Double numOne,numTwo;
System.out.print("Enter a decimal num: ");
numOne= Double.parseDouble(br.readLine());
numTwo = numOne - Math.floor(numOne) ;
System.out.printf("%.2f", numTwo);
Expressif just released their ESP8266 (a very popular and fast microcontroller) successor. It's about 50ct more expensive ($5), but has 1 more CPU core, double the CPU clock freq on all cores, 4x bigger flash and 131x more RAM. Exciting times.
So Microsoft had a rather significant outage yesterday. So they "fixed" it:
> As part of our follow-up remediation actions stemming from the issue reported under service incident MO147606, an update was introduced to the components that manage authentication. We've determined that this update has resulted in users receiving a message indicating they are being throttled when attempting to access Outlook and Skype. We're reverting the update to remediate the problem.
Your task is to write a non-empty computer program comprised of some sequence of bytes. If we choose a particular byte in the program and remove all instances of it from the program, the modified program should output the removed byte.
For example if our program were
aabacba
Then bcb would o...
I'm continuing my Windows kernel experiments and I'm glad to say I'm making good progress on adding a Brainf#ck subsystem, so one can run BF code with a single syscall.
I mean the actual kernel, not code in kernel mode. The way it works with the Windows kernel is that you build it, place it (the init, HAL etc.) into System32 and use the boot-switch kernel to load your new custom kernel. Depending on the destructiveness (do you get a GUI or not), you can do local kernel debugging on the machine itself or attach another PC via Serial and debug over that.
This is my favorite of the comments I've encountered today (in the LSA audit log code):
// Post NT5 auditing will provide a better/flexible design that will address
// this issue. For now, to delight some valuable customers, we provide this
// hack / registry based solution. This solution will be removed post NT5.