Search Results

Search found 1396 results on 56 pages for 'mr skid marks'.

Page 40/56 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Is return-type-(only)-polymorphism in Haskell a good thing?

    - by dainichi
    One thing that I've never quite come to terms with in Haskell is how you can have polymorphic constants and functions whose return type cannot be determined by their input type, like class Foo a where foo::Int -> a Some of the reasons that I do not like this: Referential transparency: "In Haskell, given the same input, a function will always return the same output", but is that really true? read "3" return 3 when used in an Int context, but throws an error when used in a, say, (Int,Int) context. Yes, you can argue that read is also taking a type parameter, but the implicitness of the type parameter makes it lose some of its beauty in my opinion. Monomorphism restriction: One of the most annoying things about Haskell. Correct me if I'm wrong, but the whole reason for the MR is that computation that looks shared might not be because the type parameter is implicit. Type defaulting: Again one of the most annoying things about Haskell. Happens e.g. if you pass the result of functions polymorphic in their output to functions polymorphic in their input. Again, correct me if I'm wrong, but this would not be necessary without functions whose return type cannot be determined by their input type (and polymorphic constants). So my question is (running the risk of being stamped as a "discussion quesion"): Would it be possible to create a Haskell-like language where the type checker disallows these kinds of definitions? If so, what would be the benefits/disadvantages of that restriction? I can see some immediate problems: If, say, 2 only had the type Integer, 2/3 wouldn't type check anymore with the current definition of /. But in this case, I think type classes with functional dependencies could come to the rescue (yes, I know that this is an extension). Furthermore, I think it is a lot more intuitive to have functions that can take different input types, than to have functions that are restricted in their input types, but we just pass polymorphic values to them. The typing of values like [] and Nothing seems to me like a tougher nut to crack. I haven't thought of a good way to handle them. I doubt I am the first person to have had thoughts like these. Does anybody have links to good discussions about this Haskell design decision and the pros/cons of it?

    Read the article

  • How can I tell if a CSV is in UTF-7 or UTF-8

    - by dru-zod
    Excel seems to save CSV files in (what I think is) UTF-7, despite the fact that most information I have read suggest that in general, you should not UTF-7. Indeed, other applications (Text pad, which lets me choose) save things in UTF-8 (or Unicode etc, but UTF-7 is not even an option). Using .NET, I read the stream, and have to provide the encoding. If I get it wrong, accented characters are replaced with question marks. If I try and let StreamReader work it out (using detectEncodingFromByteOrderMarks), it gets it wrong (at least, it does if the file has been saved in Excel). It is unlikely that anything other then Excel will be used, so I could just assume UTF-7. Are there any other options? I need to support French (accented), German, Dutch, and Norwegian characters.

    Read the article

  • How can I mark a group of changes/changesets in SVN, Hg, or Git

    - by sylvanaar
    I would like to mark an arbitrary group of commits/changesets with a label. Commit 1 *Mark 1 Commit 2 *Mark 2 Commit 3 Commit 4 *Mark 1 Commit 5 *Mark 2 The goal is to easily locate all the changes for a specific mark, and to have that grouping persisted in the VCS directly, as opposed to some outside system like a bug tracking system. The location and ordering of the marks needs to be arbitrary, and should be able to work with both committed/uncommitted and pushed/unpushed changes. In SVN the best way I know is to just edit the commit notes and add some sort of special text that you can search for e.g. "**Mark 1". Or just to make a fake edit and commit it and use its commit note to list all the included revisions. Is there a better solution for SVN? Are there equivalent or better solutions for Hg or Git?

    Read the article

  • Code folding for LaTeX in Emacs

    - by ShreevatsaR
    Is there an Emacs minor-mode (or piece of elisp code) that lets you selectively hide/show environments while in LaTeX mode? For instance, I would like to move to the beginning of a long \begin{figure} block, hit a keystroke, and have the contents of that figure environment hidden from view. Similarly with \begin{proof} and so on, and ideally even with \subsections. Is this possible? I just tried hs-minor-mode, allout-mode, and outline-minor-mode, but most of them don't recognize LaTeX's environments, e.g. hs-minor-mode fails with "scan error: unbalanced parentheses". I would prefer not to have to enter explicit folding marks like {{{ as in folding-mode. [Ideally it would be great if the folding were persistent, but I see that that question doesn't have an accepted answer yet.]

    Read the article

  • Efficient counting of an association’s association

    - by Matthew Robertson
    In my app, when a User makes a Comment in a Post, Notifications are generated that marks that comment as unread. class Notification < ActiveRecord::Base belongs_to :user belongs_to :post belongs_to :comment class User < ActiveRecord::Base has_many :notifications class Post < ActiveRecord::Base has_many :notifications I’m making an index page that lists all the posts for a user and the notification count for each post for just that user. # posts controller @posts = Post.where( :user_id => current_user.id ) .includes(:notifications) # posts view @posts.each do |post| <%= post.notifications.count %> This doesn’t work because it counts notifications for all users. What’s an efficient way to do this without running a separate query for each post?

    Read the article

  • asp:RadioButtonList doesn't set correct selected item on load

    - by Nir
    I have this code: <asp:RadioButtonList ID="rblExpDate" runat="server" > <asp:ListItem Selected="True" Text="No expiration date"></asp:ListItem> <asp:ListItem Text="Expires on:"></asp:ListItem> </asp:RadioButtonList> that I would like to be always, on page load, to mark the first option ("no expiration date"). However, if the user marks the second option and reloads, the second option is selected, even though I do this on page load: rblExpDate.Items[0].Selected = true; rblExpDate.SelectedIndex = 0; Appreciate your help!

    Read the article

  • Install app on Motorola Backflip from AT&T

    - by eric
    I'm trying to test an app out on the Motorola Backflip with AT&T as the carrier. I checked USB debugging on the phone's Development screen. Using Eclipse, how do I get the app to load on the Backflip so I can test it? DDMS shows a device with a bunch of question marks and unkown. Seems that it only gives me the option to load the app on the SD card which doesn't do me any good. I searched and found a Motorola driver which I'm supposed to install to the adb folder. Where is that folder? I've checked the phone and on my development machine. Maybe I need new glasses?

    Read the article

  • Proper indentation in array initialization, PDT/Zend Studio

    - by Sergei Stolyarov
    I'm using the following style of array initialization in the code: $a = array( 'one' => 123, 'two' => 456 ); But PDT/Zend Studio doesn't work properly in this case; after pressing [Return] key it places cursor under the $a (in my example) and ignores indentation. If array keys are numbers (at least not start with quotation marks) everything is working fine. This is how it works currently (| — is a position where edtitor places caret after pressing [Return]) $a = array( 'one' => 123,[RETURN] | ); This is expected result: $a = array( 'one' => 123,[RETURN] | ); So is it possible to force editor follow my indentation rules?

    Read the article

  • JQuery AJAX is not sending UTF-8 to my server, only in IE.

    - by alex
    I am sending UTF-8, japanese text, to my server. It works in Firefox. My access.log and headers are: /ajax/?q=%E6%BC%A2%E5%AD%97 Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Content-Type application/x-www-form-urlencoded; charset=UTF-8 Howeer, in IE8, my access.log says: /ajax/?q=?? For some reason, IE8 is turning my AJAX call into question marks. Why!? I added the scriptCharset and ContentType according to some tutorials, but still no luck. And this is my code: $.ajax({ >---method:"get", >---url:"/ajax/", scriptCharset: "utf-8" , contentType: "application/x-www-form-urlencoded; charset=UTF-8", >---data:"q="+query ... ...

    Read the article

  • Disable selected automated tests at runtime

    - by squig
    Is is posable to disable selected automated tests at runtime? I'm using VSTS and rhino mocks and have some intergation tests that require an external dependancy to be installed (MQ). Not all the developers on my team have this installed. Currently all the tests that require MQ inherit from a base class that checks if MQ is installed and if is not sets the test result to inconclusive. This works as it stops the tests from running, but marks the test run as unsuccseessful and can hide other failures. Any ideas?

    Read the article

  • noweb dpp filter and latex not printing curly braces

    - by Dervin Thunk
    Hello. Well, this smells like a tumbleweed, but I will ask it anyway. Suppose you have a noweb file with some c# code. You also have the c++ pretty-print filter dpp. If you run the command noweave -filter ./dpp -x test.nw > csharp.tex on the file below, it will print everything except for the curly braces. Instead of them, I get an em-dash and a closing quotations marks (i.e. ?) in the dvi. The tex source looks fine... Any ideas? @ C\# test file <<test.c>>= while( (a[right] >= pivot) && (left < right) ) { right--; }

    Read the article

  • casting raw strings python

    - by dave
    in python, given a variable which holds a string is there a quick way to cast that into another raw string variable? the following code should illustrate what im after... def checkEqual(x, y): print True if x==y else False line1 = "hurr..\n..durr" line2 = r"hurr..\n..durr" line3 = "%r"%line1 print "%s \n\n%s \n\n%s \n" % (line1, line2, line3) checkEqual(line2, line3) #outputs False checkEqual(line2, line3[1:-1]) #outputs True The closest I have found so far is the %r formatting flag which seems to return a raw string albeit within single quote marks. Is there any easier way to do this like a line3 = raw(line1) kind of thing?

    Read the article

  • Problem with pgfplot label

    - by harper
    I want to draw an x-y-diagram with axis labels. Unfortunately the ylabel is misplaced. It looks as depending on the actual data. When the other data line in the sample below is used instead of the upper line, it looks better. How can I move the label to the left or (more desirable) how can I tell pgfplot to do it corectly? % !TEX TS-program = pdflatex % !TEX encoding = UTF-8 Unicode \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture} \begin{axis}[width=13cm,height=8cm, xlabel={I in mA}, ylabel={U in mV}] \addplot[only marks,mark=star] coordinates { % (1.36, -0.0177) (45.38, 0.0273) (74.19, 0.0413) (100.88, 0.0533) (134.80, 0.0683) (195.27, 0.1073) }; \end{axis} \end{tikzpicture} \end{document}

    Read the article

  • Using pyodbc to insert rows into a MS Access MDB, how do I escape the paramaters?

    - by MDBGuy
    Hi, I'm using pyodbc to talk to a legacy Access 2000 .mdb file. I've got a cursor, and am trying to execute this: c.execute("INSERT INTO [Accounts] ([Name], [TypeID], [StatusID], [AccountCat], [id]) VALUES (?, ?, ?, ?, ?)", [u'test', 20, 10, 4, 2]) However, doing so results in pyodbc.Error: ('HYC00', '[HYC00] [Microsoft][ODBC Microsoft Access Driver]Optional feature not implemented (106) (SQLBindParameter)') I understand I can simply change the question marks to the literal values, but in my experience proper escaping of strings across databases is... not pretty. PHP and mysql team up to bring mysql_real_escape_string and friends, but I can't seem to find pyodbc's function for escaping values. If you could let me know what the recommended way of inserting this data (from python) is, that'd be very helpful. Alternatively, if you have a python function to escape the odbc strings, that would also be great. Thanks for the help.

    Read the article

  • Objective-C syntax

    - by mebFace
    I've been studying objective-c for a few days now. I keep coming across these two structures: NSString * somestring (NSString *) somestring I understand the first simply sets a pointer to an NSString object, but what does the second construct do, and when should I use it? What's the deal with the asterix marks? Sorry if this question doesn't make any sense, I am completely new to this language, and haven't even reached the level of asking proper questions. Main purpose -- I'm trying to decipher this method: -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger) row forComponent: (NSInteger)component *Also, the classes I chose don't matter. *

    Read the article

  • pyODBC and Unicode Problem

    - by Aviv Giladi
    Hey guys, I'm working with pyODBC communicate with a MS SQL 2005 Express server. The table to which i'm trying to save the data consists of nvarchar columns. query = u"INSERT INTO tblPersons (name, birthday, gender) VALUES('" query = query + name + u"', '" query = query + birthday + u"', '" query = query + gender + u"')" cur.execute(query ) The variables name, birthrday and gende are read from an Excel file and they are Unicode strings. When I execute the query and either look at the table with SQL Server Management Studio or execute a query that fetches the data that was just inserted, all the data that was written in a non-English languages turn into question marks. The data that was written in English is preserved and appears in the table in the correct way. I tried adding CHARSET=UTF16 to my connection string, but had no luck with that. I can use UTF-8 which works fine but as a working convention, I need all the data saved in my DB to be UTF16. Thanks!

    Read the article

  • Using Parallel Extensions with ThreadStatic attribute. Could it leak memory?

    - by the-locster
    I'm using Parallel Extensions fairly heavily and I've just now encountered a case where using thread locla storrage might be sensible to allow re-use of objects by worker threads. As such I was lookign at the ThreadStatic attribute which marks a static field/variable as having a unique value per thread. It seems to me that it would be unwise to use PE with the ThreadStatic attribute without any guarantee of thread re-use by PE. That is, if threads are created and destroyed to some degree would the variables (and thus objects they point to) remain in thread local storage for some indeterminate amount of time, thus causing a memory leak? Or perhaps the thread storage is tied to the threads and disposed of when the threads are disposed? But then you still potentially have threads in a pool that are longed lived and that accumulate thread local storage from various pieces of code the threads are used for. Is there a better approach to obtaining thread local storage with PE? Thankyou.

    Read the article

  • .NET PostSubmitter sends backslashes

    - by Stefan N.
    Hi, I'm using C# to send JSON to a PHP-Script, like this: string json = "{"; json += "\"prop\":\"some text\""; json += "}"; PostSubmitter post = new PostSubmitter(); post.Url = "http://localhost/synch/notein.php"; post.Type = PostSubmitter.PostTypeEnum.Post; post.PostItems.Add("note", json); post.Post(); Of course I'll have to escape the inner quotes, but they get sended to the script! To make things worse: There is text, which already has quotation marks, so those must be escaped to be valid JSON. In this case I want the backslashes to be transmitted. Any idea to accomplish this?

    Read the article

  • Perl TDS character sets

    - by skiphoppy
    I'm using the FreeTDS driver with DBD::Sybase, connecting to an MS SQL Server. When I query certain values of certain records, I get this error: DBD::Sybase::st fetchrow_arrayref failed: OpenClient message: LAYER = (0) ORIGIN = (0) SEVERITY = (9) NUMBER = (99) Server , database Message String: WARNING! Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks ('?'). This seems to happen for records that contain special Windows character-set characters, such as curly quotes, copied and pasted from people's Outlook and Word messages. Unfortunately, I do not have any control of this database; sanitizing the input on the way in is obviously the way to go, but is not available to me. What FreeTDS settings do I need to change to be able to successfully query these records?

    Read the article

  • How can I extract URLs from plain text with Perl?

    - by Russell C.
    I need the Perl regex to parse plain text input and convert all links to valid HTML HREF links. I've tried 10 different versions I found on the web but none of them seen to work correctly. I also tested other solutions posted on StackOverflow, none of which seem to work. The correct solution should be able to find any URL in the plain text input and convert it to: <a href="$1">$1</a> Some cases other regular expressions I tried didn't handle correctly include: URLs at the end of a line which are followed by returns URLs that included question marks URLs that start with 'https' I'm hoping that another Perl guy out there will already have a regular expression they are using for this that they can share. Thanks in advance for your help!

    Read the article

  • Tricky string transformation (hopefully) in LINQ

    - by Larsenal
    I'm hoping for a concise way to perform the following transformation. I want to transform song lyrics. The input will look something like this: Verse 1 lyrics line 1 Verse 1 lyrics line 2 Verse 1 lyrics line 3 Verse 1 lyrics line 4 Verse 2 lyrics line 1 Verse 2 lyrics line 2 Verse 2 lyrics line 3 Verse 2 lyrics line 4 And I want to transform them so the first line of each verse is grouped together as in: Verse 1 lyrics line 1 Verse 2 lyrics line 1 Verse 1 lyrics line 2 Verse 2 lyrics line 2 Verse 1 lyrics line 3 Verse 2 lyrics line 3 Verse 1 lyrics line 4 Verse 2 lyrics line 4 Lyrics will obviously be unknown, but the blank line marks a division between verses in the input.

    Read the article

  • Sharepoint Designer Workflow with multiple tasks in sequence

    - by Triangle Man
    I have a multi-step Sharepoint workflow in task list A that starts when a new task is created in that list and creates a task in another list, B. When that task in list B is completed, I would like the workflow in list A to create another task in list C. I am using Sharepoint Designer 2007 to build all of this and at the moment I have this represented by multiple steps. So, step one is to create the task in the other list, and store its ID as a variable. Step 2 is conditional on a value in the task created by step one being marked complete, and it creates a task in the next list, and so on. However, when I run the workflow, it marks its status as complete as soon as the item in the first list is completed, and does not go on to create the task outlined in Step 2 of the workflow. I would like to know why the workflow is marking itself complete at the end of step one, and why the subsequent steps are not executed. Thanks in advance for your help.

    Read the article

  • Bad interpreter: No such file or directory

    - by user1497462
    I'm working through Michael Hartl's tutorial trying to learn Rails for the first time, and I've run into some issues. I recently reinstalled the whole Rails Installer because I had apparently inadvertently deleted some important files. Now, when I try running a test I get the following error: sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre ter: No such file or directory I checked my PATH and attempted to use the solution outlined here: Bundle command not found. Bad Interpreter ..but putting quotation marks around "C:\Program Files (x86)\ruby-1.9.3\bin" didn't do anything for me. I ran $ rails -v and got the following output: $ rails -v ?[31mCould not find multi_json-1.3.6 in any of the sources?[0m ?[33mRun `bundle install` to install missing gems.?[0m So then I tried running $bundle install and got the following issue again: Tom@TOM-PC /c/sample_app (updating-users) $ bundle install sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre ter: No such file or directory I'd really appreciate any help -- I've spent 5+ hours today trying to get back on track and am still at a loss. Thanks!

    Read the article

  • Open Source Queuing Solutions for peek, mark as done and then remove

    - by user330114
    I am looking at open source queuing platforms that allow me do the following: I have multiple producers, multiple consumers putting data into a queue in a multithreaded environment with the specific use case: I want the ability for consumers to be able do the following Peek at a message from the queue(which should mark as the message as invisible on the queue so that other consumers cannot consume the same message) The consumer works on the message consumed and if it is able to do the work successfully, it marks the message as consumed which should permanently delete it from the queue. If the consumer dies abruptly after marking the message as consumed or fails to acknowledge successful consumption after a certain timeout, the message is made visible on the queue again so that another consumer can pick it up. I've been looking at RabbitMQ, hornetQ, ActiveMQ but I'm not sure I can get this functionality out of the box, any recommendations on a system that gives me this functionality?

    Read the article

  • sending mail using mutt + emacs

    - by lakshmipathi
    How to sent mail from emacs? I have add from address and subject and trapped inside emacs I found this There are two ways to send the message. C-c C-s (mail-send) sends the message and marks the mail buffer unmodified, but leaves that buffer selected so that you can modify the message (perhaps with new recipients) and send it again. C-c C-c (mail-send-and-exit) sends and then deletes the window or switches to another buffer But both ( ctrl+c ctrl+s ) and (ctrl-c crtl+c) are not working ps:Thought it's not programming related. it's programmer environment related question-hoping it won't be closed :)

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >