Daily Archives

Articles indexed Friday May 7 2010

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

  • Downloading all ctrl alt del webcomics using terminal.

    - by Conner
    I've tried using the following commands to download the ctrl alt del comics. $ for filename in $(seq 20021023 20100503); do wget http://www.ctrlaltdel-online.com/comics/"$filename".jpg; done I get the following error code, "bash: syntax error near unexpected token 'do'" I've also tried using cURL, using this command, curl http://ctrlaltdel-online.com/comics[20021023..20100503].jpg I get the following error code, "curl: (3) [globbing] error: bad range specification after pos 37" Any help would be great.

    Read the article

  • More FP-correct way to create an update sql query

    - by James Black
    I am working on access a database using F# and my initial attempt at creating a function to create the update query is flawed. let BuildUserUpdateQuery (oldUser:UserType) (newUser:UserType) = let buf = new System.Text.StringBuilder("UPDATE users SET "); if (oldUser.FirstName.Equals(newUser.FirstName) = false) then buf.Append("SET first_name='").Append(newUser.FirstName).Append("'" ) |> ignore if (oldUser.LastName.Equals(newUser.LastName) = false) then buf.Append("SET last_name='").Append(newUser.LastName).Append("'" ) |> ignore if (oldUser.UserName.Equals(newUser.UserName) = false) then buf.Append("SET username='").Append(newUser.UserName).Append("'" ) |> ignore buf.Append(" WHERE id=").Append(newUser.Id).ToString() This doesn't properly put a , between any update parts after the first, for example: UPDATE users SET first_name='Firstname', last_name='lastname' WHERE id=... I could put in a mutable variable to keep track when the first part of the set clause is appended, but that seems wrong. I could just create an list of tuples, where each tuple is oldtext, newtext, columnname, so that I could then loop through the list and build up the query, but it seems that I should be passing in a StringBuilder to a recursive function, returning back a boolean which is then passed as a parameter to the recursive function. Does this seem to be the best approach, or is there a better one?

    Read the article

  • Displaying xaml resources dynamically?

    - by Robert
    I used Mike Swanson's illustrator to xaml converter to convert some of my images to xaml. The convert creates a viewbox that contains the image. These viewboxes I made resource files in my program. The code below shows what I'm trying to do: I have a viewmodel that has an enum variable called PrimaryWinding of type Windings. The values PrimD and PrimY of the enum select the respective PrimD and PrimY xaml files in the resources. <UserControl.Resources> <DataTemplate x:Key="PrimTrafo" DataType="{x:Type l:Windings}"> <Frame Source="{Binding}" x:Name="PART_Image" NavigationUIVisibility="Hidden"> <Frame.LayoutTransform> <ScaleTransform ScaleX="0.5" ScaleY="0.5"/> </Frame.LayoutTransform> </Frame> <DataTemplate.Triggers> <DataTrigger Binding="{Binding}" Value="PrimD"> <Setter TargetName="PART_Image" Property="Source" Value="Resources\PrimD.xaml" /> </DataTrigger> <DataTrigger Binding="{Binding}" Value="PrimY"> <Setter TargetName="PART_Image" Property="Source" Value="Resources\PrimY.xaml" /> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> </UserControl.Resources> <!--The contentcontrol that holds the datatemplate defined above--> <Grid > <Grid.ColumnDefinitions> <ColumnDefinition Width="2*"></ColumnDefinition> <ColumnDefinition Width="2*"></ColumnDefinition> <ColumnDefinition Width="1*"></ColumnDefinition> </Grid.ColumnDefinitions> <ContentControl Grid.Column="0" Content="{Binding PrimaryWinding}" ContentTemplate="{StaticResource PrimTrafo}"/> </Grid> This code works. Only I can't resize the drawings to the size of the grid cell. I added the ScaleTransform class to resize the image. Is a Frame the wrong class to hold the drawings? Should I use the ScaleTransform class to resize the drawing to the size of the cell? And how can I do that dynamically?

    Read the article

  • using perforce with team foundation server

    - by rgupta4
    Does Team Foundation Server 2008 or upcoming 2010 work with perforce as the SCM tool? I haven't been able to find any documentation on the web indicating whether or not this configuration is supported? I apologize if this question has been answered elsewhere.

    Read the article

  • loading fixtures for django tests

    - by alexarsh
    Hi, I want to use some fixtures in my tests. I have cms_sample app and a fixtures folder inside with cms_sample_data.xml I use the following in my test.py: class Funtionality(TestCase): fixtures = ['cms_sample_data'] I do use TestCase of django.tests and not unittest. But the fixtures are not loaded. What am I missing? Thanks, Arshavski Alexander.

    Read the article

  • curl cookie problem in PHP

    - by safaali
    hi as my client needs, I developed a code to login via cURl. login to www.web1.com and store cookies in cookie.txt go to www.web2.com and browse a page using that cookie.txt no problem with www.web2.com so when i want to do this with www.web3.com, the problem appears. the www.web3.com uses session and cookies itself and I have to gather and use them. it means I should have tow series of cookies, first those from www.web1.com , and second those from www.web3.com , then request the www.web3.com/somepage how I can do that?

    Read the article

  • Why don't SCOM R2 web console performance views load?

    - by Nexus
    When I select any performance view via my SCOM R2 web console, I get the following error: Unexpected error There was an error displaying the page you requested. ... and some suggestions about restarting my browser, which doesn't resolve the issue. The request produces the following event in the logs: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 7/05/2010 11:41:38 AM Event time (UTC): 7/05/2010 1:41:38 AM Event ID: f4c47d1302694e1c8039e6c0088c2520 Event sequence: 18 Event occurrence:1 Event detail code: 0 [snip] Exception information: Exception type: HttpException Exception message: Error executing child request for /ResultViews/ViewTypePerformance.aspx. I'm using forms authentication and all other web console functionality works perfectly. My server is Windows 2008 R2 Standard running SCOM R2 and runs the DB, Web Console and RMS roles. Has anyone else experienced this issue? Is it fixed in the cumulative update release for SCOM R2?

    Read the article

  • Permissions Required for Sharepoint Backups

    - by Wyatt Barnett
    We are in the process of rolling out an extranet for some of our partners using WSS 3.0 as the platform. We already use it internally for a variety of things, and we are using the following powershell script to backup the server: param( $url="http://localhost", $backupFolder="c:\" ) [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $site= new-Object Microsoft.SharePoint.SPSite($url) $names=$site.WebApplication.Sites.Names foreach ($name in $names) { $n2 = "" if ($name.Length -eq 0) { $n2="ROOT" } else { $n2 = $name } $tmp=$n2.Replace("/", "_") + ".sbk" $saveas = "" if ($backupFolder.Length -eq 0) { $saveas = $tmp } else { $saveas = join-path -path $backupFolder -childPath $tmp } $site.WebApplication.Sites.Backup($name, $saveas, "true") write-host "$n2 backed up to $saveas." } This script works perfectly on the current installation running as our domain backup user. On the new box, it fails when ran as the backup user--claiming "The web application located at http://extranet/" could not be found. That url does, in fact, work so I'm fairly certain it isn't anything that dumb and rather is some permissions issue. Especially because, when executed from my security context, the script works perfectly. I have tried making the backup user a farm owner, as well as added him to the various site collection admin groups on the extranet. The one major difference between the extranet and the intranet server is that the extranet has an alternative access mapping (for https://xnet.example.com) and also uses forms authentication for that mapping. Anyhow, what permissions (or other voodoo) do I need to setup to get this script to work properly?

    Read the article

  • How much does it cost to make a phone?

    - by geoffreyf67
    I was curious if there are any websites that detail how much it costs to make a phone. Not a cell phone but a landline phone. It seems that the ones with any decent features have always cost $100+ and I'd have thought that the price would have dropped over the years but that doesn't seem to be happening. So I figured I'd look into the cost of making the phones. G-Man

    Read the article

  • Problem intialising 2D array

    - by TeeJay
    Ok, so I have a 2D Array that is initialised with values from a file (format: x y z). My file reads in the values correctly but when adding the z value to the matrix/2DArray, I run into a segfault and I have no idea why. It is possibly incorrect use of pointers? I still don't quite have the hang of them yet. This is my intialiser, works fine, even intialises all "z" values to 0. int** make2DArray(int rows, int columns) { int** newArray; newArray = (int**)malloc(rows*sizeof(int*)); if (newArray == NULL) { printf("out of memory for newArray.\n"); } for (int i = 0; i < rows; i++) { newArray[i] = (int*)malloc(columns*sizeof(int)); if (newArray[i] == NULL) { printf("out of memory for newArray[%d].\n", i); } } //intialise all values to 0 for (int i = 0; i < rows; i++) { for (int j = 0; j < columns; j++) { newArray[i][j] = 0; } } return newArray; } This is how I call the initialiser (and problem function). int** map = make2DArray(rows, columns); fillMatrix(&map, mapFile); And this is the problem code. void fillMatrix(int*** inMatrix, FILE* inFile) { int x, y, z; char line[100]; while(fgets(line, sizeof(line), inFile) != NULL) { sscanf(line, "%d %d %d", &x, &y, &z); *inMatrix[x][y] = z; } } From what I can gather through the use of ddd, the problem comes when y gets to 47. The map file has a max "x" value of 47 and a max "y" value of 63, I'm pretty sure I haven't got the order mixed up, so I don't know why the program is segfault-ing? I'm sure it's some newbie mistake...

    Read the article

  • New design patterns/design strategies

    - by steven
    I've studied and implemented design patterns for a few years now, and I'm wondering. What are some of the newer design patterns (since the GOF)? Also, what should one, similar to myself, study [in the way of software design] next? Note: I've been using TDD, and UML for some time now. I'm curious about the newer paradigm shifts, and or newer design patterns.

    Read the article

  • How few a files does it take to load a program on Linux?

    - by BCS
    The (hypothetical for now) situation is the user of my system is going to be given a chunk of C code and needs my system to compile and run it in a chroot sandbox that is generated on the fly and I want to require the fewest files in the box as possible. I'm only willing to play with compiler and linker settings (e.g. static link everything I can expect to be able to find) and make some moderate restriction on what the code can expect use (e.g. they can't use arbitrary libs). The question is how simple can I get the sandbox. Clearly I need the executable, but what about an ELF loader and a .so for the system calls? Can I dump either of them and is there something else I'll need?

    Read the article

  • Using Sleep with findstr in a .bat

    - by user270506
    I created a .bat file with the below lines cd C:\MyFolder d: findstr "Apple" C:\log.txt |findstr "red" > red_apples.txt SLEEP 3600 GOTO START When the bat is executed, the SLEEP is not working and the commands are running continously. Is there anything wrong with the code? Please help !

    Read the article

  • Rendering a variable with erb.

    - by TZer0
    I've got the following problem: I have rhtml (html minced together with ruby inside <% % and <%= % tags) stored in a database which I want to render. The information is acquired through a query. I need to be able to evaluate the information I get from the database as though as it was normal content inside the .erb-file. What I currently have: <% @mymods.each do |mod| %> <%= render_text(mod["html"])%> <% end %> Where mod["html"] is the variable containing the rhtml-code and @mymods an array of objects from the query. I have currently no idea what function I should use (render_text does, of course, not work). Help is greatly appreciated. /TZer0

    Read the article

  • build sctp protocol ss7 openss7

    - by deddihp
    hello, I try to make an ss7 application using openss7 and sctp. I made some simple application using SCTP. the part of the source code is like below : sock_srvr = socket(PF_INET, SOCK_DGRAM, IPPROTO_SCTP); if ( sock_srvr == -1 ) { perror("socket"); exit(0); } and it return socket: Protocol not supported do you have any suggestion ?. Is there anyone who have experience with openss7 before ? Thanks..

    Read the article

  • How do I prevent Eclipse from hanging on startup?

    - by Simon Nickerson
    I am using Eclipse 3.3 ("Europa"). Periodically, Eclipse takes an inordinately long time (perhaps forever) to start up. The only thing I can see in the Eclipse log is: !ENTRY org.eclipse.core.resources 2 10035 2008-10-16 09:47:34.801 !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes. Googling reveals someone's suggestion that I remove the folder: workspace\.metadata\.plugins\org.eclipse.core.resources\.root\.indexes This does not appear to have helped. Short of starting with a new workspace (something which I am not keen to do, as it takes me hours to set up all my projects again properly), is there a way to make Eclipse start up properly?

    Read the article

  • How to calculate the average rgb color values of a bitmap

    - by Matthias
    In my C# (3.5) application I need to get the average color values for the red, green and blue channels of a bitmap. Preferably without using an external library. Can this be done? If so, how? Thanks in advance. Trying to make things a little more precise: Each pixel in the bitmap has a certain RGB color value. I'd like to get the average RGB values for all pixels in the image.

    Read the article

  • How to split but ignore separators in quoted strings, in python?

    - by Sly
    I need to split a string like this, on semicolons. But I don't what to split on semicolons that are inside of a string (' or "). I'm not parsing a file; just a simple string with no line breaks. part 1;"this is ; part 2;";'this is ; part 3';part 4 Result should be: part 1 "this is ; part 2" 'this is ; part 4' part 4 I suppose this can be done with a regex but if not; I'm open to another approach.

    Read the article

  • activemodel for rails < 3

    - by brad
    Does anyone know if activemodel works with 2.3.5? I'm looking for this exact functionality (namely, validations for non-AR objects) and I'm trying to find a clean solution for a Rails 2.3.5 app. Or if anyone knows of a good gem/plugin to use that can mimic activerecord like validations for non AR objects, I'm all ears

    Read the article

  • how to find files in a given branch

    - by Haiyuan Zhang
    I noticed that when doing code view, people here in my company usually just give the branch in which his work is done, and nothing else. So I guess there must be a easy way to find out all the files that has a version in the given branch which is the same thing to find all the files that has been the changed. Yes, I don't know the expected "easy way" to find files in certain branch, so need your help and thanks in advance.

    Read the article

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