I do not want to change a string nor do I want to check if it contains white space. I want to check if the entire string is ONLY white space. What the best way to do that?
Are you an iPhone/iPad/Android programmer with a designer soul? If so we would like to hear from you.
Drop us your best work/portfolio and than we talk.
[email protected]
Cheers
T
Hello,
Let's consider that I want to extend an existing JSF component, such as the <rich:datatable/>. My main requirement is to dynamically modify the content of a <f:facet>, to change its content.
What is the best way to achieve that? Or where is the best place in the code to achieve that?
In my faces-config.xml, I have the following declaration:
<faces-config>
...
<component>
<component-type>my.component.dataTable</component-type>
<component-class>my.project.component.table.MyHtmlDataTable</component-class>
</component>
...
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
<component-family>org.richfaces.DataTable</component-family>
<renderer-type>my.renderkit.dataTable</renderer-type>
<renderer-class>my.project.component.table.MyDataTableRenderer</renderer-class>
</renderer>
...
Also, my my-project.taglib.xml file (as I use Facelets) looks like:
<facelet-taglib>
<namespace>http://my.project/jsf</namespace>
<tag>
<tag-name>dataTable</tag-name>
<component>
<component-type>my.component.dataTable</component-type>
<renderer-type>my.renderkit.dataTable</renderer-type>
</component>
</tag>
So as you can see, I have two classes in my project for my custom datatable: MyHtmlDataTable and MyDataTableRenderer.
One of my idea is to modify the content of the <f:facet> directly in the doEncodeBegin() method of my renderer. This is working (in fact almost working), but I don't really think that's the better place to achieve my modification.
What do you think?
Technical information: JSF 1.2, Facelets, Richfaces 3.3.2, Java 1.6
Hello, quick question. I am trying to use either javascript, jquery, or php to make it so when I click a link, it replaces a static image on my page with another image, for 15 seconds, then reverts back to the original image. What would be the best way to go about this?
Hi,
I have design problem regarding async calls to method.
I'd like to know best/good pattern to call async method, which calls another async method, which calls another async method :)
In other words, I have WCF service reference created with async methods and I want to call them from another async method which is called by other async method.
All this for non blocking GUI.
Thanks!
Hi,
I'm a newbie to ADO.Net Entity framework 4. I have a set of pocos which I need to map to a legacy database. The problem is that the db field names are different to the poco property names. eg. db field name = 'cusID' and poco property = 'CustomerID'.
What is the best way to map these?
In the case where Dictionary<object, object> myDictionary happens to contain a single item, what is the best way to retrieve the value object (if I don't care about the key) ?
if (myDictionary.Count == 1)
{
// Doesn't work
object obj = myDictionary.Values[0];
}
Thanks
What is the best having when implementing Memento pattern (for Undo/Redo)
in witch collection to Keep Mementos?
Basically, I need this(c = change, u = undo, r = redo):
0
*c
-1 0
*c
-2 -1 0
*c
-3 -2 -1 0
<u
-2 -1 0 1
*c
-3 -2 -1 0
Variants:
LinkedList - possible in principle, maybe not optimized.
Queue - not adapted for this task, IMO.
Stack - not adapted for undo AND redo;
Double Stack - maybe optimal, but can't control the undo maximum size.
What is the best way to send data and receive a response dependent on that data?
Consider the php file used for the request:
$test = $_POST['test'];
echo json_encode($test);
I have tried unsucessfully to achieve this with:
$.ajax({
type: "POST",
dataType: "json",
data: '{test : worked}',
url: 'ajax/getDude.php',
success: function(response) {
alert(response);
}
});
Hi there,
I have a script to handle http requests. I'm trying to think of some of the security issues I might have with it. My biggest concern at the moment is how I can manage multiple requests from the same source over and over. For instance someone trying to shut down my system.
Do I need to be concerned or will Apache handling this issue. If not what is the best approach to take using php?
Thanks,
Let's say I have programmers and artists working on a project. The artists have some folders they care about:
/Doodles
/Images/Jpgs
And maybe the programmers have a folder like this:
/Code/View/Jpgs
What is the best process in Mercurial to keep the 2 Jpgs folders synced? I have used Vault, where you can have 2 or more files/folders linked in a repository so updating one updates another. Is there a way to do the same thing with Mercurial?
What is the best way to query for something without using GORM in grails?
I have query that doesn't seem to fit in the GORM model, the query has a subquery and a computed field. I posted on stackoverflow already with no response so I decided to take a different approach. I want to query for something not using GORM within a grails application. Is there an easy way to get the connection and go through the result set?
i have three buttons what is the best way to disable button when clicked and make other two button enabled
<Button Name="initialzeButton"
Width="50"
Height="25"
Margin="460,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Click="initialzeButton_Click"
Content="Start"
Cursor="Hand" />
<Button Name="uninitialzeButton"
Width="50"
Height="25"
Margin="0,0,64,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="uninitialzeButton_Click"
Content="Stop"
Cursor="Hand" />
<Button Name="loadButton"
Width="50"
Height="25"
Margin="0,0,9,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="loadButton_Click"
Content="Load"
Cursor="Hand" />
I have a old computer , i want to buy a big LCD now the best i can found is Viewsonic's 24" lcd TFT monitor .
So will it run without any problems or i need to upgrade the video cards or something too ?
The computer is not that much old it has P4 bord and celeron processor with 128 graphics memory .
And in properties it shows i can maximum use 1280 x 1024 resolution.
I am noob hardware wise So need help on this stuff.
Thanks
I want to store some information about my rails application, like a version number. I am new to rails and I'm sure there is some sort of convention for doing this. What is the best method of doing this, maybe the environments file?
This is common interview question (according to some interview sites) but I can find no normal answers in Internet - some are wrong and some point to complex theory I expect not looked for in interview (like Bressenham algorithm).
The question is simple:
The circle equation is: x^2 + y^2 =
R^2. Given R, draw 0,0-centered circle
as best as possible without using any
floating point (no trigo, square roots, and so on, only integers)
Hi All,
I have a sharepoint site. This site large nubmer of site and sub site sollection in it. There are few that are created and are not in use. Now my questuion is how can I findout these old sites and before going deleting I have to first archive it.
Can any one tell me what is the best possible approach to do it?
I'm developing an app that requires the storage of Portuguese characters. I was wondering if I need to do any configuration to prepare my SQLite db to store those considered special characters. When I query a db table that contains those characters I get a '?' (without quotes) in their place.
best regards,
mp
I am considering using mediawiki for managing my personal information (code, and other "real life" data). And I would love any tips on how best to do so.
Thanks!
I have a bunch of methods like this in view helper
def background
"#e9eaec"
end
def footer_link_color
"#836448"
end
I'd like these methods exposed to the view, but I'd prefer the helper to be a bit more concise. What's the best way to turn a hash, say, into methods (or something else)?
Our database is filled with articles retrieved from RSS feeds. I was unsure of what data I would be getting, and how much filtering was already setup (WP-O-Matic Wordpress plugin using the SimplePie library). This plugin does some basic encoding before insertion using Wordpress's built in post insert function which also does some filtering. I've figured out most of the filters before insertion, but now I have whacko data that I need to remove.
This is an example of whacko data that I have data in one field which the content I want in the front, but this part removed which is at the end:
<img src="http://feeds.feedburner.com/~ff/SoundOnTheSound?i=xFxEpT2Add0:xFbIkwGc-fk:V_sGLiPBpWU" border="0"></img>
<img src="http://feeds.feedburner.com/~ff/SoundOnTheSound?d=qj6IDK7rITs" border="0"></img>
<img src="http://feeds.feedburner.com/~ff/SoundOnTheSound?i=xFxEpT2Add0:xFbIkwGc-fk:D7DqB2pKExk"
Notice how some of the images are escape and some aren't. I believe this has to do with the last part being cut off so as to be unrecognizable as an html tag, which then caused it to be html endcoded.
Another field has only this which is now filtered before insertion, but I have to get rid of the others:
<img src="http://farm3.static.flickr.com/2183/2289902369_1d95bcdb85.jpg" alt="post_img" width="80"
(all examples are on one line, but broken up for readability)
Question: What is the best way to work with the above escaped html (or portion of an html tag)?
I can do it in Perl, PHP, SQL, Ruby, and even Python. I believe Perl to be the best at text parsing, so that's why I used the Perl tag. And PHP times out on large database operations, so that's pretty much out unless I wanted to do batch processing and what not.
PS One of the nice things about using Wordpress's insert post function, is that if you use php's strip_tags function to strip out all html, insert post function will insert <p> at the paragraph points.
Let me know if there's anything more that I can answer.
Some article that didn't quite answer my questions.
(http://stackoverflow.com/questions/2016751/remove-text-from-within-a-database-text-field)
(http://stackoverflow.com/questions/462831/regular-expression-to-escape-html-ampersands-while-respecting-cdata)
Hi guys,
I have a table where fields are 40 varchars long, but from time to time I would have to store text ( 250-1000 characters long ) there. What would be the best solution, to try and fit it into the table or just make a separate text file associated with each table?
Thanks!
Hi
I am designing a remote CD/DVD burner to address hardware constraint on my Machine.
My design work like that :(Analogous to network paper printer)
Unix Based Machine (acts as server) hosts a burner.
Windows based machine acts as client.
Client prepare data to be burn and transfer it to server.
Server burn the data on CD/DVD.
My Question is :
.
Which is the best protocol to transfer data over network (Keeping same Directory hierarchy) between different OS