instruction stringlengths 0 30k ⌀ |
|---|
You can't run Aero on the 'basic' editions, and there are some 'extras' that only run in Ultimate. You probably won't care about those for development, though. The only thing to be careful of would be that it has the same client access restrictions that XP did. |
It took me a couple minutes to find a site that I could source for this,
> The card is valid until the last day of the month indicated, after the last
> day of the next month; the card cannot be used to make a purchase if the
> merchant attempts to obtain an authorization. - [Source][1]
Also, while looking this up, I found an interesting article on Micrsoft's website, apparently Access 2000 assumed that the card would expire on the first day of the month and [an article][2] was released on how to calculate the last day of the month. Additionally, this page has [everything you ever wanted to know about credit cards][3].
[1]: http://cumemberscard.com/noda/CreditCardGlossary.asp
[2]: http://support.microsoft.com/kb/210534
[3]: http://euro.ecom.cmu.edu/resources/elibrary/everycc.htm |
It took me a couple minutes to find a site that I could source for this,
> The card is valid until the last day of the month indicated, after the last
> day of the next month; the card cannot be used to make a purchase if the
> merchant attempts to obtain an authorization.
> - [Source][1]
Also, while looking this up, I found an interesting article on Micrsoft's website, apparently Access 2000 assumed that the card would expire on the first day of the month and [an article][2] was released on how to calculate the last day of the month. Additionally, this page has [everything you ever wanted to know about credit cards][3].
[1]: http://cumemberscard.com/noda/CreditCardGlossary.asp
[2]: http://support.microsoft.com/kb/210534
[3]: http://euro.ecom.cmu.edu/resources/elibrary/everycc.htm |
|.net|asp.net|asp.net-mvc|webforms| |
How to make a button appear as if it is pressed? |
|c#|.net|winforms|user-interface|button| |
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button look "pressed"?
Imagine this button is an on/off switch.
ToolStripButton has the Checked property, but the regular Button does not. |
|c#|.net|winforms|user-interface|button| |
Best Way to Begin Learning Web Application Design |
|language-agnostic|web-application|resources| |
I'm a long time hobbyist programmer interested in getting into web application development. I have a fair amount of personal experience with various non-web languages, but have never really branched over to web applications.
I don't usually have any issues learning new languages or technologies, so I'm not worried about which is the "best" language or web stack to work with. Instead, I'd like to know of any recommended resources (books, articles, web sites, maybe even college courses) that discuss web application design: managing and optimizing server interaction, security concerns, scalability, and other topics that fall under design rather than implementation.
What would you recommend for a Standalone Application Developer wanting to branch out into Web Development? |
|language-agnostic|web-applications|resources| |
Access files from network share in c# web app |
|c#|fileio|security|asp.net|webapp| |
I have a web application that needs to read (and possibly write) files from a network share. I was wondering what the best way to do this would be?
I can't give the network service or aspnet accounts access to the network share. I could possibly use impersonation.
The network share and the web application are both hosted on the same domain and I can create a new user on the domain specifically for this purpose however I'm not quite sure how to join the dots between creating the filestream and specifying the credentials to use in the web application. |
|c#|asp.net|security|web-application|file-io| |
|c#|asp.net|security|web-applications|file-io| |
Storing logged in user details |
|bestpractices|web-application| |
When creating a web application, and lets say you have a User object denoting a single user, what do you think is the best way to store that the user has logged in?
Two ways I've thought about have been:
* Stored the user database id in a session variable
* Stored the entire user object in a session variable
Any better suggestions, any issues with using the above ways? Perhaps security issues or memory issues, etc, etc.
|
What is the best way to deploy a VB.NET application? |
|visual-studio|vb.net|installation|clickonce| |
Generally when I use ClickOnce when I build a VB.NET program but it has a few downsides. I've never really used anything else, so I'm not sure
what my options are.
Downsides to ClickOnce:
- Consists of multiple files - Seems easier to distribute one file than manageing a bunch of file and the downloader to download those files.
- You have to build it again for CD installations (for when the end user dosn't have internet)
- Program does not end up in Program Files - It ends up hidden away in some application catch folder, making it much harder to shortcut to.
Pros to ClickOnce:
- It works. Magically. And it's built
into VisualStudio 2008 express.
- Makes it easy to upgrade the
application.
Does Windows Installer do these things as well? I know it dosen't have any of the ClickOnce cons, but It would be nice to know if it also has the ClickOnce pros. |
From SQL Server Books Online:
> To write full-text queries in
> Microsoft SQL Server 2005, you must
> learn how to use the CONTAINS and
> FREETEXT Transact-SQL predicates, and
> the CONTAINSTABLE and FREETEXTTABLE
> rowset-valued functions.
That means all of the queries written above with the % and _ are not valid full text queries.
Here is a sample of what a query looks like when calling the CONTAINSTABLE function.
SELECT
RANK
, *
FROM
TableName
, CONTAINSTABLE (TableName, *, ' "*WildCard" ') searchTable
WHERE
[KEY] = TableName.pk
ORDER BY
searchTable.RANK DESC
In order for the CONTAINSTABLE function to know that I'm using a wildcard search, I have to wrap it in double quotes. I can use the wildcard character * at the beginning or ending. There are a lot of other things you can do when you're building the search string for the CONTAINSTABLE function. You can search for a word near another word, search for inflectional words (drive = drives, drove, driving, and driven), and search for synonym of another word (metal can have synonyms such as aluminum and steel).
I just created a table, put a full text index on the table and did a couple of test searches and didn't have a problem, so wildcard searching works as intended. |
From SQL Server Books Online:
> To write full-text queries in
> Microsoft SQL Server 2005, you must
> learn how to use the CONTAINS and
> FREETEXT Transact-SQL predicates, and
> the CONTAINSTABLE and FREETEXTTABLE
> rowset-valued functions.
That means all of the queries written above with the % and _ are not valid full text queries.
Here is a sample of what a query looks like when calling the CONTAINSTABLE function.
> SELECT RANK , * FROM TableName ,
> CONTAINSTABLE (TableName, *, '
> "*WildCard" ') searchTable WHERE
> [KEY] = TableName.pk ORDER BY
> searchTable.RANK DESC
In order for the CONTAINSTABLE function to know that I'm using a wildcard search, I have to wrap it in double quotes. I can use the wildcard character * at the beginning or ending. There are a lot of other things you can do when you're building the search string for the CONTAINSTABLE function. You can search for a word near another word, search for inflectional words (drive = drives, drove, driving, and driven), and search for synonym of another word (metal can have synonyms such as aluminum and steel).
I just created a table, put a full text index on the table and did a couple of test searches and didn't have a problem, so wildcard searching works as intended. |
HTML: center a block of content when you don't know in advance its width. |
|html|css| |
After lots of attempts and search I have never found a satisfactory way to do it with CSS2.
A simple way to accomplish it is to wrap it into a handy TABLE as shown in the sample below. Do you know how to do it avoiding table layouts and also avoiding quirky tricks?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<style type="text/css">
table
{
margin:0px auto 0 auto;
}
</style>
</head>
<body>
<table>
<tr>
<td>test<br/>test</td>
</tr>
</table>
</body>
<html> |
PHPUnit is a standard, but it's sometimes also overwhelming, so if you find it too complex, check out [phpt][1] to get you started. It's very, very easy to write tests in it. A no brainer for any programmer.
And to answer your TDD question - I am not sure if TDD is widley used in the PHP space. I can see that rapid application development and TDD somewhat clash (strictly IMHO). TDD requires you to have the complete picture of what you build and you write your tests up front and then implement the code to make the test pass.
So for example what we do instead, is to write a lot of tests when we are done. This is not always the best approach because you sometimes end up with bogus tests that pass, but are not really useful but at least it's something you can expand on. Internally we continue on tests and basically write a test for each bug we find. This is how it becomes more solid.
[1]: http://qa.php.net/write-test.php |
[Console.ReadKey](http://msdn.microsoft.com/en-us/library/system.console.readkey.aspx) |
It may be helpful to understand the difference between a "registrar" and a "registry" to begin with. A registrar is a company that sells domain names (ie. godaddy) to buyers. Anyone can be a registrar. You can become a registrar.
A registry is an entity (chosen by ICANN) that maintains the master database of domain names. There are several registries out there. The Internet Society (ISOC) is the registry for all .org names, Verisign is the registry for all .com and .net domain names. There are others and each country has one for their domain. All the registrars access and update the registry databases.
A registry is responsible for maintaining the top level domain (TLD) which is the ultimate DNS server. A request to resolve a domain name, if it can't be resolved by any other DNS server will filter up to the TLD. Think of it as a hierarchy like a tree where the TLD is the trunk. At that point it will be resolved into an IP address or an error will be returned. |
In general, you don't want to create objects inside an object. That's a bad habit, instead, write a clear API and inject a model into your model.
<?php
// in your controller
$model1 = new Model1();
$model2 = new Model2();
$model2->setWhatever($model1);
?> |
I'd like to offer something I've used at times in the past: a rudimentary leak checker which is source level and fairly automatic.
I'm giving this away for three reasons:
1. You might find it useful.
2. Though it's a bit krufty, I don't let that embarass me.
3. Even though it's tied to some win32 hooks, that should be easy to alleviate.
There are things of which you must be careful when using it: don't do anything that needs to lean on `new` in the underlying code, beware of the warnings about cases it might miss at the top of leakcheck.cpp, realize that if you turn on (and fix any issues with) the code that does image dumps, you may generate a huge file.
The design is meant to allow you to turn the checker on and off without recompiling everything that includes its header. Include leakcheck.h where you want to track checking and rebuild once. Thereafter, compile leakcheck.cpp with or without LEAKCHECK #define'd and then relink to turn it on and off. Including unleakcheck.h will turn it off locally in a file. Two macros are provided: CLEARALLOCINFO() will avoid reporting the same file and line inappropriately when you traverse allocating code that didn't include leakcheck.h. ALLOCFENCE() just drops a line in the generated report without doing any allocation.
Again, please realize that I haven't used this in a while and you may have to work with it a bit. I'm dropping it in to illustrate the idea. If there turns out to be sufficient interest, I'd be willing to work up an example, updating the code in the process, and replace the contents of the following URL with something nicer that includes a decently syntax-colored listing.
You can find it here: <http://www.cse.ucsd.edu/~tkammeye/leakcheck.html> |
|php|ajax|ide| |
What do the getUTC* methods on the date object do? |
|javascript|webdevelopment| |
What does it mean when you get or create a date in UTC format in JavaScript? |
|javascript| |
It is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook to some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application's AppDomain. Then you can call methods defined in your assembly using reflection. For example, [Snoop][1] uses this method.
[1]: http://blois.us/Snoop/ |
Kevin,
it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook to some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application's AppDomain. Then you can call methods defined in your assembly using reflection. For example, [Snoop][1] uses this method.
[1]: http://blois.us/Snoop/ |
Kevin,
it is possible. You can create library with window hook proc using managed C++. All you need to do is to inject this hook into some application using standard WinAPI (SetWindowsHookEx etc.). Inside this hook you can call System::AppDomain::CurrentDomain->Load method to load your assembly into target application's AppDomain. Then you can call methods defined in your assembly using reflection. For example, [Snoop][1] uses this method.
[1]: http://blois.us/Snoop/ |
What is the best way to prevent session hijacking? |
|session|cookies|secure|webdevelopment| |
Specifically this is regarding when using a client session cookie to identify a session on the server.
Is the best answer to use SSL/HTTPS encryption for the entire web site, and you have the best guarantee that no man in the middle attacks will be able to sniff an existing client session cookie?
And perhaps second best to use some sort of encryption on the session value itself that is stored in your session cookie?
If a malicious user has physical access to a machine, they can still look at the filesystem to retrieve a valid session cookie and use that to hijack a session? |
|session|cookies|secure| |
|security|session|cookies| |
I would really recommend [Restful Authentication][1]. I think it's pretty much the de-facto standard.
[1]: http://github.com/technoweenie/restful-authentication/tree/master |
One key feature in a functional language is the concept of first-class functions. The idea is that you can pass functions as parameters to other functions and return them as values.
Functional programming involves writing code that does not change state. The primary reason for doing so is so that successive calls to a function will yield the same result. You can write functional code in any language that supports first-class functions, but there are some languages, like Haskell, which do not allow you to change state. In fact, you're not supposed to make any side effects (like printing out text) at all - which sounds like it could be completely useless.
Haskell instead employs a different approach to IO: monads. These are objects that contain the desired IO operation to be executed by your interpreter's toplevel. At any other level they are simply objects in the system. |
I think the best way to do this is with a pseudo-cron. I have seen it on several occasions, and although not exact in the timing, it should do what you need it to do. Since in Wordpress the index.php is the first thing always hit based upon the settings in the .htaccess, create a file called pseudo-cron.php, dump it into the root directory, and then require it once from the index. Whenever someone hits the site, it will run, and you can use it to initiate a script, and check if another daily digest needs to be generated depending upon the time of the day, and when the previous digest ran. |
Vista Home Basic only has enough IIS features to host WCF services and does not have any of web server features for hosting static files, asp.net, etc.
Here is a [link][1] to compare editions. I would recommend going with Home Premium or Ultimate depending on whether the computer will run on a domain.
[1]: http://www.microsoft.com/windows/windows-vista/compare-editions/default.aspx |
How to send MMS with C# |
|c#|mms| |
<br />
I need to send MMS thought a C# application. I have already found 2 interesting components:
http://www.winwap.com<br />
http://www.nowsms.com
Does anyone have experience with other third party components?<br />
Could someone explain what kind of server I need to send those MMS? Is it a classic SMTP Server?
Thanks a lot!
|
This is a similar question - [Connection Pool Settings for Tomcat][1]
This is my response to that question and it fixed the problem for the other guy. It may help you out too.
[Tomcat Documentation][2]
DBCP uses the Jakarta-Commons Database Connection Pool. It relies on number of Jakarta-Commons components:
* Jakarta-Commons DBCP
* Jakarta-Commons Collections
* Jakarta-Commons Pool
I'm using the same connection pooling stuff and I'm setting these properties to prevent the same thing it's just not configured through tomcat.
But if the first thing doesn't work try these.
testWhileIdle=true
timeBetweenEvictionRunsMillis=300000
[1]: http://stackoverflow.com/questions/15949/javatomcat-dying-databse-connection#16168
[2]: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html |
The two '|' at the start and end probably aren't needed (and in fact would probably muck things up)
Also, your forward slashes should I believe be backward slashes.
And since PHP 4.04 $n is the preferred way of referring to a capture group.
$output = preg_replace("(\D)\s+(\d+;)", "$1,$2", $output); |
The two '|' at the start and end probably are incorrect - and should both be forward-slashes.
All other forward slashes should be backward slashes (and need escaping).
And since PHP 4.04 $n is the preferred way of referring to a capture group.
$output = preg_replace("/(\\D)\\s+(\\d+;)/", "$1,$2", $output); |
The two '|' at the start and end probably are incorrect - and should both be forward-slashes.
All other forward slashes should be backward slashes (and need escaping).
And since PHP 4.04 $n is the preferred way of referring to a capture group.
$output = preg_replace("/(\\D)\\s+(\\d+;)/", "$1,$2", $output);
If you use single quotes you don't need to escape your backslashes:
$output = preg_replace('/(\D)\s+(\d+;)/', '$1,$2', $output);
|
CPAN to the rescue: [IO::LockedFile][1].
[1]: http://search.cpan.org/~rani/IO-LockedFile-0.23/LockedFile.pm |
Here's a tutorial: http://ruby.meetup.com/73/boards/view/viewthread?thread=2203432
I don't know if it's any good.
And here's one with InstantRails+Netbeans: http://weblogs.java.net/blog/bleonard/archive/2007/03/instant_rails_w.html |
Cross Page Postback doesn't work for client-side enabled button |
|asp.net| |
I am using a cross page postback for Page A to pass data to Page B.
The button that causes the postback has its postbackurl set but is disabled until the user selects a value from a DDL at which point the button is enable using javascript. However this prevents the cross page postback from occurring, Page A just postbacks to itself.
If the button is never disabled it works fine. Anyone know how to solve this?
|
If you believe in a deterministic universe, true randomness doesn't exist. :-) For example, someone has suggested that radioactive decay is *truly* random, but IMHO, just because scientists haven't yet worked out the pattern, doesn't mean that there isn't a pattern there to be worked out. Usually, when you want "random" numbers, what you need are numbers for encryption that no one else will be able to guess.
The closest you can get to random is to measure something natural that no enemy would also be able to measure. Usually you throw away the most significant bits, from your measurement, leaving numbers with are more likely to be evenly spread. Hard core random number users get special hardware that measures radioactive events, but you can get some randomness from the human using the computer from things like keypress intervals and mouse movements, and if the computer doesn't have direct users, from CPU temperature sensors, and from network traffic. You could also use things like web cams and microphones connected to sound cards, but I don't know if anyone does. |
I recently read [Dreaming in Code][1] and found it to be an interesting read. Perhaps more so since the day I started reading it Chandler 1.0 was released. Reading about the growing pains and mistakes of a project team of talented people trying to "change the world" gives you a lot to learn from. Also Scott brings up a lot of programmer lore and wisdom in between that's just an entertaining read.
[Beautiful Code][2] had one or two things that made me think differently, particularly the chapter on top down operator precedence.
[1]: http://www.amazon.com/Dreaming-Code-Programmers-Transcendent-Software/dp/1400082471/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1220285915&sr=8-1
[2]: http://www.amazon.com/Beautiful-Code-Leading-Programmers-Practice/dp/0596510047/ref=pd_ys_ir_all_1?pf_rd_p=258372101&pf_rd_s=center-1&pf_rd_t=1501&pf_rd_i=list&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=0PCB8WA6J162QJSQ5389 |
No, but there are two solutions I would recommend:
* Adiscon [EventLogger](http://www.eventreporter.com/en/) is a third-party product that will send your Windows EventLog to a SQL database. You can either send all events or create filters. Of course, once the events are in a SQL database, you can use any of the usual tools to create a web interface.
* You can use ASP.NET's [HealthMonitoring](http://msdn.microsoft.com/en-us/library/ms998306.aspx) configuration section to configure .NET to send all ASP.NET-related events directly to a SQL database. This covers exceptions, heartbeats, and a host of other event types. The [SqlWebEventProvider](http://msdn.microsoft.com/en-us/library/system.web.management.sqlwebeventprovider.aspx) is a cinch to setup. |
From SQL Server Books Online:
> To write full-text queries in
> Microsoft SQL Server 2005, you must
> learn how to use the CONTAINS and
> FREETEXT Transact-SQL predicates, and
> the CONTAINSTABLE and FREETEXTTABLE
> rowset-valued functions.
That means all of the queries written above with the % and _ are not valid full text queries.
Here is a sample of what a query looks like when calling the CONTAINSTABLE function.
> SELECT RANK , * FROM TableName ,
> CONTAINSTABLE (TableName, *, '
> "*WildCard" ') searchTable WHERE
> [KEY] = TableName.pk ORDER BY
> searchTable.RANK DESC
In order for the CONTAINSTABLE function to know that I'm using a wildcard search, I have to wrap it in double quotes. I can use the wildcard character * at the beginning or ending. There are a lot of other things you can do when you're building the search string for the CONTAINSTABLE function. You can search for a word near another word, search for inflectional words (drive = drives, drove, driving, and driven), and search for synonym of another word (metal can have synonyms such as aluminum and steel).
I just created a table, put a full text index on the table and did a couple of test searches and didn't have a problem, so wildcard searching works as intended.
[Update]
I see that you've updated your question and know that you need to use one of the functions.
You can still search with the wildcard at the beginning, but if the word is not a full word following the wildcard, you have to add another wildcard at the end.
Example: "*ildcar" will look for a single word as long as it ends with "ildcar".
Example: "*ildcar*" will look for a single word with "ildcar" in the middle, which means it will match "wildcard". |
From SQL Server Books Online:
> To write full-text queries in
> Microsoft SQL Server 2005, you must
> learn how to use the CONTAINS and
> FREETEXT Transact-SQL predicates, and
> the CONTAINSTABLE and FREETEXTTABLE
> rowset-valued functions.
That means all of the queries written above with the % and _ are not valid full text queries.
Here is a sample of what a query looks like when calling the CONTAINSTABLE function.
> SELECT RANK , * FROM TableName ,
> CONTAINSTABLE (TableName, *, '
> "*WildCard" ') searchTable WHERE
> [KEY] = TableName.pk ORDER BY
> searchTable.RANK DESC
In order for the CONTAINSTABLE function to know that I'm using a wildcard search, I have to wrap it in double quotes. I can use the wildcard character * at the beginning or ending. There are a lot of other things you can do when you're building the search string for the CONTAINSTABLE function. You can search for a word near another word, search for inflectional words (drive = drives, drove, driving, and driven), and search for synonym of another word (metal can have synonyms such as aluminum and steel).
I just created a table, put a full text index on the table and did a couple of test searches and didn't have a problem, so wildcard searching works as intended.
[Update]
I see that you've updated your question and know that you need to use one of the functions.
You can still search with the wildcard at the beginning, but if the word is not a full word following the wildcard, you have to add another wildcard at the end.
Example: "*ildcar" will look for a single word as long as it ends with "ildcar".
Example: "*ildcar*" will look for a single word with "ildcar" in the middle, which means it will match "wildcard".
[Update #2]
Dave Ward - Using a wildcard with one of the functions shouldn't be a huge perf hit. If I created a search string with just "*", it will not return all rows, in my test case, it returned 0 records. |
Does this help?
[http://www.quirksmode.org/js/iframe.html][1]
[1]: http://www.quirksmode.org/js/iframe.html
I only tested this in firefox, but if you have something like this:
<iframe name='myframe' id='myframe' src='http://www.google.com'></iframe>
You can get its address by using:
document.getElementById('myframe').src
Not sure if I understood your question correctly but anyways :) |
Would simple globs be enough? For globs it's just a matter of replacing * with .* and adding ^ and $. Or may be Excel-style patterns? It should not be too hard to write a regexp generator for simple rules like this...
My point is, adjust your requirements to simplify the code, and then may be add more features as needed. |
This is going to be the lamest answer, but it works:
[**Use the deprecated <center> tag**][1].
:P
I told you it would be lame. But, like I said, it works!
\*shudder\*
[1]: http://www.w3schools.com/TAGS/tag_center.asp |
SQL Server Full-Text Search: Hung processes with MSSEARCH wait type |
|sql-server|full-text-search| |
We have a SQL Server 2005 SP2 machine running a large number of databases, all of which contain full-text catalogs. Whenever we try to drop one of these databases or rebuild a full-text index, the drop or rebuild process hangs indefinitely with a MSSEARCH wait type. The process can’t be killed, and a server reboot is required to get things running again. Based on a Microsoft forums post[1], it appears that the problem might be an improperly removed full-text catalog. Can anyone recommend a way to determine which catalog is causing the problem, without having to remove all of them?
[1] [http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2681739&SiteID=1]
“Yes we did have full text catalogues in the database, but since I had disabled full text search for the database, and disabled msftesql, I didn't suspect them. I got however an article from Microsoft support, showing me how I could test for catalogues not properly removed. So I discovered that there still existed an old catalogue, which I ,after and only after re-enabling full text search, were able to delete, since then my backup has worked”
[1]: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2681739&SiteID=1 |
web site structure/architecture |
|architecture| |
What web site structure(s)/architecture(s) would the community swear by, with a narrowing down in the direction towards more of a small facebook style project?
I understand the question to be rather broad/subjective; but being relatively new to the area of web development, I find just looking at and learning from examples of working projects most times extremely helpful, and that at other times just blows my mind and changes how I construct future assignments.
With the latter paragraph in mind, does the community have any suggestions on places to look/articles to read? |
|architecture| |
(This isn't really iPhone specific - the same thing with happen in regular Cocoa).
NSUnknownKeyException is a common error when using [Key-Value Coding][1] to access a key that the object doesn't have.
The properties of most Cocoa objects can be accessing directly:
[@"hello world" length] // Objective-C 1.0
@"hello world".length // Objective-C 2.0
Or via Key-Value Coding:
[@"hello word" valueForKey:@"length"]
I would get an NSUnknownKeyException if I used the following line:
[@"hello world" valueForKey:@"purpleMonkeyDishwasher"]
because NSString does not have a property (key) called 'purpleMonkeyDishwasher'.
Something in your code or nib is trying to set a value for the key 'kramerImage' on an UIView, which (apparently) doesn't support that key. If you're using Interface Builder, it might be something in your nib.
Find where 'kramerImage' is being used, and try to track it down from there.
[1]: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/KeyValueCoding.html |
Capture MouseDown event for .NET TextBox |
|c#|.net|events|windows-mobile| |
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox control?
I know the inherited Control class has the event, but it's not exposed in TextBox.
Is there a way to override the event handler?
I also tried the OpenNETCF TextBox2 control which does have the MouseDown event exposed, but no matter what I do, it doesn't fire the handler.
Any suggestions? |
XAML - In C# |
|xaml|c#| |
Hi just trying to get my head around XAML.
Thought that I would try some writing XAML in code.
Trying to add a grid with 6 by 6 column definitions then add a textblock into one of the grid cells.
I dont seem to be able to reference the cell that I want - there is no method on the grid that I can add the textblock too. Just grid.children.add(object). No Cell definition.
TIA
The XAML
<Page x:Class="WPF_Tester.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1"
Loaded="Page_Loaded">
</Page>
The C#
private void Page_Loaded(object sender, RoutedEventArgs e)
{
//create the structure
Grid g = new Grid();
g.ShowGridLines = true;
g.Visibility = Visibility.Visible;
//add columns
for (int i = 0; i < 6; ++i)
{
ColumnDefinition cd = new ColumnDefinition();
cd.Name = "Column" + i.ToString();
g.ColumnDefinitions.Add(cd);
}
//add rows
for (int i = 0; i < 6; ++i)
{
RowDefinition rd = new RowDefinition();
rd.Name = "Row" + i.ToString();
g.RowDefinitions.Add(rd);
}
TextBlock tb = new TextBlock();
tb.Text = "Hello World";
g.Children.Add(tb);
} |
|c#|xaml| |
Hi just trying to get my head around XAML.
Thought that I would try some writing XAML in code.
Trying to add a grid with 6 by 6 column definitions then add a textblock into one of the grid cells.
I dont seem to be able to reference the cell that I want - there is no method on the grid that I can add the textblock too. Just grid.children.add(object). No Cell definition.
TIA
The XAML
<Page x:Class="WPF_Tester.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page1"
Loaded="Page_Loaded">
</Page>
The C#
private void Page_Loaded(object sender, RoutedEventArgs e)
{
//create the structure
Grid g = new Grid();
g.ShowGridLines = true;
g.Visibility = Visibility.Visible;
//add columns
for (int i = 0; i < 6; ++i)
{
ColumnDefinition cd = new ColumnDefinition();
cd.Name = "Column" + i.ToString();
g.ColumnDefinitions.Add(cd);
}
//add rows
for (int i = 0; i < 6; ++i)
{
RowDefinition rd = new RowDefinition();
rd.Name = "Row" + i.ToString();
g.RowDefinitions.Add(rd);
}
TextBlock tb = new TextBlock();
tb.Text = "Hello World";
g.Children.Add(tb);
}
**update**
Thanks for the answers however here is the spooky bit...
- Using VS2008 Pro on XP
- WPFbrowser Project Template (3.5 verified)
I dont get the methods in the autocomplete. |
From SQL Server Books Online:
> To write full-text queries in
> Microsoft SQL Server 2005, you must
> learn how to use the CONTAINS and
> FREETEXT Transact-SQL predicates, and
> the CONTAINSTABLE and FREETEXTTABLE
> rowset-valued functions.
That means all of the queries written above with the % and _ are not valid full text queries.
Here is a sample of what a query looks like when calling the CONTAINSTABLE function.
> SELECT RANK , * FROM TableName ,
> CONTAINSTABLE (TableName, *, '
> "*WildCard" ') searchTable WHERE
> [KEY] = TableName.pk ORDER BY
> searchTable.RANK DESC
In order for the CONTAINSTABLE function to know that I'm using a wildcard search, I have to wrap it in double quotes. I can use the wildcard character * at the beginning or ending. There are a lot of other things you can do when you're building the search string for the CONTAINSTABLE function. You can search for a word near another word, search for inflectional words (drive = drives, drove, driving, and driven), and search for synonym of another word (metal can have synonyms such as aluminum and steel).
I just created a table, put a full text index on the table and did a couple of test searches and didn't have a problem, so wildcard searching works as intended.
[Update]
I see that you've updated your question and know that you need to use one of the functions.
You can still search with the wildcard at the beginning, but if the word is not a full word following the wildcard, you have to add another wildcard at the end.
Example: "*ildcar" will look for a single word as long as it ends with "ildcar".
Example: "*ildcar*" will look for a single word with "ildcar" in the middle, which means it will match "wildcard". [Just noticed that Markdown removed the wildcard characters from the beginning and ending of my quoted string here.]
[Update #2]
Dave Ward - Using a wildcard with one of the functions shouldn't be a huge perf hit. If I created a search string with just "*", it will not return all rows, in my test case, it returned 0 records. |
If you're trying to prevent search engine bots from accessing certain pages, make sure you're using a properly formatted [robots.txt][1] file.
Using HTTP_REFERER is unreliable because it is [easily faked][2].
Another option is to check the user agent string for known bots (this may require code modification).
[1]: http://www.robotstxt.org/
[2]: http://en.wikipedia.org/wiki/Referer_spoofing |
I've been happy with [StackOverflow][1].
I listen to / watch a few others:
- [No Agenda][2]
- [This Week In Tech][3]
- [Cranky Geeks][4]
But the constant MS/Google/Apple/Yahoo fluff of these is getting really old.
I've listened to a couple [Hanselminutes][5] and might start listening more regularly.
I'd like to find some that deal with actual software engineering issues and not just "tech gossip".
[1]: http://itc.conversationsnetwork.org/series/stackoverflow.html
[2]: http://cagematch.dvorak.org/index.php/board,45.0.html
[3]: http://twit.tv/twit
[4]: http://www.crankygeeks.com/
[5]: http://www.hanselminutes.com/ |
Creating an installer project, with a dependency on your EXE (which in turn depends on whatever it needs) is a fairly straightforward process - but you'll need at least VS Standard Edition for that.
Inside the installer project, you can create custom tasks and dialog steps that allow you to do anything you code up.
What's missing is the auto-upgrade and version-checking magic you get with ClickOnce. You can still build it in, it's just not automatic. |
Since those log entries aren't problems, it sounds like the global log level has been turned up to DEBUG. Alternatively, perhaps a new Logger/LogWriter has been implemented that writes to stdout, and thus is being re-logged by Weblogic. I would look at the configuration of your logger. (Or provide it with one, if it is using a default config)
For example, when using Hibernate with an active Log4J setup, Hibernate will automatically join in with the Log4J instance that you set up in your own application
It can be tuned, as per the normal Log4J config. This example uses the properties configuration style:
log4j.category.org.hibernate=WARN
Hibernate may join in with other logging mechanisms via the apache commons logging API. Look at how to configure your own logger and tune out the org.hibernate.* frequencies.
n.b. When debugging, switching back on
log4j.category.org.hibernate.SQL=INFO or DEBUG
can be useful. |
Since those log entries aren't problems, it sounds like the global log level has been turned up to DEBUG. Alternatively, perhaps a new Logging mechanism has been implemented or a new log Appender that writes to stdout, and thus is being re-logged by Weblogic. I would look at the configuration of your logger. (Or provide it with one, if it is using a default config)
For example, when using Hibernate with an active Log4J setup, Hibernate will automatically join in with the Log4J instance that you set up in your own application
It can be tuned, as per the normal Log4J config. This example uses the properties configuration style:
log4j.category.org.hibernate=WARN
Hibernate may join in with other logging mechanisms via the apache commons logging API. Look at how to configure your own logger and tune out the org.hibernate.* frequencies.
n.b. When debugging, switching back on
log4j.category.org.hibernate.SQL=INFO or DEBUG
can be useful. |
I found this during my research on Sqlite. I haven't had the chance to use it though. Let us know if this works for you.
<http://sqlite.phxsoftware.com/>
> **System.Data.SQLite** System.Data.SQLite is the original
> SQLite database engine and a complete
> ADO.NET 2.0 provider all rolled into a
> single mixed mode assembly.
>
> ...
>
> **Visual Studio 2005/2008 Design-Time
> Support**
>
> You can add a SQLite connection to the
> Server Explorer, create queries with
> the query designer, drag-and-drop
> tables onto a Typed DataSet and more!
> SQLite's designer works on full
> editions of Visual Studio 2005/2008,
> including VS2005 Express Editions.
> NEW You can create/edit views, tables, indexes, foreign keys,
> constraints and triggers interactively
> within the Visual Studio Server
> Explorer! |
Javadoc template generator |
|java|javadoc|documentation|generation| |
I have a large codebase without javadoc and I want to run a program to write a skeleton with the basic javadoc information (e.g. for each method's parameter write @param...) so I just have to fill the gaps left.
Somebody knows a good solution for this? |
I have a large codebase without javadoc and I want to run a program to write a skeleton with the basic javadoc information (e.g. for each method's parameter write @param...) so I just have to fill the gaps left.
Somebody knows a good solution for this?
Edit:
With the code generation of eclipse you have to add the javadoc one by one. You can't generate the javadoc of all the files of your project. What I want is some kind of program that searchs your whole codebase for methods without javadoc an creates an skeleton them. |
Secure session cookies in ASP.NET over HTTPS |
|asp.net|security|session|cookies| |
I got a little curious after reading [this /. article][1] over hijacking HTTPS cookies. I tracked it down a bit, and a good resource I stumbled across lists a few ways to secure cookies [here][2]. Must I use adsutil, or will setting requireSSL in the httpCookies section of web.config cover session cookies in addition to all others ([covered here][3])? Is there anything else I should be considering to harden sessions further?
[1]: http://it.slashdot.org/it/08/09/09/1558218.shtml
[2]: http://casabasecurity.com/content/using-aspnet-session-handling-secure-sites-set-secure-flag
[3]: http://msdn2.microsoft.com/en-us/library/ms228262.aspx |