qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
18,699,718
This is a question about jQuery. ``` $(document).ready(function() { $('li a').click(function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; $('#content').load(link); }); }); ``` When I click on a link, the `#content` div is loaded with the p...
2013/09/09
[ "https://Stackoverflow.com/questions/18699718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2753579/" ]
Because you are adding the links after the document ready event has been completed. The links do not get the event handler associated with them. To get your links to work you want to associate it with the document and use `on()` ``` $(document).on('click', '#content a', function (e) { e.preventDefault(); var l...
For this purpose we have the `.on`: ``` $(document).on("click", "#content a", function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; }); ```
18,699,718
This is a question about jQuery. ``` $(document).ready(function() { $('li a').click(function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; $('#content').load(link); }); }); ``` When I click on a link, the `#content` div is loaded with the p...
2013/09/09
[ "https://Stackoverflow.com/questions/18699718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2753579/" ]
The answer is *event delegation*. Since the `#content` element itself is not loaded dynamically and you are wanting to target the `a` elements within that. It probably makes most sense to delegate on the `#content` element. Try this: ``` $('#content').on("click", "a", function(e) { e.preventDefault(); var link...
For this purpose we have the `.on`: ``` $(document).on("click", "#content a", function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; }); ```
18,699,718
This is a question about jQuery. ``` $(document).ready(function() { $('li a').click(function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; $('#content').load(link); }); }); ``` When I click on a link, the `#content` div is loaded with the p...
2013/09/09
[ "https://Stackoverflow.com/questions/18699718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2753579/" ]
Because you are adding the links after the document ready event has been completed. The links do not get the event handler associated with them. To get your links to work you want to associate it with the document and use `on()` ``` $(document).on('click', '#content a', function (e) { e.preventDefault(); var l...
[.on](http://api.jquery.com/on/) documentation ``` $('#content').on("click", "a", function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; }); ``` when you add dynamic elements you must code for them using [.on](http://api.jquery.com/on/)
18,699,718
This is a question about jQuery. ``` $(document).ready(function() { $('li a').click(function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; $('#content').load(link); }); }); ``` When I click on a link, the `#content` div is loaded with the p...
2013/09/09
[ "https://Stackoverflow.com/questions/18699718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2753579/" ]
The answer is *event delegation*. Since the `#content` element itself is not loaded dynamically and you are wanting to target the `a` elements within that. It probably makes most sense to delegate on the `#content` element. Try this: ``` $('#content').on("click", "a", function(e) { e.preventDefault(); var link...
[.on](http://api.jquery.com/on/) documentation ``` $('#content').on("click", "a", function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; }); ``` when you add dynamic elements you must code for them using [.on](http://api.jquery.com/on/)
18,699,718
This is a question about jQuery. ``` $(document).ready(function() { $('li a').click(function(e) { e.preventDefault(); var link = $(this).attr('href'); location.hash = link; $('#content').load(link); }); }); ``` When I click on a link, the `#content` div is loaded with the p...
2013/09/09
[ "https://Stackoverflow.com/questions/18699718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2753579/" ]
The answer is *event delegation*. Since the `#content` element itself is not loaded dynamically and you are wanting to target the `a` elements within that. It probably makes most sense to delegate on the `#content` element. Try this: ``` $('#content').on("click", "a", function(e) { e.preventDefault(); var link...
Because you are adding the links after the document ready event has been completed. The links do not get the event handler associated with them. To get your links to work you want to associate it with the document and use `on()` ``` $(document).on('click', '#content a', function (e) { e.preventDefault(); var l...
7,837,295
I have a edit text, whose input type is number. in emulator its working fine i.e, showing the num-pad as soft keypad. but in the device its showing alphabets keyboard why? ``` <EditText android:layout_width="110dp" android:layout_height="30dp" android:id="@+id/phone" android:layout_al...
2011/10/20
[ "https://Stackoverflow.com/questions/7837295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884054/" ]
When you give the InputType as number there is a completely new keyboard that gets loaded very different to what you will get by pressing the corner button on your normal keyboard to get numbers . Only certain phones/android versions(i think 2.2+) have this separate keyboard . For the ones that dont have this , The nor...
It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.
7,837,295
I have a edit text, whose input type is number. in emulator its working fine i.e, showing the num-pad as soft keypad. but in the device its showing alphabets keyboard why? ``` <EditText android:layout_width="110dp" android:layout_height="30dp" android:id="@+id/phone" android:layout_al...
2011/10/20
[ "https://Stackoverflow.com/questions/7837295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884054/" ]
So from what i've observed setting the inputType to phone should solve the problem . But try a different device to check if ur code works by giving input as number before moving to this option .
It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.
7,837,295
I have a edit text, whose input type is number. in emulator its working fine i.e, showing the num-pad as soft keypad. but in the device its showing alphabets keyboard why? ``` <EditText android:layout_width="110dp" android:layout_height="30dp" android:id="@+id/phone" android:layout_al...
2011/10/20
[ "https://Stackoverflow.com/questions/7837295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/884054/" ]
I think you must change inputType FROM : android:inputType="number" TO: android:inputType="phone"
It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.
33,324,226
I’m trying to update a table that is joined with another one to update the right record. Here is my command so far: ``` UPDATE links l SET l.l_id = `[value-1]`, l.l_facebook = `[value-2]`, l.l_youtube = `[value-3]`, l.l_twitter = `[value-4]`, l.l_googleplus = `[value-5]`, l.l_rss = `[value-6]`, l.l_ho...
2015/10/24
[ "https://Stackoverflow.com/questions/33324226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3423987/" ]
Try this ``` UPDATE links l, sponsering s SET l.l_faceook = `[value-2]`, l.l_youtube = `[value-3]`, l.l_twitter = `[value-4]`, l.l_googleplus = `[value-5]`, l.l_rss = `[value-6]`, l.l_homepage = `[value-7]`, l.l_freigegeben = `[value-8]` WHERE l.l_id = s.links_l_id AND sponsering.s_userID = 2 ``...
In MySQL, the `join` is part of the `update` statement itself. There is no separate `from`: ``` UPDATE links l JOIN sponsering s ON l.l_id = s.links_l_id SET l.l_id = `[value-1]`, l.l_faceook = `[value-2]`, l.l_youtube = `[value-3]`, l.l_twitter = `[value-4]`, l.l_google...
37,231,463
I've been trying to make a url open when I click a cell in my tableview programatticaly without having to make a webview controller and mess with seques. Any help on how I can get this accomplished. Below is the code I've tried ``` override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: ...
2016/05/14
[ "https://Stackoverflow.com/questions/37231463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5991916/" ]
You are looking for ``` UIApplication.sharedApplication().openURL(NSURL(string: "http://www.example.com")!) ``` this will open the safari browser for you edit *explanation for question in comment* It is better if you'll add enums or other constants, but this will do: ``` override func tableView(tableView: UITabl...
I have other solution for this, hope it works override func tableView(\_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { ``` let link = sectionContent[indexPath.section][indexPath.row].link switch indexPath.section { // Leave us feedback section //You can add as many sections you want. ...
4,595,360
My Windows date format is Month/Date/Year. If I want set StartTime with format "yyyy/MM/dd HH:mm:ss", How can I do that. I try the following code. ``` DateTime StartTime = DateTime.ParseExact("2011/01/04 09:30:00", "yyyy/MM/dd HH:mm:ss", null); ``` But StartTime come out with 1/4/2011 9:30:00 AM. (month/date/year h...
2011/01/04
[ "https://Stackoverflow.com/questions/4595360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480716/" ]
You're parsing the time correctly, but displaying it with the default format. Try `StartTime.ToString("yyyy/MM/dd HH:mm:ss")`
MSDN is your friend: <http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx> You can also set a breakpoint to inspect the value of StartTime, to figure out what is really in it.
4,595,360
My Windows date format is Month/Date/Year. If I want set StartTime with format "yyyy/MM/dd HH:mm:ss", How can I do that. I try the following code. ``` DateTime StartTime = DateTime.ParseExact("2011/01/04 09:30:00", "yyyy/MM/dd HH:mm:ss", null); ``` But StartTime come out with 1/4/2011 9:30:00 AM. (month/date/year h...
2011/01/04
[ "https://Stackoverflow.com/questions/4595360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480716/" ]
You're parsing the time correctly, but displaying it with the default format. Try `StartTime.ToString("yyyy/MM/dd HH:mm:ss")`
This code works correctly, and you have a strong-typed DateTime object now. If you wish to then output it in the format you have above, then you call ToString() with the format in your second argument.
4,595,360
My Windows date format is Month/Date/Year. If I want set StartTime with format "yyyy/MM/dd HH:mm:ss", How can I do that. I try the following code. ``` DateTime StartTime = DateTime.ParseExact("2011/01/04 09:30:00", "yyyy/MM/dd HH:mm:ss", null); ``` But StartTime come out with 1/4/2011 9:30:00 AM. (month/date/year h...
2011/01/04
[ "https://Stackoverflow.com/questions/4595360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480716/" ]
You're parsing the time correctly, but displaying it with the default format. Try `StartTime.ToString("yyyy/MM/dd HH:mm:ss")`
It is using your format to parse the date correctly, but it is displaying it by default. To display it in the format you created it in you will either need to use [String.Format](http://blog.stevex.net/string-formatting-in-csharp/) or you can even use 'ToString()' with a [pattern](http://www.geekzilla.co.uk/View00FF790...
4,595,360
My Windows date format is Month/Date/Year. If I want set StartTime with format "yyyy/MM/dd HH:mm:ss", How can I do that. I try the following code. ``` DateTime StartTime = DateTime.ParseExact("2011/01/04 09:30:00", "yyyy/MM/dd HH:mm:ss", null); ``` But StartTime come out with 1/4/2011 9:30:00 AM. (month/date/year h...
2011/01/04
[ "https://Stackoverflow.com/questions/4595360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480716/" ]
It is using your format to parse the date correctly, but it is displaying it by default. To display it in the format you created it in you will either need to use [String.Format](http://blog.stevex.net/string-formatting-in-csharp/) or you can even use 'ToString()' with a [pattern](http://www.geekzilla.co.uk/View00FF790...
MSDN is your friend: <http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx> You can also set a breakpoint to inspect the value of StartTime, to figure out what is really in it.
4,595,360
My Windows date format is Month/Date/Year. If I want set StartTime with format "yyyy/MM/dd HH:mm:ss", How can I do that. I try the following code. ``` DateTime StartTime = DateTime.ParseExact("2011/01/04 09:30:00", "yyyy/MM/dd HH:mm:ss", null); ``` But StartTime come out with 1/4/2011 9:30:00 AM. (month/date/year h...
2011/01/04
[ "https://Stackoverflow.com/questions/4595360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/480716/" ]
It is using your format to parse the date correctly, but it is displaying it by default. To display it in the format you created it in you will either need to use [String.Format](http://blog.stevex.net/string-formatting-in-csharp/) or you can even use 'ToString()' with a [pattern](http://www.geekzilla.co.uk/View00FF790...
This code works correctly, and you have a strong-typed DateTime object now. If you wish to then output it in the format you have above, then you call ToString() with the format in your second argument.
1,008,112
I am trying to debug a permission issue in quite a complex hierarchy of mounted and shared volumes. The operation that fails is captured in the following strace output: ``` open("/git/project.git/objects/12/tmp_obj_FNNWoD", O_RDWR|O_CREAT|O_EXCL, 0444) = 5 write(5, "x\1%\3121\16\3020\f@QfK\276\203\325=\250]\30\262q\22...
2015/12/02
[ "https://superuser.com/questions/1008112", "https://superuser.com", "https://superuser.com/users/220327/" ]
There are a couple of ways to take care of this - through cell formatting and through the `TEXT` conversion formula. Cell formatting allows more flexibility for working with the number after it is converted to the format, but it might not be suitable in every case. For your example as a formula, try this: ``` =TEXT(A...
You can set your default currency and number format to display like Indian style by changing global settings in Control Panel. In XP, go to Control Panel -> Regional & Language option. In the dialogue box click customize. On the Number and Currency tab, in Digit grouping option, select appropriate grouping from Drop d...
31,474,819
after successful login . page should redirect to home page, but its redirecting to Google.com only in Google chrome . how to stop redirecting to Google.com in Mozilla working fine.not working in Google Chrome browser how to resolve this issue? Tried all 3 not redirecting to home.aspx ``` Response.Redirect("~/Hom...
2015/07/17
[ "https://Stackoverflow.com/questions/31474819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I would recomment using `getline` for reading, and `ftell` and `fseek` for getting/setting the offset (and `strstr` for searching individual lines) in your case. I'm not sure I understand what your saving of the offset is all about, but it might look like this: ``` int pick_lines(const char *filename, const char *key...
You could do it like this (just pseudocode): ``` fopen(); offset = loadOffset(); fseek(offset); // set offset from previous run while(!feof()) { fgets(); if(searchKeyword() == true) { offset = ftell(); // getting the offset (after the line you just read) doSomething(); } } saveOffset(offset); fclose()...
31,474,819
after successful login . page should redirect to home page, but its redirecting to Google.com only in Google chrome . how to stop redirecting to Google.com in Mozilla working fine.not working in Google Chrome browser how to resolve this issue? Tried all 3 not redirecting to home.aspx ``` Response.Redirect("~/Hom...
2015/07/17
[ "https://Stackoverflow.com/questions/31474819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I would recomment using `getline` for reading, and `ftell` and `fseek` for getting/setting the offset (and `strstr` for searching individual lines) in your case. I'm not sure I understand what your saving of the offset is all about, but it might look like this: ``` int pick_lines(const char *filename, const char *key...
It sounds like what you want to do is begin the file with a "header" which defines where the last result was found. This way, that information is written and stored in the file itself. An 8-digit hex value could be adequate for representing the offset in a file of size up to 4GB. Something like: ``` 00000022<cr><lf> T...
43,676,614
Got a flat file with some missing date values, need to turn them into todays date. How can I do that using SSIS expressions? *Note: (All missing date values for Orderdate column = todays date)*
2017/04/28
[ "https://Stackoverflow.com/questions/43676614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6471007/" ]
This is not particularly elegant, but it does seem to work. First I removed all the `\u0000*\u0000` from the string and then just did a normal `json_decode()` ``` $s = '{ "\u0000*\u0000collection_key": "rows", "\u0000*\u0000internal_gapi_mappings": [], "cacheHit": true, "\u0000*\u0000errorsType": "Goo...
Take a look on [json\_decode](http://php.net/manual/en/function.json-decode.php)() function. ``` <?php $jsonString = '{"*collection_key":"rows","*internal_gapi_mappings":[],"cacheHit":true,"*errorsType":"Google_Service_Bigquery_ErrorProto","*errorsDataType":"array","jobComplete":true,"*jobReferenceType":"Google_Servi...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
The way I solved it with DataTables 1.10 is to use [preDrawCallBack](https://datatables.net/reference/option/preDrawCallback) to save the ScrollTop position and then [DrawCallback](https://datatables.net/reference/option/drawCallback) to set it. ``` var pageScrollPos = 0; var table = $('#example').DataTable({ "preD...
The following code retains the scroll position upon Datatables server side reload. ``` var table = $('#mytable').DataTable(); var start_row = table.scroller.page()['start']; table.ajax.reload(function () { table.scroller().scrollToRow(start_row, false); }, false); ```
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
Just wanted to add this here though it's a slightly different scenario - It worked for my case and will likely be useful to some others who arrive here looking for answers. I'm using server side processing and doing a refresh of table data once every 10 seconds with `table.ajax.reload()`. This function does accept an ...
The following code retains the scroll position upon Datatables server side reload. ``` var table = $('#mytable').DataTable(); var start_row = table.scroller.page()['start']; table.ajax.reload(function () { table.scroller().scrollToRow(start_row, false); }, false); ```
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
``` var table = $('table#example').DataTable({ "preDrawCallback": function (settings) { pageScrollPos = $('div.dataTables_scrollBody').scrollTop(); }, "drawCallback": function (settings) { $('div.dataTables_scrollBody').scrollTop(pageScrollPos); } }); ``` This appears to work for me. I...
How about this hack? It does not involve `scrollTop()` First open jquery.dataTables.js and seek for this line, and remove it: ``` divBodyEl.scrollTop = 0 ``` After that put the following code before your draw()/clear() invocations: ``` var $tbl=$('#my_table_id'); if (!document.getElementById('twrapper')) $tbl.wrap(...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
Just wanted to add this here though it's a slightly different scenario - It worked for my case and will likely be useful to some others who arrive here looking for answers. I'm using server side processing and doing a refresh of table data once every 10 seconds with `table.ajax.reload()`. This function does accept an ...
How about this hack? It does not involve `scrollTop()` First open jquery.dataTables.js and seek for this line, and remove it: ``` divBodyEl.scrollTop = 0 ``` After that put the following code before your draw()/clear() invocations: ``` var $tbl=$('#my_table_id'); if (!document.getElementById('twrapper')) $tbl.wrap(...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
The way I solved it with DataTables 1.10 is to use [preDrawCallBack](https://datatables.net/reference/option/preDrawCallback) to save the ScrollTop position and then [DrawCallback](https://datatables.net/reference/option/drawCallback) to set it. ``` var pageScrollPos = 0; var table = $('#example').DataTable({ "preD...
How about this hack? It does not involve `scrollTop()` First open jquery.dataTables.js and seek for this line, and remove it: ``` divBodyEl.scrollTop = 0 ``` After that put the following code before your draw()/clear() invocations: ``` var $tbl=$('#my_table_id'); if (!document.getElementById('twrapper')) $tbl.wrap(...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
I don't think you can do that, but you can use the Callback function instead: ``` $(document).ready(function() { var selected = []; $("#example").dataTable({ "processing": true, "serverSide": true, "ajax": "scripts/ids-arrays.php", "rowCallback": function( row, data ) { ...
How about this hack? It does not involve `scrollTop()` First open jquery.dataTables.js and seek for this line, and remove it: ``` divBodyEl.scrollTop = 0 ``` After that put the following code before your draw()/clear() invocations: ``` var $tbl=$('#my_table_id'); if (!document.getElementById('twrapper')) $tbl.wrap(...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
If you pass the draw function the `page` parameter, the table will not shift in scrolling, but it will re-read from the `.DataTable` source. E.g. after "saving" data that updates the DataTable: ``` $("your-selector").DataTable().row(t_itemid).invalidate(); $("your-selector").DataTable().row(t_itemid).draw('page'); ``...
The following code retains the scroll position upon Datatables server side reload. ``` var table = $('#mytable').DataTable(); var start_row = table.scroller.page()['start']; table.ajax.reload(function () { table.scroller().scrollToRow(start_row, false); }, false); ```
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
``` var table = $('table#example').DataTable({ "preDrawCallback": function (settings) { pageScrollPos = $('div.dataTables_scrollBody').scrollTop(); }, "drawCallback": function (settings) { $('div.dataTables_scrollBody').scrollTop(pageScrollPos); } }); ``` This appears to work for me. I...
If you pass the draw function the `page` parameter, the table will not shift in scrolling, but it will re-read from the `.DataTable` source. E.g. after "saving" data that updates the DataTable: ``` $("your-selector").DataTable().row(t_itemid).invalidate(); $("your-selector").DataTable().row(t_itemid).draw('page'); ``...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
If you pass the draw function the `page` parameter, the table will not shift in scrolling, but it will re-read from the `.DataTable` source. E.g. after "saving" data that updates the DataTable: ``` $("your-selector").DataTable().row(t_itemid).invalidate(); $("your-selector").DataTable().row(t_itemid).draw('page'); ``...
How about this hack? It does not involve `scrollTop()` First open jquery.dataTables.js and seek for this line, and remove it: ``` divBodyEl.scrollTop = 0 ``` After that put the following code before your draw()/clear() invocations: ``` var $tbl=$('#my_table_id'); if (!document.getElementById('twrapper')) $tbl.wrap(...
27,663,755
Can someone explain me (or help) why im getting print like this: ``` A and B:[45.35924,14.39673,Name 1,0, 45.35509,14.40257,Name 2,7] // this is ok C and D:nil //this is not ``` with this code: ``` var dataFromParse: Array<String>! //im calling this func in viewDidLoad and I'm sending to it the ID for row in Parse...
2014/12/27
[ "https://Stackoverflow.com/questions/27663755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4220267/" ]
``` var table = $('table#example').DataTable({ "preDrawCallback": function (settings) { pageScrollPos = $('div.dataTables_scrollBody').scrollTop(); }, "drawCallback": function (settings) { $('div.dataTables_scrollBody').scrollTop(pageScrollPos); } }); ``` This appears to work for me. I...
The way I solved it with DataTables 1.10 is to use [preDrawCallBack](https://datatables.net/reference/option/preDrawCallback) to save the ScrollTop position and then [DrawCallback](https://datatables.net/reference/option/drawCallback) to set it. ``` var pageScrollPos = 0; var table = $('#example').DataTable({ "preD...
126,904
How to set currency depending on country's IP, means if customer selects India country on checkout step then currency should be set Indian Rupee automatically. My Default Currency is 'USD'.
2016/07/22
[ "https://magento.stackexchange.com/questions/126904", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/41658/" ]
**Credits : Raphael at Digital Pianism** you can use Geo IP MAGENTO STORE SWITCHER BASED ON CUSTOMER LOCATION. Follow this [tutorial](https://www.atwix.com/magento/geoip-magento-store-switcher/) , you can find complete code [here](https://github.com/vovsky/Atwix_Ipstoreswitcher) I am posting code, just if link becom...
You must care about checkout currency. GeoIP and auto switch store can help you change display currency based on country, but when customer checkout Magento will use base currency as default
126,904
How to set currency depending on country's IP, means if customer selects India country on checkout step then currency should be set Indian Rupee automatically. My Default Currency is 'USD'.
2016/07/22
[ "https://magento.stackexchange.com/questions/126904", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/41658/" ]
**Credits : Raphael at Digital Pianism** you can use Geo IP MAGENTO STORE SWITCHER BASED ON CUSTOMER LOCATION. Follow this [tutorial](https://www.atwix.com/magento/geoip-magento-store-switcher/) , you can find complete code [here](https://github.com/vovsky/Atwix_Ipstoreswitcher) I am posting code, just if link becom...
I'm personally using this open source extension to detect a user's country and set the currency automatically. <https://github.com/chapagain/auto-currency-switcher>
70,405,841
I am working on an existing project in Angular. I have added a component a month ago, which is form with some inputs. I also have some Font Awesome icons which are displaying nicely. Code below. ```html <div class="field"> <p class="control has-icons-left has-icons-right"> <input type="text" ...
2021/12/18
[ "https://Stackoverflow.com/questions/70405841", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14089282/" ]
Is FontAwesomeModule correctly imported so it can be used by the other component?
Path for import existed in "styles" but was missing from "scripts". After I added path to "scripts" it works. Explained [here](https://stackoverflow.com/a/58801612/14089282)
194,205
Help me with this question please: how to unset `html_head_link` from pages in my Drupal 8.0.3 site. I mean, delete this META: ``` <link rel="delete-form" href="/node/{id}/delete" /> <link rel="edit-form" href="/node/{id}/edit" /> <link rel="version-history" href="/node/{id}/revisions" /> <link rel="revision" href="/...
2016/03/10
[ "https://drupal.stackexchange.com/questions/194205", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/51943/" ]
OK. I found fresh module for this trouble. Module's author use `hook_entity_view_alter()` for implements head render. Check out their [git respository](https://github.com/enjoyiacm/unset_html_head_link) to download the module and get the full code with comments.
``` function program_html_head_alter(&$head_elements) { unset($head_elements['system_meta_generator']); foreach ($head_elements as $key => $element) { if (isset($element['#attributes']['rel']) && $element['#attributes']['rel'] == 'canonical') { unset($head_elements[$key]); } } } ```
1,425,563
I installed IntelliJ Idea and I had a few working Java projects already on my system, but when I open and run a program from these projects the above-mentioned error is shown. I am also unable to create any new Java classes in these projects. But when I made a new project through IntelliJ no problems occurred. The prob...
2019/04/15
[ "https://superuser.com/questions/1425563", "https://superuser.com", "https://superuser.com/users/1021819/" ]
I guess you should mark the certain folder `java` (whose location is `src/main/java` in project) as `sources`: 1. Right Click `java` folder 2. Mark Directory as 3. Sources Root Image explanation: [![enter image description here](https://i.stack.imgur.com/wXFwU.png)](https://i.stack.imgur.com/wXFwU.png)
Look like you were having a compilation issue, please check the configuration in the project settings/structure 1. Project: SDK and language level 2. Modules: src, target
40,393,197
Hi guys I need help (again). I wanted to learn how to make the notification or alert box fade-in and fade-out after clicking a editable textbox. This is the code for the alert box: ``` <div class="alert alert-warning fade in"> <a href="#" class="close" data-dismiss="alert" aria-label="close" style="text-decoratio...
2016/11/03
[ "https://Stackoverflow.com/questions/40393197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7074729/" ]
You can use `Process.monitor/1` and `receive` for this: ``` pid = spawn(fn -> :timer.sleep(1000) IO.puts "Finished!" end) # Start monitoring `pid` ref = Process.monitor(pid) # Wait until the process monitored by `ref` is down. receive do {:DOWN, ^ref, _, _, _} -> IO.puts "Process #{inspect(pid)} is down" e...
I think this can give you some clue: ``` # save in a spawner.ex file for _ <- 1..10 do spawn(fn -> pid = self() ...
40,393,197
Hi guys I need help (again). I wanted to learn how to make the notification or alert box fade-in and fade-out after clicking a editable textbox. This is the code for the alert box: ``` <div class="alert alert-warning fade in"> <a href="#" class="close" data-dismiss="alert" aria-label="close" style="text-decoratio...
2016/11/03
[ "https://Stackoverflow.com/questions/40393197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7074729/" ]
Instead of aiming for something as equivalent as possible, here's what I'd consider a more idiomatic approach to the problem of "run a background process that sleeps for a second, and don't exit the script until it finishes." ``` Task.async(fn -> :timer.sleep(1000) end) |> Task.await ```
I think this can give you some clue: ``` # save in a spawner.ex file for _ <- 1..10 do spawn(fn -> pid = self() ...
7,451,038
I have a `RemoteFile` that inherits from Pathname ``` class RemoteFile < Pathname end ``` I create a remote file, and get its parent ``` irb> RemoteFile.new('.') => #<RemoteFile:.> irb> RemoteFile.new('.').parent => #<Pathname:..> ``` Is there any way to get Pathname to return RemoteFiles besid...
2011/09/16
[ "https://Stackoverflow.com/questions/7451038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949663/" ]
You could consider delegating to an actual `Pathname` object. Have a look at [this article](http://www.simonecarletti.com/blog/2009/12/inside-ruby-on-rails-delegate/). This way you wouldn't have to monkey patch anything, and because of delegation, you could modify things in a safer, more controllable way.
In fact you can just reopen the Pathname class instead of inheriting it.
7,451,038
I have a `RemoteFile` that inherits from Pathname ``` class RemoteFile < Pathname end ``` I create a remote file, and get its parent ``` irb> RemoteFile.new('.') => #<RemoteFile:.> irb> RemoteFile.new('.').parent => #<Pathname:..> ``` Is there any way to get Pathname to return RemoteFiles besid...
2011/09/16
[ "https://Stackoverflow.com/questions/7451038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/949663/" ]
This worked for me so far: ``` class Winpath < Pathname def to_s super.tr("/", "\\") end def +(other) self.class.new super(other) end end ``` Seems like +(other) is the only function you need to overload.
In fact you can just reopen the Pathname class instead of inheriting it.
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
This single table would be more simple (in my opinion): > > **user** (user\_id, user\_email, user\_password, user\_fbid) > > > You don't need a "type" because you can use a `CASE` to determine if `user_fbid` is `NULL` then it's a "normal" account, else if `user_password` is `NULL` then it's a Facebook account.
I would probably prefer to keep all users in 1 table. You can have fields that are null if that user's type doesn't have that field. For example fb\_userid can be null if the user is normal. ``` [USER] user_id user_type (normal/facebook) email password fb_userid (can be null: yess) ```
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
This single table would be more simple (in my opinion): > > **user** (user\_id, user\_email, user\_password, user\_fbid) > > > You don't need a "type" because you can use a `CASE` to determine if `user_fbid` is `NULL` then it's a "normal" account, else if `user_password` is `NULL` then it's a Facebook account.
I would keep everything on one table and differenciate them by if they have a Facebook Id or not.
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
This single table would be more simple (in my opinion): > > **user** (user\_id, user\_email, user\_password, user\_fbid) > > > You don't need a "type" because you can use a `CASE` to determine if `user_fbid` is `NULL` then it's a "normal" account, else if `user_password` is `NULL` then it's a Facebook account.
If those are the only fields then it's probably easiest to put all the fields in one table and have NULLs as appropriate. However, if you want a normalised design you would go for something like this: ``` [USER] user_id (PK) email (Other fields common to both) [USER_NORMAL] user_id (PK, FK to USER.user_id) password ...
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
I would keep everything on one table and differenciate them by if they have a Facebook Id or not.
I would probably prefer to keep all users in 1 table. You can have fields that are null if that user's type doesn't have that field. For example fb\_userid can be null if the user is normal. ``` [USER] user_id user_type (normal/facebook) email password fb_userid (can be null: yess) ```
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
If those are the only fields then it's probably easiest to put all the fields in one table and have NULLs as appropriate. However, if you want a normalised design you would go for something like this: ``` [USER] user_id (PK) email (Other fields common to both) [USER_NORMAL] user_id (PK, FK to USER.user_id) password ...
I would probably prefer to keep all users in 1 table. You can have fields that are null if that user's type doesn't have that field. For example fb\_userid can be null if the user is normal. ``` [USER] user_id user_type (normal/facebook) email password fb_userid (can be null: yess) ```
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
I would have two tables. One table should contain basic user information: > > **user** (user\_id, user\_email, user\_password) > > > The other table should be generic and link 3rd party accounts to these users. Example: > > **user\_ext** (type, user\_id, uid) > > > The type field should contain the type of...
I would probably prefer to keep all users in 1 table. You can have fields that are null if that user's type doesn't have that field. For example fb\_userid can be null if the user is normal. ``` [USER] user_id user_type (normal/facebook) email password fb_userid (can be null: yess) ```
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
I would have two tables. One table should contain basic user information: > > **user** (user\_id, user\_email, user\_password) > > > The other table should be generic and link 3rd party accounts to these users. Example: > > **user\_ext** (type, user\_id, uid) > > > The type field should contain the type of...
I would keep everything on one table and differenciate them by if they have a Facebook Id or not.
13,424,125
I have 2 ways for users to create an account on my website. a. Normal Registration Form (email, password) b. Registration via Facebook Connect (fb\_userid, email) Which is the best practice to implement this using MySQL (InnoDB engine) ? My approach: ``` [USER] user_id user_type (normal/facebook) [USER_NORMAL] use...
2012/11/16
[ "https://Stackoverflow.com/questions/13424125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1759069/" ]
I would have two tables. One table should contain basic user information: > > **user** (user\_id, user\_email, user\_password) > > > The other table should be generic and link 3rd party accounts to these users. Example: > > **user\_ext** (type, user\_id, uid) > > > The type field should contain the type of...
If those are the only fields then it's probably easiest to put all the fields in one table and have NULLs as appropriate. However, if you want a normalised design you would go for something like this: ``` [USER] user_id (PK) email (Other fields common to both) [USER_NORMAL] user_id (PK, FK to USER.user_id) password ...
768,052
I'm developing an ASP.NET application with VB, and using SQL Command and Connection in VB to grab the data for the page. I have both portions initialized as such: ``` travelQuery.CommandText = "SELECT [StartLoc], [EndLoc],[TravelTime], [AvgSpeed], [Distance] FROM [TravelTimes] WHERE [TripNum] = '" + lblTrip.Text + "'...
2009/04/20
[ "https://Stackoverflow.com/questions/768052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84613/" ]
<http://think-async.com/Asio/WhoIsUsingAsio>
Boost is extensively being used in serious networking software, take example of HPX uses boost libraries. HPX is implemented in C++11 and utilizes over 20 Boost and candidate Boost libraries. Have a look at <http://cppnow.org/session/hpx-a-c11-parallel-runtime-system/> Also for more details you can refer [Official "Bo...
768,052
I'm developing an ASP.NET application with VB, and using SQL Command and Connection in VB to grab the data for the page. I have both portions initialized as such: ``` travelQuery.CommandText = "SELECT [StartLoc], [EndLoc],[TravelTime], [AvgSpeed], [Distance] FROM [TravelTimes] WHERE [TripNum] = '" + lblTrip.Text + "'...
2009/04/20
[ "https://Stackoverflow.com/questions/768052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84613/" ]
The systems software for managing an IBM [Blue Gene/Q](http://en.wikipedia.org/wiki/Blue_Gene#Blue_Gene.2FQ) supercomputer uses Boost.Asio extensively. The [source code](https://repo.anl-external.org/viewvc/bgq-driver/V1R2M0/) is available under the Eclipse Public License (EPL) if you're interested. ![Blue Gene/Q](htt...
<http://think-async.com/Asio/WhoIsUsingAsio>
768,052
I'm developing an ASP.NET application with VB, and using SQL Command and Connection in VB to grab the data for the page. I have both portions initialized as such: ``` travelQuery.CommandText = "SELECT [StartLoc], [EndLoc],[TravelTime], [AvgSpeed], [Distance] FROM [TravelTimes] WHERE [TripNum] = '" + lblTrip.Text + "'...
2009/04/20
[ "https://Stackoverflow.com/questions/768052", "https://Stackoverflow.com", "https://Stackoverflow.com/users/84613/" ]
The systems software for managing an IBM [Blue Gene/Q](http://en.wikipedia.org/wiki/Blue_Gene#Blue_Gene.2FQ) supercomputer uses Boost.Asio extensively. The [source code](https://repo.anl-external.org/viewvc/bgq-driver/V1R2M0/) is available under the Eclipse Public License (EPL) if you're interested. ![Blue Gene/Q](htt...
Boost is extensively being used in serious networking software, take example of HPX uses boost libraries. HPX is implemented in C++11 and utilizes over 20 Boost and candidate Boost libraries. Have a look at <http://cppnow.org/session/hpx-a-c11-parallel-runtime-system/> Also for more details you can refer [Official "Bo...
6,761,271
I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing. My class is : ``` public class View extends JApplet { //Here I declare the buttons etc.. pub...
2011/07/20
[ "https://Stackoverflow.com/questions/6761271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824002/" ]
You mention the JUNG library, it relies on the two third party libraries, Collections-Generic & Cern Colt Scientific Library 1.2.0. As mentioned by @othman they need to be added to the run-time class-path of the applet (added to the `archive` attribute of the `applet` element). But just so we are clear, make sure the...
I'm no Applet expert, since I don't use them, but IIRC you need the `init()` method to initialize your view. `main(...)` is not called for an applet.
6,761,271
I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing. My class is : ``` public class View extends JApplet { //Here I declare the buttons etc.. pub...
2011/07/20
[ "https://Stackoverflow.com/questions/6761271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824002/" ]
You mention the JUNG library, it relies on the two third party libraries, Collections-Generic & Cern Colt Scientific Library 1.2.0. As mentioned by @othman they need to be added to the run-time class-path of the applet (added to the `archive` attribute of the `applet` element). But just so we are clear, make sure the...
First, I am not sure that new lines you added into the html are legal. I mean write `<applet` and `/>` without any new lines and spaces. Second, test that your jar is really available. To do this go to the same URL that you go to retrieve your HTML without HTML but with jar, i.e. if your HTML URL is: <http://someho...
6,761,271
I have created a JApplet using the JUNG library in Netbeans that compiles and runs normally. However, when I try to create an html file that runs the applet, only a grey pane appears but the components are missing. My class is : ``` public class View extends JApplet { //Here I declare the buttons etc.. pub...
2011/07/20
[ "https://Stackoverflow.com/questions/6761271", "https://Stackoverflow.com", "https://Stackoverflow.com/users/824002/" ]
You mention the JUNG library, it relies on the two third party libraries, Collections-Generic & Cern Colt Scientific Library 1.2.0. As mentioned by @othman they need to be added to the run-time class-path of the applet (added to the `archive` attribute of the `applet` element). But just so we are clear, make sure the...
you need to reference also the JUG jars in your applet tag : < ``` applet code = 'MyPackage.View' archive = 'MyProject.jar , jung_xx.jar', width = 1600, height = 800 / > ``` in the archive attribute add all jung jars that you have currently in your netbeans project classpath.
24,812,118
I have a panel that contains 5 textboxes, I am trying to loop through the Panel and insert the value of the textbox into the database if it is not 0. my panel name is Panel1 I honestly do not know from where to start or how to loop in a Panel that contains textfields, any suggestions are appreciated: Here is my try ...
2014/07/17
[ "https://Stackoverflow.com/questions/24812118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3345212/" ]
One way is to iterate each control within your `Panel` that is a `TextBox`. ``` foreach (TextBox tb in Panel1.Controls.OfType<TextBox>()) { if (tb.Text != "0") { } } ```
The simple answer is ``` foreach(Control control in this.Controls) { if (control is TextBox) { // The code here ... } } ``` The problem though is that you then need to make sure that the order the textboxes are looped over is correct, which adds more maintenance work that is entirely unnecessary. A...
24,812,118
I have a panel that contains 5 textboxes, I am trying to loop through the Panel and insert the value of the textbox into the database if it is not 0. my panel name is Panel1 I honestly do not know from where to start or how to loop in a Panel that contains textfields, any suggestions are appreciated: Here is my try ...
2014/07/17
[ "https://Stackoverflow.com/questions/24812118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3345212/" ]
The simple answer is ``` foreach(Control control in this.Controls) { if (control is TextBox) { // The code here ... } } ``` The problem though is that you then need to make sure that the order the textboxes are looped over is correct, which adds more maintenance work that is entirely unnecessary. A...
You're trying to loop through items of type `Panel1` in `this.Controls`. What you want to do is loop through items of type `TextBox` in `Panel1.Controls`. ``` foreach(Control c in Panel1.Controls) { var textbox = Control As TextBox; if(textbox != null){ // do stuff... } } ``` You also want to loo...
24,812,118
I have a panel that contains 5 textboxes, I am trying to loop through the Panel and insert the value of the textbox into the database if it is not 0. my panel name is Panel1 I honestly do not know from where to start or how to loop in a Panel that contains textfields, any suggestions are appreciated: Here is my try ...
2014/07/17
[ "https://Stackoverflow.com/questions/24812118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3345212/" ]
One way is to iterate each control within your `Panel` that is a `TextBox`. ``` foreach (TextBox tb in Panel1.Controls.OfType<TextBox>()) { if (tb.Text != "0") { } } ```
You're trying to loop through items of type `Panel1` in `this.Controls`. What you want to do is loop through items of type `TextBox` in `Panel1.Controls`. ``` foreach(Control c in Panel1.Controls) { var textbox = Control As TextBox; if(textbox != null){ // do stuff... } } ``` You also want to loo...
43,433,673
> > I have this code right here which attempts to show an alert dialog box once a row is successfully inserted into the database. Also I want to reload the page after displaying the dialog box. It successfully pops up an alert box when commented out the `header("location: link-1.php?e=Changes has been saved.")`, but w...
2017/04/16
[ "https://Stackoverflow.com/questions/43433673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6320816/" ]
Try this to show an alert and reload the page: ``` if(mysqli_affected_rows($connect) == 1) { ?> <script> alert('Updated successfully'); location.reload(); // It will reload the page and reloading will get the latest inserted data from db </script> <?php } ```
You can't call PHP Header to redirect since by sending out your html (javascript) your Header has already been sent. You need to redirect using javascript. `window.location.href={your_url}` will redirect. But I don't think this is the right approach, you should probably do it backwards. Do the logic on redirect in PH...
77,491
I bought Borderlands GOTY pack on Steam, but I already had it downloaded (piracy, yarn). I uninstalled the game and imported it on steam using this method: 1. Install the game to the hard drive from the installation disc. 2. Once that's done, tell Steam to install the game, but pause the download as soon as it starts...
2012/07/19
[ "https://gaming.stackexchange.com/questions/77491", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/15626/" ]
Presumably your copy has some method of circumventing Steamworks that persists even when you attempt to download changed files from Steam. Backup your saves (located in "C:\Users\Your Username\Documents\My Games\Borderlands\SaveData" for Windows 7/Vista and somewhere similar for XP) and remove Borderlands entirely. Ign...
Are you using your old shortcut, and not launching through steam? If so right click on the game in the steam window and select create new shortcut. Steam launches the app a different way to include the overlay.
299,313
In a English drama, I heard an expression I can't understand like the following. > > I'm not finished. > > > I know that the verb "finish" can be an intransitive or transitive. by the way, I can't understand the meaning of the expression, and why the sentence is made with a passive voice. Is there anyone who can...
2021/10/05
[ "https://ell.stackexchange.com/questions/299313", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/104233/" ]
> > I'm not finished. > > > If the person is referring to work or an activity then this is broadly equivalent to... * I am not finished * I have not yet finished * I have not completed the work * I still have something to do * There is still effort required * The task I'm working on is not complete It could impl...
The construction to be + past participle is called **a passive infinitive.** > > In English grammar, the passive infinitive is an infinitive > construction in which the agent (or performer of the action) either > appears in a prepositional phrase following the verb or is not > identified at all. It is also called the...
299,313
In a English drama, I heard an expression I can't understand like the following. > > I'm not finished. > > > I know that the verb "finish" can be an intransitive or transitive. by the way, I can't understand the meaning of the expression, and why the sentence is made with a passive voice. Is there anyone who can...
2021/10/05
[ "https://ell.stackexchange.com/questions/299313", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/104233/" ]
> > I'm not finished. > > > If the person is referring to work or an activity then this is broadly equivalent to... * I am not finished * I have not yet finished * I have not completed the work * I still have something to do * There is still effort required * The task I'm working on is not complete It could impl...
While your example sentence has the form *be-verb + verb-ed*, it is not a passive form. Here, "am" is just a linking verb, and "finished" is an [adjective](https://www.merriam-webster.com/dictionary/finished). It's the same grammar structure as "I'm not happy" or "I'm not hungry". Here are some examples with "-ed" adj...
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
You can use the method to check if the sheet name is valid ``` private bool IsSheetNameValid(string sheetName) { if (string.IsNullOrEmpty(sheetName)) { return false; } if (sheetName.Length > 31) { return false; } char[] invalidChars = new char[] {':', '\\', '/', '?', '...
Something like that? ``` public string validate(string name) { foreach (char c in Path.GetInvalidFileNameChars()) name = name.Replace(c.ToString(), ""); if (name.Length > 31) name = name.Substring(0, 31); return name; } ```
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
You can use the method to check if the sheet name is valid ``` private bool IsSheetNameValid(string sheetName) { if (string.IsNullOrEmpty(sheetName)) { return false; } if (sheetName.Length > 31) { return false; } char[] invalidChars = new char[] {':', '\\', '/', '?', '...
Let's match the start of the string, then between 1 and 31 things that aren't on the forbidden list, then the end of the string. Requiring at least one means we refuse empty strings: ``` ^[^\/\\\?\*\[\]]{1,31}$ ``` There's at least one nuance that this regex will miss: this will accept a sequence of spaces, tabs and...
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
You can use the method to check if the sheet name is valid ``` private bool IsSheetNameValid(string sheetName) { if (string.IsNullOrEmpty(sheetName)) { return false; } if (sheetName.Length > 31) { return false; } char[] invalidChars = new char[] {':', '\\', '/', '?', '...
You might want to do a check for the name `History` as this is a reserved sheet name in Excel.
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
Let's match the start of the string, then between 1 and 31 things that aren't on the forbidden list, then the end of the string. Requiring at least one means we refuse empty strings: ``` ^[^\/\\\?\*\[\]]{1,31}$ ``` There's at least one nuance that this regex will miss: this will accept a sequence of spaces, tabs and...
Something like that? ``` public string validate(string name) { foreach (char c in Path.GetInvalidFileNameChars()) name = name.Replace(c.ToString(), ""); if (name.Length > 31) name = name.Substring(0, 31); return name; } ```
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
To do worksheet validation for those specified invalid characters using Regex, you can use something like this: ``` string wsName = @"worksheetName"; //verbatim string to take special characters literally Match m = Regex.Match(wsName, @"[\[/\?\]\*]"); bool nameIsValid = (m.Success || (string.IsNullOrEmpty(wsName)) || ...
Something like that? ``` public string validate(string name) { foreach (char c in Path.GetInvalidFileNameChars()) name = name.Replace(c.ToString(), ""); if (name.Length > 31) name = name.Substring(0, 31); return name; } ```
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
To do worksheet validation for those specified invalid characters using Regex, you can use something like this: ``` string wsName = @"worksheetName"; //verbatim string to take special characters literally Match m = Regex.Match(wsName, @"[\[/\?\]\*]"); bool nameIsValid = (m.Success || (string.IsNullOrEmpty(wsName)) || ...
Let's match the start of the string, then between 1 and 31 things that aren't on the forbidden list, then the end of the string. Requiring at least one means we refuse empty strings: ``` ^[^\/\\\?\*\[\]]{1,31}$ ``` There's at least one nuance that this regex will miss: this will accept a sequence of spaces, tabs and...
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
Let's match the start of the string, then between 1 and 31 things that aren't on the forbidden list, then the end of the string. Requiring at least one means we refuse empty strings: ``` ^[^\/\\\?\*\[\]]{1,31}$ ``` There's at least one nuance that this regex will miss: this will accept a sequence of spaces, tabs and...
You might want to do a check for the name `History` as this is a reserved sheet name in Excel.
11,817,186
I'm getting the below error when setting the worksheet name dynamically. Does anyone has regexp to validate the name before setting it ? * The name that you type does not exceed 31 characters. The name does * not contain any of the following characters: : \ / ? \* [ or ] * You did not leave the name blank.
2012/08/05
[ "https://Stackoverflow.com/questions/11817186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/141509/" ]
To do worksheet validation for those specified invalid characters using Regex, you can use something like this: ``` string wsName = @"worksheetName"; //verbatim string to take special characters literally Match m = Regex.Match(wsName, @"[\[/\?\]\*]"); bool nameIsValid = (m.Success || (string.IsNullOrEmpty(wsName)) || ...
You might want to do a check for the name `History` as this is a reserved sheet name in Excel.
9,019,764
``` <input id="@question.QuestionId" type="radio" value="@question.QuestionDescription" name="@string.Format("name_{0}", question.Group)" checked=@question.IsSelected"checked":false /> @question.QuestionDescription ``` Depending on the question.IsSelected value the checkbox should be selected or not selected. But re...
2012/01/26
[ "https://Stackoverflow.com/questions/9019764", "https://Stackoverflow.com", "https://Stackoverflow.com/users/424611/" ]
If you give it anything for the `checked` attribute it will be set to checked. I would optionally add the entire `checked='checked'` value based on the `IsSelected` property, omitting it when the value is false. ``` <input id="@question.QuestionId" type="radio" value="@question.QuestionDescription" name="@string.Forma...
You could do it like this ``` @{ string checkedAttribute = string.Empty; if (question.IsSelected) { checkedAttribute = "checked=\"checked\""; } } <input id="@question.QuestionId" type="radio" value="@question.QuestionDescription" name="@string.Format("name_{0}", question.Group)" @checkedAttribu...
747,023
I don't know how it happened, but for about a week now Visual Studio keeps switching the active project everytime I move between files (of different projects) in the same solution. Of course when I press F5 to start debugging or Ctrl+F5 to run the tests, it tells me that it can't start because the class library can't b...
2009/04/14
[ "https://Stackoverflow.com/questions/747023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83714/" ]
Right-click on your solution in Solution Explorer, select Common Properties - Startup Project in the treeview to the left and then adjust radiobuttons to the right as needed: [alt text http://www.rgoarchitects.com/nblog/content/binary/multistart.png](http://www.rgoarchitects.com/nblog/content/binary/multistart.png)
This happens often if you copy a project file manually - then you have two projects with the same GUID in one solution and VS can't distinguish between them since it stores the GUID of the "active" project. The solution is toopen each project file in a text editor (Notepad is just fine) and change the GUID. Use "Creat...
747,023
I don't know how it happened, but for about a week now Visual Studio keeps switching the active project everytime I move between files (of different projects) in the same solution. Of course when I press F5 to start debugging or Ctrl+F5 to run the tests, it tells me that it can't start because the class library can't b...
2009/04/14
[ "https://Stackoverflow.com/questions/747023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83714/" ]
There's an option "For new solutions use the currently selected project as the startup project" under "Projects and Solutions" -> "Build and Run" which could lead to this behavior.
This happens often if you copy a project file manually - then you have two projects with the same GUID in one solution and VS can't distinguish between them since it stores the GUID of the "active" project. The solution is toopen each project file in a text editor (Notepad is just fine) and change the GUID. Use "Creat...
747,023
I don't know how it happened, but for about a week now Visual Studio keeps switching the active project everytime I move between files (of different projects) in the same solution. Of course when I press F5 to start debugging or Ctrl+F5 to run the tests, it tells me that it can't start because the class library can't b...
2009/04/14
[ "https://Stackoverflow.com/questions/747023", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83714/" ]
Right-click on your solution in Solution Explorer, select Common Properties - Startup Project in the treeview to the left and then adjust radiobuttons to the right as needed: [alt text http://www.rgoarchitects.com/nblog/content/binary/multistart.png](http://www.rgoarchitects.com/nblog/content/binary/multistart.png)
There's an option "For new solutions use the currently selected project as the startup project" under "Projects and Solutions" -> "Build and Run" which could lead to this behavior.
29,097,356
I have been doing some research on media queries and I understand the concept of mobile-first design. I know, that there are lots of questions regarding media queries but none of them targets my specific question. Also I understand the concept of structuring your stylesheets with media queries like this: ``` /* Sma...
2015/03/17
[ "https://Stackoverflow.com/questions/29097356", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4132915/" ]
You would seem to have a poor data format. If you want to store lists of things, use a junction table. However, the best answer that I can think of is a set of conditions that are added together: ``` select ((str like '%p6%') + (str like '%p7%') + (str like '%p8%') + (str like '%p9%') )...
``` SELECT count(*) FROM (SELECT 'p2p3p4p9c5c6c7' AS a) AS string_table INNER JOIN (SELECT 'p6' AS b UNION ALL SELECT 'p7' UNION ALL SELECT 'p8' UNION ALL SELECT 'p9') AS list_table ON INSTR(string_table.a,list_table.b) > 0; ```
2,425,955
How can I change cachable content so that the user will immediately get the refreshed version? I'll give an example: I have a .css file that is cachable for 2 weeks, so even if I change it, users will still get the old version, unless the press F5. There are a few solutions, that I know of, but none are perfect: * C...
2010/03/11
[ "https://Stackoverflow.com/questions/2425955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/291557/" ]
The calendar can capture the mouse without a date change (e.g. in CalendarMode drill down). A better solution is this: ``` protected override void OnPreviewMouseUp(MouseButtonEventArgs e) { base.OnPreviewMouseUp(e); if (Mouse.Captured is CalendarItem) { Mouse.Capture(null); } } ```
I added this code when changing the SelectedDates of the Calendar and it fixed the issue. ``` Private Sub Calendar_SelectedDatesChanged(ByVal sender As Object, ByVal e As System.Windows.Controls.SelectionChangedEventArgs) Handles Me.SelectedDatesChanged Me.DisplayDate = CType(Me.SelectedDate, DateTime)...
72,792,627
My data is as follows (this is just a sample, real data has ~20,000 lines) : Original raw data (tsv): ``` Names USA EU FR Jim 3 12 5 John 8 4 7 Jane 12 35 3 Sue 6 3 9 ``` Image of original Data: [![Orig data](https://i.stack.imgur.com/zEPJx.png)](https://i.stack.imgur.com/zEPJx.png) ...
2022/06/28
[ "https://Stackoverflow.com/questions/72792627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5393293/" ]
The expected output you provided doesn't show what you describe as your requirements so maybe this is what you really want: ``` $ cat tst.awk BEGIN { FS=OFS="\t" } NR > 1 { for ( i=2; i<=NF; i++ ) { $i = ( $i > 5 ? $1 : "" ) } } { $1 = "" sub(OFS,"") print } ``` ``` $ awk -f tst.awk file ...
`awk` solution without needing any arrays : ``` {m,g}awk ' BEGIN { FS=(OFS="\t")"+" } !_<NR { gsub( "\t(([-][0-9]+|[+]?[0-4])([.][0-9]*)?)(\t|$)", "\t_\t") gsub("[0-9]+", $!_) } sub("^[^\t]*\t",_)^_' USA EU FR _ Jim Jim John _ John Jane Jane _ Sue _ Sue ```
72,792,627
My data is as follows (this is just a sample, real data has ~20,000 lines) : Original raw data (tsv): ``` Names USA EU FR Jim 3 12 5 John 8 4 7 Jane 12 35 3 Sue 6 3 9 ``` Image of original Data: [![Orig data](https://i.stack.imgur.com/zEPJx.png)](https://i.stack.imgur.com/zEPJx.png) ...
2022/06/28
[ "https://Stackoverflow.com/questions/72792627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5393293/" ]
One `GNU awk` (for multidimensional arrays) idea: ``` awk ' BEGIN { FS=OFS="\t" } NR==1 { for (col=2;col<=NF;col++) output=output (col==2 ? "" : OFS) $col print output next } { for (col=2;col<=NF;col++) if ($col > 5) names[++count[col]][col]=$1 }...
`awk` solution without needing any arrays : ``` {m,g}awk ' BEGIN { FS=(OFS="\t")"+" } !_<NR { gsub( "\t(([-][0-9]+|[+]?[0-4])([.][0-9]*)?)(\t|$)", "\t_\t") gsub("[0-9]+", $!_) } sub("^[^\t]*\t",_)^_' USA EU FR _ Jim Jim John _ John Jane Jane _ Sue _ Sue ```
48,478,857
Why does this code NOT generate a double free when the shared pointers go out of scope? ``` int main() { { auto * ptr = new int(1); shared_ptr<int> a( ptr ); shared_ptr<int> b( ptr ); cout << "ok: " << *a << *b << endl; } cout << "still ok" << endl; return 0; } ```
2018/01/27
[ "https://Stackoverflow.com/questions/48478857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3074280/" ]
> > Why does this code NOT generate a double free when the shared pointers > go out of scope? > > > Why do you think it doesn't? It's undefined behavior, anything can happen. That includes your program printing out `still ok`.
This code is UB, so *anything* might happen. For `a` *delete* is called on the already deleted pointer.
48,478,857
Why does this code NOT generate a double free when the shared pointers go out of scope? ``` int main() { { auto * ptr = new int(1); shared_ptr<int> a( ptr ); shared_ptr<int> b( ptr ); cout << "ok: " << *a << *b << endl; } cout << "still ok" << endl; return 0; } ```
2018/01/27
[ "https://Stackoverflow.com/questions/48478857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3074280/" ]
This code is UB, so *anything* might happen. For `a` *delete* is called on the already deleted pointer.
Constructing more than one shared pointer from a raw pointer results in [undefined behavior](http://en.cppreference.com/w/cpp/language/ub) because: > > the pointed-to object will have multiple control blocks. > > > Excerpt from the "Effective Modern C++", page 129, item 19 Avoid passing raw pointers to a `std::s...
48,478,857
Why does this code NOT generate a double free when the shared pointers go out of scope? ``` int main() { { auto * ptr = new int(1); shared_ptr<int> a( ptr ); shared_ptr<int> b( ptr ); cout << "ok: " << *a << *b << endl; } cout << "still ok" << endl; return 0; } ```
2018/01/27
[ "https://Stackoverflow.com/questions/48478857", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3074280/" ]
> > Why does this code NOT generate a double free when the shared pointers > go out of scope? > > > Why do you think it doesn't? It's undefined behavior, anything can happen. That includes your program printing out `still ok`.
Constructing more than one shared pointer from a raw pointer results in [undefined behavior](http://en.cppreference.com/w/cpp/language/ub) because: > > the pointed-to object will have multiple control blocks. > > > Excerpt from the "Effective Modern C++", page 129, item 19 Avoid passing raw pointers to a `std::s...
67,083,249
I tried to install MongoDB on the ubuntu 20.04 and the used command are given below, > > To create a mongodb-org-4.4.list file in the sources.list.d folder > > > ``` echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-...
2021/04/13
[ "https://Stackoverflow.com/questions/67083249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14065992/" ]
Try like this ``` wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update sudo apt-get install -y mongodb-org ```
@Alex Blex, Please concern here, ``` >echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list >sudo apt-get update >sudo apt install mongodb-org ``` After running the above command I also run `apt --fix-broken inst...
67,083,249
I tried to install MongoDB on the ubuntu 20.04 and the used command are given below, > > To create a mongodb-org-4.4.list file in the sources.list.d folder > > > ``` echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-...
2021/04/13
[ "https://Stackoverflow.com/questions/67083249", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14065992/" ]
Try like this ``` wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list sudo apt-get update sudo apt-get install -y mongodb-org ```
try this command : ``` sudo apt-get install -y mongodb-org ``` I use it to install MongoDB and it's working : tuto : <https://addi-kamal.medium.com/mongodb-iceberg-how-to-install-mongodb-on-ubuntu-server-9c5beea2c62>
42,557,800
I have a div like this : ``` <div onclick="location.href='RandomURL.com/index'></div> ``` I want to append this div to another div that got the ID : divId : ``` $("#divId").html('<div onclick="location.href= ?? ``` As you can see I want to put the character ( " ) **after href**= , but I already used one with **on...
2017/03/02
[ "https://Stackoverflow.com/questions/42557800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3723197/" ]
Use a backslash character (`\`) to escape it: ``` $("#divId").html('<div onclick="location.href=\"xxx\""'); ``` Here are [characters](http://www.freeformatter.com/javascript-escape.html) that need to be escaped in javascript strings: * Horizontal Tab: `\t` * Vertical Tab: `\v` * Nul char: `\0` * Backspace: `\b` * F...
Try using backslash to escape single and double quotes. ``` $("#divId").html('<div onclick="location.href=\'RandomURL.com/index\'"></div>'); ``` It is better to use event delegation. ``` $('#divId').html('<div id="foo">'); $(document).on('click', '#foo', function() { window.location.href = 'RandomURL.com/index...
42,557,800
I have a div like this : ``` <div onclick="location.href='RandomURL.com/index'></div> ``` I want to append this div to another div that got the ID : divId : ``` $("#divId").html('<div onclick="location.href= ?? ``` As you can see I want to put the character ( " ) **after href**= , but I already used one with **on...
2017/03/02
[ "https://Stackoverflow.com/questions/42557800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3723197/" ]
Use a backslash character (`\`) to escape it: ``` $("#divId").html('<div onclick="location.href=\"xxx\""'); ``` Here are [characters](http://www.freeformatter.com/javascript-escape.html) that need to be escaped in javascript strings: * Horizontal Tab: `\t` * Vertical Tab: `\v` * Nul char: `\0` * Backspace: `\b` * F...
You can nest quotes up to four times: ``` " > \" > ' > \' ``` or ``` ' > \' > " > \" ``` In your case it would be sth. like ``` $("#divId").html("<div onclick=\"location.href='RandomURL.com/index';\"></div>"); ```
42,557,800
I have a div like this : ``` <div onclick="location.href='RandomURL.com/index'></div> ``` I want to append this div to another div that got the ID : divId : ``` $("#divId").html('<div onclick="location.href= ?? ``` As you can see I want to put the character ( " ) **after href**= , but I already used one with **on...
2017/03/02
[ "https://Stackoverflow.com/questions/42557800", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3723197/" ]
Use a backslash character (`\`) to escape it: ``` $("#divId").html('<div onclick="location.href=\"xxx\""'); ``` Here are [characters](http://www.freeformatter.com/javascript-escape.html) that need to be escaped in javascript strings: * Horizontal Tab: `\t` * Vertical Tab: `\v` * Nul char: `\0` * Backspace: `\b` * F...
Use ES6 [Template Literals](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals). Use the `` symbols to enclose your html code. In your case it would be: ``` $("#divId").html(`<div onclick="location.href= ??"></div>`); ``` You can include as many quotes [ ' ], double quoutes [ " ], and b...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
``` @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragmentlayout, container,false); CheckBox checkboxvariable=(CheckBox)rootView.findViewById(R.id.checkboxid); checkboxvariable.setOnClickL...
Any `onClick` XML attribute will mean that **the method must be found in the activity**, not in the fragment, not in the View. So the way I see it, you have two options: 1. Add the method in the Activity and inside the implementation try to find the fragment and if found, delegate the call to the fragment. 2. Remove t...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
``` @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragmentlayout, container,false); CheckBox checkboxvariable=(CheckBox)rootView.findViewById(R.id.checkboxid); checkboxvariable.setOnClickL...
Just use your custom Listener > > CompoundButton.OnCheckedChangeListener > > > inside any other view then *Activity*. Below code sample ``` public class MyFragment extends Fragment{ public View onCreateView(...){ ... CheckBox cbFilter = (CheckBox) rootView.findViewById(R.id.chb_rt_is_filter); cbFi...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
``` @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragmentlayout, container,false); CheckBox checkboxvariable=(CheckBox)rootView.findViewById(R.id.checkboxid); checkboxvariable.setOnClickL...
``` public class MyFragment extends Fragment { CheckBox myCheckBox; @Override public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle saveInstanceState) { rootView = layoutInflater.inflate(R.layout.your_fragment_layout, container, false); ... ... ...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
Any `onClick` XML attribute will mean that **the method must be found in the activity**, not in the fragment, not in the View. So the way I see it, you have two options: 1. Add the method in the Activity and inside the implementation try to find the fragment and if found, delegate the call to the fragment. 2. Remove t...
Just use your custom Listener > > CompoundButton.OnCheckedChangeListener > > > inside any other view then *Activity*. Below code sample ``` public class MyFragment extends Fragment{ public View onCreateView(...){ ... CheckBox cbFilter = (CheckBox) rootView.findViewById(R.id.chb_rt_is_filter); cbFi...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
Any `onClick` XML attribute will mean that **the method must be found in the activity**, not in the fragment, not in the View. So the way I see it, you have two options: 1. Add the method in the Activity and inside the implementation try to find the fragment and if found, delegate the call to the fragment. 2. Remove t...
``` public class MyFragment extends Fragment { CheckBox myCheckBox; @Override public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle saveInstanceState) { rootView = layoutInflater.inflate(R.layout.your_fragment_layout, container, false); ... ... ...
19,357,711
I'm trying to recieve checkbox choices inside my Fragment class, however I'm not able to use the way I've used in Activities (calling `android:onClick="onCheckboxClicked"` method from a `layout.xml`), because I get the "method onCheckboxClicked not found" everytime this method is called. ``` public void onCheckboxClic...
2013/10/14
[ "https://Stackoverflow.com/questions/19357711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1938563/" ]
``` public class MyFragment extends Fragment { CheckBox myCheckBox; @Override public View onCreateView(LayoutInflater layoutInflater, ViewGroup container, Bundle saveInstanceState) { rootView = layoutInflater.inflate(R.layout.your_fragment_layout, container, false); ... ... ...
Just use your custom Listener > > CompoundButton.OnCheckedChangeListener > > > inside any other view then *Activity*. Below code sample ``` public class MyFragment extends Fragment{ public View onCreateView(...){ ... CheckBox cbFilter = (CheckBox) rootView.findViewById(R.id.chb_rt_is_filter); cbFi...
6,693,327
I have an unbelievably strange problem which I have been trying to fix for almost a day, and I'm now against a brick wall and need help! I have created a .NET 4 C# website on my *Windows 7* PC, with a newly installed *SqlServer 2008 Express R2*, and all works fine. I have uploaded the database and website. The websi...
2011/07/14
[ "https://Stackoverflow.com/questions/6693327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390501/" ]
If it's a **stored procedure** you're calling, you should set the `SqlCommand.CommandType` to stored procedure: ``` DataSet ds = new DataSet(); using(SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString())) using(SqlCommand cmd = new SqlCommand("MYSP 'param1', param2, param...
Use SQL Server Profiler to capture the actual stored procedure call as it's issued by your production ASP.NET server, then do the same for your development setup. Make sure the parameters going in are the same. If the parameters match at that level, the only answer that seems possible is that your colleague's complica...
6,693,327
I have an unbelievably strange problem which I have been trying to fix for almost a day, and I'm now against a brick wall and need help! I have created a .NET 4 C# website on my *Windows 7* PC, with a newly installed *SqlServer 2008 Express R2*, and all works fine. I have uploaded the database and website. The websi...
2011/07/14
[ "https://Stackoverflow.com/questions/6693327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390501/" ]
usual things to try: When you're logging on to the database to run your query, are you doing so as the SAME user that the asp.net process is using? You may find that if you're using two users, they may be set-up differently (one as EN-GB, one as EN-US), which would give you odd date based problems? Also, you might find...
If it's a **stored procedure** you're calling, you should set the `SqlCommand.CommandType` to stored procedure: ``` DataSet ds = new DataSet(); using(SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString())) using(SqlCommand cmd = new SqlCommand("MYSP 'param1', param2, param...
6,693,327
I have an unbelievably strange problem which I have been trying to fix for almost a day, and I'm now against a brick wall and need help! I have created a .NET 4 C# website on my *Windows 7* PC, with a newly installed *SqlServer 2008 Express R2*, and all works fine. I have uploaded the database and website. The websi...
2011/07/14
[ "https://Stackoverflow.com/questions/6693327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390501/" ]
If it's a **stored procedure** you're calling, you should set the `SqlCommand.CommandType` to stored procedure: ``` DataSet ds = new DataSet(); using(SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["myConn"].ToString())) using(SqlCommand cmd = new SqlCommand("MYSP 'param1', param2, param...
Ok, wild shot here, but I notice that you are doing `ds.Tables[0].Rows.Count` and I wonder if your stored procedure is returning multiple tables of data? The best answer so far is from @pseudocoder to use the profiler to see what is actually getting called. I would also suggest putting a break point in your code and ex...
6,693,327
I have an unbelievably strange problem which I have been trying to fix for almost a day, and I'm now against a brick wall and need help! I have created a .NET 4 C# website on my *Windows 7* PC, with a newly installed *SqlServer 2008 Express R2*, and all works fine. I have uploaded the database and website. The websi...
2011/07/14
[ "https://Stackoverflow.com/questions/6693327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390501/" ]
usual things to try: When you're logging on to the database to run your query, are you doing so as the SAME user that the asp.net process is using? You may find that if you're using two users, they may be set-up differently (one as EN-GB, one as EN-US), which would give you odd date based problems? Also, you might find...
Use SQL Server Profiler to capture the actual stored procedure call as it's issued by your production ASP.NET server, then do the same for your development setup. Make sure the parameters going in are the same. If the parameters match at that level, the only answer that seems possible is that your colleague's complica...
6,693,327
I have an unbelievably strange problem which I have been trying to fix for almost a day, and I'm now against a brick wall and need help! I have created a .NET 4 C# website on my *Windows 7* PC, with a newly installed *SqlServer 2008 Express R2*, and all works fine. I have uploaded the database and website. The websi...
2011/07/14
[ "https://Stackoverflow.com/questions/6693327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390501/" ]
usual things to try: When you're logging on to the database to run your query, are you doing so as the SAME user that the asp.net process is using? You may find that if you're using two users, they may be set-up differently (one as EN-GB, one as EN-US), which would give you odd date based problems? Also, you might find...
Ok, wild shot here, but I notice that you are doing `ds.Tables[0].Rows.Count` and I wonder if your stored procedure is returning multiple tables of data? The best answer so far is from @pseudocoder to use the profiler to see what is actually getting called. I would also suggest putting a break point in your code and ex...
13,630,027
My Android application, like almost every other app, stores its information (some private data of the users) in a local sqlite database. Now I got a tablet and I wondered if there is a convenient way to sync the data across multiple devices and keep it up to date automatically. Most other apps seem to use their own ser...
2012/11/29
[ "https://Stackoverflow.com/questions/13630027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/991862/" ]
I believe Googles [App Engine](https://developers.google.com/appengine/) is what you are looking for, Its not free but the pricing isnt bad
did you try to use DropBox? i use it to share pictures beetwen android devices. Most important ... it is free ;)
13,630,027
My Android application, like almost every other app, stores its information (some private data of the users) in a local sqlite database. Now I got a tablet and I wondered if there is a convenient way to sync the data across multiple devices and keep it up to date automatically. Most other apps seem to use their own ser...
2012/11/29
[ "https://Stackoverflow.com/questions/13630027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/991862/" ]
I believe Googles [App Engine](https://developers.google.com/appengine/) is what you are looking for, Its not free but the pricing isnt bad
I see that you said you didn't want to many permissions, this solution goes against that. If you do not want to use your own server, your best bet would be to use the Drive API in order to back data to a user's drive account. If you are signed in to a google account on multiple devices, then is your best bet. You sho...
13,315,071
I'm overriding the `getItemViewType()` method in my project to indicate which view to use for items in my list, `R.layout.listview_item_product_complete` or `R.layout.listview_item_product_inprocess` I know this function must return a value between 0 and 1 less than the number of possible views, in my case 0 or 1. Ho...
2012/11/09
[ "https://Stackoverflow.com/questions/13315071", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1171978/" ]
> > I need to know how to define COMPLETE\_TYPE\_INDEX as 1 or 0. Seems like such a trivial thing! > > > Honestly, it doesn't matter whether `COMPLETE_TYPE_INDEX` is 0 and `INPROCESS_TYPE_INDEX` is 1, or vica versa. But you define them as class variables, in this case they can be `static` and `final` as well: ``...
in your `getView` method ``` public View getView(int position, View convertView, ViewGroup parent) { if(getItemViewType(position) == INPROCESS_TYPE_INDEX){ //inflate a layout file convertView = inflater.inflate(R.layout.R.layout.listview_item_product_inprocess); } else{ { //inflate a layout file convertView = in...
167,946
I recently purchased a mac pro w Yosemite. I left my wife set herself up as an additional user, which later I removed. Now 3 apps (numbers, Keynote and Pages) which need to be updated are listed under her apple ID and requires her password. Being my laptop, I want to correct this and use my ID. Unfortunately the OS do...
2015/01/18
[ "https://apple.stackexchange.com/questions/167946", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/110164/" ]
if she 'bought' them, even on 'your' machine, they are tied to her Apple ID. You would need to re-purchase under your own ID. App Store purchases are not tied to a machine, they are tied to an ID … or set up [Family Sharing](http://support.apple.com/en-us/HT201060), which would allow you both to download/use any app...
I had to delete the apps indeed, and then purchase them at $20 a pop.
101,507
> > My prefix is a winner. > > > My suffix is the inner. > > > My infix is whole. > > > My whole is cold. > > >
2020/08/25
[ "https://puzzling.stackexchange.com/questions/101507", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/70545/" ]
I think the answer is > > Winter > > > My prefix is a winner. > > **Win** > > > My suffix is the inner. > > **Inter** - a prefix used to mean "between" > > > My infix is whole. > > **Int** - short for integer in computer programming, i.e, a *whole* number > > > My whole is cold. > > **Win...
> > Passionless > > > Prefix > > Prefix "pass", what the winner has done to everyone else in a race > > > Suffix > > Suffix "less", a number less than x is inside the set of natural numbers up to x > > > Infix > > Infix "ion", a perfectly whole bit of matter, though I grant the missing electron m...
30,899,537
I am new to python and I am using python to query a device for information. The information that is returned is an IP address, and a score. For example the data may look like: ``` 192.168.1.1 3 192.168.1.1 4 10.10.1.1 2 10.10.1.1 3 ``` The lists are very long, but using the above as a sample I am trying pytho...
2015/06/17
[ "https://Stackoverflow.com/questions/30899537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5021021/" ]
Use the dictionary [`.get()`](https://docs.python.org/2/library/stdtypes.html#dict.get) method which can return a default value if the key is not found. ``` data = {} for ip, score in your_results: data[ip] = data.get(ip, 0) + score ```
``` from collections import defaultdict import re counts = defaultdict(int) with open('ips') as f: for line in f: line = line.rstrip() if re.match(r'\d+\.\d+\.\d+\.\d+', line): ip = line elif re.match(r'\d+', line): counts[ip] += int(line) for k in counts: prin...