Monday, May 21, 2012

How to "Insert text from file" using OpenXml SDK 2.0

Using Word 2010 GUI, there is an option to "Insert text from file...", which does exactly that: It insert the text in the main part of a document to the current location in your document.



I would like to do the same using C# and the OpenXml SDK 2.0



using (var mainDocument = WordprocessingDocument.Open("MainFile.docx", true);
{
var mainPart = mainDocument.MainDocumentPart;
var bookmarkStart = mainPart
.Document
.Body
.Descendants<BookmarkStart>()
.SingleOrDefault(b => b.Name == "ExtraContentBookmark");
var extraContent = GetTextFromFile("ExtraFile.docx");

bookmarkStart.InsertAfterSelf(extraContent);
}


I have tried using plain Xml (XElement), using OpenXmlElement (MainDocumentPart.Document.Body.Descendants), and using AltChunk. Every alternative so far has yielded a non-conformant docx-file.



What should the method GetTextFromFile look like?





UIWebView copy/paste

Hy.
I have a single view application that only contains a web view and a text field which acts like an address bar. After selecting part of a web page, i want to push a button to copy it(all of the selection including text and pictures) and automatically paste it into another view.
I can add a button to the edit menu (although i don't know how to remove the copy and paste buttons), but i don't know how to get the selection.



I have tried to use gesture recognizers to do this but i cannot find a way to get the selection. I set my view controller as a UIWebViewDelegate and an UIGestureRecognizerDelegate and tried to implement touchesBegan, touchesMoved and touchesEnded, but they don't get called when starting selection. Do you know an example with something like this or at least point me in the good direction? Thank you!





How to do i resolve "Resource interpreted as Script but transferred with MIME type text/html"

I use Django for my applications, and for some strange reasons a new project am working on has started mis-behaving with the following error when I try to load the page on a browser.




Resource interpreted as Script but transferred with MIME type text/html: "http://127.0.0.1:8000/site_media/js/jquery-1.7.js"




my view looks like this;



@csrf_exepmt
def home(request):
render_to_response("myapp/home.html",{}, context_instance=RequestContext(request))


My HTML template:



<!DOCTYPE HTML>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Home</title>
<script type="text/javascript" src="jquery-1.7.js"></script>
</head>
<body>
<h1>Welcome Home!</h1>
</body>
</html>


I have never seen anything like this in the past for any of my projects.



I am testing on Windows, Chrome 18.0. I have also tried on FF6 and Firebug is throwing some error on the first line of my html file.



All the suggestions from the net that I am trying are not working.



I have also tried to use the technique of supplying the MIME type manually via the django render shortcut but with no luck.



What am I missing? My other projects are working normally, even without the MIME settings.



Note: If I leave the "src" attribute of the script tag empty, the page loads well.





security problems with passing javascript variable to a php variable

i've found a way to pass my javascript variables to a php variable by using this:



window.location.href = ".../gameover.php?points=" + points+"&speed="+window.speed;


in the gameover.php site i use



$_GET[speed]   // and 
$_GET[points]


to access my variables.
these values then get stored into a database as hiscores. but here comes my problem:
if the user just types for example



.../gameover.php?points=500000&speed=85


in the address bar it also stores these variables.



i have found something that helps avoiding this but you can still get around it. on my main page i make a cookie 'notcheated' and if the user visits the page and notcheated isset then it destroys the cookie and stores the values in my hiscores but if the user visits the main page and then enters the above address for example then the cookie isset but he hasn't played the game and then the values are also stored.



does someone have any suggestions to secure my site so that people can't just enter their own hiscores.





spring beans and sessionFactory in different xml files

We have 3 applications using 3 different spring configuration files. But we have one database and one datasource, so one session factory.Hhow can we import the session factory bean into the 3 different spring config files?





NUnit: Unit testing, recommendations on storing test data files

I've started working on an OpenXml based engine, and we are using a lot of pptx files for testing purpose. we do not want these files to be stored in the source control. is there any recommendations on this. may be storing in a network share or a mapped drive etc?





Silverlight 4 - Out of Browser Applications

Does a Silverlight 4 out of browser application have access to the .NET Framework?





how to auto convert nil to [NSNull null] when add it to array(dict)?

how to auto convert nil to [NSNull null] when add it to array(dict)?



I have some values need to be added to a array (initwithobjects), and encode to JSON string later.



As everyone knows, when array meet a nil, it will stop read next value.



As convention of JSON Array, the nil should be act as an null in ordered position.



Should I check every value, and manually convert it to [NSNull null] before add it to array?





Showing progress in command-line application

Ok, i am a bit embarrassed to ask such a simple thing but still.



I have command line utility application and need to implement showing progress to the user.



I could write progress into cout, like this:



std::cout << "10%\n";
...
std::cout << "20%\n";
...
std::cout << "30%\n";


... but as a result user will see:



some line printed before
10%
20%
30%
...


... but what i really need is that percentage got updated
, like this at the beginning:



some line printed before
10%
...


... and after update:



some line printed before
20%
...


... and after second update:



some line printed before
30%
...


How should i manage this?





Delegate invoke

I want to change a Form control property from a process thread event fire in a class, I have the following code but I received this exception:




the calling thread cannot access this object because a different
thread owns it.




Code:



public partial class main : Window
{
public main()
{
InitializeComponent();
}

public void change()
{
label1.Content = "hello";
}

private void button1_Click(object sender, RoutedEventArgs e)
{
nmap nmap = new nmap(this);
nmap.test("hello");
}
}

class nmap
{
private main _frm;
private Process myprocess;

public nmap(main frm)
{
_frm = frm;
}

public void test(object obj)
{
string s1 = Convert.ToString(obj);
ProcessStartInfo startInfo = new ProcessStartInfo();
myprocess = new Process();
myprocess.StartInfo.FileName = "C:\\nmap\\nmap.exe";
myprocess.EnableRaisingEvents = true;
myprocess.Exited += new EventHandler(myProcess_Exited);

myprocess.Start();
}

private void myProcess_Exited(object sender, System.EventArgs e)
{
try
{
_frm.change();
}
catch{}
}
}


Please help me on this, I think delegate invoke must be work



My project is a WPF C# project.





Tic Tac Toe with Minimax: Computer sometimes losing when Player goes first; works otherwise

I am working on a Minimax algorithm for unbeatable Tic Tac Toe. I need it to work both for when the Computer goes first as well as when the Player goes first. With the current version, the Computer will never lose when going first. However, it seems that Minimax never finds a best move (always returns -1 as the score) if the Player goes first.



What is causing the Minimax score returned to be -1 for the Computer if the Player makes the first move?



Example:



board.addMark( 1, Mark2.PLAYER ); // add a 'PLAYER' mark to an arbitrary location
Minimax.minimax( board, Mark2.COMPUTER ); // will always return -1


Here's the 'Minimax' class:



public class Minimax {
public static int minimax( Board board, Mark2 currentMark ) {
int score = (currentMark == Mark2.COMPUTER) ? -1 : 1;
int[] availableSpaces = board.getAvailableSpaces();

if ( board.hasWinningSolution() )
score = (board.getWinningMark() == Mark2.COMPUTER) ? 1 : -1;
else if ( availableSpaces.length != 0 ) {
Mark2 nextMark = (currentMark == Mark2.COMPUTER) ? Mark2.PLAYER : Mark2.COMPUTER;

for ( int availableIndex = 0; availableIndex < availableSpaces.length; availableIndex++ ) {
board.addMark( availableSpaces[availableIndex], currentMark );
int nextScore = minimax( board, nextMark );
board.eraseMark( availableSpaces[availableIndex] );

if ( currentMark == Mark2.COMPUTER && nextScore > score
|| currentMark == Mark2.PLAYER && nextScore < score )
score = nextScore;
}
}

return score;
}
}


Here is the 'Board' class:



public class Board {
private Mark2 gameBoard[];
private int blankSpaces;

private boolean solutionFound;
private Mark2 winningMark;

public final static int winSets[][] = {
{ 0, 1, 2 }, { 3, 4, 5 },
{ 6, 7, 8 }, { 0, 3, 6 },
{ 1, 4, 7 }, { 2, 5, 8 },
{ 0, 4, 8 }, { 2, 4, 6 }
};

public Board() {
gameBoard = new Mark2[9];
blankSpaces = 9;

for ( int boardIndex = 0; boardIndex < gameBoard.length; boardIndex++ ) {
gameBoard[boardIndex] = Mark2.BLANK;
}
}

public void addMark( int spaceIndex, Mark2 mark ) {
if ( gameBoard[spaceIndex] != mark ) {
gameBoard[spaceIndex] = mark;

if ( mark == Mark2.BLANK ) {
blankSpaces++;
} else {
blankSpaces--;
}
}
}

public void eraseMark( int spaceIndex ) {
if ( gameBoard[spaceIndex] != Mark2.BLANK ) {
gameBoard[spaceIndex] = Mark2.BLANK;
blankSpaces++;
}
}

public int[] getAvailableSpaces() {
int spaces[] = new int[blankSpaces];
int spacesIndex = 0;

for ( int boardIndex = 0; boardIndex < gameBoard.length; boardIndex++ )
if ( gameBoard[boardIndex] == Mark2.BLANK )
spaces[spacesIndex++] = boardIndex;

return spaces;
}

public Mark2 getMarkAtIndex( int spaceIndex ) {
return gameBoard[spaceIndex];
}

public boolean hasWinningSolution() {
this.solutionFound = false;
this.winningMark = Mark2.BLANK;

for ( int setIndex = 0; setIndex < winSets.length && !solutionFound; setIndex++ )
checkSpacesForWinningSolution( winSets[setIndex][0], winSets[setIndex][1], winSets[setIndex][2] );

return solutionFound;
}

public Mark2 getWinningMark() {
return this.winningMark;
}

private void checkSpacesForWinningSolution( int first, int second, int third ) {
if ( gameBoard[first] == gameBoard[second] && gameBoard[third] == gameBoard[first]
&& gameBoard[first] != Mark2.BLANK ) {
solutionFound = true;
winningMark = gameBoard[first];
}
}

public void printBoard() {
System.out.printf( " %c | %c | %c\n", getMarkCharacter( gameBoard[0] ), getMarkCharacter( gameBoard[1] ),
getMarkCharacter( gameBoard[2] ) );
System.out.println( "------------" );
System.out.printf( " %c | %c | %c\n", getMarkCharacter( gameBoard[3] ), getMarkCharacter( gameBoard[4] ),
getMarkCharacter( gameBoard[5] ) );
System.out.println( "------------" );
System.out.printf( " %c | %c | %c\n", getMarkCharacter( gameBoard[6] ), getMarkCharacter( gameBoard[7] ),
getMarkCharacter( gameBoard[8] ) );
}

public char getMarkCharacter( Mark2 mark ) {
char result = (mark == Mark2.PLAYER) ? 'O' : ' ';
result = (mark == Mark2.COMPUTER) ? 'X' : result;
return result;
}
}


And here's the 'Mark2' class if there was any confusion:



public enum Mark2 {
BLANK,
PLAYER,
COMPUTER
}




How to update UI onActivityResult in android

I need value from the new activity to old existing activity and based on the value i need to update the UI. Please help me How to use onActivityResult to update the UI





Cycling pipelining

I have a matrix: Array2D and a function



let DivideAndSubstract value index (matrix: float[,]) = 
//something that returns a matrix


so I need to apply this function n times to my matrix like that:



matrix  
|> DivideAndSubstract matrix.[0,0] 0
|> DivideAndSubstract matrix.[1,1] 1
|> DivideAndSubstract matrix.[2,2] 2
....
|> DivideAndSubstract matrix.[n,n] n


where n = Array2D.length1 matrix - 1

How can I implement this pipelining?





MSDEPLOY Install CLR Assembly into SQL server

I'm writing my first MSDEPLOY package to deploy our website. It uses an SQL CLR .DLL which needs to be installed into the database as part of deployment.



This is nominally very simple. I just need to deploy the DLL onto the destination server and then execute an SQL Command to have it add the assembly. When the SQL command is executed it must be given the path to the assembly to add to the SQL Server.



Their are two choices out of the box. One is to use the runCommand provider to execute a command script to install it. The other is to add an SQL script using the Package/Publish SQL tab in Visual Studio 2010.



What I can't determine after much searching is how to pass the deployment path of the DLL to either the command script or the SQL or the Package/Publish SQL.



I could declare a new parameter in the parameters.xml file and force the user to provide the installation path in a seperate parameter and then use parameterEntry to write the update to the SQL script. However it seems a little odd to have to provide information to MSDEPLOY that it already knows.



Having scripts know where the deployed resources were actually deployed seems like a fundamentally basic concern that I wonder if there is something really basic that I've missed.





Javascript regular expressions for Query Builder

This may have been asked in the past but I couldnt find a suitable answer. What I am looking for is a method to extract parameters from an sql query such as below. The queries will always be an EXEC statement followed by the query name, and possible parameters.



Here is an example of what I may recieve



EXEC [dbo].[myProcedure] @Param1


This could also be as follows



EXEC [dbo].[myProcedure] @Param1, @Param2, @Param3


Those are the only types of queries that the input will take. As for why I am doing this, well thats another question all together, and I am pretty set on going down this route.



What I am looking for is to be able to take the above strings and produce an array of values such as



['@Param1','@Param2','@Param3',....]


I originally tried to just parese using a simple while statement but I seem to have huge issues there.



I hope this question makes sense,



Cheers,



Nico





Coding templates - auto property at top of code file

It might seem like a small problem, but I was wondering if there is any support from either Visual Studio or a 3rd party application to configure where Visual Studio places certain auto-generated code.



When I am programming, I try to be as efficient as possible, and use 'Ctrl+.' a lot to automatically implement interfaces, fields, properties etc.. and one of the issues i have is that EVERY time I want to create a property in a class file (by typing in the usage first, then Ctrl+. the red invalid text, choosing Generate Property Stub when prompted) is Visual Studio places the code at the very bottom of the class file.



This is not how I structure my code files, and for better or worse I would much prefer it if the Auto-Properties were generated at the top.



So instead of (as would happen on auto-generation)



public class ObjectProvider
{
public ObjectProvider(Object o)
{
this.Object = o;
}

public object Object { get; private set; }
}


I would prefer



public class ObjectProvider
{
public object Object { get; private set; }

public ObjectProvider(Object o)
{
this.Object = o;
}
}


A small change I know, but when I am coding (at the least!) 5 days a week, for about 40 hours - I think this would actually save me a lot of time!





Spinner with custom background not showing text

I have a pair of Spinners that work exactly as intended, but when I put a drawable on them, the text just dissapears. Here is the XML of both the Layout and the Drawable. The only problem here is that the drawable does not let the text show up.



ttd_list.xml



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<include
android:id="@+id/include1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
layout="@layout/action_bar" />

<LinearLayout
android:id="@+id/ll1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" android:background="@color/gray">

<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="beforeDescendants"
android:focusableInTouchMode="true"
android:paddingBottom="8dip" >

<AutoCompleteTextView
android:id="@+id/autoCompleteThingsToDo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginTop="8dip"
android:layout_toLeftOf="@+id/buttonSearchThingsToDo"
android:textColor="#000000" >
</AutoCompleteTextView>

<Button
android:id="@+id/buttonSearchThingsToDo"
style="@style/StandardButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/autoCompleteThingsToDo"
android:text="@string/search" />
</RelativeLayout>

<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="8dip" >

<Spinner
android:id="@+id/spinnerCategories"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/spinner_filters" />

<View
android:layout_width="10dip"
android:layout_height="match_parent" />

<Spinner
android:id="@+id/spinnerSortOrder"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/spinner_filters" />
</TableRow>
</LinearLayout>

<ListView
android:id="@+id/listViewThingsToDo"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" >
</ListView>




spinner_filters.xml



<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:drawable="@drawable/spinnerbg" android:state_pressed="true"><shape>
<solid android:color="@color/blue" />

<stroke android:color="@color/blue" />

<corners android:radius="3dp" />
</shape></item>
<item android:drawable="@drawable/spinnerbg" ><shape>
<solid android:color="#00000000" />

<corners android:radius="3dp" />
</shape></item>

</selector>


spinnerbg.9.png



http://i.stack.imgur.com/6R7Sk.png



Any idea on why doesn't the text show up?





How convert LPTSTR to char ch[]

I need to convert an LPTSTR p to CHAR ch[]. I am new to C++.



#include "stdafx.h"
#define _WIN32_IE 0x500
#include <shlobj.h>
#include <atlstr.h>
#include <iostream>
#include <Strsafe.h>

using namespace std;

int main(){
int a;
string res;
CString path;
char ch[MAX_PATH];
LPTSTR p = path.GetBuffer(MAX_PATH);
HRESULT hr = SHGetFolderPath(NULL,CSIDL_APPDATA, NULL, SHGFP_TYPE_CURRENT, p);

/* some operation with P and CH */

if(SUCCEEDED(hr))
{ /* succeeded */
cout << ch;
} /* succeeded */
else
{ /* failed */
cout << "error";
} /* failed */
cin >> a;
return 0;
}


Thanks in advance.





Is it possible to detect when a DMA channel on a Cortex M3 goes idle?

I've just taken over a project developing C code for an STM32 Cortex M3 microcontroller.



An issue that I immediately have is that I have a free running DMA channel that transfers data between 2 USARTs, but on occasions data from another source needs to be sent to the destination USART.



Is there any way to detect when a DMA is busy transferring data or idle, or are there any interrupts triggered when a transfer is complete.



Many thanks for any responses,



Dave





BCRYPT and Random SALTS together in database

I am in the process of upgrading the security level of my site.



When researching for the best method to store passwords i found the BCRYPT option in PHP 5.3. I have implemented this function to use a static SALT, however I read that each password should have a different SALT or defeats the purpose.



Should I store the SALT in the database with the user record in plain text? Does this defeat the purpose as well? or should i hash the salt using md5 and store it in the database?



What is the best method when implementing this and storing SALTs?





Media Player Error

This is my code for controlling two seekbars to set volume control in media player for two simultaneously playing sound. But the sound is turned on and off on the progress change of seekbar, it does not increase or decrease of volume frequently on progress change. Where am I wrong?



audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);

int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
int curVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);

volume2 = (SeekBar)findViewById(R.id.volbar2);
volume1 = (SeekBar)findViewById(R.id.volbar);


volume1.setMax(maxVolume);
volume2.setMax(maxVolume);
volume1.setProgress(curVolume);
volume2.setProgress(curVolume);

volume1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {

@Override
public void onStopTrackingTouch(SeekBar seekBar) {


}
@Override
public void onStartTrackingTouch(SeekBar arg0) {

}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean arg2) {

if(seekBar.equals(volume1)){

mediaPlayer.setVolume(progress,progress);

Toast.makeText(getApplicationContext(), ""+progress+progress, 1).show();

}

}
});

volume2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

public void onStopTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub

}

public void onStartTrackingTouch(SeekBar seekBar) {
// TODO Auto-generated method stub

}

public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser) {
// TODO Auto-generated method stub
if(seekBar.equals(volume2)){
mediaPlayer2.setVolume(progress,progress);
}

}
});




Allow WordPress users to link Facebook account

I haven't started the code side of this yet, so unfortunately don't have anything to share just yet, but I'm interested in understanding how I could theoretically achieve this;



I have a setup basically working with an action hook in Wordpress, calling the access token from the user using the_author_meta() and posting an open graph action.



My problem is getting the user to authenticate, using the login button and saving the access token, ideally from their profile. I simply am not sure where to start with this.



Any ideas/pointers on he best way to do this?





How do I remove the maximize and minimize buttons from a JFrame?

I need to remove the maximize and minimize buttons from a JFrame. Please suggest how to do this.





ajaxtabcontainer do full postback, how to controll it

i use scriptManager in masterpage, because every content page is to be ajxify.



In content page, i use updatePanel and everything work fine but incase of content page where i use TabCOntainer, each time when i move from one tab to another tab, page is full postback.



Here one thing i motice that when i remove scriptMAnager from master page and use in contentPage then tabCOntainer work fine.



what will be possible solution for such type condition.



MASTERPAGE







  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head id="Head1" runat="server">
</head>

<body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel_Register" runat="server">
<ContentTemplate>
//Update Panel work at Master Page
</ContentTemplate>
</asp:UpdatePanel>


<asp:ContentPlaceHolder ID="showcase" runat="server">

</asp:ContentPlaceHolder>





CONTENTPAGE



 <%@ Page Title="" Language="C#" MasterPageFile="~/MasterDashBoard.master" AutoEventWireup="true"
CodeFile="messages.aspx.cs" Inherits="messages" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

<asp:UpdatePanel ID="UpdatePanel_msg" runat="server" >

<ContentTemplate>

<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" AutoPostBack="True"
OnActiveTabChanged="TabContainer1_ActiveTabChanged">

<cc1:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1" ToolTip="Compose Message">

<HeaderTemplate>
Compose
</HeaderTemplate>

<ContentTemplate>
Some Work

</ContentTemplate>

</cc1:TabPanel>

<cc1:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2">

<HeaderTemplate>
inbox
</HeaderTemplate>

<ContentTemplate>
SOme Work
</ContentTemplate>
</cc1:TabPanel>

</cc1:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>






Want to insert a row taking from the same table

I have a table with 50 columns. It has two rows inserted. I want to add 3rd row by taking values from that table only.



insert into Sample([IDX],[CODE]
,[NAME]
,[LABEL]
,[BILLING_ADDRESS]
,[PRIMARY_CONTACT_NAME]
,[PRIMARY_CONTACT_EMAIL]
,[SECONDARY_CONTACT_NAME]
,[SECONDARY_CONTATCT_EMAIL]
,[RDBMS_SERVER]
,[RDBMS_DB_NAME]
,[RDBMS_LOGIN]
,[RDBMS_PWD]
,[ETL_FOLDER_PATH])
values (select [IDX],[CODE]
,[NAME]
,[LABEL]
,[BILLING_ADDRESS]
,[PRIMARY_CONTACT_NAME]
,[PRIMARY_CONTACT_EMAIL]
,[SECONDARY_CONTACT_NAME]
,[SECONDARY_CONTATCT_EMAIL]
,[RDBMS_SERVER]
,[RDBMS_DB_NAME]
,[RDBMS_LOGIN]
,[RDBMS_PWD]
,[ETL_FOLDER_PATH]
from Sample where IDX = 2
)


In the above example i taken only few columns.
While trying to execute this query it is showing message as follows.




There are more columns in the INSERT statement than values specified
in the VALUES clause. The number of values in the VALUES clause must
match the number of columns specified in the INSERT statement.




How to solve it?



Thanks





Difference between Plain text input type and Person Name input type in Editext in android

Can anybody tell me, when we use EditText widget in Android , then what are the basic difference while using Plain Text input type and Person name input type.



Please Help
Its urgent



Thanks in advance.





How to programatically lock BLACKBERRY device(6.0)?

how to lock blackberry device 6.0 pro-grammatically?
there is an API called
ApplicationManger.locksystem(true)
but its diprecated in 6.0





how to get the tree form these pre/in order traversal: Pre: A,B,D,E,C,F,G,H in:E,D,B,A,G,F,H,C Thank You

how to get the tree form these pre/in order traversal:



Pre: A,B,D,E,C,F,G,H in:E,D,B,A,G,F,H,C



Thank You





show the information in the middle of the call

I want to show the some information in the middle of the call in that screen like weather info,or facebook updates like that ,can anyone help me



check that screenshot in that below of the number i want that upates.anyone have idea,suggest me.



enter image description here



Thanks in advance





JQGrid xmlreader custom id

I need to pass a custom id to the xmlreader structure for the JQGrid to feed off of a combination of nodes in the xml data to uniquely identify the rows.
I currently have this version working
var feedXmlReaderOptions = {
root: "feed",
row: "entry",
repeatitems: false,
id: "d|clmNum,d|seqNum"
};
which concatenates the clmNum and seqNum xml nodes to build an unique identifier for the row.
By the way, the d| refers to a namespace used in the xml, so please ignore it, it's not relevant for this question.
The issue here is that I need a delimiter between the clmNum and seqNum so that I can parse the id later on, during the

ajaxRowOptions: {
beforeSend:...
}
event, so that I can build dynamically the URL that I need to post to. The URL to post to obviously listens to the same id as the grid row, so you see the connection.
What I tried, given the CSS selector style used, were the CSS pseudo elements, through which one can insert custom, non-existent elements, into the selector:
d|clmNum:after { content: "" },d|seqNum
d|clmNum.after('
'),d|seqNum
but it's not working...jQuery selectors complain about the {, and the jquery .after(), just like .before(), seem to work inline as methods, not arguments, after the selector returned already a result.
So, anyone has an idea about how to do this?
The alternative with returning the concatenated key during the creation of the xml doesn't work, the xml is not under my control.



Thanks a bunch.
serban@nj,usa