instruction stringlengths 71 95.1k |
|---|
I would like to optimize the code to be efficient. Basically the code finds and generates an Anova table with the p-value also computed.
I am inputting a text file with data delimited with commas.
This is the main function that calls the methods in the library file:
using System;
using System.Collections.Generic;
using... |
Here is the book question:
Modify the CatFile function in the program so that it uses
WriteConsole rather than WriteFile when the standard output handle
is associated with a console.
And here is my solution:
static VOID CatFile(HANDLE hInFile, HANDLE hOutFile)
{
DWORD nIn, nOut;
TCHAR buffer[BUF_SIZE];
... |
I think here is something wrong with code. I use a class with methods to get tenants from DB:
public List<CrmTenant> GetAllTenants()
{
List<CrmTenant> tenantsList = new List<CrmTenant>();
try
{
var crmTenants =
from tenant in context.CrmTenant
... |
What do you think of my own implementation of the extension method SelectMany?
Motivating criticism is always welcome.
public static IEnumerable<TResult> MySelectMany<T, TResult>(this IEnumerable<T> source, Func<T, IEnumerable<TResult>> selector)
{
var theList = new List<TResult>();
foreach (T item in source)
... |
How do I better calculate the definite integral? I am using a function to integrate and another to find the factorial recursively.
I'l like to better the algorithm or the efficiency or even the accuracy for that matter.
public static double testStatistic(double meanTreatmentSumOfSquares, double meanErrorSumOfSquare... |
I'm trying to make a drop down menu with click event. I have this HTML structure:
<ul id="menubar">
<li class="menu1">
<a href="#">Menu 1</a>
<ul class="submenubar">
<li class="submenu1"><a href="#">Submenu 1</a></li>
<li class="submenu1"><a href="#">Subme... |
I have the following datastructure to perform a longest-match lookup via nested dicts. For example. cs['a b c d'] with a and a b c being in the structure will return a b c and the remainder d.
I wonder if there's a better way to implement the _lookup method and possible the __setitem__ method. I'm also not completely s... |
My job required me to learn jQuery the last couple of weeks, but it's a mess and I do not know how to structure my code in an acceptable manner. I come from a Java and PHP background and have never touched JavaScript before.
I've searched the web for some guidelines, but I could not find anything of real value.
functio... |
Im trying to teach myself enough to start using more OOP in php. This is what Ive come up with. Is there any reason why any of this is done wrong, or should be done another way?
class workers {
private $name;
function __construct($name){
$this->name=$name;
}
... |
I have written a module in my application that makes extensive use of dynamic LINQ to produce Linq/SQL queries based on user interface selection.
Currently, the Linq-SQL translation is resulting in very unoptimised query results, so I am looking at ways to get LINQ to improve the SQL that it is producing.
The following... |
I'm looking for a new job, and a company who had a role I was going for asked me to do a programming exercise. It consisted of making a web application of two or more pages that took a person's name and a number, and then rendered the number converted to words. I sent it off and they replied saying that the code wasn't... |
General advice for a change. This is an implementation of message queues that I'm going to use for some work on an actors model library.
(defclass message-queue ()
((messages :accessor messages :initarg :messages :initform nil)
(last-cons :accessor last-cons :initarg :last-cons :initform nil
:documentation "Ca... |
A while ago I used this code to load content into a div using jQuery load. I repeated the code for all the clicks to load different pages in the same div.
Is there any other way to do this?
$("#button1").click(function(){
$('#div1').load('page1.php');
});
$("#button2").click(function(){
$('#div1').load('page2... |
In the code below , i'm only able to get PHP arrays in javascript to work when I hard code the value . Is this the only way to get it to work, or is their a way to copy the entire PHP array into Javacript . Right now I'm tempted to just create a function chart() for each set of PHP array values. As in rather then writi... |
Can you please check if I've written the code correctly?
The task was:
Calculate the user's month of birth as a a number, where January = 0 through to December = 11.
Take the string entered
Get the substring, being the first three characters
Convert to uppercase
Find the starting location of the three-letter abbre... |
I am interested in finding out what is the correct way of implementing error handling for this situation in C#.
The system tries to do an operation. If the operation succeeded (returns a non-error code), the system logs in a log database that the operation was succesfull. If the operation returns a error code or someth... |
I setup simple CRUD in Django
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
from intentions.models import User,Prayer,Intention
from intentions.forms import IntentionForm, DeleteIn... |
I am currently writing a rather large client-side JS application which is made of of multiple modules, each in different files (before compiling). I am using Node.js to build the final script based on all the individual modules.
For the script to work properly all modules must be added in the proper order, so they can... |
I am trying to eliminate unwanted namespaces, and I know there's a better way to do this. This code works, but it's remedial and redundant.
string sPattern = "xmlns:d5p1=\"http://www.w3.org/2001/XMLSchema-instance\" d5p1:nil=\"true\"";
string sPattern2 = "d5p1:nil=\"true\" xmlns:d5p1=\"http://www.w3.org/2001/XMLSchema... |
I am writing a program for my trading application. Over the months the program has been growing steadily, and what is used to be a small program now I would call a medium size program (about 1000-2000 lines in total), and it will keep growing as I add more features to it. It has grown to a point where it start to get ... |
I needed to write a function today in JavaScript that would return all elements based on a given attribute.
e.g retrieve all elements that have an id attribute in them.
The function I wrote for this is as follows:
function getElements(attrib) {
// get all dom elements
var elements = document.getElementsByTagN... |
Is large use of closures actually a bad thing for readability and maintainability of the code? For example, consider the following code with (comments removed on purpose):
$withMobile = function($c) { return $c->getMobile() !== null; };
$extractAll = function($c) { return $c; };
$extractId = function($c) { return $... |
I've been working on a simple program to output values to the console as a learning project, and I stumbled across an article advising against using 2D containers, suggesting to simulate them instead with a 1D vector/container. I immediately proceeded to try to create a ridiculous class that converted input X and Y va... |
I needed to IP block something in nginx and I ended up with duplicated proxy_forward code. How can I refactor and un-duplicate this?
server{
location /admin{
allow 123.90.250.0/24;
allow 123.66.148.0/24;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Ho... |
I need to define custom calendars and, in particular, test a DateTime for being a holiday. My current code is shown below. Is there a more concise/better way of doing this, preferably without sacrificing performance?
let private isHoliday2011 (dt:DateTime) =
match dt.DayOfWeek with
| DayOfWeek.Saturday | DayOfWeek.... |
I have a set of if/else statements that trigger certain actions. As a first step, I was thinking about moving the logic in each if statement to be its own function, but are there any recommendations on what design patterns can help clean this code up?
I guess I am trying to see if there is a cleaner way to determine wh... |
I have following model and database created using Entity Framework. Is it proper TPT Inheritance?
Is it possible to make the base class as abstract?
Model
Database
CODE
namespace LijosEF
{
public partial class Book
{
public override void Sell()
{
this.AvailabilityStatus = "BookSOLD";
}
}
public... |
I'm learning Python by converting a BASIC (BlitzPlus) program I wrote based on article at http://gamedeveloper.texterity.com/gamedeveloper/201002?pg=42#pg43 for random dungeon generation.
I've basically used Google and trial and error to get this script to where it is now (which is a working program).
However, I'd like... |
I have a serious nesting of ifs in a helper code and I would like to making cleaner. I would like to avoid case if possible as well.
I know there is probably a more object-oriented approach to this but I can't seem to know how.
I'm flooded with stuff like this:
def print_flight_options_status(invitation)
if invit... |
After posting a question about Alphanumeric Hash generation on StackOverflow, the most helpful answer was to change the conversion method from pulling 5-bit chunks of a binary hash value, to instead changing the number to base-36.
This is pretty straightforward; find the quotient and remainder of the number divided by... |
So here we are, using a StringBuilder to build an email body. I know there's a lot on StackOverflow and endless debate/discussion around how best to concatenate strings.
Can this be done in fewer lines of code in C#?
Can this be done better using templating?
My goals are readability and maintainability.
StringBuilder... |
I am building a dynamic site. All data will be served through an index.php in my webroot, using jquery to update the content. In webroot, I have a folder 'i/' which contains the files I want to include. The main include files contain code which will be used on every page: globals.php, globals.css, globals.js, etc. plus... |
I want to allow users to share documents (and other stuff) in a database-driven application.
I have designed the following schema to allow for this (PostgreSQL). Some of the tables like Party are skeletal for simplicity.
Diagram (minus lookup tables):
A lookup table for party types:
create table partyType(
id int no... |
I use a global variable to fit my need:
scores = {}
def update():
global scores
# fetch data from database
scores = xxx
class MyRequestHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
def get(self):
def choice_with_score(items):
# return a key related to scores
... |
I need to write some code that checks thousands of websites, to determine if they are in English or not.
Below is the source code. Any improvements would be appreciated.
import nltk
import urllib2
import re
import unicodedata
ENGLISH_STOPWORDS = set(nltk.corpus.stopwords.words('english'))
NON_ENGLISH_STOPWORDS = set(n... |
I have written a generic Collection class which allows me to add and remove items from an encapsulated std::list. The collection will raise an event when an item has been added or removed.
Normally I would have derived this class from the std::list, but I have been strongly recommended against doing so for various reas... |
I am new toboost::thread and am making a producer-consumer with a Monitor. This is how I've coded it so far:
//{ Declarations in header
private:
boost::condition_variable _condition;
boost::mutex _mutex;
std::deque<RawMatrix*> _queue;
boost::detail::atomic_count _count;
//}
void Matri... |
I'm a beginner in JavaScript. I wrote this code so the main image get set on whatever thumbnail image the user clicks.
And if the user didn't click on any image the main photo get changed every 10 seconds.
Here's my code (I feel like I'm doing some unnecessary work here in the timers but I can't figure it out):
HTM... |
I have this function that calculates average. I don't want it to look like this. I am hoping for a less cliche average function because I see that most people's look like this.
function mean(array) {
var num=0;
for (var i=1;i<=array.length;i++) num=num+array[i];
var divide=num/array.length;
alert(divide... |
def json_response(response):
assert response.code == 200, 'bad http response'
return json.loads(response.body)
def custom_json_response(response):
response = json_response(response)
assert 'answer' in response, 'invalid custom json'
return response['answer']
The code looks straightforward but I wo... |
If you use capturing parenthesis in the regular expression pattern in Python's re.split() function, it will include the matching groups in the result (Python's documentation).
I need this in my Clojure code and I didn't find an implementation of this, nor a Java method for achieving the same result.
(use '[clojure.stri... |
Below is an algorithm to generate all pairwise combinations for a set of random variables. See here for an explanation of what constitutes a minimal all-pairs set. The algorithm below works but I feel that it is inefficient. Any suggestions would be welcome.
from operator import itemgetter
from itertools import combina... |
I have just written a solution to the following problem:
We all know the classic "guessing game" with higher or lower prompts. lets do a role reversal; you create a program that will guess numbers between 1-100, and respond appropriately based on whether users say that the number is too high or too low. Try to make a... |
Part of an application that I am building in CakePHP 2.1 needs to send out an e-mail based on a template from a database. The end user is able to set the from, reply to, to, cc, and bcc addresses. Because the user could enter just about anything, I need to process those addresses into a usable array that I can pass to ... |
So I feel like I'm a good coder, but that's from my point of view. Can you take a look at my code and give me some tips or criticize me on my code. Or give me some tips or things to add or make things smaller.
console class
public class console {
public static void main(String[] args) {
//makes the window... |
Here is my method:
// can change
DWORD step[2] = { 0xAC, 0x723A };
packageType = 1;
DWORD computeLevel(DWORD blockNum)
{
DWORD num = (blockNum / 0x70E4) * step[1];
if (blockNum < 0x70E4)
return num + step[0];
return (1 << packageType) + num;
}
I am trying to optimize this for speed, as it gets cal... |
I hava a collection of schedules - EventSchedules. I want to select from this collection today, tomorrow and after tomorrow schedules. The day start from 06:00 and end 6:00 of next day.
Examples:
For today the query return events start in range: 30 July 2012 06:00 - 31 July 2012 06:00
For tomorrow the range is: 31 J... |
I have been looking at a couple of different approaches on how I can notify the UI about messages coming from the ViewModel, and wanted to see if this seemed appropriate or if it is too coupled. (We already have a static class that deals with notifications that I am trying to wrap for now, and maybe remove at a later t... |
When I realized that the code below has a major problem in what it'll do (it'll just update the database with information currently in the database), I was told that there are a lot of mistakes.
Please point out the mistakes to me, suggest improvements and how to avoid the mistakes in the future.
public User Get(int Us... |
I'm looking for a better more efficient way to write some code I have where I"m synchronizing two lists. Basically, the first list is a list of devices I need to check. The second list is a list of devices that I have already checked with dates. I need to synchronize the two lists so I only check devices that are ne... |
Edit: I updated the JavaScript modules in http://enlargeyourpassword.com to use scope(). You can see the result in the source of the page, and get an idea of the process by looking at the commit history on GitHub.
As a JavaScript developer, I want to write modules in a format that is well supported today and that will... |
I'm using the following pattern in my mobile app. The code snippet below manages a stopwatch.
Is there a way to simplify the code for better readability and probably getting away from needing to use MyApp.stopwatch. inside it? Somehow in some cases using this instead works, and in some it doesn't.
And what about gettin... |
This morning I decided to write this question: https://stackoverflow.com/questions/11727571/are-there-problems-if-i-have-a-verbose-datatype/11727723#11727723
I don't really explain my scenario about how am I accesing through the nested dictionaries. I decided to have the default alias (IDictionary<string, IDictionary<L... |
I am building a website that uses Amazon S3 to host its image (and other) files.
I require that images displayed on the website look like they come from my site and not from Amazon (so we are talking on the request/response level). What I have done is created a controller which all these files will pass through. The ... |
I'm writing a results wrapper for a gem which wraps a Thesaurus API. Basically, when you lookup a word in the thesaurus, the results come back in approximately this JSON form:
{
'noun' => {
'syn' => ['array', 'of', 'synonyms'],
'rel' => ['array', 'of', 'related terms']
},
'verb' => {
'syn' => ['syn... |
I'm writing am application that I've previously posted questions on here, but I'm looking for similar advice if possible. I am looking for how best to write my code, as I have a working example, but to me it feels long winded.
The application first grabs 3 tables via DataContext:-
var contacts = db.GetTable<Con... |
I need some useful functions that faster than the original. (Original - C++'s functions)
For example:
#include <time.h>
#include <stdio.h>
#include <Windows.h>
struct TestMemory {
double a,b,c;
};
void* __TestMemory__Sample=0;
int WINAPI WinMain(HINSTANCE h1,HINSTANCE h2,LPSTR str,int i) {
AllocConsole();
... |
Techies--
This routine does more once the channels + the subsets of existing batch arrays are re-distributed for processing. However, the success of that will only work as well as the initial splits. The threshold value is dubbed here, but it will come from app.config as configurable setting. Obviously the jagged strin... |
I'm designing a small intranet-based time-tracking web app that accepts an unknown number of data "rows" which each consist of 7 form fields. Rows can by dynamically added by the browser.
Can I do better?
Given this (partial) example POST data:
$_POST['project'] =>
Array
(
[0] => PROJECT_CODE_1
[1] => P... |
Any comments are welcome. However I'd like to call specific attention to my... interpretation of the N-Tier application architecture and how I'm consuming data. Note that the namespacing and inline comments have been factored out for brevity.
The Data Tier (DataModel.csproj)
// Base class for EF4 Entities
public abstra... |
I'm using the cosine function in C++ to simulate flashing for a sprite in my game. The method looks like this:
(anything in the sf namespace is part of the SFML graphics library)
void Player::update(const float& deltaTime)
{
mAccumulatedTime += deltaTime;
float opacity = abs(cosf(5*mAccumulatedTime)) * 255;
... |
Looking for a code review, as working alone on a project and don't have anyone who could possible help me.
if ($('.qp-content-right-scroll-panel').is(':visible')) {
var isLiveData = $("input:radio[name=preview-options]").val();
if (type.indexOf('DASHBOARD_LAYOUT') != -1) {
var base = $('.qp-content-rig... |
This Python code parses string representations of Reversi boards and converts them into bit string suitable for use by a bitstring module: b = BitArray('0b110') or bitarray module: a = bitarray('000111') if blackInit and whiteInit are initialized as empty strings.
I am interested in a simpler way to do this in Python. ... |
Having scoured the web and found little helpful information regarding the implementation of an overridable compareTo() method, I determined myself to find a solution. In another thread I was pointed to some information pertaining to an overridable equals() method, however compareTo() has some pretty unique issues which... |
I have two Java classes with very similar code. Basically they are almost the same except for a few method calls etc, i.e. replace ip with msisdn in the classes and they would be identical.
How can I refactor them to remove the duplication? Or maybe if there is a Design Pattern I should be using?
public class IpQuery ... |
Since I don't know how LINQ works under the hood, I can't decide what version is best to use in term of rapidity of execution. I've done some testing with my testing data (Point Cloud) but I can't see a clear difference between the two. The only thing I know is that the real life data will be a larger Point Cloud so my... |
I am working on a Rails 3 application, and am having some trouble with my user/edit view. In this application, Users can subscribe to Categories. Users and Categories have a has_and_belongs_to_many relationship through a join table (categories_users).
In my user/edit view, I need to display a list of checkboxes for the... |
I’m trying to learn as much as I can on my own by reading lots of examples, documentations, and asking here. I would like to improve my style to write efficient code and adhere to Java standards.
In this small sample of code I would like to get feedback on a few things:
Exception throwing
Opening/closing database conn... |
I followed this tutorial to create an SQL "factory".
The link shows how to make a class who's methods will output SQL statements based on the arguments you pass to it, and I've expanded on it with the class below.
Basically, as an example of its usage: if you wanted to select from a database you can pass it an array of... |
This is just a program to show the use of conditional variables when two threads are involved. One thread wants a non-zero value of count, and other thread is responsible for signaling it when the count is non-zero.
Is there something in this code which still needs an improvement? Is there something which could have be... |
I'm only just beginning in programming.
The goal of the program is to check to make sure images are properly rendered within a program(within a VM)
. Below is the code, and I am asking what I can do to clean it up.
I don't think you can tell much without the .png's, but I would appreciate it if anyone knows where/how ... |
First of all, I came up with that question on SO already. But I am offered different solution which are "better" in some ways. The goal is to improve this specific version, not to create another one.
Here is what it is about:
Reading Coding Horror, I just came across the FizzBuzz another time. The original post is h... |
I am having difficulty deciding how to implement an exception handling strategy.
I am using an observer pattern to allow "plugin" programmers to subscribe to Messages. These subscribers generally log a unique error (and do some other stuff) under an exceptional circumstance during handling the message. The code snippet... |
I wrote / modified two scripts to count Facebook and Twitter reactions. Anything I can do to improve these?
Count Facebook Reactions
class FacebookReactions
{
public $url;
function __construct($url)
{
$query = 'SELECT like_count, total_count FROM link_stat WHERE url="'.$url.'"';
... |
I am writing a WPF application that needs to access information from a database (I am currently using Entity Framework code first, so data access is via DbContext).
My ViewModels directly instantiate my DbContext derived class and query this to obtain the information they require. I understand that this is bad for the... |
I coded this because it seemed like a fun project, would be awesome if someone reviewed this.
Thanks!
#! /bin/sh
#function that checks if dependencies are installed
check_software() {
#check if md5sum is installed
if [ $(command -v md5sum) > /dev/null 2>&1 ]; then
echo 'md5sum'
#check if md5 is ... |
I have made this class that runs a query. I want to optimize my code and want to have some expert advice.
Here is the class:
class testClass extends Model
{
protected $_var1;
protected $_var2;
protected $_var3;
public function __construct($var1,$var2, $var3)
{
$this->_var1= $this->$var1;
... |
Please review my database design:
I think it is quite self-explanatory, but to be absolutely clear:
My goal is to make an application which has a super flexible user management (which is why the groups are in tree-form and the groups and users have a habtm relationship) and a super modular way to build pages (which is... |
Was the best way to implent this? For example it will only say "It's nice I know." If you first ask "hat" and then answer "yes".
This is how I'm thinking:
Topic = 0
local messages = {
{"name", "I'm Bob, the owner of this little shop."},
{"job", "I sell stuff."},
{"hat|head", "You like my hat?", Topic = 1},... |
I'm trying to get some feedback on my code for the lexicon exercise (#48) in Learn Python the Hard Way. I have only recently started learning Python and want to make sure I have my fundamentals down before progressing. I have some experience coding (only with kdb+/q in my work environment) but none in Python, so all ad... |
I changed some methods used previously, and I am wondering if I need to do the multiple for loops over and over again. How do I convert my arrays to lists to use in nested for loops?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
... |
I have the following control structure that I would like to improve:
if(number >= 100) then doSetInc(id, 8, 20)
elseif(number >= 91) then doSetInc(id, 8, 30)
elseif(number >= 81) then doSetInc(id, 8, 50)
elseif(number >= 7) then doSetInc(id, 8, 70)
elseif(number >= 1) then doSetInc(id, 8, 100)
end
|
Below is some code that I've been working to simplify, however I feel there is more that can be done. Please note that I did clean up the articles.search method.
class HomeController < ApplicationController
@@articles_per_page = 6
def index
@paged_articles = articles.search(:user_id=> @@user_id, :page=... |
Following is the code that I'm currently using to validate the user given IP address (IPV4 and IPV6). It makes use of apache commons-validator's InetAddressValidator. However, their function validates only IPV4 address and not IPV6.
public static boolean isValidInetAddress(final String address){
boolean isVali... |
I have the following SQL query I am trying to use (save/make easy future modifications to) that is essentially the same query over and over and over, UNIONed each time, with only minor changes to the WHERE clause.
I am more familiar with MS Access, which allows me to use an IIf statement in the SELECT clause to accomp... |
I have a program that displays colorful shapes to the user. It is designed so that it is easy to add new shapes, and add new kinds of views.
Currently, I have only two shapes, and a single text-based view. In the near future, I'm going to implement a Triangle shape and a BezierCurve shape.
I'm also going to implement ... |
I'm thinking about the usage of percent, example, in margins.
We can use overlay to separate our layout by DPI sizes, but why can't we use percentage?
Something like that:
Display display = getWindowManager().getDefaultDisplay();
float width = display.getWidth();
float height = display.getHeight();
//20% of left marg... |
I have made a custom login form for my site, with the help of PDO (until now I used simple MySQL connection and sanitizing), and it looks like this:
session_name('NEWCOOKIE');
session_start();
require_once "config.php";
$member_username = $_POST['username'];
$member_password = $_POST['password'];
$crypt_pass = c... |
This doesn't seem quite right, but it's the best I could do. Is there a way to do this better? My goal is to use DEBUG when I'm developing by doing a 'cc -DDEBUG' at the prompt.
#ifndef DEBUG
#define ptrValues ptrvaluesRemote
#else
#define ptrValues ptrValuesLocal
#endif
ptrLinks = (struct sLinkDescriptionLayout*) ptr... |
I am building a JSON restful web api in Node.js and so far I only got the main structure, however I am not 100% sure I am doing this correct from scratch, I still have to get used to the fact that Node.js is event driven.
Directory structure:
1. main.js
2. modules
a. router.js
b. config.js
c. routes.js
1. main.j... |
I've got a simple sinatra webapp that pulls data from Pinboard's RSS api, parses the info, and re-displays it. There are 4 tasks I need to perform with the data:
I need to remove all instances of a specific tag from all items (in this case, want)
I need to create a list of all unique tags across all the items returned... |
I am running a scheduled script on my iPhone that logs in to a website, downloads a PDF, adds it to iBooks and uploads it to dropbox. All of this happens only when it has WiFi access.
I want to make it as error proof as possible. So I am open for criticism and tipps since it is my first bash script.
#!/bin/sh
DATE=$(... |
I want to load some CSV columns or contents in my Ajax code. Please help me or improve my code. This will be live API code for me.
Data will be downloaded from Yahoo Finance in CSV format on an interval, and updated into this chart code. The values will be updated and chart will continue to be updated.
<?php $row = 1; ... |
I am interested in the community opinion about the following approach for the synchronization.
Generally it is based on the idea to have a configurable way to apply locking on some logic parts.
Any comments and review is appreciated :) .
lock.properties keeps configuration:
foo=true
bar=false
SynFactory.java produces... |
I have a table with forms in two colors - the first row is one color, the second is the other. Can you please tell me if there is a way to optimize my code (such as with this)?
I have two CSS classes:
tr.content1{
background-color: #EFF4FA;
}
tr.content2{
background-color: #F7FAFD;
}
And the table looks... |
I have 2 tables. One holds only first column of my "data table" rest is stored in another table, that is placed right to first. What I need to do is to get all the data from specific row to pass it to jqplot.
My tables look like this. My code basically works, but I think it can be improved.
$('table#baseTable > tbody ... |
I have been working on a little project to tidy up my log table which has exceeded the shared host provider limits:) So I have done some script that is working except one thing at the end: optimise DB.
This script will run in cron so I hope security should not be issue.
My questions are:
the code is working, however I... |
I have the following redundant-feeling design to convert between enums and strings regarding a class that stores enums. The approach doesn't scale if there are more enums and in any event, less-redundant code is also better.
Questions
If there will be more enums, would it be possible to avoid defining two explicit con... |
I'm working on a custom CMS and I'm primarily a PHP/database guy. This is my first real project using jQuery in any complexity. I've got it all functioning, but needless to say, it's pretty messy and I know jQuery veterans would frown at the code.
What can I do to clean up my jQuery? What bad practices am I employing? ... |
Edit Just did some further reading around the website and have come to the conclusion that this method leads to Leaky Abstraction, sorry for wasting peoples time. Time to head back to the drawing board.
Situation Context
I currently develop on my own, building codeigniter cms type websites for clients that want to mana... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.