Daily Archives

Articles indexed Thursday April 22 2010

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

  • Oracle: Use of notational parameters which calling functions in insert statements not allowed ?

    - by Sathya
    Why does Oracle 10 R2 not allow use of notational parameters while calling functions in insert statements ? In my app, I'm calling a function in an insert statement. If use notational method of parameter passing, I get an ORA-00907: Missing right parenthesis error message INSERT INTO foo (a, b, c) VALUES (c, F1(P1=>'1', P2=>'2', P3 => '3'), e) Changing the same to position based parameter passing, and the same code gets compiled with no errors. INSERT INTO foo (a, b, c) VALUES (c, F1('1','2','3'), e) Why is this so ?

    Read the article

  • ISAPI filter crashes IIS

    - by test
    Hi, I have created an ISAPI filter. It works fine on develpoment server and SIT server. But in production server it doesn't works. In event viewer the following log : Reporting queued error: faulting application w3wp.exe, version 6.0.3790.2825, faulting module msvcr80.dll, version 8.0.50727.3053, fault address 0x00046039.

    Read the article

  • JPA 2 and Hibernate 3.5.1 MEMBER OF query doesnt work.

    - by Ed_Zero
    I'm trying the following JPQL and it fails misserably: Query query = em.createQuery("SELECT u FROM User u WHERE 'admin' MEMBER OF u.roles"); List users = query.query.getResultList(); I get the following exception: ERROR [main] PARSER.error(454) | <AST>:0:0: unexpected end of subtree java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [SELECT u FROM com.online.data.User u WHERE 'admin' MEMBER OF u.roles] ERROR [main] PARSER.error(454) | <AST>:0:0: expecting "from", found '<ASTNULL>' ... ... Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected end of subtree [SELECT u FROM com.online.data.User u WHERE 'admin' MEMBER OF u.roles] I have Spring 3.0.1.RELEASE, Hibernate 3.5.1-Final and maven to glue dependencies. User class: @Entity public class User { @Id @Column(name = "USER_ID") @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(unique = true, nullable = false) private String username; private boolean enabled; @ElementCollection private Set<String> roles = new HashSet<String>(); ... } Spring configuration: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/tx/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"> <!-- Reading annotation driven configuration --> <tx:annotation-driven transaction-manager="transactionManager" /> <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" /> <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="maxActive" value="100" /> <property name="maxWait" value="1000" /> <property name="poolPreparedStatements" value="true" /> <property name="defaultAutoCommit" value="true" /> </bean> <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> <property name="dataSource" ref="dataSource" /> </bean> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true" /> <property name="databasePlatform" value="${hibernate.dialect}" /> </bean> </property> <property name="loadTimeWeaver"> <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" /> </property> <property name="jpaProperties"> <props> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.current_session_context_class">thread</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.NoCacheProvider</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">false</prop> <prop key="hibernate.show_comments">true</prop> </props> </property> <property name="persistenceUnitName" value="punit" /> </bean> <bean id="JpaTemplate" class="org.springframework.orm.jpa.JpaTemplate"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> </beans> Persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence"> <persistence-unit name="punit" transaction-type="RESOURCE_LOCAL" /> </persistence> pom.xml maven dependencies. <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>${hibernate.version}</version> <type>pom</type> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>${hibernate.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>${hibernate.version}</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${hibernate.version}</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.2</version> <type>jar</type> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-config</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-taglibs</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-acl</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>jsr250-api</artifactId> <version>1.0</version> </dependency> <properties> <!-- Application settings --> <spring.version>3.0.1.RELEASE</spring.version> <hibernate.version>3.5.1-Final</hibernate.version> Im running a unit test to check the configuration and I am able to run other JPQL queries the only ones that I am unable to run are the IS EMPTY, MEMBER OF conditions. The complete unit test is as follows: TestIntegration @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/spring/dataLayer.xml"}) @Transactional @TransactionConfiguration public class TestUserDaoImplIntegration { @PersistenceContext private EntityManager em; @Test public void shouldTest() throws Exception { try { //WORKS Query query = em.createQuery("SELECT u FROM User u WHERE 'admin' in elements(u.roles)"); List users = query.query.getResultList(); //DOES NOT WORK } catch (Exception e) { e.printStackTrace(); throw e; } try { Query query = em.createQuery("SELECT u FROM User u WHERE 'admin' MEMBER OF u.roles"); List users = query.query.getResultList(); } catch (Exception e) { e.printStackTrace(); throw e; } } }

    Read the article

  • SQL SERVER – Create Primary Key with Specific Name when Creating Table

    - by pinaldave
    It is interesting how sometimes the documentation of simple concepts is not available online. I had received email from one of the reader where he has asked how to create Primary key with a specific name when creating the table itself. He said, he knows the method where he can create the table and then apply the primary key with specific name. The attached code was as follows: CREATE TABLE [dbo].[TestTable]( [ID] [int] IDENTITY(1,1) NOT NULL, [FirstName] [varchar](100) NULL) GO ALTER TABLE [dbo].[TestTable] ADD  CONSTRAINT [PK_TestTable] PRIMARY KEY CLUSTERED ([ID] ASC) GO He wanted to know if we can create Primary Key as part of the table name as well, and also give it a name at the same time. Though it would look very normal to all experienced developers, it can be still confusing to many. Here is the quick code that functions as the above code in one single statement. CREATE TABLE [dbo].[TestTable]( [ID] [int] IDENTITY(1,1) NOT NULL, [FirstName] [varchar](100) NULL CONSTRAINT [PK_TestTable] PRIMARY KEY CLUSTERED ([ID] ASC) ) GO Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, Readers Question, SQL, SQL Authority, SQL Constraint and Keys, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • faster way to change xml to array(grails to flex)

    - by Anthony Umpad
    I have a large xml passed from grails to flex. When flex receives the xml, it converts the xml into an associative array object. Given the large xml file, it takes too long to complete the loop, is there any way in flex to make conversion faster? Below is my sample code. <xml> <car> <model>Vios</model> <type>Sedan</type> <color>Blue</color> </car> <car> <model>Camry</model> <type>Luxury</type> <color>Black</color> </car> </xml> *converted to the flex associative array below.* [Vios].type = Sedan .color = Blue [Camry].type = Luxury .color = Black *Below is a code I used in flex to convert the xml to the associative array object* var tempXML=xml.children() var tempArray:Array= new Array() for(var i:int=0;i<tempXML.length();i++) { tempArray[tempXML[i].@model]= new Object(); tempArray[tempXML[i].@model].color = tempXML[i][email protected](); tempArray[tempXML[i].@model].type = tempXML[i][email protected](); }

    Read the article

  • Passing Derived Class Instances as void* to Generic Callbacks in C++

    - by Matthew Iselin
    This is a bit of an involved problem, so I'll do the best I can to explain what's going on. If I miss something, please tell me so I can clarify. We have a callback system where on one side a module or application provides a "Service" and clients can perform actions with this Service (A very rudimentary IPC, basically). For future reference let's say we have some definitions like so: typedef int (*callback)(void*); // This is NOT in our code, but makes explaining easier. installCallback(string serviceName, callback cb); // Really handled by a proper management system sendMessage(string serviceName, void* arg); // arg = value to pass to callback This works fine for basic types such as structs or builtins. We have an MI structure a bit like this: Device <- Disk <- MyDiskProvider class Disk : public virtual Device class MyDiskProvider : public Disk The provider may be anything from a hardware driver to a bit of glue that handles disk images. The point is that classes inherit Disk. We have a "service" which is to be notified of all new Disks in the system, and this is where things unravel: void diskHandler(void *p) { Disk *pDisk = reinterpret_cast<Disk*>(p); // Uh oh! // Remainder is not important } SomeDiskProvider::initialise() { // Probe hardware, whatever... // Tell the disk system we're here! sendMessage("disk-handler", reinterpret_cast<void*>(this)); // Uh oh! } The problem is, SomeDiskProvider inherits Disk, but the callback handler can't receive that type (as the callback function pointer must be generic). Could RTTI and templates help here? Any suggestions would be greatly appreciated.

    Read the article

  • i have problem with include file

    - by user309381
    //this is intializer.php defined('DS')? null :define('DS',DIRECTORY_SEPARATOR); defined('SITE_ROOT')? null : define('SITE_ROOT',DS.'C:',DS.'wamp',DS.'www',DS.'photo_gallery'); defined('LIB_PATH')?null:define('LIB_PATH',SITE_ROOT.DS.'includes'); require_once(LIB_PATH.DS.'datainfo.php'); require_once(LIB_PATH.DS.'function.php'); require_once(LIB_PATH.DS.'session.php'); require_once(LIB_PATH.DS.'database.php'); require_once(LIB_PATH.DS.'user.php'); //this is other file where i call php file // ERROR Use of undefined constant LIB_PATH - assumed 'LIB_PATH' in //C:\wamp\www\photo_gallery\includes\database.php on //Notice: Use of undefined constant DS - assumed 'DS' in //C:\wamp\www\photo_gallery\includes\database.php on include(LIB_PATH.DS."database.php") ?

    Read the article

  • Index was outside the bounds of the array. IndexOutOfRangeException in LINQ to SQL

    - by gtas
    Im getting this exception in the protected virtual void SendPropertyChanged(String propertyName) { if ((this.PropertyChanged != null)) { this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); <---- HERE !!! } } of one recently table association i created, there lots of same associations around the database, and this happened in the 4 specific tables i added. Its 1...* relationship and association is Primary Table - Id (identity auto generated) Foreign PId column int not null. I just dont get it....Im using SqlMetal for generation, i regenerated the schema, rebuild, same. This is causing while inserting row in DevExpress XtraGrid, but i dont think this should be issue, same control with same functionality but for different tables works ok. I use grid's event for append value in a property when the entity creating. I disabled this but same again. Recreated the association. No change, exception occurs. Any ideas?

    Read the article

  • Bi-directional communication with 1 socket - how to deal with collisions?

    - by Zwei Steinen
    Hi, I have one app. that consists of "Manager" and "Worker". Currently, the worker always initiates the connection, says something to the manager, and the manager will send the response. Since there is a LOT of communication between the Manager and the Worker, I'm considering to have a socket open between the two and do the communication. I'm also hoping to initiate the interaction from both sides - enabling the manager to say something to the worker whenever it wants. However, I'm a little confused as to how to deal with "collisions". Say, the manager decides to say something to the worker, and at the same time the worker decides to say something to the manager. What will happen? How should such situation be handled? P.S. I plan to use Netty for the actual implementation. Thank you very much in advance!

    Read the article

  • How can I make PHP display the error instead of giving me 500 Internal Server Error

    - by Rob
    This has never happened before. Usually it displays the error, but now it just gives me a 500 internal server error. Of course before, when it displayed the error, it was different servers. Now I'm on a new server (I have full root, so if I need to configure it somewhere in the php.ini, I can.) Or perhaps its something with Apache? I've been putting up with it by just transferring the file to my other server and running it there to find the error, but that's become too tedious. Is there a way to fix this?

    Read the article

  • Copy an entity in Google App Engine datastore in Python

    - by Gordon Worley
    In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in. How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of the sort I expect and not something else.

    Read the article

  • Overtime culture slowly creeping in - How do I handle this?

    - by bobsmith123
    Our company was one of the very few companies that did not enforce overtime. As such, all my team members promptly worked 40-48 hours a week and everything was good. We hired a few new developers and one of them has positioned himself to be a team lead. He has started working overtime, sending emails in the middle of the night which has come somewhat as a shock for the laid back team. Obviously, the higher ups seem to love him for being the "bad guy" enforcing overtime. Before this goes out of control, what steps do I take to stop this from continuing. I would rather not bring this up with the bosses for the fear of being seen as a whining team member. I am not sure if I should reply to his email outside work hours and encourage him to enforce this culture on our team. Thoughts?

    Read the article

  • Access Rules created by WSAT are not enforced

    - by rsteckly
    Hi, I'm trying to implement roles in my site. There are several projects in the solution, one of which is a web application. In that web application, I'm trying to use WSAT to create three roles. There are many folders for the application. I've used WSAT to define role based access rules for each folder. However, when I debug and navigate to those pages, they do not redirect to a login and show me the protected page. There are web.config files in each folder. Why would the system not enforce these rules? My web.config file has: I've tested the connections in WSAT and they work. Any ideas?

    Read the article

  • How can I set up a fault-tolerant web-service built with Erlang/OTP?

    - by Jonas
    I would like to setup a fault-tolerant web-service. I will build the web-service with Erlang/OTP. At the beginning the web-service will be hosted on a few VPS. Each VPS has its own IP-address, and I can use more if IPs if I need. I would like to have the domain name pointing to a single IP-address. How can setup my Erlang/OTP-application to be fault-tolerant behind a single IP-address? Do I need to use VLAN? Is there a way my Erlang/OTP-application can use heartbeats and handle virtual IP-addresses to route the traffic? or how should I solve this problem?

    Read the article

  • java BufferedReader specific length returns NUL characters

    - by Bastien
    I have a TCP socket client receiving messages (data) from a server. messages are of the type length (2 bytes) + data (length bytes), delimited by STX & ETX characters. I'm using a bufferedReader to retrieve the two first bytes, decode the length, then read again from the same bufferedReader the appropriate length and put the result in a char array. most of the time, I have no problem, but SOMETIMES (1 out of thousands of messages received), when attempting to read (length) bytes from the reader, I get only part of it, the rest of my array being filled with "NUL" characters. I imagine it's because the buffer has not yet been filled. char[] bufLen = new char[2]; _bufferedReader.read(bufLen); int len = decodeLength(bufLen); char[] _rawMsg = new char[len]; _bufferedReader.read(_rawMsg); return _rawMsg; I solved the problem in several iterative ways: first I tested the last char of my array: if it wasn't ETX I would read chars from the bufferedReader one by one until I would reach ETX, then start over my regular routine. the consequence is that I would basically DROP one message. then, in order to still retrieve that message, I would find the first occurence of the NUL char in my "truncated" message, read & store additional characters one at a time until I reached ETX, and append them to my "truncated" messages, confirming length is ok. it works also, but I'm really thinking there's something I could do better, like checking if the total number of characters I need are available in the buffer before reading it, but can't find the right way to do it... any idea / pointer ? thanks !

    Read the article

  • Log4Net and GAC - How to reference Configuraition Files?

    - by Adam
    Hello all I am using log4net during my development, as as part of a project constraint, I now need to add it to the Global Assembly Cache. The logging definitions are in a file Log4Net.xml. That file is referenced in my assemblyinfo as: [assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.xml", Watch = true)]. So long as the xml file was in the same directory as the log4net.dll, everything has been working fine. However now that I've added log4net to the GAC, it is no longer picking up the xml file. Does anyone know what I need to change in order to have it pick up the XML file again? Is hardcoding the patch in the assembly reference the only way? Many thanks

    Read the article

  • Any way to ask a method for its name?

    - by Andy
    I'm trying to debug an iPhone app I'm working on, and the idea of adding fifty NSLog statements to the various source files gives me the willies. What I'd like to do is write a pair of statements, say NSString *methodName = [self methodName]; NSLog(@"%@", methodName); that I can just paste into each method I need to. Is there a way to do this? Is there some Objective-C construct for asking a method for its name? Or am I gonna have to do this the hard way?

    Read the article

  • Headers set on embedding

    - by mschoening
    Lets say I have a URL (http://www.example.com/something). Is the following scenario somehow possible? A) The user visits the URL directly and a standard page with markup, js, etc. is shown. B) The user embeds the same URL in an image tag and the URL is served only as an image.

    Read the article

  • jQuery slideToggle - when div is toggled it pushes content out of viewable area (IE)

    - by Chris
    This is an annoying ocurrance in IE when I use the jQuery slideToggle effect. Without the div being open, page looks normal. The minute I toggle the div open, it extends past the current content, overtop of the footer, and out of the viewable browser area (Even after scrolling all the way down). This feature seems to work just fine in firefox. Do I need an additional hack or CSS to make it work in IE8?

    Read the article

  • MSBuild: Items + Batching + CreateItem + Transforms Question

    - by KeithCS
    I have this bit of an msbuild project that is making me wonder why it the outcome is the way it is. Not that it is causing an issue or anything of the sort, but I would like to try and better my understanding of it. <?xml version="1.0" encoding="utf-8" ?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="TestTarget1;TestTarget2" ToolsVersion="3.5"> <ItemGroup> <PathDir Include="C:\RootDir\UniqueDir1"/> <PathDir Include="C:\RootDir\UniqueDir2" /> </ItemGroup> <Target Name="TestTarget1" Outputs="%(PathDir.Identity)"> <PropertyGroup> <RootPath>%(PathDir.Identity)</RootPath> </PropertyGroup> <ItemGroup> <SubDirectory Include="Common1"/> <SubDirectory Include="Common2"/> </ItemGroup> <CreateItem Include="@(SubDirectory->'$(RootPath)\%(Identity)')"> <Output TaskParameter="Include" ItemName="FullPath"/> </CreateItem> <Message Text="@(FullPath)"/> </Target> <Target Name="TestTarget2"> <Message Text="@(FullPath)"/> </Target> </Project> So I have two main paths that are unique, and within each I have two directories with the same names in each of the unique paths. In target1, I am batching against the identity of the items in PathDir, and then performing a transform on item SubDirectory, which contains the common folder names found in the unique directories, to create a new item containing the full paths. So anyways, after that, the output for the targets is as follows: Target 1: C:\RootDir\UniqueDir1\Common1;C:\RootDir\UniqueDir1\Common2 C:\RootDir\UniqueDir2\Common1;C:\RootDir\UniqueDir2\Common2 Target 2: C:\RootDir\UniqueDir1\Common1;C:\RootDir\UniqueDir1\Common2;C:\RootDir\UniqueDir2\Common1;C:\RootDir\UniqueDir2\Common2 So my question I guess is ... why does target1 only display the directories containing the directory it is batching against? I know it probably has to do with batching, but thats all I know.

    Read the article

  • How to step frames in a movie recorded by iPhone

    - by aron
    Is there a way to have my iPhone program step frame by frame through a movie recorded by the iPhone? What I want to do is have the user record a quicktime movie, then be able to step through the movie frame by frame. Alternately, I suppose if there was a way to extract every single frame from the movie to a jpg, then I could easily step through the pictures. Anyone know of a way to do this??? I suppose the third option (which might not get past Apple's store) is to capture the movie the way the old jailbroken apps did, which is somehow capture the pictures directly from the camera view???? Any help appreciated. Thanks in advance!!!!

    Read the article

  • Grid View Pagination.

    - by Wondering
    Dear All, I have a grid view and I want to implement Pagination functionality.This is working fine. protected DataSet FillDataSet() { string source = "Database=GridTest;Server=Localhost;Trusted_Connection=yes"; con = new SqlConnection(source); cmd = new SqlCommand("proc_mygrid", con); ds = new DataSet(); da = new SqlDataAdapter(cmd); da.Fill(ds); GridView1.DataSource = ds; GridView1.DataBind(); return ds; } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { int newPagenumber = e.NewPageIndex; GridView1.PageIndex = newPagenumber; GridView1.DataSource = FillDataSet(); GridView1.DataBind(); } But the problem is for each pagination I have to call FillDataSet(); Is there any way to stop that.Any other coding approach? Thanks.

    Read the article

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