Search Results

Search found 402 results on 17 pages for 'ashish sharma'.

Page 8/17 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Bean is not instantiating while using hibernate interceptor

    - by amit sharma
    I am using hibernate interceptor with spring framework,but when i pass a bean reference of DAO class its not instantiating the bean. My interceptor class has: private IMyService myService; // and getters and setters while application-context.xml having entries: <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="entityInterceptor" ref="logInterceptor"></property> </bean> <bean name="logInterceptor" class="com.amit.project.Utility.TableLogInterceptor" > <property name="myService" ref="myService"/> </bean> <bean name="myService" class="com.amit.project.service.impl.MyService"> But my bean is not instantiating in class, showing null. entityInterceptor is not allowing to do that or anything else? plz suggest a way if anybody knows.

    Read the article

  • How to declare combobox itemTemplate that has Itemsource as Enum Values in WPF?

    - by Ashish Ashu
    I have a enum let's say enum MyEnum { FirstImage, SecondImage, ThirdImage, FourthImage }; I have binded this Enum to my combobox in XAML. While defining an combobox I have defined an ItemTemplate of combox to take Two UI element: TextBlock that show the enum value (Description) Image I have done this much in XAML. I am wondering where I can specify the Image corrosponding to each item of Enum value in a combobox? Is that possible through data trigger ? I really appreciate if anyone have the XAML for this scenario. Many Thanks in advance

    Read the article

  • Detecting duplicate values in a column of a Datatable while traversing through It

    - by Ashish Gupta
    I have a Datatable with Id(guid) and Name(string) columns. I traverse through the data table and run a validation criteria on the Name (say, It should contain only letters and numbers) and then adding the corresponding Id to a List If name passes the validation. Something like below:- List<Guid> validIds=new List<Guid>(); foreach(DataRow row in DataTable1.Rows) { if(IsValid(row["Name"]) { validIds.Add((Guid)row["Id"]); } } In addition to this validation I should also check If the name is not repeating in the whole datatable (even for the case-sensitiveness), If It is repeating, I should not add the corresponding Id in the List. Things I am thinking/have thought about:- 1) I can have another List, check for the "Name" in the same, If It exists, will add the corresponding Guild 2) I cannot use HashSet as that would treat "Test" and "test" as different strings and not duplicates. 3) Take the DataTable to another one where I have the disctict names (this I havent tried and the code might be incorrect, please correct me whereever possible) DataTable dataTableWithDistinctName = new DataTable(); dataTableWithDistinctName.CaseSensitive=true CopiedDataTable=DataTable1.DefaultView.ToTable(true,"Name"); I would loop through the original datatable and check the existence of the "Name" in the CopiedDataTable, If It exists, I wont add the Id to the List. Are there any better and optimum way to achieve the same? I need to always think of performance. Although there are many related questions in SO, I didnt find a problem similar to this. If you could point me to a question similar to this, It would be helpful. Thanks

    Read the article

  • In WPF how to define a Data template in case of enum?

    - by Ashish Ashu
    I have a Enum defined as Type public Enum Type { OneType, TwoType, ThreeType }; Now I bind Type to a drop down Ribbon Control Drop Down Menu in a Ribbon Control that displays each menu with a MenuName with corresponding Image. ( I am using Syncfusion Ribbon Control ). I want that each enum type like ( OneType ) has data template defined that has Name of the menu and corrospending image. How can I define the data template of enum ? Please suggest me the solution, if this is possible !! Please also tell me if its not possible or I am thinking in the wrong direction !!

    Read the article

  • What are your recommended tools and frameworks for network development on Linux?

    - by Vivek Sharma
    What are your favourite network-tools, which you use to troubleshoot or design (as in conceptualize) your network-application code. Ethereal/Wireshark Nmap any particular simulators (e.g. ns) any special purpose sniffer any particular frameworks, (e.g. iptables) I am looking at must have, and good/advantage to have tools/framework in ones profile/skill set. I think Wireshark and Nmap are must haves.

    Read the article

  • vsts load test datasource issues

    - by ashish.s
    Hello, I have a simple test using vsts load test that is using datasource. The connection string for the source is as follows <connectionStrings> <add name="MyExcelConn" connectionString="Driver={Microsoft Excel Driver (*.xls)};Dsn=Excel Files;dbq=loginusers.xls;defaultdir=.;driverid=790;maxbuffersize=4096;pagetimeout=20;ReadOnly=False" providerName="System.Data.Odbc" /> </connectionStrings> the datasource configuration is as follows and i am getting following error estError TestError 1,000 The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see "Troubleshooting Data-Driven Unit Tests" (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library. Error details: ERROR [42000] [Microsoft][ODBC Excel Driver] Cannot update. Database or object is read-only. ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [42000] [Microsoft][ODBC Excel Driver] Cannot update. Database or object is read-only. I wrote a test, just to check if i could create an odbc connection would work and that works the test is as follows [TestMethod] public void TestExcelFile() { string connString = ConfigurationManager.ConnectionStrings["MyExcelConn"].ConnectionString; using (OdbcConnection con = new OdbcConnection(connString)) { con.Open(); System.Data.Odbc.OdbcCommand objCmd = new OdbcCommand("SELECT * FROM [loginusers$]"); objCmd.Connection = con; OdbcDataAdapter adapter = new OdbcDataAdapter(objCmd); DataSet ds = new DataSet(); adapter.Fill(ds); Assert.IsTrue(ds.Tables[0].Rows.Count > 1); } } any ideas ?

    Read the article

  • In cakePHP, how to retrieve joined result from multiple tables

    - by Manish Sharma
    Hi, can anyone tell me, how to retrieve joined result from multiple tables in cakePHP ( using cakePHP mvc architecture). For example, I have three tables to join (tbl_topics, tbl_items, tbl_votes. Their relationship is defined as following: a topic can have many items and an item can have many votes. Now I want to retrieve a list of topics with the count of all votes on all items for each topic. The SQL query for this is written below: SELECT Topic.*, count(Vote.id) voteCount FROM tbl_topics AS Topic LEFT OUTER JOIN tbl_items AS Item ON (Topic.id = Item.topic_id) LEFT OUTER JOIN tbl_votes AS Vote ON (Item.id = Vote.item_id); My problem is I can do it easily using $this-><Model Name>->query function, but this requires sql code to be written in the controller which I don't want. I'm trying to find out any other way to do this (like find()).

    Read the article

  • Access is denied error with pregenerated .pyc or .pyo files

    - by mukul sharma
    Hi All, I am getting an Access is denied error while I am trying to run the .pyo file by double click or from the command prompt. Lets say I have abc.py (keeping main method entry point) which imports files xyz.py and imports wx etc. I generate the .pyo file. But once I try to run abc.pyo I get the access is denied error. I am not getting why this happening? Any help will really appreciated. Thanks

    Read the article

  • WPF Open Combobox popup on Focus or GotFocus

    - by ashish.magroria
    Hi, I am trying to open the combobox popup when it is focused using Style/Event Trigger I used the following code in my Combobox control Template: <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}"> <Grid > <ToggleButton Grid.Column="2" Template="{DynamicResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/> <ContentPresenter HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="ContentSite" VerticalAlignment="Center" Content="{TemplateBinding SelectionBoxItem}" ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}" IsHitTestVisible="False"/> <TextBox Visibility="Hidden" Template="{DynamicResource ComboBoxTextBox}" HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="PART_EditableTextBox" Style="{x:Null}" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/> <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide"> <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True"> <Border x:Name="DropDownBorder" Background="{DynamicResource ShadeBrush}" BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1"/> <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True"> <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/> </ScrollViewer> </Grid> </Popup> </Grid> <ControlTemplate.Triggers> **<Trigger Property="IsMouseOver" Value="True"> <Setter Property="IsOpen" Value="True" TargetName="Popup"/> </Trigger>** </ControlTemplate.Triggers> </ControlTemplate> But nothing happens with this code. So I trid the following Event trigger in ControlTemplate.Triggers <EventTrigger RoutedEvent="UIElement.GotFocus"> <BeginStoryboard> <Storyboard > <BooleanAnimationUsingKeyFrames Storyboard.TargetName="Popup" Storyboard.TargetProperty="IsOpen" FillBehavior="HoldEnd"> <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="True" /> </BooleanAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> <EventTrigger RoutedEvent="UIElement.LostFocus"> <BeginStoryboard> <Storyboard > <BooleanAnimationUsingKeyFrames Storyboard.TargetName="Popup" Storyboard.TargetProperty="IsOpen" FillBehavior="HoldEnd"> <DiscreteBooleanKeyFrame KeyTime="00:00:00" Value="False" /> </BooleanAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> Now this helps open the popup on focus, but when I select any item from dropdown the pop up doesnt disappear as usual; it stays open. it closes only after I click somewhere else in the window. Can someone please suggest the proper way to do this Thanks in advance

    Read the article

  • Themes wont work when using Server Side Tags on an ASP.NET Page

    - by Sumit Sharma
    The code for the asp.net page is: <div class="facebox_content"> <% if (CurrentUser.Role == "Free") { %> <table cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:380px;"> <tr> <td> User Name : </td> <td> Membership Cost : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtUserName" Enabled="false" runat="server" Text="<%= CurrentUser.Name %>"/> </td> <td style="width:190px;"> <asp:TextBox ID="txtCost" Enabled="false" runat="server" Text="2000"/> </td> </tr> <tr> <td> <br /> Cheque / Draft No.: </td> <td> <br /> Bank Drawn On : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtChqNo" runat="server"></asp:TextBox> </td> <td style="width:190px;"> <asp:TextBox ID="txtBankName" runat="server"></asp:TextBox> </td> </tr> <tr> <td> <br /> Date : </td> <td> <br /> City : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtDate" runat="server"></asp:TextBox> </td> <td style="width:190px;"> <asp:TextBox ID="txtCity" runat="server"></asp:TextBox> </td> </tr> </table> <% } else if(CurrentUser.Role == "Pending") { %> <p style="text-align:justify;"> Your Request is pending with our Administrators. Please be patient while your request is processed. Usually it takes 2-4 Days for your request to be processed after the payment has been received. </p> <% } else if(CurrentUser.Role == "Paid") { %> <p style="text-align:justify;"> You are already a Paid Member of Website </p> <% } %> The code for the C# file is: protected void Page_PreInit(object sender, EventArgs e) { this.Theme = CurrentUser.Theme; } protected void Page_Load(object sender, EventArgs e) { txtUserName.Text = CurrentUser.Name; ConfirmButton.Attributes.Add("onclick", "javascript:document.getElementById('" + lblMsg.ClientID + "').style.display='none';"); if (CurrentUser.Role != "Free") ConfirmButton.Visible = false; } The code is giving the following error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).] System.Web.UI.ControlCollection.Add(Control child) +8678903 System.Web.UI.PageTheme.SetStyleSheet() +478 System.Web.UI.Page.OnInit(EventArgs e) +8699660 System.Web.UI.Control.InitRecursive(Control namingContainer) +333 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378 Please some one help me out..!!

    Read the article

  • Cross Thread Exception in PropertyChangedEvent in WPF

    - by Ashish Ashu
    I have a ListView that is binded to my custom collection. At run time , I am updating the certain properties of my entity in my custom collection in my ViewModel. At the same time , I am also doing the custom sorting in the listview. The custom sorting is applicable when I click on the any column header of the listview. For example, I am updating the current datetime on my entity on every 5 seconds and simulaneously , I am applying custom sorting based on DateTime. (The Listview is third party control). Hence I am doing two operations on my custom collection at the same time. Should I pass the dispatcher of my control in the view model and call any methods ( which updates any entity in my custom collection ) through UI dispatcher ?

    Read the article

  • Getting error while transfering PGP file through FTP : The underlying connection was closed: An unex

    - by sumeet Sharma
    I am trying to upload a PGP encrypted file through FTP. But I am getting an error message as follows: The underlying connection was closed: An unexpected error occurred on a receive. I am using the following code and getting the error at line: Stream ftpStream = response.GetResponse(); Is there any one who can help me out ASAP. Following is the code sample: FtpWebRequest request = WebRequest.Create("ftp://ftp.website.com/sample.txt.pgp") as FtpWebRequest; request.UsePassive = true; FtpWebResponse response = request.GetResponse() as FtpWebResponse; Stream ftpStream = response.GetResponse(); int bufferSize = 8192; byte[] buffer = new byte[bufferSize]; using (FileStream fileStream = new FileStream("localfile.zip", FileMode.Create, FileAccess.Write)) { int nBytes; while((nBytes = ftpStream.Read(buffer, 0, bufferSize) > 0) { fileStream.Write(buffer, 0, nBytes); } } Regards, Sumeet

    Read the article

  • data structure problems

    - by Ashish
    hey guys, please help me in finding the solution to some of these Amazon questions: given a file containing approx 10 million words, design a data structure for finding the anagrams Write a program to display the ten most frequent words in a file such that your program be efficient in all complexity measures. you have a file with millions of lines of data. Only two lines are identical; the rest are all unique. Each line is so long that it may not even fit in the memory. What is the most efficient solution for finding the identical lines?

    Read the article

  • Retrieving many huge sized EPS files and converting them to JPEG in ASP.NET application

    - by Ashish Gupta
    I have many (600) EPS files(300 KB - 1 MB) in database. In my ASP.NET application (using ASP.NET 4.0) I need to retrieve them one by one and call a web service which would convert the content to the JPEG file and update the database (JPEGContent column with the JPEG content). However, retrieving the content for 600 of them itself takes too long from the SQL management studio itself (takes 5 minutes for 10 EPS contents). So I have two issues:- 1) How to get the EPS content ( unfortunately, selecting certain number of content is not an option :-( ):- Approach 1:- foreach(var DataRow in DataTable.Rows) { // get the Id and byte[] of EPS // Call the web method to convert EPS content to JPEG which would also update the database. } or foreach(var DataRow in DataTable.Rows) { // get only the Id of EPS // Hit database to get the content of EPS // Call the web method to convert EPS content to JPEG which would also update the database. } or Any other approach? 2) Converting EPS to JPEG using a web method for 600 contents. Ofcourse, each call would be a long running operation. Would task parellel library (TPL) be a better way to achieve this? Also, is doing the entire thing in a SQL CLR function a good idea?

    Read the article

  • Get cookie expiration

    - by Ashish Rajan
    Is it possible to read cookie expiration time with php ? When I print_r($_COOKIE) it outputs: Array ( [PHPSESSID] => 0afef6bac83a7db8abd9f87b76838d7f [userId] => 1232 [userEmail] => [email protected] [firstName] => user [lastName] => user ) So I think $_COOKIE don't have the expiration time, is it possible with some other function?

    Read the article

  • Why I am not able to update the column based on a condition which is not the primary key

    - by Gaurav Sharma
    Why I am not able to update the column based on a condition which is not the primary key. I am trying to update the constituencies table where name matches a specific criterial as shown below but the below queries shows an error Error code 1064, SQL state 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table constituencies set city_id = '1' where constituencies.name = "East Delhi"' at line 1 update table constituencies set city_id = '1' where constituencies.name = "East Delhi"; update table constituencies set city_id = '1' where constituencies.name = "South Delhi"; update table constituencies set city_id = '1' where constituencies.name = "Delhi Sadar"; update table constituencies set city_id = '1' where constituencies.name = "Karol Bagh"; update table constituencies set city_id = '1' where constituencies.name = "New Delhi"; update table constituencies set city_id = '1' where constituencies.name = "Outer Delhi"; update table constituencies set city_id = '1' where constituencies.name = "North East Delhi"; update table constituencies set city_id = '1' where constituencies.name = "North West Delhi"; update table constituencies set city_id = '1' where constituencies.name = "West Delhi"; Is it necessary that the condition should be checked with a primary key only ? Please throw some light on the above.

    Read the article

  • Help in XPath expression

    - by Ashish Gupta
    I have an XML document which contains nodes like following:- <a class="custom">test</a> <a class="xyz"></a> I was tryng to get the nodes for which class is NOT "Custom" and I wrote an expression like following:- XmlNodeList nodeList = document.SelectNodes("//*[self::A[@class!='custom'] or self::a[@class!='custom']]"); Now, I want to get IMG tags as well and I want to add the following experession as well to the above expression:- //*[self::IMG or self::img] ...so that I get all the IMG nodes as well and any tag other than having "custom" as value in the class attribute. Any help will be appreciated. EDIT :- I tried the following and this is an invalid syntax as this returns a boolean and not any nodelist:- XmlNodeList nodeList = document.SelectNodes("//*[self::A[@class!='custom'] or self::a[@class!='custom']] && [self::IMG or self::img]");

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >