I want to create a XML file in csharp like the below format pls help me with the code
<MasterEntries>
<fruit>Apple</fruit>
<animal>Fox</animal>
<color>Violet</color>
</MasterEntries>
Are any of the Visual Studio Express editions able to work with C++/CLI code? Currently when I go to "Add File" in either the C# 2008 or C++ 2008 versions I do not see the option for creating C++/CLI.
If I visit 1 website www.abc.com that has a reference to say jQuery hosted at Google Code, and then I visit a 2nd website www.xyz.com that has the same reference - will the file be cached across both websites? i.e. will it re-download it on the 2nd website, or just use it from cache?
Hello everyone,
I have the following code in my program:
Thread getUsersist, getChatUsers;
getUsersList = new Thread(this, "getOnlineUsers");
getUsersList.start();
getChatUsers = new Thread(this, "getChatUsers");
getChatUsers.start();
In run(), I wish to know which thread is using run(). If its "getOnlineUsers" i will do something, If it is "getChatUsers" I will do something else. So how do I know which thread is using run()?
I'm trying to put together a WordPress plugin and I want to grab a list of all categories (of other WordPress blogs) via XML-RPC. I have the following code and it looks like it works so far:
function get_categories($rpcurl,$username,$password){
$rpcurl2 = $rpcurl."/xmlrpc.php";
$params = array(0,$username,$password,true);
$request = xmlrpc_encode_request('metaWeblog.getCategories',$params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $rpcurl2);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$results = curl_exec($ch);
$res = xmlrpc_decode($results);
curl_close($ch);
return $res;
}
If I use $res I get the following string as the response: Array
If I use $results then I get:
categoryId17 parentId0 descriptionTest categoryDescription categoryNameTest
htmlUrlhttp://test.yoursite.com/?cat=17 rssUrlhttp://test.yoursite.com/?feed=rss2&cat=17
categoryId1 parentId0 descriptionUncategorized categoryDescription
categoryNameUncategorized htmlUrlhttp://test.yoursite.com/?cat=1
rssUrlhttp://test.yoursite.com/?feed=rss2&cat=1
I need to pull out the names after description so Uncategorized and Test in this case.
It's my first time coding in PHP. I got these results by echoing them to the page, so not sure if they get changed in that process or not...
By the way I modified the above code from one that posts to a WordPress blog remotely so maybe I haven't set some of the options correctly?
With var_dump($res) I get:
array(2) { [0]=> array(7) { ["categoryId"]=> string(2) "17" ["parentId"]=> string(1)
"0" ["description"]=> string(4) "Test" ["categoryDescription"]=> string(0) ""
["categoryName"]=> string(4) "Test" ["htmlUrl"]=> string(40)
"http://test.youreventwebsite.com/?cat=17" ["rssUrl"]=> string(54)
"http://test.youreventwebsite.com/?feed=rss2&cat=17" } [1]=> array(7) {
["categoryId"]=> string(1) "1" ["parentId"]=> string(1) "0" ["description"]=>
string(13) "Uncategorized" ["categoryDescription"]=> string(0) "" ["categoryName"]=>
string(13) "Uncategorized" ["htmlUrl"]=> string(39) "http://test.youreventwebsite.com/?cat=1"
["rssUrl"]=> string(53) "http://test.youreventwebsite.com/?feed=rss2&cat=1" } }
Is it possible to have a navigation system optimized using javascript, but for the sake of search engines, have the hyperlinks still be crawlable?
Or maybe a condition statement that calls HTML code only if javascript is not enabled in the browser or when crawled by a search engine?
Hi all,
I've found this small code that sends email to gmail users. I'd like the body of the mail to contain html (for example, decoding a link for it to hold different text than the url it's pointing to).
How can this be done?
Thanks!
hello i am a student and i am doing my senior project it is about developing an application in j2me for scanning a barcode and extract the number of the barcode in a message to be send.
please i search the net but i cant found something usefull i am new at j2me if someone could help me with sourch code and how to create it i will be very thankfull my email is [email protected]
thanks in advanced
I am working on exercise 13 from learnpythonthehardway.org. I should run this code:
from sys import argv
script, first, second, third = argv
print "The script is called:", script
print "Your first variable is:", first
print "Your second variable is:", second
print "Your third variable is:", third
Then enter "python ex13.py first 2nd 3rd" on command line. However, I am using Aptana Studio 3 on Vista and I get the
"ValueError: too many values to unpack" error.
I am new to Python and Aptana so how can I enter the separate arguments here?
I use the command line sqlite3 executable to check queries I make from my code.
Is there a way to read in pragma statements or other session setup (".mode csv" for example) when the executable starts up?
I know I can do a ".read " once I'm in, but that's tedious.
Hey, here's a dumb question: how can I set an object property given its name in a string. I have a dictionary being passed to me and I wish to transfer its values into namesake properties using code like this:
for entry in src_dict:
if entry.startswith('can_'):
tgt_obj[entry] = src_dict_profile[entry]
I'm still a bit of a noob with Python so would appreciate some help.
- dave.
I have an ancient code snippet I use for copying tables in MySQL.
CREATE TABLE new_table (select * from old_table);
This works great, with one exception. It doesn't copy the primary key or other table indexes.
Is there any way to copy a table in MySQL AND include the indexes/primary key??
Hi,
Can i open a new window after execution of some code(ie at some point of time before completion i need to open a new window in zend.Can i do this?
Also how can i check the size of a remote file.
Thanks in advance.........
def fibSeq(n: Int): List[Int] = {
var ret = scala.collection.mutable.ListBuffer[Int](1, 2)
while (ret(ret.length - 1) < n) {
val temp = ret(ret.length - 1) + ret(ret.length - 2)
if (temp >= n) {
return ret.toList
}
ret += temp
}
ret.toList
}
So the above is my code to generate a Fibonacci sequence using Scala to a value n. I am wondering if there is a more elegant way to do this in Scala?
I'am a newbie n interest to leaarn aspnet mvc (vb) but there's too much application sample that using C#..
i just want to know how to wrote this code in VB
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master"
Inherits="System.Web.Mvc.ViewPage<MvcGridSample
.ViewModels.Shared.Grid<Customer, CustomerSearchForm>>" %>
do you have any idea??
thx before
-dix-
On my html page, I have a google map with a few markers.
I want all the markers to be cleared once the zoom is changed on the map with the following code.
GEvent.addListener(map, "zoomend", function()
{
map.clearOverlays();
}
But what happens is actually the markers are removed by the "clearOverlays()" function, but then they appear again.
Any idea why? Where is it going after the event is handled?
here is what i see in IB
and here is what appears in the simulator
i've used a segmented control with style = "Bezelled". When i change the style to "Bar", IB and simulator are consistent in the display. the style is set in interface builder and not in code, if that matters
Also - the edges look rather ugly in the simulator. not what i expected even when it rendered incorrectly.
Thanks in advance
In c++ 0x10 is the way to represent a hex value.
if I leave off the 0x then it's dec. Is there a way to define a binary?
Not that I can't derive 0x0003 is 11, but it would be cool if I could use
0b0011. It would just make the code a little more obvious.
I'm writing a C++ app.
I have a class variable that more than one thread is writing to.
In C++, anything that can be modified without the compiler "realizing" that it's being changed needs to be marked volatile right? So if my code is multi threaded, and one thread may write to a var while another reads from it, do I need to mark the var volaltile?
[I don't have a race condition since I'm relying on writes to ints being atomic]
Thanks!
I thought I can not override generic methods of a derived class.
http://my.safaribooksonline.com/book/programming/csharp/9780071741163/generics/ch18lev1sec13
The code in this link runs fine. The overriden method is called although the instance type of
the base class is used and not the instance of the derived type.
Now I am confused because a former question of mine Type parameter declaration must be identifier not a type
is about calling the overriding generic method with the instance of base type which did NOT work!
How to disable Alt + Shift + Tab using c# ? I have disabled the Alt + Tab using a function which gets only two parameters. But to disable three key strokes ??
I anyone need my code to disable the two key strokes combination, i cam post it. But it is quite big.
I would like to know about JavaScipt. Is Javascipt is available only for web browsers? Because I used some JavaScript code for Firefox Plugin development and Thunderbird.
Help me to find out more about this: where can I use JavaScript other than web browsers, and how?
I have been doing code for a few years and still feeling that my knowledge still not broad enough to become a professional. I have studied some books related to Design Pattern but I know there are many others.
So could anyone list the one which you think it is good to learn to become a better programmer and more professional?
Programming Languages I work on : C# , Ruby, Javascript
I want to add badge for tab widget at android. i use android-viewbadger lib, but i not set badge show to image
here code:
tabs = (TabWidget) findViewById(android.R.id.tabs);
badge = new BadgeView(this, tabs, 2);
// badge.setBackgroundResource(R.drawable.badge_28);
badge.setBadgePosition(BadgeView.POSITION_TOP_RIGHT);
badge.setWidth(14);
badge.setHeight(14);
badge.show();
Hey all,
I'm trying to have the following tag toggle between a "-" and the checkmark character (✓)
<a id='p_4' class='fancy_button orange bls_button' href='#'>-</a>
And here's the jquery code:
if (button.text() == '-') {
button.html('✓'); }
This works in FF3.6 and IE8, but not in WebKit (Chrome or iPhone safari).
Is there something I'm doing wrong, or does webkit just not like .html("✓")
Thanks,
Sam