I'm trying to output in bibtex format in Django and the template looks like this:
@{{ pubentry.type }{,
author = {{% for author in pubentry.authors.all %}{{ author.first_name }} {{ author.middle_name }} {{ author.last_name }}{% if not forloop.last %} and {% endif %}
{% endfor %}},
title = {{{ pubentry.title }}},
journal = {{{ pubentry.journal }}}
}
The problem is with the "{{{" or "{{%". One way to go around the problem is to add a space after the first "{", but that kind of tamper the format. What's the right way to escape { in Django templates?
how to convert YUY2,YUV, RGB565 and More Video subtype into RGB24 Subtype Video in DirectShow + VC++
can u understand my question?
I have a Upstream filter its output is in YUY2 Format but i need to convert it into RGB24 Format.
Is there any inbuilt Filters in DirectShow or we have to convert it through my code.
i have already added ColorSpaceConverter But it is not Connecting with Smart Tee Input Pin.
I've added a class for the HTML Custom Extensions:
using System;
using System.Linq.Expressions;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
namespace App.MvcHtmlHelpers
{
public static class HtmlHelperExtensions
{
public static MvcHtmlString ComboBox(HtmlHelper html, string name, SelectList items, string selectedValue)
{
var sb = new StringBuilder();
sb.Append(html.DropDownList(name + "_hidden", items, new { @style = "width: 200px;", @onchange = "$('input#" + name + "').val($(this).val());" }));
sb.Append(html.TextBox(name, selectedValue, new { @style = "margin-left: -199px; width: 179px; height: 1.2em; border: 0;" }));
return MvcHtmlString.Create(sb.ToString());
}
public static MvcHtmlString ComboBoxFor<TModel, TProperty>(HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, SelectList items)
{
var me = (MemberExpression)expression.Body;
var name = me.Member.Name;
var sb = new StringBuilder();
sb.Append(html.DropDownList(name + "_hidden", items, new { @style = "width: 200px;", @onchange = "$('input#" + name + "').val($(this).val());" }));
sb.Append(html.TextBoxFor(expression, new { @style = "margin-left: -199px; width: 179px; height: 1.2em; border: 0;" }));
return MvcHtmlString.Create(sb.ToString());
}
I've also registered it in my site web config:
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
<add namespace="App.MvcHtmlHelpers"/>
</namespaces>
In my view, I import the namespace:
<%@ Import Namespace="RSPWebApp.MvcHtmlHelpers" %>
But when I go to call it in the view, it doesn't recognize the custom extension. Can someone help me by telling me what I might have missed? Thanks so much in advance!
<%:Html.ComboBoxFor(a => a.Street2, streetAddressListItems) %
Hello,
What algorithm I can use for problem like this:
Have a graph positive weighted, i want to know a smallest
possible sum of weights where each node are connected (connected like a network, where each node is a eg. network device).
In this network each node can be connected with other node by some other other nodes in way. But all nodes from input graph must be in a network.
Any one can help me with this?
Hi,
Is there any way to completely ignore link break and tab characters etc. in RegEx?
For instance, the line break and tab characters could be found anywhere and in any order in the content string.
... [CustomToken \t \r\n Type="" \t \r\n Property="" \n /] ... [CT ...
The is the RegularExpression that I am currently using:
(\[CustomToken).*?(\/\])
.NET API
Regex.Matches(string input, string pattern)
Thanks for your suggestion.
I'm trying to add an automatic post-build trigger to run NDepend after an automated team build in TFS 2010.
NDepend's website provided code for integrating this capability, and so I have pasted their code into my .csproj file where they said for it to go, but I receive errors on the build.
The errors refer to two of the three "BuildStep" tags I have in the code snippet. The following two snippets are giving me errors:
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Message="Running NDepend analysis">
<Output TaskParameter="Id" PropertyName="StepId" />
</BuildStep>
and
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Status="Failed" />
However, this code snippet is NOT throwing up any problems:
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Status="Succeeded" />
I just don't understand why one works fine and a nearly identically laid out BuildStep tag does not. Is there something simple that I'm just overlooking?
EDIT: Here is how it looks all together, if this makes a difference:
<Target Name="NDepend" >
<PropertyGroup>
<NDPath>c:\tools\NDepend\NDepend.console.exe</NDPath>
<NDProject>$(SolutionDir)MyProject.ndproj</NDProject>
<NDOut>$(TargetDir)NDepend</NDOut>
<NDIn>$(TargetDir)</NDIn>
</PropertyGroup>
<Exec
Command='"$(NDPath)" "$(NDProject)" /OutDir "$(NDOut)" /InDirs "$(NDIn)"'/>
</Target>
<Target Name="AfterBuild">
<BuildStep TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Message="Running NDepend analysis">
<Output TaskParameter="Id" PropertyName="StepId" />
</BuildStep>
<PropertyGroup>
<NDPath>c:\tools\NDepend\NDepend.console.exe</NDPath>
<NDProject>$(SolutionRoot)\Main\src\MyProject.ndproj</NDProject>
<NDOut>$(BinariesRoot)\NDepend</NDOut>
<NDIn>$(BinariesRoot)\Release</NDIn>
</PropertyGroup>
<Exec
Command='$(NDPath) "$(NDProject)" /OutDir "$(NDOut)" /InDirs "$(NDIn)"'/>
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Status="Succeeded" />
<OnError ExecuteTargets="MarkBuildStepAsFailed" />
</Target>
<Target Name="MarkBuildStepAsFailed">
<BuildStep
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
BuildUri="$(BuildUri)"
Id="$(StepId)"
Status="Failed" />
</Target>
EDIT: Added a bounty because I really need to get this going for my team.
Thank you in advance!
I'm looking for a way to create a vCards from Outlook Contacts. Ive seen plenty of examples of how to do the reverse, but that's not what i want. I believe it will involve either the OpenSharedItem method or the OpenSharedFolder method but I havent seen any examples of how to implement this. Does anyone know of where I might find a sample or two? My end goal is to output all my Contacts as vCards to a folder.
I have a email address like [email protected] and [email protected][email protected] ... etc
I want a Mysql select query so that it would trim user names and .com an returns output as
gmail,ymail,hotmail etc
I am doing the below in a perl script:
my @pm1_CS_missing_months = `sqlplus -s $connstr \@DLmissing_months.sql`;
it takes the output of an sql query.
if i have to check for no rows selected,how could i do it?
i want to do like this:
if(no rows selected)
{
do this;
}
In a web page using jQUery 1.7.1 and jQUery-UI 1.8.18, if I output $.ui in an alert box when the document is ready, I get [object Object]. However when using Firefox, if I output $.ui in a click event handler, I get 'undefined' as result. With other browsers (latest versions of IE, Chrome and Safari), the result is still [object Object] when clicking on the link.
Here is my HTML Page:
<!doctype html>
<html>
<head>
<title></title>
<script src="Scripts/jquery-1.7.1.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui-1.8.18.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
alert($.ui); // ALERT A
$(document).on("click", ".dialogLink", function () {
alert($.ui); // ALERT B
return false;
});
});
</script>
</head>
<body>
<a href="#" class="dialogLink">Click me!</a>
</body>
</html>
In this post, I reduced to its simplest form another problem I was having described here: $(this).dialog is not a function. I created a new post for the sake of clarity, since the real question is different from the original one now that pin-pointed where the problem resided.
UPDATE:
IF I replace my alerts with simply alert($); I get this result for alert A:
function (selector, context) {
return new jQuery.fn.init(selector, context, rootjQuery);
}
and this one for alert B:
function (a, b) {
return new d.fn.init(a, b, g);
}
This does not make sense to me, although I may not be understanding well enough what $ is...
UPDATE 2:
I can only reproduce this problem using Firefox on OS X. On Firefox running on Windows 7, everything is fine.
i need the code for sorting of numbers in ascending order using visual c++ in the windows forms,the output comes on the forms text box and i am doing it in visual studio....
anyone please help...provide the code
a = matrix(1:25,5,5)
B = capture.output(for (X in 1:5){
A = c(min(a[,X]),quantile(a[,X],0.25),median(a[,X]),quantile(a[,X],0.75),max(a[,X]),mean(a[,X]),sd(a[,X])/m^(1/2),var(a[,X]))
cat(A,"\n")
})
matrix(B,8,5)
what i was trying to do is to generate a table which each column has those element in A and in that order. i try to use the matrix, but seems like it dont reli work here...can anyone help
1 2 3 4 5
min
1st quartile
median
SEM
VAR
THIS IS WHAT I WANT THE TABLE LOOKS LIKE ..
I am trying to open a remote shell via ssh to send commands from R.
As long as I send commands, I need to get results and send new commands that depends on the output of the previous ones.
For this reason I am looking for a solution to open a connection and manage it from within the R code until I have finished. I also need to open the connection with ssh key exchange (so without password authentication).
Looking at CRAN I didn't find anything useful.
I need to know the referring server for a page on my site.
Is there any safe method to check where the user "came" to the page FROM?
I tried uploading this to my server, but this wont output anything at all when I write the adress to the file in the browsers adress bar:
<?php echo $_SERVER['HTTP_REFERER']; ?>
I need to check this in order to display a link on the page or not...
Thanks
I noticed that when I build a given C# source to produce a DLL, the binary output is different each time. It would be helpful for our build / deployment process if this was not the case. Can I control this?
I may have string like,
"""Hello, %(name)s,
how are you today,
here is amount needed: %(partner_id.account_id.debit_amount)d
"""
what would be the best solution for such template may i need to combine regular expression and eval, input string may differ like $partner_id.account_id.debit_amount$ - for the moment I've kept as python string format - just for testing.
I am writing a app in .NET which will generate random text based on some input. So if I have text like "I love your {lovely|nice|great} dress" I want to choose randomly from lovely/nice/great and use that in text. Any suggestions in C# or VB.NET are welcome.
I would like to add a certain number of leading zeroes (say up to 3) to all numbers of a string. For example:
Input: /2009/5/song 01 of 3
Output: /2009/0005/song 0001 of 0003
What's the best way to do this with regular expressions?
When Python is first installed, the default setting executes users' code input line-by-line. But sometimes I need to write programs that executes multiple lines at once. Is there a setting in Python where I can change the code execution to one block at once? Thanks
if (n/2) * 2 == n:;
print 'Even';
else: print 'Odd'
SyntaxError: invalid syntax
When I tried to run the above code, I got an invalid syntax error on ELSE