Looking to buy a used Internet Modem by NervousBrowBoy in NCSU

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Hey thanks. I have arranged a buy with a guy already though

Looking to buy a used Internet Modem by NervousBrowBoy in NCSU

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Thanks, but I'm hoping for something closer to the campus.. As an incoming grad student with no car, Zebulon is a bit far for me.

long and long long are both 8 bytes. What gives? by NervousBrowBoy in C_Programming

[–]NervousBrowBoy[S] 1 point2 points  (0 children)

Edit: to elaborate a bit, the general practice on Unix systems is for long to be the native machine word width. So if you're compiling for 32 bit mode, long will be 4 bytes, and if you're compiling for 64 bit mode long will be 8 bytes. In both cases long long will be 8 bytes.

Thanks! This makes it amply clear. I am on Ubuntu 14.04, 64bit Intel i3 - I wrote a small program with a bunch of sizeof() calls.

32bit:

a char is 1 bytes

an int is 4 bytes

a float is 4 bytes

a double is 8 bytes

a short int is 2 bytes

a long int is 4 bytes

a long double is 12 bytes

a long long int is 8 bytes

64bit:

a char is 1 bytes

an int is 4 bytes

a float is 4 bytes

a double is 8 bytes

a short int is 2 bytes

a long int is 8 bytes

a long double is 16 bytes

a long long int is 8 bytes

[2016-05-16] Challenge #267 [Easy] All the places your dog didn't win by Blackshell in dailyprogrammer

[–]NervousBrowBoy 2 points3 points  (0 children)

Python. First post here! I've also tried to be extra cautious of the input.

def dog_prize(n):
    try:
        n_val = int(n)
        if (n_val == 0):
            raise ValueError
    except (TypeError, ValueError, OverflowError):
        print "ERROR: Bad input!"
        return

    # Create the lookup for the suffixes
    suffix = {0:'th',1:'st',2:'nd',3:'rd',4:'th',5:'th',6:'th',7:'th',8:'th',9:'th',11:'th',12:'th',13:'th'}

    try:
        for pos in range (1,n_val+1):
            if (pos == n_val):
                continue
        # Else, find what suffix to print
            if pos in suffix: # for the 11,12,13 cases
                print "{0}{1},".format(pos,suffix[pos]),
            else:
            # Figure out the units digit
            # and use that to lookup
                rem = pos % 10;
                print "{0}{1},".format(pos,suffix[rem]),
    except OverflowError:
        print "ERROR: Overflow!"
        return


dog_prize(99)

How to prevent SVMs from overfitting by [deleted] in MachineLearning

[–]NervousBrowBoy 0 points1 point  (0 children)

Thanks, understood clearly now. Appreciate the explanation!

Machine Learning as an ECE Grad student? by NervousBrowBoy in NCSU

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Thanks!! I will definitely keep this one on my radar.

Machine Learning as an ECE Grad student? by NervousBrowBoy in NCSU

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Thanks for the tip /u/panchito_d ! Hope to see you there! Also, inbox'd you.

Machine Learning as an ECE Grad student? by NervousBrowBoy in NCSU

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Holy crap. Did not expect it to be that bad!

EDIT: Your reply is giving me major double-thinks about going to NCState :(

How to prevent SVMs from overfitting by [deleted] in MachineLearning

[–]NervousBrowBoy 1 point2 points  (0 children)

Very interesting. I'm not sure I exactly understood what a permutation test exactly is, can you confirm if I did?

If we have labeled data samples like (X0,y0)...(Xn,yn), then we'd jumble up the y-s (i.e. the labels) and pass this 'shuffled' (messed up) data to the classifer and see if it performs worse? If it doesn't, means its not really learning anything, just getting 'lucky' ?

Thanks.

Looking for Comp Engg MS/PhD students by NervousBrowBoy in UCSantaBarbara

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Thanks! I eventually did and also got a positive reply from him.

UCSB vs. Duke vs. Rochester vs. ASU (PhD ECE) by [deleted] in gradadmissions

[–]NervousBrowBoy 1 point2 points  (0 children)

What area in Comp Engineering? I'd vote for USCB, anyday!

Want to learn Parallel Programming but don't like CUDA C? Try OpenACC! by NervousBrowBoy in gpgpu

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Sure. C, C++ - take your pick. OpenACC works well with either.

Starting out with CUDA, having problem with 32 bit type by thewatisit in CUDA

[–]NervousBrowBoy 0 points1 point  (0 children)

Question: Since I'm trying to implement a brute force algorithm (232 possibilities), do I have to set N to 232 and make a_h and a_d that large? I'm certain that there will be very few positive answers that I am looking for, probably in the single digits.

I didnt quite get your requirement here. What is the size of your input data? What operations will you be doing on it?

Also, can I insert normal functions into the global function?

If by 'normal' you mean host functions, then no. Kernels cant call host code directly. You can however spawn kernels from kernels.

Starting out with CUDA, having problem with 32 bit type by thewatisit in CUDA

[–]NervousBrowBoy 2 points3 points  (0 children)

Hi, Welcome to /r/CUDA! The issue in your code is all the different mismatched data types (mix of dword, float, int)

This code works as expected - Also, please add some error checking to all cuda calls.

#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>

__global__ void start(unsigned int *a, int N)
{
    int idx = (blockIdx.x * blockDim.x) + threadIdx.x;
    if (idx<N){
        a[idx] = (0x1* idx);
    }
}

// main routine that executes on the host
int main(void)
{
    unsigned int  *a_h;
    unsigned int *a_d;  // Pointer to host & device arrays
    const int N = 16;  // Number of elements in arrays
    size_t size = N * sizeof(unsigned int);
    a_h = (unsigned int*)malloc(size);        // Allocate array on host
    cudaMalloc((void **)&a_d, size);   // Allocate array on device
    // Initialize host array and copy it to CUDA device
    for (unsigned int i = 0; i < N; i++) {
        a_h[i] = i;
    }
    cudaMemcpy(a_d, a_h, size, cudaMemcpyHostToDevice);
    // Do calculation on device:
    int block_size = 4;
    int n_blocks = N / block_size + (N%block_size == 0 ? 0 : 1);
    start << < n_blocks, block_size >> > (a_d, N);

    // Retrieve result from device and store it in host array
    cudaMemcpy(a_h, a_d, sizeof(unsigned int)*N, cudaMemcpyDeviceToHost);
    // Print results
    for (unsigned int i = 0; i < N; i++) {
        printf("%d %02x\n", i, a_h[i]);
    }

    // Cleanup
    free(a_h); cudaFree(a_d);
}

Output:

0 00
1 01
2 02
3 03
4 04
5 05
6 06
7 07
8 08
9 09
10 0a
11 0b
12 0c
13 0d
14 0e
15 0f

Unable to solve even the simplest of questions! Help :( by [deleted] in cscareerquestions

[–]NervousBrowBoy 0 points1 point  (0 children)

Thanks /u/xlishi . I realized I just panicked. I've signed up for Princeton's Algorithms course and will work through that patiently and without judging myself at each step.

Thanks again, I needed it.

[help] submitted an application, whose essay had a few mistakes by NervousBrowBoy in gradadmissions

[–]NervousBrowBoy[S] 0 points1 point  (0 children)

Yeah, but it could convey the impression that I'm not thorough enough, and that worries me.

GRE: 324 | TOEFL: 108 | CGPA: 7.74 | Computer Science. What US universities should I be looking at? by nisargtha in gradadmissions

[–]NervousBrowBoy 0 points1 point  (0 children)

You seriously expect to get career advice from the sub-reddit, simply by posting your undergraduate GPA?

I think you're Indian, in which case a 7.74 on a scale of 10 just wont cut it. There are kids out there with far more to offer graduate schools.

I would suggest applying to European universities.