I see your Json structure is pretty complex. Consider adding breakpoints to your code in the JS debugger on your browser and accessing the properties from every nested loop's scope. Then, replicate the calls in your code. Wash, rinse, repeat.

Hope that helps!

I'm back and I brought a bag of Doritos

For starters, the structure in your json object seems odd. Let me re-format it, so that we can give it a closer look:

[{
    dateTime: "2018-12-04T10:30:45:222z"
    comments:""
    drivers: [
        {
            fname: 'John',
            lname: 'Doe',
            driverCode: 'DOEJ'
        },
        {
            fname: 'Mary',
            lname: 'Smith',
            driverCode: 'SMIMA'
        }
    ]
},]

That's better.

Now, the for sintax is invalid in both cases. The for syntax allows for three semi-colon separated rules, whereas you have four. You separated the declaration and initialization of the index variables. The correct syntax is for (var i = 0; i < json.length; i++).

Additionally, you can iterate the array using a for..in. So instead of for(var i = 0; i < json.length; i++) you can iterate the array like so:

for(var i in jsonArray){
    var objectInstance = jsonArray[i];
    for(var j in objectInstance.drivers) {
        var driver = objectInstance.drivers[j];
        ...
    }
}

Also, by instancing a variable with the specific index of the json object you're calling (var driver = objectInstance.drivers[j] in this example), you save yourself from bidimensional array hell, avoiding using i and j as much as possible.

Hope this helps!

jkon commented: great answer and +1 for specifying the reason for editing this ( I never do it but I should ) +9

Hello guys,

I wanted to share the following free online course for those interested in sharpening their design skills and learn to see the world with more imagination.

Also, There's this other course about storytelling, for the geek writers around here.

Enjoy!

how would i check if the page is cached, though? As in: if(!cache) preloader()

I'm building a website that requires some image preloading, which is handled smoothly with an overlaid splash screen and a progress bar and a spinner.

The thing is, I want the preloader to know if preloading is necessary (the cache has been wiped, or is disabled in the browser), so that it preloads the images whenever needed. My first approach was using cookies, so that the preloader would be shown only the first time, but refreshing without cache after loading the page rendered my first attempt futile. Then I thought about session variables, but I need to be able to set them via javascript (or AJAX) since the preloader is shown via php (to avoid loading it when it's not necessary).

TL;DR: How can I make my website check if the browser is loading from scratch or if it's loading from a cached version?

Here's the link to my website, so you get a clear idea (works better with Chrome and FF).

Google may be a better place to look for that information

Does your site work with a database? PHP? Perhaps some files you left out of the backup? What is it exactly that your website is failing at?

Days ago, since I started to work on a Mac (Not by choice, not the topic), I found out pressing (Alt + S) to enter a comment doesn't work. Instead, I just recently found out pressing (Ctrl + Alt + S) works instead.

Could it be possible to detect the OS and specify the different key combination?

At first I thought I might have, since I've been testing some things on responsive design, but then I checked and no, I'm on 100% zoom. Don't know what might be, but playing around I found out it was an offset around 20px.

Anyway, yeah... Quotes make absolutely no sense in a new thread :P (Unless they're from another site, in which case chances are you're not a newcomer)

In chrome in mac, the last ┬ĚList element falls beside the text box, which makes it look more "cluttery" 3135564bf20ad673aadba22dd20678a2

Rather than defaulting to the community center, I think it would be better to alert the user that choosing a forum is required to post a new article.

Here's some tutorials i found through a quick Google search, or if you're feeling more extreme, you could try one of these

There's a way to prevent automatic photo uploads by Dropbox, right there in the settings.

my internet is slow at the moment... still downloading the installer

I had already heard about this service, though I didn't know that they had already laucnhed the Windows and Mac clients.

I have 50Gb on Dropbox (thanks to my Samsung purchase). Still, there's never "too much" cloud storage space. Here's my referral link.

You should try implementing a triple nested loop: one that calls for the C and Y values, one for the X values and one for the D values, in that order of nesting.

Until you show us the code you tried, can we help you with some code. Do your own homework.

I think the former tumblr approach might be a better solution: Showing a suggestion box with the most popular tags, and after the user hits spacebar turning it into a box with the word showing in it.

Somewhat like it is now, except now it doesn't put it into a box, but attach a '#' before the word (or words, since it works with commas)
d23069ecb30d027d9f19ea22f91cd744

Clicking on the tags will delete them, and this is hinted by adding a stroke to the tag on hover. Perhaps it might be more intuitive to put a small 'x' on the corner.

It is possible. You must first create an instance of the form you are trying to access, and then call the object in the form:

Form3 form3 = new Form3()
form3.richTextBoxInstance.Text = "new Text"; //richTextBoxInstance should be the name of the object

Remember you must call the richTextBox through its name in the form, not by object type.

Sure! It can happen to anyone :P

An exception? Or a warning?

Also, I suggest you put the else return value outside of the loop. If you're trying to check wether a string is inside an array, putting the second return into the else statement will quit your loop right after the validation didn't get the searched value in the first try (given that it is not on the first position in the array). This may also solve your "unreachable code detected" warning.

public static int search(string Registration)
    {
        // this method will search for registration, if found it will return the index value , else it will return max value + 1          
        for (int x = 0; x < numOfRowsCars; x++)
        {
            reg = ds1.Tables["tblCars"].Rows[x][2].ToString();
            MessageBox.Show(reg);
            if (Registration == reg)
            {
                // Then return the index of the registration number 
                return x;
            }//move else to end of row
        }
        // Then return the max index + 1
        return numOfRowsCars;
    }

Does it suit your needs? Is it working?

Lately I have seen several threads that people have "tagged" as intended. Why is tagged in quotes? Because instead of putting keywords into the tags box, users are describing the question they're asking in the thread, and thus creating tags that look this way:

Time zone
how to find frame a standardize date time common for various zone?

I cant create code login
3 users using the login page

How to cancel an add operation
cancel add operation and display last record from recordset

So, here's my suggestion: Make it so that when the user types a new tag, after hitting spacebar triggers an event that turns the last word into a 'tag' element/box/whatever. That way, there's a more clear idea that what you're inputting into the textbox are tags, and is not meant for a sentence or a description.

I change it to x=x+y and x=x+1 the way it is suppose to be expressed.

If it is "the way it is supposed to be expressed", are you implying that the guys who invented the programming language were wrong by adding these expressions?

And as of today, I have never introduced a bug because of it.

Then, luckily for you, you haven't found a complex enough program.

My reason is good, if not the best: Programmers should code the easiest way possible for them to understand their code.

If you think for writing x++ instead of x+1 make a programmer understand his code a lot easier, then sadly we are still stuck in that 50s-60s (I think that was the time Fortran was introduced) programming mentality where code should be as simple as possible and for the machine to understand it, not us.

It is not about making code simple FOR the machine... As long as your syntax is correct, compilers don't give a rat's behind about how your code is laid out. You might as well be making your arithmetic expressions longer and more ridiculous and the machine will give you the same result you're expecting, since it doesn't care about rules, standards or optimal code; as long as you have your syntax right.

for(i=0; i<employeeArray.length; i++){
    employeeArray[i].privilegeString += companyPrivileges.employeesByLevel(employeeArray.level++).getPrivileges();
}

This is just some random code I though about now, maybe not as "complex" as I intended it to be. It doesn't even make much sense... But which ...

You shouldn't hate it. Instead, get used to it since lots of languages allow it and the majority of programmers prefer it that way. In a way it optimizes your code (albeit for a few bytes), since variable names are not always one character long, and it makes it easier to keep track of what is going on when the operation is longer than a simple n + 1.

While I'm at that, I'd recommend to get used to seeing the n++and n-- syntax, which are used very often as well.

PHP doesn't know the date and time of the client machine, since it is run on server. Use javascript to get the client's datetime and push it into the database through an AJAX call

Here, have a little search

My avatar is my actual reaction when evidently all that OP did was copy/pasting the text from his homework excercise, down to Figure 1-1 and Figure 1-2

Op, at least try to do your homework first and then you come to us when you hit a roadblock

oh, you mean the size changing on hover? Maybe just change the color of the text and a text-shadow... Also, the last lines of your code are unnecessary: you're giving the same properties to every nth-child, so a simple ul.main_menu li a:hover at line 32 and removing lines 36+ should do

What exactly d you want to do? "Fluid" layouts are supposed to adapt to window size, which your navbar does.