-
Posts
80 -
Joined
-
Last visited
Never
Posts posted by sandeep529
-
-
However, Sandeep's outputs nothing as for now.
That seems strange, I have tested this and it was working. Can you tell how you tested?
I want to replace the area where the code tags were with <div class=stylearoundcode> and </div>This could be done by change the line in callback function from
return htmlentities($src[1]);
to
return "<div class='stylearoundcode'>".htmlentities($src[1]) ."</div>" ;
-
Hi,
I believe you want to replace the content inside the #code# tags to be replaced by its htmlentitied version. If this is so please try this
$stage1 = "This is the free version, here you are #code#<?php echo \"This is the code\"; echo \"<br/>\"; echo \"and some more code\"; ?>#/code#"; function callback($src) { return htmlentities($src[1]); } $stage1= preg_replace_callback("/#code#(.*)#\/code#/sm",'callback',$stage1); echo $stage1;
-
and what exactly did u mean by remove lines from the second block so that it becomes like the first block?
Point is to change the second block gradually so that at some point,( if it is due some code present in the second block that makes it work), it will stop working. at that point you can be some what sure that the last line you removed was the one that makes the code in the first block work.
what i don't understand now is what determines the order of execution?The ready methods are executed in the order they are bound. please see the threads
http://stackoverflow.com/questions/3934570/order-of-execution-of-jquery-document-ready
-
I don't really see it as being difficult. Must things get more difficult as you make them more flexible. if you wan't simplicity, you need to be willing to give up functionality.
That is not always true...right? Do you really think the CDATA(does it even support it?) and namespaces must be handled the way simplexml does now?
-
I'm not sure it's simplexml's fault that soap sux balls.
SOAP may be justified on the grounds of interoperability or something like that... But I cant think of any reason why SimpleXML is the way it is...
-
Hi,
I went through your code and found nothing wrong with it. I think this may have something to do with the order in with the document.ready methods are being executed. If I am right the ready methods execute in the order in which they are bound.
You can try somthing like as follows
Remove lines from the second block so that it becomes identical to the first block.
If it still does not work change the order of the blocks so that the second block is executed before the first block.
If it is still not working, we may have to use debugging tools like firebug for firefox to check what exactly is happening.
Good luck
-
I use the gvim with the following plugins
Tablistlite plugin:
http://www.vim.org/scripts/script.php?script_id=3680
This enables me to switch tabs lightning fast.
I have mapped the command to open the tablist window to F2 key. This enables me to switch between different tabs without even thinking as the tablist is sorted on the basis of last accessed tab so the key sequence <F2> <Enter> will switch between the current tab and the tab you were previously in. and also
<F2><Down arrow><Enter> => to 2nd last accessed tab
<F2><Down arrow><Down arrow><Enter> =>to 3rd last accessed tab And so on
functionlist.vim
http://www.vim.org/scripts/script.php?script_id=3681
This plugin opens window on the rhs that contains a list of function names detected in the current script. Function names are sorted alphabetically.
Press any key and the cursor moves to the function names atarting with that letter. Pressing enter on a function name moves the cursor to that function in the code window.
Just map the command to open the function list to some function key.
Nerdtree plugin
http://www.vim.org/scripts/script.php?script_id=1658
This opens a file browser window in the lhs of the current window. You can do basic file opertaions like opening,opening in a new tab, delete/move/add files from the pluggins window itself.
If you take some time to learn vim, then there is really no going back...So i think...)
regards,
Sandeep
-
hi all,
I was just wondering if anyone know who created the simplexml php library and why is it so complicated when using with namespaces and all...
This is a funny writeup with an example
http://blog.preinheimer.com/index.php?/archives/172-SimpleXML,-Namespaces-Hair-loss.html
So anyone has any idea who created this, and why it is the way it is...?
-
I am badly in need of some color suggestions.....can someone tell me some color combinations are eye catching?
-
Anyways, what should I put in the footer rather than my contact field?
I am not a design person..so I am not sure i will be of any help in this regard..but can you do something like the footer at http://www.mozilla.org/...
-
perhaps go a little more in depth with the actual tutorial, maybe explain what exactly the user is doing when they type what the tut tells them to.
The problem is I have blocked constructs like echo and print_r due to security reasons.
Now I have moved the statement input box to the top of the instructions so that I can have more contents in the instruction box.
Is it better now?
-
Hi..It looks pretty nice...but....
I just feel the colors are a bit dull and the footer graphics is kind of depressing..( lot of brown emptyness ..) .may be adding a couple of birds and may be a rising sun....I understand it is a matter of taste, so please feel free to ignore my comments.
and I also agree with a previous post that says contact form should be moved from footer...
-
overall, i like the idea. Just make it more user-friendly
Thing is, I dont have a clue...I have done all that i have noticed...I need some suggestions about how to make it more user friendly...
-
But I began to notice that some of my jQ codes wouldn't work at all when isolated in their own unique document ready method.
Are you sure your code in executing in correct scope..Any variable that is initialized inside a function using the var keyword will have a local scope. If a variable is initialized inside a function without var, or it is declared outside if a function, it will have a global scope...so the issue might be your code may be using some variables declared inside a certain function so when they are moved to another scope, the code can no longer access those variables and stop wonrking
Please post some code samples so that you may get an accurate response.....
-
I will..Thank you.
-
It would be nice to add a button to automatically enter the commands. I don't want to copy and paste it every time.
The point is to involve the user a little so that he becomes a bit familiar with its syntax.
-
can I have some feedback on the colors..? You said
could probably be a little more creative with the design
Can you please provide some directions? I am weak on the design side. :-\
Thanks.
-
What is the point of this website exactly?
The page is supposed to demonstrate the capabilities of a php class for manipulating xml strings. There is a field for entering php statements that uses the class. It is a type of self guided tutorial on using some functionality of the class. Instructions are shown in the gray box. Every instruction asks user to enter some statement into the input field. Upon pressing enter, That statement is evaluated via ajax and result is shown in the right box.
I need to know if you were able to figure out how to use the demo? Or should I make some changes in layout to make it more usable?
Thanks for trying....
-
Hi,
I need some testing/feedback about the design, color selections and effectiveness of this self guided demo.
http://crxml.pagodabox.com/demo.php
I am just wondering if people are able to use this demo.
Proof of ownership : http://crxml.pagodabox.com/phpfreaks.txt
regards,
Sandeep
-
The only problem is, it becomes difficult to tell if the array you have set for the 'bar' option defines default values 9as you posted) or is actually the default value for 'bar' itself.
Why not solve this by specifying the default value in the 'default' key . Ie
This defaults aray would become
$this->setDefaults([
'foo' => ['default'=>'foo' ],
'bar' => ['required'=>true],
'boo' => ['required'=>true,'type'=>'Something']
])
-
Hi,
Good design overall...
but I did not notice the little red button....
-
Hi,
I havent used traits yet to implement anything..so pls excuse any inexperience with it...but I was thinking if the options object is necessary.
I mean can its use be simplified as
class Foo { use Options; public function __construct(array $options = array()) { $this->setDefaults([ 'foo' => 'foo' , 'bar' => ['required'=>true], 'boo' => ['required'=>true,'type'=>'Something'] ]); $this->setOptions($options); } }
And in trait definition
private function setOptions(array $options) { foreach ($options as $key => $value) { if (isset($this->options[$key])) { //validate if the value passed in $options for $key is the type specified in $this->options[$key] } else { $this->options[$key] = $value; } } }
Regards,
Sandeep
-
It is still not clear..
But I think there is issue here
foreach ($row2[0] as $table_id) {
Becauese $row2[0] is not an array but the table name. So you dont need a foreach to get its value
Just the statment
$table_id = $row2[0];
will do .
so replace
foreach ($row2[0] as $table_id) { loop
with statement
$table_id = $row2[0];
and try...
-
hi guys,
I tried to install xdebug. It worked.
But I am not able to install KCachegrind....I am on a fedora 13 machine.
Cmake terminates with error....ERROR: cmake/modules/FindKDE4Internal.cmake not found in...
May be I am doing something stupid... But it goes to show why xdebug may not work for everyone....
Regex an output from a db
in Regex Help
Posted
You could create an anonymous function using create_functon so after using that and packing it into a function that your code will become