Search Results

Search found 1349 results on 54 pages for 'jeff meatball yang'.

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

  • log4net: log information into different log files

    - by Daoming Yang
    I have the following configurations in my web.config file, but how can I log the information into data.txt and general.txt separately in C#? Could anyone provide some sample code for me? <appender name="GeneralLog" type="log4net.Appender.RollingFileAppender"> <file value="App_Data/Logs/general.txt" /> <appendToFile value="true" /> <maximumFileSize value="2MB" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="5" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" /> </layout> </appender> <appender name="DataLog" type="log4net.Appender.RollingFileAppender"> <file value="App_Data/Logs/data.txt" /> <appendToFile value="true" /> <maximumFileSize value="2MB" /> <rollingStyle value="Size" /> <maxSizeRollBackups value="5" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%d{HH:mm:ss.fff} [%t] %-5p %c - %m%n" /> </layout> </appender>

    Read the article

  • How to use Linq to group DateTime by month and days calculation

    - by Daoming Yang
    Hi all, I have two questions: First one: I have a order list and want to group them by the created month for the reports. Each order's created datetime will be like "2010-03-13 11:17:16.000" How can I make them only group by date like "2010-03"? Note: the DateCreated is the DateTime tpye The following code is not correct. var items = orderList.GroupBy(t => t.DateCreated.Month) .Select(g => new Order() { DateCreated = g.Key }) .OrderByDescending(x => x.OrderID).ToList(); Second one: Output the full months between two dates in C# If an user choose 2010-04-08 and 2010-06-04, I want to output the 2010-04-01 and 2010-06-30. I can always get the first day and last day of the months, but I want to find out some other options Many thanks. Many thanks.

    Read the article

  • mysql partitioning

    - by Yang
    just want to verify that database partition is implemented only at the database level, when we query a partitioned table, we still do our normal query, nothing special with our queries, the optimization is performed automatically when parsing the query, is that correct? e.g. we have a table called 'address' with a column called 'country_code' and 'city'. so if i want to get all the addresses in New York, US, normally i wound do something like this: select * from address where country_code = 'US' and city = 'New York' if now the table is partitioned by 'country_code', and i know that now the query will only be executed on the partition which contains country_code = US. My question is do I need to explicitly specify the partition to query in my sql statement? or i still use the previous statement and the db server will optimize it automatically? Thanks in advance!

    Read the article

  • android: having two listviews in two listactivities didn't work

    - by Yang
    I guess my previous question wasn't clear enough (http://stackoverflow.com/questions/2549585/android-failed-to-setcontentview-when-switching-to-listactivity), so I explain as follows. In my app I have two listactivities which uses two different listviews: public class Activity1 extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.listview1); } public class Activity2 extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { try{ super.onCreate(savedInstanceState); setContentView(R.layout.listview2); } } As required by android, listview must have an ID which is exactly "@android:id/list". If I set the listview in both listview1 and listview2 with the same ID, then they will end up using the same format of listview, which is not what I want. But if I set one of the IDs to be sth like "@+id/listview2", android gave me the error: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' How do I handle this dilema?

    Read the article

  • android: how to specify multipe listivews

    - by Yang
    It seems that android has enforced that a listview must have the name android:id="@android:id/list", is there anyway to create multiple listview then? I have two activities which are both listview but have to control different format of Lists, one with image+text the other is just text.

    Read the article

  • Simple java regular expression replace question.

    - by Yang
    I have a simple xml file and I want to remove everything before the first tag. ..... item1 .... The following java code is not working: String cleanxml = rawxml.replace("^[\\s\\S]+<item>", ""); What is the correct way to do this? And how do I address the non-greedy issue? Sorry I'm a C# programmer.

    Read the article

  • Error while installing dependencies for PyGTK on Mac OS 10.6.3

    - by Winston C. Yang
    I tried to install the following dependencies for PyGTK 2.16.0 (the Python GIMP Tool Kit) on Mac OS 10.6.3: glib 2.25.5 gettext-0.18 libiconv-1.13.1 When I tried to install glib, I got the following error message: gconvert.c:55:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv The libiconv web page talks about a circular dependency between gettext and libiconv---build one, then build the other, then build the first again. I tried to do this, though possibly incorrectly. (Will the following work: make distclean; ./configure; make; sudo make install?) The author of a posting had the same problem, and he solved it by installing libiconv-1.13.1. Could anyone explain the error in more detail, and how to correct it?

    Read the article

  • How to get accuracy memory usage on iphone device.

    - by Favo Yang
    I want to output accuracy memory usage on iphone device, the method I used was taking from, http://landonf.bikemonkey.org/code/iphone/Determining%5FAvailable%5FMemory.20081203.html natural_t mem_used = (vm_stat.active_count + vm_stat.inactive_count + vm_stat.wire_count) * pagesize; natural_t mem_free = vm_stat.free_count * pagesize; natural_t mem_total = mem_used + mem_free; The issue is that the total value is always changed after testing on device! used: 60200.0KB free: 2740.0KB total: 62940.0KB used: 53156.0KB free: 2524.0KB total: 55680.0KB used: 52500.0KB free: 2544.0KB total: 55044.0KB Have a look for the function implementation, it already sum active, inactive, wire and free pages, is there anything I missing here?

    Read the article

  • random generator to obtain data from array not displaying

    - by Yang Jie Domodomo
    I know theres a better solution using arc4random (it's on my to-try-out-function list), but I wanted to try out using the rand() and stand(time(NULL)) function first. I've created a NSMutableArray and chuck it with 5 data. Testing out how many number it has was fine. But when I tried to use the button function to load the object it return me with object <sampleData: 0x9a2f0e0> - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } While I feel the main cause is the method itself, I've paste the rest of the code below just incase i made any error somewhere. ViewController.h #import <UIKit/UIKit.h> #import "sampleData.h" #import "sampleDataDAO.h" @interface ViewController : UIViewController @property (weak, nonatomic) IBOutlet UILabel *label; @property (weak, nonatomic) IBOutlet UIButton *onHitMePressed; - (IBAction)generateNumber:(id)sender; @property(nonatomic, strong) sampleDataDAO *daoDS; @property(nonatomic, strong) NSMutableArray *ds; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize label; @synthesize onHitMePressed; @synthesize daoDS,ds; - (void)viewDidLoad { [super viewDidLoad]; daoDS = [[sampleDataDAO alloc] init]; self.ds = daoDS.PopulateDataSource; // Do any additional setup after loading the view, typically from a nib. } - (void)viewDidUnload { [self setLabel:nil]; [self setOnHitMePressed:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (IBAction)generateNumber:(id)sender { srand(time(NULL)); NSInteger number =rand()% ds.count ; label.text = [NSString stringWithFormat:@"object %@", [ds objectAtIndex:number] ]; NSLog(@"%@",label.text); } @end sampleData.h #import <Foundation/Foundation.h> @interface sampleData : NSObject @property (strong,nonatomic) NSString * object; @end sampleData.m #import "sampleData.h" @implementation sampleData @synthesize object; @end sampleDataDAO.h #import <Foundation/Foundation.h> #import "sampleData.h" @interface sampleDataDAO : NSObject @property(strong,nonatomic)NSMutableArray*someDataArray; -(NSMutableArray *)PopulateDataSource; @end sampleDataDAO.m #import "sampleDataDAO.h" @implementation sampleDataDAO @synthesize someDataArray; -(NSMutableArray *)PopulateDataSource { someDataArray = [[NSMutableArray alloc]init]; sampleData * myData = [[sampleData alloc]init]; myData.object= @"object 1"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 2"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 3"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 4"; [someDataArray addObject:myData]; myData=nil; myData = [[sampleData alloc] init]; myData.object= @"object 5"; [someDataArray addObject:myData]; myData=nil; return someDataArray; } @end

    Read the article

  • what is a data serialization system?

    - by Yang
    according to Apache AVRO project, "Avro is a serialization system". By saying data serialization system, does it mean that avro is a product or api? also, I am not quit sure about what a data serialization system is? for now, my understanding is that it is a protocol that defines how data object is passed over the network. Can anyone help explain it in an intuitive way that it is easier for people with limited distributed computing background to understand? Thanks in advance!

    Read the article

  • mysql result set joining existing table

    - by Yang
    is there any way to avoid using tmp table? I am using a query with aggregate function (sum) to generate the sum of each product: the result looks like this: product_name | sum(qty) product_1 | 100 product_2 | 200 product_5 | 300 now i want to join the above result to another table called products. so that i will have a summary like this: product_name | sum(qty) product_1 | 100 product_2 | 200 product_3 | 0 product_4 | 0 product_5 | 300 i know 1 way of doing this is the dump the 1st query result to a temp table then join it with products table. is there a better way?

    Read the article

  • How to recognize whether a web site is opened in a mobile or a PC

    - by Yogi Yang 007
    We have a site developed in PHP. It is working just fine. We have used JQuery for every kind of situation like slide shows, menus, etc. This site contains a lot of images which are large in size. because of this when viewed in a mobile phone user has to scroll a lot. How can we recognize whether the client (browser) trying to access our site is a mobile phone or a standard PC. Is there any standard way to build site for such situations? TIA

    Read the article

  • Hibernate can't load Custom SQL collection

    - 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. add 2010/05/23 Pascal's answer is right,but the "false" value must be replaced with other expression,like "1=2".Because the "false" value would be considered to be a column of the table. select i.code from Item i where ( case length(code) when 4 then i.code=SUBSTRING(code,1,2) else 1=2 end) And I have another question about the children "bag" mapping.There isn't formula configuration option for "bag",but we can use "loader" to load a sql-query.I configure the "bag" as following.But it get a list whose size is 0.What's wrong with it? <class> ... ... <bag name="children"> <key /> <one-to-many class="Item"></one-to-many> <loader query-ref="getChildren"></loader> </bag> </class> <sql-query name="getChildren"> <load-collection alias="r" role="Item.children" /> <![CDATA[(select {r.*} from Item r join Item o where o.code=:code and ( case length(o.code) when 2 then (length(r.code)=4 and SUBSTRING(r.code,1,2)=o.code) else 1=2 end ))]]> </sql-query>

    Read the article

  • How to efficiently SELECT rows from database table based on selected set of values

    - by Chau Chee Yang
    I have a transaction table of 1 million rows. The table has a field name "Code" to keep customer's ID. There are about 10,000 different customer code. I have an GUI interface allow user to render a report from transaction table. User may select arbitrary number of customers for rendering. I use IN operator first and it works for few customers: SELECT * FROM TRANS_TABLE WHERE CODE IN ('...', '...', '...') I quickly run into problem if I select few thousand customers. There is limitation using IN operator. An alternate way is create a temporary table with only one field of CODE, and inject selected customer codes into the temporary table using INSERT statement. I may then using SELECT A.* FROM TRANS_TABLE A INNER JOIN TEMP B ON (A.CODE=B.CODE) This works nice for huge selection. However, there is performance overhead for temporary table creation, INSERT injection and dropping of temporary table. Do you aware of better solution to handle this situation?

    Read the article

  • rails convert string to number

    - by Yang
    hi guys, i am wondering is there a convenient function in rails to convert string with negative signs into a number. e.g. -1005.32 when i use to_f method, the number will simply become 1005 with the negative sign and decimal part being ignored. thanks in advance!

    Read the article

  • Get_user running at kernel mode returns error

    - by Fangkai Yang
    Hi, all, I have a problem with get_user() macro. What I did is as follows: I run the following program int main() { int a = 20; printf("address of a: %p", &a); sleep(200); return 0; } When the program runs, it outputs the address of a, say, 0xbff91914. Then I pass this address to a module running in Kernel Mode that retrieves the contents at this address (at the time when I did this, I also made sure the process didn't terminate, because I put it to sleep for 200 seconds... ): The address is firstly sent as a string, and I cast them into pointer type. int * ptr = (int*)simple_strtol(buffer, NULL,16); printk("address: %p",ptr); // I use this line to make sure the cast is correct. When running, it outputs bff91914, as expected. int val = 0; int res; res= get_user(val, (int*) ptr); However, res is always not 0, meaning that get_user returns error. I am wondering what is the problem.... Thank you!! -- Fangkai

    Read the article

  • How do I selectively round UITableViewCell corners?

    - by Michael Yang
    I'm trying to recreate the feel of the upper part of the iPhone Stocks application. Using cornerRadius I have been able to round all the corners of the UITableView, but when the user drags too far down or up the rectangular edges of the first and last cells show. How can I round only the top or bottom part of the UITableViewCell?

    Read the article

  • How to create stackoverflow's post voting like ajax function?

    - by Daoming Yang
    Can I use Ajax or Jquery to call a action and change the image, just like stackoverflow's post voting function? In my view, I'm using the following code, but I don't want to refresh the browser. Can anyone provide some code about this? <%if (!item.IsPrinted) { %> <%=Html.ImageLink("~/Content/images/web/delete.png", "printed", "MarkAsPrinted", "Order", item.TaskID, null, null)%> <%} else {%> <img src="~/Content/images/web/star.png" alt="printed" /> <% } %>

    Read the article

  • DataAnnotationsModelBinder with MVC2 RTM

    - by yang
    Trying to validate models with DataAnnotations but DefaulModelBinder overrides my Required property error messages and never uses my error messages for invalid data entry. Always show 'value' is invalid for 'property name'. In another question I saw that MVC 2 uses DefaultModelBinder but I couldn't find any class in MVC 2 binaries. I downloaded the source for MVC futures and changed some source to compile it for .Net 4.0 but although I had success to compile, it has compatability problems and doesn't work as expected. Any help is aprreciated.

    Read the article

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