I've got two Urls. A server and a relative url that I would like to combine. The problem is that part of the url's may well overlap. I've done this using some horrible string manipulation but would like to put this out there and see if there is a nice and clean way of doing it.
string siteUrl = "http://seed-dev6/sites/irs";
string formUrl =…
I use a dynamic table:
<html>
<body>
<button id="button">Build table</button>
<div id="container">
<script type="text/javascript">
window.onload=function(){
var table = null;
var row = "<tr><td>111111111111111111111111111111111111111111111111111111</td>" +
…
Really simple question, how do I combine echo and cat in the shell, I'm trying to write the contents of a file into another file with a prepended string?
If /tmp/file looks like this:
this is a test
I want to run this:
echo "PREPENDED STRING"
cat /tmp/file | sed 's/test/test2/g' > /tmp/result
so that /tmp/result…
Spring-data-rest does a great job exposing entities via their primary key for GET, PUT and DELETE etc. operations.
/myentityies/123
It also exposes search operations.
/myentities/search/byMyOtherKey?myOtherKey=123
In my case the entities have a number of alternate keys. The systems calling us, will know the objects…
PEP 8 says that Python package and module names should be short, since some file systems will truncate long names. And I'm trying to follow Python conventions in a new project. But I really like long, descriptive names. So I'm wondering, how short do names need to be to comply with PEP 8. And does anyone really worry…
Hi everyone,
Basically I'm trying to pass a javaScript function to a Java method to act as a callback to the script.
I can do it - sort of - but the object I receive is a sun.org.mozilla.javascript.internal.InterpretedFunction and I don't see a way to invoke it.
Any ideas?
Here's what I have so far:
var…
Hi,
I'm trying to use the header() function to create a redirect. I would like to display an error message. Currently I'm sending the message as a parameter through the URL, however this makes it look quite ugly.
Is there a way to pass this value as a post variable instead?
Any advice appreciated.
…
I'm making a call to PayPal's credit card processor, and after a successful/unsuccessful transaction it returns me a string that looks like this:
DoDirectPayment failed: Array ( [TIMESTAMP] = 2010%2d05%2d02T23%3a33%3a28Z [CORRELATIONID] = 8c503f5c6c861 [ACK] = Failure [VERSION] = 51%2e0 [BUILD] =…
I'm using a the confirmit java script function to redirect to a new url with a positive response. It doesn't do exactly what I want - and maybe I can't have exactly what I want.
Here's what it does - onunload, with a positive response it opens the new url in a new window, which can be blocked by…
My application is multithreaded with intensive String processing. We are experiencing excessive memory consumption and profiling has demonstrated that this is due to String data. I think that memory consumption would benefit greatly from using some kind of flyweight pattern implementation or even…
I'm finding that Char fields are being padded.
Is there any way to stop this happening.
I've tried using the property
SET PROPERTY "sql.enforce_strict_size" FALSE
but doesn't seem to help.
I have my menu button bringing up a Settings option, which brings up numerous ListPreferences such as weight and various sizes for glasses (it's a BAC calculator app). I'll pick one example... weight will work.
Depending on how much you weigh it will affect your BAC. I have a int for Weight, set…
I have my menu button bringing up a Settings option, which brings up numerous ListPreferences such as weight and various sizes for glasses (it's a BAC calculator app). I'll pick one example... weight will work.
Depending on how much you weigh it will affect your BAC. I have a int for Weight, set…
I'm struggling with understanding Entity Framework and POCO objects. Here's what I'm trying to achieve.
1) Separate the DAL from the Business Layer by having my business layer use an interface to my DAL. Maybe use Unity to create my context.
2) Use Entity Framework inside my DAL.
I have a…
I am using Rails 2.1 to output tables from a database. But the output includes lots of extra lines and tabs. I am using a while loop with lots of nested if statements. I am also wrapping all of my non-output lines in <%- code -%. Any idea what might be happening and a solution? Thanks,
ex:…
I really want to learn how to program. A friend suggested I buy vs 2005 or a newer version if I'm serious about it. Is there a cheaper route? I would like to start with c#.
I have a short css-based animation that I want to play out before a link is followed (a card that swooped in on page load swoops out after click). Currently, however, the page called loads too quickly. I want to be able to briefly delay the href from being followed.
Here's what I've got:
…
We have a situation at work where developers working on a legacy (core) system are being pressured into using GOTO statements when adding new features into existing code that is already infected with spagetti code.
Now, I understand there may be arguments for using 'just one little GOTO'…
I have two different data models that map to the same Car entity. I needed to create a second entity called ParkedCar, which is identical to Car (and therefore inherits from it) in order to stop nhibernate complaining that two mappings exists for the same entity.
public class Car
{
…
I get this error when I do a svn update:
Working copy xxxxxxxx locked Please
execute "Cleanup" command
When I run cleanup, i get
Cleanup failed to process the
following paths: xxxxxx
How do i get out of this loop?
Let us say I have a url of subdomain.domain.com. Is there a way in ASP.NET MVC to have a url of say otherdomain.com/gotothesubdomain that takes you to subdomain.domain.com? I know that a simple redirect could do it, but I want the url to stay as otherdomain.com/gotothesubdomain.
Any…
In FitNesse, can variables be defined in terms of other variables?
I want to do the equivalent of:
int a=3;
int b=a;
To make this concrete, I have a variable defining the date:
!define clock.date {2/2/2009}
I then want to define some other variable ${other.date}…
I have a JQuery dialog box on a page that calls something like this:
$.post("/MyController/MyAction", { myKey: key} //...
And this successfully gets here:
[HttpPost]
public ActionResult MyAction(int myKey)
{
//do some stuff
return RedirectToAction("AnotherAction"); …