Search Results

Search found 8397 results on 336 pages for 'implementation'.

Page 20/336 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • FILESTREAM/FILETABLE Clarifications for Implementation

    - by user1209734
    Recently our team was looking at FILESTREAM to expand the capabilities of our proprietary application. The main purpose of this app is managing the various PDFS, Images and documents to all of the parts we manufacture. Our ASP application uses a few third party tools to allow viewing of these files. We currently have 980GB of data on the Fileserver. We have around 200GB of Binary data in SQL Server that we would like to extract since it is not performing well hence FILESTREAM seems to be a good compromise to the two major data storage/access issues. A few things are not exactly clear to us: FILESTREAM Can or Cannot store its data on a drive that is not locally attached. We already have a File Server with a RAID 10 (1.5TB drives). This server stores all of the documents right now, would we have to move these drives to the SQL Server for FILESTREAM? That would be a tough bullet to bite since the server also is doubling as the Application Server (Two VMs on one physical server). FILETABLE stores the common metadata about the files but where is the Full Text part of it stored to allow searching of files like doc/docx? Is this separate? Are you able to freely add criteria to this to search by? If so any links to clarify would be appreciated. Can FILETABLE be referenced in another table with a foreign key? Thank you in advance EDIT: For those having these questions this web video covered everything and more in terms of explaining filestream from 2008 to 2012 and the cavets to consider (I would seriously rep him if I could): http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2270 In conclusion we will not be using FILESTREAM as it would be way to huge of an upsurge to accommodate for investment. EDIT 2: Update to #1 - After carefully assessing FileTable in addition to FILESTREAM we got a winning combination. We did have to move the files over to the new server (wasn't to painful since they were on the same VM).It honestly took more time to write an extraction tool to dump the binary data within SQL to the File System. Update to #2 - This was seperate but again Bob had an excellent webinar explaining this: http://channel9.msdn.com/Events/TechEd/Europe/2012/DBI411 Update to #3 - Using TFT inheritance we recycled the Docs table we had (minus the huge binary blobs) which required very little changes in our legacy apps. This was a huge upshot for the developer team.

    Read the article

  • CultureInfo on a IValueConverter implementation

    - by slugster
    When a ValueConverter is used as part of a binding, one of the parameters to the Convert function is a System.Globalization.CultureInfo object. Can anyone tell me where this culture object gets its info from? I have some code that formats a date based on that culture. When i access my silverlight control which is hosted on my machine, it formats the date correctly (using the d/MM/yyyy format, which is set as the short date format on my machine). When i access the same control hosted on a different server (from my client machine), the date is being formatted as MM/dd/yyyy hh:mm:ss - which is totally wrong. Coincidentally the regional settings on the server are set to the same as my client machine. This is the code for my value converter: public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is DateTime) { if (parameter != null && !string.IsNullOrEmpty(parameter.ToString())) return ((DateTime)value).ToString(parameter.ToString()); else return ((DateTime)value).ToString(culture.DateTimeFormat.ShortDatePattern); } return value; } basically, a specific format can be specified as the converter parameter, but if it isn't then the short date pattern of the culture object is used.

    Read the article

  • Weighted random selection using Walker's Alias Method (c# implementation)

    - by Chuck Norris
    I was looking for this algorithm (algorithm which will randomly select from a list of elements where each element has different probability of being picked (weight) ) and found only python and c implementations, after I did a C# one, a bit different (but I think simpler) I thought I should share it, and ask your opinion ? this is it: using System; using System.Collections.Generic; using System.Linq; namespace ChuckNorris { class Program { static void Main(string[] args) { var oo = new Dictionary<string, int> { {"A",7}, {"B",1}, {"C",9}, {"D",8}, {"E",11}, }; var rnd = new Random(); var pick = rnd.Next(oo.Values.Sum()); var sum = 0; var res = ""; foreach (var o in oo) { sum += o.Value; if(sum >= pick) { res = o.Key; break; } } Console.WriteLine("result is "+ res); } } } if anyone can remake it in f# please post your code

    Read the article

  • Spring 3 Controller Exception handler implementation problems

    - by predhme
    I was hoping to implement a single "ExceptionController" to handle exceptions that are thrown in execution of my other controllers' methods. I hadn't specified any HandlerExceptionResolver in my application context so according to the API documentation the AnnotationMethodHandlerExceptionResolver should be started. Verified as such in the source. So I am curious to know why the following isn't working. @Controller public class ExceptionController { @ExceptionHandler(NullPointerException.class) public ModelAndView handleNullPointerException(NullPointerException ex) { // Do some stuff log.error(logging stuff) return myModelAndView; } } @Controller public class AnotherController { @RequestMapping(value="/nullpointerpath") public String throwNullPointer() { throw new NullPointerException(); } } I see in the debug logs that the three default exception handlers are asked for handling of the exception, but nothing is done and I see "DispatcherServlet - Could not complete request". Followed by the user being displayed the stacktrace and a 500 Internal error.

    Read the article

  • JMS messaging implementation

    - by Gandalf StormCrow
    I've been struggling with this "simple" task for more expirienced people, I'm stuck for 2 days now need help. I've changed things arround like zillion times now, finally I stumbled upon this spring JMS tutorial. What I want to do, Send a message and receive it. I've been also reading this book chapter 8 on messaging. It really nicely explains 2 type of messaging and there is nice example for publish-and-subscribe type but now example for point-to-point messaging( this is the one I need). I'm able to send message to the queue on my own, but don't have a clue how to receive thats why I tried with this spring tutorial here is what I've got so far : SENDER : package quartz.spring.com.example; import java.util.HashMap; import java.util.Map; import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.Queue; import javax.jms.Session; import org.springframework.jms.core.MessageCreator; import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.core.JmsTemplate102; import org.springframework.jms.core.MessagePostProcessor; public class JmsQueueSender { private JmsTemplate jmsTemplate; private Queue queue; public void setConnectionFactory(ConnectionFactory cf) { this.jmsTemplate = new JmsTemplate102(cf, false); } public void setQueue(Queue queue) { this.queue = queue; } public void simpleSend() { this.jmsTemplate.send(this.queue, new MessageCreator() { public Message createMessage(Session session) throws JMSException { return session.createTextMessage("hello queue world"); } }); } public void sendWithConversion() { Map map = new HashMap(); map.put("Name", "Mark"); map.put("Age", new Integer(47)); jmsTemplate.convertAndSend("testQueue", map, new MessagePostProcessor() { public Message postProcessMessage(Message message) throws JMSException { message.setIntProperty("AccountID", 1234); message.setJMSCorrelationID("123-00001"); return message; } }); } } RECEIVER : package quartz.spring.com.example; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; public class ExampleListener implements MessageListener { public void onMessage(Message message) { if (message instanceof TextMessage) { try { System.out.println(((TextMessage) message).getText()); } catch (JMSException ex) { throw new RuntimeException(ex); } } else { throw new IllegalArgumentException("Message must be of type TextMessage"); } } } applicationcontext.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd"> <bean id="sender" class="quartz.spring.com.example.JmsQueueSender" init-method="sendWithConversion" /> <bean id="receiver" class="quartz.spring.com.example.ExampleListener" init-method="onMessage" /> </beans> Didn't really know that learning curve for this is so long, I mean the idea is very simple: Send message to the destination queue Receive message from the destination queue To receive messages, you do the following(so does book say): 1 Locate a ConnectionFactory, typically using JNDI. 2 Use the ConnectionFactory to create a Connection. 3 Use the Connection to create a Session. 4 Locate a Destination, typically using JNDI. 5 Use the Session to create a MessageConsumer for that Destination. Once you’ve done this, methods on the MessageConsumer enable you to either query the Destination for messages or to register for message notification. Can somebody please direct me towards right direction, is there a tutorial which explains in details how to receive message from the queue?I have the working send message code, didn't post it here because this post is too long as it is.

    Read the article

  • What is the most simple implementation of IDynamicMetaObjectProvider?

    - by Néstor Sánchez A.
    Hi, I have this scenario... 1.- I'm providing a "Dynamic Table" for wich users can define Fields. Each Dynamic Table will have as many rows/records as needed, but the Field definitions are centralized. 2.- My Dynamic Row/Record class was inherited from the .NET DLR DynamicObject class, and the underlying storage was a List appropriately associated to the defining fields. Everything works fine! BUT... 3.- Because I need to Serialize the content, and DynamicObject is not Serializable, I was forced to generate and carry a Dynamic Object when dynamic member access is required. But this is ugly and redundant. So, I need to implement IDynamicMetaObjectProvider myself to achieve dynamic access and serialization together. After googling/binging unsuccessfully I ask for your help... Can anybody please give a good example (or related link) for doing that?

    Read the article

  • traveling salesman problem, 2-opt algorithm c# implementation

    - by TAB
    Hello Can someone give me a code sample of 2-opt algorithm for traveling salesman problem. For now im using nearest neighbour to find the path but this method is far from perfec, and after some research i found 2-opt algorithm that would correct that path to the acceptable level. I found some sample apps but withoud source code.

    Read the article

  • Implementation of ceil function in C.

    - by RBA
    Hi, I have two doubts regarding ceil function.. 1. The ceil() function is implemented in C. if i use ceil(3/2), it works fine.. But when i use ceil(count/2)-if value of count is 3, then it gives compile time error.. /tmp/ccA4Yj7p.o(.text+0x364): In function FrontBackSplit': : undefined reference toceil' collect2: ld returned 1 exit status How to use the ceil function in second case?? Please suggest.. 2. How can i implement my own ceil function in C. Please give some basic guidelines. Thanks.

    Read the article

  • Interface implementation Diferences

    - by carlos
    What is the diference of using interfaces like ... I have an interface Public Interface IProDataSource Function read() As Integer End Interface Then a class Public Class DataSource : Implements IProDataSource Function read() As Integer Implements IProDataSource.read some code... End Function End Class Then I use this the next way ... but what is the difference? ... boths approaches are working ... Dim obj As IProDataSource = New DataSource obj.read() vs Dim datas as new Datasource datas.read() The only difference I have notice is that if the method is declare private it will be visible using the first approach only. Thanks for any comments !!!

    Read the article

  • Looking for feedback on a first SAML implementation.

    - by morgancodes
    Hello, I've been tasked with designing a very simple SSO (single sign-on) process. My employer has specified that it should be implimented in SAML. I'd like to create messages that are absolutely as simple as possible while confirming to the SAML spec. I'd be really grateful if some of you would look at my request and response messages and tell me if they make sense for my purpose, if they include anything that doesn't need to be there, and if they are missing anything that does need to be there. Addionally, I'd like to know where in the response I should put additional information about the subject; in particular, the subject's email address. The interaction needs to work as follows: 1) User requests service from service provider at this point, the service provider knows nothing about the user. 2) Service provider requests authentication for user from identity provider 3) User is authenticated/registered by identity provider 4) Identity provider responds to Service provider with authentication success message, PLUS user's email address. Here's what I think the request should be: <?xml version="1.0" encoding="UTF-8"?> <samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="abc" IssueInstant="1970-01-01T00:00:00.000Z" Version="2.0" AssertionConsumerServiceURL="http://www.IdentityProvider.com/loginPage"> <saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> http://www.serviceprovider.com </saml:Issuer> <saml:Subject> <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">3f7b3dcf-1674-4ecd-92c8-1544f346baf8</saml:NameID> </saml:Subject> Here's what I think the response should be: <?xml version="1.0" encoding="UTF-8"?> <samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Destination="http://www.serviceprovider.com/desitnationURL" ID="123" IssueInstant="2008-11-21T17:13:42.872Z" Version="2.0"> <samlp:Status> <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success"/> </samlp:Status> <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Version="2.0"> <saml:Subject> <saml:NameID Format="urn:oasis:names:tc:SAML:2.0:nameid-format:transient">3f7b3dcf-1674-4ecd-92c8-1544f346baf8</saml:NameID> <saml:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser"> <saml:SubjectConfirmationData InResponseTo="abc"/> </saml:SubjectConfirmation> </saml:Subject> <saml:AuthnStatement AuthnInstant="2008-11-21T17:13:42.899Z"> <saml:AuthnContext> <saml:AuthnContextClassRef>urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef> </saml:AuthnContext> </saml:AuthnStatement> </saml:Assertion> </samlp:Response> So, again, my questions are: 1) Is this a valid SAML interaction? 2) Can either the request or response xml be simplified? 3) Where in the response should I put the subject's email address? I really apprecaite your help. Thanks so much! -Morgan

    Read the article

  • QueryInterface fails at casting inside COM-interface implementation

    - by brecht
    I am creating a tool in c# to retrieve messages of a CAN-network (network in a car) using an Dll written in C/C++. This dll is usable as a COM-interface. My c#-formclass implements one of these COM-interfaces. And other variables are instantiated using these COM-interfaces (everything works perfect). The problem: The interface my C#-form implements has 3 abstract functions. One of these functions is called -by the dll- and i need to implement it myself. In this function i wish to retrieve a property of a form-wide variable that is of a COM-type. The COM library is CANSUPPORTLib The form-wide variable: private CANSUPPORTLib.ICanIOEx devices = new CANSUPPORTLib.CanIO(); This variable is also form-wide and is retrieved via the devices-variable: canreceiver = (CANSUPPORTLib.IDirectCAN2)devices.get_DirectDispatch(receiverLogicalChannel); The function that is called by the dll and implemented in c# public void Message(double dTimeStamp) { Console.WriteLine("!!! message ontvangen !!!" + Environment.NewLine); try { CANSUPPORTLib.can_msg_tag message = new CANSUPPORTLib.can_msg_tag(); message = (CANSUPPORTLib.can_msg_tag) System.Runtime.InteropServices.Marshal.PtrToStructure(canreceiver.RawMessage, message.GetType()); for (int i = 0; i < message.data.Length; i++) { Console.WriteLine("byte " + i + ": " + message.data[i]); } } catch (Exception e) { Console.WriteLine(e.Message); } } The error rises at this line: message = (CANSUPPORTLib.can_msg_tag)System.Runtime.InteropServices.Marshal.PtrToStructure(canreceiver.RawMessage, message.GetType()); Error: Unable to cast COM object of type 'System.__ComObject' to interface type 'CANSUPPORTLib.IDirectCAN2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{33373EFC-DB42-48C4-A719-3730B7F228B5}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). Notes: It is possible to have a timer-clock that checks every 100ms for the message i need. The message is then retrieved in the exact same way as i do now. This timer is started when the form starts. The checking is only done when Message(double) has put a variable to true (a message arrived). When the timer-clock is started in the Message function, i have the same error as above Starting another thread when the form starts, is also not possible. Is there someone with experience with COM-interop ? When this timer

    Read the article

  • Automatic INotifyPropertyChanged Implementation through T4 code generation?

    - by chrischu
    I'm currently working on setting up a new project of mine and was wondering how I could achieve that my ViewModel classes do have INotifyPropertyChanged support while not having to handcode all the properties myself. I looked into AOP frameworks but I think they would just blow up my project with another dependency. So I thought about generating the property implementations with T4. The setup would be this: I have a ViewModel class that declares just its Properties background variables and then I use T4 to generate the Property Implementations from it. For example this would be my ViewModel: public partial class ViewModel { private string p_SomeProperty; } Then T4 would go over the source file and look for member declarations named "p_" and generate a file like this: public partial class ViewModel { public string SomeProperty { get { return p_SomeProperty; } set { p_SomeProperty= value; NotifyPropertyChanged("SomeProperty"); } } } This approach has some advantages but I'm not sure if it can really work. So I wanted to post my idea here on StackOverflow as a question to get some feedback on it and maybe some advice how it can be done better/easier/safer.

    Read the article

  • C# HMAC Implementation Problem

    - by Emanuel
    I want my application to encrypt a user password, and at one time password will be decrypted to be sent to the server for authentication. A friend advise me to use HMAC. I wrote the following code in C#: System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); byte[] key = encoding.GetBytes("secret"); HMACSHA256 myhmacsha256 = new HMACSHA256(key); byte[] hashValue = myhmacsha256.ComputeHash(encoding.GetBytes("text")); string resultSTR = Convert.ToBase64String(hashValue); myhmacsha256.Clear(); How to decode the password (resultSTR, in this case)? Thanks.

    Read the article

  • Rails Counter Cache and its implementation

    - by Ishu
    Hello All, I am trying to get hold of rails counter cache feature but not able to grasp it completely. Let's say that We have 3 models A B C A belongs to B or C depending upon a field key_type and key_id. key_type tells whether A belongs to B or C so if key_type="B" then the record belongs to B otherwise it belongs to C. In my model a.rb, I have defined following associations: belongs_to :b, :counter_cache => true, :foreign_key => "key_id" belongs_to :c, :counter_cache => true, :foreign_key => "key_id" and in b and c model files has_many :as , :conditions => {:key_type => "B"} has_many :as , :conditions => {:key_type => "C"} Both B and C Models have a column as as_count The problem is every time an object of a is created count is increased in the both the models b and c. Any help is appreciated. Initially i thought that this may work: belongs_to :b, :counter_cache => true, :foreign_key => "key_id", :conditions => {:key_type => "B"} belongs_to :c, :counter_cache => true, :foreign_key => "key_id", :conditions => {:key_type => "C"} But this does not help. Thanks

    Read the article

  • Implementation of ECC in Java

    - by Rookie_22
    While trying to encrypt a given input using Elliptic Curve Cryptography in Java I'm using the following algorithms for generating the cipher and the key: KeyPairGenerator g = KeyPairGenerator.getInstance("ECDSA"); Cipher cipher = Cipher.getInstance("ECIES"); Now as expected, the cipher isn't accepting the keys generated by the ECDSA algorithm. I get the error as - must be passed IE key. I searched for the ciphers being supported by these 2 methods here: http://java.sun.com/javase/6/docs/technotes/guides/security/StandardNames.html#Cipher Unfortunately no else algo is supported for ECC. Has anyone used ECC generated keys to encrypt/decrypt an input? Which algo should I use for both so that they don't clash with each other?

    Read the article

  • WCF Data Services implementation strategies.

    - by Nix
    Microsoft has done a savvy job of not outlining the actual place for data services in the wonderful world of SOA/Web dev. So my question is simple, are WCF Data Services designed to be used via clients? Or has anyone ever heard of someone using them on the server side? Simple scenario a general layered architecture using BO business objects (parenthesis indicate what is being passed between layers) (XML) WCF Service - (BO)Business Logic - (BO) Dao - Entity Framework or using data services it would be where DS BO are modeled business entities to be used in data service. (XML) WCF Service -(BO) Business Logic - (BO) WCF Data Service - (DS BO)Server I can't see a use for the later, unless there are going to be a lot of cases people would be accessing your data via your Data Service Layer vs the Service layer? Thoughts anyone? I have not seen any mention of using DS from within a Service Layer....

    Read the article

  • Blackberry stopwatch implementation

    - by Michaela
    I'm trying to write a blackberry app that is basically a stopwatch, and displays lap times. First, I'm not sure I'm implementing the stopwatch functionality in the most optimal way. I have a LabelField (_myLabel) that displays the 'clock' - starting at 00:00. Then you hit the start button and every second the _myLabel field gets updated with how many seconds have past since the last update (should only ever increment by 1, but sometimes there is a delay and it will skip a number). I just can't think of a different way to do it - and I am new to GUI development and threads so I guess that's why. EDIT: Here is what calls the stopwatch: _timer = new Timer(); _timer.schedule(new MyTimerTask(), 250, 250); And here is the TimerTask: class MyTimerTask extends TimerTask { long currentTime; long startTime = System.currentTimeMillis(); public void run() { synchronized (Application.getEventLock()) { currentTime = System.currentTimeMillis(); long diff = currentTime - startTime; long min = diff / 60000; long sec = (diff % 60000) / 1000; String minStr = new Long(min).toString(); String secStr = new Long(sec).toString(); if (min < 10) minStr = "0" + minStr; if (sec < 10) secStr = "0" + secStr; _myLabel.setText(minStr + ":" + secStr); timerDisplay.deleteAll(); timerDisplay.add(_timerLabel); } } } Anyway when you stop the stopwatch it updates a historical table of lap time data. When this list gets long, the timer starts to degrade. If you try to scroll, then it gets really bad. Is there a better way to implement my stopwatch?

    Read the article

  • 2D Inverse Kinematics Implementation

    - by Vic
    Hi I am trying to implement Inverse Kinematics on a 2D arm(made up of three sticks with joints). I am able to rotate the lowest arm to the desired position. Now, I have some questions: How can I make the upper arm move alongwith the third so the end point of the arm reaches the desired point. Do I need to use the rotation matrices for both and if yes can someone give me some example or an help and is there any other possibl;e way to do this without rotation matrices??? The lowest arm only moves in one direction. I tried google it, they are saying that cross product of two vectors give the direction for the arm but this is for 3D. I am using 2D and cross product of two 2D vectors give a scalar. So, how can I determine its direction??? Plz guys any help would be appreciated.... Thanks in advance Vikram

    Read the article

  • EcmaScript 5 browser implementation

    - by hojberg
    So Safari and Chrome have started in their betas to implement some ES5 stuff. For instance Object.create is in them. Do any of you know if there is a website that shows the progress made in the browsers? ATM i need to use Object.freeze, and wanted to see which browsers (if any) supported that yet.

    Read the article

  • Implementation review for a MVC.NET app with custom membership

    - by mrjoltcola
    I'd like to hear if anyone sees any problems with how I implemented the security in this Oracle based MVC.NET app, either security issues, concurrency issues or scalability issues. First, I implemented a CustomOracleMembershipProvider to handle the database interface to the membership store. I implemented a custom Principal named User which implements IPrincipal, and it has a hashtable of Roles. I also created a separate class named AuthCache which has a simple cache for User objects. Its purpose is simple to avoid return trips to the database, while decoupling the caching from either the web layer or the data layer. (So I can share the cache between MVC.NET, WCF, etc.) The MVC.NET stock MembershipService uses the CustomOracleMembershipProvider (configured in web.config), and both MembershipService and FormsService share access to the singleton AuthCache. My AccountController.LogOn() method: 1) Validates the user via the MembershipService.Validate() method, also loads the roles into the User.Roles container and then caches the User in AuthCache. 2) Signs the user into the Web context via FormsService.SignIn() which accesses the AuthCache (not the database) to get the User, sets HttpContext.Current.User to the cached User Principal. In global.asax.cs, Application_AuthenticateRequest() is implemented. It decrypts the FormsAuthenticationTicket, accesses the AuthCache by the ticket.Name (Username) and sets the Principal by setting Context.User = user from the AuthCache. So in short, all these classes share the AuthCache, and I have, for thread synchronization, a lock() in the cache store method. No lock in the read method. The custom membership provider doesn't know about the cache, the MembershipService doesn't know about any HttpContext (so could be used outside of a web app), and the FormsService doesn't use any custom methods besides accessing the AuthCache to set the Context.User for the initial login, so it isn't dependent on a specific membership provider. The main thing I see now is that the AuthCache will be sharing a User object if a user logs in from multiple sessions. So I may have to change the key from just UserId to something else (maybe using something in the FormsAuthenticationTicket for the key?).

    Read the article

  • Problems with this stack implementation

    - by Andersson Melo
    where is the mistake? My code here: typedef struct _box { char *dados; struct _box * proximo; } Box; typedef struct _pilha { Box * topo; }Stack; void Push(Stack *p, char * algo) { Box *caixa; if (!p) { exit(1); } caixa = (Box *) calloc(1, sizeof(Box)); caixa->dados = algo; caixa->proximo = p->topo; p->topo = caixa; } char * Pop(Stack *p) { Box *novo_topo; char * dados; if (!p) { exit(1); } if (p->topo==NULL) return NULL; novo_topo = p->topo->proximo; dados = p->topo->dados; free(p->topo); p->topo = novo_topo; return dados; } void StackDestroy(Stack *p) { char * c; if (!p) { exit(1); } c = NULL; while ((c = Pop(p)) != NULL) { free(c); } free(p); } int main() { int conjunto = 1; char p[30]; int flag = 0; Stack *pilha = (Stack *) calloc(1, sizeof(Stack)); FILE* arquivoIN = fopen("L1Q3.in","r"); FILE* arquivoOUT = fopen("L1Q3.out","w"); if (arquivoIN == NULL) { printf("Erro na leitura do arquivo!\n\n"); exit(1); } fprintf(arquivoOUT,"Conjunto #%d\n",conjunto); while (fscanf(arquivoIN,"%s", p) != EOF ) { if (pilha->topo == NULL && flag != 0) { conjunto++; fprintf(arquivoOUT,"\nConjunto #%d\n",conjunto); } if(strcmp(p, "return") != 0) { Push(pilha, p); } else { p = Pop(pilha); if(p != NULL) { fprintf(arquivoOUT, "%s\n", p); } } flag = 1; } StackDestroy(pilha); return 0; } The Pop function returns the string value read from file. But is not correct and i don't know why.

    Read the article

  • Howto set my IServiceLocator implementation as ServiceLocator.Current?

    - by stiank81
    I'm working on replacing Unity with Ninject in the Prism framework. This requires me to implement a Ninject specific IServiceLocator. From what I've understood I can inherit the ServiceLocatorImplBase instead, so that's what I do. Now how can I set this to be the Current ServiceLocator? I need this in order to have e.g. the RegionManager get it when it creates regions, and calls: IServiceLocator locator = ServiceLocator.Current; This is a static property, but it doesn't have a setter.. There is a function: void ServiceLocator.SetLocatorProvider(ServiceLocatorProvider newProvider); ..but the argument doesn't match my ServiceLocatorImplBase. Any ideas?

    Read the article

  • svcutil, WSDL, and the generated interfaces not being sufficient for implementation

    - by chtmd
    I have a WSDL file defining a service that I have to implement in WCF. I had read that I could generate the proxy using svcutil from the WSDL file, and that I could then use the generated interfaces to implement the service. Unfortunately, I can't quite seem to find a way to have the interfaces contain the correct attributes to expose the contracts. All operations have the "OperationContractAttribute" attribute, but it appears as though for the service to be exposed, I require the "OperationContract" for each one. Same thing with "ServiceContractAttribute" and "ServiceContract", and I imagine DataContract, but I haven't gotten that far. I could manually make these changes, but I would much prefer a technique where the existing code could be easily used, or better code could be generated for my uses. Is there some way that this can be done? Thanks. EDIT: Command used: svcutil ObjectManagerService.wsdl /n:*,Sample /o:ObjectManagerServiceProxy.cs /nologo Code sample: public interface ObjectManagerSyncPortType { // CODEGEN: Generating message contract since the operation createObject is neither RPC nor document wrapped. [System.ServiceModel.OperationContractAttribute(Action="http://www.sample.com/createObject", ReplyAction="*")] [System.ServiceModel.XmlSerializerFormatAttribute()] Sample.createObjectResponse1 createObject(Sample.createObjectRequest1 request); As best as I can tell/see the WSDL file is entirely self-contained and requires no additional XSD files.

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >