Search Results

Search found 249 results on 10 pages for 'winston c yang'.

Page 8/10 | < Previous Page | 4 5 6 7 8 9 10  | Next Page >

  • Hibernate collection mapping challenge

    - by Geln Yang
    Hi, There is a table Item like, code,name 01,parent1 02,parent2 0101,child11 0102,child12 0201,child21 0202,child22 Create a java object and hbm xml to map the table.The Item.parent is a Item whose code is equal to the first two character of its code : class Item{ string code; string name; Item parent; List<Item> children; .... setter/getter.... } <hibernate-mapping> <class name="Item" table="Item"> <id name="code" length="4" type="string"> <generator class="assigned" /> </id> <property name="name" column="name" length="50" not-null="true" /> <!--====================================== --> <many-to-one name="parent" class="Item" not-found="ignore"></many-to-one> <bag name="children"></bag> <!--====================================== --> </class> </hibernate-mapping> How to definition the mapping relationship? Thanks!

    Read the article

  • does mysql stored procedures support data types like array, hash,etc?

    - by Yang
    i am creating a mysql function which takes in a varchar and change it to a int based on a mapping table. select name, convert_to_code(country) from users where sex = 'male' here, the convert_to_code() function takes in a country name (e.g. Japan, Finland..) and change it to country code which is an integer (e.g. 1001, 2310..) based on a mapping table called country_maping like below: country_name (varchar) | country_code (int) Japan | 1001 Finland | 2310 Canada | 8756 currently, the stored function need to select country_code from country_mapping where country_name = country_name and return the query result. is that possible to create a hash data struct in SP to optimize the process so that it will not need to perform the query for each row matches the where clause. thanks in advance!

    Read the article

  • java: speed up reading foreign characters

    - by Yang
    My current code needs to read foreign characters from the web, currently my solution works but it is very slow, since it read char by char using InputStreamReader. Is there anyway to speed it up and also get the job done? // Pull content stream from response HttpEntity entity = response.getEntity(); InputStream inputStream = entity.getContent(); StringBuilder contents = new StringBuilder(); int ch; InputStreamReader isr = new InputStreamReader(inputStream, "gb2312"); // FileInputStream file = new InputStream(is); while( (ch = isr.read()) != -1) contents.append((char)ch); String encode = isr.getEncoding(); return contents.toString();

    Read the article

  • access denied for user root, mysql database

    - by Yang
    when i am using sequel pro to connect to a remote database, the server says access denied. I am 100% percent sure that the username and password are correct. I also try to use phpmyadmin to connect to the server, it works. I don't know what happened when I am using sequel pro to connect to the server.

    Read the article

  • Change Iframe Content from Cached HTML?

    - by Yang
    Is there any way that I can change the content of iframe from a cached html string? I am not talking about iframe.Attribute["src"] = "url", but rather given a string of html and change the content. An ugly workaround might be saving the html into a file and change iframe src to it. Any other ways? Maybe javascript can help?

    Read the article

  • XSLT: How to remove the self-closed elment

    - by Daoming Yang
    I have a large xml file which contents a lot of self-closed tags. How could remove all them by using XSLT. eg. <?xml version="1.0" encoding="utf-8" ?> <Persons> <Person> <Name>user1</Name> <Tel /> <Mobile>123</Mobile> </Person> <Person> <Name>user2</Name> <Tel>456</Tel> <Mobile /> </Person> <Person> <Name /> <Tel>123</Tel> <Mobile /> </Person> <Person> <Name>user4</Name> <Tel /> <Mobile /> </Person> </Persons> I'm expecting the result: <?xml version="1.0" encoding="utf-8" ?> <Persons> <Person> <Name>user1</Name> <Mobile>123</Mobile> </Person> <Person> <Name>user2</Name> <Tel>456</Tel> </Person> <Person> <Tel>123</Tel> </Person> <Person> <Name>user4</Name> </Person> </Persons> Note: there are thousands of different elements, how can I programmatically remove all the self-closed tags. Another question is how to remove the empty element such as <name></name> as well. Can anyone help me on this? Many thanks.

    Read the article

  • batch update mysql table

    - by Yang
    I have a table with a column called time, "HH:MM:SS". How can I do a batch update so that the value increment by 1 hour? Is it something like: update <table_name> set <time_column> = <time_column> + 3600 where ...

    Read the article

  • Raw SQL sent to SQL Server from .NET on stored procedure call

    - by Jeff Meatball Yang
    Is there a way to get the raw text that is sent to SQL Server, as seen in SQL Profiler, from the ADO.NET call? using(SqlConnection conn = new SqlConnection(connString)) { SqlCommand cmd = conn.CreateCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "GetSomeData"; cmd.Parameters.Add("@id").Value = someId; cmd.Parameters.Add("@someOtherParam").Value = "hello"; conn.Open(); SqlDataReader dr = cmd.ExecuteReader(); // this sends up the call: exec GetSomeData @id=24, @someOtherParam='hello' // how can I capture that and write it to debug? Debug.Write("exec GetSomeData @id=24, @someOtherParam='hello'"); }

    Read the article

  • Hibernate collection mapping Problem

    - by Geln Yang
    Hi, There is a table Item like, code,name 01,parent1 02,parent2 0101,child11 0102,child12 0201,child21 0202,child22 Create a java object and hbm xml to map the table.The Item.parent is a Item whose code is equal to the first two characters of its code : class Item{ String code; String name; Item parent; List<Item> children; .... setter/getter.... } <hibernate-mapping> <class name="Item" table="Item"> <id name="code" length="4" type="string"> <generator class="assigned" /> </id> <property name="name" column="name" length="50" not-null="true" /> <many-to-one name="parent" class="Item" not-found="ignore"> <formula> <![CDATA[ (select i.code,r.name from Item i where (case length(code) when 4 then i.code=SUBSTRING(code,1,2) else false end)) ]]> </formula> </many-to-one> <bag name="children"></bag> </class> </hibernate-mapping> I try to use formula to define the many-to-one relationship,but it doesn't work!Is there something wrong?Or is there other method? Thanks! ps,I use mysql database.

    Read the article

  • Hibernate mapping Problem

    - by Geln Yang
    Hi, There is a table Item like, code,name 01,parent1 02,parent2 0101,child11 0102,child12 0201,child21 0202,child22 Create a java object and hbm xml to map the table.The Item.parent is a Item whose code is equal to the first two characters of its code : class Item{ String code; String name; Item parent; List<Item> children; .... setter/getter.... } <hibernate-mapping> <class name="Item" table="Item"> <id name="code" length="4" type="string"> <generator class="assigned" /> </id> <property name="name" column="name" length="50" not-null="true" /> <many-to-one name="parent" class="Item" not-found="ignore"> <formula> <![CDATA[ (select i.code,r.name from Item i where (case length(code) when 4 then i.code=SUBSTRING(code,1,2) else false end)) ]]> </formula> </many-to-one> <bag name="children"></bag> </class> </hibernate-mapping> I try to use formula to define the many-to-one relationship,but it doesn't work!Is there something wrong?Or is there other method? Thanks! ps,I use mysql database.

    Read the article

  • Why does my javascript file sometimes compressed while sometimes not?(IIS Gzip problem)

    - by Kevin Yang
    i enable gzip for javascript file in my iis settings, here 's the corresponding config section. <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="10" dynamicCompressionLevel="8" /> <dynamicTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/soap+msbin1" enabled="true" /> <add mimeType="*/*" enabled="false" /> </dynamicTypes> <staticTypes> <add mimeType="text/*" enabled="true" /> <add mimeType="message/*" enabled="true" /> <add mimeType="application/javascript" enabled="true" /> <add mimeType="application/x-javascript" enabled="true" /> <add mimeType="*/*" enabled="false" /> </staticTypes> </httpCompression> currently, when i download my js file, it seems that sometimes server return the gzip one, and sometimes not. i dont know why, and how to debug that. If a file is already gzipped, it should be cached in local disk, and next time someone visit that file again, iis kernel should return the cache gzip file directly without compressing it again. Is that right?

    Read the article

  • ruby keyword arguments of method

    - by Yang
    How can I declare a method with keyword arguments just like rails do. some examples may be Person.find(:all, :conditions => "..."). How can I use symbols to create methods similar to the above? I am very new to ruby. Thanks in advance!

    Read the article

  • Enforcing an "end" call whenever there is a corresponding "start" call

    - by Jeff Meatball Yang
    Let's say I want to enforce a rule: Everytime you call "StartJumping()" in your function, you must call "EndJumping()" before you return. When a developer is writing their code, they may simply forget to call EndSomething - so I want to make it easy to remember. I can think of only one way to do this: and it abuses the "using" keyword: class Jumper : IDisposable { public Jumper() { Jumper.StartJumping(); } public void Dispose() { Jumper.EndJumping(); } public static void StartJumping() {...} public static void EndJumping() {...} } public bool SomeFunction() { // do some stuff // start jumping... using(Jumper j = new Jumper()) { // do more stuff // while jumping } // end jumping } Is there a better way to do this?

    Read the article

  • Need an Asp.net MVC Application solution

    - by Daoming Yang
    I have implemented a small ordering and stock control system (for internal using) with the MVC 2 framework. Now my friends, they want to have a website to present the existing products for their customers. I know, I know they will ask me to do this one day. So in the beginning, I have made the controller name to start with "Admin". But now I am not sure the best way to implement their requirements. Could you advise me? 1.For the security reason, I did not allowed anonymous user to access the website a part from the CSS and image files. My question is the controllers' name are not folders' name, how could I set this up? 2.I'm planning to put the admin section into an "area" and will it be a good way to go? Can anyone provide me some suggestions. Many thanks.

    Read the article

  • Group partial class shortcut

    - by Fred Yang
    I have to cs file for one partial class. I know that I can modify project file to group them together like way that vs.net group *.aspx and *.aspx.cs, but is there a way to do that in vs.net IDE directly?

    Read the article

  • How to use Linq to select and group complex child object from a parents list.

    - by Daoming Yang
    How to use Linq to select and group complex child object from a parents list. I have an OrderList each of order object has a OrderProductVariantList(OrderLineList), and each of OrderProductVariant object has ProductVariant, and then the ProductVariant object will have a Product object which contains product information. My goal is to select and group the most popular products from the order list. Can anyone help me with this? Many thanks.

    Read the article

  • memcached cluster maintenance

    - by Yang
    Scaling up memcached to a cluster of shards/partitions requires either distributed routing/partition table maintenance or centralized proxying (and other stuff like detecting failures). What are the popular/typical approaches/systems here? There's software like libketama, which provides consistent hashing, but this is just a client-side library that reacts to messages about node arrivals/departures---do most users just run something like this, plus separate monitoring nodes that, on detecting failures, notify all the libketamas of the departure? I imagine something like this might be sufficient since typical use of memcached as a soft-state cache doesn't require careful attention to consistency, but I'm curious what people do.

    Read the article

  • A 4-byte Unsigned Int for Sql Server 2008?

    - by Jeff Meatball Yang
    I understand there are multiple questions about this on SO, but I have yet to find a definitive answer of "yes, here's how..." So here it is again: What are the possible ways to store an unsigned integer value (32-bit value or 32-bit bitmap) into a 4-byte field in SQL Server? Here are ideas I have seen: 1) Use a -1*2^31 offset for all values Disadvantages: need to perform math on the values before reading/writing/aggregating. 2) Use 4 tinyint fields Disadvantages: need to concatenate values to perform any operations 3) Use binary(4) Disadvantages: actually uses 4 + 2 bytes of space

    Read the article

  • NHibernate: how to do lookup a specific date

    - by Daoming Yang
    How I can lookup a specific date in Nhibernate? I'm currently using this to lookup one day's order. ICriteria criteria = SessionManager.CurrentSession.CreateCriteria(typeof(Order)) .Add(Expression.Between("DateCreated", date.Date.AddDays(-1), date.Date.AddDays(1))) .AddOrder(NHibernate.Criterion.Order.Desc("OrderID")); I tried the following code, but they did bring the data for me. Expression.Eq("DateCreated", date) Expression.Like("DateCreated", date) Note: The pass in date value will be like this 2010-04-03 00:00:00, The actual date value in the database will be like this 2010-03-13 11:17:16.000 Can anyone let me know how to do this? Many thanks.

    Read the article

  • Android: passing paramters between classes

    - by Yang
    I have a class2 which is involved by class1 when clicks are made. I have to pass some parameters/objects from class1 to class2. I only know the standard way which does not have an option of passing parameters. // launch the full article Intent i = new Intent(this, Class2.class); startActivity(i);

    Read the article

  • android: test app on a real device

    - by Yang
    My client wants to dogfood my android app. They don't have eclipse and don't want to install it. It there a more convenient way to send my apk to them? Can I send it via email and let them open the attachment in mobile device? Will it start installing itself automatically?

    Read the article

< Previous Page | 4 5 6 7 8 9 10  | Next Page >