text = text.replace(/\.(?=[a-zA-Z0-9\[])/g, "<span style='background-color: #FF00FF'>.</span>");
I want to use javascript to highlight all full stops that is followed by letters, numbers and [. The above expression works for letters and numbers, but not bracket. Any idea what's wrong?
hi;
i need grab to internet explorer address bar. how to get address bar url for python ? (i need second part other browsers grabbing address bar but internet explorer is urgently).
Thanks.
Hello,
There is already a similar question(link).The thing is I don't understand what unit I have to delete.
I have installed the latest JCL library and added 'JclCompression' to the uses list in a unit and I get the error: "Unit JclCompression was compiled with a different version of sevenzip.IOutArchive".
Please explain to me in a simpler way how to resolve the problem.
Thanks in advance!
Ok so I have a problem with getline.
I have a file that contains a couple strings. I created it by myself and I have each string on a seperate line.
Ex. textfile.txt
Line 1
Line 2
Line 3
Line 4
//Little snip of code
ifstream inFile("textfile.txt");
getline(inFile, string1);
When I debug the program and ask it to print out string1 it shows that "Line 1\r" is saved into string1. I understand that it's from me actually hitting enter when I created the file. This problem causes my program to have a segmentation fault. I know my code works because if I use ofstream to write the file first and then i read it in, it works.
So for my quesiton, is their anyway to use the getline function without it picking up the escape sequence \r? If i am not clear just let me know.
I want to be able to attach the windows authentication token without having to include that piece of data on the messages themselves.
I've noticed that TransportMessage has Headers, but how do I get access to that before Send message to server?
Let's say I want to make a simple project tracking system. A manager can create a project. Then he can create tasks for that project. Team members can record the hours they work for each task or for the project as a whole.
Is the following design for the t_timesheet table a good idea?
timesheet_id - primary key, autoincrement
project_id - not null, foreign key constraint to t_project
task_id - nullable, foreign key constraint to t_task
user_id - not null, foreign key constraint to t_user
hours - decimal
Or should I do something like this:
timesheet_id - primary key, autoincrement
task_id - not null, foreign key constraint to t_task
user_id - not null, foreign key constraint to t_user
hours - decimal
In the second option, I intend to always have a record in t_task labelled "miscellaneous items" with a foreign key to the relevant t_project record. Then I'll be able to track all hours for a project that aren't for any particular task.
Are any of the ideas above good? What would be better?
Hi
I have a ol list:
<ol>
<li class="group1">item 1</li>
<li class="group1">item 2</li>
<li class="group2"> item 3</li>
<li class="group3">item 4</li>
<li class="group1">item 5</li>
<li class="group3"> item 6</li>
<ol>
and a set of checkboxes which correspond to the class names
<input type="checkbox" value="group1" />group 1
<input type="checkbox" value="group2" />group 2
<input type="checkbox" value="group3" />group 3
What I want to happen is that when a user clicks on a checkbox to 'tick' it, any li rows which are not checked are fadedOut (change opacity) and then any rows which have the class which matches the value of the checkbox are highlighter (background colour changed to yellow).
So for example if group 3 was clicked, item 4 and item 6 would be highlighted. Then if group 2 was clicked item 3 would be highlighted (item 4 and 6 would remain highlighted). If group 2 was un-ticked, item 3 would become faded out although item 4 and 6 would remain highlighted.
The code I have at the moment is:
$('input').click(function(){
input = $(this);
classVal = "." + input.val();
elements = $(classVal );
if (input.is(':checked')) {
elements.css("background-color", "#FFFF00");
} else {
elements.css("background-color", "");
}
});
This handles the highlighting but does not do the fading of the unchecked elements. I know I can change the opacity using css("opacity", 0.33) or fadeTo("slow", 0.33) but not sure how to handle this in the code and where to put it.
If any of my other code can be tidied up also please let me know
Thanks
I want to add a UISlider to my app programmatically without using the IB.
I am adding a UISlider to my UIViewController using the code below. However I don't see the slider when the view comes up. What am I missing? I am using iPhone SDK 3.1.2.
Appreciate any help.
@synthesize slider;
....
- (void)viewDidLoad {
...
...
slider = [[UISlider alloc] initWithFrame: CGRectMake(0, 480 - 80, 300, 20)];
slider.minimumValue = 0.0;
slider.maximumValue = 100.0;
slider.tag = 0;
slider.value = 50;
slider.continuous = YES;
slider.enabled = YES;
[slider addTarget:selfaction:@selector(handleSlider:)forControlEvents:UIControlEventValueChanged];
self.view addSubview:slider];
In the .h file
...
UISlider *slider;
...
@property (nonatomic, retain) UISlider *slider;
- (void) handleSlider:(id)sender;
Hi.
In my application the user can defines search-conditions. He can choose a column, set an operator (equals, like, greater than, less or equal than, etc.) and give in the value. After the user clicks on a button and the application should do a search on the database with the condition. I use NHibernate and ask me now, what is the efficientest way to do this with NHibernate.
Should I create a query with it like (Column=Name, Operator=Like, Value=%John%)
var a = session.CreateCriteria<Customer>();
a.Add(Restrictions.Like("Name", "%John%"));
return a.List<Customer>();
Or should I do this with HQL:
var q = session.CreateQuery("from Customer where " + where);
return q.List<Customer >();
Or is there a more bether solution?
Thanks for your help.
Best Regards, Thomas
I have the following code inside my ASP.NET MVC 4 razor view:
<div>
<span class="f">Old Tag</span>
@Html.TextBoxFor(model => model.olfTag, new { data_autocomplete_source = Url.Action("AutoComplete", "Home") })
@Html.ValidationMessageFor(model => model.olfTag)
</div>
But data_autocomplete_source with TextBoxFor will not work. Can anyone give me some advice?
Hello I have a string and when i try to use replace method in for loop it doesn't work
String phrase="hello friend";
String[] wordds=phrase.split(" ");
String newPhrase="sup friendhello weirdo";
for (int g=0;g<2;g++)
{
finalPhrase+=newPhrase.replace(wordds[g],"");}
}
System.out.println(finalPhrase)
It prints out "sup hello weirdo" and i expect it to print "sup weirdo".
What am i doing wrong?
I'm learning Java and I have no idea how to do this.
I dragged a button on the form in Netbeans, double clicked it and it created this event:
@Action
public void HelloClickMethod()
{
JOptionPane.showMessageDialog(this, "The message!", "This is supposed to be the MessageBox title.");
}
This is the exception the IDE brings up.
Cannot find symbol. Symbol: showMessageDialog()
Edit 1
Now I changed it to this:
@Action
public void HelloClickMethod()
{
JOptionPane.showMessageDialog(this, "The message!", "This is supposed to be the MessageBox title.",JOptionPane.ERROR_MESSAGE);
}
However the IDE is saying I have an error in the word 'this'. "Cannot find symbol". I don't understand. Why is it so dificult and why are the errors so esoteric. :P
Is there a way a Web site can learn something about your browsing activities outside of this Web site from an HTTP request sent to the Web site by your browser?
I have a User object, that is related to a Post object via two different association paths:
Post --(has_many)-- comments --(belongs to)-- writer (of type User)
Post --(belongs to)-- writer (of type User)
Say the following hold:
user1.name == "Bill"
post1.comments[1].writer == user1
post1.writer == user1
Now when I retrieve the post1 and its comments from the database and I update post1.comments[1].writer like so:
post1.comments[1].writer.name = "John"
I would expect post1.writer to equal "John" too. But it doesn't! It still equals "Bill".
So there seems to be some caching going on, but the kind I would not expect. I would expect Rails to be clever enough to load exactly one instance of the user with name "Bill"; instead is appears to load two individual ones: one for each association path.
Can someone explain how this works exactly and how I am to handle these types of situations the "Rails way"?
Using simplexml_load_string() how do I get "ForgotPassword" from the following XML?
<?xml version="1.0" encoding="utf-8"?>
<ForgotPassword>
<version>1.0</version>
<authentication>
<login>username</login>
<apikey>login</apikey>
</authentication>
<parameters>
<emailAddress>[email protected]</emailAddress>
</parameters>
</ForgotPassword>
A quartz scheduler is being used in an Application I am working on. A process that runs using the quartz scheduler spawns new threads. I was wondering if it is possible for these threads to continue living after the server is killed?
Hi
I have a form field which requires a json object as its value when it is rendered.
When the form is submitted it returns a comma seperated string of ids as its value (not a json string). however if the form does not validate i want to turn this string of ids back into a json string so it will display properly (is uses jquery to render the json object correctly).
how would i do this?
I was thinking of overwriting the form.clean method but when I tried to change self.data['fieldname'] I got the error 'This QueryDict instance is immutable'
and when i tried to change self.cleaned_data['fieldname'] it didn't make a difference to the value of the field.
Thanks
Hye Guys,
I'm busy working on a time series and am trying to find the commands that allow me to insert a quarter count variable. To keep things simple, the third quarter of 1995 (date my observations start) should be quarter -2, the fourth quarter of 1995 should be -1 etc etc uptill 2006 (should be somewhere around 45 by then). My dates are in date9 format, such as 20JUN04 etc..
Anyone who can help me with the commands I need t o let this work in SAS?
Thanks
I've checked my elisp files to make sure that I do not have any bindings that contain Shift+R (and I have not found any). I expect SHIFT+R to print an uppercase character, but instead I get R R undefined inside of the Emacs command line. This is only in C/C++ major modes.
Any suggestions?
Update: Describing the key shows that it is undefined. How would I define it for the normal, expected use (capitalizing the letter R)?
I am trying to compile a library originally written for Cocoa. Things are good until it looks for the function marg_setValue(). It says there is a syntax error before char in
marg_setValue(argumentList,argumentOffset,char,(char)lua_toboolean(state,luaArgument));
(it's talking about the third argument, not (char) )
I am trying to port LuaObjectiveCBridge to the iPhone. It has two choices, either using Runtime or Foundation. I have discovered there are some problems with foundation so I am trying runtime. But the compiler is not co-operating.
I'm working at the moment at a simple app in eclipse for android. Just receiving and sending data, and using the camera API.
I've set the minSDKversion to 8, because I think that has the widest user base. But at the beginning of the project eclipse was asking me which target SDK version I would use, and because I had just one installed (the latest 4.0.3) I've took this.
Now I'm asking me if it wouldn't be wiser to install a lower SDK, like Android 2.2, because it would be not that big (compared to the 4.0.3) and my app would not have included all the fancy new features, which are not used in any way?! Or is this complete nonsense I'm talking here, and just should take my 4.0.3 SDK? When not, how can I install a lower version? Help -> SDK Manager is not showing old SDKs...
I read an article around schema-less database which sounds cool. (http://bret.appspot.com/entry/how-friendfeed-uses-mysql)
But what isn't clear to me is how do they run search queries on this data? Since the data is in JSON format how do we look for it?
Hi there.
I'm currently busy working on an IP ban tool for the early versions of Call of Duty 1. (Apparently such a feature wasn't implemented in these versions).
I've finished a single threaded application but it won't perform well enough for multiple servers, which is why I am trying to implement threading.
Right now, each server has its own thread. I have a Networking class, which has a method; "GetStatus" -- this method is synchronized. This method uses a DatagramSocket to communicate with the server. Since this method is static and synchronized, I shouldn't get in trouble and receive a whole bunch of "Address already in use" exceptions.
However, I have a second method named "SendMessage". This method is supposed to send a message to the server. How can I make sure "SendMessage" cannot be invoked when there's already a thread running in "GetStatus", and the other way around? If I make both synchronized, I will still get in trouble if Thread A is opening a socket on Port 99999 and invoking "SendMessage" while Thread B is opening a socket on the same port and invoking "GetStatus"? (Game servers are usually hosted on the same ports)
I guess what I am really after is a way to make an entire class synchronized, so that only one method can be invoked and run at a time by a single thread.
Hope that what I am trying to accomplish/avoid is made clear in this text.
Any help is greatly appreciated.