w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Is it possible writing code that generate a class, method, member at runtime ?
Quick answer: Yes! For a detail of how to achieve this you would want to start your learning by looking at Reflection. The next step would be looking for other resources on the internet and a quick search located this question on SO: How to create a method at runtime using Reflection.emit Dynamic Language Runtime may also be worth a look.

Categories : C#

Is there any way to automatically generate proxy class for android in eclipse for web service if I have web service url?
When you say "for android" you mean for use in an android app? I haven't used it in some time, but I think you can use SoapUI. That article is a few years old, but should still be possible. There are also tools (wsdl2java) that come with Apache axis, and cxf that you can use.

Categories : Java

How will the readResolve() method of the proxy class get called in the Serialization Proxy pattern?
Check the documentation of Serializable. writeReplace() and readResolve() are special methods called by serialization engine. writeReplace() replaces object being serialized with the proxy, and readResolve() replaces deserialized proxy with the actual object. Serialization proxy class doesn't have to be a static nested class of the class you want to serialize. It's just a convention for better organization of code.

Categories : Java

Access SharePoint Web Services at runtime
You can use dynamic web service references. Have a look at http://www.codeproject.com/Articles/12317/How-to-make-your-Web-Reference-proxy-URL-dynamic If you are using SharePoint Client Object API you can set the url and password dynamically. Configure the url and password in your app.config file. using (ClientContext clientcontext = new ClientContext("http://yourspserverurl/")) { clientcontext.Credentials = new NetworkCredential("username", "password", "domain"); List list = clientcontext.Web.Lists.GetByTitle("your sharepoint list"); clientcontext.ExecuteQuery(); } For SharePoint 2013 Please see my bloghttps://mydevexperience.wordpress.com/2013/10/20/sharepoint-2013-office-365-authentication-using-sharepoint-client-object-model/

Categories : Sharepoint

Generate non-duplex proxy code for a SOAP webservice
The most easiest way is using Add Web Service reference instead of using Add Service Reference. Because your service is a simple structured soap service, without any advanced scenario such as duplex communication, you will not lose anything on client side. In 'Add Service Reference' window, click on Advanced button, provide address and click add reference. It will generate a client side for you based on .NET 2 technology Let me know if any other information is needed. Good luck

Categories : Dotnet

How to generate UI at runtime in asp.net mvc
I cant see here something really connected with mvc. The case is that you would like to have an interactive UI, that basically is the job of Javascript. If we are talking about grids, it can be next plugins/frameworks: Kendo UI (not free for commercial use) - http://demos.kendoui.com/web/grid/editing.html http://jquerygrid.net/ A lot of good plugings are here: Choosing a jQuery datagrid plugin? So basically this is the same (like) Grid View from asp.net. If you wanna have something exactly like GridView - I think there is no native implementation (from Visual Studio) for this (maybe i'm wrong, but 4 year experience say to me that i'm right :) ).

Categories : Asp Net Mvc

Unable to tunnel through proxy. Proxy returns "HTTP/1.1 407 Proxy Authorization Required"
You may not need the domain in front of the username. I had a very similar issue, and I fixed it when I removed the domain in front of the username. Since the proxy server is on a domain, I think it implies that your under the same domain.

Categories : Java

What is better generate random IDs at runtime or keep them handy before?
What I do in similar situations is to keep N values queued up so that I can instantly assign them, and then when the queue's size falls below a certain threshold (say, .2 * N) I have a background task add another N items to the queue. It probably makes sense to start this background task as soon as your program starts (as opposed to generating the first N values offline and then loading them at startup), operating on the assumption that there will be some delay between startup and requests for values from the queue.

Categories : String

Generate checkboxes and textboxes during loop (for next) in a module (runtime)
Might be more elegant to store both values in same array? array(1,1) = "Peter Meier" array(1,2) = "2" array(2,1) = "Joe Garner" array(2,2) = "2" etc... As for your problem, something like this maybe: Sub Stuff() Dim vrData(2, 1) As Variant ' or vrData() and redim later Dim ctControl As Control Dim intPosX, intPosY As Integer Dim ufForm As BlankForm ' i.e. a blank userform you create first vrData(0, 0) = "Whatever" vrData(0, 1) = "3" vrData(1, 0) = "Something" vrData(1, 1) = "2" vrData(2, 0) = "Horse" vrData(2, 1) = "7" intPosX = 20 intPosY = 20 Set ufForm = New BlankForm For i = 0 To UBound(vrData, 1) Set ctControl = ufForm.Controls.Add("Forms.CheckBox.1") With ctControl .Caption = vrData(i, 0)

Categories : Excel

How to generate a lambda at runtime passing a property name as string?
Your first attempt is closer to the solution. You just need to call the generic version of Lambda: var lambda = Expression.Lambda<Func<PolicyTran, object>>(body, x).Compile(); in order to get a Func<PolicyTran, object> delegate. Otherwise the labda will return a simple System.Delegate from which the LINQ .Select will be unable to infer the types.

Categories : C#

The class name that Rails generate controller generate
Just ran it and this is what I got: $new_project rails generate controller Therapeutics create app/controllers/therapeutics_controller.rb invoke erb create app/views/therapeutics invoke helper create app/helpers/therapeutics_helper.rb invoke assets invoke coffee create app/assets/javascripts/therapeutics.js.coffee invoke scss create app/assets/stylesheets/therapeutics.css.scss $new_project

Categories : Ruby On Rails

System.Runtime.InteropServices.Marshal class in Portable Class Libraries
You cannot access Marshal class in Portable Class Library project with support of anything else than .NET Framework and Windows Store App - by design of .NET Framework as stated in resolution of relevant bug of .NET Framework. Added below a screenshot as at MS Connect they tend to delete defects (as here) from time to time:

Categories : C#

Check if class is derived from a specific class (compile, runtime both answers available)
Check if class is derived from a specific class (compile time) You can use std::is_base_of: #include <type_traits> .... const bool isBase = std::is_base_of<base, TheOtherClass>::value; isBase is true if TheOtherClass is derived from base.

Categories : C++

How to change the parent class of an inherited class at runtime in Delphi?
You cannot change the class a run time. Once an object is instantiated, its class is fixed. You could hack the object to change its VMT pointer, making it refer to a different class, but that would still not address your main concern, which is memory usage — even if you change the VMT pointer, all the memory for the object has already been allocated; changing the VMT pointer doesn't magically make the object occupy less memory. The first thing you could do is stop descending from TControl. As you've noted, you don't need any of the things it provides. All you want is something you can drop on a form at design time to set its properties. For that, all you need is TComponent, so make that your base class instead of TControl. Then you'll get something more like TTimer, which has no GUI

Categories : Delphi

web reference : How to change proxy class code
Solution 1: Go to your project folder -> Web References -> MyService. In there, there should be a file called Reference.cs ... that's the file that is created. It contains proxy classes for the webservice. Also, if you don't want to mistakenly update the reference and delete your changes to the file, update the reference in the csproj file. On the bottom of the project file, you'll find url's to all services you're using. Point it to the WSDL in the same folder. Solution 2: Add the service reference to your project Change your project file and update the url of the service, point it to the wsdl in the same folder as in solution 1 Make the necessary changes to the wsdl in the same folder Update the reference in VS ... this will create a new Reference.cs ... it will update the proxy c

Categories : C#

Using aspects to inject InvocationHandlers without Proxy class
I don't think you can monkey patch in Java easily. I think you could try AOP, or hacking the class directly (as you'll have the source since it's hadoop). Otherwise I think reflection or byte code modification could be an option, but they are all going to be very nasty. Hacking the class directly and using a hacked jar sounds like the most straightforward way to me. Btw Hi :)

Categories : Java

Change EF entity with descendant proxy class
If you value your entity classes being light, you could approach this differently, without putting loading logic in descendant proxies. Instead, keep you entity classes simple and have them loaded externally after they're created (materialized). Ladislav's answer shows how to get to the event that fires after every entity object is created. If you use this approach, subscribe to it with a handler, that distinguishes different entity classes and loads them appropriately - there's a lot of clean ways to do this. Do note that if lazy loading of these properties is beneficial to you, this approach will probably not be useful.

Categories : C#

How to Create proxy class from WSDL File in .net
Add a Service Reference and point it at the WSDL edit As you cant use add Service Reference... http://support.microsoft.com/kb/820122 end edit

Categories : Wcf

JQuery get child of element with class name SharePoint 2013
.text() is a function you need to invoke it alert($('th.ms-acal-month-top').children().children().text()); Demo: Fiddle

Categories : Javascript

Load Class, Generate Object of this class
Well it seems you want to dynamically load the interface say A , as well as the implementing class say B. You can do it via reflection as : Class<?> bClass = Class.forName("packagename.B", true, loader); Class<?> aClass = Class.forName("packagename.A", true, loader); Object bObject = // create an instance of class B via Reflection Object aObject = aClass.cast(bobject); Remember, both the class definitions has to be loaded from a class loader that is a common parent for both. The only purpose the cast serves here to ascertain that indeed B is a subtype of A. Class#cast() : Casts an object to the class or interface represented by this Class object. Reflection tutorial will help you to know hoe to create instances reflectively.

Categories : Java

Internal calls on my proxied class don't get routed through proxy
Instead of doing that maybe message forwarding would work for you. https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Articles/ocrtForwarding.html

Categories : Objective C

Generate GWT class without using GWT.generate
No. In your specific case, I'd rather generate the MyModelImpl et al. upfront, using whichever code generator you want (including, for example, an annotation processor) and then code against the generated classes directly.

Categories : Java

Codeigniter Email class connect to smtp server from behind a proxy
Ok, to send the email your server have to make a tunnel through fsockopen and then use this tunnel to connect to SMTP. I can't specifically tell you what changes you have to made in codeigniter class but i do know a class which can send email via HTTP PROXY http://www.phpclasses.org/package/14-PHP-Sends-e-mail-messages-via-SMTP-protocol.html and following is a test script in which there is an option to configure the proxy. http://www.phpclasses.org/browse/file/31.html In case if you are wondering how this is done and wan't to populate the same logic in codeigniter class, you probably have to first read through lines 884 - 953 of file smtp.php. In my opinion, instead of mimicking the code of this class onto codeigniter mail class, you should use this class instead and change the Person

Categories : PHP

Creating instances of Django proxy models from their base class
I haven't found a "clean" or "elegant" way to do this. When I ran into this problem I solved it by cheating Python a little bit. class Check(models.Model): check_type = models.CharField(max_length=10, editable=False) type = models.CharField(max_length=10, null=True, choices=TYPES) method = models.CharField(max_length=25, choices=METHODS) 'More fields.' def __init__(self, *args, **kwargs): super(Check, self).__init__(*args, **kwargs) if self.check_type: map = {'TypeA': Check_A, 'TypeB': Check_B, 'TypeC': Check_C} self.__class__ = map.get(self.check_type, Check) def run(self): 'Do the normal stuff' pass class Check_A(Check): class Meta: proxy = True def run(se

Categories : Python

Visual Studio Office 365 SharePoint Apps - codebhind and C# classes SharePoint Hosted
Sharepoint hosted application means you need to access sharepoint using the client model, so be ready to use jQuery a lot. In this type of application you need to create all your logics on client as the app gets installed within sharepoint 365 and its very picky with what you install there, after all, it a microsoft server, so it's sandboxed to the fullest. However, if you want to have a more traditional approach, try with autohosted, there you have codebehind, aspx, classes... The whole nine yards. Bear in mind, with autohosted you will have to deal a lot with cross scripting and you will need your own hosting (provider hosted) or an azure account to deploy as all the code is deployed to your hosting and just reference to the application is installed on 365. Check http://msdn.microsof

Categories : C#

Archiving existing task list in Sharepoint 2010 without using Sharepoint Designer
The most straightforward way to solve the problem of separating completed and uncompleted tasks is simply to use views based on the task status. If you MUST move the item to a different location, you can research if Records Management features get you part way, but chances are you'll need to use a tool or write code.

Categories : Sharepoint

What are the restrictions on Office 365 (SharePoint Online) in SharePoint 2013 Environment
Sharepoint 2013 is a game changer, starting with the fact now is possible to use framework 4.5 and, since the new release of visual studio 2013, it's possible to use MVC. From a developing point of view you have to know there are two flavors: Sharepoint hosted. In this case, your whole application is installed within the Microsoft servers. Because of this, you MUST use client object model and javascript. No server code at all. So you will configure your sites, libraries, lists, etc with 365 and then access this information using the Sharepoint javascripts libraries. If you are familiar with js ans sp js the you won't have any problem. Autohosted. In this case you can choose between azure or your hosting (provider hosted) in both cases you can use a more traditional aproach, with your ser

Categories : Sharepoint

Sharepoint 2010 when adding user to a sharepoint group, no permissions are taken
Your group seems to be missing actual permissions to the site. Did you assign the group at least Read permisssions for the site? If not the Check permissions feature works as expected. See this answer for code sample for assigning the group some permissions. If the group has permissions assigned maybe the problem lies in a missing call to spGroup.Update() after adding the user to group. Have you tried calling this method?

Categories : C#

SPServices applications on SharePoint 2010. Will it work on SharePoint 2013?
Per the article linked in response to your question - it does depend on a number of factors and what is deprecated between 2010 and 2013...but I can tell you that I was able to successfully port a company news site/portal that made extensive use of GetListItem AJAX calls and Search queries with no issues. Keep in mind that a lot of stuff still works in 2013 but was deprecated and will probably be removed entirely in future releases. Here's a good list for starters: http://www.c-sharpcorner.com/UploadFile/Roji.Joy/deprecated-features-in-sharepoint-2013-from-sharepoint-2010/

Categories : Jquery

Is it possible in Play 2.1 to convert a JsValue to a case class instance if you only know the name of the case class at the runtime?
You need to implement a PathBinder...this should help out http://www.richard-foy.fr/blog/2012/04/09/how-to-implement-a-custom-pathbindable-with-play-2/

Categories : Scala

Auto-generated proxy class doesn't match service contract
This is expected behavior. The proxy serialized wire format will match the schems defined in the WSDL/XSD. However there are many anonymous types and arrays in the WSDL which have no name and when you work with a proxy you need to name them. So WCF calculates a unique name by chaining names across the element path. If you want a different name then either create a wrapper on top of the proxy (and maintain it) or don't use anonymous types in the WSDL.

Categories : C#

Method not found when setting proxy in HttpClientHandler Portable Class Library (PCL)
This error is due to the HttpClient package not being installed on the consuming project. You should be getting a warning similar: All projects referencing [consuming project] must install nuget package Microsoft.Bcl.Build. Basically, every referencing a class library that references HttpClient & Async must also reference HttpClient & Async.

Categories : C#

SOAP/MTOM: Problems with VS-generated proxy class and handling PDF attachments
Found the answer on my own, finally. In order to get the proxy class set up properly (i.e. in WCF-compliant form), I had to use svcutil via command line to convert the WSDL to the proxy class. After I did that, I was able to set the message binding to MTOM. I'm still having trouble getting it to authenticate with the certificate, but that's a smaller issue.

Categories : C#

Custom ClassLoader to proxy static library class in JUnit tests
First, you should question if it's really necessary to mock the static resolveDependencies() method. Instead, you could make initialize() delegate to another object/method and mock that. Or you could use a half-mock (e.g. via a Mockito spy) that mocks the initialize method on the class under test. Or you could make MyClass so small (by moving functionality into other classes) that it no longer needs to be (unit) tested. Or maybe you can prevent initialize() from being called and do your own initialization instead. If you come to the conclusion that you absolutely need to mock static methods, by all means use a mocking framework that supports this, rather than inventing your own solution (which will be difficult). Two well-known contenders in this market are PowerMock and JMockit. PS: It'

Categories : Java

mysql-proxy proxy.queries:append call failing with .server_capabilities error
The examples/tutorial-scramble.lua file has a lot of problems - I think it is out of date with the current mysql-proxy. You'll need some constants and another parameter for the proto.to_response_packet call: ... local CLIENT_PROTOCOL_41 = 512 -- New 4.1 protocol local CLIENT_SECURE_CONNECTION = 32768 -- New 4.1 authentication local MYSQL_AUTH_CAPABILITIES = ( CLIENT_PROTOCOL_41 + CLIENT_SECURE_CONNECTION ) ... proxy.queries:append(1, proto.to_response_packet({ username = "connect", response = password.scramble(s.scramble_buffer, password.hash("cpass!1")), charset = 8, -- default charset database = c.default_db, max_packet_size = 1 * 1024 * 1024, server_capabilities = MYSQL_A

Categories : Mysql

Generate values from db enum for jpa enum at runtime
If you're updating enum definitions then you shouldn't be using enums. Use a lookup-table with a foreign key reference. Enums are really for cases where you don't expect the enum to change, and where you're prepared to do significant work when they do change. In this case it would be entirely reasonable to expect to have to update all code that uses the enum if you change the enum's definition.

Categories : Java

creating a forward https proxy using http-node-proxy
There are https options which must be specified when handling the https traffic. Here is what I am doing in my proxy setup. var fs = require('fs'), httpProxy = require('http-proxy'); var proxyTable = {}; proxyTable['domain.com'] = 'localhost:3001'; proxyTable['domain.com/path'] = 'localhost:3002'; proxyTable['sub.domain.com'] = 'localhost:3003'; var httpOptions = { router: proxyTable }; var httpsOptions = { router: proxyTable, https: { passphrase: 'xxxxxxx', key: fs.readFileSync('/path/to/key'), ca: fs.readFileSync('/path/to/ca'), cert: fs.readFileSync('/path/to/crt')} }; httpProxy.createServer(httpOptions).listen(80); httpProxy.createServer(httpsOptions).listen(443); The documentation for https is on their github page as well. https

Categories : Node Js

Is there a programmatic way to check if an Entity Framework class meets the requirements for Proxy generation
A simple way is to use a test class. That checks the proxy is there. Otherwise I think you will find it is code and reflection. Perhaps someone has already written the check. edit: here is the MS sample is it a proxy check How to identify Poco proxy

Categories : Dotnet

how to retransform a class at runtime
Short Answer Don't iterate through all the loaded classes from Instrumentation. Instead, just examine the class name passed in to the transformer and if it matches your target class, then transform it. Otherwise, simply return the passed classfileBuffer unmodified. Make the set up calls outside the transformer, (i.e. in your case, do the following from your agent) so initialize your transformer with the class name you're looking to transform (this will be the inner format so instead of foo.bar.Snafu, you will be looking to match against foo/bar/Snafu. Then add the transformer, call retransform and then remove the transformer. In order to call retransform, you will need the actual [pre-transform] class which you can find by calling Class.forName (in the agentmain), or if you absolutely ha

Categories : Java

How to Apply css class on runTime
The problem looks like you are targeting all li elements, including the parent instead of targeting only those are under uid $('#uid li').click(function () { console.log("call lil...'"); $(this).addClass('selected').siblings().removeClass('selected'); }) Demo: Fiddle

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.