I am using Guava's bloom filter library and I need to iterate through the bloom filter so that I can create sub bloom filters. Does anyone have any experience using this library have an idea how I'd do this? Thanks in advance
my code works with the example input but get stuck in an infinite loop when i use the puzzle input.
here is my code
require 'pry-byebug'
@wires = {}
def is_integer? n
return n.to_i.to_s == n
end
def first_pass
File.readlines('input.txt').each do |line|
line = line.split("->")
sign...
The following script is a Golly script that searches for positions where one in a list of still lifes can create a Herschel (or another pattern specified in the "herschels" list) when reacting with the pattern already in the board.
import golly as g
from sys import exit
herschels = []
herschels...
Write a method named hasMidpoint that accepts three integers as parameters and returns true if one of the integers is the midpoint between the other two integers; that is, if one integer is exactly halfway between them. Your method should return false if no such midpoint relationship exists.
...
@Gustavo6046 If there's extra information people might need to review your code, the least you could do is provide a link to it. Preferably just include the relevant info in your question.
I have a project I am working on, and I would like some, or all of it
reviewed, how can I ask for this review on Code Review in a way that
produces the best possible value?
This is not about a question being on-topic, or off topic. Rather, this is about making on-topic questions great qu...
@Gustavo6046 We often omit the language from the title, but we ignore that rule often enough. At least it's quite descriptive, but it's a tad too long.
This the app that i have coded so far for linear algebra, if you do not mind could you take a look at it and give me feedback. also tell me please what other features you expect to see in future versions.
https://play.google.com/store/apps/details?id=org.test.la
READ this before working with it...
I am trying to perform the following task in Matlab. Need help as I am new to Matlab and Data Mining. So the given task is to download data from a web site, which i have done and loaded in a file name Dataset.txt, then shuffling the row contents, then trying to generate the sample and training da...
The following code fragment constructs different types of neural networks outputs based on the options supplied. Currently, my code just has a huge note that describes what all the options are supposed to do. I wanted to learn how I can make this code less complex or perhaps break its complexity ...
I'm trying to improve my javascript and have been using the revealing module pattern to good effect but I noticed that code in the module not in a function or the return is executed on creation have utilised this, such as:
var MyModule = function ($) {
setUp();
function setUp() {
...
so I have a SEDE query running to help me find relevant JavaScript questions to edit, the row count returned for CR was 1171, and the row count returned for SO was 516751
> Thank you for your candidness, patience and feedback. We're going to delay the implementation for now - we'll be back soon to open some more discussions.
I won't name any names, but there are some lowish rep users I think would be good and some higher rep users that I don't think would handle things the most appropriately.
I think we have the best candidates that volunteered in the entire site right now.
I'm very new to Haskell, I've read most of learnyouahaskell.com and played around with some simple things, but this is probably the most 'complicated' bit of Haskell I've written so far. I have an implementation in PHP that does basically the same thing, but it is much much faster.. I'm guessing ...
I have implemented chat feature using sockjs-tornado and could store the messages in RethinkDB.
Could you please help me on how do I establish private messaging in sockjs-tornado ? (I mean Private conversation / one to one)
Below is the on_message function in my server side code -
def on_messa...
I am puzzled by how many votes my rather confused answer is getting. Maybe they like the fact that I am confused because they are confused as well. — LostinfranceJan 13 at 9:31
> As in "Original Poster". How do I refer to the user who asked the question in the third person, other than by account name?
Referring to the person who asked the question:
OP
Asker
Question author (or "original author", or just "author")
Person who asked the question
Blankman
Referring to the person who answered the question:
OP
Answerer
Answer author (or "original author", or just "author")
Person who answered the question
Jon Skeet
Very often on Stack Overflow, and even on CodeReview, I've seen questions and answers that have code that begins by persisting Excel properties like DisplayAlerts and ScreenUpdating to public or private variables, and the restores them at the end of the procedure.
Public bScreenUpdating As Boole...
(See the previous iteration.)
My two previous methods for computing the integer square root of a number \$N\$ ran in the \$\mathcal{O}(\sqrt{N})\$ worst case time. Now I have added a method (intSqrt3) that runs in \$\mathcal{O}(\log \sqrt{N})\$ time:
Main.java:
import java.util.Random;
import ...
I'm using Ed scripts to track changes in a web app I'm developing. Ed scripts are probably the easiest kind of patch file for a computer to parse: detailed explanation of Ed scripts.
I quickly put together the Ruby code below with extremely little thought. I'd like to know what kind of high-leve...
Was just a general question , just wondering if there any websites for online tutoring with a live person. I wanted to compare and show my code and ask for individual help. Any help on this would be great thanks !
Just need some help regarding the JSON method I'm currently finding it quite confusing. Im completing an area class, my output should be a formatted string or single number and the number should be a sum of the area values.
This is currently the first error ive gotten through my code and i need...
I admire your desire to learn, but this site is when you have a problem and need help resolving that problem. I'll let you know before the CodePolice come around that you need to post your question here — zer00ne38 secs ago
I've an algorithm that prints all possible passwords, but that's not my main problem now. (If you were wondering, my algorithm is written in c++) I want to use my algorithm and try it on a password field in a website. But how do I implement my program in a website, such that it tries all the diff...
While this question is not strictly speaking off-topic for Stack Overflow (since you ask a specific question about how to reduce the usage of temporary files), it does seem like more of a question for Code Review. You might, at your discretion, want to delete the question here and repost it there. — 200_success30 secs ago
Here is a small project to implement a basic shell. It is a personal ongoing project to keep system call usage fresh. It currently does background processes and some basic signal handling.
I am actually looking for code feedback in regards to professionalism. I want to know if my code is clear a...
@BryanOakley This would need some serious work before it's on-topic for Code Review. It specifically wants the best for 3 sometimes mutually exclusive traits, that's simply not a good question anywhere. — Mast33 secs ago
I need to examine application port to see if it opens and I need to put the try numbers as parameter, Since Im new to node I wanted to get your feedback on it
checkAppPr: function (port) {
var result = Promise.defer();
var checkStatus = function (next, result, times) {
...
I have a problem mixing two mp3 files into one. Actually, I've found some test code to do that using NAudio library, but it is too slow for me. I am new to "audio programming" so I need your help, advice how to make an algorithm solving this problem faster than the code below.
The code mixes two...
I'm using a builder pattern to create immutable objects. Some objects have a 'large' number of properties, but some have a small amount of properties.
The pattern I'm using looks as follows:
public class X {
private final A a;
private final Optional<B> b;
private final C c;
private...
And how is it any different from "Any and all feedback welcome"? (which gives reviewers the possibility to review both code size, memory usage, and runtime performance)
I think you're putting way too much weight into the formulation.
In fact, according to one of our "magical questions" for on-topicness, being open to more changes is better than only asking for a single specific concern.
I'm with @SimonForsberg how is it Off-Topic to want your code to be better in any/every way possible? actually expecting that outcome is, perhaps, naive, but that doesn't make the question Off-Topic.
Very often on Stack Overflow, and even on CodeReview, I've seen questions and answers that have code that begins by persisting Excel properties like DisplayAlerts and ScreenUpdating to public or private variables, and the restores them at the end of the procedure.
Public bScreenUpdating As Boole...
I often use this kind of construct to avoid repeating code and writing extra-methods that are only used by a single method:
JPanel result = new JPanel();
...
BiConsumer<JPanel , JPanel> addPnl = (a , b) -> {
a.invalidate();
a.add(b);
a.revalidate();
a.repaint();
};
BiConsumer<J...
> Compilers: Principles, Techniques and Tools, known to professors, students, and developers worldwide as the "Dragon Book," is available in a new edition.
Compilers: Principles, Techniques, and Tools is a computer science textbook by Alfred V. Aho, Monica S. Lam, Ravi Sethi, and Jeffrey D. Ullman about compiler construction. Although more than two decades have passed since the publication of the first edition, it is widely regarded as the classic definitive compiler technology text.
It is affectionately known as the Dragon Book to a generation of computer scientists as its cover depicts a knight and a dragon in battle, a metaphor for conquering complexity. This name can also refer to Aho and Ullman's older Principles of Compiler Design.
== First... ==
@Quill Where do you see that? As far as I can tell, this is the latest edition from 2013
@Quill Sure. But if you unilaterally end that discussion, people are still going to want to have it, and are simply going to go and create other Meta questions to continue it.
> Thank you for your candidness, patience and feedback. We're going to delay the implementation for now - we'll be back soon to open some more discussions.
They're basically saying they're done taking feedback from that question, if someone else goes and makes another meta question similar, it'll just get closed as unconstructive unless it brings up a different, valid point
I am writing some C# that will be running on Linux and will extract values from a kernel generated system file that represents readings from a sensor.
The file contains two lines of text, and I have a method which will extract two values from the file.
The file looks like this:
$ cat /sys/bus/...
I quite like that too, but put mine high on a shelf when my son was about 3.
When I think about it, I have a collection of instruments in the house I really don't use enough - 2 guitars, a didge,, djembe, roland electric drum set, flute, piano, keyboard, and more.
Hmmm... a mouth organ, recorder (alto too), and a bushman tink-tonk thing.... should learn the name.
Proposed Q&A site for people seeking recommendations for books to read given a stated interest in previously read books, authors, topics, themes, moods, settings, characters, and/or other specific criteria.
It correctly saves the data to the string, but how do I show the data in my table? Why isn't this code working?
Javascript code:
$(document).ready(function () {
$.getJSON("http://wt.ops.few.vu.nl/api/32464776",
function (data) {
var tr;
for (var i = 0; i < data.length; i++) {
tr ...
I just finished making a blackjack program, and I hate my global variables in the program. Is there any way to change the code to not use globals and still work? Any suggestions are appreciated! Here is my code:
#!/usr/bin/env python3
import skilstak.colors as c
import random
import time
def bet...
The Grid Search
Given a 2D array of digits, try to find the location of a given 2D pattern of digits.
Input Format
The first line contains an integer, T, which is the number of test cases.
T test cases follow, each having a structure as described below:
The first line contains two space-sep...
I have been using ROS alongside python to enable my built robot to walk. I am aware that my code needs some improvement such as classes ect. This is my first python / ros program so any help and pointers would be hugely appreciated thanks :)
Code:
#!/usr/bin/env python
#
## launch start_robot_...
Phew; user responded positive to my answer telling them their code was basically horrifying. Let's hope when they post a follow-up question it seems actually readable.
I'm trying to build a simple number guessing game numberGuess() that tracks the # of attempts a player takes, but does not track an attempt if the player guesses a number that has already been guessed.
The only bug that keeps happening is if the player guesses the 1st number he guesses more th...
A friend of mine sent me his implementation of a solution to a task we were working on and it is written in Python. I have never used Python, I usually use C++, but I want to see if it gets the correct output with his code. I could provide the task if needed, but as for now I only think that some...
I need to process the data contained in a (relatively) large binary file.
The file has the following structure:
40 bytes of initialization,
4 bytes, 1 byte,
4 bytes, 1 byte,
...
lots of such 5-byte blocks
...
The number of 5-byte blocks (to which I'll refer to as 'timetags' in the following) ...
Hi i am starter in Spring boot.
I have good background of Servlets/JSPs but now want to explore Spring Boot. Because within quick time RESTFul service are up.
If someone can review my code from this git url https://gitlab.com/ashish29agre/spring-boot-example
I love our medical system. I remembered I need a reminder injection against Hep A so I went online at 19:40 on a sunday and after 30 seconds I have an appointment with the doctor two streets away at 18:45 tomorrow
@JeroenVannevel Meanwhile I had to call my local GP 49 times to get an appointment. I arrive 10 minutes early, have to wait half an hour to actually get into the appointment, and am them told they can't prescribe me anything for 2 weeks.
Because you aren't able to book appointments in advance, they have to be booked on the day.. lol
You are a computer science professor at South Harmon Institute of
Technology, and are in dire need of automatic grading! The good news
is you have all of your student's assignments in an easy-to-read
format, making automation easy!
You will be given a list of unique student names, a...
I am running through some traditional algorithms in Go, and I was hoping to get feedback on efficiency and optimization. Below is a basic selection sort algorithm that takes a parameter to dictate increasing, or decreasing order.
// SelectionSort
// in: A = {31, 41, 59, 26 , 41, 58}
//
// Increa...
There have been already many similar questions to this one (e.g. this and this, just to point two), but I did not find any for clojure.
The goal is to compress a string in a RLE-like way: i.e. each character "run" is replaced by the character and the count of the run. Some examples:
aaaabbccc ...
Hello I finished my slider with jquery and bullets but I want to learn more about this, about functions of jquery and new posibilities and styles of programming, I wil leave my source code here and if someone can change it a bit, for example here
$(".slider").on("click","button.before",function(...
I create a linked list and then free the memory. However, when I check the length of the list afterwards, it still reports the original length.
linked list size: 4
linked list size (post free): 4
Valgrind also reports that no memory leaks are possible:
==26200== HEAP SUMMARY:
==26200== i...
I'm currently working on a program to print an option menu with the use of enumerate() function, but I want to use the list generated by enumerate() for a print statement.
Here's the code I'm using to generate the list.
from operator import itemgetter
choices = {1: "| Student Details",
...
The problem statement is :
Given a binary tree, design an algorithm which creates a linked list of all the
nodes at each depth (e.g., if you have a tree with depth D, you'll have D linked
lists).
My Algorithm is to use 2 Queues and BFS to accomplish this. The code is a bit involved and ...
Is there a way I can make this code more economical It's currently reading off a txt file which I linked with a pastebin. The only bit which I really need to be more economical about is reading off the txt file, at the moment it is asking for the code then it'll link that code to a line and that ...
I'm used to fixing things straight-forward, but I'm trying to move to a more algorithmically approach so it's easier to write relatively language agnostic.
I've got an IDictionary<SomeT, DateTime> that does not always contain the desired key-value pair. For that reason, a target method expects a DateTime? that the default TryGetValue method cannot provide. I've written this generic extension with main emphasis on the parameter out TValue? value.
pu...