Buffistechnology 3: "Press Some Buttons, See What Happens."
Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!
Pfft. It wasn't all that broken. That adds support for registration and login. Logout will come later, I haven't implemented that yet for my wife's study, but all it will do is just delete the current session from the session table.
The cool thing is that the middleware layer in the Cerberus library (which I wrote real quick since I didn't like the library I found) will just take care of authenticating for the rest of the API and you don't have to worry about it. Another application-specific middleware layer will deal with updating the expiration time on the access token and the session so you don't need to deal with that either once it's in place.
One quick tip that can be confusing.
The $request and $response objects that you deal with in all the request controllers are immutable. So when you set something on them, you need to use the returned value. For example:
$response->withHeader('Content-type', 'application/json');
$value = $response->getHeader('Content-type');
Will result in $value being null.
You need to do this instead.
$response = $response->withHeader('Content-type', 'application/json');
$value = $response->getHeader('Content-type');
Which results in $value being 'application/json'
Another tip. To wipe out your database you can just run the command:
vendor/bin/propel sql:insert
from the noter/back directory. Which is handy since there is nothing that cleans out sessions yet.
I pushed a bit more code. There's now support for basic CRUD operations through the REST api with authentication. I also added a setup.sh script to do all the stuff needed to get dependencies and generate the database support. There's also some sample data in a couple of csv files and a python script for turning that into SQL.
./csv2sql.py -u user@email.com -c categories.csv -n notes.csv > file.sql
There's a pre-generated SQL file there that will work just fine, but it expects a registered user with the email: gunnar@dog.com
Anyone want a bargain smartphone with no contract?
$20 + free shipping, free minimal data talk and text.
[link]
My new phone is here! And it only took me four tries to enter the internet password correctly, even though I was staring right at it the whole time!
I've been too busy to get to the front-end, but I'm hoping to this weekend. I need to get a lot done on the front-end of my wife's study software and that's what gets adapted into my example.
Printer question. I have a Brother HL-2140. Tonight I tried to print my taxes. After printing the first 6 pages, it jammed. I clear the jam, and resumed. It would print the first page, and kinda jam as it spit it out, and the second page would be stuck in the works. Clear the problem, try again. Same result. OK, then I tried printing just one page, and it still started to feed a second page and jammed. Why? I said print one page. OK, so I try to print using the front single feeder rather than the paper cassette. Works great, no problem. So I try from the paper cassette again, and it jammed again.
I suspect the drum is the issue. It's original drum, and the printer is 7 years old or so. I rarely use it. Lately, the most I print is a sheet for UPS to leave packages at the door.
1) Any clue what the problem is and how to fix it?
2) Should I just buy a replacement. Quill dot com has a HLL2320D on sale for $40.
I hate to throw something out that works.
I'm not sure it's the drum. The paper has to go past that whether it's coming from the cassette or the feeder. It sounds more likely that it's something to do with the paper pickup from the cassette. As printers age the rubber wheels that feed the paper get less pliable and misfeed.
A couple of things to try, if you haven't already. Make sure that there aren't any slivers of paper from the original jam still stuck in the printer. Since the single feed seems okay, that should narrow down the area you need to search.
Clear out the computer's print queue, then power down the printer completely to make sure there's nothing sticking around in its buffer. Turn it back on and print a test page from the cassette to see what happens. In Windows you can do that from general tab of the printer properties window. I don't know how to do it from a Mac, but it should be similar.
If the test page prints okay, check the print settings in your application to make sure that the width of your document is 8.5" or less (if not, that would explain the second sheet you're getting, although not the jams).
I hate to throw something out that works.
But, it doesn't. Get the new one.
Make sure that there aren't any slivers of paper from the original jam still stuck in the printer. Since the single feed seems okay, that should narrow down the area you need to search.
Yeah, I was checking in after each failed print. Even had the flashlight out. All clear. The paper crinkled a lot, but no rips/tears.
Clear out the computer's print queue, then power down the printer completely to make sure there's nothing sticking around in its buffer.
Was doing that each time I cleared a jam. Not reaching into something plugged in.
But, it doesn't. Get the new one.
Ha. Well, mostly it does. But yeah, since I'm getting a tax refund, and it was only $40 on sale, that's what I ended up doing.
It could be (have been) a particle of pre-animate matter, caught in the matrix.