Dear reader,
I'm working on a project where the user can insert data into a document using fields, document properties and variables. The user also needs to be able to remove the data from the document. So far, I've managed to remove the document property and variable, but I'm not sure how I would go about removing the field (that's already inserted into the document). Please advise.
Yours sincerely,
Kevin
Please tell me what is difference
== if i write query directly in storedprocedure
== and write query in string variable and than run it in exec in stored procedure.
i am using ms sql server 2005
In Python I have a list of n lists, each with a variable number of elements. How can I create a single list containing all the possible permutations:
For example
[ [ a, b, c], [d], [e, f] ]
I want
[ [a, d, e] , [a, d, f], [b, d, e], [b, d, f], [c, d, e], [c, d, f] ]
Note I don't know n in advance. I thought itertools.product would be the right approach but it requires me to know the number of arguments in advance
Hi,
When i include fb_connect_async_js javascript helper it is throwing an
error , Facebooker 2 don't have action view template. Could you please tell
me how handle this situation .
undefined local variable or method `fb_connect_async_js' for
ActionView::Base
Thanks,
Srini
I'm trying to program a Hebrew site with a search option.
I am using php 5 with Apache 2.2, on a Debian 5 (Lenny) with
appropriate code pages enabled.
I am using _POST to pass arguments to a script. If I pass
English word to the script everything works, but when I use Hebrew
nothing is passed through the POST function. When I use ECHO
to show _POST, the variable is empty.
What might be the problem?
One of my friends sent this code to me, saying it doesn't work as expected:
#include<stdio.h>
void main()
{
int a [10] ={23, 100, 20, 30, 25, 45, 40, 55, 43, 42};
int sizeOfInput = sizeof(a)/sizeof(int);
int b, outer, inner, c;
printf("Size is : %d \n", sizeOfInput);
printf("Values before bubble sort are : \n");
for ( b = 0; b < sizeOfInput; b++)
printf("%d\n", a[b]);
printf("End of values before bubble sort... \n");
for ( outer = sizeOfInput; outer > 0; outer-- )
{
for ( inner = 0 ; inner < outer ; inner++)
{
printf ( "Comparing positions: %d and %d\n",inner,inner+1);
if ( a[inner] > a[inner + 1] )
{
int tmp = a[inner];
a[inner] = a [inner+1];
a[inner+1] = tmp;
}
}
printf ( "Bubble sort total array size after inner loop is %d :\n",sizeOfInput);
printf ( "Bubble sort sizeOfInput after inner loop is %d :\n",sizeOfInput);
}
printf ( "Bubble sort total array size at the end is %d :\n",sizeOfInput);
for ( c = 0 ; c < sizeOfInput; c++)
printf("Element: %d\n", a[c]);
}
I am using Micosoft Visual Studio Command Line Tool for compiling this on a Windows XP machine.
cl /EHsc bubblesort01.c
My friend gets the correct output on a dinosaur machine (code is compiled using TCC there).
My output is unexpected. The array mysteriously grows in size, in between.
If you change the code so that the variable sizeOfInput is changed to sizeOfInputt, it gives the expected results!
A search done at Microsoft Visual C++ Developer Center doesn't give any results for "sizeOfInput".
I am not a C/C++ expert, and am curious to find out why this happens - any C/C++ experts who can "shed some light" on this?
Unrelated note: I seriously thought of rewriting the whole code to use quicksort or merge sort before posting it here. But, after all, it is not Stooge sort...
Edit: I know the code is not correct (it reads beyond the last element), but I am curious why the variable name makes a difference.
Hi,
I want to send the following JSON text {"Email":"[email protected]","Password":"123456"} to a web service and read the response. I know to how to read JSON. The problem is that the above jason object must be sent in a variable name jason. How can i do this from android? Like creating a request object setting content headers etc.
I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code:
std::map<std::string name, std::vector<int> scores> myMap;
In this example it clearly says and no other comment is needed, what for we are using myMap variable.
Looking forward to your opinions.
I'm trying to check if a window has a certain style using GetWindowLong(hWnd, GWL_STYLE) but that gives me a LONG type of variable. how would you check for a specific style from that?
How can we convert the following 64 bit binary into the long equivalent;
01111101 10100011 01001111 11111111 11111111 11111111 11111111 11000000
equals 7D A3 4F FF FF FF FF C0 HEX
equals 9053167636875050944 << this is the value we want in a C# variable
I have a form page in PHP that reads a DBF, and conditionally converts it into a MySQL - extracting the data from an old, but still production accounting app. The conversion should be able to be actioned without user intervention, ie scripted from the web-host's command line on a cron job.
How can I get PHP to submit the form automatically when receiving variables at command line, like for instance a specific post variable? Every auto-submit I've found so far relied upon javascript, which would be useless at PHP command line.
HOWEVER! would setting the $link to my database be one thing that I prolly should use a GLOBAL scope for? In my setting of (lots of functions)...it seems as though having only one variable that is on the global scope would be wise.
I am currently using the functions to transfer it back and forth so that way I do not have it on global...but it is a bit of a hinder to my script.
Please Advise,
Thank you.
Matt
I have an object variable Object test = Spinner.getSelectedItem();
-It gets the selected item from the Spinner (called spinner) and names the item 'test'
I want to do an if statement related to that object e.g:
'if (test = "hello") {
//do something
}'
But it appears not to work....
Can someone give me some help?
-Do I have to use a different if? or convert the object to string etc.?
Thanks alot...
James
Hi all:
I've been trying to obtain the Driver class for JDBC connection to MySQL.
The workstation is running on Linux, Fedora 10.
I have manually set up the classpath variable for Java by CLI like this:
bash-3.2$ echo $CLASSPATH
/home/cmao/public_html/jsp/mysql-connector-java-5.1.12-bin.jar
This shows that I've added the lastest mysql connection jar archive to my CLASSPATH variable.
I've created a test JSP page which can be found here
And source code for this page is:
<%@page language="java"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<html>
<head>
<title>UTS JDBC MySQL connection test page</title>
</head>
<body>
<%
Connection con = null;
out.print("Java version is : " + System.getProperty("java.version") + "<br />");
out.print("Tomcat version is : " + application.getServerInfo() + "<br />");
out.print("Servlet version is: " + application.getMajorVersion() + "<br />");
out.print("JSP version is : " + JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() +"<br />");
//out.print("Java classpath is : " + System.getProperty("java.class.path")+ "<br />");
//out.print("JSP classpath is : " + appliaction.getAttribute("org.apache.catalina.jsp_classpath") + "<br />");
//out.print("Tomcat classpath is : " + System.getProperty("org.apache.tomcat.common.classpath") + "<br />");
try
{
Class c = Class.forName("com.mysql.jdbc.Driver");
}
catch(Exception e)
{
out.println("Error! Failed to obtain JDBC driver for MySQL... Missing class \"com.mysql.jdbc.Driver\"<br />");
}
%>
</body>
</html>
None of those commented out line would work, various Jsper Expetions would be thrown.
You can check those Error pages from the following links:
classpath Error page
catalina Error page
tomcat Error page
It seems, from my limited knowledge of JSP and Servlet, the Tomcat environment "ignores" my Java CLASSPATH? In which case I cannot configure the MySQL JDBC package to let my Servlets(a JSP is but a Servlet anyway) work.
I am not sure how to fix this issue. would it be better if I use an IDE like Eclipse or NetBeans and create a real Java "web app" so that everything can be "self-configured" by the usage of a web.config XML configuration file? So that I can certainly bypass this Tomcat environment restriction?
Many thanks for the suggestions in advance.
Hey all. Newbie JavaScript question here. I have an array: {r=1, g=4, b=6} How do i go about getting the value of each (r,g,b) into a separate variable?
How do you run SQL that contains one or more bind variables in the Oracle Developer Tools for Visual Studio Query Window?
For example, the following works fine in SQL*Plus:
variable x NUMBER;
BEGIN
:x := 0;
END;
/
SELECT 1 FROM DUAL WHERE :x <> 1;
When executed in the ODT Query Window, the following exception is raised in the Query output pane:
ERROR
ORA-01008: not all variables bound
I am writing a script that grabs the external IP address along with some other information about each iface. I can't figure out how to make ruby send traffic over a specific iface(eth0 and wlan0 for example). I am currently using the open-uri library to open http://whatismyip.org and read it into a variable.
def get_external_ip
begin
open("http://whatismyip.org") { |f| return f.read }
rescue
return "none"
end
end
Is there any way to specify this at runtime of the script or from within the script itself(ideally)?
I need to display a piece of HTML only if a variable value appears in a list. I know that Django 1.2 has an 'in' operator. But I am working on a Google App Engine app. Is there a workaround I can use?
Hi, i need to check the type of a variable in javascript, i know 3 ways to do it:
instanceof operator: if(a instanceof Function)
typeof operator: if(typeof a=="function"
toString method (jQuery uses this): Object.prototype.toString.call(a) == "[object Function]"
Which is the most accurate way to do type checking beetween these solutions? and why? Please don't tell me that the last solution is better only because jQuery uses that.
I have a formula which is working; the formula uses an array. I tried to extract the formula to create a custom formula but now get an error in the syntax.
I am wondering if the array is causing the problem as the error is on the line:
last_element_current:=val(sc_array[1]) + 1;
and the error is: the ) is missing and highlights the variable sc_array before the index [1].
I have a xml file which I want to transform in a jsf code page. To do that I've created a xsl file.
xml:
<?xml version='1.0' encoding='ISO-8859-1'?>
<questionario xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='Schema2.xsd'>
<componente nome='input'>
<id>input1</id>
</componente>
<componente nome='input'>
<id>input2</id>
</componente>
</questionario>
code:
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
<c:set var="xml" value="${questionarioXSLBean.xml}"/>
<c:set var="xsl">
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
exclude-result-prefixes="f h">
<xsl:template match="/">
<xsl:for-each select="questionario/componente">
<xsl:if test="attribute::nome = 'input'">
<xsl:variable name="id">
<xsl:value-of select="id" />
</xsl:variable>
<h:inputText id="{$id}"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
</c:set>
<x:transform xml="${xml}" xslt="${xsl}" />
The problem is that nothing is shown in my screen because the generated code for <h:inputText id="input1"/> is <h:inputText id="input_1" xmlns:h="http://java.sun.com/jsf/html"/> how can I replace the xmlns:h="http://java.sun.com/jsf/html" or suppress it.
Thanks!
Update: Let me clarify what I want to do. I want to generate a jsf page dynamically depending on the attributes of a xml file, for instance, 2 input texts, 3 check boxes, etc. To make the transformation to jsf I thought in two approaches, one using jstl and another using xslt. The problem with the former is that I couldn't integrate jstl with jsf code (to set jsf components attributes using jstl variables) and with the last approach, I'm facing the problem described above.I wouldn't like to create components in java (UIComponents). Any suggestions?
I am trying to created nested dictionary variable like the below, But I get compile error stating that it needs "}" at line where I am adding items (line #2) to my nested dictionary.
What Am I missing here? Thanks.
Dim myNestedDictionary As Dictionary(Of String, Dictionary(Of String, Integer)) = New Dictionary(Of String, Dictionary(Of String, Integer))()
myNestedDictionary.Add("A", New Dictionary("A", 4)())
Hi,
as I probably do not describe the problem in the right terms, I was not able to get an answer with google. Please excuse!
In the following code, I would like to replace 'hardcoded' identifier COMMENT with the variable editedField. How to do that?
var editedField:String = event.dataField;
if (model.multipleProcessingData[i][editedInformationProductNO].COMMENT != null{
...
}