|
Seriously, though, a quick google for "php parse url" returns parse_url, which splits a URL into its component parts (scheme, hostname, etc). Try feeding https://www.example.com into that and find out if it returns a blank scheme, defaults to "http" or chokes. Then the correct way to do this (in fact, the correct thing to do even if you hadn't noticed a specific problem) is to use that function to split the url's into parts and then rebuild them into a canonical form.
JoeNotCharles fucked around with this message at 23:52 on Oct 29, 2008 |
# ¿ Oct 29, 2008 23:17 |
|
|
# ¿ May 14, 2024 15:59 |
|
Savings Clown posted:I'm trying to use the CFileDialog::GetFolderPath() function in C++ to return a string value containing a folder path (eg "C:/Documents") instead of a single file (eg "C:/Documents/results.csv"). What assert? I don't see any assert there, or any m_hWnd. Did you forget to paste half your sample code, or did you ask the wrong question?
|
# ¿ Nov 12, 2008 04:02 |
|
N.Z.'s Champion posted:This is probably a moronic question but there's someone I know who wants to migrate a REALBASIC project to something more modern (because they're having problems finding developers, libraries, community). Rather than starting from scratch I guess they should modularise their code as a library, perhaps exposing interfaces in COM or .Net? Trying to expose interfaces through COM directly will be more of a headache than just porting the whole thing, unless it was designed that way from the start. If Realbasic can target .NET, modularising to expose .NET interfaces and then do new development in Visual Basic is probably the way to go. Otherwise, I think you'll have to bite the bullet and port the whole thing to Visual Basic.
|
# ¿ Nov 14, 2008 07:22 |
|
floWenoL posted:In particular, the most parsimonious way to do this would be to use a producer-consumer queue with a threadpool. If you need strict FIFO behavior, then you simply have 1 thread in your threadpool. Ok, before involving threads and poo poo, step back and think about what you NEED. Yes, this function will take a while to run could fail in the middle for a variety of outside reasons. Does this matter? Is this to be run from a command-line utility? If so, just copy each file as it's given to you, abort with an error code (or throw an exception) if it fails, and die with an error message if any of them happen. Is this to be run from a GUI that needs to not freeze while the copy is happening? If so, you're going to need to use a thread (or fork off a subprocess) to do the copying. Now decide how much error handling you need (if you can pop open a progress bar, you just need "still going" or "it failed", otherwise you have to worry about the user triggering other actions while your file copy is going on in the background.) But there's no point in trying to design a complex threaded architecture to handle every possible case if you're not going to need it.
|
# ¿ Dec 1, 2008 22:47 |