Azure Roles and Instances

Azure Roles and Instances

Can I have a Web Role and a Worker role run on the same instance, or do I have to obtain 2 separate hosting instances and pay twice the amount I would otherwise?I have a WCF Web API that I want to host on Azure. I also have a Worker Role th

change validate message in data annotation

change validate message in data annotation

my object has field with data type int. when i put in html form in this textbox letter not number the validator say- The field must be a number. how can i change this messages like this [Required(ErrorMessage = "Введите название")] [Disp

Run java thread at specific times

Run java thread at specific times

I have a web application that synchronizes with a central database four times per hour. The process usually takes 2 minutes. I would like to run this process as a thread at X:55, X:10, X:25, and X:40 so that the users knows that at X:00,

What determines the number of threads for a TaskFactory spawned jobs?

What determines the number of threads for a TaskFactory spawned jobs?

I have the following code:var factory = new TaskFactory();for (int i = 0; i foo(i1));}static void foo(int i){ Thread.Sleep(1000); Console.WriteLine($"foo{i} - on thread {Thread.CurrentThread.ManagedThreadId}");} I can see

How to make AsyncTask modular in android

How to make AsyncTask modular in android

I am quite new to Android Development. I am working in a app where i need to make a lot of async calls to api. For each and every API call, I have to write the similar looking AsyncTask class over and over again. So, is there any way to mak

Finish the calling activity when AsyncTask completes

Finish the calling activity when AsyncTask completes

My calling activity:public class Hello extends Activity { public void onCreate(Bundle savedInstanceState) { MyTask mt = new MyTask(this); mt.execute();}Now In MyTask (an external class):public class MyTask extends AsyncTask {private

iOS: NSURLSession category methods not being found at runtime

iOS: NSURLSession category methods not being found at runtime

I wanted to create a category on NSURLSession. The app compiles ok, but when I attempt to call the category methods I get -[__NSCFURLSession doSomething]: unrecognized selector sent to instance 0xbf6b0f0:0: error: -[NSURLSession_UPnPTests t

Knockout js -> Bind to editable div text?

Knockout js -> Bind to editable div text?

How can I bind an observable to an editable div text content? 1:You will need to modify the default "text" binding so that it is able to write the content of the edited div back to the observable. A simple custom binding handler for this

HTTP 503 Service is unavailable when trying to browse signalr/hubs

HTTP 503 Service is unavailable when trying to browse signalr/hubs

I have a windows hosted SignalR hub created in VS2012:public class Startup{ public void Configuration(IAppBuilder app) { app.UseCors(CorsOptions.AllowAll); app.MapSignalR(); }}public static class SignalR{ public st

Google Analytics Embed API Server Side Authorization not rendering the charts with C#

Google Analytics Embed API Server Side Authorization not rendering the charts with C#

I am trying to render charts using Server Side Authorization in C# but I am not able to do it.Google has an example but based on Python and I need to build based on C# MVC:https://ga-dev-tools.appspot.com/embed-api/server-side-authorization

Async and Await with HttpWebRequest.GetResponseAsync

Async and Await with HttpWebRequest.GetResponseAsync

I am trying to use Async and Await when making a web request and am finding that it never gets past the await line. I am doing this from a Metro app, but I also verified the problem in a winforms app.public async Task DoSomething(){ str

How to add pagination in UITableView.? [closed]

How to add pagination in UITableView.? [closed]

I parse data from API for the first page and add it to UITableView, now pages can be multiple lets say 100, I also get total number of pages from API also. but how will i implement it in tableView for every page and show indicator while scr

build AST in antlr4

build AST in antlr4

I was wondering whether we could build an AST using Antlr version 4. I couldn't find any reference on building it using antlr4.One SO answer says that it would be easy to use antlr4 which produces only parse tree but my question is what abo

how to set and get static variables from spark?

how to set and get static variables from spark?

I have a class as this:public class Test { private static String name; public static String getName() { return name; } public static void setName(String name) { Test.name = name; } public static void print()

How to Control Android back stack

How to Control Android back stack

Lets say I haveA->B->C->D->EIn android back stack. I want to be able to get back to one of the following:A->B->CA->BAHow can I achieve this? Hopefully without forcing back button clicks. 1:Using the image and information from the offic

individually minify JS and CSS in Visual Studio 2010

individually minify JS and CSS in Visual Studio 2010

I'm currently migrating a project to Visual Studio 2010 and am trying to figure out how to minify JS and CSS files individually on build.In Visual Studio 2008 I used a Web Deployment Projects with a build task that referenced the C# port of

How to receive output of NSTask in Cocoa?

How to receive output of NSTask in Cocoa?

I'm using NSTask in my Cocoa APP , and I need to be able to get result, and store it in Array, or something... I'm executing terminal commands from APP, and I need outputs for them.NSString *path = @"/path/to/command";NSArray *args = [NSArr

Android Repetitive Task

Android Repetitive Task

In an Activity, I need to call a web service every 30 seconds or so, and use the data to update the UI.Is there a recommended approach on how to schedule a repetitive task? Thanks 1:If this is in a running activity, you could use Timer/T

How to set timer to execute at specific time in c#

How to set timer to execute at specific time in c#

I have a requirement where i need to execute timer at 00:01:00 A.M every day...But i am not getting how to achieve this ..If i am taking Systems time,it can be in different format..Here is my timer code..static System.Timers.Timer timer;ti

why doesn't .net allocate memory when initialize a 2d array?

why doesn't .net allocate memory when initialize a 2d array?

var a = new double[7000,7000]; FillValue(a,3);It seems .Net doesn't actually allocate any memory to a after executing the first line. Only while it is running the FillValue call does it gradually eat the memory. (which is around 400MB)Can a

How do we do idle time processing in WPF application?

How do we do idle time processing in WPF application?

Is there a way to do idle time processing in WPF application equivalent to OnIdle event in MFC? 1:You can dispatch a task (using the Dispatcher in the normal way) with a DispatcherPriority of ApplicationIdle, which will only be executed

How to automatically create batch / shell scripts to run a Java console application?

How to automatically create batch / shell scripts to run a Java console application?

I have a Java command-line application, and would like to create an Ant* build script that will create all the required batch/shell scripts to run the application successfully including all the classpath variables. I need it to do the follo

Using C# to execute PowerShell script with command line args using V2 methods

Using C# to execute PowerShell script with command line args using V2 methods

I am writing an C# application which will need to execute Powershell scripts with command line arguments and retrieve the output (aka what I would expect to see in the output window of PowerShell ISE - including exception information)I have

Elixir ecto 2 create many_to_many association

Elixir ecto 2 create many_to_many association

How can I make a many to many relation with ecto 2? As an example app I want to create a Post which can be in multiple categories. The categories already exist. For example:[%Category{id: "1", name: "elixir"}, %Category{id: "2", name: "erla

Spring @Async limit number of threads

Spring @Async limit number of threads

My question is very similar to this one : @Async prevent a thread to continue until other thread have finishedBasically i need run ~ hundreds of computations in more threads. I want to run only some amount of parallel threads e.g. 5 threads