Search Results

Search found 3994 results on 160 pages for 'implementing'.

Page 17/160 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • Hibernate updating records and implementing listeners : getting only required attribute values for event.getOldState()

    - by Narendra
    Hi All, I am using Hibernate 3 as my persistence framework. Below is the sample hbm file I am using. <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.test.User" table="user"> <meta attribute="implements">com.test.dao.interfaces.IEntity</meta> <id name="key" type="long" column="user_key"> <generator class="increment" /> </id> <property name="userName" column="user_name" not-null="true" type="string" /> <property name="password" column="password" not-null="true" type="string" /> <property name="firstName" column="first_name" not-null="true" type="string" /> <property name="lastName" column="last_name" not-null="true" type="string" /> <property name="createdDate" column="created_date" not-null="true" type="timestamp" insert="false" update="false" /> <property name="createdBy" column="created_by" not-null="true" type="string" update="false" /> </class> </hibernate-mapping> I am added a post-update listener. What it will do is if there any updations perfomed on User then it will be invoked and cahnges will be inserted to audit table. Below is the sample implementation for postupdate event. public void onPostUpdate(PostUpdateEvent event) { LogHelper.info(logger, "Begin - onPostUpdate " + event.getEntity().getClass().getSimpleName()); if (!this.checkForAudit(event.getEntity().getClass().getSimpleName())) { // check do we need to audit it. } // Get Attribute Names String[] attrNames = event.getPersister().getEntityMetamodel() .getPropertyNames(); Object[] oldobjectValue = c Object[] newObjectValue = event.getState(); this.auditDetailsEvent(attrNames, oldobjectValue, newObjectValue); LogHelper.info(logger, "End - onPostUpdate"); // return false; } Here is my requirement. event.getPersister().getEntityMetamodel() .getPropertyNames(); or event.getOldState(); or event.getState(); must return attribute names or value which i can update or insert. Is there any way to control the return values of above one's. Pleas help me on this regard. Thanks, Narendra

    Read the article

  • Implementing rounded corners on slide down navigation menu

    - by Nick
    I am working on the slide down menu you can see here. I have rounded corners on both ul#navigation and ul.subnavigation. When the submenu slides down it is possible to see the border at the bottom of ul.subnavigation overlap with the content of ul#navigation, when I would like it to slide down smoothly, without the 'flicker'. I am aware that this issue is caused by the rounded corners. I need ul.subnavigation to cover the rounded corners at the bottom of ul#navigation when the menu drops down, without seeing the double border-bottom issue. I hope this is clear! Code is below. Thanks, Nick HTML <ul id="navigation"> <li class="dropdown"><a href="#">menu</a> <ul class="sub_navigation"> <li><a href="#">home</a></li> <li><a href="#">help</a></li> <li><a href="#">disable tips</a></li> </ul> </li> </ul> JQUERY $('.dropdown').hover(function() { $(this).find('.sub_navigation').slideToggle(); });? CSS ul#navigation, ul.sub_navigation { margin:0; padding:0; list-style-type:none; min-width:100px; background-color: white; font-size:15px; font-family: Trebuchet MS; text-align: center; -khtml-border-radius: 0 0 5px 5px; -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; border-radius: 0 0 5px 5px; border:1px black solid; border-top:none; } ul.sub_navigation { margin-left:-1px; position: absolute; top:28px; } ul#navigation { float:left; position:absolute; top:0; } ul#navigation li { float:left; min-width:100px; } ul.sub_navigation { position:absolute; display:none; } ul.sub_navigation li { clear:both; } a, a:active, a:visited { display:block; padding:7px; }

    Read the article

  • wcf class implementing multiple service contracts

    - by Archie
    Hello, I have a class TestService which implements two service contracts called IService1 and IService2. But I'm facing a difficulty in implementation. My Code looks as follows: Uri baseAddress = new Uri("http://localhost:8000/ServiceModel/Service"); Uri baseAddress1 = new Uri("http://localhost:8080/ServiceModel/Service1"); ServiceHost selfHost = new ServiceHost(typeof(TestService)); selfHost.AddServiceEndpoint(typeof(IService1), new WSHttpBinding(), baseAddress); selfHost.AddServiceEndpoint(typeof(IService2), new WSHttpBinding(), baseAddress1); ServiceMetadataBehavior smb = new ServiceMetadataBehavior(); smb.HttpGetEnabled = true; selfHost.Description.Behaviors.Add(smb); selfHost.Open(); Console.WriteLine("The service is ready."); Console.WriteLine("Press <ENTER> to terminate service."); Console.WriteLine(); Console.ReadLine(); selfHost.Close(); I'm getting a run time error as: The HttpGetEnabled property of ServiceMetadataBehavior is set to true and the HttpGetUrl property is a relative address, but there is no http base address. Either supply an http base address or set HttpGetUrl to an absolute address. What shall i do about it? Do I realy need two separate endpoints? Thanks.

    Read the article

  • Implementing a scrabble trainer

    - by bstullkid
    Hello, I've recently been playing alot of online scrabble so I decided to make a program that quickly searches through a dictionary of 200,000+ words with an input of up to any 26 letters. My first attempt was fail as it took a while when you input 8 or more letters (just a basic look through dictionary and cancel out a letter if its found kind of thing), so I made a tree like structure containing only an array of 26 of the same structure and a flag to indicate the end of a word, doing that It can output all possible words in under a second even with an input of 26 characters. But it seems that when I input 12 or more letters with some of the same characters repeated i get duplicates; can anyone see why I would be getting duplicates with this code? (ill post my program at the bottom) Also, the next step once the duplicates are weeded out is to actually be able to input the letters on the game board and then have it calculate the best word you can make on a given board. I am having trouble trying to figure out a good algorithm that can analyze a scrabble board and an input of letters and output a result; the possible words that could be made I have no problem with but actually checking a board efficiently (ie can this word fit here, or here etc... without creating a non dictionary word in the process on some other string of letters) Anyone have a idea for an approach at that? (given a scrabble board, and an input of 7 letters, find all possible valid words or word sets that you can make) lol crap i forgot to email myself the code from my other computer thats in another state... ill post it on monday when I get back there! btw the dictionary im using is sowpods (http://www.calvin.edu/~rpruim/scrabble/ospd3.txt)

    Read the article

  • Tutorial/resource for implementing VM

    - by zaharpopov
    Hello, I want self-education purpose implement a simple virtual machine for a dynamic language, prefer in C language. Something like the Lua VM, or Parrot, or Python VM, but simpler. Are there any good resources/tutorials on achieving this, apart from looking at code and design documentations of the existing VMs? Thanks in advance for your answers and ideas Edit: why close vote? I don't understand - is this not programming. Please comment if there is specific problem with my question.

    Read the article

  • Implementing a command line in perl

    - by abubacker
    I used Term::shellUI module and almost every thing is working as expected but the issue is when I pressed ctrl+c I want to print "Please use ctrl+d to exit the shell" , for that I handle the signal but the message print only after I pressed the new line how to resolve this ! Thanks in advance !

    Read the article

  • Implementing java FixedTreadPool status listener

    - by InsertNickHere
    Hi there, it's about an application which is supposed to process (VAD, Loudness, Clipping) a lot of soundfiles (e.g. 100k). At this time, I create as many worker threads (callables) as I can put into memory, and then run all with a threadPool.invokeAll(), write results to file system, unload processed files and continue at step 1. Due to the fact it's an app with a GUI, i don't want to user to feel like the app "is not responding" while processing all soundfiles. (which it does at this time cause invokeAll is blocking). Im not sure what is a "good" way to fix this. It shall not be possible for the user to do other things while processing, but I'd like to show a progress bar like "10 of 100000 soundfiles are done". So how do I get there? Do I have to create a "watcher thread", so that every worker hold a callback on it? I'm quite new to multi threading, and don't get the idea of such a mechanisem.. If you need to know: I'm using SWT/JFace. Regards, InsertNickHere

    Read the article

  • Implementing a logging library in .NET with a database as the storage medium

    - by Dave
    I'm just starting to work on a logging library that everyone can use to keep track of any sort of system information while the user is running our application. The simplest example so far is to track Info, Warnings, and Errors. I want all plugins to be able to use this feature, but since each developer might have a different idea of what's important to report, I want to keep this as generic as possible. In the C++ world, I would normally use something like a stl::pair<string,string> to act as a key value pair structure, and have a stl::list of these to act as a "row" in the log. The log cache would then be a list<list<pair<string,string>>> (ugh!). This way, the developers can use a const string key like INFO, WARNING, ERROR to have a consistent naming for a column in the database (for SELECTing specific types of information). I'd like the database to be able to deal with any number of distinct column names. For example, John might have an INFO row with a column called USER, and Bill might have an INFO row with a column called FILENAME. I want the log viewer to be able to display all information, and if one report doesn't have a value for INFO / FILENAME, those fields should just appear blank. So one option is to use List<List<KeyValuePair<String,String>>, and the another is to have the log library consumer somehow "register" its schema, and then have the database do an ALTER TABLE to handle this situation. Yet another idea is to have a table that's just for key value pairs, with a foreign key that maps the key value pairs back to the original log entry. I obviously don't want logging to bog down the system, so I only lock the log cache to make a copy of the data (and remove the already-copied data), then a background thread will dump the information to the database. My specific questions regarding this are: Do you see any performance issues? In other words, have you ever tried something like this and found that certain things just don't work well in practice? Is there a more .NETish way to implement the key value pairs, other than List<List<KeyValuePair<String,String>>>? Even if there is a way to do #2 better, is the ALTER TABLE idea I proposed above a Bad Thing? Would you recommend multiple databases over a single one? I don't yet have an idea of how frequently the log would get written to, but we ideally would like to have lots of low level information. Perhaps there should be a DB with a fixed schema only for the low level stuff, and then another DB that's more flexible for reporting information back to users.

    Read the article

  • Why does implementing ObservableCollection crash my silverlight application?

    - by Sudeep
    Hi, I have a combobox whose ItemsSource property is bound to an ObservableCollection property and its SelectedIndex property is bound to an integer property respectively. <ComboBox Name="cmbDealt" ItemsSource="{Binding Path=DealList, Mode=TwoWay}" SelectedIndex="{Binding Mode=TwoWay, Path=DealIndex}"></ComboBox> <CheckBox IsChecked="{Binding Mode=TwoWay, Path=SomeCondition}" Content="Some Condition"></CheckBox> My data structure looks like private ObservableCollection<string> m_DealList = null; private int m_DealIndex = 0; private bool m_SomeCondition = false; public ObservableCollection<string> DealList { get { if (m_DealList == null) m_DealList = new ObservableCollection<string>(); else m_DealList.Clear(); if (m_SomeCondition) { m_DealList.Add("ABC"); m_DealList.Add("DEF"); } else { m_DealList.Add("UVW"); m_DealList.Add("XYZ"); } return m_DealList; } } public int DealIndex { get { return m_DealIndex; } set { if (value != -1) { m_DealIndex = value; } } } public bool SomeCondition { get { return m_SomeCondition; } set { m_SomeCondition = value; OnPropertyChanged("DealList"); OnPropertyChanged("DealIndex"); } } Now the application loads successfully. However, when the user changes the SelectedIndex of the ComboBox to 1 from 0 and then checks the checkbox (so as to call the "DealIndex" property changed event), the application crashes. I am not sure why this could be happening. Can someone shed some light and propose a solution? TIA... Sudeep

    Read the article

  • Implementing Multitasking on an iPhone/iOS4 Web App

    - by Peter Watts
    I am looking to build a web app that implements background audio and fast app switching. These features work out of the box, when run as regular Safari web pages, but as soon as you add the web-app-capable tag, and try to run in full screen mode, this functionality breaks. I did some testing and even the most basic web app will reload every time when you switch back to it. And seeing as it's a web app, we can't exactly implement the multitasking API. Has anyone found a work around? This isn't a deal-breaker, as you can just avoid full screen mode, but then you also lose the ability to use your own icon in the app switch tray. Perhaps this explains a lack of full screen mode in YouTube's new web app....

    Read the article

  • JPanel: both implementing my own paintComponent() and rendering children doesn't work

    - by Paul Marshall
    I'm extending a JPanel to display a game board, and adding a JEditorPane at the bottom to hold some status text. Unfortunately, the game board renders just fine, but the JEditorPane is just a blank gray area until I highlight the text in it, when it will render whatever text is highlighted (but not the rest). If I'm understanding Swing right, it should work, because super.paintComponent(g) should render the other children (i.e., the JEditorPane). Tell me, o great stackoverflow, what bonehead mistake am I making? public GameMap extends JPanel { public GameMap() { JEditorPane statusLines = new JEditorPane("text/plain","Stuff"); this.setLayout(new BoxLayout(this,BoxLayout.PAGE_AXIS)); this.add(new Box.Filler(/*enough room to draw my game board*/)); this.add(statusLines); } public void paintComponent(Graphics g){ super.paintComponent(g); for ( all rows ){ for (all columns){ //paint one tile } } } }

    Read the article

  • Implementing backspace using outtextxy in graphics.h in c

    - by vinit
    Yersterday I was trying to create a text editor in c. but i am facing a problem with the backspace character. and when i am trying to print this with outtextxy a strange character is appearing. i tried following code for this backspace: str[2]="\b "; outtextxy(x,y,str); This is working fine under textmode but not working under graphics mode. If you r having any solution please help me I hav to submit my program on monday. And Thanks in advance

    Read the article

  • Best practice for implementing "tab support" in facebook App

    - by simple
    I started to stumble Facebook App development and can't get my Application to be added as a tab in the fan page, I think my Application should have a support for being able to be installed as a tab? what is the best practice the one I found on docs - Profile.setFBML method, but they are saying that it will be removed soon, can't get what is the alternative =) , so how should I implement the tab support for my App

    Read the article

  • Implementing Qt File Dialog with a Different File System Library (boost)

    - by knight
    Hi, I am writing an application which requires me to use another file system and file engine handlers and not the qt's default ones. Basically what I want to be able to do is to use qt's file dialog but have an underlying file system handler (for example built using boost file system library) of mine handling all the operations with regards to file and directory operations within that dialog. I have already written a custom file engine which handles some of the operations but I am now stuck with Qt's file system model and the file system watcher engine, as I need to have the signals transmitted for this custom file engine. Seems like I have a daunting task ahead. Am I heading in the right direction? Is there any other simpler way that I could implement this? Can anyone give me any idea on how to proceed. I was thinking of looking into proxy models but not sure if that would work. Thanks in advance for any help.

    Read the article

  • Naive question about implementing RSS

    - by interstar
    I have a naive question about RSS feeds. I have a series of timed events which appear on my site and that I make available as an RSS feed for other applications to import. Who is typically responsible for truncating this feed? Over the next year, I can see my feed having thousands of items. Should the URL mysite.com/rss always return all items? And leave it to the readers to just show the most recent? Or is it more customary that I only return, say, the top 50? Expecting the readers to cache older items? (And, if so, is there a convention for readers to ask the server for the "next page")? What is the typical behaviour of something like FriendFeed when it pulls in an RSS stream?

    Read the article

  • Implementing sub fields in a PropertyGrid

    - by evolve
    Alright so my terminology when it comes to C# isn't great, so I'll attempt to explain this with a small example. If you create a class which you are using within a PropertyGrid and you have the following values: class Test { public Point example { get; set; } } This will produce a PropertyGrid which has an expandable object "example" which has fields X and Y in order to create a "Point". I'm attempting to create an object "name" which has fields "firstname" and "lastname", so I have: class Test { public Name example { get; set; } } public struct Name { public string firstname { get; set; } public string lastname { get; set; } } This however isn't working as intended. I think I need to override some method(s) in order to get this working, however since I don't really have the terminology down for PropertyGrids it is difficult for me to find a solution. Any help would be great.

    Read the article

  • Regardign implementing Custom ExpressionBuilder.

    - by Puneet Dudeja
    I want to pass the "DisplayName" column value returned from SqlDataSource's Select command to a custom function and then the return value to be assigned to "DataTextField" property of DropDownList. I know, I can do this using "CustomExpressionBuilder", I have tried but if I use following: DataTextField="<%$ MyCustomExpressionBuilder:DisplayName %>" I do not receive the value of the DisplayName field in the overriden "GetCodeExpression" method, but the literal value "DisplayName". How can I do this? Please help me. <asp:DropDownList ID="drpCourseType" runat="server" DataSourceID="sqldsCourses" DataTextField="DisplayName" DataValueField="Type" CssClass="FilterDropdown"> </asp:DropDownList> <asp:SqlDataSource runat="server" ID="sqldsCourses" SelectCommand="SELECT Type,DisplayName FROM CourseTypes ORDER BY OrderID" ConnectionString="<%$ ConnectionStrings:connectionString %>"></asp:SqlDataSource>

    Read the article

  • Error implementing Dynamic Tab with ListView within each Tab - Tabs don't show up

    - by Jon
    I am trying to create a dyanmic tab application that has tabs on the left for each type of Food (e.g. Pasta, Dairy, etc. including those dynamically defined by user) and for each tab, have a listview connected to a SQLite database that updates. This is in the onCreate method: setContentView(R.layout.foodCabinet_layout); dbHelper = new FoodStorageDBHelper(this); dbHelper.open(); Cursor foodTypes = dbHelper.getAllFoodTypes(); ArrayList<String> typeOfFood = new ArrayList<String>(); typeOfFoods.add(foodTypes.getString(1)); while(foodTypes.moveToNext()){ typeOfFoods.add(foodTypes.getString(1)); } final TabHost tbh = (TabHost)findViewById(R.id.food_tabhost_cabinet); tbh.setup(); for(final String s : typeOfFood){ TabSpec nts = tbh.newTabSpec(s); nts.setIndicator(s.replace('_', ' ')); nts.setContent(new TabHost.TabContentFactory(){ public View createTabContent(String tag) { ListView foodCabinetLV = new ListView(FoodCabinet.this); Cursor mCursor = dbHelper.getAllFoodsWithType(s); // Create an array to specify the fields we want to display in the list (only TITLE) String[] from = new String[]{FoodStorageDBHelper.KEY_NAME, FoodStorageDBHelper.KEY_YEAR,FoodStorageDBHelper.KEY_RANK}; // and an array of the fields we want to bind those fields to (in this case just text1) int[] to = new int[]{R.id.childname,R.id.childyear,R.id.childrank}; // Now create a simple cursor adapter and set it to display SimpleCursorAdapter notes = new SimpleCursorAdapter(FoodCabinet.this, R.layout.food_row, mCursor, from, to); foodCabinetLV.setAdapter(notes); startManagingCursor(mCursor); foodCabinetLV.setOnItemClickListener( new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView arg0, View arg1, int arg2, long arg3) { Intent i = new Intent(); i.setClass(arg0.getContext(), EditFoodDialog.class); i.putExtra(FoodStorageDBHelper.KEY_ROWID, Long.toString(arg3)); startActivityForResult(i, LoadFoodOrganizer.ACTIVITY_EDIT); } }); return foodCabinetLV; } }); } For some reason, it doesn't show anything... it's a blank screen. Any help would be very much appreciated. Let me know! Thanks! Jon

    Read the article

  • Implementing Skip List in C++

    - by trikker
    [SOLVED] So I decided to try and create a sorted doubly linked skip list... I'm pretty sure I have a good grasp of how it works. When you insert x the program searches the base list for the appropriate place to put x (since it is sorted), (conceptually) flips a coin, and if the "coin" lands on a then that element is added to the list above it(or a new list is created with element in it), linked to the element below it, and the coin is flipped again, etc. If the "coin" lands on b at anytime then the insertion is over. You must also have a -infinite stored in every list as the starting point so that it isn't possible to insert a value that is less than the starting point (meaning that it could never be found.) To search for x, you start at the "top-left" (highest list lowest value) and "move right" to the next element. If the value is less than x than you continue to the next element, etc. until you have "gone too far" and the value is greater than x. In this case you go back to the last element and move down a level, continuing this chain until you either find x or x is never found. To delete x you simply search x and delete it every time it comes up in the lists. For now, I'm simply going to make a skip list that stores numbers. I don't think there is anything in the STL that can assist me, so I will need to create a class List that holds an integer value and has member functions, search, delete, and insert. The problem I'm having is dealing with links. I'm pretty sure I could create a class to handle the "horizontal" links with a pointer to the previous element and the element in front, but I'm not sure how to deal with the "vertical" links (point to corresponding element in other list?) If any of my logic is flawed please tell me, but my main questions are: How to deal with vertical links and whether my link idea is correct Now that I read my class List idea I'm thinking that a List should hold a vector of integers rather than a single integer. In fact I'm pretty positive, but would just like some validation. I'm assuming the coin flip would simply call int function where rand()%2 returns a value of 0 or 1 and if it's 0 then a the value "levels up" and if it's 0 then the insert is over. Is this incorrect? How to store a value similar to -infinite? Edit: I've started writing some code and am considering how to handle the List constructor....I'm guessing that on its construction, the "-infinite" value should be stored in the vectorname[0] element and I can just call insert on it after its creation to put the x in the appropriate place.

    Read the article

  • Implementing a scalable and high-performing web app

    - by Christopher McCann
    I have asked a few questions on here before about various things relating to this but this is more of a consolidation question as I would like to check I have got the gist of everything. I am in the middle of developing a social media web app and although I have a lot of experience coding in Java and in PHP I am trying things a bit different this time. I have modularised each component of the application. So for example one component of the application allows users to private message each other and I have split this off into its own private messaging service. I have also created a user data service the purpose of which is to return data about the user for example their name, address, age etc etc from the database. Their is also another service, the friends service, which will work off the neo4j database to create a social graph. My reason for doing all this is to allow me up to update seperate modules when I need to - so while they mostly all run off MySQL right now I could move one to Cassandra later if I thought it approriate. The actual code of the web app is really just used for the final construction. The modules behind it dont really follow any strict REST or SOAP protocol. Basically each method on our API is turned into a PHP procedural script. This then may make calls to other back-end code which tends to be OO. The web app makes CURL requests to these pages and POSTs data to them or GETs data from them. These pages then return JSON where data is required. I'm still a little mixed up about how I actually identify which user is logged in at that moment. Do I just use sessions for that? Like if we called the get-messages.php script which equates to the getMessages() method for that user - returning all the private messages for that user - how would the back-end code know which user it is as posting the users ID to the script would not be secure. Anyone could do that and get all the messages. So I thought I would use sessions for it. Am I correct on this? Can anyone spot any other problems with what I am doing here? Thanks

    Read the article

  • Implementing a multi-state planner

    - by MoominTroll
    I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this: Currently this works by rendering checkboxes within the table, picking up click events in each cell and marking the checkbox and hence the cell appropriately. I'm using the JQuery "click n drag checkbox" plugin from here. However, I've been informed that there could well be more than two states for a given cell (for instance available, unavailable, available in a given circumstance), in which case binding to a checkboxes checked value isnt going to be a lot of help. I've never used javascript or asp.net before and am unsure as to the best way to approach this problem. Ideally I could stick a data structure behind each cell which I could update to a certain state and then get my cell colour by binding to this - however I'm at something as a loss as how to best achieve this.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >