Daily Archives

Articles indexed Sunday April 18 2010

Page 21/77 | < Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • Storing old previous year data in Rails?

    - by Millisami
    Hi, I'm developing an app which has massive data entries. Its like Campaign which has attrs like rate_per_sq_feet, start_date, end_date. i.e it will have max date of around 30 days. Once the campaign is finished, its done and another starts. Now I'm confused that how to store those campaigns as reports so that its not accessed regurlarly. What I mean is to store in such a way that it will act like report on later years to come? Its something like fiscal year on accounts where the previous year reports are stored with all the calculations done so that when retrieved later, all the algorithms and calculations shouldn't be performed. Something like frozen data??

    Read the article

  • How mature is apache sshd (MINA)?

    - by Yaneeve
    Has anyone ever used apache sshd (based on Apache MINA)? I would like to get some user input. Is it mature? Does it have (annoying) bugs? How is the API? Can useful documentation/tutorials be found? etc. Thanks all for your feedback.

    Read the article

  • FAT Volume and CE

    - by Kate Moss' Open Space
    Whenever we format a disk volume, it is a good idea to name the label so it will be easier to categorize. To label a volume, we can use LABEL command or UI depends on your preference. Windows CE does provide FAT driver and support various format (FAT12, FAT16,FAT32, ExFAT and TFAT - transaction-safe FAT) and many feature to let you scan and even defrag the volume but not labeling. At any time you format a volume in CE and then mount it on PC, the label is always empty! Of course, you can always label the volume on PC, even it is formatted in CE. So looks like CE does not care about the volume label at all, neither report the label to OS nor changing the label on FAT.So how can we set the volume label in CE? To Answer this question, we need to know how does FAT stores the volume label. Here are some on-line resources are handy for parsing FAT. http://en.wikipedia.org/wiki/File_Allocation_Table http://www.pjrc.com/tech/8051/ide/fat32.html http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx You can refer to PUBLIC\COMMON\OAK\DRIVERS\FSD\FATUTIL\MAIN\bootsec.h and dosbpb.h or the above links for the fields we discuss here. The first sector of a FAT Volume (it is not necessary to be the first sector of a disk.) is a FAT boot sector and BPB (BIOS Parameter Block). And at offset 43, bgbsVolumeLabel (or bsVolumeLabel on FAT16) is for storing the volume lable, but note in the spec also indicates "FAT file system drivers should make sure that they update this field when the volume label file in the root directory has its name changed or created.". So we can't just simply update the bgbsVolumeLabel but also need to create a volume lable file in root directory. The volume lable file is not a real file but just a file entry in root directory with zero file lenth and a very special file attribute, ATTR_VOLUME_ID. (defined in public\common\oak\drivers\fsd\fatutil\MAIN\fatutilp.h) Locating and accessing bootsector is quite straight forward, as long as we know the starting sector of a FAT volume, that's it. But where is the root directory? The layout of a typical FAT is like this Boot sector (Volume ID in the figure) followed by Reserved Sectors (1 on FAT12/16 and 32 on FAT32), then FAT chain table(s) (can be 1 or 2), after that is the root directory (FAT12/16 and not shows in the figure) then begining of the File and Directories. In FAT12/16, the root directory is placed right after FAT so it is not hard to caculate the offset in the volume. But in FAT32, this rule is no longer true: the first cluster of the root directory is determined by BGBPB_RootDirStrtClus (or offset 44 in boot sector). Although this field is usually 0x00000002 (it is how CE initial the root directory after formating a volume. Note we should never assume it is always true) which means the first cluster contains data but not like the root directory is contiguous in FAT12/16, it is just like a regular file can be fragmented. So we need to access the root directory (of FAT32) hopping one cluster to another by traversing FAT table. Let's trace the code now. Although the source of FAT driver is not available in CE Shared Source program, but the formatter, Fatutil.dll, is available in public\common\oak\drivers\fsd\fatutil\MAIN\formatdisk.cpp. Be aware the public code only provides formatter for FAT12/16/32 for ExFAT it is still not available. FormatVolumeInternal is the main worker function. With the knowledge here, you should be able the trace the code easily. But I would like to discuss the following code pieces     dwReservedSectors = (fo.dwFatVersion == 32) ? 32 : 1;     dwRootEntries = (fo.dwFatVersion == 32) ? 0 : fo.dwRootEntries; Note the dwReservedSectors is 32 in FAT32 and 1 in FAT12/16. Root Entries is another different mentioned in previous paragraph, 0 for FAT32 (dynamic allocated) and fixed size (usually 512, defined in DEFAULT_ROOT_ENTRIES in public\common\sdk\inc\fatutil.h) And then here   memset(pBootSec->bsVolumeLabel, 0x20, sizeof(pBootSec->bsVolumeLabel)); It sets the Volume Label as empty string. Now let's carry on to the next section - write the root directory.     if (fo.dwFatVersion == 32) {         if (!(fo.dwFlags & FATUTIL_FORMAT_TFAT)) {             dwRootSectors = dwSectorsPerCluster;         }         else {             DIRENTRY    dirEntry;             DWORD       offset;             int               iVolumeNo;             memset(pbBlock, 0, pdi->di_bytes_per_sect);             memset(&dirEntry, 0, sizeof(DIRENTRY));                         dirEntry.de_attr = ATTR_VOLUME_ID;             // the first one is volume label             memcpy(dirEntry.de_name, "TFAT       ", sizeof (dirEntry.de_name));             memcpy(pbBlock, &dirEntry, sizeof(dirEntry));              ...             // Skip the next step of zeroing out clusters             dwCurrentSec += dwSectorsPerCluster;             dwRootSectors = 0;         }     }     // Each new root directory sector needs to be zeroed.     memset(pbBlock, 0, cbSizeBlk);     iRootSec=0;     while ( iRootSec < dwRootSectors) { Basically, the code zero out the each entry in root directory depends on dwRootSectors. In FAT12/16, the dwRootSectors is calculated as the sectors we need for the root entries (512 for most of the case) and in FAT32 it just zero out the one cluster. Please note that, if it is a TFAT volume, it initialize the root directory with special volume label entries for some special purpose. Despite to its unusual initialization process for TFAT, it does provide a example for how to create a volume entry. With some minor modification, we can assign the volume label in FAT formatter and also remember to sync the volume label with bsVolumeLabel or bgbsVolumeLabel in boot sector.

    Read the article

  • Is Gmail Being Blocked by my ISP?

    - by james
    EDIT: I thought I pinpointed the problem. Just now I tried to go to the firefox addons page which uses https and gmail also uses https. So I thought I am unable to load https pages on this computer. So I went to a bank site which uses https but that loads just fine. Sigh.... I asked this over at superuser but they weren't able to help, so I was hoping the sysadmins here will be able to advise as to what's wrong. Although the issue here is with a PC and not a server it still deals with networking so I hope it's not too irrelevant. The Issue: I have a desktop on which I cannot access Gmail and also youtube sign in (I believe since youtube is owned by google they both use the same sign in system). On other computers that uses the same connection via a wireless router I can access both gmail and youtube sign in just fine. On this computer which doesn't have a wireless card and so I have to connect via Ethernet cable (connected to a USB converter since the Ethernet port doesn't work anymore) I can access all sites and services including things like aol and hotmail. But only when it comes to gmail, do I get complete and utter throttling. I even turned off my AV ad Firewall momentarily and no luck. The gmail log in page starts to load and by mid point it just stays there loading and loading and loading... never ends. I tried everything, I reset the modem and router multiple times. I reinstalled my operating system from a vista to a windows 7 hoping that a complete reinstall would solve the issue, but no luck. And yes, I am going to call my ISP but not to solve this issue, but to cancel them. I want to upgrade to cable from DSL anyway. I didn't mention my ISP because I'm not sure if that is within the rules (if it's okay some one let me know and I will). P.S. All this happened one day, before that gmail was perfectly accessible in this computer. I can't remember anything special happening on that day prior to this. The only thing I can think of is, my ISP or Google itself is blocking this computer based on it's mac address, but I don't know if that's even done. Additional info: PC: Windows 7 Ultimate 32 bit Connection Type: DSL Connecting Medium: Ethernet cable via USB converter I should mention I can access gmail and youtube just fine through a IP proxy service.

    Read the article

  • what is the point of escaping quotation marks in php

    - by Jacksta
    Here is a validation script from a book I am learning, Why is escaping the quotation marks necassery? e.g. <option value=\"char\">char</option> <?php //validate important input if ((!$_POST[table_name]) || (!$_POST[num_fields])) { header( "location: show_createtable.html"); exit; } //begin creating form for display $form_block = " <form action=\"do_createtable.php\" method=\"post\"> <input name=\"table_name\" type=\"hidden\" value=\"$_POST[table_name]\"> <table cellspacing=\"5\" cellpadding=\"5\"> <tr> <th>Field Name</th><th>Field Type</th><th>Table Length</th> </tr>"; //count from 0 until you reach the number fo fields for ($i = 0; $i <$_POST[num_fields]; $i++) { $form_block .=" <tr> <td align=center><input type=\"texr\" name=\"field name[]\" size=\"30\"></td> <td align=center> <select name=\"field_type[]\"> <option value=\"char\">char</option> <option value=\"date\">date</option> <option value=\"float\">float</option> <option value=\"int\">int</option> <option value=\"text\">text</option> <option value=\"varchar\">varchar</option> </select> </td> <td align=center><input type=\"text\" name=\"field_length[]\" size=\"5\"> </td> </tr>"; } //finish up the form $form_block .= " <tr> <td align=center colspan=3><input type =\"submit\" value=\"create table\"> </td> </tr> </table> </form>"; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Create a database table: Step 2</title> </head> <body> <h1>defnie fields for <? echo "$_POST[table_name]"; ?> </h1> <? echo "$form_block"; ?> </body> </html>

    Read the article

  • Is there a Grid plugin for jQuery that has similiar capabilities to the Ext-JS Grid?

    - by Ehrann Mehdan
    One of the most appealing features of Ext-JS is the Grid control in my opinion. I was searching for something free that does something close and have set my hopes on jQuery. I haven't found a jQuery (or other LGPL compatible) Table / Grid plugin that allows to: Reorder columns by dragging Resize columns by dragging Add or Remove columns on the fly Have a default good looking UI (subjective, but Ext-JS look I think is a concensus) In addition to the rest most grid controls have (Sort, Paging etc) Is there a free (LGPL) jQuery plugin that does the above?

    Read the article

  • JQuery UI sortable: restore position based on some condition

    - by dafi
    I call sortable.stop() to make an ajax call to store some data after drag&drop operation. When the ajax call returns an error (application logic error or net problem) I want to move the dragged element to its original/start position, how can I achieve it? The scenario should be user drags A to B the sortable.stop() event is called, it triggers an ajax call the ajax call returns an error inside the stop() event we get the ajax error move A to its original position user again move A to B everything is ok A remains in its new position in B Steps 6-8 are shown to clarify a successive drag can be done and previous error must be forgotten

    Read the article

  • perl hashes - comparing keys and values

    - by Aaron Moodie
    I've been reading over the perl doc, but I can't quite get my head around hashes. I'm trying to find if a hash key exists, and if so, compare is't value. The thing that is confusing me is that my searches say that you find if a key exists by if (exists $files{$key}) , but that $files{$key} also gives the value? the code i'm working on is: foreach my $item(@new_contents) { next if !-f "$directory/$item"; my $date_modified = (stat("$directory/$item"))[9]; if (exists $files{$item}) { if ($files{$item} != $date_modified { $files{$item} = $date_modified; print "$item has been modified\n"; } } else { $files{$item} = $date_modified; print "$item has been added\n"; } }

    Read the article

  • Changing properties of controls that were added at runtime

    - by user257412
    I have a form in which several buttons are added at runtime via a 'for' method public Form() { for (int i = 0 ... ) Button b = new Button() b.text = (string) i ; etc.. etc.. } . now i wish to change the text property of the buttons on a certain event. How can this be accomplished? I have tried a few things but none worked.. since the buttons variables are inside the method , they are not available outside. Thanks

    Read the article

  • Repercussions of Raising Domain Functional Level to 2008 on Mac computers running 10.6.2 with OD

    - by JohnyV
    We have recently replaced all of our 2003 server domain controllers to 2008 r2 and have tried to implement PSO's but have found that the domain functional level must be raised to 2008. We have a mac server in our environment that runs open directory and it is integrated into AD. Does anyone know if I do raise the domain functional level (which makes sense since we only have 2008 r2 domain controllers) what the repercussions (if any) there will be on the macs in the environment? Macs are running 10.6.2 and mac server runs the same. Mac server is running OD and also bound to AD.

    Read the article

  • How to optimize sandboxie for faster application loading

    - by user23950
    I'm referring to this one: http://www.sandboxie.com/index.php?DownloadSandboxie Do you know of any alternatives that might be better than this software. And if you don't know of any alternative. Can you show me how can I make it faster to load firefox. Or any other browser. Because it really makes application incredibly slow at loading when you run them inside a sandbox. I've also seen lots from here: http://superuser.com/questions/57129/alternative-to-sandboxie-for-64-bit-systems Do you know of any other?

    Read the article

  • win7 amd64 guest in kvm does not have sound

    - by davidshen84
    hi, my host system is gentoo amd64, guest system is win 7 amd64. the guest system can work, except it does not have sound. i start kvm with -soundhw ac97, QEMU_AUDIO_DRV='alsa', and after i get into the guest system, i can see a 'Multimedia Audio Controller' in the device manager. but win7 cannot find the driver for it. i searched the network for a long time, and i cannot find a driver for intel ac97 for win7 amd64. i also tried -soundhw sb16, es1370, none of them work. please help me fix this.

    Read the article

  • How to make shortcut link for a website for each browser?

    - by metal gear solid
    I want to make a shortcut link for same website for each browser is it possible. For example: I have 5 link shortcut on windows desktop for Superuser.com and PC has all browsers installed. Upon double clicking on shortcut: Shortcut one should be open in IE (Which is default browser) Shortcut two should be open in Firefox Shortcut two should be open in Safari Shortcut two should be open in Opera

    Read the article

  • Listen to music from different sources possible?

    - by hsmit
    I would like to be able to listen to any song I've listened once before. Sometimes I listen to a CD, then to a MP3, a portable music player, ipod, radio channel, online services. I think it must be possible to save an index online of all my music. This index must indicate where the music is stored and ultimately be able to retrieve that song from the location. Is there a service available who accomplishes this?

    Read the article

  • Why you have create a full site - if the answer for everything is the one and the same ?

    - by Aristos
    regarding this question http://superuser.com/questions/131176/a-hidden-program-virus-send-hundred-e-mail-can-you-have-any-experience-on-som I am wondering, if everything is the same, why you have fix a so complicate site ? One simple answer can solve all ! (for you) Hope full I found answers elsewhere on internet, and this general answer did not help me almost at all. The problem there is a serious thread, special that the general answer did not give the solution - and I see and the full video on it. Please answer to this question !

    Read the article

  • Rails unknown action suddenly everywhere

    - by Joe
    The weird thing is that my app was working perfectly on Sat, and when I check it out on Monday (after doing nothing to it) I kept getting this problem: This behaviour is only happening on my production server. When I try to login or create a new user or do something that interacts with a form I am getting an unknown action error. A simple retrieval of rows does not throw this error however. I don't have all CRUD operations in most of my controllers because it's not necessary - but Rails always looks for the one that doesn't exist - it seams so anyway. If I make a mistake in the form that would normally throw a validation message to the user it will throw this error too, does that mean it has something to do with the model too (I'm not too Rails experienced and didn't know if that would be the case or not)? This is a general error I am getting - I have super_exception_notifier gem installed, so that's what all the extra params are. Processing SessionsController#new (for OMITTED at 2010-04-12 09:11:12) [GET] Rendering template within layouts/application Rendering sessions/new Completed in 3ms (View: 2, DB: 0) | 200 OK [http://OMITTED.com/session/new] Processing SessionsController#show (for OMITTED at 2010-04-12 09:11:14) [GET] ActionController::UnknownAction (No action responded to show. Actions: create, destroy, error_class_status_codes, error_class_status_codes=, error_layout, error_layout=, exception_notifiable_notification_level, exception_notifiable_notification_level=, exception_notifiable_silent_exceptions, exception_notifiable_silent_exceptions=, exception_notifiable_verbose, exception_notifiable_verbose=, http_status_codes, http_status_codes=, and new): dragonfly (0.5.3) lib/dragonfly/middleware.rb:13:in `call' passenger (2.2.9) lib/phusion_passenger/rack/request_handler.rb:92:in `process_request' passenger (2.2.9) lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop' passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:400:in `start_request_handler' passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:351:in `handle_spawn_application' passenger (2.2.9) lib/phusion_passenger/utils.rb:184:in `safe_fork' passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:349:in `handle_spawn_application' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:163:in `start' passenger (2.2.9) lib/phusion_passenger/railz/application_spawner.rb:209:in `start' passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application' passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add' passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application' passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize' passenger (2.2.9) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize' passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application' passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application' passenger (2.2.9) lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `__send__' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:352:in `main_loop' passenger (2.2.9) lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously' This is what one of my forms looks like (nothing special) <% form_tag session_path do -%> <p><%= label_tag 'Username' %><br /> <%= text_field_tag 'login', @login %></p> <p><%= label_tag 'password' %><br/> <%= password_field_tag 'password', nil %></p> <p><%= label_tag 'remember_me', 'Remember me' %> <%= check_box_tag 'remember_me', '1', @remember_me %></p> <p><%= submit_tag 'Log in' %></p> <% end -%> It looks like dragonfly is the culprit doesn't it, here's the section from the gem files it says is being naughty: module Dragonfly class Middleware def initialize(app, dragonfly_app_name) @app = app @dragonfly_app_name = dragonfly_app_name end def call(env) response = endpoint.call(env) if response[0] == 404 13 -->> @app.call(env) else response end end I don't know what goes on behind the scenes here so I probably haven't been looking in the right place to fix this issue. Like I said it only throws this in a production environment, which guess is what the 'env' variable is referencing. Thank you for your time! I've spent nearly my whole day trying to figure this out! :(

    Read the article

  • Picking good first estimates for Goldschmidt division

    - by Mads Elvheim
    I'm calculating fixedpoint reciprocals in Q22.10 with Goldschmidt division for use in my software rasterizer on ARM. This is done by just setting the nominator to 1, i.e the nominator becomes the scalar on the first iteration. To be honest, I'm kind of following the wikipedia algorithm blindly here. The article says that if the denominator is scaled in the half-open range (0.5, 1.0], a good first estimate can be based on the denominator alone: Let F be the estimated scalar and D be the denominator, then F = 2 - D. But when doing this, I lose a lot of precision. Say if I want to find the reciprocal of 512.00002f. In order to scale the number down, I lose 10 bits of precision in the fraction part, which is shifted out. So, my questions are: Is there a way to pick a better estimate which does not require normalization? Also, is it possible to pre-calculate the first estimates so the series converges faster? Right now, it converges after the 4th iteration on average. On ARM this is about ~50 cycles worst case, and that's not taking emulation of clz/bsr into account, nor memory lookups. Here is my testcase. Note: The software implementation of clz on line 13 is from my post here. You can replace it with an intrinsic if you want. #include <stdio.h> #include <stdint.h> const unsigned int BASE = 22ULL; static unsigned int divfp(unsigned int val, int* iter) { /* Nominator, denominator, estimate scalar and previous denominator */ unsigned long long N,D,F, DPREV; int bitpos; *iter = 1; D = val; /* Get the shift amount + is right-shift, - is left-shift. */ bitpos = 31 - clz(val) - BASE; /* Normalize into the half-range (0.5, 1.0] */ if(0 < bitpos) D >>= bitpos; else D <<= (-bitpos); /* (FNi / FDi) == (FN(i+1) / FD(i+1)) */ /* F = 2 - D */ F = (2ULL<<BASE) - D; /* N = F for the first iteration, because the nominator is simply 1. So don't waste a 64-bit UMULL on a multiply with 1 */ N = F; D = ((unsigned long long)D*F)>>BASE; while(1){ DPREV = D; F = (2<<(BASE)) - D; D = ((unsigned long long)D*F)>>BASE; /* Bail when we get the same value for two denominators in a row. This means that the error is too small to make any further progress. */ if(D == DPREV) break; N = ((unsigned long long)N*F)>>BASE; *iter = *iter + 1; } if(0 < bitpos) N >>= bitpos; else N <<= (-bitpos); return N; } int main(int argc, char* argv[]) { double fv, fa; int iter; unsigned int D, result; sscanf(argv[1], "%lf", &fv); D = fv*(double)(1<<BASE); result = divfp(D, &iter); fa = (double)result / (double)(1UL << BASE); printf("Value: %8.8lf 1/value: %8.8lf FP value: 0x%.8X\n", fv, fa, result); printf("iteration: %d\n",iter); return 0; }

    Read the article

  • How to check absolute control visibility and how to be notified for changes of absolute visibility

    - by portakalla
    I have several controls inside my form and I perform several changes (Text, Font, BackColor etc.) on these controls. My changes are necessary only if the controls are visible. So, I want to stop performing my changes on controls that are not visible. I want to keep changing my controls when they become visible again. I can use Control.Visible and Control.VisibleChanged, however they are not satisfactory for my purpose. The problem is, VisibleChanged is not fired when control becomes invisible due to its parent (i.e. because its parent became invisible). Interestingly, it is fired when control becomes visible again. Is there a way to be notified for visibility changes without recursively listening parent visibility changes? I also want to be notified when another form is placed over my form and some of my controls become non-visible. I call this absolute visibility. (Is there another term for it?) Is there an event that I can use for this purpose? Thanks.

    Read the article

  • XBAPs and MouseWheel events

    - by Kevin Montrose
    I've got an XBAP hosted in FireFox, which works great. However, I cannot detect MouseWheel events ever! I'm guessing that FireFox is consuming them and not passing them down to the hosted app. Any ideas on how to work around this?

    Read the article

< Previous Page | 17 18 19 20 21 22 23 24 25 26 27 28  | Next Page >