What is the difference in writing to files atomically on the iPhone in objective-c and not, is there any performance difference between the two?
Thanks in advance!
hi.......
i have a problem.i don't know how to convert a html file to pdf file. i want the answer in c#.net,but the must be without use of any convertor. i want full code in c#.so if any body can help me please reply, it is very urgent.
Thanks in Advance
Regards
Sushant jena
I'm writing a website in ASP.NET MVC, using the ASP.NET MVC 1.0 template that was added to VS2008 for me by the ASP.NET MVC installer. The template automatically adds an AccountController, but its account methods tie into a SQL Server Express entity. I don't have Express installed here. How can I reconfigure it to use my SQL Server 2008 database and to store user info in some columns in a User table I've already created?
In my view I return all posts of one blog:
posts = Post.objects.filter(blog=blog)
and pass it to context.
But.. How can I get the number of posts in the template ?
This is my template:
<h1>Number of posts: {{ ??? }} </h1>
{% for post in posts %}
{{ post.title }}
{{ post.body }}
{% endfor %}
How to set gtk "Style Properties" listed in gtk documentation?
like for GtkWidget there are Style Properties:
"separator-height" gint : Read
"separator-width" gint : Read
So how to get and set them? using GTK+ and C.
Thanks,
PP.
I have an XSL code that processes some nodes and if some condition is true, before doing apply-template select="." i need to modify current node(add and attribute).
How can i add an attribute to the node before calling apply-template select=".", or it is not possible at all ?
I try to prevent the Browser from using the :hover effect of the CSS.
$("ul#mainFilter a").hover(
function(o){ o.preventDefault(); ...do my stuff... },
function(o){ o.preventDefault(); ...do my stuff... });
I tired it with return false; to but it does not work.
Does anyone know how to do this?
due the answers i give you some more nfo:
I have set the a and a:hover styles, in my CSS already. Now if JS is available on the clients machine, i want to overwrite the effect with a smoother one. (using jQuery color plugin)
As mentioned by fudgey, a work around would be to set the style (using .css()) but i would have to overwrite every single effect specified in the CSS (see here: http://jsfiddle.net/raPeX/1/ ). I am looking for a generic solution.
can anyone help me on how to know EOF of excel using vb.net?
i have this code but it crash when i try delete the proceeding rows from row 6 to downward.
my problem is, my code was still reading a null values of rows that i deleted in excel..
this is my code:
Dim xlsConn As New OleDbConnection
Dim xlsAdapter As New OleDbDataAdapter
Dim xlsDataSet As New DataSet
xlsConn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathName & " ; Extended Properties=Excel 8.0")
strSQL = "SELECT * FROM [Sheet1$]"
xlsAdapter.SelectCommand = New OleDbCommand(strSQL, xlsConn)
xlsDataSet.Clear()
xlsAdapter.Fill(xlsDataSet)
ListView1.Items.Clear()
Dim listItem As ListViewItem
For ctr As Integer = 0 To xlsDataSet.Tables(0).Rows.Count - 1
listItem = ListView1.Items.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpNo").ToString)
listItem.SubItems.Add(xlsDataSet.Tables(0).Rows(ctr).Item("EmpName").ToString)
Next
Can anyone help me to fix this bugs!
I want simple C++ string based template library to replace strings at runtime.
For example, I will use
string template = "My name is {{name}}";
At runtime, I want the name to be changed based on actual one.
I found one example, www.stringtemplate.org but I little scared when its talks about antlr etc.
I have an option for a user to select his/her own theme while logged into the system and this theme is set in a MYSQL Database and called each time the user logs in, this is called by:
<?php $_SESSION['SESS_THEME_NAME']; ?>
Now, I had this working in a PHP file but I need it to work in Javascript instead unfortunately. And I need some help. I looked at the code using the developers tools on Google Chrome and looks like the above code is not resolving within the javascript file. Which makes sense because you can't access session variables within a javascript file (as I found by searching Google.)
The code is basically supposed to set the specific stylesheet based on the value extracted from the MYSQL database. So if the database says Default the script needs to tell the webpage to use the default.cssfile. And so on and so forth.
My attempt at writing this is as follows:
var themName="<?php $_SESSION['SESS_THEME_NAME']; ?>";
if (themeName == "Default")
{
document.write("<link re='stylesheet' type='text/css' href='css/mws-theme.css'>");
};
if (themeName == "Army")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-army.css'>");
};
if (themeName == "Rocky Mountains")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-rocky.css'>");
};
if (themeName == "Chinese Temple")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-chinese.css'>");
};
if (themeName == "Boutique")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-boutique.css'>");
};
if (themeName == "Toxic")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-toxic.css'>");
};
if (themeName == "Aquamarine")
{
document.write("<link rel='stylesheet' type='text/css' href='css/mws-theme-aquamarine.css'>");
};
Any help once so ever would be awesome and much much appreciated! I am reaching a deadline :/
Hi guys,
I have created a button template consisting of a border and a content presenter. A style is then wrapped around this template and applied to a button, when this button is used it is not carrying the values for horizontal and vertical alignment. In the designer the allignments are showing and the button is in the correct place, but when i run the program the button appears to have horizontal alignment = left and vertical alignment = right. Any ideas?
I need as simple as possible solution for uploading files (eg. photos) to my website from mobile devices (iPhone, Android, BB, Nokia). Is it possible to do it in same way? Using Java or XHTML?
When I write the following code I get garbage for an output. It is just a simple program to find prime numbers. It works when the first for loops range only goes up to 1000 but once the range becomes large the program fail's to output meaningful data
output = open("output.dat", 'w')
for i in range(2, 10000):
prime = 1
for j in range(2, i-1):
if i%j == 0:
prime = 0
j = i-1
if prime == 1:
output.write(str(i) + " " )
output.close()
print "writing finished"
I have the parent class in
/dir1/test1.rb
then i have the child class in
/dir2/test2.rb
the test1 class has a method that uses the "File.dirname(FILE)".
BUT when i call this method from the test2, that inherent from test1
the dir is the dir1, insted the dir2, where the test2 is.
How to make it work?
I've used %time% for timing previously - at least I think I have. I have this weird
IF NOT "%1" == "" (
echo Testing: %1
echo Start: %time%
sqlcmd -S MYSERVER -i test_import_%1.sql -o "test_%1%.log"
sleep 3
echo End: %time%
)
I run this, and it prints:
Testing: pm
Start: 13:29:45.30
End: 13:29:45.30
In this case, my sql code is failing (different reason), but I figure the sleep 3 should make the time increment by 3 at least. Any ideas?
tx,
tff
I'm going to use that template engine LTP . There is not so much doc available.
Now i'm stuck how to pass an environment into the render engine. I have basically this:
local ltp = require("ltp.template")
ltp.render(io.stdout, 1, "index.dhtm", false, {}, "<?lua", "?>", { total="2400" })
What data structure should be the last parameter (env_code), a string, a table with key=val ?
Good morning/evening
how can I write something in a file and then copy its content into the current file?
for example I consult file1.pro then I have rule write something in file2.pro , after this rule finish its job I want append the content of the file2.pro int file1.pro .
when I tried to append into file1.pro directly , the data appear like undefined symbols ,I don't know why
please hellp me
thank you.
I'm writing code in C++, but I really like K/APL's array-oriented style.
Does anyone know of a good set of operator overloading tricks / macros / ... to allow some K/APL -style programming in C++?
Thanks!
I've got a bash script that reads input from a file like this:
while IFS="|" read -r a b
do
echo "$a something $b somethingelse"
done < "$FILE"
The file it reads looketh like this:
http://someurl1.com|label1
http://someurl2.com|label2
However, I'd like to be able to insert the names of variables into that file when it suits me, and have the script process them when it sees them, so the file might look like this:
http://someurl1.com?$VAR|label1
http://someurl2.com|label2
So $VAR could be, for example, today's date, producing an output like this:
http://someurl1.com something label1 somethingelse
http://someurl2.com?20100320 something label2 somethingelse
Hi,
I have a customcontrol exposing a Dependency property of type ObservableCollection. When i bind this properrty directly as part ofthe control's mark up in hte containing control everythihng works fine
/< temp:EnhancedTextBox CollectionProperty="{Binding Path=MyCollection, Mode=TwoWay}"/
But when i try to do the binding in the style created for the control it fails,
/< Style x:Key="abc2" TargetType="{x:Type temp:EnhancedTextBox}"
<Setter Property="CollectionProperty" Value="{Binding Path=MyCollection, Mode=TwoWay}"/>
Please help !!!!!
Thanks
Is there a reliable way to determine whether or not two files are the same? For example, two files with the same size and type may or may not be the same binarilly (yeah, I know it's not really a word). I assume that comparing one or two checksums of the files will help, but I wonder:
How reliable are checksums at determining whether two
files are different; what are the chances of two different files having the same checksum?
Would reliability increase by
applying additional checksum
comparisons?
Which checksum algorithm(s) would be
the most efficient and/or reliable?
Any ideas, suggestions or thoughts are appreciated!
P.S. The code for this is being written in Java running on a nix system, but generic or platform agnostic input is most helpful.
Is there a way I can programmatically determine the status of a download in Chrome or Mozilla Firefox? I would like to know if the download was aborted or completed successfully.
For writing the code I'd be using either Perl, PHP or Python.
Please help.
Thank You.