Daily Archives

Articles indexed Tuesday January 11 2011

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

  • How to remove a node based on contents of a subnode and then convert to CSV with headers intact

    - by Morris Cox
    I'm downloading a 10MB zipped XML file with wget, unzipping it to 40MB, trying to weed out test and expired entries (if the text of a certain node is "This is a test opportunity. Please DO NOT apply!" or if is in the past), and then convert to CSV. However, I get this error: PHP Notice: Array to string conversion in /home/morris/projects/grantsgov/xml2csv.php on line 46 I get Array errors because some entries in the XML file have more than one occurrence of a node (different text contents). The test entries are still present. Contents of grantsgov.sh: #!/bin/bash wget --clobber "http://www.grants.gov/search/downloadXML.do;jsessionid=1n7GNpNF2tKZnRGLyQqf7Tl32hFJ1zndhfQpLrJJD11TTNzWMwDy!368676377?fname=GrantsDBExtract$(date +'%Y%m%d').zip" -O GrantsDBExtract$(date +"%Y%m%d").zip unzip GrantsDBExtract$(date +"%Y%m%d").zip php xml2csv.php zip GrantsDBExtracted$(date +"%Y%m%d").zip GrantsDBExtracted$(date +"%Y%m%d").csv Contents of xml2csv.php: <? $current_date = date("Ymd"); //$getfile=fopen("http://www.grants.gov/search/downloadXML.do;jsessionid=GqJNNmdLyJyMlsQqTzS2KdzgT5NMdhPp0QhG946JTmHzRltNTpMQ!368676377?fname=GrantsDBExtract$current_date.zip", "r"); $zip = zip_open("GrantsDBExtract$current_date.zip"); if(is_resource($zip)) { while ($zip_entry = zip_read($zip)) { $fp = fopen("./".zip_entry_name($zip_entry), "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,"$buf"); zip_entry_close($zip_entry); fclose($fp); } } zip_close($zip); } // For future potential use $xml = new DOMDocument('1.0', 'ascii'); $xpath = new DOMXpath($xml); $xslFile = "feddata.xsl"; $filexml="GrantsDBExtract$current_date.xml"; if (file_exists($filexml)) { $xml = simplexml_load_file($filexml); echo "Loaded $filexml\n"; $xslt = new XSLTProcessor(); $xsl = new DOMDocument(); //$XSL->load('feddata.xsl', LIBXML_NOCDATA); $xsl->load($xslFile, LIBXML_NOCDATA); $xslt->importStylesheet($xsl); $xslt->transformToXML($xml); $f = fopen("GrantsDBExtracted$current_date.csv", 'w'); // create the CSV header row on the first time here $first = FALSE; $fields = array(); foreach($record as $key => $value) { $fields[] = $key; } fwrite($f,implode(";",$fields)."\n"); foreach ($xml->FundingOppSynopsis as $fos) { fputcsv($f, get_object_vars($fos),',','"'); } } fclose($f); } else { exit('Failed to open file.'); } ?> Contents of feddata.xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> <xsl:template match="FundingOppSynopsis[AgencyMailingAddress = 'This is a test opportunity. Please DO NOT apply!']"> </xsl:template> </xsl:stylesheet><xsl:strip-space elements="*"/> Part of the XML file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Grants SYSTEM "http://www.grants.gov/search/dtd/XMLExtract.dtd"> <Grants> <FundingOppSynopsis> <PostDate>08312007</PostDate> <UserID>None</UserID> <Password>None</Password> <FundingInstrumentType>CA</FundingInstrumentType> <FundingActivityCategory>DPR</FundingActivityCategory> <OtherCategoryExplanation>This is a test opportunity. Please DO NOT apply!</OtherCategoryExplanation> <NumberOfAwards>5</NumberOfAwards> <EstimatedFunding>4</EstimatedFunding> <AwardCeiling>2</AwardCeiling> <AwardFloor>1</AwardFloor> <AgencyMailingAddress>This is a test opportunity. Please DO NOT apply!</AgencyMailingAddress> <FundingOppTitle>This is a test opportunity. Please DO NOT apply!</FundingOppTitle> <FundingOppNumber>IVV-08312007-RG-OPP5</FundingOppNumber> <ApplicationsDueDate>09102007</ApplicationsDueDate> <ApplicationsDueDateExplanation>This is a test opportunity. Please DO NOT apply!</ApplicationsDueDateExplanation> <ArchiveDate>10102007</ArchiveDate> <Location>None</Location> <Office>None</Office> <Agency>None</Agency> <FundingOppDescription>This is a test opportunity. Please DO NOT apply!</FundingOppDescription> <CFDANumber>000000</CFDANumber> <EligibilityCategory>21</EligibilityCategory> <AdditionalEligibilityInfo>This is a test opportunity. Please DO NOT apply!</AdditionalEligibilityInfo> <CostSharing>N</CostSharing> <ObtainFundingOppText FundingOppURL="">Not Available</ObtainFundingOppText> <AgencyContact AgencyEmailDescriptor="This is a test opportunity. Please DO NOT apply!" AgencyEmailAddress="This is a test opportunity. Please DO NOT apply!">This is a test opportunity. Please DO NOT apply!</AgencyContact> </FundingOppSynopsis> How can I fix the error and remove expired entries (based on ArchiveDate)? I suspect the second to last line in feddata.xsl needs to be fixed.

    Read the article

  • Decimal problem in Java

    - by Jerome
    I am experimenting with writing a java class for financial engineering (hobby of mine). The algorithm that I desire to implement is: 100 / 0.05 = 2000 Instead I get: 100 / 0.05 = 2000.9999999999998 I understand the problem to be one with converting from binary numbers to decimals (float -- int). I have looked at the BigDecimal class on the web but have not quite found what I am looking for. Attached is the program and a class that I wrote: // DCF class public class DCF { double rate; double principle; int period; public DCF(double $rate, double $principle, int $period) { rate = $rate; principle = $principle; period = $period; } // returns the console value public double consol() { return principle/rate; } // to string Method public String toString() { return "(" + rate + "," + principle + "," + period + ")"; } } Now the actual program: // consol program public class DCFmain { public static void main(String[] args) { // create new DCF DCF abacus = new DCF(0.05, 100.05, 5); System.out.println(abacus); System.out.println("Console value= " + abacus.consol() ); } } Output: (0.05,100.05,5) Console value= 2000.9999999999998 Thanks!

    Read the article

  • Gawker Passwords

    - by Nick Harrison
    There has been much news about the hack of the Gawker web sites. There has even been an analysis of the common passwords found. This list is embarrassing in many ways. The most common password was "123456". The second most common password was "password". Much has also been written providing advice on how to create good passwords. This article provides some interesting advice, none of which should be taken. Anyone reading my blog, probably already knows the importance of strong passwords, so I am not going to reiterate the reasons here. My target audience is more the folks defining password complexity requirements. A user cannot come up with a strong password, if we have complexity requirements that don't make sense. With that in mind, here are a few guidelines:  Long Passwords Insist on long passwords. In some cases, you may need to change to allow a long password. I have seen many places that cap passwords at 8 characters. Passwords need to be at least 8 characters minimal. Consider how much stronger the passwords would be if you double the length. Passwords that are 15-20 characters will be that much harder to crack. There is no need to have limit passwords to 8 characters. Don't Require Special Characters Many complexity rules will require that your password include a capital letter, a lower case letter, a number, and one of the "special" characters, the shits above the number keys. The problem with such rules is that the resulting passwords are harder to remember. It also means that you will have a smaller set of characters in the resulting passwords. If you must include one of the 9 digits and one of the 9 "special" characters, then you have dramatically reduced the character set that will make up the final password. Two characters will be one of 10 possible values instead of one of 70. Two additional characters will be one of 26 possible characters instead of a 70 character potential character set. If you limit passwords to 8 characters, you are left with only 7 characters having the full set of 70 potential values. With these character restrictions in place, there are 1.6 x1012 possible passwords. Without these special character restrictions, but allowing numbers and special characters, you get a total of 5.76x1014 possible passwords. Even if you only allowed upper and lower case characters, you will still have 2.18X1014 passwords. You can do the math any number of ways, requiring special characters will always weaken passwords. Now imagine the number of passwords when you require more than 8 characters.  If you are responsible for defining complexity rules, I urge you to take these guidelines into account. What other guidelines do you follow?

    Read the article

  • Ubuntu (desktop) server needed for school

    - by Dave Moody
    I need to build an ubuntu server for school, but I hate with a passion command line interfaces. I need a server with a desktop, like the current win server 2003 (which has crashed, ugh). This server needs to host the school lan domain, have an active directory, and handle the roaming profiles that the students and staff access through WinXP workstations. It also needs to work as a file server, maybe a print server. Can anyone advise me on how to create an Ubuntu server starting with Ubuntu Desktop edition? Much thanks if you respond... Dave.

    Read the article

  • bind9 DNS Ubuntu names pingible on server, but not on Windows Machines?

    - by leeand00
    I setup a DNS server today on Ubuntu, following this tutorial. My intent was to setup my network for dns-name resolving on the private LAN within a single zone (nothing fancy I just want name resolution). I've tested the setup on the DNS server machine itself, and I can ping all the machines listed in the configuration file. I've also configured the Windows Machines on my network, and for some reason they are incapable of pinging by names as was possible on the DNS Server itself. I've tried running nslookup on the Windows DNS clients and I receive and error mentioning the address of the DNS server. DNS forwarding works fine, I'm not having any trouble accessing the internet, the problem only lies within accessing names within the private LAN. Here are my configuration files: options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. // forwarders { // 0.0.0.0; // }; forwarders { 8.8.8.8; 8.8.8.4; 74.242.0.12; //68.87.76.178; }; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; }; /etc/bind/named.conf.options zone "leerdomain.local" { type master; file "/etc/bind/zones/leerdomain.local.db"; notify no; }; zone "2.168.192.in-addr.arpa" { type master; file "/etc/bind/zones/rev.2.168.192.in-addr.arpa"; notify no; }; /etc/bind/named.conf.local Lookup: $TTL 3D @ IN SOA ns.leerdomain.local. admin.leerdomain.local. ( 2010011001 28800 3600 604800 38400 ); leerdomain.local. IN NS ns.leerdomain.local. ns IN A 192.168.2.9 asus IN A 192.168.2.254 www IN CNAME asus vaio IN A 192.168.2.253 iptouch IN A 192.168.2.252 toshiba IN A 192.168.2.251 gw IN A 192.168.2.1 TXT "Network Gateway" /etc/bind/zones/leerdomain.local.db (Validates fine with named-checkzone when validating zone leerdomain.local) Reverse Lookup: $TTL 3D @ IN SOA ns.leerdomain.local. admin.leerdomain.local. ( 201001101 28800 604800 604800 86400 ) IN NS ns.leerdomain.local. 1 IN PTR gw.leerdomain.local. 254 IN PTR asus.leerdomain.local. 253 IN PTR vaio.leerdomain.local. 252 IN PTR iptouch.leerdomain.local. 251 IN PTR toshiba.leerdomain.local. /etc/bind/zones/rev.2.168.192.in-addr.arpa *(Does not validate with named-checkzone when validating zone leerdomain.local gives an error of: zone leerdomain.local/IN: NS 'ns.leerdomain.local' has no address records (A or AAAA) zone leerdomain.local/IN: not loaded due to errors. * Despite not validating bind9 starts without errors in /var/log/syslog I've also configured a few of the windows machines on my network to have the static ip as specified in the lookup and reverse lookup config files. i.e. Using nslookup yields the following results: C:\Users\leeand00>nslookup ns Server: UnKnown Address: 192.168.2.9 *** UnKnown can't find ns: Non-existent domain C:\Users\leeand00>nslookup gw Server: UnKnown Address: 192.168.2.9 Name: gw. Additionally trying to ping by name also fails on machines that are not the DNS Server. Is there something wrong with my configuration of either the nameserver or the Windows Boxes that is keeping me from accessing other machines using names?

    Read the article

  • How to collect figures of traffic used per-host, broken up by time and destination?

    - by Seishun
    We have a relatively small network, all PSs in one subnet. One PC with two NICs and pfSense installed works as a firewall/router. There is an OpenVPN tunnel to a remote location, created as a site-to-site connection to another pfSense box there. I have an assignment to capture, store and show (via a web interface) information on traffic generated (both incoming and outcoming) by each host on our subnet and present it in several views: megabytes per calendar hours / days / months / years (that is, not just "one month back", but "in Dec 2010" and so on); megabytes per destination: VPN to remote location / other destinations / Google Apps servers. I tried the software packages in pfSense that offer traffic montoring - but it seems they don't store the information fixed by months, instead showing the amounts of traffic generated in periods (days/months/etc) calculated from the present moment. I'm also interested in understanding what would be the best way for me to break up traffic by hosts and destinations. I'm open to all suggestions, even if they mean that I will have to understand something new to me.

    Read the article

  • svchost.exe @ 100% disk utilization vs. Outlook.ost

    - by Aszurom
    Vista x32 box with Outlook 2007. Outlook is not running. Hasn't been fired up for several reboots. I stopped WMI service and Windows Search service. Machine is mostly quiet, and then servicehost.exe launches an instance and starts banging away at Outlook.ost file. I can't determine what is causing it. I'm watching it in processmon, and trying to investigate it with preocessexplorer. Not having much luck at figuring out why the machine is so interested in that file. NOTHING is running that should be touching it.

    Read the article

  • How do I get the F1-F12 keys to switch screens in gnu screen in cygwin when connecting via SSH?

    - by Mikey
    I'm connecting to a desktop running cygwin via SSH from the terminal app in Mac OS X. I have already started screen on the cygwin side and can connect to it over the SSH session. Furthermore, I have the following in the .screenrc file: bindkey -k k1 select 1 # F1 = screen 1 bindkey -k k2 select 2 # F2 = screen 2 bindkey -k k3 select 3 # F3 = screen 3 bindkey -k k4 select 4 # F4 = screen 4 bindkey -k k5 select 5 # F5 = screen 5 bindkey -k k6 select 6 # F6 = screen 6 bindkey -k k7 select 7 # F7 = screen 7 bindkey -k k8 select 8 # F8 = screen 8 bindkey -k k9 select 9 # F9 = screen 9 bindkey -k F1 prev # F11 = prev bindkey -k F2 next # F12 = next However, when I start multiple windows in screen and attempt to switch between them via the function keys, all I get is a beep. I have tried various settings for $TERM (e.g. ansi, cygwin, xterm-color, vt100) and they don't really seem to affect anything. I have verified that the terminal app is in fact sending the escape sequence for the function key that I'm expecting and that my bash shell (running inside screen) is receiving it. For example, for F1, it sends the following (hexdump is a perl script I wrote that takes STDIN in binmode and outputs it as a hexadecimal/ascii dump): % hexdump [press F1 and then hit ^D to terminate input] 00000000: 1b4f50 .OP If things were working correctly, I don't think bash should receive the escape sequence because screen should have caught it and turned it into a command. How do I get the function keys to work?

    Read the article

  • Laptop changes closing lid power options based on media/music playing

    - by Backdraft
    Hi, This is on a Lenovo X60 running Windows 7 Professional. This is just a pet peeve of mine, but I was wondering if it were somehow possible to have my laptop autodetect whether any media/music is playing on and change/switch the "Close lid" options under Power Options, ie. when something is playing change state to "Do Nothing" otherwise change state to "Sleep". I guess I can probably set a some key combo up with AutoHotKey to do it, but was hoping Windows could detect and switch my Power Options automatically. Thanks.

    Read the article

  • Firewire hard drive with Leopard install image won't boot from PPC Mac Mini

    - by GregH
    I have a Mac Mini (G4 - 1.25 GHz PowerPC) running osx 10.3.9. I want to upgrade it to 10.5 (Leopard). The problem is that I only have a CD and no DVD. After working through all of these issues, I got myself a firewire hard drive and both a 10.4 and 10.5 image that I could image on to the hard drive. I was able to successfully boot off the firewire drive with the 10.4 image. However, I am not able to boot off the firewire drive with the 10.5 image. When trying to boot under the 10.5 image I specify the firewire drive as the startup drive. However, it just boots to the internal (10.3) drive. Any idea why it won't boot to the 10.5 image?

    Read the article

  • Firefox password manager - multiple logins for HTTP authentication

    - by pbarney
    When you're prompted to login to a site using HTTP authentication (the kind with the pop-up box requesting username/password), Firefox's password manager populates it with only the first stored password for that domain. Is there a way to have Firefox prompt for WHICH account should be used? It is unlike the normal HTML login forms in which you can just press the down arrow to select from multiple login accounts.

    Read the article

  • Do emails from ShoppyBag contain virus or malware ?

    - by Sysadmin Evstar
    I am curious -- when the ShoppyBag virus gets sent to you from a compromised "friend", inside the message is a secret one-pixel IMG unique to your email address --- and when your GMail message pulls up the message and the IMG is loaded from their server and displayed, their server knows you have read the message. At that moment, does it then grab your Gmail address book, the Flash Cookies, and all the Local Shared Objects it can find, i.e. at the instant you READ the message with the ShoppyBag virus, is it already too late? Do you have to Delete it to the Trash , then Delete Forever it , without reading it to be safe?

    Read the article

  • Skeptic in a Scrum Team

    - by Sorantis
    My company has recently switched to an Agile way of working and as a part of it we've started using SCRUM. While I'm very comfortable with it and feel that this way is superior to a traditional one, some of my teammates don't share the same opinion. In fact they are very skeptical about "all that agile stuff", and don't take it seriously. As an example, one of the teammates is always late on the meetings, and doesn't really care about it. The management IMO tries not to notice this (maybe because it's new, and it takes time for the people to get used to it). My question is, how to address this issue while not raising a conflict inside the team?

    Read the article

  • Random enemy placement on a 2d grid

    - by Robb
    I want to place my items and enemies randomly (or as randomly as possible). At the moment I use XNA's Random class to generate a number between 800 for X and 600 for Y. It feels like enemies spawn more towards the top of the map than in the middle or bottom. I do not seed the generator, maybe that is something to consider. Are there other techniques described that can improve random enemy placement on a 2d grid?

    Read the article

  • Validating a single radio button is not working in available javascript validation script Part-2

    - by OM The Eternity
    Hi All I am available with the solution given by @Tomalak for MY QUESTION could you pls help me out with it as its giving me an error in firebug as : frm.creatorusers is undefined [Break On This Error] var rdo = (frm.creatorusers.length ...rm.creatorusers : frm.creatorusers; I used the code for validating radio button as: function valDistribution(frm) { var mycreator = -1; var rdo = (frm.creatorusers.length > 0) ? frm.creatorusers : frm.creatorusers; for (var i=0; i<rdo.length; i++) { if (rdo[i].checked) { mycreator = 1; //return true; } } if(mycreator == -1){ alert("You must select a Creator User!"); return false; } }

    Read the article

  • Can I get rid of this read lock?

    - by Pieter
    I have the following helper class (simplified): public static class Cache { private static readonly object _syncRoot = new object(); private static Dictionary<Type, string> _lookup = new Dictionary<Type, string>(); public static void Add(Type type, string value) { lock (_syncRoot) { _lookup.Add(type, value); } } public static string Lookup(Type type) { string result; lock (_syncRoot) { _lookup.TryGetValue(type, out result); } return result; } } Add will be called roughly 10/100 times in the application and Lookup will be called by many threads, many of thousands of times. What I would like is to get rid of the read lock. How do you normally get rid of the read lock in this situation? I have the following ideas: Require that _lookup is stable before the application starts operation. The could be build up from an Attribute. This is done automatically through the static constructor the attribute is assigned to. Requiring the above would require me to go through all types that could have the attribute and calling RuntimeHelpers.RunClassConstructor which is an expensive operation; Move to COW semantics. public static void Add(Type type, string value) { lock (_syncRoot) { var lookup = new Dictionary<Type, string>(_lookup); lookup.Add(type, value); _lookup = lookup; } } (With the lock (_syncRoot) removed in the Lookup method.) The problem with this is that this uses an unnecessary amount of memory (which might not be a problem) and I would probably make _lookup volatile, but I'm not sure how this should be applied. (John Skeets' comment here gives me pause.) Using ReaderWriterLock. I believe this would make things worse since the region being locked is small. Suggestions are very welcome.

    Read the article

  • Does the number of busy worker threads in the CLR ThreadPool affect performance of I/O threads?

    - by andrej351
    We have a Windows Service which hosts a number of WCF services and, in an unrelated part of the app, makes extensive use of the TPL Task class to asynchronously do relatively short bits of work. It is my understanding that WCF uses managed I/O threads from the ThreadPool to execute requests. I noticed that after deploying a feature which significantly raised the applications use of Tasks, and as such the use of ThreadPool worker threads as well, performance of a couple of web services has become very slow. We're talking minutes instead of less than a second. The number of Tasks actually trying to run at any one time can range between 20 and 1000, which makes me think that any new (last in) work needing some CPU time could be forced to wait for quite some time. Does the (in my case extremely large) number of busy ThreadPool worker threads affect the ThreadPool's managed I/O threads? Or could these two be connected in any way? Thanks!

    Read the article

  • Use .htaccess to limit access to file downloads

    - by jimiyash
    I have downloads for static files like product.exe. I want to limit access to these files with a .htaccess file so that only certain users can download it. I think this can be handled with mod_rewrite and I found this snippet online that blocks bad sites using the referrer. RewriteEngine on # Options +FollowSymlinks RewriteCond %{HTTP_REFERER} http://example.com/downloads/confirm/3811 [NC,OR] RewriteRule .* - [F] Source: http://www.javascriptkit.com/howto/htaccess14.shtml Instead of blocking based on referrer, I want to allow based on referrer. That way, the referrer can be a URL that cannot be accessed without first logging in. I am thinking about going this route and using the http referrer to give permission to the file. I know it may not be the best way to do it, and I guess the referrer can be spoofed, but it does not have to be THAT secure. I am also open to other ideas you may have to for limitting access. Please

    Read the article

  • Is referencing a selector faster in jquery than actually calling the selector? if so, how much does it make a difference?

    - by anthonypliu
    Hi, I have this code: $(preview-button).click(...) $(preview-button).slide(...) $(preview-button).whatever(...) Is it a better practice to do this: var preview-button = $(preview-button); preview-button.click(...); preview-button.click(...); preview-button).slide(...); preview-button.whatever(...); It probably would be better practice to do this for the sake of keeping code clean and modular, BUT does it make a difference performance wise? Does one take longer to process than the other? Thanks guys.

    Read the article

  • What server log file(with Centos5) must I check to locate specific IP activity?

    - by makmour
    Hi! I leasing a dedi server under Centos5, just recently I ve setup a blog website that grabs feeds from other news websites and presents them on my blog. Some days after I see high server loads that cant be coming just from the cron jobs that I run every now and then to grab feeds from other websites for my blog website. Thats why I m trying to pico some log files in order to have a better look the whole problem. These last days I noticed(from statscounter service) the same IP address visiting my blog website many times per day so I want to find out what us trying to do. I tried looking in all /var/log log files and httpd too but no luck. Is there any other log file I should open or any other procedure to track this IP acivity on server?

    Read the article

  • Using DotNetZip Library unzip file with non ASCII characters

    - by Morten Lyhr
    I'm trying to unzip a file, using DotNetZip Library. The file contains folders and files with danish characters (æøåÆØÅ). TotalCommander, 7Zip, Windows own zip all extract the files correctly, but DotNetZip Library mangles the danish characters. Ex: File_æøåÆØÅ.txt becomes File_æ¢åÆ¥Å.txt insted of aø it contains a ¢. insted of a Ø it contains a ¥. Code: using (var zipFile = ZipFile.Read(@"File_æøåÆØÅ.zip")) { zipFile.ExtractAll(@"File_æøåÆØÅ", ExtractExistingFileAction.OverwriteSilently); } I'm using the default encoding("da-DK" culture), I have tried other encodings like UTF8 etc. How can I unzip a file containing filenames with Danish characters?

    Read the article

  • facebook .net and mvc - Unrecognized attribute 'ApiKey'. Note that attribute names are case-sensitive

    - by vondip
    Hi all, I'm trying to build a small fb application using asp.net mvc 2, and facebook C# .net From some reason, the code from the sample application doesn't seem to work for me. Here's the exception I am receiving from my web.config file. Unrecognized attribute 'apiKey'. Note that attribute names are case-sensitive. Source Error: <facebookSettings apiKey="XXXX" apiSecret="XXXX" appId="XXXX" /> Any ideas?

    Read the article

  • Hide/Show Text Field based on Selected value - ROR

    - by Tau
    I am new to ROR. I am trying to show a "Others" text field only if the selected value is "others". I am trying to make hide/show function to be as general as possible, since I will need it in many controller. If anyone can help enlightening me, I will really appreciate it. BTW, I am using Rails 2.1.1 ruby 1.8.7 general_info.html.erb <div> <%= f.label :location_id, "Location:" %> <%= f.collection_select(:location_id, Event.locations, :id, :name, {:prompt => true}, {:onchange => remote_function( :url => {:action => "showHideDOMOther"}, :with => "'selectedText='+this.options[this.selectedIndex].text + '&other_div='+'loc_other'")}) %> </div> <div id="loc_other" style="display:none"> <%= f.label :location_others, "Others:" %> <%= f.text_field :location_others %> </div> info_controller.rb def showHideDomOther render :update do |page| page.showHideDOM("Others", params[:selectedText], params[:other_div]) end end ... application_helper.rb def showHideDOM(targetString, selectedText, targetDiv) if selectedText.casecmp targetString page.hide targetDiv else page.show targetDiv end end Seem to get the correct parameters value, but nothing seems to happen. This is what I see from the console when I changed the value of selection to "Others". Parameters: {"action"=>"showHideDOMOther", "authenticity_token"=>"e7da7ce4631480b482e29da9c0fde4c026a7a70d", "other_div"=>"loc_other", "controller"=>"events", "selectedText"=>"Others"} NoMethodError (undefined method search_generic_view_paths?' for #<EventsController:0xa41c720>): /vendor/plugins/active_scaffold/lib/extensions/generic_view_paths.rb:40:infind_template_extension_from_handler' C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_finder.rb:138:in pick_template_extension' C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/template_finder.rb:115:infile_exists?' : Rendering C:/usr/lib/Ruby/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/templates/rescues/layout.erb (internal_server_error)

    Read the article

  • Tool To Catch All The Inputs That Cause Crash?

    - by Barakat
    Hi all, I need a Windows tool records inputs and debugging informations that cause program's crashing. I don't mean a fuzzing tool ! Ammmmm ... let me show you a scenario may explain what I'm talking about. Sometimes during using a program, It's crashed without known reason ! and when I want to debug it, I will not find helpful informations to know how the crash happened. Because that the data that cause the crash no longer exist. So I need a tool records all the inputs and debugging informations to find helpful informations to reuse the inputs data to make the program crashes under a debaucher in order to understand how the crash happen.

    Read the article

  • read text file from phone memory in android

    - by Sudhakar
    Hi..I just wanna create a text file into phone memory and have to read its content to display.Now i created a text file.But its not present in the path data/data/package-name/file name.txt & it didn't display the content on emulator. My code is.. public class PhonememAct extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv=(TextView)findViewById(R.id.tv); FileOutputStream fos = null; try { fos = openFileOutput("Test.txt", Context.MODE_PRIVATE); } catch (FileNotFoundException e2) { // TODO Auto-generated catch block e2.printStackTrace(); } try { fos.write("Hai..".getBytes()); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { fos.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } FileInputStream fis = null; try { fis = openFileInput("Test.txt"); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } int c; try { while((c=fis.read())!=-1) { tv.setText(c); setContentView(tv); //k += (char)c; } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { fis.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } Thanks in adv.

    Read the article

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