instruction stringlengths 71 39k |
|---|
I am curious to know if there is a faster, better, and more efficient way to accomplish this program that acquires employee information:
<?php
session_start();
//require 'functions.php';
//require 'DB.php';
$employeeID = $_SESSION['employeeID'];
$clockIn = $_GET['clockIn'];
$clockOut = $_GET['clockOut'];
$timeToday... |
I'm particularly concerned about where I have declared the functions, can I move them around to clean up the code without breaking anything? The "conjugate" function contains a lot of stuff that has nothing to do with actually conjugating verbs and rather handles output strings and html DOM objects. I really want to mi... |
I want to remove my goto's in this code but I'm not sure how. There must be a cleaner way to write my code. Perhaps move the "if" statement to the end of each loop then use break?
Sorry if this is a stupid question, I'm self-taught, and I'm finishing up my first sizable program. Any suggestions as to how I can clean my... |
I've discovered that using hashed passwords with salts is a much better idea than MD5/SHA256, so I'm not hashing them with PBKDF2. However, I'm wondering if this is a correct approach to authorizing my user. I also have logic for logging authorizations. When the same IP has entered an incorrect login/pass, it becomes b... |
I have following code for doing custom paging from an asp.net web application.
Points of interest
It uses Link Buttons as suggested in
https://stackoverflow.com/questions/14335067/passing-search-parameters-to-same-page-when-hyperlink-clicked
The link buttons are added in Page_Load itself as listed in
https://stackov... |
On an IRC channel I'm a member of, one particular person mocks every piece of code I post, even if it's a rough draft or if I haven't coded in months. I am pretty well versed with computer theory and knowledge, but my skills with programming lack due to little practice.
This particular code was from a project I was s... |
I am trying to create a randomly generated array of x numbers with no duplicates. I am choosing numbers, one at a time, then comparing each new number to the numbers already in the array.
Here is my code. At the end I should have an array of seven numbers, none that match, but sometimes I get a nil:
array = [] #DEFINE... |
I'm very new both to programming and to R so please bear with me :-)
I've written the following bit of code, which works perfectly well and runs through a data file with 17446 rows in about 35 seconds. I don't really have a problem with this but am sure that this could be a lot more elegant with probably the use of the... |
I am building a web service that gets data via Stored Procedures from a db and provides the result as JSON. The solution is built as a MVC 4 Web API project. I have to retrieve the data via Stored Procedures for several reasons (security, SQLAnywhere db, etc).
It is a relatively small scale project so I have opted for ... |
I was wondering if there was a way to rewrite this to be a bit more clean. It seems a bit odd to have a mouseenter and a mouseleave for this. Surely there's a toggle of some kind?
$(document).ready(function() {
// Post header animation
$('h1.post').mouseenter(function() {
$(this).animate({ paddingLeft: 10 }, 300);... |
I have created some code in Java that slices up an image into rows and columns and then saves each image to the file system. This works but there are some improvements I would like to make
I would like it to automatically know the original file name and extension using the StringTokenizer class so I do not have to hard... |
For a quiz web app, I decided the best way to store quiz questions, answers, and other user data related to the question was to use an array of objects for the quiz. I'm not sure if this is the best way to go about it since static information such as the questions and answers will be mixed with user data.
Each object i... |
I define in the Settings Tab of a VB.Net class library some user scoped settings. I want to expose these settings to other projects that reference the class library. I chose to do this using a public Module. This works, but it requires exposing each and every setting manually. Is there a better way?
Public Module Setti... |
I have developed a new router after having learnt a lot from my previous attempts and I will be using this in sites I make from now on.
In a previous question, the issue of REQUEST_URI being too inflexible made me wonder if I could make adjustments to allow it to route $_POST and $_GET requests too?
Please let me know ... |
I recently created an extension which detects the type of credit card based on the numbers entered in and formats it. I am using Luhn Algorithm for validating credit card numbers and I am using jQuery masking for formatting the credit card numbers (for reference: jquery.maskedinput-1.3.min).
You can play with the demo ... |
I have moved all my web-server code dealing with user management into a single Node.js module that I pasted below. I have spent time polishing it, and churned it through JSHint. I am generally happy with the code, except for the error handling. I find it clunky at best.
How can I improve error handling in the following... |
I'm tasked with getting emails from a .csv file and using them to submit a form. I am using the csv and mechanize Python libraries to achieve this.
import re
import mechanize
import csv
def auto_email(email):
br = mechanize.Browser()
br.open("URL")
br.select_form(name="vote_session")
br['email_add'] =... |
Below are some of the classes I have written for a small space invaders game. It's not finished but it's at the bare bones stage. I am still learning how to properly use the Slick2D library. I know where there are some problems but that is due to my lack of full knowledge of how Slick2D works, so I had to think of a wo... |
User specification
"var_dump($GLOBALS) is ugly as ... without wamp"
General specification
Produce a PHP function to display the contents of $GLOABLS in a user-friendly manner
Must produce properly indented HTML
Must include appropriate CSS classes for customisability
So far, this is what I've got:
function __printR... |
I have written a function to handle post data received from a web page. The Emphasis is on making getting post data easy: using the function allows the coder to specify the required data, type, and default value all in one line.
I'm using django and it provides a nice dict of post data. this will be passed to the funct... |
I have the following method that will take the car parts I searched for and match them to my car object in array. Then it tells me the percent match.
Example:
Car.h has NSSet toCarParts. toCarParts has may car parts.
My array contains 5,000 or so matches.
I will go through each one and match my parts to the car parts a... |
I am working on projecteuler # 14, http://projecteuler.net/problem=14 and my code takes too long to run. Any tips, or hints for a beginner?
Code:
////////////////////////
/// ProjectEuler # 14///
////////////////////////
#include <iostream>
#include <tuple> //New, shaky on tuple
using namespace std;
bool t... |
I wrote a solution to the Knapsack problem in Python, using a bottom-up dynamic programming algorithm. It correctly computes the optimal value, given a list of items with values and weights, and a maximum allowed weight.
Any critique on code style, comment style, readability, and best-practice would be greatly apprecia... |
My script finds all factors of an integer. First it finds all prime integers using trial division then it uses the prime factors to find all other factors of the integer.
I would like to know how I can improve and simplify it. I think the code that prevents duplicate factors such as 4 x 5 and 5 x 4 probably could be i... |
I have a program that calculates some values and saves them to an array. Before save a value, program checks if there is already an identical value in array:
string someData = GetData();
bool newItem = true;
int arrayDataLength = arrayData.Length;
for (int x = 0; x < arrayDataLength; x++)
{
if (arrayData[x] =... |
I have to display some set of:
Data in serpentine order. In an experiment there are replication, range, and plot.
Replications contains range a plot. A range contains a plot.
If there are 2 replication, 4 ranges, and 8 plots, then each replication contains 2 ranges. Each range has 2 plot, so data to displayed in serpe... |
I have created a drop-down to populate a list of cities. Everything works fine, but I would like to know better ways of doing this. Also, please let me know if it is possible to create the same drop down using <Select> instead of HTML helpers.
//ViewModel
public class LocationDTO
{
public IEnumerable<CityDTO> Citi... |
I am trying to create a class to queue up a series of commands. (Not really a queue as events happen based on time). Each command has a callback (Action) that get's called. However, each Action has a different set of parameters (signature), so I am using an object[] to pass them and then have to do lots of casting.
Exa... |
In order to create loose coupling architecture on my web applications, I have created my own implementation for ORM, in this case, NHibernate.
I want you please to review the code and tell me if you think it can work in a real world on high traffic app.
I have divided the API to transaction and session. There are some... |
I have this code in a class that gets a string, parses it, and makes some adjustments to get a valid datetime format from the string.
An input string for this function could be = "A0X031716506774"
import datetime
def _eventdatetime(self, string):
base_date = datetime.datetime.strptime("1980-1-6 0:0", "%Y-%m-%d %H:%... |
We have a rule that all of our validation messages must be in a summary, and thus the default "this field is required" doesn't cut it because the messages lose their context in a summary and therefore need specific field indicators.
I have a solution that I like rather well, but it soon became clear that there was a ne... |
I've inherited a class which has a bunch of properties defined as:
public int ID
{
get { return m_nOID; }
set { m_nOID = value; }
}
public int ConxnDetail
{
get { LoadDetails(); return m_nConxnDetail; }
set { m_nConxnDetail = value; }
}
public bool ConxnConstraints
{
get { LoadDetails(); return m_... |
I have a model section with a column parent_id - the only thing identifying a parent/child relationship. I wrote a helper method to output all sections, all their possible subsections and include their "depth".
This is the helper method:
# Calls itself for each section recursively to fetch all possible children
def fet... |
I'm trying to work with forms, and just getting a grasp on JavaScript. Basically I'm unsure if there is a more reusable way to handle forms with Meteor/jQuery.
// Creating a new prayer, including the preview
Template.newPrayer.events({
'click input.save' : function() {
var title = $("#prayer_tit... |
I have a model class that contains 3 ArrayList which are in order by parallel of the same size. <Object><Calendar><Long> I want to sort it by the <Long> Is this the most clean? is there a better way? This doesn't seem memory efficient.
public class ResultModel{
private ArrayList<Object> sets = new ArrayList... |
This code allows calling a method while redirecting the IO to strings. This is useful for unit testing where you have to direct something to the console or examine output that comes from it. I assume these have been written a lot, but I couldn't find examples.
I'd like advice on how to make them generally useful and ... |
I'm a beginner Python coder and this is the first program that I have ever programmed.
Please suggest improvements/bugs. Here's the link to the code.
global hp
hp = 20
global dice
import random
dice = random.randint(3,5)
global beardamage
import random
beardamage = random.randint(1,9)
global hunger
hunger = 5
global s... |
I found an example of how to implement Rijndael.
This class uses a symmetric key algorithm (Rijndael/AES) to encrypt and decrypt data. As long as encryption and decryption routines use the same parameters to generate the keys, the keys are guaranteed to be the same. The class uses static functions with duplicate code t... |
Oftentimes people will shorten System.out to just out and make an analog called in (e.g. Scanner in = new Scanner(System.in);). I've seen two methods of doing this
Method 1:
import static java.lang.System.out;
Method 2:
static final PrintStream out = System.out;
Is there a coding convention or best practices for this? ... |
I am designing a class to store primitive types into byte buffer using predefined byte order. I am not going to use Boost.Serialization because I am working with plain types only and I need predefined binary structure without versions and things like that.
Here is draft of the design:
#ifndef SERIALIZER_H_
#define SERI... |
I have this code in LogInService
public User isValid(User user) {
if(user == null)
return user;
User db_user = userDao.getUserByUsername(user.getUsername());
if (db_user != null) {
try {
if (PasswordHash.validatePassword(user.getPassword(),db_user.getPass... |
I'm building a small web application and it's starting to get a bit complex. I have reached to a point where I have to run some tests and load some libraries.
I made it so I can use it in this way:
this.loadDependencies([
{
test : tests.JSON,
polyfill : self.polyfills.json
},
{
test ... |
Cyclic Words
Problem Statement
We can think of a cyclic word as a word written in a circle. To
represent a cyclic word, we choose an arbitrary starting position and
read the characters in clockwise order. So, "picture" and "turepic"
are representations for the same cyclic word.
You are given a String[] words, ea... |
I'm trying to improve some code in order to get a better perfomance, I have to do a lot of pattern matching for little tags on medium large strings, for example:
import re
STR = "0001x10x11716506872xdc23654&xd01371600031832xx10xID=000110011001010\n"
def getID(string):
result = re.search('.*ID=(\d+)', string)
i... |
I'm just beginning my foray into iOS development and need a code review. I have a custom NSManagedObject that needs some smart setters. I'm new to Objective-C, iOS, and core-data development, so I don't trust myself yet. I come from a Java background, so smart setters are what I know, but might not be best when usin... |
I have the following code:
Integer cr = 3;
String y = "\"\r\n\"";
for (Integer i = 0; i < cr; i++)
{
for (Integer j = 0; j < cr; j++)
{
for (Integer k = 0; k < cr; k++)
{
for (Integer l = 0; l < cr; l++)
{
for (... |
I posted a question few weeks back, on making a PHP Login Script. Most of you guys told me not to use global variables and especially for something like MySQLi connection object as it may be insecure. I was also advised to switch to classes. I did so. And here is my code -
class Page {
private $unauthorized_source=0;
... |
I don't want to extend the functionality of this method to include say library objects. I'm just looking for feedback on what it currently does.
ES5, section 8.6.2 "exposes" these global objects. I added a few Browser or "Host" objects which I needed for my purposes.
If needed I can add some more Browser or Host obje... |
I have the below code:
public interface IRepositoryService
{
/// <summary>
/// This will add conditions like Published = true, Deleted = false and PublisehdDate smaller than NOW
///
/// </summary>
IRavenQueryable<T> AddConditionsToQueryToLoadOnlyAvailableForFrontend<T>(IRavenQueryable<T> query) whe... |
I know the code is full of useless data and stylistic and analysis errors and I'd really love and appreciate to have a pro's idea about it so I can learn to code (and think) better.
import os, time
from ConfigParser import SafeConfigParser
configfilename = "imhome.ini"
scriptpath = os.path.abspath(os.path.dirname(__fil... |
I am currently programming, but I messed up my code. What is the best way to clean this?
buttonUitvoeren_Click_1:
private void buttonUitvoeren_Click_1(object sender, EventArgs e)
{
buttonNoodstop.Enabled = true;
buttonPauze.Enabled = true;
buttonUitvoeren.Enabled = false;
// Orderlijst uitvoeren en me... |
just I wan to ask how to improve my code especially contact info block
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Compudata_ProjectManager.CodeFile.BOL;
using System.Web.Security;
namespace Compudata_ProjectManager
... |
So I would be very grateful if you could check these four tasks - I'm a Java newbie and recently coded such things on a Introduction to CS test which I didn't score so well at and would love to know where my mistakes were, what I should do some other way and how can I get better at it to score higher again :)
1> Write... |
I'm building an authentication system using a combination of PHP, MySQL, jQuery, and AJAX. The way I'm doing it right now is I have a form that takes in a username and password. When the user clicks on the login button I pass the value of those two values along with an action to a controller file. That controller file ... |
I use this simple time method to time intervals. It basically just consolidates some simple math.
/*time
** dependencies - none
** browser - unknown
**
*/
NS.time = (function () {
var measurements = [];
return function (control) {
var index,
intervals = [],
time_current = new ... |
Just curious if this is a reasonable idea. I wouldn't do it all the time. The example I'm in now is that of the data context and repository that uses it.
I kind of like this because, compared to calling new in AssignButtonClicked, it gives my code the same quality of feeling independent of resource allocation as when... |
I've created this scheme to preserve function calls until all the arguments are available. The stub_op classes will be replaced with classes that implement a forward-like mechanism that receives notifications when a forward is finished.
I wanted to have a way to set up a function call that turned into a forward that wa... |
I'm writing a simple disassembler in C for learning. It is supposed to take a ELF file read in the contents of the ELF header then the individual program headers (potentially multiple) and print out various information on the file and then print each ARM code out.
main.c
#include <stdio.h>
#include <string.h>
#include ... |
While I'm aware that code with callbacks tends to be complex, I'm wondering if there are any patterns or something to improve my situation.
All I do here is check if a file exists and then print its name if it's not a directory:
var fs = require('fs'),
filename = process.args[2];
fs.exists(filename, function(exist... |
I know that is generally expected that you should not swallow exceptions. In this code, an Infragistic's UltraWinGrid is being configured. Is there a better way to handle the failed catches? Is this an exception to the rule?
private void HideExcludedColumns(UltraGridBase grid)
{
if (_scExclusions == null) return;
... |
How could this code become cleaner? I think that the way I handle the interfaces and binary search could be improved. I am trying to understand how to structure such a code (and usage of APIs) in a cleaner and more efficient manner.
This code solves the problem of finding the max subset of non-overlapping interva... |
Thanks for taking the time to read this first off. I want to say that I have always been very interested in generating random terrain and since I'm new to any sort of graphical programming, I decided to start as simple as I could get.
I am trying to implement the midpoint displacement algorithm to make fractal type mou... |
I'm currently writing a class:
final class MyTestClass {
const URL = 'http://www.example.org';
private static $MY_ARRAY = array('...');
// since this is not allowed
// const MY_ARRAY = array('...');
}
So my question is whether I should make URL a private static variable, too?
These values are constant and are... |
I have a few custom exception classes that I created simply for the sake of having my own exception message:
public class DivideByZeroException extends Exception
{
@Override
public String toString()
{
return "ERROR: Expression cannot divide by 0";
}
}
I realize that this can be done by throwing ... |
I wrote the following in Javascript and jQuery, and I'm wondering if there are any ways to improve the code, organize it better, and increase speed:
function calendar(d) {
$("#calendar").remove();
$("#calendar_container").append("<table border='1' id='calendar'></table>");
t = new Date(d); // Today [Wed Jan... |
I'm trying to solve this problem. After a couple of tries, this is what I pulled off:
#include<stdio.h>
#define primeLimit 100000
int prime (long int Start2, long int Stop2 )
{
long int a[primeLimit+1];
long int i,j,k,l;
for (i=Start2;i<=Stop2;i++)
{
a[i-Sta... |
I have the following code below I was wondering if there is a way to clean it up/improve it especially near the if statements. I am new to programming and this is what I came up with and its working fine I just think there might be a better way to accomplish it.
<?php
require 'DB.php';
try {
$stmt = $conn->... |
I've made a small breakout game, so far with one level. My plan is to expand it so that it has a level editor, but for now I wanted to make sure that everything is currently looking well-designed. I don't use js a lot so I'm not always very sure where to put things.
Just a heads up, the collision doesn't work entirel... |
My son (9) is learning Python and wrote this temperature conversion program. He can see that there is a lot of repetition in it and would like to get feedback on ways to make it shorter.
def get_temperature():
print "What is your temperature?"
while True:
temperature = raw_input()
try:
... |
I'm coding a Minesweeper clone using Java and Swing. For my current knowledge, I manage to keep it working but two things are giving me nightmares. Namely, I have a VERY repetitive code so I suppose there should be a way to write it once only and use twice but I don't know how to do it as the things it does when the co... |
It is a little thing about UIViewController, but it has always bothered me - the boilerplate code needed to setup some of a view controller's default properties (e.g. the tab bar item and navigation item) and the location of this code.
Apple's documentation says the following:
tabBarItem
The tab bar item that represen... |
I've recently picked up the Head First Design Patterns book in an effort to become a more efficient and better Python programmer. Unfortunately, the code examples in this book are in Java.
I'm not the first one that wishes there was a Python version of this book, but I thought that writing the Python code would be a g... |
I am trying to improve my C skills, and I hope someone might be able to provide me with some feedback on the following code. I avoid strtok function intentionally.
#define MAX_SIZE 1000
int split_up(char* string, char* argv[])
{
char* p = string;
int argc = 0;
while(*p != '\0')
{
while(isspace(... |
I've been working on my first Angular JS app for the past few days.
It's in a very early stage (no real functionality), but that will only make it easier to review what IS there.
The client side is written in CoffeeScript. The app used Requirejs to manage files AMD style (it loads compiled CoffeeScript).
The server si... |
I was writing my own implementation of BlockingQueue for practice. I am trying to avoid using the synchronized keyword for the methods. I would instead like to use ReentrantLock.
What is the best way to write this implementation? I am not a Java ninja and would greatly appreciate if someone could pinpoint the errors in... |
I am basically getting data from various APIs and using PHP to put them together - like a web mashup. I am currently using 4 foreach statements to insert the gathered data into their individual arrays. I believe that the current code is inefficient because it takes probably around 3 seconds to load the page which is di... |
The entity framework will only save properties it detects has changed via its proxy classes. I have a situation where I want a property to always be saved no matter if it changed or not.
I wrote a blank attribute called AlwaysUpdate which I apply to the property. I then overrode SaveChanges to scan for these attribut... |
Here is my simple example: there is a class A with few primitive members and a class B with few primitive members but also a collection of objects of type A.
This is my A class:
#pragma once
#include<string>
class Hero
{
private:
long id;
std::string name;
int level;
static long currentId;
public:
... |
I am using Castle Windsor as my IoC container and I registered it as a DependencyResolver to let the MVC framework know about it.
With the Entity Framework I have this DbContext:
public class MyDbContext : DbContext
{
public DbSet<User> Users { get; set; }
}
In Castle Windsor it is registered as per web request:
... |
I have been doing TDD since I have started my first job out of university (about 5 months ago), most of which is working with legacy code. I started a personal project today and thought I would TDD it. I don't have much "green field" dev experience so I am unsure if this is the correct way of driving interface design. ... |
I have some data that logs kWh. I want to be able to collect the data and produce a bar chart (I'm using the Microsoft ASP.Net Chart control). I have written code that works, but it looks a little clunky to me and I wondered if somebody could point out a method that may be easier to read and/or more efficient.
The data... |
Just a quick preface, I'm not a web developer. I'm simply doing this as a favor for a friend. My goal is to be done with it as quickly as possible, but still not have the coding be horrendous. With that said, as I was coding this, my spidey senses were going off telling me that what I was doing was really bad programmi... |
Here's the situation. I'm writing a simple game and I had two main actors: GameController and GridView.
GridView is a UIView subclass displaying a grid with which the user interacts. It defines its custom delegate protocol (GridViewDelegate) for handling callbacks such as gridView:didSelectTile and others.
GameControl... |
Is there a better way to implement my carousel in less lines?
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<% @photos.each_with_index do |photo, index| %>
<% if index == 0 %>
<div class="item active">
<img src="<%= photo.image_url(:large) %>" alt="<%= photo.title %... |
I use the following code to verify that columns have data and display the appropriate error message.
My code is working but it just doesn't look tidy. Is there any way to refactor all the if statements into a loop to display the error message, possibly another method which checks all? checkIfColumnIsEmpty is a bool met... |
I have this code and I think it is very slow, about 50ms. I need to make it execute faster:
switch (unit)
{
case 0:
if (u == 2)
{
if (u1 == "piece" || u1 == "gram")
result = quantity * y;
else
result = quantity * z;
}
if (u == 1)... |
This is my code:
var test = (from x in myDb.myTable
where (x.name == tmp || x.name == tmp2 || x.name == tmp3) && x.unit == u
select x).FirstOrDefault();
if (test == null)
test = (from x in myDb.myTable
where (x.name == tmp || x.name == tmp2 || x.name == tmp3)
select ... |
I have a much needed rewrite of an inherited application ahead of me and have started to sketch out some possible solutions / build some prototypes for different parts of the application.
I'd like to have some feedback if this is a good approach to provide application events.
Goals:
Loosely coupled
Strictly typed / re... |
I decided to run a few test on js functions on jspref to see which method of using function is better suited for this small particular example, to get a better understanding.
Page with tested functions
Problem:
Getting different results each time, Cold Start, Re-test, Re-Re Test are all coming with different results
Fi... |
Due to a weird server setup on one of my client's websites, I needed to setup a script to load referenced pdf files through a case-insensitive lookup. We originally looked into mod_speling, but it was causing issues with other mod_rewrite declarations. I'm not entirely sure why, but I didn't have much control over tho... |
I've implemented adding and multiplying arbitrary precision integers.
Also available as a gist.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
int *data;
int size;
} bi;
bi *bi_new() {
bi *a = malloc(sizeof(bi));
return a;
}
bi *bi_from_string(char *a) {
bi *b = bi_ne... |
I have the following JavaScript function:
function registerEvents() {
var isTapholding = false;
$(document).delegate('.add-control .add-image', 'tap', function (evt) {
handleAddControlEvent(this);
});
$(document).delegate('.delete-image', 'tap', function (evt) {
evt.stopPropagation();
... |
I'm new to RSpec and testing in general. I've come up with a spec for testing my Content model and I need some feedback because I think there are many improvements that can be done. I don't know if the way I did it is considered over-testing, bloated/wrong code or something. This test is kinda slow but this doesn't bot... |
I feel that my current business view logic is not efficient or very clean. The problem is building the right output, but with less code and more DRY.
I have 3 'static' links, as in, direct tags:
about, contact, search
I also have three navigation menu's.
The first (URI position 1):
category = ['home', 'cat_1', 'cat... |
This is my try at the proxy pattern.
What do you Pythoneers think of my attempt?
class Image:
def __init__( self, filename ):
self._filename = filename
def load_image_from_disk( self ):
print("loading " + self._filename )
def display_image( self ):
print("display " + self._filename)
... |
This is a sample class using Rhino (1.7R4). I need it because in the context of JSON Schema, regexes should be ECMA 262. One requirement is that it is thread safe, and it is.
But I'm not sure I actually use it correctly. Can you comment?
public final class RhinoHelper
{
/**
* JavaScript scriptlet defining func... |
My app communicates with a server over an internal network through HTTPS. The SSL certificate on this server is listed for the host as its external host name. I want to accept this certificate, but I don't want to accept ANY certificate as many workarounds I've seen seem to do. I would also like to have it so that late... |
I'm still learning JavaScript and I'm building an Ajax website that loads in content for each page from external files (e.g. test1.php, test2.php). I spent several hours cobbling together some code that works, but it feels really clunky. Any recommendations on how to streamline it? Or anything I am doing that is stupid... |
What is the most elegant and readable way to in include (potentially long) image_tag calls inside of link_to?
Example
<%= link_to image_tag('buckminsterfullerene.png', width: '210', height: '60', alt: 'Molecular structure of Buckminsterfullerene'), 'some_long_path.html', title: 'Buckminsterfullerene', rel: 'tooltip', r... |
I am new to programming as you can probably tell from the code below I am curious if there is a way to create a loop so I don't have so many copy's of the same code with only different variable names. The way the code works is that for each variable that is represented as a day of the week the value is a string such as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.