instruction stringlengths 71 71.9k |
|---|
Maybe a somewhat odd choice of language, but here is a program in ><> I have tried
to optimize the execution time of. (Not golfing). The efficiency is measured in the number of required instructions on an ideal ><>-machine, which uses the same amount of time to execute each instruction.
The program does a complete fac... |
The program I have developed is currently used for detecting and recording keystrokes. I have added some built in security measures that can easily(somewhat) be modified to suit individual user needs!
I won't go into the mechanics because the Source is readily available and easily understandable! I realize that this h... |
I want to handle input like the following
ls -al | awk '{print $1}'
Now to parse it I couldn't tokenize at whitespace because of the quotations and I had to make a special case for awk instead. The code below successfully parses the command-line input. Is there a better way?
int handleToken(int awk, char *token, char ... |
I have a listing of invoice line items that I need to apply some convoluted business logic to. We have another listing of items that I compare the invoice items to and if I find matches, I then need to ensure that that all of the values from yet another listing of items are present on the invoice in the correct quanti... |
this program does work entirely without any errors appearing however I would like to shorten it down to make it more reliable and neat
def compress_sentence():
sentence_to_be_compressed, output_file_name, position_file_name = input('what sentance would you like to compress?').split(), input('what would yo... |
I am making a visual novel game and I was wondering is there a better way of setting character attributes and initializing than the way that I have done down below. As you can see I did an abstract class so that I can call each character without rewriting a bunch of code. I also have an array that initializes everythin... |
In an attempt to think up a more efficient String Matching algorithm than the naïve \$O(n \cdot k)\$ one I came up with a slightly modified approach.
In my algorithm (code in Java), I tried a little modification of the \$O(n \cdot k)\$ approach where every time a character match starting from i fails after k positions,... |
I'm building a checkout process where I am quite frequently making SQL connections based on user input so this is quite important. I want to know if it's well-protected from any SQL injection or other forms of SQL attack.
I'm currently trying to implement a prepared statement approach with some sanitizing with htmlspec... |
The following code works, I just want to know if there are any suggestions as to how I can make it better or more secure.
config.php:
<?php
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', '');
define('DB_NAME', 'database');
?>
connect.php:
<?php
class DB_Connect {
private $con;
pu... |
I haven't done much C++ coding the last few years, so I've been reviewing in preparation for upcoming interviews. I wrote a minimally functional singly linked-list. I'm using my implementation for practicing interview problems and hopefully later to build more complex data structures.
Currently, the code is not te... |
The background is the question at https://stackoverflow.com/questions/36634394/nested-shared-ptr-destruction-causes-stack-overflow. To summarize, for a data structure that looks like:
// A node in a singly linked list.
struct Node {
int head;
std::shared_ptr<Node> tail;
};
If the list grows too long, a stack o... |
I'm working through Sedgewick's Algorithms book for fun and educational purposes. I am implementing a simple Stack<T>, using System.Collections.Generic.Stack<T> as a guide:
[System.Diagnostics.DebuggerDisplay("Count = {Count}, Size = {_values.Length}")]
public class Stack<T>
{
// Constructors
public Stack(int c... |
This is a an example application for testing some encryption and decryption functions in Golang. The functions encryptString(), decryptString() and hashTo32Bytes() will potentially make it into a live application, so I need to know that these functions are safe and if not, what I can do to make them safe.
I want to ha... |
I want to generate all possible combinations (without duplicates) of all sizes less or equal than \$N\$, so for example if \$N=3\$ I want to generate the following
\$\{1\},\{2\},\{3\},
\{1,2\},\{1,3\},\{2,3\},
\{1,2,3\}.\$
I created the following algorithm in Java. Is there a more optimal way to generate?
public class ... |
I have a customised Arduino board that will be connected to a battery and never power reset (it needs to be very reliable and cope with code hangs).
The board will always be put to sleep when not in use. I will use 2 external interrupts on pins D2 and D3 to wake up from sleep.
A watchdog is enabled to detect program lo... |
What this does?:
Interactions is an Enum whereas Interactable is an interface (not @Functional Interface). Every Interactable has a list of Interactions that it can do. The below code snippet, filters out all the objects that contains any of the provided Interactions. It does not check for all Interactions, so if any o... |
I'm doing multithreading at university and we've been asked to implement the producer consumer problem in C.
My code compiles and produces the right result. From debugging it, it seems to be waiting for the semaphores to be freed etc. I'm using Xcode 6.4, hence the need for sem_open() instead of sem_init(). I just have... |
I created a gaming community website about 13 years ago. It uses PHP, SQL, HTML, and CSS, and does not use a framework or template engine. It includes features such as a login system for members, different levels of access depending on your rank, dropping members that are inactive from the member list, and other featur... |
I have a list of input, a greedy method and a dynamic programming method. I wrote a unittest script to test my two methods with input list but I don't know if I'm writing it right:
import unittest
from land_selling import Offer, Seller
class LandSellingTest(unittest.TestCase):
offers1 = [
Offer(0, 6, 2),
... |
Following this SO post and this Wikipedia article, I wrote a Python script to simulate physics of 2D elastic balls.
I define the physical behaviour of each ball in the Ball class. Then the function solve_step enables to compute position and velocity of every ball for one time step.
The balls are moving inside a square.... |
Two strings are anagrams if they are permutations of each other. Assuming we have an ASCII alphabet we can take 128 integer array to count the characters in the first string. Then decrement the count for the corresponding character in the second string. If all the character counts are zero then the strings are anagrams... |
I've just been going through core data structures and algorithms recently, wanting to get back in touch with the core fundamentals. I'm starting simple with a LinkedList implementation in C#. The functionality works and was able to test it. I'm just wondering if yo see anything with the code that could be improved.
usi... |
I have just coded a Card class which gives a suit, rank and a color to a card. However, I have serious doubts that my code is not well organized and not well structured.
I would like to receive tips on how to improve my code if possible so I can learn from them.
Card class:
import java.util.Random;
public class Card {... |
Is this a fair/clean way to detect a cycle in a LinkedList? Should work for both single and double LinkedLists'.
public bool IsCircular()
{
if (Head != null && Head.Next != null)
{
var slow = Head;
var fast = Head.Next;
while (slow.Next != null && fast.Next != null && fast.Next.Next != n... |
I've implemented the sliding blocks puzzle in Python to solve it using different algorithms.
I'd like to know if the class "Sliding_blocks" is nicely designed or if I am missing
concepts of OOP.
I think that the indices of the blocks are a bit obfuscated, because I mix tuples,
lists and arrays (arrays are better to ad... |
I needed an event bus in C++ with a few features:
Possibility to add/remove both functions and member methods.
Ability to remove automatically those listeners that wrap member methods of expired classes.
Easy to use registration facilities to attach member methods as listeners.
The last point is quite important, for ... |
I'm having trouble optimizing my code for the exercise in Project Euler #44
Pentagonal numbers are generated by the formula, \$P_n=\frac{n(3n−1)}{2}\$. The first ten pentagonal numbers are:
1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
It can be seen that \$P_4 + P_7 = 22 + 70 = 92 = P_8\$. However, their difference, \... |
As stated in the tags, I'm a beginner to C. This code implements a dynamic array (List in .NET, vector in C++, etc) for any pointer type. I would like that it be reviewed on memory usage and code structure/style.
list.h
#ifndef _game_structures_list_h
#define _game_structures_list_h
#include <stdbool.h>
typedef enum ... |
I've have methods for a stack and bag using a dynamic array in C. As far as I can tell everything is implemented correctly, but I'm wondering what I can do to improve this code.
dynArray.h
/* dynArr.h : Dynamic Array implementation. */
#ifndef DYNAMIC_ARRAY_INCLUDED
#define DYNAMIC_ARRAY_INCLUDED 1
# ifndef TYPE
# d... |
I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'll show you the tables, and then the two implementations.
Post table
id (PK)| poster_id (FK) | value | created_on
Repost table - necessary for both implementati... |
A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number.
A number n is called deficient if the sum of its proper divisors is less than n and it is ca... |
I stopped using Lodash to become better at JavaScript. These are recursive utility functions to deal with nested arrays:
const _ = {}
// find object in nested arrays
_.findDeep = (arr, obj) => {
return arr.map(item => {
const key = _.keys(obj)[0]
if (item[key] === obj[key]) return arr
if (item.children)... |
I was inspired by the Phillip Trelford "Beyond Lists" presentation published on InfoQ. So, I decided to make it simple, yet still capable to act as IList<T>.
I tried to stay close to the Core .Net System.Collections.Generic code style, this is the reason why I decided to explicitly implement Enumerator for the class.
T... |
I made a C# console roulette game. Check it out and give opinions on how to improve or ideas for some other features? It's not finished yet so it has lots of room for improvement. I am very new so take it easy on me.
GitHub link
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using... |
Interview problem:
Given a stream of characters (e.g. acacabcatghhellomvnsdb) and a list of words (e.g. ["aca","cat","hello","world"] ) find and display count of each and every word once the stream ends.(Like : "aca" : 2 , "cat" : 1 , "hello" : 1 , "world" : 0 ).
This solution works functionally. Please let me know ... |
I've written a small C function to handle the builtin commands of a custom shell that I'm writing in C. Is it better to use a switch instead?
int handleBuiltinCommands(char *input, int ret) {
int built_in_command = 0;
if (strcmp(input, "exit") == 0) {
free(input);
exit(0);
}
if (StartsWi... |
I have finished the assignment but would love some feedback. Data.json contains news articles data.
Requirements for assignment:
Fetch the data and render it on the page. Initially the page should
show only a list of titles fetched from the source. On clicking the
title it should show the relevant image and conten... |
Revisions:
Revision 1
Revision 2 (you are here)
Revision 3
png2jpeg is a simple command-line converter of PNG to JPEG.
The source code requires the libpng and libjpeg development libraries to be installed, and can be built with a C99 standard-compliant C compiler.
My intent is to ensure that the source code is readab... |
I tried to create a secure and efficient PDO class. I would really appreciate your feedback to make it more production-ready.
GitHub
<?php
/**
* Class MySQLDatabase
* This class is a database class for PHP-MySQL which uses the PDO extension.
* @author Khavish Anshudass Bhundoo( https://github.com/khavishbhundoo )
... |
Pretty simple class but just want to make sure I've approached it correctly.
public class DynamicArray<T> : IEnumerable<T>, ICollection<T>
{
private T[] _items;
private int _size;
private const int _growFactor = 2;
public DynamicArray()
{
_items = new T[4];
... |
I would like to know if I did everything right and if there a way to do it more simple?
Task:
Task link to html file
My main:
package zad2;
public class Main {
public static void main(String[] args) throws InterruptedException {
StringTask task = new StringTask("A", 70000);
System.out.println("Task " + task... |
I'm building a simple quiz app and wanted to make it more scalable by putting my code into an object. The parameters list looks a bit messy to me. Is this a normal way to use an object or is there a better way?
Thanks
// above here I have a JSON object with questions:
var quiz = new question($('#quiz-container'), $('.a... |
I have this funny program for playing around with 2D vectors:
Vector2D.java:
package net.coderodde.robohand;
import java.awt.geom.Point2D;
import java.util.List;
import java.util.ArrayList;
import java.util.Objects;
/**
* This class implements a vector. The tail of another vector can be attached to
* the head of th... |
I got a pretty large main function that I want to break up in smaller helper functions. Can you help me suggest what to break out into helper functions? The function is part of my own command-line shell and all the code is available on github. I think that a good helper function is for "builtin commands" (e.g. commands... |
I have about a million records in Redis which I want to dump into Elasticsearch periodically. I just want to make sure that my script is decent enough in terms of speed and no memory leaks.
'use strict';
const redis = require('redis');
const bluebird = require('bluebird');
const request = require('request');
const ela... |
My stack uses char data and is not tested. I use it to save command in a unix pipeline for my own POSIX shell. Maybe you can find a bug or a possible improvement.
#define _XOPEN_SOURCE 500
/*
* C program to implement stack. Stack is a LIFO data structure.
* Stack operations: PUSH(insert operation), POP(Delete ope... |
This allows enum values to be outputted as strings. But enum_strings is a type, not a map or a vector, so if the enum value is known during compile time, there will be no look-up time at all. If the enum value is a run-time value, then the look-up time is \$O(\log N)\$ due to a binary search being made through the pa... |
This is my very first implementation of a full-fledged ADT, which could potentially be use-ready. Now, I'm still learning, therefore I would like to ask you what I can do to further improve the following code.
#ifndef LIST_H
#define LIST_H
#include <utility>
#include <type_traits>
#include <stdexcept>
#include <assert... |
I would like to know if it is safe enough to create via JavaScript control of empty fields. Here is my example in detail:
<script language='javascript'>
function validate () {
if(document.getElementById('title').value=="") {
alert("Enter a Title!");
return false;
... |
This code is to solve the problem as mentioned here:
private void assignNeighbors(Node n){
ArrayList<Node> current = new ArrayList<BinaryTree.Node>();
if(n!=null) current.add(n);
while(!current.isEmpty()){
ArrayList<Node> parents = current;
current = new ArrayList<BinaryTree.Node>(... |
I'm looking for ways to optimize a program in C++ I wrote to count all the duplicates in a string and print the duplicated letters and the number of times my program takes all 256 ASCII inputs and only prints the duplicates once with the max number of duplicates. I had a really hard time writing it and needed to ask fo... |
Can anyone review the methods? If there are better ways to write a certain method I would appreciate it if anyone could tell me.
public class Node<E> {
E data;
Node<E> next;
public Node(E item) {
setData(item);
setNext(null);
}
public Node(E item, Node<E> Ref) {
setData(it... |
I'm trying to refactor this C# code that uses one true brace style (it's enforced). I'm coming to C# from C++, in the former I could've made x and y to become i and j with reference assignment, but in C# it's not possible.
Should I take the (i_IsRow) condition to a method? it will have 5 parameters and 2 of them will b... |
I am finally making the move to object oriented PHP. This has been something I have been quite reluctant to do, but I now feel that it could benefit me, and bring me up-to-date with current practices.
The main problem I have is how to start, and how to do things right. Now, I understand that with programming, there are... |
I've developed a template to modularize JavaScript code I write for client work. The example below is a simple class with 1 attribute and 3 functions.
Rationale:
Standardized constructor to add or modify settings/ options
Functions as variables used later to return only "public" functions, all else are private
Using l... |
I have created a program to visualize the working of Newton-Raphson method to find the zeroes of a function:
newton.m:
% Dummy statement to avoid writing function in the first line and making it a 'function file' instead of a 'script file'
1;
% The function to find zeroes of.
% The function is specifically chosen t... |
I'm a beginner working through an exercise on ruby arrays. Given a two-dimensional array with 0's and/or 1's, it should return an array with the non-diagonal surrounding elements of 1 changed to 1 if they are 0. That is
a = [[1,0,0,0],
[0,0,0,0],
[0,0,0,0],
[0,0,1,0]]
should return
[[1,1,0,0],
[1,0,0,0... |
I read recently that ENIAC originally was capable of 5000 additions per second. Naturally, I had to test my own laptop's capabilities and this became an instructive experiment in F#, which I suck at.
So, I am looking for feedback in two areas:
What is the most concise way to write this in F#, or at least most closely... |
I'm solving the following problem using the Visitor design pattern in Swift:
When a quote is requested or an appointment is booked we send out an
email to the customer, and build an internal report about the
the quote and the appointment. The content of the email and
report are dependant on the customer's addres... |
I'm trying to fetch records from table PaymentToken if its AccountNumber matched but AccountToken wasn't:
select DISTINCT DTR_PT.Id, DTR_PT.AccountNumber, DTR_PT.CardNumber, DTR_PT.ExpirationDate, DTR_PT.CardHolderName, DTR_PT.AccountToken, DTR_PT.CreatedDate, DTR_PT.Active
from Dev_NeoGateway_DTR.dbo.PaymentToken as D... |
I recently wrote my first XSD Schema:
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="mediums">
<xs:complexType>
<xs:element name="medium" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<... |
there is a other way to write in JS the switch statement ,
This code is working :)
_update: function(oHtml, oConfig) {
var _this = this;
var oParent;
if (oConfig.attributes != null) {
oConfig.attributes.forEach(function(oAttr) {
//debugger;
oParent = o... |
I'm learning Erlang. It's my first time with a non-imperative programming language.
I've written a code and I want some thoughts about it:
Is my logic easy to understand?
Is my code idiomatic?
Is my code well organized?
Is my code using Erlang features correctly?
My goal here is improve readability and functional-thi... |
For responsive images I have come up with a first draft of how I would like to swap image sources depending on media query. This works fine and with the added debouncing function from Paul Irish the window resize event is also taken care of.
Now what I am wondering is if I could write this even more concise and most of... |
In this question, I asked for feedback on a class that provided my program with periodical signals.
I have rewritten that class based on the feedback from the accepted answer. As this again uses a complex library I've never worked with before, I'd really appreciate some feedback!
The class runs a function in a separate... |
I'm a fan of elegant ways to condense code. I find this ugly. Been staring at it for a while, can't think of a way to write this with less verbosity (ok, short of shorter var names but that's not what I mean). What do you guys think?
if angle < 60:
red = 1
green = angle / 60
blue = 0
elif angle < 120:
r... |
I am implementing a very primitive threadpool with C++11 using mutex and conditional variable. The class ThreadPool is the main thread holder and will spawn a number of threads upon construction, and join all threads on destruction. The main thread adds task of type function<void()> into the queue and then wakes up any... |
I have been given following problem to solve:
If the integer is divisible by 3, return the string "Java".
If the integer is divisible by 3 and divisible by 4, return the string "Coffee"
If the integer is one of the above and is even, add "Script" to the
end of the string. Otherwise, return the string "mocha_missing!"... |
I'm writing an embedded application in C, and at one point I need to convert a float into an ASCII representation of that float, so I can send the ASCII over a serial port. The protocol the serial port is listening over doesn't like trailing
'0's, so I'm writing a function that will remove all of the unnecessary '0's ... |
N.B. The next stage of this project, which covers parsing filenames and checking numbers against the list produced in this question, is covered here.
I have a list of company numbers (UK companies registered at Companies House) in an Excel spreadsheet. A CRN is an 8-character unique identifier attached to a specific r... |
I'm trying to learn the Repository pattern, and I have some questions regarding my current understanding of it.
All the examples I've been able to find of database repositories use ORMs, but for a number of reasons, I can't use an ORM in the project I am learning this for. So, when not using an ORM, where should the S... |
I need to remove all occurrences of a digit from a number in a recursive function with this prototype:
unsigned rem(unsigned num, unsigned dig);
This is my solution:
#include <stdio.h>
// just returns 10 to the power of n
int power(int n)
{
if (n==0)
return 1;
int res=1;
for (int i=0; i<n; i++)
... |
I'm dipping my toes in to RXJava for the first time. The function below works just fine but I can't help thinking it can be improved. For instance I'm sure that I'm unnecessarily creating a new List<Dish> sortedDishes when I could be performing operations on the exiting List<Dish> dishes that is passed in, I just don't... |
I wrote a simple implementation of Conway's Game of Life in Java using 2 arrays and for loop and used StdDraw library for plotting generations.
It turned out that algorithm works ok for little number of cells (e.g. glider pattern), but becomes terribly slow for big number of cells (e.g. random filling) even with small ... |
/**
* Returns the value of a nested property of source object if it exists.
* Even if the nested property evaluates to false it will be returned.
* If the nested property does not exist, undefined will be returned.
* @param {Object} source source object
* @param {String} path path without first dot e... |
Simply, I call the script (brightness.sh) and pass a three character value as an argument. I've got commands to strip individual numbers for math processes, and then the final commands to apply the changes. The rest is just simple if-then stuff.
I know I've got a lot of commands calling xrandr data, and that's slowing ... |
I'm trying to change how our system generates PDF files. Currently I have a class for each PDF that goes through the model for the PDF and fills in the properties. I want to change that to a self contained class that can be called in the background through Hangfire. To that end I've settled on decorating the properties... |
I came across this mathematical puzzle, where one really cool answer was a python script to brute force answers.
Here's my take, which is essentially a translation of that to Java:
public class TerribleMath {
public static void main(String[] args) {
findAndPrintSolutions(1, 20);
}
private static v... |
I've made the following implementation of counting sort. I don't think that I understand the algorithm fully but this implementation seems to be working correctly.
I've used the Counterdictionary from the collections module. It seems to be the best way to handle the counting part. But I haven't seen anyone using it to... |
I just finished writing a program that captures temperature information for a patient. I'm looking for suggestions on how to improve the code that I have. Although what I have compiles and does what I want, I wonder if there is any methodology I'm using inappropriately despite it still working.
Some particular areas I ... |
I am currently using an iterator because I have to insert record in one table, get its primary key and add it to another table. But since it's a loop, it's very slow when data is very big.
OPEN ITERATOR
Fetch NEXT FROM ITERATOR
INTO @AccountNumber, @CardNumber, @ExpirationDate,
@CardHolderName, @CardToken, @CreatedDat... |
I have created the following code to calculate Snell's law angles, based on Zoeppritz equations on complex plane. The code works, seems it is returning valid values, but after all the code just looks a complete mess. Maybe there are nicer way to deal with complex values and matrices using numpy. Any hints to make this ... |
This is another pretty basic class I wrote for a library as I hate the way the default StringBuilder in .NET works.
Essentially, I wanted to have the + operator, as well as implicit conversions to strings. (Rather than needing .ToString() all the time.)
It's pretty small and simple, so there may not be a lot to critiqu... |
This is the next step in my project to query Companies House records. The first step, retrieving and validating the company numbers to be targeted, was covered here and I will include that code at the end for context.
In this stage, GetTargetFilenames, I need to parse the entire series of Corporate Filings (typically ... |
I want to perform a filter on a DataGridView using 3 different TextBox.
The solution below works, but does not consider very effective and good. Is there a way to improve it?
private void textBoxCod_TextChanged(object sender, EventArgs e)
{
Filter();
}
private void textBoxArt_TextChanged(object sender, EventArgs e... |
Can you think of a reason the following extension should not be used in production, or a better way of implementing it:
public extension Range {
@warn_unused_result
public func intersect(other: Range) -> Range {
let ds = startIndex.distanceTo(other.startIndex)
let de = startIndex.distanceTo(ot... |
I have read CLRS Introduction to Algorithms book, now I'm on Elementary data structure chapter. I read about queue concept and try to implement in c.
I have tested a lot it work fine, but I have a little doubt on its working. Please tell me this implementation is correct or not.
#include <stdio.h>
#include <stdlib.h>
... |
In a programme that I am writing, I need to loop through all the instances of a class, the way I got around this was by appending every class to a list like below:
allPeople = []
class Person:
def __init__(self, name, age, height):
self.name = name
self.age = age
self.height = height
... |
I post the below code as review/answer to a question in codereview.
(Custom Dynamic Array)
however, seems the answer itself having issues looking at the comments that I received.
I would appreciate your valuable review comments:
public class DynamicArray<T> : IEnumerable<T>, ICollection<T>
{
private T[] _items;
p... |
i'm a beginner and this is the second program that i have written by myself from scratch, i wrote a basic snake game with PYgame but i didn't do it by myself, so anyway, what do you guys think of this? i want honest opinions, no sugar-coating ! does it have any problems? is there any improvements that can be done?
impo... |
I'm trying to create a simple way for current & future (non VBA literate) employees to accomplish some of the tasks I've struggled with. The first being Parsing cells containing Line Feed Characters.
When reports are produced from Workday, sometimes they have to be produced for each item separately, and you end up with... |
When I work a lot with objects, that implements IDisposable I am using this pattern, like shown here with a SqlConnection and a SqlCommand.
private string _connectionString = "";
public IEnumerable<User> GetUsers()
{
List<User> users = new List<User>();
string sql = "SELECT * FROM [user]";
... |
I'm a first year uni student. We were asked to come up with code that can represent a simple two players dice throwing game (specifications are given below).
I know as a matter of fact that there are many areas upon which my code could be improved. However, rather than asking other people to correct my code, I would mu... |
I'm not entirely sure what code other people will need to see, if I miss something off that is important please leave me a comment and I will update it as soon as I possibly can.
I have coded an A* algorithm following the pseudo code from Wikipedia. The problem is, from a relatively short route I am getting about 180 l... |
In my ASP.NET MVC application, I am loading Discussion Entry records along with User info (who posted the entry), Badges (assigned to the entry), Reactions (made to the entry like Facebook-style reaction). I retrieve these records from an SQL-View (with 23 columns) via a stored procedure (executed within Entity Framew... |
I'm reading this very good book, C# Player's Guide, to learn C#. I then plan to make video games with Unity 3D after.
In one of the chapters, he asks us to make a (really) simple calculator as a console application using the switch statement:
The program that we’ll make is going to be a simple calculator. We’re
goin... |
Just looking for more experienced programmers opinions on this code. It's a framework for making simple multiple-choice quizzes. I am aware that there is the potential to make the arrays dynamic, but at small sizes this shouldn't matter much.
The formatting of the .txt files used to compose quizzes is simple- start a l... |
Following up on @Vogel612's friendly advice from the vba-rubberducking chat room, I am posting my working code for open review. Thanks also to @Mat'sMug for the help!
This will be my first task that I have completely automated via batch file scheduling, so I have included some spaces to pass error messages to the vbscr... |
As I know it is not good idea to have so many pointers in c++ code.
But I have written this simple implementation of linked list in c++ and there are many pointers in it, how can I improve that?
Also as I tried I can not use functions in algorithm module on this linked list, how can I make this class compatible with th... |
I wrote code which is doing query and insert inside while loop.
$getall = mysql_query("SELECT `deviceid`,`uid` FROM `users` WHERE FIND_IN_SET(`bgroup`, '".$allbrgou."' ) AND `uid`!='".$from."'");
while($mdata = mysql_fetch_assoc($getall)){
$newto = $mdata['uid'];
$result = mysql_query("insert int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.