When a UITextField with custom frame (200 × 54 px) loses focus, the text looks a little bit blurry.
example screenshot
Is this a common problem? Any workaround / solution or am I doing something wrong?
lets say i have a method which has two parameters. i have been implementing them as:
if(aObj instance of Marble) {
if(bObj instance of Bomb) {
this.resolve((Marble)aObj,(Bomb)bObj);
}
}
as you can see its not a very pretty solution. i plan to implement using double dispatching, but with two parameters which both need double dispatching, im afraid im a bit stumped. any ideas please.
im implementing in java btw.
The authlogic rails gem is doing a LOWER in the sql query.
SELECT * FROM `users` WHERE (LOWER(`users`.email) = '[email protected]') LIMIT 1
I want to get rid of the LOWER part since it seems to be slowing down the query by quite a bit.
I'd prefer to just lower the case in the code since this query seems to be expensive.
I'm not sure where to change this behavior in authlogic.
Thanks!
$(document).ready(function() {
$('#chekboxes a').click(function(e) {
$('.visible').removeClass('visible').addClass('invisible');
var thediv = $(this).attr('href');
$(thediv).removeClass('invisible').addClass('visible');
})
});
This simple bit of jq works in FF and not in Chrome and Safari.
Despite googling widely, I cannot tell whether there's a way to make it work in Safari and Chrome or not.
Does anyone know a fix or what is wrong ?
Thanks, Tom
I'm mainly a Python programmer, and it is often described as being "executable pseudo-code". I have used a little bit of AppleScript, which seems to be the most English-like programming language I have ever seen, because almost operators can be words, and it lets you use "the" anywhere (for example, this stupid example I just came up with:
firstnumber = 1
secondnumber = 2
if the firstnumber is equal to the secondnumber then
set the sum to 5
end if
is a valid AppleScript program. Are there any programming languages that are even more English-like than these?
I have a VC++ dll, which I want to register on my 32-bit Windows 7 machine using regsvr32.exe, however I have some problems with this.
When I register my DLL with regsvr32.exe, it shows registration successful, but when I check the entries in regedit, there is no entry in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID.
There is only one entry in Computer\HKEY_LOCAL_MACHINE\TypeLib with the guid mentioned in the project.
Can anyone help me on this?
I need to display 480 x 320 background image in OpenGL ES. The thing is I experienced a bit of a slow down in iPhone when I use 512 x 512 texture size. So I am finding an optimum case for rendering iPhone resolution size background in OpenGL ES. How should I slice the background in this case to obtain the best possible performance? My main concern is speed. Should I go for 256 x 256 or other texture sizes here?
Take the following function:
DataTable go()
{
return someTableAdapter.getSomeData();
}
When I set a breakpoint in this function, is there a possibility to inspect the returned value? The "go" function is directly coupled to a datagrid in an aspx page.
The only way to inspect the returned datatable, is to use a temporary variable... However, that's a bit inconvenient. Isn't there another way?
During a phone interview someone asked the question, "When looking at code, what the first thing that stands out to let you know its from a good/experienced developer".
I believe my answer was sufficient, just thought it was a bit strange so Im curious how some of you would answer?
As it is not possible to override a static class in c#, if i want to override a method I generally define a delegate matching the signature of the static method, then modify the method along the lines of:
public static void foo(int bar)
{
if (delegatename!=null)
{
delegatename.Invoke(bar);
}
else
{
//execute previous code as normal
}
}
I feel a twinge of guilt, knowing this is a bit messy.
Can anyone suggest a neater solution to this problem (other than rewriting the original structure)
Any ideas for an universal notification service like Adobe Wave? I need to send status updates (more specifically, things like document change notifications and the like). I could stick to RSS but then I will need either long URLs or HTTP authentications on feeds which not all the clients like. Adobe Wave looked promising but they are only desktop, in BETA, without active development, and seem a bit buggy sometimes. Any other ideas?
Mac OS X Leopard has a virtual desktop implementation called Spaces. I want to programatically detect which space the user is currently on.
Cocoa is preferable but AppleScript is acceptable if there's no other way.
I've seen a couple of AppleScript implementations, but the techniques they used seemed a bit too hacky to use in production code (one relied on causing and error and then parsing the error message to get the current space, the other interrogated the Spaces menu GUI)
I want to put a dynamically generated icon (not static image) + possibly a tiny bit of text in OSX menu bar.
If possible I'd prefer to do it from Ruby or some other convenient scripting language, but I'll deal with Objective C if that's the only way.
How do I do that?
I want to make a server written in C++ to power my game. I learned the basics of sockets and wrote a basic chat program that worked well. Now I want to create an HTTP server like Apache, but only for the AJAX request-response part.
I think just for the beginning i copied one Apache response text, and i sent the exact response with the C++ server program.
The problem that is that the browser (Firefox) connnects to the apache and everything works fine, except all of the requests get a correct response.
But if i send this with the C++ client, then FireBug tells me that the response status is OK (200) but there is no actual response text. (How is this possible?)
This response-text is exactly the same what apache sends. I made a bit-bit comparison and they were the same.
The php file wich is the original response
<?php echo "AS";echo rand(0,9); ?>
And the origional source code:
Socket.h http://pastebin.com/bW9qxtrR
Socket.cpp http://pastebin.com/S3c8RFM7
main.cpp http://pastebin.com/ckExuXsR
index.html http://pastebin.com/mcfEEqPP < this is the requester file.
ajax.js http://pastebin.com/uXJe9hVC
benchmark.js http://pastebin.com/djSYtKg9
jQuery is not needed.
The main.cpp there is lot of trash code like main3 and main4 functions, these do not affect the result.
I know that the response stuff in the C++ code is not really good because the connection closing is not the best; I will fix that later now I want to send a success response first.
UPDATE:
now i tested today a lot again and i find out there is no problem with the socket. I used the fiddler program to capture the the good answer and to capture the bad. They were the same. After this i turned off my socket application, and forced fiddler to auto respond, and the answer from the 'bad' answer still bat. So after that i replaced the bad with the good and nothing happedned. The bad answer with the good text still bad on the :8888 port but the other on the original :80 port was good, but they were absolutly the same and the same program sended it (fiddler) i think there is something missing if the response is not on the same server address (even not the same port).
UPDATE:
oh my god! i cant send ajax request to a remote server. now i know this.
Hi ,
New to smarty ,
Why people's showing interest in framework ,
What are the advantages in that , also lot of people little bit avoiding template what is the reason ,
What is the real reason people choosing the smarty ,
How much really smarty best for web development ,
Regards
Bharanikumar
Understanding that passing Datasets through web services is a bit heavy (and almost if not completely unconsumable to non .NET clients) what is the best way to prep database query results that don't map to known types for transport through web services in c#?
Almost all is dialed in except then I click the pause/play button, the current activeSlide div doesn't fade in on rollover like the other slides do. Bit at a loss to figure out why it's not allowing hover even though it works when the cycle is not manually paused (i.e. when just rolling over the pager numbers).
Thanks for any guidance!
http://www.xtracycle.com/home-test-a-rooney
What sort of minor annoyances do you run into using Delphi? I'm not looking for major issues such as "I want a 64-bit compiler." Just little things that can be easily worked around but still should have been implemented better so you don't have to work around them?
Marking this CW. I'm more interested in the answers than the points.
I'd like to use System.Net.IPAddress.TryParse to validate IPv6 addresses because I don't want to write my own reg exp :-)
However, this seems to allow strings such as "(validIPv6)](anythingatallhere)" - for example, "1234::5678:abcd]whargarbl".
Is there a reason for these being valid, or is this a fault?
This is further complicated by the fact that I actually want only strings of the form "[(validIPv6)]:(portnumber)" so I'm going to have to do a bit of validation myself.
I'm using the fragment identifier to create a permalink for AJAX events in my web app similar to this guy. Something like:
http://www.myapp.com/calendar#filter:year/2010/month/5
I've done quite a bit of searching but can't find a list of valid characters for the fragment idenitifer. The W3C spec doesn't offer anything.
Do I need to encode the characters the same as the URL in has in general?
There doesn't seem to be any good information on this anywhere.
I am finding myself doing the following a bit too often:
attr = getattr(obj, 'attr', None)
if attr is not None:
attr()
# Do something, either attr(), or func(attr), or whatever
else:
# Do something else
Is there a more pythonic way of writing that? Is this better? (At least not in performance, IMO.)
try:
obj.attr() # or whatever
except AttributeError:
# Do something else
I am setting up some redirects. I want to redirect the following URL:
/cms/index.php?cat_id=2
to the following URL:
/flash-chromatography
The rule I currently have is as follows:
RewriteCond %{QUERY_STRING} ^cat_id=2$ [NC]
RewriteRule ^cms/index\.php$ /flash-chromatography [L,R=301]
This rule is almost perfect apart from it redirect the URL to the following:
/flash-chromatography?cat_id=2
So you see my problem is it has kept the ?cat_id=2 part when I don't want it to.
How do I stop it keeping this bit?
What is a fast and efficient way to implement the server-side component for an autocomplete feature in an html input box?
I am writing a service to autocomplete user queries in our web interface's main search box, and the completions are displayed in an ajax-powered dropdown. The data we are running queries against is simply a large table of concepts our system knows about, which matches roughly with the set of wikipedia page titles. For this service obviously speed is of utmost importance, as responsiveness of the web page is important to the user experience.
The current implementation simply loads all concepts into memory in a sorted set, and performs a simple log(n) lookup on a user keystroke. The tailset is then used to provide additional matches beyond the closest match. The problem with this solution is that it does not scale. It currently is running up against the VM heap space limit (I've set -Xmx2g, which is about the most we can push on our 32 bit machines), and this prevents us from expanding our concept table or adding more functionality. Switching to 64-bit VMs on machines with more memory isn't an immediate option.
I've been hesitant to start working on a disk-based solution as I am concerned that disk seek time will kill performance. Are there possible solutions that will let me scale better, either entirely in memory or with some fast disk-backed implementations?
Edits:
@Gandalf: For our use case it is important the the autocompletion is comprehensive and isn't just extra help for the user. As for what we are completing, it is a list of concept-type pairs. For example, possible entries are [("Microsoft", "Software Company"), ("Jeff Atwood", "Programmer"), ("StackOverflow.com", "Website")]. We are using Lucene for the full search once a user selects an item from the autocomplete list, but I am not yet sure Lucene would work well for the autocomplete itself.
@Glen: No databases are being used here. When I'm talking about a table I just mean the structured representation of my data.
@Jason Day: My original implementation to this problem was to use a Trie, but the memory bloat with that was actually worse than the sorted set due to needing a large number of object references. I'll read on the ternary search trees to see if it could be of use.