Daily Archives

Articles indexed Saturday April 3 2010

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

  • How can I set the size of the gap between inline elements in CSS?

    - by Val M
    I am creating an MVC 1.0 form to use in multiple views. I have some elements that need to be shown on the same line, and I have done this by setting the display to "display: inline" for the style. I have also added the margin-left setting to the CSS in order to force the gap between the inline elements but this doesn't appear to be being set. My CSS has: fieldset label.inline { display: inline; margin-left: 2em; } The view code is: <fieldset> <legend>Details</legend> <p> <label for="StartTime">Start Time:</label> <%= Html.TextBox("StartTime", Model.StartTime.ToShortTimeString())%> <label for="NextDay" class="inline">Next Day?</label> <%= Html.CheckBox("NextDay") %> <%= Html.ValidationMessage("StartTime", "*")%> </p> </fieldset> Setting the size in the "margin-left" style has no impact on the space between the StartTime control and the NextDay label. How can I create this gap between the elements?

    Read the article

  • VC++ 6.0 application crashing inside CString::Format when %d is given.

    - by viswanathan
    A VC++ 6.0 application is crashing when doing a CString::Format operation with %d format specifier. This does not occur always but occurs when the application memory grows upto 100MB or more. ALso sometimes same crash observed when a CString copy is done. The call stack would look like this mfc42u!CFixedAlloc::Alloc+82 mfc42u!CString::AllocBuffer+3f 00000038 00000038 005b5b64 mfc42u!CString::AllocBeforeWrite+31 00000038 0a5bfdbc 005b5b64 mfc42u!CString::AssignCopy+13 00000038 057cb83f 0a5bfe90 mfc42u!CString::operator=+4b and this throws an access violation exception.

    Read the article

  • Display Select in an ASP.NET DropDownList

    A purchaser of my book writes: I would like a drop down list to display the text: "-Select-" initially instead of the first value of the data it is bound to. Here you go   <%@ Page Language="VB" %> <script runat="server">...(read more)...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • SQL Stored Queries - use result of query as boolean based on existence of records

    - by Christian Mann
    Just getting into SQL stored queries right now... anyway, here's my database schema (simplified for YOUR convenience): member ------ id INT PK board ------ id INT PK officer ------ id INT PK If you're into OOP, Officer Inherits Board Inherits Member. In other words, if someone is listed on the officer table, s/he is listed on the board table and the member table. I want to find out the highest privilege level someone has. So far my SP looks like this: DELIMITER // CREATE PROCEDURE GetAuthLevel(IN targetID MEDIUMINT) BEGIN IF SELECT `id` FROM `member` WHERE `id` = targetID; THEN IF SELECT `id` FROM `board` WHERE `id` = targetID; THEN IF SELECT `id` FROM `officer` WHERE `id` = targetID; THEN RETURN 3; /*officer*/ ELSE RETURN 2; /*board member*/ ELSE RETURN 1; /*general member*/ ELSE RETURN 0; /*not a member*/ END // DELIMITER ; The exact text of the error is #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT id FROM member WHERE id = targetID; THEN IF SEL' at line 4 I suspect the issue is in the arguments for the IF blocks. What I want to do is return true if the result-set is at least one -- i.e. the id was found in the table. Do any of you guys see anything to do here, or should I reconsider my database design into this:? person ------ id INT PK level SMALLINT

    Read the article

  • add method to reflection-object and named-scopes

    - by toy
    I Like to add a method to my has_many relation in the way that it is applyed on the relation object. I got an Order wich :has_many line_items I like to write things like order.line_items.calculate_total # returns the sum of line_items this I could do with: :has_many line_items do def calculate_total ... end end but this would not be applyed to named_scopes like payalbes_only: order.line_items.payables_only.calculate_total here calculate total would receive all line_items of order and not the scoped ones from payables_only-scope. My log tells me that the paybles_only scope is even not applied to the sql.

    Read the article

  • Cucumber Error: Socket Error for Test Environment Host in REST API

    - by tmo256
    I posted this to the Cucumber group with no replies, which makes me wonder if this is actually a cucumber issue or not. I'm pretty new to cucumber, and there are a number of things I really don't quite understand about how the cucumber environment is set up and executed within the test environment. I have a REST API rails app I'm testing with cucumber, using the RestClient gem to generate a post to controller create action. When I run the feature with a hard-coded URL pointing to a running localhost server (my local dev server environment; replacing tickets_url with "http:// localhost/tickets" in the snippet below), my cucumber steps execute as expected. However, when the resource URL resolves to the cucumber host I'm declaring, I get a socket error exception. getaddrinfo: nodename nor servname provided, or not known (SocketError) From the steps file: When /^POS Adapter sends JSON data to the Tickets resource$/ do ticket = { :ticket = { ... } } host! "test.host" puts tickets_url RestClient.post tickets_url, ticket.to_json, :content_type = :json, :accepts = :json end (the "puts" statement prints "http://test.host/tickets") Using the following gems: cucumber-0.6.1 webrat-0.6.0 rest-client-1.2.0 I should also say I have a similar set up in another rails app, using test.host as my host, and it seems to work fine. I'd appreciate any insight on what I might be missing in my configuration or what this could be related to.

    Read the article

  • Weird Issues with WPMU I Can't Figure Out

    - by HollerTrain
    I know I should post this on the WPMU forum, but no one writes me back and I'm just trying to find a larger audience hoping you have run into this issue as well. I have built a WPMU site for a client, and I am able to upload media into the Media Library and within a Post or Page perfectly. I thought my job was finished, yet the client can't upload any media at all. I'm located in Kentucky, they are located in New England (if that even matters). I had the client record their process of uploading as I thought they were simply not following my instructions for uploading, yet they are doing everything correctly. When uploading a file it goes through the process of allowing them to select a file and it says it uploads it, yet when it is finished uploading nothing is in the Media Library or in the Post. Video of the client trying to upload in Media Manager (http://www.screencast.com/users/CatherineWeber/folders/Jing/media/945d33fa-a752-45fd-9bc1-f76fc5a1814a) Video of the client trying to upload within a Post (http://www.screencast.com/users/CatherineWeber/folders/Jing/media/b5c60e25-f0b5-40c0-a820-c2fc9eb00906) Asking the client to disable Flash Uploader didn't work :( Yet, I can login to the WPMU site, access their blog's backend and can easily upload a ton of files. I am so lost at to what the issue is here. I am running version 2.8.4a, and will try to upgrade to latest release hoping this will fix things.

    Read the article

  • create an album

    - by sinoydevassy
    I have web application for upload images and videos.NOW i am showing just as links in repeater.i want to show it as album based.ie;files to be grouped as albums.Is there any way to do this?please help me.. thank you..

    Read the article

  • Best way to replace mass emails sent from Entourage with a proper mailing list solution?

    - by aaandre
    I am helping a Los Angeles choreographer to transition away from sending her announcements via Entourage. Here's the situation: She has multiple conact groups, and sends classes and performance announcements several times a month, to different groups. She manages the contact groups manually. The group size is between 1500 and 2500 people. Recently verizon blocked her outgoing port 25, presumably for spam activity. Again, her contacts are interested in the content. She is aware of mailchimp, constantcontact etc. but would like to be able to send the email via her email software and not have to create a newsletter for every single mailing. Also, she's very short on $$. So, what would be the best way to set up a system allowing her to send announcements from Entourage, with attached images, to her lists, without having Entourage send every single email? I am thinking of setting up a set of mailing lists, each corresponding to one of her groups. I have never set up a mailing list before and am wondering if it's possible to have a list accept emails from only one person (Admin) and distribute them to the group? Recipients should be able to unsubscribe easily, and by default reply to her but not the list. She should be the only one able to use the list for distribution, and should be able to send messages (with attachments) directly from her email client without modification. Is this possible? Where can I find step-by-step instructions? What are best practices to avoid her domain being blacklisted? What's the easiest way to convert her contact groups to mailing list subscribers? I am helping her for free, so the simpler the better :) Thank you! UPDATE: She has a standard linux hosting account allowing her to run php etc. And, ideally, the emails would come from her personally or at least from her domain name.

    Read the article

  • Best way to parse command line arguments in C#

    - by Paul Stovell
    When building console applications that take parameters, you can use the arguments passed to Main(string[] args). In the past I've simply indexed/looped that array and done a few regular expressions to extract the values. However, when the commands get more complicated, the parsing can get pretty ugly. More recently, I built the world's simplest Backus-Naur Form parser in C# to parse the arguments. It does the job, but it also feels like overkill. So I'm interested in: Libraries that you use Patterns that you use Assume the commands always adhere to common standards such as answered here.

    Read the article

  • How to undo an hg merge? (I think.)

    - by Grumdrig
    I'm new to collaborating with Mercurial. My situation: Another programmer changed rev 1 of a file to replace 4-space indents with 2-space indent. (I.e. changed every line.) Call that rev 2, pushed to the remote repo. I've committed substantive changes rev 1 with various code changes in my local workspace. Call that rev 3. I've hg pulled and hg mergeed without a clear idea of what was going on. The conflicts are myriad and not really substantive. So I really wish I'd changed my local repo to 2-space indents before merging; then the merge will be trivial (i'm supposing). But I can't seem to back up. I think I need to hg update -r 3 but it says abort: outstanding uncommitted merges. How can I undo the merge, changes spacing in my local repo, and remerge?

    Read the article

  • Manage a `visited` links history in browsers

    - by osgx
    Hello Can I edit the browser's visited links history? How can I dump full list of visited sites, or list of pages from some site? I'm interested in the solution for the most popular browsers: IE7-8, Firefox3, Safari4, Chrome3, Opera9.50+ The best will be solution, which can be scripted in JS+CSS. But plugins or instructions for managing visited links history will be good. Thanks

    Read the article

  • Converting C# void* to byte[]

    - by Yurik
    In C#, I need to write T[] to a stream, ideally without any additional buffers. I have a dynamic code that converts T[] (where T is a no-objects struct) to a void* and fixes it in memory, and that works great. When the stream was a file, I could use native Windows API to pass the void * directly, but now I need to write to a generic Stream object that takes byte[]. Can anyone suggest a hack way to create a dummy array object which does not actually have any heap allocations, but rather points to an already existing (and fixed) heap location. This is the pseudo-code that I need: void Write(Stream stream, T[] buffer) { fixed( void* ptr = &buffer ) // done with dynamic code generation { int typeSize = sizeof(T); // done as well byte[] dummy = (byte[]) ptr; // <-- how do I create this fake array? stream.Write( dummy, 0, buffer.Length*typeSize ); } }

    Read the article

  • Printer Sharing with FreeNAS

    - by Unkwntech
    I am using FreeNAS on my lan to do some file/iTunes sharing but I'd like to add printer sharing to it so that I can stop using a second (aging windows) system. I'm not familiar with BSDs but I am comfortable with the shell (I'm a Debian admin) are there any good tutorials for setting up printer sharing (cups?) on FreeNAS?

    Read the article

  • Cannot ssh anymore into FreeBSD 7.2 home server

    - by Gabi
    Somehow sshd stopped running and no amount of start, restart or onestart will make it go again. I normally ssh into it from a dual-boot laptop computer that shows up on the network as gabi-buntu when running Ubuntu Karmic, and as gabi-pc when running Windows XP Pro. Neither my Putty connection nor the Linux terminal can establish a ssh link anymore. Upon rebooting the server, I am greeted with "/etc/rc: WARNING: run_rc_command: cannot run /usr/sbin/sshd". In addition, a message will appear saying things like rpc.statd: failed to contact host gabi-buntu RPC: port mapper failure RPC: timed out Everything else works fine. The FreeBSD 7.2 box runs a print server, a Samba server, and an Apache server for the home wiki, via https. It also serves up NFS shares for Linux clients. Any suggestions? Thank you, Gabi Huiber

    Read the article

  • Mac Port error installing gsoap

    - by Kevin
    Hi All, I have installed Mac Ports V1.8.1 no worries. I ran sudo port -v selfupdate no worries. I ran sudo port install gsoap And get the following error message. --- Computing dependencies for gsoap --- Fetching gsoap --- Attempting to fetch gsoap_2.7.13.tar.gz from http://optusnet.dl.sourceforge.net/gsoap2 --- Verifying checksum(s) for gsoap --- Extracting gsoap --- Applying patches to gsoap --- Configuring gsoap Error: Target org.macports.configure returned: configure failure: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_devel_gsoap/work/gsoap-2.7" && ./configure --prefix=/opt/local --enable-samples " returned error 77 Command output: checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... no checking build system type... i386-apple-darwin10.2.0 checking host system type... i386-apple-darwin10.2.0 checking whether make sets $(MAKE)... (cached) no checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables See `config.log' for more details. Error: Status 1 encountered during processing. Any ideas as to why it is failing. Regards Kevin

    Read the article

  • windows 7 file permission problem

    - by user20989
    i download one zip folder and extract it in windows 7. after extracting it shows file names with green color. now when i try to open any file, it give error access denied. even i set the permission on that file for full control, same error is coming. if i extract same folder in windows vista or xp no error. actually attribute of file is AE and when i right click on file and then select properties-- general-- advance -- encrypt contents to secure data is selected. if uncheck this option i can't apply it again gives error permission denied. Thanks

    Read the article

  • WPF Animate a Maxtrix using interpolation

    - by Mark
    Im having a issue with my application that is using touch gestures to scale, translate and rotate my scene. I was using a TransformGroup which contained TranslateTransform, ScaleTransform and a RotateTransform but I could not get the movement correct, it always jumps and skips, so I moved to a MaxtrixTransform which I was able to use much easier to get my scene to be zoomable, rotatable and panable nicely. However, what I later found out was that you cannot animate smoothly (using interpolation) the values of a Matrix, for what reason I have no idea, but its part of the MSDN doco and the properties of the Matrix are not dependency properties anyways... Has anyone had any luck animating a maxtrix to make it smooth? The only idea(s) I have had is to animate a few different, custom DP which all have callbacks that I update the Matrix from OR To convert the Maxtix to a set of Transform object that I then animate and then afterwords convert back. Is there a smarter way to do this?

    Read the article

  • Wiki Database, is there one?

    - by Faiz
    I was searching the net for something like a wiki database, just like wikipedia but instead stores structured content, editable by users. What I was looking for was an online database accessible by everyone where people can design the schema and data with proper versioning of both schema and data. I couldn't find any such site. I am not sure if it is my search skills or if there really is no wiki database as of now. Does anyone out there know anything like this? I think there is a great potential for something like this. A possible example will be a website with a GUI for querying a MySQL DB where any website visitor can create DB objects and populate data.

    Read the article

  • Problems with Date, preparedStatement, JDBC and PostgreSQL

    - by GuidoMB
    I Have to get a movie from a PostgreSQL database that matches a given title and release date. title is a character(75) and releaseDate is a date. I Have this code: String query = "SELECT * FROM \"Movie\" WHERE title = ? AND \"releaseDate\" = ?)"; Connection conn = connectionManager.getConnection(); PreparedStatement stmt = conn.prepareStatement(query); java.sql.Date date = new java.sql.Date(releaseDate.getTime()); stmt.setString(1, title); stmt.setDate(2, date); ResultSet result = stmt.executeQuery(); but it's not working because the releaseDate is not matching when it should. The query SELECT * FROM "Movie" WHERE title = A_MOVIE AND "releaseDate" = A_DATE works perfectly on a command shell using psql

    Read the article

  • How do I run JUnit from NetBeans?

    - by FarmBoy
    I've been trying to understand how to start writing and running JUnit tests. When I'm reading this article: http://junit.sourceforge.net/doc/testinfected/testing.htm I get the the middle of the page and they write, "JUnit comes with a graphical interface to run tests. Type the name of your test class in the field at the top of the window. Press the Run button." I don't know how to launch this program. I don't even know which package it is in, or how you run a library class from an IDE. Being stuck, I tried this NetBeans tutorial: http://www.netbeans.org/kb/docs/java/junit-intro.html It seemed to be going OK, but then I noticed that the menu options for this tutorial for testing a Java Class Library are different from those for a regular Java application, or for a Java Web App. So the instructions in this tutorial don't apply generally. I'm using NetBeans 6.7, and I've imported JUnit 4.5 into the libraries folder. What would be the normal way to run JUnit, after having written the tests? The JUnit FAQ describes the process from the Console, and I'm willing to do that if that is what is typical, but given all that I can do inside netbeans, it seems hard to believe that there isn't an easier way. Thanks much. EDIT: If I right-click on the project and select "Test" the output is: init: deps-jar: compile: compile-test: test-report: test: BUILD SUCCESSFUL (total time: 0 seconds) This doesn't strike me as the desired output of a test, especially since this doesn't change whether the test condition is true or not. Any ideas?

    Read the article

  • Game loop and time tracking

    - by David Brown
    Maybe I'm just an idiot, but I've been trying to implement a game loop all day and it's just not clicking. I've read literally every article I could find on Google, but the problem is that they all use different timing mechanisms, which makes them difficult to apply to my particular situation (some use milliseconds, other use ticks, etc). Basically, I have a Clock object that updates each time the game loop executes. internal class Clock { public static long Timestamp { get { return Stopwatch.GetTimestamp(); } } public static long Frequency { get { return Stopwatch.Frequency; } } private long _startTime; private long _lastTime; private TimeSpan _totalTime; private TimeSpan _elapsedTime; /// <summary> /// The amount of time that has passed since the first step. /// </summary> public TimeSpan TotalTime { get { return _totalTime; } } /// <summary> /// The amount of time that has passed since the last step. /// </summary> public TimeSpan ElapsedTime { get { return _elapsedTime; } } public Clock() { Reset(); } public void Reset() { _startTime = Timestamp; _lastTime = 0; _totalTime = TimeSpan.Zero; _elapsedTime = TimeSpan.Zero; } public void Tick() { long currentTime = Timestamp; if (_lastTime == 0) _lastTime = currentTime; _totalTime = TimestampToTimeSpan(currentTime - _startTime); _elapsedTime = TimestampToTimeSpan(currentTime - _lastTime); _lastTime = currentTime; } public static TimeSpan TimestampToTimeSpan(long timestamp) { return TimeSpan.FromTicks( (timestamp * TimeSpan.TicksPerSecond) / Frequency); } } I based most of that on the XNA GameClock, but it's greatly simplified. Then, I have a Time class which holds various times that the Update and Draw methods need to know. public class Time { public TimeSpan ElapsedVirtualTime { get; internal set; } public TimeSpan ElapsedRealTime { get; internal set; } public TimeSpan TotalVirtualTime { get; internal set; } public TimeSpan TotalRealTime { get; internal set; } internal Time() { } internal Time(TimeSpan elapsedVirtualTime, TimeSpan elapsedRealTime, TimeSpan totalVirutalTime, TimeSpan totalRealTime) { ElapsedVirtualTime = elapsedVirtualTime; ElapsedRealTime = elapsedRealTime; TotalVirtualTime = totalVirutalTime; TotalRealTime = totalRealTime; } } My main class keeps a single instance of Time, which it should constantly update during the game loop. So far, I have this: private static void Loop() { do { Clock.Tick(); Time.TotalRealTime = Clock.TotalTime; Time.ElapsedRealTime = Clock.ElapsedTime; InternalUpdate(Time); InternalDraw(Time); } while (!_exitRequested); } The real time properties of the time class turn out great. Now I'd like to get a proper update/draw loop working so that the state is updated a variable number of times per frame, but at a fixed timestep. At the same time, the Time.TotalVirtualTime and Time.ElapsedVirtualTime should be updated accordingly. In addition, I intend for this to support multiplayer in the future, in case that makes any difference to the design of the game loop. Any tips or examples on how I could go about implementing this (aside from links to articles)?

    Read the article

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