Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. As far as MS is concerned I always run a little behind with their OS. I'll probably buy an OEM XP sometime soon.
  2. http://www.youtube.com/watch?v=kVVSmnnqfvc
  3. I used it in college.. The two biggest assignments were to program a queue in assembly and another to run these boards built by students from the computer engineering department.  We used a simulator, spimsal, to simulate MIPS instructions if I remember correctly.  The latter half of the course we programmed in HC11 for motorola processors; I still have my three HC11 books on my bookshelf. @redbullmarky, you are partially correct in your game development comment.  Most of what they do is in C or C++, but sometimes they have to take real control of the hardware. The other field where you'd probably still see some assembly is in real time systems.  Programmers for all our handy devices like coffee pots, alarm clocks, microwaves, pagers, cell phones, navigation systems, modems, routers, etc. still probably use it here and there.
  4. Self-taught most of C++ as a sophomore in high school.  Took a JC course in VB as a senior in high school, mostly to get extra credits and keep myself on task. Between those two languages, I had enough experience that I could recognize similar language concepts when they were thrown my way in college.  Officially, I learned C in college, but it's nothing I couldn't have learned on my own.  After all, recognizing and knowing the syntax is about 90% of learning a language.  Learning when to apply certain language constructs is another 9%.  The last 1% is discovering the more subtle things, such as the difference between: [code]int foo(const int *bar);[/code] and [code]int foo(int const *bar);[/code] Note that I said [i]learning a language[/i], I said nothing about learning how to program.  Most individuals, while learning a language, will also learn how to write basic to intermediate programs.  Almost all of them will not know how to do it efficiently, however, without previous experience or a mentor. When I entered college I knew how to write fairly complicated, although still basic, programs.  The valuable things I learned in college about programming are abstract data types, algorithm analysis, computer architecture, program design, how to write a compiler, how to build a CPU, etc.  Most of the concepts touched upon in those types of classes will remain unknown to a programmer until someone else tells them they exist. So for the poll I'd have to answer self-taught and went to college.  I would have gone far on my own without having ever gone to college, programming comes naturally and easy to me, but the introduction to foreign concepts in college has proved invaluable.  I may have come across and learned many of them in due time, but college accelerated the process. [quote author=obsidian link=topic=119164.msg539093#msg539093 date=1172508362] I have heard recently by one of the directors of an IT department of a state school nearby that the definition of a "good programmer" that they have held to for years is not how well they can code in C, C++, C#, Java, etc, but rather someone that knows the theories and design principles and can apply them to any language you throw at them. [/quote] I agree.  In addition, good programmers are natural problem solvers as well as inherently lazy.  Programming is nothing more than solving problems with a unique tool; so if someone is lacking in general problem solving strategies they will not a good programmer make.  As for the lazy, a good programmer has to be diligent in their methods and solving a particular problem can be hard work; but once you've written the solution you can sit back, relax, and relish the automated glory that is your creation.
  5. Maybe the original person(s) that implemented objects in PHP didn't want to deal with the added complexity of dealing with the problems myself and 448191 discussed above; or they didn't [i]know[/i] how to deal with them. Either way, they chose -> and the bottom line is no one has bothered to go back and implement a dot operator that does the same thing.  And why would anyone want to?  There's no [i]practical[/i] reason in this case to go back and implement a second operator that does the exact same thing as one that already exists.
  6. So I finally solved this with javascript. I initially sought after a pure CSS solution because I felt that was the better way to handle this, but came up rather dry. I contemplated displaying just the content area I'm trying to create as it's own page without any headers, footers, navigation, etc. but decided against it. Finally, the page is AJAX driven , so any users on this page will need to have JS enabled anyways. I kept my original CSS, as it works in standards-compliant browsers: .BidDetailsTbl { border: none; margin: 0px; } .BidDetailsTbl tr td { white-space: nowrap; border: inset 1px; margin: 2px; padding: 2px; padding-left: 10px; padding-right: 5px; } #BidPlans { /* The bid plans table */ float: left; margin-left: 5px; } #BidSubsContainer { /* The div that contains the sub bids table */ overflow: auto; margin-right: 5px; } #BidSubs { /* The sub bids table */ background-color: #ffffff; } This is the javascript that does the brunt of the work: // fixOverflowX // IE has the annoying habit of not obeying overflow properties and will instead // stretch container elements to fit the content. This function will set the // offending element's width to a fixed amount of pixels. In order to do so, // it requires the containing element and the offender // container - containing element, specified as id name or a DOM object // offender - offending element, specified as id name or a DOM object window.ieSucks.fixOverflowX = function(container, offender){ if(!this.isIE()){ return; // Don't waste time if this isn't IE } try{ container = htmlDOM.getElementById(container); offender = htmlDOM.getElementById(offender); if(!container || !offender){ return; // Not valid objects } // Save some properties of the offender offender.style.width = ""; // Clear the width so we get "true" dimensions var origOffsetLeft = offender.offsetLeft; var origOffsetWidth = offender.offsetWidth; var origMarginRight = container.clientWidth - offender.offsetLeft - offender.offsetWidth; // Now hide the offender so it stops distorting our page offender.style.display = "none"; // Determine if resizing is necessary var needed = origOffsetLeft + origOffsetWidth + origMarginRight; if( container.clientWidth >= needed ){ offender.style.display = ""; offender.style.overflow = ""; offender.style.overflowX = ""; return; // No resize } // If we're still here we need to resize var setWidth = container.clientWidth - origOffsetLeft - origMarginRight; offender.style.width = setWidth + "px"; offender.style.display = ""; // Determine if we need to turn on horizontal scrolling if(offender.scrollWidth > offender.clientWidth){ offender.style.overflowX = "scroll"; } }catch(e){ alert("Error: ieSucks: fixOverflowX"); } return; } Just in case someone runs into the same issue. (EDIT) Fixed 2 issues with JS function.
  7. I'm about ready to gouge my eyeballs out with this one. They say a picture is worth a thousand words so here's the layout working correctly within FF: Here is FF after the navigation menu has been collapsed: Here it is broken in IE: As you can see, IE mangles the Hell out of the navigation menu in addition to expanding past the page width (look at the header and footer). Here is the PHP that generates the tables: <div> <!-- Do the plan table --> <table id="BidPlans" class="BidDetailsTbl" cellpadding="0" cellspacing="0" border="0"> <tr><td>Plans</td></tr> <?php foreach($Plans as $Plan){ ?> <tr><td><?=$Plan?></td></tr> <?php } ?> </table> <!-- Do the Sub bids table --> <div id="BidSubsContainer"> <table id="BidSubs" class="BidDetailsTbl" cellpadding="0" cellspacing="0" border="0"> <?php foreach($TblRows as $Row){ ?> <tr><td><?=implode("</td><td>", $Row)?></td></tr> <?php } ?> </table> </div> </div> Here is the CSS: .BidDetailsTbl { border: none; margin: 0px; } .BidDetailsTbl tr td { white-space: nowrap; border: inset 1px; margin: 2px; padding: 2px; padding-left: 5px; padding-right: 5px; } #BidPlans { /* The bid plans table */ float: left; margin-left: 5px; } #BidSubsContainer { /* The div that contains the sub bids table */ overflow: scroll; } #BidSubs { /* The sub bids table */ background-color: #ffffff; } Now, I've broken the layout into two separate tables because I'd like people to always see which plans the dollar amounts are attached to. I've used white-space: nowrap for the table cells to guarantee the two tables are the same height. I don't think I can use any solution that relies on fixed widths. Doing so would make my life Hell due to the collapsible navigation menu and the fact that our clients can customize the CSS, so not everyone is necessarily using the same widths for the page, navigation area, and content area. Any tips or advice is greatly appreciated.
  8. Nice link ken. I wonder what percentage of that 14% are people who just re-installed their OS and are at their video card manufacturer's website downloading the proper drivers. Joking aside, 14% is higher than I expected. The site I program at work is contained within 800 pixels of width and it's sufficient for most of the site; after taking into account the left-side navigation menu there's about 600 pixels of content to work with. However, a new module I'm developing can potentially need more space so I added a bit of javascript to make the left-side menu collapsible. I'll amend my original statement to: If you really want to make your pages accessible to everyone, make sure the content can fit in an 800 pixel width area without needing constant horizontal scrolling from the user. (EDIT) Thinking about it a bit more, a new video card and monitor to support a higher resolution and still maintain readable text isn't all that expensive. So if your site is something like e-commerce, if your users are so tight in the wallet they won't shell out to upgrade their system, how likely are they to shell out for the products you're selling? And if they are that tight in the wallet, they'll buy from the cheapest, most trustworthy-appearing site, regardless of if it fits within their browser window or not.
  9. I'd add that second table. Build a scalable solution now and you can forget about it later. One of the tables from our <shudder> dbase server application at work has 100 additional columns, Plan1 through Plan50 and then sqft1 through sqft50. I look at it and honestly can't believe anyone ever set it up that way to begin with.
  10. I think for most content, especially with how widely used 19" or larger monitors are, 800x600 is really pushing the limits of what you can display at one time. It depends on how you laid it out, but having a vertical navigation menu and a vertical banner would give very little room for content. You have to look at the reason as to why anyone would size their browser window so small in the first place. Most of the time I think people use a small viewing window just so they can alt+tab as their boss walks by and avoid notice more easily. Similar situation for people in school. In that case, I think it'd be more appropriate to provide a layout or stylesheet that isn't so flashy so as not to catch attention.
  11. Actually if you look at the event handlers for the menu objects, you'll see code like: onmousedown="rteCommand('description', 'bold')" Tells me the iframe is being used as the editing body and all your magic is happening with javascript. I still couldn't tell you why you're getting extra \r\n in there though. I've ran into extra spacing using textareas, but I've never used an iframe or attempted any sort of rich editor, so I don't know what's causing your current issue. The last thing I can suggest is in your blank.html, change: <body> </body> to <body></body> You might get lucky!
  12. The iframe has this style: style="margin: 0pt; padding: 0pt; width: 100%; height: 200px;" So I believe it's set up to appear as a mock text input. It's also using the id and name: id="description" name="description" My guess is somewhere in the javascript is an onkeydown or onkeyup handler for the iframe.
  13. <?php $replaces = Array(); $replaces["\""] = "Quote"; $replaces["""] = "Quote"; $str = "Hello, "World!\""; echo $str . "<br />"; foreach($replaces as $find => $replace){ $str = str_replace($find, $replace, $str); } echo $str . "<br />"; ?>
  14. You can't even write a script to save a file to the user's machine. The closest you can get to that is giving them the option of Open or Save As to save information in a cookie.
  15. <iframe id="description" name="description" src="./blank.htm" style="margin: 0pt; padding: 0pt; width: 100%; height: 200px;" frameborder="0"></iframe> My guess is you want to look inside the file pointed at by the src attribute: src="./blank.htm"
  16. My guess is this code snippet: <!-- //build new richTextEditor var rte1 = new richTextEditor('description'); rte1.html = ''; rte1.toggleSrc = false; rte1.build(); //--> is building a textarea. You're obviously typing these comments into something and it doesn't make much logical sense for it to not be a textarea control. If you're using FF with the WebDeveloper plug-in, use the View Source -> View Generated Source after the page loads and paste that.
  17. Can you paste the HTML source when viewing the page in your browser? I have a feeling you have extra whitespace between your < textarea> and </ textarea> tags.
  18. http://www.phpfreaks.com/forums/index.php/topic,113143.0.html
  19. Turned out to be easier than I thought. In ajaxRun I changed: xmlHttp = GetXmlHttpObject(); to var xmlHttp = null; xmlHttp = GetXmlHttpObject(); and now it works.
  20. Ah I think I see the problem. In ajaxRun, the variable xmlHttp is a global variable so even though I'm storing a copy of it in the callback function, the xmlHttp.onreadystatechange is the real callback function and it just gets overwritten by the next call. Looks like I'll actually have to create multiple xmlHttp objects in an array or something.
  21. I came up semi-dry with google and the search feature built into these forums, so here goes. I'm finding that it would be quite convenient to be able to post multiple AJAX calls simultaneously, but having a bit of trouble with the implementation. I've created a function called ajaxRun that I use to make my AJAX calls. The relevant part of the function is where I process the parameter passXMLObj. // ajaxRun // url - server url to process // callback - javascript function to use as the callback // method - GET or POST // qs - the query string for GET, the post data for POST // noAsync - true to run non asynchronously // passXMLObj - pass the xmlobject to the callback function function ajaxRun(url, callback, method, qs, noAsync, passXMLObj){ if(!noAsync){ noAsync = false; } xmlHttp = GetXmlHttpObject(); if(xmlHttp == null){ alert("Your browser does not support AJAX!"); return; } url = clientURL() + url; if(method=="GET"){ url = url + "?" + qs; } // Check if we're passing the XML object to the callback function if(passXMLObj){ var cb = callback; callback = function(){ var xmlObj = xmlHttp; cb(xmlObj); return; } } // The magic happens next xmlHttp.open( method, url, !noAsync ); xmlHttp.onreadystatechange = callback; if(method=="POST"){ xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xmlHttp.send(qs); }else{ xmlHttp.send(null); } return; } I'm testing the code with the following script: window.ajaxPath_OptBid = "ajax/Builder/Subc/OptionsBidding/"; // cbSelPhasesReady // xmlObj - The xml http object // Called when the server responds with the new phases dropdown function cbSelPhasesReady(xmlObj){ if( xmlObj && xmlObj.readyState == 4){ if(xmlObj.status == 200){ var txt = xmlObj.responseText; alert(txt); } } return; } function cbTest(xmlObj){ if( xmlObj && xmlObj.readyState == 4){ if(xmlObj.status == 200){ var txt = xmlObj.responseText; alert(txt); } } return; } // getPhases // Called when it's time to refresh or retrieve the phase dropdown, usually // when the project drop down changes. function getPhases(){ var fields = new Array; fields[0] = document.getElementById("SelProject"); var qs = ajaxPrepareQS(fields); ajaxRun(window.ajaxPath_OptBid + "getSelPhases", cbSelPhasesReady, "POST", qs, false, true); ajaxRun(window.ajaxPath_OptBid + "test", cbSelPhasesReady, "POST", qs, false, true); return; } When getPhases runs I only see the alert from the cbTest, the second callback function. I thought creating an inline function in my ajaxRun would help me save the object for the callback, but it doesn't appear to be working. Any tips?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.