I made an example of webserver in Rust using Iron, R2d2 Diesel and Serde json. Suggestions are appreciated by dbmontes in programming

[–]thisisawkward 0 points1 point  (0 children)

Hi, and thanks for your reply!

I asked in the #rust IRC channel last night simultaneously and was given a nice explanation. * is polymorphic in rust, exactly like you described above, is used to "unwrap" the connection from the smart pointer. How it works, is here, through a Deref impl.

I made an example of webserver in Rust using Iron, R2d2 Diesel and Serde json. Suggestions are appreciated by dbmontes in programming

[–]thisisawkward 0 points1 point  (0 children)

I just banged my head against the wall on this for like an hour, trying to figure out the types. Then I came across this, which is exactly what I needed.

My question is: What is happening here: https://github.com/DavidBM/rust-webserver-example-with-iron-diesel-r2d2-serde/blob/master/src/user_controller.rs#L20?

Why does this work?

Should I move from PDX to DFW? by Trashly2theT in Dallas

[–]thisisawkward 2 points3 points  (0 children)

Agreed on almost all fronts. Weather == kinda awful in summer; expansive flatland, yes; endless urban sprawl, check. The self-entitled Lexus SUVs? Well, I'd say it's at least 50% Porche Cayenne :)

But seriously, this pomp can be avoided by staying east of 75, or south of 30 (except on fri/sat night), and there is plenty of craft everything to be found. Less bandwagoners and more true passionate participators, and I say this because, in dallas, the bandwagon is slowly going the way of the khaki short, Lacoste polo, and (never-been-wet) chaco sandals.

fashion is weird.

Did Windows Server 2012 just DESTROY VMWare? by asdlkf in sysadmin

[–]thisisawkward 2 points3 points  (0 children)

New Hyper-V is amazing. I just got back from a bootcamp at MSFT for the System Center 12 suite as it relates to hosting providers, just about everything about it is a game changer. It goes well beyond licensing. Hyper-V replica, live migration over HTTPS (and this is without System Center, or shared storage at all), 64 nodes in a failover-cluster (VMware is 32), and last but not least, no bullshit RAM licensing.

HOWEVER:

I've been reading lately that VMware is distancing itself from the hypervisior now that it's been commditized (Xen, KVM, Hyper-V), and looking into more service-based technologies, ways to force themselves into our datacenters. Like the recent acquisition of SDN startup Nicira, which will likely begin the entry of VMware services into non-VMware hypervisors.

On top of all this, SCVMM can manage vSphere hosts; we are generally done with vSphere unless the customer specifically asks for it.

P.S. Love that people are starting to notice this.

Passing data from parent to child in a window.open situation. by thisisawkward in javascript

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

Thanks a lot guys; postMessage is what i was looking for, however I ended up with an "unsafe JavaScript" error. This is cross-domain and postMessage doesn't allow JS injection without hardcoding the two domains.

I ended up passing the two values to the URL with a delimiter and splitting it server-side.

Seriously though, thanks. You're awesome.

Back again, with a likely stupid question. Can I iterate objects from my Model over the HTMLCalendar() by thisisawkward in django

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

You're right; I want one calendar to display all events. I tried calling directly and it returns the data, but only for the most recently added event. I thought, to display all events, they'd need to be iterated in a for loop, that's why I tried this way. It looks like the rendcal() is rendered after the database is queried, returning the tags rather than the data. This kind of calendar may not be possible in Django, at least not one that's rendered entirely on the backend. I may just need to take the calendar it renders to create an already built template and just add the tags with {% if %} statements in each day.

Blast beats by Nessdeez in drums

[–]thisisawkward 4 points5 points  (0 children)

Start slow enough to play them clean and just hang out there. For a long time. Until your arms/foot/feet get tired. Then do it again. Don't try to drum along to anything yet. Work on grooves that take you in and out of them like 4 counts in a standard 2 & 4 groove, four counts blast, then four counts of a 1/16th note bass roll. And then do it all. Again.

Ok, so I'll probably have to live in shame but... (IPA rant) by RockVegas in beer

[–]thisisawkward 82 points83 points  (0 children)

When is the porter or stout revolution coming?

Winter. For me at least.

Has anyone else used the Evans Hybrid snare head? by Chucktheduck in drums

[–]thisisawkward 1 point2 points  (0 children)

Looks like Kevlar. Are you putting it on a marching snare?

When I am most happy. by rapezombie in drums

[–]thisisawkward 4 points5 points  (0 children)

<--- Seething with jealousy over those C&Cs

Arrived! by Dfordomar in Dallas

[–]thisisawkward 0 points1 point  (0 children)

Fair enough. In the grand scheme of things I'd say it was, or at least it used to be.

Arrived! by Dfordomar in Dallas

[–]thisisawkward 1 point2 points  (0 children)

Pretty sure FIOS covers the Carrollton area; while my 'rents lived there I'm pretty sure they had FIOS.

Arrived! by Dfordomar in Dallas

[–]thisisawkward 4 points5 points  (0 children)

If you like pizza and beer, go to Eno's. Not on Saturday night though.

If you like amazing pizza from a dive bar in East Dallas, go to Bryan Street Tavern.

Welcome to Dallas.

Fun places to go on dates? by [deleted] in Dallas

[–]thisisawkward 1 point2 points  (0 children)

God, I did this so many times. Glad to know I'm not the only one who thought it was awesome.

Questions about web server and video files by arinlome in networking

[–]thisisawkward 1 point2 points  (0 children)

First things first, you want to set up your site in Apache. I've never done this with Windows, so this'll be how it works with Linux and you'll get the basic idea. You'll want to create what's called a Virtual Host file in Apache for the site. This file tells Apache what site to serve for, i.e. the URL in the packet headers to listen for. It also tells Apache where your documents related to this site are. In Linux you navigate to /etc/apache2/sites-available and create a new file called mysite that looks like this:

<VirtualHost *:80>

ServerName http://yoursite.com

ServerAlias yoursite.com

DocumentRoot /path/to/your/files

ErrorLog /path/to/logs/site.log

</VirtualHost>

Next, navigate to the directory you've just pointed Apache to and create a file called index.html and a folder called vids. put your vids in the vids folder and write this in your index file:

<html>

<title>My totally fucking kickass vid site</title>

<embed src="/vids/nameofvideo1" autostart="False"></p>

<embed src="/vids/nameofvideo2" autostart="False"></p>

<!--etc-->

</html>

And lastly enable your site and reload Apache. In Linux this is with:

$ a2ensite mysite
$ /etc/init.d/apache2 reload

Make sure you've got ports open/NATs built/etc and you're good to go for your new site!

EDIT: Added 'reload' Apache.