In an assignment for college it was suggested to use the c readline function in an exercise. I have searched for its reference but still haven't found it. Does it really exist? In which header? Can you please post the link to the reference?
Thanks.
When I use Django's logout function to log out an authenticated user, it switched locale to en_US, the default one.
from django.contrib.auth import logout
def someview(request):
logout(request)
return HttpResponseRedirect('/')
How to keep user's locale after logged out?
If funciton overloading and templates serve more the less the same purpose then which one should we go for templates or function overloading and what are the corresponding benefits.
I have a document based on a xml structure that I have stored in a CouchDB database.
Some of the keys contains namespaces and are on the form "namespace:key":
{"mykey":{nested:key":"nested value"}}
In the map function, I want to emit the nested value as a key, but the colon inside the name makes it hard...
emit(doc.mykey.nested:key, doc) <-- will not work.
Does anyone know how this can be solved?
I am triggering the transformation using a .NET code,
unless I add "EnableDocumentFunction" property to the XSL-Setting, the program throws error saying .. "Usage of Document() function is prohibited",
Actually the program is not editable and a kind of read-only .. is it possible to edit the XSL code itself so that I can use document() function??
The sample XSL and XMLs are Here:
Sample XML :
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:variable name="State_Code_Trn">
<State In="California" Out="CA"/>
<State In="CA" Out="CA"/>
<State In="Texas" Out="TX"/>
<State In="TX" Out="TX"/>
</xsl:variable>
<xsl:template name="testing" match="test_node">
<xsl:variable name="test_val">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:element name="{name()}">
<xsl:choose>
<xsl:when test="document('')/*/xsl:variable[@name='State_Code_Trn']
/State[@In=$test_val]">
<xsl:value-of select="document('')/*/xsl:variable[@name='State_Code_Trn']
/State[@In=$test_val]/@Out"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Other</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
And the sample XML :
<?xml version="1.0" encoding="utf-8"?>
<root>
<test_node>California</test_node>
<test_node>CA</test_node>
<test_node> CA</test_node>
<test_node>Texas</test_node>
<test_node>TX</test_node>
<test_node>CAA</test_node>
<test_node></test_node>
</root>
So my logic is flawed and I need a better and correct way to resize an image in my c# app
I need a function similar to this setup
public void ResizeImageForWeb(string OriginalFile, string NewFile, int MaxWidth, int MaxHeight, int Quality)
{
// Resize Code
}
Basically, I'm a web designer lost trying to programming a desktop app.
i use date function to get day, month and year.
$year = date(y);
$month = date(m);
$day = date(d);
but my hosting is in another place where i am, so i need to add 11 hours.
could you tell me how can i do that?
thanks
Hi all
I have the following model association: a student model and has_many scores.
I need to make a list showing their names and average, min, max scores. So far I am using
student.scores.average(:score) on each student, and I realise that it is doing one sql per student. How can I make the list with one joined sql?
Also how would I use that with Will_Paginate plugin?
Thank you
Hi all
I am very confused about the const version and mutable version member function like below::
value_type& top() { return this.item }
const value_type& top() const { return this.item }
What is the different these two functions? In what situation they would be used? Could someone give me some explanation about it?
Best Regards,
How can i make my own delete method to prevent that the data really gets deleted?
i want to set a datetime field when it gets deleted insted of a normal delete.
i read about overriding the submitchanges function, but i don't get it to work
thanks
Hi
I have wordpress site. I have installed modern-blue-green-120070612-2 theme.Then i got an error message on the right hand side "Fatal error: Call to undefined function cypher_previousposts() in mydomain\wp-content\themes\modern-blue-green-120070612-2\sidebar.php on line 59.
Does any one know this? Please help me ....
Thaks in advance
I have one image. i want that when someone scrolls the browser window then by jquery i should also change the image position from top as well
I want to use jquery only . Is there function like that.
I don't want to use position:fixed or something like that. I want something like
onScroll(){
var x = getScrollDIstance();
moveImageDown(x);
}
Hello I am trying to write code for a function called Triplet getTriplet()
and I must use find and atoi in this fuction to call the array[3] = {0, 1, 2} and find the "," and find the "()" in the program? I am so lost. I have read and read and cannot locate any informatin which really touches on the subjects enough to give me an understanding of what I am suppose to do. Please help if you can! Thanks in advance.
Hey guys, I'm new to javascript and I'm doing a project for my final in class. I need to make it so this game engine I manipulated causes the generation button to go for an infinite loop.
I also need to stop it using (Reset==1). Any help? Here's the code I have so far if that helps:
function generation()
{
for(y2=0; y2<2500; y2++)
{
tempmapactual[y2]=mapactual[y2];
}
for (g=0;g<2500;g++)
{
neighbours=0;
for (h=0;h<8;h++)
{
if (g+coords[h]>0 && g+coords[h]<2499 && mapactual[g+coords[h]]=="white.gif")
{neighbours=neighbours+1;}
}
if (neighbours>=4 || neighbours==1 || neighbours==0)
{tempmapactual[g]="black.gif";}
if (neighbours==3) {tempmapactual[g]="white.gif";}
}
for(y3=0; y3<2500; ++y3)
{
if (mapactual[y3]!=tempmapactual[y3])
{
mapactual[y3]=tempmapactual[y3];
document.images[y3+offset].src=mapactual[y3];
}
}
}
</script>
<script>
function doIt()
{
for (i=0; i<X; i++)
{
// This is where I have trouble. What part of generation() do I call?
}
if (Reset==1) break; // This will kill the loop instantly.
}
}
</script>
<script>
window.onload(doIt($(X).value)));
</script>
<form>
<input type="button" value="generate" onClick="generation();">
</form>
<form>
<input type="text">
</form>
<form>
<input type="button" value="Infinite Loop!" onclick="doIt();">
</form>
<form>
<input type="button" value="Reset" onclick="doIt();">
</form>
Hi,
I am trying to implement my own version of pow() and sqrt() function as my custom library doesn't have pow()/sqrt() floating point support.
Can anyone help?
I right clicked on a Database in the object explorer of SQL Server 2008 Management Studio. I went to Tasks Import Data, and imported some data from a flat text file, opting to save the package on the server.
Now how the heck do I get to the package to edit or run it again? Where in SQL Server Management Studio do I go? I've expanded everything and I can't find it. It's driving me nuts.
I use the previewKeyDown() function for some controls in my project but they always get called twice for each key press. Anyone who knows how to solve this?
And is there anyway to do a global keylistener in my project?
I am dynamically creating a hyperlink in the c# code behind file of ASP.NET. I need to call a JavaScript function on client click. how do i accomplish this?
thanks in advance
Is it pronounced "Gewid" or is it prononced "G.U.I.D" by spelling out the letters. It seems inconsistently used. What is the proper pronountiaton? Same story goes for SQL. It seems more people say "S.Q.L." than "Sequel".
Sometime back I used a windows tool to see what a process is doing. This tool allowed me to inspect functions exported from DLL. It also allowed me to change the values passed to a function on the fly.
I cannot recollect the name(not sure if that was free or commercial one). Could any one point to me solution that can do this?
(Tools like ProcessExplorer, ProcessMonitor helps a bit.. this was better)
Cheers,
Jayan