Search Results

Search found 10078 results on 404 pages for 'bad man'.

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

  • C# file Decryption - Bad Data

    - by Jon
    Hi all, I am in the process of rewriting an old application. The old app stored data in a scoreboard file that was encrypted with the following code: private const String SSecretKey = @"?B?n?Mj?"; public DataTable GetScoreboardFromFile() { FileInfo f = new FileInfo(scoreBoardLocation); if (!f.Exists) { return setupNewScoreBoard(); } DESCryptoServiceProvider DES = new DESCryptoServiceProvider(); //A 64 bit key and IV is required for this provider. //Set secret key For DES algorithm. DES.Key = ASCIIEncoding.ASCII.GetBytes(SSecretKey); //Set initialization vector. DES.IV = ASCIIEncoding.ASCII.GetBytes(SSecretKey); //Create a file stream to read the encrypted file back. FileStream fsread = new FileStream(scoreBoardLocation, FileMode.Open, FileAccess.Read); //Create a DES decryptor from the DES instance. ICryptoTransform desdecrypt = DES.CreateDecryptor(); //Create crypto stream set to read and do a //DES decryption transform on incoming bytes. CryptoStream cryptostreamDecr = new CryptoStream(fsread, desdecrypt, CryptoStreamMode.Read); DataTable dTable = new DataTable("scoreboard"); dTable.ReadXml(new StreamReader(cryptostreamDecr)); cryptostreamDecr.Close(); fsread.Close(); return dTable; } This works fine. I have copied the code into my new app so that I can create a legacy loader and convert the data into the new format. The problem is I get a "Bad Data" error: System.Security.Cryptography.CryptographicException was unhandled Message="Bad Data.\r\n" Source="mscorlib" The error fires at this line: dTable.ReadXml(new StreamReader(cryptostreamDecr)); The encrypted file was created today on the same machine with the old code. I guess that maybe the encryption / decryption process uses the application name / file or something and therefore means I can not open it. Does anyone have an idea as to: A) Be able explain why this isn't working? B) Offer a solution that would allow me to be able to open files that were created with the legacy application and be able to convert them please? Thank you

    Read the article

  • Returning IEnumerable from an indexer, bad practice?

    - by fearofawhackplanet
    If I had a CarsDataStore representing a table something like: Cars -------------- Ford | Fiesta Ford | Escort Ford | Orion Fiat | Uno Fiat | Panda Then I could do IEnumerable<Cars> fords = CarsDataStore["Ford"]; Is this a bad idea? It's iconsistent with the other datastore objects in my api (which all have a single column PK indexer), and I'm guessing most people don't expect an indexer to return a collection in this situation.

    Read the article

  • android layout images bad quality

    - by user1028269
    when I add images on layout it show in bad quality <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/sbackground" /> how to fix it? (I need to fix it only without programmatically) thanks

    Read the article

  • Use of @keyword in C# -- bad idea?

    - by Robert Fraser
    In my naming convention, I use _name for private member variables. I noticed that if I auto-generate a constructor with ReSharper, if the member is a keyword, it will generate an escaped keyword. For example: class IntrinsicFunctionCall { private Parameter[] _params; public IntrinsicFunctionCall(Parameter[] @params) { _params = @params; } } Is this generally considered bad practice or is it OK? It happens quite frequently with @params and @interface.

    Read the article

  • UDK "Error, 'DefaultMesh': Bad command or expression"

    - by Ricket
    I'm porting UT3 code to UDK, and I am getting the following compile error with the UDK compiler: C:\UDK\UDK-2010-03\Development\Src\FixIt\Classes\ZPawn.uc(25) : Error, 'DefaultMesh': Bad command or expression The ZPawn class extends UTPawn. Line 25 is the following: DefaultMesh = SkeletalMesh(DynamicLoadObject(ZBotOwner(Owner).MeshToUse, class'SkeletalMesh')); Where did DefaultMesh go in UDK?

    Read the article

  • java.io.IOException: Bad DNS address - in opening a HttpConnection

    - by Shreyas
    Hi, I m opening a HttpConnection to a URL. Its working in simulator but when i try it in device, it gives "java.io.IOException: Bad DNS address" while opening the HttpConnection. I serached the forums but havent got the solution yet. That URL is opening in Blackberry device Internet Browser but not getting the HttpConnection (HttpConnection is coming NULL) when i try through my code.

    Read the article

  • Finite State Machine : Bad design?

    - by f4
    Are Finite State Machines generally considered as bad design in OOP ? I hear that a lot. And, after I had to work on a really old, undocumented piece of C++ making use of it, I tend to agree. It was a pain to debug. what about readability/maintainability concerns?

    Read the article

  • ./configure : /bin/sh^M : bad interpreter

    - by Vineeth
    Hello there, I've been trying to install lpng142 on my fed 12 system. Seems like a problem to me. I get this error [root@localhost lpng142]# ./configure bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory [root@localhost lpng142]# How do I fix this? and for more details, I shall include the /etc/fstub file details here # # /etc/fstab # Created by anaconda on Wed May 26 18:12:05 2010 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=ce67cf79-22c3-45d4-8374-bd0075617cc8 /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 [root@localhost etc]# Help, please

    Read the article

  • Gtk+ Tables for Layout - Good or Bad?

    - by wag2639
    Hi, I'm just starting to play around with GTK+ and I wanted to stop bad habits before they happen. I see that GTK+ seems to be a little based in HTML/CSS and I was wondering if there are any reasons to avoid using tables for layout.

    Read the article

  • [Java2D] Is this bad practice? Multiple Graphics2D Objects

    - by m00st
    I've created a JPanel canvas that holds all graphics; namely JLabel. To get animated sprites to work you have to over ride the paintComponent of the extended JLabel class. I've successfully implemented animated sprites this way. Is it bad practice to have a Graphics2D canvas and then have multiple 'images' in their own Graphics2D?

    Read the article

  • good word whitelist to override bad word black list

    - by dangerousguy
    I've read through the discussion here... http://stackoverflow.com/questions/273516/how-do-you-implement-a-good-profanity-filter I've decided to implement a bad word filter using the badlist referenced in that thread. However I'm thinking about the scunthorpe problem. (see wikipedia I can't post the link, I'm a new user) Is there a white list of words like scunthorpe and manuscript that I can use to override a black list? (not interested in discussions about sensorship etc)

    Read the article

  • Wierd typeloadexception "Bad flags on delegate constructor."

    - by Marcus
    Hi, Anybody seen this exception before, Google doesn't have a single post regarding the exception. The code that raises the error is a simple add. Items.Add(item); System.TypeLoadException: Bad flags on delegate constructor. at System.Windows.Forms.ListView.Sort() at System.Windows.Forms.ListView.InsertItems(Int32 displayIndex, ListViewItem[] items, Boolean checkHosting) at System.Windows.Forms.ListView.ListViewNativeItemCollection.Add(ListViewItem value) at System.Windows.Forms.ListView.ListViewItemCollection.Add(ListViewItem value)

    Read the article

  • Why is Visual Basic bad?

    - by Mike
    Why do programmers consider Visual Basic a bad language? Putting aside any gripes with Microsoft or with proprietary/non-free software in general, and looking the language itself. Syntax, style, etc. I have just started using it, and find the syntax rather terrible. But I'm wondering what are the most common specific problems.

    Read the article

  • Is opening too many datacontexts bad?

    - by ryudice
    I've been checking my application with linq 2 sql profiler, and I noticed that it opens a lot of datacontexts, most of them are opened by the linq datasource I used, since my repositories use only the instance stored in Request.Items, is it bad to open too many datacontext? and how can I make my linqdatasource to use the datacontext that I store in Request.Items for the duration of the request? thanks for any help!

    Read the article

  • Why would var be a bad thing?

    - by Spoike
    I've been chatting with my colleagues the other day and heard that their coding standard explicitly forbids them to use the var keyword in C#. They had no idea why it was so and I've always found implicit declaration to be incredibly useful when coding. I've never had any problems finding out what type the variable was (you only hover over the variable in VS and you'll get the type that way). Does anyone know why it would be a bad idea to use the var keyword in C#?

    Read the article

  • Why are joins bad when considering scalability?

    - by acidzombie24
    Why are joins bad or 'slow'. I know i heard this more then once. I found this quote The problem is joins are relatively slow, especially over very large data sets, and if they are slow your website is slow. It takes a long time to get all those separate bits of information off disk and put them all together again. source I always thought they were fast especially when looking up a PK. Why are they 'slow'?

    Read the article

  • bad file descriptor with close() socket (c++)

    - by user321246
    hi everybody! I'm running out of file descriptors when my program can't connect another host. The close() system call doesn't work, the number of open sockets increases. I can se it with cat /proc/sys/fs/file-nr Print from console: connect: No route to host close: Bad file descriptor connect: No route to host close: Bad file descriptor .. Code: #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <string.h> #include <iostream> using namespace std; #define PORT 1238 #define MESSAGE "Yow!!! Are we having fun yet?!?" #define SERVERHOST "192.168.9.101" void write_to_server (int filedes) { int nbytes; nbytes = write (filedes, MESSAGE, strlen (MESSAGE) + 1); if (nbytes < 0) { perror ("write"); } } void init_sockaddr (struct sockaddr_in *name, const char *hostname, uint16_t port) { struct hostent *hostinfo; name->sin_family = AF_INET; name->sin_port = htons (port); hostinfo = gethostbyname (hostname); if (hostinfo == NULL) { fprintf (stderr, "Unknown host %s.\n", hostname); } name->sin_addr = *(struct in_addr *) hostinfo->h_addr; } int main() { for (;;) { sleep(1); int sock; struct sockaddr_in servername; /* Create the socket. */ sock = socket (PF_INET, SOCK_STREAM, 0); if (sock < 0) { perror ("socket (client)"); } /* Connect to the server. */ init_sockaddr (&servername, SERVERHOST, PORT); if (0 > connect (sock, (struct sockaddr *) &servername, sizeof (servername))) { perror ("connect"); sock = -1; } /* Send data to the server. */ if (sock > -1) write_to_server (sock); if (close (sock) != 0) perror("close"); } return 0; }

    Read the article

  • DateTimeZone error: Unknown or bad timezone

    - by Falya
    I am trying to run this script: <?php $d = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $time = $d->format('H:i'); echo $time; ?> but I got this error: Fatal error: Uncaught exception 'Exception' with message 'DateTimeZone::__construct() [<a href='function.DateTimeZone---construct'>function.DateTimeZone---construct</a>]: Unknown or bad timezone (Asia/Kolkata) Though it works well for Asia/Dacca for example. What could be the problem and how to fix it?

    Read the article

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