Search Results

Search found 1288 results on 52 pages for 'bert smith'.

Page 12/52 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • JPA / Hibernate checks conditions in merge()

    - by bert
    Working with JPA / Hibernate in an OSIV Web environment is driving me mad ;) Following scenario: I have an entity A that is loaded via JPA and has a collection of B entities. Those B entities have a required field. When the user adds a new B to A by pressing a link in the webapp, that required field is not set (since there is no sensible default value). Upon the next http request, the OSIV filter tries to merge the A entity, but this fails as Hibernate complains that the new B has a required field is not set. javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value Reading the JPA spec, i see no sign that those checks are required in the merge phase (i have no transaction active) I can't keep the collection of B's outside of A and only add them to A when the user presses 'save' (aka entitymanager.persist()) as the place where the save button is does not know about the B's, only about A. Also A and B are only examples, i have similar stuff all over the place .. Any ideas? Do other JPA implementaions behave the same here? Thanks in advance.

    Read the article

  • drupal rules module - add fields to email

    - by bert
    I am looking for the syntax to add node fields to the body of an email. Examples I looked at indicate the the format is: [content_type:content_type_title] However my email arrives with just the string : [content_type:content_type_title] Even better would be a PHP snippet that loads the node and dumps filed title and filed value into the body of the message.

    Read the article

  • add array element to row returned from sql query

    - by bert
    I want to add an additional value into an array before passing it to json_encode function, but I can't get the syntax right. $result = db_query($query); // $row is a database query result resource while ($row = db_fetch_object($result)) { $stack[] = $row; // I am trying to 'inject' array element here $stack[]['x'] = "test"; } echo json_encode($stack);

    Read the article

  • Stopping Filter Display in Dynamic Data Entity Web App

    - by bert
    I'm currently experimenting with the Dynamic Data Entity Web App Project type in VS2008 SP1 and after reading many tutorials which offer helpful advice for problems I so far have no need of a solution to I have fallen at the first hurdle. In the DB I have made my entity model from I decided to start small with a table called "Companies" just to see if I could tweak the display into a satisfactory shape for this small table. The Companies table has a column called "contactid" which leads to a record filled with various contact information in a "contacts" table. The default created Entity Data Model has guessed that One companies could have many contact records. So it tries to be helpful and add a "Contact" filter onto the page that allows you to see all the Companies that share a particular set of contact info indexed by the "Contact Name" field. Unfortunately the contact table is a multi-purpose one that also stores contact info for customers and there are about 1000 times more customers than there are companies. So the Dropdown makes the page load time increase exponentially and produces no benefit. So I'd like to just stop the filter from appearing. Only problem is I don't have a clue how to switch it off. Google is so far proving recalcitrant on the matter so I wondered if anyone in here knew how to get rid of a useless filter.

    Read the article

  • Drupal - how to add add same page to two menus?

    - by bert
    How can I add same callback to 2 different menus? function my_callback_menu(){ $items = array(); $items['my_callback'] = array( 'title' => t('My title'), 'menu_name' => 'menu-my-menu', 'page callback' => 'my_callback', 'access arguments' => array('access content'), ); return $items; }

    Read the article

  • pagerAnchorBuilder - trying to add classes

    - by Bert Murphy
    I'm using Cycle2 to build a carousel gallery and I've run into a little problem regarding styling the pager buttons. What I've gathered is that Cycle2 creates its own pager span tags for each slide which is a bummer becaus I've already styled my the sub-nav markup. This should be a minor issue as long as I can assign individual classes to the spans and change my css accordingly. However, I can't get this to work. TLDR: I was hoping that I could use pagerAnchorBuilder to create individual classes for each span. I can't. Help. The original markup (pre Cycle2) looks like the following: <div id ="sub-nav" class="sub-nav"> <ul> <li><a id="available" class="available" href="#"></a></li> <li><a id="reliable" class="reliable" href="#"></a></li> <li><a id="use" class="use" href="#"></a></li> <li><a id="reports" class="reports" href="#"></a></li> <li class="last"><a id="software" class="software" href="#"></a></li> </ul> </div> With Cycle2 it looks like this (note the addition of the span tags) <div id ="sub-nav" class="sub-nav"> <ul> <li><a id="available" class="available" href="#"></a></li> <li><a id="reliable" class="reliable" href="#"></a></li> <li><a id="use" class="use" href="#"></a></li> <li><a id="reports" class="reports" href="#"></a></li> <li class="last"><a id="software" class="software" href="#"></a></li> </ul> <span class="cycle-pager-active">•</span><span>•</span><span>•</span><span>•</span><span>•</span></nav> </div> Cycle2 $('#sliding-gallery ul').cycle({ fx: 'carousel', carouselVisible: 1, speed: 'fast', timeout: 10000, slides: '>li', next: '.next', prev: '.prev', pager: '.sub-nav', pagerAnchorBuilder: function(idx, slide) { return '.sub-nav span:eq(' + idx + ')'; } });

    Read the article

  • Drupal questions - customizing form_altered modules

    - by bert
    This week I have figured out how to modify form elements in the location module using form_alter and the custom element hook_elements() see: see http://stackoverflow.com/questions/2637052/need-some-tips-on-drupal-form-value I was able to to hide elements using unset eg: unset($element['locpick']['user_latitude']); Also added css with drupal_add_css to hide unwanted groups, and change margins, borders & padding However, I have a few questions - how can I add additional text header between fields? - how can I change input field length? - is it possible to move fields around or put them in a table? reference: http://tinyurl.com/y6ugwtd

    Read the article

  • list arrays in Drupal form

    - by bert
    Is there a better way to find all form elements in a Drupal form than doing a print_r($form)? This dumps excessive amount of information and it is no obvious what to look for.

    Read the article

  • How do I add events to nested server controls? (ASP.Net)

    - by bert
    I am building a custom master page type control i.e. sort of like a datagrid but should be easier to add custom functionality into it. It's going great but part of the desired functionality is to have a paging control that switches on and off and part of that control would be a textbox that displays the current page number and on TextChanged redirects to the new page of the dataset. The problem I'm having is that technically the textbox which has its event fired is embedded in a control that is embedded in the control you actually put on the page sort of like Page  | Display Control  | Paging Control  | Textbox Buried all the way down there the event is not firing. Worse the postback javascript isn't even being written onto the page (Nothing on the page posts back so far this is the only bit that really needs to). I've been trawling around Google for quite a while now and picked up that I need to implement INamingContainer (done) and I need to add the control into the page's control tree (is Pre_Init too late for that? When's a good time to Add the Control to the page?) then the event should fire, apparently. But I've been unable to find an example of best practice on this there are quite a few near misses where people are having button angst but this isn't a button. So can anyone point me in the direction of getting a control embedded in a control embedded in a control added to a page to behave properly?

    Read the article

  • C# dispatcher problem

    - by Bert
    Hi, In the constructor of an object i need to create a WPF mediaElement object: m_videoMedia = new MediaElement(); but the class can also be instantiated from a other thread so i need to use Dispatcher.Invoke(DispatcherPriority.Normal, (Action)(() => { m_videoMedia = new MediaElement(); })); But how can I get the right dispatcher instance in that constructor :s

    Read the article

  • SQL Query to update parent record with child record values

    - by Wells
    I need to create a Trigger that fires when a child record (Codes) is added, updated or deleted. The Trigger stuffs a string of comma separated Code values from all child records (Codes) into a single field in the parent record (Projects) of the added, updated or deleted child record. I am stuck on writing a correct query to retrieve the Code values from just those child records that are the children of a single parent record. -- Create the test tables CREATE TABLE projects ( ProjectId varchar(16) PRIMARY KEY, ProjectName varchar(100), Codestring nvarchar(100) ) GO CREATE TABLE prcodes ( CodeId varchar(16) PRIMARY KEY, Code varchar (4), ProjectId varchar(16) ) GO -- Add sample data to tables: Two projects records, one with 3 child records, the other with 2. INSERT INTO projects (ProjectId, ProjectName) SELECT '101','Smith' UNION ALL SELECT '102','Jones' GO INSERT INTO prcodes (CodeId, Code, ProjectId) SELECT 'A1','Blue', '101' UNION ALL SELECT 'A2','Pink', '101' UNION ALL SELECT 'A3','Gray', '101' UNION ALL SELECT 'A4','Blue', '102' UNION ALL SELECT 'A5','Gray', '102' GO I am stuck on how to create a correct Update query. Can you help fix this query? -- Partially working, but stuffs all values, not just values from chile (prcodes) records of parent (projects) UPDATE proj SET proj.Codestring = (SELECT STUFF((SELECT ',' + prc.Code FROM projects proj INNER JOIN prcodes prc ON proj.ProjectId = prc.ProjectId ORDER BY 1 ASC FOR XML PATH('')),1, 1, '')) The result I get for the Codestring field in Projects is: ProjectId ProjectName Codestring 101 Smith Blue,Blue,Gray,Gray,Pink ... But the result I need for the Codestring field in Projects is: ProjectId ProjectName Codestring 101 Smith Blue,Pink,Gray ... Here is my start on the Trigger. The Update query, above, will be added to this Trigger. Can you help me complete the Trigger creation query? CREATE TRIGGER Update_Codestring ON prcodes AFTER INSERT, UPDATE, DELETE AS WITH CTE AS ( select ProjectId from inserted union select ProjectId from deleted )

    Read the article

  • Read a text file and transfer contents to mysql database

    - by Jack Brown
    I need a php script to read a .txt file. The content of the text file are like this: data.txt 145|Joe Blogs|17/03/1954 986|Jim Smith|12/01/1976 234|Paul Jones|19/07/1923 098|James Smith|12/09/1998 234|Carl Jones|01/01/1925 These would then get stored into a database like this DataID |Name |DOB 234 |Carl Jones|01/01/1925 I would be so grateful if someone could give me script to achieve this.

    Read the article

  • LINQ to SQL select distinct from multiple colums

    - by Morron
    Hi, I'm using LINQ to SQL to select some columns from one table. I want to get rid of the duplicate result also. Dim customer = (From cus In db.Customers Select cus.CustomerId, cus.CustomerName).Distinct Result: 1 David 2 James 1 David 3 Smith 2 James 5 Joe Wanted result: 1 David 2 James 3 Smith 5 Joe Can anyone show me how to get the wanted result? Thanks.

    Read the article

  • SQL Replace Into question

    - by Matt
    With Replace Into, if I have two fields. FirstName LastName. The table has John Smith in it, if I was to run REPLACE INTO tblNames (FirstName, LastName) VALUES (John, Jones) Would that replace Smith with Jones, or create a new name? What determines if its an Update or and Insert?

    Read the article

  • preg_replace to capitalize a letter after a quote

    - by Summer
    I have names like this: $str = 'JAMES "JIMMY" SMITH' I run strtolower, then ucwords, which returns this: $proper_str = 'James "jimmy" Smith' I'd like to capitalize the second letter of words in which the first letter is a double quote. Here's the regexp. It appears strtoupper is not working - the regexp simply returns the unchanged original expression. $proper_str = preg_replace('/"([a-z])/',strtoupper('$1'),$proper_str); Any clues? Thanks!!

    Read the article

  • How to bulk insert from CSV when some fields have new line character?

    - by z-boss
    I have a CSV dump from another DB that looks like this (id, name, notes): 1001,John Smith,15 Main Street 1002,Jane Smith,"2010 Rockliffe Dr. Pleasantville, IL USA" 1003,Bill Karr,2820 West Ave. The last field may contain carriage returns and commas, in which case it is surrounded by double quotes. I use this code to import CSV into my table: BULK INSERT CSVTest FROM 'c:\csvfile.csv' WITH ( FIELDTERMINATOR = ',', ROWTERMINATOR = '\n' ) SQL Server 2005 bulk insert cannot figure out that carriage returns inside quotes are not row terminators. How to overcome?

    Read the article

  • Potential issues using member's "from" address and the "sender" header

    - by Paul Burney
    Hi all, A major component of our application sends email to members on behalf of other members. Currently we set the "From" address to our system address and use a "Reply-to" header with the member's address. The issue is that replies from some email clients (and auto-replies/bounces) don't respect the "Reply-to" header so get sent to our system address, effectively sending them to a black hole. We're considering setting the "From" address to our member's address, and the "Sender" address to our system address. It appears this way would pass SPF and Sender-ID checks. Are there any reasons not to switch to this method? Are there any other potential issues? Thanks in advance, -Paul Here are way more details than you probably need: When the application was first developed, we just changed the "from" address to be that of the sending member as that was the common practice at the time (this was many years ago). We later changed that to have the "from" address be the member's name and our address, i.e., From: "Mary Smith" <[email protected]> With a "reply-to" header set to the member's address: Reply-To: "Mary Smith" <[email protected]> This helped with messages being mis-categorized as spam. As SPF became more popular, we added an additional header that would work in conjunction with our SPF records: Sender: <[email protected]> Things work OK, but it turns out that, in practice, some email clients and most MTA's don't respect the "Reply-To" header. Because of this, many members send messages to [email protected] instead of the desired member. So, I started envisioning various schemes to add data about the sender to the email headers or encode it in the "from" email address so that we could process the response and redirect appropriately. For example, From: "Mary Smith" <[email protected]> where the string after "messages" is a hash representing Mary Smith's member in our system. Of course, that path could lead to a lot of pain as we need to develop MTA functionality for our system address. I was looking again at the SPF documentation and found this page interesting: http://www.openspf.org/Best_Practices/Webgenerated They show two examples, that of evite.com and that of egreetings.com. Basically, evite.com is doing it the way we're doing it. The egreetings.com example uses the member's from address with an added "Sender" header. So the question is, are there any potential issues with using the egreetings method of the member's from address with a sender header? That would eliminate the replies that bad clients send to the system address. I don't believe that it solves the bounce/vacation/whitelist issue since those often send to the MAIL FROM even if Return Path is specified.

    Read the article

  • sql query - how to count values in a row separately?

    - by n00b0101
    I have a table that looks something like this: id | firstperson | secondperson 1 | jane doe | 2 | bob smith | margie smith 3 | master shifu | madame shifu 4 | max maxwell | I'm trying to count all of the firstpersons + all of the secondpersons, if the secondpersons field isn't blank... Is there a way to do that?

    Read the article

  • Convert json data to javascript array - in multi-dimensional sense

    - by AW-GWTF899
    I have a json array say { "People": { "Person": [ {"FirstName": "John", "LastName": "Smith"} {"FirstName": "Joe", "LastName": "Bloggs"} {"FirstName": "Wendy", "LastName": "Deng"} ] } } And I want to convert this into a javascript array (something like this) var persons = [ ["FirstName", "John", "LastName", "Smith"], ["FirstName", "Joe", "LastName", "Bloggs"], ["FirstName", "Wendy", "LastName": "Deng"] ]; How do I accomplish this? Hope my question makes sense and I realise the javascript array initialization may not be the correct way to put it. Thanks.

    Read the article

  • excel change 4 rows / 48 col to 48 rows / 4 col

    - by GoodOlPete
    Hi, I've selected 4 database records of 48 fields into excel as below: FirstName LastName Age Address1 ....................... Andy smith 23 53 high st billy ball 43 23 the avenue charles brown 76 rose cottage dave green 43 station rd I want to display them as firstname andy billy charles dave lastname smith ball brown green age 23 43 76 43 address1.............................. Can anyone suggest how to do this?

    Read the article

  • How to merge two single column csv files with linux commands

    - by user1328191
    I was wondering how to merge two single column csv files into one file where the resulting file will contain two columns. file1.csv    first_name    chris    ben    jerry file2.csv    last_name    smith    white    perry result.csv    first_name,last_name    chris,smith    ben,white    jerry,perry Thanks

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >