how to delete space between two words using c programme... should I use ascii or just compair with ''?
eg. Input- "Hello World" Output-"HelloWorld".
Thanks,
Vikram
I have a table, where i have a click event on the tr:
<tr id="<%= candidate.AnsogerID %>" class="newCandidatesTableTr">
, this click event:
$(".newCandidatesTableTr").click(function(e) {
works just fine, but in the row i also have a click event on a td:
$(".insertCandidate").live("click", (function(e) {
and this conflicts eachother. I want to do one thing if the tr is clicked and other when this specific td in the tr is clicked. So how do i in my tr.click() event defined that the event shall not happend when i click the specific td?
Here is the code:
// Lists a table with old candidates who migth be the same person as the new candidate
$(".newCandidatesTableTr").click(function(e) {
alert(this.id);
GetCandidateName(this.id);
});
// Show insert candidate dialog
$(".insertCandidate").live("click", (function(e) {
var tempCanName = $(".suggentionCandidatesTableTitle").text();
var tempCanNameSub = tempCanName.substr(0, tempCanName.length - 1);
var canName = $(".suggentionCandidateName_" + canID + "").text();
$("#mergeCandidateDialog").empty();
$.blockUI({ message: $("#mergeCandidateDialog").append(
"<div>" + tempCanNameSub + "'s ansøgning vil blive lagt under den eksiterende ansøger " + canName + "'s data.<br /><br /> Ønsker du at fortsætte?<br /><br /></div>" +
"<div id=\"content\">" +
"<input type=\"button\" id=\"" + this.id + "\" class=\"insertCandidateYes\" value=\"Ja\" />" +
"<input type=\"button\" id=\"insertCandidateNo\" value=\"Nej\" /></div>"), css: { cursor: 'default', fontWeight: 'normal', padding: '7px', textAlign: 'left' }
});
}));
<% foreach (var candidate in Model.Ansogninger)
{
%>
<tr id="<%= candidate.AnsogerID %>" class="newCandidatesTableTr">
<td><div id="candidateID""><label title="<%= candidate.Navn %>"><%= candidate.AnsogerID %></label></div></td>
<td><div id="<%= "candidateName_" + candidate.AnsogerID %>" class="candidateNameTD"><%= candidate.Navn %></div></td>
<td><div id="candidateEmail"><%= candidate.Email %></div></td>
<td><div id="candidateRundeName"><%= Model.RundeName %></div></td>
<td id="testTD">
<div id="<%= "acceptCandidateButton_" + candidate.AnsogerID %>" class="acceptb">Godkend</div>
</td>
</tr>
<%
} %>
The default Cassandra systems keyspace system is present in all Cassandra installations.
Judging from the output of the describe keyspace command the keyspace it is used partly for "persistent metadata for the local node" (LocationInfo) and partly for "hinted handoff data".
What persistent metadata for the local node is stored in system/LocationInfo?
What is the definition of hinted handoff in Cassandra terminology?
What hinted handoff data is stored in the system keyspace?
Hi,
I am wondering if there is a tool or technique which, given a BNF grammar, adjusts it randomly(but intelligently) and generates a stream of output for use in detecting cases that slip past the BNF (but shouldn't).
Thanks
Today's browsers (or HTML < 5) only support HTTP GET and POST, but to communicate RESTful one need PUT and DELETE too. If the workaround should not be to use Ajax, something like a hidden form field is required to overwrite the actual HTTP method.
Rails uses the following trick:
<input name="_method" type="hidden" value="put" />
Is there a possibility to do something similar with JAX-RS?
I'm using CodeSmith on my current project and I'm trying to figure out an issue. For my CodeSmith project (.csp) I can select an option to have it automatically add all generated files to the current project (.csproj). But I want to be able to add the output to multiple projects (.csproj). Is there an option inside of CodeSmith to allow this? Or is there a good way to programmatically do that?
Thanks.
I have a class which loads an xml file using the following:
Path.Combine( AppDomain.CurrentDomain.BaseDirectory, "Xml", documentName );
The documents that are being loaded are set to copy to the output directory. However, when I run mstest the xml file is not being copied to the BaseDirectory.
Does anyone have any idea how I can accomplish this?
Hey guys,
I am working on a date parser in Java. Just wanted some information on if there is any java library which could parse special occasions like for example if I give input as: Christmas or new year, it returns a date for this.
Thanks in advance.
Regards,
Pranav
If my project name is ABC and the DLL currently outputs as ABC.DLL, how can I make my DLL be outputted as say CBA.DLL and so that when the .LIB is compiled linked against, it is not looking for ABC.DLL, but CBA.DLL. I tried changing the name under Linker General Output File but when I linked to the .lib in my other application, it was still looking for ABC.DLL and CBA.DLL.
This is how I'd like to write markup in say index.html.erb
<%= page_for "Super Cool Page" do |p| %>
<%= p.header do %>
Ruby is Cool
<% end %>
<%= p.body do %>
Witty discourse on Ruby.
<% end %>
<% if page.has_sidebar? %>
<%= p.sidebar do %>
<ul><li>Option 1</li></ul>
<% end %>
<% end %>
<% end %>
Which would output
<div class="page">
<header><h1>Super Cool Page</h1></header>
<section>
Witty discourse on Ruby.
</section>
</div>
and when page.has_sidebar? is true
<div class="page">
<header><h1>Super Cool Page</h1></header>
<asside><ul><li>Option 1</li></ul></asside>
<section>
Witty discourse on Ruby.
</section>
</div>
I've taken a look at the FormHelper class in rails for guidance, but it seems like I'd have to duplicate a lot of work which I'm trying to avoid. I'm really just trying to figure out where to hang the classes/modules/methods in the framework and whit kind of object |p| should be.
My first inclination was to create a PageBuilder class that implements header, body and sidebar methods. But I got stuck on the rendering pipeline to get everything output just right.
Is there a gem that already provides this type of semantic generation? If not I'd love any insight on how to set this up.
I'm retrieving an array of objects from a hidden html input field. The string I'm getting is:
"{"id":"1234","name":"john smith","email":"[email protected]"},{"id":"4431","name":"marry doe","email":"[email protected]"}"
Now I need to pass this as an array of objects again. How do I convert this string into array of objects?
Is there a conversion utility from svn to hg that can deal with a branch hierarchy that's more complex than just a flat list of branches under /branches?
My repository has a directory that looks (conceptually) like this:
/branches
/projectA
/v1.x
/v1.1
/v1.2
etc..
IOW I need a tool that can get a tree structure as input that represents the branch hierarchy, and migrate this into hg (could be flat in HG, don't really care).
I am looking for a way to direct all the jetty 7 logging to syslog. My current configuration
dumps everything to JETTY_HOME/logs/.. After some initial ivestigation, it seems I should change JETTY_HOME/etc/jetty-logging.xml, but this does not look straightforward. It looks like I should create a new PrintStream implementation which sends its output to syslog and redirecting stderr and stdout to that class in jetty-logging.xml.
any easier way to do that or to make jetty log directly to log4j ?
Thanks
For HTML input, I want to neutralize all HTML elements that have inline js (onclick="..", onmouseout=".." etc).
I am thinking, isn't it enough to encode the following chars? =,(,)
So onclick="location.href='ggg.com'"
will become
onclick%3D"location.href%3D'ggg.com'"
What am I missing here?
Edit: I do need to accept active HTML (I can't escape it all or entities is it).
Hello colleagues!
Googling today I couldn't found sample or mentioning of best practice: how to escape user input in Struts2.
Of course I can manually convert characters on validate() method, but it looks too obvious. So may be exists some automation to avoid code/script injection?
If I call "[NSString stringWithFormat:@"Testing \n %@",variableString]"; I get what I would expect, which is Testing, followed by a new line, then the contents of variableString.
However, if i try
NSString *testString = @"Testing \n %@"; //forgive shorthand here
[NSString stringWithFormat,testString,variableString]
the output actually literally writes \n to the screen instead of a newline. any workaround to this? seems odd to me
I have a word list:word_1,word_2,...word_n
If the input text is like this:
... word_i xxx word_k ...
I want the output to be(the out most):
word_i xxx word_k
How to implement it?
What are some best practices for using pc-lint - how to wade thru the zillion options?
I'm particularly interested in better ways to read/parse the output files.
Hello
I have the following problem:
ComponentA with Unique Name
ChildComponent
ChildChild
AnotherChild
Everytime a new instance of ComponentA is created I want to redirect the output to a unique file named ComponentA-UniqueName including all child component log entries.
How can this be achieved?
Daniel
Hi,
I am Rashmi.I have two forms in a single JSP page which are developed using JSF.Each form has one required field input and a submit button.On click of any of the button from any form,both forms should get validated and display required message.Please need help..........
sample code:
in advance
Thanks.
I want to make an input where you write a domain, click a button, and then know if a domain is ocupied or unregistered.
Is any API out there that can help me?
I am porting some functionality from a C++ application to java. This involves reading non-modifiable data files that contain regular expressions.
A lot of the data files contain regular expressions that look similar to the following:
(?<=id="VIEWSTATE".*?value=").*?(?=")
These regular expressions produce the following error:
"Look-behind group does not have an obvious maximum length near index XX"
In C++ the engine being used supported these expressions. Is there another form of regexp that can produce the same result that can be generated using expressions like my example as input?
I am running a Apache Server . I have a simple screen capture set up using Html2canvas .The capture function is rendering a blank Image . I have tried numerous ways to configure the javascript using related articles from this site to no Avail . The code is all working and tested because I can capture the image prior to "google maps api being loaded . Thank you and any advice would be much appreciated .
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<head>
<title>Tester</title>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="html2canvas.js"></script>
<script type="text/javascript" src="jquery.plugin.html2canvas.js"></script>
<script src="http://www.google.com/jsapi?key=ABQIAAAAwbkbZLyhsmTCWXbTcjbgbRSzHs7K5SvaUdm8ua-Xxy_-2dYwMxQMhnagaawTo7L1FE1-amhuQxIlXw"></script>
<script>
google.load("earth", "1");
var ge = null;
function init() {
google.earth.createInstance("map_canvas", initCallback, failureCallback);
}
function initCallback(object) {
ge = object;
ge.getWindow().setVisibility(true);
}
function failureCallback(object) {
}
function capture() {
$('#target').html2canvas({
onrendered: function (canvas) {
//Set hidden field's value to image data (base-64 string)
$('#img_val').val(canvas.toDataURL("image/png"));
//Submit the form manually
document.getElementById("myForm").submit();
}
});
}
</script>
<style type="text/css">
#map_canvas {position: fixed; top: 60px;
left: 0px; right:0px; bottom:0px; }
#target {
border: 1px solid #CCC;
margin: 0px; padding:0px; position: absolute; left: 10px;top: 80px;height: 580px; width: 580px;
}
</style>
</head>
<body onload='init()' id='body'>
<form method="POST" enctype="multipart/form-data" action="save.php" id="myForm">
<input type="hidden" name="img_val" id="img_val" value="" />
</form>
<input type="submit" value="Take Screenshot Of Div Below" onclick="capture();" />
<div id="target">
<div id="map_canvas"> </div>
</div>
</body>
</html>
This is the php document renders to save.php
<?php
//Get the base-64 string from data
$filteredData=substr($_POST['img_val'], strpos($_POST['img_val'], ",")+1);
//Decode the string
$unencodedData=base64_decode($filteredData);
//Save the image
file_put_contents('img.png', $unencodedData);
?>
<h2>Save the image and show to user</h2>
<table>
<tr>
<td>
<a href="img.png" target="blank">
Click Here to See The Image Saved to Server</a>
</td>
<td align="right">
<a href="index.php">
Click Here to Go Back</a>
</td>
</tr>
<tr>
<td colspan="2">
<br />
<br />
<span>
Here is Client-sided image:
</span>
<br />
<?php
//Show the image
echo '<img src="'.$_POST['img_val'].'" />';
?>
</td>
</tr>
</table>
<style type="text/css">
body, a, span {
font-family: Tahoma; font-size: 10pt; font-weight: bold;
}
</style>
This sample works Correctly . I want to achieve this with above Code using "Google Earth"
<!DOCTYPE html>
<html>
<head>
<script src="http://maps.googleapis.com/maps/api/js?key=AIzaSyDY0kkJiTPVd2U7aTOAwhc9ySH6oHxOIYM&sensor=false"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.js"></script>
<script type="text/javascript" src ="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="html2canvas.js"></script>
<script type="text/javascript" src="jquery.plugin.html2canvas.js"></script>
</script>
<script type="text/javascript">
function initialize()
{
var mapProp = {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:5,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("googleMap"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
$(window).load(function(){
$('#load').click(function(){
html2canvas($('#googleMap'), {
useCORS: true,
onrendered: function (canvas) {
var dataUrl= canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
window.location.href = dataUrl;
}
});
});
});
</script>
</head>
<body>
<div id="googleMap" style="width:500px;height:380px;"></div>
<input type="button" value="Save" id="load"/>
</body>
</html>
Title says it. What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with "mine", "theirs" and "output" in separate panels.
Also, instructions for invoking said tool would be great. (I still haven't figure out how to start kdiff3 in such a way that it doesn't give me an error)
edit: My OS is Ubuntu.