I am designing a desktop application in C#, which needs to be connected to my online mysql database. I tried to give access in control panel a "%" which means from any IP, but it is not working. May be the hosting provider (bigrock) not allowing that.
Alternatively, I am trying to write some code in online on PHP which will get the "sql" as parameter and returns the output as JSON format using json_encode.
Is there any alternate methods which is better approach.
I have a class name xxxx and a resource whichthe class read from it to set some string. Everything is fine and nothing goes wrong.
The problem is that I have some Constant Global String which I set them in global area like
public partial class ExampleDocument : ClassBase
{
const string TheProblem = "I can not read this string from resources cause here Methods do not work";
#region Method
...
#endregion
}
The question is, How to read this strings frrom Rersource File.
Python: How to get the caller's method name in the called method?
Assume I have 2 methods:
def method1(self):
...
a = A.method2()
def method2(self):
...
If I don't want to do any change for method1, how to get the name of the caller (in this example, the name is method1) in method2?
Hi,
I am trying to construct a graph using cocoa.To display the points on x -axis and y- axis i used methods called drawATPoint and drawinRect which allows to draw apoint inside rect not out side .
So please mention if there is any solution to display the points.I am using the following code.
NSTextStorage *textStorage = [[NsTextStorage alloc]initWithString:@"0.0"];
[textStorage drawAtPoint:NSMakePoint(0,0)];
When debugging in Visual Studio and you want to step into a procedure for example, but you dont want to step into the parameter methods.
Is there a way to do this?
var a = StepIntoSomething(getSomeValueDontStepIn(1),getSomeValueDontStepIn(2));
I should start by saying I'm not now, nor do I have any delusions I'll ever be a professional programmer so most of my skills have been learned from experience very much as a hobby.
I learned PHP as it seemed a good simple introduction in certain areas and it allowed me to design simple web applications.
When I learned about objects, classes etc the tutor's basic examnples covered the idea that as a rule of thumb each database table should have its own class. While that worked well for the photo gallery project we wrote, as it had very simple mysql queries, it's not working so well now my projects are getting more complex. If I require data from two separate tables which require a table join I've instead been ignoring the class altogether and handling it on a case by case basis, OR, even worse been combining some of the data into the class and the rest as a separate entity and doing two queries, which to me seems inefficient.
As an example, when viewing content on a forum I wrote, if you view a thread, I retrieve data from the threads table, the posts table and the user table. The queries from the user and posts table are retrieved via a join and not instantiated as an object, whereas the thread data is called using my Threads class.
So how do I get from my current state of affairs to something a little less 'stupid', for want of a better word. Right now I have a DB class that deals with connection and escaping values etc, a parent db query class that deals with the common queries and methods, and all of the other classes (Thread, Upload, Session, Photo and ones thats aren't used Post, User etc ) are children of that.
Do I make a big posts class that has the relevant extra attributes that I retrieve from the users (and potentially threads) table?
Do I have separate classes that populate each of their relevant attributes with a single query? If so how do I do that?
Because of the way my classes are written, based on what I was taught, my db update row method, or insert method both just take the attributes as an array and update all of that, if I have extra attributes from other db tables in each class then how do I rewrite those methods as obbiously updating automatically like that would result in errors?
In short I think my understanding is limited right now and I'd like some pointers when it comes to the fundamentals of how to write more complex classes.
Is there any way to programmatically determine if an .xls contains macros, without actually opening it in Excel?
Also are there any methods to examine which certificate (including timestamp cert) these macros are signed with? Again without using Excel.
I'm wondering in particular if there are any strings that always show up in the raw data of an Excel file when macros are present.
Hi,
I am working on an iphone application in which I am consuming a webservice.
So i am parsing the XML file data. any idea about how to parse self closing tag
like: State/ and how to read data of self tag like: Contact Email="[email protected]" Name="PhD" Phone="123-521-3388" Source="location"/
I am parsing xml file using NSXMLPARSER class methods and library
Thanks,
I have a controller method with the following signature:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult UpdateValues(int id, MyViewModel[] array)
{
}
The id is normally picked up as part of the Url on other GET controller methods (I have a working route that does this)
I am successfully passing the array1 from the form in my view to the controller method, but how do I also put the id onto my Url so that when the user clicks the Submit button, the controller method will pick up the ID?
Hi,
What is the difference between PrintStream and PrintWriter? They have much methods in common. I always mix up this classes because of that reason. And I think we can use them for exactly the same. But there has to be a difference. Otherwise there was only one class.
I first searched on StackOverflow, but not yet this question.
Thanks
If a variable is at class level (ie, private MyDataAccessClass _dataAccess;, can it be used as part of a using statement within the methods of that class to dispose of it correctly?
Is it wise to use this method, or is it better to always declare a new variable with a using statement (ie, using (MyDataAccessClass dataAccess = new MyDataAccessClass()) instead of using (_dataAccess = new MyDataAccessClass()))?
List (and List) instances can be readonly, seeing ReadOnly property; methods throws exceptions in the case the collection have the property ReadOnly property.
How can I create readonly List instances? What are the main uses?
hi all,
is it possible to write database methods in properties file, like some database queries and can be accessed using servlets which may reduce the code?
please any body help
Typical scenario: a class that a lot of people have worked on. I'd like to sort methods, properties, etc... in alphabetical order.
I'd like to be able to do this within the region or globally in the class.
I see the feature in Resharper to do it, but it does not seem to do anything.
Hi
Raising an event, will call its event handler. eg http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx
What is the difference between using the events mechanism and direct calls to other methods (eg if a condition is met in method A(), call B() )?
And what is the difference between consuming and raising events?
Thanks
How to call AS2 method from NextFrame(or any other frame) in Flash?
Say you have Action Frame on frame 3, and another one on frame 4, how do you call methods on frame 4 when you are on frame 3.
How to declare an array in method declaration in gen-class?
(ns foo.bar
(:gen-class
:methods [[parseString [String Object] Object]]))
That works fine. But the return type is really an array. How I can declare that so Java can understand it?
Does anyone know of a good (read: quick to code) method for converting DTOs to View Models or mapping DTO members to View Model members? Lately I've been finding myself writing many conversion and helper methods but this is a very arduous and tedious task. Moreover, it will often needs to be done twice (DTO - View Model, View Model - DTO).
Is there a methodology, technique, or technology which would allow me to do this more quickly and efficiently?
Is it possible to override the to_sentence method just for one model in my rails application?
More generally, how do I modify methods for an Array of my models?
I am fiddling around with JBOSS's Web Services, and I have created the following:
http://127.0.0.1:8080/IM/TestService?wsdl
Now I need to access Web Methods from that Web Service from JavaScript.
Say I have a web method named foo in TestService, how do I make an ajax call to it?
I tried accessing the method via http://127.0.0.1:8080/IM/TestService/foo, but I'm getting an HTTP Status 404.
Hi Guys,
I need a help from ur side.
Actually I need to call a method automatically when I click on to the textview.
Is there any delegate methods or any other process for this.
Anyone's help will be much appreciated.
Thank you,
Monish.
Hello everyone,
I would like to achieve the following: all the workflows created should have the same structure (validation, execution, save results), and all the developers should implement those three stages (maybe leaving it empty). Similar to inheritance with abstract methods.
Any ideas?