I really wish that Google was better at searching for syntax:
decades :: (RealFrac a) => a -> a -> [a] -> Array Int Int
decades a b = hist (0,9) . map decade
where decade x = floor ((x - a) * s)
s = 10 / (b - a)
I have a query to a database that returns a number X of results. I am looking to return a maximum of 10 results. Is there a way to do this without using LIMIT 0,9? I'll use LIMIT if I have to, but I'd rather use something else that will literally stop the searching, rather than look at all rows and then only return the top 10.
While taking a look at this awesome thread I noticed that some examples use
PS1="Blah Blah Blah"
and some use
PROMPT_COMMAND="Blah Blah Blah"
(and some use both) when setting the prompt in a bash shell. What is the difference between the two? An SO search and even a bit of broader google searching aren't getting me results, so even a link to the right place to look for the answer would be appreciated. Thanks!
Hi All
I've been searching all over the internet for days.
Does anybody have, or know of, and can share sample Feature Driven Development documents? I keep coming across gazillions of "samples" with absolutely no useful information whatsoever.
Thank you
jt
I have a 2D array
1 2 3
4 5 6
7 8 9
and want to sort it like this
Snake
1 2 3
8 9 4
7 6 5
Snake (different)
1 2 3
6 5 4
7 8 9
Rotated
1 4 7
2 5 8
3 6 9
Wipe (diagonal)
1 3 6
2 5 8
4 7 9
Well, you got it, all kinds of sorting.
Searching the interweb for hours now. Any resources (specific language or pseudo code) on that greatly appreciated...
I am having a problem getting my devices to pair in Android. If I go into the settings and pair them manually I can get them to connect using the following code:
Server
// Make sure the device it discoverable
mServerSocket = mAdapter.listenUsingRfcommWithServiceRecord("Moo Productions Bluetooth Server", mUUID);
mState = State.ACCEPTING;
BluetoothSocket socket = mServerSocket.accept();
mServerSocket.close();
connected(socket);
Client
Set<BluetoothDevice> pairedDevices = mAdapter.getBondedDevices();
BluetoothSocket socket = null;
// Search the list of paired devices for the right one
for(BluetoothDevice device : pairedDevices)
{
try
{
mState = State.SEARCHING;
socket = device.createRfcommSocketToServiceRecord(mUUID);
mState = State.CONNECTING;
socket.connect();
connected(socket);
break;
}
catch (IOException e)
{
socket = null;
continue;
}
}
But if the devices hadn't already been paired it gets out of the foreach without connecting to a valid socket. In that case I start discovering.
// If that didn't work, discover
if(socket == null)
{
mState = State.SEARCHING;
mReceiver = new SocketReceiver();
mContext.registerReceiver(mReceiver, new IntentFilter(BluetoothDevice.ACTION_FOUND));
mAdapter.startDiscovery();
}
// ... Later ...
private class SocketReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
if(BluetoothDevice.ACTION_FOUND.equals(intent.getAction()))
{
try
{
// Get the device and try to open a socket
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
BluetoothSocket socket = device.createRfcommSocketToServiceRecord(mUUID);
mState = State.CONNECTING;
socket.connect();
// This is our boy, so stop looking
mAdapter.cancelDiscovery();
mContext.unregisterReceiver(mReceiver);
connected(socket);
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
}
}
}
But it will never find the other device. I never get a pairing dialog and when I step through I see that it discovers the correct device, but it fails to connect with this exception java.io.IOException: Service discovery failed. Any ideas as to what I'm missing?
I have a need to search a pdf file to see if a certin string is present. The string in question is definately encoded as text (ie. it is not an image or anything). I have tried just searching the file as though it was plain text, but this does not work.
Is it possible to do this? Are there any librarys out there for .net2.0 that will extract/decode all the text out of pdf file for me?
Hello,
I want to write fastest possible algorithm for 2 number multiplications.
Each number has max digits around 1000000 and is contained in string.
Anyone want to tell about this problem? I searching really speed solution.
Searching repository for plugin with prefix: 'eclipse'.
org.apache.maven.plugins: checking for updates from central
NG] repository metadata for: 'org.apache.maven.plugins' could not be retrieved from repository: central due to an error: Error transferring file: Connection timed out: connect
Repository 'central' will be blacklisted
] BUILD ERROR
The plugin 'org.apache.maven.plugins:maven-eclipse-plugin' does not exist or no valid version could be found
For more information, run Maven with the -e switch
Total time: 22 seconds
Finished at: Fri Aug 26 17:42:01 IST 2011
Final Memory: 3M/15M
Is there a right way to add empty table text? For example, if you go to the simulator and open contacts, the table is empty and displays "No Contacts". Or searching that gives "no results".
I could do this via a label positioned and hidden at run time, but is the correct approach?
Thanks for your help
Is there a way to reassign agents to a different container or will I have to create a new container and then create all new instances of the agents within the new container?
I have done a lot of searching and can't seem to find anything on container reassignment.
Thanks in advance for any info!
This is a follow up to this question. I'm totally blind so printed books aren't an option. All the recommended books appear to have been published before electronic publishing got started. I've been able to learn the very basics but would like something between here's what a register is, and the IBM reference material. Searching the normal places like Safari Books Online has come up dry.
I'm looking for a compiler or interpreter for a language with basic math support and File IO which can be executed directly from a memorystick in either Linux or Windows. Built in functionality for basic datastructures and sorting/searching would be a plus.
(I've read about movable python, but it only supports windows)
Thank you
Searching here and on the internet have not let me to a example of a Live Template for Delphi that generate a Property with getter / setter and also generate the private field and execute the complication. (SHIFT + CTRL + C)
Is this possible?
Hello,
I'm creating a java web application runing on a Tomcat server.
One of the functions fill in a StringBuffer variable with data.
At the end, I would like to propose the user to download the generated content packaged in a text file. This without having to store the file on the server.
I've been searching for a code snippet but couldn't find anything corresponding ...
I hope I've been clear enough on my problem.
Thanks in advance,
Hello,
I'm looking for an entry point in an EJB deployed on JBoss.
Servlets have the tag to use in its web.xml. I'm searching for similar init() functionality for an ejb.
I am in my semester vacation and i am looking to spend some time in learning how to develop Android application since this market is on fire these days, i have a background with programming and would like you to suggest ways or even sites that use baby steps tutorials to get an idea ( and hopefully ) create android application.
Any suggestions would be great since i spend the last 2 days searching the web without finding what i am looking for thanks.
HI! Could you please tell me how to resize a .png image. Or better give an example. I've been searching for the answer for a long time and it seems that nobody knows how to resize a .png image and keep its transparency. :(
Hello,
I am interested in a complex, mature and admin friendly cms. I am also searching the one with most extensions, packages, add-ons ...
I found these to be the most popular: alfresco, drupal, ez, joomla, dotcms, plone ...
Can you help me find the one I am looking for ? (dotcms and drupal are on my mind now)
Thank you.
Hi,
Similar to a print to pdf option, where we can choose PDF to be the output format when printing something, I am searching for something which can print to a power point file from a file. Is there any such plugin or tool? Also link to a relilable print to pdf tool would be helpful.
This essentially would eliminate the export to power point option that the users are asking for.
Thanks...
I have been searching around using Google but I can't find an answer to this question.
A robots.txt file can contain the following line:
Sitemap: http://www.mysite.com/sitemapindex.xml
but is it possible to specify MULTIPLE sitemap index files in the robots.txt and have the search engines recognize that and crawl ALL of the sitemaps referenced in each sitemap index file? For example, will this work:
Sitemap: http://www.mysite.com/sitemapindex1.xml
Sitemap: http://www.mysite.com/sitemapindex2.xml
Sitemap: http://www.mysite.com/sitemapindex3.xml
Dear friends,
I've been searching for a hosting solution for a grails application.
I've read some very good comments on slicehost, but not much about linode.
could some one with the experiences of either of them share your insights please?
thanks.
So what i need is a query or some tip on how to turn all titles on a wordpress powered website into capitalized case.
What i have now is something like this:
AAAAA BBBBB CCCCC
I want it to be like this:
Aaaaa Bbbbb Ccccc
I did try googling and searching here, but have failed at that task so any help is much appreciated!
Hi,
I'm trying to download a file from the internet, but I get the error -3001 back. I've been searching through google but the error doesn't appear on any website, so i have no idea what it means.
Can anyone tell me what the error code "NSURLErrorDomain error -3001" means?
Thanks