Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
No it doesn't. Konqueror uses KHTML, but Safari uses WebKit. It's true that WebKit is a derivative of KHTML, but that doesn't guarantee consistency in rendering on the modern versions.
-
So the way you get out of (or rather recovering from) an economic crisis is spending a shitload of money? Cool. Send me some money and I'll help you.
-
The idea is that the entire infrastructure will focus on the content instead of the PDF file, which is just one representation of the content. So you move to a kind of higher abstraction level. I don't know if you're a programmer, or just an employee they sent out to do some research. I'll assume programmer. So in the database you may have some tables called "surveys", "questions" and "content" (and other tables that are irrelevant right now). There is a has many relationship between a survey and some questions (1:n), and there is a one-to-one relationship between a question and content object. The content objects would have an output strategy. This allows you to abstract the representation to an arbitrary format (assuming someone implemented a strategy for that format obviously). The kind of strategies we would have here is an HTML strategy for output in a browser, and a PDF strategy for exporting. Of course just one content object would not be sufficient for the entire PDF consultation paper, so you could make a composite content object that's simply a container of content objects. Because it's a composite it would be allowed to still use the strategies, but it can also itself allow for creation of e.g. a table of contents. The composite would then represent the survey in its entirety while the leafs represent a single question. This allows for a very flexible system that can have multiple output methods, and it allows you to represent the consultation paper either partially or in its entirety. It of course would require some staff retraining, but while the system might seem complex it shouldn't be complex from an end user perspective. References: http://en.wikipedia.org/wiki/Strategy_pattern http://en.wikipedia.org/wiki/Composite_pattern http://en.wikipedia.org/wiki/Object_composition
-
What you could do is to create a system where you enter the content into. From there you could export it as a PDF (dynamically create it) and send it out to people, or offer people to download it. During the survey you could also link to relevant pages that dynamically fetch the information that was entered into a database and show it. Doing that you focus on storing the raw content, which can be used for a variety of purposes in differing contexts. It would be technically easier to implement instead of having it all revolve around a PDF which was generated in some other way (e.g. via MS Word or whatever). Without knowing how you currently do, I also think it would be administratively easier.
-
I would expect that the required amount of work would be similar to if you had to show up physically. I know for instance Harvard offers distance education. Given their reputation I would expect it to be of reasonable quality.
-
Why not incorporate whatever is in the PDF into the survey system instead of keep focusing on the PDF?
-
Right, something like <?php $addresses = array( 'http://foo.com/something.php', 'http://example.com/helloWorld.py', ); $context = stream_context_create(array('http' => array('timeout' => 1))); $values = array(); $oldErrorReporting = error_reporting(0); // faster than using @ on each iteration foreach ($addresses as $address) { $var = file_get_contents($address, $context); } error_reporting($oldErrorReporting); If something takes over 1 second it will be skipped as per the timeout value.
-
No, you did <=, which is a binary operator that returns a boolean value. I did =>, which is quite different. You might want to read the Language Reference chapter in the manual. Again, saying "it doesn't work" really isn't of much help to me. Doesn't work can mean hundreds of different things. You need to tell me how it doesn't work, i.e., what did you expect and what happened instead?
-
$ctx = stream_context_create(array('http' => array('timeout' => 1))); You set it there, to whatever value you want. Ignore sleep(), that was for my testing purposes in a different script.
-
The sleep() I added in another file was just to make sure it took long enough for the file retrieval to timeout. It was to emulate high network latency.
-
Right, and that is possible. The timeout is a float. If the time spent on retrieving the resource is larger than that float value it will fail with a Warning as demonstrated in the example. Just set the timeout to the maximum acceptable time for you.
-
"Doesn't work" doesn't help me help you. It "works" for me. I have test2.php looking like this: <?php sleep(10); echo 'hi'; And another file looking like this: <?php $ctx = stream_context_create(array('http' => array('timeout' => 1))); $var= file_get_contents('http://localhost/test2.php', 0, $ctx); echo $var; Which results in As you would expect. If I set timeout to a value higher than 10 I'll get the 'hi' output.
-
That's because you defined your array incorrectly. <= is a comparison operator, so what you will have is a in the 'http' index is an array containing the boolean value of 'timeout' <lower than or equal to> 1. What you're looking for is: $ctx = stream_context_create(array('http' => array('timeout' => 1)));
-
Enforcing Referential Integrity with Business Objects
Daniel0 replied to JoeBuntu's topic in Application Design
It is designed exactly for that purpose. The error for integrity constraint violations has a particular error code. You can look it up, match with a potential error you get when you try and then give a nicer error message to the end user. -
It works for me. <?php $xml = <<<EOF <?xml version="1.0" encoding="utf-8"?> <!-- http://www.designvillain.com/vp/list1.xml --> <item> <list name="My name" videotitle="My title"> <thumb>1.jpg</thumb> </list> </item> EOF; $xml = simplexml_load_string($xml); foreach ($xml->list as $list) { echo $list['name']; } Outputs: My name Is that not the output you're looking for?
-
Yeah, just pass it a context resource specifying the timeout value (it's in the manual).
-
foreach ($xml->list as $list) { echo $list['name']; } Here it is implicitly cast as a string because it's used in a printing context, but if you need to do things like comparison you will have to do explicit casting.
-
Enforcing Referential Integrity with Business Objects
Daniel0 replied to JoeBuntu's topic in Application Design
Assuming you use MySQL, the easiest (and best) would be to use the InnoDB data storage type and FK constraints. http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html -
I hardly think this qualifies as a "drastic change" and I don't think it warrants a committee. You're free to make an attempt at creating smileys yourself though.
-
I say keep one of the sets only. What should :) then refer to? The SMF built-in or then one you made? What would be a logical code for the "normal" smiley besides :) ? I'm also thinking consistency here.
-
Sorry for undermining your authority, Ben, but... This has nothing to do with racism. You're being picked on because you've chosen to speak like an imbecile on purpose. It has nothing to do with ethnicity. Claiming racism when race was never mentioned is quite ridiculous. Okay, now I'm done
-
I can communicate quite quickly without sounding like a fool. And English is not my native language. Unless you're dyslexic, I see no reason why a native speaker couldn't do that either.
-
No, it takes longer time reading your posts when you use inconsistent and incorrect grammar, spelling, etc. People are accustomed to that English works in a particular way. If things are suddenly notably different they will have to stop and actively try to interpret the sentence instead of doing it subconsciously. Additionally, it makes you look like an imbecile and it is highly unprofessional. To be honest, my perception of you is that you're quite stupid. I figure you must be when you are an adult and claim English is your first language, but is unable to write a coherent sentence. Moreover, it's entirely irrelevant how many languages that exist and how many languages you speak. The only natural language that has any significance here is English.
-
I think you have a quite opposite view concerning progress than most other people do.
-
Uh... it took you 6 years to get a final product? No offense, but that's a damn long time. Do I have to wait 8 months for security patches as well?