|
How to implement code for html
|
|
|
|
|
First, use a better subject line. Second, read some documentation or books.
only two letters away from being an asset
|
|
|
|
|
...
"Well, we're getting "F"'d at work. WPF, WCF, and WWF... WTF?" --John Simmons
|
|
|
|
|
Smtnri wrote: How to implement code for html
You've got a couple of choices. The first choice would be to write some code like a real coder, but if I were you I'd go for the hardcore option and whack it out using ones and zeroes.
|
|
|
|
|
I'm so very sorry. Every computer has an IQ requirement of 42. You don't meet this requirement, so pack your computer away, and send it back, stating reason code I D Ten T
|
|
|
|
|
|
|
|
I want to pass string and convert to array in javascript.Somebody said that can use json to achieve it.Could you show me how to write code?
Best Regards.
|
|
|
|
|
You write the code one letter at a time, like this. You don't start writing the code until you understand what needs be written. Therefore, research should focus on JavaScript & JSON. There's a lot of information on Google out there on the JSON-format.
I are troll
|
|
|
|
|
I'm trying to piece together someone else's code. The code was looking for Oracle.DataAccess.DLL for Oracle 10. My GAC has version 9.2.0.700, so I downloaded the dll for version 10, copied it to the \bin\Debug directory and added a reference using the BROWSE tab. When I try to build, however, I get this:
D:\Projects\Gnf.Utils_Source\Gnf.Utils.Oracle\Database.cs(5,18): error CS0234: The type or namespace name 'DataAccess' does not exist in the namespace 'Gnf.Utils.Oracle' (are you missing an assembly reference?)
My output appears to say that my intended version was picked up:
Primary reference "Oracle.DataAccess, Version=10.1.0.400, Culture=neutral, PublicKeyToken=89b483f429c47342".
Resolved file path is "bin\Debug\Oracle.DataAccess.dll".
Reference found at search path location "bin\Debug\".
When I double click on the reference it shows the namespace as :
namespace Oracle.DataAccess.Client
Member of Oracle.DataAccess
In my code I have this
namespace Gnf.Utils.Oracle
{
using Oracle.DataAccess.Client;
It just doesn't seem that it's recognizing that reference. I've tried to use the version 9.2 from the GAC. I've tried creating a new project. I'm not sure what else to look at. I'm very confused.
|
|
|
|
|
What about this?
namespace Gnf.Utils.Oracle
{
using Oracle.DataAccess;
I are troll
|
|
|
|
|
Thanks for the suggestion, but it didn't work. In fact, the intellisense doesn't kick in at all when I type the "Oracle.".
|
|
|
|
|
You could check that the Specific Version property is not set to true for your reference. If it is, perhaps it could cause the problem.
|
|
|
|
|
I tried to build using your suggestion to set SPECIFIC VERSION to FALSE, but it still failed.
|
|
|
|
|
Wait a second... Are the lines in correct order? Shouldn't it be:
using Oracle.DataAccess.Client;
namespace Gnf.Utils.Oracle
{
...
|
|
|
|
|
Yes!!!! That worked! But I don't understand.
I didn't change that code at all, and I'm sure the previous developer built it successfully.
I don't understand why I have to declare this particular thing outside of the namespace, while the others can be defined inside.
using Oracle.DataAccess.Client;
namespace Gnf.Utils.Oracle
{
using Gnf.Utils.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Runtime.InteropServices;
using System.Threading;
|
|
|
|
|
I'm not sure. Perhaps you have two namespaces in the file and if the the other one also wants to use classes from Oracle.DataAccess.Client, the using directive would be out of scope, just a guess since I actually never use using directive. I always like to add full namespace to a class definition.
|
|
|
|
|
Well, its a standard practice to use Using before declaring Namespace.
The compiler need to know what references to use (Using) before it can compile the namespace function map.
|
|
|
|
|
|
So I'm coding in .NET (C#), under Visual Studio, and getting some numbers in string format and converting them to double.Parse to doubles. However, it only works if the number strings first have the . replaced with a ,
How can I make the double.parse command give me decimals delimited with dots , not commas?
|
|
|
|
|
Have you checked setting for the local computer? In Vista the formatting is set in the Regional and Language options dialog from the control panel
only two letters away from being an asset
|
|
|
|
|
Thanks, good idea, however, I just checked and the decimal separator is already defined as the dot.
|
|
|
|
|
use this:
double dummyOut = new double();
System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-US", true);
Double.TryParse(anyString, System.Globalization.NumberStyles.Any, cultureInfo.NumberFormat, out dummyOut); }
|
|
|
|
|
Using generics and interfaces in .net, it's possible to design a class so that a particular method name can invoke a number of different methods, based upon the type of a passed-in parameter. For example:
Class DoItMagic
Interface iAct(Of T)
Sub Act(ByVal param As T)
End Interface
Public Shared Sub exec(Of T)(ByVal target As iAct(Of T), ByVal param As T)
target.Act(param)
End Sub
Public Shared Sub hitEverything(Of T, U As DoItMagic.iAct(Of T))(ByVal theEnum As IEnumerable(Of U), ByVal theParam As T)
For Each thing As U In theEnum
exec(Of T)(thing, theParam)
Next
End Sub
End Class
Class DoItTarget
Implements DoItMagic.iAct(Of param1), DoItMagic.iAct(Of param2)
Class param1
End Class
Class param2
End Class
Public Sub Act_param1(ByVal param As param1) Implements DoItMagic.iAct(Of param1).Act
End Sub
Public Sub Act_param2(ByVal param As param2) Implements DoItMagic.iAct(Of param2).Act
End Sub
End Class
Class DoItTest
Dim firstParam As DoItTarget.param1
Dim secondParam As DoItTarget.param2
Dim L As List(Of DoItTarget)
Sub go()
DoItMagic.hitEverything(Of DoItTarget.param1, DoItTarget)(L, firstParam)
DoItMagic.hitEverything(Of DoItTarget.param2, DoItTarget)(L, secondParam)
End Sub
End Class
This approach seems to work out pretty elegantly. The first hitEverything will call iAct(of Param1) on each element of the list; the second will call iAct(of Param2). Additional methods may be added by simply creating new classes and adding interface iAct(of eachNewClass), without any need to change anything in DoItMagic.
My questions:
- Are there any performance implementations with creating empty classes that are used as method selectors rather than as distinct ways of holding data (e.g. there might be a number of different classes that hold a single integer, but select different methods).
- Does invoking methods via generics pose any performance problems in cases where everything can be type-checked at compile time?
- What would be the performance implications in cases where things couldn't be checked until run-time (e.g. if a list holds a number of elements, not all of which will support any particular iAct(of type).
- Is this overall approach a brilliant idea, crazy idea, or somewhere in between?
I like the way this approach seems to work, but I would be very sad if I developed a lot of code with it and discovered that while it performed well in initial testing it sometimes dogged in real applications. Any thoughts?
|
|
|
|