Search Results

Search found 243 results on 10 pages for 'fernando garcia'.

Page 8/10 | < Previous Page | 4 5 6 7 8 9 10  | Next Page >

  • How to save the world from your computer?

    - by Francisco Garcia
    Sometimes I miss the "help other people" factor within computer related careers. Sure that out there I could find many great projects improving society, but that is not common. However there are little things that we all can do to make this a better place beyond trying to erradicate annoynig stuff such as Visual Basic. You could join a cloud computing network such as World Community Grid to fight cancer. Write a charityware application such as Vim, improve an office IT infrastructure to support telecommuting and reduce CO2 emissions, use an ebook reader for saving paper... what else would you? which projects do you think can have an impact?

    Read the article

  • javascript switch using intervals

    - by Fernando SBS
    Can I use intervals in a switch statement? Like switch (parseInt(troops[i])) { case <10: editbox.style.fontSize = "13px"; break; case <100: editbox.style.fontSize = "12px"; break; case <1000: editbox.style.fontSize = "8px"; editbox.size = 3; //editbox.style.width = "18px"; break; default: editbox.style.fontSize = "10px"; } ???

    Read the article

  • Generate random number from an arbitrary weighted list

    - by Fernando
    Here's what I need to do, I'll be doing this both in PHP and JavaScript. I have a list of numbers that will range from 1 to 300-500 (I haven't set the limit yet). I will be running a drawing were 10 numbers will be picked at random from the given range. Here's the tricky part: I want some numbers to be less likely to be drawn up. A small set of those 300-500 will be flagged as "lucky numbers". For example, out of 100 drawings, most numbers have equal chances of being drawn, except for a few, that will only be picked once every 30-50 drawings. Basically I need to artificially set the probability of certain numbers to be picked while maintaining an even distribution with the rest of the numbers. The only similar thing I've found so far is this question: Generate A Weighted Random Number, the problem being that my spec has considerably more numbers (up to 500) so the weights would get very small and supposedly this could be a problem with that solution (Rejection Sampling). I'm still trying it, though, but I wonder if there other solutions. Math is not my thing so I appreciate any input. Thanks.

    Read the article

  • How to make Subversion use Linux system accounts for authentication?

    - by Alejandro García Iglesias
    Hi all, I've set up a Ubuntu Server for Subversion with Apache/WebDAV interface to share repositories with other developers. My question is, how can I make Subversion use the linux system accounts for authentication? This would lead to very easy Subversion account management. Subversion with Apache/WebDAV is currently working with this configuration: Contents of /etc/apache2/mods-available/dav_svn.conf: <Location /svn> DAV svn SVNParentPath /home/svn SVNListParentPath On AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd Require valid-user </Location> I have tried changing AuthUserFile /etc/apache2/dav_svn.passwd with AuthUserFile /etc/shadow with no success. This makes the server to respond with a error 500 internal server error. It's logical, why the Web service should have access to system authentication file? Thanks a lot in advance!

    Read the article

  • Determine target architecture of binary file in Linux (library or executable)

    - by Fernando Miguélez
    We have an issue related to a Java application running under a (rather old) FC3 on a Advantech POS board with a Via C3 processor. The java application has several compiled shared libs that are accessed via JNI. Via C3 processor is suppossed to be i686 compatible. Some time ago after installing Ubuntu 6.10 on a MiniItx board with the same processor I found out that the previous statement is not 100% true. The Ubuntu kernel hanged on startup due to the lack of some specific and optional instructions of the i686 set in the C3 processor. These instructions missing in C3 implementation of i686 set are used by default by GCC compiler when using i686 optimizations. The solution in this case was to go with a i386 compiled version of Ubuntu distribution. The base problem with the Java application is that the FC3 distribution was installed on the HD by cloning from an image of the HD of another PC, this time an Intel P4. Afterwards the distribution needed some hacking to have it running such as replacing some packages (such as the kernel one) with the i383 compiled version. The problem is that after working for a while the system completely hangs without a trace. I am afraid that some i686 code is left somewhere in the system and could be executed randomly at any time (for example after recovering from suspend mode or something like that). My question is: Is there any tool or way to find out at what specific architecture is an binary file (executable or library) aimed provided that "file" does not give so much information?

    Read the article

  • How to use your computer to save the world?

    - by Francisco Garcia
    Sometimes I miss the "help other people" factor within computer-related fields. However, there are little things that we all can do to make this a better place—beyond trying to eradicate annoying stuff such as Visual Basic. You could join a cloud computing network such as World Community Grid to fight cancer, write a charityware application such as Vim, improve office IT infrastructure to support telecommuting and reduce CO2 emissions, use an ebook reader to save paper, ... What else can we do to help others? Which projects can have the biggest impact?

    Read the article

  • javascript - dom - how to get info from a specific field?

    - by Fernando SBS
    <table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">Movimentações de tropas:</th></tr></thead><tbody><tr> <td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="att1" alt="Tropas atacantes chegando" title="Tropas atacantes chegando" /></a><span class="a1">&raquo;</span></td> <td><div class="mov"><span class="a1">1&nbsp;Ataque</span></div><div class="dur_r">em&nbsp;<span id="timer1">13:21:06</span>&nbsp;hrs.</div></div></td></tr><tr> <td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="def1" alt="Tropas de reforço chegando" title="Tropas de reforço chegando" /></a><span class="d1">&raquo;</span></td> <td><div class="mov"><span class="d1">1&nbsp;Reforço</span></div><div class="dur_r">em&nbsp;<span id="timer2">0:14:55</span>&nbsp;hrs.</div></div></td></tr><tr> <td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="att2" alt="Próprias tropas atacando" title="Próprias tropas atacando" /></a><span class="a2">&laquo;</span></td> <td><div class="mov"><span class="a2">1&nbsp;Ataque</span></div><div class="dur_r">em&nbsp;<span id="timer3">0:08:50</span>&nbsp;hrs.</div></div></td></tr><tr> <td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="def2" alt="Próprias tropas reforçando" title="Próprias tropas reforçando" /></a><span class="d2">&laquo;</span></td> <td><div class="mov"><span class="d2">1&nbsp;Reforço</span></div><div class="dur_r">em&nbsp;<span id="timer4">2:50:45</span>&nbsp;hrs.</div></div></td></tr></tbody></table> this is the source code, what I need to is get the 0:14:55 . but it has to be based on the class="d1" because the id="timer2" is always changing, sometimes the 0:14:55 will be related to id="timer1", other times to id="timer3", but the class="d1" is always correct. How to do it? <td class="typ"><a href="build.php?gid=16"><img src="img/x.gif" class="def1" alt="Tropas de reforço chegando" title="Tropas de reforço chegando" /></a><span class="d1">&raquo;</span></td> <td><div class="mov"><span class="d1">1&nbsp;Reforço</span></div><div class="dur_r">em&nbsp;<span id="timer2">0:14:55</span>&nbsp;hrs.</div></div></td></tr><tr>

    Read the article

  • How do I switch out Views in a Cocoa application?

    - by David Garcia
    So I'm beginning to learn how to use Cocoa. I think I've pretty much got it but I'm hung up on creating and switching views. I'm rewriting a game I made a little bit ago for practice. All I want is one window (preferably not resizable) and I want to be able to switch out views for different screens in the game. First, I have the main menu (Start Game, High Scores, Exit). Then I need a window for each screen (Gameplay screen, Highscore screen). What I'm getting confused with is how to design this. I looked up NSViewController thinking it manages views but it doesn't. It only manages one view by loading it really. I don't understand why I'd need to use NSViewController then. Couldn't I just have a window class that contains multiple subclasses of NSView and load them like that? I'm not sure I understand the purpose of the ViewController. Does my Window Class really need to subclass NSWindowController? I was trying to follow the example of Apple's ViewController example and it has a window controller class that's a subclass of NSWindowController. I don't see what the purpose was of subclassing that. All NSWindowController seems to add is - initWithPath:(NSString *)newPath but I fail to see the use in that either when I can just edit the plist file to open the window on start up. Apple's example also has an NSView variable and an NSViewController variable. Don't you only need one variable to store the current view? Thanks in advance guys, I'm really confused as to how this works.

    Read the article

  • Do new Apple SDKs patch previous releases?

    - by Francisco Garcia
    A new iPhone will be soon out there along a new iOS release. Sooner or later there will also be a Xcode upgrade with the SDK for iOS 6 Does Apple do any type of bugfix on previous SDKs or are bugfixes just solved on new releases? As an example: Core Data with iCloud still have some issues but it is getting better over time. Let's say I have an app that really depends on that combo. I would require iOS6, however not all users upgrade the handsets. Ideally an app compiled with a newer XCode release could patch some error on previous SDKs if the target is set to an older iOS release. Should I expect that a project compiled with future SDK releases to work better on devices running on older iOS versions? will be some SDKs bugfixes backported? I understand that there are some bugs that cannot be fixed without an iOS update on the client. Also that it is a lot of work (and unlikely) to backport bugfixes. I am just wondering what is the normal release policy of Apple.

    Read the article

  • Is it a good idea to use only a key to encrypt an entire (small) filesystem?

    - by Fernando Miguélez
    This question comes as part of my doubts presented on a broader question about ideas implementing a small encrypted filesystem on Java Mobile phones (J2ME, BlackBerry, Android). Provided the litte feedback received, considering the density of the question, I decided to divide those doubts into small questions. So to sum up I plan to "create" an encrypted filesystem for for mobile phones (with the help of BoucyCastle or a subset of JCE), providing an API that let access to them in a transparent way. Encryption would be carried out on a file basis (not blocks). My question is this: Is it a good idea to use only a simmetric key (maybe AES-256) to encrypt all the files (they wouldn't be that many, maybe tens of them) and store this key in a keystore (protected by a pin) or would you rather encrypt each file with an on-the-fly generated key stored alongside each file, encrypting that key with the "master" key stored on the keystore? What are the benefits/drawbacks of each approach?

    Read the article

  • StreamReader returning another char

    - by Fernando
    I'm trying to read the content of a file with a StreamReader, that receives a FileStream. The file has some spaces inside (char 32) and the StreamReader is reading them as 0 (char 48). The screenshot shows the FileStream buffer and the StreamReader buffer. Both have the value 32, but when I call Read(), it returns 48. Am I missing something here? By the way, the code is running under .NET Compact Framework. The code that reads the data: public void Read() { using (StreamReader reader = new StreamReader(InputStream, Encoding.ASCII)) { foreach (var property in DataObject.EnumerateProperties()) { OffsetInfo offset = property.GetTextOffset(); reader.BaseStream.Position = offset.Start - 1; StringBuilder builder = new StringBuilder(offset.Size); int count = 0; while (reader.Peek() >= 0 && count < offset.Size) { char c = (char)reader.Read(); if ((int)c != 32 && c != '\r' && c != '\n') { builder.Append(c); count++; } else { reader.BaseStream.Position++; } } property.SetValue(DataObject, Convert.ChangeType(builder.ToString(), property.PropertyType, CultureInfo.CurrentCulture), null ); } } }

    Read the article

  • High quality software examples

    - by Francisco Garcia
    One of the best ways to learn about programming is reading high quality code/projects from great engineers. Which open-source projects do you think is worth looking at? I mean, that code that you can print and sit under a tree with a glass of wine and enjoy reading. If you can, also specify if the software is great to look at because its documentation, design, UML diagrams or just plain code. I believe UML is not very common within open-source projects. Is there such a thing as a project branch that polishes code and design with the sole objective to give other programmers a great example of great software?

    Read the article

  • Rails: has_many association with a table in another database and without foreign key

    - by Fernando
    Here is my situation. I have model called Account. An account can have one or more contracts. The problem is that i'm dealing with a legacy application and each account's contracts are stored in a different database. Example: Account 1's contract are in account1_db.contracts. Account 2's contract are in account2_db.contracts. The database name is a field stored in accounts table. How can i make rails association work with this? This is a legacy PHP application and i simply can't change it to store everything in one table. I need to make it work somehow. I tried this, but it didn't worked: has_many :contracts, :conditions => [lambda{ Contract.set_table_name(self.database + '.contracts'); return '1' }] Any ideas?

    Read the article

  • StackOverflow WordPress Plugin: Sidebar Widget [closed]

    - by Fernando
    I used the idea from "StackOverflow badge to show in your blog" from here to develop a small WordPress plugin to show your SO reputation and badges on your WordPress weblog sidebar. It's awfully lacking some graphic design, style, color, etc. I also thought of adding the user avatar, and images for the different badges. But it's working so far, and it's pretty late and I have to get some sleep. But I'll add the stuff I mentioned tomorrow. That was quite an interesting PHP challenge. Hope someone finds it as usefull as me (already showing it off on my blog :P ). If you're interested: Download it here

    Read the article

  • Reading the .vcproj file with C#

    - by Dulantha Fernando
    We create the vcproj file with the makefileproj keyword so we can use our own build in VS. My question is, using C#, how do you read the "C++" from the following vcproj file: <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="TestCSProj" ProjectGUID="{840501C9-6AFE-8CD6-1146-84208624C0B0}" RootNamespace="TestCSProj" Keyword="MakeFileProj" > <Platforms> <Platform Name="x64" /> <Platform Name="C++" ===> I need to read "C++" /> </Platforms> I used XmlNode and got upto the second Platform: String path = "C:\\blah\\TestCSProj\\TestCSProj\\TestCSProj.vcproj"; FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); XmlDocument xmldoc = new XmlDocument(); xmldoc.Load(fs); XmlNodeList oldFiles = xmldoc.GetElementsByTagName("Platform"); XmlAttribute name = oldFiles[1].Attributes[0]; Console.WriteLine(name.Name); This will print Name, but I need "C++". How do I read that? Thank you very much in advance

    Read the article

  • Restrict update Column

    - by Kushan Hasithe Fernando
    Is it possible to restrict updating a column in SQL without using a trigger ? If so how ? (need the query) PS: I mean, I have a table CREATE TABLE MYBUDGET.tbl_Income ( [IncomeID] INT NOT NULL IDENTITY(1,1), [IncomeCatID] INT NOT NULL, [IncomeAmnt] MONEY NOT NULL, [IncomeCurrencyID] INT NOT NULL, [ExchangeRateID] INT NOT NULL, [IncomeAmnt_LKR] MONEY NOT NULL, [AddedOn] DATETIME NOT NULL, [Remark] VARCHAR(250), ) I need to allow users to update only [ExchangeRateID] and [IncomeAmnt_LKR] fields. All other fields can not be updated. only insert.

    Read the article

  • jQuery: event that tracks click in browser autocomplete

    - by Fernando
    I have a keyup event on an input. This event works fine for auto complete when you select a value and press enter. But it doesn't work when you click at an auto complete value. Is there an event that i can use in such case? I already tried the change one but it doesn't work. Thanks! Edit: Maybe i was not clear but i am referring to the autocomplete feature that browsers have. I am not trying to build my own. Example: I have the following event: $('.product').keyup(searchByProduct); When user clicks at this input the old values that he already typed shows up ( it's the browser that does this ). If he clicks on one of the values, the function searchByProduct is not called. Which event do i have to register to track this click ( and that the input content has changed )?

    Read the article

  • How to change a button from another function?

    - by Fernando SBS
    var ButtonFarmAtivada = new Array(); function X() { var tableCol = dom.cn("td"); //cell 0 //create start checkbox button ButtonFarmAtivada[index] = createInputButton("checkbox", index); ButtonFarmAtivada[index].name = "buttonFarmAtivada_"+index; ButtonFarmAtivada[index].checked = GM_getValue("farmAtivada_"+index, true); FM_log(3,"checkboxFarm "+(index)+" = "+GM_getValue("farmAtivada_"+index)); ButtonFarmAtivada[index].addEventListener("click", function() { rp_farmAtivada(index); }, false); tableCol.appendChild(ButtonFarmAtivada[i]); tableRow.appendChild(tableCol); // add the cell } 1) is it possible to create the button inside an array as I'm trying to do in that example? like an array of buttons? 2) I ask that because I will have to change this button later from another function, and I'm trying to do that like this (not working): function rp_marcadesmarcaFarm(valor) { var vListID = getAllVillageId().toString(); FM_log(4,"MarcaDesmarcaFarm + vListID="+vListID); var attackList = vListID.split(","); for (i = 0; i <= attackList.length; i++) { FM_log(3, "Marca/desmarca = "+i+" "+buttonFarmAtivada[i].Checked); ButtonFarmAtivada[i].Checked = valor; }; };

    Read the article

  • javascript font size not working

    - by Fernando SBS
    why this don´t work: function rp_insertTable() { FM_log(3,"rp_insertTable() called"); var farmTable = dom.cn("table"); var ftableBody = dom.cn("tbody"); var i; var maximize = GM_getValue("Maximize_" + suffixGlobal, 0); farmTable.className = "FMtbg"; farmTable.id = "farmMachineTable"; farmTable.setAttribute('cellpadding', 2); farmTable.setAttribute('cellspacing', 1); farmTable.style.marginBotton = "12px"; farmTable.style.font = "bold 12px arial,serif"; farmTable.style.font = "bold 12px arial,serif"; the font does change in format, but the font size is not working, I can put 100px and it deosn´t change anything, why is that?

    Read the article

  • javascript - switch not working

    - by Fernando SBS
    function FM_log(level, text) { // caso não seja log total escolhe o que loga var log = false; switch (level) { case "addtoprio()":log = true; case "alternaTropas()":log = false; case "sendtroops()":log = false; defalt: log = false; } if ((logTotal == false) && (log == true)) GM_log(horaAtual() + " - "+level+", "+text); else if (logTotal == true) GM_log(horaAtual() + " - "+level+", "+text); } how to do that switch is a way it works?

    Read the article

  • mod_rewrite params inversion

    - by Fernando Constantino
    How can I create the mod_rewrite rule so I can convert the following URLs: From: domain/something/param/action ex:domain/cities/Chicago/view to: domain/something/action.php?param1=param ex: domain/cities/view.php?city=Chicago Changing to cities/view/Chicago cannot be an alternative. Thanks in advance.

    Read the article

  • Display a diferent selector with each Galleria image

    - by Fernando
    I'm looking for a way to trigger for a different function on each individual image. I'm using the Galleria Jquery plugin and have it set up on my site. The problem is i want to display a div with information depending on which image is loaded. I can't figure out how to capture which image is displayed and how to create a condition based on it.

    Read the article

< Previous Page | 4 5 6 7 8 9 10  | Next Page >