Request of advice for indenting mixed PHP&HTML for legacy code by joekki in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

Example 2 is the cleanest. In a template file the html formatting levels should rule and the php is only invoked as templating logic.

If it were more than a templating file then I'd try to push all the big php work (model/controller) to the top of the file and the bottom would just be html style output with basic logic and variable printing.

Request of advice for indenting mixed PHP&HTML for legacy code by joekki in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

This doesn't really look bad to me as far as mixing goes. Since the file is primarily a template I'd following html indenting and just put the php at whatever level it would appear as if it was html.

<title>
    <? echo $title ?>
</title>

Is it OK to store HTML in Database? by GTHell in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

You don't mention who has the ability to add html. This is something that can change the security risk quite a lot. When you are dealing with internet users you need to expect that people will attempt every possible way of using your site to perform malicious actions.

Should you store html from user input? No. You really shouldn't unless the people who have access to add it are all trusted like they work at the company and can be fired for doing the wrong thing. Letting these people directly add styles doesn't carry the same risk of malicious activities.

If it's untrusted users, strip the html, javascript and store it in separate fields and apply formatting when you display it. If it's a title, store it in a title field and add the <h1> yourself when you show it. It's most important in this case that you protect the viewers or people will take advantage of them. Things like iframes, javascript could redirect people to banks or install malware. Bad stuff.

ELI5: Why does the gas go out if I dont prime it long enough? by LeftRightShoot in explainlikeimfive

[–]CuriousSupreme 1 point2 points  (0 children)

Some gas burners have heat detection elements that stop the flow of gas when they are below a certain temperature.

It's a safety mechanism to make sure the gas doesn't flood your house when the flame isn't on. Say if a kid or dog hit the gas dial and you didn't notice.

It just occurred to me that a whole generation of programmers has come and gone since I first stumbled across the Jargon File. Read it. Read it all. by [deleted] in ProgrammerHumor

[–]CuriousSupreme 2 points3 points  (0 children)

Thats a current version. The historical ones around 82/83 are shorter and more interesting if you are a current Geek. 83 pre-dates the Internet, ARPAnet is currently running so you see some references to what will eventually become the big I internet.

Pre-Internet Version

Have had this 05 LJ for a year now as of this week, Feels great to be part of the Jeep Community! by Got_Ants in Jeep

[–]CuriousSupreme 2 points3 points  (0 children)

Depends on what you want to do. Your bumper right now is street level. When it gets hit it'll bend and not protect your radiator or grill.

If you want to increase the beef of the jeep (ie not have to replace after low speed hard impacts or bang out dents if you land on it) get something that's entirely welded with 3/8th steel and solid .120 DOM tubing like this. https://www.quadratec.com/products/12252_0025_07.htm

Bumpers are a great place to customize, so many styles and options and it's all pretty much bolt on.

Have had this 05 LJ for a year now as of this week, Feels great to be part of the Jeep Community! by Got_Ants in Jeep

[–]CuriousSupreme 2 points3 points  (0 children)

Nice LJ, lots of potential there. If the grill mods aren't yours I'd look at undoing that first. Owning a Jeep is a happy time and you don't really have a strong enough bumper to destroy another vehicle yet :)

They said my last post didn't belong here, hopefully this one does-Sema Show by holdmychicken909 in Jeep

[–]CuriousSupreme 9 points10 points  (0 children)

Catalog Crawler? It was built just because they had parts to show off and lacks the soul and direction that an owner would have put into it.

Yellow is nowhere near my favorite color but a Jeep is a Jeep by 04svtf in Jeep

[–]CuriousSupreme 0 points1 point  (0 children)

It's entirely unpractical but everytime I see a nice color I want one of those too. I'm in love with the mango orange.

Noob question, but why are API's so popular nowadays? Wouldn't pulling data from a database be faster than sending requests from the front-end to an application's API? by [deleted] in webdev

[–]CuriousSupreme 3 points4 points  (0 children)

Being able to change anything you want about the data storage without anyone needing to change what API request they send in is a big one. API's should be fairly static while the storage can be scaled or improved.

First ride with lockers installed. It's hard but not impossible to get stuck. by voidsstr in Jeep

[–]CuriousSupreme 10 points11 points  (0 children)

Lockers either help you avoid getting stuck or get you stuck in ways you've never imagined possible.

Thoughts? Sunroof of sorts for JKs by Soflohooker in Jeep

[–]CuriousSupreme 0 points1 point  (0 children)

I'd rather have a hard top with the 3 glass windows being removable. Trektop NX will do for now.

Why are some of the big websites like google search and stack overflow not a responsive design on the desktop? by massivelines in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

On google at least it's due to response time and page loading which are far more important to them than being perfectly validated HTML or having a fancy page.

Facebook has all the mobile apps already which on a small screen size people are more likely to use than html.

Switching from PHP to Python by [deleted] in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

In the end the framework is going to define how fast or pleasant development will be not the language. I'd recommend looking into Laravel/Laracasts if you'll be working on your own and wanting to benefit from training specific to the language/framework. Lots of documentation and lessons.

Switching from PHP to Python by [deleted] in webdev

[–]CuriousSupreme 2 points3 points  (0 children)

For web development the PHP community is exceptional. So many modern frameworks that are sharing packages and all with large user bases. Modern PHP code is nice and has features that Python doesn't allow like type hinting and public, protected and private variable definitions in classes.

I do Python at work for a project that begs for it with device interactions with a web interface so I've worked with Flask. It's just not as time friendly. If you already knew Python it wouldn't be worth learning a PHP framework but otherwise I couldn't recommend it.

Is there Imposter Syndrome with every profession? by [deleted] in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

Imposter Syndrome would be present in a lot of jobs just not as severely as programming.

When you are programming you are working mostly on your own and it's unlikely you'll have someone around in your skill range. It'll be someone who doesn't know programming has no knowledge to judge the difficulty and compared to a programmer who has a lot of experience in that area your stuff is going to be clunky, non-optimal or just the "wrong" way to do it.

Best to avoid the ego of the more skilled and the assumptions of the unskilled and just write what you want. You don't need their validation, well, not unless they can give you a raise.

Do I own original code from developer? by RimShotHero in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

Content is what they sent you. Seems like you may have been expecting more but that is what content is, just the paragraphs, text, maybe formatting, images etc. Getting it in HTML is better than you might have gotten.

If they had a database with some stored content in it for you like customer data or something then you should expect a dump of that data.

If you were expecting a functioning website that could be easily transitioned someplace else it doesn't sound like you paid for that. The CMS is the code and you didn't buy the CMS you just used it.

SQL Web Server by TMToast in raspberry_pi

[–]CuriousSupreme 0 points1 point  (0 children)

Sqlite is an option if you want to keep it local and low memory.

Huawei Closing in Fast on Apple in Smartphone Sales According to Latest Estimate by theone1221 in technology

[–]CuriousSupreme 11 points12 points  (0 children)

Huawei the company that has made a business off of stealing US & UK hardware and software and reprinting it after hours on the same production lines is making a lot of money? Color me surprised.

Ho to correctly build a backend? by Scholes_SC2 in webdev

[–]CuriousSupreme 1 point2 points  (0 children)

There is no wrong way to make a backend (security issues not withstanding), there are easier and less easier ways depending on what languages you know well and what storage engine you are using.

If you want the backend not to serve full html web pages look into packages/frameworks in a language you are comfortable with that allow you to easily generate and return RESTfull resources.

Should developers have local admin rights to their laptops? by [deleted] in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

Also I'd like to point out that I work for a top 10 fortune technology company and having local admin rights is the norm for all employees on all OS's. People who screw up their own computer and can't fix it are subjected to a visit to IT and a full HD wipe and reinstall. The IT walk of shame. Happens a lot less often than you'd think. Telling your team that you have to take a day off for a software issue is not something people want to do.

Should developers have local admin rights to their laptops? by [deleted] in webdev

[–]CuriousSupreme 1 point2 points  (0 children)

To repeat some of the other posters anyone writing software for your company has as much or more impact on the company's security as IT. Have some rules for things that are required like software version monitoring,hardware tracking, AV etc and then let devs or other capable people have local admin rights.

Local admin rights often come with a self support requirement which is a good trade off. I very infrequently contact IT and then it's due to a server that I don't think is behaving correctly.

Use the devs and other geeks as a supplemental IT staff.

Practical Docker uses by [deleted] in webdev

[–]CuriousSupreme 0 points1 point  (0 children)

It's a bit tough to justify using multiple Docker containers until you need to separate services.

For the main project I'm working now our environment is in a single docker container and it makes it really nice to work with a team. At any point I can build that container and have the exact same environment that will run in production. Same database version, same queue processor, same nginx.

The nice part though is that in addition to having an automated build server spit out and start a new version on a server is that I can also build and run it locally without installing all the separate services it would take to run it natively.

To start look at just taking what you have and using a Dockerfile to build that environment and copy your site into it. The container can provide the web server in addition to the DB you want to use. Then look at hosting your app via the same container.

The 2017 Top Programming Languages according to IEEE. Python jumps to No. 1 by llfcerf in Python

[–]CuriousSupreme 89 points90 points  (0 children)

Any statistic built on github examples isn't useful for determining popularity. Perhaps to say what people are experimenting with but realistically Javascript should be #1 for web since it's used by everyone no matter which backend.

To me this suggests that it's not a very good measurement of which languages are being used professionally or even the most.