instruction
stringlengths
0
30k
|wpf|
I've done some WPF programing and one thing I never got was the command pattern. Every example seems to be for built in ones, edit, cut, paste. Anyone have an example or suggestion of best practice for custom commands?
I believe you need to add a section with <Directory "/home/other_files"> (options) </Directory> to your server configuration before apache will be able to serve anything from it. For an example, my DocumentRoot is /var/www but there is this section in the default available site: Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> You could then rewrite a URL to go to /doc/ and the server would know where to get the files from.
Flags allow you to use bitmasking inside your enumeration. This allows you to combine enumeration values, while retaining which ones are specified. <pre><Code> [Flags] public enum DashboardItemPresentationProperties : long { None = 0, HideCollapse = 1, HideDelete = 2, HideEdit = 4, HideOpenInNewWindow = 8, HideResetSource = 16, HideMenu = 32 } </code></pre>
It's a fairly simple process. Take a function, bind one of its arguments and return a new function. For example: let concatStrings left right = left + right let makeCommandPrompt= appendString "c:\> " Now by currying the simple concatStrings function, you can easily add a DOS style command prompt to the front of any string! Really useful! Okay, not really. A more useful case I find is when I want to have a make a function that returns me data in a stream like manner. let readDWORD array i = array[i] | array[i + 1] << 8 | array[i + 2] << 16 | array[i + 3] << 24 //I've actually used this function in Python. The convenient part about it is that rather than creating an entire class for this sort of thing, calling the constructor, calling obj.readDWORD(), you just have a function that can't be mutated out from under you.
Is the number of extra bytes you need equal to the number of lines in the file? I ask because perhaps its possible that somehow carriage-returns are being introduced but not counted.
We recently went through this in my organization. Although it is not the best solution, and hitting the right session across multiple browser windows is rough, we put a countdown timer on our page, included a button that just went back and hit the server to restart the session, and also provided the user with a JavaScript popup (the user's favorite part of the solution) with a message saying that the session was, say, five minutes from timing out and to hit the "OK" button to restart. Then the button would hit the server to restart the session, restart the timer on the base page, close the popup and the base page didn't need to be refreshed at all.
I've always had the most success using PDFs to accomplish this. I can't think of a more universally acceptable format that does what you are trying to do. Rather than looking for another format, perhaps it would be better to try to understand how to overcome the problems that you are experiencing with Acrobat on the client side. Can you provide some more information on the types of problems that you are experiencing with Acrobat?
If you are using a SQL browsing tool like TOAD or TORA it will help you with ORA errors by highlightling or pointing moving the cursor to where you made your error. Copy and paste your SQL in to one of these tools to help. You may also find the analyse info available useful too.
Have the browser ping the server via Ajax periodically to keep the session alive. Most sites do something useful in this ping, like save a draft of the user's submission.
How are you getting the number of bytes? .. By looking at the size of the file on the filesystem? You can use "-s" to get the size of the file. Or, if you want to do more, you may use [File::Stat](http://search.cpan.org/~rgarcia/perl-5.10.0/lib/File/stat.pm)
I think by 'cleanly' you mean like with a 300 redirect. Config for a lot of servers & languages [here][1]. [1]: http://www.somacon.com/p145.php
DELETE FROM Table WHERE ID NOT IN (SELECT TOP 10 ID FROM Table)?
DELETE FROM Table WHERE ID NOT IN (SELECT TOP 10 ID FROM Table)? Edit: Chris brings up a good performance hit since the TOP 10 query would be run for each row. If this is a one time thing, then it may not be as big of a deal, but if it is a common thing, then I'd look closer at it.
In your accepted answer you should add parenthesis around the 'b' in the macro expansion (I don't have enough points yet to edit other's content): #define BOOL_STR(b) ((b)?"true":"false") This is a [defensive programming][1] technique that protects against hidden order-of-operations errors; i.e., how does this evaluate for *all* compilers? 1 == 2 ? "true" : "false" compared to (1 == 2) ? "true" : "false" [1]: http://www.embedded.com/1999/9912/9912feat1.htm
If you decide to use macros (or are using C on a future project) you should add parenthesis around the 'b' in the macro expansion (I don't have enough points yet to edit other people's content): #define BOOL_STR(b) ((b)?"true":"false") This is a [defensive programming][1] technique that protects against hidden order-of-operations errors; i.e., how does this evaluate for *all* compilers? 1 == 2 ? "true" : "false" compared to (1 == 2) ? "true" : "false" [1]: http://www.embedded.com/1999/9912/9912feat1.htm
One way to differentiate is that "business logic" is something the customer would care about and that could be explained to a customer without referring to computer-specific words.
Specifically in Visual Studio go to "Tools-Options" then Select "Source Control-visual Studio Team Founation Server" and check the "Show deleted items in the Source Control explorer". Having done that - you can then right click a folder and say "Undelete"
How do you get double-underscores to display in markdown?
|markdown|
In python, there are some special variables and filenames that are surrounded by double-underscores. For example, there is the __file__ variable. I am only able to get them to show up correctly inside of a code block. What do I need to enter to get double underscores in regular text without having them interpreted as an emphasis?
[According to MSDN][1]: > [The `Project`] statement contains the > unique project GUID and the project > type GUID. This information is used by > the environment to find the project > file or files belonging to the > solution, and the VSPackage required > for each project. The project GUID is > passed to IVsProjectFactory to load > the specific VSPackage related to the > project, then the project is loaded by > the VSPackage. [1]: http://msdn.microsoft.com/en-us/library/bb165951(VS.80).aspx
Neither GUID is the same GUID as from AssemblyInfo.cs (that is the GUID for the assembly itself, not tied to Visual Studio but the end product of the build). So, for a typical line in the sln file (open the .sln in notepad or editor-of-choice if you wish to see this): Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleSandbox", "ConsoleSandbox\ConsoleSandbox.csproj", "{55A1FD06-FB00-4F8A-9153-C432357F5CAC}" The second GUID is a unique GUID for the project itself. The solution file uses this to map other settings to that project: GlobalSection(ProjectConfigurationPlatforms) = postSolution {55A1FD06-FB00-4F8A-9153-C432357F5CAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {55A1FD06-FB00-4F8A-9153-C432357F5CAC}.Debug|Any CPU.Build.0 = Debug|Any CPU {55A1FD06-FB00-4F8A-9153-C432357F5CAC}.Release|Any CPU.ActiveCfg = Release|Any CPU {55A1FD06-FB00-4F8A-9153-C432357F5CAC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection The first GUID is actually a GUID that is the unique GUID for the solution itself (I believe). If you have a solution with more than one project, you'll actually see something like the following: Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleSandbox", "ConsoleSandbox\ConsoleSandbox.csproj", "{55A1FD06-FB00-4F8A-9153-C432357F5CAC}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Composite", "..\CompositeWPF\Source\CAL\Composite\Composite.csproj", "{77138947-1D13-4E22-AEE0-5D0DD046CA34}" EndProject
I wound up writing a .net c# UI to deal with the xml data. Using xsl for display and an xml schema helped display the xml nicely and maintain it's integrity. edit: Also c# contains the xmldocument class that simplefies reading/writing the data.
Yes your insight is correct. This is called [dynamic programming][1]. It is usually a common memory runtime trade-off. In the case of fibo, you don't even need to cache everything : [edit] The author of the question seems to be looking for a general method to cache rather than a method to compute Fibonacci. Search wikipedia or look at the code of the other poster to get this answer. Those answers are linear in time and memory. **Here is a linear-time algorithm O(n), constant in memory ** in OCaml: let rec fibo n = let rec aux = fun | 0 -> (1,1) | n -> let (cur, prec) = aux (n-1) in (cur+prec, cur) let (cur,prec) = aux n in prec;; in C++: int fibo(int n) { if (n == 0 ) return 1; if (n == 1 ) return 1; int p = fibo(0); int c = fibo(1); int buff = 0; for (int i=1; i < n; ++i) { buff = c; c = p+c; p = buff; }; return c; }; This perform in linear time. But log is actually possible !!! Roo's program is linear too, but way slower, and use memory. **Here is the log algorithm O(log(n))** Now for the log-time algorithm (way way way faster), here is a method : If you know u(n), u(n-1), computing u(n+1), u(n) can be done by applying a matrix: | u(n+1) | = | 1 1 | | u(n) | | u(n) | | 1 0 | | u(n-1) | So that you have : | u(n) | = | 1 1 |^(n-1) | u(1) | = | 1 1 |^(n-1) | 1 | | u(n-1) | | 1 0 | | u(0) | | 1 0 | | 1 | Computing the exponential of the matrix has a logarithmic complexity. Just implement recursively the idea : M^(0) = Id M^(2p+1) = (M^2p) * M M^(2p) = (M^p) * (M^p) // of course don't compute M^p twice here. You can also just diagonalize it (not to difficult), you will find the gold number and its conjugate in its eigenvalue, and the result will give you an EXACT mathematical formula for u(n). It contains powers of those eigenvalues, so that the complexity will still be logarithmic. *Fibo is often taken as an example to illustrate Dynamic Programming, but as you see, it is not really pertinent.* @John: I don't think it has anything to do with do with hash. @John2: A map is a bit general don't you think? For Fibonacci case, all the keys are contiguous so that a vector is appropriate, once again there are much faster ways to compute fibo sequence, see my code sample over there. [1]: http://en.wikipedia.org/wiki/Dynamic_programming
The IRC Specification is laid out in RFC 1459 http://www.irchelp.org/irchelp/rfc/rfc.html
I used a [much less complicated version recently][1] with [jQuery][2]: <script src="scripts/jquery.js" type="text/javascript"></script> <script type="text/javascript">//<![CDATA[ var js = ["scripts/jquery.dimensions.js", "scripts/shadedborder.js", "scripts/jqmodal.js", "scripts/main.js"]; var $head = $("head"); for (var i = 0; i < js.length; i++) $head.append("<script src=\"" + js[i] + "\" type=\"text/javascript\"></scr" + "ipt>"); //]]></script> It worked great in every browser I tested it in: IE6/7, Firefox, Safari, Opera. [1]: http://gist.github.com/4102 [2]: http://jquery.com/
Is It Possible To Raise An Event When A File Becomes Accessible?
Flex MVC Frameworks
|apache-flex|model-view-controller|framework|
I'm currently using and enjoying using the Flex MVC framework [PureMVC][1]. I have heard some good things about Cairngorm, which is supported by Adobe and has first-to-market momentum. And there is a new player called Mate, which has a good deal of buzz. Has anyone tried two or three of these frameworks and formed an opinion? Thanks! [1]: http://www.puremvc.org
|apache-flex|model-view-controller|frameworks|
Esacping XML tag contents
|.net|xml|framework|escaping|encode|
I have a simple CAML query like <Where><Eq><Field="FieldName"><Value Type="Text">Value text</Value></Field></Eq></Where> And I have a variable to substitute for "Value text". What's the best way to validate/escape the text that is substituted here in the .NET framework? I've done a quick web search on this problem but all what I found was [System.Xml.Convert](http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.aspx) class but this seems to be not quite what I need here. I no I could have gone with an XmlWriter here, but it seems like a lot of code for such a simple task where I just need to make sure that "Value text" part is formatted well.
I have a simple CAML query like <Where><Eq><Field="FieldName"><Value Type="Text">Value text</Value></Field></Eq></Where> And I have a variable to substitute for "Value text". What's the best way to validate/escape the text that is substituted here in the .NET framework? I've done a quick web search on this problem but all what I found was [System.Xml.Convert](http://msdn.microsoft.com/en-us/library/system.xml.xmlconvert.aspx) class but this seems to be not quite what I need here. I know I could have gone with an XmlWriter here, but it seems like a lot of code for such a simple task where I just need to make sure that the "Value text" part is formatted well.
Escaping XML tag contents
|.net|xml|frameworks|escaping|encode|
ASP.NET MVC and Spring.NET
|asp.net-mvc|framework|spring.net|
Starting a new project and would like to use one of the MVC framworks. [ASP.NET MVC][1] is still in preview but [Spring.net][2] is in production and has a history with Java. I'd like to know the general lowdown between the two. Current questions.. What are the major feature differences? What about deployment/hosting issues? Future support? Do you think Spring.net will fade once ASP.NET MVC is in production. Current Support? I saw the Jeff twitting about a breaking change in the next preview. Thanks! [1]: http://www.asp.net/mvc/ [2]: http://springframework.net/
|asp.net-mvc|frameworks|spring.net|
Conventions for Perl Test::More module
I have an asp.net page with an asp:button that is not visible. I cant turn it visible with javascript because its not rendered to the page. What are my alternatives to solve this? Thanks in advance, Artur
If you wait until the page is loaded, and then set the button's display to none, that should work. Then you can make it visible at a later point.
I would like a recommendation for a book on Eclipse's Rich Client Platform (RCP).
|java|eclipse|rcp|myeclipse|
I have read through several reviews on Amazon and some books seem outdated. I am currently using MyEclipse 6.5 which is using Eclipse 3.3. I'm interested in hearing from people that have experience learning RCP and what reference material they used to get started. Thanks in advance. Bruce
Here's my strategy (I use JUnit, but I'm sure there's a way to do the equivalent in PHP): I have a method that runs before all of the Unit Tests for a specific DAO class. It puts the dev database into a known state (adds all test data, etc.). As I run tests, I keep track of any data added to the known state. This data is cleaned up at the end of each test. After all the tests for the class have run, another method removes all the test data in the dev database, leaving it in the state it was in before the tests were run. It's a bit of work to do all this, but I usually write the methods in a DBTestCommon class where all of my DAO test classes can get to them.
First of all its a matter of casing... Change Part_Track to PART_Track which will fix your binding error.. But I do not think that this is what you are trying to do.. You could use a Grid instead of a canvas, and the Thumb will size automatically. Canvas does not really have a height, for it does not really care about the height of its children... Hope this helps...
First of all its a matter of casing... Change <pre><code>Part_Track</code></pre> to <pre><code>PART_Track</code></pre> which will fix your binding error.. But I do not think that this is what you are trying to do.. You could use a Grid instead of a canvas, and the Thumb will size automatically. Canvas does not really have a height, for it does not really care about the height of its children... Hope this helps...
If you need to manipulate it on the client side, you can't use the Visible property on the server side. Instead, set its display style to "none".
If you need to manipulate it on the client side, you can't use the Visible property on the server side. Instead, set its CSS display style to "none". For example: <asp:Label runat="server" id="Label1" style="display: none;" /> Then, you could make it visible on the client side with: document.getElementById('Label1').style.display = 'inherit'; You could make it hidden again with: document.getElementById('Label1').style.display = 'none'; Keep in mind that there may be issues with the ClientID being more complex than "Label1" in practice. You'll need to use the ClientID with getElementById, not the server side ID, if they differ.
`__`file`__` It works! Put backticks around the underscores. Like this: `__`file`__`
What Adam said. You could also add some logic to detect maximum amplitude values over a period of time and only flag those, but the essence is to determine if/when the signal hits the maximum amplitude. MSN
You can also put a backslash before the final underscore __file_\_ gives you __file_\_
Whether you want a perfect hashfunction (different value for each object that evaluates to equal) or just a pretty good one is always a performance tradeoff, it takes normally time to compute a good hashfunction and if your dataset is smallish you're better of with a fast function. The most important (as your second post points out) is correctness, and to achieve that all you need is to return the Lenght of the array. Depending on your dataset that might even be ok. If it isn't (say all your arrays are equally long) you can go with something cheap like looking at the first and last value and XORing their values and then add more complexity as you see fit for your data. A quick way to see how your hashfunction performs on your data is to add all the data to a hashtable and count the number of times the Equals function gets called, if it is too often you have more work to do on the function. If you do this just keep in mind that the hashtable's size needs to be set bigger than your dataset when you start, otherwise you are going to rehash the data which will trigger reinserts and more Equals evaluations (though possibly more realistic?) For some objects (not this one) a quick HashCode can be generated by ToString().GetHashCode(), certainly not optimal, but useful as people tend to return something close to the identity of the object from ToString() and that is exactly what GetHashcode is looking for Trivia: The worst performance I have ever seen was when someone by mistake returned a constant from GetHashCode, easy to spot with a debugger though, especially if you do lots of lookups in your hashtable
Best way to implement 1:1 asynchronous callbacks/events in ActionScript 3 / Flex?
|actionscript-3|apache-flex|asynchronous|
I've been utilizing the [command pattern][1] in my Flex projects, with asynchronous callback routes required between: - whoever instantiated a given command object and the command object, - the command object and the "data access" object (i.e. someone who handles the remote procedure calls over the network to the servers) that the command object calls. Each of these two callback routes has to be able to be a one-to-one relationship. This is due to the fact that I might have several instances of a given command class running the exact same job at the same time but with slightly different parameters, and I don't want their callbacks getting mixed up. Using events, the default way of handling asynchronicity in AS3, is thus pretty much out since they're inherently based on one-to-many relationships. Currently I have done this using **callback function references** with specific kinds of signatures, but I was wondering *if someone knew of a better (or an alternative) way?* Here's an example to illustrate my current method: - I might have a view object that spawns a `DeleteObjectCommand` instance due to some user action, passing references to two of its own private member functions (one for success, one for failure: let's say `"deleteObjectSuccessHandler()"` and `"deleteObjectFailureHandler()"` in this example) as callback function references to the command class's constructor. - Then the command object would repeat this pattern with its connection to the "data access" object. - When the RPC over the network has successfully been completed (or has failed), the appropriate callback functions are called, first by the "data access" object and then the command object, so that finally the view object that instantiated the operation in the first place gets notified by having its `deleteObjectSuccessHandler()` or `deleteObjectFailureHandler()` called. [1]: http://en.wikipedia.org/wiki/Command_pattern
|c#|.net|file-io|
In C# I can use the FileSystemWatcher object to watch for a specific file and raise an event when it is created, modified, etc. The problem I have with this class is that it raises the event the moment the file becomes created, even if the process which created the file is still in the process of writing. I have found this to be very problematic, especially if I'm trying to read something like an XML document where the file must have some structure to it which won't exist until it is completed being written. Does .NET (preferably 2.0) have any way to raise an event after the file becomes accessible, or do I have to constantly try reading the file until it doesn't throw an exception to know it is available?
@Jeff > Relative to straight procedural programming, the first fundamental tenet of OOP is the notion of information hiding and encapsulation. This idea leads to the notion of the class that seperates the interface from implementation. Which has the more hidden implementation: C++'s iostreams, or C's FILE*s? I think the use of opaque context objects (HANDLEs in Win32, FILE*s in C, to name two well-known examples--hell, HANDLEs live on the other side of the kernel-mode barrier, and it really doesn't get much more encapsulated than that) is found in procedural code too; I'm struggling to see how this is something particular to OOP. I suppose that may be a part of why I'm struggling to see the benefits: the parts that are obviously good are not specific to OOP, whereas the parts that are specific to OOP are not obviously good! (this is not to say that they are necessarily bad, but rather that I have not seen the evidence that they are widely-applicable and consistently beneficial).
OOP *has* reduced costs, and increased efficiency. When I made the jump from classic ASP/VBScript to C# I noticed a HUGE increase in productivity thanks to OOP.
>I found this gem on Wikipedia. Sounds intimidating. It's actually not. Telnet onto an IRC Server and witness the simplicity of the protocol first hand. The hardest part is the handshake, after that its very simple.
Not sure if there is a way of an event actually being raised by the standard class, but I eas experiencing similar problems on some recent work I was doing. In short, I was trying to write to a file that was locked at the time. I ended up wrapping the write method up so it would automatically try the write again in a few ms after.. Thinking out loud, Can you probe the file for a ReadOnly status? May be worth then having a wrapper for file IO which can stack up delegates for pending file operations or something.. Thoughts?
What's the point of OOP?
|language-agnostic|oop|
As far as I can tell, in spite of the countless millions or billions spent on OOP education, languages, and tools, OOP has not improved developer productivity or software reliability, nor has it reduced development costs. Few people use OOP in any rigorous sense (few people adhere to or understand principles such as LSP); there seems to be little uniformity or consistency to the approaches that people take to modelling problem domains. All too often, the class is used simply for its syntactic sugar; it puts the functions for a record type into their own little namespace. I've written a large amount of code for a wide variety of applications. Although there have been places where true substitutable subtyping played a valuable role in the application, these have been pretty exceptional. In general, though much lip service is given to talk of "re-use" the reality is that unless a piece of code does _exactly_ what you want it to do, there's very little cost-effective "re-use". It's extremely hard to design classes to be extensible _in the right way_, and so the cost of extension is normally so great that "re-use" simply isn't worthwhile. In many regards, this doesn't surprise me. The real world isn't "OO", and the idea implicit in OO--that we can model things with some class taxonomy--seems to me very fundamentally flawed (I can sit on a table, a tree stump, a car bonnet, someone's lap--but not one of those is-a chair). Even if we move to more abstract domains, OO modelling is often difficult, counterintuitive, and ultimately unhelpful (consider the classic examples of circles/ellipses or squares/rectangles). So what am I missing here? Where's the value of OOP, and why has all the time and money failed to make software any better?
We use [NUnit][1] and [MBUnit][2] here. We use [TestDriven.NET][3] to run the unit tests from within Visual Studio. We use the excellent, highly recommended [RhinoMocks][4] as a mock framework. [1]: www.nunit.org [2]: http://mbunit.com [3]: http://testdriven.net [4]: http://www.ayende.com/projects/rhino-mocks/downloads.aspx
Use a 3 step process: 1. Generate a script from the working database 2. Create a new database from that script 3. Create a backup of the new database
Using SQLite with Visual Studio 2008 and Silverlight
|.net|silverlight|sqlite|
Any one know decent way to reference a SQLite database using the above mentioned tools? I tried using ODBC (the SQLite driver) but while the connection is good, I get no data returned. Like I can't see any tables in Data Connection (VS 2008). Is there a better way? *Edit: corrected typos*
Sun itself recommends staying away from StringTokenizer and using the String.spilt method instead. You'll also want to look at the Pattern class.
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\phpA30E.tmp' to './people.xml' in E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\upload.php on line 3 is the important line it says you can't put the file where you want it and this normally means a permissions problem check the process running the app (normally the webservers process for php) has the rights to write a file there. EDIT: hang on a bit I jumped the gun a little is the path to the file in the first line correct?
As it's Windows, there is no real 777. If you're using [chmod][1], check the Windows-related comments. Check that the IIS Account can access (read, write, modify) these two folders: E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\ C:\WINDOWS\Temp\ [1]: http://fr2.php.net/manual/en/function.chmod.php
PHP Error - Uploading a file
|iis|windows|php|upload|
I'm trying to write some php to upload a file to a folder on my webserver. Here's what I have: <?php if ( !empty($_FILES['file']['tmp_name']) ) { move_uploaded_file($_FILES['file']['tmp_name'], './' . $_FILES['file']['name']); header('Location: http://www.mywebsite.com/dump/'); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>Dump Upload</title> </head> <body> <h1>Upload a File</h1> <form action="upload.php" enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000000" /> Select the File:<br /><input type="file" name="file" /><br /> <input type="submit" value="Upload" /> </form> </body> </html> I'm getting these errors: Warning: move_uploaded_file(./test.txt) [function.move-uploaded-file]: failed to open stream: Permission denied in E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\upload.php on line 3 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\Temp\phpA30E.tmp' to './people.xml' in E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\upload.php on line 3 Warning: Cannot modify header information - headers already sent by (output started at E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\upload.php:3) in E:\inetpub\vhosts\mywebsite.com\httpdocs\dump\upload.php on line 4 PHP version 4.4.7 Running IIS on a Windows box. This particular file/folder has 777 permissions. Any ideas?
Best way to implement 1:1 asynchronous callbacks/events in ActionScript 3 / Flex / AIR?
|apache-flex|actionscript-3|air|asynchronous|
As far as I know LINQ to SQL does lazy loading by default. And even if it doesn't, I'm pretty sure the MS guys used some kind of [identity map][1] to ensure every record is loaded only once per DataContext. Did you experience it getting stuck in a loop in practice? [1]: http://en.wikipedia.org/wiki/Identity_map
In the designer, select a property on an entity in the diagram, and in the _Code Generation_ section in the properties window, set **Delay Loaded** to _True_ . See [this blog post](http://www.davidhayden.com/blog/dave/archive/2007/08/05/LINQToSQLLazyLoadingPropertiesSpecifyingPreFetchWhenNeededPerformance.aspx).
My guess would be that you have to do it as an administrator...try either disabling UAC, or using gacutil.exe to add your assembly.
Komrade, stsadm.blogspot.com may be the answer again, you can list all the site collections and then using the command that edward posted to remove the site templates. That might help make things a bit quicker! Although, you should only have to do it once per site collection, all subsites (as far as I remember) inherit their settings from the parent site.
Use [runas][1] command to run [gacutil][2] as a user with local admin rights to register the dll to GAC. [1]: http://www.microsoft.com/technet/scriptcenter/resources/qanda/apr06/hey0428.mspx [2]: http://msdn.microsoft.com/en-us/library/ex0ss12c(VS.80).aspx
It really all depends on how many text messages you intend to send and how critical it is that the message arrives on time (and, actually arrives). SMS Aggregators --------------- For larger volume and good reliability, you will want to go with an SMS aggregator. These aggregators have web service API's (or SMPP) that you can use to send your message and find out whether your message was delivered over time. Some examples of aggregators with whom I have experience are Air2Web, mBlox, etc. The nice thing about working with an aggregator is that they can guide you through what it takes to send effective messages. For example, if you want your own, distinct, shortcode they can navigate the process with the carriers to secure that shortcode. They can also make sure that you are in compliance with any rules regarding using SMS. Carriers will flat shut you off if you don't respect the use of SMS and only use SMS within the bounds of what you agreed to when you started to use the aggregator. If you overstep your bounds, they have the aggregator relationships to prevent any service interruptions. You'll pay per message and may have a baseline service fee. All if this is determined by your volume. SMTP to SMS ----------- If you want an unreliable, low-rent solution to a low number of known addresses, you can use an SMTP to SMS solution. In this case you simply find out the mobile provider for the recipient and use their mobile provider's e-mail scheme to send the message. An example of this is 7705551212@cellcompany.com. In this scenario, you send the message and it is gone and you hope that it gets there. You really don't know if it is making it. Also, some providers limit how messages come in via their SMTP to SMS gateway to limit SMS spam. But, that scenario is the very easiest to use from virtually any programming language. There are a million C# examples of how to send e-mail and this way would be no different. This is the most cost-effective solution (i.e. free) until you get a large volume of messages. When you start doing too much of this, the carriers might step in when they find that you are sending a ton of messages through their SMTP to SMS gateway. Effective Texting ----------------- In many cases you have to make sure that recipients have properly opted-in to your service. This is only a big deal if your texts are going to a really large population. You'll want to remember that text messages are short (keep it to less than 140 to 160 characters). When you program things you'll want to bake that in or you might accidentally send multipart messages. Don't forget that you will want to make sure that your recipients realize they might have to pay for the incoming text messages. In a world of unlimited text plans this is less and less of a concern.
The problem with the second way is the way Strings are handled in Java: - `"0"` is converted into a constant String object at compile time. - Each time this code is called, `s` is constructed as a new String object, and `javac` converts that code to `String s = new StringBuilder().append(integerObj.toString()).append("0").toString()` (StringBuffer for older versions). Even if you use the same `integerObj`, i.e., `String s1 = integerObj + "0"; String s2 = integerObj + "0";` `(s1 == s2)` would be `false`, while `s1.equals(s2)` would be `true`. - `Integer.parseInt` internally calls `new Integer()` anyway, because `Integer` is immutable. BTW, autoboxing/unboxing is internally the same as the first method.
Lisp list iteration
|lisp|list|iteration|
I have a function that gets x(a value) and xs(a list) and removes all values that are bigger than x from the list. Well it doesn't work, can you tell me why? (defun biggerElems(x xs) (let ((xst)) (dolist (elem xs) (if (> x elem) (setf xst (remove elem xs)))) xst))
You might try [NDepend][1]. The great [Scott Hanselman discusses it more here.][2] Tons of visual dependency formats too. [1]: http://www.ndepend.com/ [2]: http://www.hanselman.com/blog/ExitingTheZoneOfPainStaticAnalysisWithNDepend.aspx
You might try [NDepend][1]. The great [Scott Hanselman discusses it more here.][2] Tons of visual dependency formats too. It sounds like its only for .NET though. [1]: http://www.ndepend.com/ [2]: http://www.hanselman.com/blog/ExitingTheZoneOfPainStaticAnalysisWithNDepend.aspx
As long as people can get at the executable - which, unless you want to run the game on a locked kiosk, is always the case - there's no perfectly secure way of doing this. The music and movie industries spent tens of millions on DRM that got cracked by home hobbyists in days/weeks. If they can't protect *their* stuff...
I would be very hesitant to place the WebBrowser control between your software and the flv, because you will lose all control of the flv and will not get any meaningful notifications about its status. The lack of tight integration will lead to a very poor user experience. The blog post [here][1] has instructions on embedding flash via COM. [1]: http://weblogs.asp.net/twalters/archive/2003/12/29/46265.aspx
We have two projects in our solution that are built completely out of generated code. Basically, we run the code generator .exe as a post-build step for another project and along with generating the code, it automates the active instance of visual studio to make sure that the generated project is in the solution, that it has all of the generated code files, and that they are checked out/added to TFS as necessary. It very rarely flakes out during the VS automation stage, and we have to run it "by hand" but that's usually only if you have several instances of VS open with >1 instance of the solution open and it can't figure out which one it's supposed to automate. Our solution and process are such that the generation should always be done and correct before our auto-build gets to it, so this approach might not work for you.
Reading all the answers reminded me that I actually never looked into solving this using a Firefox add-on. I soon found [Update Scanner][1] and I think it look really promising! [1]: https://addons.mozilla.org/en-US/firefox/addon/3362
Make sure the Visible property is set to true or the control won't render to the page. Then you can use script to manipulate it.
What is the value-binding syntax in xaml?