KevinM1
Moderators-
Posts
5,222 -
Joined
-
Last visited
-
Days Won
26
Everything posted by KevinM1
-
I know of it, but haven't tried it. I know that MySpace is written in it, so that may or may not be an indictment of the technology. Hmm...maybe Microsoft is trying to get into the open source side of the market as well?
-
Yes I'm familiar with the C# 2008 express IDE, How is that game your making work? So it uses xna? I looked and it appears you need xbox or something, But I can't really tell. But its looks like you need pay money for it right? Well, my game is actually a web-based, ASP.NET game, so I'm not using XNA. XNA itself has two components. You can get the framework for free and install it into Visual C# 2008 Express/Visual Studio. There's nothing stopping you from working on a game right at this moment. In order to publish the game, and gain access to all of the online developer resources, you need to pay a license/subscription fee. And since the XNA project is aimed at people publishing Xbox 360 games, you'll need a console for testing purposes at the very least. I wouldn't be surprised if an Xbox Live Gold account was necessary, too. Expensive, but still cheaper than what publishing used to cost. If a few hundred people buy your game, the costs are essentially paid for.
-
Well, don't confuse the IDE for the language. C# is a full-fledged OOP language that's used to do everything from backend website programming to game programming (XNA and XBox Live's Indie Games). The IDE is as simple or as complex as you want to make it. I don't have the $$ for Visual Studio, so I use Visual Web Developer 2008 Express, and I use it almost entirely in code view, meaning I write out all my code (server controls and the C# code-behind). The only aid I get is real time intellisense, which is great as it shows you the objects and signatures of the methods you're trying to write. When you're dealing with the members of namespaces you're not entirely familiar with, it's nice to get real time feedback on the objects and methods available to you and what they do. Also, from what I've read, you can essentially write C++ code in C# if you decide to write what's known as 'unsafe' code in C# parlance. Don't take my word for it, though, as I haven't had the need to do it. I've attached an image of what the IDE and C# look like, just so you can get a real idea of what it is. Large image, so there will be H-scroll. [attachment deleted by admin]
-
I guess that explains why I've experienced so many slow websites with files ending in .aspx. Haha, probably. I'm wondering how the .NET CLR effects site performance. Is it all loaded/running in the background?
-
A few reasons: 1. ASP.NET is ridiculously easy for a designer to use. Drag server controls onto the design surface, play with some properties, and voila, you have a site. If my brother - who knows nothing of design, CSS, or even HTML - can create functional pages with it, then someone familiar with Photoshop will be very productive. What's more is that a lot of the things that would require a coder to function can be done in a few clicks. Have you looked at ASP.NET's data binding features? They're so simple to use, they'll make you want to cry. In a few clicks, you can have a table that displays records from the db, which can allow the user to sort them in a variety of ways, handle pagination, and even allow for in-place editing. All without writing a line of C#. Its calender control is even better. For common tasks, I can't think of a platform that allows as much productivity as ASP.NET does. That said, it can be difficult to bend ASP.NET to your design needs, depending on what you want to do. I'm currently trying to blend its built-in user profile functionality with some custom db tables that handle other info not directly tied to the user system. To say it's been difficult would be an understatement. 2. A lot of companies feel more at ease with having another company they can turn to if things go wrong. Open source is scary to a lot of people, even today. A common thing I hear from people on the business side of things is that going open source means working without a net. There's no ultimate authority to contact when things go wrong. Keep in mind that developers often don't have the final say on what platform a company will use. It's often the clients that have decided, for whatever reason, to go Microsoft or not. Look at it like this - your local small business owner probably won't care what kind of server is being used to host their site so long as they have a site out there somewhere. It's the medium-to-large businesses that have to weigh the costs of the various technical support available to them. The idea of a corporate entity standing behind the repair/maintenance work is comforting. 3. C# is a great language. VB is crap, but C# is very nice, and I wish PHP would lift its property mechanism wholesale.
-
How would you use the php in the same page as the form.
KevinM1 replied to k21chrono's topic in PHP Coding Help
Well, there are two things in play - a sticky form to display the numbers on the same page as the form, and attempting to process the form without a refresh. A sticky form would look something like: <?php if(isset($_POST['submit'])) { //invoke random number functions } ?> <!DOCTYPE html> <html> <head> <title>Random number generator</title> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="text1" value="<?php if(isset($result1)) { echo $result1; } ?>" /> <br /> <input type="text" name="text2" value="<?php if(isset($result2)) { echo $result2; } ?>" /> <br /> <br /> <input type="submit" name="submit" value="Click to calculate random numbers" /> </form> </body> </html> This will cause the page to refresh itself when the submit button is clicked. If you want the values to appear without any refresh at all, you'd need to use AJAX. Another option is to forgo PHP completely and use JavaScript only. But, since you asked this in the PHP Coding section, I figured you wanted to see your PHP options. -
From what I gather, FLEX is essentially a SDK for Flash apps. I think the term you want to lump together with Silverlight is Adobe AIR, which allows for Flash apps to run on the desktop. In terms of content management systems, many are built in PHP. So, yes, there's a future for PHP.
-
It hasn't been installed yet.
-
Even though this is clearly homework, which is against the rules to post, I'll give you a nudge in the right direction. Your logic isn't very efficient. It makes far more sense to tie the validation function to the input's onmouseover event, and leave the actual form submission to clicking the button instead of blindly sticking event handlers in your code. In fact, if you re-read the question in your assignment, that's exactly what it's telling you to do.
-
A few questions about different things (C#)
KevinM1 replied to HaLo2FrEeEk's topic in Other Programming Languages
From what I understand, a lot of .NET XML work is now done with LINQ-to-XML (XLINQ). I've played with retrieving data from an XML file and populating objects with that data through XLINQ, and it's pretty nice. It feels a lot like vanilla SQL, so it's pretty natural to write. Example (rough, since it's still a work in process): protected void Page_Load(object sender, EventArgs e) { List<Attack> charAttacks = (from a in XElement.Load(MapPath("CharacterClasses/Hacker.xml")).Element("Attacks").Elements("Attack") let se = a.Element("StatusEffect") select new Attack ( (string)a.Element("AttackName"), (int)a.Element("AttackLevel"), (int)a.Element("TPCost"), (double)a.Element("DMGModifier"), (double)a.Element("HitPenalty"), CreateStatusEffect(se) )).ToList(); } public StatusEffect CreateStatusEffect(XElement se) { if (se.Element("Type") != null) { StatusEffect result = (StatusEffect)Assembly.GetExecutingAssembly().CreateInstance(((string)se.Element("Type"))); result.Name = (string)se.Element("Name"); result.Duration = (int)se.Element("Duration"); result.Level = (int)se.Element("Level"); return result; } else { throw new Exception(); } } My XML file is: <?xml version="1.0" encoding="utf-8" ?> <CharacterClass> <Name>Hacker</Name> <InitialStats> <HP>10</HP> <TP>25</TP> <BaseDMG>2</BaseDMG> <BaseDefense>25</BaseDefense> </InitialStats> <LevelingStats> <HPMultiplier>2</HPMultiplier> <TPMultiplier>4</TPMultiplier> <BaseDMGMultiplier>2</BaseDMGMultiplier> <DefenseIncrease>5</DefenseIncrease> </LevelingStats> <Attacks> <Attack> <AttackName>Basic Attack</AttackName> <AttackLevel>1</AttackLevel> <TPCost>0</TPCost> <DMGModifier>1</DMGModifier> <HitPenalty>0</HitPenalty> <StatusEffect> <Type>null</Type> <Duration>0</Duration> <Level>0</Level> </StatusEffect> </Attack> </Attacks> </CharacterClass> So, the code loads the Hacker.xml file into memory, and performs a select query on each Attack element. It then builds a new Attack object from that returned data, and stuffs it in the List. The hardest part was getting a hold of the embedded Status Effect info. Those, too, are objects, because they are applied both through attacks and items. I'm still trying to figure out how to handle those attacks and items that shouldn't have Status Effects, but that's not really important for this topic. -
When you're disabled, can't get out of bed, bored out of your mind, and none of the games installed on your machine interest you at the moment, the web browser is a godsend. Most of my posts here after 10PM EST come from my PS3. Tedious, sure, but better than tossing and turning with insomnia.
-
Nope. Trim just removes extra whitespace from a string (see: trim). What you're looking for is htmlentities. Don't do your development work on the same server as where your live site is. You should have an environment for site development, and one for where the final produced site resides.
-
Never put your real db credentials in a post. Beyond that, a couple of things: 1. You're not forming your URL correctly. It should look like: http://www.amejjaou.com/informatica/dvdonline/zoektest.php?name=The%20Shawshank%20Redemption - note that there ISN'T a '/' after '.php'. 2. You can't assume that your script will be getting data passed into it via GET, nor can you assume that data will be safe or legit. You need to filter it. if(isset($_GET['name'])) { //test to see if the data is valid. If so, access the db } else { //no value sent } 3. You don't have an opening <body> tag.
-
Rule #1 of PHP Freaks: Don't talk about PHP Freaks. Rule #2 of PHP Freaks: Show your code.
-
Sounds pretty nasty. How are discrimination laws over in The States? Here in the UK, it seems things have swung the other way a little; it seems to be quite common now for job averts to promise to interview any and all people with a disability for fear of appearing discriminatory. Now, im not being funny, but would they really interview you if you applied to be a brain surgeon, just because you had a disability? Well, discrimination can be hard to nail down when someone is in the kind of situation I'm in. It's often hard to determine if you're turned down merely because they don't want to 'deal' with someone in a wheelchair, or if the extra baggage my life requires to work (aides and their (lack of) flexibility, transportation needs, etc) makes it difficult to impossible to handle some of the job requirements (overtime, going elsewhere to meet with clients, etc). Add to it our current unemployment rate (10% and climbing) and I need to make myself the most attractive potential employee possible, not only to beat out the others looking for a job, but to overcome whatever hesitation an employer may have in hiring someone in a wheelchair. And, I mean, no one would consider me for something like a surgeon, or a warehouse worker stocking shelves or anything like that. Those kind of jobs are obviously impossible for me to do. But a lot of employers don't think about things like, hey, I'm screwed if my aide is sick and can't drive me into work. And, how would food prep work for me for lunch? Would my aide be allowed to come in and help me? What about a phone? I can't lift a receiver to my ear, nor can I tap a headset's 'talk' button. Would a speaker phone be too distracting? Would working from home be a viable option? Now, I'm not saying that these kind of logistical problems can't be worked out. If I thought that, I wouldn't even be trying to increase my knowledge and add to my skill. What I am saying is that I need to make myself so attractive to an employer that dealing with those issues is a small price to pay for the overall value I bring to the table. I'm not there yet, especially when it comes to .NET, but I'm getting closer.
-
Without seeing where $id comes from or what element has an id of 'advertisement', I'm guessing it has something to do with you never actually using the id you pass to the event handler.
-
How about After Effects? Used it for my brother's wedding reception. Great program.
-
Need some help in the right direction...
KevinM1 replied to dhmallette's topic in Application Design
Short answer: In your books, look for a chapter titled something along the lines of "Group Membership", "Role Management", "User Management System", "Managing User Groups", or something along those lines. Longer answer: You'll need to design two main things: 1. Login system 2. User management system The login system should be fairly trivial to come up with. You store user credentials in the db. If the submitted info matches what's in the db, that person is logged in. The user management system is more complicated, and its design relies on the realities of what you need the system to do as a whole. So, there's no standard solution you can plug into your site. To start you thinking about the design, are any of the sub-contractors part of a certain group? Should they be? Or do they need to be all treated individually? -
This. I like OSX, but Apple hardware is way too expensive, and I hate that the one-button mouse is still the default. When I finally get my new laptop (yay early Christmas present!), I'll probably turn it into a dual-boot Win7/Ubuntu machine. Windows for my .NET stuff, Adobe stuff, and gaming, Ubuntu for my open source stuff. Best of both worlds, baby!
-
To shamelessly copy Zane, and since other past and present badged members are creating threads, I figured I might as well update my introduction (originally found here: http://www.phpfreaks.com/forums/index.php/topic,112560.msg458113.html#msg458113). I don't want to be left out! Most of what originally wrote still applies. The job I mentioned back in 2006/2007 came and went. It wasn't what it was cracked up to be, and I didn't really learn anything. It was mismanaged to the ground by my boss/the owner. Oh well. I've had some freelance gigs come and go, but nothing substantial. I live in a .NET part of the country, so I'm teaching myself the relevant languages. Unfortunately, the recession hit somewhat hard here, and I face an uphill battle with employment anyway because of my disability (who's more likely to get hired: the guy who relies on other people for transportation, or the guy who can drop everything and work overtime if necessary?). Still, I'm working at it. My big .NET project, which I'm using for non-portfolio educational purposes only, is a game (surprise surprise). It's been a PITA thus far - there have been a ton of little details that tripped me up - but rewarding at the same time. I think I've learned more about programming in general in the last 8 months or so than I had in the last 8 years. So, yeah, still plugging away, and procrastinating on having to touch my db again.
-
You need to give the table cell you want to change the background of an id, so something like: <td id="tshirt">stuff</td> Next, move your changebackground function code all the way to the end of your HTML, after the closing </body> tag, and before the closing </html> tag. In that space, scrap what you have and write the following: <script type="text/javascript"> function changebackground(color) { var tshirt = document.getElementById('tshirt') switch(color) { case 1: tshirt.style.backgroundColor = "#1129DB"; break; case 2: tshirt.style.backgroundColor = "#312D2E"; break; case 3: tshirt.style.backgroundColor = "#FFFFFF"; break; case 4: tshirt.style.backgroundColor = "15AA35"; break; case 5: default: tshirt.style.backgroundColor = "DB1111"; } } </script> This should work, but as I have written in my signature, it's not tested.
-
Can you show us all your code as it stands now?
-
Do you grab a hold of the tshirt element before attempting to change its background color? JavaScript can't auto-detect normal, non-form elements.
-
1. Why are you passing the form to the function when you don't use that information? 2. You use the same id - picimages - twice. This is wrong. An id is supposed to be unique, meaning only one id per element per page. 3. You have to check to see if a button has been clicked. 4. An unobtrusive style would serve you well: <form action="" name="myform" method="post"> <input type="hidden" name="picimages" value="<?php echo $resultsetstory['bigger_id']; ?>" /> <p> <label> <input type="radio" name="picimages" value="<?php echo $resultsetstory['picture_id']; ?>" /> <?php if($resultsetstory['title']<>""){ echo $resultsetstory['title']; }else{ echo "Image 1"; } ?> </label> <br /> <label> <input type="radio" id="picimages" name="picimages" value="<?php echo $resultsetpic2['picture_id']; ?>" /> <?php if($resultsetpic2['title']<>""){ echo $resultsetpic2['title']; }else{ echo "Image 2"; } ?> </label> <br /> <input name="submit" id="submit" type="button" value="Vote!" /> </p> </form> <!-- after all your HTML is output --> </body> <script type="text/javascript"> var button = document.getElementById('submit'); button.onclick = function() { var radios = document.forms["myform"].elements["picimages"]; var radiosLength = radios.length; var chosen = ''; for(var i = 0; i < radiosLength; ++i) { if(radios[i].checked == true) { chosen = radios[i].value; } } if(chosen){ var postStr = "picimage=" + chosen + "&bigger_id=" + encodeURI(document.getElementById('bigger_id').value); alert(postStr); makePOSTrequest('voteresults.php', postStr); } else { //error } } </script>
-
Instead of echoing out the HTML, exit PHP to display it, like so: <?php if(!isset($_POST['submit')) { ?> <html> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="first" /> <br /> <input type="submit" name="submit" value="Go" /> </form> </body> </html> <?php } //<-- end if else { $name = $_POST['first']; echo "Your name is: $name<br /><a href='welcome.html'>Welcome Home</a>"; } ?> It might make it easier to debug this way.