Daily Archives

Articles indexed Thursday May 13 2010

Page 23/119 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • PHP syntax for postgresql Mixed-case table names

    - by yam
    I have a code below: <?php require "institution.php" /* in this portion, query for database connection is executed, and */ $institution= $_POST['institutionname']; $sCampID = 'SELECT ins_id FROM institution where ins_name= '$institution' '; $qcampID = pg_query($sCampID) or die("Error in query: $query." . pg_last_error($connection)); /* this portion outputs the ins_id */ ?> My database before has no mixed-case table names, that's why when I run this query, it shows no error at all. But because I've changed my database for some reasons, and it contains now mixed-case table names, i have to change the code above into this one: $sCampID = 'SELECT ins_id FROM "Institution" where ins_name= '$institution' '; where the Institution has to be double quoted. The query returned parse error. When i removed this portion: where ins_name= '$institution', no error occured. My question is how do I solve this problem where the table name which contains a mixed-case letter and a value stored in a variable ($institution in this case) will be combined in a single select statement? Your answers and suggestions will be very much appreciated.

    Read the article

  • How to change the cursor blink color?

    - by Nitz
    I don't know this is possible or not? But i want to change the this cursor blink color...which is normally black.... i am making one java-swing based project and in that...one of the requirement is to change the color of the cursor blink.... Is this possible?

    Read the article

  • Why does jquery button take a second to refresh after updating a page using ajax

    - by oo
    when i refresh a part of a webpage that has a jquery ui button, it seems like I have to call: $(":button").button(); again or it shows up as a regular button. Thats fine but when i do this, it still shows up as a regular button for a split second before converting to the styling of the jquery theme. is there anyway to avoid this as it looks a bit messy. NOTE: i noticed that this is for anything that i am theming using jquery ui like autocomplete, button, etc. so its not button specific issue.

    Read the article

  • finally and return

    - by abson
    In the below example, class ex8 { public void show() { try { int a=10/0; return;} catch(ArithmeticException e) { System.out.println(e); return ;} finally { System.out.println("Finally"); } } public static void main(String[] args) { new ex8().show(); } } the output is: java.lang.ArithmeticException: / by zero Finally How is it that Finally gets printed in spite of return statement in catch?

    Read the article

  • C syntax or binary optimized syntax?

    - by Dpp
    Let's take an simple example of two lines supposedly doing the same thing: if (value = 96 || value < 0) ... or if (value & ~ 95) ... Say 'If's are costly in a loop of thousands of iterations, is it better to keep with the traditional C syntax or better to find a binary optimized one if possible?

    Read the article

  • best way to store list of websites on iphone app

    - by Jonathan
    By best I mean most efficient. So don't go on about subjectiveness. I have a list of websites and I want to store the list on the iphone locally, there must be an URL, title and a small image (like 32x32 max image size). I don't think I should be using CoreData for this. Should I be using a plist?

    Read the article

  • Using a4j:support 's onchange event with h:selectOneMenu

    - by user339637
    <h:selectOneMenu id="selectOneMenu" value="#{Bean1.val1}" > <f:selectItems value="#{Bean1.selectItems}"/> <a4j:support event="onchange" action="#{Bean1.onSelectOneMenuChange}" reRender="textbox1 , textbox2 , textbox3, textbox4" /> </h:selectOneMenu> <h:inputText id="textbox1" value="#{Bean1.textbox1}"> </h:inputText> <h:inputText id="textbox2" value="#{Bean1.textbox2}"> </h:inputText> <h:inputText id="textbox3" value="#{Bean1.textbox3}"> </h:inputText> <h:inputText id="textbox4" value="#{Bean1.textbox4}"> </h:inputText> Bean1.onSelectOneMenuChange() will change the value of Bean1.textbox1 , Bean1.textbox2,Bean1.textbox3 and Bean1.textbox4 depending on the value selected (Bean1.val1) .Sometimes , it will change all the textbox value and sometimes it will only changes some textbox value. When users change the value in the "selectOneMenu" drop down list control , the JSF framework will not call the update model values phase but call the Bean1.onSelectOneMenuChange() directly. After that , the all the textbox are reRender. Because the update model values phase is not called , the values entered by the user is never set the the Bean1 and the original value is shown in the textbox after reRender . So I want to ask: How can I manually call the update model values phase inside Bean1.onSelectOneMenuChange() ?How can I get the value input input by the users inside Bean1.onSelectOneMenuChange() and set it to the corresponding fields of the Bean1 ? 2.Another approach is that only reRender those textbox whose values are updated inside the Bean1.onSelectOneMenuChange() .However , there are many cases . For example , a value will change all the textbox value and a values may only change some textbox value.How can I reRender conditionally ? What method is more prefer for maintainability?

    Read the article

  • UISplitView show different views in the detail pane

    - by Mark
    How can I change the view in the Details pane of the UISplitView so that its a completely different view? Im having a fair amount of trouble understanding how its all wired up and where things should go at the moment, could someone please enlighten me? What I would love to be able to do is to show a specific view based on what the user has selected in the UITableView on the left pane (this view could be an image, or a more complex view of a news article, etc... many different options) then when the user turns the iPad into portrait view, that view that was in the details pane changes to be its equivalent portrait view version. Does this make sense? How on earth would I do that? Just to brainstorm, here is what I was thinking: Create a Split View project Create 2 NIBs for each view: (with accompanying view controllers???) * PortraitNewsStory * LandscapeNewsStory * PortraitImageBrowser * LandscapeImageBrowser * etc... Create a UISplitView control using XCode Capture when a user rotates the iPad (should this be done in the RootViewController.m ?) Change the view of the DetailViewController how should I do this? profit??? Thanks Mark

    Read the article

  • Dynamic domain methods missing from grails service when injected into java service in grails app.

    - by Gordon C
    I had the idea that I would write my GroovyDao as a grails service. Next I would write a MyJavaService in java and locate it in the java sources dir in my grails app. MyJavaService contains a instance reference to groovyDao for spring injection. I would wire up in resources.groovy the MyJavaService with a groovyDao = ref("GroovyDao"). Everything starts up fine. However if I make call to MyJavaService any Domain method like Domain.list() returns a Method not found error. Any help is appreciated.

    Read the article

  • TFS Notifications - change title

    - by Sebastian
    On action WorkItemChangeEvent TFS sending an email. Title of maile looks like: [Project] [Work Item Created] [Type of Work Item][Id] [Title of WorkItem] I would like to change this title. Can I do this ? I can't find it in WorkItemChangedEvent.xsl

    Read the article

  • Deep copy objects from different namespaces

    - by Wasim
    Hi all, I have the following situation: I have class User with the follwing properies : public class User { string user name ; List <Contact> contacts ; List <BookMark> book marks; . . . } I have the same class in a different namespace , with some different properties . BWT , it's the same situation of it's classes (Contact) and (BookMark). I need to make a deep copy of the same properties from the two classes . Actually , I arrive to this situation by having an Entity Framework edmx file . I created the first database (SQL server 2008) from this model . And copied he same edmx file to another project and created the database with SQL CE db. Now I get the first data model objects by WCF service and need to persist them in the local database in my application . The objects are the same but there are some changs because of the modeling issue with a different databse. Do you have any workarround about this assue. Thanks in advance ...

    Read the article

  • HTML input text box vs CakePHP Automagic Form Elements

    - by kwokwai
    Hi all, I was manually creating a simple form with one input text box field like this: <form action="/user/add" method="post"> <input type="text" name="data[user_id]" value="1"> But when I call $this->model->save($this->data) in the Controller, nothing was saved to the Table. Only when I used this and the data in the field was written to the database successfully: $form->create(null, array('url' => '/user/add')); echo $form->input('user_id', array('label' => 'User ID', 'value' => '1'));

    Read the article

  • Copying metadata over a database link in Oracle 10g

    - by Tunde
    Thanks in advance for your help experts. I want to be able to copy over database objects from database A into database B with a procedure created on database B. I created a database link between the two and have tweaked the get_ddl function of the dbms_metadata to look like this: create or replace function GetDDL ( p_name in MetaDataPkg.t_string p_type in MetaDataPkg.t_string ) return MetaDataPkg.t_longstring is -- clob v_clob clob; -- array of long strings c_SYSPrefix constant char(4) := 'SYS_'; c_doublequote constant char(1) := '"'; v_longstrings metadatapkg.t_arraylongstring; v_schema metadatapkg.t_string; v_fullength pls_integer := 0; v_offset pls_integer := 0; v_length pls_integer := 0; begin SELECT DISTINCT OWNER INTO v_schema FROM all_objects@ENTORA where object_name = upper(p_name); -- get DDL v_clob := dbms_metadata.get_ddl(p_type, upper(p_name), upper(v_schema)); -- get CLOB length v_fullength := dbms_lob.GetLength(v_clob); for nIndex in 1..ceil(v_fullength / 32767) loop v_offset := v_length + 1; v_length := least(v_fullength - (nIndex - 1) * 32767, 32767); dbms_lob.read(v_clob, v_length, v_offset, v_longstrings(nIndex)); -- Remove table’s owner from DDL string: v_longstrings(nIndex) := replace( v_longstrings(nIndex), c_doublequote || user || c_doublequote || '.', '' ); -- Remove the following from DDL string: -- 1) "new line" characters (chr(10)) -- 2) leading and trailing spaces v_longstrings(nIndex) := ltrim(rtrim(replace(v_longstrings(nIndex), chr(10), ''))); end loop; -- close CLOB if (dbms_lob.isOpen(v_clob) > 0) then dbms_lob.close(v_clob); end if; return v_longstrings(1); end GetDDL; so as to remove the schema prefix that usually comes with metadata. I get a null value whenever I run this function over the database link with the following queries. select getddl( 'TABLE', 'TABLE1') from user_tables@ENTORA where table_name = 'TABLE1'; select getddl( 'TABLE', 'TABLE1') from dual@ENTORA; t_string is varchar2(30) t_longstring is varchar2(32767) and type t_ArrayLongString is table of t_longstring I would really appreciate it if any one could help. Many thanks.

    Read the article

  • Professional way to write project documentation

    - by EugeneP
    What tools and standards do you use to describe your project, database, modules, classes, their interaction for programmers, let's say after the project is finished. Do you use UML? Are there enterprise standards for Java developers, how to write such a documentation let's say from SUN? Are there specific tools that simplify this documentation process & compilation of neccessary docs. If there are good books on project documenting process, please give me links to Amazon.

    Read the article

  • unable to load library at runtime in android application

    - by Addy
    Hi. I m working on android application in which I used JNI for native c code. I build this application on android 2.0 version and ndkr3. and its work fine. Now when I changed the android sdk version 1.5 and api version 3 I faced problem of unable to open library libtest_demo.so. 05-13 16:54:23.603: INFO/dalvikvm(1211): Unable to dlopen(/data/data/org.abc.test_demo/lib/libtest_demo.so): Cannot find library I put the libtest_demo.so file at the same place /data/data/org.abc.test_demo/lib/libtest_demo.so but still problem arise. please help me..

    Read the article

  • trying to append a list, but something breaks

    - by romunov
    I'm trying to create an empty list which will have as many elements as there are num.of.walkers. I then try to append, to each created element, a new sub-list (length of new sub-list corresponds to a value in a. When I fiddle around in R everything goes smooth: list.of.dist[[1]] <- vector("list", a[1]) list.of.dist[[2]] <- vector("list", a[2]) list.of.dist[[3]] <- vector("list", a[3]) list.of.dist[[4]] <- vector("list", a[4]) I then try to write a function. Here is my feeble attempt that results in an error. Can someone chip in what am I doing wrong? countNumberOfWalks <- function(walk.df) { list.of.walkers <- sort(unique(walk.df$label)) num.of.walkers <- length(unique(walk.df$label)) #Pre-allocate objects for further manipulation list.of.dist <- vector("list", num.of.walkers) a <- c() # Count the number of walks per walker. for (i in list.of.walkers) { a[i] <- nrow(walk.df[walk.df$label == i,]) } a <- as.vector(a) # Add a sublist (length = number of walks) for each walker. for (i in i:num.of.walkers) { list.of.dist[[i]] <- vector("list", a[i]) } return(list.of.dist) } > num.of.walks.per.walker <- countNumberOfWalks(walk.df) Error in vector("list", a[i]) : vector size cannot be NA

    Read the article

  • Creating a MySQL view with an auto-incrementing id column

    - by hmemcpy
    I have a MySQL database from which a view is created. Is is possible to add an auto-incrementing id for each row in the view? I tried CREATE ALGORITHM=UNDEFINED DEFINER=`database_name`@`%` SQL SECURITY DEFINER VIEW `MyView` AS set @i = 0; select @i:=@i+1 as `id` ... but that doesn't work in a View. Sorry, my SQL is weak, any help is appreciated.

    Read the article

  • How can I make a UIButton "flash" (with a glow, or changing its image for a split second)

    - by marty
    I tried just making the image switch to black and then use sleep(1) and have it go back to the original image, but the sleep doesn't work at the right time, and I can't even see the black flash it goes so fast. [blueButton setImage:[UIImage imageNamed:@"black.png"] forState:UIControlStateNormal]; sleep(3); [blueButton setImage:[UIImage imageNamed:@"blue.png"] forState:UIControlStateNormal]; I just want to make it give a indicator to this button. Any thoughts? Thanks.

    Read the article

  • How to track the answers in quiz of camtasia product?

    - by Srikanth
    I am using camtasia product. I have created a video and added quizzing along with the video and produced it. I got flash output. I opened it in the browser and played the video. In the quiz section I have entered the answers. Now my question is how to retrieve these answers??. Where these answers will be stored?

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >