Daily Archives

Articles indexed Tuesday March 30 2010

Page 13/126 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Pure Java open-source libraries for portfolio selection (= constrained, non-linear optimization)?

    - by __roland__
    Does anyone know or has experience with a pure Java library to select portfolios or do some similar kinds of quadratic programming with constraints? There seems to be a lot of tools, as already discussed elsewhere - but what I would like to use is a pure Java implementation. Since I want to call the library from within another open-source software with a BSD-ish license I would prefer LGPL over GPL. Any help is appreciated. If you don't know such libraries, which is the most simple algorithm you would suggest to implement? It has to cope with an inequality constraint (all x_i = 0) and an equality constraint (sum of all x_i = 1).

    Read the article

  • how to uppercase date and month first letter of ToLongDateString() result in es-mx Culture ?

    - by Oscar Cabrero
    currently i obtain the below result from the following C# line of code when in es-MX Culture Thread.CurrentThread.CurrentCulture = Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-mx"); <span><%=DateTime.Now.ToLongDateString()%></span> miércoles, 22 de octubre de 2008 i would like to obtain the following Miércoles, 22 de Octubre de 2008 do i need to Build my own culture?

    Read the article

  • IBM Informix Spatial datablade LIneFromText function

    - by swatit
    Hi Everybody, I am using IBM-Informix for my school project as part of "Informix on-campus" ativity conduted by IBM. I am using spatial datablade to store spatial data. My spatial data table looks like, CREATE TABLE xmlTest (row_id integer NOT NULL,pre integer, post integer,parent integer,tagname varchar(40,1),point ST_POINT); Then I inserted the spatial data into the table. Now I am trying to select the 'Points' lying under given 'polygon', where the co-ordinates of the polygon are dynamic i.e co-ordinates will be decided in the 'select' query. My query is like SELECT v2.* FROM xmlTest v1,xmlTest v2 WHERE ST_Contains(ST_Polygon(ST_LineFromText('linestring (0 0, 22000 0,22000 22000,0 22000,0 0)',5)),ST_Point(v1.pre,v1.post,5)) AND v1.tagname like 'n1' AND ST_Contains(ST_Polygon(ST_LineFromText('linestring (0 0,v1.pre 0,v1.pre v1.post,0 v1.post,0 0 )',5)),ST_Point(v2.pre,v2.post,5)) AND v2.tagname like 'n2' however it is giving me error as "(USE31) - Too few points for geometry type in ST_LineFromText.", in the second linefromtext function. I checked the number of parameters for linestring function, but could not find the source of error. I think,linestring function's parameters should be fixed values and not the variable like in this query. Is it right? Then what is the alternate way, where I can specify my polygon co-ordinates dynamically? or is there any mistake in my query? I hope my question is clear. I appreciate your help!

    Read the article

  • Is there a better way than a sequence of if's to handle events?

    - by Matt
    I recently ran across several objects implemented to handle events with a hard coded mapping using this pattern: public void handleEvent(Event event) { if(event.getCode() == SOME_STATIC_EVENT) doSomething(event); if(event.getCode() == ANOTHER_STATIC_EVENT) doSomethingElse(event); } where doSomething functions are implemented as methods of the same class. In hopes of striving for looser coupling, how would you suggest abstracting out this pattern? Also, what's the best approach for mapping 0..N functions to a fired event?

    Read the article

  • Simplest way to debug an android bluetooth application

    - by intiha
    I am trying to test and build a sample android application that can simply connect to a BT server to send and receive a few packets. Since the emulator has no support what is the next best thing to test BT communication? Can I just run a code that acts as a server on my laptop and dumps BT connection onto a console? Do I have to write this code, or is their a simple tool that saves me that hassle? One more thing, I have windows 7, and currently I attach to my PC an anycom USB BT adapter. This is able to show up my nexus one as a BT device. I can pair to my laptop but connection always fails. When it tries to pair I have tried both 0000 and 1234 as suggested on my nexus, but in my connection list it still lists my laptop as paired but not connected. Any idea why? I searched for this problem and apparently people talk about rebooting and power cycling BT, but these solutions dont work for me. Thanks. Affan.

    Read the article

  • How do I enable SQLite on Linux/Apache/PHP?

    - by Edward Tanguay
    To enable SQLite on my Windows/Apache/PHP setup, I uncomment the following lines in the php.ini file and restart Apache: extension=php_pdo.dll extension=php_pdo_sqlite.dll Now I have a VPS with Suse Linux 10.3 and Apache/PHP was set automatically. Looking through the php.ini file to make the above changes, I see that things are a little different on Linux: there is no list of extensions to uncomment I found "extension_dir = /usr/lib/php5/extensions" but in this directory find only: pdo.so pdo_mysql.so How can I enable SQLite in this Linux environment?

    Read the article

  • Transfering iTunes Connect Account name and information. [closed]

    - by Avizzv92
    I would like to change the name/ssn/tax information that is currently signed up with the iTunes Connect account. Basically I want to transfer the account to a different person. I know you need to contact them directly and you can't do it online, but I'm wondering how difficult it is to do? And what are the chances that Apple will do this for me?

    Read the article

  • Oracle SQL: ROLLUP not summing correctly

    - by tommy-o-dell
    Hi guys, Rollup seems to be working correcly to count the number of units, but not the number of trains. Any idea what could be causing that? The output from the query looks like this. The sum of the Units column in yellow is 53 but the rollup is showing 51. The number of units adds up correctly though... And here's the oracle SQL query... select t.year, t.week, decode(t.mine_id,NULL,'PF',t.mine_id) as mine_id, decode(t.product,Null,'LF',t.product) as product, decode(t.mine_id||'-'||t.product,'-','PF',t.mine_id||'-'||t.product) as code, count(distinct t.tpps_train_id) as trains, count(1) as units from ( select trn.mine_code as mine_id, trn.train_tpps_id as tpps_train_id, round((con.calibrated_weight_total - con.empty_weight_total),2) as tonnes from widsys.train trn INNER JOIN widsys.consist con USING (train_record_id) where trn.direction = 'N' and (con.calibrated_weight_total-con.empty_weight_total) > 10 and trn.num_cars > 10 and con.consist_no not like '_L%' ) w, ( select to_char(td.datetime_act_comp_dump-7/24, 'IYYY') as year, to_char(td.datetime_act_comp_dump-7/24, 'IW') as week, td.mine_code as mine_id, td.train_id as tpps_train_id, pt.product_type_code as product from tpps.train_details td inner join tpps.ore_products op using (ore_product_key) inner join tpps.product_types pt using (product_type_key) where to_char(td.datetime_act_comp_dump-7/24, 'IYYY') = 2010 and to_char(td.datetime_act_comp_dump-7/24, 'IW') = 12 order by td.datetime_act_comp_dump asc ) t where w.mine_id = t.mine_id and w.tpps_train_id = t.tpps_train_id having t.product is not null or t.mine_id is null group by t.year, t.week, rollup( t.mine_id, t.product)

    Read the article

  • ThreadAbortException (WebClient using DownloadFile to grab file from server)

    - by baron
    Hi Everyone, Referencing my Earlier Question, regarding downloading a file from a server and handling exceptions properly. I am positive that I had this solved, then in classic programming fashion, returned days later to frustratingly find it broken :-( Updated code: private static void GoGetIt(HttpContext context) { var directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe = new FileInfo(......); var name = SomeBasicLogicToDecideName(); //if (!directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe.RefreshExists()) //{ // throw new Exception(string.Format("Could not find {0}.", name)); //} var tempDirectory = ""; //Omitted - creates temporary directory try { directoryInfoOfWhereTheDirectoryFullOfFilesShouldBe.CopyAll(tempDirectory); var response = context.Response; response.ContentType = "binary/octet-stream"; response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}.zip", name)); ZipHelper.ZipDirectoryToStream(tempDirectory, response.OutputStream); response.End(); } catch (Exception ex) { Debug.WriteLine(ex.ToString()); context.Response.StatusCode = 404; } finally { tempDirectory.DeleteWithPrejudice(); } } This was working fine, and returning the zip, otherwise if the file didn't exist returning 404. Then on the client side I could handle this: public bool Download() { try { using (var client = new WebClient()) { client.DownloadFile(name, tempFilePath); } } catch (Exception) { fileExists = false; } return fileExists; } But the problem now is two things. 1) I get System.Threading.ThreadAbortException: Thread was being aborted in the server side try-catch block. Usually this was just a file not found exception. I have no idea what or why that new exception is throwing? 2) Now that a different exception is throwing on the server side instead of the file not found, it would seem I can't use this set up for the application, because back on client side, any exception is assumed to be filenotfound. Any help, especially info on why this ThreadAbortException is throwing!?!? greatly appreciated. Cheers

    Read the article

  • Why does it NOT give a segmentation violation?

    - by user198729
    The code below is said to give a segmentation violation: #include <stdio.h> #include <string.h> void function(char *str) { char buffer[16]; strcpy(buffer,str); } int main() { char large_string[256]; int i; for( i = 0; i < 255; i++) large_string[i] = 'A'; function(large_string); return 1; } It's compiled and run like this: gcc -Wall -Wextra hw.cpp && a.exe But there is nothing output. NOTE The above code indeed overwrites the ret address and so on if you really understand what's going underneath.

    Read the article

  • Where do you store the private key for your code signing certificate?

    - by flipdoubt
    I recently acquired a code signing certificate for my employer, but I am not the InstallShield developer who will sign the binaries before distribution. I know I can export the certificate along with its private key, but where do I store it so the InstallShield developer can install it on his machine? Should I remove it from my machine once I give it to the person doing the signing? Where do I store the master copy? Obviously, source control is not the best place, unless I lock down that directory in SVN.

    Read the article

  • Find order of data inside an array

    - by user271619
    I have a simple array of stuff: $array = array("apples","oranges","strawberries"); I am trying to find the order of the stuff inside the array. (sometimes the order changes, and so do the items) I'm expecting to get something like this: "apples" = 0, "oranges = 1, "strawberries = 2 The end result has something to do with database sorting. Something like this, inside a foreach loop: UPDATE tbl SET sortorder = $neworder WHERE fruit = '$fruitname' The $neworder variable would be populated with the new order, inside the array. While the $fruit variable comes from the item inside the array.

    Read the article

  • Tool to aid Code Review

    - by Prakash
    For our small team of 20 developers, we used do code review like: Make a label in svn and publish the label to the reviewers Reviewers checkout the code and add comments in line (with marker like: // REVIEWER_NAME::REVIEW COMMENT:) After all comments are in, reviewer checks in the code, preferably with new label. Developer checks the comments and makes changes (if appropriate) Developer keeps an excel sheet report for considered changes and reasons for ignored comments Problem: Developer needs to keep track of multiple labels which might have same comments Sometimes we even do One on One review and if we really have time, even do Table review (team of reviewers looks at the code on projector, on the fly, and pass comment) I was wondering: Are you guys using any specific tool which helps to do code reviews smoother? I have heard of Code Collaborator. But have anyone used that? Is it worth the money?

    Read the article

  • Custom Validator and specifying type of message

    - by user102533
    I have a custom validation in the enterprise validation block. The DoValidate method is as shown below. protected override void DoValidate(Double objectToValidate, object currentTarget, string key, ValidationResults validationResults) { if (!IsSalMoreThanMinWage(objectToValidate)) { //Here I need to mark this message as a "Warning" LogValidationResult(validationResults, "Salary is too low for this state", currentTarget, key); } } I'd need to mark this validation failure as a "warning" message. In the front end, when I iterate through the ValidationResults collection and grab a ValidationResult object, I would need to identify and group different types of messages and render them differently. My question is - how do I mark a failure as a warning?

    Read the article

  • What happens after a packet is captured?

    - by Rayne
    Hi all, I've been reading about what happens after packets are captured by NICs, and the more I read, the more I'm confused. Firstly, I've read that traditionally, after a packet is captured by the NIC, it gets copied to a block of memory in the kernel space, then to the user space for whatever application that then works on the packet data. Then I read about DMA, where the NIC directly copies the packet into memory, bypassing the CPU. So is the NIC - kernel memory - User space memory flow still valid? Also, do most NIC (e.g. Myricom) use DMA to improve packet capture rates? Secondly, does RSS (Receive Side Scaling) work similarly in both Windows and Linux systems? I can only find detailed explanations on how RSS works in MSDN articles, where they talk about how RSS (and MSI-X) works on Windows Server 2008. But the same concept of RSS and MSI-X should still apply for linux systems, right? Thank you. Regards, Rayne

    Read the article

  • Vertical scroll is not active when a UITableView is put into a UIScrollView+PageControl

    - by Ming
    Hi all, I am trying to simulate a TabStrip using UIScrollView+PageControl. Inside each Tab/Page (UIView is used here), I've put a UITableView inside. The outer scroll view & pageControl work perfect, I can swipe fom one page to the next. Now the problem iswhen there are more entries in the UITableView, the vertical scrolling of the inner UITableView does not work any more. Anyone has an idea? regards, Ming

    Read the article

  • Microsoft exchange/outlook "tasks" in linux/evolution ??

    - by criss
    Hi all Ive tried receiving Microsoft outlook/exchange tasks (like meetings and duties) with "evolution"(evolution) without any success... Have anyone succeed with evolution or other linux program?? This is the only thing stopping me to say good by to microsft windows... Best Regards and thanks for the great Site !!

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >