I've been working on a simple forum for my site. I'm adding a feature that will mark unread posts + forums since your last visit.
Im essentially storing a date of last access to the forum with each user account. When a user comes back to the site, a query is ran to fetch all the post_id and post_parent_forum values, which are then added...
I have a method which returns a document list consisting of all these attributes:
private String activitySource, activitySystemStatus, regionCode, channel,
creatorUserId, displayOnAccessIndicator, documentLocationCode,
extraDetails, keywordList, lastUserId, summaryText,
textTypeIndicator;
H...
Hi,
I'm receiving an XML via php://input and after using simpleXML to break the elements down into variables and then what I want to do is append an array, or create an array of the variables every 30 seconds or so.
The reason is this script will be getting regular inputs, and rather than doing loads of mySQL updates or inserts, I assu...
Hi,
i found the following solution to add sorting capabilities to jQuery (ref: jQuery sort()). I've altered the solution to sort strings of unknown length. It works nicely, however as you might notice from the function name: it sorts acscending :-).
jQuery.fn.sort = function() {
return this.pushStack( [].sort.apply( this, argumen...
I've got the following JSON:
{
"row": [
{
"sort":3,
"type":"fat",
"widgets":
[
{"values": [3,9] },
{"values": [8,4] }
]
},
{
"sort":2,
"type":"three",
"widgets":
[
{"values": [3,4] },
{"values": [12,7] },
{"values": [12,7] }
]
}
]
}
And this PHP to output it:
foreach ( $value->row as $thero...
Let me provide a little detail to explain what I'm trying to accomplish before I get into the nuts and bolts of the question.
I've got two data sources - one is a SQL Server containing part numbers, descriptions, etc. The other is a CAD system that does not have a database in a traditional sense. What I'm trying to do is read out the ...
I've got a collection of strings, and I need to know the first index where they all differ. I can think of two ways to do this: (the following pseudo code is just off the top of my head and may be heavily bug-laden)
First Way:
var minLength = [go through all strings finding min length];
var set = new set()
for(i=0;i<minlength;i++)
{
...
Simple question here: is there any way to convert from a jagged array to a double pointer?
e.g. Convert a double[][] to double**
This can't be done just by casting unfortunately (as it can in plain old C), unfortunately. Using a fixed statement doesn't seem to resolve the problem either. Is there any (preferably as efficient as possib...
I'm looking for a data structure (or structures) that would allow me keep me an ordered list of integers, no duplicates, with indexes and values in the same range.
I need four main operations to be efficient, in rough order of importance:
taking the value from a given index
finding the index of a given value
inserting a value at a giv...
I am taking a C# class and I need help understanding the following code.
The code has an array which represents responses to a survey, with values 1 thru 10.
The output displays these ratings and the frequency of how many times a value was selected.
The following code is from my book, but I have modified it to just a basic example.
i...
Greetings everyone!
I am trying to write a calendar in PHP. In week view, I want my events to be listed like iCal, where simultaneous events reduces their width to half size.
I have an extremely hard time figuring this one out though, so I hope you can help me. What I want is that if one event is overlapping another, it should set "[sp...
I need a javascript function that can take in a string and an array, and return true if that string is in the array..
function inArray(str, arr){
...
}
caveat: it can't use any javascript frameworks.
...
Edit: I've removed the faster/more efficient from the question title as it was misleading..my intention was not optimisation but understanding arrays. Sorry for the trouble!
int array[10][10], i, j;
for(i=0;i<10;i++)
{
for(j=0;j<10;j++)
std::cin>>array[i][j];
}
Versus
int array[10][10], i, j;
for(i=0;i<10;i++)
{
for...
Hello,
I read the example on "Passing multi-dimensional arrays in C" on this site.
It is a great example using char arrays, and I learned a lot from it. I would like to do the same thing by creating a function to handle a dynamically allocated one-dimensional integer array, and after that, create another function for handling a multi-...
I need to look up a value in a "table" where a table can be an array or whatever really.
On paper it looks like this (reduced and generalized):
Size 500 750 1000 1250 1500 (speed)
--------------------------------------------
6x5 0.1 0.5 0.55 0.58 0.8
6x4 0.01 0.1 0.4 0.5 0.9
8x5 ...
If I have a javascript object/assoc. array defined like this:
function somefunction(options) {
var defaults = {
prop1: 'foo',
prop2: 'bar'
};
//Do stuff here
}
and I want to use this as the default values for the function. So when the function gets called I want to populate the options variable with the...
I stumbled upon this odd result when I was messing around with C arrays:
char s[100] = "hello";
if(s == &s[0]) printf("true. ");
if(s == &s) printf("true.");
// output: true. true.
I know that s holds the memory location of the first element, but is there a way to find the address of s (the address of the pointer that points to the fi...
How do I catch wrong array reference in C++? Why doesn't the following code work:
#include <exception>
int * problemNum = new int;
int (* p [100])() = {problem1, problem2, problem3};
...
try {
cout << (*p[*problemNum-1])();
}
catch (exception){
cout << "No such problem";
}
My compiler...
My requirement is -using XSLT- to show a dropdown list with the US states and print 'selected' on one specific that is declared in the XML which will use my style sheet.
I was thinking on declare an array with the states and iterate it but I don't know how to do it.
NOTE: More ideas are welcome ;)
...
Hi,
This is my first post and I am fairly new to jQuery but I was hoping to get some help on creating objects and arrays using jQuery.
What I'm basically after is a way of creating an abject that will store the following information, i.e.:
[index, name] such as [0,"NameA"][1,"NameB"] etc.
Unsure how to create an object/array to store...