Search Results

Search found 613 results on 25 pages for 'pdns troubles'.

Page 19/25 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • UTF-8 BOM signature in PHP files

    - by skidding
    I was writing some commented PHP classes and I stumbled upon a problem. My name (for the @author tag) ends up with a ? (which is a UTF-8 character, ...and a strange name, I know). Even though I save the file as UTF-8, some friends reported that they see that character totally messed up (È™). This problem goes away by adding the BOM signature. But that thing troubles me a bit, since I don't know that much about it, except from what I saw on Wikipedia and on some other similar questions here on SO. I know that it adds some things at the beginning of the file, and from what I understood it's not that bad, but I'm concerned because the only problematic scenarios I read about involved PHP files. And since I'm writing PHP classes to share them, being 100% compatible is more important than having my name in the comments. But I'm trying to understand the implications, should I use it without worrying? or are there cases when it might cause damage? When? Thanks!

    Read the article

  • Amazon S3 and swfaddress

    - by justinbach
    I recently migrated a large AS3 site (lots of swfs, lots of flvs) to Amazon S3. Pretty much everything but HTML and JS files is being stored/served from Amazon, and it's working well. The only problem I'm having is that I built the site using SWFaddress (actually, via the Gaia framework which uses SWFaddress), and for some reason, SWFaddress is no longer updating the address bar correctly as users navigate from page to page. In other words, the URL persistently remains http://www.mysite.com, not http://www.mysite.com/#/section as would be the case were SWFaddress functioning correctly (and as it was functioning prior to the migration). Stranger yet, if I go to (e.g.) http://www.mysite.com/#/section directly, the deeplinking functions as you'd expect--I arrive directly at the correct section. However, navigating away from that section doesn't have any effect on the address bar, despite the fact that it should be dynamically updated. I've got a crossdomain.xml file set up on the site that allows access from all domains, so that's not the issue, and I don't know what else might be. Any ideas would be greatly appreciated! P.S. I integrated S3 by putting pretty much the entire site in an S3 bucket and then just changing the initial swfobject embed to point to the S3 instance of main.swf, passing in the S3 path as the "base" param to the embedded swf so that all dynamically loaded assets and swfs would also be sourced from s3. Dunno if that's related to the troubles I'm having.

    Read the article

  • Delivery of JMS message before the transaction is committed

    - by ewernli
    Hi, I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS 4. ( tiny little gap where message can be delivered before insert has been committed) 5. commit database I've discussed this problem with others, but the answer was always: "Strange, it should work out of the box". My questions are then: How could it work out-of-the box? My scenario sounds fairly simple, why isn't there more people with similar troubles? Am I doing something wrong? Is there a way to solve this issue correctly? Here are a bit more details about my understanding of the problem: This timing issue exist only if the participant are treated in this order. If the 2PC treats the participants in the reverse order (database first then message broker) that should be fine. The problem was randomly happening but completely reproducible. I found no way to control the order of the participants in the distributed transactions in the JTA, JCA and JPA specifications neither in the Glassfish documentation. We could assume they will be enlisted in the distributed transaction according to the order when they are used, but with an ORM such as JPA, it's difficult to know when the data are flushed and when the database connection is really used. Any idea?

    Read the article

  • Problem with authentication from different domains using Django sessions.

    - by Greg
    Hi all, I am developing a bookmarklet which essentially adds a toolbar to a web page user is currently looking at. To use it, user needs to be logged in. To login user clicks on 'Singin' which displays a standard form containing Username, Password etc fields. When user successfully logs in they may chose to navigate to a different web-site. When on another page, they (a) re-load the bookmarklet (b) their session is retrieved from the server (c) user doesn't need to login again. Pretty standard I've would have thought. Using Django sessions and JQuery. I'm having troubles implementing the above usecase. Here are some problems I've encountered: Cross domain POST AJAX requests are disallowed. That was solved with JSONp. I doubt it is a very secure approach but for now it works. My server returns the session id in a cookie, however when the user navigates to a different page I don't really know how to retrieve that session id to send back to my server. Can I even read third party cookies from my JavaScript? I'm looking for some guidelines on implementing the above usecase. Ideally I don't want to redirect user to another page for them to sign in. Any suggestion would be greatly appreciated. Thanks.

    Read the article

  • Best Practice for Uploading Many (2000+) Images to A Server

    - by bob
    Hello, I have a general question about this. When you have a gallery, sometimes people need to upload 1000's of images at once. Most likely, it would be done through a .zip file. What is the best way to go about uploading this sort of thing to a server. Many times, server have timeouts etc. that need to be accounted for. I am wondering what kinds of things should I be looking out for and what is the best way to handle a large amount of images being uploaded. I'm guessing that you would allow a user to upload a zip file (assuming the timeout does not effect you), and this zip file is uploaded to a specific directory, lets assume in this case a directory is created for each user in the system. You would then unzip the directory on the server and scan the user's folder for any directories containing .jpg or .png or .gif files (etc.) and then import them into a table accordingly. I'm guessing labeled by folder name. What kind of server side troubles could I run into? I'm aware that there may be many issues. Even general ideas would be could so I can then research further. Thanks! Also, I would be programming in Ruby on Rails but I think this question applies accross any language.

    Read the article

  • Will running aspnet_regiis.exe -ir create any problems?

    - by alexander-strandberg
    Hi there. I've asked a question about changing the version of .Net sites in the IIS. If it affects classic asp sites etc (See Does asp.net setting affect classic asp (IIS 6 settings)) And that seems fine. So my follow-up question is, will running this command get me fired? What it does is changing the default value (and all existing?) of the .net version to 2.0. This wont affect any of the .net sites since they're allready versioned to 2.0. The classic asp pages needs to get its app pools updated so its functionoal with 2.0 but may I run into any other troubles? I've tried doing this on a test environment and no sites whet down during the installation period (from the command) but I did not have any classic asp sites or any .net sites running though (which I should test, come to think about it) but may something else break? Is this command doing anything else? We have some very large sites running and we cannot have downtime periods so I need to be 100% sure that this command is safe. Since all sites go down everytime we change a new sites .net version number we need to get this fix live asap. Any good ideas?

    Read the article

  • Endless problems with a very simple python subprocess.Popen task

    - by Thomas
    I'd like python to send around a half-million integers in the range 0-255 each to an executable written in C++. This executable will then respond with a few thousand integers. Each on one line. This seems like it should be very simple to do with subprocess but i've had endless troubles. Right now im testing with code: // main() u32 num; std::cin >> num; u8* data = new u8[num]; for (u32 i = 0; i < num; ++i) std::cin >> data[i]; // test output / spit it back out for (u32 i = 0; i < num; ++i) std::cout << data[i] << std::endl; return 0; Building an array of strings ("data"), each like "255\n", in python and then using: output = proc.communicate("".join(data))[0] ...doesn't work (says stdin is closed, maybe too much at one time). Neither has using proc.stdin and proc.stdout worked. This should be so very simple, but I'm getting constant exceptions, and/or no output data returned to me. My Popen is currently: proc = Popen('aux/test_cpp_program', stdin=PIPE, stdout=PIPE, bufsize=1) Advise me before I pull my hair out. ;)

    Read the article

  • PHP APC and Pecl upload progress returning false/null.

    - by Keyo
    This is a long shot. I believe this might be suhosin patch issue. Here is my php from codeigniter: public function uploadprogress($id) { if ($id) { header("Cache-Control: no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); echo json_encode(apc_fetch('upload_'.$id)); exit(); } } public function uploader() { $this->load->view('myid/' . $this->router->class . '_uploader'); //phpinfo(); } script: <script type="text/javascript"> $(document).ready(function(){ var progress_key = $('#progress_key').val(); // this sets up the progress bar $('#uploadform').submit(function() { setTimeout(beginUpload,1500); return; }); function beginUpload() { $("#progressbar").progressbar({ value:0}).fadeIn(); var i = setInterval(function() { $.getJSON("/myid/videos/uploadprogress/" + progress_key, function(data) { alert('data'); if (data == null) { clearInterval(i); location.reload(true); return; } var response; eval ("response = " + data); if (!response) return; var percentage = Math.floor(100 * parseInt(response['bytes_uploaded']) / parseInt(response['bytes_total'])); $("#progressbar").progressbar({value:percentage}); }, 1500); }); } }); </script> Has anyone had strange troubles with this before? The upload key is the same on the view and the uploadprogress method. I've Tried apc and pecl upload-progress both return false or null. I wondering if it's just suhosin patch messing up everything?

    Read the article

  • GRAPH PROBLEM: find an algorithm to determine the shortest path from one point to another in a recta

    - by newba
    I'm getting such an headache trying to elaborate an appropriate algorithm to go from a START position to a EXIT position in a maze. For what is worth, the maze is rectangular, maxsize 500x500 and, in theory, is resolvable by DFS with some branch and bound techniques ... 10 3 4 7 6 3 3 1 2 2 1 0 2 2 2 4 2 2 5 2 2 1 3 0 2 2 2 2 1 3 3 4 2 3 4 4 3 1 1 3 1 2 2 4 2 2 1 Output: 5 1 4 2 Explanation: Our agent looses energy every time he gives a step and he can only move UP, DOWN, LEFT and RIGHT. Also, if the agent arrives with a remaining energy of zero or less, he dies, so we print something like "Impossible". So, in the input 10 is the initial agent's energy, 3 4 is the START position (i.e. column 3, line 4) and we have a maze 7x6. Think this as a kind of labyrinth, in which I want to find the exit that gives the agent a better remaining energy (shortest path). In case there are paths which lead to the same remaining energy, we choose the one which has the small number of steps, of course. I need to know if a DFS to a maze 500x500 in the worst case is feasible with these limitations and how to do it, storing the remaining energy in each step and the number of steps taken so far. The output means the agent arrived with remaining energy= 5 to the exit pos 1 4 in 2 steps. If we look carefully, in this maze it's also possible to exit at pos 3 1 (column 3, row 1) with the same energy but with 3 steps, so we choose the better one. With these in mind, can someone help me some code or pseudo-code? I have troubles working this around with a 2D array and how to store the remaining energy, the path (or number of steps taken)....

    Read the article

  • MYSQL Data -> PHP arrays -> Javascript (or Jquery) How can I pass the data with JSON ?

    - by Alex
    I am starting with a new site (it's my first one) and I am getting big troubles ! I wrote this code <?php include("misc.inc"); $cxn=mysqli_connect($host,$user,$password,$database) or die("couldn't connect to server"); $query="SELECT DISTINCT country FROM stamps"; $result=mysqli_query($cxn,$query) or die ("couldn't execute query"); $numberOfRows=mysqli_num_rows($result); for ($i=0;$i<$numberOfRows;$i++){ $row=mysqli_fetch_assoc($result); extract($row); $a=json_encode($row); $a=$a.","; echo $a; } ?> and the output is as follows : {"country":"liechtenstein"},{"country":"romania"},{"country":"jugoslavia"},{"country":"polonia"}, which should be a correct JSON outout ... How can I get it now in Jquery ? I tried with $.getJSON but I am not able to fuse it properly. I don't want yet to pass the data to a DIV or something similar in HTML. Alex

    Read the article

  • String to array or Array to string tips on formats, etc

    - by user316841
    hi, first of all thanks for taking your time! I'm a junior Dev, working with PHP + mysql. My issue: I'm saving data from a form to my database. From this form, there's only need to save the contacts: Name, phone number, address. But, it would be nice to have a small reference to the user answers. Let's say for each question we've got a value betwee 1 and 4. Since there's no need to create a table just for it, because what's needed is just the personal contacts. I'm thinking of recording each question/answer, as a letter and its correspondent value. Example (A2, B1, C5, D3, etc). My question is: Is there a format I could afterwards, handle easily ? Convert to array (string to array) in case the client change ideas, and ask this data, placed in table columns ? Just to prevent this situation! Example, From (A2, B1, C5 ) to array( "A" = "1", "B" = "1", "C" = "5" ) For now I guess, Regex is the answer, but it's allways hard to figure it out and I'm allways getting in troubles =) Thanks!

    Read the article

  • Binding DataTemplates (or another aproach)

    - by Bataglião
    Hi all, I'm having some troubles trying to dynamically generate content in WPF and after it bind data. I have the following scenario: TabControl - Dynamically generated TabItems through DataTemplate - inside TabItems, I have dynamic content generated by DataTemplate that I wish to bind (ListBox). The code follows: ::TabControl <TabControl Height="252" HorizontalAlignment="Left" Name="tabControl1" VerticalAlignment="Top" Width="458" Margin="12,12,12,12" ContentTemplate="{StaticResource tabItemContent}"></TabControl> ::The Template for TabControl to generate TabItems <DataTemplate x:Key="tabItemContent"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> <ListBox ItemTemplate="{StaticResource listBoxContent}" ItemsSource="{Binding}"> </ListBox> </Grid> </DataTemplate> ::The template for ListBox Inside each TabItem <DataTemplate x:Key="listBoxContent"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="22"/> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Image Grid.Column="0" Source="{Binding Path=PluginIcon}" /> <TextBlock Grid.Column="1" Text="{Binding Path=Text}" /> </Grid> </DataTemplate> So, when I try to do this on code inside a loop to create the tabitems: TabItem tabitem = tabControl1.Items[catIndex] as TabItem; tabitem.DataContext = plugins.ToList(); where 'plugins' is an Enumerable The ListBox is not bounded. I tried also to find the ListBox inside the TabItem to set the ItemSource property but no success at all. Someone have an idea on how to do that? Thanks in advance.

    Read the article

  • Static variables and long running thread on IIS 7.5

    - by Dmitry
    Hello people. Help me solve next problem. I have ASP .NET MVC2 application. I run it on IIS 7.5. In one page user clicks button and handler for this button sends request to server (jquery.ajax). At server action in controller starts new thread (it makes long time import): var thread = new Thread(RefreshCitiesInDatabase); thread.Start(); State of import is available in static variable. New thread changes value of variable in the begin of work. User can check state of import too with the help of this variable, which is used in view. And user sees import's state. When I start this function few minutes everything is okey. On page I see right state of import, quantity of imported records is changed, I see changes in logs. But after few minutes begin troubles. When I refresh page with import state sometimes I see that import is okey but sometimes I see page with default values about import (like application is just started), but after that again I can see page with normal import's state. I tried to attach Visual Studio to IIS process and debug application. But when request comes to controller sometimes static variables have right values and sometimes they have default values (static int has 0, static string has "" etc.). Tell me what I do wrong. May be I must start additional thread in other way? Thanks in advance, Dmitry

    Read the article

  • Python byte per byte XOR decryption

    - by neurino
    I have an XOR encypted file by a VB.net program using this function to scramble: Public Class Crypter ... 'This Will convert String to bytes, then call the other function. Public Function Crypt(ByVal Data As String) As String Return Encoding.Default.GetString(Crypt(Encoding.Default.GetBytes(Data))) End Function 'This calls XorCrypt giving Key converted to bytes Public Function Crypt(ByVal Data() As Byte) As Byte() Return XorCrypt(Data, Encoding.Default.GetBytes(Me.Key)) End Function 'Xor Encryption. Private Function XorCrypt(ByVal Data() As Byte, ByVal Key() As Byte) As Byte() Dim i As Integer If Key.Length <> 0 Then For i = 0 To Data.Length - 1 Data(i) = Data(i) Xor Key(i Mod Key.Length) Next End If Return Data End Function End Class and saved this way: Dim Crypter As New Cryptic(Key) 'open destination file Dim objWriter As New StreamWriter(fileName) 'write crypted content objWriter.Write(Crypter.Crypt(data)) Now I have to reopen the file with Python but I have troubles getting single bytes, this is the XOR function in python: def crypto(self, data): 'crypto(self, data) -> str' return ''.join(chr((ord(x) ^ ord(y)) % 256) \ for (x, y) in izip(data.decode('utf-8'), cycle(self.key)) I had to add the % 256 since sometimes x is 256 i.e. not a single byte. This thing of two bytes being passed does not break the decryption because the key keeps "paired" with the following data. The problem is some decrypted character in the conversion is wrong. These chars are all accented letters like à, è, ì but just a few of the overall accented letters. The others are all correctly restored. I guess it could be due to the 256 mod but without it I of course get a chr exception... Thanks for your support

    Read the article

  • How do I sort an internationalized i18n table with symfony and doctrine?

    - by Maurizio
    I would like to display a list of records from an internationalized table using sfDoctrinePager. Not all the records have been translated to all the languages supported by the application, so I had to implement a fallback mechanism for some fields (by overriding the getFoo() function in the Bar.class.php, as explained in another post here). I have different fallback list for each culture. Everything works fine until when it comes to sorting the records in alphabetical order. I'm sorting the records at the SQL (Dql) level, by adding an -orderBy('t.name') to the query: $q = Doctrine::getTable('Foo') ->createQuery('f') ->leftJoin('f.Translation t') ->orderBy('t.name') But here come the troubles: the list gets not sorted correctly, regardless of the active culture. I get rather better results when I limit the translations to the active culture, like this: ->leftJoin('f.Translation t WITH lang = ?', $request->getParameter('sf_culture'); Then the sorting is correct, as far as all the translations exist for the active culture. If a translation does not exist and I have to take the name from the fallback language, the record will be displayed at the very beginning of the list (I understand this happens because the value for the current culture is null). My question is: is there a best practice for getting internationalized fields (needing fallbacks) sorted correctly with doctrine and sfDoctrinePager? Thank you in advance.

    Read the article

  • Silverlight Vs. WPF Vs. Winforms What is good for specifically my purpose?

    - by Cyril Gupta
    I am about to start a new Windows applications and the contenders for the platform are: Windows Forms WPF Silverlight Now my experience with WPF at least in my last application was not very encouraging (the app failed to run on the deployment machines and I had to re-do it in Winforms). So my confidence is shaken here. My app is for mass-distribution (the last version had some 100,000+ installations). So I want to make absolutely sure that my users will be able to use it and enjoy it without any problems. I would love to create a nice interface, going the next step like a Flex or Silverlight, iPhone app, with animations and effects. So I would really like to go with WPF or Silverlight if I can. My needs are Good support for visuals and animation effects. Support for database connectivity. Support for printing (Is there an equivalent of PrintDocument in Silverlight) Must not suffer from deployment troubles. Silverlight is universal, but does it have printing support and good controls toolset? WPF has printing support and a nice toolset, but can I depend on it? Winforms is dated already and is not so impressive, but should I go with it anyway? Your advice would be appreciated

    Read the article

  • Join + IEqualityComparer<T> and HashCode

    - by Jesus Rodriguez
    Im writing my own LINQ reference but Im getting troubles with some of the more complicated operators implementations. There is a Join implementation that takes a IEqualityComparer Im getting just crazy. Im trying to understand it first before I write (obviously) Image this two lists: List<string> initials = new List<string> {"A", "B", "C", "D", "E"}; List<string> words = new List<string> {"Ant", "Crawl", "Pig", "Boat", "Elephant", "Arc"}; Nothing weird here. I want to join both lists by the Initial, something like: Initial=A Word=Ant Initial=A Word=Arc Initial=B Word=Boat ... I need a comparator, I wrote this: public class InitialComparator : IEqualityComparer<string> { public bool Equals(string x, string y) { return x.StartsWith(y); } public int GetHashCode(string obj) { return obj[0].GetHashCode(); } } The Join itself: var blah = initials.Join(words, initial => initial, word => word, (initial, word) => new {Initial = initial, Word = word}, new InitialComparator()); It's the first time Im using HashCodes, after a good session of debugging I see that every word go to the comparator and look at its HashCode, if another word has the same HashCode it calls equals. Since I want to compare just the initial I though that I just need the first letter Hash (Am I wrong?) The thing is that this is not working correctly. Its says that "Ant" and "Arc" are equals, Ok, its comparing every word in the same list or not, But it adds only the last word it finds, in this case Arc, ignoring Ant and Ant is equals to "A" too... If I put "Ant" and "Ant" it add both. In short, What is the way of doing something like that? I know that Im doing something wrong. Thank you.

    Read the article

  • Getting Started with Ruby & Ruby on Rails

    - by JakeTheSnake
    Some background: I'm a jack-of-all traits, one of which is programming. I learned VB6 through Excel and PHP for creating websites and so far it's worked out just fine for me. I'm not CS major or even mathematically inclined - logic is what interests me. Current status: I'm willing to learn new and more powerful languages; my first foray into such a route is learning Ruby. I went to the main Ruby website and did the interactive intro. (by the way, I'm currently getting redirected to google.com when I try the link...it's happening to other websites as well...is my computer infected?) I liked what I learned and wanted to get started using Ruby to create websites. I downloaded InstantRails and installed it; everything so far has been fine - the program starts up just fine, and I can test some Ruby code in the console. However my troubles begin when I try and view a web page with Ruby code present. Lastly, my problem: As in PHP, I can browse to the .php file directly and through using PHP tags and some simple 'echo' statements I can be on my way in making dynamic web pages. However with the InstantRails app working, accessing a .rb or .rhtml page doesn't produce similar results. I made a simple text file named 'test.rb' and put basic HTML tags in there (html, head, body) and the Ruby tags <%= and % with some ruby code inside. The web page actually shows the tags and the code - as if it's all just plain HTML. I take it Ruby isn't parsing the page before it is displayed to the user, but this is where my lack of understanding of the Ruby environment stops me short. Where do I go from here?

    Read the article

  • Why aren't my objects sorting with sortedArrayUsingDescriptors?

    - by clozach
    I expected the code below to return the objects in imageSet as a sorted array. Instead, there's no difference in the ordering before and after. NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"imageID" ascending:YES]; NSSet *imageSet = collection.images; for (CBImage *image in imageSet) { NSLog(@"imageID in Set: %@",image.imageID); } NSArray *imageArray = [[imageSet allObjects] sortedArrayUsingDescriptors:(descriptor, nil)]; [descriptor release]; for (CBImage *image in imageArray) { NSLog(@"imageID in Array: %@",image.imageID); } Fwiw, CBImage is defined in my core data model. I don't know why sorting on managed objects would work any differently than on "regular" objects, but maybe it matters. As proof that @"imageID" should work as the key for the descriptor, here's what the two log loops above output for one of the sets I'm iterating through: 2010-05-05 00:49:52.876 Cover Browser[38678:207] imageID in Array: 360339 2010-05-05 00:49:52.876 Cover Browser[38678:207] imageID in Array: 360337 2010-05-05 00:49:52.877 Cover Browser[38678:207] imageID in Array: 360338 2010-05-05 00:49:52.878 Cover Browser[38678:207] imageID in Array: 360336 2010-05-05 00:49:52.879 Cover Browser[38678:207] imageID in Array: 360335 ... For extra credit, I'd love to get a general solution to troubleshooting NSSortDescriptor troubles (esp. if it also applies to troubleshooting NSPredicate). The functionality of these things seems totally opaque to me and consequently debugging takes forever.

    Read the article

  • Misalignement in the output Bitmap created from a byte array

    - by Daniel
    I am trying to understand why I have troubles creating a Bitmap from a byte array. I post this after a careful scrutiny of the existing posts about Bitmap creation from byte arrays, like the followings: Creating a bitmap from a byte[], Working with Image and Bitmap in c#?, C#: Bitmap Creation using bytes array My code is aimed to execute a filter on a digital image 8bppIndexed writing the pixel value on a byte [] buffer to be converted again (after some processing to manage gray levels) in a 8BppIndexed Bitmap My input image is a trivial image created by means of specific perl code: https://www.box.com/shared/zqt46c4pcvmxhc92i7ct Of course, after executing the filter the output image has lost the first and last rows and the first and last columns, due to the way the filter manage borders, so from the original 256 x 256 image i get a 254 x 254 image. Just to stay focused on the issue I have commented the code responsible for executing the filter so that the operation really performed is an obvious: ComputedPixel = InputImage.GetPixel(myColumn, myRow).R; I know, i should use lock and unlock but I prefer one headache one by one. Anyway this code should be a sort of identity transform, and at last i use: private unsafe void FillOutputImage() { OutputImage = new Bitmap (OutputImageCols, OutputImageRows , PixelFormat .Format8bppIndexed); ColorPalette ncp = OutputImage.Palette; for (int i = 0; i < 256; i++) ncp.Entries[i] = Color .FromArgb(255, i, i, i); OutputImage.Palette = ncp; Rectangle area = new Rectangle(0, 0, OutputImageCols, OutputImageRows); var data = OutputImage.LockBits(area, ImageLockMode.WriteOnly, OutputImage.PixelFormat); Marshal .Copy (byteBuffer, 0, data.Scan0, byteBuffer.Length); OutputImage.UnlockBits(data); } The output image I get is the following: https://www.box.com/shared/p6tubyi6dsf7cyregg9e It is quite clear that I am losing a pixel per row, but i cannot understand why: I have carefully controlled all the parameters: OutputImageCols, OutputImageRows and the byte [] byteBuffer length and content even writing known values as way to test. The code is nearly identical to other code posted in stackOverflow and elsewhere. Someone maybe could help to identify where the problem is? Thanks a lot

    Read the article

  • eclipseFP2 haskell unix haveing issues connectiong to Scion Server

    - by Chris
    I am having troubles with using FP2 for eclipse and getting it to connect with the server. Eclipse seems to auto-detect scion_server, but I a error in the log file !ENTRY net.sf.eclipsefp.haskell.scion.client 4 4 2010-04-15 10:40:06.580 !MESSAGE The connection with the Scion server could not be established. !STACK 0 The connection with the Scion server could not be established. at net.sf.eclipsefp.haskell.scion.internal.client.ScionServer.connectToServer(ScionServer.java:328) at net.sf.eclipsefp.haskell.scion.internal.client.ScionServer.startServer(ScionServer.java:73) at net.sf.eclipsefp.haskell.scion.client.ScionInstance.start(ScionInstance.java:94) at net.sf.eclipsefp.haskell.scion.client.ScionInstance.runCommandSync(ScionInstance.java:207) at net.sf.eclipsefp.haskell.scion.internal.commands.ScionCommand.run(ScionCommand.java:136) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(Unknown Source) at java.net.PlainSocketImpl.connectToAddress(Unknown Source) at java.net.PlainSocketImpl.connect(Unknown Source) at java.net.SocksSocketImpl.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.connect(Unknown Source) at java.net.Socket.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at net.sf.eclipsefp.haskell.scion.internal.client.ScionServer.connectToServer(ScionServer.java:345) at net.sf.eclipsefp.haskell.scion.internal.client.ScionServer.connectToServer(ScionServer.java:324)

    Read the article

  • HATEOAS - Discovery and URI Templating

    - by Paul Kirby
    I'm designing a HATEOAS API for internal data at my company, but have been having troubles with the discovery of links. Consider the following set of steps for someone to retrieve information about a specific employee in this system: User sends GET to http://coredata/ to get all available resources, returns a number of links including one tagged as rel = "http://coredata/rels/employees" User follows HREF on the rel from the first request, performing a GET at (for example) http://coredata/employees The data returned from this last call is my conundrum and a situation where I've heard mixed suggestions. Here are some of them: That GET will return all employees (with perhaps truncated data), and the client would be responsible for picking the one it wants from that list. That GET would return a number of URI templated links describing how to query / get one employee / get all employees. Something like: "_links": { "http://coredata/rels/employees#RetrieveOne": { "href": "http://coredata/employees/{id}" }, "http://coredata/rels/employees#Query": { "href": "http://coredata/employees{?login,firstName,lastName}" }, "http://coredata/rels/employees#All": { "href": "http://coredata/employees/all" } } I'm a little stuck here with what remains closest to HATEOAS. For option 1, I really do not want to make my clients retrieve all employees every time for the sake of navigation, but I can see how using URI templating in example two introduces some out-of-band knowledge. My other thought was to use the RetrieveOne, Query, and All operations as my cool URLs, but that seems to violate the concept that you should be able to navigate to the resources you want from one base URI. Has anyone else managed to come up with a good way to handle this? Navigation is dead simple once you've retrieved one resource or a set of resources, but it seems very difficult to use for discovery.

    Read the article

  • Delphi TRttiType.GetMethods return zero TRttiMethod instances

    - by conciliator
    I've recently been able to fetch a TRttiType for an interface using TRttiContext.FindType using Robert Loves "GetType"-workaround ("registering" the interface by an explicit call to ctx.GetType, e.g. RType := ctx.GetType(TypeInfo(IMyPrettyLittleInterface));). One logical next step would be to iterate the methods of said interface. Consider program rtti_sb_1; {$APPTYPE CONSOLE} uses SysUtils, Rtti, mynamespace in 'mynamespace.pas'; var ctx: TRttiContext; RType: TRttiType; Method: TRttiMethod; begin ctx := TRttiContext.Create; RType := ctx.GetType(TypeInfo(IMyPrettyLittleInterface)); if RType <> nil then begin for Method in RType.GetMethods do WriteLn(Method.Name); end; ReadLn; end. This time, my mynamespace.pas looks like this: IMyPrettyLittleInterface = interface ['{6F89487E-5BB7-42FC-A760-38DA2329E0C5}'] procedure SomeProcedure; end; Unfortunately, RType.GetMethods returns a zero-length TArray-instance. Are there anyone able to reproduce my troubles? (Note that in my example I've explicitly fetched the TRttiType using TRttiContext.GetType, not the workaround; the introduction is included to warn readers that there might be some unresolved issues regarding rtti and interfaces.) Thanks!

    Read the article

  • ASP.NET application - Error when trying to connect to a SQL Server 2008 instance

    - by Pablo Dami
    Hi everyone! Despite that I’m a regular reader of this great forum, this is my first post on it. I believe that this community can help me with the following problem that I have. I’m trying to publish an ASP.NET website over an IIS 6.0 (Windows 2003 Server), and I have some troubles trying to connect to the database. Curiously, I have installed another ASP.NET website into the same IIS 6.0 with the same properties and security parameters and can connect without problems with the same database. The application that works fine is almost the same that the one that can’t connect with SQL Server (actually is the same but with several modifications). I’ll enumarate some information related to the problem: S.O: Windows 2003 Server SQL Server Engine: SQL Server 2008 SQL Server accept remote connections? Yes. ASP.NET version: 2.0.50727 The connections via TCP/IP are enabled to the SQL Server instance? Yes. The corresponding user that I have in the connection string, actually exists into the database with the “owner” role? Yes. ORM Tool used: nHibernate I get the following error when I try to run the aplication into the browser: Error while establishing a connection to the server. When connecting to SQL Server 2005, this failure may occur because the default settings SQL Server does not allow remote connections. (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) In order to isolate the problem, I made some test. For example, using the web app that works fine I can connect without any problema with the database that uses the web app that can’t. With this evidence I concluded that the problem is within the web app and not into the SQL Server instance. I also google it my problem but sadly I can't find nothing usefull to solve it. If someone can help me I’ll appreciate that. Thank you so much for your time!

    Read the article

  • Why qry.post executed with asynchronous mode?

    - by Ryan
    Recently I met a strange problem, see code snips as below: var sqlCommand: string; connection: TADOConnection; qry: TADOQuery; begin connection := TADOConnection.Create(nil); try connection.ConnectionString := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Test.MDB;Persist Security Info=False'; connection.Open(); qry := TADOQuery.Create(nil); try qry.Connection := connection; qry.SQL.Text := 'Select * from aaa'; qry.Open; qry.Append; qry.FieldByName('TestField1').AsString := 'test'; qry.Post; beep; finally qry.Free; end; finally connection.Free; end; end; First, Create a new access database named test.mdb and put it under the directory of this test project, we can create a new table named aaa in it which has only one text type field named TestField1. We set a breakpoint at line of "beep", then lunch the test application under ide debug mode, when ide stops at the breakpoint line (qry.post has been executed), at this time we use microsoft access to open test.mdb and open table aaa you will find there are no any changes in table aaa, if you let the ide continue running after pressing f9 you can find a new record is inserted in to table aaa, but if you press ctrl+f2 to terminate the application at the breakpoint, you will find the table aaa has no record been inserted, but in normal circumstance, a new record should be inserted in to the table aaa after qry.post executed. who can explain this problem , it troubles me so long time. thanks !!! BTW, the ide is delphi 2010, and the access mdb file is created by microsoft access 2007 under windows 7

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25  | Next Page >