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
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`appendTo` can only be applied on jQuery objects. But `val` returns a string. Try this instead: ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
val returns a string, not a jQuery object, try: ``` $('div#links').append($(this).val()); ```
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`val()` doesn't return a DOM element. It returns the `value` attribute from a DOM element. So if you have something like `<input value="foo" />`, calling val() on that node will give you a string `"foo"`. Since javascript's string class doesn't have a method `appendTo`, you're getting an error. You probably want somet...
$(this).val() doesn't return a jQuery object (it returns the value of the input element). So it can't be chained.
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`appendTo` can only be applied on jQuery objects. But `val` returns a string. Try this instead: ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
$(this).val() doesn't return a jQuery object (it returns the value of the input element). So it can't be chained.
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`val()` doesn't return a DOM element. It returns the `value` attribute from a DOM element. So if you have something like `<input value="foo" />`, calling val() on that node will give you a string `"foo"`. Since javascript's string class doesn't have a method `appendTo`, you're getting an error. You probably want somet...
You can change it to ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`appendTo` can only be applied on jQuery objects. But `val` returns a string. Try this instead: ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
You can change it to ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
2,128,632
I thought this code should work but it didnt, can someone explain? ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $(this).val().appendTo('div#links'); }); ``` It says `$(this).val().appendTo()` is not a function.
2010/01/24
[ "https://Stackoverflow.com/questions/2128632", "https://Stackoverflow.com", "https://Stackoverflow.com/users/206446/" ]
`appendTo` can only be applied on jQuery objects. But `val` returns a string. Try this instead: ``` $("#addLinkLayout input.comment, #addLinkLayout input.link").each(function() { $('div#links').append($(this).val()); }); ```
`val()` doesn't return a DOM element. It returns the `value` attribute from a DOM element. So if you have something like `<input value="foo" />`, calling val() on that node will give you a string `"foo"`. Since javascript's string class doesn't have a method `appendTo`, you're getting an error. You probably want somet...
31,712,873
I have been trying to figure out this query the whole day, and I have no idea how to get it. I have a model `Book` ``` class Book < ActiveRecord::Base # Relationships has_many :requests, dependent: :destroy end ``` and this model `Request` ``` class Request < ActiveRecord::Base belongs_to :book # ...
2015/07/29
[ "https://Stackoverflow.com/questions/31712873", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392684/" ]
Your approach is not bad. If you want to stick with it, what about the following: ``` Book.all .eager_load(:requests) .where([ "books.id not in (?) or requests.status <> ?", Request.pluck(:book_id), Request.statuses[:completed] ]) ``` `eager_load` is basically `includes(:requests)` + `r...
This could be easily done with raw SQL, but it seems that you want to rely on the DSL provided by ActiveRecord. You need `OR`, which is unfortunately not available. Your best bet is to implement it yourself, for example with this method: ``` def join_with_or(*relations) relations.map do |relation| clause = ...
59,655,585
In my organization we share several computers and i need to change computer each day. Therefore, as a scientific programmer i always keep a version of my code on an usb key to transfer to the computer I will be working on this day. Also Sometimes I work on my code at home after work . What suggestions do you have for ...
2020/01/09
[ "https://Stackoverflow.com/questions/59655585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11580831/" ]
It is not usually needed - to be able to develop the same code from multiple computers. Mostly it is easy - we have version control for this. Git push on one machine and pull on another. All good. Enough for web and backend development. But there is a small number of cases when the projects are a bit too complex for t...
good question. I think you already know what you need but a little confused on how it works. Let's say you used GitHub and have a public repository (your code would go here instead of your usb) then you would have the GitHub client (sourcetree works good too) on your work computers. From here you 'push' your code to...
59,655,585
In my organization we share several computers and i need to change computer each day. Therefore, as a scientific programmer i always keep a version of my code on an usb key to transfer to the computer I will be working on this day. Also Sometimes I work on my code at home after work . What suggestions do you have for ...
2020/01/09
[ "https://Stackoverflow.com/questions/59655585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11580831/" ]
It is not usually needed - to be able to develop the same code from multiple computers. Mostly it is easy - we have version control for this. Git push on one machine and pull on another. All good. Enough for web and backend development. But there is a small number of cases when the projects are a bit too complex for t...
If those are the same computers then also any cloud account is very useful: I personally use `OneDrive` which gives me 1TB of space (since I have Office 365 subsd) and files are visible by any applications as if they were actually on the computer (Windows quickly fetches them in the background). Apart from that I hav...
20,692,974
For a unique test scenario I have, I need to be able to read the directory structure of a given Github project (public project) in Java. In other words, given a GitHub project url, my program should be able to read the Java files under `/src/main/java`. Option 1: Reading the html directly from a url like below and pa...
2013/12/19
[ "https://Stackoverflow.com/questions/20692974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1732171/" ]
Since I couldn't get the Java GitHub library to work, I decided to parse the source zip file to get what I wanted. ``` String githubZip = "https://github.com/testuser/testproject/archive/master.zip" ZipInputStream zipInputStream = null def javaFiles = [:] try { zipInputStream = new ZipInputStr...
Use the `JGit` library to clone the repository onto your filesystem, and then traverse the working directory in the normal way - because it's just a regular directory.
31,201,505
Strange bug i am getting right now : If i am disabling auto-layout in application and trying to handle with launch screen then strange bug is coming : **Step 1 :** * If i am setting application for iOS-7 and above only for LaunchImage then everything is working fine . But problem is that we can not set LaunchImage ...
2015/07/03
[ "https://Stackoverflow.com/questions/31201505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3024579/" ]
It is not a strange problem. Just set background color of your view in `veiwDidLoad` like `self.view.backgroundcolor = [UIColor redColor];` and you will notice your viewController is using full screen but other controls are not getting resized. **Just use AUTO LAYOUT** > > Auto Layout is a system that lets you lay o...
I think are you Forget to adding splash screen Default-568h@2x.png in to your Project and can you check my [previous answer](https://stackoverflow.com/questions/19403334/ios7-xib-issue-blank-space-at-top-and-bottom/19403601#19403601)
31,201,505
Strange bug i am getting right now : If i am disabling auto-layout in application and trying to handle with launch screen then strange bug is coming : **Step 1 :** * If i am setting application for iOS-7 and above only for LaunchImage then everything is working fine . But problem is that we can not set LaunchImage ...
2015/07/03
[ "https://Stackoverflow.com/questions/31201505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3024579/" ]
Finally i have found one alternate solution for this problem : Just add Launch screen for 7.0 and above then your App will run on iPhone 5,5s , 6 and 6+ accordingly . ![Launchscreen](https://i.stack.imgur.com/HyxLV.png) Add both LaunchImage for 2x and Retina . ![enter image description here](https://i.stack.imgur.c...
I think are you Forget to adding splash screen Default-568h@2x.png in to your Project and can you check my [previous answer](https://stackoverflow.com/questions/19403334/ios7-xib-issue-blank-space-at-top-and-bottom/19403601#19403601)
4,524,285
Is it possible to use [SQL](http://en.wikipedia.org/wiki/SQL) to install a database program? If so, even in theory, how? The question refers to the following comment: > > 7.They used SQL to install a database program. > > > From the following document: <http://mirror.wikileaks.info/leak/us-intel-wikileaks.pdf>...
2010/12/24
[ "https://Stackoverflow.com/questions/4524285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59087/" ]
Hey if you read the PDF doc, it all becomes clear. This is a(n alleged) US intelligence analysis of wikileaks' capabilities and means. The report is meant to be read by non technical people really, so my guess is that someone took a bit of a short-cut to explain the basics. This is not, as far as I can read in 2 minut...
If you mean a database program as in "create a database", then sure, that's the DDL (data definition language) arm of SQL. `CREATE TABLE etc...`. If you mean actually install a database, such as MySQL, Oracle, DB2, etc.., then no... THat'd be like saying "can I use a car to build a car?"
43,666,618
**FOLLOW UP** A combination of comments answered this question. A followup is why the import/require statements matter. I thought the effectively did the same thing. **ORIGINAL QUESTION** I'm trying to use `vue-resource` to make REST calls to an API. I have up to now a working Vue app that also uses `vue-material` an...
2017/04/27
[ "https://Stackoverflow.com/questions/43666618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2393012/" ]
You need to check for `this.$http` from within a Vue instance method: ``` import Vue from 'vue'; Vue.use(require('vue-resource')); new Vue({ el: '#app', mounted: function() { console.log(this.$http); } }) ```
You can try an alternative. From the Vue web site: <https://v2.vuejs.org/v2/cookbook/adding-instance-properties.html#Real-World-Example-Replacing-Vue-Resource-with-Axios> "Alias `axios` to `Vue.prototype.$http`. Then you’ll be able to use methods like `this.$http.get` in any Vue instance" ``` <script src="https://cdn...
49,454,819
``` String ccToken = ""; String result = "ssl_transaction_type=CCGETTOKENssl_result=0ssl_token=4366738602809990ssl_card_number=41**********9990ssl_token_response=SUCCESS"; String[] elavonResponse = result.split("=|ssl"); for (String t : elavonResponse) { System.out.println(t); } ccToken = ...
2018/03/23
[ "https://Stackoverflow.com/questions/49454819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8928082/" ]
You can use [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#replaceAll-java.lang.String-java.lang.String-) with this regex [`.*ssl_token=(\\d+).*`](https://regex101.com/r/esTegi/1) : ``` String number = result.replaceAll(".*ssl_token=(\\d+).*", "$1"); ``` Outputs ``` 4366738602809990 `...
You can do it with regex. It would probably be better to change the specifications of the input string so that each key/value pair is separated by an ampersand (&) so you could split it (similar to HTTP POST parameters). ``` Pattern p = Pattern.compile(".*ssl_token=([0-9]+).*"); Matcher m = p.matcher(result); if(m.ma...
49,454,819
``` String ccToken = ""; String result = "ssl_transaction_type=CCGETTOKENssl_result=0ssl_token=4366738602809990ssl_card_number=41**********9990ssl_token_response=SUCCESS"; String[] elavonResponse = result.split("=|ssl"); for (String t : elavonResponse) { System.out.println(t); } ccToken = ...
2018/03/23
[ "https://Stackoverflow.com/questions/49454819", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8928082/" ]
You can use [replaceAll](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html#replaceAll-java.lang.String-java.lang.String-) with this regex [`.*ssl_token=(\\d+).*`](https://regex101.com/r/esTegi/1) : ``` String number = result.replaceAll(".*ssl_token=(\\d+).*", "$1"); ``` Outputs ``` 4366738602809990 `...
Search index of ssl\_token. Create substring from that index. Convert substring to number. To number can extract number when it is at the beggining of the string.
70,585,182
I'm trying to integrate an API with my react native app, but when I make the request, I always receive a Network error: ``` [Unhandled promise rejection: TypeError: Network request failed] at node_modules\whatwg-fetch\dist\fetch.umd.js:541:17 in setTimeout$argument_0 at node_modules\react-native\Libraries\Core\Timers\...
2022/01/04
[ "https://Stackoverflow.com/questions/70585182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14159985/" ]
The `once` method returns a `DatabaseEvent`, not a `DataSnapshot`. `DatabaseEvent` is a class that encapsulates a `DataSnapshot` **AND** a `DatabaseEventType`, to extract the snapshot, you must use `DatabaseEvent.snapshot`: ``` reference.once().then((event) { final dataSnapshot = event.snapshot; if (dataSnapShot!....
I was following the same old tutorial you mentioned, the @mobdev991 answer is correct and i think the reason why you don't receive data is the class where you are assigning data try this ``` class Users { String? id; String? email; String? name; String? phone; Users({this.id, this.email, this.name, this.pho...
1,158,501
There are a lot of open source software like Reaver in internet, everyone is able to download and use it. So, my question is about the security of this kind of software, I mean, not just hacking software. Are there back doors on those programs or some like that?
2019/07/15
[ "https://askubuntu.com/questions/1158501", "https://askubuntu.com", "https://askubuntu.com/users/966037/" ]
They are safe if only: 1. You read and compile the source by yourself. 2. You use a compiled version which has been read and compiled by someone who you trust. (and/or being watched by a lot of peoples). Otherwise there is no way to tell a compiled version of a source is exactly same as the source. For your specific...
Depends on your definition of "safe". Just because the software has no backdoors, does not mean that it has no potential vulnerabilities (i.e. security-related bugs), or it cannot be used in potentially dangerous ways (e.g. ssh agent forwarding)
7,009,398
I have Spinner with some items. Some of the items are having long text, so its not appearing on the spinner. How can I have scrolling text on the Spinner?
2011/08/10
[ "https://Stackoverflow.com/questions/7009398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/887689/" ]
For spinner, you have to create xml file ``` <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text1" style="android:attr/dropDownItemStyle" android:singleLine="true" android:layout_width="fill_parent" android:layout_height="45px" android:ellipsize="marquee" android:textColor="#00...
you have to create some custom spinner Adapter.setDropDownViewResource(R.layout.spinner);
7,009,398
I have Spinner with some items. Some of the items are having long text, so its not appearing on the spinner. How can I have scrolling text on the Spinner?
2011/08/10
[ "https://Stackoverflow.com/questions/7009398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/887689/" ]
For spinner, you have to create xml file ``` <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/text1" style="android:attr/dropDownItemStyle" android:singleLine="true" android:layout_width="fill_parent" android:layout_height="45px" android:ellipsize="marquee" android:textColor="#00...
you have to create a custom spinner Globals in Activity =================== ``` String[] spinnerValues = { "1-10", "10-100", "100-200","200-500", "500-1000","1000-2000","2000-5000","No. of Employees" }; Private Spinner _spin; ``` In oncreate =========== ``` _spin= (Spinner) findViewById(R.id.your_spinner_id); _sp...
37,404,164
I want to find the occurrence of a specific letter in array and also want to count the number of values in which it is present. for example: ``` <?php $aa= array ( 'sayhello', 'hellostackoverflow', 'ahelloworld', 'foobarbas' 'apple' ); ``` here if i search for 'o' then it should return 4 as 'o' is present...
2016/05/24
[ "https://Stackoverflow.com/questions/37404164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4165262/" ]
try this code this is worked for me. ``` <?php $input = preg_quote('o', '~'); // don't forget to quote input string! $data = array ( 'sayhello', 'hellostackoverflow', 'ahelloworld', 'foobarbas', 'apple' ); $result = preg_grep('~' . $input . '~', $data); echo count($result); // return the number of element ...
An array can just be flattened to a string for all intents and purposes. ``` $occurences = substr_count((string)$aa, 'o'); ``` $occurences will then be `4`.
37,404,164
I want to find the occurrence of a specific letter in array and also want to count the number of values in which it is present. for example: ``` <?php $aa= array ( 'sayhello', 'hellostackoverflow', 'ahelloworld', 'foobarbas' 'apple' ); ``` here if i search for 'o' then it should return 4 as 'o' is present...
2016/05/24
[ "https://Stackoverflow.com/questions/37404164", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4165262/" ]
try this code this is worked for me. ``` <?php $input = preg_quote('o', '~'); // don't forget to quote input string! $data = array ( 'sayhello', 'hellostackoverflow', 'ahelloworld', 'foobarbas', 'apple' ); $result = preg_grep('~' . $input . '~', $data); echo count($result); // return the number of element ...
You can use from this structure: ``` function array_seaech($array, $search) { $count = 0; foreach($array as $key => $value) { if(strpos($value, $search)) $count++; } return $count; } ``` in this structure we check all nodes of an array and ...
57,379,758
Is there a cross-vendor-compatible way to get the column metadata for an arbitrary SELECT statement in ODBC or JDBC without needing to execute the query? I am building an analytics tool as a vendor. I cannot assume that the user can create temp tables. Would throwing a TOP or LIMIT on the statement work? Would that gu...
2019/08/06
[ "https://Stackoverflow.com/questions/57379758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45051/" ]
[dcl.enum]/5: > > ... If the underlying type is fixed, the type of each enumerator prior to the closing brace is the underlying type ... > > > That is, each enumerator has type `int` until the closing brace is encountered. After that point, the enumerators have type `FileCopy` and you would not be able to bitwise...
According to the C++17 Standard (8.5.13 Bitwise inclusive OR operator) > > 1 The usual arithmetic conversions (8.3) are performed; the result is > the bitwise inclusive OR function of its operands. The operator > applies only to integral or unscoped enumeration operands. > > > And (10.2 Enumeration declarations...
12,279,926
In our JSF web application, we have an input field where the user can enter a numeric ID, which is then looked up by the app. To help the user, the lookup is bound to "onchange", thus it will be triggered as soon as the user tabs out of the field or clicks elsewhere. So, user enters "123", presses tab (or clicks), lo...
2012/09/05
[ "https://Stackoverflow.com/questions/12279926", "https://Stackoverflow.com", "https://Stackoverflow.com/users/43681/" ]
p:commandButton type="button" will just provide a push button.
Since you tagged this question also as a usability issue, I would advise against a button in the first place if the onchange already triggers the lookup. From a user's perspective it is confusing whether or not clicking the button is mandatory. After they have entered the field and skipped to the next, they see the lo...
43,702,317
I have a long text file, but here is the shortened version of tuples in my list. ``` [[(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)]] ``` Here is my code, using reverse() ``` for i in range(len(image_2dlist)): image_2dlist.reverse() print...
2017/04/30
[ "https://Stackoverflow.com/questions/43702317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7934431/" ]
``` L = [[(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)]] In [28]: list(itertools.chain.from_iterable([L[i:i+3][::-1] for i in range(0, len(L), 3)])) Out[28]: [[(6, 2, 9)], [(5, 3, 3)], [(2, 4, 4)], [(8, 10, 3)], [(4, 9, 10)], [(3, 5, ...
``` a=[[(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)]] '''Initialize the 2d list of dimention 3x3''' b = [[None for _ in range(3)] for _ in range(3)] k,j=0,0 '''convert a-1d list to b-2d list''' for i in range(3): for j in range(3): ...
43,702,317
I have a long text file, but here is the shortened version of tuples in my list. ``` [[(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)]] ``` Here is my code, using reverse() ``` for i in range(len(image_2dlist)): image_2dlist.reverse() print...
2017/04/30
[ "https://Stackoverflow.com/questions/43702317", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7934431/" ]
``` L = [[(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)]] In [28]: list(itertools.chain.from_iterable([L[i:i+3][::-1] for i in range(0, len(L), 3)])) Out[28]: [[(6, 2, 9)], [(5, 3, 3)], [(2, 4, 4)], [(8, 10, 3)], [(4, 9, 10)], [(3, 5, ...
``` ll = [ [(2, 4, 4)], [(5, 3, 3)], [(6, 2, 9)], [(3, 5, 7)], [(4, 9, 10)], [(8, 10, 3)], [(2, 5, 6)], [(6, 7, 2)], [(8, 5, 4)] ] ``` **Stage1** ``` start , end , step = 0 , 3, 3 while end <= len(ll): print('Start:',start,'End :',end,'Step:',step) print(ll[start:end]) start = start + ...
10,665,655
Where should i use an except block in order to log exceptions of a `QApplication`? This doesn't seem to work: ``` app = QtGui.QApplication(sys.argv) MainWindow = MainWindow() MainWindow.show() try: eventLoop = app.exec_() except Exception, e: log.exception(str(e)) ``` as the exception won't even reach that ...
2012/05/19
[ "https://Stackoverflow.com/questions/10665655", "https://Stackoverflow.com", "https://Stackoverflow.com/users/288280/" ]
Throwing exceptions from an event handler is not supported in Qt. You must reimplement QApplication::notify() and catch all exceptions there. Overwrite the function bool QApplication::notify(QObject \* receiver, QEvent \*event) so that it catches all thrown exceptions. You can implement like this. ``` virtual bool n...
I solved it by overriding the `excepthook`, as seen in the following answer: [Logging All Exceptions in a pyqt4 app](https://stackoverflow.com/questions/1015047/logging-all-exceptions-in-a-pyqt4-app)
2,379,108
A. Given the function $f(x)=(\cos(x), \sin(x)) , f:\mathbb{R} → \mathbb{R^2}$ , find: 1. $f^{-1}[(0, 1)] $, in this example $(0,1) \in \mathbb{R^2}$ is a point, not an interval. 2. $f^{-1}[X] $, where $X=\{(x,y) \in \mathbb{R^2}, x \geq 0\}$ B. $\mathbb{(N\_+)^{<\mathbb{N}}}$ is a set of all finite sequences with el...
2017/08/01
[ "https://math.stackexchange.com/questions/2379108", "https://math.stackexchange.com", "https://math.stackexchange.com/users/467303/" ]
> > The negation of $\varphi$ is $\lnot \varphi$, for every formula $\varphi$. > > > Thus, regarding your example, the negation of $∃x \ ∀n \ P$ is of course $\lnot ∃x \ ∀n \ P$. --- 1) We have to "move inside" the negation sign step-by-step following the rules: $¬∃$ is $∀¬$ and $¬∀$ is $∃¬$. Thus, for $¬∃x \ ∀...
The negation of $\bbox[lemonchiffon,0.5ex]{\neg \exists B\,\forall n\,P}$ is definitely $\bbox[lemonchiffon,0.5ex]{\exists B\, \forall n\,P}$.   (Well, unless your logic system disallows double negation.) The negation of $\bbox[lemonchiffon,0.5ex]{\exists B\, \forall n\,P}$ is $\bbox[lemonchiffon,0.5ex]{\forall B\,\ex...
2,379,108
A. Given the function $f(x)=(\cos(x), \sin(x)) , f:\mathbb{R} → \mathbb{R^2}$ , find: 1. $f^{-1}[(0, 1)] $, in this example $(0,1) \in \mathbb{R^2}$ is a point, not an interval. 2. $f^{-1}[X] $, where $X=\{(x,y) \in \mathbb{R^2}, x \geq 0\}$ B. $\mathbb{(N\_+)^{<\mathbb{N}}}$ is a set of all finite sequences with el...
2017/08/01
[ "https://math.stackexchange.com/questions/2379108", "https://math.stackexchange.com", "https://math.stackexchange.com/users/467303/" ]
The assertion is wrong (or maybe you misunderstood what they tried to do ...) The negation of $\lnot \exists B. \forall n. P$ is of course just $ \exists B. \forall n. P$, and *not* $ \exists B. \lnot \forall n. P$ In general, we have: **Quantifier Negation** Where $\varphi$ is any formula: $\neg \exists x \varphi...
The negation of $\bbox[lemonchiffon,0.5ex]{\neg \exists B\,\forall n\,P}$ is definitely $\bbox[lemonchiffon,0.5ex]{\exists B\, \forall n\,P}$.   (Well, unless your logic system disallows double negation.) The negation of $\bbox[lemonchiffon,0.5ex]{\exists B\, \forall n\,P}$ is $\bbox[lemonchiffon,0.5ex]{\forall B\,\ex...
54,356,621
For each same id, same date, and same first name, I would like to display the shortest last name through a group by or any other workaround: Here's the table: <https://imgur.com/LnJRqMZ> Here's the results I would like to see: <https://imgur.com/BSv1ibi> I was wondering if someone could show me how to do this with a...
2019/01/24
[ "https://Stackoverflow.com/questions/54356621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10964474/" ]
Each flowfile has *attributes*, which are pieces of metadata stored in key/value pairs in memory (available for rapid read/write). When any operation occurs, pieces of metadata get written by the NiFi framework, both to the *provenance* events related to the flowfile, and sometimes to the flowfile itself. For example, ...
So, I added an `ExecuteScript` processor with this code: ``` import org.apache.commons.io.IOUtils import java.nio.charset.StandardCharsets import java.time.LocalDateTime flowFile = session.get() if(!flowFile)return def text = '' // Cast a closure with an inputStream parameter to InputStreamCallback session.read(flowF...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
If you disable `display_errors` in `php.ini`, and later enable it in your PHP script using `ini_set()`, **it will only be enabled after the line containing that `ini_set()` call has been executed**. Parse errors occur **before the PHP script even starts** -- when the PHP file is parsed *(hence the "parse error" name)*...
Try `error_reporting(E_ALL);`. Or the [docs](http://www.php.net/manual/en/function.error-reporting.php)
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
If you disable `display_errors` in `php.ini`, and later enable it in your PHP script using `ini_set()`, **it will only be enabled after the line containing that `ini_set()` call has been executed**. Parse errors occur **before the PHP script even starts** -- when the PHP file is parsed *(hence the "parse error" name)*...
Aside from turning on `display_errors`, you can also watch error logs. Typically, running Ubuntu + apache, your error log is going to be in `/var/log/apache2/error_log`. To watch in real time what's happening, you run something like `tail -f /var/log/apache2/error_log`. This can sometimes be more straightforward than...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
If you disable `display_errors` in `php.ini`, and later enable it in your PHP script using `ini_set()`, **it will only be enabled after the line containing that `ini_set()` call has been executed**. Parse errors occur **before the PHP script even starts** -- when the PHP file is parsed *(hence the "parse error" name)*...
here I am **years** after this was answered, but I found a way around this. For the script I'm writing, I created a second script which includes the ini\_set() directives, followed by an include for the script I **really** am working on. To with, here is test\_run.php ``` <?php ini_set('display_errors', '1'); ini_s...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
If you disable `display_errors` in `php.ini`, and later enable it in your PHP script using `ini_set()`, **it will only be enabled after the line containing that `ini_set()` call has been executed**. Parse errors occur **before the PHP script even starts** -- when the PHP file is parsed *(hence the "parse error" name)*...
\*\*You must enable error displaying in the php.ini file \*\* I have added ( un-commented ) the following lines, and the parse errors are being displayed now. ``` error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED Development Value: E_ALL Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
Aside from turning on `display_errors`, you can also watch error logs. Typically, running Ubuntu + apache, your error log is going to be in `/var/log/apache2/error_log`. To watch in real time what's happening, you run something like `tail -f /var/log/apache2/error_log`. This can sometimes be more straightforward than...
Try `error_reporting(E_ALL);`. Or the [docs](http://www.php.net/manual/en/function.error-reporting.php)
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
here I am **years** after this was answered, but I found a way around this. For the script I'm writing, I created a second script which includes the ini\_set() directives, followed by an include for the script I **really** am working on. To with, here is test\_run.php ``` <?php ini_set('display_errors', '1'); ini_s...
Try `error_reporting(E_ALL);`. Or the [docs](http://www.php.net/manual/en/function.error-reporting.php)
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
\*\*You must enable error displaying in the php.ini file \*\* I have added ( un-commented ) the following lines, and the parse errors are being displayed now. ``` error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED Development Value: E_ALL Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT...
Try `error_reporting(E_ALL);`. Or the [docs](http://www.php.net/manual/en/function.error-reporting.php)
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
here I am **years** after this was answered, but I found a way around this. For the script I'm writing, I created a second script which includes the ini\_set() directives, followed by an include for the script I **really** am working on. To with, here is test\_run.php ``` <?php ini_set('display_errors', '1'); ini_s...
Aside from turning on `display_errors`, you can also watch error logs. Typically, running Ubuntu + apache, your error log is going to be in `/var/log/apache2/error_log`. To watch in real time what's happening, you run something like `tail -f /var/log/apache2/error_log`. This can sometimes be more straightforward than...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
Aside from turning on `display_errors`, you can also watch error logs. Typically, running Ubuntu + apache, your error log is going to be in `/var/log/apache2/error_log`. To watch in real time what's happening, you run something like `tail -f /var/log/apache2/error_log`. This can sometimes be more straightforward than...
\*\*You must enable error displaying in the php.ini file \*\* I have added ( un-commented ) the following lines, and the parse errors are being displayed now. ``` error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED Development Value: E_ALL Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT...
10,667,421
I'm running ubuntu 10.04 + nginx + php-fpm 5.4 If I set `display_errors = On` in php.ini all errors are printed. If Instead I set that to off and then use ini\_set('display\_errors, '1'); directly in the script they will show as well but not the parse errors, just a blank page. I tried to play with error\_reporting to...
2012/05/19
[ "https://Stackoverflow.com/questions/10667421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/418690/" ]
here I am **years** after this was answered, but I found a way around this. For the script I'm writing, I created a second script which includes the ini\_set() directives, followed by an include for the script I **really** am working on. To with, here is test\_run.php ``` <?php ini_set('display_errors', '1'); ini_s...
\*\*You must enable error displaying in the php.ini file \*\* I have added ( un-commented ) the following lines, and the parse errors are being displayed now. ``` error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED Development Value: E_ALL Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT...
57,768,010
I'm reading the [source code of ArrayList class](https://hg.openjdk.java.net/jdk/jdk/file/2172fd713350/src/java.base/share/classes/java/util/ArrayList.java) and I'm wondering about the method [`add(E e, Object[] elementData, int s)`](https://hg.openjdk.java.net/jdk/jdk/file/2172fd713350/src/java.base/share/classes/java...
2019/09/03
[ "https://Stackoverflow.com/questions/57768010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10778575/" ]
The "method bytecode size" is the number of [JVM instructions](https://en.wikipedia.org/wiki/Java_bytecode) that a method compiles to. Roughly speaking the shorter a method, the lower this number. The [C1-compiler](https://openjdk.java.net/groups/hotspot/docs/HotSpotGlossary.html) is one of the compiler in the HotSpot...
> > What is "method bytecode"? > > > It's the bytecode generated by the compiler for the method. > > Why should it be kept under 35? > > > The hotspot JVM can inline the code of methods when this code is smaller than 35 instructions. > > C1-compiled > > > Is a compiler in the JVM that translates byteco...
16,604,579
I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results. Joomla Smart Search removes any html tags and I want to prevent to do this extra fields
2013/05/17
[ "https://Stackoverflow.com/questions/16604579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2331589/" ]
I have found a solution, not absolutly like I wanted but it works. The solution shows the intro-text and all inside the "read more" of the article in the search results (images, links and everything you want). This solution was found here <http://forum.joomla.org/viewtopic.php?p=2324152> and says something like this:...
Smart search plugins say which fields should be indexed. You could replace some of the smart search plugins with ones of your own.
16,604,579
I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results. Joomla Smart Search removes any html tags and I want to prevent to do this extra fields
2013/05/17
[ "https://Stackoverflow.com/questions/16604579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2331589/" ]
in **www\plugins\finder\content** open **content.php** then search for **getListQuery** , at the end of **->select** list add **->select('a.images AS image');** save & close the file in www\components\com\_finder\views\search\tmpl open **default\_result.php** then search for **class="result-title** after the tag add t...
Smart search plugins say which fields should be indexed. You could replace some of the smart search plugins with ones of your own.
16,604,579
I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results. Joomla Smart Search removes any html tags and I want to prevent to do this extra fields
2013/05/17
[ "https://Stackoverflow.com/questions/16604579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2331589/" ]
Smart search plugins say which fields should be indexed. You could replace some of the smart search plugins with ones of your own.
actually there is a very easy solution. K2 saves the images based on the md5 hash of the id. **adding this:** ``` <div class="search-img"> <img src="<?php echo JURI::base().'media/k2/items/cache/'.md5("Image".$this->result->id).'_M.jpg'; ?>" /> </div> ``` to the html override of the default\_result.php will display...
16,604,579
I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results. Joomla Smart Search removes any html tags and I want to prevent to do this extra fields
2013/05/17
[ "https://Stackoverflow.com/questions/16604579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2331589/" ]
I have found a solution, not absolutly like I wanted but it works. The solution shows the intro-text and all inside the "read more" of the article in the search results (images, links and everything you want). This solution was found here <http://forum.joomla.org/viewtopic.php?p=2324152> and says something like this:...
actually there is a very easy solution. K2 saves the images based on the md5 hash of the id. **adding this:** ``` <div class="search-img"> <img src="<?php echo JURI::base().'media/k2/items/cache/'.md5("Image".$this->result->id).'_M.jpg'; ?>" /> </div> ``` to the html override of the default\_result.php will display...
16,604,579
I´m using Joomla Smart Search in my website and I´m want to show intro-image and some extrafields from the article in the search results. Joomla Smart Search removes any html tags and I want to prevent to do this extra fields
2013/05/17
[ "https://Stackoverflow.com/questions/16604579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2331589/" ]
in **www\plugins\finder\content** open **content.php** then search for **getListQuery** , at the end of **->select** list add **->select('a.images AS image');** save & close the file in www\components\com\_finder\views\search\tmpl open **default\_result.php** then search for **class="result-title** after the tag add t...
actually there is a very easy solution. K2 saves the images based on the md5 hash of the id. **adding this:** ``` <div class="search-img"> <img src="<?php echo JURI::base().'media/k2/items/cache/'.md5("Image".$this->result->id).'_M.jpg'; ?>" /> </div> ``` to the html override of the default\_result.php will display...
69,929,816
I've been trying to define a method that should store the largest of three int numbers in a variable and then return that value. Here's how I tried it: ``` public static int Max(int a, int b, int c) { int iResult = 0; a > b && a > c ? iResult = a : b > a && b > c ? iResult = b : iResult = c; return(iResu...
2021/11/11
[ "https://Stackoverflow.com/questions/69929816", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14629073/" ]
For anyone that finds this question - we figured it out after 3 days of trial and error. We ended up specifying the database folder for the `mongod` command since `brew services` wasn't working using mongo: `alias mongod="mongo --port 27017 --dbpath /opt/homebrew/var/mongodb”`. This solved the first issue and we are a...
**This worked for me** you just need to go to **/tmp** folder, and remove the **mongodb-27017.sock** file, then you can restart the mongo db in terminal again. When you remove the **mongodb-27017.sock** file, you need take care about the file owner and permission. If only root user can remove this file, then you need...
84,002
I'm trying to scan plain pdf maps containing color-coded geographic regions and convert them into undifferentiated (I don't actually need them to contain any attribute data) overlays. My workflow is to take one of my color-coded maps, select a few of the color-coded regions via Gimp's "Select by Color" tool, cut those ...
2014/01/23
[ "https://gis.stackexchange.com/questions/84002", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/20514/" ]
* OpenLayers.js: i would recommend you to download the lib and link it to your application server. This way you can have total control over its URL and content. * "insecure content" warnings: that happened to me too. In OpenLayers 2.13.1, when you instantiate an OpenLayers.Layer.OSM, it is configured by default for HTT...
The official OSM tile servers don't provide any access via SSL. They are shared public goods and [shall not be used](https://wiki.openstreetmap.org/wiki/Tile_usage_policy) by apps with heavy traffic. If you want to use them anyway, you must be ok with the "some content isn't encrypted" message at the browsers. If you ...
84,002
I'm trying to scan plain pdf maps containing color-coded geographic regions and convert them into undifferentiated (I don't actually need them to contain any attribute data) overlays. My workflow is to take one of my color-coded maps, select a few of the color-coded regions via Gimp's "Select by Color" tool, cut those ...
2014/01/23
[ "https://gis.stackexchange.com/questions/84002", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/20514/" ]
The official OSM tile servers don't provide any access via SSL. They are shared public goods and [shall not be used](https://wiki.openstreetmap.org/wiki/Tile_usage_policy) by apps with heavy traffic. If you want to use them anyway, you must be ok with the "some content isn't encrypted" message at the browsers. If you ...
You need override the forms `Widget`. Example: ``` from django.contrib import admin from django.contrib.gis.db import models from django.contrib.gis.forms.widgets import BaseGeometryWidget class CustomOpenLayersWidget(BaseGeometryWidget): template_name = 'gis/openlayers.html' def __init__(self, attrs=None): ...
84,002
I'm trying to scan plain pdf maps containing color-coded geographic regions and convert them into undifferentiated (I don't actually need them to contain any attribute data) overlays. My workflow is to take one of my color-coded maps, select a few of the color-coded regions via Gimp's "Select by Color" tool, cut those ...
2014/01/23
[ "https://gis.stackexchange.com/questions/84002", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/20514/" ]
* OpenLayers.js: i would recommend you to download the lib and link it to your application server. This way you can have total control over its URL and content. * "insecure content" warnings: that happened to me too. In OpenLayers 2.13.1, when you instantiate an OpenLayers.Layer.OSM, it is configured by default for HTT...
You need override the forms `Widget`. Example: ``` from django.contrib import admin from django.contrib.gis.db import models from django.contrib.gis.forms.widgets import BaseGeometryWidget class CustomOpenLayersWidget(BaseGeometryWidget): template_name = 'gis/openlayers.html' def __init__(self, attrs=None): ...
4,003,881
I have WPF 4 desktop-based application. In one of the windows of this application, I have `DataGrid` with data, bonded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate data, I have a delete button, that deletes selected row from `DataGrid` and call `SaveChanges()` method. Now I want to a...
2010/10/23
[ "https://Stackoverflow.com/questions/4003881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462347/" ]
Have you tried with the PreviewKeyDown event? Something like this ``` <DataGrid x:Name="dataGrid" PreviewKeyDown="dataGrid_PreviewKeyDown"> private void dataGrid_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { var dataGrid = (DataGrid)sender; // dataGrid.SelectedItem...
Or you could use the CommandManager, which only deletes the row if the row is selected (if a cell is editing, it backs up). Put this in your Window where the Datagrid is located. ``` CommandManager.RegisterClassInputBinding(typeof(DataGrid), new InputBinding(DataGrid.DeleteCommand, new KeyGesture(Key....
4,003,881
I have WPF 4 desktop-based application. In one of the windows of this application, I have `DataGrid` with data, bonded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate data, I have a delete button, that deletes selected row from `DataGrid` and call `SaveChanges()` method. Now I want to a...
2010/10/23
[ "https://Stackoverflow.com/questions/4003881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462347/" ]
Have you tried with the PreviewKeyDown event? Something like this ``` <DataGrid x:Name="dataGrid" PreviewKeyDown="dataGrid_PreviewKeyDown"> private void dataGrid_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { var dataGrid = (DataGrid)sender; // dataGrid.SelectedItem...
Same as Ben's but all one has to do is enable the property [CanUserDeleteRows](http://msdn.microsoft.com/en-us/library/vstudio/system.windows.controls.datagrid.canuserdeleterows%28v=vs.100%29.aspx) by setting it to `true` and the delete button will have delete active. As shown below in `XAML` for the `DataGrid`: ```...
4,003,881
I have WPF 4 desktop-based application. In one of the windows of this application, I have `DataGrid` with data, bonded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate data, I have a delete button, that deletes selected row from `DataGrid` and call `SaveChanges()` method. Now I want to a...
2010/10/23
[ "https://Stackoverflow.com/questions/4003881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462347/" ]
Have you tried with the PreviewKeyDown event? Something like this ``` <DataGrid x:Name="dataGrid" PreviewKeyDown="dataGrid_PreviewKeyDown"> private void dataGrid_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Delete) { var dataGrid = (DataGrid)sender; // dataGrid.SelectedItem...
I see you managed to go ahead, but maybe this will be useful for others seing this post in search results. You need to override the OnCanExecuteDelete method of the DataGrid, like: ``` public class MyDataGrid : DataGrid { protected override void OnCanExecuteDelete(CanExecuteRoutedEventArgs e) { foreach...
4,003,881
I have WPF 4 desktop-based application. In one of the windows of this application, I have `DataGrid` with data, bonded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate data, I have a delete button, that deletes selected row from `DataGrid` and call `SaveChanges()` method. Now I want to a...
2010/10/23
[ "https://Stackoverflow.com/questions/4003881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462347/" ]
Or you could use the CommandManager, which only deletes the row if the row is selected (if a cell is editing, it backs up). Put this in your Window where the Datagrid is located. ``` CommandManager.RegisterClassInputBinding(typeof(DataGrid), new InputBinding(DataGrid.DeleteCommand, new KeyGesture(Key....
I see you managed to go ahead, but maybe this will be useful for others seing this post in search results. You need to override the OnCanExecuteDelete method of the DataGrid, like: ``` public class MyDataGrid : DataGrid { protected override void OnCanExecuteDelete(CanExecuteRoutedEventArgs e) { foreach...
4,003,881
I have WPF 4 desktop-based application. In one of the windows of this application, I have `DataGrid` with data, bonded with SQL Server database (via ADO.NET Entity Framework). In order to manipulate data, I have a delete button, that deletes selected row from `DataGrid` and call `SaveChanges()` method. Now I want to a...
2010/10/23
[ "https://Stackoverflow.com/questions/4003881", "https://Stackoverflow.com", "https://Stackoverflow.com/users/462347/" ]
Same as Ben's but all one has to do is enable the property [CanUserDeleteRows](http://msdn.microsoft.com/en-us/library/vstudio/system.windows.controls.datagrid.canuserdeleterows%28v=vs.100%29.aspx) by setting it to `true` and the delete button will have delete active. As shown below in `XAML` for the `DataGrid`: ```...
I see you managed to go ahead, but maybe this will be useful for others seing this post in search results. You need to override the OnCanExecuteDelete method of the DataGrid, like: ``` public class MyDataGrid : DataGrid { protected override void OnCanExecuteDelete(CanExecuteRoutedEventArgs e) { foreach...
57,374,109
I am using Volley image request inside recyclerview adapter. Request appears to work fine until a fast scroll is done, whenever I scroll the recyclerview fast up or down, the app crashes with following error : ``` java.lang.OutOfMemoryError: Could not allocate JNI Env: Failed anonymous mmap(0x0, 8192, 0x3, 0x22, -1, ...
2019/08/06
[ "https://Stackoverflow.com/questions/57374109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9239449/" ]
Your recycler view will fire your adapter's `onBindViewHolder` every time an element is supposed to be displayed that was not bound to a view before (or that was un-bound). When you scroll fast, binds and unbinds will happen fast. Each bind generates an HTTP request, which is a relatively expensive IO operation that ...
@fjc pointed out correct the HTTP request is resource intensive. If you look at your `populateViews` function's first line ``` val requestQueue = Volley.newRequestQueue(context) ``` This is the main reason of OOM. You are creating multiple request queue for each image request which is therefore occupying all the re...
820,769
How would you make a button in cocoa when clicked open a web page?
2009/05/04
[ "https://Stackoverflow.com/questions/820769", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92714/" ]
Just like what Chuck said, look up [this](http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace%5FClass/Reference/Reference.html#//apple%5Fref/occ/instm/NSWorkspace/openURL:). For example, if I wanted to link to Google.com, You would do the following: ``` - (IBAction)goToLink:(id)...
Assuming you mean opening the page in the user's default browser (not in a web view inside your app), see [-[NSWorkspace openURL:]](http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWorkspace/openURL:)
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var $el = $('a[href*="/HelloWorld/default.aspx"]'); $el.attr("href", $el.attr("href")+ "?template=PW"); } }); ```
Use $.attr() to edit an attribute. $.append() is used to insert an html child node inside your element. ``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var href = '/HelloWorld/default.aspx'; $('a[href*="' + href + '"]').attr(...
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var $el = $('a[href*="/HelloWorld/default.aspx"]'); $el.attr("href", $el.attr("href")+ "?template=PW"); } }); ```
Replace ``` $('a[href*="/HelloWorld/default.aspx"]').append("href",$("?template=PW")) ``` With ``` $.each( $('a[href*="/HelloWorld/default.aspx"]'), function(index, value) { $(value).attr('href', $(value).attr('href') + '?template=PW'); } ); ``` That will get you started, but you should also c...
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var $el = $('a[href*="/HelloWorld/default.aspx"]'); $el.attr("href", $el.attr("href")+ "?template=PW"); } }); ```
Have you consider using [PURL](https://github.com/allmarkedup/purl)? With PURL I was able to do this: ``` var url = "http://localhost/some/url?item1=one&item2=two"; if ($.url(url).attr('query')) { url = url + '&newItem=new'; } else { url = url + '?newItem=new'; } ```
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var $el = $('a[href*="/HelloWorld/default.aspx"]'); $el.attr("href", $el.attr("href")+ "?template=PW"); } }); ```
This would definitely solve your problem as it did mine. ``` <script type="text/javascript"> var querystring = 'MyString'; // Replace this $('a').each(function(){ var href = $(this).attr('href'); href += (href.match(/\?/) ? '&' : '?') + querystring; $(this).attr('href', href); }); <...
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
Use $.attr() to edit an attribute. $.append() is used to insert an html child node inside your element. ``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var href = '/HelloWorld/default.aspx'; $('a[href*="' + href + '"]').attr(...
Replace ``` $('a[href*="/HelloWorld/default.aspx"]').append("href",$("?template=PW")) ``` With ``` $.each( $('a[href*="/HelloWorld/default.aspx"]'), function(index, value) { $(value).attr('href', $(value).attr('href') + '?template=PW'); } ); ``` That will get you started, but you should also c...
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
Use $.attr() to edit an attribute. $.append() is used to insert an html child node inside your element. ``` $(document).ready(function(){ if (document.location.href.indexOf('/MyWebsite/Example.aspx') > 0) { var href = '/HelloWorld/default.aspx'; $('a[href*="' + href + '"]').attr(...
Have you consider using [PURL](https://github.com/allmarkedup/purl)? With PURL I was able to do this: ``` var url = "http://localhost/some/url?item1=one&item2=two"; if ($.url(url).attr('query')) { url = url + '&newItem=new'; } else { url = url + '?newItem=new'; } ```
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
This would definitely solve your problem as it did mine. ``` <script type="text/javascript"> var querystring = 'MyString'; // Replace this $('a').each(function(){ var href = $(this).attr('href'); href += (href.match(/\?/) ? '&' : '?') + querystring; $(this).attr('href', href); }); <...
Replace ``` $('a[href*="/HelloWorld/default.aspx"]').append("href",$("?template=PW")) ``` With ``` $.each( $('a[href*="/HelloWorld/default.aspx"]'), function(index, value) { $(value).attr('href', $(value).attr('href') + '?template=PW'); } ); ``` That will get you started, but you should also c...
16,408,695
I keep getting TypeError: 'float' object is not subscriptable wondering why ``` from math import log class Logarithm(object): def __init__(self, base = 0, number= 0): self.base = float(base) self.number = float(number) the_logarithm = log(self.base[self.number]) def __str__(self): ...
2013/05/06
[ "https://Stackoverflow.com/questions/16408695", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2356379/" ]
This would definitely solve your problem as it did mine. ``` <script type="text/javascript"> var querystring = 'MyString'; // Replace this $('a').each(function(){ var href = $(this).attr('href'); href += (href.match(/\?/) ? '&' : '?') + querystring; $(this).attr('href', href); }); <...
Have you consider using [PURL](https://github.com/allmarkedup/purl)? With PURL I was able to do this: ``` var url = "http://localhost/some/url?item1=one&item2=two"; if ($.url(url).attr('query')) { url = url + '&newItem=new'; } else { url = url + '?newItem=new'; } ```
32,878,227
Hoping you can point out what I'm doing wrong. I have a widget area in my sidebar which is only to display for a section of my site. ``` if(is_page(199) || $post->post_parent == '199') { dynamic_sidebar( 'widget-area' ); } ``` What Im getting is the actual page and its children, This is good though I changed the str...
2015/10/01
[ "https://Stackoverflow.com/questions/32878227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1423063/" ]
This should help <https://codex.wordpress.org/Function_Reference/get_post_ancestors> Kinda bad practice to use post ID... But that's another story :)
``` $ancestors = get_post_ancestors( $post ); if ( is_page( 199 ) || in_array( '199', $ancestors ) ) { echo "This is My Page or one of its descendants"; } ```
11,354,535
Suppose that I compiled a dynamic library (Windows DLL and/or Linux shared object file, .so) in debug mode for use by a client application that links to it dynamically. My source code is available to the client application developer. I need some clarification regarding the following debugging scenario. I've always und...
2012/07/06
[ "https://Stackoverflow.com/questions/11354535", "https://Stackoverflow.com", "https://Stackoverflow.com/users/545591/" ]
I only ask you to read more about this, and just so you know, I tried to do this one and I achieved a good result but I halted that project because of my new job. Anyway, you can look into some game engines written in javascript for starters, here is the list of the well known game engines you might find interesting: ...
I checked your reference game out, and understand what you mean by "2.5D". From my understanding, the best way to tackle this problem is to create a pseudo third dimension by transforming the x,y coordinates of objects. You would have a function that does the transformation for you, and here is my best guess of an exam...
23,723,307
Hy, I have in the home of my drupal site an image that i want cache, but if write this in the htaccess: ``` ## EXPIRES CACHING ## <IfModule mod_expires.c> ExpiresByType image/png "access 1 year" </IfModule> ## EXPIRES CACHING ## ``` it will be cache all files (.png)... I want cache only one image.png; so ...
2014/05/18
[ "https://Stackoverflow.com/questions/23723307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3162975/" ]
You can't add "lines" to a JScrollPane, nor should you want to. Instead you add lines to whatever component the JScrollPane holds, a very important component, and something you never tell us about, but probably should. So take your pick. If it's a JList, then add a new line to the JList's model via the `addElement(......
You could try: ``` map.addText("The time is...\n"); map.addText("Random Text"); ```
948,241
I am quite content with using Windows 7 on my desktop PC, and do not wish to install Windows 10 at this time. To ensure that Windows 10 does not install, what measures can I immediately take (I note there is a white Windows icon in the system tray) or look out for (in terms of Windows Updates) to prevent it from being...
2015/07/31
[ "https://superuser.com/questions/948241", "https://superuser.com", "https://superuser.com/users/176033/" ]
The simplest way to prevent this is just to not reserve your upgrade. If `GetWindowsX` doesn't reserve Windows 10, it won't instruct Windows Update that there is an update titled `Install Windows 10 <version>`. Therefore, if you don't reserve, you won't get the upgrade through Windows Update. **EDIT:** If you've reser...
You can also just go into your Windows Update option in Control Panel and select the "Check for updates but let me choose whether to download and install them" option.
2,897,414
I am doing `connection string encryption`. we use our own `encryption key` with `AES` algorithm to do this. during the process, we need to convert string to byte array and then convert byte array back to string. I found the `encoding` play an important role on those conversions. So I need to know the encoding C# is u...
2010/05/24
[ "https://Stackoverflow.com/questions/2897414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117039/" ]
If you're looking to store an encrypted string in a config (or other plain text) file, you're better off storing the encrypted bytes as a base64-encoded string. ``` byte[] encrypted = // encrypt your data string encryptedString = Convert.ToBase64String(encrypted); ``` Likewise: ``` string encryptedString = // read...
The result of encryption is likely to be not representable purely in valid code-points for XML (e.g. a null, 0, byte is invaid in XML)—and this is independent of encoding. Therefore the answer is to base64 encode your byte arrarys, and store the resulting string and a string. And let the configuration support in .NET (...
2,897,414
I am doing `connection string encryption`. we use our own `encryption key` with `AES` algorithm to do this. during the process, we need to convert string to byte array and then convert byte array back to string. I found the `encoding` play an important role on those conversions. So I need to know the encoding C# is u...
2010/05/24
[ "https://Stackoverflow.com/questions/2897414", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117039/" ]
Just in case if you don't know, but .NET have built-in support for [Encrypting Configuration Information Using Protected Configuration](http://msdn.microsoft.com/en-us/library/53tyfkaw.aspx). The encryption will be transparent for the application but operation system will guarantee that only accounts allowed to deciphe...
The result of encryption is likely to be not representable purely in valid code-points for XML (e.g. a null, 0, byte is invaid in XML)—and this is independent of encoding. Therefore the answer is to base64 encode your byte arrarys, and store the resulting string and a string. And let the configuration support in .NET (...
15,307
If we are able to create a fusion reactor so there is a net gain in energy how can we turn the heat into electricity. I know how it is done normally for fission, steam, but how could this be adapted for a fusion reactor where all of the heat is confined? Are there any concepts for the stage after fusion becomes net p...
2017/05/14
[ "https://engineering.stackexchange.com/questions/15307", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/10361/" ]
This is an excellent question, and one that has not yet been fully answered by people working in this area of research. Let's look at some of the bigger projects and see what their proposals are: ITER, the tokamak (giant doughnut) being built in France is supposed to be the first reactor to ever beat the break even po...
Thermal energy is, in part, obtained or collected in the breeder blanket concept. Here [neutrons with high energy are used to produce heat and breed valuable tritium](https://www.researchgate.net/publication/263201067_A_Thermal_Discrete_Element_Analysis_of_EU_Solid_Breeder_Blanket_subjected_to_Neutron_Irradiation) by i...
34,227,716
> > We have File like Zip, txt Files in Windows SFTP Server and we use Informatica for our ETL Jobs , but our concern is the vendors who drop Files in SFTP Server they drop files in random times , and the files are of different sizes so How can we detect a File transfer is complete or Not?? > > >
2015/12/11
[ "https://Stackoverflow.com/questions/34227716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3944755/" ]
We need some more context to give you a straight answer. Both methods might be called multiple times depending on what the user is doing. I suggest defaulting your object instances as null, and inside `onCreate()` and/or `onResume()`, initialize it only if it is null. ``` if(objectInstance == null) { objectInstan...
You should not re instantiate an object that you already have unless you have a reason for it! recreating objects just gets more memory and produces more garbage for the GC that is bad for efficiency! So initialize needed objects in `onCreate()`
34,227,716
> > We have File like Zip, txt Files in Windows SFTP Server and we use Informatica for our ETL Jobs , but our concern is the vendors who drop Files in SFTP Server they drop files in random times , and the files are of different sizes so How can we detect a File transfer is complete or Not?? > > >
2015/12/11
[ "https://Stackoverflow.com/questions/34227716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3944755/" ]
We need some more context to give you a straight answer. Both methods might be called multiple times depending on what the user is doing. I suggest defaulting your object instances as null, and inside `onCreate()` and/or `onResume()`, initialize it only if it is null. ``` if(objectInstance == null) { objectInstan...
Like Hojjat points out you should not re instantiate objects, you must create again the objects if they are not currently present, ``` if(myObject == null){ myObject = new ObjectFoo(); } ``` but if you are using a service maybe that will require the initialization: ``` class A extends Activity{ public Servi...
31,588,018
I am getting the following error for this line of code... ``` Warning: mysqli::query() expects parameter 1 to be string, object given ``` for ``` if ($result2 = $con->query($stmt2)) { ``` and I cannot figure it out? My connections are correct, as is the prepared statement above it. I have tried moving stu...
2015/07/23
[ "https://Stackoverflow.com/questions/31588018", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4864334/" ]
ActiveWindow.ViewType is only applicable in design mode. When you are running a slide show there are no active windows and it will throw an error thats why you are not hitting the message box calls.
Are you unloading the form at the end of the OKbut sub with this? ``` Unload Me ``` Don't hide it as this will definitely cause problems. You may also find the user experience will be a lot better if you use a shape rather than an ActiveX control on the slide to trigger the form. Microsoft will show lots of verbose...
47,220,468
I have reinstalled GitLab and forgot to back up the gitlab-secrets.json file. Now I cannot enable 2FA (was disabled) and I'm seeing this error in the production.log file: ``` Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.3ms) OpenSSL::Cipher::CipherError (bad decrypt): app/controllers/profiles/two_f...
2017/11/10
[ "https://Stackoverflow.com/questions/47220468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4921968/" ]
You can use this `awk`comand: ``` awk 'NR==1{$(NF+1)="new column"} NR>1{$(NF+1)="99"}1' file ```
``` $ awk '{s=(NR==1)?"new_column":"99";$0=$0 OFS s}1' file name measurement gender duration new_column a 1 m 55 99 b 1 f 54 99 c 2 m 53 99 ```
47,220,468
I have reinstalled GitLab and forgot to back up the gitlab-secrets.json file. Now I cannot enable 2FA (was disabled) and I'm seeing this error in the production.log file: ``` Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.3ms) OpenSSL::Cipher::CipherError (bad decrypt): app/controllers/profiles/two_f...
2017/11/10
[ "https://Stackoverflow.com/questions/47220468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4921968/" ]
``` $ awk '{s=(NR==1)?"new_column":"99";$0=$0 OFS s}1' file name measurement gender duration new_column a 1 m 55 99 b 1 f 54 99 c 2 m 53 99 ```
You could golf it like this (assuming you have no empty lines): ``` awk '$++NF=NR==1?"new_column":99' infile ``` Output: ``` name measurement gender duration new_column a 1 m 55 99 b 1 f 54 99 c 2 m 53 99 ```
47,220,468
I have reinstalled GitLab and forgot to back up the gitlab-secrets.json file. Now I cannot enable 2FA (was disabled) and I'm seeing this error in the production.log file: ``` Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.3ms) OpenSSL::Cipher::CipherError (bad decrypt): app/controllers/profiles/two_f...
2017/11/10
[ "https://Stackoverflow.com/questions/47220468", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4921968/" ]
You can use this `awk`comand: ``` awk 'NR==1{$(NF+1)="new column"} NR>1{$(NF+1)="99"}1' file ```
You could golf it like this (assuming you have no empty lines): ``` awk '$++NF=NR==1?"new_column":99' infile ``` Output: ``` name measurement gender duration new_column a 1 m 55 99 b 1 f 54 99 c 2 m 53 99 ```
8,820,160
I have a table that I would like to partition in MYSQL 5.5. That I know how to do, but what I also need is to specify a disk for each of my partitions. For example, I would like to put: * P01 in c:\ * P02 in d:\ * ....... and so on. I'm currently using this statement: (which doesn't fulfil my requirements, but work...
2012/01/11
[ "https://Stackoverflow.com/questions/8820160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/963602/" ]
``` ... PARTITION p0 VALUES LESS THAN (1288562400000) DATA DIRECTORY ="C:\\foo\\bar" INDEX DIRECTORY ="C:\\foo\\baz", ... ``` Mind that this needs NO\_DIR\_IN\_CREATE to be off As user963602 points out, this doesn't directly work on windows due to a MySQL bug, see my comment for a workaround
InnoDB SE won't support the specifying the disk/mount :(
67,162,214
This is not a duplicate. I'm trying to print some output to a file in a subdirectory (in this case to a file /stuff/output\_1.txt) but it doesn't seem to create any new file. The code executes but no file is created, nor any subdirectory called /stuff. Here is my code: ``` #include <iostream> #include <sstream> #inclu...
2021/04/19
[ "https://Stackoverflow.com/questions/67162214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15112823/" ]
Use nested `.Where()` methods: ``` $RecycleBinPaths.Where({ # Save path to separate variable $path = $_ # Now test if _any_ string in the list of wildcards match, and then apply -not - making it resolve to true only if _none_ of the wildcards match the path -not $ExcludeRecycleBinsPathWildCards.Where({ $path -...
Another way of looping through the items and adding to another array. ``` $RecycleBinPaths = @('C:\$Recycle.Bin','D:\$RECYCLE.BIN','E:\$RECYCLE.BIN','F:\$RECYCLE.BIN','L:\$RECYCLE.BIN','M:\$RECYCLE.BIN','S:\$RECYCLE.BIN','T:\$RECYCLE.BIN') $ExcludeRecycleBinsPathWildCards = @('C:\','F:\') $SelectedRecycleBinPaths = ...
5,741,344
Having a issue trying to make a bash script that will read ip address and usernames from a file that mount a connection to that share on windows and then copy ano file types into a new folder called the users name. At the moment it doesn't quite work, it makes hundreds of folders called \*.ano if it can not find the w...
2011/04/21
[ "https://Stackoverflow.com/questions/5741344", "https://Stackoverflow.com", "https://Stackoverflow.com/users/718534/" ]
I was facing a similar problem and found that, while left-click always select the item pointed to, you can use Ctrl + left-click to toggle selection in a list view. This is the default behavior.
You can write a wpf behaviour. Something like: ``` public class ListViewBehaviour { /// <summary> /// Enfoca automaticament el item sel·leccionat /// </summary> public static readonly DependencyProperty AutoUnselectItemProperty = DependencyProperty.RegisterAttached( "AutoUnselect", ...
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I don't think formatted string literals allowing nesting (by nesting, I take it to mean `f'{f".."}'`) is a result of careful consideration of possible use cases, I'm more convinced it's just allowed in order for them to conform with their specification. The specification states that they [support full Python *expressi...
I guess this is to pass formatting parameters in the same line and thus simplify *f-strings* usage. For example: ``` >>> import decimal >>> width = 10 >>> precision = 4 >>> value = decimal.Decimal("12.34567") >>> f"result: {value:{width}.{precision}}" 'result: 12.35' ``` Of course, it allows programmers to wri...
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I don't think formatted string literals allowing nesting (by nesting, I take it to mean `f'{f".."}'`) is a result of careful consideration of possible use cases, I'm more convinced it's just allowed in order for them to conform with their specification. The specification states that they [support full Python *expressi...
Any basic use case is where you need a string to completely describe the object you want to put inside the f-string braces `{}`. For example, you need strings to index dictionaries. So, I ended up using it in an ML project with code like: ``` scores = dict() scores[f'{task}_accuracy'] = 100. * n_valid / n_total print...
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
Any basic use case is where you need a string to completely describe the object you want to put inside the f-string braces `{}`. For example, you need strings to index dictionaries. So, I ended up using it in an ML project with code like: ``` scores = dict() scores[f'{task}_accuracy'] = 100. * n_valid / n_total print...
The following nested f-string one-liner does a great job in constructing a command argument string `cmd_args = f"""{' '.join([f'--{key} {value}' for key, value in kwargs.items()])}"""` where the input `{'a': 10, 'b': 20, 'c': 30, ....}` gets elegantly converted to `--a 10 --b 20 --c 30 ...` `
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I've actually just come across something similar (i think) and thought i'd share. My specific case is a big dirty sql statement where i need to conditionally have some very different values but some fstrings are the same (and also used in other places). Here is quick example of what i mean. The cols i'm selecting ar...
I found nesting to be useful when doing ternaries. Your opinion will vary on readability, but I found this one-liner very useful. ``` logger.info(f"No program name in subgroups file. Using {f'{prg_num} {prg_orig_date}' if not prg_name else prg_name}") ``` As such, my tests for nesting would be: * Is the value reuse...
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
A simple example of when it's useful, together with an example of implementation: sometimes the formatting is also a variable. ``` num = 3.1415 fmt = ".2f" print(f"number is {num:{fmt}}") ```
You could use it for dynamicism. For instance, say you have a variable set to the name of some function: ``` func = 'my_func' ``` Then you could write: ``` f"{f'{func}'()}" ``` which would be equivalent to: ``` '{}'.format(locals()[func]()) ``` or, equivalently: ``` '{}'.format(my_func()) ```
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I guess this is to pass formatting parameters in the same line and thus simplify *f-strings* usage. For example: ``` >>> import decimal >>> width = 10 >>> precision = 4 >>> value = decimal.Decimal("12.34567") >>> f"result: {value:{width}.{precision}}" 'result: 12.35' ``` Of course, it allows programmers to wri...
You could use it for dynamicism. For instance, say you have a variable set to the name of some function: ``` func = 'my_func' ``` Then you could write: ``` f"{f'{func}'()}" ``` which would be equivalent to: ``` '{}'.format(locals()[func]()) ``` or, equivalently: ``` '{}'.format(my_func()) ```
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I found nesting to be useful when doing ternaries. Your opinion will vary on readability, but I found this one-liner very useful. ``` logger.info(f"No program name in subgroups file. Using {f'{prg_num} {prg_orig_date}' if not prg_name else prg_name}") ``` As such, my tests for nesting would be: * Is the value reuse...
If some fancy formatting is needed, such nesting could be, perhaps, useful. ``` for n in range(10, 1000, 100): print(f"{f'n = {n:<3}':<15}| {f'|{n:>5}**2 = {n**2:<7_}'} |") ```
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I don't think formatted string literals allowing nesting (by nesting, I take it to mean `f'{f".."}'`) is a result of careful consideration of possible use cases, I'm more convinced it's just allowed in order for them to conform with their specification. The specification states that they [support full Python *expressi...
If some fancy formatting is needed, such nesting could be, perhaps, useful. ``` for n in range(10, 1000, 100): print(f"{f'n = {n:<3}':<15}| {f'|{n:>5}**2 = {n**2:<7_}'} |") ```
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
I guess this is to pass formatting parameters in the same line and thus simplify *f-strings* usage. For example: ``` >>> import decimal >>> width = 10 >>> precision = 4 >>> value = decimal.Decimal("12.34567") >>> f"result: {value:{width}.{precision}}" 'result: 12.35' ``` Of course, it allows programmers to wri...
I've actually just come across something similar (i think) and thought i'd share. My specific case is a big dirty sql statement where i need to conditionally have some very different values but some fstrings are the same (and also used in other places). Here is quick example of what i mean. The cols i'm selecting ar...
41,215,379
I have the following code, worked up from my earlier question which was answered Tim Williams. However, a few minutes after it was working I figured out something else that was a new requirement and wasn't posed with the original question. Given the code below and the following HTML structure how can I modify the code ...
2016/12/19
[ "https://Stackoverflow.com/questions/41215379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5078821/" ]
The following nested f-string one-liner does a great job in constructing a command argument string `cmd_args = f"""{' '.join([f'--{key} {value}' for key, value in kwargs.items()])}"""` where the input `{'a': 10, 'b': 20, 'c': 30, ....}` gets elegantly converted to `--a 10 --b 20 --c 30 ...` `
You could use it for dynamicism. For instance, say you have a variable set to the name of some function: ``` func = 'my_func' ``` Then you could write: ``` f"{f'{func}'()}" ``` which would be equivalent to: ``` '{}'.format(locals()[func]()) ``` or, equivalently: ``` '{}'.format(my_func()) ```
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I found a way to consistently reproduce this. First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator: `~/Library/Application Support/iPhone Simulator/[6.0 and above]/Library` Then look inside of your `Caches/GeoServices/Resources` ...
![Shows User Location](https://i.stack.imgur.com/dcYSn.jpg) This is old, but for anyone who comes across this thread like I did, it may also be that the option "Shows User Location" on the map view object was not checked. This was my issue and not about cache above, although I got the exact same error in console. I did...
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
mmm...I had de same problem...I think the problem could be the 6.0 Simulator; if I set the Deployment Target to 5.1 and run the app using the 5.1 Simulator and uncheck the Autolayout check-box, I didn't have any problem, but if I use the 6.0 Simulator when I run the app, the map doesn't appear, and the message "Couldn'...
I just turned on my wireless on device and this warning disappear and my map comes visible.
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I found a way to consistently reproduce this. First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator: `~/Library/Application Support/iPhone Simulator/[6.0 and above]/Library` Then look inside of your `Caches/GeoServices/Resources` ...
I just turned on my wireless on device and this warning disappear and my map comes visible.
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
![Shows User Location](https://i.stack.imgur.com/dcYSn.jpg) This is old, but for anyone who comes across this thread like I did, it may also be that the option "Shows User Location" on the map view object was not checked. This was my issue and not about cache above, although I got the exact same error in console. I did...
If your iOS simulator's GPS setting is none, you will get this waring. Just change iOS simulator's GPS setting to "Apple Stores" or other, it will gone.
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I just turned on my wireless on device and this warning disappear and my map comes visible.
If your iOS simulator's GPS setting is none, you will get this waring. Just change iOS simulator's GPS setting to "Apple Stores" or other, it will gone.
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I found a way to consistently reproduce this. First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator: `~/Library/Application Support/iPhone Simulator/[6.0 and above]/Library` Then look inside of your `Caches/GeoServices/Resources` ...
If your iOS simulator's GPS setting is none, you will get this waring. Just change iOS simulator's GPS setting to "Apple Stores" or other, it will gone.
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I found a way to consistently reproduce this. First, the culprit is a set of files in the Cache folder for your simulator. Go to your Application Support folder for the iPhone Simulator: `~/Library/Application Support/iPhone Simulator/[6.0 and above]/Library` Then look inside of your `Caches/GeoServices/Resources` ...
mmm...I had de same problem...I think the problem could be the 6.0 Simulator; if I set the Deployment Target to 5.1 and run the app using the 5.1 Simulator and uncheck the Autolayout check-box, I didn't have any problem, but if I use the 6.0 Simulator when I run the app, the map doesn't appear, and the message "Couldn'...
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I solved by adjusting the MKMapView in my view controller to iPhone 5 new size, now I got no warning message.
Please set your GPS settings active otherwise this error may occur again. Also,it is advisable to set the frame for the iPhone 5 .
12,626,536
Running my app with the iOS6 simulator I am getting the following printed in the XCode console prior to `viewDidLoad` getting called: > > Couldn't find default.styleproto in framework > > > Has anyone else encountered this, and if so have you found a reason why? My guess is that it has to do with the iOS6 Apple M...
2012/09/27
[ "https://Stackoverflow.com/questions/12626536", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1344738/" ]
I solved by adjusting the MKMapView in my view controller to iPhone 5 new size, now I got no warning message.
I just turned on my wireless on device and this warning disappear and my map comes visible.