Jump to content

boen_robot

Members
  • Posts

    8,493
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by boen_robot

  1. It was a polite way of asking if you're spamming... You know those SPAM schemes where they say "Hey, I'm a Nigerian prince, and I'm about to move to another country because of riots. I need your assistance. Give me your bank account and PIN, so that I can deposit all my fortune, and come back to collect it later if I make it safely across the border. I'll leave you some for your assistance".
  2. How should the JSON look like? I mean, there isn't a 1:1 mapping between them, so...I'll assume you want every element name to be a JSON name, and every text() node to be a JSON value. In that case, the following should work: <xsl:template match="*"> <xsl:if test="not(preceding-sibling::*)">{</xsl:if>"<xsl:value-of select="local-name()"/>": <xsl:apply-templates/> <xsl:choose> <xsl:when test="following-sibling::*">,</xsl:when> <xsl:otherwise>}</xsl:otherwise> </xsl:choose> </xsl:template> However, you may have to remove the XML prolog at the start of attribute3, as some XML parsers don't allow this.
  3. If what you're trying to do is an assembly emulator, I have proof this isn't THAT hard in JavaScript.Here is a tiny JS Assembly emulator I whipped up in the last 2 hours. It has a command set that's beyond useless, but the framework for supporting other assembly instructions is already there. AND it works perfectly with hex and decimal numbers alike.
  4. One way is to "tag" the latest tag into a new one, and then commit any changes over that new tag. With this approach, you must also remember to fix the trunk though (which you can do in a single commit if the fix is trivial enough). Depends on how do you originally restructured the trunk. If you just created two folders, moved stuff appropriately into them (without SVN commands), and committed, doing the same thing again should work.
  5. The whole point of tags is for them to reflect the different "live" versions, while the trunk is supposed to reflect the development version. Your first error has been trying to restructure the trunk.Create a new tag for the "live" live version, and restructure the trunk back to the old structure (for it to be development only).BTW, it sounds like you may be in need of switching to Git or another distributed VCS. With them, you can have multiple repositories that sync to each other on demand, so you could have a "live" repo syncing with a "dev" repo only when you're ready with something. You can copy and edit the "live" repo when there's a serious issue, and merge back with the "dev" one afterwards. In addition to that, Git's "submodule" feature (basically, the ability of making a shortcut to one repo to within another repo) could help with modularity.
  6. No. The two echoes are there only for illustration purposes. How else do you distinguish a delay caused by sleep() vs. a delay caused by a slow script?
  7. First, adjust your copy-of template to only do this for attributes and text nodes, like: <xsl:template match="text() | @*"><xsl:copy-of select="." /></xsl:template> Then create a new template that copies elements, but also applies inner templates, like: <xsl:template match="*"><xsl:copy> <xsl:apply-templates/></xsl:copy></xsl:template> Once you do that, you should be able to have the template: <xsl:template match="CAEXFile/InstanceHierarchy/InternalElement/InternalElement"> <xsl:attribute name="FurtherInformation">ConstantValue</xsl:attribute></xsl:template> and have it work too.
  8. boen_robot

    Cloud Server

    You mean what questions you should ask to your "cloud" provider? He's not really a cloud provider, and therefore not a CDN, so there's nothing to ask.A CDN is a separate service that could be used alongside traditional hosting, but is never bundled (if it is bundled, we're probably talking about a cloud). See Wikipedia's article on CDNs for a list of some CDN providers.CDNs typically don't disclose their number of locations, because they all know long time CDN providers like Akamai will beat them on that criteria. Downtimes are rarely, if ever, discussed, because a CDN can claim that your site will always be on. They can indeed say this honestly (unlike hosting providers, which are forced to compete for the number of nines behind the decimal point), except that "always on" doesn't tell you from how many locations. For all you know, they could have times where there's only 1 server in China... your site is still on, but speed is a different matter, which depends on the number and availability of nodes, neither of which is disclosed.But assuming that you're looking at actual CDN providers... whether they allow you to use your DNS names is also an interesting thing. If they don't, you'll have to link your static resources from odd domain names, like "client13947.provider.com". The ability to use your own DNS name with the CDN is typically something you need to pay extra for.
  9. See sleep() in the PHP manual Have you actually tried this? I'm pretty sure it isn't going to work.[[Testing...]]Yep. Doesn't work. Error 500 due to exceeded timeout. Reducing the timeout to something more reasonable, like 1 second doesn't work either. Depending on how you have your output buffering settings, one of two things happens:1. Redirect after the sleep, without the message ever being visible. This happens when output buffering is on, and since headers are sent before any content, the browser decides to ignore the content and redirect, just as it does normally with redirects.2. The message is visible, and no redirect occurs. This happens when output buffering is off, and since after the echo, the headers are already sent, there's no way for PHP to ask the browser for a redirect.
  10. boen_robot

    Cloud Server

    The spread-ness (if that's even a word) is more important, i.e. the more diverse kinds of locations the different servers are in.A CDN that has servers in only 2 locations, both of which are 99.9999% available is a worse option than a CDN with servers in 20 locations that are overall 98.0% available.
  11. ... And you can learn the basics of those from the tutorials at W3Schools. It's easy once you do know the basics.
  12. Use the Refresh header. It starts with a timeout, and can optionally take a different URL to redirect to, e.g. header('Refresh: 2; url=http://google.com'); will redirect to google.com after 2 seconds.
  13. Right, and as CodeName said (rather cryptically), you can store an apostrophe in an attribute by replacing it with ' or (for the sake of portability... long story...) ' Alternatively, if your attributes use double quotes, you can have double quotes inside the attribute by replacing them with " In PHP, you have a convinient function for that called htmlspecialchars(), and you can use it like for example: echo '<input name="topic_page" value="' . htmlspecialchars($_POST['topic_page']) . '" />';
  14. boen_robot

    Visitor IP

    No. They are not the same. ... And a proxy is a client. ... And ANY header (standard or non standard) can be spoofed or not present at all. It's up to the client (and... say it with me... "a proxy is a client") to decide if and what it should send.If all that sounds like a mouthful, here's another way to sum it up:- $_SERVER['REMOTE_ADDR'] - Always present. Always the IP that contacted your server.- $_SERVER['HTTP_X_FORWARDED'] - May or may not be present. Sometimes it is the IP of an end user.
  15. boen_robot

    Visitor IP

    Birbal did answer your question... let me sum it up for you... No. No.
  16. boen_robot

    CHOSING STRINGS

    You just chained a bunch of technical terms that make no sense together? What gives?
  17. boen_robot

    Cloud Server

    I think this is the very definition of a Virtual Private Server - the very thing I mentioned in my first post.It's a nice offer, and indeed, it's useful for learning... but it's not a cloud. Your provider has tried to use the term in order to mislead ignorant new comers. It's a marketing plot if you will.
  18. boen_robot

    Cloud Server

    A CDN (Content Delivery Network) is a collection of web servers for delivering static content (images, stylesheets, etc.) distributed at different locations over the globe.When a server is closer to a client (in terms of network hops that is, but those are typically tied to a geographical distance), the speed is noticeably faster from the user's point of view.A good cloud provider SHOULD basically work like a CDN that can serve static and dynamic content alike.
  19. boen_robot

    Cloud Server

    What is that supposed to mean? The big selling point is a big reduction on the "Total cost of ownership". What this means is that getting a single cloud account with several dynamically delegated servers is far cheaper than buying the equivalent amount of constantly dedicated web servers, and a CDN.A single web host with no CDN is still a cheaper option than a cloud, although less powerful => unsuitable for massive scale sites, but still good for small, medium, and (if the user base is not constantly at the site) even some large sites.
  20. boen_robot

    Cloud Server

    Are you sure they're talking about a cloud? Sounds more like a virtual private server - you get one of a few virtual machines running on a single real server.A cloud is supposed to be more like a cross between a web host and CDN - you buy one or more hardware units with software you want to have on each, and the provider takes care to keep them all in sync, and give you any additional resources you want pretty much immediately on demand or (if you've asked for it) automatically give you resources as needed up to a certain limit you're willing to pay.The issues with a virtual machine are the same ones as a real server - it's a single server. It can only handle up to a few thousand simultaneous requests, which actually isn't that bad, unless maybe you're making the next YouTube or a "self service" site for a public institution that has very strict, yet short deadlines.The issues with a cloud are mostly financial ones, because you're not just paying for the bandwidth and a fixed monthly fee, but also for the delegated resources, which can go higher than in a normal hosting.
  21. In terms of popularity - SVN for centralized, Git for decentralized. Those are also the only two I've used. I've also heard nothing but good things about Mercurial, but haven't used it myself, and it's less popular than Git.
  22. A "real" VCS has a lot of other features, which I don't mention, because they differ from one VCS to the next. Most have "tags" (a specifically targeted snapshot; typically a public release of the software), SVN has the ability to automatically replace a targeted text with an SVN revision, allowing easier tracking of pre-release versions, Git differentiates an author from the one who made the commit, allowing easier tracking of contributions from external parties, etc.Even if you do manage to create all the features, using PHP and MySQL to manage the files would be far less efficient, since items pass over HTTP, the PHP/MySQL codes, and then the PHP and MySQL engines, unlike normal VCS where things go from HTTP directly to the engine.Creating a basic VCS using a compiled desktop language (C/C++), without any networking abilities isn't that hard if you can convince yourself to pass through the VCS for everything, and don't mind it being a little slow. It's the rest (efficiency, networking, etc.) that's harder, especially any stuff that the VCS is supposed to detect without you consulting with it.
  23. If you're going to talk about a server machine that you already have - no. Keep it here.if you're going to talk about recommendations for what server machine you should buy - yes, you should start a new topic... although a general guideline is to disregard the video card, buy as much CPU and RAM as you can afford, and get an ISP with higher upload speeds (even if the download is low). If you have something more specific in mind, start a topic.
  24. At all places, I have Windows. Windows 7 at home and work, Windows Server 2008 R2 at my server. The server itself is also sometimes acting as my development machine, thanks to the fact it's not under a heavy load.I use IIS 7.5 on the server, Apache 2.2 at home. PHP 5.3.8 and the latest GA release of MySQL on the server and at home. I plan to upgrade Apache and PHP when all extensions I use have binaries distributed, and I'm currently missing my most beloved one - the HTTP extension.In terms of hardware, I have 3GB RAM and 1TB HDD on all computers, Intel Dual Core E5200 2.5GHz and NVidia G-Force 9600GT at home, Intel Dual Core E2200 2.2GHz and an Intel video card (on the motherboard) on the server. I don't remember the exact motherboards (and seeing them without actually opening the computer isn't exactly trivial), but I think they were all by Gigabyte. 1Gbs LAN cards on all motherboards, although at home, I use a separate 100MBps one, because my motherboard's LAN got fried by an electrical surge (which is a semi-frequent event around here). Not that this is in any way relevant, since our ISP at work offers 100MBps, less at the server, and even less at home.At work, we resell the internet, which why it's the highest there. The server has pretty much the download as I have at home, but a significantly better upload.
  25. boen_robot

    passwords as...

    To define a foreign key constraint on a column, you must define a column where the values must come from (a "reference" column). It is from this characteristic that the value set is known => the foreign key's index will be created in a fashion compatible with the referenced column's index. Of course, if the referenced column is not indexed, the foreign key's index will be a completely new and independent one, and thus it will still have the JOIN penalty.
×
×
  • Create New...