PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,692,912 | 07/27/2012 17:41:43 | 299,230 | 03/22/2010 17:29:47 | 682 | 9 | Quickest way to change service call to file dumping | I am using JaxWsPortProxyFactoryBean for a service call but we got a coupling between two system. When they are down, it failed our process. So we decided to do a fast-foward changing the web service into a file dumping process.
My goal is:
1. Although we still need data/service contract between two systems, I don't want it to become a old code-sharing problem. I want to keep the data/service contract simple and transparent.
2. We have limited time-frame, so I want it can be done beautifully and quickly without huge change.
You guys are smart. Does anybody has a good suggestion?
| java | web-services | file-transfer | null | null | null | open | Quickest way to change service call to file dumping
===
I am using JaxWsPortProxyFactoryBean for a service call but we got a coupling between two system. When they are down, it failed our process. So we decided to do a fast-foward changing the web service into a file dumping process.
My goal is:
1. Although we still need data/service contract between two systems, I don't want it to become a old code-sharing problem. I want to keep the data/service contract simple and transparent.
2. We have limited time-frame, so I want it can be done beautifully and quickly without huge change.
You guys are smart. Does anybody has a good suggestion?
| 0 |
11,349,221 | 07/05/2012 17:11:40 | 1,080,350 | 12/04/2011 18:12:12 | 197 | 0 | About reducing the branch miss prediciton | I saw a sentence in a paper "Transforming branches into data dependencies to avoid mispredicted branches." (Page 6)
I wonder how to change the code from branches into data dependencies.
This is the paper address: www.adms-conf.org/p1-SCHLEGEL.pdf | algorithm | branch | null | null | null | null | open | About reducing the branch miss prediciton
===
I saw a sentence in a paper "Transforming branches into data dependencies to avoid mispredicted branches." (Page 6)
I wonder how to change the code from branches into data dependencies.
This is the paper address: www.adms-conf.org/p1-SCHLEGEL.pdf | 0 |
11,349,222 | 07/05/2012 17:11:44 | 180,862 | 09/29/2009 03:40:19 | 1,481 | 8 | Create a EBS volume from last EBS snapshot of a few snapshots of same EBS volume | I have a EBS backed EC2 instance. I take snapshot for the EBS volume a few times say s1, s2, s3 where s3 being the last one took. Now I need to launch another EBS backed EC2 instance and also want to apply the snapshot took earlier onto the EBS volume of the new instance. I know that the EBS snapshots were taken incrementally, meaning that only the changed blocks since last snapshot will be captured. I wonder if I only apply the last snapshot (s3) on to the new EBS volume, does it mean that the data captured in s1 and s2 won't get on to the new volume? Or put in another way, do I need to apply s1, s2, s3 sequentially and manually on to the new volume in order to get the full data set? | snapshot | amazon-ebs | null | null | null | null | open | Create a EBS volume from last EBS snapshot of a few snapshots of same EBS volume
===
I have a EBS backed EC2 instance. I take snapshot for the EBS volume a few times say s1, s2, s3 where s3 being the last one took. Now I need to launch another EBS backed EC2 instance and also want to apply the snapshot took earlier onto the EBS volume of the new instance. I know that the EBS snapshots were taken incrementally, meaning that only the changed blocks since last snapshot will be captured. I wonder if I only apply the last snapshot (s3) on to the new EBS volume, does it mean that the data captured in s1 and s2 won't get on to the new volume? Or put in another way, do I need to apply s1, s2, s3 sequentially and manually on to the new volume in order to get the full data set? | 0 |
11,349,223 | 07/05/2012 17:11:47 | 1,327,815 | 04/11/2012 23:36:12 | 78 | 9 | Cannot use Mail.php from command line | I have a php script that is going to be a cron job and it was working fine until I added the email script I have been using.
I have used the email script all over the site before but when I try and run the cron job using it from the command line it fails.
The mail script looks as followed
<?php
require_once "Mail.php";
function sendMail($to, $from, $subject, $message) {
$no_errors = true;
$host = "ssl://smtp.server.com";
$port = "465";
$username1 = "username";
$password = "password";
$headers = array ('From' => '[email protected]',
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username1,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
$no_errors = false;
echo $mail->getMessage();
} else {
$no_errors = true;
}
return $no_errors;
}
?>
If I comment out the include send_mail.php it works fine but doesn't send email.
Any ideas? | php | email | ubuntu | cron | smtp | null | open | Cannot use Mail.php from command line
===
I have a php script that is going to be a cron job and it was working fine until I added the email script I have been using.
I have used the email script all over the site before but when I try and run the cron job using it from the command line it fails.
The mail script looks as followed
<?php
require_once "Mail.php";
function sendMail($to, $from, $subject, $message) {
$no_errors = true;
$host = "ssl://smtp.server.com";
$port = "465";
$username1 = "username";
$password = "password";
$headers = array ('From' => '[email protected]',
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'port' => $port,
'auth' => true,
'username' => $username1,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
$no_errors = false;
echo $mail->getMessage();
} else {
$no_errors = true;
}
return $no_errors;
}
?>
If I comment out the include send_mail.php it works fine but doesn't send email.
Any ideas? | 0 |
11,349,224 | 07/05/2012 17:11:50 | 1,415,802 | 05/24/2012 18:27:25 | 132 | 5 | MS access SELECT INTO in vba | I'm having some issues with some functionality of my application. There is a particular instance where I have an instance of a 'pending class' on a form for an administrator to review. The form is populated with students associated with this pending class. After their grades are finished, I have a button at the footer that will delete this class from my 'pending' table and add the grades to all of the students. This works.
However, I want to essentially copy this pending class, which just has the class name, date, and teacher to a completed class table before it's deleted from pending. Since no data about this class other than the primary key(class number) persists throughout this form, I can't populate the other fields(class name, date) of the row into my completed class table.
I am trying a "SELECT INTO" operation in VBA to get these values. It's going like this:
dim cname as String
dim classdate as Date
dim pid as integer
dim teacher as String
dim qry as String
pid = [Forms]![frmClasses]![txtID]
qry = "Select className INTO cname FROM tblPending WHERE tblPending.id = " & " ' " & pid & " ' " & ";"
db.execute qry
debug.print qry
debug.print cname
From here, I do the same operations for each other variable, build my INSERT query, and execute it. The problem is-- my select into's are not working. Debug.print shows that the local variables were never initialized from the SELECT INTO statement. Any thoughts?
| sql | ms-access | vba | null | null | null | open | MS access SELECT INTO in vba
===
I'm having some issues with some functionality of my application. There is a particular instance where I have an instance of a 'pending class' on a form for an administrator to review. The form is populated with students associated with this pending class. After their grades are finished, I have a button at the footer that will delete this class from my 'pending' table and add the grades to all of the students. This works.
However, I want to essentially copy this pending class, which just has the class name, date, and teacher to a completed class table before it's deleted from pending. Since no data about this class other than the primary key(class number) persists throughout this form, I can't populate the other fields(class name, date) of the row into my completed class table.
I am trying a "SELECT INTO" operation in VBA to get these values. It's going like this:
dim cname as String
dim classdate as Date
dim pid as integer
dim teacher as String
dim qry as String
pid = [Forms]![frmClasses]![txtID]
qry = "Select className INTO cname FROM tblPending WHERE tblPending.id = " & " ' " & pid & " ' " & ";"
db.execute qry
debug.print qry
debug.print cname
From here, I do the same operations for each other variable, build my INSERT query, and execute it. The problem is-- my select into's are not working. Debug.print shows that the local variables were never initialized from the SELECT INTO statement. Any thoughts?
| 0 |
11,349,219 | 07/05/2012 17:11:33 | 265,341 | 02/03/2010 14:33:09 | 2,279 | 114 | Android Videos format | I'm a set of videos to be played in my android application.<br>
The app is able to play videos perfectly on some android phones. In some phones, it just starts and goes to black screen.<br>
How can I fix the video issue. Is it the issue with video format? <br>
If yes, what format do I have to use so that it works in all android phones.<br>
<br>
Thanks in advance. | android | video | format | null | null | null | open | Android Videos format
===
I'm a set of videos to be played in my android application.<br>
The app is able to play videos perfectly on some android phones. In some phones, it just starts and goes to black screen.<br>
How can I fix the video issue. Is it the issue with video format? <br>
If yes, what format do I have to use so that it works in all android phones.<br>
<br>
Thanks in advance. | 0 |
11,349,220 | 07/05/2012 17:11:37 | 1,001,919 | 10/18/2011 20:04:38 | 155 | 1 | print iframe height larger than page | I have an iframe larger than the max of a print page. So when I call print, The Iframe is truncate.
How print everything of the iframe (on multiple page)
----------
Sample:
Main page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head></head>
<body>
<p>Before</p>
<iframe src="IframeData.html" id="IframeData" name="IframeData" frameborder="0" scrolling="no" noresize></iframe>
<p>After</p>
</body>
</html>
IframePage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
function setHeight(IFrameId) {
if (parent !== self) {
var parentFrame = parent.document.getElementById(IFrameId);
parentFrame.style.height = document['body'].offsetHeight + 20;
}
}
</script>
</head>
<body onload="setHeight('IframeData')">
A lot of text
</body>
</html> | iframe | printing | null | null | null | null | open | print iframe height larger than page
===
I have an iframe larger than the max of a print page. So when I call print, The Iframe is truncate.
How print everything of the iframe (on multiple page)
----------
Sample:
Main page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head></head>
<body>
<p>Before</p>
<iframe src="IframeData.html" id="IframeData" name="IframeData" frameborder="0" scrolling="no" noresize></iframe>
<p>After</p>
</body>
</html>
IframePage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script language="javascript" type="text/javascript">
function setHeight(IFrameId) {
if (parent !== self) {
var parentFrame = parent.document.getElementById(IFrameId);
parentFrame.style.height = document['body'].offsetHeight + 20;
}
}
</script>
</head>
<body onload="setHeight('IframeData')">
A lot of text
</body>
</html> | 0 |
11,349,232 | 07/05/2012 17:12:20 | 1,176,806 | 01/29/2012 18:46:45 | 147 | 6 | Compute Angle Between Quaternions (in Matlab) | I am working on a project where I have many quaternion attitude vectors, and I want to find the 'precision' of these quaternions with respect to each-other.
Without being an expert in this type of thing, my first thought is to find the angle between each (normalized) quaternion, and then find the RMS of that angle. That will give a measure of the precision of our attitude measurements. I was going to use a simple dot product to get this angle.
I don't know that this is a good solution though. Don't know if the dot product will necessarily work between quaternions though.
Note that just want a scalar representation of the pointing precision, and that the differences will on the order of arcseconds. I had also thought to convert to Euler Angles and then just use the vector part of that the Euler Angles.
Doing the math in MATLAB, but really I'm just looking for the theory behind it.
Thanks for the help! | matlab | rotation | quaternion | null | null | 07/07/2012 12:56:26 | off topic | Compute Angle Between Quaternions (in Matlab)
===
I am working on a project where I have many quaternion attitude vectors, and I want to find the 'precision' of these quaternions with respect to each-other.
Without being an expert in this type of thing, my first thought is to find the angle between each (normalized) quaternion, and then find the RMS of that angle. That will give a measure of the precision of our attitude measurements. I was going to use a simple dot product to get this angle.
I don't know that this is a good solution though. Don't know if the dot product will necessarily work between quaternions though.
Note that just want a scalar representation of the pointing precision, and that the differences will on the order of arcseconds. I had also thought to convert to Euler Angles and then just use the vector part of that the Euler Angles.
Doing the math in MATLAB, but really I'm just looking for the theory behind it.
Thanks for the help! | 2 |
11,349,238 | 07/05/2012 17:12:46 | 1,357,289 | 04/25/2012 21:31:51 | 1 | 0 | Copy a method declaration from one CompilationUnit AST to the AST of another Compilation Unit in Eclipse JDT | I am trying to copy a method declaration from the first AST (where the method declaration originally resides) to another AST. What I tried to do was to copy the method declaration using the ASTRewrite of the original compilation unit, which then I add to the ListRewrite of the second compilation unit in the code below.
MethodDeclaration newMethodDeclaration = (MethodDeclaration) oldCURewrite.createCopyTarget(oldMethodDeclaration);
astRewrite.getListRewrite(typeDeclaration, TypeDeclaration.BODY_DECLARATIONS_PROPERTY).insertAfter(newMethodDeclaration, constructor, null);
However, this gives me a MISSING method declaration and not the correct one. No exceptions are being thrown during the procedure.
Is there any standard way to do the copy or do I have to create all child nodes of the method declarations from start? (which will be too difficult, if possible)
thanks | eclipse | jdt | null | null | null | null | open | Copy a method declaration from one CompilationUnit AST to the AST of another Compilation Unit in Eclipse JDT
===
I am trying to copy a method declaration from the first AST (where the method declaration originally resides) to another AST. What I tried to do was to copy the method declaration using the ASTRewrite of the original compilation unit, which then I add to the ListRewrite of the second compilation unit in the code below.
MethodDeclaration newMethodDeclaration = (MethodDeclaration) oldCURewrite.createCopyTarget(oldMethodDeclaration);
astRewrite.getListRewrite(typeDeclaration, TypeDeclaration.BODY_DECLARATIONS_PROPERTY).insertAfter(newMethodDeclaration, constructor, null);
However, this gives me a MISSING method declaration and not the correct one. No exceptions are being thrown during the procedure.
Is there any standard way to do the copy or do I have to create all child nodes of the method declarations from start? (which will be too difficult, if possible)
thanks | 0 |
11,349,175 | 07/05/2012 17:08:49 | 1,488,527 | 06/28/2012 12:23:55 | 1 | 0 | IE7 throwing jQuery's 'Stack overflow at line: 0' error | I have a small script on jQuery 1.7.2. Essentially, it displays the thumbnail, and then is replaced with the full image once that has loaded.
<img src="http://site.com/thumbnail.jpg" data-original="http://site.com/original.jpg" class="preload">
Within jQuery, I simply have:
$('.preload').load(function(){
$(this).attr('src', $(this).attr("alt"));
});
Which works fine on browsers such as Firefox, Chrome, and even IE8. However, IE7 will continue to throw a
Stack overflow at line: 0
Error (multiplied by the number of elements that have the preload class).
If I remove the class from the images.. the error is not shown.
Thanks | jquery | internet-explorer-7 | stack | overflow | preload | null | open | IE7 throwing jQuery's 'Stack overflow at line: 0' error
===
I have a small script on jQuery 1.7.2. Essentially, it displays the thumbnail, and then is replaced with the full image once that has loaded.
<img src="http://site.com/thumbnail.jpg" data-original="http://site.com/original.jpg" class="preload">
Within jQuery, I simply have:
$('.preload').load(function(){
$(this).attr('src', $(this).attr("alt"));
});
Which works fine on browsers such as Firefox, Chrome, and even IE8. However, IE7 will continue to throw a
Stack overflow at line: 0
Error (multiplied by the number of elements that have the preload class).
If I remove the class from the images.. the error is not shown.
Thanks | 0 |
11,349,242 | 07/05/2012 17:13:13 | 567,947 | 01/08/2011 11:00:14 | 471 | 23 | Concurrent views of MemoryMappedFile throws UnauthorizedAccessException | I have a large text file (0.5 gig) which I need to parse over and over in different situations, as much as 40 times in a single method. Of course this is going to take a long time and I tried to work over the file faster by doing it concurrently. I understand that a `MemoryMappedFile` is great for handling large files and concurrency so I chose to use it.
Now, I'm concurrently creating two views of the file (the views are of two different parts) but while one view works great the other one throws an `UnauthorizedAccessException`. Here's the guilty code:
private void PartitionAndAnalyzeTextBlock(int start, int length)
{
Console.WriteLine("Starting analysis");
//Exception thrown here
using (var accessor = file.CreateViewAccessor(start, length, MemoryMappedFileAccess.Read))
{
char[] buffer = new char[BufferSize];
for (long i = 0; i < length; i += 5)
{
accessor.ReadArray(i, buffer, 0, 5);
string retString = new string(buffer);
frequencyCounter.AddOrUpdate(retString, 1, (s, j) => j++);
}
}
Console.WriteLine("Finished analysis");
}
`file` is instantiated in this line:
private MemoryMappedFile file = MemoryMappedFile.CreateFromFile(path, FileMode.Open, "MemoryMappedPi");
Do you have any idea what would cause this?
| c# | .net | c#-4.0 | null | null | null | open | Concurrent views of MemoryMappedFile throws UnauthorizedAccessException
===
I have a large text file (0.5 gig) which I need to parse over and over in different situations, as much as 40 times in a single method. Of course this is going to take a long time and I tried to work over the file faster by doing it concurrently. I understand that a `MemoryMappedFile` is great for handling large files and concurrency so I chose to use it.
Now, I'm concurrently creating two views of the file (the views are of two different parts) but while one view works great the other one throws an `UnauthorizedAccessException`. Here's the guilty code:
private void PartitionAndAnalyzeTextBlock(int start, int length)
{
Console.WriteLine("Starting analysis");
//Exception thrown here
using (var accessor = file.CreateViewAccessor(start, length, MemoryMappedFileAccess.Read))
{
char[] buffer = new char[BufferSize];
for (long i = 0; i < length; i += 5)
{
accessor.ReadArray(i, buffer, 0, 5);
string retString = new string(buffer);
frequencyCounter.AddOrUpdate(retString, 1, (s, j) => j++);
}
}
Console.WriteLine("Finished analysis");
}
`file` is instantiated in this line:
private MemoryMappedFile file = MemoryMappedFile.CreateFromFile(path, FileMode.Open, "MemoryMappedPi");
Do you have any idea what would cause this?
| 0 |
11,349,244 | 07/05/2012 17:13:16 | 1,469,673 | 06/20/2012 15:05:00 | 12 | 0 | iPad Animation of modal view controller from table cell | So I'm creating an iPad app that displays images in a UITableView and when when a row/image is selected it pushes another view controller that plays a video in full screen. This is all working correctly but I want to animate the transition from the image's original size in the table to the fullscreen video. This video here displays what I want at about 1 second in http://www.apple.com/ipad/videos/#itunes. So how would I get the frame of the cell that is selected? And how would I transition the view from the cell frame to full screen?
Here is how I am doing the transition now:
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
if (indexPath.row == 0)
{
VideoViewController * video1 = [[VideoViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:video1];
navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
navController.modalPresentationStyle = UIModalPresentationFullScreen;
navController.navigationBarHidden = YES;
[self presentModalViewController:navController animated:YES];
}
}
| iphone | ios | xcode | ipad | null | null | open | iPad Animation of modal view controller from table cell
===
So I'm creating an iPad app that displays images in a UITableView and when when a row/image is selected it pushes another view controller that plays a video in full screen. This is all working correctly but I want to animate the transition from the image's original size in the table to the fullscreen video. This video here displays what I want at about 1 second in http://www.apple.com/ipad/videos/#itunes. So how would I get the frame of the cell that is selected? And how would I transition the view from the cell frame to full screen?
Here is how I am doing the transition now:
- (void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
if (indexPath.row == 0)
{
VideoViewController * video1 = [[VideoViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:video1];
navController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
navController.modalPresentationStyle = UIModalPresentationFullScreen;
navController.navigationBarHidden = YES;
[self presentModalViewController:navController animated:YES];
}
}
| 0 |
11,349,246 | 07/05/2012 17:13:24 | 734,094 | 05/02/2011 07:44:33 | 60 | 1 | Solr 4.0 UI issue | I just discovered today that there is a new solr release (4.0 ALPHA). So, I give it a try. After setting it up (under Tomcat) I had the following error message:
This interface requires that you activate the admin request handlers, add the following configuration to your solrconfig.xml:
<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->
<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
The above error popped up when I added the following in the solrconfig.xml:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
Does anybody know what it is wrong?
Thank you in advance,
Tom
Greece
**The solr folder structure:**
+solr
+conf
+data
+lib
-contrib
-dist
**The solr.xml file:**
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
</cores>
</solr>
**The solrconfig.xml file:**
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="lib/dist/" regex="apache-solr-cell-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-clustering-\d.*\.jar" />
<lib dir="lib/contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
<!--<lib dir="lib/contrib/dataimporthandler/lib/" regex=".*\.jar" />-->
<lib dir="lib/dist/" regex="apache-solr-langid-\d.*\.jar" />
<lib dir="lib/contrib/langid/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-velocity-\d.*\.jar" />
<lib dir="lib/contrib/velocity/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex="tika-core-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex="tika-parsers-\d.*\.jar" />
<lib dir="/total/crap/dir/ignored" />
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<indexConfig>
</indexConfig>
<jmx />
<updateHandler class="solr.DirectUpdateHandler2">
<autoCommit>
<maxTime>15000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<updateLog>
<str name="dir">${solr.data.dir:}</str>
</updateLog>
</updateHandler>
<query>
<maxBooleanClauses>1024</maxBooleanClauses>
<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<queryResultCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<documentCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<queryResultWindowSize>20</queryResultWindowSize>
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<listener event="newSearcher" class="solr.QuerySenderListener">
<arr name="queries">
</arr>
</listener>
<listener event="firstSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<lst>
<str name="q">static firstSearcher warming in solrconfig.xml</str>
</lst>
</arr>
</listener>
<useColdSearcher>false</useColdSearcher>
<maxWarmingSearchers>2</maxWarmingSearchers>
</query>
<requestDispatcher handleSelect="false" >
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000" />
<httpCaching never304="true" />
</requestDispatcher>
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="df">text</str>
</lst>
</requestHandler>
<requestHandler name="/query" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="wt">json</str>
<str name="indent">true</str>
<str name="df">text</str>
</lst>
</requestHandler>
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
</lst>
</requestHandler>
<requestHandler name="/browse" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<!-- VelocityResponseWriter settings -->
<str name="wt">velocity</str>
<str name="v.template">browse</str>
<str name="v.layout">layout</str>
<str name="title">Solritas</str>
<!-- Query settings -->
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="mm">100%</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
<str name="mlt.qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
<int name="mlt.count">3</int>
<!-- Faceting defaults -->
<str name="facet">on</str>
<str name="facet.field">cat</str>
<str name="facet.field">manu_exact</str>
<str name="facet.query">ipod</str>
<str name="facet.query">GB</str>
<str name="facet.mincount">1</str>
<str name="facet.pivot">cat,inStock</str>
<str name="facet.range.other">after</str>
<str name="facet.range">price</str>
<int name="f.price.facet.range.start">0</int>
<int name="f.price.facet.range.end">600</int>
<int name="f.price.facet.range.gap">50</int>
<str name="facet.range">popularity</str>
<int name="f.popularity.facet.range.start">0</int>
<int name="f.popularity.facet.range.end">10</int>
<int name="f.popularity.facet.range.gap">3</int>
<str name="facet.range">manufacturedate_dt</str>
<str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
<str name="f.manufacturedate_dt.facet.range.end">NOW</str>
<str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
<str name="f.manufacturedate_dt.facet.range.other">before</str>
<str name="f.manufacturedate_dt.facet.range.other">after</str>
<!-- Highlighting defaults -->
<str name="hl">on</str>
<str name="hl.fl">text features name</str>
<str name="f.name.hl.fragsize">0</str>
<str name="f.name.hl.alternateField">name</str>
<!-- Spell checking defaults -->
<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">false</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.alternativeTermCount">2</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">5</str>
<str name="spellcheck.maxCollations">3</str>
</lst>
<!-- append spellchecking to our list of components -->
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<requestHandler name="/update" class="solr.UpdateRequestHandler">
</requestHandler>
<requestHandler name="/update/extract"
startup="lazy"
class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
<!-- All the main content goes into "text"... if you need to return
the extracted text or do highlighting, use a stored field. -->
<str name="fmap.content">text</str>
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
<!-- capture link hrefs but ignore div attributes -->
<str name="captureAttr">true</str>
<str name="fmap.a">links</str>
<str name="fmap.div">ignored_</str>
</lst>
</requestHandler>
<requestHandler name="/analysis/field"
startup="lazy"
class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/analysis/document"
class="solr.DocumentAnalysisRequestHandler"
startup="lazy" />
<requestHandler name="/admin/"
class="solr.admin.AdminHandlers" />
<!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<!-- Echo the request contents back to the client -->
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">textSpell</str>
<!-- a spellchecker built from a field of the main index -->
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">name</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
<float name="accuracy">0.5</float>
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
<int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->
<int name="minPrefix">1</int>
<!-- maximum number of inspections per result. -->
<int name="maxInspections">5</int>
<!-- minimum length of a query term to be considered for correction -->
<int name="minQueryLength">4</int>
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
<float name="maxQueryFrequency">0.01</float>
<!-- uncomment this to require suggestions to occur in 1% of the documents
<float name="thresholdTokenFrequency">.01</float>
-->
</lst>
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="field">name</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
</lst>
</searchComponent>
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.alternativeTermCount">5</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.maxCollations">5</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<bool name="tv">true</bool>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
<searchComponent name="clustering"
enable="${solr.clustering.enabled:false}"
class="solr.clustering.ClusteringComponent" >
<!-- Declare an engine -->
<lst name="engine">
<!-- The name, only one can be named "default" -->
<str name="name">default</str>
<str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
<str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
<str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
<str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
</lst>
<lst name="engine">
<str name="name">stc</str>
<str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
</lst>
</searchComponent>
<requestHandler name="/clustering"
startup="lazy"
enable="${solr.clustering.enabled:false}"
class="solr.SearchHandler">
<lst name="defaults">
<bool name="clustering">true</bool>
<str name="clustering.engine">default</str>
<bool name="clustering.results">true</bool>
<!-- The title field -->
<str name="carrot.title">name</str>
<str name="carrot.url">id</str>
<!-- The field to cluster on -->
<str name="carrot.snippet">features</str>
<!-- produce summaries -->
<bool name="carrot.produceSummary">true</bool>
<!-- the maximum number of labels per cluster -->
<!--<int name="carrot.numDescriptions">5</int>-->
<!-- produce sub clusters -->
<bool name="carrot.outputSubClusters">false</bool>
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
</lst>
<arr name="last-components">
<str>clustering</str>
</arr>
</requestHandler>
<searchComponent name="terms" class="solr.TermsComponent"/>
<!-- A request handler for demonstrating the terms component -->
<requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<bool name="terms">true</bool>
</lst>
<arr name="components">
<str>terms</str>
</arr>
</requestHandler>
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>
<!-- A request handler for demonstrating the elevator component -->
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="df">text</str>
</lst>
<arr name="last-components">
<str>elevator</str>
</arr>
</requestHandler>
<searchComponent class="solr.HighlightComponent" name="highlight">
<highlighting>
<!-- Configure the standard fragmenter -->
<!-- This could most likely be commented out in the "default" case -->
<fragmenter name="gap"
default="true"
class="solr.highlight.GapFragmenter">
<lst name="defaults">
<int name="hl.fragsize">100</int>
</lst>
</fragmenter>
<fragmenter name="regex"
class="solr.highlight.RegexFragmenter">
<lst name="defaults">
<!-- slightly smaller fragsizes work better because of slop -->
<int name="hl.fragsize">70</int>
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
<str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
</lst>
</fragmenter>
<!-- Configure the standard formatter -->
<formatter name="html"
default="true"
class="solr.highlight.HtmlFormatter">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
<str name="hl.simple.post"><![CDATA[</em>]]></str>
</lst>
</formatter>
<!-- Configure the standard encoder -->
<encoder name="html"
class="solr.highlight.HtmlEncoder" />
<!-- Configure the standard fragListBuilder -->
<fragListBuilder name="simple"
class="solr.highlight.SimpleFragListBuilder"/>
<!-- Configure the single fragListBuilder -->
<fragListBuilder name="single"
class="solr.highlight.SingleFragListBuilder"/>
<!-- Configure the weighted fragListBuilder -->
<fragListBuilder name="weighted"
default="true"
class="solr.highlight.WeightedFragListBuilder"/>
<!-- default tag FragmentsBuilder -->
<fragmentsBuilder name="default"
default="true"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<!--
<lst name="defaults">
<str name="hl.multiValuedSeparatorChar">/</str>
</lst>
-->
</fragmentsBuilder>
<!-- multi-colored tag FragmentsBuilder -->
<fragmentsBuilder name="colored"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<lst name="defaults">
<str name="hl.tag.pre"><![CDATA[
<b style="background:yellow">,<b style="background:lawgreen">,
<b style="background:aquamarine">,<b style="background:magenta">,
<b style="background:palegreen">,<b style="background:coral">,
<b style="background:wheat">,<b style="background:khaki">,
<b style="background:lime">,<b style="background:deepskyblue">]]></str>
<str name="hl.tag.post"><![CDATA[</b>]]></str>
</lst>
</fragmentsBuilder>
<boundaryScanner name="default"
default="true"
class="solr.highlight.SimpleBoundaryScanner">
<lst name="defaults">
<str name="hl.bs.maxScan">10</str>
<str name="hl.bs.chars">.,!? 	 </str>
</lst>
</boundaryScanner>
<boundaryScanner name="breakIterator"
class="solr.highlight.BreakIteratorBoundaryScanner">
<lst name="defaults">
<!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
<str name="hl.bs.type">WORD</str>
<!-- language and country are used when constructing Locale object. -->
<!-- And the Locale object will be used when getting instance of BreakIterator -->
<str name="hl.bs.language">en</str>
<str name="hl.bs.country">US</str>
</lst>
</boundaryScanner>
</highlighting>
</searchComponent>
<queryResponseWriter name="json" class="solr.JSONResponseWriter">
<str name="content-type">text/plain; charset=UTF-8</str>
</queryResponseWriter>
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>
<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
<admin>
<defaultQuery>*:*</defaultQuery>
</admin>
</config>
| pdf | solr | binary | indexing | null | null | open | Solr 4.0 UI issue
===
I just discovered today that there is a new solr release (4.0 ALPHA). So, I give it a try. After setting it up (under Tomcat) I had the following error message:
This interface requires that you activate the admin request handlers, add the following configuration to your solrconfig.xml:
<!-- Admin Handlers - This will register all the standard admin RequestHandlers. -->
<requestHandler name="/admin/" class="solr.admin.AdminHandlers" />
The above error popped up when I added the following in the solrconfig.xml:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
Does anybody know what it is wrong?
Thank you in advance,
Tom
Greece
**The solr folder structure:**
+solr
+conf
+data
+lib
-contrib
-dist
**The solr.xml file:**
<?xml version="1.0" encoding="UTF-8" ?>
<solr persistent="false">
<cores adminPath="/admin/cores" defaultCoreName="collection1">
<core name="collection1" instanceDir="." />
</cores>
</solr>
**The solrconfig.xml file:**
<?xml version="1.0" encoding="UTF-8" ?>
<config>
<luceneMatchVersion>LUCENE_40</luceneMatchVersion>
<lib dir="lib/dist/" regex="apache-solr-cell-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-clustering-\d.*\.jar" />
<lib dir="lib/contrib/clustering/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-dataimporthandler-\d.*\.jar" />
<!--<lib dir="lib/contrib/dataimporthandler/lib/" regex=".*\.jar" />-->
<lib dir="lib/dist/" regex="apache-solr-langid-\d.*\.jar" />
<lib dir="lib/contrib/langid/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-velocity-\d.*\.jar" />
<lib dir="lib/contrib/velocity/lib/" regex=".*\.jar" />
<lib dir="lib/dist/" regex="apache-solr-dataimporthandler-extras-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex="tika-core-\d.*\.jar" />
<lib dir="lib/contrib/extraction/lib/" regex="tika-parsers-\d.*\.jar" />
<lib dir="/total/crap/dir/ignored" />
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory"
class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/>
<indexConfig>
</indexConfig>
<jmx />
<updateHandler class="solr.DirectUpdateHandler2">
<autoCommit>
<maxTime>15000</maxTime>
<openSearcher>false</openSearcher>
</autoCommit>
<updateLog>
<str name="dir">${solr.data.dir:}</str>
</updateLog>
</updateHandler>
<query>
<maxBooleanClauses>1024</maxBooleanClauses>
<filterCache class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<queryResultCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<documentCache class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<queryResultWindowSize>20</queryResultWindowSize>
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
<listener event="newSearcher" class="solr.QuerySenderListener">
<arr name="queries">
</arr>
</listener>
<listener event="firstSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<lst>
<str name="q">static firstSearcher warming in solrconfig.xml</str>
</lst>
</arr>
</listener>
<useColdSearcher>false</useColdSearcher>
<maxWarmingSearchers>2</maxWarmingSearchers>
</query>
<requestDispatcher handleSelect="false" >
<requestParsers enableRemoteStreaming="true"
multipartUploadLimitInKB="2048000" />
<httpCaching never304="true" />
</requestDispatcher>
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
</requestHandler>
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10</int>
<str name="df">text</str>
</lst>
</requestHandler>
<requestHandler name="/query" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="wt">json</str>
<str name="indent">true</str>
<str name="df">text</str>
</lst>
</requestHandler>
<requestHandler name="/get" class="solr.RealTimeGetHandler">
<lst name="defaults">
<str name="omitHeader">true</str>
</lst>
</requestHandler>
<requestHandler name="/browse" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<!-- VelocityResponseWriter settings -->
<str name="wt">velocity</str>
<str name="v.template">browse</str>
<str name="v.layout">layout</str>
<str name="title">Solritas</str>
<!-- Query settings -->
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="mm">100%</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
<str name="mlt.qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="mlt.fl">text,features,name,sku,id,manu,cat</str>
<int name="mlt.count">3</int>
<!-- Faceting defaults -->
<str name="facet">on</str>
<str name="facet.field">cat</str>
<str name="facet.field">manu_exact</str>
<str name="facet.query">ipod</str>
<str name="facet.query">GB</str>
<str name="facet.mincount">1</str>
<str name="facet.pivot">cat,inStock</str>
<str name="facet.range.other">after</str>
<str name="facet.range">price</str>
<int name="f.price.facet.range.start">0</int>
<int name="f.price.facet.range.end">600</int>
<int name="f.price.facet.range.gap">50</int>
<str name="facet.range">popularity</str>
<int name="f.popularity.facet.range.start">0</int>
<int name="f.popularity.facet.range.end">10</int>
<int name="f.popularity.facet.range.gap">3</int>
<str name="facet.range">manufacturedate_dt</str>
<str name="f.manufacturedate_dt.facet.range.start">NOW/YEAR-10YEARS</str>
<str name="f.manufacturedate_dt.facet.range.end">NOW</str>
<str name="f.manufacturedate_dt.facet.range.gap">+1YEAR</str>
<str name="f.manufacturedate_dt.facet.range.other">before</str>
<str name="f.manufacturedate_dt.facet.range.other">after</str>
<!-- Highlighting defaults -->
<str name="hl">on</str>
<str name="hl.fl">text features name</str>
<str name="f.name.hl.fragsize">0</str>
<str name="f.name.hl.alternateField">name</str>
<!-- Spell checking defaults -->
<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">false</str>
<str name="spellcheck.count">5</str>
<str name="spellcheck.alternativeTermCount">2</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">5</str>
<str name="spellcheck.maxCollations">3</str>
</lst>
<!-- append spellchecking to our list of components -->
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<requestHandler name="/update" class="solr.UpdateRequestHandler">
</requestHandler>
<requestHandler name="/update/extract"
startup="lazy"
class="solr.extraction.ExtractingRequestHandler" >
<lst name="defaults">
<!-- All the main content goes into "text"... if you need to return
the extracted text or do highlighting, use a stored field. -->
<str name="fmap.content">text</str>
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
<!-- capture link hrefs but ignore div attributes -->
<str name="captureAttr">true</str>
<str name="fmap.a">links</str>
<str name="fmap.div">ignored_</str>
</lst>
</requestHandler>
<requestHandler name="/analysis/field"
startup="lazy"
class="solr.FieldAnalysisRequestHandler" />
<requestHandler name="/analysis/document"
class="solr.DocumentAnalysisRequestHandler"
startup="lazy" />
<requestHandler name="/admin/"
class="solr.admin.AdminHandlers" />
<!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="solr.PingRequestHandler">
<lst name="invariants">
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<!-- Echo the request contents back to the client -->
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<requestHandler name="/replication" class="solr.ReplicationHandler" startup="lazy" />
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
<str name="queryAnalyzerFieldType">textSpell</str>
<!-- a spellchecker built from a field of the main index -->
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">name</str>
<str name="classname">solr.DirectSolrSpellChecker</str>
<!-- the spellcheck distance measure used, the default is the internal levenshtein -->
<str name="distanceMeasure">internal</str>
<!-- minimum accuracy needed to be considered a valid spellcheck suggestion -->
<float name="accuracy">0.5</float>
<!-- the maximum #edits we consider when enumerating terms: can be 1 or 2 -->
<int name="maxEdits">2</int>
<!-- the minimum shared prefix when enumerating terms -->
<int name="minPrefix">1</int>
<!-- maximum number of inspections per result. -->
<int name="maxInspections">5</int>
<!-- minimum length of a query term to be considered for correction -->
<int name="minQueryLength">4</int>
<!-- maximum threshold of documents a query term can appear to be considered for correction -->
<float name="maxQueryFrequency">0.01</float>
<!-- uncomment this to require suggestions to occur in 1% of the documents
<float name="thresholdTokenFrequency">.01</float>
-->
</lst>
<!-- a spellchecker that can break or combine words. See "/spell" handler below for usage -->
<lst name="spellchecker">
<str name="name">wordbreak</str>
<str name="classname">solr.WordBreakSolrSpellChecker</str>
<str name="field">name</str>
<str name="combineWords">true</str>
<str name="breakWords">true</str>
<int name="maxChanges">10</int>
</lst>
</searchComponent>
<requestHandler name="/spell" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<str name="spellcheck.dictionary">default</str>
<str name="spellcheck.dictionary">wordbreak</str>
<str name="spellcheck">on</str>
<str name="spellcheck.extendedResults">true</str>
<str name="spellcheck.count">10</str>
<str name="spellcheck.alternativeTermCount">5</str>
<str name="spellcheck.maxResultsForSuggest">5</str>
<str name="spellcheck.collate">true</str>
<str name="spellcheck.collateExtendedResults">true</str>
<str name="spellcheck.maxCollationTries">10</str>
<str name="spellcheck.maxCollations">5</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
<searchComponent name="tvComponent" class="solr.TermVectorComponent"/>
<requestHandler name="/tvrh" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="df">text</str>
<bool name="tv">true</bool>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
<searchComponent name="clustering"
enable="${solr.clustering.enabled:false}"
class="solr.clustering.ClusteringComponent" >
<!-- Declare an engine -->
<lst name="engine">
<!-- The name, only one can be named "default" -->
<str name="name">default</str>
<str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
<str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
<str name="carrot.lexicalResourcesDir">clustering/carrot2</str>
<str name="MultilingualClustering.defaultLanguage">ENGLISH</str>
</lst>
<lst name="engine">
<str name="name">stc</str>
<str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
</lst>
</searchComponent>
<requestHandler name="/clustering"
startup="lazy"
enable="${solr.clustering.enabled:false}"
class="solr.SearchHandler">
<lst name="defaults">
<bool name="clustering">true</bool>
<str name="clustering.engine">default</str>
<bool name="clustering.results">true</bool>
<!-- The title field -->
<str name="carrot.title">name</str>
<str name="carrot.url">id</str>
<!-- The field to cluster on -->
<str name="carrot.snippet">features</str>
<!-- produce summaries -->
<bool name="carrot.produceSummary">true</bool>
<!-- the maximum number of labels per cluster -->
<!--<int name="carrot.numDescriptions">5</int>-->
<!-- produce sub clusters -->
<bool name="carrot.outputSubClusters">false</bool>
<str name="defType">edismax</str>
<str name="qf">
text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
</str>
<str name="q.alt">*:*</str>
<str name="rows">10</str>
<str name="fl">*,score</str>
</lst>
<arr name="last-components">
<str>clustering</str>
</arr>
</requestHandler>
<searchComponent name="terms" class="solr.TermsComponent"/>
<!-- A request handler for demonstrating the terms component -->
<requestHandler name="/terms" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<bool name="terms">true</bool>
</lst>
<arr name="components">
<str>terms</str>
</arr>
</requestHandler>
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>
<!-- A request handler for demonstrating the elevator component -->
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="df">text</str>
</lst>
<arr name="last-components">
<str>elevator</str>
</arr>
</requestHandler>
<searchComponent class="solr.HighlightComponent" name="highlight">
<highlighting>
<!-- Configure the standard fragmenter -->
<!-- This could most likely be commented out in the "default" case -->
<fragmenter name="gap"
default="true"
class="solr.highlight.GapFragmenter">
<lst name="defaults">
<int name="hl.fragsize">100</int>
</lst>
</fragmenter>
<fragmenter name="regex"
class="solr.highlight.RegexFragmenter">
<lst name="defaults">
<!-- slightly smaller fragsizes work better because of slop -->
<int name="hl.fragsize">70</int>
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
<str name="hl.regex.pattern">[-\w ,/\n\"']{20,200}</str>
</lst>
</fragmenter>
<!-- Configure the standard formatter -->
<formatter name="html"
default="true"
class="solr.highlight.HtmlFormatter">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
<str name="hl.simple.post"><![CDATA[</em>]]></str>
</lst>
</formatter>
<!-- Configure the standard encoder -->
<encoder name="html"
class="solr.highlight.HtmlEncoder" />
<!-- Configure the standard fragListBuilder -->
<fragListBuilder name="simple"
class="solr.highlight.SimpleFragListBuilder"/>
<!-- Configure the single fragListBuilder -->
<fragListBuilder name="single"
class="solr.highlight.SingleFragListBuilder"/>
<!-- Configure the weighted fragListBuilder -->
<fragListBuilder name="weighted"
default="true"
class="solr.highlight.WeightedFragListBuilder"/>
<!-- default tag FragmentsBuilder -->
<fragmentsBuilder name="default"
default="true"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<!--
<lst name="defaults">
<str name="hl.multiValuedSeparatorChar">/</str>
</lst>
-->
</fragmentsBuilder>
<!-- multi-colored tag FragmentsBuilder -->
<fragmentsBuilder name="colored"
class="solr.highlight.ScoreOrderFragmentsBuilder">
<lst name="defaults">
<str name="hl.tag.pre"><![CDATA[
<b style="background:yellow">,<b style="background:lawgreen">,
<b style="background:aquamarine">,<b style="background:magenta">,
<b style="background:palegreen">,<b style="background:coral">,
<b style="background:wheat">,<b style="background:khaki">,
<b style="background:lime">,<b style="background:deepskyblue">]]></str>
<str name="hl.tag.post"><![CDATA[</b>]]></str>
</lst>
</fragmentsBuilder>
<boundaryScanner name="default"
default="true"
class="solr.highlight.SimpleBoundaryScanner">
<lst name="defaults">
<str name="hl.bs.maxScan">10</str>
<str name="hl.bs.chars">.,!? 	 </str>
</lst>
</boundaryScanner>
<boundaryScanner name="breakIterator"
class="solr.highlight.BreakIteratorBoundaryScanner">
<lst name="defaults">
<!-- type should be one of CHARACTER, WORD(default), LINE and SENTENCE -->
<str name="hl.bs.type">WORD</str>
<!-- language and country are used when constructing Locale object. -->
<!-- And the Locale object will be used when getting instance of BreakIterator -->
<str name="hl.bs.language">en</str>
<str name="hl.bs.country">US</str>
</lst>
</boundaryScanner>
</highlighting>
</searchComponent>
<queryResponseWriter name="json" class="solr.JSONResponseWriter">
<str name="content-type">text/plain; charset=UTF-8</str>
</queryResponseWriter>
<queryResponseWriter name="velocity" class="solr.VelocityResponseWriter" startup="lazy"/>
<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
<admin>
<defaultQuery>*:*</defaultQuery>
</admin>
</config>
| 0 |
11,349,247 | 07/05/2012 17:13:25 | 1,504,694 | 07/05/2012 16:52:47 | 1 | 0 | has_many competitions through teams and inverse_teams | Thanks for looking. Total noob here. Sorry!
I have a self-referential association to set up a team with two users and a competition through teams:
class User < ActiveRecord::Base
has_many :teams, :dependent => :destroy
has_many :inverse_teams, :class_name => "Team", :foreign_key => "team_mate_id"
has_many :competitions, :through => :teams
end
I'd like to use something like user.competitions but this will only return competitions for teams that directly belong to the user via team.user_id.
What I need is a users competitions for team and inverse team, without showing duplicate results.
Please let me know if I need to show more code here and keep in mind this is my first stack overflow question.
I really appreciate your help! Thanks!
| ruby-on-rails-3.2 | null | null | null | null | null | open | has_many competitions through teams and inverse_teams
===
Thanks for looking. Total noob here. Sorry!
I have a self-referential association to set up a team with two users and a competition through teams:
class User < ActiveRecord::Base
has_many :teams, :dependent => :destroy
has_many :inverse_teams, :class_name => "Team", :foreign_key => "team_mate_id"
has_many :competitions, :through => :teams
end
I'd like to use something like user.competitions but this will only return competitions for teams that directly belong to the user via team.user_id.
What I need is a users competitions for team and inverse team, without showing duplicate results.
Please let me know if I need to show more code here and keep in mind this is my first stack overflow question.
I really appreciate your help! Thanks!
| 0 |
11,627,581 | 07/24/2012 09:07:23 | 625,466 | 02/20/2011 17:58:03 | 542 | 35 | Uploading file from GWT to asp.net | I'm trying to upload a file using GWT to the server running ASP.NET. Somehow I do see the data send to the server when I monitor the request using TamperData in firefox.
I'm using the following code in GWT
form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.setAction("JSON/AddLogo.ashx");
holder = new VerticalPanel();
form.setWidget(holder);
final FileUpload uploader = new FileUpload();
uploader.setName("upload");
holder.add(uploader);
When looking in firebug the form is created correctly and the data is sent on the right way also.
I try reading the file on the server using:
public void ProcessRequest(HttpContext context)
{
HttpPostedFile file = context.Request.Files["upload"];
}
But somehow file stays null and context.Request.Files.Count gives 0 as return. Anyone knows what I am doing wrong?
When trying with normal enctype and a simpel textbox it works fine (using context.Request.Form["field"])
| asp.net | gwt | file-upload | null | null | null | open | Uploading file from GWT to asp.net
===
I'm trying to upload a file using GWT to the server running ASP.NET. Somehow I do see the data send to the server when I monitor the request using TamperData in firefox.
I'm using the following code in GWT
form = new FormPanel();
form.setEncoding(FormPanel.ENCODING_MULTIPART);
form.setMethod(FormPanel.METHOD_POST);
form.setAction("JSON/AddLogo.ashx");
holder = new VerticalPanel();
form.setWidget(holder);
final FileUpload uploader = new FileUpload();
uploader.setName("upload");
holder.add(uploader);
When looking in firebug the form is created correctly and the data is sent on the right way also.
I try reading the file on the server using:
public void ProcessRequest(HttpContext context)
{
HttpPostedFile file = context.Request.Files["upload"];
}
But somehow file stays null and context.Request.Files.Count gives 0 as return. Anyone knows what I am doing wrong?
When trying with normal enctype and a simpel textbox it works fine (using context.Request.Form["field"])
| 0 |
11,627,685 | 07/24/2012 09:14:40 | 993,494 | 10/13/2011 12:54:21 | 83 | 3 | Select row if col1 value exits twice and col2 is not null | We are monitoring network devices.
A device may appear at more than one switch.
We want to filter out those devices which are on an uplink / portchannel in case it appears also on another port. All other devices are selected.
Let's say the table looks like:
HOST, SWITCH, PORT
HostA, Switch1, 01
HostB, Switch1, 02
HostA, Switch2, Po - Po is portchannel / uplink
HostC, Switch2, Po - Po is portchannel / uplink
Desired Output:
HostA, Switch1, 01
HostB, Switch1, 02
HostC, Swtich2, Po - is only on an uplink / so that is OK
The Entry HostA, Switch2, Po needs to be filtered out since it appears on another port as well.
Now the question is how to write an efficient query.
In SQL terms we want to select all rows except those where HOST appears twice. Then we want only that row where PORT is not 'Po'
Our current query is slow because of subqueries !?
I assume that the subquery is creating a cartesian product - right?
SELECT * FROM devices t1
WHERE NOT ((Port = 'Po') AND
((Select count(*) from table t2 where t1.host=t2.host AND NOT Port='Po') > 0))
Again the question is how to write a faster SQL query?? | sql | performance | select | subquery | cartesian-product | null | open | Select row if col1 value exits twice and col2 is not null
===
We are monitoring network devices.
A device may appear at more than one switch.
We want to filter out those devices which are on an uplink / portchannel in case it appears also on another port. All other devices are selected.
Let's say the table looks like:
HOST, SWITCH, PORT
HostA, Switch1, 01
HostB, Switch1, 02
HostA, Switch2, Po - Po is portchannel / uplink
HostC, Switch2, Po - Po is portchannel / uplink
Desired Output:
HostA, Switch1, 01
HostB, Switch1, 02
HostC, Swtich2, Po - is only on an uplink / so that is OK
The Entry HostA, Switch2, Po needs to be filtered out since it appears on another port as well.
Now the question is how to write an efficient query.
In SQL terms we want to select all rows except those where HOST appears twice. Then we want only that row where PORT is not 'Po'
Our current query is slow because of subqueries !?
I assume that the subquery is creating a cartesian product - right?
SELECT * FROM devices t1
WHERE NOT ((Port = 'Po') AND
((Select count(*) from table t2 where t1.host=t2.host AND NOT Port='Po') > 0))
Again the question is how to write a faster SQL query?? | 0 |
11,627,689 | 07/24/2012 09:15:11 | 996,809 | 10/15/2011 11:54:08 | 54 | 6 | Is $_GET available in all created classes? | I do one request and my URL has a parameter like this `.../index.php?customer=abc`
In `index.php`'s class `$_GET['customer']` is available.
There are multiple other classes being created then.
Finally in `somefile.php` containing some different class `someClass`, `$_GET['customer']` is no more available.
I am forced to use a framework that uses a form that `eval()`s PHP code on button click.
`new TDynButton($body, "login", ... , "\$this->win->doLogin();");`
In`doLogin()` there is no `$_GET['customer']`. Cannot understand why. Is it possible if this framework uses `action=GET` in the background that I am losing my `$_GET`? Im totally lost.
Thanks.
| php | get | eval | null | null | null | open | Is $_GET available in all created classes?
===
I do one request and my URL has a parameter like this `.../index.php?customer=abc`
In `index.php`'s class `$_GET['customer']` is available.
There are multiple other classes being created then.
Finally in `somefile.php` containing some different class `someClass`, `$_GET['customer']` is no more available.
I am forced to use a framework that uses a form that `eval()`s PHP code on button click.
`new TDynButton($body, "login", ... , "\$this->win->doLogin();");`
In`doLogin()` there is no `$_GET['customer']`. Cannot understand why. Is it possible if this framework uses `action=GET` in the background that I am losing my `$_GET`? Im totally lost.
Thanks.
| 0 |
11,627,691 | 07/24/2012 09:15:14 | 388,887 | 07/11/2010 14:02:12 | 215 | 1 | What is the transaction model in EJB3.0 invoking a stored procedure | I have a stateless bean (EJB3.0) with container-managed transaction. This bean has a method invoking a Stored Procedure.
What is the transaction model here ? Will the process in the SP(i.e., in DB) be in the save transaction of the EJB method or it is in a transaction of its own ? Is the behavior here standardized by the EJB3.0 spec or it's vendor dependent ? | stored-procedures | transactions | ejb | null | null | null | open | What is the transaction model in EJB3.0 invoking a stored procedure
===
I have a stateless bean (EJB3.0) with container-managed transaction. This bean has a method invoking a Stored Procedure.
What is the transaction model here ? Will the process in the SP(i.e., in DB) be in the save transaction of the EJB method or it is in a transaction of its own ? Is the behavior here standardized by the EJB3.0 spec or it's vendor dependent ? | 0 |
11,627,615 | 07/24/2012 09:09:22 | 1,249,812 | 03/05/2012 12:27:49 | 56 | 8 | Does anyone created a SQLite database based on GTFS data? (Maybe in Java)? | i am working on trip plan for sydney.please anyone tell me store gtfs data in sqlite, please anyone have a query to find a path between two stops?
thank u in advance | android | sqlite3 | null | null | null | 07/27/2012 02:06:55 | not a real question | Does anyone created a SQLite database based on GTFS data? (Maybe in Java)?
===
i am working on trip plan for sydney.please anyone tell me store gtfs data in sqlite, please anyone have a query to find a path between two stops?
thank u in advance | 1 |
11,627,700 | 07/24/2012 09:15:40 | 1,545,920 | 07/23/2012 13:05:29 | 1 | 0 | Image (not element) visibility with WebDriver | I have a clickable image and it is not visible in FireFox. I mean, there is no image, but is there is an element (and it is clickable). **FindElement(by).Displayed** returns true but there is still no image.
The question is how can I check, is this image visible?
Also, I found an error in html headers (the reason, why image is not visible), maybe there is a way to check image presence using html headers? | html | webdriver | null | null | null | null | open | Image (not element) visibility with WebDriver
===
I have a clickable image and it is not visible in FireFox. I mean, there is no image, but is there is an element (and it is clickable). **FindElement(by).Displayed** returns true but there is still no image.
The question is how can I check, is this image visible?
Also, I found an error in html headers (the reason, why image is not visible), maybe there is a way to check image presence using html headers? | 0 |
11,386,709 | 07/08/2012 21:06:48 | 1,047,842 | 11/15/2011 15:01:06 | 84 | 0 | Why is compiler not flagging this as an Error instead of warning? | #include <iostream>
using namespace std;
class test{
public:
test() { cout<<"CTOR"<<endl; }
~test() { cout<<"DTOR"<<endl; }
};
int main()
{
test testObj();
cout<<"HERE"<<endl;
}
Output:
HERE
Compiler skips the line "test testObj(); " and compiles the rest with warning and when run will generate the output. The warning is "prototyped function not called (was a variable definition intended?) in VC++ 2008. Why does it not throw an error?
| c++ | visual-studio-2008 | visual-c++ | null | null | null | open | Why is compiler not flagging this as an Error instead of warning?
===
#include <iostream>
using namespace std;
class test{
public:
test() { cout<<"CTOR"<<endl; }
~test() { cout<<"DTOR"<<endl; }
};
int main()
{
test testObj();
cout<<"HERE"<<endl;
}
Output:
HERE
Compiler skips the line "test testObj(); " and compiles the rest with warning and when run will generate the output. The warning is "prototyped function not called (was a variable definition intended?) in VC++ 2008. Why does it not throw an error?
| 0 |
11,386,711 | 07/08/2012 21:07:37 | 1,509,444 | 07/08/2012 01:01:10 | 15 | 5 | What is the easiest way to create responsive Images? | I'm working on my first responsive website and I want to know how to make all of the images resize dynamically. I've worked around it for now, but I'd really like to rethink how I did this. Is there a `jquery` plugin for this that is easy to implement (I don't know alot of `js`)? Is there a better way?
<a href="http://smore.rvadv.com/?page_id=60">My site</a>
| javascript | jquery-plugins | image-processing | responsive-design | null | null | open | What is the easiest way to create responsive Images?
===
I'm working on my first responsive website and I want to know how to make all of the images resize dynamically. I've worked around it for now, but I'd really like to rethink how I did this. Is there a `jquery` plugin for this that is easy to implement (I don't know alot of `js`)? Is there a better way?
<a href="http://smore.rvadv.com/?page_id=60">My site</a>
| 0 |
11,386,712 | 07/08/2012 21:08:08 | 1,510,083 | 07/08/2012 13:35:21 | 6 | 0 | Remove alert from a javascript | I've the below code from a tutorial,i want the action but i just want to remove the alert,
here is the code:
<script type="text/javascript">
setTimeout('read()', 10000);
function read()
{
FB.api('/me/news.reads' +
'?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post',
function(response) {
var msg = 'Error occured';
if (!response || response.error) {
if (response.error) {
msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
}
alert(msg);
}
else {
alert('Post was successful! Action ID: ' + response.id);
}
});
}
</script>
I've tried this:
<script type="text/javascript">
setTimeout('read()', 10000);
function read()
{
FB.api('/me/news.reads' +
'?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post';
}
</script>
but not worked, thanks | javascript | facebook | null | null | null | null | open | Remove alert from a javascript
===
I've the below code from a tutorial,i want the action but i just want to remove the alert,
here is the code:
<script type="text/javascript">
setTimeout('read()', 10000);
function read()
{
FB.api('/me/news.reads' +
'?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post',
function(response) {
var msg = 'Error occured';
if (!response || response.error) {
if (response.error) {
msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
}
alert(msg);
}
else {
alert('Post was successful! Action ID: ' + response.id);
}
});
}
</script>
I've tried this:
<script type="text/javascript">
setTimeout('read()', 10000);
function read()
{
FB.api('/me/news.reads' +
'?article=<?php echo $fbrdurl ?>&access_token=<?php echo $access_token ?>','post';
}
</script>
but not worked, thanks | 0 |
11,386,492 | 07/08/2012 20:35:34 | 230,571 | 12/13/2009 05:54:21 | 2,123 | 95 | Accessing line number in V8 JavaScript (Chrome & Node.js) | JavaScript developers who have spent time in languages like C often miss the ability to use certain types of introspection, like logging line numbers, and what method the current method was invoked from. Well if you're using V8 (Chrome, Node.js) you can employ the following. | javascript | node.js | google-chrome | v8 | null | null | open | Accessing line number in V8 JavaScript (Chrome & Node.js)
===
JavaScript developers who have spent time in languages like C often miss the ability to use certain types of introspection, like logging line numbers, and what method the current method was invoked from. Well if you're using V8 (Chrome, Node.js) you can employ the following. | 0 |
11,386,726 | 07/08/2012 21:09:58 | 1,484,378 | 06/27/2012 02:29:31 | 17 | 4 | Onclick change top position doesnt do anything | I think the problem's already stated. When you click the plus extra content is show(the Hello Guest and Register and Signup). Is their a better and working way of doing this or do I have a bug. New at java-script so don't hate.
---> http://jsfiddle.net/CM9Av/ | javascript | css | drop-down-menu | absolute | null | null | open | Onclick change top position doesnt do anything
===
I think the problem's already stated. When you click the plus extra content is show(the Hello Guest and Register and Signup). Is their a better and working way of doing this or do I have a bug. New at java-script so don't hate.
---> http://jsfiddle.net/CM9Av/ | 0 |
11,386,731 | 07/08/2012 21:10:18 | 1,483,633 | 06/26/2012 18:16:26 | 11 | 1 | Submit button and form handler from Grocery CRUD table view? | I have an app that has to send bulk email to selected users. I need to display my users table with a checkbox per row and a submit button with a form handler to operate on checked rows. Considering the built-in features of GC like the filter and column sorting, pagination, etc... I thought using GC would be a good solution. I found info on adding the checkbox. How do I add a submit button and form handler? Anyone have a hint or two where to start? | php | codeigniter | grocery-crud | null | null | null | open | Submit button and form handler from Grocery CRUD table view?
===
I have an app that has to send bulk email to selected users. I need to display my users table with a checkbox per row and a submit button with a form handler to operate on checked rows. Considering the built-in features of GC like the filter and column sorting, pagination, etc... I thought using GC would be a good solution. I found info on adding the checkbox. How do I add a submit button and form handler? Anyone have a hint or two where to start? | 0 |
11,319,240 | 07/03/2012 21:10:07 | 1,325,199 | 04/10/2012 22:08:40 | 365 | 1 | Why does Chrome use the client cache differently in these two scenarios? | I'm working on a small single-page application using HTML5. One feature is to show PDF documents embedded in the page, which documents can be selected form a list.
NOw I'm trying to make Chrome (at first, and then all the other modern browsers) use the local client cache to fulfill simple GET request for PDF documents without going through the server (other than the first time of course). I cause the PDF file to be requested by setting the "data" property on an `<object>` element in HTML.
I have found a [working example for XMLHttpRequest][1] (not `<object>`). If you use Chrome's developer tools (Network tab) you can see that the first request goes to the server, and results in a response with these headers:
Cache-Control:public,Public
Content-Encoding:gzip
Content-Length:130
Content-Type:text/plain; charset=utf-8
Date:Tue, 03 Jul 2012 20:34:15 GMT
Expires:Tue, 03 Jul 2012 20:35:15 GMT
Last-Modified:Tue, 03 Jul 2012 20:34:15 GMT
Server:Microsoft-IIS/7.5
Vary:Accept-Encoding
The second request is served from the local cache without any server roundtrip, which is what I want.
Back in my own application, I then used ASP-NET MVC 4 and set
[OutputCache(Duration=60)]
on my controller. The first request to this controller - with URL `http://localhost:63035/?doi=10.1155/2007/98732` results in the following headers:
Cache-Control:public, max-age=60, s-maxage=0
Content-Length:238727
Content-Type:application/pdf
Date:Tue, 03 Jul 2012 20:45:08 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
The second request results in another roundtrip to the server, with a much quicker response (suggesting server-side caching?) but returns 200 OK and these headers:
Cache-Control:public, max-age=53, s-maxage=0
Content-Length:238727
Content-Type:application/pdf
Date:Tue, 03 Jul 2012 20:45:13 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
The third request for the same URL results in yet another roundtrip and a 304 response with these headers:
Cache-Control:public, max-age=33, s-maxage=0
Date:Tue, 03 Jul 2012 20:45:33 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
**My question is**, how should I set the OutputCache attribute in order to get the desired behaviour (i.e. PDF requests fullfilled from the client cache, within X seconds of the initial request)?
Or, am I not doing things right when I cause the PDF to display by setting the "data" property on an `<object>` element?
[1]: http://www.httpwatch.com/demos/ajax_caching/ | asp.net-mvc | google-chrome | pdf | http-caching | null | null | open | Why does Chrome use the client cache differently in these two scenarios?
===
I'm working on a small single-page application using HTML5. One feature is to show PDF documents embedded in the page, which documents can be selected form a list.
NOw I'm trying to make Chrome (at first, and then all the other modern browsers) use the local client cache to fulfill simple GET request for PDF documents without going through the server (other than the first time of course). I cause the PDF file to be requested by setting the "data" property on an `<object>` element in HTML.
I have found a [working example for XMLHttpRequest][1] (not `<object>`). If you use Chrome's developer tools (Network tab) you can see that the first request goes to the server, and results in a response with these headers:
Cache-Control:public,Public
Content-Encoding:gzip
Content-Length:130
Content-Type:text/plain; charset=utf-8
Date:Tue, 03 Jul 2012 20:34:15 GMT
Expires:Tue, 03 Jul 2012 20:35:15 GMT
Last-Modified:Tue, 03 Jul 2012 20:34:15 GMT
Server:Microsoft-IIS/7.5
Vary:Accept-Encoding
The second request is served from the local cache without any server roundtrip, which is what I want.
Back in my own application, I then used ASP-NET MVC 4 and set
[OutputCache(Duration=60)]
on my controller. The first request to this controller - with URL `http://localhost:63035/?doi=10.1155/2007/98732` results in the following headers:
Cache-Control:public, max-age=60, s-maxage=0
Content-Length:238727
Content-Type:application/pdf
Date:Tue, 03 Jul 2012 20:45:08 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
The second request results in another roundtrip to the server, with a much quicker response (suggesting server-side caching?) but returns 200 OK and these headers:
Cache-Control:public, max-age=53, s-maxage=0
Content-Length:238727
Content-Type:application/pdf
Date:Tue, 03 Jul 2012 20:45:13 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
The third request for the same URL results in yet another roundtrip and a 304 response with these headers:
Cache-Control:public, max-age=33, s-maxage=0
Date:Tue, 03 Jul 2012 20:45:33 GMT
Expires:Tue, 03 Jul 2012 20:46:06 GMT
Last-Modified:Tue, 03 Jul 2012 20:45:06 GMT
Server:Microsoft-IIS/8.0
Vary:*
**My question is**, how should I set the OutputCache attribute in order to get the desired behaviour (i.e. PDF requests fullfilled from the client cache, within X seconds of the initial request)?
Or, am I not doing things right when I cause the PDF to display by setting the "data" property on an `<object>` element?
[1]: http://www.httpwatch.com/demos/ajax_caching/ | 0 |
11,319,246 | 07/03/2012 21:10:55 | 356,849 | 06/02/2010 20:09:19 | 3,460 | 46 | How can I use the same layout multiple times on a page? | TL; DR: How can I use the same layout multiple times on a page? All attempts to render partials with recurring layouts go into the elements where the first time the layout is used.
Quick Info:
Using
Rails 2.3.14
Ruby 1.8.7
My partials use content_for, which is pretty handy with layouts.
Basically, my layout looks like this:
<div class="header">
<%= yield :modal_header %>
</div>
<div class="body">
<%= yield :modal_body or yield %>
</div>
Generally, this is how I use my modal layout:
<% content_for :modal_header do %>
header text / elements
<% end %>
<% content_for :modal_body do %>
body info / settings for object or warning message, etc
<% end %>
This is how I render modals on my page:
<%= render :partial => "section_options", :layout => "modal" %>
and that works really well
BUT
when, on the same page, I try to render another modal:
<%= render :partial => "section_content_options", :layout => "modal" %>
This is what happens to the modal at the top of my page (occurs first in the HTML document)
<div class="header">
-- header from second partial --
-- header from first partial --
</div>
<div class="body">
-- body from second partial --
-- body from first partial --
</div>
and then later in the page, where the content from the second partial is supposed to be:
everything is rendered correctly ...
For the sake of this example:
<div class="header">
section content options
</div>
<div class="body">
section contents options ... options
lil confirm / cancel buttons
</div>
Is there a way to fix this? This behavior really messes with javascript bindings as well. so. yup.
Is there a bug with layouts in rails 2.3.14? do I have to upgrade to rails 3 to get rid of this problem? | ruby-on-rails | ruby | layout | null | null | null | open | How can I use the same layout multiple times on a page?
===
TL; DR: How can I use the same layout multiple times on a page? All attempts to render partials with recurring layouts go into the elements where the first time the layout is used.
Quick Info:
Using
Rails 2.3.14
Ruby 1.8.7
My partials use content_for, which is pretty handy with layouts.
Basically, my layout looks like this:
<div class="header">
<%= yield :modal_header %>
</div>
<div class="body">
<%= yield :modal_body or yield %>
</div>
Generally, this is how I use my modal layout:
<% content_for :modal_header do %>
header text / elements
<% end %>
<% content_for :modal_body do %>
body info / settings for object or warning message, etc
<% end %>
This is how I render modals on my page:
<%= render :partial => "section_options", :layout => "modal" %>
and that works really well
BUT
when, on the same page, I try to render another modal:
<%= render :partial => "section_content_options", :layout => "modal" %>
This is what happens to the modal at the top of my page (occurs first in the HTML document)
<div class="header">
-- header from second partial --
-- header from first partial --
</div>
<div class="body">
-- body from second partial --
-- body from first partial --
</div>
and then later in the page, where the content from the second partial is supposed to be:
everything is rendered correctly ...
For the sake of this example:
<div class="header">
section content options
</div>
<div class="body">
section contents options ... options
lil confirm / cancel buttons
</div>
Is there a way to fix this? This behavior really messes with javascript bindings as well. so. yup.
Is there a bug with layouts in rails 2.3.14? do I have to upgrade to rails 3 to get rid of this problem? | 0 |
11,319,248 | 07/03/2012 21:11:05 | 1,436,982 | 06/05/2012 09:19:48 | 1 | 0 | How to access MySQL from MPI program (use MPICH2)? | I have huge database (DBMS = MySQL) that I accessed from MPI program (use MPICH2). In this program, I just want to know about time to execute sql query. It's reference to my other parallel program.
When the code's runed from Visual Studio C++,it's run well (I get the output). But when it's runed use mpiexec, it's no output and no error message. Otherwise, when I try simple program (no mysql code, use mpiexec),its run well (there is output). Would not be using mysql library and mpi library together?
The code like this :
`#include <stdio.h>
#include <windows.h>
#include <mysql.h>
#include <iostream>
#include <winsock.h>
#include <mpi.h>
#include <stdlib.h>
using namespace std;
//namespace for error handling
namespace ekception{
struct error{
const char *p;
error(const char *q){
p=q;
}
};
}
int main(int argc, char *argv[]){
MYSQL mysql,*sock;
MYSQL_RES *res;
int state;
char *host="localhost";
char *user="root";
char *password="";
char *dbName="sp";
double start,finish,time;
long j;
char s[]="SELECT COUNT(kolom2) FROM coba WHERE kolom1<=";
char query[BUFSIZ];
MPI_Init(&argc,&argv);
for(j=250000;j<=25000000;j+=250000){
sprintf_s(query,"%s%d",s,j);
start=MPI_Wtime();
try{
mysql_init(&mysql);
if(!(sock=mysql_real_connect(&mysql,host,user,password,dbName,0,NULL,0))){
throw ekception::error("Connection failed\n");
}
mysql.reconnect=1;
state=mysql_query(sock,query);
if(state!=0){
throw ekception::error("Query execution Failed\n");
}
res=mysql_store_result(sock);
mysql_free_result(res);
mysql_close(sock);
}
catch(ekception::error e){
printf("%s\n",e.p);
}
finish=MPI_Wtime();
time=finish-start;
printf("Data size = %d *** time = %f\n",j,time);
}
MPI_Finalize();
getchar();
return 0;
}`
Thanks in Advance | c++ | mysql | parallel-processing | mpi | mpich2 | null | open | How to access MySQL from MPI program (use MPICH2)?
===
I have huge database (DBMS = MySQL) that I accessed from MPI program (use MPICH2). In this program, I just want to know about time to execute sql query. It's reference to my other parallel program.
When the code's runed from Visual Studio C++,it's run well (I get the output). But when it's runed use mpiexec, it's no output and no error message. Otherwise, when I try simple program (no mysql code, use mpiexec),its run well (there is output). Would not be using mysql library and mpi library together?
The code like this :
`#include <stdio.h>
#include <windows.h>
#include <mysql.h>
#include <iostream>
#include <winsock.h>
#include <mpi.h>
#include <stdlib.h>
using namespace std;
//namespace for error handling
namespace ekception{
struct error{
const char *p;
error(const char *q){
p=q;
}
};
}
int main(int argc, char *argv[]){
MYSQL mysql,*sock;
MYSQL_RES *res;
int state;
char *host="localhost";
char *user="root";
char *password="";
char *dbName="sp";
double start,finish,time;
long j;
char s[]="SELECT COUNT(kolom2) FROM coba WHERE kolom1<=";
char query[BUFSIZ];
MPI_Init(&argc,&argv);
for(j=250000;j<=25000000;j+=250000){
sprintf_s(query,"%s%d",s,j);
start=MPI_Wtime();
try{
mysql_init(&mysql);
if(!(sock=mysql_real_connect(&mysql,host,user,password,dbName,0,NULL,0))){
throw ekception::error("Connection failed\n");
}
mysql.reconnect=1;
state=mysql_query(sock,query);
if(state!=0){
throw ekception::error("Query execution Failed\n");
}
res=mysql_store_result(sock);
mysql_free_result(res);
mysql_close(sock);
}
catch(ekception::error e){
printf("%s\n",e.p);
}
finish=MPI_Wtime();
time=finish-start;
printf("Data size = %d *** time = %f\n",j,time);
}
MPI_Finalize();
getchar();
return 0;
}`
Thanks in Advance | 0 |
11,319,249 | 07/03/2012 21:11:16 | 1,496,544 | 07/02/2012 15:54:48 | 1 | 0 | Socket getaddrinfo()-equivalent function for VxWorks? | As far as I can tell, there is no getaddrinfo() function for VxWorks. Is there any equivalent, or are there any examples of how to roll your own?
Alternatively, what would be another method to populate an addrinfo structure for use with sockets? | c++ | sockets | vxworks | cross-compile | null | null | open | Socket getaddrinfo()-equivalent function for VxWorks?
===
As far as I can tell, there is no getaddrinfo() function for VxWorks. Is there any equivalent, or are there any examples of how to roll your own?
Alternatively, what would be another method to populate an addrinfo structure for use with sockets? | 0 |
11,319,117 | 07/03/2012 21:01:02 | 1,210,016 | 02/14/2012 21:13:42 | 10 | 0 | How to parse this json with jquery? | I'm trying to create my first node.js program with socket.io and I want to store the chat history and then when a user joins have the chat history pushed to his browser. I have the chat saving and pushing and the json that is sent looks like this:
[
[
{
"username": "Warren2",
"text": "Test"
},
{
"username": "Warren2",
"text": "Test2"
},
{
"username": "Warren2",
"text": "Test3"
}
]
]
On my html page I have a javascript that has this
socket.on('updatehistory', function(data) {
}
The code that I put in there will be executed when the updatehistory message is pushed. I'm a n00b and pretty lost lol. This is what I tried:
socket.on('updatehistory', function (data) {
$.each(json.results, function(username,text){
$('#conversation').append('<b>'+ username + ':</b> ' + text + '<br>');
});
});
This is the exact debug message for the updatehistory event from node.js
debug - websocket writing 5:::{"name":"updatehistory","args":[[{"username":"W
arren2","text":"Test"},{"username":"Warren2","text":"Test2"},{"username":"Warren
2","text":"Test3"}]]}
Can someone help me figure out how to parse that (preferable with jquery).
Thank you :D
| jquery | json | null | null | null | null | open | How to parse this json with jquery?
===
I'm trying to create my first node.js program with socket.io and I want to store the chat history and then when a user joins have the chat history pushed to his browser. I have the chat saving and pushing and the json that is sent looks like this:
[
[
{
"username": "Warren2",
"text": "Test"
},
{
"username": "Warren2",
"text": "Test2"
},
{
"username": "Warren2",
"text": "Test3"
}
]
]
On my html page I have a javascript that has this
socket.on('updatehistory', function(data) {
}
The code that I put in there will be executed when the updatehistory message is pushed. I'm a n00b and pretty lost lol. This is what I tried:
socket.on('updatehistory', function (data) {
$.each(json.results, function(username,text){
$('#conversation').append('<b>'+ username + ':</b> ' + text + '<br>');
});
});
This is the exact debug message for the updatehistory event from node.js
debug - websocket writing 5:::{"name":"updatehistory","args":[[{"username":"W
arren2","text":"Test"},{"username":"Warren2","text":"Test2"},{"username":"Warren
2","text":"Test3"}]]}
Can someone help me figure out how to parse that (preferable with jquery).
Thank you :D
| 0 |
11,319,260 | 07/03/2012 21:12:07 | 1,497,462 | 07/03/2012 01:13:55 | 1 | 0 | Bad interpreter: No such file or directory | I'm working through Michael Hartl's tutorial trying to learn Rails for the first time, and I've run into some issues. I recently reinstalled the whole Rails Installer because I had apparently inadvertently deleted some important files. Now, when I try running a test I get the following error:
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre
ter: No such file or directory
I checked my PATH and attempted to use the solution outlined here: http://stackoverflow.com/questions/10575644/bundle-command-not-found-bad-interpreter
..but putting quotation marks around "C:\Program Files (x86)\ruby-1.9.3\bin" didn't do anything for me.
I ran $ rails -v and got the following output:
$ rails -v
←[31mCould not find multi_json-1.3.6 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m
So then I tried running $bundle install and got the following issue again:
Tom@TOM-PC /c/sample_app (updating-users)
$ bundle install
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre
ter: No such file or directory
I'd really appreciate any help -- I've spent 5+ hours today trying to get back on track and am still at a loss. Please let me know if I'm missing any pertinent info -- Thanks! | ruby-on-rails | null | null | null | null | null | open | Bad interpreter: No such file or directory
===
I'm working through Michael Hartl's tutorial trying to learn Rails for the first time, and I've run into some issues. I recently reinstalled the whole Rails Installer because I had apparently inadvertently deleted some important files. Now, when I try running a test I get the following error:
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre
ter: No such file or directory
I checked my PATH and attempted to use the solution outlined here: http://stackoverflow.com/questions/10575644/bundle-command-not-found-bad-interpreter
..but putting quotation marks around "C:\Program Files (x86)\ruby-1.9.3\bin" didn't do anything for me.
I ran $ rails -v and got the following output:
$ rails -v
←[31mCould not find multi_json-1.3.6 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m
So then I tried running $bundle install and got the following issue again:
Tom@TOM-PC /c/sample_app (updating-users)
$ bundle install
sh.exe": /c/Program Files (x86)/ruby-1.9.3/bin/bundle: "c:/Program: bad interpre
ter: No such file or directory
I'd really appreciate any help -- I've spent 5+ hours today trying to get back on track and am still at a loss. Please let me know if I'm missing any pertinent info -- Thanks! | 0 |
11,541,174 | 07/18/2012 12:17:23 | 1,339,063 | 04/17/2012 14:33:24 | 32 | 0 | Create documents in CMIS | Could you tell me if there is any possibility to create documents which parent would be another document.
ObjectId parentId = session.createObjectId(someDocumentStringId);
session.createDocument(properties, parentId, stream, VersioningState.None);
Now I get error: **Operation not supported by the repository for this object!** | java | cmis | null | null | null | null | open | Create documents in CMIS
===
Could you tell me if there is any possibility to create documents which parent would be another document.
ObjectId parentId = session.createObjectId(someDocumentStringId);
session.createDocument(properties, parentId, stream, VersioningState.None);
Now I get error: **Operation not supported by the repository for this object!** | 0 |
11,541,192 | 07/18/2012 12:18:13 | 687,476 | 04/01/2011 11:27:11 | 203 | 4 | Creating a rsa public key from it's modulus and exponent | I want to verify a RSA signature. I have data to verify, the signature and a public key in a form of modulus and exponent. I'd like to do the verification using openssl. Is it possible? I know I can use `openssl rsautl -verify -in sig -inkey key.pem` but I don't know how (using openssl) to create a public key having just it's modulus and exponent.
Maybe other ideas how to check this signature (except writing some programs)? | openssl | rsa | null | null | null | null | open | Creating a rsa public key from it's modulus and exponent
===
I want to verify a RSA signature. I have data to verify, the signature and a public key in a form of modulus and exponent. I'd like to do the verification using openssl. Is it possible? I know I can use `openssl rsautl -verify -in sig -inkey key.pem` but I don't know how (using openssl) to create a public key having just it's modulus and exponent.
Maybe other ideas how to check this signature (except writing some programs)? | 0 |
11,541,199 | 07/18/2012 12:19:19 | 1,412,565 | 05/23/2012 12:14:25 | 329 | 9 | Which UIView is on top | in my program there is a `MainView` and during the program user can add some `subView`.
for handling them i want to know which `subView` now are showing on top level.
NOTE: I do not remove `subView`s unless the user wants. and the `subview`s are in different sizes and may have overlap or not. | objective-c | uiview | null | null | null | null | open | Which UIView is on top
===
in my program there is a `MainView` and during the program user can add some `subView`.
for handling them i want to know which `subView` now are showing on top level.
NOTE: I do not remove `subView`s unless the user wants. and the `subview`s are in different sizes and may have overlap or not. | 0 |
11,541,201 | 07/18/2012 12:19:26 | 1,534,730 | 07/18/2012 12:09:31 | 1 | 0 | Getting this error when loading the table | I have pasted my code below. I am getting this error:
url is undefined
I am trying to do a grid with pagination.I have a doubt on the proxy loading and loading the store. I dont know exactly how its connected to store.Could some please help me.
Pls help me.i need a pagination for my grid with a simple store.
<html>
<head>
<title>Getting Started Example</title>
<link rel="stylesheet" type="text/css"
href="extjs4/resources/css/ext-all.css" />
<script type="text/javascript"
src="extjs4/ext-all-debug.js"></script>
</head>
<body>
<div id='div1' class='myDiv'> </div>
<script type="text/javascript" >
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', './ux');
Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.toolbar.Paging',
'Ext.ModelManager',
'Ext.ux.PreviewPlugin',
'Ext.ux.ProgressBarPager',
'Ext.selection.CellModel',
'Ext.state.*',
'Ext.form.*'
]);
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [ 'name', 'email', 'phone' ]
});
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
data: [
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }, { name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }, { name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }
]
});
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
Ext.onReady(function() {
var pluginExpanded = true;
Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
store: userStore,
width: 400,
height: 200,
title: 'Application Users',
disableSelection: true,
loadMask: true,
viewConfig: {
id: 'gv',
trackOver: false,
stripeRows: false,
plugins: [{
ptype: 'preview',
bodyField: 'excerpt',
expanded: true,
pluginId: 'preview'
}]
},
columns: [
{
text: 'Name',
width: 100,
sortable: true,
hideable: false,
dataIndex: 'name',
editor: {
allowBlank: false
}
},
{
text: 'Email Address',
width: 150,
dataIndex: 'email',
hidden: true,
editor: {
xtype: 'textfield',
allowBlank: false,
}
},
{
text: 'Phone Number',
dataIndex: 'phone',
editor: {
xtype: 'numberfield',
allowBlank: false,
}
}
],
bbar: Ext.create('Ext.PagingToolbar', {
store: userStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-', {
text: 'Show Preview',
pressed: pluginExpanded,
enableToggle: true,
toggleHandler: function(btn, pressed) {
var preview = Ext.getCmp('gv').getPlugin('preview');
preview.toggleExpanded(pressed);
}
}]
}),
plugins: [cellEditing]
});
userStore.load();
});
</script>
<body>
</body>
</html>
</body>
</html> | extjs4 | null | null | null | null | null | open | Getting this error when loading the table
===
I have pasted my code below. I am getting this error:
url is undefined
I am trying to do a grid with pagination.I have a doubt on the proxy loading and loading the store. I dont know exactly how its connected to store.Could some please help me.
Pls help me.i need a pagination for my grid with a simple store.
<html>
<head>
<title>Getting Started Example</title>
<link rel="stylesheet" type="text/css"
href="extjs4/resources/css/ext-all.css" />
<script type="text/javascript"
src="extjs4/ext-all-debug.js"></script>
</head>
<body>
<div id='div1' class='myDiv'> </div>
<script type="text/javascript" >
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', './ux');
Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.toolbar.Paging',
'Ext.ModelManager',
'Ext.ux.PreviewPlugin',
'Ext.ux.ProgressBarPager',
'Ext.selection.CellModel',
'Ext.state.*',
'Ext.form.*'
]);
Ext.define('User', {
extend: 'Ext.data.Model',
fields: [ 'name', 'email', 'phone' ]
});
var userStore = Ext.create('Ext.data.Store', {
model: 'User',
data: [
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }, { name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' },
{ name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }, { name: 'Lisa', email: '[email protected]', phone: '555-111-1224' },
{ name: 'Bart', email: '[email protected]', phone: '555-222-1234' },
{ name: 'Homer', email: '[email protected]', phone: '555-222-1244' },
{ name: 'Marge', email: '[email protected]', phone: '555-222-1254' }
]
});
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
Ext.onReady(function() {
var pluginExpanded = true;
Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
store: userStore,
width: 400,
height: 200,
title: 'Application Users',
disableSelection: true,
loadMask: true,
viewConfig: {
id: 'gv',
trackOver: false,
stripeRows: false,
plugins: [{
ptype: 'preview',
bodyField: 'excerpt',
expanded: true,
pluginId: 'preview'
}]
},
columns: [
{
text: 'Name',
width: 100,
sortable: true,
hideable: false,
dataIndex: 'name',
editor: {
allowBlank: false
}
},
{
text: 'Email Address',
width: 150,
dataIndex: 'email',
hidden: true,
editor: {
xtype: 'textfield',
allowBlank: false,
}
},
{
text: 'Phone Number',
dataIndex: 'phone',
editor: {
xtype: 'numberfield',
allowBlank: false,
}
}
],
bbar: Ext.create('Ext.PagingToolbar', {
store: userStore,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-', {
text: 'Show Preview',
pressed: pluginExpanded,
enableToggle: true,
toggleHandler: function(btn, pressed) {
var preview = Ext.getCmp('gv').getPlugin('preview');
preview.toggleExpanded(pressed);
}
}]
}),
plugins: [cellEditing]
});
userStore.load();
});
</script>
<body>
</body>
</html>
</body>
</html> | 0 |
11,541,205 | 07/18/2012 12:19:43 | 1,438,009 | 06/05/2012 17:50:04 | 36 | 4 | JQuery can't find variable from separate javascript file | I am using the cakephp framework and I created 2 separate javascript files and placed them into my webroot/js folder. The first javascript file contains modal dialog variables that contain the settings for the dialog boxes. The second javascript file contains other click event handlers that post data to an action and then open up the dialog.
The problem I am having is that the second file calls a variable from the first file using
$*variablename* and I get an error saying varaibleName is not defined.
Some code is below to show you what I mean.
From the first file:
var $editSel = $("#editSel_dialog").dialog(
{
autoOpen: false,
height: 530,
width: 800,
resizable: true,
modal: true,
buttons:
{
"Cancel": function()
{
$(this).dialog("close");
}
}
});
From the second file:
$('.neweditSel_dialog').live('click', function()
{
$.ajaxSetup({ async: false });
var selected = [];
$("#[id*=LocalClocks]").each(function()
{
if(false != $(this).is(':checked'))
{
var string = $(this).attr('id').replace('LocalClocks', '');
string = string.substring(10);
selected.push(string);
}
});
if(0 === selected.length)
{
$selError.dialog('open');
$selError.text('No Local Clocks Were Selected')
}
else
{
$.post('/LocalClocks/editSelected', { "data[Session][selected]": selected }, function(data)
{
});
$editSel.load($(this).attr('href'), function ()
{
$editSel.dialog('open');
});
}
return false;
});
This was working when I was using jquery-1.4.2.min.js, but I am using jquery1.7 now.
I also ended up putting the first file with all the variables inside of `$(document).ready(function(){});` I tried putting the second file inside of a document.ready() function but that made no difference.
Any help would be great.
Thanks | javascript | jquery | variables | undefined | null | null | open | JQuery can't find variable from separate javascript file
===
I am using the cakephp framework and I created 2 separate javascript files and placed them into my webroot/js folder. The first javascript file contains modal dialog variables that contain the settings for the dialog boxes. The second javascript file contains other click event handlers that post data to an action and then open up the dialog.
The problem I am having is that the second file calls a variable from the first file using
$*variablename* and I get an error saying varaibleName is not defined.
Some code is below to show you what I mean.
From the first file:
var $editSel = $("#editSel_dialog").dialog(
{
autoOpen: false,
height: 530,
width: 800,
resizable: true,
modal: true,
buttons:
{
"Cancel": function()
{
$(this).dialog("close");
}
}
});
From the second file:
$('.neweditSel_dialog').live('click', function()
{
$.ajaxSetup({ async: false });
var selected = [];
$("#[id*=LocalClocks]").each(function()
{
if(false != $(this).is(':checked'))
{
var string = $(this).attr('id').replace('LocalClocks', '');
string = string.substring(10);
selected.push(string);
}
});
if(0 === selected.length)
{
$selError.dialog('open');
$selError.text('No Local Clocks Were Selected')
}
else
{
$.post('/LocalClocks/editSelected', { "data[Session][selected]": selected }, function(data)
{
});
$editSel.load($(this).attr('href'), function ()
{
$editSel.dialog('open');
});
}
return false;
});
This was working when I was using jquery-1.4.2.min.js, but I am using jquery1.7 now.
I also ended up putting the first file with all the variables inside of `$(document).ready(function(){});` I tried putting the second file inside of a document.ready() function but that made no difference.
Any help would be great.
Thanks | 0 |
11,541,209 | 07/18/2012 12:19:53 | 835,035 | 07/08/2011 08:51:57 | 518 | 19 | Android Eclipse AsyncTask - but result is empty - can someone have a look | sorry to be a pain, but I've been on this one too long and I am sure it's a easy one but I am tired and can't see it. All works fine but the 'String result' is empty
package com.example.me;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.widget.Button;
import android.widget.TextView;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
Button btnLoginButton;
TextView tmpError, tmpUsername, tmpPassword;
ArrayList<NameValuePair> postParameters;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tmpError = (TextView) findViewById(R.id.lblMessage);
tmpUsername = (TextView) findViewById(R.id.lblUsername);
tmpPassword = (TextView) findViewById(R.id.lblPassword);
addListenerOnButton();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public void addListenerOnButton() {
btnLoginButton = (Button) findViewById(R.id.btnLogin);
btnLoginButton.setOnClickListener(new OnClickListener() {
public void onClick(View arg) {
try{
triggerClick();
}
catch (Exception e) {
tmpError.setText("[]" + e.toString());
}
}
});
}
private void triggerClick() {
postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("username", tmpUsername.getText().toString()));
postParameters.add(new BasicNameValuePair("password", tmpPassword.getText().toString()));
final class HttpTask
extends
AsyncTask<String/* Param */, Boolean /* Progress */, String /* Result */> {
@Override
protected String doInBackground(String... params) {
publishProgress(true);
try {
CustomHttpClient.executeHttpPost("http://some.url/thatiknoworks/check.php", postParameters);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
@Override
protected void onPostExecute(String result) {
publishProgress(false);
result = result.replaceAll("\\s+","");
if(result.equals("1")) {
tmpError.setText("Correct");
}
else {
tmpError.setText("Sorry!!("+result+")");
}
}
}
new HttpTask().execute();
}
}
come back time and time again with an empty "result" string :-( | android | eclipse | android-asynctask | null | null | null | open | Android Eclipse AsyncTask - but result is empty - can someone have a look
===
sorry to be a pain, but I've been on this one too long and I am sure it's a easy one but I am tired and can't see it. All works fine but the 'String result' is empty
package com.example.me;
import java.util.ArrayList;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import android.os.AsyncTask;
import android.os.Bundle;
import android.app.Activity;
import android.widget.Button;
import android.widget.TextView;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
Button btnLoginButton;
TextView tmpError, tmpUsername, tmpPassword;
ArrayList<NameValuePair> postParameters;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tmpError = (TextView) findViewById(R.id.lblMessage);
tmpUsername = (TextView) findViewById(R.id.lblUsername);
tmpPassword = (TextView) findViewById(R.id.lblPassword);
addListenerOnButton();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
public void addListenerOnButton() {
btnLoginButton = (Button) findViewById(R.id.btnLogin);
btnLoginButton.setOnClickListener(new OnClickListener() {
public void onClick(View arg) {
try{
triggerClick();
}
catch (Exception e) {
tmpError.setText("[]" + e.toString());
}
}
});
}
private void triggerClick() {
postParameters = new ArrayList<NameValuePair>();
postParameters.add(new BasicNameValuePair("username", tmpUsername.getText().toString()));
postParameters.add(new BasicNameValuePair("password", tmpPassword.getText().toString()));
final class HttpTask
extends
AsyncTask<String/* Param */, Boolean /* Progress */, String /* Result */> {
@Override
protected String doInBackground(String... params) {
publishProgress(true);
try {
CustomHttpClient.executeHttpPost("http://some.url/thatiknoworks/check.php", postParameters);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}
@Override
protected void onPostExecute(String result) {
publishProgress(false);
result = result.replaceAll("\\s+","");
if(result.equals("1")) {
tmpError.setText("Correct");
}
else {
tmpError.setText("Sorry!!("+result+")");
}
}
}
new HttpTask().execute();
}
}
come back time and time again with an empty "result" string :-( | 0 |
11,541,211 | 07/18/2012 12:19:56 | 613,126 | 02/11/2011 13:48:53 | 104 | 2 | Rotating IPad Screen Orientation on Different Views | I have an iPad application that opens up in portrait mode but when I switch to another view I need to force the orientation to landscape so that the user realises they need to physically move the screen orientation to landscape, and then when they leave this view I need to force the orientation back to portrait.
I can see the ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) which if believe correctly just restricts the orientations that are possible for the view but setting this to one orientation (e.g. UIInterfaceOrientation.LandscapeRight) doesn't force the orientation to change.
I've seen some other suggestions about forcing the View to rotate using this.View.Transform.Rotate(...) but doesn't seem to work for me.
Just wondering if anyone had any suggestions or be able to point me in the right direction?
Thanks | monotouch | null | null | null | null | null | open | Rotating IPad Screen Orientation on Different Views
===
I have an iPad application that opens up in portrait mode but when I switch to another view I need to force the orientation to landscape so that the user realises they need to physically move the screen orientation to landscape, and then when they leave this view I need to force the orientation back to portrait.
I can see the ShouldAutorotateToInterfaceOrientation(UIInterfaceOrientation toInterfaceOrientation) which if believe correctly just restricts the orientations that are possible for the view but setting this to one orientation (e.g. UIInterfaceOrientation.LandscapeRight) doesn't force the orientation to change.
I've seen some other suggestions about forcing the View to rotate using this.View.Transform.Rotate(...) but doesn't seem to work for me.
Just wondering if anyone had any suggestions or be able to point me in the right direction?
Thanks | 0 |
11,541,213 | 07/18/2012 12:20:00 | 1,010,943 | 10/24/2011 13:31:08 | 190 | 2 | Website does not display on Android emulator | I am new to Android dev and am trying to create a Web app. I want to check how the web page looks in my web app but it would not display (niether the localhost nor the web one) on the emulator. The webaddress (http://48.128...) worked on the phone when i got it connected it to wifi and checked it at my workplace. Any ideas ?
This is what i have tried so far ( http://www.vtgroup.com/index.html#LocalBrowser ) | android | android-emulator | null | null | null | null | open | Website does not display on Android emulator
===
I am new to Android dev and am trying to create a Web app. I want to check how the web page looks in my web app but it would not display (niether the localhost nor the web one) on the emulator. The webaddress (http://48.128...) worked on the phone when i got it connected it to wifi and checked it at my workplace. Any ideas ?
This is what i have tried so far ( http://www.vtgroup.com/index.html#LocalBrowser ) | 0 |
11,541,215 | 07/18/2012 12:20:11 | 1,493,386 | 06/30/2012 18:07:10 | 19 | 1 | Why am I getting this error when loading my TableViewcontroller | I'm working on a project for iOS5 using ARC and storyboard.
I have a mapview with annotations with a disclosure button going to my DetailView (which is a TableViewController) but when it's supposed to be loaded, I get the following error:
2012-07-18 14:09:43.328 Zone-It-new[1966:707] Loadded the view for MapViewController
2012-07-18 14:11:40.467 Zone-It-new[1966:707] -[UILabel copyWithZone:]: unrecognized selector sent to instance 0x138470
2012-07-18 14:11:40.470 Zone-It-new[1966:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector sent to instance 0x138470'
*** First throw call stack:
(0x3748488f 0x35189259 0x37487a9b 0x37486915 0x373e1650 0x311997ef 0x31195059 0x31194711 0x3119466b 0x311945e7 0x31284f63 0x311979bb 0x311973ad 0x31191b8b 0x311917d5 0x9386d 0x3120a93d 0x31284627 0x37cf5933 0x37458a33 0x37458699 0x3745726f 0x373da4a5 0x373da36d 0x33b99439 0x31186cd5 0x924b3 0x92458)
terminate called throwing an exception(lldb)
This is my detailviewcontroller.h:
#import <UIKit/UIKit.h>
#import "Event.h"
@interface DetailViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>{
IBOutlet UILabel *title;
IBOutlet UILabel *description;
IBOutlet UILabel *zone;
IBOutlet UILabel *gemeente;
IBOutlet UILabel *plaats;
IBOutlet UILabel *deelnemers;
IBOutlet UILabel *start;
IBOutlet UILabel *einde;
IBOutlet UILabel *id_nr;
}
@property (nonatomic) Event *event;
@property (nonatomic) IBOutlet UILabel *title, *zone, *description, *gemeente, *deelnemers, *start, *einde, *plaats, *id_nr;
@end
part of the DetailViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[[self navigationController] setNavigationBarHidden:NO animated:YES];
/*title.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;*/
[title lineBreakMode];
[title setText:[event title]];
[title sizeToFit];
gemeente.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
[title lineBreakMode];
[gemeente setText:[event gemeente]];
}
And this is where the view gets created in via the ListView:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
SingletonManager *sharedManager = [SingletonManager sharedManager];
[detail setEvent:[sharedManager.eventsManager objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:detail animated:YES];
} | iphone | objective-c | ios | uitableview | null | null | open | Why am I getting this error when loading my TableViewcontroller
===
I'm working on a project for iOS5 using ARC and storyboard.
I have a mapview with annotations with a disclosure button going to my DetailView (which is a TableViewController) but when it's supposed to be loaded, I get the following error:
2012-07-18 14:09:43.328 Zone-It-new[1966:707] Loadded the view for MapViewController
2012-07-18 14:11:40.467 Zone-It-new[1966:707] -[UILabel copyWithZone:]: unrecognized selector sent to instance 0x138470
2012-07-18 14:11:40.470 Zone-It-new[1966:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector sent to instance 0x138470'
*** First throw call stack:
(0x3748488f 0x35189259 0x37487a9b 0x37486915 0x373e1650 0x311997ef 0x31195059 0x31194711 0x3119466b 0x311945e7 0x31284f63 0x311979bb 0x311973ad 0x31191b8b 0x311917d5 0x9386d 0x3120a93d 0x31284627 0x37cf5933 0x37458a33 0x37458699 0x3745726f 0x373da4a5 0x373da36d 0x33b99439 0x31186cd5 0x924b3 0x92458)
terminate called throwing an exception(lldb)
This is my detailviewcontroller.h:
#import <UIKit/UIKit.h>
#import "Event.h"
@interface DetailViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>{
IBOutlet UILabel *title;
IBOutlet UILabel *description;
IBOutlet UILabel *zone;
IBOutlet UILabel *gemeente;
IBOutlet UILabel *plaats;
IBOutlet UILabel *deelnemers;
IBOutlet UILabel *start;
IBOutlet UILabel *einde;
IBOutlet UILabel *id_nr;
}
@property (nonatomic) Event *event;
@property (nonatomic) IBOutlet UILabel *title, *zone, *description, *gemeente, *deelnemers, *start, *einde, *plaats, *id_nr;
@end
part of the DetailViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[[self navigationController] setNavigationBarHidden:NO animated:YES];
/*title.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;*/
[title lineBreakMode];
[title setText:[event title]];
[title sizeToFit];
gemeente.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin;
[title lineBreakMode];
[gemeente setText:[event gemeente]];
}
And this is where the view gets created in via the ListView:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *detail = [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
SingletonManager *sharedManager = [SingletonManager sharedManager];
[detail setEvent:[sharedManager.eventsManager objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:detail animated:YES];
} | 0 |
11,541,216 | 07/18/2012 12:20:14 | 1,190,958 | 02/05/2012 18:07:32 | 370 | 18 | Play video file in Sencha touch 2 |
Ext.define('Video.view.video', {
extend: 'Ext.Container',
requires: [
'Ext.Video'
],
config: {
layout: 'fit',
items: [{
xtype: 'video',
url: ['aa.mp4'],
loop: true,
posterUrl: 'resources/images/cover.jpg'
}]
}
});
> this is my code, but not display video
| android | sencha-touch | sencha | null | null | null | open | Play video file in Sencha touch 2
===
Ext.define('Video.view.video', {
extend: 'Ext.Container',
requires: [
'Ext.Video'
],
config: {
layout: 'fit',
items: [{
xtype: 'video',
url: ['aa.mp4'],
loop: true,
posterUrl: 'resources/images/cover.jpg'
}]
}
});
> this is my code, but not display video
| 0 |
11,226,192 | 06/27/2012 12:27:33 | 1,428,109 | 05/16/2012 12:26:22 | 74 | 5 | Carousel didn't start cycle onload | Problem is in title.
<p> My html:
<div id="myCarousel" class="carousel">
<div class="carousel-inner">
<div class="active item"><%= image_tag("/images/home_page_1.png")%></div>
<div class="item"><%= image_tag("/images/home_page_2.png", :size => '600x260') %></div>
<div class="item"><%= image_tag("/images/home_page_3.png", :size => '600x260') %></div>
</div>
</div>
My js:
$('#myCarousel').carousel({ interval: 200 })
Files are in my js folder. Everthing else working wright.
Google chrome gives me error:
Uncaught TypeError: Object [object Object] has no method 'carousel' :3000/assets/application.js?body=1:17 | twitter-bootstrap | null | null | null | null | null | open | Carousel didn't start cycle onload
===
Problem is in title.
<p> My html:
<div id="myCarousel" class="carousel">
<div class="carousel-inner">
<div class="active item"><%= image_tag("/images/home_page_1.png")%></div>
<div class="item"><%= image_tag("/images/home_page_2.png", :size => '600x260') %></div>
<div class="item"><%= image_tag("/images/home_page_3.png", :size => '600x260') %></div>
</div>
</div>
My js:
$('#myCarousel').carousel({ interval: 200 })
Files are in my js folder. Everthing else working wright.
Google chrome gives me error:
Uncaught TypeError: Object [object Object] has no method 'carousel' :3000/assets/application.js?body=1:17 | 0 |
11,226,196 | 06/27/2012 12:27:40 | 894,837 | 08/15/2011 11:29:51 | 46 | 1 | Jasper report line chart with two date type axis | ![Required report][1]
[1]: http://i.stack.imgur.com/jReEz.jpg
Hello !
I need to create a report like the attachment shows with Jasper Reports.
I've tried it with line chart. Result : line chart expects 2 number type field for axises.
I've tried it with Time series. Result : time series expect 1 number and 1 date type field for axises.
I have to use dates, so I need a chart type what can handle dates.
Any suggestion how can I solve this ? I've tried Google at least 10 hour. Now I'm very desperated.
Thanks ! | date | jasper-reports | report | axis | null | null | open | Jasper report line chart with two date type axis
===
![Required report][1]
[1]: http://i.stack.imgur.com/jReEz.jpg
Hello !
I need to create a report like the attachment shows with Jasper Reports.
I've tried it with line chart. Result : line chart expects 2 number type field for axises.
I've tried it with Time series. Result : time series expect 1 number and 1 date type field for axises.
I have to use dates, so I need a chart type what can handle dates.
Any suggestion how can I solve this ? I've tried Google at least 10 hour. Now I'm very desperated.
Thanks ! | 0 |
11,226,198 | 06/27/2012 12:27:45 | 1,025,589 | 11/02/2011 12:15:58 | 1 | 0 | Desire2Learn Office Extensions not working correctly with Office 2010 and D2L 10 | When we attempt to use Desire2Learn Office Extension with Office 2010 on Windows 7 against our development instance of D2L v10 the login integration does not work properly. I enter the URL for our development instance:
[Screenshot #1](http://s.lundrigan.ca/d87e6c.png)
When I click the "Login" button on the Desire2Learn tab in Word, I get a popup dialog with the standard D2L sign-in page:
[Screenshot #2](http://s.lundrigan.ca/7c6940.png)
But when I enter valid credentials I am redirected to the D2L org-level homepage within the same small popup window, which is not the expected behavior for the IDKey authentication redirect. I haven't had much experience yet with D2L Valence APIs, but it appears that the initial request to /d2l/auth/api/token fails and am then redirected to the standard D2L login page.
Is there anyone here who has been able to successfully configure D2L 10 to work with the Office Extension who could assist me in getting this working? | desire2learn | null | null | null | null | null | open | Desire2Learn Office Extensions not working correctly with Office 2010 and D2L 10
===
When we attempt to use Desire2Learn Office Extension with Office 2010 on Windows 7 against our development instance of D2L v10 the login integration does not work properly. I enter the URL for our development instance:
[Screenshot #1](http://s.lundrigan.ca/d87e6c.png)
When I click the "Login" button on the Desire2Learn tab in Word, I get a popup dialog with the standard D2L sign-in page:
[Screenshot #2](http://s.lundrigan.ca/7c6940.png)
But when I enter valid credentials I am redirected to the D2L org-level homepage within the same small popup window, which is not the expected behavior for the IDKey authentication redirect. I haven't had much experience yet with D2L Valence APIs, but it appears that the initial request to /d2l/auth/api/token fails and am then redirected to the standard D2L login page.
Is there anyone here who has been able to successfully configure D2L 10 to work with the Office Extension who could assist me in getting this working? | 0 |
11,226,199 | 06/27/2012 12:27:48 | 1,434,917 | 06/04/2012 10:25:00 | 1 | 0 | Join performance on AWS elastic map reduce running hive | I am running a simple join query
select count(*) from t1 join t2 on t1.sno=t2.sno
Table t1 and t2 both have 20 million records each and column sno is of string data type.
The table data is imported in to HDFS from Amazon s3 in rcfile format.
The query took 109s with 15 Amazon large instances however it takes 42sec on sql server with 16 GB RAM and 16 cpu cores.
Am I missing anything? Can't understand why am I getting slow performance on Amazon?
| amazon-ec2 | hive | hdfs | elastic-map-reduce | null | null | open | Join performance on AWS elastic map reduce running hive
===
I am running a simple join query
select count(*) from t1 join t2 on t1.sno=t2.sno
Table t1 and t2 both have 20 million records each and column sno is of string data type.
The table data is imported in to HDFS from Amazon s3 in rcfile format.
The query took 109s with 15 Amazon large instances however it takes 42sec on sql server with 16 GB RAM and 16 cpu cores.
Am I missing anything? Can't understand why am I getting slow performance on Amazon?
| 0 |
11,226,202 | 06/27/2012 12:27:56 | 1,303,170 | 03/30/2012 11:58:13 | 1 | 0 | MVC ViewPathProvider, database views and Layout | I am trying to create a CMS using the MVC framework.
All was going well, I created my tables to store my ViewData, ViewTitle and virtualPath.
I use VirthPathProvider and it looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Hosting;
using CMS;
using System.Collections.ObjectModel;
using CMS.Components;
using System.Web;
namespace CMS.Providers
{
public class PageVirtualPathProvider : VirtualPathProvider
{
private Directory current { get; set; }
private Collection<Directory> directories { get; set; }
private Collection<BasePage> pages { get; set; }
public override bool FileExists(string virtualPath)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
{
BasePage oPage = FindPage(virtualPath);
if (oPage != null)
return true;
}
bool bExists = base.FileExists(virtualPath);
return bExists;
}
public override VirtualFile GetFile(string virtualPath)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
{
BasePage oPage = FindPage(virtualPath);
if (oPage != null)
return new PageVirtualFile(virtualPath, oPage.ViewData.ToArray());
}
return base.GetFile(virtualPath);
}
public override bool DirectoryExists(string virtualDir)
{
if (IsVirtualPath(virtualDir))
{
if (current != null)
{
if (current.Path.ToLower() != virtualDir.ToLower())
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
else
{
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
if (current != null)
return true;
}
return base.DirectoryExists(virtualDir);
}
public override VirtualDirectory GetDirectory(string virtualDir)
{
if (IsVirtualPath(virtualDir))
{
if (current != null)
{
if (current.Path.ToLower() != virtualDir.ToLower())
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
else
{
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
if (current != null)
return new CmsVirtualDirectory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
return base.GetDirectory(virtualDir);
}
public override System.Web.Caching.CacheDependency GetCacheDependency(string virtualPath, System.Collections.IEnumerable virtualPathDependencies, DateTime utcStart)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
return null;
return base.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
}
public override string GetFileHash(string virtualPath, System.Collections.IEnumerable virtualPathDependencies)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
return Guid.NewGuid().ToString();
return base.GetFileHash(virtualPath, virtualPathDependencies);
}
private BasePage FindPage(string virtualPath)
{
string VirtualName = VirtualPathUtility.GetFileName(virtualPath).ToLower();
if (pages == null)
{
pages = PageManager.getAllPages("53AF0033-4011-4C8F-A14D-7CE9301E264D", false);
}
BasePage oPage = pages.SingleOrDefault(page => page.Path.ToLower() == VirtualName);
return oPage;
}
private bool IsVirtualPath(string virtualPath)
{
string Path = VirtualPathUtility.ToAppRelative(virtualPath);
if (directories == null)
{
directories = DirectoryManager.GetAllDirectories("53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
Directory oDir = directories.SingleOrDefault(dir => dir.Path.ToLower() == Path.ToLower());
if (oDir == null || virtualPath == "~/") return false; // If we don't have directory, return false
return true; // Hit only if we are null
}
}
}
Now my problem is this:
Getting the pages is fine, when they are virtual it returns null as Cache and the FileHash is always a different string, so GetFile is called.
My file is returned, but it never finds the Layout.
I believe this is because there is no _ViewStart.cshtml because there is no views directory....So how can I force it to use a Layout?
I have tried so many things, like getting my virtual pages to inherit from @inherits System.Web.Mvc.WebViewPage<dynamic>, etc, but I still get the same problem....
When I navigate to a virtual page, I get this error:
Unable to cast object of type 'ASP._Page_Guidelines_index_cshtml' to type 'System.Web.IHttpHandler'.
Please help me; I have been stuck on this for 3 weeks.... | mvc | null | null | null | null | null | open | MVC ViewPathProvider, database views and Layout
===
I am trying to create a CMS using the MVC framework.
All was going well, I created my tables to store my ViewData, ViewTitle and virtualPath.
I use VirthPathProvider and it looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Hosting;
using CMS;
using System.Collections.ObjectModel;
using CMS.Components;
using System.Web;
namespace CMS.Providers
{
public class PageVirtualPathProvider : VirtualPathProvider
{
private Directory current { get; set; }
private Collection<Directory> directories { get; set; }
private Collection<BasePage> pages { get; set; }
public override bool FileExists(string virtualPath)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
{
BasePage oPage = FindPage(virtualPath);
if (oPage != null)
return true;
}
bool bExists = base.FileExists(virtualPath);
return bExists;
}
public override VirtualFile GetFile(string virtualPath)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
{
BasePage oPage = FindPage(virtualPath);
if (oPage != null)
return new PageVirtualFile(virtualPath, oPage.ViewData.ToArray());
}
return base.GetFile(virtualPath);
}
public override bool DirectoryExists(string virtualDir)
{
if (IsVirtualPath(virtualDir))
{
if (current != null)
{
if (current.Path.ToLower() != virtualDir.ToLower())
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
else
{
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
if (current != null)
return true;
}
return base.DirectoryExists(virtualDir);
}
public override VirtualDirectory GetDirectory(string virtualDir)
{
if (IsVirtualPath(virtualDir))
{
if (current != null)
{
if (current.Path.ToLower() != virtualDir.ToLower())
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
else
{
current = new Directory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
if (current != null)
return new CmsVirtualDirectory(virtualDir, "53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
return base.GetDirectory(virtualDir);
}
public override System.Web.Caching.CacheDependency GetCacheDependency(string virtualPath, System.Collections.IEnumerable virtualPathDependencies, DateTime utcStart)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
return null;
return base.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
}
public override string GetFileHash(string virtualPath, System.Collections.IEnumerable virtualPathDependencies)
{
string Path = (VirtualPathUtility.GetDirectory(virtualPath) != "~/") ? VirtualPathUtility.RemoveTrailingSlash(VirtualPathUtility.GetDirectory(virtualPath)) : VirtualPathUtility.GetDirectory(virtualPath);
if (IsVirtualPath(Path))
return Guid.NewGuid().ToString();
return base.GetFileHash(virtualPath, virtualPathDependencies);
}
private BasePage FindPage(string virtualPath)
{
string VirtualName = VirtualPathUtility.GetFileName(virtualPath).ToLower();
if (pages == null)
{
pages = PageManager.getAllPages("53AF0033-4011-4C8F-A14D-7CE9301E264D", false);
}
BasePage oPage = pages.SingleOrDefault(page => page.Path.ToLower() == VirtualName);
return oPage;
}
private bool IsVirtualPath(string virtualPath)
{
string Path = VirtualPathUtility.ToAppRelative(virtualPath);
if (directories == null)
{
directories = DirectoryManager.GetAllDirectories("53AF0033-4011-4C8F-A14D-7CE9301E264D");
}
Directory oDir = directories.SingleOrDefault(dir => dir.Path.ToLower() == Path.ToLower());
if (oDir == null || virtualPath == "~/") return false; // If we don't have directory, return false
return true; // Hit only if we are null
}
}
}
Now my problem is this:
Getting the pages is fine, when they are virtual it returns null as Cache and the FileHash is always a different string, so GetFile is called.
My file is returned, but it never finds the Layout.
I believe this is because there is no _ViewStart.cshtml because there is no views directory....So how can I force it to use a Layout?
I have tried so many things, like getting my virtual pages to inherit from @inherits System.Web.Mvc.WebViewPage<dynamic>, etc, but I still get the same problem....
When I navigate to a virtual page, I get this error:
Unable to cast object of type 'ASP._Page_Guidelines_index_cshtml' to type 'System.Web.IHttpHandler'.
Please help me; I have been stuck on this for 3 weeks.... | 0 |
11,226,203 | 06/27/2012 12:27:58 | 1,423,650 | 05/29/2012 12:14:07 | 8 | 0 | Trying to update 3 tables with 1 query [in vain] | When i want to populate my grid I use this Select command :
SELECT t1.Id, t1.emertimi, kredite, pershkrim, Viti, t2.Emertimi as Expr1, emri, mbiemri
FROM Kurse as t1 INNER JOIN
Deget as t2 ON t1.degID = t2.Id INNER JOIN
Pedgoge ON t1.Id = Pedgoge.kurs_id
Now when I try to Update the grid with an Update command that is fired after an EditCommand finished ( you pres Update as a link) I use it this way :
UPDATE Kurse
SET t1.emertimi=@emertimi,
kredite=@kredite,
pershkrim=@pershkrim,
Viti=@Viti,
t2.Emertimi as Expr1 = @Expr1, emri=@emri, mbiemri=@mbiemri
FROM Kurse as t1 INNER JOIN
Deget as t2 ON t1.degID = t2.Id INNER JOIN
Pedgoge ON t1.Id = Pedgoge.kurs_id
But this doesn't work. Please as I am a student and non english native is a little hard to understand what should I do in this case. Any help is much appreciated
| sql-server | sql-update | inner-join | multiple-tables | null | null | open | Trying to update 3 tables with 1 query [in vain]
===
When i want to populate my grid I use this Select command :
SELECT t1.Id, t1.emertimi, kredite, pershkrim, Viti, t2.Emertimi as Expr1, emri, mbiemri
FROM Kurse as t1 INNER JOIN
Deget as t2 ON t1.degID = t2.Id INNER JOIN
Pedgoge ON t1.Id = Pedgoge.kurs_id
Now when I try to Update the grid with an Update command that is fired after an EditCommand finished ( you pres Update as a link) I use it this way :
UPDATE Kurse
SET t1.emertimi=@emertimi,
kredite=@kredite,
pershkrim=@pershkrim,
Viti=@Viti,
t2.Emertimi as Expr1 = @Expr1, emri=@emri, mbiemri=@mbiemri
FROM Kurse as t1 INNER JOIN
Deget as t2 ON t1.degID = t2.Id INNER JOIN
Pedgoge ON t1.Id = Pedgoge.kurs_id
But this doesn't work. Please as I am a student and non english native is a little hard to understand what should I do in this case. Any help is much appreciated
| 0 |
11,226,181 | 06/27/2012 12:26:49 | 1,485,581 | 06/27/2012 12:10:51 | 1 | 0 | Google App Engine with GoLang "permission denied" error on Oauth2 autentification | Oauth2 autentification library
Works well on the localhost but crashes when is uploaded to the Google App Engine
http://code.google.com/p/goauth2/source/browse/oauth/oauth.go
When it does the line 250 of the above code
`r, err := (&http.Client{Transport: t.transport()}).PostForm(t.TokenURL, v)`
The error response is "permission denied" | google-app-engine | go | oauth-2.0 | null | null | null | open | Google App Engine with GoLang "permission denied" error on Oauth2 autentification
===
Oauth2 autentification library
Works well on the localhost but crashes when is uploaded to the Google App Engine
http://code.google.com/p/goauth2/source/browse/oauth/oauth.go
When it does the line 250 of the above code
`r, err := (&http.Client{Transport: t.transport()}).PostForm(t.TokenURL, v)`
The error response is "permission denied" | 0 |
11,225,963 | 06/27/2012 12:15:45 | 995,230 | 10/14/2011 10:39:39 | 65 | 0 | how to play popup sound while displaying popup window | Hi I'm displaying pop up window using below code
var left = (screen.width/2)-(400/2);
var top = (screen.height/2)-(400/2);
targetWin2 = window.open ('', 'popup', 'toolbar=no,location=no,directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=10, top='+top+', left='+left);
It works. but how to play pop up sound while displaying this window??? | javascript | javascript-events | popup | popupwindow | null | null | open | how to play popup sound while displaying popup window
===
Hi I'm displaying pop up window using below code
var left = (screen.width/2)-(400/2);
var top = (screen.height/2)-(400/2);
targetWin2 = window.open ('', 'popup', 'toolbar=no,location=no,directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=400, height=10, top='+top+', left='+left);
It works. but how to play pop up sound while displaying this window??? | 0 |
11,225,964 | 06/27/2012 12:15:56 | 1,485,585 | 06/27/2012 12:11:59 | 1 | 0 | Code contratcs doesn't check null condition. Why? | why Contracts for .net doesn't complain about that code ?
private static User GetUser()
{
var sFirstName = Console.ReadLine();
var sLastName = Console.ReadLine();
if (sLastName == "NULL")
{
return null;
}
else
{
return new User(sLastName, sFirstName);
}
}
public static int Main(string[] args)
{
var oUser = GetUser();
DisplayUser(oUser);
Console.ReadLine();
return 0;
}
private static void DisplayUser(User user)
{
Contract.Requires(user != null);
Console.WriteLine(user.ToString());
}
GetUser can return null, but contract never say that I must check the return value before passing it to DisplayUser. Why ? | c# | .net | code-contracts | null | null | null | open | Code contratcs doesn't check null condition. Why?
===
why Contracts for .net doesn't complain about that code ?
private static User GetUser()
{
var sFirstName = Console.ReadLine();
var sLastName = Console.ReadLine();
if (sLastName == "NULL")
{
return null;
}
else
{
return new User(sLastName, sFirstName);
}
}
public static int Main(string[] args)
{
var oUser = GetUser();
DisplayUser(oUser);
Console.ReadLine();
return 0;
}
private static void DisplayUser(User user)
{
Contract.Requires(user != null);
Console.WriteLine(user.ToString());
}
GetUser can return null, but contract never say that I must check the return value before passing it to DisplayUser. Why ? | 0 |
11,226,205 | 06/27/2012 12:28:31 | 489,046 | 10/27/2010 15:35:57 | 362 | 3 | Three tables join given me the all combination of records | When i written the query like the following.. It's written the combination of all the records.
What's the mistake in the query?
SELECT ven.vendor_code, rem.address from vendor ven inner join employee emp on ven.emp_fk = emp.id inner join address add on add.emp_name = emp.emp_name;
| sql | inner-join | null | null | null | null | open | Three tables join given me the all combination of records
===
When i written the query like the following.. It's written the combination of all the records.
What's the mistake in the query?
SELECT ven.vendor_code, rem.address from vendor ven inner join employee emp on ven.emp_fk = emp.id inner join address add on add.emp_name = emp.emp_name;
| 0 |
11,297,830 | 07/02/2012 16:45:07 | 1,496,577 | 07/02/2012 16:12:14 | 1 | 0 | Adding Different Autocompletes of JQuery UI to Dynamically created Inputs | ok here I go,
<p>
What my client wants is to generate a list where he can choose employees names and account numbers and such. So we had some Javascript code to generate a div section with the inputs but when we tried to add the autocomplete it only works for the first field generated in the page, so I know why that happens so cool right>? nope couldnt find a way to add the information to the dynamic divs so is there a way to add them to those? or is it easier to do it by cloning in jquery?
here is the way I had it
this is the HTML
<span id="writedireccion"></span>
<div class="label_texto">Employee
<a class="Nuevo" onclick="addEmp();" >New Employee</a></div>
<div class="input_quitapon">
<div class="input_element">
<div class="input_label">Tipo</div>
<div class="input_value">
</div>
</div>
<div class="input_element">
<div class="input_label">ID</div>
</div>
<div class="input_element">
<div class="input_label">Name.</div>
</div>
<div id="readdireccion" style="display:none">
<div class="input_quitapon">
<a class="Eliminar" onclick="this.parentNode.parentNode.removeChild(this.parentNode);" >Erase</a>
<div class="input_element">
<div class="input_label">Tipo</div>
<div class="input_value">
</div>
</div>
<div class="input_element">
<div class="input_label">ID</div>
<div class="input_value">
<input type="text" name="ID[]" id="ID" class="Employee" maxlength="10" size="12" value=""/>
</div>
</div>
<div class="input_element">
<div class="input_label">Name.</div>
<div class="input_value">
<input type="text" name="Name[]" id="Name" class="Employee" maxlength="25" size="25" value=""/>
and this is the JavaScript
function AgregarDireccion(){
// counter++;
var newFields = document.getElementById('readdireccion').cloneNode(true);
newFields.id = '';
newFields.style.display = 'block';
var insertHere = document.getElementById('writedireccion');
insertHere.parentNode.insertBefore(newFields,insertHere);
}
and finally the Autocomplete
var Cuentas = [ <?php echo($Accounts); ?> ];
$( "#txnTipoNom" ).autocomplete({
source: TransactionCodes,
select: function(event, ui) {
$("#ID").val(ui.item.value);
$("#Name").val(ui.item.desc);
return false;
}
});
so the php echo is actually a list from things inside a mysql table so no biggy there I got that part sorted out but how can I apply this to the dynamically created div's????
| javascript | html | dynamic | input | jquery-ui-autocomplete | null | open | Adding Different Autocompletes of JQuery UI to Dynamically created Inputs
===
ok here I go,
<p>
What my client wants is to generate a list where he can choose employees names and account numbers and such. So we had some Javascript code to generate a div section with the inputs but when we tried to add the autocomplete it only works for the first field generated in the page, so I know why that happens so cool right>? nope couldnt find a way to add the information to the dynamic divs so is there a way to add them to those? or is it easier to do it by cloning in jquery?
here is the way I had it
this is the HTML
<span id="writedireccion"></span>
<div class="label_texto">Employee
<a class="Nuevo" onclick="addEmp();" >New Employee</a></div>
<div class="input_quitapon">
<div class="input_element">
<div class="input_label">Tipo</div>
<div class="input_value">
</div>
</div>
<div class="input_element">
<div class="input_label">ID</div>
</div>
<div class="input_element">
<div class="input_label">Name.</div>
</div>
<div id="readdireccion" style="display:none">
<div class="input_quitapon">
<a class="Eliminar" onclick="this.parentNode.parentNode.removeChild(this.parentNode);" >Erase</a>
<div class="input_element">
<div class="input_label">Tipo</div>
<div class="input_value">
</div>
</div>
<div class="input_element">
<div class="input_label">ID</div>
<div class="input_value">
<input type="text" name="ID[]" id="ID" class="Employee" maxlength="10" size="12" value=""/>
</div>
</div>
<div class="input_element">
<div class="input_label">Name.</div>
<div class="input_value">
<input type="text" name="Name[]" id="Name" class="Employee" maxlength="25" size="25" value=""/>
and this is the JavaScript
function AgregarDireccion(){
// counter++;
var newFields = document.getElementById('readdireccion').cloneNode(true);
newFields.id = '';
newFields.style.display = 'block';
var insertHere = document.getElementById('writedireccion');
insertHere.parentNode.insertBefore(newFields,insertHere);
}
and finally the Autocomplete
var Cuentas = [ <?php echo($Accounts); ?> ];
$( "#txnTipoNom" ).autocomplete({
source: TransactionCodes,
select: function(event, ui) {
$("#ID").val(ui.item.value);
$("#Name").val(ui.item.desc);
return false;
}
});
so the php echo is actually a list from things inside a mysql table so no biggy there I got that part sorted out but how can I apply this to the dynamically created div's????
| 0 |
11,297,831 | 07/02/2012 16:45:09 | 47,110 | 12/17/2008 16:18:32 | 7,908 | 348 | scrollLeft does not work on overflow div in Android? | I setup a very simple Android app with a webview displaying the following:
<style>
div {
overflow-x:scroll;
overflow-y:hidden;
white-space:nowrap;
}
</style>
<div id="main">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
</div>
<script>
window.setTimeout(function () {
var main = document.getElementById('main');
main.scrollLeft = 300;
}, 5000);
</script>
Fiddle [here][1].
What I'm doing is creating a simple scrollable area, however I want to offset the contents by a certain amount. It works great in Chrome, however does not seem to work at all in the Android webview. I even printed the value of `main.scrollLeft` before and after and it shows up in logcat as having been modified but nothing shows up in the display as having changed. Any ideas on what's going on? I've tested this on Gingerbread and ICS.
[1]: http://jsfiddle.net/amjibaly/qVyjb/2/ | javascript | android | webview | null | null | null | open | scrollLeft does not work on overflow div in Android?
===
I setup a very simple Android app with a webview displaying the following:
<style>
div {
overflow-x:scroll;
overflow-y:hidden;
white-space:nowrap;
}
</style>
<div id="main">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
<img src="https://www.google.com/images/srpr/logo3w.png">
</div>
<script>
window.setTimeout(function () {
var main = document.getElementById('main');
main.scrollLeft = 300;
}, 5000);
</script>
Fiddle [here][1].
What I'm doing is creating a simple scrollable area, however I want to offset the contents by a certain amount. It works great in Chrome, however does not seem to work at all in the Android webview. I even printed the value of `main.scrollLeft` before and after and it shows up in logcat as having been modified but nothing shows up in the display as having changed. Any ideas on what's going on? I've tested this on Gingerbread and ICS.
[1]: http://jsfiddle.net/amjibaly/qVyjb/2/ | 0 |
11,296,946 | 07/02/2012 15:45:07 | 1,496,482 | 07/02/2012 15:31:46 | 1 | 0 | Perl - merging two csv files | I am using Text::CSV::Slurp to create csv from an array of hashs. It works great except with one problem - some headers are missing.
hash1
header1 header2
1 2
hash2
header1 header2 header3
11 22 33
I want the final output to be
csv file:
header1 header2 header3
1 2
11 22 33
not the slurp output
header1 header2
1 2
11 22
Any suggestion?
| perl | csv | null | null | null | null | open | Perl - merging two csv files
===
I am using Text::CSV::Slurp to create csv from an array of hashs. It works great except with one problem - some headers are missing.
hash1
header1 header2
1 2
hash2
header1 header2 header3
11 22 33
I want the final output to be
csv file:
header1 header2 header3
1 2
11 22 33
not the slurp output
header1 header2
1 2
11 22
Any suggestion?
| 0 |
11,296,947 | 07/02/2012 15:45:11 | 1,492,272 | 06/29/2012 22:36:11 | 39 | 0 | Xcode Git issues with Google Drive/Dropbox | Apparently XCode should recognize a git repo automatically, but after doing git init and my initial commit, XCode is not seeing the repo. I have my entire project and git repo in Google Drive, and I suspect that is causing some issue? What do I have to do to get XCode to read .git files in Google Drive? | objective-c | ios | xcode | git | null | null | open | Xcode Git issues with Google Drive/Dropbox
===
Apparently XCode should recognize a git repo automatically, but after doing git init and my initial commit, XCode is not seeing the repo. I have my entire project and git repo in Google Drive, and I suspect that is causing some issue? What do I have to do to get XCode to read .git files in Google Drive? | 0 |
11,296,949 | 07/02/2012 15:45:11 | 1,442,534 | 06/07/2012 14:54:40 | 25 | 2 | Created Fille Has No Parent? | In a java program, I create a file with
File temp = new File("temp");
temp.createNewFile();
Then for some reason when I write
File pDir = temp.getParentFile();
and pDir is null. I actually want to write
File pDir = temp.getParentFile().getParentFile();
but that throws a null pointer exception. | java | file | directory | nullpointerexception | parent | null | open | Created Fille Has No Parent?
===
In a java program, I create a file with
File temp = new File("temp");
temp.createNewFile();
Then for some reason when I write
File pDir = temp.getParentFile();
and pDir is null. I actually want to write
File pDir = temp.getParentFile().getParentFile();
but that throws a null pointer exception. | 0 |
11,297,833 | 07/02/2012 16:45:12 | 1,371,057 | 05/02/2012 20:46:32 | 5 | 0 | using Magick++ library in VS C++ Express Edition 2010 | I use Visual Studio C++ Express Edition. I need to build a project which includes Magick++.h
I downloaded ImageMagick-windows library , then I run a wizard(configure.exe) with default options from VisualMagick/configure.
Next I ran generated configure.sln and built it(debug and release). I assume that I should add some dependencies(lib, dll)
to the project but I don't know which files. What about a header Magick++.h ? Should I copy something from ImageMagick folder
to the Microsoft SDKs ? | c++ | visual-studio-2010 | visual-studio | dll | null | null | open | using Magick++ library in VS C++ Express Edition 2010
===
I use Visual Studio C++ Express Edition. I need to build a project which includes Magick++.h
I downloaded ImageMagick-windows library , then I run a wizard(configure.exe) with default options from VisualMagick/configure.
Next I ran generated configure.sln and built it(debug and release). I assume that I should add some dependencies(lib, dll)
to the project but I don't know which files. What about a header Magick++.h ? Should I copy something from ImageMagick folder
to the Microsoft SDKs ? | 0 |
11,297,834 | 07/02/2012 16:45:14 | 527,205 | 12/01/2010 21:33:08 | 470 | 29 | Does anyone know of a jQuery Zoom Plugin? | I've been trying to look at some zoom functionality, but the plugins that I've found that do not have the following:
Zoom Button In/Out
Mouse Zoom on Hover
Location of Zoom
Panning
I've had a problem looking for all the features, but I feel like its better to omit the zoom in and out buttons. What do you think? | jquery-plugins | null | null | null | null | 07/02/2012 16:50:51 | not a real question | Does anyone know of a jQuery Zoom Plugin?
===
I've been trying to look at some zoom functionality, but the plugins that I've found that do not have the following:
Zoom Button In/Out
Mouse Zoom on Hover
Location of Zoom
Panning
I've had a problem looking for all the features, but I feel like its better to omit the zoom in and out buttons. What do you think? | 1 |
11,297,814 | 07/02/2012 16:44:13 | 1,481,252 | 06/25/2012 22:46:21 | 6 | 0 | Lattice Diamond: Setting up a clock | I'm working on learning Verilog and working with CPLDs and I'm stuck. The code I wrote toggles an LED, but I keep getting warnings during synthesis.
//toggles LED on and off after 30 clock cycles
module LEDON(
LED,
clk
);
output LED;
reg LED;
input clk ;
wire clk;
reg [31:0] count;
wire count_max = 32'd1_000_000;
assign count_nxt = (count >= count_max) ? 32'd0 : count + 32'd1;
assign led_state_nxt = (count == count_max) ? ~LED : LED;
always @(posedge clk)
begin
count <= count_nxt;
LED <= led_state_nxt;
end
endmodule
I get these warnings:
@W: MT420 |Found inferred clock LEDON|clk with period 1000.00ns. Please declare a user-defined clock on object "p:clk"
WARNING - map: C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf (4): Error in FREQUENCY NET "clk" 2.080000 MHz ;
WARNING - map: Preference parsing results: 1 semantic error detected
WARNING - map: There are errors in the preference file, "C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf".
WARNING - map: There are semantic errors in the preference file, "C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.prf".
My LPF file looks like this:
BLOCK RESETPATHS ;
BLOCK ASYNCPATHS ;
LOCATE COMP "LED" SITE "41" ;
FREQUENCY NET "clk" 2.08 MHz ;
So does anyone know how to fix these clock warnings? | warnings | delay | verilog | lattice | led | null | open | Lattice Diamond: Setting up a clock
===
I'm working on learning Verilog and working with CPLDs and I'm stuck. The code I wrote toggles an LED, but I keep getting warnings during synthesis.
//toggles LED on and off after 30 clock cycles
module LEDON(
LED,
clk
);
output LED;
reg LED;
input clk ;
wire clk;
reg [31:0] count;
wire count_max = 32'd1_000_000;
assign count_nxt = (count >= count_max) ? 32'd0 : count + 32'd1;
assign led_state_nxt = (count == count_max) ? ~LED : LED;
always @(posedge clk)
begin
count <= count_nxt;
LED <= led_state_nxt;
end
endmodule
I get these warnings:
@W: MT420 |Found inferred clock LEDON|clk with period 1000.00ns. Please declare a user-defined clock on object "p:clk"
WARNING - map: C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf (4): Error in FREQUENCY NET "clk" 2.080000 MHz ;
WARNING - map: Preference parsing results: 1 semantic error detected
WARNING - map: There are errors in the preference file, "C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.lpf".
WARNING - map: There are semantic errors in the preference file, "C:/Documents and Settings/belo/Desktop/LedOn2/LedON2.prf".
My LPF file looks like this:
BLOCK RESETPATHS ;
BLOCK ASYNCPATHS ;
LOCATE COMP "LED" SITE "41" ;
FREQUENCY NET "clk" 2.08 MHz ;
So does anyone know how to fix these clock warnings? | 0 |
11,297,804 | 07/02/2012 16:43:45 | 571,506 | 01/11/2011 16:12:02 | 128 | 9 | Scandinavian characters æ, ø, å escaped incorrectly | My program interfaces with servers in other countries and regularly needs to handle URLs containing foreign characters. This works fine until we consider Scandinavian characters such as `æ`, `ø`, and `å`. When I receive a URL, I decode it as follows:
-(NSString*)urlDECODE:(NSString*)string
{
NSString* s = [string stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return (s)?s:string;
}
This fails to properly decode these characters, however:
filename: æøåa.rtf
input: %C3%83%C2%A6%C3%83%C2%B8a%C3%8C%C2%8Aa.rtf
output: æøaÌa.rtf | objective-c | osx | utf8-decode | null | null | null | open | Scandinavian characters æ, ø, å escaped incorrectly
===
My program interfaces with servers in other countries and regularly needs to handle URLs containing foreign characters. This works fine until we consider Scandinavian characters such as `æ`, `ø`, and `å`. When I receive a URL, I decode it as follows:
-(NSString*)urlDECODE:(NSString*)string
{
NSString* s = [string stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
return (s)?s:string;
}
This fails to properly decode these characters, however:
filename: æøåa.rtf
input: %C3%83%C2%A6%C3%83%C2%B8a%C3%8C%C2%8Aa.rtf
output: æøaÌa.rtf | 0 |
11,471,321 | 07/13/2012 13:19:10 | 1,477,414 | 06/23/2012 22:12:27 | 1 | 0 | scheduling an event in Android | What is the best way to schedule an event?
I was thinking about this new Calendar API,but it requires a internet connectiong at least for create a new calendar.
There is no one API for create a schedule without connection? | android | android-calendar | null | null | null | null | open | scheduling an event in Android
===
What is the best way to schedule an event?
I was thinking about this new Calendar API,but it requires a internet connectiong at least for create a new calendar.
There is no one API for create a schedule without connection? | 0 |
10,932,095 | 06/07/2012 12:47:47 | 1,089,715 | 12/09/2011 12:29:46 | 101 | 9 | How to debug objuscated JavaScript? | I need to debug obfuscated JavaScript like this example:
__d("DataStore",[],function(a,b,c,d,e,f){var g={},h=1;function i(l){if(typeof l=='string'){return 'str_'+l;}else return 'elem_'+(l.__FB_TOKEN||(l.__FB_TOKEN=[h++]))........
JavaScript debuggers embedded in MSIE, Opera and Chrome do not understand that JS uses semicolon and not CRLF as a line break; so, it is impossible to debug script like that, because entire function is located on one large line, and debugger always highlight this one line disallowing me to see what part of code is actually executed.
Is there any way or any tools that allow to debug JavaScript files that contain a very long lines of codes and don't use CRLF to separate code lines? | javascript | html | html5 | debugging | null | null | open | How to debug objuscated JavaScript?
===
I need to debug obfuscated JavaScript like this example:
__d("DataStore",[],function(a,b,c,d,e,f){var g={},h=1;function i(l){if(typeof l=='string'){return 'str_'+l;}else return 'elem_'+(l.__FB_TOKEN||(l.__FB_TOKEN=[h++]))........
JavaScript debuggers embedded in MSIE, Opera and Chrome do not understand that JS uses semicolon and not CRLF as a line break; so, it is impossible to debug script like that, because entire function is located on one large line, and debugger always highlight this one line disallowing me to see what part of code is actually executed.
Is there any way or any tools that allow to debug JavaScript files that contain a very long lines of codes and don't use CRLF to separate code lines? | 0 |
11,471,283 | 07/13/2012 13:16:42 | 1,523,627 | 07/13/2012 13:06:17 | 1 | 0 | Something in my initiation is causing the app to crash. I'm fresh out of ideas if anyone can help I will be greatfull | The catlog says that the first for cycle completes and the crash happens at the second one.
This is the init method for a very simple game.
private void init()
{
Resources res = this.getResources();
int x=R.drawable.crystal0000;
for(int i=0;i<=100;i++)// This for completes
{
Bitmap b=BitmapFactory.decodeResource(res, x+i);
Log.d("crystalframes loaded", Integer.toString(i));
crystalframes[i]=Bitmap.createScaledBitmap(b, 20, 20, false);
}// Nothing after this points goes trough
x = R.drawable.frame0;
for (int i = 0; i < 10; i++) {
Bitmap t = BitmapFactory.decodeResource(res, x + i);
Log.d("frame", Integer.toString(i));
frames[i] = Bitmap.createScaledBitmap(t, 40, 40, false);
}
x = R.drawable.rframe0;
for (int i = 0; i < 10; i++) {
Bitmap t = BitmapFactory.decodeResource(res, x + i);
Log.d("frame", Integer.toString(i));
frames[i + 10] = Bitmap.createScaledBitmap(t, 40, 40, false);
}
// Code continues from the here but the crash is caused somewhere in these lines | java | android | null | null | null | null | open | Something in my initiation is causing the app to crash. I'm fresh out of ideas if anyone can help I will be greatfull
===
The catlog says that the first for cycle completes and the crash happens at the second one.
This is the init method for a very simple game.
private void init()
{
Resources res = this.getResources();
int x=R.drawable.crystal0000;
for(int i=0;i<=100;i++)// This for completes
{
Bitmap b=BitmapFactory.decodeResource(res, x+i);
Log.d("crystalframes loaded", Integer.toString(i));
crystalframes[i]=Bitmap.createScaledBitmap(b, 20, 20, false);
}// Nothing after this points goes trough
x = R.drawable.frame0;
for (int i = 0; i < 10; i++) {
Bitmap t = BitmapFactory.decodeResource(res, x + i);
Log.d("frame", Integer.toString(i));
frames[i] = Bitmap.createScaledBitmap(t, 40, 40, false);
}
x = R.drawable.rframe0;
for (int i = 0; i < 10; i++) {
Bitmap t = BitmapFactory.decodeResource(res, x + i);
Log.d("frame", Integer.toString(i));
frames[i + 10] = Bitmap.createScaledBitmap(t, 40, 40, false);
}
// Code continues from the here but the crash is caused somewhere in these lines | 0 |
11,471,335 | 07/13/2012 13:20:11 | 206,520 | 11/09/2009 01:07:33 | 190 | 5 | Android Zxing scanner - cannot run debugger | For some reason when I'm running the Zxing example project, I can't seem to scan when debugging. Nothing just seems to be fired, and I can't decode anything.
The camera is running fine and I don't see any errors in logcat.
As soon as I disconnect the debugger, everything works as expected. I'm hence forced to use logcat to debug.
Has anyone seen this before?
Thanks! | android | zxing | barcode-scanner | null | null | null | open | Android Zxing scanner - cannot run debugger
===
For some reason when I'm running the Zxing example project, I can't seem to scan when debugging. Nothing just seems to be fired, and I can't decode anything.
The camera is running fine and I don't see any errors in logcat.
As soon as I disconnect the debugger, everything works as expected. I'm hence forced to use logcat to debug.
Has anyone seen this before?
Thanks! | 0 |
11,471,339 | 07/13/2012 13:20:23 | 982,002 | 10/06/2011 10:28:02 | 1,606 | 77 | ColdFusion Axis stuck - can't kill it due it's a native call - restart service? | I'm consuming a webservice to get some information from another server. Sadly I need to use SOAP to do so.
The problem is that at the moment there are 4 requests running which consume the webservice with something like this:
<CFSET args = structnew() />
<CFSET args.refreshWSDL = false />
<CFSET webservice_wsdl = "http://www.example.com/getsomeinfo.asmx?wsdl" />
<CFSET ws = createObject("webservice", webservice_wsdl, args) />
<CFSET result = ws.stealCookieMonstersCookies() />
These 4 requests are shown in FusionReactor like this:
![FusionReactor / Requests -> Running Requests][1]
Our crashprotection tried already killing them but did not succeed ... either did a manual kill attempt.
The first few lines of the Stacktrace don't seem to help much (or am I wrong here?):
![Stacktrace (native call)][2]
New requests to these pages are running fine. I _guess_ there was something wrong at the time where these 4 webservice calls were started.
How do I get rid of these stuck requests? Do I need to restart the CF service? What can I do that this won't happen again? What may have caused this behaviour?
[1]: http://i.stack.imgur.com/P1e8E.png
[2]: http://i.stack.imgur.com/X2wCC.png | soap | request | coldfusion-9 | apache-axis | fusionreactor | null | open | ColdFusion Axis stuck - can't kill it due it's a native call - restart service?
===
I'm consuming a webservice to get some information from another server. Sadly I need to use SOAP to do so.
The problem is that at the moment there are 4 requests running which consume the webservice with something like this:
<CFSET args = structnew() />
<CFSET args.refreshWSDL = false />
<CFSET webservice_wsdl = "http://www.example.com/getsomeinfo.asmx?wsdl" />
<CFSET ws = createObject("webservice", webservice_wsdl, args) />
<CFSET result = ws.stealCookieMonstersCookies() />
These 4 requests are shown in FusionReactor like this:
![FusionReactor / Requests -> Running Requests][1]
Our crashprotection tried already killing them but did not succeed ... either did a manual kill attempt.
The first few lines of the Stacktrace don't seem to help much (or am I wrong here?):
![Stacktrace (native call)][2]
New requests to these pages are running fine. I _guess_ there was something wrong at the time where these 4 webservice calls were started.
How do I get rid of these stuck requests? Do I need to restart the CF service? What can I do that this won't happen again? What may have caused this behaviour?
[1]: http://i.stack.imgur.com/P1e8E.png
[2]: http://i.stack.imgur.com/X2wCC.png | 0 |
11,471,345 | 07/13/2012 13:20:45 | 524,336 | 11/29/2010 20:35:06 | 20 | 0 | Apache proxy with ssl not show basicauth dialog from back-end | I have a Apache proxy which serve the ssl for the client. The Apache then proxy to a plain http tomcat server.
Listen 7777
<VirtualHost *:7777>
ServerName my.server.com
SSLEngine on
SSLCertificateFile /some.crt
SSLCertificateKeyFile /some.pem
SSLProxyEngine on
# Replace HTTP response headers (http to https)
Header edit Location ^http:(.*)$ https:$1
ProxyRequests off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://my.server.com:8888/
ProxyPassReverse / http://my.server.com:8888/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
Everything is working fine but when I access
https://my.server.com:7777/jmx-console
I get a
http status 403 Access to the specified resource () has been forbidden.
If I access the backend directly
http://my.server.com:8888/jmx-console
I get the basic authentication dialog
I want the Apache to show the backend basic authentication dialog from tomcat. What am I missing? | apache | tomcat | null | null | null | null | open | Apache proxy with ssl not show basicauth dialog from back-end
===
I have a Apache proxy which serve the ssl for the client. The Apache then proxy to a plain http tomcat server.
Listen 7777
<VirtualHost *:7777>
ServerName my.server.com
SSLEngine on
SSLCertificateFile /some.crt
SSLCertificateKeyFile /some.pem
SSLProxyEngine on
# Replace HTTP response headers (http to https)
Header edit Location ^http:(.*)$ https:$1
ProxyRequests off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://my.server.com:8888/
ProxyPassReverse / http://my.server.com:8888/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
Everything is working fine but when I access
https://my.server.com:7777/jmx-console
I get a
http status 403 Access to the specified resource () has been forbidden.
If I access the backend directly
http://my.server.com:8888/jmx-console
I get the basic authentication dialog
I want the Apache to show the backend basic authentication dialog from tomcat. What am I missing? | 0 |
11,280,122 | 07/01/2012 06:51:43 | 1,014,005 | 10/26/2011 05:53:31 | 9 | 0 | Why am I allowed to access a nonexistant variable? | Possibly a dumb question, but I'm more used to Java and the likes and thus don't get why I can do this:
class A:
def __init__( self ):
pass
a = A()
a.description = "whyyy"
print a.description
And have it print out `whyyy` instead of giving me an error. | python | class | null | null | null | null | open | Why am I allowed to access a nonexistant variable?
===
Possibly a dumb question, but I'm more used to Java and the likes and thus don't get why I can do this:
class A:
def __init__( self ):
pass
a = A()
a.description = "whyyy"
print a.description
And have it print out `whyyy` instead of giving me an error. | 0 |
11,280,124 | 07/01/2012 06:52:11 | 1,174,184 | 01/27/2012 19:02:58 | 13 | 0 | Sandboxing in Lua 5.2 | I am learning from "Programing in Lua" by Roberto Ierusalimschy, and I found that in the book, the example of Sandboxing uses the function `setfenv()` to change the environment of a given function, but in lua 5.2 this function is no longer available.
I tried to load some values for a file (a configuration file) into a field in a table, but, in lua 5.2 I can't use setfenv ( so I can load the values in the given environment). After reading some articles about lua 5.2 I found that each function may have (or not) an upvalue called _ENV which serves as the environment, so, I tried the following code:
function sandbox(sb_func, sb_env)
if not sb_func then return nil, "sandbox function not valid" end
sb_orig_env = _ENV
_ENV = sb_env -- yes, replaces the global _ENV
pcall_res, message = pcall( sb_func )
local modified_env = _ENV -- gets the environment that was used in the pcall( sb_func )
_ENV = sb_orig_env
return true, modified_env
end
function readFile(filename)
code = loadfile(filename)
res, table = sandbox(code, {})
if res then
--[[ Use table (modified_env) ]]--
else
print("Code not valid")
end
Replacing `_ENV` in the 'sandbox' function works well (can't access the regular fields), but, when the 'code' is executed it seems that it ignores that I replaced `_ENV`, it still can access regular fields (print, loadfile, dofile, etc).
Reading a little more, I found that lua 5.2 provides a function for this purpose, this function is `loadin(env, chunk)`, which runs the given chunk in the given environment, but, when I try to add this function to my code, the function doesn't exist ( Is not present in the global `_G` field).
Some help will be appreciated.
| file | lua | external | sandbox | environment | null | open | Sandboxing in Lua 5.2
===
I am learning from "Programing in Lua" by Roberto Ierusalimschy, and I found that in the book, the example of Sandboxing uses the function `setfenv()` to change the environment of a given function, but in lua 5.2 this function is no longer available.
I tried to load some values for a file (a configuration file) into a field in a table, but, in lua 5.2 I can't use setfenv ( so I can load the values in the given environment). After reading some articles about lua 5.2 I found that each function may have (or not) an upvalue called _ENV which serves as the environment, so, I tried the following code:
function sandbox(sb_func, sb_env)
if not sb_func then return nil, "sandbox function not valid" end
sb_orig_env = _ENV
_ENV = sb_env -- yes, replaces the global _ENV
pcall_res, message = pcall( sb_func )
local modified_env = _ENV -- gets the environment that was used in the pcall( sb_func )
_ENV = sb_orig_env
return true, modified_env
end
function readFile(filename)
code = loadfile(filename)
res, table = sandbox(code, {})
if res then
--[[ Use table (modified_env) ]]--
else
print("Code not valid")
end
Replacing `_ENV` in the 'sandbox' function works well (can't access the regular fields), but, when the 'code' is executed it seems that it ignores that I replaced `_ENV`, it still can access regular fields (print, loadfile, dofile, etc).
Reading a little more, I found that lua 5.2 provides a function for this purpose, this function is `loadin(env, chunk)`, which runs the given chunk in the given environment, but, when I try to add this function to my code, the function doesn't exist ( Is not present in the global `_G` field).
Some help will be appreciated.
| 0 |
11,280,120 | 07/01/2012 06:50:53 | 330,320 | 05/01/2010 11:06:04 | 16 | 4 | How to disable issueing queries against EdmMetadata table in EF CodeFirst | I'm using CodeFirst in my new project. I'm not going to use Auto Migration feature and have not [__MigrationHistory] table in db. But with looking at Profiler, I can always see EF issues a query like this before any other queries:
<pre>
SELECT
[GroupBy1].[A1] AS [C1]
FROM ( SELECT
COUNT(1) AS [A1]
FROM [dbo].[__MigrationHistory] AS [Extent1]
) AS [GroupBy1]
</pre>
Haw can I disable this feature?
Thanks | entity-framework | code-first | null | null | null | null | open | How to disable issueing queries against EdmMetadata table in EF CodeFirst
===
I'm using CodeFirst in my new project. I'm not going to use Auto Migration feature and have not [__MigrationHistory] table in db. But with looking at Profiler, I can always see EF issues a query like this before any other queries:
<pre>
SELECT
[GroupBy1].[A1] AS [C1]
FROM ( SELECT
COUNT(1) AS [A1]
FROM [dbo].[__MigrationHistory] AS [Extent1]
) AS [GroupBy1]
</pre>
Haw can I disable this feature?
Thanks | 0 |
11,280,121 | 07/01/2012 06:51:38 | 1,291,122 | 03/25/2012 10:16:53 | 68 | 3 | HTML table going beyond asp.net master page content margin | I have a table with 9 columns in an asp.net(vb) master page. The cells are supposed to hold textboxes. But even without textboxes, they are going beyond the content margins. So what can be done to make them fit the master page margins and if still it does not fits, the content area should become scrollable(not the whole page!). | asp.net | html | css | vb.net | master-pages | null | open | HTML table going beyond asp.net master page content margin
===
I have a table with 9 columns in an asp.net(vb) master page. The cells are supposed to hold textboxes. But even without textboxes, they are going beyond the content margins. So what can be done to make them fit the master page margins and if still it does not fits, the content area should become scrollable(not the whole page!). | 0 |
11,279,750 | 07/01/2012 05:11:51 | 1,325,480 | 04/11/2012 02:21:28 | 44 | 0 | Making older files compatible for ARC iOS | In order to make older files capable to compiled under ARC, set the switch -fno-objc-arc
under Build phase.
But only .m files listed which I can add -fno-objc-arc.
but I have some .h files that caused ARC errors too. I need to set that switch to those .h files. but I don't see them under Build phase.
So, how do I set the switch for the .h files?
| ios | arc | null | null | null | null | open | Making older files compatible for ARC iOS
===
In order to make older files capable to compiled under ARC, set the switch -fno-objc-arc
under Build phase.
But only .m files listed which I can add -fno-objc-arc.
but I have some .h files that caused ARC errors too. I need to set that switch to those .h files. but I don't see them under Build phase.
So, how do I set the switch for the .h files?
| 0 |
11,280,128 | 07/01/2012 06:52:53 | 963,714 | 09/25/2011 14:42:29 | 75 | 0 | ExtJs: TypeError: Cannot call method 'setStyle' of undefined | I've hit the wall with
TypeError: Cannot call method 'setStyle' of undefined
All I am doing is just placing a grid inside a tabpanel. I have tried all I could think of to make it work, but it simply won't. What could be the problem? | extjs | grid | tabpanel | null | null | null | open | ExtJs: TypeError: Cannot call method 'setStyle' of undefined
===
I've hit the wall with
TypeError: Cannot call method 'setStyle' of undefined
All I am doing is just placing a grid inside a tabpanel. I have tried all I could think of to make it work, but it simply won't. What could be the problem? | 0 |
11,280,131 | 07/01/2012 06:53:07 | 69,834 | 02/23/2009 10:29:38 | 260 | 3 | Changing the id-attribute of a list item with jquery | When I click on the list-item below (li) I change the id of it from sprite-heart to sprite-stars. That works nice.
But once I click the li again it handles the function like it is sprite-heart but the function should be bypassed now that the list item is sprite-stars.
How can I change this?
<li><a class="navit" id="sprite-heart" title="Love this webcam! Add to my personal webcam page" href="#"><span class="love">Love this webcam</span></a></li>
$("#sprite-heart").click(function() {
addfavcam();
});
function addfavcam()
{
$.ajax({
url: '/v3/ajax/addfavourite.php',
type: 'POST',
data: {id: <?php echo $cam_id; ?>, usr: 'x<?php echo $user_id; ?>'},
success: function(responseText){
$('#sprite-heart').attr('id','sprite-stars');
$('#sprite-heart,#sprite-stars').attr('title','My favourite');
},
error: function(responseText){
}
});
}
| jquery | jquery-ajax | null | null | null | null | open | Changing the id-attribute of a list item with jquery
===
When I click on the list-item below (li) I change the id of it from sprite-heart to sprite-stars. That works nice.
But once I click the li again it handles the function like it is sprite-heart but the function should be bypassed now that the list item is sprite-stars.
How can I change this?
<li><a class="navit" id="sprite-heart" title="Love this webcam! Add to my personal webcam page" href="#"><span class="love">Love this webcam</span></a></li>
$("#sprite-heart").click(function() {
addfavcam();
});
function addfavcam()
{
$.ajax({
url: '/v3/ajax/addfavourite.php',
type: 'POST',
data: {id: <?php echo $cam_id; ?>, usr: 'x<?php echo $user_id; ?>'},
success: function(responseText){
$('#sprite-heart').attr('id','sprite-stars');
$('#sprite-heart,#sprite-stars').attr('title','My favourite');
},
error: function(responseText){
}
});
}
| 0 |
11,280,136 | 07/01/2012 06:53:58 | 1,087,995 | 12/08/2011 15:06:14 | 194 | 0 | C++ - making command line arguments optional | My program receives three arguments:
int bufferSize
int priority
int milliTimeOut
Is there a way to make some of these params optional?(and to set these params value as default values?)
for example:
if the user want to leave 'priority' to be the defauld priority, but to insert 'bufferSize' and 'milliTimeOut', what does he type when he runs my program?
and how do I check it in my program?
10X! | c++ | command-line-arguments | null | null | null | null | open | C++ - making command line arguments optional
===
My program receives three arguments:
int bufferSize
int priority
int milliTimeOut
Is there a way to make some of these params optional?(and to set these params value as default values?)
for example:
if the user want to leave 'priority' to be the defauld priority, but to insert 'bufferSize' and 'milliTimeOut', what does he type when he runs my program?
and how do I check it in my program?
10X! | 0 |
11,280,141 | 07/01/2012 06:54:51 | 1,311,779 | 04/04/2012 02:09:24 | 8 | 3 | Get data from Sqlite database one at a time with Android | I am building an application where the user can save some information into an sqlite database. What I now want to do is be able to get the data from the sqlite database and store each row in its own string.
Note
There is only one column in the database. | java | android | sqlite | null | null | null | open | Get data from Sqlite database one at a time with Android
===
I am building an application where the user can save some information into an sqlite database. What I now want to do is be able to get the data from the sqlite database and store each row in its own string.
Note
There is only one column in the database. | 0 |
11,280,142 | 07/01/2012 06:54:56 | 1,476,273 | 06/23/2012 02:44:30 | 13 | 0 | Maven: unresolvable build extension | I've been looking at google and nothing really points to this problem. When I run "mvn clean install" it returns the following error. <br>
[ERROR] Unresolveable build extension: Plugin org.sonatype.flexmojos:flexmojos-maven-plugin:3.8 or one of its dependencies could not be resolved: Failed to collect dependencies for org.sonatype.flexmojos:flexmojos-maven-plugin:jar:3.8 ()
I'm trying to figure out how to import the maven plugin flexmojos but there are no clear directions on how to do this.
How would I import this plugin into my project?
ejay | maven | plugins | installation | null | null | null | open | Maven: unresolvable build extension
===
I've been looking at google and nothing really points to this problem. When I run "mvn clean install" it returns the following error. <br>
[ERROR] Unresolveable build extension: Plugin org.sonatype.flexmojos:flexmojos-maven-plugin:3.8 or one of its dependencies could not be resolved: Failed to collect dependencies for org.sonatype.flexmojos:flexmojos-maven-plugin:jar:3.8 ()
I'm trying to figure out how to import the maven plugin flexmojos but there are no clear directions on how to do this.
How would I import this plugin into my project?
ejay | 0 |
11,280,145 | 07/01/2012 06:55:04 | 318,752 | 04/16/2010 17:42:06 | 1,098 | 19 | Convert lat/lon to zipcode / neighborhood name | I have a large collection of pictures with GPS locations, encoded as lat/lon coordinates, mostly in Los Angeles. I would like to convert these to (1) zipcodes, and (2) neighborhood names. Are there any free web services or databases to do so?
The best I can come up with so far is scrape the neighborhood polygons from the [LA times page][1] and try to find out in which polygon every coordinate is. However this might be quite a lot of work, and not all of my coordinates are in LA. As for the zipcodes, this 2004 [database][2] is the best I can find, however zipcodes are encoded as a single coordinates instead of a polygon. So the best I can do is find the minimum distance from a given coordinate to the given zipcode-coordinates, which is not optimal.
I was under the impression that google-maps or open-street-maps should be able to do this (as they seem to 'know' exactly where every neighboorhood and zipcode is), however I cannot find any API's to do the lookups / queries.
[1]: http://projects.latimes.com/mapping-la/neighborhoods/
[2]: http://www.boutell.com/zipcodes/ | r | google-maps | gis | geospatial | openstreetmap | null | open | Convert lat/lon to zipcode / neighborhood name
===
I have a large collection of pictures with GPS locations, encoded as lat/lon coordinates, mostly in Los Angeles. I would like to convert these to (1) zipcodes, and (2) neighborhood names. Are there any free web services or databases to do so?
The best I can come up with so far is scrape the neighborhood polygons from the [LA times page][1] and try to find out in which polygon every coordinate is. However this might be quite a lot of work, and not all of my coordinates are in LA. As for the zipcodes, this 2004 [database][2] is the best I can find, however zipcodes are encoded as a single coordinates instead of a polygon. So the best I can do is find the minimum distance from a given coordinate to the given zipcode-coordinates, which is not optimal.
I was under the impression that google-maps or open-street-maps should be able to do this (as they seem to 'know' exactly where every neighboorhood and zipcode is), however I cannot find any API's to do the lookups / queries.
[1]: http://projects.latimes.com/mapping-la/neighborhoods/
[2]: http://www.boutell.com/zipcodes/ | 0 |
11,499,577 | 07/16/2012 07:07:55 | 1,480,435 | 06/25/2012 15:41:13 | 5 | 0 | searching in sorted Indexes of tuple list by bubble sort in haskell | I choice binary search for index of array of record ascasestudy for my graduate research by c++ and haskell I **write** the c++ code and work and now I work for the haskell one
import Data.List
data BookInfo = Book Int String [String]
deriving (Show)
--Entering the variables
entering :: Int String [String]-> Book
entering id name subject= Book id name subject
--make an idex of the array of tuples
index :: [Book]->[Int]
index [m] =
getID (Book id _ _ ) = id
main :: IO ()
main = do
putStrLn "Please enter your book id,name,Subject"
Book inpStr <- getLine
putStrLn print r
-- BubbleSort using map
bubbleSort ::(Ord x) => [x] -> [x]
bubbleSort (x':xs) = if x>x' then x': bubbleSort(x:xs)
else
if x<x' then x: bubbleSort(x':xs)
else
x: bubbleSort(X':xs)
bubble ::[a] -> [a]
bubble [a] = map bubbleSort [a]
--Make index for the array
indexsort(ord a)::[int]->[Int]
indexsort a=bubble a
--Make the list of tuples
addBooks2List Book->[Book]->[Book]
addBooks2List b m=b:entering b':m
--binarysearch
binarysearch [Int]->Int->Int->Int->Int
a=bubble x
binaryseach a i m j=
let u=(i+m)/2
if a[u]=j then u
if a[u]>j then binaryseach a i u-1 j
else
if a[u]<j then binarysearch a u+1 m j
if i=m "Not found"
--printing the tuple that has the searched id
print::Int->Book
print r= Book r y z
r=binaryseach m 0 (length m)
it made an error at 8:3 parse error on input 'entering' what this error mean? and how I can correct it ? | homework | haskell | tuples | null | null | null | open | searching in sorted Indexes of tuple list by bubble sort in haskell
===
I choice binary search for index of array of record ascasestudy for my graduate research by c++ and haskell I **write** the c++ code and work and now I work for the haskell one
import Data.List
data BookInfo = Book Int String [String]
deriving (Show)
--Entering the variables
entering :: Int String [String]-> Book
entering id name subject= Book id name subject
--make an idex of the array of tuples
index :: [Book]->[Int]
index [m] =
getID (Book id _ _ ) = id
main :: IO ()
main = do
putStrLn "Please enter your book id,name,Subject"
Book inpStr <- getLine
putStrLn print r
-- BubbleSort using map
bubbleSort ::(Ord x) => [x] -> [x]
bubbleSort (x':xs) = if x>x' then x': bubbleSort(x:xs)
else
if x<x' then x: bubbleSort(x':xs)
else
x: bubbleSort(X':xs)
bubble ::[a] -> [a]
bubble [a] = map bubbleSort [a]
--Make index for the array
indexsort(ord a)::[int]->[Int]
indexsort a=bubble a
--Make the list of tuples
addBooks2List Book->[Book]->[Book]
addBooks2List b m=b:entering b':m
--binarysearch
binarysearch [Int]->Int->Int->Int->Int
a=bubble x
binaryseach a i m j=
let u=(i+m)/2
if a[u]=j then u
if a[u]>j then binaryseach a i u-1 j
else
if a[u]<j then binarysearch a u+1 m j
if i=m "Not found"
--printing the tuple that has the searched id
print::Int->Book
print r= Book r y z
r=binaryseach m 0 (length m)
it made an error at 8:3 parse error on input 'entering' what this error mean? and how I can correct it ? | 0 |
11,499,581 | 07/16/2012 07:08:52 | 1,482,852 | 06/26/2012 13:16:10 | 3 | 0 | Read xml data from url using php | I want to read data and xml attributes values from this url using php-
[journey planner][1]
[1]: http://journeyplanner.tfl.gov.uk/user/XML_TRIP_REQUEST2?language=en&sessionID=0&place%20_origin=London&type_origin=stop&name_origin=Alexa%20nder%20Road&place_destinat%20ion=London&type_destination=stop&name_destination=Prince%20Of%20Wales%20%20Gate&itdDate=20110801&itdTime=0800
I have never worked with xml before..So i need some suggestion for doing my task.. | php | xml | null | null | null | 07/21/2012 04:12:02 | not a real question | Read xml data from url using php
===
I want to read data and xml attributes values from this url using php-
[journey planner][1]
[1]: http://journeyplanner.tfl.gov.uk/user/XML_TRIP_REQUEST2?language=en&sessionID=0&place%20_origin=London&type_origin=stop&name_origin=Alexa%20nder%20Road&place_destinat%20ion=London&type_destination=stop&name_destination=Prince%20Of%20Wales%20%20Gate&itdDate=20110801&itdTime=0800
I have never worked with xml before..So i need some suggestion for doing my task.. | 1 |
11,499,584 | 07/16/2012 07:09:00 | 1,528,082 | 07/16/2012 06:36:40 | 1 | 0 | can't read : variable isn't array | I have the following code :
set arr1(a1) t1
set arr2(a2) t2
set l1 {}
lappend l1 arr1
lappend l1 arr2
set arr3(a3) $l1
foreach names [array names arr3] {
set value $arr3($names)
puts "names = $names, value = $value"
foreach ar $value {
if {[array exists $ar]} {
puts "$ar is an array"
foreach {key val} [array get $ar] {
set d1 $ar($key)
puts "ar key = $key value = $val "
}
}
}
}
but when I run the tcl script it fails for the line "set d1 $ar($key)" . The error msg is 'can't read "ar(a1)": variable isn't array' . Can you please suggest what is causing the error and how do I resolve the same. | arrays | tcl | null | null | null | null | open | can't read : variable isn't array
===
I have the following code :
set arr1(a1) t1
set arr2(a2) t2
set l1 {}
lappend l1 arr1
lappend l1 arr2
set arr3(a3) $l1
foreach names [array names arr3] {
set value $arr3($names)
puts "names = $names, value = $value"
foreach ar $value {
if {[array exists $ar]} {
puts "$ar is an array"
foreach {key val} [array get $ar] {
set d1 $ar($key)
puts "ar key = $key value = $val "
}
}
}
}
but when I run the tcl script it fails for the line "set d1 $ar($key)" . The error msg is 'can't read "ar(a1)": variable isn't array' . Can you please suggest what is causing the error and how do I resolve the same. | 0 |
11,499,585 | 07/16/2012 07:09:03 | 1,357,883 | 04/26/2012 06:20:34 | 27 | 2 | Sound sensor, Android | I want to make an test application which will be capable of recording sound of the environment and will generate a graph in android. Please someone suggest me how to capture the surroundings' sound and analyze it to detect noise or something like that. I am new in android. :)
Thank You. | android | android-layout | android-sensors | null | null | null | open | Sound sensor, Android
===
I want to make an test application which will be capable of recording sound of the environment and will generate a graph in android. Please someone suggest me how to capture the surroundings' sound and analyze it to detect noise or something like that. I am new in android. :)
Thank You. | 0 |
11,496,173 | 07/15/2012 22:28:41 | 428,173 | 08/23/2010 08:19:59 | 710 | 9 | IdCookieManager with IdHTTP not sending cookies | I'm logging onto a website, trying to get the cookies running. From what I understand, assigning a IdCookieManager to an IdHTTP and setting `AllowCookies:=true` should be all that I need to do, right? I succesfully receive a cookie after logging in, but when I try to navigate further, the cookie is not being sent.
Here is the code I have:
procedure TForm1.Login;
var data: TStringList;
begin
data:=TStringList.Create;
try
IdHTTP.Get('http://navratdoreality.cz/'); // Here I receive Set-Cookie
data.Add('ACTION=check_adult');
data.Add('check=18plus');
Memo1.text:=IdHTTP.Post('http://navratdoreality.cz/',data); // Here the request contains the cookie and I get a succesfully-logged page in response, no more set-cookie
except
ShowMessage('err');
end;
data.Free;
end;
procedure TForm1.Navigate;
var ms:TMemoryStream;
begin
ms:=TMemoryStream.Create;
try
IdHTTP.Get('http://www.navratdoreality.cz/?p=view&id='+Edit1.Text, ms); // the request doesn't contain any cookies, even though the cookie from logging is saved in IdCookieManager
ms.Position:=0;
Memo1.Lines.LoadFromStream(ms, TEncoding.UTF8);
except
ShowMessage('err');
end;
ms.Free;
end;
I don't know what might be the problem. My Indy is 10.5.8.0. If you are going to look at the site, beware, some of it is nsfw.
Thanks | delphi | indy | null | null | null | null | open | IdCookieManager with IdHTTP not sending cookies
===
I'm logging onto a website, trying to get the cookies running. From what I understand, assigning a IdCookieManager to an IdHTTP and setting `AllowCookies:=true` should be all that I need to do, right? I succesfully receive a cookie after logging in, but when I try to navigate further, the cookie is not being sent.
Here is the code I have:
procedure TForm1.Login;
var data: TStringList;
begin
data:=TStringList.Create;
try
IdHTTP.Get('http://navratdoreality.cz/'); // Here I receive Set-Cookie
data.Add('ACTION=check_adult');
data.Add('check=18plus');
Memo1.text:=IdHTTP.Post('http://navratdoreality.cz/',data); // Here the request contains the cookie and I get a succesfully-logged page in response, no more set-cookie
except
ShowMessage('err');
end;
data.Free;
end;
procedure TForm1.Navigate;
var ms:TMemoryStream;
begin
ms:=TMemoryStream.Create;
try
IdHTTP.Get('http://www.navratdoreality.cz/?p=view&id='+Edit1.Text, ms); // the request doesn't contain any cookies, even though the cookie from logging is saved in IdCookieManager
ms.Position:=0;
Memo1.Lines.LoadFromStream(ms, TEncoding.UTF8);
except
ShowMessage('err');
end;
ms.Free;
end;
I don't know what might be the problem. My Indy is 10.5.8.0. If you are going to look at the site, beware, some of it is nsfw.
Thanks | 0 |
11,496,175 | 07/15/2012 22:28:53 | 1,209,464 | 02/14/2012 15:54:44 | 449 | 2 | How to compare between two executable files? | I have a file which doesn't require UAC Warning. I copied the file to another location using C#.NET
File.Copy("Original.exe", "Copy.exe");
Now i see that Copy.exe require UAC warning to run under windows 7/Vista.
How can i compare between Original.exe and Copy.exe to see exactly what happened to the file and change it manually so that it doesn't require UAC anymore. Which tool can i use to achieve that ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/8iRF0.png
**BOTH EXECUTABLE ARE THE SAME FILE** : How to know the difference between these two files ?
| c# | .net | visual-studio-2010 | null | null | null | open | How to compare between two executable files?
===
I have a file which doesn't require UAC Warning. I copied the file to another location using C#.NET
File.Copy("Original.exe", "Copy.exe");
Now i see that Copy.exe require UAC warning to run under windows 7/Vista.
How can i compare between Original.exe and Copy.exe to see exactly what happened to the file and change it manually so that it doesn't require UAC anymore. Which tool can i use to achieve that ?
![enter image description here][1]
[1]: http://i.stack.imgur.com/8iRF0.png
**BOTH EXECUTABLE ARE THE SAME FILE** : How to know the difference between these two files ?
| 0 |
11,499,589 | 07/16/2012 07:09:13 | 1,523,407 | 07/13/2012 11:27:18 | 11 | 1 | Asp.net partial refreshing a datagridview | How can I seperate refreshing rates in a datagridview? I am using dropdownlist for filtering my data. If nothing selected it shows all of them. For example it is filtering with countries, and I want datagridview to use different resfresh rates by country.
<form id="form1" runat="server">
<h3>Northwind Employees</h3>
<table cellspacing="10">
<tr>
<td valign="top">
<table border="0">
<tr>
<td valign="top">Country</td>
<td><asp:DropDownList runat="server" id="CountryListBox" AppendDataBoundItems="True"
DataSourceID="CountrySqlDataSource"
DataTextField="Country" DataValueField="Country" >
<asp:ListItem Selected="True" Value="" >(Show All)</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Last Name</td>
<td><asp:TextBox runat="server" id="LastNameTextBox" Text="*" /></td>
</tr>
<tr>
<td></td>
<td><asp:Button runat="server" id="FilterButton" Text="Filter Results" /></td>
</tr>
</table>
</td>
<td valign="top">
<asp:GridView ID="EmployeesGridView"
DataSourceID="EmployeeDetailsSqlDataSource"
AutoGenerateColumns="false"
AllowSorting="true"
DataKeyNames="EmployeeID"
Gridlines="Both"
RunAt="server">
<HeaderStyle backcolor="Navy"
forecolor="White"/>
<RowStyle backcolor="White"/>
<AlternatingRowStyle backcolor="LightGray"/>
<EditRowStyle backcolor="LightCyan"/>
<Columns>
<asp:BoundField DataField="EmployeeID" HeaderText="Employee ID" ReadOnly="true"/>
<asp:BoundField DataField="FirstName" HeaderText="First Name"/>
<asp:BoundField DataField="LastName" HeaderText="Last Name"/>
<asp:BoundField DataField="Country" HeaderText="Country"/>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
<asp:SqlDataSource ID="CountrySqlDataSource"
SelectCommand="SELECT DISTINCT Country FROM Employees"
EnableCaching="True"
CacheDuration="60"
ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
RunAt="server" />
<asp:SqlDataSource ID="EmployeeDetailsSqlDataSource"
SelectCommand="SELECT EmployeeID, LastName, FirstName, Country FROM Employees"
EnableCaching="True"
CacheDuration="60"
ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
FilterExpression="Country LIKE '{0}' AND LastName LIKE '{1}'"
RunAt="server">
<FilterParameters>
<asp:ControlParameter ControlID="CountryListBox" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="LastNameTextBox" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
</form>
| c# | asp.net | null | null | null | null | open | Asp.net partial refreshing a datagridview
===
How can I seperate refreshing rates in a datagridview? I am using dropdownlist for filtering my data. If nothing selected it shows all of them. For example it is filtering with countries, and I want datagridview to use different resfresh rates by country.
<form id="form1" runat="server">
<h3>Northwind Employees</h3>
<table cellspacing="10">
<tr>
<td valign="top">
<table border="0">
<tr>
<td valign="top">Country</td>
<td><asp:DropDownList runat="server" id="CountryListBox" AppendDataBoundItems="True"
DataSourceID="CountrySqlDataSource"
DataTextField="Country" DataValueField="Country" >
<asp:ListItem Selected="True" Value="" >(Show All)</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>Last Name</td>
<td><asp:TextBox runat="server" id="LastNameTextBox" Text="*" /></td>
</tr>
<tr>
<td></td>
<td><asp:Button runat="server" id="FilterButton" Text="Filter Results" /></td>
</tr>
</table>
</td>
<td valign="top">
<asp:GridView ID="EmployeesGridView"
DataSourceID="EmployeeDetailsSqlDataSource"
AutoGenerateColumns="false"
AllowSorting="true"
DataKeyNames="EmployeeID"
Gridlines="Both"
RunAt="server">
<HeaderStyle backcolor="Navy"
forecolor="White"/>
<RowStyle backcolor="White"/>
<AlternatingRowStyle backcolor="LightGray"/>
<EditRowStyle backcolor="LightCyan"/>
<Columns>
<asp:BoundField DataField="EmployeeID" HeaderText="Employee ID" ReadOnly="true"/>
<asp:BoundField DataField="FirstName" HeaderText="First Name"/>
<asp:BoundField DataField="LastName" HeaderText="Last Name"/>
<asp:BoundField DataField="Country" HeaderText="Country"/>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
<asp:SqlDataSource ID="CountrySqlDataSource"
SelectCommand="SELECT DISTINCT Country FROM Employees"
EnableCaching="True"
CacheDuration="60"
ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
RunAt="server" />
<asp:SqlDataSource ID="EmployeeDetailsSqlDataSource"
SelectCommand="SELECT EmployeeID, LastName, FirstName, Country FROM Employees"
EnableCaching="True"
CacheDuration="60"
ConnectionString="<%$ ConnectionStrings:NorthwindConnection %>"
FilterExpression="Country LIKE '{0}' AND LastName LIKE '{1}'"
RunAt="server">
<FilterParameters>
<asp:ControlParameter ControlID="CountryListBox" PropertyName="SelectedValue" />
<asp:ControlParameter ControlID="LastNameTextBox" PropertyName="Text" />
</FilterParameters>
</asp:SqlDataSource>
</form>
| 0 |
11,499,593 | 07/16/2012 07:09:29 | 1,527,584 | 07/15/2012 23:14:00 | 1 | 0 | Excel formula by combining 2 sheets | file1:
$Colmn A Coulmn B Colmn C
$www.example1.com/ab 200 abc
$file 2:
$URL Hits
$www.something.com/dir/abc 1000
$www.exapmle1.com/ab 100
$www.example2.com/cd 50
$www.exapmle1.com/ab 100
<pre>
I need help in generating excel report.Can anyone of you please help me.
I have 2 excel files. I have tried to paste the files in the question.
1.Contains 3 columns -- colA (URLs), colB(Hits in Numerals), colC(some data)
2.Contains 2 columns -- ColA (URLs), ColB(Hits in Numericals)
Steps:
1>Take ColA(URLs) from file1 and search in ColA(URL) of files2.
2>Suppose we get 10 searches, I need to get the Sum of all the ColB(Hits) of file2 and
place it in file1 ColB of the first result.
Any kind of hints would be helpful. I tried many options, but none of them worked.
</pre>
| excel | report | null | null | null | null | open | Excel formula by combining 2 sheets
===
file1:
$Colmn A Coulmn B Colmn C
$www.example1.com/ab 200 abc
$file 2:
$URL Hits
$www.something.com/dir/abc 1000
$www.exapmle1.com/ab 100
$www.example2.com/cd 50
$www.exapmle1.com/ab 100
<pre>
I need help in generating excel report.Can anyone of you please help me.
I have 2 excel files. I have tried to paste the files in the question.
1.Contains 3 columns -- colA (URLs), colB(Hits in Numerals), colC(some data)
2.Contains 2 columns -- ColA (URLs), ColB(Hits in Numericals)
Steps:
1>Take ColA(URLs) from file1 and search in ColA(URL) of files2.
2>Suppose we get 10 searches, I need to get the Sum of all the ColB(Hits) of file2 and
place it in file1 ColB of the first result.
Any kind of hints would be helpful. I tried many options, but none of them worked.
</pre>
| 0 |
11,499,594 | 07/16/2012 07:09:29 | 312,815 | 07/22/2009 06:50:06 | 81 | 5 | Get Claims from STS in DesktopApp (active) | I would really appreciate some help in understanding how Claims are used in a local desktop app. Here's the scenario: I want to display a tab f.e. depending on wether the user has a claim like "AnalysisAllowed:true". So I want to fetch the claims at app start and bind against them later.
All samples are talking about how to make WCF use Authorization- and AuthenticationManagers to do claims-based calls to other WCF-Services but I just want to contact the sts (how do I do that? WCF-Fed Binding?) and than cache the stuff to use it. No other Service calls... :)
Thanks a lot! | desktop-application | wif | claims | null | null | null | open | Get Claims from STS in DesktopApp (active)
===
I would really appreciate some help in understanding how Claims are used in a local desktop app. Here's the scenario: I want to display a tab f.e. depending on wether the user has a claim like "AnalysisAllowed:true". So I want to fetch the claims at app start and bind against them later.
All samples are talking about how to make WCF use Authorization- and AuthenticationManagers to do claims-based calls to other WCF-Services but I just want to contact the sts (how do I do that? WCF-Fed Binding?) and than cache the stuff to use it. No other Service calls... :)
Thanks a lot! | 0 |
11,499,598 | 07/16/2012 07:10:31 | 793,934 | 06/11/2011 12:14:37 | 1,353 | 94 | Data access layer by file implementation in spring | I defined a `Data Access Layer` for my application `CRUD` operations and its interfaces. I want temporary save/load data to/from file but finally I will define appropriate model in relational database. So I wrote a file implementation of defined `DAO` layer for temporary.
My question is:
Is there a wrapper such as `JpaTemplate` for file `DAO` implementation in `Spring`?
(Sorry if I am using the wrong terminology or grammar, I am still learning the English language.)
| java | spring | data-access-layer | dao | null | null | open | Data access layer by file implementation in spring
===
I defined a `Data Access Layer` for my application `CRUD` operations and its interfaces. I want temporary save/load data to/from file but finally I will define appropriate model in relational database. So I wrote a file implementation of defined `DAO` layer for temporary.
My question is:
Is there a wrapper such as `JpaTemplate` for file `DAO` implementation in `Spring`?
(Sorry if I am using the wrong terminology or grammar, I am still learning the English language.)
| 0 |
11,499,604 | 07/16/2012 07:10:45 | 1,157,846 | 01/19/2012 06:39:38 | 256 | 0 | How to check the listbox is checked or not | How to check whether the listbox is checked or not
list1
checkbox item
checkbox Raja
checkbox Raman
checkbox Vijay
From the list1 i want to check whethere checkbox is checked or not
How to write a code in vb6
Need Vb6 code Help | vb6 | vb | null | null | null | null | open | How to check the listbox is checked or not
===
How to check whether the listbox is checked or not
list1
checkbox item
checkbox Raja
checkbox Raman
checkbox Vijay
From the list1 i want to check whethere checkbox is checked or not
How to write a code in vb6
Need Vb6 code Help | 0 |
11,327,140 | 07/04/2012 10:21:08 | 127,013 | 06/22/2009 15:34:45 | 8,766 | 104 | How to retrace horizontally merged classes with ProGuard? | We're using ProGuard to obfuscate and optimize our Android app, and up until now we've kept all class/merging optimizations active. The problem with this is: if an error occurs in a method that was merged horizontally into a different class, the retrace tool does not revert that step, so line numbers become useless and it's impossible to track down the error.
One peculiar example we just had was a static helper method being merged into a class that is part of a 3rd party JAR we link--we don't even have the source code for that. Since retrace shows me line numbers inside that 3rd party class (since the helper method was merged into it), I can't proceed.
Is there any way to retrace methods merged into other classes during optimization? | android | proguard | null | null | null | null | open | How to retrace horizontally merged classes with ProGuard?
===
We're using ProGuard to obfuscate and optimize our Android app, and up until now we've kept all class/merging optimizations active. The problem with this is: if an error occurs in a method that was merged horizontally into a different class, the retrace tool does not revert that step, so line numbers become useless and it's impossible to track down the error.
One peculiar example we just had was a static helper method being merged into a class that is part of a 3rd party JAR we link--we don't even have the source code for that. Since retrace shows me line numbers inside that 3rd party class (since the helper method was merged into it), I can't proceed.
Is there any way to retrace methods merged into other classes during optimization? | 0 |
11,327,143 | 07/04/2012 10:21:17 | 611,350 | 02/10/2011 12:36:54 | 324 | 4 | How to check values of too many number of radio buttons groups to enable the submit button? | I have too many number of radio buttons inside a form with different names, and I want to in-disable the submit button if only all radio button groups are checked ( in other words each radio button name has been checked).
How Can I do that with jQuery?
| jquery | forms | radio-button | null | null | null | open | How to check values of too many number of radio buttons groups to enable the submit button?
===
I have too many number of radio buttons inside a form with different names, and I want to in-disable the submit button if only all radio button groups are checked ( in other words each radio button name has been checked).
How Can I do that with jQuery?
| 0 |
11,327,173 | 07/04/2012 10:22:31 | 1,360,437 | 04/27/2012 06:43:49 | 47 | 1 | How to install cached archives in Ubuntu | After I update my Emacs to the newest version(GNU Emacs 24.1.50.1) through [emacs-snapshot PPA](http://emacs.naquadah.org/) :
sudo aptitude update
sudo aptitude safe-upgrade
I got an warning when I use rinari to programming Rails project.
I am tired to wait the author to fix this issue. So I decided to 'roll back' my Emacs to the previous version that I installed.
I find the archives in **/var/cache/apt/archives/** directory:
/var/cache/apt/archives/emacs-snapshot_2%3a20120608-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120609-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120614-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120615-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120622-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120629-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120701-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120608-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120609-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120614-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120615-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120622-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120629-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120701-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120608-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120609-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120614-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120615-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120622-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120629-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120701-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120608-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120609-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120614-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120615-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120622-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120629-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120701-1~ppa1~precise1_all.deb
So, How to install the specified version(old version) of Emacs?
| linux | emacs | null | null | null | 07/05/2012 15:56:38 | off topic | How to install cached archives in Ubuntu
===
After I update my Emacs to the newest version(GNU Emacs 24.1.50.1) through [emacs-snapshot PPA](http://emacs.naquadah.org/) :
sudo aptitude update
sudo aptitude safe-upgrade
I got an warning when I use rinari to programming Rails project.
I am tired to wait the author to fix this issue. So I decided to 'roll back' my Emacs to the previous version that I installed.
I find the archives in **/var/cache/apt/archives/** directory:
/var/cache/apt/archives/emacs-snapshot_2%3a20120608-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120609-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120614-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120615-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120622-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120629-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot_2%3a20120701-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120608-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120609-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120614-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120615-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120622-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120629-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-bin-common_2%3a20120701-1~ppa1~precise1_amd64.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120608-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120609-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120614-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120615-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120622-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120629-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-common_2%3a20120701-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120608-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120609-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120614-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120615-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120622-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120629-1~ppa1~precise1_all.deb
/var/cache/apt/archives/emacs-snapshot-gtk_2%3a20120701-1~ppa1~precise1_all.deb
So, How to install the specified version(old version) of Emacs?
| 2 |
11,567,304 | 07/19/2012 18:44:01 | 1,149,114 | 01/14/2012 09:49:26 | 1 | 0 | Powermock Mockito : the method I'm trying to stubb ends up beeing called | I'm trying to test a class A which in turn autowires a class B :
public class A {
@Autowired
private B b;
public int foo(int x, int y) {
int z = b.bar(x, y, false);
//do something with z
return z;
}
}
I'm using junit together with powermock and mockito to try to test the method foo in class A.
@RunWith(PowerMockRunner.class)
@PrepareForTest(A.class)
public class TestA {
@Test
private void testFoo() {
B b = PowerMockito.mock(B.class);
when(b.bar(2,3,false)).thenReturn(5);
A a = PowerMockito.spy(new A());
Whitebox.setInternalState(a, "b", b);
int z = a.foo(2,3);
Assert.assertEquals(10,z);
}
}
When i try to run the test I get a NullPointerException from within class B.
After using the debugger, I found out that right after stubbing the bar method of the B class, the bar method gets called.
The null pointer exception in this case is normal because the B class is not properly initialized.
Can anyone explain why this is happening and what can I do about it. | java | unit-testing | junit4 | mockito | powermock | null | open | Powermock Mockito : the method I'm trying to stubb ends up beeing called
===
I'm trying to test a class A which in turn autowires a class B :
public class A {
@Autowired
private B b;
public int foo(int x, int y) {
int z = b.bar(x, y, false);
//do something with z
return z;
}
}
I'm using junit together with powermock and mockito to try to test the method foo in class A.
@RunWith(PowerMockRunner.class)
@PrepareForTest(A.class)
public class TestA {
@Test
private void testFoo() {
B b = PowerMockito.mock(B.class);
when(b.bar(2,3,false)).thenReturn(5);
A a = PowerMockito.spy(new A());
Whitebox.setInternalState(a, "b", b);
int z = a.foo(2,3);
Assert.assertEquals(10,z);
}
}
When i try to run the test I get a NullPointerException from within class B.
After using the debugger, I found out that right after stubbing the bar method of the B class, the bar method gets called.
The null pointer exception in this case is normal because the B class is not properly initialized.
Can anyone explain why this is happening and what can I do about it. | 0 |
11,567,501 | 07/19/2012 18:57:31 | 223,897 | 12/03/2009 14:21:00 | 5,004 | 128 | Running Rake loads its test suite? | At some point I started getting test output when running `rake` tasks, and I have no idea why.
$ rake -T
(task output)
Loaded suite /Users/tsigo/.rbenv/versions/1.9.2-p290/bin/rake
Started
Finished in 0.000398 seconds.
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Test run options: --seed 30951
And `rails c` is behaving weirdly as well:
$ rails c
Loading development environment (Rails 3.1.6)
irb(main):002:0> Rails.version
=> "3.1.6"
irb(main):003:0> RUBY_VERSION
=> "1.9.2"
irb(main):004:0> exit
/Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:581:in `block in process_args': invalid option: --rubygems (OptionParser::InvalidOption)
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:560:in `new'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:560:in `process_args'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:591:in `run'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:508:in `block in autorun'
And finally, in my RSpec suite, if there's a failure, it doesn't show the file and line info, making any output almost useless:
Failures:
1) Test
Failure/Error: false.should be_true
expected: true
got: false
~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:16:in `expand_path': No such file or directory - getcwd (Errno::ENOENT)
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:16:in `relative_path'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:126:in `backtrace_line'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `block in format_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `map'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `format_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:154:in `dump_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:20:in `block in dump_failures'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each_with_index'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `dump_failures'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:98:in `block in notify'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:97:in `each'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:97:in `notify'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:81:in `finish'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:36:in `report'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
| ruby | rspec | rake | null | null | null | open | Running Rake loads its test suite?
===
At some point I started getting test output when running `rake` tasks, and I have no idea why.
$ rake -T
(task output)
Loaded suite /Users/tsigo/.rbenv/versions/1.9.2-p290/bin/rake
Started
Finished in 0.000398 seconds.
0 tests, 0 assertions, 0 failures, 0 errors, 0 skips
Test run options: --seed 30951
And `rails c` is behaving weirdly as well:
$ rails c
Loading development environment (Rails 3.1.6)
irb(main):002:0> Rails.version
=> "3.1.6"
irb(main):003:0> RUBY_VERSION
=> "1.9.2"
irb(main):004:0> exit
/Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:581:in `block in process_args': invalid option: --rubygems (OptionParser::InvalidOption)
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:560:in `new'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:560:in `process_args'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:591:in `run'
from /Users/tsigo/.rbenv/versions/1.9.2-p290/lib/ruby/1.9.1/minitest/unit.rb:508:in `block in autorun'
And finally, in my RSpec suite, if there's a failure, it doesn't show the file and line info, making any output almost useless:
Failures:
1) Test
Failure/Error: false.should be_true
expected: true
got: false
~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:16:in `expand_path': No such file or directory - getcwd (Errno::ENOENT)
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:16:in `relative_path'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:126:in `backtrace_line'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `block in format_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `map'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_formatter.rb:114:in `format_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:154:in `dump_backtrace'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:20:in `block in dump_failures'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `each_with_index'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/formatters/base_text_formatter.rb:17:in `dump_failures'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:98:in `block in notify'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:97:in `each'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:97:in `notify'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:81:in `finish'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/reporter.rb:36:in `report'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:25:in `run'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
from ~/.rbenv/versions/1.9.3-p125/lib/ruby/gems/1.9.1/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
| 0 |
11,567,508 | 07/19/2012 18:57:59 | 345,645 | 05/20/2010 01:39:45 | 578 | 9 | Applied CSS Triangle with Pseudo | I've managed to create a reload icon in pure css, but is uses a character that may break on some systems. I know that one can create a [triangle in css][1], and that it can be [applied to pseudo elements][2], but I have not been able to replicate the results for my reload icon.
Fiddle with it [here][3].
[1]: http://css-tricks.com/snippets/css/css-triangle/
[2]: http://nicolasgallagher.com/an-introduction-to-css-pseudo-element-hacks/
[3]: http://jsfiddle.net/codemastercode/xas5w/ | css | css3 | icons | pseudo-element | css-hack | null | open | Applied CSS Triangle with Pseudo
===
I've managed to create a reload icon in pure css, but is uses a character that may break on some systems. I know that one can create a [triangle in css][1], and that it can be [applied to pseudo elements][2], but I have not been able to replicate the results for my reload icon.
Fiddle with it [here][3].
[1]: http://css-tricks.com/snippets/css/css-triangle/
[2]: http://nicolasgallagher.com/an-introduction-to-css-pseudo-element-hacks/
[3]: http://jsfiddle.net/codemastercode/xas5w/ | 0 |
11,567,510 | 07/19/2012 18:58:00 | 1,102,480 | 12/16/2011 17:48:53 | 26 | 1 | Can the time period before a remote git repository (not git hub) hangs up while awaiting a password be increased? | I am running a bash script that performs several git cloning operations in addition to some installations. When trying to clone, if the remote server does not have a password entered into it within a short time, it hangs up.
However, because some of the installs take so long I cannot (and probably should not have to) monitor the progress of the script, waiting for instances when 'git clone' requires a password. I want to be able to leave it running and any time is requires a password it continues to wait for a password without hanging up
My question is how can I increase time the remote end waits before hanging up? I am the owner of the remote server the git repo is on.
Note: I do not want to use passwordless SSH or similar. | git | git-clone | git-bash | null | null | null | open | Can the time period before a remote git repository (not git hub) hangs up while awaiting a password be increased?
===
I am running a bash script that performs several git cloning operations in addition to some installations. When trying to clone, if the remote server does not have a password entered into it within a short time, it hangs up.
However, because some of the installs take so long I cannot (and probably should not have to) monitor the progress of the script, waiting for instances when 'git clone' requires a password. I want to be able to leave it running and any time is requires a password it continues to wait for a password without hanging up
My question is how can I increase time the remote end waits before hanging up? I am the owner of the remote server the git repo is on.
Note: I do not want to use passwordless SSH or similar. | 0 |
11,567,491 | 07/19/2012 18:56:48 | 1,276,567 | 03/18/2012 05:51:22 | 117 | 8 | PHP 5.3 code on 5.2 server? | Right now my webhost only has a sever with the max php number of 5.2. I didn't realize this and coded entirely on Xamp with a 5.3.1 server. Is there any sort of php script or something that will allow me to run 5.3 code on a 5.2 server. One of the particular lines im having trouble with is this:
$files = array_diff( scandir( __DIR__ . '/data' ), array('.','..') );
require __DIR__ . '/views/view_index.php';
At about that line the php just doesn't read, and has issues. The view_index.php works on its own, but the line above doesn't seem to be working, since I need to pass that variable to read in some file names into a dropdown selector. Although, I have more problems, most of which will take a long time to solve. Is there any sort of script made to ease this process. I have been looking around and couldn't find any. | php | arrays | php-5.3 | php-5.2 | null | null | open | PHP 5.3 code on 5.2 server?
===
Right now my webhost only has a sever with the max php number of 5.2. I didn't realize this and coded entirely on Xamp with a 5.3.1 server. Is there any sort of php script or something that will allow me to run 5.3 code on a 5.2 server. One of the particular lines im having trouble with is this:
$files = array_diff( scandir( __DIR__ . '/data' ), array('.','..') );
require __DIR__ . '/views/view_index.php';
At about that line the php just doesn't read, and has issues. The view_index.php works on its own, but the line above doesn't seem to be working, since I need to pass that variable to read in some file names into a dropdown selector. Although, I have more problems, most of which will take a long time to solve. Is there any sort of script made to ease this process. I have been looking around and couldn't find any. | 0 |
11,567,493 | 07/19/2012 18:56:57 | 1,536,528 | 07/19/2012 01:57:25 | 1 | 0 | clojure join of two CSV files in vector of vectors format | I am new to clojure and want to do this correctly. I have two data sources of date stamped data from two CSV files. I have pulled them in a put them in vector of vectors format. I would like to do a join(outer join) sort of combining of the data.
I have several ugly ideas I just want to do the best ugly idea. :)
What is the most clojure idomatic method of doing "joins"? Should I be doing maps? I like vectors because I will be doing a lot of range calculations after csv's are joined, like moving a window(groups of rows) down the rows of the joined data.
| csv | clojure | null | null | null | null | open | clojure join of two CSV files in vector of vectors format
===
I am new to clojure and want to do this correctly. I have two data sources of date stamped data from two CSV files. I have pulled them in a put them in vector of vectors format. I would like to do a join(outer join) sort of combining of the data.
I have several ugly ideas I just want to do the best ugly idea. :)
What is the most clojure idomatic method of doing "joins"? Should I be doing maps? I like vectors because I will be doing a lot of range calculations after csv's are joined, like moving a window(groups of rows) down the rows of the joined data.
| 0 |
11,297,843 | 07/02/2012 16:46:11 | 685,590 | 03/31/2011 11:12:14 | 108 | 1 | signalr client app not connecting to hub | What I am trying to achieve is a console app capable of connecting to and sending messages to a specific hub hosted on a website using SignalR.
I have a console app that tries to connect to the "Chat" hub on the website. Console will try to connect and then send a message and close .
static void Main(string[] args)
{
var connection = new HubConnection("http://mysite:101/");
IHubProxy myHub = connection.CreateProxy("Chat");
connection.Start().ContinueWith(task =>
{
if (task.IsFaulted)
{
Console.WriteLine("There was an error opening the connection:{0}", task.Exception.GetBaseException());
}
else
{
Console.WriteLine("Client Connected");
}
}).Wait();
myHub.Invoke("Send", "Console App is Online!. ").ContinueWith(task =>
{
if (task.IsFaulted)
{
Console.WriteLine("There was an error calling send: {0}", task.Exception.GetBaseException());
Console.WriteLine(task.Status.ToString());
}
else
{
Console.WriteLine("Send Complete.");
}
}).Wait();
Everything works fine locally, (which I guess it would being the same app domain.)
My asp hub is just based of the chat example in the wiki https://github.com/SignalR/SignalR/wiki/
using SignalR.Hosting.AspNet;
using System.Threading.Tasks;
namespace HubSignalrTest
{
//[HubName("Hubtest")]
public class Chat : Hub , IDisconnect , IConnected
{
public void Send(string message)
{
// Call the addMessage method on all clients
Clients.addMessage(message);
}
The Jscript is pretty much the same as in the example as well.
<script type="text/javascript" src="Scripts/jquery-1.7.2.js"></script>
<script type="text/javascript" src="Scripts/jquery.signalR-0.5.1.js"></script>
<script src='<%= ResolveClientUrl("~/signalr/hubs") %>'> type="text/javascript"> </script>
<script type="text/javascript">
jQuery.support.cors = true;
$(function () {
// Proxy created on the fly
var chat = $.connection.chat;
// Declare a function on the chat hub so the server can invoke it
chat.addMessage = function (message) {
$('#messages').append('<li>' + message + '</li>');
};
$("#broadcast").click(function () {
// Call the chat method on the server
chat.send($('#msg').val())
.done(function () {
console.log('Success!');
})
.fail(function (e) {
console.warn(e);
});
});
// Start the connection
$.connection.hub.start();
});
</script>
I tried setting jQuery.support.cors = true; omitting or adding a hub name, and I have investigated running the console app on the same server with the correct settings (still does not connect to hub) and does not seem to be a firewall issue. Has anyone had luck with a similar project or know what I am doing wrong?. I would really like to achieve this basic communication to expand on a lot of ideas that SignalR brings.
| signalr | null | null | null | null | null | open | signalr client app not connecting to hub
===
What I am trying to achieve is a console app capable of connecting to and sending messages to a specific hub hosted on a website using SignalR.
I have a console app that tries to connect to the "Chat" hub on the website. Console will try to connect and then send a message and close .
static void Main(string[] args)
{
var connection = new HubConnection("http://mysite:101/");
IHubProxy myHub = connection.CreateProxy("Chat");
connection.Start().ContinueWith(task =>
{
if (task.IsFaulted)
{
Console.WriteLine("There was an error opening the connection:{0}", task.Exception.GetBaseException());
}
else
{
Console.WriteLine("Client Connected");
}
}).Wait();
myHub.Invoke("Send", "Console App is Online!. ").ContinueWith(task =>
{
if (task.IsFaulted)
{
Console.WriteLine("There was an error calling send: {0}", task.Exception.GetBaseException());
Console.WriteLine(task.Status.ToString());
}
else
{
Console.WriteLine("Send Complete.");
}
}).Wait();
Everything works fine locally, (which I guess it would being the same app domain.)
My asp hub is just based of the chat example in the wiki https://github.com/SignalR/SignalR/wiki/
using SignalR.Hosting.AspNet;
using System.Threading.Tasks;
namespace HubSignalrTest
{
//[HubName("Hubtest")]
public class Chat : Hub , IDisconnect , IConnected
{
public void Send(string message)
{
// Call the addMessage method on all clients
Clients.addMessage(message);
}
The Jscript is pretty much the same as in the example as well.
<script type="text/javascript" src="Scripts/jquery-1.7.2.js"></script>
<script type="text/javascript" src="Scripts/jquery.signalR-0.5.1.js"></script>
<script src='<%= ResolveClientUrl("~/signalr/hubs") %>'> type="text/javascript"> </script>
<script type="text/javascript">
jQuery.support.cors = true;
$(function () {
// Proxy created on the fly
var chat = $.connection.chat;
// Declare a function on the chat hub so the server can invoke it
chat.addMessage = function (message) {
$('#messages').append('<li>' + message + '</li>');
};
$("#broadcast").click(function () {
// Call the chat method on the server
chat.send($('#msg').val())
.done(function () {
console.log('Success!');
})
.fail(function (e) {
console.warn(e);
});
});
// Start the connection
$.connection.hub.start();
});
</script>
I tried setting jQuery.support.cors = true; omitting or adding a hub name, and I have investigated running the console app on the same server with the correct settings (still does not connect to hub) and does not seem to be a firewall issue. Has anyone had luck with a similar project or know what I am doing wrong?. I would really like to achieve this basic communication to expand on a lot of ideas that SignalR brings.
| 0 |
11,166,477 | 06/23/2012 03:05:38 | 309,960 | 04/06/2010 11:21:16 | 116 | 12 | DTrace won't output aggregates on 2012 MacBook Pro | I have a mid-2009 MacBook Pro and a new 2012 MacBook Pro and I am in the process of learning DTrace ( a pretty amazing tool). When I calculate aggregates on the new 2012 MBP, the aggregates don't print out.
sudo dtrace -n 'syscall:::entry { @[execname] = count() }'
On my mid-2009 MBP, it shows something like:
usbmuxd 1
GrowlHelperApp 2
imklaunchagent 2
installd 2
stackshot 2
...
The 2012 MBP doesn't show anything.
I added a printf in a BEING and END probe to see if the END probe would even fire like so:
BEGIN
{
printf("Hi!");
}
syscall:::entry
{
@[execname] = count();
}
END
{
printf("Bye!")
}
On the mid-2009 MBP both probes fired and printed and on the 2012 MBP only the BEGIN probe fired. The END never fired.
Both MBPs are running Lion 10.7.3. I'm not sure what to try next. The only difference that comes to mind right now is that I haven't installed the developer command line tools on the 2012 MBP. That just doesn't make sense to me though and is a shot in the dark.
Any help or ideas would be appreciated. Thanks. | osx | dtrace | null | null | null | null | open | DTrace won't output aggregates on 2012 MacBook Pro
===
I have a mid-2009 MacBook Pro and a new 2012 MacBook Pro and I am in the process of learning DTrace ( a pretty amazing tool). When I calculate aggregates on the new 2012 MBP, the aggregates don't print out.
sudo dtrace -n 'syscall:::entry { @[execname] = count() }'
On my mid-2009 MBP, it shows something like:
usbmuxd 1
GrowlHelperApp 2
imklaunchagent 2
installd 2
stackshot 2
...
The 2012 MBP doesn't show anything.
I added a printf in a BEING and END probe to see if the END probe would even fire like so:
BEGIN
{
printf("Hi!");
}
syscall:::entry
{
@[execname] = count();
}
END
{
printf("Bye!")
}
On the mid-2009 MBP both probes fired and printed and on the 2012 MBP only the BEGIN probe fired. The END never fired.
Both MBPs are running Lion 10.7.3. I'm not sure what to try next. The only difference that comes to mind right now is that I haven't installed the developer command line tools on the 2012 MBP. That just doesn't make sense to me though and is a shot in the dark.
Any help or ideas would be appreciated. Thanks. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.