David Spades

Ranch Hand
+ Follow
since Feb 01, 2014
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by David Spades

never mind, posted to the wrong endpoint apparently. powers that be, feel free to delete this thread, you can save some memory on server, but the real reason is so that I can save my dignity.

Bear Bibeault wrote:Perhaps you should show us that code.

which code? you mean the "need to do something here?" part?
that's the problem, I completely have no idea what to do, and success is currently blank.

Paul Clapham wrote:Do you mean that the Ajax response includes a cookie which is supposed to be noticed by the browser?

Hi all,

I'm building a simple web application that sends cookie and json payload. I'm currently struggling with the front end. in the front end, I'm using jquery's $.ajax to communicate with server, but the cookie just doesnt seem to get picked up by browser (Windows 7, latest chrome 47.xxx). Following is the code:

Is there something I need to do inside "success" callback?

I'm typing a method from an interface from jar and during autocomplete, I got

I was sure that the signature was

what can I do so that during autocomplete I can get the human-readable param name? I'm using eclipse mars with java 1.7

8 years ago

First, perhaps it's better to explain the problem background
I'm tracking 100K+ items sold on various store chains globally. each has item name, store chain name, manufacturer, sales country and date dimension. There are 4 facts that I record --> sales volume, manufactured volume, defect volume and returned volume. Sample of report I want to generate:
* top n items with highest average daily sales volume increase during the whole 2014

I'm trying to do aggregate operations on several millions facts vs decades of time. I just recently stumbled upon columnar DBMS. My question :

1. Are OLAP cubes and columnar DBs partners or competitors in DW?
2. If they're competitors, which is better? there will be no optional columns (sparseness) in my transactional data.

8 years ago
still doing some research, but most likely hmac sha256. also, is it safe to have one secret key per application as opposed to 1 secret key per user? and how often should I change the secret key? or can I use the same secret key forever? thanks
8 years ago
Hi all,

I'm trying to create a secret key string for my mac. I have 2 questions:
1. will there be a problem if I include chinese, japanese, cyrillic characters in the secret key string?
2. what's the best length for the secret key?

8 years ago
damn, you're right. 4.08 - 9.05 --> that's 5 hour difference, not 5 minutes. sorry about that.
signs of brain overload, time for some relaxation and it's friday, tequila time.
thanks for the suggestions.
8 years ago
what do you mean?
4.08 am mean 8 past 4 in the morning. I dont include the seconds in the time. most people dont include seconds when referring to any specific point of time, meeting at 8.15 sharp or the show at 9.30. but okay, fair point, since this is programming forum and most application deals with time down to seconds part.
8 years ago
max 5 requests in any 5-minute window

there are 6 requests between 4.08am to 9.05 am (less than 5 minutes)
8 years ago
your approach wont work for this case

max 5 requests in any 5-minute window
4.03 am
4.08 am
6.10 am
8.02 am
9.02 am
9.03 am
9.05 am --> violated
8 years ago
ok, so what I'm trying to do is "guard" a certain method with a certain access frequency.
lets say I want the method not be accessed more than 60 times within any 5-minute window. so everytime the method is accessed:
1. it will first get "now" timestamp
2. check if the timestamp diff of first access token in queue and "now" is MORE than 5 mins
3. if #2 condition is met, pop first access token, create new access token and push said access token
4. if #3 condition is not met, then sleep

8 years ago
I see. so for my operations:
1. add element always at the end
2. remove element always at the beginning
3. no iteration, no random access and no synchronization

LinkedList is best options in java 8, yes?
just want to make sure with those already using this impl if there's a better way or if linkedlist has undesirable side effects.
8 years ago
Hi all,

I want to know what's the best impl for queue (FIFO) in java 8. These are the only operations I'm gonna do to the collection:
1. add element (always at the tail)
2. remove element (always at the head)
no random access, no iteration, no synchronization needed, and it will have a fixed max size.

I saw that many people say linkedlist must be avoided (memory issue, etc), but arraylist is inferior in speed for the 2 operations I need compared to linkedlist.

8 years ago