i have a string of the format SUCCESS,12:34:56:78:90, i want to separate these two values that are separated by commas into two different strings. how do i do that in gcc using c language.
I often have a Dictionary of keys & values and need to sort it by value. For example, I have a hash of words and their frequencies, and want to order them by frequency.
There's SortedList which is good for a single value (frequency), but I want to map it back to the word.
SortedDictionary orders by key, not value. Some resort to a custom class, but what's the cleanest way?
Hi, i want to have pre-made list of most common OSes in my DB and all non default to be listed as other. Problem is i don't know what OSes called in Request.Browser object.
List i want to have WinXP, Vista, Win7, Linux, MacOS and other...
Do any of you know what are exact names of these OSes in Request.Browser.Platform or where i can get list of values from ?
hi there,
I'm using MS Sql Server and I want to use identity constraint in it
I know how to use it in following manner
create table mytable
(
c1 int primary key identity(1,1);
)
the above code works fine but what if i want the identity column to have values as EMP001, EMP002,... instead of 1,2....
Thanks in advance,
Guru
I am simply taking the data from a Table and insert it into #tempTable then delete the data, and insert it back to the table. I get "Insert Error: Column name or number of supplied values does not match table definition." Error.
Here are the lines I am running.
SELECT * INTO #tempTable FROM dbo.ProductSales
SELECT * FROM #tempTable
DELETE FROM dbo.ProductSales
INSERT INTO dbo.ProductSales SELECT * FROM #tempTable
Any Idea?
Annoyingly, the jquery ui's set a few css properties inline, making it impossible to override them in the stylesheet. I tried to override the values with jquery, but then they get changed back as soon as the control is interacted with.
Does anyone know if any of the jquery ui control's initialisers/constructors have the ability to override their z-index value or set other css properties?
Hi there,
I created a program that contains linked lists that are passed various methods. While this works just fine in Java... a style checker program we have to use doesn't like it
It says: Declaring variables, return values or parameters of
type 'LinkedList' is not allowed.
If I declare them as simply List then I don't have access to the methods I want. What should I do?
I am trying to sort an ArrayList of Strings that represent card values. So, some cards contain letters ("King") and some contain Strings containing only a number ("7"). I know to use Collections.sort, but it only sorts Strings that contain letters. How do I get the ArrayList to be sorted by number as well as alphabetically?
I've created a form that posts to a cfm file. When running a script onLoad that fills in the form values and tries to submit...The site takes me back to the login screen.
function f()
{
document.getElementById("email").value = "[email protected]";
document.getElementById("password").value = "asdf";
document.getElementById("form1").submit();
}
Please help!
D <- read.csv("sample1.csv", header = FALSE, sep = ",")
D
V1 V2 V3 V4
1 20100316 109825 352120 239065
2 20100317 108625 352020 239000
3 20100318 109125 352324 241065
D[,1]
[1] 20100316 20100317 20100318
In the above example how do I get the data in D[,1] to be read, and stored as date values:
2010-03-16, 2010-03-17, 2010-03-18 ? I have lots of data files in this format.
TIA,
Is there anybody who can help me making pixels of an png picture transparant, such like: MakePixelTransparant(const png:TPngImage; x,y:integer; perc:integer); and what else do I have to do to makes thinks works (with values do i have to change to make the png object transparant, so i can use it in for example PhotoShop).
Thanks, John Duinmeijer.
I have this XML at http://localhost/file.xml:
<?xml version="1.0" encoding="utf-8"?>
<val:Root xmlns:val="http://www.hw-group.com/XMLSchema/ste/values.xsd">
<Agent>
<Version>2.0.3</Version>
<XmlVer>1.01</XmlVer>
<DeviceName>HWg-STE</DeviceName>
<Model>33</Model>
<vendor_id>0</vendor_id>
<MAC>00:0A:DA:01:DA:DA</MAC>
<IP>192.168.1.1</IP>
<MASK>255.255.255.0</MASK>
<sys_name>HWg-STE</sys_name>
<sys_location/>
<sys_contact>
HWg-STE:For more information try http://www.hw-group.com
</sys_contact>
</Agent>
<SenSet>
<Entry>
<ID>215</ID>
<Name>Home</Name>
<Units>C</Units>
<Value>27.7</Value>
<Min>10.0</Min>
<Max>40.0</Max>
<Hyst>0.0</Hyst>
<EmailSMS>1</EmailSMS>
<State>1</State>
</Entry>
</SenSet>
</val:Root>
I am trying to read this from my c# code:
static void Main(string[] args)
{
var xmlDoc = new XmlDocument();
xmlDoc.Load("http://localhost/file.xml");
XmlElement root = xmlDoc.DocumentElement;
// Create an XmlNamespaceManager to resolve the default namespace.
XmlNamespaceManager nsmgr = new XmlNamespaceManager(xmlDoc.NameTable);
nsmgr.AddNamespace("val", "http://www.hw-group.com/XMLSchema/ste/values.xsd");
XmlNodeList nodes = root.SelectNodes("/val:SenSet/val:Entry");
foreach (XmlNode node in nodes)
{
string name = node["Name"].InnerText;
string value = node["Value"].InnerText;
Console.Write("name\t{0}\value\t{1}", name, value);
}
Console.ReadKey();
}
}
Problem is that the node is empty. I understand this is a common newbie problem when reading XML, still not able to solve what I am doing wrong, probably something with the Namespace "val" ?
Hi,
My UPDATE and DELETE logic are in stored procedures. I've built an entity framework model with mappings to these procedures.
In spUpdate I return the new timestamp column so the EF could detect concurrency conflicts. It works fine.
I have a problem with the spDelete because I don't see mappings for return values in the "delete function" row.
How to check concurrency in this example?
i have following regular expression but it's not working properly it takes only three values after @ sign but i want it to be any number length
"/^[a-zA-Z0-9_.-]+\@([a-zA-Z0-9-]+.)+[a-zA-Z0-9]{2,4}$/"
this@thi This is validated
this@this It is not validating this expression
Can you please tell me what's the problem with the expression...
Thanks
Is there any facility in Django for doing currency conversions? Obviously, rates change day by day but I'm somewhat hopeful that the locale module has some sort of web-service based converter :P
There's a snippet here that handles the formatting: http://www.djangosnippets.org/snippets/552/ But I need to localize the values first.
Hi.I am new on iphone development and I have problem with CoreData. I hardly made to sore value in CoreData but How can I look those value like in MySql WorkBench you can see the tables ad also values.In CoreData am I have chance like that?
In a ruby on rails app, I build an array of Project Names and project id values, but want to truncate the length of the names. Current code is:
names = active_projects.collect {|proj| [proj.name, proj.id]}
I have tried to add a truncate function to the block, but am getting undefined method for class error.
Thanks in advance - I just cannot wrap my head around this yet.
I have a .SWF email submit form. The background color is set via:
`<param name="bgcolor" value="#000000" />`
and in the embed:
`<embed src="FILE.swf" flashvars="STUFF" quality="high" **bgcolor="#000000"** width="260" height="32" name="WidgetMailBlack" align="middle" swLiveConnect="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />`
Is it possible either on mouse over of the Object or a containing div to change those values? i.e. to #ffffff
many thanks!
What do I pass as the first parameter "object" to the function setattr(object, name, value), to set variables on the current module?
For example:
setattr(object, "SOME_CONSTANT", 42);
giving the same effect as:
SOME_CONSTANT = 42
within the module containing these lines (with the correct object).
I'm generate several values at the module level dynamically, and as I can't define __getattr__ at the module level, this is my fallback.
I am using jQuery validation plugin for form validation. The problem I am facing is when I have inline labels..
For Example:
<input type="text" name="myinput" value="Enter your ....">
This is the sample case where validation is failing because the 'value' is set for input field. Is there any workaround? How do I ignore default/label values?
create or replace procedure proc_advertisement(CustomerID in Number,
NewspaperID in number,
StaffID in Number,
OrderDate in date,
PublishDate in date,
Type in varchar,
Status in varchar,
Units in number) is
begin
insert into PMS.Advertisement(CustomerID, NewspaperID, StaffID, OrderDate, PublishDate,
Type, Status, Units)
values(CustomerID,NewspaperID, StaffID, OrderDate, PublishDate,
Type, Status, Units);
dbms_output.put_line('Advertisement Order Placed Successfully');
end;
How to check for if any error has occurred during the execution of the procedure and if any error has occurred then I wish to display an error message.
Is there any way I can store an array of numbers in a Tokyo Cabinet db? For example, I have predictable arrays of values such as
1 => [1, 2, 444, 0.987],
2 => [2, 23, 123, -0.234],
3 => [3, 1, 34, 1.456]
I would like to store the above in a TC fixed length db. Is there a way to store the above as arrays instead of as strings?