I'd like the user to specify a RSS feed address and serialize the information from it. I am not interested in the XML format, but populate a strongly typed object from the XML. My question is, is there a standard that all RSS feeds support (Do all of them have date, title etc)? If so, is there a XSD that describes this. If not, how do I handle serializing a RSS feed to an object in ASP.NET?
I have a simple two vector dataframe (length=30) that looks something like this:
> mDF
Param1 w.IL.L
1 AuZgFw 0.5
2 AuZfFw 2
3 AuZgVw 74.3
4 AuZfVw 20.52
5 AuTgIL 80.9
6 AuTfIL 193.3
7 AuCgFL 0.2
8 ...
I'd like to use each of the rows to form 30 single value numeric vectors with the name of the vector taken from mDF$Param1, so that:
> AuZgFw
[1] 0.5
etc
I've tried melting and casting, but I suspect there may be an easier way??
Thanks in advance
BT
I can think of a number of ways to do this in PHP or even JavaScript, but I'm wondering if there's a SQL-based technique I'm overlooking.
I have a database table, let's say 20 fields X 10 rows. I want to display the entire table on an web page, so I'd do something like SELCT * FROM data_table;, and then format the result set using HTML table tags.
However, I'd also like to highlight values in the table based on whether they are the maximum or minimum value in their column. For example, I'd add bold tags around the max in each column. A resulting table might look something like this, with bold tags shown:
id | field1 | field2 | field3 | ...
0 | 5 | 2 | <b>7</b> | ...
1 | 3 | <b>8</b> | 6 | ...
2 | <b>9</b> | 5 | 1 | ...
...
I could do a separate SELECT with an ORDER BY for each field and then interpret the results, but that seems like a lot of extra DB access.
My alternative right now is to just fetch the whole table, and then sort/search for the highlight values using PHP.
Is there a better way?
def maxVote(nLabels):
count = {}
maxList = []
maxCount = 0
for nLabel in nLabels:
if nLabel in count:
count[nLabel] += 1
else:
count[nLabel] = 1
#Check if the count is max
if count[nLabel] > maxCount:
maxCount = count[nLabel]
maxList = [nLabel,]
elif count[nLabel]==maxCount:
maxList.append(nLabel)
return random.choice(maxList)
nLabels contains a list of integers.
The above function returns the integer with highest frequency, if more than one have same frequency then a randomly selected integer from them is returned.
E.g. maxVote([1,3,4,5,5,5,3,12,11]) is 5
There is an image capturing device which gives its output in wmf. This output is stored in the database directly. We have cases where at times some of these images do not appear on a web page in IE. But if we right click on the page we are able to save the image on to the hard disk; meaning the image does exist on the page, but does not appear visible. I think this is because of some file corruption issue, but I don't know how to resolve it. We are however able to view such files using MS Picture Viewer (desktop app). Is there anyway we can detect such problematic files?
Well, I know there is a funciton mysql_fetch_array() and we can use it like this:
while ($row = mysql_fetch_array($result)) {
echo $row['name'] . "<br />";
}
But is there any other way? For example, if there is only one element that can be returned, and not an array.
Thanks)
From the docs:
You usually access to-many
relationships using
mutableSetValueForKey:, which returns
a proxy object that both mutates the
relationship and sends appropriate
key-value observing notifications for
you.
So this returns an "intelligent" NSMutableSet which automatically lets the context delete objects when they get deleted from the set, and reverse? Is that a proxy object?
i want to read a file which consists of 1's and 0's in each line, how do can i store a false in any bool variable after reading 0 from the file.
language c++
I am using AIR to build an application that will search and show the thumbnails from deviantART the request URL for getting resuts in form of RSS feed i get the following
for simplicity i am showing the only code in which i have my question
we can use this for tag
trace(myxml.channel.item[0].title);
but what to do for tags like media:content
trace(myxml.channel.item[0].media:content);
but it does not work
The colons are confusing me
By best I mean most efficient.
So don't go on about subjectiveness.
I have a list of websites and I want to store the list on the iphone locally, there must be an URL, title and a small image (like 32x32 max image size). I don't think I should be using CoreData for this. Should I be using a plist?
Hi,
I am new to iphone programming designs. I have hundreds of plists on my server. On the first launch i will be downloading all these plists into my application and storing it here. What are all the best ways to save and retrieve these plists in my application ? What are the iPhone libraries that should be used to get the best and memory efficient iphone application ?
`public void SeparateData()
{
//read file
StreamReader sr = new StreamReader("myTextFile.txt");
//string to hold line
string myline;
myline = sr.ReadLine();
while ((myline = sr.ReadLine()) != null)
{
string[] lines = Regex.Split(myline, " ");
foreach (string s in lines)
{
using (StreamWriter sw = new StreamWriter("myTextFile.txt"))
sw.WriteLine(lines);
}
}
} `
I've been trying to estimate the size of an Access table with a certain number of records.
It has 4 Longs (4 bytes each), and a Currency (8 bytes).
In theory: 1 Record = 24 bytes, 500,000 = ~11.5MB
However, the accdb file (even after compacting) increases by almost 30MB (~61 bytes per record). A few extra bytes for padding wouldn't be so bad, but 2.5X seems a bit excessive - even for Microsoft bloat.
What's with the discrepancy? The four longs are compound keys, would that matter?
I have a datamodel with to-many to-many relations. Using the example of employee database let say the entity division is related to department which in turn is related to employee. The employee has an attribute salary. How best to have a attribute at the level of division which is derived from the salary attribute. For example average salary or maximum salary.
I would need those attributes to sort the list of departments.
Does anyone out there who's familiar with Scala know how I could use scala.collection.immutable.Set from Java? I can vaguely read the scaladoc, but am not sure how to call scala methods like "-" from java (I assume that I just need to include some scala .jar file in my classpath...?)
What's the difference between the two? They seem to have the same functionality at first glance.
Which one has faster performance which one is easier to use?
I'm having some problems using sed in combination with html. The following sample illustrates the problem:
HTML="<html><body>ENTRY</body><html>"
TABLE="<table></table>"
echo $HTML | sed -e s/ENTRY/$TABLE/
This outputs:
sed: -e expression #1, char 18: unknown option to `s'
If I leave out the / from $TABLE so that it becomes <table><table> it works ok.
Any ideas on how to fix it?
This is what I'm doing right now:
Execute a query and check if the date
to be inserted already exists in a
table.
If date doesn't exist:
Another query will insert the date into the table.
How can these two query be combined?
I'm listing out a bunch of cars with a button next to them that when clicked will need to perform a GET but also sends over that item's model.Name:
@using (Html.BeginForm("GetCarUrl", "Car", FormMethod.Get, new { model = Model }))
{
if(Model.Cars != null && Model.Cars.Count > 0)
{
foreach (CarContent car in Model.Cars)
{
<p>@car.Name</p>
}
<input type="button" value="Get Car Url" class="submit" />
}
So the page renders a bunch of hyperlinks and buttons:
[hyperlink1] [submit]
[hyperlink2] [submit]
[hyperlink3] [submit]
[hyperlink4] [submit]
[hyperlink5] [submit]
...
When a user clicks on any of the submits, I need to pass back its corresponding @car.CarType for that specific hyperlink
Not sure how to go about this. My action method expects a @car.CarType for that specific car hyperlink to be sent to it