Search Results

Search found 95 results on 4 pages for 'marius stuparu'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Cocoa window position anomaly

    - by Marius
    Hello everyone, I have a weird problem with positioning a window on screen. I want to center the window on the screen, but i don't know how to do that. Here's what i've got. The window is created from nib by the main controller: IdentFormController *ftf = [[IdentFormController alloc] initWithWindowNibName:@"IdentForm"]; [[ftf window] makeKeyAndOrderFront:self]; Now the IdentFormController has awakeFromNib() method in which it tries to position the window. For the sake of simplicity i've just tried to do setFrameOrigin(NSMakePoint(0, 0)). What happens is as follows: The first time i create this window, everything works as expected. But if i create it again after releasing the previous, it starts appearing at random positions. Why does it do that?

    Read the article

  • Castle, sharing a transient component between a decorator and a decorated component

    - by Marius
    Consider the following example: public interface ITask { void Execute(); } public class LoggingTaskRunner : ITask { private readonly ITask _taskToDecorate; private readonly MessageBuffer _messageBuffer; public LoggingTaskRunner(ITask taskToDecorate, MessageBuffer messageBuffer) { _taskToDecorate = taskToDecorate; _messageBuffer = messageBuffer; } public void Execute() { _taskToDecorate.Execute(); Log(_messageBuffer); } private void Log(MessageBuffer messageBuffer) {} } public class TaskRunner : ITask { public TaskRunner(MessageBuffer messageBuffer) { } public void Execute() { } } public class MessageBuffer { } public class Configuration { public void Configure() { IWindsorContainer container = null; container.Register( Component.For<MessageBuffer>() .LifeStyle.Transient); container.Register( Component.For<ITask>() .ImplementedBy<LoggingTaskRunner>() .ServiceOverrides(ServiceOverride.ForKey("taskToDecorate").Eq("task.to.decorate"))); container.Register( Component.For<ITask>() .ImplementedBy<TaskRunner>() .Named("task.to.decorate")); } } How can I make Windsor instantiate the "shared" transient component so that both "Decorator" and "Decorated" gets the same instance? Edit: since the design is being critiqued I am posting something closer to what is being done in the app. Maybe someone can suggest a better solution (if sharing the transient resource between a logger and the true task is considered a bad design)

    Read the article

  • Redirect Entry form in SharePoint back to itself once entry submitted?

    - by Marius
    The issue I have is that people in my group are using a link to an Entry Form to post new itmes to a SharePoint list. Everytime they click 'submit' to post new item, SharPoint redirects them to the list. I need a solution for SharePoint to direct them to the empty Entry form instead, no matter how many times they need to use it. Is there such solution? Thanks, I already have this "/EntryForm.aspx?Source=http://" in the link to the Entry form, but works only 2 times, after that will direct to the list.

    Read the article

  • Accessing bitmap array in another class? C#

    - by Marius Mathisen
    I have this array : Bitmap[] bildeListe = new Bitmap[21]; bildeListe[0] = Properties.Resources.ål; bildeListe[1] = Properties.Resources.ant; bildeListe[2] = Properties.Resources.bird; bildeListe[3] = Properties.Resources.bear; bildeListe[4] = Properties.Resources.butterfly; bildeListe[5] = Properties.Resources.cat; bildeListe[6] = Properties.Resources.chicken; bildeListe[7] = Properties.Resources.dog; bildeListe[8] = Properties.Resources.elephant; bildeListe[9] = Properties.Resources.fish; bildeListe[10] = Properties.Resources.goat; bildeListe[11] = Properties.Resources.horse; bildeListe[12] = Properties.Resources.ladybug; bildeListe[13] = Properties.Resources.lion; bildeListe[14] = Properties.Resources.moose; bildeListe[15] = Properties.Resources.polarbear; bildeListe[16] = Properties.Resources.reke; bildeListe[17] = Properties.Resources.sheep; bildeListe[18] = Properties.Resources.snake; bildeListe[19] = Properties.Resources.spider; bildeListe[20] = Properties.Resources.turtle; I want that array and it´s content in a diffenrent class, and access it from my main form. I don´t know if should use method, function or what to use with arrays. Are there some good way for me to access for instanse bildeListe[0] in my new class?

    Read the article

  • Maintaining white space in html select tag

    - by Marius
    Hi, I have a list of strings that I would like to display in a HTML select object. The strings look something like : id - name - description I would like the fields to align however. In PHP I'm using sprintf ("%4s%10s%20s", $id, $name, $description); which works fine. The problem is the multiple spaces is compacted to 1 space in the select list. I tried using the pre and white-space CSS properties of the select box, but it has no effect. Any suggestions?

    Read the article

  • validate constructor arguments or method parameters with annotations, and let them throw an exceptio

    - by marius
    I am validating constructor and method arguments, as I want to the software, especially the model part of it, to fail fast. As a result, constructor code often looks like this public MyModelClass(String arg1, String arg2, OtherModelClass otherModelInstance) { if(arg1 == null) { throw new IllegalArgumentsException("arg1 must not be null"); } // further validation of constraints... // actual constructor code... } Is there a way to do that with an annotation driven approach? Something like: public MyModelClass(@NotNull(raise=IllegalArgumentException.class, message="arg1 must not be null") String arg1, @NotNull(raise=IllegalArgumentException.class) String arg2, OtherModelClass otherModelInstance) { // actual constructor code... } In my eyes this would make the actual code a lot more readable. In understand that there are annotations in order to support IDE validation (like the existing @NotNull annotation). Thank you very much for your help.

    Read the article

  • SharePoint Error - Datasheet View refuses to show up!

    - by Marius
    Hi, Recently the DataSheet view of my list refuses to dispaly. I tried numerouse times and with no luck. Other lists works just fine, except for this one. there is a Java error message on the left bottom corner of the screen that disapears in 2 seconds, then it renders the list in Standard view any time you try it. I even created a new Datasheet View - the result a Standard View. Any suggestions? Thanks,

    Read the article

  • Search relevance from XML docs (XQuery?) vs MySQL

    - by Marius
    Hello there, I have a website where documents are saved in xml documents, all with the same structure. I need a search engine where I am able to choose documents with the highest relevance according to the key words given by a searching user. I thought it could (?) be a good idea to have one using XQuery rather than having the information stored twice (in XML docs + mysql database) and querying the mysql database for relevance searches. Is XQuery any good for this, and how, and what speed can I expect on +1000 documents of about 7kb each. Thank you for your time. Kind regards

    Read the article

  • PHP Type Hinting: array supported, object NOT?

    - by Marius Burz
    Am I missing something or there really is no support for generic object type hinting in PHP 5.x? I find it really strange that hinting arrays is supported while hinting objects is not, at least not out of the box. I'd like to have something like this: function foo(object $o) Just as we have: function foo(array $o) Example of possible use: methods of an objects collection class. Workaround: using an interface "Object" implemented by all classes or extending all classes from a generic class "Object" and writing something like this: function foo(Object $o) Well, that just ain't cute. Edit: somebody suggested in a deleted post using stdClass. It doesn't work: Catchable fatal error: Argument 1 passed to c::add() must be an instance of stdClass, instance of b given

    Read the article

  • authorization services question cocoa

    - by Marius
    Sorry for being a total beginner in cocoa and for asking the following stupid question, but it's too confusing for me to google it myself or maybe i'm just missing something. I need to run a shellscript with elevated privileges in cocoa. As i understand, "AuthorizationExecuteWithPrivileges" is the correct way to do it. So i've created an application and tried to use some code from one example i found online. The problem is ... if i understand it correctly ... there should be a Security framework in /System/Library/Frameworks that i have to import to the project, but ... it's not there. What am i missing here? Thank you.

    Read the article

  • Does isolation frameworks (Moq, RhinoMock, etc) lead to test overspecification?

    - by Marius
    In Osherove's great book "The Art of Unit Testing" one of the test anti-patterns is over-specification which is basically the same as testing the internal state of the object instead of some expected output. To my experience, using Isolation frameworks can cause the same unwanted side effects as testing internal behavior because one tends to only implement the behavior necessary to make your stub interact with the object under test. Now if your implementation changes later on (but the contract remains the same), your test will suddenly break because you are expecting some data from the stub which was not implemented. So what do you think is the best approach to counter this? 1) Implement your stubs/mocks fully, this has the negative side-effect of potentially making your test less readable and also specifying more than necessary to make your test pass. 2) Favor manual, fully implemented fakes. 3) Implement your stubs/fakes so that they make your test just pass, and then deal with the brittleness that this might introduce.

    Read the article

  • Calculation error in Datasheet view in SharePoint

    - by Marius
    I have a custom list, with calculation, in SharePoint. Everything worked fine until recently when the DataSheet will show strange or wrong % calculation in a % column. But the Standard View will show correct values. IT checked the server side and everything looked ok, I checked the formulas and even re-did them in the column and the issue persist. Anyone, any suggestion? Thanks,

    Read the article

  • Wxpython cut copy paste and openfiledialog...

    - by Marius
    i have a web browser made in python with menu. in one menu i have cut copy paste but no functionality and i need to make them work. i need an example of class oncopy.(event menu) Open file i manage to work like this .takes file and print on screen the link to that file but how can make open dialog to open a file at least one type of file?

    Read the article

  • How do I use on delete cascade in mysql?

    - by Marius
    I have a database of components. Each component is of a specific type. That means there is a many-to-one relationship between a component and a type. When I delete a type, I would like to delete all the components which has a foreign key of that type. But if I'm not mistaken, cascade delete will delete the type when the component is deleted. Is there any way to do what I described?

    Read the article

  • javascript inserting html code

    - by Marius
    Hello, I have a situation when there's a table and you can add a new row by clicking a button. The row is dynamically generated by a server and it is passed back in HTML. So basically what i need to do is prefix the new row to the old table. Something like this: tableelement.innerHTML = newHtml + tableelement.innerHTML; That surely works, but i have a table header and, obviously, i need to insert the new html after it. How would i do this? insertBefore or insertAfter can't help (afaik), because they're meant for inserting elements and not unparsed HTML. So how could i, having an object of the header's row, insert another row (in HTML) after it (or before) ? Thank you for your ideas

    Read the article

  • C++ struct, public data members and inheritance

    - by Marius
    Is it ok to have public data members in a C++ class/struct in certain particular situations? How would that go along with inheritance? I've read opinions on the matter, some stated already here http://stackoverflow.com/questions/952907/practices-on-when-to-implement-accessors-on-private-member-variables-rather-than http://stackoverflow.com/questions/670958/accessors-vs-public-members or in books/articles (Stroustrup, Meyers) but I'm still a little bit in the shade. I have some configuration blocks that I read from a file (integers, bools, floats) and I need to place them into a structure for later use. I don't want to expose these externally just use them inside another class (I actually do want to pass these config parameters to another class but don't want to expose them through a public API). The fact is that I have many such config parameters (15 or so) and writing getters and setters seems an unnecessary overhead. Also I have more than one configuration block and these are sharing some of the parameters. Making a struct with all the data members public and then subclassing does not feel right. What's the best way to tackle that situation? Does making a big struct to cover all parameters provide an acceptable compromise (I would have to leave some of these set to their default values for blocks that do not use them)?

    Read the article

  • Why doesn't Java warn about a == "something"?

    - by Marius
    This might sound stupid, but why doesn't the Java compiler warn about the expression in the following if statement: String a = "something"; if(a == "something"){ System.out.println("a is equal to something"); }else{ System.out.println("a is not equal to something"); } I realize why the expression is untrue, but AFAIK, a can never be equal to the String literal "something". The compiler should realize this and at least warn me that I'm an idiot who is coding way to late at night.

    Read the article

  • Inotifywait doesn't run command

    - by Marius Miliunas
    I have a basic inotifywait script called watch.sh and a few files ending in .styl in the same directory. Here's the script, that catches the changes, but doesn't execute the code within the do/done I init it like sh watch.sh and here's the script #!/bin/sh while inotifywait -m -o ./log.txt -e modify ./*.styl; do stylus -c %f done I tried having echo "hi" within the exec portion but nothing executes

    Read the article

  • Subclassing and adding data members

    - by Marius
    I have an hierarchy of classes that looks like the following: class Critical { public: Critical(int a, int b) : m_a(a), m_b(b) { } virtual ~Critical() { } int GetA() { return m_a; } int GetB() { return m_b; } void SetA(int a) { m_a = a; } void SetB(int b) { m_b = b; } protected: int m_a; int m_b; }; class CriticalFlavor : public Critical { public: CriticalFlavor(int a, int b, int flavor) : Critical(a, b), m_flavor(flavor) { } virtual ~CriticalFlavor() { } int GetFlavor() { return m_flavor; } void SetFlavor(int flavor) { m_flavor = flavor; } protected: int m_flavor; }; class CriticalTwist : public Critical { public: CriticalTwist(int a, int b, int twist) : Critical(a, b), m_twist(twist) { } virtual ~CriticalTwist() { } int GetTwist() { return m_twist; } void SetTwist(int twist) { m_twist = twist; } protected: int m_twist; }; The above does not seem right to me in terms of the design and what bothers me the most is the fact that the addition of member variables seems to drive the interface of these classes (the real code that does the above is a little more complex but still embracing the same pattern). That will proliferate when in need for another "Critical" class that just adds some other property. Does this feel right to you? How could I refactor such code? An idea would be to have just a set of interfaces and use composition when it comes to the base object like the following: class Critical { public: virtual int GetA() = 0; virtual int GetB() = 0; virtual void SetA(int a) = 0; virtual void SetB(int b) = 0; }; class CriticalImpl { public: CriticalImpl(int a, int b) : m_a(a), m_b(b) { } ~CriticalImpl() { } int GetA() { return m_a; } int GetB() { return m_b; } void SetA(int a) { m_a = a; } void SetB(int b) { m_b = b; } private: int m_a; int m_b; }; class CriticalFlavor { public: virtual int GetFlavor() = 0; virtual void SetFlavor(int flavor) = 0; }; class CriticalFlavorImpl : public Critical, public CriticalFlavor { public: CriticalFlavorImpl(int a, int b, int flavor) : m_flavor(flavor), m_critical(new CriticalImpl(a, b)) { } ~CriticalFlavorImpl() { delete m_critical; } int GetFlavor() { return m_flavor; } void SetFlavor(int flavor) { m_flavor = flavor; } int GetA() { return m_critical-GetA(); } int GetB() { return m_critical-GetB(); } void SetA(int a) { m_critical-SetA(a); } void SetB(int b) { m_critical-SetB(b); } private: int m_flavor; CriticalImpl* m_critical; };

    Read the article

  • jQuery - Compatibility Problem with Internet Explorer 7 and Opera

    - by Marius
    Hello there, I have this counter which counts + 1 every time somebody shares content from the site. When it happens, the social icon that was clicked will bounce. It works in Firefox,Chrome, IE8, and Opera, however the bouncing animation is wrong in opera. $.fn.countExternal = function(animSpeed, num) { // for each counter this.each(function(){ // select all the digit containers var span = $(this).children(); // count the num of digit containers var len = $(span).length; // get the current count u = $(span).text(); // copy variable and add increment(s) v = num + ''; // foreach digit container... for (i=v.length - 1; i >= 0; i--) { // ...check which digits are not affected by the increment(s) if (v.charAt(i) == u.charAt(i)) { break; } } // slice from the total number of digit containers the digits containers which needs updating. slce = len - (v.length - (i + 1)) var updates = $(span).slice(slce); // loop through each digit container and fade out ... $(updates).fadeTo(animSpeed, 0,function(){ $(updates).each(function(index){ f = i + 1 + index; // ...then pick the right digit and update the digit... $(this).text(v.charAt(f)); // ...before fading back in. Cycle complete. $(this).fadeTo(animSpeed, 1); }); }); }); }; }) (jQuery); Demo (NSFW) is here (look underneath the social sharing icons). Any idea how I can solve the IE, and possibly the Opera compatibility problem? Thank you for your time.

    Read the article

  • How can I spot subtle Lisp syntax mistakes?

    - by Marius Andersen
    I'm a newbie playing around with Lisp (actually, Emacs Lisp). It's a lot of fun, except when I seem to run into the same syntax mistakes again and again. For instance, here's something I've encountered several times. I have some cond form, like (cond ((foo bar) (qux quux)) ((or corge (grault warg)) (fred) (t xyzzy))) and the default clause, which returns xyzzy, is never carried out, because it's actually nested inside the previous clause: (cond ((foo bar) (qux quux)) ((or corge (grault warg)) (fred)) (t xyzzy)) It's difficult for me to see such errors when the difference in indentation is only one space. Does this get easier with time? I also have problems when there's a large distance between the (mal-)indented line and the line it should be indented against. let forms with a lot of complex bindings, for example, or an unless form with a long conditional: (defun test () (unless (foo bar (qux quux) (or corge (grault warg) (fred)))) xyzzy) It turns out xyzzy was never inside the unless form at all: (defun test () (unless (foo bar (qux quux) (or corge (grault warg) (fred))) xyzzy)) I auto-indent habitually and use parenthesis highlighting to avoid counting parentheses. For the most part it works like a breeze, but occasionally, I discover my syntax mistakes only by debugging. What can I do?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >