w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Can Azure Worker Process stop itself?
So I think you're referring to Worker Roles, right? A worker process would simply be something you run in your app (like a thread, a method, something). Azure Worker Roles are full VMs. Assuming that's what you meant: The new announcement about stopping VMs does not apply to Web / Worker Role instances; it applies to Virtual Machines. And those can be stopped easily via REST call (or much easier via PowerShell that wraps the REST call). You could make that call from a Virtual Machine, which would effectively shut itself down, but I'm not so sure that's a sound idea. If you take that approach, it will be very hard for you to track the role-stop progress, since you would have just stopped the VM that made the call.

Categories : Azure

How many instances of a web application are running in one worker process?
I'm not sure if this applies to you, but HttpModule Initialize methods are called more than once because even though there is only one Application instance. One HttpApplication can spawn multiple HttpModule instances, so make sure those initializations are thread safe. Application_Start and _End will fire only once per site start and stop with your current settings, so that will not be the issue. If you are using the HttpContext.Cache object, you might have the issue mentioned in this answer: HashTable in HttpContext.Current.Cache If you want, you can try using WinDbg and get a dump of what is going on in your process but that is a really heavy-handed tactic that probably won't shed as much light as just looking through the code. Not until you look at it a little harder, and are still s

Categories : Asp Net

Perl's worker don't process connections, waiting on a futex
According to futex man page: This system call is typically used to implement the contended case of a lock in shared memory, as described in futex(7) So my first question: is your Perl script using "Perl Threads" and are you having contention on a shared memory variable?

Categories : Perl

ImportError being generated when trying to run django-celery worker process
I'm pretty sure this line is your problem: File "C:sitescorecrmpeoplemodels.py", line 163, in <module> UserProfile._meta.get_field_by_name('username')[0]._max_length = 75 While you're still busy importing from people.models, this line (in particular get_field_by_name) forces Django to evaluate the model and setup all relationships between that model and it's related models. This, in turn, forces an import of Customer in people.models, while you're still busy importing that exact model. This is what results in an ImportError. For a working solution you'll need to post your models.py. Why does this error only occur with celery? I can't say for sure without some more information, but my best guess is that Celery handles importing everything slightly different (Django probably

Categories : Django

What is the relationship between Application Pools and worker process threads?
Yes, each application pool is typically a single process1, but can contain multiple threads. You can assign multiple sites to an application pool, and those sites will all run under the same process, however they will run under different "app domains", which are security contexts that separate the code of one site from another, even if they're running on the same app pool. Two users hitting the site at the same time can run on different threads, meaning they can run concurrently. That means any logging can have values interspersed. You might want to add a session value to your logging so you can sort based on session. App pool restarts (recycling) are normal, 20 restarts in a day does not seem unusual. They can happen multiple times per day, and IIS controls when app pools are restar

Categories : Asp Net

PHP process takes a long time to finish, how can I farm it off to a worker
PHP cant multi-thread, it can fork - but only when not going through apache! Look at using a Worker system, like PHP-Resque It makes life so much easier :)

Categories : PHP

Worker process not releasing memory and Oracle connection not closing
Once I ran into the same issue and I bumped into this article and this one. I exchanged a few emails with the author (Paul Wilson) and he helped me to understand the problem with large objects which are allocated in memory in a "Large Object Heap" and it never gets compacted. This is what he told me: Larger objects are indeed allocated separately, where large is something around 60-90 KB or larger (I don't remember exactly, and its not officially documented anyhow). So if your byte arrays, and other objects for that matter, are larger than that threshold then they will be allocated separately. When does the large object heap get collected? You may have ran into statements about there being several generations of normal memory allocation (0, 1, and 2 in the current f

Categories : Vb.Net

Debug worker project run as a process from another project in VS
You don't give much info about the interaction between the gui and the worker, but if attaching to the process is too hard (typically beacuse the worker only runs briefly), a more usable scenario is to add a configuration option to the gui to add an extra argument to the worker command line, on which the worker responds with a DebugBreak. For example the worker's main would be var args = ParseArguments(); //check if string 'WaitForDeugger' is on command line if( args.RequestsDebug ) System.Diagnostics.Debugger.Break(); .... And the gui invokes the worker like this: var args = GetArgumentsForWorker(); if( someSpecialDebugOptionEnabled ) args += " WaitForDeugger"; Process.Start( "worker.exe", args );

Categories : C#

NServiceBus Distributor Worker creates a new worker queue
When you start the endpoint, you'll see a warning logged, which explains the reason. 2013-08-26 18:56:48,473 [1] WARN NServiceBus.ConfigureDistributor [(null)] <(nu ll)> - 'MasterNodeConfig.Node' points to a local host name: [localhost]. Worker input address name is [Orders.Handler.810aa1ea-7eb4-47b3-b639-724c4498a999@SELEN E]. It is randomly and uniquely generated to allow multiple workers working from the same machine as the Distributor. Here's some documentation on the distributors and the explanation of the Scale out sample as well. http://particular.net/articles/load-balancing-with-the-distributor http://particular.net/articles/scale-out-sample. Check out the Hands on Lab (Intermediate lab), which will walk you through the Scale out lab as well. The Scale out lab will sh

Categories : Misc

I do not understand why this worker cannot spawn a sub-worker in IE10 HTML5
I'm in about the same boat. My plan is to load a subworker from another doamin or file:// protocol because you cannot load one directly from a regular js script. I still need to test this, but I know that Workers/SharedWorkers are not subject to the normal Cross-Origin Restriction Policy, except** for when you're trying to load one (and hopefully only when doing this from a window script). Another method is to use window.postMessage to forward messages to a Worker that it has created in the other window. Alternatively, for my specific needs I am considering running a headless browser locally, a CDN, or a localhost "forever-server" with CORS enabled -- but this most likely still requires a window.postMessage(). Hope this helps, Tim! Post back if you find an answer, eh?

Categories : Javascript

Can I get the ID of my sidekiq worker inside the worker?
You can access the job id using the jid accessor method and the thread id using the Thread.current method. Like this: logger.info "JID #{jid} - TID #{Thread.current.object_id.to_s(36)}"

Categories : Ruby On Rails

Connecting an Azure worker role to a dedicated cache worker role
Hello maybe you should try to set the connection between them using Inter Role Communication, you can find an answer for how to make the inter role communication in the following stackoverflow website: How to do inter-role communication with Azure? you can also find more details in the following link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx I hope this helps you solve your problem please let me know if you need anything else.

Categories : Caching

How to Redirect in ASPNET Web API
Is there a Web API controller method equivalent to the MVC controller method RedirectToAction? You could set the Location header: public HttpResponseMessage Get() { var response = Request.CreateResponse(HttpStatusCode.Found); response.Headers.Location = new Uri("http://www.google.com"); return response; }

Categories : Asp Net Web Api

ASPNET C# onclientclick
I would create a property to access like Code Behind string _selectedValue; public string SelectedValue { get { return _selectedValue; } } Set the '_selectedValue' as your grdFlights.SelectedDataKey.Value Then in the .aspx page you can do var value = <%# SelectedValue%>; onclientclick="window.open('../Prints/EASYBRIEF.aspx?' + value)" Something to that effect.

Categories : C#

How to receive data in aspnet mvc from swf
Your ASP method is expecting a parameter called data. So my guess is it would work if you did this in the AS3 code: request.data = { data: {id:1, name:"hello"} }; //creating an object with the property data, and giving it's value an object with id and name properties Or, even better, ignore the line above and keep the flash as is, and make a View Model with id and name properties in ASP. Then the MVC data binder will do it's magic. public class FlashData { public string id {get;set;} public string name {get;set;} } public HttpResponseMessage Post(FlashData data){ //data.id //data.name return Request.CreateResponse(HttpStatusCode.OK, data); } Another thing you could try is this: public HttpResponseMessage Post(string id, string name){ return Request.CreateRe

Categories : Asp Net Mvc

Aspnet MVC 4 routing challenges
Your routes are exactly the same. It's impossible to differentiate between /DepartmentName/ProductName and /Controller/Action. You need something else in the URL in order to differentiate between the two things, e.g.: routes.MapRoute( name: "ProductDetailsPage", url: "/Products/{DepartmentName}/{ProductName}", defaults: new { controller = "ContentPage", action = "ProductDetail" } ); And then navigate to /products/departmentname/productname

Categories : Asp Net Mvc

Does AspNet automaticaly decode url?
If I recall my MVC correctly, you should encode from the client side. The parameter in the controller method is going to expect clean input. I never had to decode within the controller method.

Categories : Asp Net Mvc

C# method in view [ aspnet mvc ]
<% %> blocks can only contain statements. (the code in the block is placed inside the generated function) To add fields or methods to the generated class, use <script runat="server">...</script>.

Categories : Asp Net Mvc

Decoupling Microsoft.AspNet.Identity.*
Yes this is a fully supported scenario, basically you will want to use exclude using the Microsoft.AspNet.Identity.EntityFramework dll which has the default EF implementation, but you should be able to reuse the Manager classes and just implement your own custom Stores using your own POCOs which the manager will use just fine via the interface. For RTM its been streamlined and simplified a bit more, I believe the RC version was not quite as streamlined yet. Updated You can get early access to the RTM bits here: MyGet

Categories : Asp Net Mvc

MFC: sending a msg from worker thread to the Main thread to stop the worker thread
Actually, the only safe way to do anything to a worker thread is from within the worker thread itself. It should probably be structured as a while(bRun) loop so it runs until the program is shutting down. Whatever you are trying to do (stop and start) should be handled by code in the while loop.

Categories : C++

In MVC 4 how aspnet db mebership table create in mdf file
MVC 4 does not use the traditional ASP.NET Membership, which you seem to be referring to. When you use the Internet template to create a new MVC 4 application it uses something referred to as SimpleMembership which uses EF code-first and should automatically create a local database in the app_data folder. Look in the web.config for the default connection string to see what the name of the file is. The default connection string I am referring to is generated by the Internet Template and looks something like this: <add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)v11.0;Initial Catalog=aspnet-MvcApplication1-20120822144338;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnet-MvcApplication1-20120822144338.mdf" />

Categories : Asp Net Mvc

LastActivityDate different than LastLoginDate in ASPNET Membership Provider
For a new user the LastLoginDate and the LastActivityDate is equal to the CreationDate. The LastLoginDate is updated when the method "ValidateUser" is called. In most cases this will be at login. The LastActivityDate is also updated when the method "ValidateUser" is called but also when information from the profile is requested. So in that last case it can happens that when you have for example a backendpage with a list of all users including some profile information that you will see that the LastActivityDate is the same for all the users. The LastActivityDate will then be set to the date and time you access the backendpage.

Categories : Asp Net

IdentityStoreManager could not be found after upgrading Microsoft.AspNet.Identity to rc1
Update the following nuget packages: Microsoft ASP.NET Identity EntityFramework version="1.0.0-rc1" Microsoft.Owin.Security version="2.0.0-rc1" Microsoft.Owin.Security.OAuth version="2.0.0-rc1" Get these: Microsoft.AspNet.Identity.Owin version="1.0.0-rc1" Microsoft.Owin.Host.SystemWeb version="2.0.0-rc1" Then you will still have a lot of errors in your AccountController.cs file. But now you have the classes in your project to fix them, or you could get my AccountController.cs file which is fixed, well it compiles and the application runs, but there is a spot (commented with todo:) that I am not sure about yet. You can download my AccountController.cs file from my sample project on github here: https://github.com/onybo/Asp.Net-Identity-RC1-sample-app

Categories : Entity Framework

Microsoft.AspNet.WebApi.Client IsSuccessStatusCode not working
IsSuccessStatusCode will only return a value if a HTTP request is made. If it can't connect to the server you will get an exception throw instead. It works with fiddler running because your client is actually connecting to fiddler and then fiddler is trying to connect to your server. You have two choices. Either catch the Exception, or install a second self-host web api that is running on the same port but using a Weak Wildcard. That second service will only get hit if your main service is not running.

Categories : Asp Net Web Api

Programmatically inserting a new user into an aspnet membership schema
I haven't used MYWSAT yet but if it works with the default ASP.Net membership provider then try this: MembershipUser newUser = Membership.CreateUser("username", "password", "email@a.com"); The membership provider will determine whether to encrypt or send a clear password. It really depends on your settings in your web.config (system.web --> membership --> providers).

Categories : C#

LinkedIn OAUTH - Still can't get email-address using DotNetOpenAuth.AspNet
I have two solutions to this, although I still don't understand how to get my existing code to work as I'd expect, but hopefully this may help someone else; (1) I went to Making it easier for you to add default member permissions and clicked on the API admin page. Here you can select what scopes you want requested by default. It didn't work until I clicked a box (now disappeared) that was worded along the lines of "[x] Make this permanent". Once I'd done that I started to get the email-address field populated as I was expecting. (2) I tried using the OAuth2 URL instead from information here and it seemed to work. I have also found an implementation of an OAuth2 client here which looks like a good start. I suspect that in the long run, an OAuth2 upgrade (once the spec is more static) w

Categories : C#

ASPNET MVC4 Facebook app - FacebookAuthorize filter and post data
I found an answer. The key is to add a hidden field named "signed_request" and fill it with the same value from request: vm.signed_request = Request["signed_request"]; Why is that so? Here lies the answer: https://github.com/ASP-NET-MVC/aspnetwebstack/blob/master/src/Microsoft.AspNet.Mvc.Facebook/Authorization/FacebookAuthorizeFilter.cs FacebookAuthorizeFilter checks that particular field and makes a redirect if field is not filled. I've described it further here and introduced useful Html helper for that purpose: My blog post

Categories : Asp Net Mvc

ASPNET. Signed PDF file saved to sql server, problems when retrieving
Finally I've decided not to use response object and open a link to the virtual directory in the server where I store the file created with File.WriteAllBytes method. I haven't been able to make it work through response.

Categories : Asp Net

Compiler Errors after updating Microsoft.Aspnet.Identity in MVC5
Think i have finally found the resource which answers this. There is an asp.net/vs2013 refresh which updates the templates to the beta preview of Identity and removes the breaking changes

Categories : Asp Net Mvc

ASPNET Session between jQuery AJAX calls in a CORS enviroment
You need to set withCredentials which means the client wants implicit "stuff" to be sent (which includes cookies): http://brockallen.com/2012/12/15/cors-and-windows-authentication/ Also, given that you need "credentials" to be allowed, the server must respond with Access-Control-Allow-Origin with the specific origin requesting -- it can't use "*".

Categories : Jquery

Custom Membership with Microsoft.AspNet.Identity - CreateLocalUser fails
PulseUser.Id is defined as a string but doesn't appear to be set to a value. Were you meant to be using a GUID for the Id? If so, initialise it in the constructor. public PulseUser() : this(String.Empty) { } public PulseUser(string userName) { UserName = userName; Id = Guid.NewGuid().ToString(); } You will also want to perform a check that the user name doesn't already exist. Look at overriding DbEntityValidationResult in PulseDbContext. Do a new MVC project in VS2013 to see an example.

Categories : Asp Net Mvc

How to give scopes in AspNet.Membership.OpenAuth and get extra data from facebook?
This does not work although there is a provision to add extra data as per many developers. Some say this feature worked before but subsequently dropped due to one of facebook policy which asks developers to ask basic and publish scope differently. //following code will not work, although option is given var extraData= new Dictionary<string, object>(); extraData.Add("scope", "email,publish_actions,create_event"); //facebookSocialData.Add("perms", "status_update"); OAuthWebSecurity.RegisterFacebookClient( "xxxx", "yyyy", "Facebook", extraData); My suggestion is to make your own custom methods which will allow you to set custom scope or just pull the source of dotnetopenauth and change its code to suite

Categories : C#

working with ashx file get current user aspnet membership provider
The reason you're not able to get the user is because you're not inside a page. You could get it from the context though: HttpContext.Current.User.Identity.Name.ToString();

Categories : Asp Net

could not load type 'system.data.entity.design.aspnet.entitydesignerbuildprovider'
Open your web.config and add this line below in the Assemblies section: <add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" /> For more information, check this link: http://forums.asp.net/t/1698282.aspx Hope this helps

Categories : Asp Net

Instantiating a worker role from a worker role
If your worker roles are different applications, you could make use of Service Management API to create a new deployment for WR-2 from WR-1. What you would do is put the package and configuration files of WR-2 in blob storage and when WR-1 has done putting all the messages in the queue, you create a new deployment of WR-2. To create a deployment programmatically using Service Management API, please see here: http://msdn.microsoft.com/en-us/library/windowsazure/ee460813.aspx. However you would need to ensure that once WR-2 has done all the data, it is destroyed by WR-1 so that you don't keep on incurring charges. Other possibility is to run your worker role instances to run in Master/Slave configuration. Let's say there are 2 instances of your worker role running. One of the instance would

Categories : C#

Using the ion_auth login process and using a templated process to render the login process
There is no need to use ion_auth views or controllers. they are just for reference. we have to use their function as they have define in model for login/logout/register etc... just simply put his model,library and config file to the respective folder of codeigniter in your project and just use their function as they have shown in demo

Categories : Codeigniter

Html or Aspnet button on ColorBox Popup Redirect to another aspx page on button click
This would propably be a lot easier if you could use a simple html form, add the value to a hidden input when onsubmit is triggered, and post it to a webservice which will redirect for you. Anyway: You need to decorate your btnSaveData method with another attribute and change the return type / parameter to string (or any other type that suits your needs): [ScriptMethod(ResponseFormat = ResponseFormat.Json)] [WebMethod] public static string btnSaveData(string color) { // do sth with the color return "/SaveSuccess.aspx"; } And in js: // retrieve the color as a string (this is up to you - I don't know what sort of ColorPicker you're using, so this is a placeholder) function saveColor() { var color = $('#myColorPicker').color.

Categories : Asp Net

Where is Microsoft.AspNet.Identity.Owin.AuthenticationManager in Asp.Net Identity RTM version?
That class is gone, as it was basically just adding methods that generated a ClaimsIdentity and passed that into an Owin.Security.IAuthenticationManager. Instead the RTM templates have a SignIn method in the controller that looks something like this: private async Task SignInAsync(ApplicationUser user, bool isPersistent) { AuthenticationManager.SignOut(DefaultAuthenticationTypes.ExternalCookie); var identity = await UserManager.CreateIdentityAsync(user, DefaultAuthenticationTypes.ApplicationCookie); AuthenticationManager.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity); }

Categories : Asp Net

cross memory attach. How do I get the remote address from a child process to a parent process
The system calls process_vm_readv and process_vm_writev are meant for fast data transfer between processes. They are supposed to be used in addition to some traditional way of interprocess communication. For example, you may use a regular pipe or fifo to transfer the required addresses between your processes. Then you may use those addresses to establish faster process_vm_ communication. The simpliest way to transfer something between forked processes should be the pipe() function (man 2 pipe has a good example of its usage). There are many other ways to do so of course, like using sockets or messages. You can even write an address to a file and let the other process read it.

Categories : C

How do I deal with cases when Process.Kill() yields "access denied" because the process is terminating?
Use the command line C# to kill the task, for example Taskkill /F /IM ExeName.exe. If you do not have a persmission to kill the task than also force kill will not help. More info Please check http://www.c-sharpcorner.com/UploadFile/8ea152/kill-process-from-the-command-prompt-in-windows-8/ here an example how to run command line in C# Run Command Prompt Commands Greetings

Categories : C#



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