Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

01-04-2015 , 08:30 AM
So I'm building this little app for planning and tracking pub tours (friends bachelor party coming up etc.) and I'd be totally fine with just hardcoding the available pubs in the app since it's never going to hit any app store and will be manually installed on a couple of devices via USB cable

But then I thought...mmm would be fun to have an API to call and get them. Problem is I only have some webspace with a MySQL database where I can run PHP stuff (I only have this for a WordPress page, owncloud and email). Anyone aware of a simple way of wrapping MySQL into a REST-API via PHP? The DB would only store the pubs with stuff like name, picture, location and maybe a list of available drinks and I want to be able to GET them as JSON. Nothing fancy, I can manually enter the stuff into MySQL so no need for a frontend for that.

First link I found looks promising already:
http://www.brenelz.com/blog/how-to-c...php-and-mysql/

But checking to make sure there's not something supersimple I am missing. Seems like this would be a pretty common task.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-04-2015 , 09:05 AM
Small aside: I often find myself wondering if the best apps in the world are only installed on a couple of people's phones, private shares, that sort of thing
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-04-2015 , 02:18 PM
Quote:
Originally Posted by clowntable
But checking to make sure there's not something supersimple I am missing. Seems like this would be a pretty common task.
http://www.slimframework.com/

Never used it but I think this is the popular one in php circles.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-04-2015 , 03:52 PM
Quote:
Originally Posted by Baltimore Jones
Is there a legit link between computer programming or similar jobs/hobbies and transsexualism? There are a number of semi-famous early PC game designers who were born male and eventually became women (check YouTube for Matt Chat with Rebecca "Burger" Heineman, she's super entertaining. There are at least 2 other Matt Chat interviews with transgender women). Computer type I knew in real life is now a woman as well.
I was a regular on the long gone Genderpeace forum. Anecdotally, there seemed to be a super geeky subgroup of people there, including an overrepresentation of Aspergers. This is particularly interesting because one of the theories about autism is that it is an over masculinization of the brain. There was also this apparent division in kind, among MTFs, which many people didn't like to talk about. It was often characterized as "young" vs "old" transitioners, but my guess is that it had to do with the division between DDT exposure and genetically based 3B-Congenital Adrenal Hyperplasia (CAH) (see http://www.nel.edu/22_6/NEL220601R02_Dorner_.pdf ), where the apparent differences in "older" transitioners may have been, in part, the shift from 3/4 of the older population being DDT(/DDE) exposed to none of the younger ones.

I grew up on Spray Shed Rd. A mile down from our farm was the county's mosquito spraying shed. In another twist, a few miles in the other direction, my dad worked for Monsanto (though the local plant didn't make DDT). It's frustrating that people who benefit from the disease prevention of DDT won't acknowledge the other side of the coin. Most are obviously unaware, but in my experience, when shown this research, they ignore it. Everyone now knows who's on who's side.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2015 , 03:29 PM
These people are hilarious. Budget is $30-$250 CAD:

I need to build a website in the next 48 hours that:

Accepts payments using Stripe, WePay or other payment APIs.
Has a chat functionality.
Has a voice/video communication functionality.
Allows users to share remote access to their computers, TeamViewer Style. (Optional)

Let me know if you can deliver all of the above functionalities, or just part of it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2015 , 05:56 PM
Ok well here are the node repos I've been working on: https://github.com/jackspaniel/yukon

The ReadMe pretty much says it all. I'd love to hear anyone's feedback.

I separated out the core self-discovery and initialization functionality: https://github.com/jackspaniel/nodulejs

I figured it could be useful for a lot of other implementations other than just our specific needs (a framework that calls multiple REST APIs in parallel for each web request).

The baby is birthed! Time to get drunk.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2015 , 06:25 PM
Quote:
Originally Posted by suzzer99
The baby is birthed! Time to get drunk.
Spoiler:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2015 , 07:31 PM
That was me at 2am last night when I finally finished the readme file.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2015 , 10:03 PM
Code:
#pragma pack(1)
struct ExampleStruct0 {

    union {

        struct {

            uint32_t xxx    : 23;
            uint32_t xxx    : 13;
            uint32_t xxx    :  3;
            uint32_t xxx    :  3;
            uint32_t xxx    :  2;
            uint32_t xxx    :  1;
            uint32_t xxx    :  2;
            uint32_t xxx    :  1;
        };
        struct {

            uint32_t xxxLow     : 32;
            uint32_t xxxHigh    :  7;
            uint32_t xxx           :  1;
        };
    };
};
Code:
#pragma pack(1)
struct ExampleStruct1 {

    union {

        struct {

            uint32_t xxx    : 23;
            uint32_t xxx    : 13;
            uint32_t xxx    :  3;
            uint32_t xxx    :  3;
            uint32_t xxx    :  2;
            uint32_t xxx    :  1;
            uint32_t xxx    :  2;
            uint32_t xxx    :  1;
        };
        struct {

            uint64_t xxx    : 39;
            uint64_t xxx    :  1;
        };
    };
};

What would you expect the result of sizeof(ExampleStruct0) to be?

How about sizeof(ExampleStruct1)?

I am getting something different than expected.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:10 AM
Well at work the result is 8, but I just tried it on my home computer and I get what I expected -- 6. The #pragma pack(1) must not be working correctly at work.

It's not actually being done like in the example, it's being set in some weird way with a macro and a file with tons of ifdefs so we can write code to compile with several different compilers.

I've never done much with preprocessors, compilers, etc. I guess now is as good a time as any to learn.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:38 AM
I'd never seen the ": 23" stuff before so I was like "doesn't pack(1) make no difference? It's already aligned? But I guess it means "i'm using so many bits for this variable" based on the behavior, playing in GCC. I get 6 also.

Pack has to be doing something on the work one though, because with no packing it would be 32. My best guess is it's still aligning to 1 byte boundaries but that ends up expecting 7 bytes so it pads out the last byte for a word boundary? I dunno :P
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:46 AM
Quote:
Originally Posted by well named
I'd never seen the ": 23" stuff before so I was like "doesn't pack(1) make no difference? It's already aligned? But I guess it means "i'm using so many bits for this variable" based on the behavior, playing in GCC. I get 6 also.

Pack has to be doing something on the work one though, because with no packing it would be 32. My best guess is it's still aligning to 1 byte boundaries but that ends up expecting 7 bytes so it pads out the last byte for a word boundary? I dunno :P
I have never worked with the ": 23" stuff before this either.

I am not sure that the bolded is true. If the pack(1) isn't working and/or isn't being set (as I suspect), wouldn't the :23 be padded to 4 bytes as 23+13> 32, and then the rest of the Struct would be another 4 bytes (as 13+3+3+2+1+2+1 = 25, which would be padded to 32 bits)?

That would make sense with the result of 8 that I am getting.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:50 AM
yeah I'm wrong, the : bits is separate from pack

yeah I got nothing.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 01:32 AM
Quote:
Originally Posted by KatoKrazy
I have never worked with the ": 23" stuff before this either.

I am not sure that the bolded is true. If the pack(1) isn't working and/or isn't being set (as I suspect), wouldn't the :23 be padded to 4 bytes as 23+13> 32, and then the rest of the Struct would be another 4 bytes (as 13+3+3+2+1+2+1 = 25, which would be padded to 32 bits)?

That would make sense with the result of 8 that I am getting.
I am going to guess that the target processor at work is different than the processor at your house. Compilers being used probably would be helpful.

Here's two links that I think applies to your issue:
Effect of Pack

Might be Related to Your Issue

specifying bit fields and using pack are used typically for storing data in non volatile memory like flash where the memory resource is limited.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 03:10 AM
Quote:
Originally Posted by daveT
Totally not me. I get more done in that one day than I do in a whole month. It's incredible what can happen when you aren't tensed up waiting for the next tap on the shoulder, AIM, email, or other distraction.

Everything I do takes hours of non-disturbed time. It is no wonder I don't get anything done anymore.
I think I've figured this out. I also have trouble working from home. I think it's the white noise of people moving around and chatting in the distance that helps me focus. Without it my mind wanders too easily and before I know it I'm reading hacker news or staring out the window.

I sit just an arms length (and cubicle wall) from our VP of marketing. On days where she's on the phone all day, I don't get distracted, I get angry. Maybe I'm just weird.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 03:19 AM
There is a huge difference between background noise and outright constant disturbance. I like having background noise (I hate libraries), and could care less if people are talking around me. Well, those stupid walkie-talkies the warehouse uses makes me very upset, but they thankfully aren't around much.

What I'm talking about is the constant, aggressive, "get it done now" distractions that are a constant around me. Everything is Priority Number One, and Priority One is always 5 minutes apart. Usually it is someone needing an immediate answer. Other times it is management rattling their sabers. Other times, well, it's a physical or digital presence that is always around the corner. I've found myself on more than one occasion clicking my mouse around the screen doing nothing just because I was too paralyzed to start anything, because after 15 minutes, I lose track of my work. On days when that disturbance is constant, and those days happen more often than not, I really don't get anything tangible done.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 05:14 AM
Yeah I get that. My boss is good about heading off the vast majority of the real distractions.

I totally feel that "everything is priority number one" complaint. The last few weeks we've been gearing up to do another round of funding so we're constantly getting questions about how much work would it take to *insert thing that is several days of work and will yield one PowerPoint slide*

And they don't seem to understand that we can't get to these asks and still do all they stuff they said they needed ASAP lat week
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 07:48 AM
Quote:
Originally Posted by suzzer99
Ok well here are the node repos I've been working on: https://github.com/jackspaniel/yukon

The ReadMe pretty much says it all. I'd love to hear anyone's feedback.

I separated out the core self-discovery and initialization functionality: https://github.com/jackspaniel/nodulejs

I figured it could be useful for a lot of other implementations other than just our specific needs (a framework that calls multiple REST APIs in parallel for each web request).

The baby is birthed! Time to get drunk.
congrats on pushing this!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 08:30 AM
So, for the uninitiated, what exactly did suzzer, uh, do?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 11:11 AM
Quote:
Originally Posted by adios
I am going to guess that the target processor at work is different than the processor at your house. Compilers being used probably would be helpful.

Here's two links that I think applies to your issue:
Effect of Pack

Might be Related to Your Issue

specifying bit fields and using pack are used typically for storing data in non volatile memory like flash where the memory resource is limited.
Thanks.

This is going in firmware code for an SSD so your assumptions about its use are correct.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 11:27 AM
Quote:
Originally Posted by KatoKrazy
Thanks.

This is going in firmware code for an SSD so your assumptions about its use are correct.
You are correct that the compiler options that are selected is one thing to understand. Not sure but this appears to be an issue with the compiler and how it is aligning data. Maybe some issue with optimization selection. I'm going to guess that your using the gcc compiler at work and there are a lot of possible option selections to experiment with. Worthwhile things to understand btw especially for embedded development.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 11:46 AM
Quote:
Originally Posted by Anais
So, for the uninitiated, what exactly did suzzer, uh, do?
Can you be a little more specific with your question(s)? I'll be glad to go into any amount of detail you want. But I don't want to write a whole essay on what a web server is, or what node is, if that's not really what you're asking.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:28 PM
Quote:
Originally Posted by adios
You are correct that the compiler options that are selected is one thing to understand. Not sure but this appears to be an issue with the compiler and how it is aligning data. Maybe some issue with optimization selection. I'm going to guess that your using the gcc compiler at work and there are a lot of possible option selections to experiment with. Worthwhile things to understand btw especially for embedded development.
The flag -mno-ms-bitfields causes it to behave as expected.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 12:35 PM
Quote:
Originally Posted by KatoKrazy
The flag -mno-ms-bitfields causes it to behave as expected.
Thank you!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2015 , 02:13 PM
Quote:
Originally Posted by suzzer99
Can you be a little more specific with your question(s)? I'll be glad to go into any amount of detail you want. But I don't want to write a whole essay on what a web server is, or what node is, if that's not really what you're asking.
Well, was it something you or your guys will use at work, or just something you were interested in developing? I think that's the main part Im curious about.

Haven't read any of it because I'm sure I wouldn't understand any of it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m