instruction
stringlengths
71
95.1k
I'm working with an XML structure that requires booleans to be represented as 1 or 0. So, suppose the XML output has to look like: <valid>1</valid> Several nodes can be represented this way, so I made a struct to handle this. The solution I found works, but lacks oomph. OK, no, it doesn't just lack oomph, it sucks. (...
Inspired by the motivations expressed in this question. I created some code to generate the point list (and also display a pretty picture) using just analytic geometry (no Logo/Turtle, no trigonometry). Also, instead of recursively inserting new points to a growing list, I calculated the final length, and then assigned...
Is it a bad idea for a model class hold the db handler as a property? Example code are as below. I think the second is better, but the first is not so bad in my opinion. First: class ActiveModel { protected $db; public function __construct() { $this->db = DbFactory::get('Foo'); } public functi...
I am a biologist. Some time ago, I wanted to learn to program, and since I am fascinated by the 4th dimension and I was fascinated by the rotatation of hypercubes and hypersphere, so I decided to understand it better, and thanks to the work of Steve Hollasch, I understood that humans cannot "see" the 4th dimension, on...
Any suggestions on cleaning up this code: public override bool Validate(Control control, object value) { bool res = false; string str = string.Empty; try { if (((string)value).Length > 0) str = value.ToString(); } catch (Exception e) { res = fals...
This is my general database connection class. I am using this class to execute my queries through website. What would your suggestions on how to improve performance be? (Running MSSQL 2008 R2 SP1 - Microsoft Visual Studio 2010 SP1 , C# 4.0 - ASP.net 4.0) Class: using System; using System.Collections.Generic; using Syst...
I am looking for best practices as they apply to constructor usage in common Java class construction. Example 1 import javax.swing.*; import java.awt.*; public class Painter extends JPanel{ public Painter(){ buildGUI(); } private void buildGUI(){ JFrame frame = new JFrame(); frame.setLayout(new Bo...
The following is a personal attempt at implementing the Composite design pattern in Scala. Observation is abstract... class CompositeObservation(obss: Observation*) extends Observation { val elements: MutableList[Observation] = new MutableList[Observation]() elements ++ obss def hasElement(o: Observation): Bool...
I wrote one of my first classes in Actionscript 3 and I want someone versed in AS3 to help me fine tune my class. I am sure there are things that could really help with efficiency and I love learning about "Object Oriented Programming" so please take a look and let me know what you think. Project Background: This proje...
At the end of the Day 1 Go Course slides (pdf) there is an exercise stated as follows (NOTE: the course in the linked presentation is considered obsolete. If you are looking to learn Go the suggested route is first via http://tour.golang.org): You all know what the Fibonacci series is. Write a package to implement it....
I've got a foreach loop, going through each section of an XML document (an example of said XML document can be found in this SO question) and only display them in divs with corresponding classes. <xsl:for-each select="sections/section"> <xsl:sort select="sc_index" /> <h2> <xsl:value-of select='name' /> </h2>...
This code is part of one of the methods. I'm pretty sure it is really bad programming. The third if statement is supposed to be called if all 4 variables were set. Is another method needed? How would you write this piece? int width = img.Width; int height = img.Height; int thumbWidth = 0 , thumbHeight = 0; int preWidth...
So I have this SDK I'm working with, which lives in unmanaged land, and when it wants to tell me something in particular it sends me a particular Windows API message and passes a pointer to a Date in the LParam of that message. I figured out that the date is OA-compatible (a double representing a fractional number of d...
As part of my implementation of cross-validation, I find myself needing to split a list into chunks of roughly equal size. import random def chunk(xs, n): ys = list(xs) random.shuffle(ys) ylen = len(ys) size = int(ylen / n) chunks = [ys[0+size*i : size*(i+1)] for i in xrange(n)] leftover = ylen...
Just need to know if I'm doing something wrong in this code. my app seem work fast now with this code. I just want to if i really understant that - (void)receive { NSString *post2 = [NSString stringWithFormat:@"expediteur=%@&destinataire=%@", [[expediteurLbl text] stringByAddingPercentEs...
The idea is to lock resources in C# or Java using Qt: lock(obj){/*process with locked obj*/}` Now I see the problem with deleting obj under lock(). resourcelocker.h #ifndef RESOURCELOCKER_H #define RESOURCELOCKER_H #include <QObject> #include <QHash> #include <QSemaphore> class ResourceLocker : public QObject { ...
I'm writing a SQLite wrapper for C++. I have this class representing a database: class Database { sqlite3 *db; public: Database(const std::string& file_path, bool readonly = false) throw(SQLiteException); ~Database(); std::vector<std::map<std::string, Value> > Query(const std::string& query) throw(...
In the main class, loops generate numbers (0~100), and when its generated number is > 20, its value is passed to the thread where it simulates some work with this number. Meanwhile, while this number is being processed, other generated numbers > 20 must be skipped. Is this code OK? I am not sure if I'm doing something ...
I'm 100% sure improvements can be made. Any help is greatly appreciated. I should add that I am new to OOP and am not sure if I'm using this the right way. <?php defined('_VALID') or die('Restricted Access!'); class email { public function addtemplate($html, $public) { global $conn; $sql = "INSERT INTO emailt...
I have Model Object Car. public class Car { private String colour; private String make; private String yearOfMake; } Then a managed bean public Class CarSearchManagedBean { private Car car; @EJB private CarFacade carFacade; public String search() { this.car =carFacade.find(car); ..... } }...
I have two accordions on the same page First, I have a page, Freemarker, that includes two other Freemarkers that have the accordion. [#include "page1.ftl"] [#include "page2.ftl"] On page1: <h3 class="trigger"><div id="toggle-image">&nbsp;&nbsp;&nbsp;&nbsp;Page1</div></h3> <div class="toggle-container"> On page2: <h...
My goal was to be able to render my view models using a standard Object.cshtml editor and display template. In order to do so I needed to be able to always call Html.Editor(propertyName) or Html.Display(propertyName) in order to render the HTML element. There were plenty of resources for creating custom attributes and ...
This is my first experience of creating a useful tool in Python. I'd appreciate any critics on this. I can also post the config file if needed. # !/usr/bin/env python # -*- coding: utf-8 -*- """ A Python script that checks for Portage tree and overlays updates and notifies of the list of packages available for upgra...
I have implemented generic doubly-linked list class, which supports IEnumerable<T>,IEnumerator<T> interfaces. DoublyLinkedList<T> is fully compatible with standart BCL classes. Targets: class can be used as a standard replacement for Stack<T>, Queue<T> and List<T>. class itself is immutable, so you can-not change the ...
I have a function that accepts a big amount of data as a parameter (sometimes 1 megabyte) I was thinking which would be the fastest way to pass that data, dunno if I got this right, but here is what I think (functionality doesn't matter, all are the same in my app, since data is never used again after this function). /...
I've developed a log reader which can filter it's output following a few criteria: errorlevel, product, category, id. It is functioning, but when the log file is really big, it becomes very slow, to the point of going beyond the time limit. log_reader.php <?php session_start(); unset($_SESSION['errorlevel']); ...
I have a performance issue causing test->code->test cycle to be really slow. The slowness is hard to avoid, since I am doing some heavy image processing, and I am trying to accelerate things a bit by not running functions when it is not needed. For ex: compute some numbers from big images -> serialize results in text f...
I'm looking to improve this class - any suggestions? It checks for empty, name, email, and password. The regex for email is very simple. A very lengthy article from the Linux Journal for improving upon this is here. The character set for password I borrowed from the NASA signup page. For name I allow letters, perio...
I'm writing a little Downloader that will look through directories online and download the content. The first prototype of my program is a success, now I just want to refine it and learn some more C#. The task is this: Take this string: http://example.free.pl/plus%20violent/Dark%20The%20Suns/All%20Ends%20In%20Silence/...
This is my first ever attempt at Ajax form validation, and everything works as expected, the final true example will hold a lot more input fields than in my testing scripts which are below. The file is expected to get a lot bigger as in my testing I have only used 3 input fields, how can I improve on this: HTML file <f...
I wrote a short ruby script to generate various screenshots, and event though I am not completely new to ruby I rarely use it. Full script (41 LOC): https://gist.github.com/1229115 The string substitutions irritate me. They don't look quite right - much too ugly for a beautiful and concise language like ruby. Am I ove...
I am fairly satisfied with my solution here but I would definitely appreciate any constructive criticism of my style and design. The basic idea is to use the strategy pattern to simplify assembling a custom procedural generator. I'm using modules rather than classes for improved simplicity of 'mixing' everything togeth...
I have 2 Dictionaries. I am trying to optimize this code to run as fast as possible. This is for solving Shanks Baby Step Giant Step Algorithm Algorithm: Given b = a^x (mod p) First choose n, such that n^2 >= p-1 Then create 2 lists: 1. a^j (mod p) for 0 <= j < n 2. b*(a(inverse)^n)^k for 0 <= k < n Finally loo...
So after answering a question about nested linked checkboxes I mentioned it at work and surprisingly it turned out to be similar to something we needed. The requirements were: a "Select all" checkbox a nested "Select all" checkbox (only selects a small portion) Cannot rely upon the hierarchy of the markup. The given...
I have function which writes data of a specified type to a buffer. Here is the part of this which writes Uint8, Uint16, Uint32 and Uint64, in big and little endian. As you can see that the same code is repeated several times, so I want to make this code more elegant. ... case BW_DATA_TYPE_UINT8: ...
The whole idea behind this ,is the user enters : 1. hg commit -m "NO-TIK" and is able to submit the changeset 2. hg commit -m "NO-REVIEW" also does the same as # 1 3. hg commit -m "JIRA-123 blah blah" is also submitted as long as there is a valid issue "JIRA-123" otherwise the commit is reverted with the message "%s do...
I am actually pretty excited about this approach, but for sanity's sake I wanted to hear some thoughts on others on my strategy here. My basic goal is to parse a YAML file and recursively create module constants using eval. The core business logic is here: # # configure application based on an easily-managed .yml fil...
This code is from a flex app and is the PHP to determine if a user has read a section of text and answered a question correctly. I write to a table that is similar to a bookmark, and then update the users points. This code works, but since I am making two calls to the database I am worried that it is too "expensive". I...
In SQL Server, there is two tables: Houses, and their images. I need a list with 20 houses with the first of their images (only one). I tried: SELECT top 20 h.id, h.name, im.id, im.name FROM image im INNER JOIN house h ON im.house_id = h.id WHERE 1=1 AND im.id=(SELECT TOP (1) im2.id FROM image ...
I'm playing around with PHP, trying to write a small ORM. Having worked with Magento quite a bit lately, I've fallen in love with the automagic getters/setters that Magento, I think, inherited from Zend. For those, who've never seen it in action, this is what I'm talking about: $my_object->setSomeProperty('foo'); j...
I'm using some slow-ish emit() methods in Python (2.7) logging (email, http POST, etc.) and having them done synchronously in the calling thread is delaying web requests. I put together this function to take an existing handler and make it asynchronous, but I'm new to python and want to make sure my assumptions about ...
The purpose of this function is to report processing progress to the terminal. It loops through an array of maps that contain two properties: :sequence and :function. Within each sequence-function-map, it will loop through the sequence, and run the function on each item in the sequence. This is my first Clojure progr...
Since Python's ConfigParser does not throw an exception if the file does not exist, is it fine to do it this way: try: config = ConfigParser.RawConfigParser() if config.read('/home/me/file.conf') != []: pass else: raise IOError('Cannot open configuration file') except IOError, error: sys...
Simple really my javascript function for checking my form. var errors = {}; errors.email = true; errors.cemail = true; errors.password = true; errors.cpassword = true; errors.username = true; function joinAjax (id) { var val = $('#' + id).val(); if (id == 'email') { $('#emailMsg').hide(); var reg = /[a-z0-9!#...
I'm trying to isolate a webservice in its own class, and I plan to add separate classes to each webmethod there is in the webservice. What I have so far works, but I have this feeling tickling that I've missed something (except for the invisible variable declarations down here, I didn't want to clog the page). Webserv...
Can you suggest how I might make the following code more efficient: from collections import Counter a = [1,1,3,3,1,3,2,1,4,1,6,6] c = Counter(a) length = len(set(c.values())) normalisedValueCount = {} previousCount = 0 i = 0 for key in sorted(c, reverse=True): count = c[key] if not previousCount == count: ...
I have all large file of all the order sold in one week. This file gives one line for every order. We have over 5000 orders a day. It read the file line by line and then adds the sale to a database of sales. to I really need to boost performance. static void sold4weeks1() { string sold, asin; st...
<?php $userinput = $_GET['host']; $e = escapeshellcmd($userinput); $arr = (explode(".",$e)); $num = count($arr); $times = (int)$_GET['times']; $time = (range(1,51)); if (!isset($time[$times])){ $times = 5; } function isValidURL($url){ return preg_match('/(www\.)?(.)*[...
This is basically my first Ruby class, which is to remove all empty lines and blank times from a .txt file. A simple test case is also included. I tested the code and it works fine. But I did not have much idea about if the code style is good, or if there are some potential issues. Can someone please do a quick review ...
Doing practise questions for a Java exam which have no answers (useful) I have been asked to do the following: Write a class called Person with the following features: a private int called age; a private String called name; a constructor with a String argument, which initialises name to the received value and age to 0...
This exercise gave me some trouble, but I think I have a solution here that fulfils the spec. However it's very long compared to what I'm looking at on the solutions page at clc-wiki.net. In the course of solving the problem I loop over my buffered line three or four times. This seems like quite a lot, and the various...
Background is this question and to create something like Craigslist or olx.com i.e. classifieds advertisement webapp / site and I've basically solved the problem and had a mess of unstructured code that built other code and generated SQL and other stuff and now I've first rewritten it from Java which got the source dow...
My first jQuery plugin is working, but I wonder if my coding is conventional. What can I do better and how can I make it more efficient? I know it's only a small plugin, so efficiency is not a big deal, but I don't want to start with bad habits. What this plugin is doing: It transforms a div to a widget (with header a...
I've written the following controller and i was looking for some input/advice on how i could go about cleaning this up or rewriting it. I feel like i'm repeating myself a lot or that there might be a better way to do this. namespace WebUI.Controllers { [Authorize(Roles="Administrator,Registrar")] public class R...
I previously asked for a review at Count to target with JavaScript, and it was a great help. I'm now looking for comments on the extended version. This code very simply counts in the direction of a particular target number, with the count slowing down as the target gets nearer. The target number is stored in a nearby ...
This is a JUnit asserts for this function: assertEquals(0, obj.generateListSize(0)); assertEquals(1, obj.generateListSize(1)); assertEquals(1, obj.generateListSize(2)); assertEquals(3, obj.generateListSize(3)); assertEquals(3, obj.generateListSize(4)); assertEquals(5, obj.generateListSize(5)); ...
I started creating a Dictionary class that accepts objects as there keys: class Dictionary implements ArrayAccess { private $_keys = array(); private $_values = array(); public function offsetExists( $key ) { return false !== array_search( $key, $this->_keys, true ); } public ...
I have created an extension for unit-testing my own equality implementations. Is it a good approach in general to have such extensions for unit testing? What unit-testing extensions do you use? public static class EqualityExtensions { /// <summary> /// Checks that all variations Equals method confor...
I'm a complete beginner of Factor, but I just managed to solved Euler Problem #1 using it, and would love to have the code reviewed. Anything that can be improved? In particular I'm wondering if there is a cleaner or more idiomatic way to write the mult3or5? word. USING: math kernel sequences math.ranges prettyprint ; ...
I've created a program that uses System.Graphics to render a simple (small) 2D scene to the screen. The problem is, for some reason, it starts to quickly accumulate memory. In fact, it goes from only 100,000K Mem to ten times that and then crashes. As expected, the frame-rate of the program drops dramatically as well ...
I had an efficiency problem like I thought and I didn't have the best solution here. My solution was \$O(n)\$ and directly a more experienced member told me a solution that is \$O(1)\$, that only fetches one element and doesn't have to do a count. I'd like to rewrite to that solution, if you agree that is the next thin...
This is a INSERT function. It's working... I just pulled out the function from the class, atm to try it out. And improve. I think the code is a bit messy, And I am pretty sure I can improve the code, less code, for example.. Any ideas? $data['test'] = array('username' => 'john', 'password' => 'hello',...
I have written a small template Viewer/Controller esque library that I would like some critiques on. The library is located here If you are looking for where to start, check out App.php and AppController.php in the classes folder I would really love to hear your critiques on: Code quality Code clarity How to improve A...
I am working on a small script for a mobile site. Is there any way to improve on the regex here? or remove it completely? function fn_page_change(event) { event.preventDefault(); var activePage = $(".ui-active"); var newPage = $(event.target.getAttribute("href")); activePage.className = activePage.class...
This question came up today on StackOverflow. I find it more unfortunate than (as some others said) idiotic. And it recalled an old function I have which I just remembered. I have a user.config file which has some settings which can be updated through user action. My rationale was "if the setting is changed, it should ...
We have interviewees write sample code, but now we want them to modify some simple working code. I came up with the following proposal, which is a syntax-directed interpreter implemented with a table-driven finite state machine. The interpreter simply accepts whitespace-delimited text and outputs "Hello" when it sees t...
The following code is a javascript typeOf function. We aren't here to discuss coding conventions or whether or not extending a native object like I have is kosher or not. I want to know in what cases this would fail to correctly identify an object and hopefully ways to correct it. Or is this sufficient for 99% of cases...
I would like a serious, blunt and cold judgement on this code. Would it be considered 'good' code? In general, is it well written? Is the design reasonable? #include <iostream> // C++ IO library code to include. #include <string> // C++ string functions. using namespace std ; // Use standard C++ names for func...
Simple question: What would you rather do? public class FooRepository { public Foo GetById(int id) { Foo foo = null; using (IDataReader data = /* Get Foo's data */) { // Let the Foo object set it's own fields using the data object foo = new Foo(data); } ...
Here is the question. From SPOJ [HS11DIVS]. Now , the problem is that my code works perfectly for small numbers. But when it comes to Large numbers , the time limit exceeds. I am not getting any hint on how to make it more efficient. The code is simple enough to understand. I mean its a pretty basic question but diffic...
I'm not very experienced in test-driven development (TDD), but I'm trying to get into the groove. Here I am making a console app that creates records in a database. I bootstrapped by creating a console app and then let MSTest make a unit test for Main(string [] args). I know I'm doing at least something right, because...
I'm working on an implementation of the Double-Ended Queue as a Doubly-Linked List (for personal enrichment), and I was wondering if anyone minded taking a look at my Constructor/Destructor and Empty functions to see if I'm on the right track. It should be self-explanatory enough on it's own (I hope). DeQueue::DeQ...
I've been spending a lot of time reading about JavaScript lately, and this is my first piece code that I've tried to apply some of what I've read to. I'm trying to stay clear of using a framework for this so I can have a better understanding of the JavaScript language itself. This code is part of a chrome extention ...
I'd like to get some feedback on a PHP Database Abstraction Layer I've created. It's a little long, but there really wasn't a way to just post part of it. Here is the base DBObject class for MySQL: <?php /** * Description: The DBObject class is the generic database object. It is not to be used directly, but extended ...
I am trying to make a generic form parser for Javascript. The idea being, a developer could drop the function onto a form and sumbit via AJAX, or do something with a form besides submit it. The result will be in the same format used in a query string. What I have posted works, so I am basically wondering if this is a g...
Should I leave in <cfif reFindNoCase( "\.cfc$" , targetPage ) eq 0> or not? Direct CFC calls are flushed when the method returns. Either way, onRequestEnd will stop debug output from being returned for AJAX requests. Keep If Statement Additional regular expression search on every AJAX call. Direct CFC calls return quic...
This module makes a doubly linked list and initializes each member. I couldn't do it with a loop, so I gave up and made each node individually. How can I improve it? Can somebody help me make a loop to chain all these lists together? This is from a Checkers game I'm making. #include <stdio.h> #include <string.h>...
Simply put, is this function a correct and safe way to add and/or subtract time to a tm struct (from <time.h>)? void AddTime(int seconds, tm *date) { date->tm_sec += seconds; mktime(date); } seconds could be any value, supposedly larger than 60 (or smaller than -60). I'm using mktime to readjust the other valu...
def int_to_roman (integer): returnstring='' table=[['M',1000],['CM',900],['D',500],['CD',400],['C',100],['XC',90],['L',50],['XL',40],['X',10],['IX',9],['V',5],['IV',4],['I',1]] for pair in table: while integer-pair[1]>=0: integer-=pair[1] returnstring+=pair[0] return...
I've tried to create optimal in terms of performance and memmory consumption. But also I've tried to make it functional and scala way. I want to get you comment on how to make it more 'scala'stic object LifeGame extends App { trait Matrix extends Iterable[(Int, Int)] { def apply(p: (Int, Int)): Boolean ...
I am using the following code to run an operation on a .dat file, which is working fine. The .dat file can be treated as a text file. My main concern is improving execution time when you have to run a for loop on 25 Mb of data. $file_name='grid_10min_sunp.dat'; $handle = fopen($file_name, "r"); $lat1=13.86082; $lan1=...
I'm currently writing a mesh generator class, and I'm making a method that generates vertices, normals and texcoords for a cube. But, as you can see, it's incredibly complicated and hard to follow. Is anyone willing to help me making this shorter? public static void GenerateCube(float size, out Vector3[] vertices, out ...
Like many, I started out with procedural programming. Of course, when learning a functional language, old habits may die hard, so I wrote a fairly trivial little thing which takes an integer and returns a list of the english-language representation. A few days later, I re-wrote it to try to take advantage of tail recu...
Could someone please review my code? It seems too convoluted. I am just starting to learn to go from blog to hosting. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <style id="page-skin-1" ty...
What follows is the first almost useful C program I've successfully written since an Intro to Programming class in college. I'm hoping to slowly maybe work my way up to Objective-C/Cocoa development, but figured I'd start by re-teaching myself the basics. I write PHP for a living, so some things, particularly pointers,...
So this was inspired by: this question But doesn't actually answer it: What do you think of: public class Case<TRes> { public Case(bool condition, Func<TRes> result) { Condition = condition; Result = result; } public bool Condition {get; private set;} public Func<TRes> Result { get; ...
I'm working on an android application, but this is basically plain 'ole java. The aim is to do the right thing and not repeat myself. public enum Datafile { ACTIVITIES() { @Override public String filepath() { return "activities.yaml"; } }, OPEN_LOOPS() { @Override publi...
class HtmlLogger:ILogger,IDisposable { private System.IO.StreamWriter _file; private bool _disposed; public HtmlLogger() { _disposed = false; _file = new StreamWriter(@"somepath"); _file.Write("<HTML><BODY>"); } public void Log(string message) { _file.Writ...
This simply pulls data from mysql and creates the html to be sent to the page. class view_html extends database { function __construct($type) { parent::__construct(); switch ($type) { case "bookmraks": $this->bookmarks(); break; case "tweets": $this->tweets...
This class sends "tweet" data to the client in the form of a custom markup language. How can it be improved? It is used in Ajax call and in previous post people have suggested not to echo the result..but this is my primary means of communicating with the server via Ajax responseText. Also <tw_p> is used to denote a pa...
I have an application that has a lot of very complex objects that in most cases I only need to access an id value and a name value from. I'd like to reduce the overhead of serializing these large objects to JSON. This is a simple function I created that takes an array of objects and returns an array of structures that...
Now I have a bunch of these methods ( you can tell how ugly it looks like): void ConvertUtility::ConvertEdgeIndexList(const list<EdgeIndex> &edgeIndex) { list<EdgeIndex>::const_iterator sit; for(sit=edgeIndex.begin(); sit!=edgeIndex.end(); sit++) { } } void ConvertUtility::ConvertEdgeIndexList(c...
I'm trying to get my head in the Scala game, and would welcome feedback on the following code, which produces a table from data. class TabulatorTest extends FunSuite with ShouldMatchers { test("format") { Tabulator.format(List( List("head1", "head2", "head3"), List("one", "two", "three"), List...
Due to software constraints, I cannot use the standard libraries, <math.h>, <algorithm>, templates, inline, or Boost. I am also using standard C (ISO C99) such that array is not a reserved keyword like it is in Visual Studio. Is this the "best" possible implementation of a min function? This needs to be robust and fast...
This week-end, I finally found some time to learn unit testing (it's about time, I know). So I've tried to do this in PHP, with PHPUnit 3.6. I've wrote a small, simple and useless class wrapper for files, and a basic unit testing class for it. As I'm a self learner, and nobody around me can help me about that, is it po...
I'm very much a beginner and have put together some JavaScript to control a pair of radio buttons which essentially behave as links. I'm doing this as sort of a self-initiated project, or bit of fun. I know I don't have to use radio buttons, but it's something I just wanted to do. It simply checks the radio button when...
It always bugged me that you would have to write your private class members inside the header files in C++. This means that everytime you change you implementation, client code has to be rebuild. I found thise site which describes how to hide implementation detail in C++: http://www.octopull.demon.co.uk/c++/implementat...
/**************************************************************** VIEW MODULE view, view_database, view_message view_arche_1 (external), view_arche_2 (external) - these are primarily html files ****************************************************************/ /*view*/ class view extends database { } /*view_d...
Due to software constraints, I cannot use the standard libraries, math.h, algorithm, templates, inline, or boost. I am also using standard C (ISO C99) such that array is not a reserved keyword like it is in Visual Studio. I need to duplicate the Matlab any function in C / C++ for an array. I currently have written two ...
So I've been thinking alot about simple/convenient ways to implement simple 2D animation using a bare-bones graphics library I'm using for school (Animation is way out of the scope of the class, I'm just experimenting.) I thought of using a custom function passed to the class to allow the "user" of the code to just wri...