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,192,597
6,192,700
Revealing div using jQuery show() - what happens for those with JS disabled?
I have a module on my website that loads quite strangely, so I want to hide the div while the page loads, then reveal it on document ready. The following (simplified) code works just fine: This div should be hidden during load This works as intended. But what happens to users with Javascript disabled? Will the div rema...
A quite common way is, to add a class.nojs to your or element and remove it via Javascript e.g. onload. Like this you can simple handle the two different states via CSS:.slideshow { display: none; } html.nojs.slideshow { display: block; } Might want to try http://www.modernizr.com/ in this context.
Revealing div using jQuery show() - what happens for those with JS disabled? I have a module on my website that loads quite strangely, so I want to hide the div while the page loads, then reveal it on document ready. The following (simplified) code works just fine: This div should be hidden during load This works as in...
TITLE: Revealing div using jQuery show() - what happens for those with JS disabled? QUESTION: I have a module on my website that loads quite strangely, so I want to hide the div while the page loads, then reveal it on document ready. The following (simplified) code works just fine: This div should be hidden during loa...
[ "javascript", "jquery" ]
0
2
1,247
6
0
2011-05-31T19:33:06.743000
2011-05-31T19:44:51.760000
6,192,599
6,193,346
How to redraw an optionsmenu-icon with canvas
I'm trying to get a optionsmenu-icon inside onPrepareOptionsMenu in my Activity an redraw it with the help of canvas: @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem item = menu.findItem(R.id.menuCart); Drawable icon = item.getIcon(); Bitmap bitmap = Bitmap.create...
In these two lines: c.drawCircle(5, 5, 50, paint); icon.draw(c); you are drawing first a circle then the icon into the Cavas c, which is derived from the Bitmap 'bitmap', hence your new graphics is now in 'bitmap' which should be set as the new icon. Try this: item.setIcon(new BitmapDrawable(bitmap));
How to redraw an optionsmenu-icon with canvas I'm trying to get a optionsmenu-icon inside onPrepareOptionsMenu in my Activity an redraw it with the help of canvas: @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem item = menu.findItem(R.id.menuCart); Drawable icon =...
TITLE: How to redraw an optionsmenu-icon with canvas QUESTION: I'm trying to get a optionsmenu-icon inside onPrepareOptionsMenu in my Activity an redraw it with the help of canvas: @Override public boolean onPrepareOptionsMenu(Menu menu) { super.onPrepareOptionsMenu(menu); MenuItem item = menu.findItem(R.id.menuCart)...
[ "android", "icons", "android-canvas", "draw", "options-menu" ]
2
0
1,254
2
0
2011-05-31T19:33:41.483000
2011-05-31T20:45:46.353000
6,192,602
6,194,376
force update many times :Gps Location during 3-6 seconds
my app need use new current GPS parameter(update after each from 3 to 8 second): latitude and longitude. and i am using both: GPS-provider and Network-provider. i know use to update the GPS parameters if(gps_enabled) lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListenerGps); if(network_enabled...
try{gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);}catch(Exception ex){} try{network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);}catch(Exception ex){} //lm is locationManager In fact. i don't use the condition: network_enabled or Network-provider to get Location. ---> It work and th...
force update many times :Gps Location during 3-6 seconds my app need use new current GPS parameter(update after each from 3 to 8 second): latitude and longitude. and i am using both: GPS-provider and Network-provider. i know use to update the GPS parameters if(gps_enabled) lm.requestLocationUpdates(LocationManager.GPS_...
TITLE: force update many times :Gps Location during 3-6 seconds QUESTION: my app need use new current GPS parameter(update after each from 3 to 8 second): latitude and longitude. and i am using both: GPS-provider and Network-provider. i know use to update the GPS parameters if(gps_enabled) lm.requestLocationUpdates(Lo...
[ "android", "gps", "locationmanager", "locationlistener" ]
0
2
11,898
4
0
2011-05-31T19:33:55.370000
2011-05-31T22:41:04.900000
6,192,624
6,192,684
Box issue in Chrome versus Firefox
In Chrome, notice that that input area under "Your contact info" lines up with the border for div#contact. Also notice that the textarea under "Message" does not line up with that border; it's moved in a couple pixels. This is not the behavior I prefer. In Firefox, everything lines up on the left. It's a little difficu...
It seams that your margins are off... Are you using a CSS reset to level the style across all browsers? try setting margin:0; to your inputs For a css reset, I recommend: http://meyerweb.com/eric/tools/css/reset/
Box issue in Chrome versus Firefox In Chrome, notice that that input area under "Your contact info" lines up with the border for div#contact. Also notice that the textarea under "Message" does not line up with that border; it's moved in a couple pixels. This is not the behavior I prefer. In Firefox, everything lines up...
TITLE: Box issue in Chrome versus Firefox QUESTION: In Chrome, notice that that input area under "Your contact info" lines up with the border for div#contact. Also notice that the textarea under "Message" does not line up with that border; it's moved in a couple pixels. This is not the behavior I prefer. In Firefox, e...
[ "css" ]
1
1
443
2
0
2011-05-31T19:36:39.223000
2011-05-31T19:43:50.173000
6,192,628
6,192,767
Thread safety and bit-field
I know that bit-field are compiler dependant, but I haven't find documentation about thread safety on bit-field with the latest g++ and Visual C++ 2010. Does the operations on a bit-field member are atomic?
"Thread safe" is unfortunately a very overloaded term in programming. If you mean atomic access to bit-fields, the answer is no (at least on all processors I'm aware of). You have atomic access to 32bit memory locations on 32bit machines, but that only means you'll read or write a whole 32 bit value. This does not mean...
Thread safety and bit-field I know that bit-field are compiler dependant, but I haven't find documentation about thread safety on bit-field with the latest g++ and Visual C++ 2010. Does the operations on a bit-field member are atomic?
TITLE: Thread safety and bit-field QUESTION: I know that bit-field are compiler dependant, but I haven't find documentation about thread safety on bit-field with the latest g++ and Visual C++ 2010. Does the operations on a bit-field member are atomic? ANSWER: "Thread safe" is unfortunately a very overloaded term in p...
[ "c++", "c", "thread-safety", "bit-fields" ]
6
6
4,730
5
0
2011-05-31T19:36:49.817000
2011-05-31T19:51:42.183000
6,192,633
6,193,728
perforce codeline freeze
I have currently 3 codelines in my perforce depot Main Development Release The idea being changes will be integrated into Main from release and dev branches. But as of now some of the devs are making changes directly to Main branch. Is there a way to freeze check-ins for the "Main" codeline and allow integrations via b...
As Adam said, you should use permissions to limit access to the Main branch. You can do this either by using the Admin tool, or by running p4 protect from the command line (as long as you have super user access). You should limit the permissions for Main to read for most people, and allow write for those you trust to s...
perforce codeline freeze I have currently 3 codelines in my perforce depot Main Development Release The idea being changes will be integrated into Main from release and dev branches. But as of now some of the devs are making changes directly to Main branch. Is there a way to freeze check-ins for the "Main" codeline and...
TITLE: perforce codeline freeze QUESTION: I have currently 3 codelines in my perforce depot Main Development Release The idea being changes will be integrated into Main from release and dev branches. But as of now some of the devs are making changes directly to Main branch. Is there a way to freeze check-ins for the "...
[ "perforce" ]
2
4
818
2
0
2011-05-31T19:37:32.640000
2011-05-31T21:23:19.253000
6,192,645
6,192,707
Does calling sleep() from pthread put thread to sleep or process?
I saw that there is a question about pthread sleep linux However, when I looked up the man page on my Linux machine, I see the following: SYNOPSIS #include unsigned int sleep(unsigned int seconds); DESCRIPTION sleep() makes the current process sleep until seconds seconds have elapsed or a signal arrives which is not ig...
The wording in your man page is likely wrong. Trust the standard and trust the man page on kernel.org. Write to the maintainer of the documentation for your distro and tell them to update the manual pages.
Does calling sleep() from pthread put thread to sleep or process? I saw that there is a question about pthread sleep linux However, when I looked up the man page on my Linux machine, I see the following: SYNOPSIS #include unsigned int sleep(unsigned int seconds); DESCRIPTION sleep() makes the current process sleep unti...
TITLE: Does calling sleep() from pthread put thread to sleep or process? QUESTION: I saw that there is a question about pthread sleep linux However, when I looked up the man page on my Linux machine, I see the following: SYNOPSIS #include unsigned int sleep(unsigned int seconds); DESCRIPTION sleep() makes the current ...
[ "c", "pthreads", "sleep" ]
11
10
20,493
3
0
2011-05-31T19:39:15.070000
2011-05-31T19:45:21.110000
6,192,647
6,193,144
Rails 3 Shopping Cart Design Questions
I have a Transactions object (as a part of a shopping cart) that belongs_to two other objects, Products and Services. Both Products and Services are nested with Transactions to create URLs like /products/1/transactions/new and /services/1/transactions/new. And, the forms are created using form_for [@product, @transacti...
I think you have two basic options here. (1) Create two transaction types/models: product_transactions and service_transactions. Both can inherit from a common transaction module. This approach allows you to ignore the issue of which, "which kind of transaction am I dealing with?" and focus on the common implementation...
Rails 3 Shopping Cart Design Questions I have a Transactions object (as a part of a shopping cart) that belongs_to two other objects, Products and Services. Both Products and Services are nested with Transactions to create URLs like /products/1/transactions/new and /services/1/transactions/new. And, the forms are creat...
TITLE: Rails 3 Shopping Cart Design Questions QUESTION: I have a Transactions object (as a part of a shopping cart) that belongs_to two other objects, Products and Services. Both Products and Services are nested with Transactions to create URLs like /products/1/transactions/new and /services/1/transactions/new. And, t...
[ "ruby-on-rails-3", "e-commerce" ]
1
1
882
1
0
2011-05-31T19:39:22.683000
2011-05-31T20:24:42.027000
6,192,651
6,192,691
MySQL TimeStamp query
I am trying to search for studentID within a date range. I only have one date in my database, therfore i only want the users to input one date, rather than having them input a start date and an end date for: WHERE timeStamp BETWEEN startDate AND endDate So i am trying this... SELECT * FROM scansTable INNER JOIN registe...
It seems you are using something like '2011 -05 -30'+00:00:00, where you should use '2011-05-30 00:00:00' (and make corresponsing changes to the second condition), because TIMESTAMP format (I assume this field is in this format) is YYYY-MM-DD HH:MM:SS. Did it help? If not, give use the definition of the table plus the ...
MySQL TimeStamp query I am trying to search for studentID within a date range. I only have one date in my database, therfore i only want the users to input one date, rather than having them input a start date and an end date for: WHERE timeStamp BETWEEN startDate AND endDate So i am trying this... SELECT * FROM scansTa...
TITLE: MySQL TimeStamp query QUESTION: I am trying to search for studentID within a date range. I only have one date in my database, therfore i only want the users to input one date, rather than having them input a start date and an end date for: WHERE timeStamp BETWEEN startDate AND endDate So i am trying this... SEL...
[ "mysql" ]
0
2
5,251
4
0
2011-05-31T19:39:43.313000
2011-05-31T19:44:20.080000
6,192,652
6,192,865
Is it possible to add a autoincrement primary index column in full mysql table belated?
Assuming this table with nearly 5 000 000 rows CREATE TABLE `author2book` ( `author_id` int(11) NOT NULL, `book_id` int(11) NOT NULL, KEY `author_id_INDEX` (`author_id`), KEY `paper_id_INDEX` (`book_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci is it possible to add a primary index column id with au...
You can use ALTER TABLE to add the column and index in one command. i.e.: ALTER TABLE author2book ADD id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (id); See the MySQL docs for ALTER TABLE for more info.
Is it possible to add a autoincrement primary index column in full mysql table belated? Assuming this table with nearly 5 000 000 rows CREATE TABLE `author2book` ( `author_id` int(11) NOT NULL, `book_id` int(11) NOT NULL, KEY `author_id_INDEX` (`author_id`), KEY `paper_id_INDEX` (`book_id`) ) ENGINE=MyISAM DEFAULT CHAR...
TITLE: Is it possible to add a autoincrement primary index column in full mysql table belated? QUESTION: Assuming this table with nearly 5 000 000 rows CREATE TABLE `author2book` ( `author_id` int(11) NOT NULL, `book_id` int(11) NOT NULL, KEY `author_id_INDEX` (`author_id`), KEY `paper_id_INDEX` (`book_id`) ) ENGINE=M...
[ "mysql", "primary-key", "addition" ]
3
5
2,782
3
0
2011-05-31T19:39:57.240000
2011-05-31T20:00:06.163000
6,192,655
6,192,676
What's the advantage or benefit of Slug field in Django?
What's the benefit of the slug field? Does it make the url more searching engine friendly? If it does, how? Isn't a meaningful title of the page searching engine friendly enough?
The slug provides a human-friendly url fragment for the page. This is often useful when people are deciding whether or not to click a link. There's one in the url of this page, for example: http://stackoverflow.com/questions/6192655/whats-the-advantage-or-benefit-of-slug-field-in-django You can actually get to this que...
What's the advantage or benefit of Slug field in Django? What's the benefit of the slug field? Does it make the url more searching engine friendly? If it does, how? Isn't a meaningful title of the page searching engine friendly enough?
TITLE: What's the advantage or benefit of Slug field in Django? QUESTION: What's the benefit of the slug field? Does it make the url more searching engine friendly? If it does, how? Isn't a meaningful title of the page searching engine friendly enough? ANSWER: The slug provides a human-friendly url fragment for the p...
[ "python", "django", "slug" ]
1
8
3,649
1
0
2011-05-31T19:40:27.820000
2011-05-31T19:42:48.660000
6,192,660
6,192,678
Can I rely on template type?
I am looking into working code from Game AI by example book and there is a part I do not understand. There is template class SparseGraph {... }; and int SparseGraph::AddNode(node_type node) { if (node.Index() < (int)m_Nodes.size())... } How can be node.Index() called? There also is class class GraphNode { public:... in...
If node_type is not GraphNode, then your compiler will smack you and throw an error. However, if your class depends on the Index function, then you should document it as a requirement and any replacement for GraphNode must provide it, probably with some expected semantics.
Can I rely on template type? I am looking into working code from Game AI by example book and there is a part I do not understand. There is template class SparseGraph {... }; and int SparseGraph::AddNode(node_type node) { if (node.Index() < (int)m_Nodes.size())... } How can be node.Index() called? There also is class cl...
TITLE: Can I rely on template type? QUESTION: I am looking into working code from Game AI by example book and there is a part I do not understand. There is template class SparseGraph {... }; and int SparseGraph::AddNode(node_type node) { if (node.Index() < (int)m_Nodes.size())... } How can be node.Index() called? Ther...
[ "c++", "templates" ]
1
7
110
3
0
2011-05-31T19:40:48.283000
2011-05-31T19:43:01.250000
6,192,661
6,192,829
How to reference a resource file correctly for JAR and Debugging?
I have a nasty problem referencing resources when using a Maven project and Jar files... I have all my resources in a dedicated folder /src/main/resources which is part of the build path in Eclipse. Files are referenced using getClass().getResource("/filename.txt") This works fine in Eclipse but fails in the Jar file -...
The contents of Maven resource folders are copied to target/classes and from there to the root of the resulting Jar file. That is the expected behaviour. What I don't understand is what the problem is in your scenario. Referencing a Resource through getClass().getResource("/filename.txt") starts at the root of the clas...
How to reference a resource file correctly for JAR and Debugging? I have a nasty problem referencing resources when using a Maven project and Jar files... I have all my resources in a dedicated folder /src/main/resources which is part of the build path in Eclipse. Files are referenced using getClass().getResource("/fil...
TITLE: How to reference a resource file correctly for JAR and Debugging? QUESTION: I have a nasty problem referencing resources when using a Maven project and Jar files... I have all my resources in a dedicated folder /src/main/resources which is part of the build path in Eclipse. Files are referenced using getClass()...
[ "java", "eclipse", "jar" ]
57
22
95,324
7
0
2011-05-31T19:40:57.697000
2011-05-31T19:57:18.770000
6,192,667
6,192,709
CSS in Classic ASP vs ASP.Net 3.5?
With an ASP.net 1.0 site the following worked with the CSS. But we are upgrading the site to asp 3.5 and I think the CSS is no longer valid. Is this true for the Active and Hover CSS?.BodyText { font-size: 8pt; font-family: Arial, Sans-Serif; color: Black; }:active.BodyText { font-size: 8pt; color: #000000; font-famil...
CSS isn't affected by the version of ASP or ASP.NET you are using. You have to look at the HTML that is being generated and make sure you are appropriately using the class names from you CSS. EDIT As others have said, it also looks like your selectors are backwards (not sure if this is a typo or not). They should be:.B...
CSS in Classic ASP vs ASP.Net 3.5? With an ASP.net 1.0 site the following worked with the CSS. But we are upgrading the site to asp 3.5 and I think the CSS is no longer valid. Is this true for the Active and Hover CSS?.BodyText { font-size: 8pt; font-family: Arial, Sans-Serif; color: Black; }:active.BodyText { font-si...
TITLE: CSS in Classic ASP vs ASP.Net 3.5? QUESTION: With an ASP.net 1.0 site the following worked with the CSS. But we are upgrading the site to asp 3.5 and I think the CSS is no longer valid. Is this true for the Active and Hover CSS?.BodyText { font-size: 8pt; font-family: Arial, Sans-Serif; color: Black; }:active....
[ "css", "asp.net", "visual-studio-2008", "hover" ]
0
10
552
3
0
2011-05-31T19:41:45.853000
2011-05-31T19:45:28.833000
6,192,669
6,196,695
libpq-fe.h and c program closing
I've got a problem with a C program that connects with localhost database on postgresql. Code looks similar to this: #include #include int main() { int dane; PGconn *dbh; // definujemy uchwyt do bazy – jest to specjalna zmienna pamiętająca PGresult *wynik; //wskaźnik do struktury przechowującej wynik zapytania dbh = ...
The required DLL's are all located in the bin folder of your postgresql install. Typically c:\program files\postgresql\9.0\bin These DLL's have to be in the search path or in the same folder as your executable. The relevant DLL's are: COMERR32.DLL, GSSAPI32.DLL, K5SPRT32.DLL, KRB5_32.DLL, LIBEAY32.DLL, LIBICONV2.DLL, L...
libpq-fe.h and c program closing I've got a problem with a C program that connects with localhost database on postgresql. Code looks similar to this: #include #include int main() { int dane; PGconn *dbh; // definujemy uchwyt do bazy – jest to specjalna zmienna pamiętająca PGresult *wynik; //wskaźnik do struktury przec...
TITLE: libpq-fe.h and c program closing QUESTION: I've got a problem with a C program that connects with localhost database on postgresql. Code looks similar to this: #include #include int main() { int dane; PGconn *dbh; // definujemy uchwyt do bazy – jest to specjalna zmienna pamiętająca PGresult *wynik; //wskaźnik ...
[ "c", "postgresql", "libpq" ]
1
2
1,554
2
0
2011-05-31T19:41:48.477000
2011-06-01T05:29:59.993000
6,192,685
6,192,748
How do create a multi select options? or add attributes to the models.CharField
I have this models.CharField(max_length=10,choices=LOCATION_NAME) However, I want it to render something like this, 1 2 3 4 I am trying to add this to the django admin section.
You can render it using the SelectMultiple Widget: https://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.SelectMultiple You'll probably be using a MultipleChoiceField in your form: https://docs.djangoproject.com/en/1.3/ref/forms/fields/#multiplechoicefield
How do create a multi select options? or add attributes to the models.CharField I have this models.CharField(max_length=10,choices=LOCATION_NAME) However, I want it to render something like this, 1 2 3 4 I am trying to add this to the django admin section.
TITLE: How do create a multi select options? or add attributes to the models.CharField QUESTION: I have this models.CharField(max_length=10,choices=LOCATION_NAME) However, I want it to render something like this, 1 2 3 4 I am trying to add this to the django admin section. ANSWER: You can render it using the SelectMu...
[ "django", "django-models" ]
1
2
4,745
2
0
2011-05-31T19:43:52.823000
2011-05-31T19:50:12.730000
6,192,695
6,192,741
Code folding in a Qt widget subclassed from QPlainTextEdit?
I need to implement something like code folding feature of Qt Creator for my widget. Its a subclass of QPlainTextEdit with some additional syntax highlighting and line numbering. It should hide text between some environment declaration statement and when user requests show them again. Line numbering should not be affec...
Why not use QScintilla instead? It is a well-tried editor with the folding feature. For folding with your own rules you need to make your own lexer by subclassing QsciLexer of QsciLexerCustom. I suggest studying existing lexers. You will need to implement the same functionality for your rules even if you decide not to ...
Code folding in a Qt widget subclassed from QPlainTextEdit? I need to implement something like code folding feature of Qt Creator for my widget. Its a subclass of QPlainTextEdit with some additional syntax highlighting and line numbering. It should hide text between some environment declaration statement and when user ...
TITLE: Code folding in a Qt widget subclassed from QPlainTextEdit? QUESTION: I need to implement something like code folding feature of Qt Creator for my widget. Its a subclass of QPlainTextEdit with some additional syntax highlighting and line numbering. It should hide text between some environment declaration statem...
[ "qt", "qt4", "folding" ]
2
2
1,898
1
0
2011-05-31T19:44:36.583000
2011-05-31T19:49:33.527000
6,192,697
6,193,480
Codeigniter Views with Dynamic Parameters
I load the multiple views from the controller, in order to display a page. $this->load->view('header'); $this->load->view('content', $data); $this->load->view('sidebar1', $data1); $this->load->view('sidebar2', $data2); $this->load->view('footer'); However I think its not a clean approach. Can it be improved by creating...
Within my projects, I have a tendency to do: $this->load->vars($data); $this->load->view('template_name'); Where my template loads in other views within itself. The CodeIgniter documentation states the following for the method $this->load->vars(): "This function takes an associative array as input and generates variabl...
Codeigniter Views with Dynamic Parameters I load the multiple views from the controller, in order to display a page. $this->load->view('header'); $this->load->view('content', $data); $this->load->view('sidebar1', $data1); $this->load->view('sidebar2', $data2); $this->load->view('footer'); However I think its not a clea...
TITLE: Codeigniter Views with Dynamic Parameters QUESTION: I load the multiple views from the controller, in order to display a page. $this->load->view('header'); $this->load->view('content', $data); $this->load->view('sidebar1', $data1); $this->load->view('sidebar2', $data2); $this->load->view('footer'); However I th...
[ "codeigniter" ]
1
0
7,984
3
0
2011-05-31T19:44:38.987000
2011-05-31T20:58:32.603000
6,192,703
6,200,522
How to define a shape.xml for RadioButton?
I want to create a custom drawable for RadioButton's button drawable. I have created a theme and style, which points the RadioButton's button drawable to a custom drawable defined in XML. The drawable.xml looks like this: But this displays a blank area where the button should have been. I tried adding a size parameter ...
It was a silly mistake on my part! I had missed the android: namespace qualifier on the color and other attributes. The following works fine:
How to define a shape.xml for RadioButton? I want to create a custom drawable for RadioButton's button drawable. I have created a theme and style, which points the RadioButton's button drawable to a custom drawable defined in XML. The drawable.xml looks like this: But this displays a blank area where the button should ...
TITLE: How to define a shape.xml for RadioButton? QUESTION: I want to create a custom drawable for RadioButton's button drawable. I have created a theme and style, which points the RadioButton's button drawable to a custom drawable defined in XML. The drawable.xml looks like this: But this displays a blank area where ...
[ "android" ]
1
3
1,742
1
0
2011-05-31T19:45:05.647000
2011-06-01T11:40:28.933000
6,192,721
6,203,588
Translate CodeIgniter's calendar to another language
I'm trying to translate CodeIgniter's calendar object to Hebrew. I made Hebrew-calendar translation files (calender_lang.php under a 'hebrew' folder) as required and loaded the calendar (in english). However, I don't understand how to translate the whole calender in one time. Should I use a loop for everything? I can't...
solved. i see there is importance to the order you load your libraries. first, load the language library. and also - load the parser library. $this->lang->load('calendar', 'hebrew'); $this->load->library('parser'); then: \\ $prefs is an array inculding long days preferences etc. $this->load->library('calendar', $prefs)...
Translate CodeIgniter's calendar to another language I'm trying to translate CodeIgniter's calendar object to Hebrew. I made Hebrew-calendar translation files (calender_lang.php under a 'hebrew' folder) as required and loaded the calendar (in english). However, I don't understand how to translate the whole calender in ...
TITLE: Translate CodeIgniter's calendar to another language QUESTION: I'm trying to translate CodeIgniter's calendar object to Hebrew. I made Hebrew-calendar translation files (calender_lang.php under a 'hebrew' folder) as required and loaded the calendar (in english). However, I don't understand how to translate the ...
[ "php", "codeigniter", "calendar", "translate" ]
1
1
2,131
2
0
2011-05-31T19:47:22.793000
2011-06-01T15:20:38.890000
6,192,727
6,192,795
basic question about tkinter buttons
I'm new to using tkinter and GUI programming in general so this may be a pretty basic question. Anyway, suppose I have a set of buttons for the user to choose from and what I want is a list of all the button objects that were clicked by the user. Basically, I want to know which buttons the user clicked.
On each of the buttons you could set the command to add themselves to a list of clicked buttons. clicked = [] foo = Button(root, text='bar', command=lambda self:clicked.append(self)) Not sure if the syntax is all correct, but that's the basic idea.
basic question about tkinter buttons I'm new to using tkinter and GUI programming in general so this may be a pretty basic question. Anyway, suppose I have a set of buttons for the user to choose from and what I want is a list of all the button objects that were clicked by the user. Basically, I want to know which butt...
TITLE: basic question about tkinter buttons QUESTION: I'm new to using tkinter and GUI programming in general so this may be a pretty basic question. Anyway, suppose I have a set of buttons for the user to choose from and what I want is a list of all the button objects that were clicked by the user. Basically, I want ...
[ "python", "user-interface", "button", "tkinter" ]
1
1
1,987
3
0
2011-05-31T19:47:55.837000
2011-05-31T19:53:56.223000
6,192,731
6,196,176
Is it meaningful to verifyText() on an element that has just had type() executed on it?
I'm curious about whether the following functional test is possible. I'm working with PHPUnit_Extensions_SeleniumTestCase with Selenium-RC here, but the principle (I think) should apply everywhere. Suppose I execute the following command on a particular div: function testInput() { $locator = $this->get_magic_locator();...
You should use verifyValue(locator,texttoverify) rather than verifyText(locator,value) for validating the textbox values
Is it meaningful to verifyText() on an element that has just had type() executed on it? I'm curious about whether the following functional test is possible. I'm working with PHPUnit_Extensions_SeleniumTestCase with Selenium-RC here, but the principle (I think) should apply everywhere. Suppose I execute the following co...
TITLE: Is it meaningful to verifyText() on an element that has just had type() executed on it? QUESTION: I'm curious about whether the following functional test is possible. I'm working with PHPUnit_Extensions_SeleniumTestCase with Selenium-RC here, but the principle (I think) should apply everywhere. Suppose I execut...
[ "selenium", "phpunit" ]
3
2
652
2
0
2011-05-31T19:48:20.027000
2011-06-01T04:11:07.863000
6,192,733
6,192,775
How to execute a set of related SQL instructions with JDBC?
I'm trying to execute this script through JDBC (it's SQL Server): DECLARE @var VARCHAR(10) SET @var = "test" INSERT INTO foo (name) VALUES (@var) It's just an example, in my business case I have a big collection of SQL statements in one script. I'm trying this: final Statement stmt = connection.createStatement(); for (...
You're executing it one line at a time, so of course the second line fails as it depends on the first line. Why not execute it all at once?...
How to execute a set of related SQL instructions with JDBC? I'm trying to execute this script through JDBC (it's SQL Server): DECLARE @var VARCHAR(10) SET @var = "test" INSERT INTO foo (name) VALUES (@var) It's just an example, in my business case I have a big collection of SQL statements in one script. I'm trying this...
TITLE: How to execute a set of related SQL instructions with JDBC? QUESTION: I'm trying to execute this script through JDBC (it's SQL Server): DECLARE @var VARCHAR(10) SET @var = "test" INSERT INTO foo (name) VALUES (@var) It's just an example, in my business case I have a big collection of SQL statements in one scrip...
[ "java", "sql", "jdbc" ]
1
2
2,328
1
0
2011-05-31T19:48:29.357000
2011-05-31T19:52:10.930000
6,192,739
6,192,806
How do I raise an event in a usercontrol and catch it in mainpage?
I have a UserControl, and I need to notify the parent page that a button in the UserControl was clicked. How do I raise an event in the UserControl and catch it on the Main page? I tried using static, and many suggested me to go for events.
Check out Event Bubbling -- http://msdn.microsoft.com/en-us/library/aa719644%28vs.71%29.aspx Example: User Control public event EventHandler StatusUpdated; private void FunctionThatRaisesEvent() { //Null check makes sure the main page is attached to the event if (this.StatusUpdated!= null) this.StatusUpdated(this, new...
How do I raise an event in a usercontrol and catch it in mainpage? I have a UserControl, and I need to notify the parent page that a button in the UserControl was clicked. How do I raise an event in the UserControl and catch it on the Main page? I tried using static, and many suggested me to go for events.
TITLE: How do I raise an event in a usercontrol and catch it in mainpage? QUESTION: I have a UserControl, and I need to notify the parent page that a button in the UserControl was clicked. How do I raise an event in the UserControl and catch it on the Main page? I tried using static, and many suggested me to go for ev...
[ "c#", "silverlight", "events", "user-controls", "raiseevent" ]
51
91
75,836
3
0
2011-05-31T19:49:21.337000
2011-05-31T19:55:27.207000
6,192,740
6,192,777
asp.net mvc2 dropdownlistfor
I want to create a dropdownlist in my asp.net MVC2 view and I am following code: foreach (var whiteout in Model) { %> <%= whiteout.Field.NiceName%> <% Html.DropDownListFor("anyname", Model); %> <% } } %> but I am getting error that second parameter is not correct. Second parameter is a list. Here is how Model is decla...
A DropDownListFor helper takes a SelectList as second argument and a lambda expression to a simple property as first: <%= Html.DropDownListFor( x => x.SomeProperty, new SelectList(Model.SomeList, "ValueProperty", "TextProperty") ) %> If you want to use the weakly typed DropDownList helper you could manually specify the...
asp.net mvc2 dropdownlistfor I want to create a dropdownlist in my asp.net MVC2 view and I am following code: foreach (var whiteout in Model) { %> <%= whiteout.Field.NiceName%> <% Html.DropDownListFor("anyname", Model); %> <% } } %> but I am getting error that second parameter is not correct. Second parameter is a lis...
TITLE: asp.net mvc2 dropdownlistfor QUESTION: I want to create a dropdownlist in my asp.net MVC2 view and I am following code: foreach (var whiteout in Model) { %> <%= whiteout.Field.NiceName%> <% Html.DropDownListFor("anyname", Model); %> <% } } %> but I am getting error that second parameter is not correct. Second ...
[ "asp.net", "asp.net-mvc-2" ]
0
0
227
1
0
2011-05-31T19:49:32.867000
2011-05-31T19:52:23.743000
6,192,751
6,193,165
Listening and passing data without stopping
This code illustrates my problem: //Constructor public ReadFormat(String path, int nic) throws IOException{ this.path = path; this.nic = String.valueOf(nic); ReadTshark(); //Calls listening function } //listening stdout and sends to another public void ReadTshark() throws IOException{ String cmdTshark = path + " -S" +...
if you want to move stream data between threads, you should look at the PipedInputStream and PipedOutputStream classes. your ReadTshark() would write the data it reads to the PipedOutputStream, and your other thread would read the data from a linked PipedInputStream. of course, i see no reason why your other thread wou...
Listening and passing data without stopping This code illustrates my problem: //Constructor public ReadFormat(String path, int nic) throws IOException{ this.path = path; this.nic = String.valueOf(nic); ReadTshark(); //Calls listening function } //listening stdout and sends to another public void ReadTshark() throws IO...
TITLE: Listening and passing data without stopping QUESTION: This code illustrates my problem: //Constructor public ReadFormat(String path, int nic) throws IOException{ this.path = path; this.nic = String.valueOf(nic); ReadTshark(); //Calls listening function } //listening stdout and sends to another public void Read...
[ "java", "multithreading" ]
0
0
135
2
0
2011-05-31T19:50:24.320000
2011-05-31T20:27:08.407000
6,192,752
6,192,780
Can a primary key contain more than one columns?
Possible Duplicate: is this possible to made two primary key in one table Is it possible to define a primary key on more than one columne in MySQL? How is this indicated in a create table statement?
Yes, you absolutely can. Here's a link: http://sqlzoo.net/howto/source/z.dir/tip241027/mysql And here is the basic syntax: CREATE TABLE myTable( myCol1 INTEGER NOT NULL, myCol2 CHAR(10) NOT NULL, myCol3 INTEGER NOT NULL, myCol4 CHAR(1), PRIMARY KEY (myCol1, myCol2, myCol3 ) )
Can a primary key contain more than one columns? Possible Duplicate: is this possible to made two primary key in one table Is it possible to define a primary key on more than one columne in MySQL? How is this indicated in a create table statement?
TITLE: Can a primary key contain more than one columns? QUESTION: Possible Duplicate: is this possible to made two primary key in one table Is it possible to define a primary key on more than one columne in MySQL? How is this indicated in a create table statement? ANSWER: Yes, you absolutely can. Here's a link: http:...
[ "sql" ]
1
9
4,604
4
0
2011-05-31T19:50:26.470000
2011-05-31T19:52:34.773000
6,192,757
6,192,940
outlook 2010 virtual address book
I have contacts stored in a mySQL database, is it possible to create an add-in that presents a virtual address book with contact information that is retrieved from the database? I don't want to do an import, I want the virtual address book to change as data in the contacts table changes.
I think you need to write a custom address book provider for Outlook. IIRC these have to be implemented in C++ due to MAPI requirements, but someone may have exposed these interfaces to languages like C# now.
outlook 2010 virtual address book I have contacts stored in a mySQL database, is it possible to create an add-in that presents a virtual address book with contact information that is retrieved from the database? I don't want to do an import, I want the virtual address book to change as data in the contacts table change...
TITLE: outlook 2010 virtual address book QUESTION: I have contacts stored in a mySQL database, is it possible to create an add-in that presents a virtual address book with contact information that is retrieved from the database? I don't want to do an import, I want the virtual address book to change as data in the con...
[ "outlook-addin", "addressbook" ]
0
0
338
1
0
2011-05-31T19:50:49.407000
2011-05-31T20:07:00.810000
6,192,763
6,192,792
A query about lexical scoping
I try to understand lexical-scoping. In lexical-scoping, I have this code, C like syntax: main{ f1(){ int y = 8; } int y = 1; //* f1(); } After the execution of f1() line, will the value of y variable in main (I put * next of it) remain 1 or change to 8?
It will remain 1. You have two completely distinct variables. Changes to one do not affect the other.
A query about lexical scoping I try to understand lexical-scoping. In lexical-scoping, I have this code, C like syntax: main{ f1(){ int y = 8; } int y = 1; //* f1(); } After the execution of f1() line, will the value of y variable in main (I put * next of it) remain 1 or change to 8?
TITLE: A query about lexical scoping QUESTION: I try to understand lexical-scoping. In lexical-scoping, I have this code, C like syntax: main{ f1(){ int y = 8; } int y = 1; //* f1(); } After the execution of f1() line, will the value of y variable in main (I put * next of it) remain 1 or change to 8? ANSWER: It wil...
[ "scope", "lexical-scope" ]
0
1
69
1
0
2011-05-31T19:51:07.250000
2011-05-31T19:53:28.253000
6,192,769
6,194,220
Is it possible to get a value from view.yml in an action
I'm wondering if it's possible to get the name of a stylesheet from view.yml in an action, ideally using something as simple as: sfConfig::get('......'); I'd like to access the existing declaration in view.yml instead of hardcoding it or duplicating it somewhere like app.yml. Thanks.
If you want to access the current Module's Config, you can use: sfViewConfigHandler::getConfiguration(array(dirname(__DIR__). '/config/view.yml')); It should return something like this: Array ( [indexSuccess] => Array ( [javascripts] => Array ( [0] => mission-control.js ) [stylesheets] => Array ( [0] => control-box.cs...
Is it possible to get a value from view.yml in an action I'm wondering if it's possible to get the name of a stylesheet from view.yml in an action, ideally using something as simple as: sfConfig::get('......'); I'd like to access the existing declaration in view.yml instead of hardcoding it or duplicating it somewhere ...
TITLE: Is it possible to get a value from view.yml in an action QUESTION: I'm wondering if it's possible to get the name of a stylesheet from view.yml in an action, ideally using something as simple as: sfConfig::get('......'); I'd like to access the existing declaration in view.yml instead of hardcoding it or duplica...
[ "view", "symfony1", "action", "configuration-files" ]
2
5
858
1
0
2011-05-31T19:51:49.207000
2011-05-31T22:17:02.747000
6,192,778
6,193,236
What is the best way to store an array of objects with cocoa?
I have an NSMutableArray with many objects in it. Some are NSStrings, others are NSMutableArrays, others are NSNumbers. What is the best way to store this data so that the app could use it again? The array needs to stay in order as well. I'm thinking a plist or NSUserDefaults? Many thanks
Consider using NSKeyedArchiver. // Archive NSData *data = [NSKeyedArchiver archivedDataWithRootObject:theArray]; NSString *path = @"/Users/Anne/Desktop/archive.dat"; [data writeToFile:path options:NSDataWritingAtomic error:nil]; // Unarchive NSString *path = @"/Users/Anne/Desktop/archive.dat"; NSMutableArray *theArray...
What is the best way to store an array of objects with cocoa? I have an NSMutableArray with many objects in it. Some are NSStrings, others are NSMutableArrays, others are NSNumbers. What is the best way to store this data so that the app could use it again? The array needs to stay in order as well. I'm thinking a plist...
TITLE: What is the best way to store an array of objects with cocoa? QUESTION: I have an NSMutableArray with many objects in it. Some are NSStrings, others are NSMutableArrays, others are NSNumbers. What is the best way to store this data so that the app could use it again? The array needs to stay in order as well. I'...
[ "cocoa-touch", "xcode", "cocoa", "nsmutablearray" ]
4
3
5,401
2
0
2011-05-31T19:52:27.957000
2011-05-31T20:34:42.900000
6,192,781
6,192,828
Month name as a string
I'm trying to return the name of the month as a String, for instance "May", "September", "November". I tried: int month = c.get(Calendar.MONTH); However, this returns integers (5, 9, 11, respectively). How can I get the month name?
Use getDisplayName. For earlier API's use String.format(Locale.US,"%tB",c);
Month name as a string I'm trying to return the name of the month as a String, for instance "May", "September", "November". I tried: int month = c.get(Calendar.MONTH); However, this returns integers (5, 9, 11, respectively). How can I get the month name?
TITLE: Month name as a string QUESTION: I'm trying to return the name of the month as a String, for instance "May", "September", "November". I tried: int month = c.get(Calendar.MONTH); However, this returns integers (5, 9, 11, respectively). How can I get the month name? ANSWER: Use getDisplayName. For earlier API's ...
[ "android", "calendar" ]
117
93
166,470
12
0
2011-05-31T19:52:42.117000
2011-05-31T19:57:17.830000
6,192,786
6,198,053
Grails validation fails after interchanging unique attribute values
Grails validation fails after interchanging unique attribute values Hi, I am trying to create an interface where users can create some custom enumeration with translations for different languages. For example the user can create an enumeration "Movie Genre". For this enumeration there might be an enumeration-value "Com...
Let me take another try:) I'm looking at UniqueConstraint.processValidate(), and can suppose that its logic does not consider the exchange case. Particularly, the code boolean reject = false; if (id!= null) { Object existing = results.get(0); Object existingId = null; try { existingId = InvokerHelper.invokeMethod(exist...
Grails validation fails after interchanging unique attribute values Grails validation fails after interchanging unique attribute values Hi, I am trying to create an interface where users can create some custom enumeration with translations for different languages. For example the user can create an enumeration "Movie G...
TITLE: Grails validation fails after interchanging unique attribute values QUESTION: Grails validation fails after interchanging unique attribute values Hi, I am trying to create an interface where users can create some custom enumeration with translations for different languages. For example the user can create an en...
[ "grails", "grails-validation" ]
2
3
488
1
0
2011-05-31T19:53:00.587000
2011-06-01T08:03:53.203000
6,192,788
6,192,832
Difference between "+" and "%A0" - urlencoding?
I am url encoding a string of text to pass along to a function. However, it encodes the second space in a double-space as "%A0". This means that when I decode the string, the "%A0" is displayed as a question mark in a black box. I really just need to be able to remove the extra space, but I'd like to understand what is...
%A0 indicates a NBSP (U+00A0). + indicates a normal space (U+0020). The NBSP displays as a replacement character (U+FFFD) because the encoding of the character does not match the encoding of the page, so its byte sequence is not valid for the page.
Difference between "+" and "%A0" - urlencoding? I am url encoding a string of text to pass along to a function. However, it encodes the second space in a double-space as "%A0". This means that when I decode the string, the "%A0" is displayed as a question mark in a black box. I really just need to be able to remove the...
TITLE: Difference between "+" and "%A0" - urlencoding? QUESTION: I am url encoding a string of text to pass along to a function. However, it encodes the second space in a double-space as "%A0". This means that when I decode the string, the "%A0" is displayed as a question mark in a black box. I really just need to be ...
[ "html", "forms", "urlencode" ]
11
19
15,916
4
0
2011-05-31T19:53:16.903000
2011-05-31T19:57:28.057000
6,192,791
6,192,904
Problem with reassigning spinner value
I trying to get a value off a spinner and then pass it onto another java file. I have a spinner in which has a number of values. I change this value, convert it to a string, then on the click of a button I use and intent to pass this information onto the other java file to do stuff with. The problem I am having is that...
There is no need for PipeSizeOnItemSelectedListener. You can just call getSelectedItemPosition in OnClickListener.
Problem with reassigning spinner value I trying to get a value off a spinner and then pass it onto another java file. I have a spinner in which has a number of values. I change this value, convert it to a string, then on the click of a button I use and intent to pass this information onto the other java file to do stuf...
TITLE: Problem with reassigning spinner value QUESTION: I trying to get a value off a spinner and then pass it onto another java file. I have a spinner in which has a number of values. I change this value, convert it to a string, then on the click of a button I use and intent to pass this information onto the other ja...
[ "android", "android-widget" ]
0
0
208
1
0
2011-05-31T19:53:26.647000
2011-05-31T20:04:12.497000
6,192,798
6,204,308
Sharing an element between jQuery UI tabs?
I'm using jQuery UI's tabs to divide content on my page. I have a 'link bar' I would like to have hang at the bottom of each tab. (The tab text will change but generally they will navigate the user left or right through tabs.) Hosting the #linkBar div inside the first tab makes it 'look' right, inside Themeroller's bor...
Ok... It was simply adding the jQuery UI classes to the linkBar. Check out my working jsFiddle demo: I moved the linkBar div out of the tabOne div and put it at the bottom of the tabs div: title bar one two three content goes here more stuff more stuff content goes here... content goes here... << left link right link >...
Sharing an element between jQuery UI tabs? I'm using jQuery UI's tabs to divide content on my page. I have a 'link bar' I would like to have hang at the bottom of each tab. (The tab text will change but generally they will navigate the user left or right through tabs.) Hosting the #linkBar div inside the first tab make...
TITLE: Sharing an element between jQuery UI tabs? QUESTION: I'm using jQuery UI's tabs to divide content on my page. I have a 'link bar' I would like to have hang at the bottom of each tab. (The tab text will change but generally they will navigate the user left or right through tabs.) Hosting the #linkBar div inside ...
[ "jquery-ui", "html", "jquery-ui-tabs" ]
5
4
2,126
1
0
2011-05-31T19:54:33.960000
2011-06-01T16:12:07.073000
6,192,800
6,192,885
How to repeatedly add text on both sides of a word in vim?
I have a bunch of local variable references in a Python script that I want to pull from a dictionary instead. So, I need to essentially change foo, bar, and others into env['foo'], env['bar'] and so on. Do I need to write a regular expression and match each variable name to transform, or is there a more direct approach...
You can use a macro: type these commands in one go (with spacing just to insert comments) " first move to start of the relevant word (ie via search) qa " record macro into the a register. ienv[' " insert relevant piece ea'] " move to end of word and insert relevant piece q " stop recording then, when you're on the next...
How to repeatedly add text on both sides of a word in vim? I have a bunch of local variable references in a Python script that I want to pull from a dictionary instead. So, I need to essentially change foo, bar, and others into env['foo'], env['bar'] and so on. Do I need to write a regular expression and match each var...
TITLE: How to repeatedly add text on both sides of a word in vim? QUESTION: I have a bunch of local variable references in a Python script that I want to pull from a dictionary instead. So, I need to essentially change foo, bar, and others into env['foo'], env['bar'] and so on. Do I need to write a regular expression ...
[ "vim", "editor", "vi" ]
6
7
1,599
4
0
2011-05-31T19:54:46.817000
2011-05-31T20:02:09.377000
6,192,805
6,193,002
jQuery Toggle Texts on Multiple Divs
The following code is what I am using: jQuery: jQuery('#slickbox3242').hide(); jQuery('#slickbox3243').hide(); jQuery('#slickbox3244').hide(); jQuery.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; jQuery("a.slick-toggle").click(function () { v...
index and relation attributes are helpful here: Show Sales Org Filters Some Content Show Retail Filters Some Content jquery $("a.slick-toggle").click(function () { var rel = $(this).attr('rel'); //get the text from the and remove the 1st word var text = $(this).text().substr(5); $(".content[rel='" + rel + "']").fadeTog...
jQuery Toggle Texts on Multiple Divs The following code is what I am using: jQuery: jQuery('#slickbox3242').hide(); jQuery('#slickbox3243').hide(); jQuery('#slickbox3244').hide(); jQuery.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; jQuery("a...
TITLE: jQuery Toggle Texts on Multiple Divs QUESTION: The following code is what I am using: jQuery: jQuery('#slickbox3242').hide(); jQuery('#slickbox3243').hide(); jQuery('#slickbox3244').hide(); jQuery.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callba...
[ "jquery" ]
0
0
936
3
0
2011-05-31T19:55:19.563000
2011-05-31T20:12:30.263000
6,192,807
6,193,020
Using OpenMP to calculate the value of PI
I'm trying to learn how to use OpenMP by parallelizing a monte carlo code that calculates the value of PI with a given number of iterations. The meat of the code is this: int chunk = CHUNKSIZE; count=0; #pragma omp parallel shared(chunk,count) private(i) { #pragma omp for schedule(dynamic,chunk) for ( i=0; i Though t...
Okay, I found the answer. I needed to use the REDUCTION clause. So all I had to modify was: #pragma omp parallel shared(chunk,count) private(i) to: #pragma omp parallel shared(chunk) private(i,x,y,z) reduction(+:count) Now it's converging at 3.14...yay
Using OpenMP to calculate the value of PI I'm trying to learn how to use OpenMP by parallelizing a monte carlo code that calculates the value of PI with a given number of iterations. The meat of the code is this: int chunk = CHUNKSIZE; count=0; #pragma omp parallel shared(chunk,count) private(i) { #pragma omp for sch...
TITLE: Using OpenMP to calculate the value of PI QUESTION: I'm trying to learn how to use OpenMP by parallelizing a monte carlo code that calculates the value of PI with a given number of iterations. The meat of the code is this: int chunk = CHUNKSIZE; count=0; #pragma omp parallel shared(chunk,count) private(i) { #...
[ "c", "openmp", "montecarlo" ]
5
5
6,673
1
0
2011-05-31T19:55:29.657000
2011-05-31T20:13:33.757000
6,192,809
6,193,155
EF Code First: Treating entity like a complex type (denormalization)
I'm using EF 4.1 Code First, and I'm making a configurable utility for parsing/importing large delimited files. Each row in the file may contain data for several entities. The exact data and layout for the file will be unknown at build time (it's configured differently for each client), so I'm making it configurable. E...
Entity cannot be nested and in the same time complex type cannot have entity key so you cannot use one instead of other but you can try this little cheat. I just tested that it at least creates correct database structure: public class Context: DbContext { public DbSet Accounts { get; set; } public DbSet Contacts { get;...
EF Code First: Treating entity like a complex type (denormalization) I'm using EF 4.1 Code First, and I'm making a configurable utility for parsing/importing large delimited files. Each row in the file may contain data for several entities. The exact data and layout for the file will be unknown at build time (it's conf...
TITLE: EF Code First: Treating entity like a complex type (denormalization) QUESTION: I'm using EF 4.1 Code First, and I'm making a configurable utility for parsing/importing large delimited files. Each row in the file may contain data for several entities. The exact data and layout for the file will be unknown at bui...
[ "entity-framework", "mapping", "ef-code-first", "entity-framework-4.1" ]
2
4
982
1
0
2011-05-31T19:55:47.720000
2011-05-31T20:25:50.043000
6,192,810
6,193,185
Correct SQL Select statement when using BETWEEN
I need to do a few things here and I'm confused on how this should work. Here are the variables I need to work with: Date Range Employee ID Team and a possible additional search term (acct_number='$_REQUEST[q]') if someone wants to search for a specific account number. Each variable is populated with a drop down select...
You cannot use '*' wildcard for WHERE clause. Try using variables for conditions you put in your query, like: if( is_numeric( $searched_employee ) ) $employee_cond = " AND employee_id=$searched_employee"; else $employee_cond = ""; and put $employee_cond inside your query instead of AND employee_id='$searched_employee'....
Correct SQL Select statement when using BETWEEN I need to do a few things here and I'm confused on how this should work. Here are the variables I need to work with: Date Range Employee ID Team and a possible additional search term (acct_number='$_REQUEST[q]') if someone wants to search for a specific account number. Ea...
TITLE: Correct SQL Select statement when using BETWEEN QUESTION: I need to do a few things here and I'm confused on how this should work. Here are the variables I need to work with: Date Range Employee ID Team and a possible additional search term (acct_number='$_REQUEST[q]') if someone wants to search for a specific ...
[ "php", "mysql", "select", "date" ]
2
1
501
3
0
2011-05-31T19:56:09.360000
2011-05-31T20:28:47.220000
6,192,812
6,193,069
Looping Through XSLT
I've got some XML that appears like this Foo Details Bar Details Baz Details Foo Blah Bar BlahBlah Baz BlahBlahBlahBlahBlah What I'm trying to transform is something similar to this: Foo - Details - Blah Bar - Details - BlahBlah Baz - Details - BlahBlahBlahBlahBlah using XSLT 1.0. I'm currently accomplishing the grou...
Try something like this: - I set up a working example for you.
Looping Through XSLT I've got some XML that appears like this Foo Details Bar Details Baz Details Foo Blah Bar BlahBlah Baz BlahBlahBlahBlahBlah What I'm trying to transform is something similar to this: Foo - Details - Blah Bar - Details - BlahBlah Baz - Details - BlahBlahBlahBlahBlah using XSLT 1.0. I'm currently a...
TITLE: Looping Through XSLT QUESTION: I've got some XML that appears like this Foo Details Bar Details Baz Details Foo Blah Bar BlahBlah Baz BlahBlahBlahBlahBlah What I'm trying to transform is something similar to this: Foo - Details - Blah Bar - Details - BlahBlah Baz - Details - BlahBlahBlahBlahBlah using XSLT 1....
[ "xslt", "loops", "grouping" ]
3
2
238
3
0
2011-05-31T19:56:14.713000
2011-05-31T20:17:11.917000
6,192,821
6,193,679
Java EE auto completion
Where can I find the jar file or the source code of JEE6? Or is there another way how you can get autocompletion for this in Netbeans/Eclipse? And I have just installed glassfish so that i can use JAX-RS but i do not understand how it works. Why does the javacompiler find these classes but netbeans does not? I building...
Question #1: See this example project. The example project is built with maven, which may answer your question about auto-complete. Netbeans 6.8+ (approx) has built-in maven support. After the first build of the example project, I think you'll see that auto-complete works better for any dependencies (i.e. jersey) insid...
Java EE auto completion Where can I find the jar file or the source code of JEE6? Or is there another way how you can get autocompletion for this in Netbeans/Eclipse? And I have just installed glassfish so that i can use JAX-RS but i do not understand how it works. Why does the javacompiler find these classes but netbe...
TITLE: Java EE auto completion QUESTION: Where can I find the jar file or the source code of JEE6? Or is there another way how you can get autocompletion for this in Netbeans/Eclipse? And I have just installed glassfish so that i can use JAX-RS but i do not understand how it works. Why does the javacompiler find these...
[ "java", "glassfish", "java-ee-6" ]
0
1
166
1
0
2011-05-31T19:56:41.310000
2011-05-31T21:18:44.067000
6,192,822
6,193,037
To convert a data obtained through URL to post variables
I need to read the result of a form which uses POST action type for submission. So, can I convert a variable obtained through GET variable to POST and then I can simply read the contents using file_get_contents(). Please help me in getting the data using this method or through some alternate method if possible.
file_get_contents can be used to perform POST requests by using stream_context_create: $options = array('http'=>array( 'method'=>'POST', 'header'=>'Content-type: application/x-www-form-urlencoded', 'content'=>'var1=a&var2=b' ) ); echo file_get_contents('http://somesite.com/someform/', false, stream_context_create($opt...
To convert a data obtained through URL to post variables I need to read the result of a form which uses POST action type for submission. So, can I convert a variable obtained through GET variable to POST and then I can simply read the contents using file_get_contents(). Please help me in getting the data using this met...
TITLE: To convert a data obtained through URL to post variables QUESTION: I need to read the result of a form which uses POST action type for submission. So, can I convert a variable obtained through GET variable to POST and then I can simply read the contents using file_get_contents(). Please help me in getting the d...
[ "php", "html", "post" ]
4
3
1,675
2
0
2011-05-31T19:56:48.113000
2011-05-31T20:14:52.883000
6,192,825
6,193,318
C: Calculating the distance between 2 floats modulo 12
I require a function dist( a, b ) // 0 ≤ a,b < 12 which returns the shortest (absolute ie +ve) distance ala clock arithmetic, using modulo 12. So for example, dist( 1, 2 ) = dist( 2, 1 ) = dist( 11, 0 ) = dist( 0, 11 ) = dist( 0.5, 11.5 ) = 1 EDIT: while this can easily be done with a bit of hacking around, I feel that...
Firstly, an optimal solution is nontrivial, it took a little thinking. float distMod12(float a,float b) { float diff = fabs( b - a ); return ( diff < 6 )? diff: 12 - diff; } EDIT: Alternatively, return MIN( diff, 12 - diff ); // needs a MIN function Complete code listing here: http://ideone.com/XxRIw
C: Calculating the distance between 2 floats modulo 12 I require a function dist( a, b ) // 0 ≤ a,b < 12 which returns the shortest (absolute ie +ve) distance ala clock arithmetic, using modulo 12. So for example, dist( 1, 2 ) = dist( 2, 1 ) = dist( 11, 0 ) = dist( 0, 11 ) = dist( 0.5, 11.5 ) = 1 EDIT: while this can e...
TITLE: C: Calculating the distance between 2 floats modulo 12 QUESTION: I require a function dist( a, b ) // 0 ≤ a,b < 12 which returns the shortest (absolute ie +ve) distance ala clock arithmetic, using modulo 12. So for example, dist( 1, 2 ) = dist( 2, 1 ) = dist( 11, 0 ) = dist( 0, 11 ) = dist( 0.5, 11.5 ) = 1 EDIT...
[ "c", "distance", "modulo" ]
13
16
4,388
5
0
2011-05-31T19:57:05.100000
2011-05-31T20:43:20.353000
6,192,840
6,195,780
iOS system icons and custom buttons
i'm working on my first app and the problem a have is that the application interface design is quite customised, (even though it is a tab bar based app). now in one of the view controllers i need to present the user with the print interaction controller to print images. the thing is i don't use a navigation bar or a to...
You might want to consider having a toolbar at the top of the view for this particular tab. Just appearing on this tab. This would make the issue moot. You could also, have the tool bar "slide in" and "slide out" from the top to provide access to this (and other?) actions. A single or double tap could instigate such an...
iOS system icons and custom buttons i'm working on my first app and the problem a have is that the application interface design is quite customised, (even though it is a tab bar based app). now in one of the view controllers i need to present the user with the print interaction controller to print images. the thing is ...
TITLE: iOS system icons and custom buttons QUESTION: i'm working on my first app and the problem a have is that the application interface design is quite customised, (even though it is a tab bar based app). now in one of the view controllers i need to present the user with the print interaction controller to print ima...
[ "ios", "button", "system" ]
0
0
3,357
2
0
2011-05-31T19:57:55.270000
2011-06-01T02:56:45.720000
6,192,841
6,193,036
Win API Local File Reference c++
I am trying to hard code into C++ program to look for config.ini in the same directory as the executable, without knowing the complete path to the file. I am trying to find a way to make a local reference to the executable. Basically load ("./config.ini") without doing ("C:\foo\bar\config.ini")
You want GetModuleFilename() on Windows (pass NULL to get filename of current executable). Otherwise, call boost::filesystem::initial_path() early in the program (see Boost docs in link for the reason to do this early). That should cover most of the situations. Edit Brain malfunction. We always start our programs from ...
Win API Local File Reference c++ I am trying to hard code into C++ program to look for config.ini in the same directory as the executable, without knowing the complete path to the file. I am trying to find a way to make a local reference to the executable. Basically load ("./config.ini") without doing ("C:\foo\bar\conf...
TITLE: Win API Local File Reference c++ QUESTION: I am trying to hard code into C++ program to look for config.ini in the same directory as the executable, without knowing the complete path to the file. I am trying to find a way to make a local reference to the executable. Basically load ("./config.ini") without doing...
[ "c++", "file", "io" ]
1
1
238
4
0
2011-05-31T19:57:57.287000
2011-05-31T20:14:51.420000
6,192,844
6,193,455
What library to use for building HTML documents?
Could please anybody recommend libraries that are able to do the opposite thing than these libraries? HtmlCleaner, TagSoup, HtmlParser, HtmlUnit, jSoup, jTidy, nekoHtml, WebHarvest or Jericho. I need to build html pages, build the DOM model from String content. EDIT: I need it for testing purposes. I have various types...
If you are interested in HtmlCleaner particularly, it is actually a very convenient choice for building html documents. But you must know that if you want to set content to a TagNode, you append a child ContentNode element:-) List paragraphs = getParagraphs(entity.getFile()); List pNodes = new ArrayList (); TagNode ht...
What library to use for building HTML documents? Could please anybody recommend libraries that are able to do the opposite thing than these libraries? HtmlCleaner, TagSoup, HtmlParser, HtmlUnit, jSoup, jTidy, nekoHtml, WebHarvest or Jericho. I need to build html pages, build the DOM model from String content. EDIT: I n...
TITLE: What library to use for building HTML documents? QUESTION: Could please anybody recommend libraries that are able to do the opposite thing than these libraries? HtmlCleaner, TagSoup, HtmlParser, HtmlUnit, jSoup, jTidy, nekoHtml, WebHarvest or Jericho. I need to build html pages, build the DOM model from String ...
[ "java", "html", "dom", "htmlcleaner" ]
3
2
3,491
4
0
2011-05-31T19:58:24.477000
2011-05-31T20:55:34.923000
6,192,848
6,193,836
How to generalize outer to n dimensions?
The standard R expression outer(X, Y, f) evaluates to a matrix whose (i, j)-th entry has the value f(X[i], Y[j]). I would like to implement the function multi.outer, an n-dimensional generalization of outer: multi.outer(f, X_1,..., X_n), where f is some n-ary function, would produce a (length(X_1) *... * length(X_n)) a...
This is one way: First use Vectorize and outer to define a function that creates an n-dimensional matrix where each entry is a list of arguments on which the given function will be applied: list_args <- Vectorize( function(a,b) c( as.list(a), as.list(b) ), SIMPLIFY = FALSE) make_args_mtx <- function( alist ) { Reduce(...
How to generalize outer to n dimensions? The standard R expression outer(X, Y, f) evaluates to a matrix whose (i, j)-th entry has the value f(X[i], Y[j]). I would like to implement the function multi.outer, an n-dimensional generalization of outer: multi.outer(f, X_1,..., X_n), where f is some n-ary function, would pro...
TITLE: How to generalize outer to n dimensions? QUESTION: The standard R expression outer(X, Y, f) evaluates to a matrix whose (i, j)-th entry has the value f(X[i], Y[j]). I would like to implement the function multi.outer, an n-dimensional generalization of outer: multi.outer(f, X_1,..., X_n), where f is some n-ary f...
[ "r", "vectorization", "reduce", "outer-join" ]
8
16
3,451
3
0
2011-05-31T19:58:59.127000
2011-05-31T21:34:29.187000
6,192,852
6,216,936
Titanium Appcelerator Photo Gallery (Display grid of photos based on list from server)
I'm having some problems with the Photo Gallery view in Titanium Appcelerator (iPhone app). I don't really have any example code at the moment to share because I'm at a loss for exactly how this is supposed to function. I just want to call my server for a list of images, and show these images in a grid as thumbnails th...
var newsFeed = Titanium.Facebook.requestWithGraphPath('me/feed', {}, 'GET', function(e) { if (e.success) { var videoObjs = new Array(); var result = (JSON.parse(e.result)).data; for(var c = 0; c < result.length;c++) { if(result[c].type == 'video') { var vid = result[c].source.substring((result[c].source.indexOf("/v/")...
Titanium Appcelerator Photo Gallery (Display grid of photos based on list from server) I'm having some problems with the Photo Gallery view in Titanium Appcelerator (iPhone app). I don't really have any example code at the moment to share because I'm at a loss for exactly how this is supposed to function. I just want t...
TITLE: Titanium Appcelerator Photo Gallery (Display grid of photos based on list from server) QUESTION: I'm having some problems with the Photo Gallery view in Titanium Appcelerator (iPhone app). I don't really have any example code at the moment to share because I'm at a loss for exactly how this is supposed to funct...
[ "iphone", "titanium", "photo-gallery" ]
3
3
8,294
1
0
2011-05-31T19:59:21.653000
2011-06-02T15:52:36.677000
6,192,853
6,193,701
Bteq Scripts to copy data between two Teradata servers
How do I copy data from multiple tables within one database to another database residing on a different server? Is this possible through a BTEQ Script in Teradata? If so, provide a sample. If not, are there other options to do this other than using a flat-file?
If I am understanding your question, you want to move a set of tables from one DB to another. You can use the following syntax in a BTEQ Script to copy the tables and data: CREATE TABLE. AS. WITH DATA AND STATS; Or just the table structures: CREATE TABLE. AS. WITH NO DATA AND NO STATS; If you get real savvy you can cre...
Bteq Scripts to copy data between two Teradata servers How do I copy data from multiple tables within one database to another database residing on a different server? Is this possible through a BTEQ Script in Teradata? If so, provide a sample. If not, are there other options to do this other than using a flat-file?
TITLE: Bteq Scripts to copy data between two Teradata servers QUESTION: How do I copy data from multiple tables within one database to another database residing on a different server? Is this possible through a BTEQ Script in Teradata? If so, provide a sample. If not, are there other options to do this other than usin...
[ "sql", "teradata" ]
2
1
9,323
4
0
2011-05-31T19:59:24.303000
2011-05-31T21:20:12.067000
6,192,856
6,193,400
MSBuild - Nest an external file (file outside of the project folder) into a file in the project folder
I have the following scenario: I have 2 projects: Proj1 Proj2 Each of these projects needs access to a similar service (FooService) so I wrote up the Foo.svc and Foo.svc.cs files and put them in a directory that was outside of both of the project directories. I then edited my Proj1.csproj file to do the following: Foo....
What you're talking about is altering your MSBuild file (also known as a csproj file - http://msdn.microsoft.com/en-us/library/bb629388.aspx ) I tried to simulate what you're doing and I don't think there is a solution that would fit what you want. You're right, your project will work just fine, but aesthetically you c...
MSBuild - Nest an external file (file outside of the project folder) into a file in the project folder I have the following scenario: I have 2 projects: Proj1 Proj2 Each of these projects needs access to a similar service (FooService) so I wrote up the Foo.svc and Foo.svc.cs files and put them in a directory that was o...
TITLE: MSBuild - Nest an external file (file outside of the project folder) into a file in the project folder QUESTION: I have the following scenario: I have 2 projects: Proj1 Proj2 Each of these projects needs access to a similar service (FooService) so I wrote up the Foo.svc and Foo.svc.cs files and put them in a di...
[ "wcf", "iis", "msbuild" ]
0
1
163
1
0
2011-05-31T19:59:32.730000
2011-05-31T20:50:25.970000
6,192,858
6,192,918
LINQ query complex join problem
So I was trying to convert a SQL into LINQ query the logic is: JOIN SalesPeriod SP1 ON SP1.SalesPeriodId = SE1.SalesPeriodId AND SP1.SalePeriodId =.....(XML stuff) but it keeps complaining the types on both sides of equals statement don't match Any ideas? Note: I declared b and d because it doesn't accept anonymous typ...
Simple, they're not the same (compatible) types. The first key has a SalesPeriodId of type whatever, and b of type string. The second key has a SalesPeriodId of type whatever (probably the same as the first's), and d of type string. You can't compare these to eachother. It must have the same properties of the same type...
LINQ query complex join problem So I was trying to convert a SQL into LINQ query the logic is: JOIN SalesPeriod SP1 ON SP1.SalesPeriodId = SE1.SalesPeriodId AND SP1.SalePeriodId =.....(XML stuff) but it keeps complaining the types on both sides of equals statement don't match Any ideas? Note: I declared b and d because...
TITLE: LINQ query complex join problem QUESTION: So I was trying to convert a SQL into LINQ query the logic is: JOIN SalesPeriod SP1 ON SP1.SalesPeriodId = SE1.SalesPeriodId AND SP1.SalePeriodId =.....(XML stuff) but it keeps complaining the types on both sides of equals statement don't match Any ideas? Note: I declar...
[ "linq" ]
0
3
605
3
0
2011-05-31T19:59:45.287000
2011-05-31T20:05:05.243000
6,192,860
6,193,301
Leading period as folder name in a URL
I am working on a project where the name of our assets folder is.assets, and must remain that way. We need it to be as such so that it's hidden on UNIX and Linux systems. The only problem with this is that: background-image: url(.assets/images/startup_arabic.jpg); background-image: url(/.assets/images/startup_arabic.jp...
well I don't know your directory structure but use./.assets if your file you are using to access the.assets folder is in the same dir as the.assets folder Also put your url in quotes
Leading period as folder name in a URL I am working on a project where the name of our assets folder is.assets, and must remain that way. We need it to be as such so that it's hidden on UNIX and Linux systems. The only problem with this is that: background-image: url(.assets/images/startup_arabic.jpg); background-image...
TITLE: Leading period as folder name in a URL QUESTION: I am working on a project where the name of our assets folder is.assets, and must remain that way. We need it to be as such so that it's hidden on UNIX and Linux systems. The only problem with this is that: background-image: url(.assets/images/startup_arabic.jpg)...
[ "html", "url", "syntax", "path", "directory" ]
0
1
2,943
3
0
2011-05-31T19:59:49.610000
2011-05-31T20:41:12.757000
6,192,863
6,197,385
htaccess 301 Redirect
I'm trying to 301 redirect http://www.domain.com/page.html to http://subdomain.domain.com/page.html and tried: redirect 301 /page.html http://subdomain.domain.com/page.html The problem is both the domain and the subdomain are pointed to the same dir and that makes the redirect in a way that will never complete. also tr...
ok...I figured this out - the second case works - just needs to be placed right after RewriteEngine On: RewriteCond %{HTTP_HOST} ^domain.com$ [OR] RewriteCond %{HTTP_HOST} ^www.domain.com$ RewriteRule ^page.html$ http://subdomain.domain.com/page.html [R=301,L] and this could be used for multiple rules under one condit...
htaccess 301 Redirect I'm trying to 301 redirect http://www.domain.com/page.html to http://subdomain.domain.com/page.html and tried: redirect 301 /page.html http://subdomain.domain.com/page.html The problem is both the domain and the subdomain are pointed to the same dir and that makes the redirect in a way that will n...
TITLE: htaccess 301 Redirect QUESTION: I'm trying to 301 redirect http://www.domain.com/page.html to http://subdomain.domain.com/page.html and tried: redirect 301 /page.html http://subdomain.domain.com/page.html The problem is both the domain and the subdomain are pointed to the same dir and that makes the redirect in...
[ "mod-rewrite", "redirect", "url-rewriting" ]
3
1
490
1
0
2011-05-31T19:59:59.670000
2011-06-01T06:58:26.023000
6,192,871
6,193,563
Centering Horizontally and Vertically an image inside a box
I'm trying to vertically and horizontally center logos of various sizes within a floated grey box so that when they are along side of one another they'll have equal distance between each other. Can anyone help with this? I have the horizontal alignment but the vertical is not so simple. section#content { overflow: hidd...
I tested this and it may be what you are looking for. section#content { overflow: hidden; clear: both; #set spacing between child elements border-spacing: 11px; } #content.thumbnail { width: 240px; height: 200px; # moved margin properties to enclosing block # float: left; # margin: 0px 0px 11px 11px; background: #ccc...
Centering Horizontally and Vertically an image inside a box I'm trying to vertically and horizontally center logos of various sizes within a floated grey box so that when they are along side of one another they'll have equal distance between each other. Can anyone help with this? I have the horizontal alignment but the...
TITLE: Centering Horizontally and Vertically an image inside a box QUESTION: I'm trying to vertically and horizontally center logos of various sizes within a floated grey box so that when they are along side of one another they'll have equal distance between each other. Can anyone help with this? I have the horizontal...
[ "html", "css" ]
0
1
657
1
0
2011-05-31T20:00:45.163000
2011-05-31T21:07:20.833000
6,192,877
6,193,260
How to use g:datePicker in grails gsp to pick a time?
By using g:datePicker on java.sql.Time object that refers to a TIME legacy DB column I get this error: Failed to convert property value of type java.util.GregorianCalendar to required type java.sql.Time for property jobTime; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.util...
It looks like you're trying to convert a GregorianCalendar object to a Time object (at least, that's what the object says its doing). Try manually doing it: // assuming that 'jobTime' is the object you're dealing with jobTime = new java.sql.Time(jobTime.getTimeInMillis()) If you're absolutely sure its a Time object, tr...
How to use g:datePicker in grails gsp to pick a time? By using g:datePicker on java.sql.Time object that refers to a TIME legacy DB column I get this error: Failed to convert property value of type java.util.GregorianCalendar to required type java.sql.Time for property jobTime; nested exception is java.lang.IllegalArgu...
TITLE: How to use g:datePicker in grails gsp to pick a time? QUESTION: By using g:datePicker on java.sql.Time object that refers to a TIME legacy DB column I get this error: Failed to convert property value of type java.util.GregorianCalendar to required type java.sql.Time for property jobTime; nested exception is jav...
[ "grails", "time", "groovy", "gsp" ]
1
1
917
1
0
2011-05-31T20:01:18.313000
2011-05-31T20:37:18.437000
6,192,880
6,193,073
Normalization 3NF
I an reading through some examples of normalization, however I have come across one that I do not understand. The website the example is located here: http://cisnet.baruch.cuny.edu/holowczak/classes/3400/normalization/#allinone The part I do not understand is "Third Normal Form" In my head I see the transitive dependen...
5) you assume a naming sheme here... offices 4xx have to be on floor 4... 5xx have to be on floor 5... if such a scheme exists, you can have your dependency... as long as this is not part of the specification... no. 5 is out of the game...
Normalization 3NF I an reading through some examples of normalization, however I have come across one that I do not understand. The website the example is located here: http://cisnet.baruch.cuny.edu/holowczak/classes/3400/normalization/#allinone The part I do not understand is "Third Normal Form" In my head I see the t...
TITLE: Normalization 3NF QUESTION: I an reading through some examples of normalization, however I have come across one that I do not understand. The website the example is located here: http://cisnet.baruch.cuny.edu/holowczak/classes/3400/normalization/#allinone The part I do not understand is "Third Normal Form" In m...
[ "database", "relational-database", "database-normalization", "functional-dependencies", "3nf" ]
1
1
899
3
0
2011-05-31T20:01:31.943000
2011-05-31T20:17:42.557000
6,192,881
6,193,004
Upload lower version number of app
I have client with an app in the app store that was at version 4.05 and they accidentally submitted a new build as version 5.06 when they meant to submit it as 4.06. They aren't ready yet for a full version number increase. Long story. Is it possible to submit the next version as 4.06 to get it back on track? Or is not...
Yes. The version numbers only need be distinct. From the Developer Guide: A Version Number The unique version number of the app. Keep the following in mind: Use typical software versioning conventions (for example, “1.0 or 1.0.1 or 1.1”). Do not include words such as “build”, “version” or “beta” in your version number....
Upload lower version number of app I have client with an app in the app store that was at version 4.05 and they accidentally submitted a new build as version 5.06 when they meant to submit it as 4.06. They aren't ready yet for a full version number increase. Long story. Is it possible to submit the next version as 4.06...
TITLE: Upload lower version number of app QUESTION: I have client with an app in the app store that was at version 4.05 and they accidentally submitted a new build as version 5.06 when they meant to submit it as 4.06. They aren't ready yet for a full version number increase. Long story. Is it possible to submit the ne...
[ "iphone", "app-store" ]
6
4
1,745
1
0
2011-05-31T20:01:32.950000
2011-05-31T20:12:32.713000
6,192,883
6,193,369
Is Lua an event-based programming language?
Is Lua event-based or thread-based? I've been reading a lot about Node.js lately, and it appears that one of the the largest selling points for it is related to it being event-based as opposed to thread-based. What is Lua?
Do not mix terms. Lua is a programming language. Node.js is an evented library/framework written using JavaScript. Lua can be (almost) anything you want;) You can write your code thread-based using libraries like Lua-Lanes, or you can create/use event-based libraries. In fact, there is a Lua port of Node.js in developm...
Is Lua an event-based programming language? Is Lua event-based or thread-based? I've been reading a lot about Node.js lately, and it appears that one of the the largest selling points for it is related to it being event-based as opposed to thread-based. What is Lua?
TITLE: Is Lua an event-based programming language? QUESTION: Is Lua event-based or thread-based? I've been reading a lot about Node.js lately, and it appears that one of the the largest selling points for it is related to it being event-based as opposed to thread-based. What is Lua? ANSWER: Do not mix terms. Lua is a...
[ "multithreading", "events", "node.js", "lua", "multiprocessing" ]
1
9
1,169
1
0
2011-05-31T20:02:08.813000
2011-05-31T20:47:41.403000
6,192,889
6,193,038
Legally avoiding popup blocking
What is causing some browsers to see my code as unsolicited? I have a web site devoted to helping people with interactive sessions. It starts with the user clicking [Begin] so this is a consented action. This should (1) open a popup while (2) redirecting the first page to a end page as below: As said, this is not tryin...
No much you can do. You could ask your users to disable pop-up blockers or inform them that a pop-up blocker is enabled by checking the window object ref returned by window.open() e.g. var w = window.open('http://domain.com'); if(!w) { //an alert in this example alert('oops..seems like a pop-up blocker is enabled. Plea...
Legally avoiding popup blocking What is causing some browsers to see my code as unsolicited? I have a web site devoted to helping people with interactive sessions. It starts with the user clicking [Begin] so this is a consented action. This should (1) open a popup while (2) redirecting the first page to a end page as b...
TITLE: Legally avoiding popup blocking QUESTION: What is causing some browsers to see my code as unsolicited? I have a web site devoted to helping people with interactive sessions. It starts with the user clicking [Begin] so this is a consented action. This should (1) open a popup while (2) redirecting the first page ...
[ "javascript" ]
14
6
11,880
3
0
2011-05-31T20:02:49.857000
2011-05-31T20:14:56.307000
6,192,898
6,192,949
Thread.Start() versus ThreadPool.QueueUserWorkItem()
The Microsoft.NET Base Class Library provides several ways to create a thread and start it. Basically the invocation is very similar to every other one providing the same kind of service: create an object representing an execution flow (or more), assign it a delegate representing the execution flow to execute and, even...
Starting a new thread can be a very expensive operation. The thread pool reuses threads and thus amortizes the cost. Unless you need a dedicated thread, the thread pool is the recommended way to go. By using a dedicated thread you have more control over thread specific attributes such as priority, culture and so forth....
Thread.Start() versus ThreadPool.QueueUserWorkItem() The Microsoft.NET Base Class Library provides several ways to create a thread and start it. Basically the invocation is very similar to every other one providing the same kind of service: create an object representing an execution flow (or more), assign it a delegate...
TITLE: Thread.Start() versus ThreadPool.QueueUserWorkItem() QUESTION: The Microsoft.NET Base Class Library provides several ways to create a thread and start it. Basically the invocation is very similar to every other one providing the same kind of service: create an object representing an execution flow (or more), as...
[ "c#", ".net", "multithreading", "threadpool" ]
50
57
36,140
7
0
2011-05-31T20:03:35.217000
2011-05-31T20:07:59.657000
6,192,899
6,193,184
js method fails (throws exception?), which firebug does not report
The following js method does not return, yet firebug reports no exception: function test_contains_doesNotBailWithoutException() { $.contains(document.getElementById('navlinks', undefined)); // This line should be reached, or you should get an exception message in Firebug. return true; } where navlinks is something tha...
Yes, there should be an exception; I certainly get one with either the JavaScript version: Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOM3Node.compareDocumentPosition]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame:: javascrip...
js method fails (throws exception?), which firebug does not report The following js method does not return, yet firebug reports no exception: function test_contains_doesNotBailWithoutException() { $.contains(document.getElementById('navlinks', undefined)); // This line should be reached, or you should get an exception...
TITLE: js method fails (throws exception?), which firebug does not report QUESTION: The following js method does not return, yet firebug reports no exception: function test_contains_doesNotBailWithoutException() { $.contains(document.getElementById('navlinks', undefined)); // This line should be reached, or you shoul...
[ "javascript", "firebug" ]
2
1
356
1
0
2011-05-31T20:03:51.067000
2011-05-31T20:28:29.540000
6,192,901
6,192,951
Static Method -- Is it usual behavior?
Have a small doubt with static method. Documentation says that "Static method can't access instance member variable OR static methods and properties can only access static fields and static events since it's gets executed much before an instance is created". So, the below code fails to compile class staticclass { int a...
You're misunderstanding what static means – it means that you only have access to static members of this. It doesn't restrict you accessing another object's non-static members. The fact that the "other" object you're accessing in your static method happens to be an instance of the same class does not matter.
Static Method -- Is it usual behavior? Have a small doubt with static method. Documentation says that "Static method can't access instance member variable OR static methods and properties can only access static fields and static events since it's gets executed much before an instance is created". So, the below code fai...
TITLE: Static Method -- Is it usual behavior? QUESTION: Have a small doubt with static method. Documentation says that "Static method can't access instance member variable OR static methods and properties can only access static fields and static events since it's gets executed much before an instance is created". So, ...
[ "c#-2.0", "static-methods" ]
2
5
76
1
0
2011-05-31T20:03:57.380000
2011-05-31T20:08:03.183000
6,192,906
6,204,713
Can I put a windows (.bat ) file inside the resources folder of a Visual studio C# project?
Although one can run a batch file form c: location, i would like to know if its possible to have the.bat file inside the resources folder. I tried this Process p = new Process; p.StartInfo.FileName = @"\Resources\batchfile.bat"; and this p.StartInfo.FileName = @"\Resources\batchfile"; Both don't work.
string location; Process p = new Process; location = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) +@"\Resources\batchfile.bat"; p.StartInfo.FileName = location;
Can I put a windows (.bat ) file inside the resources folder of a Visual studio C# project? Although one can run a batch file form c: location, i would like to know if its possible to have the.bat file inside the resources folder. I tried this Process p = new Process; p.StartInfo.FileName = @"\Resources\batchfile.bat";...
TITLE: Can I put a windows (.bat ) file inside the resources folder of a Visual studio C# project? QUESTION: Although one can run a batch file form c: location, i would like to know if its possible to have the.bat file inside the resources folder. I tried this Process p = new Process; p.StartInfo.FileName = @"\Resourc...
[ "c#", "batch-file" ]
5
5
4,946
4
0
2011-05-31T20:04:27.300000
2011-06-01T16:41:56.693000
6,192,908
6,192,928
How do I reset the title in an HTML page, without reloading?
I am trying to reset the title of the page in JQuery, without having to refresh it. Every place I have looked allows me to use either: $('title').text('foo'); OR $(document).attr('title', 'foo2'); Which [apparently] needs a refresh to work properly. I am loading information into a div in the main page and never needing...
Not much to do with jquery, except for when (ie handling some event) you decide to change the page title: document.title = 'something';
How do I reset the title in an HTML page, without reloading? I am trying to reset the title of the page in JQuery, without having to refresh it. Every place I have looked allows me to use either: $('title').text('foo'); OR $(document).attr('title', 'foo2'); Which [apparently] needs a refresh to work properly. I am load...
TITLE: How do I reset the title in an HTML page, without reloading? QUESTION: I am trying to reset the title of the page in JQuery, without having to refresh it. Every place I have looked allows me to use either: $('title').text('foo'); OR $(document).attr('title', 'foo2'); Which [apparently] needs a refresh to work p...
[ "jquery", "html", "properties" ]
4
13
1,297
3
0
2011-05-31T20:04:42.157000
2011-05-31T20:05:58.987000
6,192,910
6,193,576
Converting a txt File from ANSI to UTF-8 programmatically
I need your help here please. I'm working on a java application that convert data from a txt file into the database, The problem is that the file have ANSI encoding which i can't change because it comes from outside my application,and when i write the data to the database i got some "???" inside. My question is, how ca...
Use open a decoding Reader like this one: Reader reader = new InputStreamReader(inputStream, Charset.forName(encodingName)); Exaclty which encoding name you should use depends on which "ANSI" encoding the text file was written in. You can find a list of encoding supported by Java 6 here. If it is an English-language sy...
Converting a txt File from ANSI to UTF-8 programmatically I need your help here please. I'm working on a java application that convert data from a txt file into the database, The problem is that the file have ANSI encoding which i can't change because it comes from outside my application,and when i write the data to th...
TITLE: Converting a txt File from ANSI to UTF-8 programmatically QUESTION: I need your help here please. I'm working on a java application that convert data from a txt file into the database, The problem is that the file have ANSI encoding which i can't change because it comes from outside my application,and when i wr...
[ "java", "encoding", "utf-8", "file", "text-files" ]
9
6
36,091
2
0
2011-05-31T20:04:48.003000
2011-05-31T21:08:20.993000
6,192,914
6,193,214
Spring beans injected into JSF Managed Beans
Problem Description: My injected Spring bean defined as a Managed-Property to a JSF backing bean is not being instantiated. Its always coming up null when I retreive the Managed-Bean. I have been fighting with this all day and it seems that JSF Managed Bean just won't read out of the applicationContext from Spring. I c...
First of all and I think this your problem that DelegatingVariableResolver is deprecated in all JSF version after 1.1 and you are using 1.2 so please use this following configuration. org.springframework.web.jsf.el.SpringBeanFacesELResolver Hope it helps.
Spring beans injected into JSF Managed Beans Problem Description: My injected Spring bean defined as a Managed-Property to a JSF backing bean is not being instantiated. Its always coming up null when I retreive the Managed-Bean. I have been fighting with this all day and it seems that JSF Managed Bean just won't read o...
TITLE: Spring beans injected into JSF Managed Beans QUESTION: Problem Description: My injected Spring bean defined as a Managed-Property to a JSF backing bean is not being instantiated. Its always coming up null when I retreive the Managed-Bean. I have been fighting with this all day and it seems that JSF Managed Bean...
[ "spring", "jsf", "configuration" ]
2
12
9,835
2
0
2011-05-31T20:04:59.960000
2011-05-31T20:31:37.183000
6,192,919
6,192,985
Preference UI Components without PrefernceActivity
Is there a way to use the ui Components from the preference package without a PreferenceActivity? I have to build a lot of settingsviews, and i cant use sharedprefernces. Do i Have to build this all by hand? Vino
Is there a way to use the ui Components from the preference package without a PreferenceActivity? Preferences are built using normal widgets, such as ListView, CheckedTextView, etc. You cannot use subclasses of Preference outside of PreferenceActivity, though. I have to build a lot of settingsviews Use SharedPreference...
Preference UI Components without PrefernceActivity Is there a way to use the ui Components from the preference package without a PreferenceActivity? I have to build a lot of settingsviews, and i cant use sharedprefernces. Do i Have to build this all by hand? Vino
TITLE: Preference UI Components without PrefernceActivity QUESTION: Is there a way to use the ui Components from the preference package without a PreferenceActivity? I have to build a lot of settingsviews, and i cant use sharedprefernces. Do i Have to build this all by hand? Vino ANSWER: Is there a way to use the ui ...
[ "android" ]
0
0
261
1
0
2011-05-31T20:05:06.997000
2011-05-31T20:11:18.873000
6,192,925
6,192,995
How do I debug MVC 3 web application?
I have an MVC 3 web application. I need to step through the controller code. I set break point in the controller and hit F5. I get this error: Unable to launch the ASP.NET development server because port 'xxxx' is in use. Any one has the simple steps to help me step through the code? Visual Studio: 2010 IIS: 7.5 OS: Wi...
I find this can happen if you had been working on an ASP.NET Website (MVC or Forms), and it has been starting the web development server. Then VS crashes and leaves it running. So as @ChrisF recommends, just make sure all the web dev servers are gone, then try again. Specifically, the process name is either WebDev.WebS...
How do I debug MVC 3 web application? I have an MVC 3 web application. I need to step through the controller code. I set break point in the controller and hit F5. I get this error: Unable to launch the ASP.NET development server because port 'xxxx' is in use. Any one has the simple steps to help me step through the cod...
TITLE: How do I debug MVC 3 web application? QUESTION: I have an MVC 3 web application. I need to step through the controller code. I set break point in the controller and hit F5. I get this error: Unable to launch the ASP.NET development server because port 'xxxx' is in use. Any one has the simple steps to help me st...
[ "visual-studio-2010", "debugging", "asp.net-mvc-3" ]
2
1
3,279
2
0
2011-05-31T20:05:35.863000
2011-05-31T20:12:06.397000
6,192,926
6,195,098
Beat Detection from line in
I wan't to try some beat detection algorithms from here in Java. My problem: How do I get the current audio mix from the soundcard as datasource for the algorithms?
Check out the Java Tutorial for Accessing Audio System Resources.
Beat Detection from line in I wan't to try some beat detection algorithms from here in Java. My problem: How do I get the current audio mix from the soundcard as datasource for the algorithms?
TITLE: Beat Detection from line in QUESTION: I wan't to try some beat detection algorithms from here in Java. My problem: How do I get the current audio mix from the soundcard as datasource for the algorithms? ANSWER: Check out the Java Tutorial for Accessing Audio System Resources.
[ "java", "audio", "fft", "heartbeat" ]
3
2
1,118
1
0
2011-05-31T20:05:36.350000
2011-06-01T00:42:48.540000
6,192,933
6,193,092
How to avoid "Type mismatch" in static generic factory method?
Either I'm too stupid to use google, or nobody else encountered this problem so far. I'm trying to compile the following code: public interface MyClass { public class Util { private static MyClass _this; public static T getInstance(Class clazz) { if(_this == null) { try { _this = clazz.newInstance(); } catch(Exception ...
Imagine you have two implementations of MyClass, Foo and Bar. As a field of type MyClass, _this could be a Foo or a Bar. Now, since your getInstance method returns, it's legal to call it any of these ways: MyClass myClass = Util.getInstance(MyClass.class); This doesn't work if it's the first call, because MyClass is an...
How to avoid "Type mismatch" in static generic factory method? Either I'm too stupid to use google, or nobody else encountered this problem so far. I'm trying to compile the following code: public interface MyClass { public class Util { private static MyClass _this; public static T getInstance(Class clazz) { if(_this =...
TITLE: How to avoid "Type mismatch" in static generic factory method? QUESTION: Either I'm too stupid to use google, or nobody else encountered this problem so far. I'm trying to compile the following code: public interface MyClass { public class Util { private static MyClass _this; public static T getInstance(Class c...
[ "java", "generics", "generic-method" ]
5
6
522
4
0
2011-05-31T20:06:34.390000
2011-05-31T20:19:59.110000
6,192,939
6,193,170
IntelliJ Idea - configuring search
I'm a front end developer who's recently started using IntelliJ Idea for JS development. I've found it's a fantastic IDE with some excellent features - the search functions are especially useful. Unfortunately, with the complexity of our setup I'm getting far too many results in my "Find in Path" and file searches. It'...
The thing is, as you said yourself, you shouldn't have your release files mixed with your trunk (in the IDE at least) and you don't want to change the project configuration. So having scopes is the best solution you can have right now; maybe not the best way to deal with this problem, but given the conditions I think i...
IntelliJ Idea - configuring search I'm a front end developer who's recently started using IntelliJ Idea for JS development. I've found it's a fantastic IDE with some excellent features - the search functions are especially useful. Unfortunately, with the complexity of our setup I'm getting far too many results in my "F...
TITLE: IntelliJ Idea - configuring search QUESTION: I'm a front end developer who's recently started using IntelliJ Idea for JS development. I've found it's a fantastic IDE with some excellent features - the search functions are especially useful. Unfortunately, with the complexity of our setup I'm getting far too man...
[ "javascript", "intellij-idea" ]
0
1
290
2
0
2011-05-31T20:06:58.580000
2011-05-31T20:27:37.580000
6,192,941
6,193,226
Why am I not getting colors with shoulda and test::unit?
I have 2 identical ruby setups. One of them is a VM of ubuntu running inside of windows. The other is a native ubuntu install. On the VM, my Test::Unit output is colored with green, yellow, and red. Both of them are running ruby-1.9.2-p180, installed through rvm. Both of them have exactly the same gems installed, as ve...
I'd guess that you have different TERM environment variables inside the VM than you do outside the VM.
Why am I not getting colors with shoulda and test::unit? I have 2 identical ruby setups. One of them is a VM of ubuntu running inside of windows. The other is a native ubuntu install. On the VM, my Test::Unit output is colored with green, yellow, and red. Both of them are running ruby-1.9.2-p180, installed through rvm....
TITLE: Why am I not getting colors with shoulda and test::unit? QUESTION: I have 2 identical ruby setups. One of them is a VM of ubuntu running inside of windows. The other is a native ubuntu install. On the VM, my Test::Unit output is colored with green, yellow, and red. Both of them are running ruby-1.9.2-p180, inst...
[ "ruby", "shoulda", "testunit" ]
0
1
437
1
0
2011-05-31T20:07:05.913000
2011-05-31T20:33:28.203000
6,192,947
6,291,141
Own string usage
I have my own string class and I want to export it into python (with boost.python) and use as a native string. I wrote converters for this. The first is exporting of my string: bp::class_ ("CL_StringRef8", bp::init ()).def("CStr", &CL_StringRef8::c_str); Converters are from default tutorial but with my type: // CL_Stri...
In order for the.def(bp::self_ns::str(bp::self_ns::self)); line to work, you need to have the streaming operator defined for your class. std::ostream & operator<<(std::ostream & os, const CL_StringRef8 &s) { os << s.c_str(); return os; } An alternative way of defining the str() method without needing the streaming oper...
Own string usage I have my own string class and I want to export it into python (with boost.python) and use as a native string. I wrote converters for this. The first is exporting of my string: bp::class_ ("CL_StringRef8", bp::init ()).def("CStr", &CL_StringRef8::c_str); Converters are from default tutorial but with my...
TITLE: Own string usage QUESTION: I have my own string class and I want to export it into python (with boost.python) and use as a native string. I wrote converters for this. The first is exporting of my string: bp::class_ ("CL_StringRef8", bp::init ()).def("CStr", &CL_StringRef8::c_str); Converters are from default tu...
[ "c++", "python", "boost", "export" ]
2
2
905
1
0
2011-05-31T20:07:43.210000
2011-06-09T10:07:03.687000
6,192,950
6,192,975
Store a value in ViewBag from javascript
How can I store a value in the ViewBag accessing it from javascript?
You cannot store a value in ViewBag from javascript. ViewBag is a server side concept and exists only on the server. Javascript runs on the client. As far as storing some data from ViewBag into a javascript variable is concerned you could use the following: Now this being said I always advice people against using ViewB...
Store a value in ViewBag from javascript How can I store a value in the ViewBag accessing it from javascript?
TITLE: Store a value in ViewBag from javascript QUESTION: How can I store a value in the ViewBag accessing it from javascript? ANSWER: You cannot store a value in ViewBag from javascript. ViewBag is a server side concept and exists only on the server. Javascript runs on the client. As far as storing some data from Vi...
[ "javascript", "asp.net-mvc-3", "viewbag" ]
16
40
36,155
2
0
2011-05-31T20:08:03.027000
2011-05-31T20:10:02.650000
6,192,960
6,193,028
How to cancel a method registered with [performSelector: withObject: afterDelay:]?
My problem is, at some point in my application I call [performSelector: withObject: afterDelay:] but during the delay which can be up to 1 second several things happen that decide whether the delayed method should or should not be called, however, once registered, the selector can't be unregistered so it will be called...
The cancelPreviousPerformRequestsWithTarget: method will remove any such queued perform operations.
How to cancel a method registered with [performSelector: withObject: afterDelay:]? My problem is, at some point in my application I call [performSelector: withObject: afterDelay:] but during the delay which can be up to 1 second several things happen that decide whether the delayed method should or should not be called...
TITLE: How to cancel a method registered with [performSelector: withObject: afterDelay:]? QUESTION: My problem is, at some point in my application I call [performSelector: withObject: afterDelay:] but during the delay which can be up to 1 second several things happen that decide whether the delayed method should or sh...
[ "iphone", "objective-c", "ipad" ]
2
10
1,252
1
0
2011-05-31T20:08:34.947000
2011-05-31T20:14:16.050000
6,192,963
6,206,492
Adding a scroll view behind view
Hey, I've been trying to add a scroll view to my view for sometime now and I can't seem to get it work. I've been trying some tutorials without luck. Could anyone aid me in this? It is just basically a normal view with some buttons on it. Thanks.
The most common mistake I've seen with UIScrollView usage is forgetting to set contentSize. contentSize needs to be bigger than the size of the UIScrollView for scrolling to make sense.
Adding a scroll view behind view Hey, I've been trying to add a scroll view to my view for sometime now and I can't seem to get it work. I've been trying some tutorials without luck. Could anyone aid me in this? It is just basically a normal view with some buttons on it. Thanks.
TITLE: Adding a scroll view behind view QUESTION: Hey, I've been trying to add a scroll view to my view for sometime now and I can't seem to get it work. I've been trying some tutorials without luck. Could anyone aid me in this? It is just basically a normal view with some buttons on it. Thanks. ANSWER: The most comm...
[ "cocoa-touch", "uiview", "uiscrollview" ]
0
0
103
1
0
2011-05-31T20:08:53.703000
2011-06-01T19:18:54.480000
6,192,974
6,193,007
What special characters I should escape in T-SQL strings?
What special characters I should escape in T-SQL (SQL Server) string? SET @email = ''alex_USA$info@example.com'' Fails.
If you want @email to have the value 'alex_USA$info@example.com', try: SET @email = '''alex_USA$info@example.com'''
What special characters I should escape in T-SQL strings? What special characters I should escape in T-SQL (SQL Server) string? SET @email = ''alex_USA$info@example.com'' Fails.
TITLE: What special characters I should escape in T-SQL strings? QUESTION: What special characters I should escape in T-SQL (SQL Server) string? SET @email = ''alex_USA$info@example.com'' Fails. ANSWER: If you want @email to have the value 'alex_USA$info@example.com', try: SET @email = '''alex_USA$info@example.com'''
[ "sql", "sql-server", "t-sql" ]
2
3
2,091
3
0
2011-05-31T20:10:00.453000
2011-05-31T20:12:44.567000
6,192,979
6,193,339
TWebBrowser without parent window
I am trying to use TWebBrowser in Console/Service type of application (without any windows). Navigate is definitely doing something, but it never calls onDocumentComplete. Is there any other way to get access to IHTMLDocument2 of some URL? Thank you.
Before using the TWebBrowser instance (e.g. with Navigate2), call its HandleNeeded method. This will allocate an 'invisible' parent window handle and straighten out any event issues.
TWebBrowser without parent window I am trying to use TWebBrowser in Console/Service type of application (without any windows). Navigate is definitely doing something, but it never calls onDocumentComplete. Is there any other way to get access to IHTMLDocument2 of some URL? Thank you.
TITLE: TWebBrowser without parent window QUESTION: I am trying to use TWebBrowser in Console/Service type of application (without any windows). Navigate is definitely doing something, but it never calls onDocumentComplete. Is there any other way to get access to IHTMLDocument2 of some URL? Thank you. ANSWER: Before u...
[ "delphi", "twebbrowser" ]
4
1
1,923
1
0
2011-05-31T20:10:14.647000
2011-05-31T20:45:00.973000
6,192,983
6,193,056
Get bytes from UIImage
I have a UIImage object, but I need to access the bytes of the image. I don't see any method in the class reference to do this, such as getBytes, etc. This is coming back from a UIImagePicker, so I do not have a file path, just an instance of UIImage that contains the original image.
UIImageJPEGRepresentation or UIImagePNGRepresentation will return NSData* 's that you can use to get the raw data See docs here
Get bytes from UIImage I have a UIImage object, but I need to access the bytes of the image. I don't see any method in the class reference to do this, such as getBytes, etc. This is coming back from a UIImagePicker, so I do not have a file path, just an instance of UIImage that contains the original image.
TITLE: Get bytes from UIImage QUESTION: I have a UIImage object, but I need to access the bytes of the image. I don't see any method in the class reference to do this, such as getBytes, etc. This is coming back from a UIImagePicker, so I do not have a file path, just an instance of UIImage that contains the original i...
[ "ios4", "uiimageview", "uiimage", "ipad" ]
1
2
1,666
1
0
2011-05-31T20:10:53.243000
2011-05-31T20:16:17.907000
6,192,989
6,207,069
storing n+1 objects in a solr document
I'm struggling to work out how the best way to store n+1 object in a solr document. I am storing a CV/resume document in a solr document. I am looking at storing two different data types "education" and "employment" If we look at education the object looks like this: { "establishment" => 'Oxford', "Subject" => 'Computi...
You essentially want to turn Solr into a relational database. I.e. you want to enforce some structure on your documents rather than having them just be a bag of words. If you need relations, then you need relations. The only way I can think of accomplishing this is to index education objects separately, and then have a...
storing n+1 objects in a solr document I'm struggling to work out how the best way to store n+1 object in a solr document. I am storing a CV/resume document in a solr document. I am looking at storing two different data types "education" and "employment" If we look at education the object looks like this: { "establishm...
TITLE: storing n+1 objects in a solr document QUESTION: I'm struggling to work out how the best way to store n+1 object in a solr document. I am storing a CV/resume document in a solr document. I am looking at storing two different data types "education" and "employment" If we look at education the object looks like t...
[ "php", "search", "lucene", "solr" ]
5
0
252
1
0
2011-05-31T20:11:28.873000
2011-06-01T20:12:12.933000
6,192,991
6,193,419
Output parameter in stored procedure in EF
I have an existing database with lots of complex stored procedure and I want to use those procedure through EF 4. I have done the following: Created an EF data object, Customer. Added a Stored Procedure into the EF Right Click on the EF designer and add a function import. Function Import Name - MyFunction, complex type...
Output parameters are returned in ObjectParameter instance. So you must use code like: var oMyString = new ObjectParameter("o_MyString", typeof(string)); var result = ctx.MyFunction("XYZ", oMyString).ToList(); var data = oMyString.Value.ToString(); The reason is that function import cannot use ref parameter because out...
Output parameter in stored procedure in EF I have an existing database with lots of complex stored procedure and I want to use those procedure through EF 4. I have done the following: Created an EF data object, Customer. Added a Stored Procedure into the EF Right Click on the EF designer and add a function import. Func...
TITLE: Output parameter in stored procedure in EF QUESTION: I have an existing database with lots of complex stored procedure and I want to use those procedure through EF 4. I have done the following: Created an EF data object, Customer. Added a Stored Procedure into the EF Right Click on the EF designer and add a fun...
[ "stored-procedures", "entity-framework-4", "output-parameter" ]
13
36
36,665
2
0
2011-05-31T20:11:56.660000
2011-05-31T20:52:18.560000
6,192,997
6,194,480
How to upload image without any php script?
please tell me can i upload image from iphone without using php or.net script. i found a code of php by hitting URL i think image will be uploaded but can i upload without help of server side script? Waiting for your kind reply:)
There is a way to upload a photo from the iPhone without using server side script. You could FTP the photo. You would need your server to be an FTP server. Not the most secure thing in the world, but technically all the work is done on the phone side without server side code. FTP sample code
How to upload image without any php script? please tell me can i upload image from iphone without using php or.net script. i found a code of php by hitting URL i think image will be uploaded but can i upload without help of server side script? Waiting for your kind reply:)
TITLE: How to upload image without any php script? QUESTION: please tell me can i upload image from iphone without using php or.net script. i found a code of php by hitting URL i think image will be uploaded but can i upload without help of server side script? Waiting for your kind reply:) ANSWER: There is a way to u...
[ "php", "iphone", "objective-c", "image-uploading" ]
0
1
1,168
2
0
2011-05-31T20:12:08.190000
2011-05-31T22:55:17.363000
6,192,998
6,193,091
CGRectFrame, getting confused on origins
So I'm a bit confused when it comes to using the.frame property, CGRectMake, and the iPhone coordinate system. I was looking at the code given in this example: Sizing a UILabel to fit? I am confused on the line: self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, fixedWidth, 0); In the above line of code,...
In the above line of code, is it basically setting self.frame to the same origin as it was originally, but changing the width and height? Yes. The origin is the center point like in normal geometry right? It's not the upper left hand corner like the iPhone coordinate system is right? No. frame.origin is a corner of the...
CGRectFrame, getting confused on origins So I'm a bit confused when it comes to using the.frame property, CGRectMake, and the iPhone coordinate system. I was looking at the code given in this example: Sizing a UILabel to fit? I am confused on the line: self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, f...
TITLE: CGRectFrame, getting confused on origins QUESTION: So I'm a bit confused when it comes to using the.frame property, CGRectMake, and the iPhone coordinate system. I was looking at the code given in this example: Sizing a UILabel to fit? I am confused on the line: self.frame = CGRectMake(self.frame.origin.x, self...
[ "iphone", "cgrect" ]
1
4
989
1
0
2011-05-31T20:12:11.643000
2011-05-31T20:19:55.583000
6,193,010
6,193,452
How to determine if compilation debug="true" in web.config
I am drawing a blank here for something that should be simple... I am trying to do something like:
This should get you the element in the section group: using System.Web.Configuration;... CompilationSection compilationSection = (CompilationSection)System.Configuration.ConfigurationManager.GetSection(@"system.web/compilation");... // check the DEBUG attribute on the element bool isDebugEnabled = compilationSection....
How to determine if compilation debug="true" in web.config I am drawing a blank here for something that should be simple... I am trying to do something like:
TITLE: How to determine if compilation debug="true" in web.config QUESTION: I am drawing a blank here for something that should be simple... I am trying to do something like: ANSWER: This should get you the element in the section group: using System.Web.Configuration;... CompilationSection compilationSection = (Comp...
[ "c#", "asp.net", "debugging" ]
35
54
24,057
5
0
2011-05-31T20:12:52.667000
2011-05-31T20:55:18.950000
6,193,014
6,195,125
What is this webview popup dialog?
what is this kind of window that pops up referred to as? and is there a way to apply it to my webview for popups? (I can ask this in a separate question if needed)
I suppose you want to show a popup windows which contain a webview from a webview in your application. Two steps needed. First you need to Override the onJSAlert() method in the WebChromeClient class to enable popup window in webview: public class MyWebChromeClient extends WebChromeClient { @Override public boolean onJ...
What is this webview popup dialog? what is this kind of window that pops up referred to as? and is there a way to apply it to my webview for popups? (I can ask this in a separate question if needed)
TITLE: What is this webview popup dialog? QUESTION: what is this kind of window that pops up referred to as? and is there a way to apply it to my webview for popups? (I can ask this in a separate question if needed) ANSWER: I suppose you want to show a popup windows which contain a webview from a webview in your appl...
[ "android", "popup" ]
2
4
3,619
1
0
2011-05-31T20:13:07.207000
2011-06-01T00:48:19.617000
6,193,015
6,193,545
Can't send anything that is not generic type
I have application based on this tutorial Method I use to get user list from service: public class PBMBService: IService { public ServiceResponse UserList() { try { sql.Open(); List result = new List (); //filling list from database return new ServiceResponse(SRFlag.OK, result); } catch (Exception ex) { return new Se...
I guess this happens because User class is declared as DataContract and data serializer is able to serialize and deserialize it. However, it is a very bad idea to declare object as a part of response that is returned. You should always specify the type that is returned. Returning object is against message passing princ...
Can't send anything that is not generic type I have application based on this tutorial Method I use to get user list from service: public class PBMBService: IService { public ServiceResponse UserList() { try { sql.Open(); List result = new List (); //filling list from database return new ServiceResponse(SRFlag.OK, re...
TITLE: Can't send anything that is not generic type QUESTION: I have application based on this tutorial Method I use to get user list from service: public class PBMBService: IService { public ServiceResponse UserList() { try { sql.Open(); List result = new List (); //filling list from database return new ServiceResp...
[ "c#", "wcf", "visual-studio-2010" ]
5
3
193
1
0
2011-05-31T20:13:09.763000
2011-05-31T21:05:34.470000
6,193,017
6,193,058
PHP autloading variable
I am not sure if this possible or if this is the right place to post this type of questions but here goes! Is there any way to autoload a variable with a class of the same name? An example of this: class MyClass {.... function display() { echo 'test'; } } I am wondering if it is possible to do the following: $MyClass->...
What you can do is make your method static and call the method directly on the class: class MyClass { public static function display() { echo 'test'; } } MyClass::display(); Apart from that: "Autoloading" variables is not possible.
PHP autloading variable I am not sure if this possible or if this is the right place to post this type of questions but here goes! Is there any way to autoload a variable with a class of the same name? An example of this: class MyClass {.... function display() { echo 'test'; } } I am wondering if it is possible to do t...
TITLE: PHP autloading variable QUESTION: I am not sure if this possible or if this is the right place to post this type of questions but here goes! Is there any way to autoload a variable with a class of the same name? An example of this: class MyClass {.... function display() { echo 'test'; } } I am wondering if it i...
[ "php", "oop", "class", "variables" ]
2
0
80
4
0
2011-05-31T20:13:11.497000
2011-05-31T20:16:23.507000
6,193,018
6,193,249
Preload Entity Framework 4 tree
I would like to preload my catalog in my web application. I'm using EF4 and would like to prefetch all my catalog data. Is there a simple way to do it with EF4? DB structure: Catalog -> Category -> [Category ->] product -> options How can I preload all objects on application start? Thanks
You can simply call: var data = context.Catalogs.Include("Categories.Products.Options").ToList(); I assume that Catalog has navigation property Categories, Category has navigation property Products and Product has navigation property Options. This will probably create enormous result set. Pre-loading such big amount of...
Preload Entity Framework 4 tree I would like to preload my catalog in my web application. I'm using EF4 and would like to prefetch all my catalog data. Is there a simple way to do it with EF4? DB structure: Catalog -> Category -> [Category ->] product -> options How can I preload all objects on application start? Thank...
TITLE: Preload Entity Framework 4 tree QUESTION: I would like to preload my catalog in my web application. I'm using EF4 and would like to prefetch all my catalog data. Is there a simple way to do it with EF4? DB structure: Catalog -> Category -> [Category ->] product -> options How can I preload all objects on applic...
[ "entity-framework-4" ]
1
1
891
1
0
2011-05-31T20:13:19.377000
2011-05-31T20:35:38.733000
6,193,027
6,193,785
Selecting the tapped-on word on a single click in textbox
In a Windows Phone 7 app. I happen to have many TextBox s stacked in a ItemsControl and the behaviour across textboxes for selection is not uniform i.e. a single click on any word in any text box does not select the tapped word. First a click is consumed for focusing the text box and then another to actually select the...
Just found a neat trick! On a single tap of a TextBox control it gets focus and on GotFocus routine using SelectionStart property of TextBox one can get the current character which has the caret just before it. With this data the left and right boundaries with space character can be found and thus the word selected. pr...
Selecting the tapped-on word on a single click in textbox In a Windows Phone 7 app. I happen to have many TextBox s stacked in a ItemsControl and the behaviour across textboxes for selection is not uniform i.e. a single click on any word in any text box does not select the tapped word. First a click is consumed for foc...
TITLE: Selecting the tapped-on word on a single click in textbox QUESTION: In a Windows Phone 7 app. I happen to have many TextBox s stacked in a ItemsControl and the behaviour across textboxes for selection is not uniform i.e. a single click on any word in any text box does not select the tapped word. First a click i...
[ "c#", "silverlight", "windows-phone-7", "textbox", "selection" ]
2
2
2,928
1
0
2011-05-31T20:14:12.947000
2011-05-31T21:29:01.303000
6,193,034
6,193,055
How to log changed values to database on all action?
The controller above has a standard edit ActionResult. I simply find rows in a database by ID and update it. Before db.SaveChanges() there is log.Save() static function that saves all changes in model to separate tables in the database. It simply check old and new values from ChangeTracker. The problem is, i want use l...
SaveChanges in EF4 is virtual, so you can override it, add custom logging etc.
How to log changed values to database on all action? The controller above has a standard edit ActionResult. I simply find rows in a database by ID and update it. Before db.SaveChanges() there is log.Save() static function that saves all changes in model to separate tables in the database. It simply check old and new va...
TITLE: How to log changed values to database on all action? QUESTION: The controller above has a standard edit ActionResult. I simply find rows in a database by ID and update it. Before db.SaveChanges() there is log.Save() static function that saves all changes in model to separate tables in the database. It simply ch...
[ "entity-framework", "sql-server-2008", "asp.net-mvc-3" ]
1
2
1,146
2
0
2011-05-31T20:14:43.103000
2011-05-31T20:16:05.957000
6,193,039
6,193,232
Can I localize an ASP.Net MVC 2 application to English but change the date format?
With the following tag in web.config I localized the application to english Can I change the date format to 'dd/MM/yyyy' and keep all other english culture stuff? (e.g. keep the decimal separator as dot '.'). Edit I looking for a one-time tweak, something to setup/implement once I forget about it. I don't want to decor...
Sure. On your view model: [DisplayFormat(DataFormatString = @"{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)] public DateTime Date { get; set; } and in your view: <%= Html.DisplayFor(x => x.Date) %> UPDATE: Another possibility is to write a custom display template ( ~/Views/Shared/DisplayTemplates/DateTime.ascx ): <%@ ...
Can I localize an ASP.Net MVC 2 application to English but change the date format? With the following tag in web.config I localized the application to english Can I change the date format to 'dd/MM/yyyy' and keep all other english culture stuff? (e.g. keep the decimal separator as dot '.'). Edit I looking for a one-tim...
TITLE: Can I localize an ASP.Net MVC 2 application to English but change the date format? QUESTION: With the following tag in web.config I localized the application to english Can I change the date format to 'dd/MM/yyyy' and keep all other english culture stuff? (e.g. keep the decimal separator as dot '.'). Edit I loo...
[ "asp.net", "asp.net-mvc-2", "localization", "date-format" ]
2
4
460
1
0
2011-05-31T20:15:02.213000
2011-05-31T20:34:19.403000
6,193,044
6,201,366
Using .change() and a datepicker in jquery to submit a form
Currently I'm using JQuery UI's datepicker range, and I've added some more javascript that should submit the form on the page when different form elements change. This works on the drop down I've added, as well as the date picker input boxes if I enter dates manually and then click away. However, if I click an input fi...
The correct answer is here: jQuery datepicker, onSelect won't work
Using .change() and a datepicker in jquery to submit a form Currently I'm using JQuery UI's datepicker range, and I've added some more javascript that should submit the form on the page when different form elements change. This works on the drop down I've added, as well as the date picker input boxes if I enter dates m...
TITLE: Using .change() and a datepicker in jquery to submit a form QUESTION: Currently I'm using JQuery UI's datepicker range, and I've added some more javascript that should submit the form on the page when different form elements change. This works on the drop down I've added, as well as the date picker input boxes ...
[ "javascript", "jquery", "jquery-ui" ]
4
1
28,151
4
0
2011-05-31T20:15:23.430000
2011-06-01T12:47:10.347000
6,193,049
6,193,081
PHP site URL ID please Help!
Please could someone help im building my first website that pulls info from a MySQL table, so far ive successfully managed to connect to the database and pull the information i need. my website is set up to display a single record from the table, which it is doing however i need some way of changing the URL for each re...
Use $_GET to retrieve things from the script's query (aka command line, in a way):
PHP site URL ID please Help! Please could someone help im building my first website that pulls info from a MySQL table, so far ive successfully managed to connect to the database and pull the information i need. my website is set up to display a single record from the table, which it is doing however i need some way of...
TITLE: PHP site URL ID please Help! QUESTION: Please could someone help im building my first website that pulls info from a MySQL table, so far ive successfully managed to connect to the database and pull the information i need. my website is set up to display a single record from the table, which it is doing however ...
[ "php", "sql", "url" ]
2
3
2,516
6
0
2011-05-31T20:15:37.803000
2011-05-31T20:18:51.603000
6,193,070
6,193,115
subject line of email message
I'm writing an asp.net mvc app. in c#, and I'm wondering if anybody can help me to understand, if it's possible to include an input from another field stored in the database, like a numeric or text string into a subject line of the email. For example, along with the subject text, like "Your event registration" I'd like...
Yes. When you call your method, you should be able to format your subject however you want. E.g., NotifyHtml("coe-RoomReservations@coe.berkeley.edu", string.format("#{0} Your event registration", registrationId), body);
subject line of email message I'm writing an asp.net mvc app. in c#, and I'm wondering if anybody can help me to understand, if it's possible to include an input from another field stored in the database, like a numeric or text string into a subject line of the email. For example, along with the subject text, like "You...
TITLE: subject line of email message QUESTION: I'm writing an asp.net mvc app. in c#, and I'm wondering if anybody can help me to understand, if it's possible to include an input from another field stored in the database, like a numeric or text string into a subject line of the email. For example, along with the subje...
[ "c#", "asp.net-mvc", "email" ]
0
1
3,202
3
0
2011-05-31T20:17:16.430000
2011-05-31T20:21:40.483000
6,193,071
6,193,114
Can I store and read data from “Application” object accessing it from javascript?
Can I store something in HttpContext.Current.Application["MyData"] accessing that from javascript?
You can do it but you should not do it as this is totally anti MVC practice as views shouldn't be pulling information => views should only use information that is being passed to them in the form of a view model from the controller action: Obviously the correct way to achieve this is to define a view model: public clas...
Can I store and read data from “Application” object accessing it from javascript? Can I store something in HttpContext.Current.Application["MyData"] accessing that from javascript?
TITLE: Can I store and read data from “Application” object accessing it from javascript? QUESTION: Can I store something in HttpContext.Current.Application["MyData"] accessing that from javascript? ANSWER: You can do it but you should not do it as this is totally anti MVC practice as views shouldn't be pulling inform...
[ "javascript", "asp.net-mvc-3" ]
0
1
595
3
0
2011-05-31T20:17:22.900000
2011-05-31T20:21:22.463000
6,193,096
6,193,127
Is that worth to learn LINQ for hobbyists?
Is that worth to learn LINQ for hobbyists or the professionals (who are free from formal job requirement)? We can achieve the same thing that LINQ does via traditional language functionality such as loop, array, etc. Why bother to duplicate the way to achieve the same objective?
I've found using LINQ to be very beneficial, from the standpoint that I don't have to write the for loop to iterate over a collection and perform some operation. Rather, I can use a single line LINQ statement to do that for me. One simple example could be someCollection.OrderBy(c => c.propertyOne); Doing that on your o...
Is that worth to learn LINQ for hobbyists? Is that worth to learn LINQ for hobbyists or the professionals (who are free from formal job requirement)? We can achieve the same thing that LINQ does via traditional language functionality such as loop, array, etc. Why bother to duplicate the way to achieve the same objectiv...
TITLE: Is that worth to learn LINQ for hobbyists? QUESTION: Is that worth to learn LINQ for hobbyists or the professionals (who are free from formal job requirement)? We can achieve the same thing that LINQ does via traditional language functionality such as loop, array, etc. Why bother to duplicate the way to achieve...
[ "linq" ]
2
4
167
3
0
2011-05-31T20:20:08.283000
2011-05-31T20:23:15.567000
6,193,098
6,193,135
Problem creating function for .net assembly in SQL Server
[SqlProcedure()] public static void GetCustInfo(SqlString PhoneNo, out SqlString CustInfo) { // code... } This is how I try to create the function: CREATE FUNCTION [dbo].[GetCustInfo] (@PhoneNo nvarchar(50)) RETURNS nvarchar(max) WITH EXECUTE AS CALLER AS EXTERNAL NAME CustFromPhone.[ManagedCodeAndSQLServer.BaseFunctio...
even if you ask nicely... a void function won't return something that can be converted to a nvarchar
Problem creating function for .net assembly in SQL Server [SqlProcedure()] public static void GetCustInfo(SqlString PhoneNo, out SqlString CustInfo) { // code... } This is how I try to create the function: CREATE FUNCTION [dbo].[GetCustInfo] (@PhoneNo nvarchar(50)) RETURNS nvarchar(max) WITH EXECUTE AS CALLER AS EXTERN...
TITLE: Problem creating function for .net assembly in SQL Server QUESTION: [SqlProcedure()] public static void GetCustInfo(SqlString PhoneNo, out SqlString CustInfo) { // code... } This is how I try to create the function: CREATE FUNCTION [dbo].[GetCustInfo] (@PhoneNo nvarchar(50)) RETURNS nvarchar(max) WITH EXECUTE A...
[ "c#", "sql-server-2008", ".net-assembly" ]
0
3
682
2
0
2011-05-31T20:20:17.283000
2011-05-31T20:23:55.380000
6,193,104
6,193,122
PHP set_time_limit no effect
I have a very painful slow script that gets lots of data from MySQL and creates a large report out of it that it serves to the user at the end as application/force-download. Long story short, on production server it keeps terminating after about 30 seconds (quite consistently) and spitting out an empty file instead. On...
Maybe the PHP safe_mode. Try to do a die(ini_get('max_execution_time')) to read the value after you have called the set_time_limit(0); to see if actually it get overwrited. If it gets overwrited to 0 and your script still dies then the cause could be somewhere else in your code
PHP set_time_limit no effect I have a very painful slow script that gets lots of data from MySQL and creates a large report out of it that it serves to the user at the end as application/force-download. Long story short, on production server it keeps terminating after about 30 seconds (quite consistently) and spitting ...
TITLE: PHP set_time_limit no effect QUESTION: I have a very painful slow script that gets lots of data from MySQL and creates a large report out of it that it serves to the user at the end as application/force-download. Long story short, on production server it keeps terminating after about 30 seconds (quite consisten...
[ "php", "apache", "timeout" ]
4
8
4,220
1
0
2011-05-31T20:20:40.047000
2011-05-31T20:22:37.703000