web-development

Why people always encourage single js for a website?

I read some website development materials on the Web and every time a person is asking for the organization of a website's js, css, html and php files, people suggest single js for the whole website. And the argument is the speed. I clearly understand the fewer request there is, the faster the page is responded. But I never understand t...

What are recommended programming patterns for passing identifiers/keys between server and client?

If I need to keep track of a key or token that identifies a resource being displayed and modified in the browser, what are the some of the programming patterns used? For example, if I display a list of movies and hookup ajax calls for users to checkout or review those movies, I'm assuming I would embed the identifier in the html which w...

Div max-height too tall

Hi, I am doing some of my first web dev, and had a question about the max-height css property. Here's my code: div{ max-height:10px; } Whenever I create a new div, everything works fine, but when I add any sort of other element between the div tags, the height of the div increase by around 10 pixels (I'm guessing). Is there any...

Why PHP function `curl_exec ` should be disabled?

As you know there's some php functions to be disabled on shared hosting environments. Searching the Google, I found many lists of these functions. one of these functions is curl_exec, I can't understand why this function should be disabled? How this function could be vulnerable? ...

About tlsmail with rails = Error - 'no such file to load -- tlsmail.'

I have configured smtp gmail for mail sending. It sends mail well, but when try to open script/console, it says no such file to load -- tlsmail and ends. If i comment out the require 'tlsmail' file in environment.rb file, it doesn't send the mail. gem list also shows the tlsmail installed on machine. ...

JSF 2.0 How to link CSS from resources folder

Hi folks, I'm designing the template for my new JSF2.0 App and I want to use the resources folder to store my css-file. Now I started to create a template-file, but I don't know how to link the css. I tried: <link rel="stylesheet" type="text/css" href="resources/css/style.css"/> ..but didn't work Can somebody help me, pls. THX <...

Spring MVC URL Path Change

Hi All, I am new to web programming and Spring MVC 2.5. I am not sure about my problem is spring sprecific or web specific in general. I have a menu.jsp and I use jsp:include to include it in all my jsp. <ul class="menu"> <c:url var="home" value="home.htm"/> <c:url var="data" value="data.htm"/> <li><a href="${home}" clas...

How to deal with expiring item (due to TTL) in memcached on high-load website?

When you have peaks of 600 requests/second, then the memcache flushing an item due to the TTL expiring has some pretty negative effects. At almost the same time, 200 threads/processes find the cache empty and fire of a DB request to fill it up again What is the best practice to deal with these situations? p.s. what is the term for this...

Using python to provide application services

My company's web architecture has essentially got an extra layer due to client security requirements, which complicates the process of developing applications a bit. I'd like to get some input and suggestions on the best way to do so. First, an overview: presentation layer - this is mostly PHP, with some flex applications as well. We ...

what makes website looks more professional or authentic ?

Hi, I am creating a social networking ( yet another ) website targeting specific non-technical audience. How do I make it look/feel more professional ? How do you prepare a website so it feel authentic ? I am looking answer in terms of usability, font selection, colors, navigation, level of ajax, form design, link position, how to...

How to decide if you should develop an application within SharePoint.

We currently have a fully developed web forms application, basically its like WordPress using .net for multiple users to publish content. It does more than that but thats the simplest way to describe it. Our "webmasters" (I work in the gov) want everything put inside of SharePoint. We currently have SharePoint 2007. I have no experience ...

Organizing CSS rules

I'm thinking about organizing my CSS better. One suggestion is to use something like .LESS I'm using ASP.NET and there is currently a Beta .LESS for .NET Curious if there are other solutions like .LESS? ...

Ruby on Rails/Activerecord mySQL modeling

This is a pretty simple question really, but let's say I'm creating a model for Person. Person obviously has first name, last name, age, etc. But the person also has contact info consisting of things like address line 1, address line 2, city, state, zip, country, phone 1, phone 2, etc... Does it make more sense to create a model for P...

Building a Rails app from scratch - What should be the ideal workflow ?

Hello, I am going to develop a Rails app pretty soon. Currently I have nothing but an idea + few wireframes. I would like to know how shall I proceed? At what stage should I implement/write the following Cucumber features Rspec tests Code Refactoring code What gems/plugins do you use? [ For common tasks ] ...

Safari: Prevent two print dialogs when printing an Iframe

My site has a "print this page" button. I load a static print template HTML file into a hidden iframe, copy the HTML into that page using jQuery, and call window.print() from the Iframe page. All is well, except on Safari, which wants to print the parent frame as well, so I get two print dialogs opening. I've tried calling window.print...

Cookies on Android/Iphone vs Desktop

I am in the process of building an mobile/web application. I want to use cookies for persistence, but I am wondering of the cookies in firefox workings the sames as say the mobile browsers and will it be recognized. Thanks in advance ...

Crop and resize image on clientside

Is it possible to work with client chosen images on client PC without uploading image to server. If yes, what web programming language can do that? ...

What is the preferred method of handling missing or otherwise unavailable keys in a web.config

In my web.config, appSettings section, I have several keys. What is the preferred way to handle in code any keys that are missing? For example, a key name is changed due to a typo. I know I can use various methods to test if the values of said keys exist but what about the key itself? ...

Framework/Platform Selection?

So...I am creating software for a university. The purpose of the software doesn't matter. What I do need to know is, the best way to make it, and what technology to use. The software needs to be able to accept multiple data sources, from Excel to SQL. However, the students will be using it primarily, and they won't always be on the scho...

Permalinks in ASP.NET

Can anyone point me to some good resources on how to implement PERMA links in ASP.NET? I've done a couple google searches but haven't found anything that like authoritative or definitive. ...