Daily Archives

Articles indexed Saturday March 13 2010

Page 9/89 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Distributed Lock Service over MySql/GigaSpaces/Netapp

    - by ripper234
    Disclaimer: I already asked this question, but without the deployment requirement. I got an answer that got 3 upvotes, and when I edited the question to include the deployment requirement the answer then became irrelevant. The reason I'm resubmitting is because SO considers the original question 'answered', even though I got no meaningful upvoted answer. I opened a uservoice submission about this problem. The reason I reposted is so StackOverflow consider the original question answered, so it doesn't show up on the 'unanswered questions' tab. Which distributed lock service would you use? Requirements are: A mutual exclusion (lock) that can be seen from different processes/machines lock...release semantics Automatic lock release after a certain timeout - if lock holder dies, it will automatically be freed after X seconds Java implementation Easy deployment - must not require complicated deployment beyond either Netapp, MySql or GigaSpaces. Must play well with those products (especially GigaSpaces - this is why TerraCotta was ruled out). Nice to have: .Net implementation If it's free: Deadlock detection / mitigation I'm not interested in answers like "it can be done over a database", or "it can be done over JavaSpaces" - I know. Relevant answers should only contain a ready, out-of-the-box, proven implementation.

    Read the article

  • Google Python Class Day 1 Part 3

    Google Python Class Day 1 Part 3 Google Python Class Day 1 Part 3: Dicts and Files. By Nick Parlante. Support materials and exercises: code.google.com From: GoogleDevelopers Views: 7 0 ratings Time: 28:59 More in Science & Technology

    Read the article

  • Monitors - inches vs resolution

    - by Vnuk
    I'm currently moving away from living five years only on laptop to a desktop setup. I'm currently browsing for monitors and I've noticed something strange. On my laptop I have 1920x1200 on 17". To get the same resolution on a monitor I have to get Dell U2410 24" or Samsung SM2443NW 24". I do not need (or want) 7" more inches of screen, I just want the 1920x1200 resolution. Why is this setup (big resolution on less inches of screen) available on a laptop but not on a regular monitor? I'm setting this as a community wiki beacuse I think that there is no right answer here...

    Read the article

  • java.util.ConcurrentModificationException when serializing non thread-safe maps

    - by [email protected]
    We have got some questions related to exceptions thrown during a map serialization like the following one (in this example, for a LRUMap): java.util.ConcurrentModificationExceptionat org.apache.commons.collections.SequencedHashMap$OrderedIterator.next(Unknown Source)at org.apache.commons.collections.LRUMap.writeExternal(Unknown Source)at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined CompiledCode))at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined CompiledCode))at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java(Inlined CompiledCode))at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java(Compiled Code))at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java(Compiled Code))at com.tangosol.util.ExternalizableHelper.writeSerializable(ExternalizableHelper.java(InlinedCompiled Code))at com.tangosol.util.ExternalizableHelper.writeObjectInternal(ExternalizableHelper.java(Compiled Code))at com.tangosol.util.ExternalizableHelper.serializeInternal(ExternalizableHelper.java(Compiled Code))at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java(InlinedCompiled Code))at com.tangosol.util.ExternalizableHelper.toBinary(ExternalizableHelper.java(InlinedCompiled Code))at com.tangosol.coherence.servlet.TraditionalHttpSessionModel$OptimizedHolder.serializeValue(TraditionalHttpSessionModel.java(Inlined Compiled Code))at com.tangosol.coherence.servlet.TraditionalHttpSessionModel$OptimizedHolder.getBinary(TraditionalHttpSessionModel.java(Compiled Code)) This is caused because LRUMap is not thread safe, so if another thread is modifying the content of that same map while serialization is in progress, then the ConcurrentModificationException will be thrown. Also, the map must be synchronized. Other structures like java.util.HashMap are not thread safe too. To avoid this kind of problems, it is recommended to use a thread-safe and synchronized map such as java.util.Map, java.util.Hashtable or com.tangosol.util.SafeHashMap. You may also need to use the synchronizedMap(Map) method from Class java.util.Collections.  

    Read the article

  • anonymous function in SML

    - by vichet
    I have this below function and it works (fn x => x * 2) 2; but for this below one, it is not working (fn x y => x + y ) 2 3; can anyone tell me why? or help give me some hint to get it to work.

    Read the article

  • Best way to learn how to use FPGAs

    - by Myrrdyn
    In next weeks probably I will have some little FPGA to play with. I have a programmer background (C, C++, Java mostly) and some (very) limited experience in electronics. What are the best tools to know if you want to develop on FPGAs? What are the best languages to study? (what HW description languages?) Have you some examples of little "toy projects" that can be interesting, easy, and "eye-opener"? Thanks in advance. Edit: More details: if I understood correctly, the device I will be playing on will have an ARM core (no idea which one) and a 300k gates FPGA I'm looking specifically at some Linux free sw / open source tools...

    Read the article

  • Why can't I fade out this table row in IE using jQuery?

    - by George Edison
    I can't get the table row to fade out in IE. It works in Chrome, but not IE. It just becomes really 'light' and stays on the screen. I tried IE8 with and without compatibility mode. <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> function hideIt() { $('#hideme').fadeTo("slow", 0.0); } </script> </head> <body> <table> <tr id='hideme'> <td>Hide me!</td> </tr> </table> <button onclick='hideIt();'>Hide</button> </body> </html> Is there a workaround/solution for a smooth fade?

    Read the article

  • MySQL Stored Procedures not working with SELECT (basic question)

    - by TMG
    Hello, I am using a platform (perfectforms) that requires me to use stored procedures for most of my queries, and having never used stored procedures, I can't figure out what I'm doing wrong. The following statement executes without error: DELIMITER // DROP PROCEDURE IF EXISTS test_db.test_proc// CREATE PROCEDURE test_db.test_proc() SELECT 'foo'; // DELIMITER ; But when I try to call it using: CALL test_proc(); I get the following error: #1312 - PROCEDURE test_db.test_proc can't return a result set in the given context I am executing these statements from within phpmyadmin 3.2.4, PHP Version 5.2.12 and the mysql server version is 5.0.89-community. When I write a stored procedure that returns a parameter, and then select it, things work fine (e.g.): DELIMITER // DROP PROCEDURE IF EXISTS test_db.get_sum// CREATE PROCEDURE test_db.get_sum(out total int) BEGIN SELECT SUM(field1) INTO total FROM test_db.test_table; END // DELIMITER ; works fine, and when I call it: CALL get_sum(@t); SELECT @t; I get the sum no problem. Ultimately, what I need to do is have a fancy SELECT statement wrapped up in a stored procedure, so I can call it, and return multiple rows of multiple fields. For now I'm just trying to get any select working. Any help is greatly appreciated.

    Read the article

  • UIToolBar and iPhone Interface Orientation Problem

    - by Leo
    I am developing an application in iPhone. One view support orientation in portrait and landscape. I have two separate views for both orientation. This view has a UIToolbar at the top. Problem is when I change view back from landscape to portrait, UIToolbar at the top disappears. I want toolbar to come back in its original position when it is rotated back to portrait. This is what I am doing in my program. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration { if (interfaceOrientation == UIInterfaceOrientationPortrait) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(0)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(-90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } else if (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { self.view = self.portrait; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(180)); self.view.bounds = CGRectMake(0.0, 0.0, 300.0, 480.0); } else if (interfaceOrientation == UIInterfaceOrientationLandscapeRight) { self.view = self.landscape; self.view.transform = CGAffineTransformIdentity; self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90)); self.view.bounds = CGRectMake(0.0, 0.0, 460.0, 320.0); } } I don't know what am I missing here? Any help would be really appreciated.

    Read the article

  • Reading the registry of a (windows computer) from a web app (silverlight? php? etc)

    - by Tommy
    Is there a way to read the windows registry from a web based application with no user interaction? im open to language suggestions, any language will work i just need to know how to pull a certain string from one particular registry key. EDIT: incase this wasnt clear, im operating inside of a web-browser, obviously.. its a web application, weather it be silverlight, java, php, or something else.

    Read the article

  • Delay rendering or force re-rendering in Flex

    - by Tereno
    Hi there, In my Flex application, using a custom control, I am making a JSON request to grab some data from the server. My rendering depends on this data such as knowing how many boxes to draw. How can I either force the rendering to wait until I've got the data before drawing to screen or have the boxes draw once we receive the data? I have an event listener for Event.COMPLETE for my JSON request and in there, I call methods that add to the control. I've tried invalidateDisplayList but that doesn't seem to do anything for me?

    Read the article

  • iPhones SDK: Setting a relationship property object using core data?

    - by Harkonian
    I'm using core data in my app. I have two entities that are related: EntityA and EntityB. EntityA has a property of type "relationship" with EntityB. In addition, both of these entities are defined classes (not the default NSManagedObject). I'm inserting a new object into my data like this: EntityA *newEntityA = [NSEntityDescription insertNewObjectForEntityForName:@"EntityA" inManagedObjectContext:self.managedObjectContext]; newEntityA.name = @"some name"; newEntityA.entityB.name = @"some other name"; The problem is entityB.name is null. Even if I add an NSLog() statement right after assigning the value, it is null. What is the proper way of setting my "name" property of EntityB when EntityB is a property of EntityA?

    Read the article

  • Why does the interpreted order seem different from what I expect?

    - by inspectorG4dget
    I have a problem that I have not faced before: It seems that the order of interpretation in my program is somehow different from what I expect. I have written a small Twitter client. It takes a few seconds for my program to actually post a tweet after I click the "GO" button (which can also be activated by hitting ENTER on the keyboard). I don't want to click multiple times within this time period thinking that I hadn't clicked it the first time. Therefore, when the button is clicked, I would like the label text to display something that tells me that the button has been clicked. I have implemented this message by altering the label text before I send the tweet across. However, for some reason, the message does not display until the tweet has been attempted. But since I have a confirmation message after the tweet, I never get to see this message and my original problem goes unsolved. I would really appreciate any help. Here is the relevant code: class SimpleTextBoxForm(Form): def __init__(self): # set window properties self.Text = "Tweeter" self.Width = 235 self.Height = 250 #tweet away self.label = Label() self.label.Text = "Tweet Away..." self.label.Location = Point(10, 10) self.label.Height = 25 self.label.Width = 200 #get the tweet self.tweetBox = TextBox() self.tweetBox.Location = Point(10, 45) self.tweetBox.Width = 200 self.tweetBox.Height = 60 self.tweetBox.Multiline = True self.tweetBox.WordWrap = True self.tweetBox.MaxLength = 140; #ask for the login ID self.askLogin = Label() self.askLogin.Text = "Login:" self.askLogin.Location = Point(10, 120) self.askLogin.Height = 20 self.askLogin.Width = 60 self.login = TextBox() self.login.Text= "" self.login.Location = Point(80, 120) self.login.Height = 40 self.login.Width = 100 #ask for the password self.askPass = Label() self.askPass.Text = "Password:" self.askPass.Location = Point(10, 150) self.askPass.Height = 20 self.askPass.Width = 60 # display password box with character hiding self.password = TextBox() self.password.Location = Point(80, 150) self.password.PasswordChar = "x" self.password.Height = 40 self.password.Width = 100 #submit button self.button1 = Button() self.button1.Text = 'Tweet' self.button1.Location = Point(10, 180) self.button1.Click += self.update self.AcceptButton = self.button1 #pack all the elements of the form self.Controls.Add(self.label) self.Controls.Add(self.tweetBox) self.Controls.Add(self.askLogin) self.Controls.Add(self.login) self.Controls.Add(self.askPass) self.Controls.Add(self.password) self.Controls.Add(self.button1) def update(self, sender, event): if not self.password.Text: self.label.Text = "You forgot to enter your password..." else: self.tweet(self.tweetBox.Text, self.login.Text, self.password.Text) def tweet(self, msg, login, password): self.label.Text = "Attempting Tweet..." # this should be executed before sending the tweet is attempted. But this seems to be executed only after the try block try: success = 'Tweet successfully completed... yay!\n' + 'At: ' + time.asctime().split()[3] ServicePointManager.Expect100Continue = False Twitter().UpdateAsXML(login, password, msg) except: error = 'Unhandled Exception. Tweet unsuccessful' self.label.Text = error else: self.label.Text = success self.tweetBox.Text = ""

    Read the article

  • Java Timers - Functions called not completing!

    - by Matt Swanson
    So I have a TimerTask task calling a function onTimerComplete() in its run() onTimerComplete() looks something like this: private void onTimerComplete(){ myFunc1(); myFunc2(); } I make a Timer t and I schedule the TimerTask with t.schedule(task, 2000); The problem is, when the timer is up and the task runs my onTimerComplete() but that function does not finish. It runs myFunc1() but never finishes it nor does it ever call myFunc2() However, if I call onTimerComplete() directly, everything works. What's the deal here?

    Read the article

  • gparted installed on OpenSuse shows all file system types as greyed out except for hfs

    - by cmdematos.com
    I have had this problem before and fixed it, but I don't recall how I did it and I did not record it (sadness :( ) I have all the requisite commands installed on OpenSuse to support gparted's efforts in creating any of the supported file systems. I recall that the problem was that gparted could not find the commands, in any event all the file systems are greyed out in the context menu except for the legacy hfs partition which only supports < 2gb. Even extfs2-extfs4 are greyed out. How do I fix this?

    Read the article

  • HP Usb storage Format tool : Error

    - by Srin
    I have a 2 GB Kingston Usb drive. This is working fine- I am able to format and access from 'My computer' I am trying to format this drive using HP USB Storage format tool to load a bootable image on to the drive, it says "device media is write protected" OS : Windows XP what could be wrong ? Thanks!

    Read the article

  • how to make a queue in php with mysql

    - by robert
    hy, in my script i run a exec() function to make a movie file with ffmpeg. the problem is ffmpeg can run only 1 time on the server, if 2 people are online on server and first one already run ffmpeg i want the second to wait until the first end the process how to code this? thank you

    Read the article

  • JPA where clause all

    - by Ke
    Hi, I'm new to JPA. In SQL, there is "*" which means any all. For example, SELECT * FROM PRODUCT WHERE CATEGORY=* In JPA, the query is: Query query = entityManager.createQuery("select o from Product o WHERE o.category = :value"); query.setParameter("category", category); How can I set category to any category in JPA?

    Read the article

  • Collection wrapping a array is read-only. Possible to make it writeable without casting?

    - by Brian Triplett
    I have a Collection<T> property that wraps a array like T[] array; public Collection<T> Items { get { return new Collection<T>(array); } } When I attempt to assign to the collection via: T variable; Items[i] = variable; I get a NotSupportedException because the colleciton's IsReadOnly property is true. Turns out that this is a design choice by Microsoft. Does anyone know a workaround that does NOT involve enumeration? It could be done if the underlying data is not an array but I enjoy the performance gains because the data is fixed length.

    Read the article

  • rails test.log is always empty

    - by Raiden
    All the log entries generated when running tests with 'rake' are written to my development.log instead of test.log file Do I have to explicitly enable logging for test in enviornments/test.config?? (I'm using 'turn' gem to format test output, Can that cause an issue?) I'm running rails 2.3.5, ruby 1.8.7 I've all these gems installed for RAILS_ENV=test. Any help is appreciated. -[I] less -[I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] mutter = 0.4.2 - [I] mysql - [I] authlogic - [R] activesupport - [I] turn - [I] ansi = 1.1.0 - [I] facets = 2.8.0 - [I] rspec = 1.2.0 - [I] rspec-rails = 1.2.0 - [I] rspec = 1.3.0 - [R] rack = 1.0.0 - [I] webrat = 0.4.3 - [I] nokogiri = 1.2.0 - [R] rack = 1.0 - [I] rack-test = 0.5.3 - [R] rack = 1.0 - [I] cucumber = 0.2.2 - [I] term-ansicolor = 1.0.4 - [I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] polyglot = 0.2.9 - [R] builder = 2.1.2 - [I] diff-lcs = 1.1.2 - [R] json_pure = 1.2.0 - [I] cucumber-rails - [I] cucumber = 0.6.2 - [I] term-ansicolor = 1.0.4 - [I] treetop = 1.4.2 - [I] polyglot = 0.2.5 - [I] polyglot = 0.2.9 - [R] builder = 2.1.2 - [I] diff-lcs = 1.1.2 - [R] json_pure = 1.2.0 - [I] database_cleaner = 0.2.3 - [I] launchy - [R] rake = 0.8.1 - [I] configuration = 0.0.5 - [I] faker - [I] populator - [R] flog = 2.1.0 - [R] flay - [I] rcov - [I] reek - [R] ruby_parser ~ 2.0 - [I] ruby2ruby ~ 1.2 - [R] sexp_processor ~ 3.0 - [R] ruby_parser ~ 2.0 - [R] sexp_processor ~ 3.0 - [I] roodi - [R] ruby_parser - [I] gruff - [I] rmagick - [I] ruby-prof - [R] jscruggs-metric_fu = 1.1.5 - [I] factory_girl - [I] notahat-machinist

    Read the article

  • Software Safety Standards

    - by user68472
    What industry known software safety standards has anyone had experience in having to adhere to while developing software that is involved in controlling a device/system that has potential to harm the individuals using it?

    Read the article

  • what can be causes of http server crash?

    - by mithunmo
    Hello , I am using WAMP server on Windows XP. - Apache 2.2.11 - MySQL 5.1.36 (INNODB engine) - PHP 5.3.0 I observe that my WAMP server crashes in the following scenarios 1) IF I use a Low end PC ( low processor speed and low RAM) 2) After making some changes to httpd.conf file .For eg changing the Allow from IP address . But here it crashes only once and then it starts to work fine. 3) Random crashes CRASH LOG szAppName : httpd.exe szAppVer : 2.2.11.0 szModName : php5ts.dll szModVer : 5.3.0.0 offset : 0000c309 C:\DOCUME~1\blrcom\LOCALS~1\Temp\WERc677.dir00\httpd.exe.mdmp C:\DOCUME~1\blrcom\LOCALS~1\Temp\WERc677.dir00\appcompat.txt My questions 1) Does high CPU utilization/LOW RAM can also cause the HTTP server to crash ? 2) excessive file reading as in every 10 seconds ? 3) unlimited script execution time . I have set the maximum execution time in php script to 0 as my script has to execute for sometimes 2-3 days. Is there any way to avoid this ? 4) Access to Database ? Should we use lock before reading and writing Can these be the reasons for random wamp server crashes ? OR is is some other programming error ? Please guide me . Regards, Mithun

    Read the article

  • Using Yii framework, what would be a right way to process an attribute before displaying it using CH

    - by Karolis
    Say I have this line of code in the view. <?php echo CHtml::activeTextField($model,'start_time'); ?> start_time is a UNIX timestamp. When just displaying it in a view I can apply functions like date() on it. Where should I apply the formatting when I'm displaying it in a form, by using the above line of code? (This case of timestamps/dates might be special, but I'm also interested in how would one go about if it wasn't a date and I just want to work with "value in database" < "different representations of the value in different views. Thanks =)

    Read the article

  • Simple regex question?

    - by Joan Venge
    In the streams I am parsing I need to parse something in this pattern: <b>PaintTitle</b></td><td class=detail valign="top" align=left><div align=left><font size=small><b>The new great album by Pet Shop Boys</b> How would I get the string "The new great album by Pet Shop Boys" where <b>PaintTitle</b> is guaranteed to be once per album?

    Read the article

  • generation of random numbers in java

    - by S.PRATHIBA
    Hi all, I want to create 30 tables which consists of the following fields.For example, Service_ID Service_Type consumer_feedback 75 Computing 1 35 Printer 0 33 Printer -1 3 rows in set (0.00 sec) mysql select * from consumer2; Service_ID Service_Type consumer_feedback 42 data 0 75 computing 0 mysql select * from consumer3; Service_ID Service_Type consumer_feedback 43 data -1 41 data 1 72 computing -1 As you can infer from the above tables, i am getting the feedback values.I have generated these consumer_feedback values,Service_ID,Service_Type using the concept of random numbers .I have used the funtion int min1=31;//printer int max1=35;//the values are generated if the Service_Type is printer. int provider1 = (int) (Math.random() * (max1 - min1 + 1) ) + min1; int min2=41;//data int max2 =45 int provider2 = (int) (Math.random() * (max2 - min2 + 1) ) + min2; int min3=71;//computing int max3=75; int provider3 = (int) (Math.random() * (max3 - min3 + 1) ) + min3; int min5 = -1;//feedback values int max5 =1; int feedback = (int) (Math.random() * (max5 - min5 + 1) ) + min5; I need the Service_Types to be distributed uniformly in all the 30 tables.Similarly I need feedback value of 1 to be generated many times other than 0 and -1.Please Help me.

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >