Daily Archives

Articles indexed Wednesday April 21 2010

Page 4/126 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • wcf data service security configuration

    - by Daniel Pratt
    I'm in the process of setting up a WCF Data Services web service and I'm trying to sort out the security configuration. Although there's quite a lot of documentation out there for configuring WCF security, a lot of it seems to be outmoded or does not apply to my scenario. Ultimately, I am planning on managing authorization of operations via change interceptors. Thus, all I really need is the simplest way to permit a client to pass credentials along with a request and to be able to authenticate those credentials against either AD or an ASP.NET membership provider (I'd much prefer the latter unless it makes things much more complicated). I'm intending to manage encryption at the transport level (i.e. HTTPS). I'm hoping that the eventual solution does not involve a huge web.config. Likewise, I'd much prefer to avoid writing custom code for the purpose of authentication.

    Read the article

  • Is there a scheduling algorithm that optimizes for "maker's schedules"?

    - by John Feminella
    You may be familiar with Paul Graham's essay, "Maker's Schedule, Manager's Schedule". The crux of the essay is that for creative and technical professionals, meetings are anathema to productivity, because they tend to lead to "schedule fragmentation", breaking up free time into chunks that are too small to acquire the focus needed to solve difficult problems. In my firm we've seen significant benefits by minimizing the amount of disruption caused, but the brute-force algorithm we use to decide schedules is not sophisticated enough to handle scheduling large groups of people well. (*) What I'm looking for is if there's are any well-known algorithms which minimize this productivity disruption, among a group of N makers and managers. In our model, There are N people. Each person pi is either a maker (Mk) or a manager (Mg). Each person has a schedule si. Everyone's schedule is H hours long. A schedule consists of a series of non-overlapping intervals si = [h1, ..., hj]. An interval is either free or busy. Two adjacent free intervals are equivalent to a single free interval that spans both. A maker's productivity is maximized when the number of free intervals is minimized. A manager's productivity is maximized when the total length of free intervals is maximized. Notice that if there are no meetings, both the makers and the managers experience optimum productivity. If meetings must be scheduled, then makers prefer that meetings happen back-to-back, while managers don't care where the meeting goes. Note that because all disruptions are treated as equally harmful to makers, there's no difference between a meeting that lasts 1 second and a meeting that lasts 3 hours if it segments the available free time. The problem is to decide how to schedule M different meetings involving arbitrary numbers of the N people, where each person in a given meeting must place a busy interval into their schedule such that it doesn't overlap with any other busy interval. For each meeting Mt the start time for the busy interval must be the same for all parties. Does an algorithm exist to solve this problem or one similar to it? My first thought was that this looks really similar to defragmentation (minimize number of distinct chunks), and there are a lot of algorithms about that. But defragmentation doesn't have much to do with scheduling. Thoughts? (*) Practically speaking this is not really a problem, because it's rare that we have meetings with more than ~5 people at once, so the space of possibilities is small.

    Read the article

  • Setting default radio button on edit

    - by DTown
    So I'm trying to setup scaffolding to use radio buttons for the format button. It definitely works to add a new and edit. The problem is when I go to edit an entry the correct radio button isn't selected by default. <% form_for(@cinema) do |f| %> <%= f.error_messages %> <p> <%= f.label :title %><br /> <%= f.text_field :title %> </p> <p> <%= f.label :director %><br /> <%= f.text_field :director %> </p> <p> <%= f.label :release_date %><br /> <%= f.date_select :release_date, :start_year => 1900, :end_year => 2010 %> </p> <p> <%= f.label :running_time %><br /> <%= f.text_field :running_time %> </p> <p>Blockquote <%= f.label :format %><br /> <%= f.radio_button :format, "black & white" %> <%= label :format_bw, "Black & White" %> <%= f.radio_button :format, "color" %> <%= label :format_color, "Color" %> </p> <p> <%= f.submit 'Create' %> </p> <% end % Controller def edit @cinema = Cinema.find(params[:id]) end Model class Cinema < ActiveRecord::Base validates_presence_of :title, :on => :create validates_presence_of :title, :on => :update # validates_presence_of :director, :on => :create validates_presence_of :director, :on => :update # validates_presence_of :release_date, :on => :create validates_presence_of :release_date, :on => :update # validates_presence_of :format, :on => :create validates_presence_of :format, :on => :update # validates_presence_of :running_time, :on => :create validates_presence_of :running_time, :on => :update validates_numericality_of :running_time, :on => :create, :on => :update, :less_than_or_equal_to => 300, :greater_than => 0 end

    Read the article

  • Slow local file transfer (copy) on ESX vmware server?

    - by Sorin Sbarnea
    I have a 8 CPU VmWare ESX server (3.5) with 4 HDD drives in RAID that is not loaded at all. I enabled SSH and installed mc (midnight commander) in order to be able to copy(clone) virtual machines but I observed that if does copy the files very slow - around 3.5mb/s on local drive. Why is this happening and how should I solve the issue?

    Read the article

  • Download contents of FTP but only first 10meg of each file?

    - by MrGreen
    I have an FTP of very large files scattered amonst smaller files. I was to be able to download the entire FTP contents, but limit the amount downloaded for each file to 10meg or so. So all files less than 10 meg will be in tact, but all files larger than 10 meg will have the first 10 meg of data. Is this at all possible? Is there at least a way to download all files smaller than 10meg?

    Read the article

  • How to crop Screen Recordings under Snow Leopard?

    - by willc2
    Quicktime Player for Snow Leopard now allows you record the screen. Awesome! Once you have a movie it will let you trim screen recordings for length. Is there a way to crop the movie's dimensions, either in QT or using some built-in or free software? Update: How to crop to an arbitrary size and aspect ratio? iMovie only seems to let you crop to the aspect ratio of the containing project. Result: Both good answers but since I have QuickTime Player 7 and Photoshop, that's the workflow I choose as the answer. NOTE: If you have Photoshop Extended, you can import a movie, use the crop tool, and Export the cropped movie. Not free or built-in, but convenient. To summarize the instructions from the video link ricbax posted: Open movie in QuickTime Player 7 Copy a frame and Paste it into a new document in Photoshop Draw a rectangular selection around the area to keep and fill with black Invert the selection and fill with white Save as .GIF, with 2 colors Back in QuickTime Player 7, open Movie Properties window Select the Video Track Select the Visual Settings Tab Drag and Drop the 2-color .GIF file onto the Mask drop area (or use choose file button) Export the (now cropped) movie DONE

    Read the article

  • Entity Framework with XML Files

    - by Tim
    Can someone point me to a good tutorial explaining the Entity Framework using an XML file instead of a database? I have seen some good tutorials with SQL databases, but I can't make the leap to an XML file. Thanks!

    Read the article

  • Synchronous and asynchronous callbacks

    - by csharpbaby
    I get confused with some terms while reading MSDN documents and code samples. What are callbacks in C#? In particular, what are synchronous and asynchronous callbacks ? Please explain these from a layman's point of view. Also, please explain the IAsyncResult interface. How can we implement it? (with very simple example) Thanks in advance. EDITED: Fixed spelling, grammar

    Read the article

  • Getting window style

    - by Dave18
    I'm trying to check if a window has a certain style using GetWindowLong(hWnd, GWL_STYLE) but that gives me a LONG type of variable. how would you check for a specific style from that?

    Read the article

  • System architecture: simple approach for setting up background tasks behind a web application -- wil

    - by Tim Molendijk
    I have a Django web application and I have some tasks that should operate (or actually: be initiated) on the background. The application is deployed as follows: apache2-mpm-worker; mod_wsgi in daemon mode (1 process, 15 threads). The background tasks have the following characteristics: they need to operate in a regular interval (every 5 minutes or so); they require the application context (i.e. the application packages need to be available in memory); they do not need any input other than database access, in order to perform some not-so-heavy tasks such as sending out e-mail and updating the state of the database. Now I was thinking that the most simple approach to this problem would be simply to piggyback on the existing application process (as spawned by mod_wsgi). By implementing the task as part of the application and providing an HTTP interface for it, I would prevent the overhead of another process that is holding all of the application into memory. A simple cronjob can be setup that sends a request to this HTTP interface every 5 minutes and that would be it. Since the application process provides 15 threads and the tasks are quite lightweight and only running every 5 minutes, I figure they would not be hindering the performance of the web application's user-facing operations. Yet... I have done some online research and I have seen nobody advocating this approach. Many articles suggest a significantly more complex approach based on a full-blown messaging component (such as Celery, which uses RabbitMQ). Although that's sexy, it sounds like overkill to me. Some articles suggest setting up a cronjob that executes a script which performs the tasks. But that doesn't feel very attractive either, as it results in creating a new process that loads the entire application into memory, performs some tiny task, and destroys the process again. And this is repeated every 5 minutes. Does not sound like an elegant solution. So, I'm looking for some feedback on my suggested approach as described in the paragraph before the preceeding paragraph. Is my reasoning correct? Am I overlooking (potential) problems? What about my assumption that application's performance will not be impeded?

    Read the article

  • Java simple encryption

    - by Ran
    Hello, I would like to encrypt a textual (configuration) file stored on disk. Trying to use DES encryption I've had fatal error on client machines, I later found out caused because the algorithm could not handle accented characters (!) I suspect that was because I was using old packages (sun.misc.BASE64Decoder) - but I'm not sure that is the reason. However, I'm looking for a simpler solution - I need a really simple encryption (I know some people would not agree on that) - not RSA of 128 bit keys or so, just obscuring the text from curious eyes. It is really weird that I could not find on the web a simple trivial solution. Any idea, anyone ? Thanks, Ran

    Read the article

  • R cannot be resolved - android error

    - by MaurizioPz
    Hi, I just downloaded and installed the new android sdk. I wanted to create a simple application to test drive it. the widzard creates this code: package eu.mauriziopz.gps; import android.app.Activity; import android.os.Bundle; public class ggps extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } but ecplise give me this error R cannot be resolved on this line setContentView(R.layout.main); can any one explain me why? ps. I do have an xml file named main.xml under res/layout/

    Read the article

  • Some questions regarding Flex

    - by Rachel
    For what real time scenarios/use cases one should go to Flex Technology ? What real time problems you have solved using Flex Technology ? What real time problems have you faced because of using Flex Technology and what was your work around for that use case ?

    Read the article

  • Stack overflow code golf

    - by Chris Jester-Young
    To commemorate the public launch of Stack Overflow, what's the shortest code to cause a stack overflow? Any language welcome. ETA: Just to be clear on this question, seeing as I'm an occasional Scheme user: tail-call "recursion" is really iteration, and any solution which can be converted to an iterative solution relatively trivially by a decent compiler won't be counted. :-P ETA2: I've now selected a “best answer”; see this post for rationale. Thanks to everyone who contributed! :-)

    Read the article

  • Can I access the Cocoa Accessibility API from with Java on OSX?

    - by sanity
    I need to write an app which can observe and manipulate the positions of windows on screen, and I've been told that this requires using Cocoa's Accessibility API. Unfortunately I'm a Java programmer, and Objective C scares me ;) Is it possible to access this Cocoa API from within Java? I know that back when Apple cared about Java it maintained a "bridge" to cocoa, but I'm not sure if this does what I need. Oh, and my IDE is Eclipse, in case that is relevant.

    Read the article

  • Iphone Icon Changed

    - by dragon
    Hi When i start to develop my application , I used iPhone version 2.0.... Now i have update Iphone version 3.0.. My simulator works fine both in iphone 2.0 as well as iphone 3.0.. But When i run my application in 2.0 all icons in the iphone should be correct . But when i run this in 3.0 my other applications icons are changed.... (Example my safari icon should be placed to itunes and itunes icon to settings likewise all icons changed) I dont know why? Can anyone help me? THanks in advance.......

    Read the article

  • design time usercontrols - I can't see anything!

    - by taglius
    newbie question, please forgive... I'm developing a Wpf UserControl that will eventually be bound to a business object. The usercontrol is little more than a series of laid out TextBlocks, and perhaps (later) an image or two. As I'm laying out the usercontrol, I can put dummy text into all the TextBlocks so I can see what the usercontrol will look like, but as soon as I change the text property to contain the Binding information: <TextBlock Margin="0,12.8,42,0" Name="lblLastName" FontSize="8" Height="19" VerticalAlignment="Top" Text="{Binding Mode=OneWay, Path=LastName}"/> Then I can no longer see the textbox, or any "placeholder" text. This makes it very difficult to adjust the location and sizes of all the controls on the UserControl. In WinFormas programming, you could set binding information independently of the Text property, so you could at least see the Placeholder text during design time development. It's going to be pretty hard to visually arrange a bunch of invisible TextBlocks! What's the standard solution for this?

    Read the article

  • How do you generate WSDL using Maven2?

    - by user118802
    I am using jax ws wsgen tool in maven2. I need to deploy the webservice on weblogic10.1 wsgen is not generating the webservice.xml , weblogic-webservices.xml. Is there any way to generate these weblogic related artifacts using wsgen or by anyother tool by inuputting the wsdl.

    Read the article

  • Adding button to jqGrid top toolbar

    - by Ron Harlev
    Looks like the default toolbar for jqGrid is always at the bottom. Buttons like Next/Prev page and the dropdown to select the number of rows per page will always show at the bottom of the grid. I found a way to add a custom top toolbar and push custom buttons into it. What a really need is a way to add default functionality (like paging) to the top of the grid, instead the bottom.

    Read the article

  • C++ 'ClassName Not Declared' Error

    - by Arjun Nayini
    I have this cpp file. dsets.cpp: #ifndef DSETS_CPP #define DSET_CPP //Adds elements to the DisjointSet data structure. This function adds //x unconnected roots to the end of the array. void DisjointSets::addelements(int x){ } //Given an int this function finds the root associated with that node. int DisjointSets::find(int x){ return 0; } //This function reorders the uptree in order to represent the union of two //subtrees void DisjointSets::setunion(int x, int y){ } #endif and this header file dsets.h: #ifndef DSETS_H #define DSET_H #include <iostream> #include <vector> using namespace std; class DisjointSets { public: void addelements(int x); int find(int x); void setunion(int x, int y); private: vector<int> x; }; #include "dsets.cpp" #endif And I keep getting an error that is saying that "DisjointSets has no been declared" ~ ~

    Read the article

  • Generate webservice soap client from wsdl when server using Windows Integrated Authentication

    - by James Black
    There is an SAP server that has some webservices I need to use, so I am trying to use wsimport to generate the client stubs. I don't want to find all the wsdls and schemas that are referenced and modify them to do it locally, as that isn't sustainable, if they service should change. So, how can I use wsimport to fetch a wsdl and generate the client stubs when the server is using Windows Integrated Authentication, where even the wsdl requires credentials.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >