instruction stringlengths 71 71.9k |
|---|
I've written a custom Error handler for use in PHP. What it does is simply capture PHP errors, and logs them using Monolog.
It works, but I can't help that it has too much stuff inside. I could remove the error levels that are not handled by set_error_handler but that's guaranteed to lead to a developer that spends 2 h... |
I am working on a project that needs to represent different kinds of vehicles, components of these vehicles and actual parts of the components.
So far I have this code:
class Vehicle
{
public:
/* Public interface */
//ctor
Vehicle(int id, int year, int mileage, int weight, int length, int width, int height... |
I am trying to teach myself to code using Python. The following is the first real program I have written from scratch. I feel that it is messy and in need of improvement, but I am either unsure of what to improve next or don't know how to improve it. I am looking for suggestions about: turning my functions into class m... |
I've written this program that writes all the combinations (without repetition) of n elements in groups of k.
I think the code is good, but I like to know if you have some better (or faster) solutions.
The elements to combine are always the number from 0 to n-1, the program calls a function (newCombo()) for each genera... |
This is a number guesser that guesses a random number between the values that you set. The user has to use the up or down arrow keys to say if the number that they thought of between the number generated. This continues until the number that the user is thinking is generated and then the user pressed enter to say that ... |
I am designing an in-depth poker game. I am first focusing on recognizing the strength of a hand given the set of cards.
Is the following algorithm suitable for the stated purpose?
Am I using correct OOP design principles and implementation in my code?
Algorithm:
Go from a top down approach checking for the following... |
Last Friday I was hit with a sorting interview question that I never really had to deal with.
Develop a your own sorting algorithm.
It cannot use any other Classes for help.
It needs to be able to sort an array of millions of integers in size.
It needs to be as fast as possible.
For instance:
int[] old = {5434,... |
I'm writing some code to return results from a web service and display them on screen. If the service is down I want to use Lawnchair to serve cached results.
<h2>Test</h2>
<p>Click to load!</p>
<button class="btn" type="button" onclick="loadData()">Load</button>
<div id="results"></div>
@section scripts{
<script>... |
Sometimes I need to implement recursive algorithms that pass a certain state from one recursive call to another. For example, a greedy subset selection: we have a set of candidate objects, and we select a subset of size k greedily, one-by-one. The choice depends on the already selected objects and some constantly re-co... |
I just thought about creating a C# program to download all chapters of a manga given an URL. HTML parsing is done with HtmlAgilityPack.
Issues I have yet to work out are the blocking of the whole program, the rather slow performance of GetPagesLink() as it calls LoadHtmlCode() which uses WebClient a lot (one Webclient ... |
I recently received a simple interview assignment as to implement an RPN calculator in Ruby. The program takes user input and quits when the user presses 'q'.
I did it in under 30 minutes and was quite confident about my solution, but the interviewers did not like it. I would love to know the flaws it has so I can avoi... |
I have written a little class that is basicly looking for video files in given directory and then parsing some info about those files. Finally it saves everything in a list.
To properly run this you need ffmpeg.exe (to get file duration).
Can you please give me some hints how can I improve my code? I am not sure if I... |
After weeks of slaving over FIPS-197, I finally have my own working C/C# implementation of AES-128 which I'm quite happy about.
The next thing I'm looking to do is implement a nonce counter block of configurable length (either 8 or 16 bytes) to convert this block cipher into a stream cipher (CTR mode), according to NI... |
Write code to sum two numbers represented by a linked list. The digits
in this linked list are in reverse order. eg. (9->2->3) + (4->8->2) =
(3->1->6)
Any comments on my solution (especially on the testing part)?
public class ListNode {
private int val;
ListNode next;
ListNode(int x) {
val = ... |
I am writing a "collision detection" in PHP and want to check if a specific "area" is still free in the two-dimensional target array.
I use the following code to do that, but I think there might be a better (= faster) solution than looping over every possible position in the array and check whether it's set or not.
pub... |
I am somewhat new to ruby (but not to programming) and I want to develop a small web-app with Sinatra. I started creating a small password utility script that hashes and secures entered password. I am not sure it is finished. I would like to know if there are any ruby tricks to make my code better or more verbose, and ... |
I was happy with my shell script that needed to generate alphanumeric combinations of length N (in this case, 3)
for i in {a..z}{a..z}{a..z}; do ...
Now I became less happy when I needed alphanumeric combinations (specially if I choose a larger value for N)
for i in {0..9}{a..z}{a..z} \
{a..z}{0..9}{a..z} \
... |
I just wrote a basic DTMC algorithm focused on generating names, though it could be used to generate lots of other things. It's designed to be run from the command line, so input is taken from a file, with a couple of options specified on the command line.
I'm specifically looking for these things, though any other ad... |
A covering array is an \$N \times k\$ array in which each element is a from a set of \$v\$ symbols, and for every \$t\$ columns, every possible set of \$v^t\$ choices of the symbols appears at least once. The covering array number \$\mathrm{CA}(t,k,v)\$ is the smallest \$N\$ for which a covering array exists, given \$t... |
I implemented a binary tree in the following code. Its node's copy constructor and assignment operator should copy itself and all its descendents. Similarity a node's destructor should delete itself and all nodes descended from it.The print function just prints each node in a new line. How can I pretty-print it? Please... |
I'm a self-taught Python programmer and I never really learned the fundamentals of programming, so I want to see how to improve upon this script and make it adhere to best practices.
The script has three functions that retrieve data from an API, cleanse the data and store it in a sqlite db. This script is going to run... |
I wanted to create a loot table mechanic for any future game projects, and came up with what I am about to show you guys. I was wondering if someone could give it a glance and see if there could be any errors, or if it could be improved in any way.
using System;
using System.Collections.Generic;
namespace NovaEngineFr... |
I've written an encryption-decryption class that is to be used in my companies commercial web application that will handle sensitive information. The encrypted data will be passed over the internet via HTTPS but even so it needs to be internally secure.
I've tried to follow best practices but I'm limited in that I only... |
I have a simple projection in my code. Taking away the majority of the fields which are not of interest, it looks like the following:
var result = employments.Select(x => new EmpListItem
{
EndDate = x.EmpRelationship.OrderByDescending(y => y.EndTime).FirstOrDefault().CancelledBeforeTime ?
... |
I need a class that holds a huge amount of data, which should be useable across multiple threads. To avoid copying the data every time, I used a std::shared_ptr. To make it thread-safe I need a mutex to secure the data. But if I'm right, this mutex must be shared too. Since boost::recursive_mutex (and other mutexes I g... |
Aside: This code assumes a class Option that can be Some or None to represent the presence (Some) or absence (None) of the value it contains. Haskell calls it Maybe.
Here is my first pass at wrapping Iterator in a thread-safe way:
public synchronized Option<T> nextBlocking() {
return iter.hasNext() ? Option.of(ite... |
I decided to write a tiny class to automatically write and delete a file given filename and content. It is intended to make testing IO less verbose. I include a small example usage.
temporary.py
import os
class Temporary:
def __init__(self, name, content):
self.name = name
self.content = content
... |
I have just started learning python and I am solving Project Euler problems alongside for practice. This is my solution for problem 5. Project Euler asks for the minimum value divisible by all numbers from 1 to 20 but I have made the program so it works from 1 to n.
I think there is a lot of room for improvement in it ... |
I'd like to cache some heavy resources locally. The goal of this implementation is to have be able to load resources for an unknown amount of time and then keep them in memory and finally evict them upon needs. So there is no "time-based" evictions needed: only "memory-based" ones.
As written in comment, I'm writing th... |
Below assignment is taken from here.
Introduction
In this project, you will develop a geographic visualization of
twitter data across the USA. You will need to use dictionaries, lists,
and data abstraction techniques to create a modular program. Below is
phase 1 of this project.
Phase 1: The Feelings in Tweets
I... |
I have a system that receives messages. Each message has a type defined. These types are declared in an enum:
enum MessageType {
TYPE1, TYPE2, ... , TYPE999
}
People can extend my system by implementing message processors. Each message type can only have one processor and most will have none. My current design has u... |
I want to create variable paging on Node.js with MongoDB. I use MongoJS on client side create a request:
api\logs?&limit=val1&page=val2&sort=val3&order=val4&field1=val5&field2=val6
where
limit, page - paging sort
order, sort - sorting (sort - field. "title","age" & etc)
field1, filed2 ... - option for filter
are a... |
I'm looking for tips on how to clean up this code and/or make it more efficient.
Keep in mind I am a seriously new programmer and if it is too advanced it's likely to go over my head.
import random
cscore = 0
pscore = 0
print 'I would like to play a game. \nThe name of the game is Rock, Paper, Scissors.'
rest = 'y'
whi... |
I am trying to parse InputEvents of an Android device.
Background:
For an android device we have a utility getevent which gives all the touch events that are sent to a device.
getevent -l gives all the input events to the device.
Every event has 3 fields - EVENT_TYPE, EVENT_CODE and VALUE.
EVENT_TYPE can be of foll... |
I wrote this method to recursively insert a new node at the proper position in a BST. Is it good enough? Can it be improved? It went through a couple of revisions and I still am not very confident in this version.
Making the new node root when no nodes are present is taken care of in a separate wrapper function.
public... |
I made some changes to how I was saving the data in order for it to show up on a kendo grid. Right now my giant method is getting data from the database (using getValue), then creating a new list to save both data onto the single list to populate the kendo grid with one list even though they are two different types of ... |
I'm formatting price string with the following method:
def price_formatter(price)
return if price.nil?
formatted = '$'
if price.length > 8 || price.length == 6
price_separated = price.scan(/.{3}|.+/).join(',')
elsif price.length == 8
price_separated = price.insert(2, ',').insert(6,... |
My most recent project was a console based maze game and I wanted to get some feedback on it. Is there a better way to design my code?
#include <iostream>
using std::endl;
using std::cout;
using std::cin;
#include <string>
using std::string;
#include<Windows.h>
#include<conio.h>
void welcome();
char getKeyPress();
v... |
I'm trying to get a good grasp on recursion by implementing document.getElementsByClassName. I've made something that works but I'd like to know if there is some blatant refactoring that should be done or perhaps some not-so-edge cases that might break it.
var getElementsByClassName = function(className){
var result ... |
This code is a part of a little game I've started a week ago.
It is too extensive to review at once, so I'm picking the most interesting and crucial parts.
Start with the AI.
It has public update function that gets called from the player model's evolve function and calls it's public setDirection function.
Following are... |
I have written a Java JSON stringifier with the Nashorn API. Since this code is slow, I wanted to ask if I can improve it. My target is the highest possible performance to make it an alternative to other JSON libraries.
JSON.java
package com.example.json;
import java.util.Map;
import javax.script.Invocable;
import ja... |
This is the player view model and controller for human player using a keyboard (easily extendable for over the network / split screen mode).
The AI controller is posted in another post I've made earlier.
mazePlayerModel.h
#pragma once
#include <memory>
#include "CMaze.h"
namespace amazeinggame
{
struct CPlayerInn... |
I have a form that consists of about 60 fields that all update when choosing a different customer from a drop down. I feel like my current way is not the best way as it takes about 30 seconds to update when changing customers. Currently I have:
Private Sub ClientSelection_AfterUpdate()
On Error GoTo errhandler
Dim d... |
I wanted to create a basic interaction which does 1 outcome but with 2 possible actions: get a number from an other document, by either clicking on a button or waiting a fixed amount of time.
I wrote this, which works:
//Initialize the ajax function
(function($) {
$.fn.getNumber = function() {
$(this).load(... |
My Python implementation of for Hack Assembly Language. See this question for the Java implementation. Any comment about best practices and performance improvement?
import sys
import os
def usage():
print "Usage: %s namefile.asm" % os.path.basename(sys.argv[0])
def tobin(val, nbits):
return bin((val + (1 << nb... |
I have a basic outline for the best way I can come up with to move a character through a basic text map. I want to implement this module in my simple text RPG. I know there has to be a better way to implement this code with less functions, and possibly with less print statements. Also I am not sure if this is a module ... |
My friend and I are working on a bare-bones chat web app, using Angular on the front end. He's using Swampdragon for some of the real-time stuff.
My task that I set out to achieve was to get the chat window to scroll to the bottom when a chat room is loaded (most relevant bit is $dragon.onChannelMessage):
app.controlle... |
I have seen one algorithmic task and I am not sure if my solution is fully efficient. As input to the method you are given positive integer N. And you should return the sum of values of the digits in a decimal representation of N!.
For example, given N = 6 the function should return 9, because N != 720 and sum of digit... |
As an input you have non-empty zero-indexed array of integers. The goal is to find the longest subsequence (any sequence obtained by removing some elements from A), where difference between min value and max value does not exceed 1.
For example, given array: 6,10,7,7,9,8 function should return 3, because 6,7,7 (or 7,7,... |
I made a program that runs my version of Space Invaders.
I recently finished it. I just want to make it more pythonic, and streamline it so it uses less memory and performs faster.
The basic outline of the program is at this website.
import pygame, sys, random
from pygame.locals import *
# set up pygame
pygame.init()
... |
Next release of Rubberduck (should be 1.4) introduces a reorder parameters refactoring, which lets user reorder the parameters of a module (or class) member, and automatically adjust all usages.
Before:
After:
This is the IDialogView interface implementation:
interface IReorderParametersView : IDialogView
{
Decl... |
My aim is to define a set of classes, each providing methods for comparing a particular type of file. My idea is to use some kind of factory method to instantiate the class based upon a string, which could allow new classes to be added easily. Then it would be simple to loop over a dictionary like:
files = {
'csv':... |
Recently I learned HTML+CSS and a bit of jQuery and am building various web-things to stretch my skills and learn more about how to do things the right way. I was a bit surprised at just how many different ways there are to do the same thing using just CSS and JavaScript.
Currently I am building a bit of a "landing ... |
Find the length of the longest substring without repeating characters
Any comments on my code?
public class LongestSubstring {
/**
* First version. O(n^2) runtime
* For each character, find the longest substring starting
* with this character and update max
* @param s
* @return
*/
... |
While writing this review, I edited the code until it became something quite different from the original. In addition to the issues I mentioned, I ended up adding features:
More operators / commands, including trigonometry in degree and radian modes.
Support for multiple commands on a line, separated by whitespace. ... |
I have this legacy code and I don't really think this is easy to read/maintain it. Can you suggest a way to make this more readable while still saving the performance?
template<typename T>
void static ConvertBayerToRgbImageDemosaic(T* BayerChannel, T* RgbChannel, int Width, int Height, ColorSpace ColorSpace)
{
... |
I am creating a utility class to do an HttpURLConnection. I want to make this class generic as in I pass the URL and the POST params. It works with any range of these two values.
public class HttpUrlConnection {
String url, params;
public HttpUrlConnection(String url, String params) {
this.url = url;
... |
I have the following code from a JavaScript file:
$("body").on("click",".edit",function(){
var list=$(this).closest("a").data("list");
var seira=$(this).closest("a").data("order");
//alert(navbar_edit[list][seira]);
var edit=navbar_edit[list][seira];
navbar_edit[list][seira]=prompt("Change property"... |
I was wondering... In the standard library of some Prolog systems, there are meta-predicates like maplist and foldl.
In general, when using meta-predicates (like the ones above) with dcg we always need the "foldl" variants. What about the following mapfoldl/5 (mapfoldl//3)?
mapfoldl(P_4,Xs,Zs,S0,S) :-
list_mapfoldl_... |
I'm trying to create a list from a string with items alternating between words and parse characters like ['Hello', ' ', 'World']
Is there a built in function, existing module, or simpler way to achieve something like below? I'm interested in variable chars for parsing.
sample.txt
def parse_chars(string, chars):
par... |
I was having fun implementing some really basic stuff for 3D graphics. See what I came up with:
Matrix.java:
package net.coderodde.lib3d;
/**
* This class represents a matrix.
*
* @author Rodion "rodde" Efremov
* @version 1.6
*/
public class Matrix {
/**
* The actual elements.
*/
private final... |
While playing with the concurrency features in C++11 I noticed that there wasn't any support for continuations. I wanted to develop something similar to Tasks in The Parallel Patterns Library (PPL), where a Task can run asynchronously and execute a continuation upon completion using the 'then' member function.
I desig... |
I'm doing an archived MOOC at the moment which introduces Ruby programming.
There are some assingments, yet no solutions and since the MOOC is over no one will correct those (+ the forum is down)
I'm totally new to Ruby (background in Java) and asking for some hints on my solution to the following task (my solution und... |
I need to return a "human readable" description based on a minimum and a maximum value. Note that the minimum is included in the condition, but the maximum is excluded -- so for instance if the parameters are 6 and 9, the valid values are 6, 7 and 8, but not 9. The maximum value is also nullable.
I started out with nes... |
Below assignment is taken from here.
Introduction
In this project, you will develop a geographic visualization of
twitter data across the USA. You will need to use dictionaries, lists,
and data abstraction techniques to create a modular program. Below
assignment is phase 2 of this project. For reference, phase 1... |
I have a method which checks some preconditions and if everything is fine returns a success response object, otherwise fail with an appropriate error message.
My problem is that I have a bunch of if-elses which are checking some specific condition and if it fails return a fail object with a message.
Here is an example ... |
I am trying to come up with a way to fetch the same data both when the application is running and when it is in the background. The code I have written so far works... I just think it is very messy and could probably be refactored, but I'm not sure where to start.
I have put all the files up on GitHub as they are rath... |
Just wanted to seek some advice on how can I speed up this PHP form. My batch file that calls this form is for every 1 second but it seems something in my code does the slowing.
Is there any way to speed up the process of this PHP file?
<?php
// Connect to the database (host, username, password)
$con = mssql_connect('M... |
In the code below, all pairs of functions are very similar:
set function
rankListId is different
rankListName is different
class of Mongoengine is different
get function
the rankListId is different
How can I make these function into just one function?
def set_male_rank_list(self):
rankList = ... |
I am writing a macro for an inventory management document. The point of the User Form is to allow the user to add a new item to each of 5 sheets (Daily Sales, Total Inventory, Deliveries, Income Statement, Profits), directly into a dynamic named range. The user provides Item Name, category (Cool Drinks, Beer and Cide... |
I am managing the changing of views in an Android app using this enum and associated methods. I am particularly interested in the Page enum's use of overriding previous() and next() for the first and last elements.
Is this readable?
Is this idiomatic?
Is there a preferable data structure?
Are there general stylistic ... |
In my client server application, client sends some commands and the server gives the results back.
Now my special concern is about the looping for downloading file from the server class, that is downloaded by using the GET filename command.
My question:
In my ClientSide there is a while loop for read/downlaod the nam... |
I'm going through the artificial intelligence domain at HackerRank. I'm very new to this domain and I really need a guide on how should I minimize the number of if/else statements in my code.
Problem Statement
The goal of Artificial Intelligence is to create a rational agent
(Artificial Intelligence 1.1.4). An agent... |
I am developing a library to easily register WordPress custom post types and taxonomies.
But the problem is I can't use one instance of object because of adding the object in WordPress hooks.
So what I have done as a solution is to re instantiate the class every time when you want to register a custom post type. Is tha... |
I'm going through the Google Foobar challenges and am currently on the first challenge of level three. I've come up with a working solution, however, it's not an acceptable solution because it runs out of time. How can I optimize it?
Problem Statement
Oh no! The mad Professor Boolean has trapped Beta Rabbit in an NxN
... |
Two strings are isomorphic if the characters in s can be replaced to get t.
Can efficiency be increased further for this code? As I am getting errors that limit is being exceeded for very large strings.
static boolean isIsomorphic(String s, String t) {
s= s.toLowerCase();
t = t.toLowerCase();
if(s.length()!=t.length()... |
I applied for a Junior .NET Developer Position recently, and I was asked to solve a problem (Sales Tax Program) and I was rejected for some reason. The question goes like this:
Basic sales tax is applicable at a rate of 10% on all goods, except food, medicines and books. For all imported goods, a tax rate of additiona... |
On my web forms page, I have this huge GridView. I make it refresh every five minutes since the data has to be up to date.
It has sort options, so upon every refresh, I use cookies through every refresh to remember the search and sort options.
In the Page_Load function, this is how I do it.
HttpCookie cookieStat = new... |
Grade 0: ++
This is so low that it is boring; the operation of grade 0 is incrementing or counting up, for example:
5++ -> 6
8++ -> 9
Grade 1: +
Addition is repeated incrementing:
4 + 3 -> 4++ ++ ++ -> 7
2 + 2 -> 2++ ++ -> 4
Grade 2: *
Multiplication is repeated addition:
3 * 4 -> 3 + 3 + 3 + 3 -> 12
5 * 2 -> 5 + 5 -... |
I have a very problematic nested if/else/for that I'm sure it could use some love. Here's how it looks originally:
function addBookmark(obj) {
var isFound = false;
var posFound;
if (bookmarks.length > 0) {
for (var j = 0; j < bookmarks.length; j++) {
if (obj.mirror == bookmarks[j].mirro... |
I have a method that basically passes in a known drawn line segment in my view and then draws parallel lines n distances away from the passed in original line. This one in particular draws two parallel lines on either side.
It seems to be a lot of repeat code here, so how can I refactor it to a smaller method and avoi... |
For a class, I need to ask the user for a double. To verify that the number can be safely passed to Double.parseDouble, I wrote the following function. I'd like to have it heavily scrutinized; including the comments.
Are my comments helpful? They're more directed towards the marker than a maintainer down the road. Sho... |
Some numbers have funny properties. For example:
$$\eqalign{89 &→ 8^1 + 9^2 &= 89 &= 89 × 1 \\ 695 &→ 6^2 + 9^3 + 5^4 &= 1390 &= 695 × 2 \\ 46288 &→ 4^3 + 6^4 + 2^5 + 8^6 + 8^7 &= 2360688 &= 46288 × 51}$$
Given a positive integer \$n\$ written in decimal as \$abcd\dotso\$, and a positive integer \$p\$, we want to find ... |
This is my implementation of a Tic Tac Toe game with Tkinter GUI. So far I've set up the game to play with another player. For an interview coming up, I am suppose to build additional feature such as play with AI.
I would like some general feedback on my code. Does my code smell? Can I organize the Player, Board... |
In a further exercise of my original Battleship test framework, I have enhanced and refactored the SmartRandom class from an earlier question and have updated GitHub project to incorporate most of the suggestions I received for the previous questions. This is the second non-trivial bombing strategy class for the May 2... |
I have tried the below program to find (Kth element from tail) of a singly linked list. I have tried to utilize the length field which I am incrementing whenever an item is added into the list or vice versa.
public Node<T> findKthFromTail(int kthElem) {
// length has the size of the list
int kthPos = length - k... |
I would like someone to review this code and tell if it can be done better, or if the code is elegant and simple enough for the task at hand.
I used code climate and I got 4/4 and my test coverage is 96%, yet I would like a professional opinion about it.
'use strict';
var cheerio = require('cheerio');
var FeedParser =... |
I would like someone review this code and tell if it can be done better, or if the code is elegant and simple enough for the task at hand.
I used code climate and I got 4/4 and my test coverage is 96%, yet I would like a professional opinion about it.
'use strict';
var PromisePolyfill = require('promise');
var http = ... |
I'm stuck with a contest problem.
Description:
What is the minimum number of moves to annihilate an int array where the possible moves are:
Remove both the first and last elements if they are equal to each other, or
Remove the first element, or
Remove the last element.
Input
The first line is the number of test case... |
I'm in the process of attempting to write a parser compiler. In this, sets play a major role. I'm in the 'lexical ambiguity' isolation phase, and to that, I need to yield a set of every possible permutation of a given set of items which represent an ambiguity.
An ambiguity is reached when there are at two or more ite... |
#include <iostream>
const int STRINGSIZE = 100;
using std::cout;
using std::cin;
using std::endl;
void IsPalindrome(char[]);
void IsAlphaStr(char[]);
void CountChar(char[]);
int main()
{
char string[STRINGSIZE] = {};
char repeat = NULL;
cout << "Would you like to perform an analysis on a string of ch... |
Cross post from stackoverflow, as suggested.
I have an ordereddict, and I need to store it in CSV file.
Input:
dic = collections.OrderedDict([('k1', 'v1'),
('k2', 'v2'),
('k3', [ [('k3a',21), ('k3b',22)],
[('k3a',23), ... |
I've managed to create a working shopping cart and my next concern is security, mostly about the architecture and session security.
Should I make sessions somehow secure, if there's no authenticated login and sessions are deleted when browser closes? or is session_start() enough in this case?
Would the server side val... |
The goal of this query is to get a list of payments where all the corresponding payment lines and transactions have the status CLOSED. These are one to many relationships. The database is Informix.
I wonder if there is a more efficient way to write this? In its current state it has a lot of repetition which, maybe beca... |
This assignment is taken from Berkeley's CS61A page here.
Introduction
In this project, you will develop a geographic visualization of twitter data across the USA. You will need to use dictionaries, lists, and data abstraction techniques to create a modular program.
The map displayed above depicts how the people in ... |
I'm pretty new to client side scripting and I'm still learning.
I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page.
Everything seems to be works correctly, but was just wondering if there is anyone who could suggest how I can improve on this?
e.g:
... |
Let's say you have a Employees table mapped to a Employee class. Now you want to code a Edit page for general information. You need a ViewModel with all the properties you need to build the page, so you create EditEmployeeViewModel. Then you make your action EditEmployee and your view EditEmployee.
So far so good, but ... |
I am writing a script that will check the set values against a .properties file and I am just wondering if there is any nicer way to write what I have here.
#!/bin/bash
# @summary Check Values
# --------------------------------------------------------------------------------------------------
function _RunChecks
{
Su... |
I am doing a game that uses nape physics in ActionScript, but my question isn't about language. It is about the use of patterns.
I had fruits in my game. I did one interface Fruit and fruits like Banana using this interface. I also made a class Fruits to get random fruits in runtime.
public interface WorldElement {
... |
Our school grading scale is from 1..10 with one decimal. If you do nothing you still get a grade of 1.0. A passing grade equals 5.5. A 'cesuur' percentage defines at what percentage of correct answers the 5.5 will be given to a student.
Examples:
List item
Grade(0,100,x) should always result in 1.0
Grade(100,100,x) sh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.