Search Results

Search found 1506 results on 61 pages for 'ben mezger'.

Page 37/61 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Why does Microsoft Windows' performance appear to degrade over time?

    - by Ben Aston
    Windows XP/2k3 and earlier (can't attest to Vista, but suspect it's the same) all appear to become more sluggish over time as applications are installed and uninstalled. This is not a scientifically tested observation, but more of a learned-through-experience piece of wisdom. (I've always suspected the registry as being behind the issue.) Does anyone have any concrete evidence of this degradation occurring, or it just an invalid perception of mine?

    Read the article

  • Writing csv files with python with exact formatting parameters

    - by Ben Harrison
    I'm having trouble with processing some csv data files for a project. The project's programmer has moved onto greener pastures, and now I'm trying to finish the data analysis up (I did/do the statistical analysis.) The programmer suggested using python/csv reader to help break down the files, which I've had some success with, but not in a way I can use. This code is a little different from what I was trying before. I am essentially attempting to create an array. In the raw data format, the first 7 rows contain no data, and then each column contains 50 experiments, each with 4000 rows, for 200000 some rows total. What I want to do is take each column, and make it an individual csv file, with each experiment in its own column. So it would be an array of 50 columns and 4000 rows for each data type. The code here does break down the correct values, I think the logic is okay, but it is breaking down the opposite of how I want it. I want the separators without quotes (the commas and spaces) and I want the element values in quotes. Right now it is doing just the opposite for both, element values with no quotes, and the separators in quotes. I've spent several hours trying to figure out how to do this to no avail, import csv ifile = open('00_follow_maverick.csv') epistemicfile = open('00_follower_maverick_EP.csv', 'w') reader = csv.reader(ifile) colnum = 0 rownum = 0 y = 0 z = 8 for column in reader: rownum = 4000 * y + z for element in column: writer = csv.writer(epistemicfile) if y <= 50: y = y + 1 writer.writerow([element]) writer.writerow(',') rownum = x * y + z if y > 50: y = 0 z = z + 1 writer.writerow(' ') rownum = x * y + z if z >= 4008: break What is going on: I am taking each row in the raw data file in iterations of 4000, so that I can separate them with commas for the 50 experiments. When y, the experiment indicator here, reaches 50, it resets back to experiment 0, and adds 1 to z, which tells it which row to look at, by the formula of 4000 * y + z. When it completes the rows for all 50 experiments, it is finished. The problem here is that I don't know how to get python to write the actual values in quotes, and my separators outside of quotes. Any help will be most appreciated. Apologies if this seems a stupid question, I have no programming experience, this is my first attempt ever. Thank you.

    Read the article

  • Jquery each loop with json array

    - by Ben
    I'm trying to use Jquery's each loop to go through this Json and add it to a div named #contentHere. The Json is as follows: { "justIn": [ { "textId": "123", "text": "Hello", "textType": "Greeting" }, { "textId": "514", "text":"What's up?", "textType": "Question" }, { "textId": "122", "text":"Come over here", "textType": "Order" } ], "recent": [ { "textId": "1255", "text": "Hello", "textType": "Greeting" }, { "textId": "6564", "text":"What's up?", "textType": "Question" }, { "textId": "0192", "text":"Come over here", "textType": "Order" } ], "old": [ { "textId": "5213", "text": "Hello", "textType": "Greeting" }, { "textId": "9758", "text":"What's up?", "textType": "Question" }, { "textId": "7655", "text":"Come over here", "textType": "Order" } ] } I'm getting this Json through use of this code: $.get("data.php", function(data){ }) Any solutions?

    Read the article

  • Drawing only part of a

    - by Ben Reeves
    ..Continued on from my previous question I have a 320*480 RGB565 framebuffer which I wish to draw using OpenGL ES 1.0 on the iPhone. - (void)setupView { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, (int[4]){0, 0, 480, 320}); glEnable(GL_TEXTURE_2D); } // Updates the OpenGL view when the timer fires - (void)drawView { // Make sure that you are drawing to the current context [EAGLContext setCurrentContext:context]; //Get the 320*480 buffer const int8_t * frameBuf = [source getNextBuffer]; //Create enough storage for a 512x512 power of 2 texture int8_t lBuf[2*512*512]; memcpy (lBuf, frameBuf, 320*480*2); //Upload the texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 512, 512, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, lBuf); //Draw it glDrawTexiOES(0, 0, 1, 480, 320); [context presentRenderbuffer:GL_RENDERBUFFER_OES]; } If I produce the original texture in 512*512 the output is cropped incorrectly but other than that looks fine. However using the require output size of 320*480 everything is distorted and messed up. I'm pretty sure it's the way I'm copying the framebuffer into the new 512*512 buffer. I have tried this routine int8_t lBuf[512][512][2]; const char * frameDataP = frameData; for (int ii = 0; ii < 480; ++ii) { memcpy(lBuf[ii], frameDataP, 320); frameDataP += 320; } Which is better, but the width appears to be stretched and the height is messed up. Any help appreciated.

    Read the article

  • How can I temporarily redirect printf output to a c-string?

    - by Ben S
    I'm writing an assignment which involves adding some functionality to PostgreSQL on a Solaris box. As part of the assignment, we need to print some information on the client side (i.e.: using elog.) PostgreSQL already has lots of helper methods which print out the required information, however, the helper methods are packed with hundreds of printf calls, and the elog method only works with c-style strings. Is there I way that I could temporarily redirect printf calls to a buffer so I could easily send it over elog to the client? If that's not possible, what would be the simplest way to modify the helper methods to end up with a buffer as output?

    Read the article

  • Heroku powered private restricted beta

    - by Ben Sand
    I'd like to run an app in a restricted private beta on heroku. We're changing the app regularly and haven't done a security audit. To stop anyone exploiting stuff, we'd like to lock down the whole site, so you need a password to access anything. Ideally similar to using .htaccess and .htpasswd files to lock an entire site on an Apache server. Is there a simple one shot way to do this for a heroku hosted app?

    Read the article

  • Simplest way to match array of strings to search in perl?

    - by Ben Dauphinee
    What I want to do is check an array of strings against my search string and get the corresponding key so I can store it. Is there a magical way of doing this with Perl, or am I doomed to using a loop? If so, what is the most efficient way to do this? I'm relatively new to Perl (I've only written 2 other scripts), so I don't know a lot of the magic yet, just that Perl is magic =D Reference Array: (1 = 'Canon', 2 = 'HP', 3 = 'Sony') Search String: Sony's Cyber-shot DSC-S600 End Result: 3

    Read the article

  • ASMX Web Service online works when all of the code is in one file without code-behind

    - by Ben McCormack
    I have an ASMX Web Service that has its code entirely in a code-behind file, so that the entire contents of the .asmx file is: <%@ WebService Language="C#" CodeBehind="~/App_Code/AddressValidation.cs" Class="AddressValidation" %> On my test machine (Windows XP with IIS 5), I set up a virtual directory just for this ASP.NET 2.0 solution and everything works great. All my code is separated nicely and it just works. However, when we deployed this solution to our Windows Server 2003 development environment, we noticed that the code only compiled when all of the code was dropped directly into the .asmx file, meaning that the solution didn't work with code-behind. We can't figure out why this is happening. One thing that's different about our setup in our development environment is that instead of creating a separate virual directory just for this solution, we dropped it into an existing directory that runs a classic ASP application. So here we have a folder with an ASP.NET 2.0 application within a directory that contains a classic ASP application. Granted, everything in the ASP.NET 2.0 application works if all of the code is within the .asmx file and not in code-behind, but we'd really like to know why it's not recognizing the code-behind files and compiling it correctly.

    Read the article

  • Binding ListBox ItemCount to IvalueConverter

    - by Ben
    Hi All, I am fairly new to WPF so forgive me if I am missing something obvious. I'm having a problem where I have a collection of AggregatedLabels and I am trying to bind the ItemCount of each AggregatedLabel to the FontSize in my DataTemplate so that if the ItemCount of an AggregatedLabel is large then a larger fontSize will be displayed in my listBox etc. The part that I am struggling with is the binding to the ValueConverter. Can anyone assist? Many thanks! XAML Snippet <DataTemplate x:Key="TagsTemplate"> <WrapPanel> <TextBlock Text="{Binding Name, Mode=Default}" TextWrapping="Wrap" FontSize="{Binding ItemCount, Converter={StaticResource CountToFontSizeConverter}, Mode=Default}" Foreground="#FF0D0AF7"/> </WrapPanel> </DataTemplate> <ListBox x:Name="tagsList" ItemsSource="{Binding AggregatedLabels, Mode=Default}" ItemTemplate="{StaticResource TagsTemplate}" Style="{StaticResource tagsStyle}" Margin="200,10,16.171,11.88" /> AggregatedLabel Collection using (DB2DataReader dr = command.ExecuteReader()) { while (dr.Read()) { AggregatedLabelModel aggLabel = new AggregatedLabelModel(); aggLabel.ID = Convert.ToInt32(dr["LABEL_ID"]); aggLabel.Name = dr["LABEL_NAME"].ToString(); LabelData.Add(aggLabel); } } Converter public class CountToFontSizeConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { const int minFontSize = 6; const int maxFontSize = 38; const int increment = 3; int count = (int)value; if ((minFontSize + count + increment) < maxFontSize) { return minFontSize + count + increment; } return maxFontSize; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } AggregatedLabel Class public class AggregatedLabelModel { public int ID { get; set; } public string Name { get; set; } } CollectionView ListCollectionView labelsView = new ListCollectionView(LabelData); labelsView.GroupDescriptions.Add(new PropertyGroupDescription("Name"));

    Read the article

  • How do I build a JSON object to send to an AJAX WebService?

    - by Ben McCormack
    After trying to format my JSON data by hand in javascript and failing miserably, I realized there's probably a better way. Here's what the code for the web service method and relevant classes looks like in C#: [WebMethod] public Response ValidateAddress(Request request) { return new test_AddressValidation().GenerateResponse( test_AddressValidation.ResponseType.Ambiguous); } ... public class Request { public Address Address; } public class Address { public string Address1; public string Address2; public string City; public string State; public string Zip; public AddressClassification AddressClassification; } public class AddressClassification { public int Code; public string Description; } The web service works great with using SOAP/XML, but I can't seem to get a valid response using javascript and jQuery because the message I get back from the server has a problem with my hand-coded JSON. I can't use the jQuery getJSON function because the request requires HTTP POST, so I'm using the lower-level ajax function instead: $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "http://bmccorm-xp/HBUpsAddressValidation/AddressValidation.asmx/ValidateAddress", data: "{\"Address\":{\"Address1\":\"123 Main Street\",\"Address2\":null,\"City\":\"New York\",\"State\":\"NY\",\"Zip\":\"10000\",\"AddressClassification\":null}}", dataType: "json", success: function(response){ alert(response); } }) The ajax function is submitting everything specified in data:, which is where my problem is. How do I build a properly formatted JSON object in javascript so I can plug it in to my ajax call like so: data: theRequest I'll eventually be pulling data out of text inputs in forms, but for now hard-coded test data is fine. How do I build a properly formatted JSON object to send to the web service?

    Read the article

  • Insert multiple values using INSERT INTO

    - by Ben McCormack
    In SQL Server 2005, I'm trying to figure out why I'm not able to insert multiple fields into a table. The following query, which inserts one record, works fine: INSERT INTO [MyDB].[dbo].[MyTable] ([FieldID] ,[Description]) VALUES (1000,N'test') However, the following query, which specifies more than one value, fails: INSERT INTO [MyDB].[dbo].[MyTable] ([FieldID] ,[Description]) VALUES (1000,N'test'),(1001,N'test2') I get this message: Msg 102, Level 15, State 1, Line 5 Incorrect syntax near ','. When I looked up the help for INSERT in SQL Sever Management Studio, one of their examples showed using the "Values" syntax that I used (with groups of values in parentheses and separated by commas). The help documentation I found in SQL Server Management Studio looks like it's for SQL Server 2008, so perhaps that's the reason that the insert doesn't work. Either way, I can't figure out why it won't work.

    Read the article

  • Traceroute comparison and statistics

    - by ben-casey
    I have a number of traceroutes that i need to compare against each other but i dont know the best way to do it, ive been told that hash maps are a good technique but i dont know how to implement them on my code. so far i have: FileInputStream fstream = new FileInputStream("traceroute.log"); // Get the object of DataInputStream DataInputStream in = new DataInputStream(fstream); BufferedReader br = new BufferedReader(new InputStreamReader(in)); String strLine; // reads lines in while ((strLine = br.readLine()) != null) { System.out.println(strLine); } and the output looks like this: Wed Mar 31 01:00:03 BST 2010 traceroute to www.bbc.co.uk (212.58.251.195), 30 hops max, 40 byte packets 1 139.222.0.1 (139.222.0.1) 0.873 ms 1.074 ms 1.162 ms 2 core-from-cmp.uea.ac.uk (10.0.0.1) 0.312 ms 0.350 ms 0.463 ms 3 ueaha1btm-from-uea1 (172.16.0.34) 0.791 ms 0.772 ms 1.238 ms 4 bound-from-ueahatop.uea.ac.uk (193.62.92.71) 5.094 ms 4.451 ms 4.441 ms 5 gi0-3.norw-rbr1.eastnet.ja.net (193.60.0.21) 4.426 ms 5.014 ms 4.389 ms 6 gi3-0-2.chel-rbr1.eastnet.ja.net (193.63.107.114) 6.055 ms 6.039 ms * 7 lond-sbr1.ja.net (146.97.40.45) 6.994 ms 7.493 ms 7.457 ms 8 so-6-0-0.lond-sbr4.ja.net (146.97.33.154) 8.206 ms 8.187 ms 8.234 ms 9 po1.lond-ban4.ja.net (146.97.35.110) 8.673 ms 6.294 ms 7.668 ms 10 bbc.lond-sbr4.ja.net (193.62.157.178) 6.303 ms 8.118 ms 8.107 ms 11 212.58.238.153 (212.58.238.153) 6.245 ms 8.066 ms 6.541 ms 12 212.58.239.62 (212.58.239.62) 7.023 ms 8.419 ms 7.068 ms what i need to do is compare this trace against another one just like it and look for the changes and time differences etc, then print a stats page.

    Read the article

  • When should I be cautious using data binding in .NET?

    - by Ben McCormack
    I just started working on a small team of .NET programmers about a month ago and recently got in a discussion with our team lead regarding why we don't use databinding at all in our code. Every time we work with a data grid, we iterate through a data table and populate the grid row by row; the code usually looks something like this: Dim dt as DataTable = FuncLib.GetData("spGetTheData ...") Dim i As Integer For i = 0 To dt.Rows.Length - 1 '(not sure why we do not use a for each here)' gridRow = grid.Rows.Add() gridRow(constantProductID).Value = dt("ProductID").Value gridRow(constantProductDesc).Value = dt("ProductDescription").Value Next '(I am probably missing something in the code, but that is basically it)' Our team lead was saying that he got burned using data binding when working with Sheridan Grid controls, VB6, and ADO recordsets back in the nineties. He's not sure what the exact problem was, but he remembers that binding didn't work as expected and caused him some major problems. Since then, they haven't trusted data binding and load the data for all their controls by hand. The reason the conversation even came up was because I found data binding to be very simple and really liked separating the data presentation (in this case, the data grid) from the in-memory data source (in this case, the data table). "Loading" the data row by row into the grid seemed to break this distinction. I also observed that with the advent of XAML in WPF and Silverlight, data-binding seems like a must-have in order to be able to cleanly wire up a designer's XAML code with your data. When should I be cautious of using data-binding in .NET?

    Read the article

  • Playing Multiple Sounds at Once in Qt

    - by Ben
    I'm trying to play background music along with sound effects using Qt. However, I can't get more than one sound to play at once. For example: QSound::play("Music.wav"); QSound::play("Effect.wav"); When this code is run (on Windows), you can hear Music.wav just start to play, but then it stops and Effect.wav plays. Is there any way to get the two sounds to play at once?

    Read the article

  • Best way to implement a 404 in ASP.NET

    - by Ben Mills
    I'm trying to determine the best way to implement a 404 page in a standard ASP.NET web application. I currently catch 404 errors in the Application_Error event in the Global.asax file and redirect to a friendly 404.aspx page. The problem is that the request sees a 302 redirect followed by a 404 page missing. Is there a way to bypass the redirect and respond with an immediate 404 containing the friendly error message? Does a web crawler such as Googlebot care if the request for a non existing page returns a 302 followed by a 404?

    Read the article

  • Mathematica equivalent of Ruby's inject

    - by Ben Alpert
    Is there a Mathematica function like inject in Ruby? For example, if I want the product of the elements in a list, in Ruby I can write: list.inject(1) { |prod,el| prod * el } I found I can just use Product in Mathematica: Apply[Product, list] However, this isn't general enough for me (like, if I don't just want the product or sum of the numbers). What's the closest equivalent to inject?

    Read the article

  • What do you think is the best language for Bioinformatics?

    - by Ben Fossen
    I have done a couple research jobs in Bio-informatics and I have used Matlab for them. Matlab had a lot of powerful tools and was easy to use. I did thinks with genome sequencing and predicting metabolic pathways. I am wondering what other people think is best? or there might not be one specific language but a few that lend themselves best to Bio-informatics work that is math heavy and deals with a large amount of data.

    Read the article

  • JavaScript distributed computing project

    - by Ben L.
    I made a website that does absolutely nothing, and I've proven to myself that people like to stay there - I've already logged 11+ hours worth of cumulative time on the page. My question is whether it would be possible (or practical) to use the website as a distributed computing site. My first impulse was to find out if there were any JavaScript distributed computing projects already active, so that I could put a piece of code on the page and be done. Unfortunately, all I could find was a big list of websites that thought it might be a cool idea. I'm thinking that I might want to start with something like integer factorization - in this case, RSA numbers. It would be easy for the server to check if an answer was correct (simply test for modulus equals zero), and also easy to implement. Is my idea feasible? Is there already a project out there that I can use?

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >