Daily Archives

Articles indexed Friday March 19 2010

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

  • Ehcache - Distributed RMI not working

    - by Ted
    Hi, I have this strange problem with ehcache 2.0 that I hope someone can help me with. I have set up a cluster of two hosts, A and B. I can see that heartbeats are received at both ends, so I'm pretty sure the networking and multicast stuff is working. The problem is that is I put an element into the cache at host A, I can see in the logs of host B that it receives a remote put. But when I request the same element from host B, it runs off to the data base and performs a query nonetheless. What may be the cause of this? Thankful for any pointers!

    Read the article

  • Using terminal vs KDE in linux?

    - by Ke
    Hi Im used to using nautilus within centos but have recently just got a VPS and quickly realising that using a KDE is unacceptable in this environment. Although I do find it so much quicker doing things like folder permissions in KDE rather than typing it all out in the terminal? Everyone I speak to says, use the terminal and I should learn this way as opposed to using the KDE, but theres certain things I just dont get How is it possible to make quick changes to scripts and viewing them in a browser etc , without a mouse or using KDE? and only using a terminal?? I am wondering how to develop websites just using the terminal??? How can it be quicker to type out/view permissions etc in the terminal when its instant and just a few clicks in the KDE? Any thoughts are much appreciated. I would love to understand the benefits but just cant seem to see them right now. Cheers Ke.

    Read the article

  • on hover overlay image in CSS

    - by Juventus
    I need a div with picture bg to overlay an image (with some amount transparency) when hovered on. I need to be able to have one transparent overlay that can be used and reused throughout the site on any image. My first attempt was round-about to say the least. Because I found out you cannot roll-over an invisible div I devised a sandwhich system in which the original image is the first layer, the overlay is the second layer, and the original image is third layer again. This way, when you roll-over, the original image disappears revealing the overlay image over the original image: http://www.nightlylabs.com/uploads/test.html So it works. Kinda. Because of you cannot interact with an visibility:invisible element (why?!) the roll-over flickers unless you rest the cursor on it. Any help? This method is bad so if anyone has a better one please comment.

    Read the article

  • Using separate model methods to manage transactions

    - by DCrystal
    If i’ve got 2(or more) model methods which do (for example, in billing system) enrolling/withdrawing, and one controller’s method that calls 2(or more) of these model methods. Is it a good way(maybe, any suggestions how to do it better) to write/use 2model methods like these: public function start_transaction(){ $this->db->trans_start(); } public function end_transaction(){ $this->db->trans_complete(); } And call in controller’s method: public function smth(){ //something $this->model->start_transaction(); $this->model->enroll(); //something else $this->model->withdraw(); $this->model->end_transaction(); } Will transaction be reversed, if model's withdraw() method fails? Thanks.

    Read the article

  • How do you keep all your languages straight?

    - by Chris Blackwell
    I think I'm going a little crazy. Right now, I'm working with the following languages (I was just doing a mental inventory): C++ - our game engine Assembler - low level debugging and a few co-processor specific routines Lua - our game engine scripting language HLSL - for shaders Python - our build system and utility tools Objective C/C++ - game engine platform code for Mac and iPhone C# - A few tools developed in our overseas office ExtendScript - Photoshop exporting tools ActionScript - UI scripting VBScript - some spreadsheet related stuff PHP - some web related stuff SQL - some web and tool related stuff On top of this are the plethora of API's that often have many different ways of doing the same thing: std library, boost, .NET, wxWidgets, Cocoa, Carbon, native script libraries for Python, Lua, etc, OpenGL, Direct3d, GDI, Aqua, augh! I find myself inadvertently conflating languages and api's, not realizing what I'm doing until I get syntax errors. I feel like I can't possibly keep up with it, and I can't possibly be proficient in all of these areas. Especially outside the realm of C++ and Python, I find myself programming more by looking at manuals that from memory. Do you have a similar problem? Ideas for compartmentalizing so you're more efficient? Deciding where you want to stay proficient? Organizational tips? Good ways to remember when you switch from Lua to C++ you need to start using semi-colons again? Rants on how complicated we programmers have made things for ourselves? Any ideas welcome!

    Read the article

  • Logic inside an enum

    - by Vivin Paliath
    My colleagues and I were having a discussion regarding logic in enums. My personal preference is to not have any sort of logic in Java enums (although Java provides the ability to do that). The discussion in this cased centered around having a convenience method inside the enum that returned a map: public enum PackageTypes { Letter("01", "Letter"), .. .. Tube("02", "Packaging Tube"); private String packageCode; private String packageDescription; .. .. public static Map<String, String> toMap() { Map<String, String> map = new LinkedHashMap<String, String>(); for(PackageType packageType : PackageType.values()) { map.put(packageType.getPackageCode(), packageType.getPackageDescription()); } return map; } } My personal preference is to pull this out into a service. The argument for having the method inside the enum centered around convenience. The idea was that you don't have to go to a service to get it, but can query the enum directly. My argument centered around separation of concern and abstracting any kind of logic out to a service. I didn't think "convenience" was a strong argument to put this method inside an enum. From a best-practices perspective, which one is better? Or does it simply come down to a matter of personal preference and code style?

    Read the article

  • Uncompress GZIPed HTTP Response in Java

    - by bill0ute
    Hi, I'm trying to uncompress a GZIPed HTTP Response by using GZIPInputStream. However I always have the same exception when I try to read the stream : java.util.zip.ZipException: invalid bit length repeat My HTTP Request Header: GET www.myurl.com HTTP/1.0\r\n User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2) Gecko/20100115 Firefox/3.6\r\n Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n X-Requested-With: XMLHttpRequest\r\n Cookie: Some Cookies\r\n\r\n At the end of the HTTP Response header, I get path=/Content-Encoding: gzip, followed by the gziped response. I tried 2 similars codes to uncompress : GZIPInputStream gzip = new GZIPInputStream (new ByteArrayInputStream (tBytes)); StringBuffer szBuffer = new StringBuffer (); byte tByte [] = new byte [1024]; while (true) { int iLength = gzip.read (tByte, 0, 1024); // <-- Error comes here if (iLength < 0) break; szBuffer.append (new String (tByte, 0, iLength)); } And this one that I get on this forum : InputStream gzipStream = new GZIPInputStream (new ByteArrayInputStream (tBytes)); Reader decoder = new InputStreamReader (gzipStream, "UTF-8");//<- I tried ISO-8859-1 and get the same exception BufferedReader buffered = new BufferedReader (decoder); I guess this is an encoding error. Best regards, bill0ute

    Read the article

  • Face morph and recognition

    - by startuper
    I have two requirements: members of a social network choose other member's faces and morph an average face of them. The website finds other members' faces that resemble the morphed face and list up in order of resemblance. Is there a script that can do this? I see that http://www.faceresearch.org/demos/average does the item 1 but they don't license their technology. Please help. Thank you in advance.

    Read the article

  • C++ find method is not const?

    - by Rachel
    I've written a method that I'd like to declare as const, but the compiler complains. I traced through and found that this part of the method was causing the difficulty: bool ClassA::MethodA(int x) { bool y = false; if(find(myList.begin(), myList.end(), x) != myList.end()) { y = true; } return y; } There is more happening in the method than that, but with everything else stripped away, this was the part that didn't allow the method to be const. Why does the stl find algorithm prevent the method from being const? Does it change the list in any way?

    Read the article

  • Installer for java application

    - by bguiz
    Hi, I would like to know what packages are out there that can be used to create installers to distribute applications. The target application is written in Java. The installer must be able to: be compiled via an ant script be compiled Linux (and Windows) run on Windows and Linux detect / handle previously installed versions of the application We currently use IzPack, because it does all of the above, except the latter: It cannot easily detect previously installed version of the software. Are there any other packages out there which fit the bill? Thank you!

    Read the article

  • How to sort by a field that has an alternative value if null in lucene?

    - by citizenmatt
    Hi folks. I want to sort my lucene(.net) search results by a date field (date1), but if date1 is not set, I'd like to use date2. The traditional sort method is to sort by date1, and then sort the values that are the same by date 2. This would mean that whenever I did fall back to date2, these values would be at the top (or bottom) of the result set. I'd like to interleave the date2 values with the date1 values. In other words, I want to sort on (date1 != null ? date1 : date2). Is this possible in lucene? I reckon I could do this in the index creation phase (just put the relevant date value in a new field) but I don't have enough control of the indexing process to be able to do this, so would like a sorting solution. Any ideas? Thanks Matt

    Read the article

  • We have multiple app servers running against a single database. How do I ensure that each row in a q

    - by Dave
    We have about 7 app servers running .NET windows services that ping a single sql server 2005 queue table and fetch a fixed amount of records to process at fixed intervals. The amount of records to process and the amount of time between fetches are both configurable and are initially set to 100 and 30 seconds initially. Currently, my queue table has an int status column which can be either "Ready, Processing, Complete, Error". The proc that fetches the records has a sql transaction with the following code inside the transaction: 1) Fetch x number of records into temp table where the status is "Ready". The select uses a holdlock hint 2) Update the status on those records in the Queue table to "Processing" The .NET services do some processing that may take seconds or even minutes per record. Another proc is called per record that simply updates the status to "Complete". The update proc has no transaction as I'm leaning on the implicit transaction as part of the update clause here. I don't know the traffic exceptions for this but figure it will be under 10k records per day. Is this the best way to handle this scenario? If so, are there any details that I've left out, such as a hint here or there? Thanks! Dave

    Read the article

  • mysql query is producing more results than it should

    - by user253530
    SELECT S.CLIENT,S.IP_DOMAIN as IP, IFNULL(K.DATE, DATE '0000-00-00') AS RecentDate FROM PLD_SERVERS AS S JOIN PLD_SEARCHES AS K ON S.ID = K.SERVER_ID This query will produce as many results as entries in the PLD_SEARCHES. For example: I have 3 entries in PLD_SERVERS and 18 entries in PLD_SEARCHES. The output of this query will be 18 but i need it to be 3 (as the number of PLD_SERVERS entries) with the recent date as a join field from PLD_SEARCHES.

    Read the article

  • hibernate and ehcache replication

    - by cachingsol
    Hi, I am working on a cache replication solution between nodes Node A - master node = Hibernate + Database + Ehcache as secondary cache Node B - regional node= Ehcache as prmiary cache. no Hibernate Node B is used only as near-by cache for query. Now I am updating data (Say SudentInfo) in Node A, it gets persisted and cached correctly. On replication side (I am using JMS) it sends a message to Node B. But the problem is, the message it sends is of instance CacheEntry(deep Inside Element), there is no way to resurrect the original object (StudentInfo). What I got in node B is CacheEntry with some attributes of Students but not actually an Student Object. Please note that I don't need Hibernate session/persistence in Node B, node B is only for fast query, persistence is done through Node A. So has anybody tried any solution like this? Is there any way to convert CacheEntry to actual object? or Tell ehcache to replicate original object rather than CacheEntry. Thanks for the help

    Read the article

  • Python 3 Gui Development?

    - by bunnyBEARZ
    Are there any good gui libraries for python 3 (NOT 2)? I would love to use tkinter but it's widgets are not native and it is extremely ugly in my opinion. I was wondering if there were any other gui libraries for python 3.

    Read the article

  • Which platform can we expect one's complement being used there?

    - by Jian Lin
    For some questions such as checking whether a number is odd or even, I noted the comment, a & 1 won't work when it is a one's complement machine or when the code is ported to a platform that uses one's complement. Since 30 years ago on the Superboard, TRS-80, Apple II, I haven't seen a system with one's complement. Are there popular systems that use one's complement still, or do we have some cell phone or mobile device that uses one's complement?

    Read the article

  • Passive ftp on Server 2008

    - by xpda
    I have a new Windows 2008 server with IIS7. When I connect to the ftp in active mode, it works fine. In passive mode, it connects, but then times out trying to get the directory listing. I tried disabling both firewalls, but it didn't help. I've tried this with difference client machines and different ftp client software, with no change. Any ideas?

    Read the article

  • What device can create wireless network while connecting to an ethernet router

    - by Nicolo
    Hi, I have access to an ethernet port of a wireless router. I simply connect my laptop to it via an ethernet cable. There are a total of four such ports on the wireless router. Now I want to connect a device (a wireless access point? wireless bridge? wireless switch?) via an ethernet cable to one of the other ethernet ports of the router. I want this device to act as a kind of wireless switch - it should "split" the ethernet connection coming from the router to two or more computers that connect to this device via a wireless. Basically, I have a wireless router with its wireless function switched off. I don't know the password for that router so can't activate the wireless function. Don't know the password of the ISP either. The only thing I can do is to connect via ethernet cable to the wireless router and this does not require a password. Now I want to use that connection and build a wireless upon it. What kind of device do I need? I am not really very well informed about network management and find the descriptions "wireless access point", "wireless bridge", "wireless switch" confusing. I know what an ethernet switch is - what I need is a device which would do the same but by allowing the clients to connect to it via a wireless. What kind of device would do that? Any recommendations about specific products?

    Read the article

  • WebView load css from local file

    - by ADAM
    [[self mainFrame] loadHTMLString:@"<html><body><link href='main.css' rel='stylesheet' type='text/css' /></body></html>" baseURL:nil]; I am trying to load a css file called main.css from the application Resources folder as below from a WebView, how do i get the path of the resources folder correct so i can load the css?

    Read the article

  • Faster way to transfer table data from linked server

    - by spender
    After much fiddling, I've managed to install the right ODBC driver and have successfully created a linked server on SQL Server 2008, by which I can access my PostgreSQL db from SQL server. I'm copying all of the data from some of the tables in the PgSQL DB into SQL Server using merge statements that take the following form: with mbRemote as ( select * from openquery(someLinkedDb,'select * from someTable') ) merge into someTable mbLocal using mbRemote on mbLocal.id=mbRemote.id when matched /*edit*/ /*clause below really speeds things up when many rows are unchanged*/ /*can you think of anything else?*/ and not (mbLocal.field1=mbRemote.field1 and mbLocal.field2=mbRemote.field2 and mbLocal.field3=mbRemote.field3 and mbLocal.field4=mbRemote.field4) /*end edit*/ then update set mbLocal.field1=mbRemote.field1, mbLocal.field2=mbRemote.field2, mbLocal.field3=mbRemote.field3, mbLocal.field4=mbRemote.field4 when not matched then insert ( id, field1, field2, field3, field4 ) values ( mbRemote.id, mbRemote.field1, mbRemote.field2, mbRemote.field3, mbRemote.field4 ) WHEN NOT MATCHED BY SOURCE then delete; After this statement completes, the local (SQL Server) copy is fully in sync with the remote (PgSQL server). A few questions about this approach: is it sane? it strikes me that an update will be run over all fields in local rows that haven't necessarily changed. The only prerequisite is that the local and remote id field match. Is there a more fine grained approach/a way of constraining the merge statment to only update rows that have actually changed?

    Read the article

  • Python for a hobbyist programmer ( a few questions)

    - by Matt
    I'm a hobbyist programmer (only in TI-Basic before now), and after much, much, much debating with myself, I've decided to learn Python. I don't have a ton of free time to teach myself a hundred languages and all programming I do will be for personal use or for distributing to people who need them, so I decided that I needed one good, strong language to be good at. My questions: Is python powerful enough to handle most things that a typical programmer might do in his off-time? I have in mind things like complex stat generators based on user input for tabletop games, making small games, automate install processes, and build interactive websites, but probably a hundred things along those lines Does python handle networking tasks fairly well? Can python source be obscufated (mispelled I think), or is it going to be open-source by nature? The reason I ask this is because if I make something cool and distribute it, I don't want some idiot script kiddie to edit his own name in and say he wrote it And how popular is python, compared to other languages. Ideally, my language would be good and useful with help found online without extreme difficulty, but not so common that every idiot with computer knows python. I like the idea of knowing a slightly obscure language. Thanks a ton for any help you can provide.

    Read the article

  • Maven problem with invalid jar file which is actually html

    - by fei
    i'm running into a problem in my maven build recently, that it downloads a jar file for the javamail-1.4.jar or something, but it turns out the file is not a real jar file, it's actually a html with a link to where to get the correct jar. it seems to be the repo has changed for that. but in my maven setting everything is supposely to go to our internal repo, i don't know how did that happen. but anyways, more importantly, how do i fix this problem so that it will download the correct jar file on a fresh install? thanks!

    Read the article

  • Getting the index of the returned max or min item using max()/min() on a list

    - by KevinGriffin
    I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min(). In other words, I need to know which move produced the max (at a first player's turn) or min (second player) value. for i in range(9): newBoard = currentBoard.newBoardWithMove([i / 3, i % 3], player) if newBoard: temp = minMax(newBoard, depth + 1, not isMinLevel) values.append(temp) if isMinLevel: return min(values) else: return max(values) I need to be able to return the actual index of the min or max value, not just the value.

    Read the article

  • Arrrg! MovieClip object refuses to moved in any rational way in as3?

    - by Aaron H.
    I have a MovieClip object, which is exported for actionscript (AS3) in an .swc file. When I place an instance of the clip on the stage without any modifications, it appears in the upper left corner, about half off stage (i.e. only the lower right quadrant of the object is visible). I understand that this is because the clip has a registration point which is not the upper left corner. If you call getBounds() on the movieclip you can get the bounds of the clip (presumably from the "point" that it's aligned on) which looks something like (left: -303, top: -100, right: 303, bottom: 100), you can subtract the left and top values from the clip x and y: clip.x -= bounds.left; clip.y -= bounds.top; This seems to properly align the clip fully on stage with the top left of the clip squarely in the corner of the stage. But! Following that logic doesn't seem to work when aligning it on the center of the stage! clip.x = (stage.stageWidth / 2); etc... This creates the crazy parallel universe where the clip is now down in the lower right corner of the stage. The only clue I have is that looking at: clip.transform.matrix and clip.transform.concatenatedMatrix matrix has a tx value of 748 (half of stage height) ty value of 426 (Half of stage height) concatenatedMatrix has a tx value of 1699.5 and ty value of 967.75 That's also obviously where the movieclip is getting positioned, but why? Where is this additional translation coming from?

    Read the article

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