Search Results

Search found 3994 results on 160 pages for 'implementing'.

Page 16/160 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Implementing auto-save in WPF / MVVM / NHibernate

    - by Echiban
    My client likes programs like Microsoft OneNote where changes are saved automatically, and he can choose to discard when he explicitly wants to do so. I will have to implement some undo functionality, but I'll figure that out some other time. With NHibernate, I suppose I can call ISession.Update on every single property / binding change, but I can see real pain with this approach down the road. I am not a fan of timers, but maybe a 5 second timer that starts on property / binding change and at timer end use BackgroundWorker thread to save to db. What do you think?

    Read the article

  • implementing feature structures: what data type to use?

    - by Dervin Thunk
    Hello. In simplistic terms, a feature structure is an unordered list of attribute-value pairs. [number:sg, person:3 | _ ], which can be embedded: [cat:np, agr:[number:sg, person:3 | _ ] | _ ], can subindex stuff and share the value [number:[1], person:3 | _ ], where [1] is another feature structure (that is, it allows reentrancy). My question is: what data structure would people think this should be implemented with for later access to values, to perform unification between 2 fts, to "type" them, etc. There is a full book on this, but it's in lisp, which simplifies list handling. So, my choices are: a hash of lists, a list of lists, or a trie. What do people think about this?

    Read the article

  • fullCalendar: Implementing a custom event fetcher using event as function

    - by Nick-ACNB
    If I specify a json feed, the events are re-fetched everytime and the fetching time shows the item appearing which causes a delay which is undesirable (at least after initial fetch was done). I am using the latest version from gitHub 1.4.6. The lazyFetching property seems to only work when you change views and you previously fetched for example a month and are drilling down to week/day which is unusable since I only use agendaDay. Here is what I am trying to achieve: $("#calendar").fullCalendar({ events: function(start, end, callback) { $.getJSON( "/GetEvents", { start: start.valueOf() }, function(data, textStatus) { $.each(data, function(i, event) { //Goal here is to only add items that aren't already rendered. if ($("#calendar") .fullCalendar('clientEvents', event.id)=="") $("#calendar").fullCalendar('renderEvent', event, true); }); } ); }); The goal is to use the sticky property in the renderEvent method so that on-screen they aren't re-rendered if they we're previously fetched. I omitted a part where I manually delete those that we're deleted and modify those that we're updated since I am in multi-user settings but you get the point. My issue is that they are fetched once and added. But once I change day and come back, they don't render even if I used sticky... has anyone gotten this error or did I code anything wrong? Also, is this a wrong way to go? I will consider any input. :) Thank you very much.

    Read the article

  • Project management: Implementing custom errors in VS compilation process

    - by David Lively
    Like many architects, I've developed coding standards through years of experience to which I expect my developers to adhere. This is especially a problem with the crowd that believes that three or four years of experience makes you a senior-level developer.Approaching this as a training and code review issue has generated limited success. So, I was thinking that it would be great to be able to add custom compile-time errors to the build process to more strictly enforce this and other guidelines. For instance, we use stored procedures for ALL database access, which provides procedure-level security, db encapsulation (table structure is hidden from the app), and other benefits. (Note: I am not interested in starting a debate about this.) Some developers prefer inline SQL or parametrized queries, and that's fine - on their own time and own projects. I'd like a way to add a compilation check that finds, say, anything that looks like string sql = "insert into some_table (col1,col2) values (@col1, @col2);" and generates an error or, in certain circumstances, a warning, with a message like Inline SQL and parametrized queries are not permitted. Or, if they use the var keyword var x = new MyClass(); Variable definitions must be explicitly typed. Do Visual Studio and MSBuild provide a way to add this functionality? I'm thinking that I could use a regular expression to find unacceptable code and generate the correct error, but I'm not sure what, from a performance standpoint, is the best way to to integrate this into the build process. We could add a pre- or post-build step to run a custom EXE, but how can I return line- and file-specifc errors? Also, I'd like this to run after compilation of each file, rather than post-link. Is a regex the best way to perform this type of pattern matching, or should I go crazy and run the code through a C# parser, which would allow node-level validation via the parse tree? I'd appreciate suggestions and tales of prior experience.

    Read the article

  • Eclipse 3.5: Implementing my own context menu for a MultipageEditorPart --> no viewer involved

    - by Patrick
    Hello! :-) In my current RCP-project i use a MultipageEditorPart. It has various pages, with simple SWT composites on it. The composites contain some Text and Combo elements. When the user right clicks onto the editor page, I want a context menu to open. This menu holds a command for creating a new editor page, with a composite on it. The command is already working, but I'm quite clueless about how to implement the context menu for the editor. Can someone help with this?

    Read the article

  • Need help implementing this algorithm with map Hadoop MapReduce

    - by Julia
    Hi all! i have algorithm that will go through a large data set read some text files and search for specific terms in those lines. I have it implemented in Java, but I didnt want to post code so that it doesnt look i am searching for someone to implement it for me, but it is true i really need a lot of help!!! This was not planned for my project, but data set turned out to be huge, so teacher told me I have to do it like this. EDIT(i did not clarified i previos version)The data set I have is on a Hadoop cluster, and I should make its MapReduce implementation I was reading about MapReduce and thaught that i first do the standard implementation and then it will be more/less easier to do it with mapreduce. But didnt happen, since algorithm is quite stupid and nothing special, and map reduce...i cant wrap my mind around it. So here is shortly pseudo code of my algorithm LIST termList (there is method that creates this list from lucene index) FOLDER topFolder INPUT topFolder IF it is folder and not empty list files (there are 30 sub folders inside) FOR EACH sub folder GET file "CheckedFile.txt" analyze(CheckedFile) ENDFOR END IF Method ANALYZE(CheckedFile) read CheckedFile WHILE CheckedFile has next line GET line FOR(loops through termList) GET third word from line IF third word = term from list append whole line to string buffer ENDIF ENDFOR END WHILE OUTPUT string buffer to file Also, as you can see, each time when "analyze" is called, new file has to be created, i understood that map reduce is difficult to write to many outputs??? I understand mapreduce intuition, and my example seems perfectly suited for mapreduce, but when it comes to do this, obviously I do not know enough and i am STUCK! Please please help.

    Read the article

  • Implementing the procducer-consumer with .NET 4.0 new

    - by bitbonk
    With alle the new paralell programming features in .NET 4.0, what would be a a simple and fast way to implement the producer-consumer pattern (where at least one thread is producing and enqueuing task items and one other thread executes (dequeues) these tasks). Can we benfit from all these new APIs? What is your preferred implementation of this pattern?

    Read the article

  • implementing stretchable dialog borders in iphone sdk

    - by Joey
    Hi, I want to implement dialog borders that scale to the size I require the dialog to be. Perhaps there is a better more conventional name for this sort of thing. If there is, if someone would edit the title, that'd be great. Anyhow, I'd like to do this so I can have dialogs of any size without the visual artifacts that come with scaling border art to small, large, or wacky unproportional dimentions. I have a few ideas on how this is done, but am not sure which is better for iphone. I have a few questions. 1) Should I make a containing view object that basically overloads its drawRect method and draws the images where they should be at their appropriate scale when the method is called, or should I main a containing view object that simply contains 8 UIImageViews? I suspect the latter approach won't work if I need to actively scale the resulting dialog class like in an animation. 1b) If overloading drawRect is the way to go, does someone have some sample code or a link to an example that demonstrates drawing an image directly from drawRect()? 2) Is it generally better to create a) a 3 x 3 image where the segments are in their appropriate 1x1 grid of the image? If so, is it simple to draw from a portion of this image onto my target view in drawRect (if the former assumption is correct that I should use drawRect)? b) The pieces separately in 8 different files?

    Read the article

  • Suggestions on implementing an iPad magazine app

    - by alku83
    I've been tasked with creating a magazine style app for iPad. Ideally it would look a little something like the Zinio app: http://www.zinio.com/ipad/ . This app is effectively a shell, allowing you to sample magazines (eg. read the first few pages) and select them for download. The magazines appear to have some sort of overlay, allowing you to interact with some things (eg. tap to watch a video). A few questions that come to mind: How would I go about delivering content to the user? In-app purchases aren't really an option, as some content will need to be delivered for free. Is it possible to download a package and make this available within the application? What format would be suitable for displaying the magazine? Sequential images, PDF, ebook? I'll need to have some form of interactivity. I guess I could have some form of lookup table, which would include information such as if the user taps on this page, within these coordinates, then launch this item. Anyone dealt with any similar issues?

    Read the article

  • Deriving from a component and implementing IDisposable properly

    - by PaulH
    I have a Visual Studio 2008 C# .NET 2.0 CF project with an abstract class derived from Component. From that class, I derive several concrete classes (as in my example below). But, when I go to exit my Form, though the Form's Dispose() member is called and components.Dispose() is called, my components are never disposed. Can anybody suggest how I can fix this design? public abstract class SomeDisposableComponentBase : Component { private System.ComponentModel.IContainer components; protected SomeDisposableComponentBase() { Initializecomponent(); } protected SomeDisposableComponentBase(IContainer container) { container.Add(this); Initializecomponent(); } private void InitializeComponent() { components = new System.ComponentModel.Container(); } protected abstract void Foo(); #region IDisposable Members bool disposed_; /// Warning 60 CA1063 : Microsoft.Design : Ensure that 'SomeDisposableComponentBase.Dispose()' is declared as public and sealed.* public void Dispose() { // never called Dispose(true); GC.SuppressFinalize(this); } protected virtual void Dispose(bool disposing) { // never called if (!disposed_) { if (disposing && (components != null)) { components.Dispose(); } disposed_ = true; } base.Dispose(disposing); } #endregion } public SomeDisposableComponent : SomeDisposableComponentBase { public SomeDisposableComponent() : base() { } public SomeDisposableComponent(IContainer container) : base(container) { } protected override void Foo() { // Do something... } protected override void Dispose(bool disposing) { // never called base.Dispose(disposing); } } public partial class my_form : Form { private SomeDisposableComponentBase d_; public my_form() { InitializeComponent(); if (null == components) components = new System.ComponentModel.Container(); d_ = new SomeDisposableComponent(components); } /// exit button clicked private void Exit_Click(object sender, EventArgs e) { this.Close(); } /// from the my_form.designer.cs protected override void Dispose(bool disposing) { if (disposing && (components != null)) { // this function is executed as expected when the form is closed components.Dispose(); } base.Dispose(disposing); } } *I note that FX-Cop is giving me a hint here. But, if I try to declare that function as sealed, I get the error: error CS0238: 'SomeDisposableComponentBase.Dispose()' cannot be sealed because it is not an override Declaring that function an override leads to: 'SomeDisposableComponentBase.Dispose()': cannot override inherited member 'System.ComponentModel.Component.Dispose()' because it is not marked virtual, abstract, or override Thanks, PaulH

    Read the article

  • Implementing a 1 to many relationship with SQLite

    - by Patrick
    I have the following schema implemented successfully in my application. The application connects desk unit channels to IO unit channels. The DeskUnits and IOUnits tables are basically just a list of desk/IO units and the number of channels on each. For example a desk could be 4 or 12 channel. CREATE TABLE DeskUnits (Name TEXT, NumChannels NUMERIC); CREATE TABLE IOUnits (Name TEXT, NumChannels NUMERIC); CREATE TABLE RoutingTable (DeskUnitName TEXT, DeskUnitChannel NUMERIC, IOUnitName TEXT, IOUnitChannel NUMERIC); The RoutingTable 'table' then connects each DeskUnit channel to an IOUnit channel. For example the DeskUnit called "Desk1" channel 1 may route to IOunit name "IOUnit1" channel 2, etc. So far I hope this is pretty straightforward and understandable. The problem is, however, this is a strictly 1 to 1 relationship. Any DeskUnit channel can route to only 1 IOUnit channel. Now, I need to implement a 1 to many relationship. Where any DeskUnit channel can connect to multiple IOUnit channels. I realise I may have to rearrange the tables completely, but I am not sure the best way to go about this. I am fairly new to SQLite and databases in general so any help would be appreciated. Thanks Patrick

    Read the article

  • Implementing an interface with interface members

    - by jstark
    What is the proper way to implement an interface that has its own interface members? (am I saying that correctly?) Here's what I mean: public Interface IFoo { string Forty { get; set; } string Two { get; set; } } public Interface IBar { // other stuff... IFoo Answer { get; set; } } public class Foo : IFoo { public string Forty { get; set; } public string Two { get; set; } } public class Bar : IBar { // other stuff public Foo Answer { get; set; } //why doesnt' this work? } I've gotten around my problem using explicit interface implementation, but I'm wondering if there is a better way?

    Read the article

  • Implementing password hashing/salting algorithm from crackstation.net

    - by Mason240
    I am trying to implement a password hashing/salting algorithm from crackstation.net, but I am unsure how implement it. Storing the password upon user registration seems to be as simple as passing the password into create_hash(). $password = create_hash($_POST['Password']; I'm not following how to validate upon user login. validate_password($password, $good_hash) returns either true or false, and takes $password as parameter, so it seems like a no brainer except for the second parameter $good_hash. Where does this param come from? It is my understanding that password is turned into a hash value every time its used, and that the hash value is what is stored and compared. So why would I have both the $password and $good_hash values? Quick overview of the functions: function create_hash($password){ calls pbkdf2() } function validate_password($password, $good_hash){ calls pbkdf2() calls slow_equals() } function slow_equals($a, $b){ } function pbkdf2($algorithm, $password, $salt, $count, $key_length, $raw_output = false){ } Of course a different, better method for this would also be just as helpful. Thank you

    Read the article

  • Implementing IXmlSerializable on a generated class that has XmlTypeAttribute

    - by Josh
    Basically, the initial problem is I need to make a boolean value serialize as 0 or 1. The solution I found was to implement IXmlSerializable, which I did. Unfortunately the class I'm trying to serialize is generated code off a schema and has an XmlTypeAttribute on it. When I try to (de)serialize the object with the XmlSerializer created in the usual manner ( new XmlSerializer(type)) it throws this exception: System.InvalidOperationException: Only XmlRoot attribute may be specified for the type ______ Please use XmlSchemaProviderAttribute to specify schema type. Two options come to mind immediatly: 1) remove the attribute in the generated code. This change would have to be made every time the code was re-generated. 2) Use an XmlAttributeOverrides object when creating the serializer to remove the attribute. This would require the rest of the code base to "know" that it needs to override that attribute. Also, the exception thrown gives absolutly no clue as to what needs to be done to fix it. Both options kinda stink. Is there a third option?

    Read the article

  • hadoop implementing a generic list writable

    - by Guruprasad Venkatesh
    I am working on building a map reduce pipeline of jobs(with one MR job's output feeding to another as input). The values being passed around are fairly complex, in that there are lists of different types and hash maps with values as lists. Hadoop api does not seem to have a ListWritable. Am trying to write a generic one, but it seems i can't instantiate a generic type in my readFields implementation, unless i pass in the class type itself: public class ListWritable<T extends Writable> implements Writable { private List<T> list; private Class<T> clazz; public ListWritable(Class<T> clazz) { this.clazz = clazz; list = new ArrayList<T>(); } @Override public void write(DataOutput out) throws IOException { out.writeInt(list.size()); for (T element : list) { element.write(out); } } @Override public void readFields(DataInput in) throws IOException{ int count = in.readInt(); this.list = new ArrayList<T>(); for (int i = 0; i < count; i++) { try { T obj = clazz.newInstance(); obj.readFields(in); list.add(obj); } catch (InstantiationException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } } } } But hadoop requires all writables to have a no argument constructor to read the values back. Has anybody tried to do the same and solved this problem? TIA.

    Read the article

  • Java singleton VO class implementing serializable, having default values using getter methods

    - by user309281
    Hi All I have a J2SE application having user threads running in a separate JVM outside JBOSS server. During startup, J2SE invokes a EJB inside jboss, by passing a new object(singleton) of simple JAVA VO class having getter/setter methods. {The VO class is a singleton and implements serialiable(as mandated by EJB)}. EJB receives the object, reads all db configuration and uses the setter methods of new object to set all the values. It then returns back this updated object back to J2SE in the same remote call. After J2SE receives the object(singleton/serializable), if i invoke getter methods, I could see only default values set during object creation before EJB call, and not the values set by the EJB. Kindly throw some light on, why the received object from EJB does not see any updated values and how to rectify this. I believe it got to do with object initialization during deserialization. And i tried overriding readResolve() in the VO class, but of no help. With Regards, Krishna

    Read the article

  • Implementing tracing gestures on iPhone

    - by bmoeskau
    I'd like to create an iPhone app that supports tracing of arbitrary shapes using your finger (with accuracy detection). I have seen references to an Apple sample app called "GestureMatch" that supposedly implemented exactly that, but it was removed from the SDK at some point and I cannot find the source anywhere via Google. Does anyone know of a current official sample that demonstrates tracing like this? Or any solid suggestions on other resources to look at? I've done some iPhone programming, but not really anything with the graphics API's or custom handling of touch gestures, so I'm not sure where to start.

    Read the article

  • Implementing callback functions in C

    - by robertjohn123
    Hi, I am a newbie to C.I am trying to implement callback function using function pointers. I am getting an error :test_callback.c:10: error: expected identifier or ‘(’ before ‘void’ when I try to compile the following program: #include<stdio.h> void (*callback) (void); void callback_proc () { printf ("Inside callback funtion\n"); } void register ((void (*callback) (void))) { printf ("Inside registration \n"); callback (); /* Calling an initial callback with function pointer */ } int main () { callback = callback_proc;/* Assigning function to the function pointer */ register (callback);/* Passing the function pointer */ return 0; } What is this error?Can anyone help?

    Read the article

  • Implementing a 'Send Feedback' feature in a Java desktop application

    - by William
    I would like to implement a 'Send Feedback' option in a Java desktop application. One which will pop up a box for the user to enter a comment, then send it to us along with a screenshot of the application window. How would be the best way to communicate the data to us? Two obvious solutions spring to mind: Email - I'm thinking that the application would connect to an SMTP server set-up by us, with the username/password somehow hidden in the code. SMTP over SSL for security (not of the data being sent, but of the SMTP username/password). Web service - pretty self explanatory. Which of these would be best, or is there a better alternative?

    Read the article

  • Custom Collection Implementing IEnumerable

    - by Burnzy
    I know that technically, an Interface is used for reading and not writting or editing however, I want to add an add and addrange function to the following class, here is what I currently have which is not working public class HrefCollection : IEnumerable<Href> { private IEnumerable<Href> hrefs; public IEnumerable<Href> Add( Href href ) { yield return href; } public IEnumerable<Href> AddRange( List<Href> hrefs ) { foreach( Href href in hrefs ) { yield return href; } } public IEnumerator<Href> GetEnumerator() { return hrefs.GetEnumerator(); } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return hrefs.GetEnumerator(); } } I'm not quite sure how to associate the yield return with the private list. Thanks for your help!

    Read the article

  • help Implementing Object Oriented ansi-C approach??

    - by No Money
    Hey there, I am an Intermediate programmer in Java and know some of the basics in C++. I recently started to scam over "C language" [please note that i emphasized on C language and want to stick with C as i found it to be a perfect tool, so no need for suggestions focusing on why should i move back to C++ or Java]. Moving on, I code an Object Oriented approach in C but kindda scramble with the pointers part. Please understand that I am just a noob trying to extend my knowledge beyond what i learned in High School. Here is my code..... #include <stdio.h> typedef struct per{ int privateint; char *privateString; struct per (*New) (); void (*deleteperOBJ) (struct t_person *); void (*setperNumber) ((struct*) t_person,int); void (*setperString) ((struct*) t_person,char *); void (*dumpperState) ((struct*) t_person); }t_person; void setperNumber(t_person *const per,int num){ if(per==NULL) return; per->privateint=num; } void setperString(t_person *const per,char *string){ if(per==NULL) return; per->privateString=string; } void dumpperState(t_person *const per){ if(per==NULL) return; printf("value of private int==%d\n", per->privateint); printf("value of private string==%s\n", per->privateString); } void deleteperOBJ(struct t_person *const per){ free((void*)t_person->per); t_person ->per = NULL; } main(){ t_person *const per = (struct*) malloc(sizeof(t_person)); per = t_person -> struct per -> New(); per -> setperNumber (t_person *per, 123); per -> setperString(t_person *per, "No money"); dumpperState(t_person *per); deleteperOBJ(t_person *per); } Just to warn you, this program has several errors and since I am a beginner I couldn't help except to post this thread as a question. I am looking forward for assistance. Thanks in advance.

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >