I have two C files and one header that are as follows:
Header file header.h:
char c = 0;
file1.c:
#include "header.h"
file2.c:
#include "header.h"
I was warned about 'duplicate definition' when compiling. I understand the cause as the variable c is defined twice in both file1.c and file2.c; however, I do need to reference the header.h in both c files. How should I overcome this issue?
Hello,
I would like to know how can I get record count of a query with C#.
Here is the code that I use..
MySqlDataReader recordset = null;
query = new MySqlCommand("SELECT * FROM test ORDER BY type_ID ASC", this.conn);
recordset = query.ExecuteReader();
while (recordset.Read())
{
result.Add(recordset["type_ID"].ToString());
}
return result;
Hi
I need to give the count down as shown in the following link for each item using asp.net with c#.
http://www.bidrivals.com/us/
Please help me out from this problem
Thanking you
Waiting for your valuable thoughts.
Hi,
I have an ExpenseType object that I have created with the following migration:
class CreateExpenseTypes < ActiveRecord::Migration
def self.up
create_table :expense_types do |t|
t.column :name, :string, :null => false
t.timestamps
end
end
I can see the table name is the pluralised expense_types. My question is, how do I reference this type in a belongs_to relationship?
Is it:
belongs_to :expensetype
or is it
belongs_to :expense_type
I do not seem able to set it up correctly.
Cheers
It is possible to reference a generic method using a Lambda Expression Object?
For example, having:
TheObject:
public abstract class LambdaExpression : Expression
TheMethod (an extension method of LINQ):
public static TSource Last<TSource>( this IEnumerable<TSource> source )
I'm trying to create an instance of TheObject, that references to TheMethod.
How do you do such thing?
I am able to insert, filter and order records but can't use a simple count!!
I am wondering if there a way to get no of total rows in a table??
Is there a way to use GROUP BY in query?
Hi
I know Visual Studio 2010's STL has been rewritten to support rvalue reference to boost its performance a lot.
I am curious that STL of gcc 4.4 (and above) does support it?
Thanks.
I have a style defined in a resource dictionary that applies to
all ComboBox controls.
Within the ComboBox control, I reference the style like so:
Style="{DynamicResource MyComboBoxStyle}"
This works ok.
I want to be able to add some triggers to some of the ComboBox controls.
What is a good way to use the style referenced as a dynamic resource yet still be able to add triggers to some of the ComboBox controls?
When I add a service reference to my Visual Studio 2010 C# project, a new class for one of the types defined in the WSDL will be generated. A de-facto equivalent definition of that type already exists in our solution in a different assembly.
When adding the SoapTypeAttribute to the existing class and replacing the references to the generated class in the generated code, everything runs perfectly and as expected.
How would I tell Visual Studio to use the existing class in the generated code?
Hi all,
i have the following table:
mysql select * from consumer1;
Service_ID | Service_Type | consumer_feedback
31 Printer -1
34 Printer 0
31 Printer 0
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
34 Printer 1
I need a query such that I need THE COUNT(Service_ID)=2 AS Service_ID is 31 and 34.Please help me and give me some suggestions.
Is it allowed to reference external field from nested select?
E.g.
SELECT
FROM ext1
LEFT JOIN (SELECT * FROM int2 WHERE int2.id = ext1.some_id ) as x ON 1=1
in this case, this is referencing ext1.some_id in nested select.
I am getting errors in this case that field ext1.some_id is unknow.
Is it possible? Is there some other way?
I have a WCF service which I am able to connect to from my web application and get data.
I now added a web reference to this wcf project to a wsdl file that a shipping company provides. Intention is to get shipping quotes..
I am able to access the objects that are generated from this wsdl file but when I call service.Authenticate("DEMO");
method almost nothing happens. I debug and see the debugger continue to the next lines but there is no change on service parameters and service.isauthorized is null..
Can you lead me to how I should debug this further and things I should check, or if there are additional steps that I need to ensure to have a web reference working on wcf app
Thanks
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using ShippingCalculator.com.freight.api;
namespace ShippingCalculator
{
public class ShippingService : IShippingService
{
freight_service service = new freight_service();
public string GetData(int value)
{
service.setConnectionType(".net");
service.Authenticate("DEMO");
OriginRequest origin = new OriginRequest();
origin.zip = "60101";
DestinationRequest destination = new DestinationRequest();
destination.zip = "10001";
PackageRequest package = new PackageRequest();
package.weight = "10";
ShipmentInfoRequest shipmentInfo = new ShipmentInfoRequest();
shipmentInfo.ship_date = DateTime.Now.AddDays(5);
service.setOrigin(origin);
service.setDestination(destination);
service.setPackage(package);
service.setShipmentInfo(shipmentInfo);
Quote quote = service.getQuote();
return string.Format("Quote Number: {0}<br /> ", quote.QuoteNumber);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ShippingTestApp.ShippingServiceReference;
namespace ShippingTestApp.Controllers
{
[HandleError]
public class HomeController : Controller
{
public ActionResult Index()
{
ShippingServiceClient shipClient = new ShippingServiceClient();
shipClient.GetData(0);
ViewData["Message"] = shipClient.GetData(0);
return View();
}
}
}
Can somebody please refer me to a comprehensive tutorial on Canvas which covers all properties / functions?
I also need a definite reference on Canvas - something like w3schools
I'm trying to save text fields in MySql using NHibernate in Asp.Net frame work. But while executing this I got the error"Object reference not set to an instance of an object". If anyone knew help me...
I'm running Ubuntu 12.04 X64 and have installed all the tools(Toolchain: arm-2010q1 and Samsung Galaxy S2 source as given Here) to compile a ROM.
When I run make Command I'm getting this error:
kernel/built-in.o: In function `cpufreq_table_show':
cpu_pm.c:(.text+0x39b64): undefined reference to `cpufreq_frequency_get_table'
kernel/built-in.o: In function `cpufreq_max_limit_store':
cpu_pm.c:(.text+0x39cd4): undefined reference to `omap_cpufreq_max_limit'
cpu_pm.c:(.text+0x39d04): undefined reference to `omap_cpufreq_max_limit_free'
cpu_pm.c:(.text+0x39d24): undefined reference to `omap_cpufreq_max_limit_free'
kernel/built-in.o: In function `cpufreq_min_limit_store':
cpu_pm.c:(.text+0x39dd4): undefined reference to `omap_cpufreq_min_limit'
cpu_pm.c:(.text+0x39e04): undefined reference to `omap_cpufreq_min_limit_free'
cpu_pm.c:(.text+0x39e24): undefined reference to `omap_cpufreq_min_limit_free'
make: *** [.tmp_vmlinux1] Error 1
I have noticed that it has solutions for matching multiple words in a given text, such as below:
http://stackoverflow.com/questions/1099985/algorithm-for-multiple-word-matching-in-text
If I want to know exactly the number of appearances of each matched word in the text, my solution is like this:
step 1: using ac-algorithm to obtain the maching words;
step 2: count the number of each word obtained in step 1
is there a faster way?
Thx~
Could someone tell me how to view the XML to be sent via web reference while debugging Visual Studio (i.e. see the actual XML with all tags too?) I'm having a "There is an error in this XML Document (4, 56)." error.
Any help would be much appreciated.
declare @t1 Table
(
a1 int
)
insert into @t1
select top 10 AnimalID from Animal
--select * from @t1
declare @t2 table
(
dogs int null
)
update @t2
set dogs = (Select COUNT(*) from @t1)
--------- The out put it gives me is just 0
I am try to find the top n number of categories as they relate to articles, there is a habtm relationship set up between the two. This is the SQL I want to execute, but am unsure of how to do this with ActiveRecord, aside from using the find_by_sql method. is there any way of doing this with ActiveRecord methods:
SELECT "categories".id, "categories".name, count("articles".id) as counter FROM "categories"
JOIN "articles_categories" ON "articles_categories".category_id = "categories".id
JOIN "articles" ON "articles".id = "articles_categories".article_id
GROUP BY "categories".id
ORDER BY counter DESC
LIMIT 5;
i've found one cheat sheet for doctrine: cheat sheet
but it doesn't list all methods for Doctrine_Record, Doctrine_Core, Doctrine_Query etc.
i wonder if there is a such reference?
Would be very helpful.
Is there a way to use visual studio's "add assembly reference dialog" (or something similar) in my own application? I need it for dynamic code generation and compilation.
This is not simply an OpenFileDialog, since it additionally looks into the GAC and so on, so it will be very complicated to do it on my own, I think.
If this is not possible, how can I get a list of all assemblies from the GAC?
When I have a JavaScript array like this:
var member = {
"mother": {
"name" : "Mary",
"age" : "48"
},
"father": {
"name" : "Bill",
"age" : "50"
},
"brother": {
"name" : "Alex",
"age" : "28"
}
}
How to count objects in this array?!I mean how to get a counting result 3, because there're only 3 objects inside: mother, father, brother?!
Hi iExperts
I am little bit confus about the iPhone developer program.
I know its One year subscription program after that we have to re-new it
Q : From which time the count down of iPhone developer program starts ?
from the Enrolment time or
from the application submission time
is anyone have idea then pls tell me frnds...
Thanks in advaced...