Search Results

Search found 15210 results on 609 pages for 'technical writing'.

Page 108/609 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • making a programming language

    - by None
    I was wondering which way would create a faster programming language, because I have tried both. Writing code that takes the text, splits it by whitespace or newlines or something, then processes each line and has a dictionary for variables. Or writing code that takes text and converts it to another programming language. This is an example of how a very simple version of the first way would be programmed in python: def run(code): text = code.split(";") for t in text: if t == "hello": print "hi" second: def run(code): rcode = "" text = code.split(";") for t in text: if t == "hello": rcode += "print 'hi'"

    Read the article

  • Communicate between service and winform

    - by Richard Tivey
    I could do with a bit of help with a windows service im writing in c#. The service basically just runs various tasks on a schedule. It has 3 main sections: a class which contains everything for the task (config, code to be executed when it runs, etc), the service which contains instances of the tasks, running them on a timer and a windows form which is used to configure the settings for the task. The question I have is would it be possible to reference the service from the Winform whilst the service is running? Ultimately I want to be able to open the Winform and see a live status of what the service is currently doing. I've considered writing something network related to get around it but it didn't seem correct considering that both processes would be on the same machine.

    Read the article

  • Where can I find an array of the unassigned Unicode code points for a particular block?

    - by gitparade
    At the moment, I'm writing these arrays by hand. For example, the Miscellaneous Mathematical Symbols-A block has an entry in hash like this: my %symbols = ( ... miscellaneous_mathematical_symbols_a => [(0x27C0..0x27CA), 0x27CC, (0x27D0..0x27EF)], ... ) The simpler, 'continuous' array miscellaneous_mathematical_symbols_a => [0x27C0..0x27EF] doesn't work because Unicode blocks have holes in them. For example, there's nothing at 0x27CB. Take a look at the code chart [PDF]. Writing these arrays by hand is tedious, error-prone and a bit fun. And I get the feeling that someone has already tackled this in Perl!

    Read the article

  • Twitter oauth php problems

    - by Patrick Gates
    I'm writing some backend script for a twitter app and heres how it's going On the app you click a button that sends you to login.php on my server which logs into my database connects to twitter with my consumer key and secret: $to = new TwitterOAuth($consumer_key, $consumer_secret); $tok = $to->getRequestToken(); $request_link = $to->getAuthorizeURL($tok); and then writes the token and secret to the database, sets a session equal to the id in the database of the token and secret and then redirects to the "$request_link" You then go through the process of logging in and such on twitter and it redirects you to callback.php on my server Callback.php consists of logging into the database again, getting the new token and secret, and then writing the new token and secret to the database and then prompts you to go back to the app Then on the app, all I'm trying to do is access the basic credentials$to->get('account/verify_credentials') and it keeps coming back "could not authenticate you" What am I doing wrong?? Thank you for all the help :)

    Read the article

  • Error handling in controllers with MVC

    - by twrn
    Does it make sense to do error handling and logging inside actions methods or handle the OnException method inside the controllers. One way means writing try/catches in all the action methods even when there is nothing to be done to recover from the error. Handling this at the controller level would allow logging and redirection to an error handler page without writing try/catches inside all the action methods. Which method makes the most sense? Here is example code of try/catches in an action method. [HttpPost] public ActionResult Delete(int id) { using (new Tracer("Project Controller")) { try { Logger.Write("Deleting project"); projService.DeleteProject(id); TempData["message"] = "Project Deleted successfully"; } catch (System.Exception ex) { HandleException(ex, "Project could not be deleted."); } return RedirectToAction("List"); } }

    Read the article

  • Why can't a bind linux service to the loop-back only?

    - by Jon Trauntvein
    I am writing a server application that will provide a service on an ephemeral port that I only want accessible on the loopback interface. In order to do this, I am writing code like the following: struct sockaddr_in bind_addr; memset(&bind_addr,0,sizeof(bind_addr)); bind_addr.sin_family = AF_INET; bind_addr.sin_port = 0; bind_addr.sin_addr.s_addr = htonl(inet_addr("127.0.0.1")); rcd = ::bind( socket_handle, reinterpret_cast<struct sockaddr *>(&bind_addr), sizeof(bind_addr)); The return value for this call to bind() is -1 and the value of errno is 99 (Cannot assign requested address). Is this failing because inet_addr() already returns its result in network order or is there some other reason?

    Read the article

  • Where can I find an array of the (un)assigned Unicode code points for a particular block?

    - by gitparade
    At the moment, I'm writing these arrays by hand. For example, the Miscellaneous Mathematical Symbols-A block has an entry in hash like this: my %symbols = ( ... miscellaneous_mathematical_symbols_a => [(0x27C0..0x27CA), 0x27CC, (0x27D0..0x27EF)], ... ) The simpler, 'continuous' array miscellaneous_mathematical_symbols_a => [0x27C0..0x27EF] doesn't work because Unicode blocks have holes in them. For example, there's nothing at 0x27CB. Take a look at the code chart [PDF]. Writing these arrays by hand is tedious, error-prone and a bit fun. And I get the feeling that someone has already tackled this in Perl!

    Read the article

  • PHP , What is the difference between fopen r+ and r ! does it matter if i used r+ when not intending

    - by Naughty.Coder
    when I use fopen function , why don't I use r+ always , even when I'm not going to write any thing ... is there a reason for separating writing/reading process from only reading .. like , the file is locked for reading when I use r+ , because i might write new data into it or something ... another question : in php manual a+ : Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it. What is supposed to be read if you are at the end of the file ..(pointer at the end) !!? where to learn more about the filesystem thing .... it's confusing

    Read the article

  • Difference between User Control and Custom Control Library

    - by Rod
    I'm working on creating a date/time user control in WPF using C# 2008. My first user control. I'm also using Matthew MacDonald's book, "Pro WPF in C# 2008". In that book he strongly recommended creating a user control using the WPF Custom Control Library project template; so I followed his suggestion. I've finished writing the code which would go into what I think of as the code-behind file. Now I'm ready to write the XAML. The only problem is, I just discovered there is no corresponding .xaml file? So, I don't get why using a WPF Custom Control Library project is better, or prefered, when writing a user control?

    Read the article

  • Why have private fields in data contracts modified through public ones?

    - by Nordvind
    When you make a new WCF project, sample service is generated for you. The default data contract is (I've just changed the string type field title): [DataContract] public class CompositeType { bool boolValue = true; string name = ""; [DataMember] public bool BoolValue { get { return boolValue; } set { boolValue = value; } } [DataMember] public string Name { get { return name; } set { name = value; } } } What is the point of having those private fields boolValue and name? Is it a good practice writing some data sanitizing or some other manipulations in contract, thus bloating it? It seems the only sane reason for me not writing to fields directly. So is it a bloatware or it has some reason behind it?

    Read the article

  • Can an appdomain in C# be restricted to one directory?

    - by Caerbanog
    I am developing a plugin host. The plugins should have as little trust as they need, however I want to have the possibility for a plugin to read and write files. Can the AppDomain where the assembly will be loaded be restricted to have access to only one directory for reading and writing? Other options and ways to go about this are also appreciated like for example easy ways to stream file data from the host to the plugin (reading) and from the plugin to the host (writing). If its relevant: I am using the MAF infrastructure for the plugins. http://msdn.microsoft.com/en-us/library/bb384200.aspx

    Read the article

  • Localizing a JSF 1.2 application with UTF-8 resources

    - by Filini
    (WARNING: this is my first java application, coming from .NET, so don't bash me if I write too much garbage) I'm developing a simple JSF 1.2 web application which should support Russian, Chinese, and other languages outside ISO 8859-1, which is automatically used in Properties.load(). Is there a way to use the Properties loaded from XML files, with Properties.loadFromXml(), inside JSF, without writing too much code? I know there are alternative ways to do so (writing my own loader, escaping the characters...), but I'd really love to find a simple solution, and I don't see it in all the forums I checked. Thanks in advance for any help

    Read the article

  • f# string.Format

    - by mamu
    I am writing my first f# library i am trying to use string.Format and it complains that no such function Is it not available or am i doing something wrong

    Read the article

  • Overhead of serving pages - JSPs vs. PHP vs. ASPXs vs. C

    - by John Shedletsky
    I am interested in writing my own internet ad server. I want to serve billions of impressions with as little hardware possible. Which server-side technologies are best suited for this task? I am asking about the relative overhead of serving my ad pages as either pages rendered by PHP, or Java, or .net, or coding Http responses directly in C and writing some multi-socket IO monster to serve requests (I assume this one wins, but if my assumption is wrong, that would actually be most interesting). Obviously all the most efficient optimizations are done at the algorithm level, but I figure there has got to be some speed differences at the end of the day that makes one method of serving ads better than another. How much overhead does something like apache or IIS introduce? There's got to be a ton of extra junk in there I don't need. At some point I guess this is more a question of which platform/language combo is best suited - please excuse the in-adroitly posed question, hopefully you understand what I am trying to get at.

    Read the article

  • Ruby Metaprogramming

    - by Veerendra Manikonda
    I am having a method which returns the price of a given symbol and i am writing a test for that method. This is my test def setup @asset = NetAssetValue.new end def test_retrieve_price_for_symbol_YHOO assert_equal(33.987, @asset.retrieve_price_for_a_symbol('YHOO')) end def test_retrive_price_for_YHOO def self.retrieve_price_for_a_symbol(symbol) 33.77 end assert_equal(33.97, @asset.retrieve_price_for_a_symbol('YHOO')) end This is my method. def retrieve_price_for_a_symbol(symbol) symbol_price = { "YHOO" => 33.987, "UPS" => 35.345, "T" => 80.90 } raise Exception if(symbol_price[symbol].nil?) symbol_price[symbol] end I am trying to mock the retrieve_price_for_a_symbol method by writing same method in test class but when i call it, the call is happening to method in main class not in the test class. How do I add that method to meta class from test and how do i call it? Please help.

    Read the article

  • Are there design-time watch windows for Visual Studio 2008/2010?

    - by Jeff
    There are many times when I need to test a little snippet of .net code but rebuilding and publishing the entire project or writing a suite of unit tests just seems like overkill. For example, I am writing a regular expression right now and I want to see if it the pattern is matching on the right parts. I could go and find a million other utilities that do that sort of thing, but that is not exactly my point. FireBug has an exact analogue to what I want - the FireBug console. There is a text box where the user can enter some JavaScript and FireBug will execute it on the spot and display the return value. I would love to be able to enter something like (new Regex("b+")).Replace("abc", "x") and see the results without having to do all the overhead. Does VS have anything like this?

    Read the article

  • How can I give some basic text editing functionality to a firefox plugin?

    - by roddik
    Hello. I'm writing a plugin to Firefox, which is basically a sidebar, that is filled with yaml-formatted information based on what user does on the page (just another web testing solution). I want to enable user to change generated text manually right in the sidebar and: Add code-folding (folding click: \n text: some text to a single line) Add highlighting of registered actions (click, fill and so on) and unregistered actions (syntax errors) How do I do that? Is placing an iframe to the sidebar and trying to do that with html/js the best solution (seen it in a similar one)? As you may have noticed, I'm a newbie in plugin writing, so please excuse if anything.

    Read the article

  • How to do visible EditText Data on Activity change

    - by user1249134
    HellO friends i am having edit text in my program and if i am writing some thing on there and if i am clciking on other option which will move to anothe activity and when i am coming back to same page the data of my edit text is clearing i dont want to clear data if i move on another page can any body tell me how to do it ..i am doing it by writing below code.. if(PresetQuestion.value=="true") { String note1=note.getText().toString(); note.setText(note1); } but its not woring i thing i am not doing correctly ...

    Read the article

  • Tests that are 2-3 times bigger than the testable code

    - by HeavyWave
    Is it normal to have tests that are way bigger than the actual code being tested? For every line of code I am testing I usually have 2-3 lines in the unit test. Which ultimately leads to tons of time being spent just typing the tests in (mock, mock and mock more). Where are the time savings? Do you ever avoid tests for code that is along the lines of being trivial? Most of my methods are less than 10 lines long and testing each one of them takes a lot of time, to the point where, as you see, I start questioning writing most of the tests in the first place. I am not advocating not unit testing, I like it. Just want to see what factors people consider before writing tests. They come at a cost (in terms of time, hence money), so this cost must be evaluated somehow. How do you estimate the savings created by your unit tests, if ever?

    Read the article

  • Efficient way to access a mapping of identifiers in Python

    - by sixbelo
    I am writing an app to do a file conversion and part of that is replacing old account numbers with a new account numbers. Right now I have a CSV file mapping the old and new account numbers with around 30K records. I read this in and store it as dict and when writing the new file grab the new account from the dict by key. My question is what is the best way to do this if the CSV file increases to 100K+ records? Would it be more efficient to convert the account mappings from a CSV to a sqlite database rather than storing them as a dict in memory?

    Read the article

  • ' \r ' vs ' \n ' in C

    - by MCP
    I'm writing a function that basically waits for the user to hit "enter" and then does something. What I've found that works when testing is the below: #include <stdio.h> int main() { int x = getc(stdin); if (x == '\n') { printf("carriage return"); printf("\n"); } else { printf("missed it"); printf("\n"); } } The question I have, and what I tried at first was to do: "if (x == '\r')" but in testing, the program didn't catch me hitting enter. The '\n' seems to correspond to me hitting enter from the console. Can someone explain the difference? Also, to verify, writing it as "if... == "\n"" would mean the character string literal? Ie the user would literally have to enter "\n" from the console, correct? Thanks!

    Read the article

  • Is pthread_spin_trylock safe inside of sigsegv handler of multithreaded application?

    - by TWMouton
    I am trying to implement a handler that on SIGSEGV will collect some information such as process-id, thread-id and a backtrace and write this information to a file/pipe/socket. The problem lies in that there is the (probably pretty high) possibility that if one thread experienced a SIGSEGV that the others will shortly follow. If two threads happen to make it to the bit of code where they're writing their report out at the same time then they'll interleave their writing (to the same file). I know that I should only be using async-signal-safe functions as detailed in signal(7) I also have seen at least two cases here and video linked in top answer here where others have used pthread_spin_trylock to get around this problem. Is this a safe way to prevent the above problem?

    Read the article

  • FTP: check whether file is closed

    - by Andrey
    Hello! My FTP client (apache commons ftpclient) needs to download file from FTP. The problem is that an external service may not have finished writing to this file before I start downloading. Is there any way to determine via FTP whether the file is already closed (i.e. there is no writing handlers opened)? The problem is that I cannot synchronize with that external service. But I mustn't download file which is not finished yet (a large JPEG). Thanks in advance!

    Read the article

  • Any custom/third party Visual C# text box Controls with extra features?

    - by PlaZmaZ
    I'm writing a program that uses the textbox in visual C# to read a log file. When dealing with very large amounts of text, writing to the textbox is incredibly slow. The textbox also lacks many features. Are there any custom textbox controls that are faster, or even a sort of embedded editor (with ability to highlight certain words, indent, input bookmarks)? Many of the features I want are programmable, but it would be nice if there was a faster textbox or one that already had these features :) Thanks.

    Read the article

  • Python 2.6 - I can not write dwords greater than 0x7fffffff into registry using _winreg.SetValueEx()

    - by stasizke
    using regedit.exe I have manually created a key in registry called HKEY_CURRENT_USER/00_Just_a_Test_Key and created two dword values dword_test_1 and dword_test_2 I am trying to write some values into those two keys using following program import _winreg aReg = _winreg.ConnectRegistry(None,_winreg.HKEY_CURRENT_USER) aKey = _winreg.OpenKey(aReg, r"00_Just_a_Test_Key", 0, _winreg.KEY_WRITE) _winreg.SetValueEx(aKey,"dword_test_1",0, _winreg.REG_DWORD, 0x0edcba98) _winreg.SetValueEx(aKey,"dword_test_2",0, _winreg.REG_DWORD, 0xfedcba98) _winreg.CloseKey(aKey) _winreg.CloseKey(aReg) I can write into the first key, dword_test_1, but when I attempt to write into the second, I get following message Traceback (most recent call last): File "D:/src/registry/question.py", line 7, in <module> _winreg.SetValueEx(aKey,"dword_test_2",0, _winreg.REG_DWORD, 0xfedcba98) ValueError: Could not convert the data to the specified type. How do I write the second value 0xfedcba98, or any value greater than 0x7fffffff as a dword value? Originally I was writing script to switch the "My documents" icon on or off by writing "0xf0500174" to hide or "0xf0400174" to display the icon into [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID{450D8FBA-AD25-11D0-98A8-0800361B1103}\ShellFolder]

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >