language
stringclasses
1 value
query
stringlengths
16
203k
source
stringclasses
20 values
metadata
stringlengths
14
99
source_name
stringclasses
20 values
stratify_key
class label
74 classes
en
We're trying to figure out how to drag an item from a LibraryStack container onto a ScatterView, like how the photo viewer sample applications work. Currently, the item just flies back into the LibraryStack after we drag it out. We can drag and drop items into other LibraryStacks or LibraryBars. Here's a sample of what we're trying: ``` <s:SurfaceWindow x:Class="Idia_seminar.SurfaceWindow1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="http://schemas.microsoft.com/surface/2008" Title="Idia_seminar" > <s:SurfaceWindow.Resources> <ImageBrush x:Key="WindowBackground" Stretch="None" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg"/> </s:SurfaceWindow.Resources> <Grid Background="{StaticResource WindowBackground}" > <s:ScatterView Name="scatterView1" AllowDrop="True"> <s:SurfaceButton Name="surfaceButton1">Button</s:SurfaceButton> <s:LibraryStack AllowDrop="True"> <s:LibraryStackItem Content="hello"></s:LibraryStackItem> </s:LibraryStack> </s:ScatterView> </Grid> </s:SurfaceWindow> ``` Thanks!
ArmelR/stack-exchange-instruction
{ "qid": 1632909 }
stackexchange
109stackexchange_5
en
Where do I add a file do hold custom configuration variables for my wordpress website ? e.g. ``` $config['forbidden_users'] = array("admin", "host"); ```
ArmelR/stack-exchange-instruction
{ "qid": 10812716 }
stackexchange
107stackexchange_3
en
when and why did we start daylight savings?
sentence-transformers/gooaq
{ "index": 2269519 }
gooaq
46gooaq_1
en
In the code sample below I want to make it so that `deductions` would equal one of the 4 values depending on the input the user enters (look at the if-else statement). Is this possible? ``` deductions1 = 0.12 + 0.04 + 0.01 + 0.06 deductions2 = 0.20 + 0.07 + 0.03 + 0.06 deductions3 = 0.30 + 0.09 + 0.05 + 0.06 deductions4 = 0.38 + 0.11 + 0.07 + 0.06 deductions = monthly_salary = hours_worked * hourly_pay if monthly_salary < 4000: deduction_rate = deductions1 elif monthly_salary >= 4000 and monthly_salary < 8000: deduction_rate = deductions2 elif monthly_salary >= 8000 and monthly_salary < 16000: deduction_rate = deductions3 else: deductions = deductions4 net_salary = monthly_salary - (deductions * monthly_salary) ```
ArmelR/stack-exchange-instruction
{ "qid": 49550043 }
stackexchange
108stackexchange_4
en
I have a batch file with lot of stuff. I there is one Alert Window with info for user. On Windows Pro I'm using Msg command for it and it works fine. On Windows Home there is no Msg, so I got the idea to use PowerShell instead: ``` [System.Windows.Forms.MessageBox]::Show("my text") ``` which works fine in PowerShell. -However, when I try to use it in batch or execute it directly in Cmd, I only get the text: ``` C:\Windows\System32>powershell {[System.Windows.Forms.MessageBox]::Show("\""my text"\"")} [System.Windows.Forms.MessageBox]::Show("my text") ``` Or I get errors: ``` C:\Windows\System32>powershell -command [System.Windows.Forms.MessageBox]::Show("my text") At line:1 char:41 + [System.Windows.Forms.MessageBox]::Show(my text) + ~ Missing ')' in method call. At line:1 char:41 + [System.Windows.Forms.MessageBox]::Show(my text) + ~~ Unexpected token 'my' in expression or statement. At line:1 char:48 + [System.Windows.Forms.MessageBox]::Show(my text) + ~ Unexpected token ')' in expression or statement. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall ``` or ``` C:\Windows\System32>powershell -command "& {[System.Windows.Forms.MessageBox]::Show('my text')}" Unable to find type [System.Windows.Forms.MessageBox]. At line:1 char:4 + & {[System.Windows.Forms.MessageBox]::Show('my text')} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Windows.Forms.MessageBox:TypeName) [], RuntimeException + FullyQualifiedErrorId : TypeNotFound ``` What should I do to get it to work? (without rewriting the whole script to PowerShell, that is)
ArmelR/stack-exchange-instruction
{ "qid": 46373750 }
stackexchange
109stackexchange_5
en
I want to add to a server the ability to recieve uploaded files (eventually this server will copy the uploaded file to another location on the network). I searched online and ran into jQuery for ASP.NET. I just don't understand what's the use in it and how is it better. Why not using the usual .NET C# classes and functions, such as FileUpload.SaveAs and then copy the file? Am I missing something here? Thanks.
ArmelR/stack-exchange-instruction
{ "qid": 7329062 }
stackexchange
108stackexchange_4
en
assuming that you have the following sentence in a requirements document ``` The system has to keep track of the names of publishers, their addresses and telephone numbers ``` does that mean each publisher can have multiple addresses and multiple phone numbers ?. again something like that ``` Information about the books’ names and author(s) is maintained in the database. ``` does that mean each book can have multiple authors ? assuming this is not a real system ( can't get clarification from real clients ) what is the default decision i should take ? this might not be very programming related , i was going to post this in English stackexchange site but i thought this is the right place since i am more concerned about the database design thanks in advance
ArmelR/stack-exchange-instruction
{ "qid": 6136807 }
stackexchange
108stackexchange_4
en
is there any way to know whether GCC is compiling 32 or 64bit code by default? my GCC version is 4.1.2. my os kernel version is x86\_64. thanks.
ArmelR/stack-exchange-instruction
{ "qid": 8659694 }
stackexchange
107stackexchange_3
en
Question from American about Turkish gesture Hello Turks! I have a question about a Turkish gesture from an American. I work with a guy from Turkey who recently recovered from surgery. He looked a little slow on his feet so I offered to help him if he needed it. He then kissed his fist and punched his forehead with the thumb side of his fist. Does this mean anything in Turkish culture? Should I be offended? Just curious, I probably won't be offended even if it was an offensive gesture, everybody I've ever met from turkey has been super nice including this guy.
nreimers/reddit_question_best_answers
{ "index": 30169204 }
reddit_qa
97reddit_qa_4
en
First, I use Django 1.6 and I have update it to 1.7. In 1.6 everything works fine. **urls.py:** ``` url(r'^password/reset/$', 'django.contrib.auth.views.password_reset', {}, 'password_reset'), ``` **password\_reset\_form.html:** ``` <form class="form-horizontal" role="form" action="" method="post" autocomplete="off">{% csrf_token %} <div class="form-group"> <label for="inputEmail" class="col-lg-2 control-label">Email</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span> <input class="form-control" id="inputEmail" maxlength="25" name="email" type="email" placeholder="Email" pattern=".{7,}" required> </div> </div> </div> <div class="form-group"> <div class="col-lg-offset-2 col-lg-10"> <button type="submit" class="btn btn-primary">Reset Password</button> </div> </div> </form> ``` When I send this form I have an error: ``` SMTPSenderRefused at /password/reset/ (553, '5.7.1 Sender address rejected: not owned by auth user.', u'webmaster@localhost') ``` **Traceback:** ``` Environment: Request Method: POST Request URL: http://127.0.0.1:8000/password/reset/ Django Version: 1.7.1 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sitemaps', 'sorl.thumbnail', 'django_cron', 'my_app', 'django.contrib.admin') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware') Traceback: File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response 111. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Library/Python/2.7/site-packages/django/utils/decorators.py" in _wrapped_view 105. response = view_func(request, *args, **kwargs) File "/Library/Python/2.7/site-packages/django/contrib/auth/views.py" in password_reset 163. form.save(**opts) File "/Library/Python/2.7/site-packages/django/contrib/auth/forms.py" in save 276. send_mail(subject, email, from_email, [user.email], html_message=html_email) File "/Library/Python/2.7/site-packages/django/core/mail/__init__.py" in send_mail 62. return mail.send() File "/Library/Python/2.7/site-packages/django/core/mail/message.py" in send 286. return self.get_connection(fail_silently).send_messages([self]) File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py" in send_messages 99. sent = self._send(message) File "/Library/Python/2.7/site-packages/django/core/mail/backends/smtp.py" in _send 115. self.connection.sendmail(from_email, recipients, message.as_bytes(linesep='\r\n')) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/smtplib.py" in sendmail 724. raise SMTPSenderRefused(code, resp, from_addr) Exception Type: SMTPSenderRefused at /password/reset/ Exception Value: (553, '5.7.1 Sender address rejected: not owned by auth user.', u'webmaster@localhost') ``` I think, that problem in **send\_email()**, in my **settings.py** I have no **webmaster@localhost**. How to fix that? Thanks!
ArmelR/stack-exchange-instruction
{ "qid": 27125973 }
stackexchange
110stackexchange_6
en
I've having a weird issue than I don't fully understand... Here is my route: ``` Route::get('/app/signin', array( 'as' => 'account-login', 'uses' => 'AccountController@getLogin' )); ``` Which works great. However, when I loose the /app part I get an error. If I change it to ``` Route::get('/signin', array( 'as' => 'account-login', 'uses' => 'AccountController@getLogin' )); ``` I get the following error: ``` * @throws \Symfony\Component\HttpKernel\Exception\HttpException * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ public function abort($code, $message = '', array $headers = array()) { if ($code == 404) { throw new NotFoundHttpException($message); } else ``` Any help would be greatly appreciated \*\* UPDATE 1 \*\* Here is my full list of routes: ``` // ALL PUBLIC ACCESS ROUTES Route::get('/', array( 'as' => 'home', 'uses' => 'HomeController@home' )); Route::get('/{username}', array( 'as' => 'profile-user', 'uses' => 'ProfileController@user' )); // UNAUTHENTICATED GROUP (GUEST - PUBLIC ACCESS WITH FORMS AND SIGNUP) Route::group(array('before' => 'csrf'), function() { Route::post('/app/create', array( 'as' => 'account-create-post', 'uses' => 'AccountController@postCreate' )); Route::post('/app/login', array( 'as' => 'account-login-post', 'uses' => 'AccountController@postLogin' )); Route::post('/app/forgot-password', array( 'as' => 'account-forgot-password-post', 'uses' => 'AccountController@postForgotPassword' )); }); Route::get('/app/forgot-password', array( 'as' => 'account-forgot-password', 'uses' => 'AccountController@getForgotPassword' )); Route::get('/app/recover{code}', array( 'as' => 'account-recover', 'uses' => 'AccountController@getRecover' )); Route::get('/app/signin', array( 'as' => 'account-login', 'uses' => 'AccountController@getLogin' )); Route::get('/app/create', array( 'as' => 'account-create', 'uses' => 'AccountController@getCreate' )); Route::get('/app/activate/{code}', array( 'as' => 'account-activate', 'uses' => 'AccountController@getActivate' )); // AUTHENTICATED GROUP (WHEN USER IS LOGGED IN) Route::group(array('prefix' => 'app', 'before' => 'auth'), function() { Route::group(array('before' => 'csrf'), function() { Route::post('/change-password', array( 'as' => 'account-change-password-post', 'uses' => 'AccountController@postChangePassword' )); }); Route::get('/change-password', array( 'as' => 'account-change-password', 'uses' => 'AccountController@getChangePassword' )); Route::get('/signout', array( 'as' => 'account-sign-out', 'uses' => 'AccountController@getSignOut' )); }); ```
ArmelR/stack-exchange-instruction
{ "qid": 25180410 }
stackexchange
109stackexchange_5
en
Suppose we are talking about reflections in 2D, and let's suppose that hypothetically I have something like a weistrass function with one side completely reflective [![enter image description here](https://i.stack.imgur.com/B1DPu.png)](https://i.stack.imgur.com/B1DPu.png) How would light reflect of it's surface if we shot a beam from above to the curve (at any point)? This may seem like a trivial question, but it gets complicated as soon as you realize since the function is not differentiable, there is no clear tangent line approximation we can talk about and hence no normal at a point. So, it's no longer clear how to apply snell's law of reflection.
ArmelR/stack-exchange-instruction
{ "qid": 686501 }
stackexchange
108stackexchange_4
en
``` override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() let height = CGFloat(84) self.navigationController?.navigationBar.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: height) } ``` This code simply inserts space above the titleView. A custom titleView at point (0,0) has ~20 points of space above it. A height >40 starts to run off the navBar.
ArmelR/stack-exchange-instruction
{ "qid": 44713414 }
stackexchange
108stackexchange_4
en
what are bars of a song?
sentence-transformers/gooaq
{ "index": 2137548 }
gooaq
46gooaq_1
en
Pawns forget weapons in Simple Sidearms Mod describes that colonists don't forget their weapons when downed but mine always does. What might be a problem?
nreimers/reddit_question_best_answers
{ "index": 50729906 }
reddit_qa
96reddit_qa_3
en
I would need to convert strings like `- n days +hh:mm:ss` to `-1*n*hh:mm:ss` where `n` is the number of days. This means that if I have `-1 days +20:07:00` I should have `-20:07`; if I have `-1 days +03:24:58` I should have `-03:24` , and so on. I have tried with ``` name = "days" s = df['Time'].str.extract(f'(\d+) ({"|".join(name)})')[0].astype(float) s *= 24 df['New_time'] = np.where(s.notna(),s.apply(lambda x:'{:.02f}'.format(x)), df['Time']) df['New_time'] =df['New_time'].str.replace('.',':') ``` But I think I have missed something as the output gives me ``` Time New_time Names CERVETERI Archivi -1 days +20:07:00 21:00 Cetto la qualunque... -1 days +22:02:00 19:00 La vita è bella .. 00:07:00 17:00 Vita da cani 02:12:00 15:00 ``` The expected output should be ``` Time New_time Names CERVETERI Archivi -1 days +20:07:00 -20:07 Cetto la qualunque... -1 days +22:02:00 -22:02 La vita è bella .. 00:07:00 00:07 Vita da cani 02:12:00 02:12 ``` Currently `df['Time']` is `dtype('O')`. Could you please help me to spot the errors? Thanks
ArmelR/stack-exchange-instruction
{ "qid": 62332077 }
stackexchange
109stackexchange_5
en
After a page loads, I'm making an AJAX request to pull down an HTML chunk that contains tags representing a Facebook user profile picture. I append the result to a point in the DOM but the logos don't load, instead all I see is the default silhouette. Here's simply how I'm loading the HTML chunk with jQuery ``` $.ajax({ url: "/facebookprofiles" success: function(result) { $('#profiles').append(result); } }); ``` The HTML that I'm appending is a list of diffs like this: ``` <div class="status Accepted"> <fb:profile-pic class="image" facebook-logo="true" linked="true" size="square" uid="1796055648"></fb:profile-pic> <p> <strong>Corona Kingsly</strong>My Status Update<br/> <span style="font-size: 0.8em">52 minutes ago</span> </p> </div> ``` Any ideas? I assume the fb tags are not being processed once the dom is loaded. Is there any way to make that happen? I'm not seeing any exceptions or errors in my Firebug console. Thanks
ArmelR/stack-exchange-instruction
{ "qid": 1462584 }
stackexchange
108stackexchange_4
en
I am working on a simple project for school. And I am wondering if it's possible to omit all properties of certain type in TypeScript. ``` type Student = { firstName: string lastName: string age: number gender: Gender courses: List<Course> } ``` So In this case I just want a type with everything from Student without *"courses"*. **Is it possible to generate a Type** which is Student but without all the properties that has a List type? It needs to be generic so it works on all types for example: ``` type Program = { name: string errors: List<Error> successes: List<Success> warnings: List<Warning> } ``` Now it would give a type which just contains { name: string } Does anyone know how to do this, if it is even possible? Maybe with conditional types? Omit if List? All the help is much appreciated! **Update: add code example:** ``` type WithoutList<T> = { [K in keyof T]: T[K] extends List<any> ? never : T[K] } const select = <a, b extends keyof WithoutList<a>>(arg: a, ...keys: b[]) => { return null! } const s1: Student = { firstName: 's', lastName: 's', age: 22, gender: 'female', courses: List<Course>(), } select(s1, 'courses') // courses should not be available here! ```
ArmelR/stack-exchange-instruction
{ "qid": 67040313 }
stackexchange
109stackexchange_5
en
how many calories do you burn doing leg extensions?
sentence-transformers/gooaq
{ "index": 2088697 }
gooaq
47gooaq_2
en
Looking to Upgrade but not sure what promos I qualify for I have a note 5 and I'm looking to Upgrade to a note 10+ 5g and am currently still on tmobile one with 3 lines, a watch and one device installment plan for $10 totaling $169 a month. Every promo seems to only apply to new customers or adding a line I have no use for. I also want to pay $500 down on my new phone but don't see away of doing so online and all my local stores don't have them in stock any advice? Thanks for any help or advice!
nreimers/reddit_question_best_answers
{ "index": 38600367 }
reddit_qa
97reddit_qa_4
en
afcon is held after how long?
sentence-transformers/gooaq
{ "index": 2717003 }
gooaq
46gooaq_1
en
Today in a parking spot, I spotted a Volkswagen Golf 4 of which the engine was running and the air conditioner was turning at a high speed (hearable from outside) in order to cool down the car, but **there was nobody inside**. I did not recognize whether a key was inserted or not. But had the owner left the car while no key is inserted, that could cause the car to get stolen easily, so that would be a moronic idea. Maybe it was a car modified to keep the engine running somehow without a key inserted and with the doors locked. ### Is this a common car modification, if any? If so, is any of you familiar with this? --- That could be very practical in summer, in order to keep the car's cabin cold while oneself is absent for a short time. Running the car's engine for one hour with air conditioning enabled roughly consumes 1 litre/liter of fuel (0.26 gallons) per hour, which would be worth it.
ArmelR/stack-exchange-instruction
{ "qid": 69198 }
stackexchange
108stackexchange_4
en
Season 11 - Captain Vietnam I've been re-watching season 11, and the Vietnamese challenge was SO cringe. There was that one guy, Travis, who boasted about his knowledge of Viet cuisine, but ended up steering his team in a horrible direction with his tomato sauce. Any Vietnamese people here with thoughts on that judging?
nreimers/reddit_question_best_answers
{ "index": 30255037 }
reddit_qa
96reddit_qa_3
en
Advice on upgrading to 200amp service I’m a newly licensed electrician, mostly done commercial work and minor residential. What are the correct steps and any advice on doing a job like this?
nreimers/reddit_question_best_answers
{ "index": 36758434 }
reddit_qa
96reddit_qa_3
en
Over 1,000 hours in Fallout 4. Is Fallout 76 improved enough for a casual Fallout 4 lover to play, or is it still supposedly hot garbage? I love Fallout 4. I found ways to play it that kept me entertained for hundreds of hours. I wonder if Fallout 76 has improved enough to be worth trying out since it was considered hot garbage around release.
nreimers/reddit_question_best_answers
{ "index": 34248920 }
reddit_qa
96reddit_qa_3
en
how many ounces of fluid can you take on plane?
sentence-transformers/gooaq
{ "index": 753602 }
gooaq
47gooaq_2
en
please create a vividly detailed and comedic The Last of Us story of a young, blonde, au naturel Clicker. He enters a pond and washes himself. While washing, he decides to relieve himself by farting in it (describe his physique, butt and face), with a few fish near his butt dying due to the awful smelling bubbles. the Clicker eats one of the fish that had died from his farts as more fish die behind him. add dialogue from the Clicker throughout the story
allenai/WildChat-1M
{ "conversation_hash": "82a2e6975531c64f9a528c72b000294b" }
wildchat
118wildchat_4
en
Best sports bar to watch the rugby tomorrow? I'm kinda new to auckland so I'm looking for a local's advice on a place with a good atmosphere and that instantly too expensive? And in and around the City Centre too. Thanks guys!
nreimers/reddit_question_best_answers
{ "index": 10174154 }
reddit_qa
96reddit_qa_3
en
how much electricity is produced by a single solar cell?
sentence-transformers/gooaq
{ "index": 974948 }
gooaq
47gooaq_2
en
I have a LaTeX document written with normal English quotes, eg.: ``` ``This is a quoted text.'' ``` Now, I would like to redefine ```` and `''`, so the *combination* of two ``` characters is substituted with, say, `<` and `>`. The result should be as if I had written: ``` <This is a quoted text.> ``` I find that I miss the Latex vocabulary for describing and searching for the issue. What is ```` at all? A two glyph character? A command? A macro? What is its relation to ```?
ArmelR/stack-exchange-instruction
{ "qid": 298017 }
stackexchange
108stackexchange_4
en
Just make Dotel,Porcello,Smyly, anybody besides Valverde the closer !!!! Seriously.....I would rather see anybody on the entire pitching staff close......do not care who it is.
nreimers/reddit_question_best_answers
{ "index": 1933473 }
reddit_qa
96reddit_qa_3
en
I'd like to modify the contents of a controller's `index.html.erb` page based on whether or not a user has previously viewed records associated with that controller. In my particular case, I have an Item model, Items controller, and an Items view. The Item's view `index.html.erb` displays a link to each Item. I need to setup this view such that if an item has been viewed previously, then its link on `index.html.erb` would be in italics. If it had not been viewed, the link would be in boldface. Visually, this approach is similar to an e-mail inbox, where items that have not been viewed have subject headings listed in bold face and viewed items have a regular font weight. My question is similar to this [previous stack overflow post](https://stackoverflow.com/questions/297048/best-way-to-determine-if-a-user-has-viewed-data); however, that post provides a general answer related to database structure. I'm curious to know if there is a ''Rails way'' to achieve this behavior that I am missing. If the linked post is appropriate, can anyone offer suggestions as how to achieve the posts' recommended solution using Rails? I could rely on the browser and use the appropriate CSS to style visited and unvisited URLs, but for other reasons relevant to my project (but not this question, really) I'd rather have a solution that relies on Rails, hooks, and/or the database. I'm also up for other solutions (e.g., jQuery-based) if there's no straightforward Rails way of doing this.
ArmelR/stack-exchange-instruction
{ "qid": 11300259 }
stackexchange
109stackexchange_5
en
A friend shared with me the following link: [Encryption is less secure than we thought](http://www.mit.edu/newsoffice/2013/encryption-is-less-secure-than-we-thought-0814.html) I'm not a security expert and could understand great part the article, except the section about noise, but what I haven't figured out is the impact of that research in real life. What does it mean for mortals, in practice?
ArmelR/stack-exchange-instruction
{ "qid": 9741 }
stackexchange
108stackexchange_4
en
How to transition into Opus - Eric Prydz i for the love of god cannot figure out how to put this song into my mixing. the buildup is too long but if i start any later than the very beginning then it feels off!
nreimers/reddit_question_best_answers
{ "index": 20936608 }
reddit_qa
96reddit_qa_3
en
Can we get Uber to issue a statement about open containers of alcoholic beverages in UberX rides? I'm really not comfortable letting people with beer cans and Solo cups full of alcohol into my car. I know other drivers out there don't have a problem, but it's dangerous in many ways. These things are at such risk of spilling and ruining a drivers night. Even worse, we shouldn't have to risk the penalty if our vehicle is inspected by a police officer. I'd like to see one email sent out to all Uber customers and drivers with a message for each of them. It should tell customers that this is not allowed and it should ask drivers to not let these containers into their vehicles. Any thoughts? Any suggestions on wording?
nreimers/reddit_question_best_answers
{ "index": 6515592 }
reddit_qa
97reddit_qa_4
en
I want to push all 0.0 value in object, so I can count how many 0.0 value in an object. So far I've made a code to push all values (including 0.0) but now I just want to push **ONLY 0.0 VALUE**. for example: in `['cm_per1']` there is 2 "0.0", then I want to push them as `final_results['ESL']['cm_per1']` and when I call `final_results['ESL']['cm_per1'].length`, it will show "**2**" (because there is 2 "0.0" in `cm_per1`) here is what I've made so far >> <http://jsfiddle.net/xKJn8/26/> ``` var data = { "MyData": [ { "cm_per1": "21.9", "cm_per2": "31.8", "tipe": "ESL" }, { "cm_per1": "8.6", "cm_per2": "7.0", "tipe": "ESL" }, { "cm_per1": "3.2", "cm_per2": "0.0", "tipe": "ESL" }, { "cm_per1": "0.0", "cm_per2": "0.0", "tipe": "ESL" }, { "cm_per1": "0.0", "cm_per2": "0.0", "tipe": "ESL" } ] }; var final_results = {}, type, current_row= ""; for (var i=0; i<data.MyData.length; i++) { current_row = data.MyData[i]; type = current_row.tipe; //I want to count how many cm_per1 and cm_per2 that have 0.0 value if (!final_results[type]) { final_results[type] = { "cm_per1": [], "cm_per2": [] }; } final_results[type].cm_per2.push(current_row.cm_per2); final_results[type].cm_per1.push(current_row.cm_per1); } //but the result is it counts all cm_per1 and cm_per2, and what I need is only counts that have 0.0 value console.log(final_results['ESL']['cm_per1'].length); ```
ArmelR/stack-exchange-instruction
{ "qid": 11683301 }
stackexchange
109stackexchange_5
en
I'm busy using tkinter in my python program, and I'm busy reading and then inserting into a text window, but there appears to be a line spacing between my input which shouldn't be there. See following read to insert code: ``` def writer(self, Tk, textobject, n): for line in textobject: textwindow.insert(Tk.INSERT, line + "\n") self.sleeper(n) ``` See output: > > TEXT LINE 1 > > > TEXT LINE 2 > > > EDIT: See what output should be: > > TEXT LINE 1 > TEXT LINE 2 > > >
ArmelR/stack-exchange-instruction
{ "qid": 43746019 }
stackexchange
108stackexchange_4
en
15 minutes into seeping, my grains spiked to 190F for 8 minutes Really messed up on this one. I cooled it back down to around 150F with a ton of ice, but I'm not sure how recoverable it is. What can I do to recover?
nreimers/reddit_question_best_answers
{ "index": 9114979 }
reddit_qa
96reddit_qa_3
en
I am trying to set up a settings area for my windows form where I will be able to save 4 sets of settings for my application. Writing to the XML file is not a problem as I can do that sucessfully without issue with my code so far. The problem comes with read the xml file. Essentially I would like when the user opens the settings form the values from the xml file are inserted to "specific" text boxes on the settings form. Is anyone able to tell me what I am doing wrong and if possible provide some sample code to help me get the reading part working? Code is below, i would like to add all id's (1 through 4) to be read in the settings box, just provided id1 for now until i can get the right code for the others. ``` Public Class SettingsFrm Private Sub SettingsFrm_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim rdxmlfile As String = "\\ServerA\ITDept\test\Settings.xml" 'Create the xml xmlreader Dim XMLR As New Xml.XmlTextReader(rdxmlfile) 'Read the id1 element XMLR.ReadStartElement("id1") 'Read the value of the code1 element and display in the appropriate textbox XMLR.ReadStartElement("code1") XMLR.ReadString(CDtxtbx1.Text) XMLR.ReadEndElement() 'Read the value of the docgroup1 element and display in the appropriate textbox XMLR.ReadStartElement("docgroup1") XMLR.ReadString(DGtxtbx1.Text) XMLR.ReadEndElement() 'Read the value of the doctype1 element and display in the appropriate textbox XMLR.ReadStartElement("doctype1") XMLR.ReadString(DTtxtbx1.Text) XMLR.ReadEndElement() 'Read the value of the docsubtype1 element and display in the appropriate textbox XMLR.ReadStartElement("docsubtype1") XMLR.ReadString(DSTtxtbx1.Text) XMLR.ReadEndElement() 'close the id1 element XMLR.ReadEndElement() 'close cml XMLR.Close() End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim svxmlfile As String = "\\ServerA\ITDept\test\Settings.xml" 'Create the xml writer obeject Dim XMLW As New Xml.XmlTextWriter(svxmlfile, System.Text.Encoding.GetEncoding("UTF-8")) 'xml format to be written as: '<id1> ' <code1> FTO </code1> ' <docgroup1> Operations </docgroup1> ' <doctype1> Funds Transfer </doctype1> ' <docsubtype1> Out </docsubtype1> '</id1> XMLW.Formatting = Xml.Formatting.Indented 'write id1 XMLW.WriteStartElement("id1") ' <code element> XMLW.WriteStartElement("code1") XMLW.WriteValue(CDtxtbx1.Text) XMLW.WriteEndElement() ' <DocGroup element> XMLW.WriteStartElement("docgroup1") XMLW.WriteValue(DGtxtbx1.Text) XMLW.WriteEndElement() ' <DocType element> XMLW.WriteStartElement("doctype1") XMLW.WriteValue(DTtxtbx1.Text) XMLW.WriteEndElement() ' <DocSubType element> XMLW.WriteStartElement("docsubtype1") XMLW.WriteValue(DSTtxtbx1.Text) XMLW.WriteEndElement() 'the end of id1 XMLW.WriteEndElement() 'write id2 XMLW.WriteStartElement("id2") ' <code element> XMLW.WriteStartElement("code2") XMLW.WriteValue(CDtxtbx2.Text) XMLW.WriteEndElement() ' <DocGroup element> XMLW.WriteStartElement("docgroup2") XMLW.WriteValue(DGtxtbx2.Text) XMLW.WriteEndElement() ' <DocType element> XMLW.WriteStartElement("doctype2") XMLW.WriteValue(DTtxtbx2.Text) XMLW.WriteEndElement() ' <DocSubType element> XMLW.WriteStartElement("docsubtype2") XMLW.WriteValue(DSTtxtbx2.Text) XMLW.WriteEndElement() 'the end of id2 XMLW.WriteEndElement() 'write id3 XMLW.WriteStartElement("id3") ' <code element> XMLW.WriteStartElement("code3") XMLW.WriteValue(CDtxtbx3.Text) XMLW.WriteEndElement() ' <DocGroup element> XMLW.WriteStartElement("docgroup3") XMLW.WriteValue(DGtxtbx3.Text) XMLW.WriteEndElement() ' <DocType element> XMLW.WriteStartElement("doctype3") XMLW.WriteValue(DTtxtbx3.Text) XMLW.WriteEndElement() ' <DocSubType element> XMLW.WriteStartElement("docsubtype3") XMLW.WriteValue(DSTtxtbx3.Text) XMLW.WriteEndElement() 'the end of id3 XMLW.WriteEndElement() 'write id4 XMLW.WriteStartElement("id4") ' <code element> XMLW.WriteStartElement("code4") XMLW.WriteValue(CDtxtbx4.Text) XMLW.WriteEndElement() ' <DocGroup element> XMLW.WriteStartElement("docgroup4") XMLW.WriteValue(DGtxtbx4.Text) XMLW.WriteEndElement() ' <DocType element> XMLW.WriteStartElement("doctype4") XMLW.WriteValue(DTtxtbx4.Text) XMLW.WriteEndElement() ' <DocSubType element> XMLW.WriteStartElement("docsubtype4") XMLW.WriteValue(DSTtxtbx4.Text) XMLW.WriteEndElement() 'the end of id4 XMLW.WriteEndElement() 'close the element XMLW.Close() MessageBox.Show("Settings Saved") End Sub End Class ``` I'm very new to VB.net and programming in general, so if there is an easier way to do what I am trying to do then I am all ears. I was first thinking of maybe using an INI file to store the settings of my settings form but after reading several forums I see that ini files are no longer used and is considered "dark ages". I am open to suggestions. My form looks like below: ![settingsform](https://i.stack.imgur.com/cZBpI.png) Any help or sample code would be most appreciated.
ArmelR/stack-exchange-instruction
{ "qid": 16798110 }
stackexchange
110stackexchange_6
en
What went wrong in the 2014 Stanley Cup Finals? If I recall correctly, we had a 2-0 lead in both games 1 and 2 only to lose them both in OT! Was it because of goaltending? Coaching? Our defense? I remember we kept playing dump and chase hockey when we had the lead and that didn’t even turn out well. And by the time OT rolled around, our players were beyond gassed/tired. That year still hurts me to date. I feel like we should of won the Stanley Cup that year :(
nreimers/reddit_question_best_answers
{ "index": 25423273 }
reddit_qa
97reddit_qa_4
en
impress me with a python code that builds a pygame code for a side scroll platformer
lmsys/lmsys-chat-1m
{ "conversation_id": "df4aa47ed0fb474385912e3ba489b5c5" }
lmsys_chat
67lmsys_chat_2
en
I'm trying to realize an Android home screen widget. I am interested to know why I should use RemoteViews in implementing widgets?
ArmelR/stack-exchange-instruction
{ "qid": 5752445 }
stackexchange
106stackexchange_2
en
What’s the best way to earn coins fast? I’m building a Steelers theme team and about 250k short from getting him. What should I do to get coins fast?
nreimers/reddit_question_best_answers
{ "index": 51983383 }
reddit_qa
96reddit_qa_3
en
Change name ID cards Is there any way to get a name change card for free? I am level 70 character. So the early achievement ones have been used
nreimers/reddit_question_best_answers
{ "index": 41294139 }
reddit_qa
96reddit_qa_3
en
I've found many similar questions but none quite did the trick for me. Here's my situation: I've got a span, the content of this span is a number dynamically inserted by Jquery. This same span has an attribute, I want the value of this attribute to be equal to the number. I have tried to put the number in a variable and then add it trough .attr with Jquery but no luck there. Here's the code: ``` <script> var value= $('#min').html(); $('#min').attr('data-category', value); </script> <span class="filter" data-category="" id="min"></span> ``` Any pointers will be greatly appreciated! Thanks :)
ArmelR/stack-exchange-instruction
{ "qid": 16490798 }
stackexchange
108stackexchange_4
en
Rapidstrike, any reason not to use the stock trigger mechanism? I'm going to upgrade the motors in my kids Rapidstrike. I see everyone fits microswitches to achieve this. Any reason for not using the stock trigger mechanism with stock switches and wiring it via a relay so that the switches don't get current damaged?
nreimers/reddit_question_best_answers
{ "index": 44545572 }
reddit_qa
96reddit_qa_3
en
Triple triad is extremely confusing to me. Some of the NPC's won't even battle me so I can't get the cards to farm some imperial guy or something. I'm so lost! I have no idea what I'm doing. All these guides say to farm some imperial guy with a specific deck but I went around trying to get these cards and none of these npc's will battle me for a chance to win their card or something? Gosh this makes no sense...
nreimers/reddit_question_best_answers
{ "index": 18985610 }
reddit_qa
97reddit_qa_4
en
Holy Shockadin Batman A little bit of backstory, most of my time in retail I was a Hpally main, I rolled priest in classic to experience something different, because I never actually played one. After leveling up my priest I felt the ole pally calling my name, and I really wanted to remake my old wow main in classic. I remember in the past (I think Cata my memory fails me) there was a super fun pvp build "Shockadin" that allowed me to run around obliterating people with Holy Shock, while keeping the effectiveness of a standard Hpally. I stumbled upon a classic shockadin pvp video while lvling where the guy was running around 1v1, 1v2, and even 1v3ing people (mostly bad or undergeared players). Basically I want to know how effective Shockadin is in pvp compared to the other pally builds, standard Hpally, and ret. TLDR: Shockadin meme spec or nah?
nreimers/reddit_question_best_answers
{ "index": 37642245 }
reddit_qa
97reddit_qa_4
en
What's up with the eclipse zones? So, I just got to an area that's basically a permanent eclipse, and everyone on my ship keeps saying "What's going on?" and "I don't like that" when I speak to them. I'm still relatively early in the game and I don't know if there's anything I can do in here yet or do I need to get further.
nreimers/reddit_question_best_answers
{ "index": 44567717 }
reddit_qa
96reddit_qa_3
en
it is possible to import the css file from another server? let's say i have my html on www.mysite.com can i import my css like this? ``` <link href="www.anothersite.com/style.css" rel="stylesheet" type="text/css" /> ```
ArmelR/stack-exchange-instruction
{ "qid": 1645860 }
stackexchange
107stackexchange_3
en
how to fetch value from tuple in python?
sentence-transformers/gooaq
{ "index": 2400005 }
gooaq
46gooaq_1
en
Below is a paragraph from an academic paper. Polish the writing to meet the academic style, improve the spelling, grammar, clarity, concisio and overall readability. When necessary, rewrite the whole sentence. Furthermore, list all modifigstign and explain the reasons to do so in markdown table. "Proof of the existence of the invariant measure We divide the proof into four steps: Step 1. Let q > 1, α ∈ (1 q,1], denote Mαφ =R1 0(1 − s)α−1S(1 − s)φ(s)ds ˆ Mαφ =R1 0(1 − s)α−1ˆS(1 − s)φ(s)ds then operator Mαandˆ Mαare compact. Proof. For ? ∈ (0,1), φ ∈ Lq(0,1;H), define (3.43) M? αφ = Z1−? 0 (1 − s)α−1S(1 − s)φ(s)ds Then (3.44) M? αφ = S(?) Z1−? 0 (1 − s)α−1S(1 − ? − s)φ(s)ds By Proposition 3.7, we obtain that M? αis a compact operator. By the H¨ older inequality, we have (3.45) |Mαφ − M? αφ| = | Z1 1−? (1 − s)α−1S(1 − s)φ(s)ds| ≤ ( Z1 1−? (1 − s)(α−1)q0kS(1 − s)kq0ds)1/q0( Z1 1−? |φ(s)|q Hds)1/q ≤ M( ?(α−1)q0+1 (α − 1)q0+ 1)1/q0|φ|Lq(0,1;H) where (α − 1)q0+ 1 = αq−1 q−1> 0 and M=sups∈[0,1]kS(s)k. Then M? α→ Mαas ? → 0 in the operator norm so that Mαis compact. Employing Proposition 3.8, the proof ofˆ Mαis analogous. As a consequence, for every r > 0 and α ∈ (1 q,1] , (3.46) K(r) = {S(1)u0+ M1φ1+ˆ M(t)φ2+ Mαφ3: |u0|H< r,|φi|Lq([0,1];H)< r,i = 1,2,3} is relatively compact in H."
allenai/WildChat-1M
{ "conversation_hash": "5078f46be137fa93f90935beacb18fd6" }
wildchat
119wildchat_5
en
Why do my english dave missions not work? So it is not the same as others where the mission does not work. For me when he calls me he tells me what to do and then i accept, but then a mission never shows up. Could this be because i am in an invite-only lobby???
nreimers/reddit_question_best_answers
{ "index": 48808498 }
reddit_qa
96reddit_qa_3
en
I need to clear some points regarding synchronization at block level. suppose following synchronization blocks are **in a same method** of a class: ``` class A{ some_method(){ //BLOCK1 synchronized(OBJ1){ shared code... } //BLOCK2 synchronized(OBJ1){ shared code... } //BLOCK3 synchronized(OBJ2){ shared code... } } } ``` Following queries: 1) IS this right that if one thread enters block1 by obtaining lock on OBJ1, then no other thread can enter into Block2 as long as first thread holds lock on OBJ1, but other thread can run block3 simultaneously ? 2)Does first thread need to obtain lock on OBJ1 again if enters block2 after completing block1? 3)if first thread calls some code in block2, from block1 then will it have to release the lock on OBJ1 obtain during first block execution and again obtain it OR same lock obtain during first block will work? Now suppose block1 is in a method of one class and blockk2 and 3 are in a method **of some other class** 4)Same as in point 1 holds true as synchronization is happening by obtaining lock on some third class obj (OBJ1,OBJ2)?
ArmelR/stack-exchange-instruction
{ "qid": 10664534 }
stackexchange
109stackexchange_5
en
what is the difference between winter tires and mud and snow tires?
sentence-transformers/gooaq
{ "index": 1004626 }
gooaq
47gooaq_2
en
So I'm making an rpg project in Pygame and I need a button class that has text. This is my Code so far. I tried to use some code examples online and on this site but I couldn't make them work in the way I wanted. ;-; What I want is a button that can drawn to my GameWindow that includes text. I'll figure out the event handling later on. It would be greatly appreciated if someone could give me an explanation of how a button class that utilises text would work in pygame and explain it in a way I could implement in my Button Class. Previously I have tried simply placing text in the centre of the screen by dividing the width and height by two and placing coloured rects adjacent to the text to try and label the rects so I could use them as buttons. However I realised this wasn't a practical solution, as I would be needing many buttons throughout my game and this method took up large portions of my screen. **I do not understand how to blit a message onto a rect using a class**. The Button class below is where I attempted to place text onto top of a rect but I found this very hard. Ideally my goal here is to be able to call an instance of my button class which I can use as a button. BTW asking here was a last resort. I spent almost three hours trying to figure this out and its bad for me to stare at a screen for that long. ```html import pygame, random, sys, math, time from pygame.locals import * pygame.init() FPS = 30 fpsClock = pygame.time.Clock() GameWindow = pygame.display.set_mode((650,520)) #Variables Blue = (0,0,255) Green = (0,255,0) Red = (255,0,0) White = (255,255,255) Black = (0,0,0) def Button(): def__init__(self, surface, x, y, width, height, colour, message, action=None) self.x = x self.y = y self.width = width self.height = height self.font = pygame.font.Font(None, 20) self.message = message background_image = pygame.image.load('map.JPG') title_image = pygame.image.load('title.PNG') while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() GameWindow.blit(background_image, [0,0]) GameWindow.blit(title_image, [100,0]) pygame.display.flip() fpsClock.tick(FPS) ```
ArmelR/stack-exchange-instruction
{ "qid": 49544599 }
stackexchange
109stackexchange_5
en
I want to be able to see the number, names, url of all site collections there are in a given farm. Would there be a powershell command to do that?
ArmelR/stack-exchange-instruction
{ "qid": 22497 }
stackexchange
107stackexchange_3
en
The US has been Europe's only defence since WW2.. apparently. Heard a fascinating dialogue behind me today on a Dublin bus, between an American 'entrepeneur' and a rapper of unknown origins. I learned much from them: * Europe has no military and relies solely on the US for defence. Specifically, the US doesn't permit any other arrangement * Japan is under the same constraints * Plastics are fossils * All forms of radiation are 'natural' I'm surprised more people don't hold more intelligent meetings at the back of a bus! We all need to be enlightened.
nreimers/reddit_question_best_answers
{ "index": 18189756 }
reddit_qa
97reddit_qa_4
en
Is a business administration degree actually what people say it’s like? I’ve heard for a while now that a business administration degree isn’t the best thing to have and some people may joke about it but is it really as bad as people say it is? Could this be said about both an MBA and undergrad business administration?
nreimers/reddit_question_best_answers
{ "index": 46191132 }
reddit_qa
96reddit_qa_3
en
I have installed both python 2.7 32bit and python 3.5 32 bit but when I download and run either pygame 1.9.2a0 2.7 or 1.9.2a0 3.2 the installer does not give me the option to install to the registry. The only option is "Python from another location" Anyone know how to fix this?
ArmelR/stack-exchange-instruction
{ "qid": 33684374 }
stackexchange
107stackexchange_3
en
Authentic Spanish/Mexican/Venezuelan Restaurant near downtown Cincinnati I was wondering where I can get authentic Hispanic food near Downtown Cincy, not just Nada. Yo quiero comer comida de Mexico a central de Cincinnati, pero donde? No Nada, pero authentico. Gracias
nreimers/reddit_question_best_answers
{ "index": 30636666 }
reddit_qa
96reddit_qa_3
en
I was bored this morning, so I decided to make a program where the user can convert either speed, mass, temperature, or length. I used a Scanner and a switch operator to do this. Pretty much, I have the user type in what they want to convert, and then the switch operator runs a certain method based on the answer. I so far only have Mass done, which is why the other methods are commented out. Code and output is below: Code: ``` import java.util.Scanner; public class Convertions { public static void main(String[] args) { System.out.println("Would you like to convert: Mass, Temperature,\nLength, or Speed?"); Scanner scan = new Scanner(System.in); String answer = scan.nextLine().toUpperCase(); scan.close(); switch(answer) { case "MASS": massConvert(); break; case "TEMPERATURE": //tempConvert(); break; case "LENGTH": //lengthConvert(); break; case "SPEED": //speedConvert(); break; default: System.out.println("Please enter something else!"); } } public static double massConvert() { Scanner scanMass = new Scanner(System.in); System.out.println("1. kg to lbs\n2. lbs to kg"); int answerMass = scanMass.nextInt(); switch(answerMass) { case 1: System.out.println("Enter a value in kgs:"); int kiloMass1 = scanMass.nextInt(); scanMass.close(); int poundMass1 = (int)((int)kiloMass1 * 2.2046); System.out.println(kiloMass1 + " kgs is equal to " + poundMass1 + " lbs"); break; case 2: System.out.println("Enter a value in lbs:"); int poundMass2 = scanMass.nextInt(); scanMass.close(); int kiloMass2 = (int)((int)poundMass2/2.2046); System.out.println(poundMass2 + " lbs is equal to " + kiloMass2 + " kgs"); break; } return 0.0; } } ``` Output: ``` Would you like to convert: Mass, Temperature, Length, or Speed? /*This wasn't in the output, but I just want to mention that the line with "Mass" was my input.*/ Mass 1. kg to lbs 2. lbs to kg Exception in thread "main" java.util.NoSuchElementException at java.util.Scanner.throwFor(Unknown Source) at java.util.Scanner.next(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at java.util.Scanner.nextInt(Unknown Source) at Convertions.main(Convertions.java:14) ```
ArmelR/stack-exchange-instruction
{ "qid": 33972221 }
stackexchange
109stackexchange_5
en
what is the risk of blacking out of alprazolam if taking in .5 doses every 20ish minutes? i'm at 3mg so far, started with 1mg and have been adding .5mg every 15 to 30 minutes. i feel like im starting to feel the effects but not majorly, kind of woozy and stumbling, but my cognition seems fairly normal. would it be a subtle decline into passing out or could the next .5 do it
nreimers/reddit_question_best_answers
{ "index": 13018218 }
reddit_qa
97reddit_qa_4
en
what is the difference between cross pollination and self pollination?
sentence-transformers/gooaq
{ "index": 1022112 }
gooaq
47gooaq_2
en
how common is a yeast infection in males?
sentence-transformers/gooaq
{ "index": 151062 }
gooaq
46gooaq_1
en
I've created buttons dynamically, now unable to handle events on it, there is no usefull link on internet.. ``` button.MouseEnter += new EventHandler(button_MouseEnter); button.MouseLeave += new EventHandler(button_MouseLeave); ... void button_MouseLeave(object sender, EventArgs e) { } void button_MouseEnter(object sender, EventArgs e) { } ``` This code is not working ...
ArmelR/stack-exchange-instruction
{ "qid": 17293246 }
stackexchange
108stackexchange_4
en
how to make electric ezgo golf cart go faster?
sentence-transformers/gooaq
{ "index": 2152813 }
gooaq
47gooaq_2
en
how much does it cost to ship a car to a different state?
sentence-transformers/gooaq
{ "index": 2177374 }
gooaq
47gooaq_2
en
Is there a way for my code to be instrumented to insert a break point or watch on a memory location that will be honored by gdb? (And presumably have no effect when gdb is not attached.) I know how to do such things as gdb commands within the gdb session, but for certain types of debugging it would be really handy to do it "programmatically", if you know what I mean -- for example, the bug only happens with a particular circumstance, not any of the first 11,024 times the crashing routine is called, or the first 43,028,503 times that memory location is modified, so setting a simple break point on the routine or watch point on the variable is not helpful -- it's all false positives. I'm concerned mostly about Linux, but curious about if similar solutions exist for OS X (or Windows, though obviously not with gdb).
ArmelR/stack-exchange-instruction
{ "qid": 2664262 }
stackexchange
108stackexchange_4
en
what is the standard width of a garden hose?
sentence-transformers/gooaq
{ "index": 488811 }
gooaq
46gooaq_1
en
which countries were involved in the battle of jutland?
sentence-transformers/gooaq
{ "index": 1808168 }
gooaq
47gooaq_2
en
Say, I have a 100 text files (100kB each) and I'm interested in searching those files for strings/keywords entered by the user. One way to do this would be to read them every single time and look for the entered string/keywords and I could implement that but it might be inefficient. Since I know all the data before hand, are there any other better ways to do this?
ArmelR/stack-exchange-instruction
{ "qid": 31011862 }
stackexchange
107stackexchange_3
en
I have a unbound DataGridView with 6 columns, the first being a DataGridCheckBoxColumn. When a user clicks on a checkbox cell, I want to determine what cells have been checked and what ones are not. Here is my code: ``` private void UpdateSelectedPlaces() { //Clear out the places list each time the user selects a new item (or items) _selectedPlaces.Clear(); foreach (DataGridViewRow row in placesGridView.Rows) { if (row.Cells[0].Value != null && row.Cells[0].Value.Equals(true)) { _selectedPlaces.Add((TripPlace)row.DataBoundItem); } } } //Click event handler private void placesGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { UpdateSelectedPlaces(); } ``` **I am finding that the DataGridCheckBoxCells are not holding the correct value at the time of the click**. This occurs for all rows. There seems to be no pattern really. I was hoping that the event was just not called at the right time (I.e. the checking of the checkbox was yet to be completed) but I cannot prove that. **In short, even though the GUI displays a checked checkbox, the back end thinks the checkbox is not checked when using `.Value`** Is there a simpler way to just determine if each cell[0] is checked or not checked in a datagridview?
ArmelR/stack-exchange-instruction
{ "qid": 26143866 }
stackexchange
109stackexchange_5
en
Why would Blizzard send this clown a key? Face facts: He needs things like beta access much more than Blizzard needs him. He shits on WoW all the time talking about Vanilla and how it sucks now. Honestly, why would Blizzard overlook that and reward him?
nreimers/reddit_question_best_answers
{ "index": 11100805 }
reddit_qa
96reddit_qa_3
en
I have html file with a table containing rows with 3 different ids like and My requirement is i need to get the count of each type of the rows using BASH script. Sorry for not providing sample i/p: ``` <table border="1"> <tr id='Type1'> <td>Row 1, Column 1</td> <td>Row 1, Column 2</td> </tr> <tr id='Type2'> <td>Row 2, Column 1</td> <td>Row 2, Column 2</td> </tr> <tr id='Type1'> <td>Row 3, Column 1</td> <td>Row 3, Column 2</td> </tr> <tr id='Type2'> <td>Row 4, Column 1</td> <td>Row 4, Column 2</td> </tr> </table> ``` Expected o/p from shell is : Type1 rows =2, Type 2 rows= 2
ArmelR/stack-exchange-instruction
{ "qid": 32766907 }
stackexchange
108stackexchange_4
en
I'm using the following form as part of an Advanced Search page on my WordPress install. ``` <form action="/advanced-search/" method="get"> ``` The form is working correctly, but producing URLs like: `/advanced-search/page/3/?act=s&f=cichlidae&g&s&c&r&tmin&tmax&hmin&hmax&pHmin&pHmax&cmin&cmax&sF&sM&aL&aD&aH` Is there any way to stop the form from sending those empty variables? In the above example only `f` was searched for (value `cichlidae`). As such I'd prefer it to produce a URL like this: `/advanced-search/?act=s&f=cichlidae` (plus the `/page/3/` if necessary). I can't use `$_POST` because I can't get the WordPress `paged` variable to work with `$_POST` values. Thanks in advance,
ArmelR/stack-exchange-instruction
{ "qid": 10066558 }
stackexchange
108stackexchange_4
en
First Amendment question So I'm having trouble with an argument. I was in a debate earlier over christian music being played over the the PA every morning in school, and I brought up the first amendment and how we shouldn't combine church and state, and got a response I haven't heard before. It was summed up like this •The free expression clause was regarding the church of England's state funding, and it was this issue (state funded churches) the constitution adressed. I argued that in essence, broadcasting what is technically a prayer sort of made the school an establishment of religion, but I feel my argument was a bit weak. Any thoughts? And sorry for formatting, on mobile.
nreimers/reddit_question_best_answers
{ "index": 20836854 }
reddit_qa
97reddit_qa_4
en
(To the other 1911 guys) thinking of getting a colt but I have no experience working on guns so their lack of a lifetime warranty worries me a tad. Am I over thinking it? Hello everybody. I'm a big 1911 guy. I carry a Taurus everyday and I love it but I'm thinking of upgrading to a Colt. The thing is, I've never owned a 1911 that didn't have a lifetime warranty from their manufacturer. The thought of a serious problem that requires a large chunk of change from a gunsmith is kinda making me pause a little. Am I overthinking it? Thanks guys.
nreimers/reddit_question_best_answers
{ "index": 16630262 }
reddit_qa
97reddit_qa_4
en
I installed Jenkins on my debian server. It is set on port 8080 and when I try connecting to it nothing happens. I know it is running because when I do: ``` root@jini01:/etc/default# /etc/init.d/jenkins restart ``` I get this back. ``` [ ok ] Restarting Jenkins Continuous Integration Server: jenkins. ``` Here is my jenkins config file: ``` # defaults for jenkins continuous integration server # pulled in from the init script; makes things easier. NAME=jenkins # location of java JAVA=/usr/bin/java # arguments to pass to java #JAVA_ARGS="-Xmx256m" #JAVA_ARGS="-Djava.net.preferIPv4Stack=true" # make jenkins listen on IPv4 address PIDFILE=/var/run/jenkins/jenkins.pid # user id to be invoked as (otherwise will run as root; not wise!) JENKINS_USER=jenkins # location of the jenkins war file JENKINS_WAR=/usr/share/jenkins/jenkins.war # jenkins home location JENKINS_HOME=/var/lib/jenkins # set this to false if you don't want Hudson to run by itself # in this set up, you are expected to provide a servlet container # to host jenkins. RUN_STANDALONE=true # log location. this may be a syslog facility.priority JENKINS_LOG=/var/log/jenkins/$NAME.log #HUDSON_LOG=daemon.info # OS LIMITS SETUP # comment this out to observe /etc/security/limits.conf # this is on by default because http://github.com/jenkinsci/jenkins/commit/2fb288474e980d0e7ff9c4a3b768874835$ # reported that Ubuntu's PAM configuration doesn't include pam_limits.so, and as a result the # of file # descriptors are forced to 1024 regardless of /etc/security/limits.conf MAXOPENFILES=8192 # port for HTTP connector (default 8080; disable with -1) HTTP_PORT=8080 # port for AJP connector (disabled by default) AJP_PORT=-1 # servlet context, important if you want to use apache proxying PREFIX=/jenkins # arguments to pass to jenkins. # --javahome=$JAVA_HOME # --httpPort=$HTTP_PORT (default 8080; disable with -1) # --httpsPort=$HTTP_PORT # --ajp13Port=$AJP_PORT # --argumentsRealm.passwd.$ADMIN_USER=[password] # --argumentsRealm.passwd.$ADMIN_USER=[password] # --argumentsRealm.$ADMIN_USER=admin # --webroot=~/.jenkins/war # --prefix=$PREFIX ``` When I do : ``` ps aux | grep -i java ``` I get: ``` root 12912 0.0 0.0 7676 892 pts/0 S+ 19:04 0:00 grep -i java ``` Why will it not show up on a browser even when i specify the 8080 port?
ArmelR/stack-exchange-instruction
{ "qid": 384302 }
stackexchange
109stackexchange_5
en
Hello i am trying to create the folding phenomena of undersampling in matlab, When i undersample the sampling frequency is 135 less than the Nyquist frequency for 70 Hz signal ou will see that it is shifted back by the amount of this new sampling frequency (105-70=35) Hz. as shown in the matlab plot bellow. I want to create the folding effect shown in diagram bellow (shifted copy). Where did i go wrong. This is my code which producedthe plot in the first post. my code is shown as one line for some reason. ``` f1=10; f2=30; f3=70; % twice the sampling rate Fs=1.5*70; % sampling frequency is a bit above 2 times to get all the peaks. Ts=1/Fs; Tn=0:Ts:1; fft_L=length(Tn); y4_samples=10*sin(2*pi*f1*Tn)+10*sin(2*pi*f2*Tn)+10*sin(2*pi*f3*Tn); %stem(Tn_new,y4_samples); ff=fft(y4_samples); ff1 = abs(ff/fft_L); fft2 = ff1(1:floor(fft_L/2)+1); fft2(2:end) = 2*fft2(2:end); f = Fs*(0:fft_L/2)/fft_L; plot(f, fft2) ``` [![the effect i am looking for](https://i.stack.imgur.com/QQdVc.jpg)](https://i.stack.imgur.com/QQdVc.jpg) [![my matlab code ](https://i.stack.imgur.com/AHYix.jpg)](https://i.stack.imgur.com/AHYix.jpg)
ArmelR/stack-exchange-instruction
{ "qid": 66028 }
stackexchange
109stackexchange_5
en
Write a humorous story, set in the Zootopia universe, about Nick Wilde sleeping peacefully at night...when suddenly lots of alarms go off in his bedroom and coordinates begin displaying on the bedroom TV. He jumps out of bed and immediately starts running to those coordinates. It turns out the reason the alarm went off and Nick ran to the coordinates was because Luigi pressed a "EMERGENCY: SUMMON NICK WILDE" button that Mayor Lionheart implemented one day because he was bored and had nothing else to do. Nick groggily tells Luigi that the button is for emergencies only...and immediately collapses from exhaustion. Suddenly, Nick wakes up in his bed, realizing that it was all just a dream, so he goes to tell Judy about it and they both burst into laughter
allenai/WildChat-1M
{ "conversation_hash": "ffde51ba4b8124b4a2d623b9419ec154" }
wildchat
118wildchat_4
en
How often can the truth come out? &lt; Can't wait for truth to come out-last we will hear from guilters Is Sandy telling us there is yet another version of truth? This is getting boring.
nreimers/reddit_question_best_answers
{ "index": 22762657 }
reddit_qa
96reddit_qa_3
en
My instructor wants me to improve my note reading by practicing with some sonatinas. Any suggestions? I've been playing for about 14 years, but my previous teacher never really focused much on it, so I've gotten rusty/lazy.
nreimers/reddit_question_best_answers
{ "index": 953265 }
reddit_qa
96reddit_qa_3
en
what is the difference between a phrase clause and sentence give an example of each?
sentence-transformers/gooaq
{ "index": 2320811 }
gooaq
47gooaq_2
en
Is ECM additive or multiplicative Suppose a 30% accuracy missile is fired at a 30% ECM plane. What is the chance to hit? 1% or 20%? I think I heard it was 1%, but I'm not sure.
nreimers/reddit_question_best_answers
{ "index": 51044324 }
reddit_qa
96reddit_qa_3
en
I have a small text file in markdown : ``` --- title: postWithReference author: auf date: 2010-07-29 keywords: homepage abstract: | What are the objects of ontologists . bibliography: "/home/frank/Workspace8/SSG/site/resources/BibTexLatex.bib" csl: "/home/frank/Workspace8/SSG/site/resources/chicago-fullnote-bibliography-bb.csl" --- An example post. With a reference to [@Frank2010a] and more[@navratil08]. ## References ``` and process it in Haskell with `processCites'` which has a single argument, namely the `Pandoc` data resulting from `readMarkdown`. The bibliography and the csl style should be taken from the input file. The process does not produce errors, but the result of `processCites` is the same text as the input; references are not treated at all. For the same input the references are resolved with the standalone pandoc (this excludes errors in the bibliography and the csl style) ``` pandoc -f markdown -t html --filter=pandoc-citeproc -o p1.html postWithReference.md ``` The issue is therefore in the API. The code I have is: ``` markdownToHTML4 :: Text -> PandocIO Value markdownToHTML4 t = do pandoc <- readMarkdown markdownOptions t let meta2 = flattenMeta (getMeta pandoc) -- test if biblio is present and apply let bib = Just $ ( meta2) ^? key "bibliography" . _String pandoc2 <- case bib of Nothing -> return pandoc _ -> do res <- liftIO $ processCites' pandoc -- :: Pandoc -> IO Pandoc when (res == pandoc) $ liftIO $ putStrLn "*** markdownToHTML3 result without references ***" return res htmltex <- writeHtml5String html5Options pandoc2 let withContent = ( meta2) & _Object . at "contentHtml" ?~ String ( htmltex) return withContent getMeta :: Pandoc -> Meta getMeta (Pandoc m _) = m ``` What do I misunderstand? are there any reader options necessary for citeproc? The bibliography is a BibLatex file. I found in hakyll [code](https://jaspervdj.be/hakyll/reference/src/Hakyll-Web-Pandoc-Biblio.html) a comment, which I cannot understand in light of the code there - perhaps somebody knows what the intention is. ``` -- We need to know the citation keys, add then *before* actually parsing the -- actual page. If we don't do this, pandoc won't even consider them -- citations! ```
ArmelR/stack-exchange-instruction
{ "qid": 54262296 }
stackexchange
109stackexchange_5
en
Self Studying AP Psych Hi, I'm aware that there have been some forums from the past about the topic but I'm looking for the most current information. I'm currently a sophomore and I'd like to self study AP Psych. I've heard a lot of people say it is very easy to do. What I'm planning on doing is reading the Baron's book and making a Quizlet for the vocab. Will this be enough to get a 4 or 5? Also do I just go alert my council that I'd like to take the AP test once it gets nearer? Thanks
nreimers/reddit_question_best_answers
{ "index": 15478941 }
reddit_qa
97reddit_qa_4
en
is anlene milk good for diabetics?
sentence-transformers/gooaq
{ "index": 1272231 }
gooaq
46gooaq_1
en
Native North American species spread around the world? Hi, I live in Pennsylvania and live close to where the spotted lantern fly was introduced. It's an awful bug. It seems like the news always talks about invasive species from China. What are some destructive native North American species that we've spread to the world?
nreimers/reddit_question_best_answers
{ "index": 41508127 }
reddit_qa
96reddit_qa_3
en
First of all I would like to make it clear that this is not a language-X-versus-language-Y question to determine which is better. I have been using Java for a long time and I intend to keep using it. Parallel to this, I am currently learning Scala with great interest: apart from minor things that take some getting used to my impression is that I can really work very well in this language. My question is: how does software written in Scala compare to software written in Java in terms of execution speed and memory consumption? Of course, this is a difficult question to answer in general, but I would expect that higher level constructs such as pattern matching, higher-order functions, etc, introduce some overhead. However, my current experience in Scala is limited to small examples under 50 lines of code and I haven't run any benchmarks up to now. So, I have no real data. If it turned out that Scala *does have* some overhead wrt Java, does it make sense to have mixed Scala / Java projects, where one codes the more complex parts in Scala and the performance-critical parts in Java? Is this a common practice? **EDIT 1** I have run a small benchmark: build a list of integers, multiply each integer by two and put it in a new list, print the resulting list. I wrote a Java implementation (Java 6) and a Scala implementation (Scala 2.9). I have run both on Eclipse Indigo under Ubuntu 10.04. The results are comparable: 480 ms for Java and 493 ms for Scala (averaged over 100 iterations). Here are the snippets I have used. ``` // Java public static void main(String[] args) { long total = 0; final int maxCount = 100; for (int count = 0; count < maxCount; count++) { final long t1 = System.currentTimeMillis(); final int max = 20000; final List<Integer> list = new ArrayList<Integer>(); for (int index = 1; index <= max; index++) { list.add(index); } final List<Integer> doub = new ArrayList<Integer>(); for (Integer value : list) { doub.add(value * 2); } for (Integer value : doub) { System.out.println(value); } final long t2 = System.currentTimeMillis(); System.out.println("Elapsed milliseconds: " + (t2 - t1)); total += t2 - t1; } System.out.println("Average milliseconds: " + (total / maxCount)); } // Scala def main(args: Array[String]) { var total: Long = 0 val maxCount = 100 for (i <- 1 to maxCount) { val t1 = System.currentTimeMillis() val list = (1 to 20000) toList val doub = list map { n: Int => 2 * n } doub foreach ( println ) val t2 = System.currentTimeMillis() println("Elapsed milliseconds: " + (t2 - t1)) total = total + (t2 - t1) } println("Average milliseconds: " + (total / maxCount)) } ``` So, in this case it seems that the Scala overhead (using range, map, lambda) is really minimal, which is not far from the information provided by World Engineer. Maybe there are other Scala constructs that should be used with care because they are particularly *heavy* to execute? **EDIT 2** Some of you pointed out that the println's in the inner loops take up most of the execution time. I have removed them and set the size of the lists to 100000 instead of 20000. The resulting average was 88 ms for Java and 49 ms for Scala.
ArmelR/stack-exchange-instruction
{ "qid": 131636 }
stackexchange
110stackexchange_6
en
I have two tables that I would like to let them share the same sequence to populate the primary key `ID` column. However, I also don't want the user to specify or change the value for the `ID` column. --- By using the code below, I can let two tables share the same sequence. ```sql CREATE TABLE T1 ( ID INTEGER DEFAULT SEQ_1.nextval NOT NULL ); ``` This code will use its own sequence and prevent users from changing or specifying with `INSERT`: ```sql CREATE TABLE T1 ( ID INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL ); ``` --- Is there a way that can both world? Something like this: ```sql CREATE TABLE T1 ( ID INTEGER GENERATED ALWAYS AS ( SEQ_1.nextval ) NOT NULL ); ``` --- Regarding the use case, as `@Sujitmohanty30` asked, the reason that I raised this question: I'm thinking to implement inheritance in the database, consider this [UML diagram](https://i.stack.imgur.com/PRkdN.png) (I can't directly post images due to insufficient reputation, and sorry for being lack of imagination). `ANIMAL` is abstract and all inheritance is mandatory. This means no instance of `ANIMAL` should be created. Furthermore, there is an one-to-many relationship between `ANIMAL` and `ZOO_KEEPER`. Therefore, I came up with this idea: ```sql CREATE SEQUENCE ANIMAL_ID_SEQ; CREATE TABLE HORSE ( ID INT DEFAULT ANIMAL_ID_SEQ.nextval NOT NULL PRIMARY KEY, HEIGHT DECIMAL(3, 2) NOT NULL ); CREATE TABLE DOLPHIN ( ID INT DEFAULT ANIMAL_ID_SEQ.nextval NOT NULL PRIMARY KEY, LENGTH DECIMAL(3, 2) NOT NULL ); CREATE MATERIALIZED VIEW LOG ON HORSE WITH ROWID; CREATE MATERIALIZED VIEW LOG ON DOLPHIN WITH ROWID; CREATE MATERIALIZED VIEW ANIMAL REFRESH FAST ON COMMIT AS SELECT 'horse' AS TYPE, ROWID AS RID, ID -- TYPE column is used as a UNION ALL marker FROM HORSE UNION ALL SELECT 'dolphin' AS TYPE, ROWID AS RID, ID FROM DOLPHIN; ALTER TABLE ANIMAL ADD CONSTRAINT ANIMAL_PK PRIMARY KEY (ID); CREATE TABLE ZOO_KEEPER ( NAME VARCHAR(50) NOT NULL PRIMARY KEY, ANIMAL_ID INT NOT NULL REFERENCES ANIMAL (ID) ); ``` In this case, the use of the shared sequence is to avoid collision in `ANIMAL` mview. It uses `DEFAULT` to get the next ID of the shared sequence. However, using `DEFAULT` doesn't prevent users from manually `INSERT`ing the `ID` field or `UPDATE` the value of it.
ArmelR/stack-exchange-instruction
{ "qid": 63649431 }
stackexchange
109stackexchange_5
en
are hemp seeds legal in uae?
sentence-transformers/gooaq
{ "index": 1953535 }
gooaq
46gooaq_1
en
Why does Tyro have 2 record dive nodes for minor Silence Resist? I half-dived Tyro and just noticed he has a Minor Silence Resist node in both Sage and Legend. Do these behave like accessories and not stack? Or is the mechanism different for record spheres and relics? If it's the former, we are being cheated out of a node bonus. If it's the latter, then how does this work? Sorry if this is old news.
nreimers/reddit_question_best_answers
{ "index": 20888687 }
reddit_qa
97reddit_qa_4
en
I have two files and I need catch the last column of a file and append to other file. file1 ``` 1 2 3 1 2 3 1 2 3 ``` file2 ``` 5 5 5 5 5 5 ``` Initial proposal ``` #!/usr/bin/env bash column=$(awk '{print $(NF)}' $file1) paste -d',' $file2 < $column ``` Expected result file2 ``` 5 5 3 5 5 3 5 5 3 ``` But, This script does not work yet OBS: I do not know how many columns have in the file. I need more generic solution.
ArmelR/stack-exchange-instruction
{ "qid": 30468425 }
stackexchange
108stackexchange_4
en
I have a table like this: ``` Store_Id | Week ---------+-------- A1 | 201601 A1 | 201602 A1 | 201604 A1 | 201606 A1 | 201607 A2 | 201552 A2 | 201603 A2 | 201604 A2 | 201605 A2 | 201608 ``` I need to derive a dynamic week column next to this which will be ideally looking like this: ``` Store_Id | Week | Dynamic_Week ---------+--------+------------- A1 | 201602 | 1 A1 | 201603 | 2 A1 | 201605 | 4 A1 | 201606 | 5 A1 | 201607 | 6 A2 | 201552 | 1 A2 | 201603 | 4 A2 | 201604 | 5 A2 | 201605 | 6 A2 | 201608 | 9 ``` The logic is: the MIN(Week) for each store is considered as the first week of sales for the corresponding store. The preceding values in the dynamic week will be incremented based on the reference of the first week of sales on each store. I tried `Row_Number()`, `RANK()`, `DENSE_RANK()`, but couldn't get a solution that's needed. All the three things didn't work. Can anyone suggest me with possible solution. Thanks in advance.
ArmelR/stack-exchange-instruction
{ "qid": 43270533 }
stackexchange
109stackexchange_5
en
I'm trying to close my account by withdrawing all my XRP into a new account. But the Ripple client insists on keeping a minimum balance of 50 XRP. How can I properly close this account?
ArmelR/stack-exchange-instruction
{ "qid": 10255 }
stackexchange
107stackexchange_3
en
are used paper plates recyclable?
sentence-transformers/gooaq
{ "index": 756293 }
gooaq
46gooaq_1
en
I have an old computer from around 1995. It's from a computer brand that I've never heard of called Samanna Compu-Solutions. I am unsure of the model. The problem is, I only have one PS/2 port to work with. Since the computer is from 1995, there are no USB ports. The PS/2 port is labeled as a mouse port, and I've tried a keyboard on there to no avail. My question is: why isn't there a keyboard port? Without a keyboard, there's no way to get past the BIOS. I'm also getting a CMOS checksum error. The computer is using the Award Modular BIOS v4.51PG. It has 64MB of RAM, and a Pentium MMX 233MHz CPU. > > Keyboard error or no keyboard present > > CMOS checksum error - Defaults loaded > > > > Press F1 to continue, DEL to enter SETUP > > > Without a keyboard, I can't press F1 to continue, or press DEL to enter the setup. I have tried: * Clearing the CMOS/removing the motherboard battery * Unplugging the keyboard and plugging it back in (while the computer is off, I've heard PS/2 is not hot swappable) Basically, what I'm trying to solve is how I can use a keyboard and mouse at the same time. Any help would be appreciated.
ArmelR/stack-exchange-instruction
{ "qid": 15970 }
stackexchange
109stackexchange_5
en
how to connect disabled iphone to itunes on macbook?
sentence-transformers/gooaq
{ "index": 1441215 }
gooaq
47gooaq_2
en
My boss told me to weed the parking lot... I work at a golf course as a cart attendant. My boss tells me I need to "weed the cracks in the parking lot". I asked if we had any round-up... He hands me a rusty butter knife and tells me to get to it. I get paid $6 an hour. Minimum wage here is $7.40. (I am 16 and this is technically "seasonal help", and apparently, I make tip money, but I have made $3 in tips total this year.)
nreimers/reddit_question_best_answers
{ "index": 3714307 }
reddit_qa
97reddit_qa_4