question_id
int64
4
6.31M
answer_id
int64
7
6.31M
title
stringlengths
9
150
question_body
stringlengths
0
28.8k
answer_body
stringlengths
60
27.2k
question_text
stringlengths
40
28.9k
combined_text
stringlengths
124
39.6k
tags
listlengths
1
6
question_score
int64
0
26.3k
answer_score
int64
0
28.8k
view_count
int64
15
14M
answer_count
int64
0
182
favorite_count
int64
0
32
question_creation_date
stringdate
2008-07-31 21:42:52
2011-06-10 18:12:18
answer_creation_date
stringdate
2008-07-31 22:17:57
2011-06-10 18:14:17
6,187,060
6,191,091
Using Windows Authentication inside my own login form
I have WPF application that has a login form. I would like to make all existing windows users that belong to some specific group able to log into my application. So what I need is a way after the user have given his username and password to see if this is a user, belonging to the wanted group, and that the password is ...
If you need to find out if the user has membership to some AD group, you will need to use the group's SID if the user is not a "direct" member of the group (i.e. the user is a member of a nested group which itself is a member of the 'desired' AD group). (I've used this for years, but long ago lost the link to where I f...
Using Windows Authentication inside my own login form I have WPF application that has a login form. I would like to make all existing windows users that belong to some specific group able to log into my application. So what I need is a way after the user have given his username and password to see if this is a user, be...
TITLE: Using Windows Authentication inside my own login form QUESTION: I have WPF application that has a login form. I would like to make all existing windows users that belong to some specific group able to log into my application. So what I need is a way after the user have given his username and password to see if ...
[ "c#", ".net", "wpf", "windows-authentication" ]
7
7
14,612
3
0
2011-05-31T11:45:17.690000
2011-05-31T17:14:47.987000
6,187,066
6,188,622
binding click event using images to page
I have a menu on my page which changes the source of a particular div(). The items are divs are located in a div called foliolist The div where the image changes is below: List of items that change the div, these sit at the absolute bottom of the page Jquery code that makes it happen $('.foliolist a').click(function(e)...
Little comment: Your last snippet of code could be replaced by $('#bubbles > #folioholder >.foliolist > a:first').click(); On the actual question: You'll have to create your buttons and bind them event to retrieve the currently displayed picture to retrieve the following/previous img. $('#btnNext').click(function(){ //...
binding click event using images to page I have a menu on my page which changes the source of a particular div(). The items are divs are located in a div called foliolist The div where the image changes is below: List of items that change the div, these sit at the absolute bottom of the page Jquery code that makes it h...
TITLE: binding click event using images to page QUESTION: I have a menu on my page which changes the source of a particular div(). The items are divs are located in a div called foliolist The div where the image changes is below: List of items that change the div, these sit at the absolute bottom of the page Jquery co...
[ "jquery" ]
0
1
139
1
0
2011-05-31T11:45:48.450000
2011-05-31T13:51:37.977000
6,187,069
6,188,664
How can I package a specific version with maven?
I'd like to call mvn clean install -Dsomeproperty=1.2.3-20110526-1836 to get artifact-1.2.3-20110526-1836.jar instead of artifact-1.2.3-SNAPSHOT.jar How can I pass that timestamp to maven??
The following artifact setting in pom.xml seem to be doing what you want: testgroup testartifact ${someproperty} Now if you execute "mvn clean install -Dsomeproperty=1.1.timestamp", the jar file produced also contains the timestamp in its name. I'm not sure if this is what you are looking for. EDIT Another solution sin...
How can I package a specific version with maven? I'd like to call mvn clean install -Dsomeproperty=1.2.3-20110526-1836 to get artifact-1.2.3-20110526-1836.jar instead of artifact-1.2.3-SNAPSHOT.jar How can I pass that timestamp to maven??
TITLE: How can I package a specific version with maven? QUESTION: I'd like to call mvn clean install -Dsomeproperty=1.2.3-20110526-1836 to get artifact-1.2.3-20110526-1836.jar instead of artifact-1.2.3-SNAPSHOT.jar How can I pass that timestamp to maven?? ANSWER: The following artifact setting in pom.xml seem to be d...
[ "maven-2", "maven" ]
6
7
14,645
3
0
2011-05-31T11:46:00.093000
2011-05-31T13:54:56.177000
6,187,093
6,187,873
Flex 4 Datagrid Header
I have created my own DataGridHeader class - by extending the default DataGridHeader. In the contructor of this class I have added an event listener to listen to column clicks with the cntrl key pressed. addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); It appears though that the keyDownHandler is not being cal...
DataGridHeader has the following method which you can override: protected function mouseDownHandler(event:MouseEvent):void; Then you can refer to the MouseEvent documentation to found ctrlKey flag there. I think this information is enough to solve your problem:)
Flex 4 Datagrid Header I have created my own DataGridHeader class - by extending the default DataGridHeader. In the contructor of this class I have added an event listener to listen to column clicks with the cntrl key pressed. addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); It appears though that the keyDownH...
TITLE: Flex 4 Datagrid Header QUESTION: I have created my own DataGridHeader class - by extending the default DataGridHeader. In the contructor of this class I have added an event listener to listen to column clicks with the cntrl key pressed. addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler); It appears though...
[ "apache-flex", "datagrid", "header" ]
0
0
616
1
0
2011-05-31T11:48:35.597000
2011-05-31T12:54:33.657000
6,187,103
6,187,145
Database: One To Many (or One To None) relationship
Im modelling a database in MSSQL 2008. I have 4 tables. **User** userID userName **NewsCategory** newsCategoryID newsCategoryName **News** newsID newsText newsCategoryID **Subscription** userID categoryID I understand that I should have foreign keys between the News and the Category tables. But what should I do with...
Yes you should. Foreign key is used for be sure, that Subscription is created for existing user. Foreign key does not mean, that user should be subscribed on something.
Database: One To Many (or One To None) relationship Im modelling a database in MSSQL 2008. I have 4 tables. **User** userID userName **NewsCategory** newsCategoryID newsCategoryName **News** newsID newsText newsCategoryID **Subscription** userID categoryID I understand that I should have foreign keys between the New...
TITLE: Database: One To Many (or One To None) relationship QUESTION: Im modelling a database in MSSQL 2008. I have 4 tables. **User** userID userName **NewsCategory** newsCategoryID newsCategoryName **News** newsID newsText newsCategoryID **Subscription** userID categoryID I understand that I should have foreign ke...
[ "sql", "sql-server" ]
3
7
2,974
5
0
2011-05-31T11:49:14.080000
2011-05-31T11:52:17.340000
6,187,105
6,187,231
Browser back-button in AJAX problem
I try to enable a brwoserback button for my tabs. But the problem is that in some cases the the hash dissapears. function showTab1(){ window.location.hash = 'tab1'; oldHash = window.location.hash; //showTab1 } function showTab2(){ window.location.hash = 'tab2'; oldHash = window.location.hash; //showTab2 } function chec...
try using this instead of the interval: $(window).bind('hashchange', function() { //Do something });
Browser back-button in AJAX problem I try to enable a brwoserback button for my tabs. But the problem is that in some cases the the hash dissapears. function showTab1(){ window.location.hash = 'tab1'; oldHash = window.location.hash; //showTab1 } function showTab2(){ window.location.hash = 'tab2'; oldHash = window.locat...
TITLE: Browser back-button in AJAX problem QUESTION: I try to enable a brwoserback button for my tabs. But the problem is that in some cases the the hash dissapears. function showTab1(){ window.location.hash = 'tab1'; oldHash = window.location.hash; //showTab1 } function showTab2(){ window.location.hash = 'tab2'; oldH...
[ "javascript", "google-chrome" ]
1
1
867
1
0
2011-05-31T11:49:22.880000
2011-05-31T11:57:53.003000
6,187,111
6,187,490
when I set postData in jqGrid, it is not serialized properly on reload
I have jqGrid which is initially empty (I return data from server only when _search is true). This is grid code: jQuery(gridId).jqGrid({ url: '/controller/GetData', height: 100, multiplesearch: true, datatype: "json", mtype: "POST", rowNum: 10, rowList: [ 10, 20, 30 ], sortname: 'LBONumber', sortorder: "desc", viewreco...
You construct the filters in the wrong way. Instead of usage $.param the value of filters must be JSON encoded (see the documentation ) with respect of JSON.stringify for example. The answer contain the corresponding code example. UPDATED: The definition of postData can be about the following postData: { filters: funct...
when I set postData in jqGrid, it is not serialized properly on reload I have jqGrid which is initially empty (I return data from server only when _search is true). This is grid code: jQuery(gridId).jqGrid({ url: '/controller/GetData', height: 100, multiplesearch: true, datatype: "json", mtype: "POST", rowNum: 10, rowL...
TITLE: when I set postData in jqGrid, it is not serialized properly on reload QUESTION: I have jqGrid which is initially empty (I return data from server only when _search is true). This is grid code: jQuery(gridId).jqGrid({ url: '/controller/GetData', height: 100, multiplesearch: true, datatype: "json", mtype: "POST"...
[ "jqgrid", "http-post", "jqgrid-asp.net" ]
1
3
2,385
1
0
2011-05-31T11:49:38.483000
2011-05-31T12:21:27.857000
6,187,112
6,187,134
MSIL of System.Int32 and int will be same?
Possible Duplicate: C#, int or Int32? Should I care? Please any one let me know MSIL of System.Int32 and int will be same or different, If different then which one we should use. Edit: this won't compile public enum MyEnum: Int32 { AEnum = 0 } but this will public enum MyEnum: int { AEnum = 0 }
int is an alias for System.Int32, they are completely the same. enums only take integral types as type, as this would be possible otherwise: using Int32 = System.String; public enum Something: Int32 { } This is according to C# spec, which states enum-declaration: [attributes] [enum-modifiers ] enum identifier [enum-ba...
MSIL of System.Int32 and int will be same? Possible Duplicate: C#, int or Int32? Should I care? Please any one let me know MSIL of System.Int32 and int will be same or different, If different then which one we should use. Edit: this won't compile public enum MyEnum: Int32 { AEnum = 0 } but this will public enum MyEnum:...
TITLE: MSIL of System.Int32 and int will be same? QUESTION: Possible Duplicate: C#, int or Int32? Should I care? Please any one let me know MSIL of System.Int32 and int will be same or different, If different then which one we should use. Edit: this won't compile public enum MyEnum: Int32 { AEnum = 0 } but this will p...
[ "c#", ".net", "asp.net" ]
5
10
484
6
0
2011-05-31T11:49:42.333000
2011-05-31T11:51:42.010000
6,187,113
6,187,233
problems with finalizing the sales invoice form
i know this would be probably too much to ask for. i am sorry. and i would really appreciate if someone can guide me in the right direction. i have made the sales invoice posting form. the fields are:- customer id, segment id, date of invoice, invoice no(streamed from mysql max value), items,uom's prices,quantities. si...
From what I understand, you are trying to INSERT invoice data after validating from MySQL. A generic answer would: Receive the data at the server. Do the logical validation. Use SELECT to get respective values from the database Compare those values with the received one Execute an INSERT query if successful. There are ...
problems with finalizing the sales invoice form i know this would be probably too much to ask for. i am sorry. and i would really appreciate if someone can guide me in the right direction. i have made the sales invoice posting form. the fields are:- customer id, segment id, date of invoice, invoice no(streamed from mys...
TITLE: problems with finalizing the sales invoice form QUESTION: i know this would be probably too much to ask for. i am sorry. and i would really appreciate if someone can guide me in the right direction. i have made the sales invoice posting form. the fields are:- customer id, segment id, date of invoice, invoice no...
[ "php", "mysql", "arrays" ]
0
0
139
1
0
2011-05-31T11:49:43.070000
2011-05-31T11:58:04.253000
6,187,118
6,187,270
app.config Transformations
I'm a huge fan of the addition of web.config transformations in Visual Studio 2010. See also Scott Hanselman's recent talk at MIX2011. What sucks is that this functionality (appears at least) to only be available to web projects. In our solution we have several Windows Services that connect to a different database depe...
You can use the XML transformation functionality with any XML file - we do this all the time. It's available via an MSBuild task. Try adding the following to your build script:
app.config Transformations I'm a huge fan of the addition of web.config transformations in Visual Studio 2010. See also Scott Hanselman's recent talk at MIX2011. What sucks is that this functionality (appears at least) to only be available to web projects. In our solution we have several Windows Services that connect t...
TITLE: app.config Transformations QUESTION: I'm a huge fan of the addition of web.config transformations in Visual Studio 2010. See also Scott Hanselman's recent talk at MIX2011. What sucks is that this functionality (appears at least) to only be available to web projects. In our solution we have several Windows Servi...
[ "visual-studio", "deployment", "slowcheetah" ]
25
15
24,347
5
0
2011-05-31T11:50:01.787000
2011-05-31T12:00:34.660000
6,187,119
6,240,791
Is there any OCR that can be trained for new symbols?
Is there any free/open source OCR available that can be trained for new symbols and can also output the coordinates of symbol found in the target image? I have read that tesseract OCR can be trained, but can it give me coordinates after OCR? any example? I need the code/steps to train a ocr using an image that contains...
You can train Tesseract to recognize new symbols. The hocr format contains the coordinates of the recognized words. https://github.com/tesseract-ocr/tesseract/wiki/Training-Tesseract http://vietocr.sourceforge.net/training.html https://github.com/tesseract-ocr/tesseract/wiki/Command-Line-Usage#hocr-output
Is there any OCR that can be trained for new symbols? Is there any free/open source OCR available that can be trained for new symbols and can also output the coordinates of symbol found in the target image? I have read that tesseract OCR can be trained, but can it give me coordinates after OCR? any example? I need the ...
TITLE: Is there any OCR that can be trained for new symbols? QUESTION: Is there any free/open source OCR available that can be trained for new symbols and can also output the coordinates of symbol found in the target image? I have read that tesseract OCR can be trained, but can it give me coordinates after OCR? any ex...
[ "image-processing", "pattern-matching", "neural-network", "ocr", "fuzzy-logic" ]
2
4
4,567
1
0
2011-05-31T11:50:08.207000
2011-06-05T03:14:18.850000
6,187,123
6,187,192
How can I represent a binary tree in python?
Currently I'm representing a binary tree in the following manner: [None,2,[None,3,None]] The tree above is rooted at 2. None means that the branch is empty. I'd rather implement this in a list. Are there better ways to do this (without resorting to creating classes)?
It is possible to represent a binary tree using a flat list, as described here. How wasteful this method is would depend on the shape of your tree. I am curious as to why you insist on avoiding classes. If you were to wrap this in a class, you could define a clean API and hide the details of your implementation from th...
How can I represent a binary tree in python? Currently I'm representing a binary tree in the following manner: [None,2,[None,3,None]] The tree above is rooted at 2. None means that the branch is empty. I'd rather implement this in a list. Are there better ways to do this (without resorting to creating classes)?
TITLE: How can I represent a binary tree in python? QUESTION: Currently I'm representing a binary tree in the following manner: [None,2,[None,3,None]] The tree above is rooted at 2. None means that the branch is empty. I'd rather implement this in a list. Are there better ways to do this (without resorting to creating...
[ "python", "data-structures" ]
1
3
3,553
3
0
2011-05-31T11:50:48.417000
2011-05-31T11:55:26.857000
6,187,126
6,187,380
UILabel not showing text
I have a UILabel IBOutlet UILabel *lblMissionLevel; [lblMissionLevel setFrame:CGRectMake(0, -55, 177.0, 43.0)]; UIView *view= [[UIView alloc] initWithFrame:CGRectMake(11.0, 55.0, 480, 500)]; [view addSubview:lblMissionLevel]; and I'm setting the text using lblMissionLevel.text = @"My String"; My issue is, most of the ...
If this is intermittent then the likely cause is the low memory warning, this will cause any non-active view to unload. If you are not handling the re-loading of this view you will see the default Label caption once the view becomes active again (it will load but the initialisation you do with label captions etc is pro...
UILabel not showing text I have a UILabel IBOutlet UILabel *lblMissionLevel; [lblMissionLevel setFrame:CGRectMake(0, -55, 177.0, 43.0)]; UIView *view= [[UIView alloc] initWithFrame:CGRectMake(11.0, 55.0, 480, 500)]; [view addSubview:lblMissionLevel]; and I'm setting the text using lblMissionLevel.text = @"My String"; ...
TITLE: UILabel not showing text QUESTION: I have a UILabel IBOutlet UILabel *lblMissionLevel; [lblMissionLevel setFrame:CGRectMake(0, -55, 177.0, 43.0)]; UIView *view= [[UIView alloc] initWithFrame:CGRectMake(11.0, 55.0, 480, 500)]; [view addSubview:lblMissionLevel]; and I'm setting the text using lblMissionLevel.tex...
[ "iphone", "objective-c", "view", "uilabel" ]
0
1
4,038
4
0
2011-05-31T11:51:02.893000
2011-05-31T12:11:21.893000
6,187,132
6,187,324
Can't delete php set cookie
I've set a cookie through this call in php setcookie('alert_msg', 'you have the add badge'); I have tried unsetting it this way setcookie('alert_msg', ''); setcookie('alert_msg', false); setcookie('alert_msg', false, 1); setcookie('alert_msg', false, time()-3600); setcookie('alert_msg', '', 1, '/'); and it still won't ...
Checkout the cookie path. Since you are not passing the path parameter to the setcookie function, in this case the cookie will be set for the current directory only and can be used and can be unset from that directory only. Possible solution is to pass the path value as /. So that cookie can be used and unset from any ...
Can't delete php set cookie I've set a cookie through this call in php setcookie('alert_msg', 'you have the add badge'); I have tried unsetting it this way setcookie('alert_msg', ''); setcookie('alert_msg', false); setcookie('alert_msg', false, 1); setcookie('alert_msg', false, time()-3600); setcookie('alert_msg', '', ...
TITLE: Can't delete php set cookie QUESTION: I've set a cookie through this call in php setcookie('alert_msg', 'you have the add badge'); I have tried unsetting it this way setcookie('alert_msg', ''); setcookie('alert_msg', false); setcookie('alert_msg', false, 1); setcookie('alert_msg', false, time()-3600); setcookie...
[ "php", "cookies" ]
8
21
11,943
3
0
2011-05-31T11:51:32.880000
2011-05-31T12:05:45.183000
6,187,140
6,188,147
compare two datatable in c#
what would be the best way to compare two data table. i populate two data table reading two different xml and now i need to compare and return the difference in terms of datatable.my compare logic was private DataTable CompareDataTables(DataTable dtFirst, DataTable dtSecond) { int result = 0; bool flag = false; DataTab...
you can use LINQ to comparing tables values(two table must have the same structure) bool flag = false; if (dtFirst.Columns.Count == dtSecond.Columns.Count) { for (int i = 0; i <= dtFirst.Columns.Count - 1; i++) { String colName = dtFirst.Columns[i].ColumnName; var colDataType = dtFirst.Columns[i].DataType.GetType(); va...
compare two datatable in c# what would be the best way to compare two data table. i populate two data table reading two different xml and now i need to compare and return the difference in terms of datatable.my compare logic was private DataTable CompareDataTables(DataTable dtFirst, DataTable dtSecond) { int result = 0...
TITLE: compare two datatable in c# QUESTION: what would be the best way to compare two data table. i populate two data table reading two different xml and now i need to compare and return the difference in terms of datatable.my compare logic was private DataTable CompareDataTables(DataTable dtFirst, DataTable dtSecond...
[ "c#" ]
0
0
5,692
2
0
2011-05-31T11:52:05.997000
2011-05-31T13:13:51.550000
6,187,141
6,187,222
Expected result not achieved with java but yes with c#
I have a program meant to simulate some probability problem (A variation of the monty hall problem if your interested). The code is expected to produce 50% after enough iterations but in java it always comes to 60% (even after 1000000 iterations) while in C# it comes out to the expected 50% is there some thing differen...
At the very least, you have forgotten to end each case block with a break statement. So for this: switch (x) { case 0: // Code here will execute for x==0 only case 1: // Code here will execute for x==1, *and* x==0, because there was no break statement break; case 2: // Code here will execute for x==2 only, because th...
Expected result not achieved with java but yes with c# I have a program meant to simulate some probability problem (A variation of the monty hall problem if your interested). The code is expected to produce 50% after enough iterations but in java it always comes to 60% (even after 1000000 iterations) while in C# it com...
TITLE: Expected result not achieved with java but yes with c# QUESTION: I have a program meant to simulate some probability problem (A variation of the monty hall problem if your interested). The code is expected to produce 50% after enough iterations but in java it always comes to 60% (even after 1000000 iterations) ...
[ "c#", "java", "random" ]
0
9
131
2
0
2011-05-31T11:52:08.060000
2011-05-31T11:57:33.540000
6,187,150
6,187,184
How to call program from web?
How to call program from web. Just like yahoo messenger ymsgr:sendIM?myyahooid I need solution to call a J2SE application from web for both Windows and Mac
Those are called URL handlers. Here is how to do it for windows. http://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx
How to call program from web? How to call program from web. Just like yahoo messenger ymsgr:sendIM?myyahooid I need solution to call a J2SE application from web for both Windows and Mac
TITLE: How to call program from web? QUESTION: How to call program from web. Just like yahoo messenger ymsgr:sendIM?myyahooid I need solution to call a J2SE application from web for both Windows and Mac ANSWER: Those are called URL handlers. Here is how to do it for windows. http://msdn.microsoft.com/en-us/library/aa...
[ "java", "windows", "macos" ]
0
4
99
2
0
2011-05-31T11:52:47.887000
2011-05-31T11:54:57.903000
6,187,176
6,187,218
How to handle null in Pattern.compile?
How to handle null when using Pattern.compile? I'm using the following line to compare strings: Pattern.compile(Pattern.quote(s2), Pattern.CASE_INSENSITIVE).matcher(s1).find() There are some cases where s1 can be null and obviously it throws NullPointerException. I know this could be handled by another if condition to ...
Pattern.matcher() will always throw a NullPointerException when you pass in null, so: no, there is no other way, you'll have to check for null explicitly.
How to handle null in Pattern.compile? How to handle null when using Pattern.compile? I'm using the following line to compare strings: Pattern.compile(Pattern.quote(s2), Pattern.CASE_INSENSITIVE).matcher(s1).find() There are some cases where s1 can be null and obviously it throws NullPointerException. I know this could...
TITLE: How to handle null in Pattern.compile? QUESTION: How to handle null when using Pattern.compile? I'm using the following line to compare strings: Pattern.compile(Pattern.quote(s2), Pattern.CASE_INSENSITIVE).matcher(s1).find() There are some cases where s1 can be null and obviously it throws NullPointerException....
[ "java", "design-patterns" ]
3
8
14,682
3
0
2011-05-31T11:54:22.817000
2011-05-31T11:57:16.113000
6,187,178
6,187,763
MySQL Partition usage stats
I applied partitioning to my tables today, and would now like to see stats for each partition (how many rows per partition). Now, I partitioned it by date, so it's quite easy to get it via "SELECT COUNT(*) FROM table WHERE date >=... AND date <=..."... However, what happens when you break your tables by i.e. KEY? I che...
Put EXPLAIN PARTITIONS in front of your select: EXPLAIN PARTITIONS SELECT... FROM table.... For more info see: http://dev.mysql.com/doc/refman/5.1/en/partitioning-info.html
MySQL Partition usage stats I applied partitioning to my tables today, and would now like to see stats for each partition (how many rows per partition). Now, I partitioned it by date, so it's quite easy to get it via "SELECT COUNT(*) FROM table WHERE date >=... AND date <=..."... However, what happens when you break yo...
TITLE: MySQL Partition usage stats QUESTION: I applied partitioning to my tables today, and would now like to see stats for each partition (how many rows per partition). Now, I partitioned it by date, so it's quite easy to get it via "SELECT COUNT(*) FROM table WHERE date >=... AND date <=..."... However, what happens...
[ "mysql", "database-partitioning" ]
2
2
746
1
0
2011-05-31T11:54:31.287000
2011-05-31T12:45:54.087000
6,187,179
6,187,460
Is the scala eclipse IDE stable enough?
I use eclipse as my scala IDE. But It seems not so good. I can build my project using maven successfully. But eclipse always warn me there's compilation error. Any has experience of scala eclipse plugin? Thanks BTW I use scala IDE for 2.8.1
There is a new Eclipse plug-in which is in the final stages of release, currently in beta 4 which offers numerous improvements including stability. It runs with Scala 2.9. You can download and try it for yourself. More information and download available here: http://www.scala-ide.org/ Also, be sure to read on improving...
Is the scala eclipse IDE stable enough? I use eclipse as my scala IDE. But It seems not so good. I can build my project using maven successfully. But eclipse always warn me there's compilation error. Any has experience of scala eclipse plugin? Thanks BTW I use scala IDE for 2.8.1
TITLE: Is the scala eclipse IDE stable enough? QUESTION: I use eclipse as my scala IDE. But It seems not so good. I can build my project using maven successfully. But eclipse always warn me there's compilation error. Any has experience of scala eclipse plugin? Thanks BTW I use scala IDE for 2.8.1 ANSWER: There is a n...
[ "eclipse", "scala" ]
5
7
690
2
0
2011-05-31T11:54:34.940000
2011-05-31T12:18:12.410000
6,187,198
6,187,306
Clarity of using if(count())
In this code fragment: $results = $this->getAdapter()->fetchAll($query); if(count($results)) { // … } …do you consider the if(count()) part to be be a well understood idiom, or confusing code. i.e. should it be if(count($results) > 0)???
Using a boolean expression with 'if' requires less understanding of a language than using implicit conversions, so I would always prefer the second option (adding "> 0") - at least if this code is meant to be read by others, too. You never know who will maintain your code. The keyword is "clarity" here. But I must admi...
Clarity of using if(count()) In this code fragment: $results = $this->getAdapter()->fetchAll($query); if(count($results)) { // … } …do you consider the if(count()) part to be be a well understood idiom, or confusing code. i.e. should it be if(count($results) > 0)???
TITLE: Clarity of using if(count()) QUESTION: In this code fragment: $results = $this->getAdapter()->fetchAll($query); if(count($results)) { // … } …do you consider the if(count()) part to be be a well understood idiom, or confusing code. i.e. should it be if(count($results) > 0)??? ANSWER: Using a boolean expressio...
[ "php", "coding-style" ]
1
2
148
5
0
2011-05-31T11:55:44.080000
2011-05-31T12:04:19.307000
6,187,203
6,187,781
How to check if a TextView String has been trimmed (marquee)?
If a TextView does not have enough space in its parent element, I will show an icon. A tab on that text or the icon will be used to call an alert dialog with the full string. So i need to know if a TextView has been trinmmed.
Claculate the width of TextView and also calculate the width of text which wil be displayed in the textview. If the width of text is more that the width of textView that means your have to call dialog because because the text will be marqued. Otherwise the text completely fit in the TextView without any issue so no nee...
How to check if a TextView String has been trimmed (marquee)? If a TextView does not have enough space in its parent element, I will show an icon. A tab on that text or the icon will be used to call an alert dialog with the full string. So i need to know if a TextView has been trinmmed.
TITLE: How to check if a TextView String has been trimmed (marquee)? QUESTION: If a TextView does not have enough space in its parent element, I will show an icon. A tab on that text or the icon will be used to call an alert dialog with the full string. So i need to know if a TextView has been trinmmed. ANSWER: Clacu...
[ "android", "textview" ]
4
5
4,953
2
0
2011-05-31T11:56:05.283000
2011-05-31T12:46:48.433000
6,187,204
6,187,252
How can I use jQuery to select and act on an element without a guard clause?
I am rewriting some old JavaScript with jQuery and would like to know how to write it more cleanly. The script I'm starting with is: for (var i = 0; i < form1.elements.length; i++) { var element = form1.elements[i]; alert(element.id) if (Left(element.id, 15) === 'selHeaderFilter' || element.id === 'ddlHierarchy1') { g...
You could use the each function of jQuery. $('[id$=ddlHierarchy1], [id*="selHeaderFilter"]').each(function(){ var item = $(this); garrHeaderState[item.attr('id')] = item.val(); });
How can I use jQuery to select and act on an element without a guard clause? I am rewriting some old JavaScript with jQuery and would like to know how to write it more cleanly. The script I'm starting with is: for (var i = 0; i < form1.elements.length; i++) { var element = form1.elements[i]; alert(element.id) if (Left...
TITLE: How can I use jQuery to select and act on an element without a guard clause? QUESTION: I am rewriting some old JavaScript with jQuery and would like to know how to write it more cleanly. The script I'm starting with is: for (var i = 0; i < form1.elements.length; i++) { var element = form1.elements[i]; alert(ele...
[ "jquery", "jquery-selectors" ]
3
4
143
2
0
2011-05-31T11:56:14.470000
2011-05-31T11:59:54.580000
6,187,207
6,187,328
How to extract new matrix from existing one
I have a large number of entries arranged in three columns. Sample of the data is: A=[1 3 2 3 5 4 1 5; 22 25 27 20 22 21 23 27; 17 15 15 17 12 19 11 18]' I want the first column (hours) to control the entire matrix to create new matrix as follows: Anew=[1 2 3 4 5; 22.5 27 22.5 21 24.5; 14 15 16 19 15]' Where the 2nd co...
You can use ACCUMARRAY for this: Anew = [unique(A(:,1)),... cell2mat(accumarray(A(:,1),1:size(A,1),[],@(x){mean(A(x,2:3),2)}))] This uses the first column A(:,1) as indices ( x ) to pick the values in columns 2 and 3 for averaging ( mean(A(x,2:3),1) ). The curly brackets and the call to cell2mat allow you to work on bo...
How to extract new matrix from existing one I have a large number of entries arranged in three columns. Sample of the data is: A=[1 3 2 3 5 4 1 5; 22 25 27 20 22 21 23 27; 17 15 15 17 12 19 11 18]' I want the first column (hours) to control the entire matrix to create new matrix as follows: Anew=[1 2 3 4 5; 22.5 27 22....
TITLE: How to extract new matrix from existing one QUESTION: I have a large number of entries arranged in three columns. Sample of the data is: A=[1 3 2 3 5 4 1 5; 22 25 27 20 22 21 23 27; 17 15 15 17 12 19 11 18]' I want the first column (hours) to control the entire matrix to create new matrix as follows: Anew=[1 2 ...
[ "matlab", "matrix" ]
3
4
329
2
0
2011-05-31T11:56:24.750000
2011-05-31T12:06:15.637000
6,187,223
6,187,882
ASP.NET MVC templates for both client and server
Is this possible? For an example of what I want to achieve, take the Facebook commenting system. Existing comments are rendered on the server, but if I leave a new comment, it is created using AJAX on the client. Ideally, I'd like to store the template for the comment in only one place, and have access to it on both th...
I would oppose rendering server-side and then sending it back to your JS-script for bandwith and performance. Rather you should use a templating engine that works on both the server and the client. When the client wants to refresh the comments, it requests only the data for the comments and then replaces the old commen...
ASP.NET MVC templates for both client and server Is this possible? For an example of what I want to achieve, take the Facebook commenting system. Existing comments are rendered on the server, but if I leave a new comment, it is created using AJAX on the client. Ideally, I'd like to store the template for the comment in...
TITLE: ASP.NET MVC templates for both client and server QUESTION: Is this possible? For an example of what I want to achieve, take the Facebook commenting system. Existing comments are rendered on the server, but if I leave a new comment, it is created using AJAX on the client. Ideally, I'd like to store the template ...
[ "javascript", "asp.net", "asp.net-mvc", "templates", "razor" ]
9
8
3,036
3
0
2011-05-31T11:57:35.533000
2011-05-31T12:55:21.983000
6,187,227
6,187,769
How do I correctly return values from a web service?
I'm not familiar with the web services. I created a Email Service using web service. My questions is: How to make a Email Sending with have a MsgBox "Sent" and " sent Failed"?
You need to create a custom response type and return that from your service. The client (who called the service) should read the response and be responsible for popping up a message box stating whether or not the service call was a success. Here is what the type could look like: [DataContract] public class SendMessageR...
How do I correctly return values from a web service? I'm not familiar with the web services. I created a Email Service using web service. My questions is: How to make a Email Sending with have a MsgBox "Sent" and " sent Failed"?
TITLE: How do I correctly return values from a web service? QUESTION: I'm not familiar with the web services. I created a Email Service using web service. My questions is: How to make a Email Sending with have a MsgBox "Sent" and " sent Failed"? ANSWER: You need to create a custom response type and return that from y...
[ "c#", ".net", "web-services" ]
4
5
4,411
3
0
2011-05-31T11:57:47.043000
2011-05-31T12:46:10.740000
6,187,230
6,189,471
UIInterfaceOrientation in UINavigationViewController
I'm having issue with auto rotating in my view which is inside a UINavitionViewController and the navigationViewcontroller is inside a tabBarViewController. I subclassed tabBarViewController. The problem is the interfaceorientation works fine on the first view inside the tabViewController, but whenever I push to anothe...
You should have a UIViewController inside a UINavigationController inside a UITabBarController. The rotation is decided by shouldAutorotateToInterfaceOrientation: in your UIViewController. You need to override that method for every UIViewController to return the desired value, i.e., YES if you want it to rotate and NO ...
UIInterfaceOrientation in UINavigationViewController I'm having issue with auto rotating in my view which is inside a UINavitionViewController and the navigationViewcontroller is inside a tabBarViewController. I subclassed tabBarViewController. The problem is the interfaceorientation works fine on the first view inside...
TITLE: UIInterfaceOrientation in UINavigationViewController QUESTION: I'm having issue with auto rotating in my view which is inside a UINavitionViewController and the navigationViewcontroller is inside a tabBarViewController. I subclassed tabBarViewController. The problem is the interfaceorientation works fine on the...
[ "iphone", "ios" ]
0
0
281
2
0
2011-05-31T11:57:51.090000
2011-05-31T14:53:58.107000
6,187,234
6,187,259
Checking if a constant is empty
Why is this not possible? if(!empty( _MY_CONST)){... But yet this is: $my_const = _MY_CONST; if(!empty($my_const)){... define( 'QUOTA_MSG', '' ); // There is currently no message to show $message = QUOTA_MSG; if(!empty($message)){ echo $message; } I just wanted to make it a little cleaner by just referencing the const...
See the manual: empty() is a language construct, not a function. empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name)). So you'll have to use a variable - empty() is really what you want in the first place? It would return true when ...
Checking if a constant is empty Why is this not possible? if(!empty( _MY_CONST)){... But yet this is: $my_const = _MY_CONST; if(!empty($my_const)){... define( 'QUOTA_MSG', '' ); // There is currently no message to show $message = QUOTA_MSG; if(!empty($message)){ echo $message; } I just wanted to make it a little clean...
TITLE: Checking if a constant is empty QUESTION: Why is this not possible? if(!empty( _MY_CONST)){... But yet this is: $my_const = _MY_CONST; if(!empty($my_const)){... define( 'QUOTA_MSG', '' ); // There is currently no message to show $message = QUOTA_MSG; if(!empty($message)){ echo $message; } I just wanted to make...
[ "php" ]
13
17
8,999
6
0
2011-05-31T11:58:05.720000
2011-05-31T12:00:15.060000
6,187,241
6,187,440
Getting GPS strength in Android
In my app, I have to find out GPS strength. However, when I use the following code, I get 0 only for count no of satellites. So, I could not get GPS strength. My code: public void onCreate(Bundle savedInstanceState) { locMgr = (LocationManager)getSystemService(Context.LOCATION_SERVICE); locMgr.addGpsStatusListener(onGp...
private class MyGPSListener implements GpsStatus.Listener { public void onGpsStatusChanged(int event) { switch (event) { case GpsStatus.GPS_EVENT_SATELLITE_STATUS: if (mLastLocation!= null) isGPSFix = (SystemClock.elapsedRealtime() - mLastLocationMillis) < 3000; if (isGPSFix) { // A fix has been acquired. // Do someth...
Getting GPS strength in Android In my app, I have to find out GPS strength. However, when I use the following code, I get 0 only for count no of satellites. So, I could not get GPS strength. My code: public void onCreate(Bundle savedInstanceState) { locMgr = (LocationManager)getSystemService(Context.LOCATION_SERVICE); ...
TITLE: Getting GPS strength in Android QUESTION: In my app, I have to find out GPS strength. However, when I use the following code, I get 0 only for count no of satellites. So, I could not get GPS strength. My code: public void onCreate(Bundle savedInstanceState) { locMgr = (LocationManager)getSystemService(Context.L...
[ "android", "android-location" ]
0
0
5,883
3
0
2011-05-31T11:58:42.377000
2011-05-31T12:16:31.740000
6,187,251
6,187,469
Problem executing SQL query in Zend?
I was executing sql query in zend something like this and it was working: $front = Zend_Controller_Front::getInstance(); $bootstrap = $front->getParam('bootstrap'); $resource = $bootstrap->getPluginResource('db'); $dbAdapter = $resource->getDbAdapter(); $statement = $dbAdapter->query("SELECT * from tablename"); $result...
To retrieve the default Database Adapter use the following code: $bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap'); $resource = $bootstrap->getPluginResource('multidb'); $db = $resource->getDb();
Problem executing SQL query in Zend? I was executing sql query in zend something like this and it was working: $front = Zend_Controller_Front::getInstance(); $bootstrap = $front->getParam('bootstrap'); $resource = $bootstrap->getPluginResource('db'); $dbAdapter = $resource->getDbAdapter(); $statement = $dbAdapter->quer...
TITLE: Problem executing SQL query in Zend? QUESTION: I was executing sql query in zend something like this and it was working: $front = Zend_Controller_Front::getInstance(); $bootstrap = $front->getParam('bootstrap'); $resource = $bootstrap->getPluginResource('db'); $dbAdapter = $resource->getDbAdapter(); $statement ...
[ "php", "database", "zend-framework" ]
1
1
1,756
2
0
2011-05-31T11:59:40.617000
2011-05-31T12:19:21.177000
6,187,257
6,187,300
Visual Studio 2010 error: "Non-invocable member 'Microsoft.SqlServer.Management.Smo.Server.Databases' cannot be used like a method."
I get the following error when compiling a simple C# console app from MSDN docs, Setting Up a Partition Scheme for a Table in Visual C#: Non-invocable member 'Microsoft.SqlServer.Management.Smo.Server.Databases' cannot be used like a method. The offending line: //Reference the AdventureWorks2008R2 database. db = srv.Da...
I think you want db = srv.Databases["AdventureWorks2008R2"]; Databases is a property that returns a DatabaseCollection, not a method. You then use the default indexer of DatabaseCollection to get your database. See MSDN. Your linked page appears to have an mistake.
Visual Studio 2010 error: "Non-invocable member 'Microsoft.SqlServer.Management.Smo.Server.Databases' cannot be used like a method." I get the following error when compiling a simple C# console app from MSDN docs, Setting Up a Partition Scheme for a Table in Visual C#: Non-invocable member 'Microsoft.SqlServer.Manageme...
TITLE: Visual Studio 2010 error: "Non-invocable member 'Microsoft.SqlServer.Management.Smo.Server.Databases' cannot be used like a method." QUESTION: I get the following error when compiling a simple C# console app from MSDN docs, Setting Up a Partition Scheme for a Table in Visual C#: Non-invocable member 'Microsoft....
[ ".net", "visual-studio-2010", "sql-server-2008" ]
2
5
546
1
0
2011-05-31T12:00:07.823000
2011-05-31T12:03:42.723000
6,187,261
6,188,342
Notification Error When Downloading
I'm using some code from the internet in this - but i still don't know why it's not working... If i take out the Notification things, then it downloads fine (in the background - no good!). But whenever i include them, it forces quit, and i'm not sure why! Notification Setup Intent intent = new Intent(this, ListActivity...
To your new problem with the app freezing while downloading, you are actually blocking the UI process with the download itself. The way around that is to use an AsyncTask to do the downloading in the background. Google has an intro to AsyncTasks here. There are plenty of other good resources on how to download files in...
Notification Error When Downloading I'm using some code from the internet in this - but i still don't know why it's not working... If i take out the Notification things, then it downloads fine (in the background - no good!). But whenever i include them, it forces quit, and i'm not sure why! Notification Setup Intent in...
TITLE: Notification Error When Downloading QUESTION: I'm using some code from the internet in this - but i still don't know why it's not working... If i take out the Notification things, then it downloads fine (in the background - no good!). But whenever i include them, it forces quit, and i'm not sure why! Notificati...
[ "android" ]
0
2
447
1
0
2011-05-31T12:00:24.097000
2011-05-31T13:30:27.853000
6,187,269
6,188,112
Linq to Nhibernate 3.1 Group By (Or distinct)
I need to do a simple "group by" with a nhibernate query. My try were: (from adn in session.Query () orderby adn.Data select adn.Data).Distinct().ToList (); and session.Query adn.Data).Select(dat => dat).ToList () can someone help me to find a solution? My goal is to retrieve all the Distinct "Data" Column. It can be b...
Look here: Linq to NHibernate and Group By here some examples: http://msdn.microsoft.com/en-us/vcsharp/aa336754 updated try this with 3.1.0.4000: var ret = (from adn in session.Query () group adn by adn.Data into dataGroup select new {dataGroup.Key }).ToList(); update var ret = (from adn in session.Query () group adn b...
Linq to Nhibernate 3.1 Group By (Or distinct) I need to do a simple "group by" with a nhibernate query. My try were: (from adn in session.Query () orderby adn.Data select adn.Data).Distinct().ToList (); and session.Query adn.Data).Select(dat => dat).ToList () can someone help me to find a solution? My goal is to retrie...
TITLE: Linq to Nhibernate 3.1 Group By (Or distinct) QUESTION: I need to do a simple "group by" with a nhibernate query. My try were: (from adn in session.Query () orderby adn.Data select adn.Data).Distinct().ToList (); and session.Query adn.Data).Select(dat => dat).ToList () can someone help me to find a solution? My...
[ "nhibernate", "linq-to-nhibernate" ]
2
4
6,851
1
0
2011-05-31T12:00:34.237000
2011-05-31T13:12:03.780000
6,187,277
6,187,641
Android -- how to strech columns of Tablelayout without streching its children
as the title means, I want my tablelayout to evenly assign each column's width and the child of each column be centered inside the column. Setting android:stretchColumns="*" also, however, streches the child inside each column. any ideas for hacking this issue? using horizontal Linearlayout to imitate a tablerow is acc...
No hack needed.:-) Simply set the layout_width of the children to wrap_content instead of fill_parent, or to a fixed value. Set layout_gravity to center or center_horizontal. EDIT: Code added. Try this:
Android -- how to strech columns of Tablelayout without streching its children as the title means, I want my tablelayout to evenly assign each column's width and the child of each column be centered inside the column. Setting android:stretchColumns="*" also, however, streches the child inside each column. any ideas for...
TITLE: Android -- how to strech columns of Tablelayout without streching its children QUESTION: as the title means, I want my tablelayout to evenly assign each column's width and the child of each column be centered inside the column. Setting android:stretchColumns="*" also, however, streches the child inside each col...
[ "android" ]
0
0
2,298
1
0
2011-05-31T12:01:28.943000
2011-05-31T12:34:16.937000
6,187,284
6,187,315
Html.BeginForm in MVC3 is rendering too much
I have the following code. Note that I am not using a using as I want to begin and end the form in two different areas of my code. Has anyone seen this action where the helper adds "System.Web.Mvc.Html.MvcForm". I cannot see why this is added. Code: @Html.BeginForm(new { action = ViewContext.Controller.ValueProvider.Ge...
The BeginForm/EndForm helpers don't return a IHtmlResult so you should use them like this: @{ Html.BeginForm(new { action = ViewContext.Controller.ValueProvider.GetValue("action").RawValue }); }... @{ Html.EndForm(); }
Html.BeginForm in MVC3 is rendering too much I have the following code. Note that I am not using a using as I want to begin and end the form in two different areas of my code. Has anyone seen this action where the helper adds "System.Web.Mvc.Html.MvcForm". I cannot see why this is added. Code: @Html.BeginForm(new { act...
TITLE: Html.BeginForm in MVC3 is rendering too much QUESTION: I have the following code. Note that I am not using a using as I want to begin and end the form in two different areas of my code. Has anyone seen this action where the helper adds "System.Web.Mvc.Html.MvcForm". I cannot see why this is added. Code: @Html.B...
[ "asp.net-mvc", "asp.net-mvc-3" ]
0
1
4,249
4
0
2011-05-31T12:02:17.587000
2011-05-31T12:05:11.037000
6,187,287
6,187,336
Variable in query
Hi I have a little problem. I must exec query in that style. In the example, something like that declare @name varchar(max) set @name = 'ColumnID' select @name from Account that return a lot of 'ColumnID' but I will have a result column ColumnID in Account table
You'll be wanting to execute a dynamic SQL Statement: exec('select ' + @name + ' from Account'); Be wary of over-liberal use of these, as they can come with pretty hefty baggage: Advantages It gives flexibility and scalability It can reduce the number of lines of code written Disadvantages It can become very complex an...
Variable in query Hi I have a little problem. I must exec query in that style. In the example, something like that declare @name varchar(max) set @name = 'ColumnID' select @name from Account that return a lot of 'ColumnID' but I will have a result column ColumnID in Account table
TITLE: Variable in query QUESTION: Hi I have a little problem. I must exec query in that style. In the example, something like that declare @name varchar(max) set @name = 'ColumnID' select @name from Account that return a lot of 'ColumnID' but I will have a result column ColumnID in Account table ANSWER: You'll be wa...
[ "sql", "t-sql" ]
1
3
138
3
0
2011-05-31T12:02:18.867000
2011-05-31T12:06:50.033000
6,187,292
6,187,322
Check wether a InApp is purchased
in the app I am developing it is possible to buy additional Features. After I uninstall the app the shared preferences are gone. How can I check wether I bought the inApp-Product after a new installation. Thanks in advance!
You should use the Restore Transactions request to obtain information about billed items. Read more here.
Check wether a InApp is purchased in the app I am developing it is possible to buy additional Features. After I uninstall the app the shared preferences are gone. How can I check wether I bought the inApp-Product after a new installation. Thanks in advance!
TITLE: Check wether a InApp is purchased QUESTION: in the app I am developing it is possible to buy additional Features. After I uninstall the app the shared preferences are gone. How can I check wether I bought the inApp-Product after a new installation. Thanks in advance! ANSWER: You should use the Restore Transact...
[ "android", "in-app-purchase" ]
3
4
427
2
0
2011-05-31T12:02:33.877000
2011-05-31T12:05:40.573000
6,187,295
6,190,433
Server Events not got fired in Virtual Directory
I am having a sample application developed in.Net. I had created a Virtual directory for that. i want to access my application in another system ( The source code will not be in that system ),using my local IP. Like this..... http://xxx.xx.xx.120/Development/Login.aspx Now its working in another system. But the server ...
If you are using IIS, make sure it's more than just a Virtual Directory. It has to be an Application within IIS. This may help, if that is indeed your problem.
Server Events not got fired in Virtual Directory I am having a sample application developed in.Net. I had created a Virtual directory for that. i want to access my application in another system ( The source code will not be in that system ),using my local IP. Like this..... http://xxx.xx.xx.120/Development/Login.aspx N...
TITLE: Server Events not got fired in Virtual Directory QUESTION: I am having a sample application developed in.Net. I had created a Virtual directory for that. i want to access my application in another system ( The source code will not be in that system ),using my local IP. Like this..... http://xxx.xx.xx.120/Develo...
[ ".net", "iis-6" ]
0
0
33
1
0
2011-05-31T12:02:51.423000
2011-05-31T16:11:06.653000
6,187,296
6,187,346
How to set a parameter for a Java Web application
I have a web app in Java, which uses some external program (invokes a command line tool). I want to make the path of the command line program configurable, so that I can change it without re-building my application. Questions: 1) Which exactly parameter should I use (out of those available in web.xml), if it is set onl...
web.xml command SOME_COMMAND.... Java code String commandToExecute = getServletContext().getInitParameter("command"); Alternatively You can also put this thing in property/xml file in the classpath read it and put it to servlet context when context initializes.
How to set a parameter for a Java Web application I have a web app in Java, which uses some external program (invokes a command line tool). I want to make the path of the command line program configurable, so that I can change it without re-building my application. Questions: 1) Which exactly parameter should I use (ou...
TITLE: How to set a parameter for a Java Web application QUESTION: I have a web app in Java, which uses some external program (invokes a command line tool). I want to make the path of the command line program configurable, so that I can change it without re-building my application. Questions: 1) Which exactly paramete...
[ "java", "jakarta-ee" ]
10
11
9,409
4
0
2011-05-31T12:03:02.517000
2011-05-31T12:07:27.637000
6,187,297
6,187,334
Simple Object Oriented Design Example with Java
I'm studing on a project. It's a bank simulation and just for practicing OOP metodologies. Here is my code, could you help me about OOD. How can I use inheritance and interfaces on this project? public class Main { public static void main(String[] args) { User[] User = new User[10]; for(int i = 0; i < 10; i++) User[i...
You could put all your withdraw() etc other methods in an interface and create a concrete implementation of these methods.. And for inheritance you an categorize the users as privileged user or general user.You can further do categorization based on Account type as Current or Saving Account etc. interface Bank { public...
Simple Object Oriented Design Example with Java I'm studing on a project. It's a bank simulation and just for practicing OOP metodologies. Here is my code, could you help me about OOD. How can I use inheritance and interfaces on this project? public class Main { public static void main(String[] args) { User[] User = ...
TITLE: Simple Object Oriented Design Example with Java QUESTION: I'm studing on a project. It's a bank simulation and just for practicing OOP metodologies. Here is my code, could you help me about OOD. How can I use inheritance and interfaces on this project? public class Main { public static void main(String[] args)...
[ "java" ]
0
1
2,416
3
0
2011-05-31T12:03:16.637000
2011-05-31T12:06:41.313000
6,187,299
6,187,553
Recommended approach for model validation that needs to touch the Db
Up to now, most of our validation is performed using validation attributes on our view models. One additional validation check we need to perform is to validate that a string doesn't already exist in our database. Originally I was just handling this check within the controller action and then adding an error into Model...
I would recommend doing this type of validation at the service layer and not bother with data annotations.
Recommended approach for model validation that needs to touch the Db Up to now, most of our validation is performed using validation attributes on our view models. One additional validation check we need to perform is to validate that a string doesn't already exist in our database. Originally I was just handling this c...
TITLE: Recommended approach for model validation that needs to touch the Db QUESTION: Up to now, most of our validation is performed using validation attributes on our view models. One additional validation check we need to perform is to validate that a string doesn't already exist in our database. Originally I was ju...
[ "asp.net-mvc", "validation", "asp.net-mvc-3" ]
3
4
614
1
0
2011-05-31T12:03:39.753000
2011-05-31T12:27:14.110000
6,187,310
6,201,204
Parsing text from CMemFile line by line
I have got a huge text file loaded into a CMemFile object and would like to parse it line by line (separated by newline chars). Originally it is a zip file on disk, and I unzip it into memory to parse it, therefore the CMemFile. One working way to read line by line is this (m_file is a smart pointer to a CMemFile ): CA...
Using a profiler showed that 75 % of process time was wasted in this line of code: ProcessLine(string(readBuffer, posNewline)); Mainly the creation of the temporary string caused a big overhead (many allocs). The ProcessLine function itself contains no code. By changing the declaration from: void ProcessLine(const std:...
Parsing text from CMemFile line by line I have got a huge text file loaded into a CMemFile object and would like to parse it line by line (separated by newline chars). Originally it is a zip file on disk, and I unzip it into memory to parse it, therefore the CMemFile. One working way to read line by line is this (m_fil...
TITLE: Parsing text from CMemFile line by line QUESTION: I have got a huge text file loaded into a CMemFile object and would like to parse it line by line (separated by newline chars). Originally it is a zip file on disk, and I unzip it into memory to parse it, therefore the CMemFile. One working way to read line by l...
[ "c++", "windows", "mfc" ]
2
2
1,928
4
0
2011-05-31T12:04:38.067000
2011-06-01T12:33:24.140000
6,187,326
6,187,394
Extract portion of these urls with RegEx and c#
I have to check if these two url match a pattern (or 2, to be more accurate). If so, I'd like to extract some portion of data. 1) /selector/ en /any-string-chain-you-want.aspx?FamiId= 32 Then I need to extract "en" and "32" into variables. To me the regex expression should like roughly something like /selector/{0}/any-...
This is the regex: /selector/([a-z]{2})/.+?\.aspx\?FamiId=([0-9]+) Code: var regex = new Regex(@"/selector/([a-z]{2})/.+?\.aspx\?FamiId=([0-9]+)"); var test = "/selector/en/any-string-chain-you-want.aspx?FamiId=32"; foreach (Match match in regex.Matches(test)) { var lang = match.Groups[1].Value; var id = Convert.ToInt...
Extract portion of these urls with RegEx and c# I have to check if these two url match a pattern (or 2, to be more accurate). If so, I'd like to extract some portion of data. 1) /selector/ en /any-string-chain-you-want.aspx?FamiId= 32 Then I need to extract "en" and "32" into variables. To me the regex expression shoul...
TITLE: Extract portion of these urls with RegEx and c# QUESTION: I have to check if these two url match a pattern (or 2, to be more accurate). If so, I'd like to extract some portion of data. 1) /selector/ en /any-string-chain-you-want.aspx?FamiId= 32 Then I need to extract "en" and "32" into variables. To me the rege...
[ "c#", "regex" ]
0
1
191
7
0
2011-05-31T12:05:54.267000
2011-05-31T12:12:28.930000
6,187,337
6,188,305
Print of HTML table drops cells in first column
I have identified a strange problem in Internet Explorer and Chrome: I have a simple HTML table with no layout CSS, 2 columns, no styles, and width set to 100%. When I attempt to print this table in Internet Explorer (all versions) and Chrome, the first cell on the 2nd page and later is dropped. Snippet of the HTML: Da...
IE has issues printing when the doctype isn't set correctly. Try adding a doctype at top of the page. In my test adding to the top of your sample fixed the issue.
Print of HTML table drops cells in first column I have identified a strange problem in Internet Explorer and Chrome: I have a simple HTML table with no layout CSS, 2 columns, no styles, and width set to 100%. When I attempt to print this table in Internet Explorer (all versions) and Chrome, the first cell on the 2nd pa...
TITLE: Print of HTML table drops cells in first column QUESTION: I have identified a strange problem in Internet Explorer and Chrome: I have a simple HTML table with no layout CSS, 2 columns, no styles, and width set to 100%. When I attempt to print this table in Internet Explorer (all versions) and Chrome, the first ...
[ "html", "printing" ]
5
2
2,173
4
0
2011-05-31T12:06:52.187000
2011-05-31T13:26:37.053000
6,187,351
6,188,616
Is Camel Spring ws compatible with spring ws 2.0.2.RELEASE?
The documentation says that camel-spring-ws(v2.7.1) officially supports spring-ws 1.5.9, but doesn't mention spring-ws 2.0.2.RELEASE. I'd like to stick with 2.0.2.RELEASE instead trying to retrofit 1.5.9 to work with Spring 3.0, but I'm hitting enough roadblocks to make me think that it's just not going to work. Has an...
There is a ticket to upgrade to use Spring 2.0.2. The was a bug in Spring WS 2.0.0 and 2.0.1 releases in terms of not working with OSGi. That should hopefully be fixed in Spring WS 2.0.2. If you are not using OSGi you can most likely manually upgrade to Spring WS 2.0.x. But it requires a bit of work as some JARs have c...
Is Camel Spring ws compatible with spring ws 2.0.2.RELEASE? The documentation says that camel-spring-ws(v2.7.1) officially supports spring-ws 1.5.9, but doesn't mention spring-ws 2.0.2.RELEASE. I'd like to stick with 2.0.2.RELEASE instead trying to retrofit 1.5.9 to work with Spring 3.0, but I'm hitting enough roadbloc...
TITLE: Is Camel Spring ws compatible with spring ws 2.0.2.RELEASE? QUESTION: The documentation says that camel-spring-ws(v2.7.1) officially supports spring-ws 1.5.9, but doesn't mention spring-ws 2.0.2.RELEASE. I'd like to stick with 2.0.2.RELEASE instead trying to retrofit 1.5.9 to work with Spring 3.0, but I'm hitti...
[ "spring-ws", "apache-camel" ]
1
3
270
1
0
2011-05-31T12:07:38.617000
2011-05-31T13:50:59.643000
6,187,355
6,187,378
How do you get the name of a calling module as a string using inspect in Python (I keep getting a module object)
I'm trying to get the name of a calling module by using inspect. When I return what should be the module string, I get this: I've looked at the docs and couldn't see anything about what the reason for this may be (I'm tired, so I may have missed it). Here is the class import inspect class Wrapper(): def getView(self,...
inspect.getmodule() returns the module object itself, not its name. Try replacing str(inspect.getmodule(frm[0])) with inspect.getmodule(frm[0]).__name__ Also, bear in mind that inspect.getmodule() can return None.
How do you get the name of a calling module as a string using inspect in Python (I keep getting a module object) I'm trying to get the name of a calling module by using inspect. When I return what should be the module string, I get this: I've looked at the docs and couldn't see anything about what the reason for this m...
TITLE: How do you get the name of a calling module as a string using inspect in Python (I keep getting a module object) QUESTION: I'm trying to get the name of a calling module by using inspect. When I return what should be the module string, I get this: I've looked at the docs and couldn't see anything about what the...
[ "python", "module", "inspect" ]
1
4
5,128
2
0
2011-05-31T12:08:17.840000
2011-05-31T12:11:14.950000
6,187,357
6,187,411
access a property in UIView in Viewcontroller?
I have been given a project to edit. I think this is a simple question but want to explain it in detail.I usually set up iPhone projects with interface builder and then have a view controller h and m file. However this has been set up in a different way I am new to, the view has been coded. The h file is a simple viewc...
Synthesize the variable in MainView. Have an instance of the MainView in MainViewController and then you can access it by MainView *mv = [[MainView alloc] init]; mv.firstInteger // gives you the variable.
access a property in UIView in Viewcontroller? I have been given a project to edit. I think this is a simple question but want to explain it in detail.I usually set up iPhone projects with interface builder and then have a view controller h and m file. However this has been set up in a different way I am new to, the vi...
TITLE: access a property in UIView in Viewcontroller? QUESTION: I have been given a project to edit. I think this is a simple question but want to explain it in detail.I usually set up iPhone projects with interface builder and then have a view controller h and m file. However this has been set up in a different way I...
[ "iphone", "uiview", "uiviewcontroller" ]
0
0
214
2
0
2011-05-31T12:08:34.127000
2011-05-31T12:13:31.517000
6,187,358
6,189,733
How to avoid calls to png_read_filter_row and transform_premul_argb_fn in Core Graphics?
I'm having some performance problems with images in my app. I assign a UIImageView to the backgroundView property of a UITableViewCell. The Time Profiler instrument tells me that I'm spending most of my time here: My table view has semi-transparent cells to let the background shine through. I know this is not good. But...
Make sure your images are uncompressed after loading. Use the following code from http://markmail.org/message/vav7a5khncak2u3h UIGraphicsBeginImageContext(image.size); [image drawAtPoint:CGPointZero blendMode:kCGBlendModeCopy alpha:1.0]; UIImage *decompressed = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEnd...
How to avoid calls to png_read_filter_row and transform_premul_argb_fn in Core Graphics? I'm having some performance problems with images in my app. I assign a UIImageView to the backgroundView property of a UITableViewCell. The Time Profiler instrument tells me that I'm spending most of my time here: My table view has...
TITLE: How to avoid calls to png_read_filter_row and transform_premul_argb_fn in Core Graphics? QUESTION: I'm having some performance problems with images in my app. I assign a UIImageView to the backgroundView property of a UITableViewCell. The Time Profiler instrument tells me that I'm spending most of my time here:...
[ "iphone", "ios", "performance", "ipad", "core-graphics" ]
1
4
463
1
0
2011-05-31T12:08:48.137000
2011-05-31T15:13:31.510000
6,187,383
6,187,990
Rails 3: Querying from associated tables
Im very new to Ruby on Rails 3 and ActiveRecord and seem to have been thrown in at the deep end at work. Im struggling to get to grips with querying data from multiple tables using joins. A lot of the examples Ive seen either seem to be based on much simpler queries or use < rails 3 syntax. Given that I know the busine...
Basically, you do not need to specify the joins: # This gives you all the BusinessUnitGroupItems for that BusinessUnitGroup BusinessUnitGroup.find(id).business_unit_group_items # BusinessUnitGroupItem seems to be a rich join table so you might # be iterested in the items directly: class BusinessUnitGroup < ActiveRecor...
Rails 3: Querying from associated tables Im very new to Ruby on Rails 3 and ActiveRecord and seem to have been thrown in at the deep end at work. Im struggling to get to grips with querying data from multiple tables using joins. A lot of the examples Ive seen either seem to be based on much simpler queries or use < rai...
TITLE: Rails 3: Querying from associated tables QUESTION: Im very new to Ruby on Rails 3 and ActiveRecord and seem to have been thrown in at the deep end at work. Im struggling to get to grips with querying data from multiple tables using joins. A lot of the examples Ive seen either seem to be based on much simpler qu...
[ "ruby-on-rails", "ruby-on-rails-3", "activerecord" ]
0
1
364
1
0
2011-05-31T12:11:38.857000
2011-05-31T13:03:36.733000
6,187,385
6,187,587
Create variable with list of strings
I would like to know if it's possible to use the content of a variable list of strings to create a new variable. As an example: str={"cow","monkey"} these strings are extracted from a file. Now I would like to refer to these strings as if it was a variable. So the variable cow could be set to {4,2,3} or anything else. ...
The simplest would be to just manually use symbols cow and monkey rather than strings: In[309]:= cow = 1; monkey = 2; {cow, monkey} Out[311]= {1, 2} But this is probably not what you asked. If you want to automatically convert strings to variables, then what you have to do (if I understood the question correctly) is t...
Create variable with list of strings I would like to know if it's possible to use the content of a variable list of strings to create a new variable. As an example: str={"cow","monkey"} these strings are extracted from a file. Now I would like to refer to these strings as if it was a variable. So the variable cow could...
TITLE: Create variable with list of strings QUESTION: I would like to know if it's possible to use the content of a variable list of strings to create a new variable. As an example: str={"cow","monkey"} these strings are extracted from a file. Now I would like to refer to these strings as if it was a variable. So the ...
[ "list", "variables", "string", "wolfram-mathematica" ]
5
4
5,367
3
0
2011-05-31T12:11:55.040000
2011-05-31T12:29:47.027000
6,187,387
6,190,346
The purpose of creating anonymous types in AutoFixture for class under tests?
I recently started using AutoFixture library (http://autofixture.codeplex.com/) for Unit Testing and I quite like it. I got this code sample from the AutoFixture CodePlex website. My question is in regards to line number 8. 1. [TestMethod] 2. public void IntroductoryTest() 3. { 4. // Fixture setup 5. Fixture fixture = ...
In the trivial case you are correct - there is no material difference. However, SUT API Encapsulation has its uses -- as your System Under Test and its Fixture Object s get more interesting than something with a default ctor (does it really have no dependencies?), e.g.: MyClass requires stuff to be fed into it's constr...
The purpose of creating anonymous types in AutoFixture for class under tests? I recently started using AutoFixture library (http://autofixture.codeplex.com/) for Unit Testing and I quite like it. I got this code sample from the AutoFixture CodePlex website. My question is in regards to line number 8. 1. [TestMethod] 2....
TITLE: The purpose of creating anonymous types in AutoFixture for class under tests? QUESTION: I recently started using AutoFixture library (http://autofixture.codeplex.com/) for Unit Testing and I quite like it. I got this code sample from the AutoFixture CodePlex website. My question is in regards to line number 8. ...
[ "unit-testing", "c#-4.0", "autofixture" ]
10
6
2,668
1
0
2011-05-31T12:12:10.080000
2011-05-31T16:02:52.983000
6,187,392
6,187,420
How to find first chance exceptions from output window
I'm getting first chance exceptions in my output window in debug mode. How do I find where they're coming from? Do I have to put a breakpoint in every catch? A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll
Go to Debug, Exceptions ( Ctrl + D, E ), and check the types you're interested in. This dialog tells the debugger to break whenever an exception is thrown, regardless of whether it's caught.
How to find first chance exceptions from output window I'm getting first chance exceptions in my output window in debug mode. How do I find where they're coming from? Do I have to put a breakpoint in every catch? A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll
TITLE: How to find first chance exceptions from output window QUESTION: I'm getting first chance exceptions in my output window in debug mode. How do I find where they're coming from? Do I have to put a breakpoint in every catch? A first chance exception of type 'System.IO.IOException' occurred in mscorlib.dll ANSWER...
[ "c#", "exception" ]
14
28
4,579
1
0
2011-05-31T12:12:19.047000
2011-05-31T12:14:35.680000
6,187,393
6,251,725
How do I stop the winform designer putting the version of custom controls in a .resx file?
We are getting issues with both the merging of.resx files and the winform designer not being able to open form/controls due to the designer putting the version of custom controls in.resx files. I would like it to always put in Version=0.0.0.0. This is what it is doing: KSS.Common.Windows.Forms.Splitter, KSS.Common.Wind...
The best solution I can think of doesn't involve stopping the reference, and isn't very neat, but it should ease the symptoms: You could create a custom tool ResXResourceReader / ResXResourceWriter (or just XDocument classes) to run on the.resx files. You could add it to the Context Menu for files (Tools, Customise, Co...
How do I stop the winform designer putting the version of custom controls in a .resx file? We are getting issues with both the merging of.resx files and the winform designer not being able to open form/controls due to the designer putting the version of custom controls in.resx files. I would like it to always put in Ve...
TITLE: How do I stop the winform designer putting the version of custom controls in a .resx file? QUESTION: We are getting issues with both the merging of.resx files and the winform designer not being able to open form/controls due to the designer putting the version of custom controls in.resx files. I would like it t...
[ ".net", "winforms", "visual-studio-2010", "user-controls" ]
2
3
633
1
0
2011-05-31T12:12:22.970000
2011-06-06T12:04:14.543000
6,187,398
6,187,576
code invalid according to W3C - dont know how to solve these
I have a rather big website, but it has 31 errors. I seriously dont know how to fix these. any help on any error fix would be appreciated. Even some i dont know why it displays an error: http://www.horecavacaturebank.nl http://validator.w3.org/check?uri=http%3A%2F%2Fwww.horecavacaturebank.nl%2F&charset=%28detect+automa...
my experience abt w3c validation, just read carefully and is tells itself what is problem, here in you page attributes used like rel are not what can say w3c not defined or permitted yet, one more simple error there used li tag but parent tag should be there either ul or ol. More to say is we have to validate when our ...
code invalid according to W3C - dont know how to solve these I have a rather big website, but it has 31 errors. I seriously dont know how to fix these. any help on any error fix would be appreciated. Even some i dont know why it displays an error: http://www.horecavacaturebank.nl http://validator.w3.org/check?uri=http%...
TITLE: code invalid according to W3C - dont know how to solve these QUESTION: I have a rather big website, but it has 31 errors. I seriously dont know how to fix these. any help on any error fix would be appreciated. Even some i dont know why it displays an error: http://www.horecavacaturebank.nl http://validator.w3.o...
[ "html", "css", "w3c" ]
0
0
99
1
0
2011-05-31T12:12:36.990000
2011-05-31T12:28:57.823000
6,187,399
6,187,702
Controlling package dependencies in Java (Eclipse)
I have a Java project (in Eclipse) consisting of several packages. I would like to control the dependencies between packages so that, for example, one package couldn't use some other package in the project. The reason for this is that I am going to make a self-contained jar from a subset of packages. Do I have to separ...
Well since Aspectj is now an Eclipse Project, I guess an Aspectj solution qualifies as well. AspectJ is great for policy enforcements like that, because it lets you create compile-time warnings and errors based on pointcuts. And if you use the AspectJ Developer Tools, you get aspects up and running in Eclipse. Here's a...
Controlling package dependencies in Java (Eclipse) I have a Java project (in Eclipse) consisting of several packages. I would like to control the dependencies between packages so that, for example, one package couldn't use some other package in the project. The reason for this is that I am going to make a self-containe...
TITLE: Controlling package dependencies in Java (Eclipse) QUESTION: I have a Java project (in Eclipse) consisting of several packages. I would like to control the dependencies between packages so that, for example, one package couldn't use some other package in the project. The reason for this is that I am going to ma...
[ "java", "eclipse", "dependencies", "package" ]
2
5
1,016
1
0
2011-05-31T12:12:41.100000
2011-05-31T12:39:22.413000
6,187,402
6,187,479
asp.net project publish on iis error on brow page
i publish my ASP.NET project as. Build / publish. choice of publish is file system and directory is IIS/wwwroot Using asp.net and iis7. When I want browse page from browser it show error with web-config file. You can see it on my page http://isprojekty.fri.uniza.sk/MainForm.aspx Can you help me where is problem? thx.
If you can remotely access the server where it is deployed, you could try accessing your site from there, and then you can see the error, if you have customErrors="remoteOnly". Otherwise, you will need to update your web.config to allow you to see the error message (but put it back again right away, because everyone el...
asp.net project publish on iis error on brow page i publish my ASP.NET project as. Build / publish. choice of publish is file system and directory is IIS/wwwroot Using asp.net and iis7. When I want browse page from browser it show error with web-config file. You can see it on my page http://isprojekty.fri.uniza.sk/Main...
TITLE: asp.net project publish on iis error on brow page QUESTION: i publish my ASP.NET project as. Build / publish. choice of publish is file system and directory is IIS/wwwroot Using asp.net and iis7. When I want browse page from browser it show error with web-config file. You can see it on my page http://isprojekty...
[ "asp.net", "iis-7", "windows-server-2008" ]
1
1
127
1
0
2011-05-31T12:12:55.187000
2011-05-31T12:20:23.160000
6,187,404
6,187,432
DataRowCollection issue in datatable
What is the difference between test.Rows[0] and test.Rows[test.Rows.Count - 1] if rows is a collection in a datatable.For example if count =o or count = -1 what will be the situation here My intention was to determine the last value in that collection.If no value is there in that collection will it make problems Previo...
In a zero-based collection / array / list, etc; item 0 and item count - 1 are the first and last items respectively. For example if count =o If the collection does not have any items, either of the above will usually result in an out-of-range exception. So... don't do that. Check the size first. or count = -1 If the co...
DataRowCollection issue in datatable What is the difference between test.Rows[0] and test.Rows[test.Rows.Count - 1] if rows is a collection in a datatable.For example if count =o or count = -1 what will be the situation here My intention was to determine the last value in that collection.If no value is there in that co...
TITLE: DataRowCollection issue in datatable QUESTION: What is the difference between test.Rows[0] and test.Rows[test.Rows.Count - 1] if rows is a collection in a datatable.For example if count =o or count = -1 what will be the situation here My intention was to determine the last value in that collection.If no value i...
[ "c#", "collections" ]
2
4
354
1
0
2011-05-31T12:13:17.940000
2011-05-31T12:15:52.940000
6,187,412
6,187,500
python save url list in txt file
Hello I am trying to make a python function to save a list of URLs in.txt file Example: visit http://forum.domain.com/ and save all viewtopic.php?t= word URL in.txt file http://forum.domain.com/viewtopic.php?t=1333 http://forum.domain.com/viewtopic.php?t=2333 I use this function but not save I am very new in python can...
This is far from trivial and can have quite a few corner cases (I suppose the page you're referring to is a web page) To give you a few pointers, you need to: download the web page: you're already doing it (in data ) extract the URLs: this is hard, most probably, you'll want to usae an html parser, extract tags, fetch ...
python save url list in txt file Hello I am trying to make a python function to save a list of URLs in.txt file Example: visit http://forum.domain.com/ and save all viewtopic.php?t= word URL in.txt file http://forum.domain.com/viewtopic.php?t=1333 http://forum.domain.com/viewtopic.php?t=2333 I use this function but not...
TITLE: python save url list in txt file QUESTION: Hello I am trying to make a python function to save a list of URLs in.txt file Example: visit http://forum.domain.com/ and save all viewtopic.php?t= word URL in.txt file http://forum.domain.com/viewtopic.php?t=1333 http://forum.domain.com/viewtopic.php?t=2333 I use thi...
[ "python" ]
1
4
2,225
1
0
2011-05-31T12:13:32.637000
2011-05-31T12:22:30.900000
6,187,415
6,190,540
Facebook Like button functionality without IFRAME or Javascript
I want to add Facebook "Like" functionality to a native mobile app i.e. Not one running in a browser. I can retrieve the Likes for an item from the Graph API but I cannot see how to POST a "Like" operation using that API. How do I do that? Am I going to have do have a browser control hidden with the app that uses an IF...
According to the Facebook graph api documentation, you can like any object that has a /likes connection by posting to https://graph.facebook.com/OBJECT_ID/likes. This would work for friends posts, comments, etc. But I don't believe there is an API to "like" a page (become a fan) and probably won't be because it would b...
Facebook Like button functionality without IFRAME or Javascript I want to add Facebook "Like" functionality to a native mobile app i.e. Not one running in a browser. I can retrieve the Likes for an item from the Graph API but I cannot see how to POST a "Like" operation using that API. How do I do that? Am I going to ha...
TITLE: Facebook Like button functionality without IFRAME or Javascript QUESTION: I want to add Facebook "Like" functionality to a native mobile app i.e. Not one running in a browser. I can retrieve the Likes for an item from the Graph API but I cannot see how to POST a "Like" operation using that API. How do I do that...
[ "facebook", "facebook-graph-api" ]
1
2
2,146
1
0
2011-05-31T12:14:05.390000
2011-05-31T16:21:09.020000
6,187,421
6,187,645
Exposing class structure through WCF?
I have a simple class that contains the required properties for a request to the service. I want a consumer to instantiate this class on their end, fill it up, then pass it back to the service. Maybe the terminology I'm using isn't exactly right, but I'm sure I've read some project notes in the past where this was poss...
Typically, SearchRequestObject would be one of the objects used in one of your service methods, for instance: [ServiceContract(ConfigurationName = "IWCFService")] public interface ICascadeManagementService { [OperationContract(Action = "http://tempuri.org/IWCFService/DoSearch")] SearchResponseObject DoSearch(SearchRequ...
Exposing class structure through WCF? I have a simple class that contains the required properties for a request to the service. I want a consumer to instantiate this class on their end, fill it up, then pass it back to the service. Maybe the terminology I'm using isn't exactly right, but I'm sure I've read some project...
TITLE: Exposing class structure through WCF? QUESTION: I have a simple class that contains the required properties for a request to the service. I want a consumer to instantiate this class on their end, fill it up, then pass it back to the service. Maybe the terminology I'm using isn't exactly right, but I'm sure I've...
[ "asp.net-mvc", "wcf", "c#-4.0" ]
0
1
152
1
0
2011-05-31T12:14:36.373000
2011-05-31T12:34:36.407000
6,187,427
6,187,506
How safe is the apple binary (secret key saftey)
I'm developing an application for iPhone which uses a HTTP request to get quote data from a webserver. I am working with another developer who is managing the web service. We are using an MD5 encryption (simple xor) to pass the data between iPhone and webserver. He posed a question to me this morning which is quite fra...
The binary is not even remotely safe. Whether through the iTunes download or on a jailbroken iPhone, there's nothing you can do other than obfuscation, which a determined adversary will always get past. Do not ever rely on the "secrecy" of something embedded in a client application, it is not secret. Ever. On any platf...
How safe is the apple binary (secret key saftey) I'm developing an application for iPhone which uses a HTTP request to get quote data from a webserver. I am working with another developer who is managing the web service. We are using an MD5 encryption (simple xor) to pass the data between iPhone and webserver. He posed...
TITLE: How safe is the apple binary (secret key saftey) QUESTION: I'm developing an application for iPhone which uses a HTTP request to get quote data from a webserver. I am working with another developer who is managing the web service. We are using an MD5 encryption (simple xor) to pass the data between iPhone and w...
[ "iphone", "binary", "secret-key" ]
5
8
338
1
0
2011-05-31T12:15:14.580000
2011-05-31T12:23:14.873000
6,187,430
6,188,716
Resizing image view and movie player controller in xcode when orientation changes
In my app i have an image view in one view controller and a movie player in other view controller.Now i want to display the image or movie in both mode i.e in portrait mode and in landscape mode.How can i define frame for each and how do i notify it when the view changes its position from one to other. Thanks, Christy
Checkout the documentation for UIViewController and look at the Responding to View Rotation Events Methods like: - willRotateToInterfaceOrientation:duration: You can put your code for setting the new frame sizes in those functions along with any notification functions you want. player.view.frame = CGRectMake(x,y,w,h);
Resizing image view and movie player controller in xcode when orientation changes In my app i have an image view in one view controller and a movie player in other view controller.Now i want to display the image or movie in both mode i.e in portrait mode and in landscape mode.How can i define frame for each and how do ...
TITLE: Resizing image view and movie player controller in xcode when orientation changes QUESTION: In my app i have an image view in one view controller and a movie player in other view controller.Now i want to display the image or movie in both mode i.e in portrait mode and in landscape mode.How can i define frame fo...
[ "xcode", "ipad", "uiimageview", "mpmovieplayercontroller" ]
0
0
986
2
0
2011-05-31T12:15:47.510000
2011-05-31T13:58:50.853000
6,187,434
6,189,290
Using a table purely for its function as an index to facilitate searches
I am writing an application to carry out analysis on online poker hands. I represent a playing card with a number 1-52. I do this in a way which allows me easily to extract the suit and denomination of the card. I am writing in Java and am using MySQL as the database. An example of a problem I am facing is described be...
An enum can seem very valid here -- the data basically never changes, unless you also intend to play Tarot (has a Cavalier between J and Q) or Rummy (adds 2-3 jokers per deck). That said, for cards I'd personally stick to an int because you can use it to introduce sorting and where-condition magic. For instance, if you...
Using a table purely for its function as an index to facilitate searches I am writing an application to carry out analysis on online poker hands. I represent a playing card with a number 1-52. I do this in a way which allows me easily to extract the suit and denomination of the card. I am writing in Java and am using M...
TITLE: Using a table purely for its function as an index to facilitate searches QUESTION: I am writing an application to carry out analysis on online poker hands. I represent a playing card with a number 1-52. I do this in a way which allows me easily to extract the suit and denomination of the card. I am writing in J...
[ "database-design" ]
0
0
90
2
0
2011-05-31T12:16:01.067000
2011-05-31T14:40:37.910000
6,187,447
6,210,188
Inheritance problem in a Java/CXF/SOAP app?
I'm working on an application that uses cxf, the base of the app is a wsdl file and I'm having some trouble working with the inheritance. I'll try to make a clear example (not exactly what I'm working on, but it should sum up the idea). In the type definition I have the following When the java code is generated using w...
I don't think the javascript clients support type inheritance at all. There are a bunch of restrictions on it. Patches would be welcome.:-) In particular, the javascript would need to be updated to output an xsi:type="ns:Child1" attribute so JAXB can properly map it.
Inheritance problem in a Java/CXF/SOAP app? I'm working on an application that uses cxf, the base of the app is a wsdl file and I'm having some trouble working with the inheritance. I'll try to make a clear example (not exactly what I'm working on, but it should sum up the idea). In the type definition I have the follo...
TITLE: Inheritance problem in a Java/CXF/SOAP app? QUESTION: I'm working on an application that uses cxf, the base of the app is a wsdl file and I'm having some trouble working with the inheritance. I'll try to make a clear example (not exactly what I'm working on, but it should sum up the idea). In the type definitio...
[ "java", "inheritance", "cxf" ]
2
0
2,954
2
0
2011-05-31T12:16:57.500000
2011-06-02T03:56:17.027000
6,187,449
6,188,307
Intellij IDEA and mvp4g APT annotation checking
Was anyone able to configure annotation checking for mvp4g in their project? For eclipse there is this plugin ( http://code.google.com/p/mvp4g/wiki/APT ) so I'm just wondering if it'll work with Intellij's IDEA.
I have no experience with this, but in Idea 10.5 there is Settings -> Compiler -> Annotation Processors. You might give it a try.
Intellij IDEA and mvp4g APT annotation checking Was anyone able to configure annotation checking for mvp4g in their project? For eclipse there is this plugin ( http://code.google.com/p/mvp4g/wiki/APT ) so I'm just wondering if it'll work with Intellij's IDEA.
TITLE: Intellij IDEA and mvp4g APT annotation checking QUESTION: Was anyone able to configure annotation checking for mvp4g in their project? For eclipse there is this plugin ( http://code.google.com/p/mvp4g/wiki/APT ) so I'm just wondering if it'll work with Intellij's IDEA. ANSWER: I have no experience with this, b...
[ "gwt", "intellij-idea", "annotations", "mvp4g" ]
3
3
481
1
0
2011-05-31T12:17:03.250000
2011-05-31T13:26:52.827000
6,187,450
6,188,063
Managing deployment-specific configurations with Spring
What strategies have people developed for controlling deployment configurations with Spring? I've already extracted out the environmental details (e.g. jdbc connection parameters) into a properties file, but I'm looking for some way of managing deployment details that aren't simple strings. Specifically, I'm currently ...
Use @Bean to define your datasource in code, rather than in XML. That way you can apply conditional logic to how the bean is created. For example: @Value("${url:jdbc:hsqldb:mem:memdb}") String url; // username, password, etc @Value("${jndiName:}") String jndiName; @Bean public DataSource dataSource() { DataSource ds...
Managing deployment-specific configurations with Spring What strategies have people developed for controlling deployment configurations with Spring? I've already extracted out the environmental details (e.g. jdbc connection parameters) into a properties file, but I'm looking for some way of managing deployment details ...
TITLE: Managing deployment-specific configurations with Spring QUESTION: What strategies have people developed for controlling deployment configurations with Spring? I've already extracted out the environmental details (e.g. jdbc connection parameters) into a properties file, but I'm looking for some way of managing d...
[ "spring", "deployment", "configuration" ]
1
2
306
1
0
2011-05-31T12:17:15.643000
2011-05-31T13:08:52.363000
6,187,453
6,187,564
Translate code from Java to .NET
I need to translate this fragment from Java to.NET (rather C#, but I know Visual Basic too). This is code: typeStrings = new Dictionary (); Field[] fields = Type.class.getDeclaredFields(); for (Field field: fields) { try { typeStrings.put(field.getInt(null), field.getName()); } catch (IllegalArgumentException e) { //...
var typeStrings = new Dictionary (); FieldInfo[] fields = yourObject.GetType().GetFields(BindingFlags.Public | BindingFlags.Instance); foreach (var field in fields) { typeStrings.Add((int)field.GetValue(yourObject), field.Name); }
Translate code from Java to .NET I need to translate this fragment from Java to.NET (rather C#, but I know Visual Basic too). This is code: typeStrings = new Dictionary (); Field[] fields = Type.class.getDeclaredFields(); for (Field field: fields) { try { typeStrings.put(field.getInt(null), field.getName()); } catch ...
TITLE: Translate code from Java to .NET QUESTION: I need to translate this fragment from Java to.NET (rather C#, but I know Visual Basic too). This is code: typeStrings = new Dictionary (); Field[] fields = Type.class.getDeclaredFields(); for (Field field: fields) { try { typeStrings.put(field.getInt(null), field.ge...
[ "c#", "java", ".net", "translation", "equivalent" ]
1
2
1,127
3
0
2011-05-31T12:17:21.573000
2011-05-31T12:27:58.990000
6,187,456
6,187,535
TCP vs UDP on video stream
I just came home from my exam in network-programming, and one of the question they asked us was "If you are going to stream video, would you use TCP or UDP? Give an explanation for both stored video and live video-streams". To this question they simply expected a short answer of TCP for stored video and UDP for live vi...
Drawbacks of using TCP for live video: As you mentioned, TCP buffers the unacknowledged segments for every client. In some cases this is undesirable, such as TCP streaming for very popular live events: your list of simultaneous clients (and buffering requirements) are large in this case. Pre-recorded video-casts typica...
TCP vs UDP on video stream I just came home from my exam in network-programming, and one of the question they asked us was "If you are going to stream video, would you use TCP or UDP? Give an explanation for both stored video and live video-streams". To this question they simply expected a short answer of TCP for store...
TITLE: TCP vs UDP on video stream QUESTION: I just came home from my exam in network-programming, and one of the question they asked us was "If you are going to stream video, would you use TCP or UDP? Give an explanation for both stored video and live video-streams". To this question they simply expected a short answe...
[ "networking", "video", "tcp", "udp", "video-streaming" ]
111
101
180,819
13
0
2011-05-31T12:17:27.637000
2011-05-31T12:25:55.090000
6,187,465
6,188,625
Sorl-thumbnail bad url's
I setup sorl-thumbnail according to instructions, but none of the images are appearing when I try to use the templatetags in my app. It appears that the url's are not valid, but it's not clear what additional configuration is needed. A image like like this is generated: How does "cache/..." get resolved to a request fo...
You need to configure MEDIA_URL correctly. The "url" attribute of an ImageFile is basically just a pass-through from the underlying storage backend. For out-of-the-box Django, the upload_to path is appended to MEDIA_URL to generate the URL for a FileField. What you have: '' + 'cache/e5/25/e5253a328b9130ecd7d820893f44b0...
Sorl-thumbnail bad url's I setup sorl-thumbnail according to instructions, but none of the images are appearing when I try to use the templatetags in my app. It appears that the url's are not valid, but it's not clear what additional configuration is needed. A image like like this is generated: How does "cache/..." get...
TITLE: Sorl-thumbnail bad url's QUESTION: I setup sorl-thumbnail according to instructions, but none of the images are appearing when I try to use the templatetags in my app. It appears that the url's are not valid, but it's not clear what additional configuration is needed. A image like like this is generated: How do...
[ "django", "sorl-thumbnail" ]
5
6
4,497
1
0
2011-05-31T12:19:02.893000
2011-05-31T13:51:46.057000
6,187,470
6,192,575
Cast to multiple interfaces
Possible Duplicate: Casting an object to two interfaces at the same time, to call a generic method I'm fairly sure you can't do this so I'm wondering if there's a workaround, but I need/want to cast an object to represent multiple interfaces for use with generic constraints. For example: public void Foo (T t) where T: ...
EDIT Despite the answer below, I would say the better solution is the one that most other answers point to. (This assumes that you can redefine the multiple classes that implement both interfaces.) Create an interface that inherits from both InterfaceA and InterfaceB, then, for all classes that implement interfaces A a...
Cast to multiple interfaces Possible Duplicate: Casting an object to two interfaces at the same time, to call a generic method I'm fairly sure you can't do this so I'm wondering if there's a workaround, but I need/want to cast an object to represent multiple interfaces for use with generic constraints. For example: pub...
TITLE: Cast to multiple interfaces QUESTION: Possible Duplicate: Casting an object to two interfaces at the same time, to call a generic method I'm fairly sure you can't do this so I'm wondering if there's a workaround, but I need/want to cast an object to represent multiple interfaces for use with generic constraints...
[ "c#", "generics", "casting" ]
10
3
6,526
5
0
2011-05-31T12:19:22.413000
2011-05-31T19:31:21.657000
6,187,476
6,187,501
bash command not found, or other workaround?
I'm working with the book Agile Web Development with Yii. In Chapter 8, it creates a php script to set up a RBAC (role based access control) so that when we access the shell at /framework/yiic shell it should allow us to enter a command rbac Pursuant to the PHP script that we created, the command creates three roles, O...
Try the full path: /framework/yiic shell You have to add /framework/ to your $PATH -environment variable if you want to use yiic without giving the full path.
bash command not found, or other workaround? I'm working with the book Agile Web Development with Yii. In Chapter 8, it creates a php script to set up a RBAC (role based access control) so that when we access the shell at /framework/yiic shell it should allow us to enter a command rbac Pursuant to the PHP script that w...
TITLE: bash command not found, or other workaround? QUESTION: I'm working with the book Agile Web Development with Yii. In Chapter 8, it creates a php script to set up a RBAC (role based access control) so that when we access the shell at /framework/yiic shell it should allow us to enter a command rbac Pursuant to the...
[ "php", "bash", "terminal", "yii" ]
0
4
3,506
2
0
2011-05-31T12:20:15.267000
2011-05-31T12:22:37.640000
6,187,478
6,190,201
Differences in magento1.4v and 1.5v databases
I want to know is there any difference in catalog and eav tables of magento 1.4.1.1v and magento 1.5v. Difference in the sense, are there any fields are added or removed in catalog, eav tables?
I would install fresh copies of both 1.4 and 1.5, then do a structure-only dump (phpmyadmin can do this too) of the databases, then Diff the resulting SQL files. This will show you the differences. Here are a ton of other options to compare two MySQl DBs: Compare two MySQL databases Cheers
Differences in magento1.4v and 1.5v databases I want to know is there any difference in catalog and eav tables of magento 1.4.1.1v and magento 1.5v. Difference in the sense, are there any fields are added or removed in catalog, eav tables?
TITLE: Differences in magento1.4v and 1.5v databases QUESTION: I want to know is there any difference in catalog and eav tables of magento 1.4.1.1v and magento 1.5v. Difference in the sense, are there any fields are added or removed in catalog, eav tables? ANSWER: I would install fresh copies of both 1.4 and 1.5, the...
[ "mysql", "magento", "schema", "sql-update" ]
1
4
287
2
0
2011-05-31T12:20:22.897000
2011-05-31T15:51:07.020000
6,187,482
6,187,545
Eclipse messes up my text by converting tabs into spaces
Opened up a tab separated file in Eclipse. When I copy one line and then paste it into the same file, all the tabs have been converted into spaces. This kind of ruins the tab separated format... How can I stop Eclipse from messing up my files?
Have you checked Window -> Preferences -> General -> Editors -> Text Editors -> Insert spaces for tabs
Eclipse messes up my text by converting tabs into spaces Opened up a tab separated file in Eclipse. When I copy one line and then paste it into the same file, all the tabs have been converted into spaces. This kind of ruins the tab separated format... How can I stop Eclipse from messing up my files?
TITLE: Eclipse messes up my text by converting tabs into spaces QUESTION: Opened up a tab separated file in Eclipse. When I copy one line and then paste it into the same file, all the tabs have been converted into spaces. This kind of ruins the tab separated format... How can I stop Eclipse from messing up my files? ...
[ "eclipse", "tabs", "whitespace", "spaces", "csv" ]
2
2
939
1
0
2011-05-31T12:20:27.453000
2011-05-31T12:26:40.117000
6,187,488
6,187,575
Installing EasyPHP and MySQL data with application files
I wrote some code in PHP that uses a MySQL database. It run with EasyPHP for Windows. Now it's quite difficult to install these on another PC. I have to: Install EasyPHP Copy.php files in www directory Run the.sql file on PhpMyAdmin How can I make the installation easier?
You can use a Framework like http://www.appcelerator.com/ to bundle your code as standalone application. Mind you, it only has PHP support, so you would need to switch to SQlite or similar..
Installing EasyPHP and MySQL data with application files I wrote some code in PHP that uses a MySQL database. It run with EasyPHP for Windows. Now it's quite difficult to install these on another PC. I have to: Install EasyPHP Copy.php files in www directory Run the.sql file on PhpMyAdmin How can I make the installatio...
TITLE: Installing EasyPHP and MySQL data with application files QUESTION: I wrote some code in PHP that uses a MySQL database. It run with EasyPHP for Windows. Now it's quite difficult to install these on another PC. I have to: Install EasyPHP Copy.php files in www directory Run the.sql file on PhpMyAdmin How can I ma...
[ "php", "mysql", "windows" ]
1
0
348
1
0
2011-05-31T12:21:06.450000
2011-05-31T12:28:51.553000
6,187,495
6,187,541
Do I use fadeIn() wrong?
Looking at fadeIn() I get the impression that I just have to add.fadeIn("slow") to an element like so $('#template').tmpl(data).prependTo('#content').fadeIn("slow"); but it appears instantaneously and doesn't even give an error. It can be seen here http://jsfiddle.net/HYLYq/8/ $(document).ready(function(){ $('form')....
You need to.hide() it before appending it to the DOM. $('#template').tmpl(data).hide().prependTo('#content').fadeIn("slow"); Alternatively, you could put style="display:none;" in the HTML of your template and then you wouldn't need.hide(). EDIT: Also, your template is only text. So,.hide() will not work unless you wrap...
Do I use fadeIn() wrong? Looking at fadeIn() I get the impression that I just have to add.fadeIn("slow") to an element like so $('#template').tmpl(data).prependTo('#content').fadeIn("slow"); but it appears instantaneously and doesn't even give an error. It can be seen here http://jsfiddle.net/HYLYq/8/ $(document).ready...
TITLE: Do I use fadeIn() wrong? QUESTION: Looking at fadeIn() I get the impression that I just have to add.fadeIn("slow") to an element like so $('#template').tmpl(data).prependTo('#content').fadeIn("slow"); but it appears instantaneously and doesn't even give an error. It can be seen here http://jsfiddle.net/HYLYq/8/...
[ "javascript", "jquery" ]
2
5
136
2
0
2011-05-31T12:22:12.907000
2011-05-31T12:26:23.550000
6,187,502
6,187,643
How do I fix these margins? Only working ok in Firefox
I'm having issues with the margins in browsers (other than Firefox) on this page: http://jumpthru.net/newsite/commentary/ Here is the CSS: #container3 { float: right; margin: 0 -240px; width: 100%; } #content3 { margin: 0 210px 0 -45px; width:500px; } #primary, #secondary { left:920px; overflow: hidden; padding-top: ...
Kind of a strange way to build up the page.. I recommend you to create a 2 column layout in main2.. Left for menu and right for the comments header, with beneath that the content and the recent comments div.. And, start using clearfix: http://www.positioniseverything.net/easyclearing.html
How do I fix these margins? Only working ok in Firefox I'm having issues with the margins in browsers (other than Firefox) on this page: http://jumpthru.net/newsite/commentary/ Here is the CSS: #container3 { float: right; margin: 0 -240px; width: 100%; } #content3 { margin: 0 210px 0 -45px; width:500px; } #primary, #...
TITLE: How do I fix these margins? Only working ok in Firefox QUESTION: I'm having issues with the margins in browsers (other than Firefox) on this page: http://jumpthru.net/newsite/commentary/ Here is the CSS: #container3 { float: right; margin: 0 -240px; width: 100%; } #content3 { margin: 0 210px 0 -45px; width:500...
[ "css", "position", "css-float" ]
0
0
101
3
0
2011-05-31T12:22:40.697000
2011-05-31T12:34:26.230000
6,187,521
6,187,648
what is need of connection open and close of execution in query in winform?
In my form, there are a lot of combo boxes. I want to load different table data to combo box. I am trying to do that, but code is very slow because of the connection open and close codings. When I run two command in without close connection and open it throws an exception. There is already an open DataReader associated...
Try by using this Reader = command.ExecuteReader( CommandBehavior.CloseConnection() );
what is need of connection open and close of execution in query in winform? In my form, there are a lot of combo boxes. I want to load different table data to combo box. I am trying to do that, but code is very slow because of the connection open and close codings. When I run two command in without close connection and...
TITLE: what is need of connection open and close of execution in query in winform? QUESTION: In my form, there are a lot of combo boxes. I want to load different table data to combo box. I am trying to do that, but code is very slow because of the connection open and close codings. When I run two command in without cl...
[ "mysql", "winforms" ]
5
3
177
1
0
2011-05-31T12:24:50.007000
2011-05-31T12:34:49.227000
6,187,523
6,195,659
DispatcherServlet doesn't appear to be processing the ModelAndView response
web.xml: audiClave webAppRootKey rest.root rest org.springframework.web.servlet.DispatcherServlet 1 rest /REST/ base org.springframework.web.servlet.DispatcherServlet 2 base / base-servlet.xml: Here is the BaseController: package com.audiClave.controllers; import org.springframework.stereotype.Controller; import org.s...
The problem is that home.jsp does not exist in the.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\audiClave\WEB-INF\views directory even though in eclipse it is showing. Wasn't able to see that until I got the logging working properly. Stopping the server, cleaning, and then republishing seems to have fi...
DispatcherServlet doesn't appear to be processing the ModelAndView response web.xml: audiClave webAppRootKey rest.root rest org.springframework.web.servlet.DispatcherServlet 1 rest /REST/ base org.springframework.web.servlet.DispatcherServlet 2 base / base-servlet.xml: Here is the BaseController: package com.audiClave....
TITLE: DispatcherServlet doesn't appear to be processing the ModelAndView response QUESTION: web.xml: audiClave webAppRootKey rest.root rest org.springframework.web.servlet.DispatcherServlet 1 rest /REST/ base org.springframework.web.servlet.DispatcherServlet 2 base / base-servlet.xml: Here is the BaseController: pack...
[ "java", "spring", "tomcat" ]
2
0
12,920
3
0
2011-05-31T12:25:12.987000
2011-06-01T02:37:44.703000
6,187,525
6,188,785
How to do a loading (pre-page load handler) abstract class to inherit from?
Is it possible to make an abstract class that handles a pre-render of the page showing what you want to show (image/gif) while the user waits for the page to load? How about managing every object-load in the page? For example, I have a large image with a lot of stuff in it. But I know it's size long before I load it. I...
This isn't a server-side thing. ASP.net receives a request and sends a response from and to the browser respectively. No server-side action can manipulate client-side DOM. If you want to do that you need to use JavaScript and DHTML approaches, because this way you'll be able to render an entire page and leave some area...
How to do a loading (pre-page load handler) abstract class to inherit from? Is it possible to make an abstract class that handles a pre-render of the page showing what you want to show (image/gif) while the user waits for the page to load? How about managing every object-load in the page? For example, I have a large im...
TITLE: How to do a loading (pre-page load handler) abstract class to inherit from? QUESTION: Is it possible to make an abstract class that handles a pre-render of the page showing what you want to show (image/gif) while the user waits for the page to load? How about managing every object-load in the page? For example,...
[ "c#", "visual-studio-2008", "web-applications" ]
0
1
363
1
0
2011-05-31T12:25:18.590000
2011-05-31T14:04:09.503000
6,187,544
6,187,689
JSF submit button after submit call javascript function
I have a form in my jsf page(a popup) that I used to upload a file. I need to refresh the parent page when the file is uploaded. What is the best approach that I can use to achive this task. My JSF page is simple and looks like this any suggestion is highly appreciated
In the popup, you need to conditionally render a so that the parent window will be refreshed. You can do this by triggering some boolean in the action method private boolean reloadParent; public void submit() { //... reloadParent = true; } public boolean isReloadParent() { return reloadParent; } and wrapping the scri...
JSF submit button after submit call javascript function I have a form in my jsf page(a popup) that I used to upload a file. I need to refresh the parent page when the file is uploaded. What is the best approach that I can use to achive this task. My JSF page is simple and looks like this any suggestion is highly apprec...
TITLE: JSF submit button after submit call javascript function QUESTION: I have a form in my jsf page(a popup) that I used to upload a file. I need to refresh the parent page when the file is uploaded. What is the best approach that I can use to achive this task. My JSF page is simple and looks like this any suggestio...
[ "java", "javascript", "jquery", "jsf", "jsf-2" ]
2
2
2,827
1
0
2011-05-31T12:26:38.993000
2011-05-31T12:38:17.777000
6,187,558
6,188,213
How to draw swt image?
I am trying to draw an swt Image but nothing appears: Display display = new Display(); Shell shell = new Shell(display); shell.open(); Image image = new Image(display, "C:/sample_image.png"); Rectangle bounds = image.getBounds(); GC gc = new GC(image); gc.drawImage(image, 100, 100); // gc.drawLine(0, 0, bounds.width,...
Create a Label and set the image on it. Image myImage = new Image( display, "C:/sample_image.png" ); Label myLabel = new Label( shell, SWT.NONE ); myLabel.setImage( myImage ); That may be enough for you.
How to draw swt image? I am trying to draw an swt Image but nothing appears: Display display = new Display(); Shell shell = new Shell(display); shell.open(); Image image = new Image(display, "C:/sample_image.png"); Rectangle bounds = image.getBounds(); GC gc = new GC(image); gc.drawImage(image, 100, 100); // gc.drawL...
TITLE: How to draw swt image? QUESTION: I am trying to draw an swt Image but nothing appears: Display display = new Display(); Shell shell = new Shell(display); shell.open(); Image image = new Image(display, "C:/sample_image.png"); Rectangle bounds = image.getBounds(); GC gc = new GC(image); gc.drawImage(image, 100,...
[ "java", "swt" ]
8
9
9,647
2
0
2011-05-31T12:27:33.267000
2011-05-31T13:19:11.483000
6,187,565
6,188,104
Find bitness (32-bit/64-bit) from Excel Application object?
Is it possible to determine whether Excel is running in 32-bit or 64-bit from the Microsoft.Office.Interop.Excel.ApplicationClass? Edit The solution should work for both Excel 2010 and Excel 2007
This code should give you the "bitness" of Excel. Microsoft.Office.Interop.Excel.ApplicationClass app = new Microsoft.Office.Interop.Excel.ApplicationClass(); if (System.Runtime.InteropServices.Marshal.SizeOf(app.HinstancePtr) == 8) { // excel 64-bit } else { // excel 32-bit } EDIT: here is another version that should ...
Find bitness (32-bit/64-bit) from Excel Application object? Is it possible to determine whether Excel is running in 32-bit or 64-bit from the Microsoft.Office.Interop.Excel.ApplicationClass? Edit The solution should work for both Excel 2010 and Excel 2007
TITLE: Find bitness (32-bit/64-bit) from Excel Application object? QUESTION: Is it possible to determine whether Excel is running in 32-bit or 64-bit from the Microsoft.Office.Interop.Excel.ApplicationClass? Edit The solution should work for both Excel 2010 and Excel 2007 ANSWER: This code should give you the "bitnes...
[ ".net", "excel", "32bit-64bit", "excel-interop" ]
5
9
4,157
2
0
2011-05-31T12:28:01.083000
2011-05-31T13:11:41.940000
6,187,570
6,188,057
select query to remove nodes from xml column
I have a table with an XML column that contains 2 nodes that have large base64 strings (images). When I query the database, I want to remove these 2 nodes from the xml returned to the client. I cannot change the schema of the table (i.e. I cannot split the data in the column). How can I remove the 2 nodes from the xml ...
This is tested on SQL Server You can store your query result to a temp table or table variable and use modify() to delete the Image nodes. Use contains() and local-name() to figure out if a node should be deleted or not. declare @T table(XmlData xml) insert into @T values (' ') update @T set XmlData.modify('delete //...
select query to remove nodes from xml column I have a table with an XML column that contains 2 nodes that have large base64 strings (images). When I query the database, I want to remove these 2 nodes from the xml returned to the client. I cannot change the schema of the table (i.e. I cannot split the data in the column...
TITLE: select query to remove nodes from xml column QUESTION: I have a table with an XML column that contains 2 nodes that have large base64 strings (images). When I query the database, I want to remove these 2 nodes from the xml returned to the client. I cannot change the schema of the table (i.e. I cannot split the ...
[ "sql", "xpath" ]
3
3
6,548
1
0
2011-05-31T12:28:35.500000
2011-05-31T13:08:35.480000
6,187,582
6,187,630
PHP - Merge Two Functions
I need to merge the following two functions, but I can't seem to get the syntax right: One: strtotime( $var = get_post_meta($post->ID, 'hub_expiry-date', true) )? 'expired': ''?> Two: ID, 'hub_expiry-date', true); if ($var == '') { echo ""; } else { echo 'expired'; }?> What is the correct way of merging these? Thanks Z...
ID, 'hub_expiry-date', true); if (!empty($var) && time() > strtotime($var) ) { echo 'expired'; }?>
PHP - Merge Two Functions I need to merge the following two functions, but I can't seem to get the syntax right: One: strtotime( $var = get_post_meta($post->ID, 'hub_expiry-date', true) )? 'expired': ''?> Two: ID, 'hub_expiry-date', true); if ($var == '') { echo ""; } else { echo 'expired'; }?> What is the correct way ...
TITLE: PHP - Merge Two Functions QUESTION: I need to merge the following two functions, but I can't seem to get the syntax right: One: strtotime( $var = get_post_meta($post->ID, 'hub_expiry-date', true) )? 'expired': ''?> Two: ID, 'hub_expiry-date', true); if ($var == '') { echo ""; } else { echo 'expired'; }?> What i...
[ "php", "function", "merge" ]
1
1
707
1
0
2011-05-31T12:29:16.063000
2011-05-31T12:32:57.043000
6,187,583
6,189,369
DataContext is Not Accesible so the Binding is not happening i guess
The ToggleButton Binding is Not working the Properties/Commands are existing in the DataContext of the View but the output says System.Windows.Data Error: 40: BindingExpression path error: 'MemeberButtonSelected' property not found on 'object' ''String' (HashCode=-1399923548)'. BindingExpression:Path=MemeberButtonSelec...
The Header of your GroupBox is a string ("Members"), so the DataContext in the HeaderTemplate is also a string... and there is no MemeberButtonSelected property on type String, as mentioned in the error message. You need to bind to the DataContext of the GroupBox:......
DataContext is Not Accesible so the Binding is not happening i guess The ToggleButton Binding is Not working the Properties/Commands are existing in the DataContext of the View but the output says System.Windows.Data Error: 40: BindingExpression path error: 'MemeberButtonSelected' property not found on 'object' ''Strin...
TITLE: DataContext is Not Accesible so the Binding is not happening i guess QUESTION: The ToggleButton Binding is Not working the Properties/Commands are existing in the DataContext of the View but the output says System.Windows.Data Error: 40: BindingExpression path error: 'MemeberButtonSelected' property not found o...
[ ".net", "wpf", "data-binding", "binding", "datatemplate" ]
0
2
1,143
2
0
2011-05-31T12:29:23.630000
2011-05-31T14:47:13.633000
6,187,584
6,187,759
PHP : replace all "foo" string between "style='()'" using regex
Possible Duplicate: replace all “foo” between () Hello, I tried to use regex to replace all foo string between the () which between style=" and " Here's an example: blah blah foo blah style="foo text blah (foo and blah foo)" it should be replaced to be: blah blah foo blah style="foo text blah (bar and blah bar)" i trie...
Works on your string, might need modifying a bit to work in all circumstances... echo preg_replace_callback('/style="(.*)(\(.+\))"/',create_function( '$matches', 'return "style=\"". $matches[1]. preg_replace("/foo/","bar",$matches[2]). "\"";' ),'blah blah foo blah style="foo text blah (foo and blah foo)"');
PHP : replace all "foo" string between "style='()'" using regex Possible Duplicate: replace all “foo” between () Hello, I tried to use regex to replace all foo string between the () which between style=" and " Here's an example: blah blah foo blah style="foo text blah (foo and blah foo)" it should be replaced to be: bl...
TITLE: PHP : replace all "foo" string between "style='()'" using regex QUESTION: Possible Duplicate: replace all “foo” between () Hello, I tried to use regex to replace all foo string between the () which between style=" and " Here's an example: blah blah foo blah style="foo text blah (foo and blah foo)" it should be ...
[ "php", "regex", "preg-replace" ]
1
1
714
4
0
2011-05-31T12:29:28.807000
2011-05-31T12:45:20.447000
6,187,591
6,187,782
How can i display the default image?
I am trying to get the default image if no image is uploaded by the user but I get always the image which is uploaded by the user and the default does not show up. Here is SQL query code and CSS part. $query="INSERT INTO tbl_images (f_naam) VALUES ('$filename')"; if($result=mysql_query($query) or die ('query fout') ){?...
i am not sure if this is the problem BUT i suspect that even if $filename is empty, the query would run successfully and you would go into the section trying to display the uploaded image. So you might want to put a check on $filename and make sure it has something before running the query. I might do it something like...
How can i display the default image? I am trying to get the default image if no image is uploaded by the user but I get always the image which is uploaded by the user and the default does not show up. Here is SQL query code and CSS part. $query="INSERT INTO tbl_images (f_naam) VALUES ('$filename')"; if($result=mysql_qu...
TITLE: How can i display the default image? QUESTION: I am trying to get the default image if no image is uploaded by the user but I get always the image which is uploaded by the user and the default does not show up. Here is SQL query code and CSS part. $query="INSERT INTO tbl_images (f_naam) VALUES ('$filename')"; i...
[ "php", "css" ]
1
1
3,249
7
0
2011-05-31T12:30:07.030000
2011-05-31T12:46:56.177000
6,187,593
6,187,688
Open datepicker on datetextfield click
Is it possible to open/ popup wicket datepicker by datetextfield onclick? Or is there any other way to do that. I am using wicket 1.3.6.
I suggest you to dig into DateTextfield to bind a onfocus or onclick javascript event on the generated input field which triggers the opening. I don't have my IDE right now to point you to the exact piece of code but I can have a look later if you want...
Open datepicker on datetextfield click Is it possible to open/ popup wicket datepicker by datetextfield onclick? Or is there any other way to do that. I am using wicket 1.3.6.
TITLE: Open datepicker on datetextfield click QUESTION: Is it possible to open/ popup wicket datepicker by datetextfield onclick? Or is there any other way to do that. I am using wicket 1.3.6. ANSWER: I suggest you to dig into DateTextfield to bind a onfocus or onclick javascript event on the generated input field wh...
[ "java", "wicket" ]
0
1
1,193
1
0
2011-05-31T12:30:12.020000
2011-05-31T12:38:17.147000
6,187,600
6,188,034
(iphone) audio format to play voice sound?
Is there a preferred audio format to play voice recording? play time is about 1-5secs. AAC is considered bad for this? I'm trying to play aac with AVAudioPlayer but having -1 error. AVAudioplayer isn't suitable for aac?
might be some codec problems... Try to convert your audio files from the itunes..
(iphone) audio format to play voice sound? Is there a preferred audio format to play voice recording? play time is about 1-5secs. AAC is considered bad for this? I'm trying to play aac with AVAudioPlayer but having -1 error. AVAudioplayer isn't suitable for aac?
TITLE: (iphone) audio format to play voice sound? QUESTION: Is there a preferred audio format to play voice recording? play time is about 1-5secs. AAC is considered bad for this? I'm trying to play aac with AVAudioPlayer but having -1 error. AVAudioplayer isn't suitable for aac? ANSWER: might be some codec problems.....
[ "iphone", "avaudioplayer", "aac" ]
0
0
183
1
0
2011-05-31T12:30:49.943000
2011-05-31T13:06:50.630000
6,187,602
6,194,698
How do extract child element in XML using DOM in PHP 5.0?
I am having the XML like this From this I want to remove and So expected result is How can I do this? Edit 1:TO Phil $dom = new DomDocument(); //$dom->preserveWhitespace = false; $dom->load('treewithchild.xml'); function DOMinnerHTML($element) { $innerHTML = ""; $children = $element->childNodes; foreach ($children as...
As you want the inner markup of the node, that is the element who's child nodes you'll want to iterate. You can access this element using the DOMDocument::documentElement property. Try this (tested and working) $doc = new DOMDocument; $doc->load('treewithchild.xml'); $inner = ''; foreach ($doc->documentElement->childNo...
How do extract child element in XML using DOM in PHP 5.0? I am having the XML like this From this I want to remove and So expected result is How can I do this? Edit 1:TO Phil $dom = new DomDocument(); //$dom->preserveWhitespace = false; $dom->load('treewithchild.xml'); function DOMinnerHTML($element) { $innerHTML = ""...
TITLE: How do extract child element in XML using DOM in PHP 5.0? QUESTION: I am having the XML like this From this I want to remove and So expected result is How can I do this? Edit 1:TO Phil $dom = new DomDocument(); //$dom->preserveWhitespace = false; $dom->load('treewithchild.xml'); function DOMinnerHTML($element)...
[ "php", "xml" ]
0
1
732
2
0
2011-05-31T12:31:02.473000
2011-05-31T23:28:01.103000
6,187,603
6,195,799
(python) matplotlib pyplot show() .. blocking or not?
I have run into this trouble with show() over and over again, and I'm sure I'm doing something wrong but not sure of the 'correct' way to do what I want. And [I think] what I want is some way to block in the main thread until an event happens in the GUI thread, something like this works the first time: from matplotlib ...
I was able to resolve my issue today. if anyone else is interested in changing the behaviour of show(), read on for how you can do it: I noticed this paragraph titled multiple calls to show supported on the what's new part of the matplotlib webpage: A long standing request is to support multiple calls to show(). This h...
(python) matplotlib pyplot show() .. blocking or not? I have run into this trouble with show() over and over again, and I'm sure I'm doing something wrong but not sure of the 'correct' way to do what I want. And [I think] what I want is some way to block in the main thread until an event happens in the GUI thread, some...
TITLE: (python) matplotlib pyplot show() .. blocking or not? QUESTION: I have run into this trouble with show() over and over again, and I'm sure I'm doing something wrong but not sure of the 'correct' way to do what I want. And [I think] what I want is some way to block in the main thread until an event happens in th...
[ "python", "events", "matplotlib", "blocking" ]
6
1
7,036
3
0
2011-05-31T12:31:04.780000
2011-06-01T03:00:14.610000
6,187,617
6,187,902
With javascript find all instances of MySQL style dates and replace
Would like to find all instances of a MySQL style date or date/time ( YYYY-MM-DD or YYYY-MM-DD HH:MM:SS ) on an html page using javascript (or jquery if practical) and replace each with a nicely formatted string (like: October 5th, 2010). Looking for the best approach.
Do it in php is the correct answer but you don't want to do that. So... Try this toolkit: http://www.javascripttoolbox.com/lib/date/examples.php Put in a date in the 'parsing' box and use yyyy-MM-dd for the format, that should give you what you are after, there on it is probably best you read the instructions. Oh, and ...
With javascript find all instances of MySQL style dates and replace Would like to find all instances of a MySQL style date or date/time ( YYYY-MM-DD or YYYY-MM-DD HH:MM:SS ) on an html page using javascript (or jquery if practical) and replace each with a nicely formatted string (like: October 5th, 2010). Looking for t...
TITLE: With javascript find all instances of MySQL style dates and replace QUESTION: Would like to find all instances of a MySQL style date or date/time ( YYYY-MM-DD or YYYY-MM-DD HH:MM:SS ) on an html page using javascript (or jquery if practical) and replace each with a nicely formatted string (like: October 5th, 20...
[ "javascript", "jquery", "regex", "datetime", "date" ]
0
1
227
2
0
2011-05-31T12:31:45.327000
2011-05-31T12:57:09.800000
6,187,623
6,187,795
Is it possible to embed all files from a folder?
I want to embed all xml files of a given folder. For now I'm doing something like this: [Embed(source="../somefolder/file1.xml", mimeType="application/octet-stream")] private var MyClass1:Class; [Embed(source="../somefolder/file2.xml", mimeType="application/octet-stream")] private var MyClass2:Class; [Embed(source="....
I don't think there is a way to do something like: [Embed(source="../somefolder/*", mimeType="application/octet-stream")] But you could use a Zip file and access to his content. I use often http://nochump.com/blog/archives/15 to do this kaind of things: package { import flash.display.Sprite; import flash.utils.ByteArra...
Is it possible to embed all files from a folder? I want to embed all xml files of a given folder. For now I'm doing something like this: [Embed(source="../somefolder/file1.xml", mimeType="application/octet-stream")] private var MyClass1:Class; [Embed(source="../somefolder/file2.xml", mimeType="application/octet-stream...
TITLE: Is it possible to embed all files from a folder? QUESTION: I want to embed all xml files of a given folder. For now I'm doing something like this: [Embed(source="../somefolder/file1.xml", mimeType="application/octet-stream")] private var MyClass1:Class; [Embed(source="../somefolder/file2.xml", mimeType="applic...
[ "flash", "apache-flex", "actionscript-3", "embed", "flash-builder" ]
2
6
1,528
2
0
2011-05-31T12:32:14.857000
2011-05-31T12:47:37.030000
6,187,636
6,187,685
IE7 Javascript not Working Correctly
I have created this JavaScript so that when you hover over a div it wills how in the box below the image. It works in all browsers but Internet Explorer and can't figure out why? Here the Code for the site: Hover Over the Numbers to Find the Answer Any help is great. Thanks
Delete the trailing coma in the object literal. IE chokes on those. myInfo={ "s1":"Flaunchin",...... "s42b":"Underpinning", "s43":"Interceptor Trap", "s44":"Water Main", -------------------^^^^ }
IE7 Javascript not Working Correctly I have created this JavaScript so that when you hover over a div it wills how in the box below the image. It works in all browsers but Internet Explorer and can't figure out why? Here the Code for the site: Hover Over the Numbers to Find the Answer Any help is great. Thanks
TITLE: IE7 Javascript not Working Correctly QUESTION: I have created this JavaScript so that when you hover over a div it wills how in the box below the image. It works in all browsers but Internet Explorer and can't figure out why? Here the Code for the site: Hover Over the Numbers to Find the Answer Any help is grea...
[ "javascript", "html", "css", "internet-explorer" ]
0
3
492
2
0
2011-05-31T12:33:27.337000
2011-05-31T12:37:54.343000
6,187,639
6,187,751
VB return procedure
Function f(ByVal x As String, ByVal y As Integer, ByVal z As Integer, ByVal w As Integer, ByRef t As String) As String If Length(x) < w Then // Definition for Length below Return t End If If y = z Then t = t + SubStr(x, w, 1) // Definition for SubStr below z = 1 Else z = z + 1 End If w = w + 1 Return f(x, y, z, w, t) ...
Just converted it over to Vb.Net and the output is "nice test". Its parsing the even position characters in the string excluding the space.
VB return procedure Function f(ByVal x As String, ByVal y As Integer, ByVal z As Integer, ByVal w As Integer, ByRef t As String) As String If Length(x) < w Then // Definition for Length below Return t End If If y = z Then t = t + SubStr(x, w, 1) // Definition for SubStr below z = 1 Else z = z + 1 End If w = w + 1 Retur...
TITLE: VB return procedure QUESTION: Function f(ByVal x As String, ByVal y As Integer, ByVal z As Integer, ByVal w As Integer, ByRef t As String) As String If Length(x) < w Then // Definition for Length below Return t End If If y = z Then t = t + SubStr(x, w, 1) // Definition for SubStr below z = 1 Else z = z + 1 End ...
[ "vb.net" ]
0
2
167
2
0
2011-05-31T12:33:44.347000
2011-05-31T12:44:13.720000
6,187,663
6,187,778
ASP.NET MVC3 route for static .cshtml files
I'm adding some.cshtml files with some content (nothing dynamicaly loaded, just a static content) There are several files: /Views is a directory /Dealership is a directory in /Views Views - Dealership - About.cshtml Views - Dealership - Testimonials.cshtml Views - Dealership - Audi.cshtml Views - Dealership - AudiA6.cs...
Generally static content should go in the Content directory, but I can see why you don't want to do that. I would consider using partial views for the specific vehicles, then using logic in the base view for that manufacturer to determine whether to show the generic code or the partial for a particular view based on th...
ASP.NET MVC3 route for static .cshtml files I'm adding some.cshtml files with some content (nothing dynamicaly loaded, just a static content) There are several files: /Views is a directory /Dealership is a directory in /Views Views - Dealership - About.cshtml Views - Dealership - Testimonials.cshtml Views - Dealership ...
TITLE: ASP.NET MVC3 route for static .cshtml files QUESTION: I'm adding some.cshtml files with some content (nothing dynamicaly loaded, just a static content) There are several files: /Views is a directory /Dealership is a directory in /Views Views - Dealership - About.cshtml Views - Dealership - Testimonials.cshtml V...
[ "asp.net-mvc", "asp.net-mvc-3", "routes" ]
1
2
2,812
2
0
2011-05-31T12:35:55.190000
2011-05-31T12:46:45.367000
6,187,664
6,187,752
Implicit Cast not happening in Expression Tree
I came across a scenario where I need to sort a list of custom type on different properties based on input. With the help of few articles, I was able to come up with generic implementation using LINQ.During unit testing, one of the test failed because implicit conversion was happening when lamda expression was created ...
You need to use the boxed version (you currently create boxingExpression, but base your final query instead on propertyExpression ): return Expression.Lambda >(boxingExpression, param).Compile(); Re why this isn't implicit - there simply is no implicit casting here; Expression!= C#. Boxing is a non-trivial operation, a...
Implicit Cast not happening in Expression Tree I came across a scenario where I need to sort a list of custom type on different properties based on input. With the help of few articles, I was able to come up with generic implementation using LINQ.During unit testing, one of the test failed because implicit conversion w...
TITLE: Implicit Cast not happening in Expression Tree QUESTION: I came across a scenario where I need to sort a list of custom type on different properties based on input. With the help of few articles, I was able to come up with generic implementation using LINQ.During unit testing, one of the test failed because imp...
[ "c#", ".net", "linq", "expression-trees", "type-parameter" ]
6
6
3,683
3
0
2011-05-31T12:35:55.220000
2011-05-31T12:44:22.237000
6,187,667
6,187,961
Asterisk::AMI module
I'm learning about Asterisk::AMI module in perl to connect to asterisk. While running the following program I can't connect to asterisk. can anyone give me solution to solve this issue?. use Asterisk::AMI; my $astman = Asterisk::AMI->new(PeerAddr => '127.0.0.1', #Remote host address PeerPort => '5038', #Remote host por...
Your script should show errors/warnings if you include: use warnings; at the start of your script.
Asterisk::AMI module I'm learning about Asterisk::AMI module in perl to connect to asterisk. While running the following program I can't connect to asterisk. can anyone give me solution to solve this issue?. use Asterisk::AMI; my $astman = Asterisk::AMI->new(PeerAddr => '127.0.0.1', #Remote host address PeerPort => '50...
TITLE: Asterisk::AMI module QUESTION: I'm learning about Asterisk::AMI module in perl to connect to asterisk. While running the following program I can't connect to asterisk. can anyone give me solution to solve this issue?. use Asterisk::AMI; my $astman = Asterisk::AMI->new(PeerAddr => '127.0.0.1', #Remote host addre...
[ "perl", "asterisk", "telephony" ]
0
2
2,521
3
0
2011-05-31T12:36:11.363000
2011-05-31T13:01:36.450000
6,187,668
6,188,512
Rails 3 - redirecting users who sign in
I'm using Devise and Can-Can for my community blog and currently looking for a way to re-direct 'only' the Admins and Moderators to the views/admin/index page directly once they sign in. Not sure if I can do this in the routes.rb or Sign In form? Any help appreciated... application_controller class ApplicationControlle...
In your application_controller add something like this: class ApplicationController < ActionController::Base def after_sign_in_path_for(resource) if current_user.role?("admin") or current_user.role?("moderator") admins_index_path # Make sure this route exists in your app! else stored_location_for(:user) end end end A...
Rails 3 - redirecting users who sign in I'm using Devise and Can-Can for my community blog and currently looking for a way to re-direct 'only' the Admins and Moderators to the views/admin/index page directly once they sign in. Not sure if I can do this in the routes.rb or Sign In form? Any help appreciated... applicati...
TITLE: Rails 3 - redirecting users who sign in QUESTION: I'm using Devise and Can-Can for my community blog and currently looking for a way to re-direct 'only' the Admins and Moderators to the views/admin/index page directly once they sign in. Not sure if I can do this in the routes.rb or Sign In form? Any help apprec...
[ "ruby-on-rails", "ruby-on-rails-3", "devise" ]
1
2
203
1
0
2011-05-31T12:36:25.470000
2011-05-31T13:43:13.090000
6,187,675
6,188,059
Doctrine2 select birthday range
I want to select all employees who have their birthday the upcoming 5 days. The birthday is saved in a date field. It feels like I have to use a between, but then the year range ruins the result. Basically I want to select a date by month and day only, in a range of 5 days. Database scheme: CREATE TABLE IF NOT EXISTS `...
You want something like this in MySQL ( edited - REALLY WORKING EXAMPLE): SELECT * FROM `tbl_office_employee` e WHERE FLOOR( ( UNIX_TIMESTAMP( CONCAT( YEAR(CURDATE()) + (DATE_FORMAT(e.birthdate, '%m-%d') < DATE_FORMAT(CURDATE(), '%m-%d')), DATE_FORMAT(e.birthdate, '-%m-%d'))) - UNIX_TIMESTAMP(CURDATE())) / 86400) < 5 S...
Doctrine2 select birthday range I want to select all employees who have their birthday the upcoming 5 days. The birthday is saved in a date field. It feels like I have to use a between, but then the year range ruins the result. Basically I want to select a date by month and day only, in a range of 5 days. Database sche...
TITLE: Doctrine2 select birthday range QUESTION: I want to select all employees who have their birthday the upcoming 5 days. The birthday is saved in a date field. It feels like I have to use a between, but then the year range ruins the result. Basically I want to select a date by month and day only, in a range of 5 d...
[ "mysql", "sql" ]
6
4
2,486
3
0
2011-05-31T12:37:04.857000
2011-05-31T13:08:42.317000