Webmasters Forum
Question about best practices in PHP5 OOP (beginner)
Hi everyone,
I'm teaching myself php object-oriented programming (I would've gone with ruby or something like that, but I already had a base in php). I've got a good handle on the syntax and structure of classes, methods, etc.
My question is, what do I put in a class. The tutorials I've seen around the internet just create dumb objects (a user class that has parameters but no logic). However, I've been looking through the source of several projects written in php5 oop, and some include a lot of logic (validation for input, database queries, etc) and some include a little bit, but have the other needed logic in other classes or includes.
So my question is two-fold:
What are the best practices for organizing/dividing your classes? and also kinda related,
Do you have some good resources on learning how to do php5 oop professionally (meaning clean-code, following best practices, security minded, etc)?
--
I'm an IT technician with a lot to learn, taught by viewers like you!
What are going rates?
I've setup/hosted websites for myself a friends, but now a business is asking me, and i have no idea what the going rates are.
I will:
register their domain
setup a Wordpress site based on a template of their choosing, with some minor customizations
host the site on my server
Continue care and feeding of the site
I'm not sure what a fair 'startup' fee would be, or the ongoing hosting/feeding & caring fees ..
--
...
ASP.NET Issues
I am not good at editing ASP files... I tried but I can't seem to get the formatting correct... can someone please edit this for me?
http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes#0.1__Toc256770150
Thanks!
CSS List Styling
I'm converting a bunch of HTML documents on a client site I inherited into templated content from a database. They have stuff like this:
<span "font-style-bold;">Section Title</span>The narrative for this section. Note that the sections are numbered.</li><li><span "font-style-bold;">Another Section Title</span>The narrative for this section. The twist being this one has a lettered sub list as part of it.<br />a. Blah blah.<br />b. Blah blah blah.<br /></li></ol>
1. Section Title
The narrative for this section. Note that the sections are numbered.
2. Another Section Title
The narrative for this section. The twist being this one has a lettered sub list as part of it.
a. Blah blah.
b. Blah blah blah.
c. Blah blah blah blah blah.
I do not want that extraneous styling stuff polluting the database (or confusing the crap out the gentleusers who will be editing it through the handy forms I am building for them). I do not have Mad Crazy CSS Skillz (yet). Can someone show me how to accomplish this without relying on markup in the data itself?
BTW, is the closing </li> tag deprecated/out of fashion? I have come across a number of references that do not include it.
Danke...
Edit: Added the example of the output.
--
"Keep calm and carry on."
C array of pointers to a 2D array of structs
I've done a lot of stuff with C arrays, but this one has me slightly stumped. How does one define this in C?
An array of 16 pointers, each of which points to a [3][50] array of structs with 4 fields.
I plan to have the array of 16 pointers statically allocated, and dynamically allocate each [3][50] array.
any tool to help absolute position divs?
what are best WYSIWYG web dev tools out there?
is there any that will help me make my own personal links page...
like I want to be able to drag drop into absolute position divs and etc...
Thank you...
[VB.NET] Declaring DLL with environmental variable in path?
How can I create a DLL declare statement with an environmental variable in it so as to make sure that I'm loading the system DLL from the right place, the system32 folder?
--
Tom
Kinect for Windows SDK
This is highly cool
quote:The Kinect for Windows SDK beta is a programming toolkit for application developers. It enables the academic and enthusiast communities easy access to the capabilities offered by the Microsoft Kinect device connected to computers running the Windows 7 operating system.
The Kinect for Windows SDK beta includes drivers, rich APIs for raw sensor streams and human motion tracking, installation documents, and resource materials. It provides Kinect capabilities to developers who build applications with C++, C#, or Visual Basic by using Microsoft Visual Studio 2010.
This SDK includes the following features:
Raw sensor streams
Access to raw data streams from the depth sensor, color camera sensor, and four-element microphone array enables developers to build upon the low-level streams that are generated by the Kinect sensor.
Skeletal tracking
The capability to track the skeleton image of one or two people moving within the Kinect field of view make it easy to create gesture-driven applications.
Advanced audio capabilities
Audio processing capabilities include sophisticated acoustic noise suppression and echo cancellation, beam formation to identify the current sound source, and integration with the Windows speech recognition API.
Sample code and documentation
The SDK includes more than 100 pages of technical documentation. In addition to built-in help files, the documentation includes detailed walkthroughs for most samples provided with the SDK.
Easy installation
The SDK installs quickly, requires no complex configuration, and the complete installer size is less than 100 MB. Developers can get up and running in just a few minutes with a standard standalone Kinect sensor unit (widely available at retail outlets).
This SDK is designed for non-commercial purposes only; a commercial version is expected to be available at a later date.
http://research.microsoft.com/en-us/um/redmond/projects/kinectsdk/
--
Vendor: Author of Link Logger which is a traffic analysis and firewall logging tool
Research Opportunity for Developers - Pays $150
One on one phone interview for software developers who integrate online invoicing and payment processing with their AGIs. Strictly legit, no sales will be attempted. Pays $150 if you qualify, for a one-hour interview. Reply to tom@infocousa.com
Stock Market software for the web cms
I'm looking for an advanced Stock market financial software that I can integrate into drupal/cms.
I'm willing to purchase it if it's what I need.
Please offer any help you can.
Thanks
multiple calls to same resource = ?
I have a page and it makes multiple calls to the exact same URL of the .js file
say
<script type="text/javascript" src="http://server1.com/content/branding/js/jquery-1.4.4.js"></script>
I guess each browser and it's version handle this differently
my expectation is that browser should just cache the first one and no subsequent call / loading / processing is done
but is that so?
any info on this
thx
Future of MyBB
http://blog.mybb.com/2011/06/07/developing-the-future/
The future of MyBB and a preview of v2.0. v2.0 is probably going to be excellent, now if only there was a good CMS for MyBB, then I should be set for my site.
Developing a special mp3 file 'streaming' php script
So I am hoping there are some good PHP guru's here who can help me out. :)
I am trying to build a very specially crafted php file with a specific set of features I am after. For the most part 90% of is easy but one particular feature I am not sure how easy to accomplsih it is.
Basically what I want to do is build a PHP script that reads a static mp3 file on the server and streams it on demand to a player in a way so that it looks like a live stream rather than a pre-recorded file. This part is pretty easy.
What I am not sure of is this:
a) I want the file to look to the player like it is a live stream with no given duration. Once the file it is reading ends, it either tells the player there is a definite duration/end ahead or just drops the connection or something when it hits.
b) (and this is a primary concern) I want the script to read an mp3 file that will be actively written to at the time it is read. And I want it to continue reading the given mp3 file until it actually hits the end of the file wherever the program writing to it decides to stop. As it is, all tests and programs I have run so far will take and see the end of the file at the exact point it is accessed and stop the player there even though more of it has been written. I want it to continue being read as it is being written.
Any ideas? I'd really appreciate the help on this one. I have no idea where to start on this one honestly. Thanks. :)
--
I swear, some people should have pace-makers installed to free up the resources. Breathing and heart beat taxes their whole system, all of their brain cells wasted on life support.-two bit brains, and the second bit is wasted on parity! ~head_spaz
Login box issue
Hi, guys!
I've been working on a system where authorized personnel gets access to certain things.
I've got it more or less working. The issue is that the login box does not look right. I've been trying to work on this, and it drives me up the wall because this login box is refusing to work with the theme I've integrated into this page.
To view the code and the like, visit http://staff.shatteredtears.com and yes, I know it's supposed to be set to https but I do not want to set that up just yet until I can get the login box working, then integrate valid SSL.
For those of you wanting to have a look at the code, here it is:
<div class="inputArea"> <h3>Log into SSAS</h3> <form name="loginForm" method="post" action="/index.php" autocomplete="off"> <label for="username">Username</label> <input type="text" name="user" id="user" maxlength="24" value="" tabindex="1" /> <span class="formError" id="userError"></span> <label for="pass">Password</label> <input type="password" name="pass" id="pass" value="" tabindex="2" /> <span class="formError" id="passError"></span> <br /><input type="hidden" name="to" value="" /> <input type="submit" name="doLogin" id="doLogin" onclick = 'return processForm()' value="Login" /> <input type="checkbox" name="remember" id="remember" value="1" tabindex="3" /> Remember Me? <br /><br /><a href="http://staff.shatteredtears.com/forgot.php?do=pass">Forgot Password?</a> <a href="http://staff.shatteredtears.com/forgot.php?do=user">Forgot Username?</a> <script type="text/javascript"> document.write('<input type="hidden" name="hashed" value="1" />');</script> </form> </div>
Unfortunately, I'm not very good with javascript code. :( Thanks for checking it out.
Edit: Logging in works fine, it's just that I want to fix the look of the box on http://staff.shatteredtears.com so that it doesn't look as munged up.
--
Wanderer of the Stars...
ShatteredTears NOC
Managing: ShatteredTears IRC
EidolonHost
Java GUI Programming
A few years ago I was in a pre-bankrupt Borders and perused what appeared to be a good, solid book on programming GUIs in Java, focused on Swing.
It just seemed to do a really good job walking the reader systematically through everything GUI: the container classes (JFrame, JPanel, JApplet), the component classes (JButton, JTextField, JComboBox, etc.), and other areas with lots of code examples.
I didn't have the discretionary income at the time and the name of the book is lost in the sands of time. The really cool thing about this book is that it was devoted to GUI programming and nothing else. I'd like to have a "go to" book like this in my library. I still rely on my old Java textbook, Liang's Introduction to Java Programming, and it's good as a refresher.
Any recommendations? It would be nice to eventually "graduate" to a book like Filthy Rich Clients: Developing Animated and Graphical Effects for Desktop Java Applications, but a good, solid GUI 101 book would be very helpful, too.
Thanks!
--
Leave the gun. Take the cannoli.
IIS Not Serving Web Pages After Restore from Power Outage
Specifically, our XP-based server, which has been running since Feb 2006, has gone all awry today, after the UPS shut down due to exhausted batteries during a prolonged (and still ongoing) power outage.
I have had limited success only after restoring a Norton Ghost image of the system drive, after which, restarting the server resulted in web pages served for about 30 minutes. Then the dreaded "waiting.... done" white screen appeared again when browsers tried to access any of eight web sites hosted on this server.
IIS is running, and the Admin panel runs, but it's just not serving any pages. Even http://localhost produces nothing, on the server itself.
What could be getting corrupted so regularly (running on generator) that causes IIS to appear to be running, but just refuse to serve web pages?
For example, a visit to http://www.mwhdvideo.com/ results in a long wait, followed by "done" in the browser status bar. The screen is a blank white area, no part of any page appears. Not getting a 404 error..
Note, this is going through DNSalias, to enable function on a DSL line with dynamic IP. DNSalias is forwarding, but the server is not responding. NOt even a direct http://ipaddress will produce a page. That's usually foolproof, when stuff goes haywire.
Three times today, I was able to get the IIS working by restoring a Norton Ghost image. But soon after, it reverts to this odd behavior. Simply rebooting the server does not restore functionality. I'm at a loss here.. is there a way to analyze what's happening to the connection from a remote location? I'd like to figure out how to fix this without doing a partition restore every 30 minutes or whenever. The sites have been down most of the day due to this unexplained issue.
Bluehost/Ebay shutdown crap is lame - need new host
I have had Bluehost for about 6 years. 2 weeks ago I was shutdown without warning. Nobody would tell me what was going on and then I was transferred to TOS.
About 4 years ago I signed up as an ebay developer, built a few really nice pages with different backgrounds etc. When I started to sell I put a few example pages onto my server along with some pics and forgot about them.
Some where along the line some pages on an unrelated domain must have been crawled and according to Bluehost Ebay had issue. Bluehost then proceeded to shut me down without warning and did not know for several days. No warning nothing zip.
I did not have any use for the pages so I removed the requested pages and requested the complaint. They then put my site back up but never sent out a complaint or other.
Bluehost conveniently shut me down @ 3:30 just about the time that all the managers leave. I got on chat and they said that my account has been terminated and I would have to get a new host. I looked in my email and this time I did get an email to inform me that I am terminated because I did not remove some links. WTF I never saw this information before and was lead to believe that I had corrected any issues.
They chat was ended abruptly and it was quite clear that Bluehost did not like their answers in writing.
I talked to several people at blue host and they now refuse to reinstate my account, send a complaint or care to resolve what was clearly a misunderstanding. Sales did not care and the scripted TOS lady refused to let me talk. I also asked her and several others for the complaint.
My site is simple, no flash, porn, video or other low hit type of site.
So Bluehost sucks and I need a host that has cpanel and hopefully unlimited databases for R&D. Cost effective LAMP host.
I have heard the complaints with Bluehost before, but I never pushed the limits so I never had issues until this time. They just lost a customer or more for life.
I guess the good news is that there is a better host out there that knows how to communicate and appreciates customer loyalty.
I also wonder how you can be an Ebay developer and not be able to put pages up onto a sever.
Any suggestions and/or other?
Thanks
HTML5 Fest Calgary - June 15th
Wednesday, June 15, 2011 from 6:00 PM - 9:00 PM (MT)
Calgary, Alberta
Fairmont Palliser
Alberta Room
133 - 9th Avenue S.W.
Calgary, Alberta T2P 2M3
Canada
Come join us for an evening of HTML5 developer goodness! In this session, you'll learn how to take advantage of HTML5 today and into the future! You'll also see what's possible with HTML5, enabling rich user experiences on the web without the need for plugins. Finally, you'll discover the tools that are available to help you build HTML5 web applications and sites. Come join us for an action-packed evening of HTML5 awesomeness!
Dinner will be provided.
http://www.eventbrite.com/event/1787690029?utm_source=eb_email&utm_medium=email&utm_campaign=new_eventv2&utm_term=eventurl_text
Blake McNeill
Speaker Coordinator
Calgary .Net User Group
http://www.dontnetcalgary.com
Edit I should point out this is a free event
asp.net lost in design
Ok, what I am looking for is something like this... or am I going to have to build a User Control for it...
4/1 4/2 4/3 4/4 4/5 ... 4/29 4/30
name green green green green green
name2 red red green green green
name3 blue blue blue blue green
where green/red/blue is a colored box. green = accepted red = decline and blue = nodata
I looked at charts, but I am not sure I know what I am doing there.
so basically I need to gknow if there is anything out there currently.
--
Remember, you are a nutjob, but they should not find anything wrong with your work.
just curious if it's possible to wrap...
my preliminary google search did not turn up an answer...
just curious if it's possible to make the overflow wrap around...
say i have one looooong string - without spaces
like:
quote:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
see here on DSLR - our forums add mandatory spaces to prevent the overflow...
well I'm wondering if anything like that is possible with CSS
one way to prevent the overflow it's possible to do
overflow: hidden;
or
overflow: scroll;
but would be interesting to know if it's possible to have it wrap via one way or another...
I guess a JavaScript function could find a break up long strings...
hmmmmm
let's consider all possible way...
just curious...
thank you...
<div style="width:200px; border:1px solid red;">c</div><br><div style="width:200px; border:1px solid blue; overflow: hidden;">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>

