query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
172100bbcebc757e7536238d2436df512458a7cb50ec7010bb00b314edb45d12
['f4d0a2d4196b4c18b0f13ede24a3a187']
I am working on a startup which basically serves website. Sorry, I can't reveal much details about the startup. I need some ideas on how spammers and cralwer devs think on attacking some website. And if possible, then a way to prevent such attacks too. We have come up with some basic ideas like: 1. Include a small JS file in the sites that would send an ACK on our servers ones all the assets are loaded. Like some crawlers/bots only come to websites and download specific stuff like images or articles. In such cases, our JS won't be triggered. And when we study our logs, which will have a record of resources requested by the particular IP and if out JS was triggered or not. We can then whitelist or blacklist IP's based on the study. 2. Like email services do, we will load a 1x1 px image on the client side via an API call. In simple words, we won't add the "img" tag directly in out HTML, but rather a JS that calls an API on our server that returns the image to the client. 3. We also have a method to detect Good bots like that of google which indexes our pages. So we can differentiate between good bots and bad bots that just waste our resources. We are at a very basic level. Infact, all our code does right now is logs the IP's and assets requested by that IP in elasticsearch. And so we need ideas on how people spam/crawl websites via cralwers/bots/etc. So we can come up with some solution. And if possible, please also mention the pros and cons and ways to defend against your ideas too. Thanks in advance. If you share your ideas, you'll be helping a startup which will be doing a lot of good stuff.
9407d85150e6dbf7c8285f5ff041490d1eaaadf7d0a6ee1a826e7846800353fd
['f4d0a2d4196b4c18b0f13ede24a3a187']
I belong to a newly setup college, and have teachers who are not so talented. I personally have spotted them making mistakes many times. This is because they themselves have false knowledge. Hence I teach programming and networking to myself. As I cannot rely on them. Now since this is the scenario, I have fallen into a big doubt. One of my teachers of the subject Analysis Of Algorithms, had said, "when int main() returns 0, all the buffers are closed, all the resources utilized are cleared off, and space is created for other programs. Hence it is a good practise to return 0". To which I argued, "mam, we always knew that it is only to indicate that the program has completed exexution successfully" To which she said, "you are partly correct". Which clearly means she meant returning a non zero doesnt release resources. Now who is correct, I or she? Should I ask for a money back?
7d6215057e3043635a9d1c8316558f463966db5364a2455895b8fc370201f81e
['f4df62ad90b3475ba533501b1aba2791']
You can use below query along with WITH clause and refer DATE_RANGE as a table in your From clause and refer MY_DATE in place of '2020-08-19'. WITH DATE_RANGE AS ( SELECT DATEADD(DAY, -1*SEQ4(), CURRENT_DATE()) AS MY_DATE FROM TABLE(GENERATOR(ROWCOUNT => (365000) )) where my_date >='01-Jan-2000' ) SELECT * FROM DATE_RANGE
cc4cfd761ce4407b5854999ccc7ce4277f8992682f02f4ed7e91a38486b2836e
['f4df62ad90b3475ba533501b1aba2791']
<PERSON>, I got your requirement. Here is my solution, it works in Snowflake, consider Test2 as your table name select * from Test2 where (case when MONTH(current_date) <6 and (marked_yr in (YEAR(current_date) ,YEAR(current_date)-1)) then 1 when MONTH(current_date) >=6 and (marked_yr in (YEAR(current_date) ,YEAR(current_date)+1)) then 1 else 0 end) = 1
e44cf1a402e8bc558e03e505d75bbbcc1734d2cdf0b7304360031b6199fd4b12
['f4e3ad1cb8414324b54212a4be1379c8']
Answered my own question: When using require in the Gulp task, you need to supply a path to a file, not just a name. gulp.task("scripts-vendor", function () { browserify() .transform(debowerify) .require("./bower_components/phaser/phaser.js") .pipe(source("vendor.js")) .pipe(gulp.dest("./tmp/assets")); }); Notice that require("phaser") became require("./bower_components/phaser/phaser.js"). Doing this works, although the bundle takes forever to build (around 20 seconds). You're probably better of just loading giant libraries/frameworks directly into your app through a <script> tag and then using Browserify Shim. This let's you require() (in the NodeJS/Browserify sense) global variables (documentation).
9c3f88e90b3f3dcc50615e0e9967895212c091c90342c17a9e02bc2e916aaa38
['f4e3ad1cb8414324b54212a4be1379c8']
In your init method, put this: budgetArray = [[NSMutableArray alloc] init]; Also, why not use dictionary and array literal syntax? -(void)applyCCCSWeights { NSMutableDictionary *valueDict; NSString *newAmount; for (NSDictionary *budgetElement in [self budgetArray]) { valueDict = [budgetElement mutableCopy]; newAmount = [NSString stringWithFormat:@"%0.2f", [[self afterTaxIncome].text floatValue] * [budgetElement[@"cccs_weight"] floatValue]]; valueDict[@"amount"] = newAmount; _budgetArray[0] = valueDict; NSLog(@"%0.2f (%0.2f)", [budgetElement[@"amount"] floatValue], [[self afterTaxIncome].text floatValue] * [budgetElement[@"cccs_weight"] floatValue]); } [self.budgetTableView reloadData]; } Notice that [[self budgetArray] replaceObjectAtIndex:0 withObject:valueDict]; becomes: _budgetArray[0] = valueDict;
2db028744ef5e8e0f7642dfffdf55078563ed1004fc6c93f8acf7146a395ff49
['f501c1c983c84c49a2dac55d6bd1cfd8']
Sometimes when I compile C++ projects, the build goes successful by saying "Build Succeeded". But, if you clicked on error list, it may show some errors such as "IntelliSense: incomplete type is not allowed". My question is what is that "IntelliSense" errors and should I have concerns on output executable file?
edd0d6bd5fecaec5f431afba35fd71fd4ffab9646a870106f7433a86bef5c1de
['f501c1c983c84c49a2dac55d6bd1cfd8']
I am trying to convert form DateTime value string such as "Feb 13, 2015 20:03:36:820" to DateTime values in Microsoft Excel. I know I can convert from a string such as '01/12/2015' to Date. But I want both date and time parts. Is there anyway we can do it?
29157f92b4d71c7600bf2e74793cf890b0e8e23222ecffc8fa913708106bcefa
['f5043f569bf54f5798380950ff6f75af']
If you are using this package, then you are in luck - it has a built in lcm method for you: link to the docs If you want to see the implementation of it, check out the source over at the Github repository. Implementation of the method inside the above library: Source Hope this helps you out :)
db73e44e7c8302fec6a6605596963b1b9aa4961d80cdef97667638abd748bd35
['f5043f569bf54f5798380950ff6f75af']
Let's start from the top: The JSON you have pasted above is not valid - objects must be key-value pairs. Your args key does not have a value. args is an array of strings that are passed in to the command in your configuration. In your case this would be ["${workspaceFolder}/main.py"] if your main is in the root directory of the workspace. To have a nice dynamic list of secondary arguments (in your case files) you can use the runtimeArgs key. It is also a list of strings, in your case it would be ["test_file.xlsx"] Documentation about the VSCode debugger can be found here: https://code.visualstudio.com/docs/editor/debugging Hope this helps :)
06c87465afad6282bd1dcf3d9f739c35e1389e9c77d20ab08280ed2d3c74eb95
['f50686edbfa041b09fa4b93a80c10fd3']
we have two tables name "students" AND vouchers. we create the voucher of the fee and display voucher, and we also want to display the roll no of that particular student which was we create voucher, but we can't get the roll any of student table ... we got error,enter image description here I've added the code below <?php if(isset($_GET['session_id'])):?> <?php $student_session= $_GET['session_id'];?> <?php $stu = "select * from students where session_id='$student_session'"; $run_stu = mysqli_query($con,$stu); while($row = mysqli_fetch_array($run_stu)){ $stu_id = $row['student_id']; $stu_roll = $row['roll_no']; $stu_name= $row['s_name']; ?> <?php if (isset($_POST['many_voucher'])){ $student_roll = $_GET['roll_no']; $student_session_post = $_GET['session_id']; $fee_date = $_POST['fee_date']; $adm_fee = $_POST['adm_fee']; $reg_fee = $_POST['reg_fee']; $tution_fee = $_POST['tution_fee']; $lab_fund = $_POST['lab_fund']; $misc_dues = $_POST['misc_fund']; $others = $_POST['others']; $total_amount = $_POST['total_amount']; $due_date = $_POST['due_date']; $remarks = $_POST['remarks']; $query = "Insert INTO vouchers(session_id,roll_no,fee_month,adm_fee,reg_fee,tution_fee,lab_fund,misc_dues,other_dues,total_amount,due_date,remarks) VALUES('$student_session_post','$student_roll','$fee_date','$adm_fee','$reg_fee','$tution_fee','$lab_fund','$misc_dues','$others','$total_amount','$due_date','$remarks')"; if(mysqli_query($con,$query)){ //echo "<script>alert('Run')</script>"; }else{ echo"query failed"; } } ?>
102edae630a05f94edaf646783a27440ccab9aae689ca51c22558474120e3400
['f50686edbfa041b09fa4b93a80c10fd3']
we are facing problem to get month form database that have already posted, in another page using javascript get method... when page redirect to another pag, the output is 2008, and its false, while true value is 2018-10. here is code <input type='button' class='btn btn-primary btn-md' onClick='print_all_vouchers($session,$get_month)' value='Print All'/> function print_all_vouchers(session_id,months){ $('#loading_img').fadeIn('fast'); $.get('ajax/vouchers.php? session_id='+session_id+'&months='+months,function(data){ $('#loading_img').fadeOut('fast'); data=$.trim(data); if(data!=''){ $('#print_this').html(data); $('#print_this').printThis({printContainer:false}); } else{ alert('Error'); } }); } //------vouchers.php------// <?php if(isset($_GET['months'])): echo $month = $_GET['months']; if(isset($_GET['session_id'])): $session_id= $_GET['session_id'];?> <?php endif;?> <?php endif;?>
35a2c5b5f10e555be5f5b70a4f7f8262c5521f773696eb11ddd513a61a283147
['f5140d7c79b545a197c31c2680ffe5ef']
Basically I can't pass build properties to Library var call without extra nonsense. jenkinsfile relevant chunk: tc_test{ repo = 'test1' folder = 'test2' submodules = true refs = params.GitCheckout } That results in error java.lang.NullPointerException: Cannot get property 'GitCheckout' on null object This, however, works: def a1 = params.GitCheckout tc_test{ repo = 'test1' folder = 'test2' submodules = true refs = a1 } The contents of the vars/tc_test.groovy in shared library : def call ( body ) { def config = [:] body.resolveStrategy = Closure.DELEGATE_FIRST body.delegate = config try { body() } catch(e) { currentBuild.result = "FAILURE"; throw e; } finally { config.each{ k, v -> println "${k}:${v}" } } } I'm not really good with groovy, so it might be something obvious.
68b45b0eee841b006e2367b10101487e3229ff2923031d19befc5b443f5e9a98
['f5140d7c79b545a197c31c2680ffe5ef']
Got the answer from Jenkins JIRA. Small workaround is using maps instead of closures: tc_test ([ repo: 'test1', folder: 'test2', submodules: true, refs = params.GitCheckout ]) May have drawbacks, but for me that worked perfectly. Still have to transfer params as argument to have access to them, but at least the code makes more sense now.
97084395f7bfec7e1ad98dd511ecfbbcd2831e504797ef4afa9d39962d5a8b2f
['f5180dce71db40a1b0e5a8ffd57baea9']
You can put the classes in a separate DLL (class library). When you create that DLL using another solution you will not see the classes in your solution explorer of the project where you include them. Don't forget to add a reference to the DLL (class library) in your main project.
3722b4c2f24e885d187f561c8b54bd10a3f05294eba8d0956e03892801315fa1
['f5180dce71db40a1b0e5a8ffd57baea9']
Is this what you mean? var fullList = BLogic.GetDataStoreCompaniesForFilterList(); var filterList = fullList.Where( ( w => w.Name.ToLower().StartsWith(filterString.ToLower()) ) || ( filterString.Length > 2 && w.Vat.ToLower().Contains(filterString.ToLower()) ) || ( w.IndustryLang != null && w.IndustryLang.Where(ww => ww.LanguageId == usrX.LanguageId).Select(s => s.Name.ToLower()).Contains(filterString.ToLower()))).ToList(); I added some parenthesis.
c35cceb3ffe6f4f53d720ec32d714275c3e7660aac171d14dcef3233f811c68d
['f51d0dd8cb3743a585f1d1107c2a11bc']
I did get a reply in firebird-support from <PERSON>, saying not to worry: the file copy util will read the data from the cache, so it doesn't matter if it's flushed to disk or not. The important thing is that there's no data inside the Firebird superserver process or the nbackup process that hasn't been flushed to Windows yet, but I think we can rest assured that this is never the case. For me, the problem is that FastCopy checks the timestamp after completing the copy, and if it's been updated since the copying started, it will delete the copy and exit with failure code.
3e16cbb3597ef5fe5eb14cd838515166cb6215b81990e61b225225948350d723
['f51d0dd8cb3743a585f1d1107c2a11bc']
We have a Firebird database that's almost 200 Gbyte in sice, and for performance we have forced writes off. Please don't debate the risks of forced writes, we are aware of them. This is Firebird 3.0.4 on Windows Server 2016. For backup, we use alter database begin backup and alter database end backup, and copy the main database file using FastCopy. We can see that the delta file is created right away when executing alter database begin backup. But the main database file usually gets an updated timestamp quite some time later, often within a few minutes, but sometimes it takes longer. I assume this is caused by forced writes off and the fact that Windows may delay some writes for an arbitrary amount of time. In other words, I assume that the Firebird engine does in fact not write to the main databse file after alter database begin backup, but writes that were made before this may be delayed by Windows for quite a while, meaning it's not in fact safe to start copying the main database file until Windows has flushed all writes. Now, my question is how to properly handle this to achieve safe and reliable backups? Up to now I've scheduled file copy to 3 hours after alter database begin backup, and I also included a dummy transaction right after the alter database begin backup. But are there better approaches? I came up with the idea to use gfix to switch forced writes on before executing alter database begin backup (and switch it back off later). I assume this will cause the locked state to be flushed to disk right away, but I also assume that writes that were made before switching forced writes on will still suffer the arbitrary delay from Windows' write cache. Correct? Or is gfix or the Firebird engine actually able to force flush all previous writes that are already in the Windows write cache? Another idea is to use Sysinternals Sync util to flush Windows' write cache for the entire disk. For overall system performace, this would not be a problem, considering backup is scheduled to a low-traffic time of day. We could use nbackup instead of FastCopy. Would this help? In other words: would nbackup's reads of the main database file see the new still-cached versions of the database pages being copied, or would it see the outdated on-disk versions? In fact, I'm not sure if FastCopy actually sees the new still-cached versions or not, but it fails when it notices that the source file's timestamp has been changed since it started copying, so it fails anyway. There's no apparent way to avoid this.
5d7a8836a27c857cc5bab3eb6e4c0f80dbf36d439e965c6bcdee767b256d9607
['f525829f1bad4b6c824118eb76a25486']
I am trying to automatically update Meteor, to be more specific Meteor-based Telescope framework with json regularly, each hour. To be more specific, json will be generated by Kimono Labs. So I am just trying to glue the two together. Each hour when json is updated by Kimono, my Meteor/Telescope should import and tag the relevant updates and post them. Please direct me refer me to some relevant sources. I apologize in advance if this is very newbie or poorly-articulated question!
68967eceb17e67fc531fa2ec953f2968e63c29650e2307ea8c2c3c2262f32205
['f525829f1bad4b6c824118eb76a25486']
I've almost completed the course on Udemy on web development but stumbled at the very last step. I really hope someone will be able to help me out as this seems to be a very simple thing that I'm struggling with. The problem seems to be with HttpResponseRedirect(reverse('index')) that is triggered when a user clicks on the Log In link. Thank you very much! Error is triggered at http://<IP_ADDRESS>:8000/basic_app/user_login/ NoReverseMatch at /basic_app/user_login/ Reverse for 'basic_app/user_login' not found. 'basic_app/user_login' is not a valid view function or pattern name. Error during template rendering In template /Users/maxa/Dropbox/workspace/2018/projects/python-django-udemy-bootcamp/myplayground/Django_level_5/learning_users/templates/basic_app/base.html, error at line 6 Project's urls.py: from django.contrib import admin from django.conf.urls import url, include from django.urls import path from basic_app import views urlpatterns = [ url(r'^$',views.index, name='index'), path('admin/', admin.site.urls), url(r'^basic_app/',include('basic_app.urls')), url(r'^logout/$',views.user_logout,name='logout'), ] App's urls.py (basic_app/urls.py): from django.conf.urls import url from basic_app import views # TEMPLATE RULES app_name = 'basic_app' urlpatterns = [ url(r'^register/$',views.register,name='register'), url(r'^user_login/$',views.user_login,name='user_login'), ] App's views.py (basic_app/views.py): from django.shortcuts import render from basic_app.forms import UserForm, UserProfileInfoForm from django.contrib.auth import authenticate, login, logout from django.http import HttpResponseRedirect, HttpResponse from django.urls import reverse from django.contrib.auth.decorators import login_required # Create your views here. def index(request): return render(request,'basic_app/index.html') def register(request): registered = False if request.method == "POST": user_form = UserForm(data=request.POST) profile_form = UserProfileInfoForm(data=request.POST) if user_form.is_valid() and profile_form.is_valid(): user = user_form.save() user.set_password(user.password) user.save() profile = profile_form.save(commit=False) profile.user = user if 'profile_pic' in request.FILES: profile.profile_pic = request.FILES['profile_pic'] profile.save() registered = True else: print(user_form.errors,profile_form.errors) else: user_form = UserForm() profile_form = UserProfileInfoForm() return render(request,'basic_app/registration.html',{'user_form':user_form,'profile_form':profile_form,'registered':registered}) def user_login(request): if request.method == 'POST': username = request.POST.get('username') password = request.POST.get('password') user = authenticate(username=username,password=password) if user: if user.is_active: login(request, user) return HttpResponseRedirect(reverse('index')) else: return HttpResponse("Your account is not active.") else: print("Someone tried to log in and failed") print("Username: {}. Password: {}".format(username,password)) return HttpResponse("invalid login details supplied!") else: return render(request,'basic_app/login.html',{}) @login_required def user_logout(request): logout(request) return HttpResponseRedirect(reverse('index')) App's base.html (templates/basic_app/base.html): <!DOCTYPE html> <html> <head> <title></title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="container"><ul class="nav navbar-nav"> <li><a href="{% url 'index' %}" class="navbar-brand" class="nav-link">Home</a></li> <li class="nav-item"><a href="{% url 'admin:index' %}" class="nav-link">Admin</a></li> <li class="nav-item"><a href="{% url 'basic_app:register' %}" class="nav-link">Register</a></li> {% if user.is_authenticated %} <li><a href="{% url 'logout' %}" class="nav-link">Log Out</li> {% else %} <li><a href="{% url 'basic_app:user_login' %}" class="nav-link">Log In</a></li> {% endif %} </ul></div> </nav> <div class="container"> {% block body_block %} {% endblock %} </div> </body> </html> App's login.html (templates/basic_app/login.html): {% extends 'basic_app/base.html' %} {% block body_block %} <div class="jumbotron"> <h1>Please login</h1> <form action="{% url 'basic_app/user_login' %}" method="post"> {% csrf_token %} <label for="username">Username:</label> <input type="text" name="username" value="" placeholder="Enter Username"> <label for="password">Password:</label> <input type="password" name="password"> <input type="submit" name="" value="Login"> </form> </div> {% endblock %} Thank you very much!
3c34ac1f83be01f33260d9806ce829a99749eeb67fe6ebdcc857e98a80d8ff9d
['f53dad0887e244d28de6648ccd691f83']
I just started developing Xamarin But I encountered a problem I have a login screen and I want to play gif there but unfortunately no images are coming Works well for png and jpeg files my code is below; Content = new StackLayout { Padding = new Thickness(10, 40, 10, 10), Children = { new Label { Text = "Versiyon:"+DependencyService.Get<INativeCall>().getApplicationVersion(), FontSize = Device.GetNamedSize(NamedSize.Large, typeof(Label)), TextColor = Color.White, HorizontalTextAlignment=TextAlignment.Center }, new Image { Source = "a.gif" }, username, password, btnLogin, indicator, infoServer, infoUpdate } };
05a6103d3330e90414052446d4c17d12d6116f93b74a8bc57e01f6061832448d
['f53dad0887e244d28de6648ccd691f83']
I'm new to c. i have a problem please help me I am reading from the file. But I want to read the file 24 lines first and I want to ask the user, okay or not? if the user wants to continue I will read 24 more lines int main(int argc, char* argv[]){ char const* const fileName = argv[1]; FILE* file = fopen(fileName, "r"); char line[256]; int i=0; while (fgets(line, sizeof(line), file)) { for(i=0;i<24;i++){ printf("%s", line); i++; } } fclose(file); return 0; I wrote something like this, I'm sure it's not right, help me
6ad28e00a192cee7e522ac969ccaef14384f81df8e20f638b67bf0a9aa47b077
['f549aca3407c4995a8616a1100f72f11']
My ViewController wants to display some data based on a CloudKit query. My CloudKit code is all in a separate class. That class has a function called loadExpenses() that fetches some Expenses entities from CK. I want to be able to call loadExpenses() from the VC, so I need a completion block provided by the function to update the UI from the VC. This is what loadExpenses() looks like: func loadExpenses() { let pred = NSPredicate(value: true) let sort = NSSortDescriptor(key: "creationDate", ascending: true) let query = CKQuery(recordType: "Expense", predicate: pred) query.sortDescriptors = [sort] let operation = CKQueryOperation(query: query) operation.desiredKeys = ["person", "action", "amount", "timestamp"] operation.resultsLimit = 50 var newExpenses = [Expense]() operation.recordFetchedBlock = { (record) in let recordID = record.recordID let person = record["person"] as! String let action = record["action"] as! String let amount = record["amount"] as! Double let timestamp = record["timestamp"] as! NSDate let expense = Expense(person: person, action: action, amount: amount, timestamp: timestamp) newExpenses.append(expense) } // This is the part that needs to be changed operation.queryCompletionBlock = { [unowned self] (cursor, error) in dispatch_async(dispatch_get_main_queue()) { if error == nil { self.objects = newExpenses self.tableView.reloadData() self.refreshRealmDataFromCK() } else { let ac = UIAlertController(title: "Fetch failed", message: "There was a problem fetching the list of expenses; please try again: \(error!.localizedDescription)", preferredStyle: .Alert) ac.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) self.presentViewController(ac, animated: true, completion: nil) } } } CKContainer.defaultContainer().privateCloudDatabase.addOperation(operation) } Obviously the last part won't execute, considering all those self.property belong to the VC (I kept them just to show what I need to do in the VC). As I said, I want to be able to call this function from the VC and get/use a completion block to update those properties. How do I do that?
85851ab3feb0b2d4b00d647f3bf3c1c8ef933e3c6d56471ce2f09830ae438a5b
['f549aca3407c4995a8616a1100f72f11']
I have a overlayView that usually covers the bottom 10% of a tableView. When I tap anywhere on the overlayView, the view slides up and covers 50% of the tableView. At the second (selected) state, I want to be able to go back to the first state by touching anywhere on the tableView, outside of the overlayView. However, I want scrolling on the tableView (and any other action such as selecting a row) to be disabled until the view is back at the resting (bottom 10%) state. Please ignore the "Edit" and "add" buttons, consider them disabled. How do I do that?
610cb8b6137f6784ee189112014de14c0e6547146fcb8bec5e47ee5185fe336e
['f5576a388d9845a6ba85de11d546c248']
Whats the best way to make the program? I connected the program to a database through JDBC. I have 2 integer typed columns. In my program, I put on GUI in a table the number1, number2 and number1+number2. What would be the best: if I store the number1+number2 as a third column in database and all I do I read from database and put on gui OR read the first, second column, sum them and then put on GUI?
59dc69f52da606e133ca57f6179d413242f228fda3a46819b28ac8cd0715b63d
['f5576a388d9845a6ba85de11d546c248']
I have a JSONParser class where I have this: Database db = new Database(/* Need context here! */); In the Database class I have this: public Database(Context context) { super(context, DATABASE_NAME, null, 1); SQLiteDatabase db = this.getWritableDatabase(); } How am I supposed to give a context in the Database constructor? Thanks for any help...
3d1315864602ef1fd4ed357ff5363c2c9433235f2d5d2690123a1a254374e53b
['f5576add6db8455b8f58ab8216f7bf42']
You can use conditional statements to test for those values and tally them In your example, the Code: =IF(OR(A3 = $D$3, A3 = $D$4, A3 = $D$5, A3 = $D$6, A3 = $D$8), 1, 0) I've placed this code in column B in cell B3. I can than click and drag on the plus sign to fill the cells below it adjacent to all of the A column entries and it will test them against the values referenced in your D column. I could put these functions anywhere in my workbook I wanted, but since your B column is empty, it makes it easy for me visually to verify that we have a 1 where we should and a zero where we should. Then you can auto-sum the column and voila, your number of English credits, which you can use for whatever you wish. If you really want to have all of the duplicate words in your table, you can skip the ones and zeros and put: =IF(OR(A3 = $D$3, A3 = $D$4, A3 = $D$5, A3 = $D$6, A3 = $D$8), "Credit", "") Directly into your table (changing A3 to A4, A5, etc. as needed). Good Luck!
926208a9a6dc12ab82a3380524a89e14ee04cc86bcc9fc6348286e9fa9039341
['f5576add6db8455b8f58ab8216f7bf42']
Android does not have an API specifically for Bluetooth 3.0 or even just BLE. It provides a basic BluetoothProfile.ServiceListener API and several methods for their own Bluetooth Class, but in every case they abstract away hardware details, I would try for a newer open-source stack if possible, but none that I have seen appear to allow you to access the speed protocols, not sure why you wish to manipulate them directly, as long as the standard libraries compile to functioning Bluetooth on your device.
94dd2db24f3ed6498c181dbb7dbc57cbddf475a689175a287c38a51bb4e75e8a
['f557a28848a24bbb873a3cf178d9176c']
Shogun also has GPU support of some of the operations used in the NN code. This is work in progress though. At this point in time, other libraries might be faster. We mostly built these networks in there in order to be able to easily compare them to the other algorithms in the toolbox. The advantage, however, is that you can use it from a large number of languages (while internally, C++ code is executed) -- useful if you don't want to use python. Here are some IPython notebooks that you could use as a basis to compare: autoencoders for denoising and classification (convolution) networks for digit classification We appreciate any experience to be shared. Shogun is in constant development and especially the NNs attract a lot of people to work on them, so expect things to change. If you are interested in helping GPU-fying Shogun, please let us know.
9617d2183a9fdae253d23727d38c7efaa998483dfcb00e69ad256e2705ea294c
['f557a28848a24bbb873a3cf178d9176c']
In Shogun 6.1.3 (and earlier versions), you can use a (global) static call Math.init_random(seed). Since having a global seed leads to reproducibility issues in multi-threaded settings, in the develop branch of Shogun, we have recently removed this. Instead you can set the seed (recursively) of particular objects using obj.put("seed", my_seed). Or, even simpler, using kwargs style initializers in Python: km = sg.machine("KMeans", k=2, distance=d, seed=1). Both of those are documented in the generated meta examples, using the 6.1.3 and develop branch respectively. The website examples will be updated with the next release.
5573c743660451d03d089557ad1bec2cfd3e479c457e11e0cadbf0577a8583fc
['f562e9ac175f4e0fa4b97fb3d8edf957']
Tengo un dilema, ya que estoy intentando generar un archivo XML apartir de una fuente de datos, tengo una variable string, la cual me guarda un formato XML que me retorna mi base de datos, lo que quisiera saber es ¿cómo puedo generar un archivo y guardarlo en un directorio apartir de esa fuente de datos? Estoy ocupando c# como lenguaje, no sé si pudieran ayudarme. ¡Gracias!
8dc706198a0eca481b7e258980fdc6d8490712984d0414c39857dd5ef5fc5a41
['f562e9ac175f4e0fa4b97fb3d8edf957']
The question goes like this: There's a thermodynamic cycle of an engine, operating with an ideal monoatomic gas. What'll be the amount of heat extracted from the source in a single cycle? My Approach: The work done by the gas is the area enclosed by the cycle, $$\Delta W = P_0 V_0$$ By the first law of thermodynamics, $$\Delta U = \Delta Q - \Delta W$$ Since, in a cycle $\Delta U = 0$, $$\Delta Q = \Delta W = P_0 V_0$$ But the book says that the answer is $(13/2)P_0V_0$. Where I'm possibly going wrong?
786e8d4fd3190f47effb5507d45c5e9bbd91c5ba6f2410cf836b02603b771074
['f56764aff54d4e339dabd05f5c8b4983']
SO it turns out it much easier that i thought.. 1) separate them by single byte and put them in a buffer and & operate them individually and you will get the data. thanks for all the support. ** byte input = (byte)( buffer[10]);//1 byte var p_timeout = (byte)(input & 0x7F); var p_s_detected = (input & 0x80) == 0 ? false : true; input = (byte)( buffer[11]);//1 byte var p_o_timeout = (byte)(input & 0x7F); var p_o_timeout_set = (input & 0x80) == 0 ? false : true; var override_l_lvl = (byte)(buffer[12] & 0xff);//1 byte var l_b_lvl = (byte)(buffer[13] & 0xff); //1 byte **
6743f4a75b9307439eec2dc18da7750dbc99668f2ab9e11a619e67298a252286
['f56764aff54d4e339dabd05f5c8b4983']
A simple console code which read the console called ShellStream, private ShellStream Shell; public TelnetConnection(string Hostname, int Port, string MySSHHost, string MySSHRootUser, string MySSHRootUserPassword) { SshConnection(MySSHHost, MySSHRootUser, MySSHRootUserPassword); shell.DataReceived += new EventHandler<ShellDataEventArgs>(shell_DataReceived); /// Created a event } So, a event is created below private void shell_DataReceived( object sender, ShellDataEventArgs e) { ScbyteReceived = e.Data; string result = Encoding.UTF8.GetString(e.Data, 0, e.Data.Count()); ConsoleRead = result; <---------------------here Console.WriteLine(result); } Now I want to read from the event real time, so i create a string variable "ConsoleRead" and passed the "result" to it then in another function i started reading from Console read like below public string ReadWithTimeOut(int Tout) { long mycount = 0; if (!sshClient.IsConnected) return null; StringBuilder sb = new StringBuilder(); do { //ParseTelnet(sb); sb.Append(ConsoleRead); /// <-----------------here System.Threading.Thread.Sleep(TimeOutMs); mycount += TimeOutMs; } while (mycount < (long) Tout); return sb.ToString(); } I know this is not the correct way. can you guys suggest me a better way to read from shell console in real time and pass it to ReadWithTimeOut() method . note i call ReadWithTimeOut method only when needed with a time.
bf2530d2574b405c9ee2239353bb6ed39cf5f7513d5e74b3b184d752ab4a1bac
['f57fd400310645d286cf663225e5973b']
I use NumVerify API in order to get the carrier of my mobile phone. The result of this API is Telefonica Moviles Argentina SA. But my number is ported out, i think the original is COMPANIA DE RADIOCOMUNICACIONES. Do you know any application that helps me to get the original carrier when my number is ported out? I need this because we use another API to send sms according to the carrier.
dcf9f68e2262f2885a06068fffc6b22e8f67b661a7cdaf984f10f508ade57db0
['f57fd400310645d286cf663225e5973b']
i've created a kubernetes cluster using kops and its config file in S3. The problem is that i've modified some resources manually (such as ec2 properties). I would like to know if there is some way to view the changes i've made manually. Hope you can help me.
5c6cca62a9ec2db8d9d9d736851051f25264109ce0c008c31bcf295ab0c2c1ef
['f58099fe51174aa6b5159e49b6468687']
So as I thought there was an easy answer to my problem but I just did not understand some key concepts of React. I've read up on state and props and decided that I need to to pass data from my child to my parent. For this I defined a callback function in my main file (App.js): getAutosuggestInput(value){ // Test logging: console.log(value); this.setState({myfieldname: value}) } Then I passed the function to my component in autosuggest.js: <Autosuggest getInputData={this.getAutosuggestInput} /> In my autosuggest component I called the function inside of the event handler which handles changes. You have to use this.props.functionName here where functionName is the function in the parent: handleChange(event, { newValue }) { this.setState({ value: newValue, }); this.props.getInputData(newValue); console.log("New input value:", newValue); }; So like that I have a function in my parent that sets the textfield value to what was just entered by the user, the value itself comes from the child components handleChange handler which passes the value to my parent. Looks easy when you know what you do but let my tell you it was hard for me :)
3b5accf6fd54a03a1fa9d6aae23d4fcfde5ae686d033b5a605e59797f0dab39c
['f58099fe51174aa6b5159e49b6468687']
I cant comment with my reputation but I am unsure if this qualifies as an answer. I just tested it and the only difference I saw was that the paragraph attribute did add more bottomMargin than the gutterBottom attribute. However in my example it made like a 5px difference between the two.
80c5c5a24ad604087c1876d9c3125a58c6de9fb9a990b73b2120c2d6b83e5b4c
['f5885c76b63e4213afe598697bca9d01']
I created a new Folder I put some files in it I created a new Mercurial repository in this Folder I tried to commit all files using TortoiseHg Until this Point I did this Scenario quite often. But this time i get an error message cannot commit without an active Bookmark. What does this error message mean?
1fea2f7c52781d39b8ad96d64c1900e5eab971f6e274db4ba794cec707304f00
['f5885c76b63e4213afe598697bca9d01']
When I use a variable in PHP which does not exist, I will get a warning/error message. Notice: Undefined variable So usually I'm writing an if-statement to initialize it first. Example 1: if (!isset($MySpecialVariable)) { $MySpecialVariable = 0; } $MySpecialVariable++; Example 2: if (!isset($MyArray["MySpecialIndex"])) { $MyArray["MySpecialIndex"] = "InitialValue"; } $Value = $MyArray["MySpecialIndex"]; The disadvantage is that I have to write $MySpecialVariable or $MyArray["MySpecialIndex"] several times and the program gets bloated. How can I achieve the same result with writing the variable only once? I'm looking for something like GetVar($MySpecialVariable, 0); # Sets MySpecialVariable to 0 only if not isset() $MySpecialVariable++; $Value = GetVar($MyArray["MySpecialIndex"], "InitialValue");
a438734c4e06a53d547f444c743d743d127bb95ad6dc0001bdc33c34ff2e882c
['f58ac396d9434ce9935c27de3f4ade8d']
I think there are diffrent ways of implementing this depending on your skill and time. If i would do it, i would link the pixels that are same color and at the same place by http://en.wikipedia.org/wiki/Connected-component_labeling this method. And then color them. or this: http://en.wikipedia.org/wiki/Flood_fill
8e1637229077e450fe6ea9c29434c8784a84e7592dd07f973c7a3dbcf03e6247
['f58ac396d9434ce9935c27de3f4ade8d']
The problem was that XmlValidatingReader is not only obsolete it is also not doing what is is supposed to be doing. I post my new Validation method basically from here: http://msdn.microsoft.com/en-US/library/as3tta56(v=vs.80).aspx in hopes that is helps someone :) private Boolean m_success = true; private void ValidationCallBack(object sender, ValidationEventArgs args) { m_success = false; Console.WriteLine("\r\n\tValidation error: " + args.Message); } public void validate(string xmlfile, string ns, string xsdfile) { m_success = true; XmlReaderSettings settings = new XmlReaderSettings(); XmlSchemaSet sc = new XmlSchemaSet(); sc.Add(ns, xsdfile); settings.ValidationType = ValidationType.Schema; settings.Schemas = sc; settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack); XmlReader reader = XmlReader.Create(xmlfile, settings); // Parse the file. while (reader.Read()) ; Console.WriteLine("Validation finished. Validation {0}", (m_success == true ? "successful!" : "failed.")); reader.Close(); }
fa96d2d4efe1ad0f7f4567aca7973b6f9576f88c3e5cb3dfa87fcc978dc469c3
['f58ae854615342c78f03cdc7c145e4f6']
I don't know why but in my case Odoo generates models like .py file in new application, but not like folder. If you want use folder for your models you need: 1) import models in your __init__.py like this: # -*- coding: utf-8 -*- import models 2) create __init__.py in folder models and import your all models like this: # -*- coding: utf-8 -*- import my_model_one import one_more_model # etc.
6b0781cdb5b2cc033d5b05507d1697a29d261d01b67187f88119429f844f48c8
['f58ae854615342c78f03cdc7c145e4f6']
About problem. cursorPatients / patients / etc is a class-level variable(static variable). It means you do not have instance and properties at this level. Roughly speaking, You trying to use self to access to an object but object was not created. If I understood correctly you need to change some choices using a Form property. Let's trying to change choices using __init__: class RegisterPatternForm(FlaskForm): patients = SelectMultipleField('Select the patient', validators=[Optional()], choices=[('one', 'one')]) def __init__(self, patients_choices: list = None, *args, **kwargs): super().__init__(*args, **kwargs) if patients_choices: self.patients.choices = patients_choices RegisterPatternForm() # default choices - [('one', 'one')] RegisterPatternForm(patients_choices=[('two', 'two')]) # new choices As you can see patients choices are changing using constructor. So in your case it should be something like this: class RegisterPatternForm(FlaskForm): patients = SelectMultipleField('Select the patient', validators=[Optional()], choices=[]) def __init__(self, myParam: int, *args, **kwargs): super().__init__(*args, **kwargs) self.myParam = myParam self.patients.choices = self._mongo_mock() def _mongo_mock(self) -> list: """ db = MongoClient('localhost:27017').myDb["coll"] result = [] for pt in db.find({"field1": self.myParam}).sort([("id", 1)]): blablabla.... return result Just an example(I `mocked` mongo) """ return [(str(i), str(i)) for i in range(self.myParam)] form1 = RegisterPatternForm(1) form2 = RegisterPatternForm(5) print(form1.patients.choices) # [('0', '0')] print(form2.patients.choices) # [('0', '0'), ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4')] Hope this helps.
ac11febc1589f0cd6de04be7df17e2681f59979c00a33ddd79a28835bd593e6b
['f58de14ac6a24e54b0d5c38015a9064e']
I have experienced similar problem. There are 2 ways of importing modules generally. One is absolute path, the other one is relative path. For absolute path, python uses sys.path to resolve the path, as suggested by above answers. But personally I don't like manipulate sys.path. For relative path, python uses __name__ resolve the path. Say an module has __name__ as package1.package2.module3 and module3 imports module in upper package using from ..packge3 import module4. Python will combine them to get package1.packge3.module4. Details have been illustrated in this post. My solution is adding an /outside dir as the parent dir of /outdir and make outdir as a package by adding __init__.py under /outdir. Then you can add from ..lib.abc import cls in import_abc.py file. The relative path should work
ec6fc8e1f9e011f1bc10bb963daa714fdb578da9837761c3afae3a3147eb7a75
['f58de14ac6a24e54b0d5c38015a9064e']
In your case, the UserProfileUpdateForm already binds with UserProfile, so you don't need to change context data. However, I was facing exactly the same problem when trying to give some initial values to the form by following the doc. So in get_context_data, I have context['form'] = self.form_class(instance=self.post, initial={"tags":",".join([tag.name for tag in self.post.tags.all()])}) This will prepopulate form.tags with a list of tags associated with a post separated by comma. I managed to solve the problem after diving into the source code of UpdateView. In line 81, they have def form_invalid(self, form): """ If the form is invalid, re-render the context data with the data-filled form and errors. """ return self.render_to_response(self.get_context_data(form=form)) If the form is invalid and contains errors, it will call get_context_data with the bound form. I have to pass this form to the template instead of the form I specified in my get_context_data method. In order to achieve that, we need to make some changes to get_context_data. def get_context_data(self, **kwargs): context = super(PostUpdate, self).get_context_data(**kwargs) if 'form' in kwargs and kwargs['form'].errors: return context else: context['form'] = self.form_class(instance=self.post, initial={"tags":",".join([tag.name for tag in self.post.tags.all()])}) return context If there is a form containing errors, it will pass it directly to the template. Otherwise use the one we provide. I am sure there are other solutions. Please post it if you have one. It will help others to learn Django.
a368b55e52a13aa45e1663540cf1162754138b7008b1917154f823c225667222
['f599a202b5a648f3ab8949c8c05aa00e']
First excuse me for my english, is not my native language. Thats the problem. Im trying to construct one form in cakephp 3 and save data into two models, saveAll() function not working. Thats the specific case. There are users, the users have several datas like, username, pass, email, etc.. There are to doctors, doctors are users that have another field, "doctor number" And finally there are patients, patients are users that have illness The relationhips are: users-doctors -> 0-1 doctors-users -> 1-1 users-patients -> 0-1 patients-users -> 1-1 Now my code (Thats bake generated code)(Example with doctors): User TableModel Relationship: public function initialize(array $config) { parent<IP_ADDRESS>initialize($config); $this->table('users'); $this->displayField('id'); $this->primaryKey('id'); $this->addBehavior('Timestamp'); $this->belongsTo('Countries', [ 'foreignKey' => 'country_id', 'joinType' => 'INNER' ]); $this->belongsTo('Rols', [ 'foreignKey' => 'rol_id', 'joinType' => 'INNER' ]); $this->hasOne('Doctors', [ 'foreignKey' => 'user_id' ]); } User Validations: public function validationDefault(Validator $validator) { $validator ->allowEmpty('id', 'create'); $validator ->requirePresence('user_email', 'create') ->notEmpty('user_email') ->add('user_email', 'validFormat', [ 'rule' => 'email', 'message' => 'E-mail must be valid' ]); $validator ->requirePresence('user_username', 'create') ->notEmpty('user_username'); $validator ->requirePresence('user_pass', 'create') ->notEmpty('user_pass'); $validator ->add('user_birthdate', 'valid', ['rule' => 'date']) ->requirePresence('user_birthdate', 'create') ->notEmpty('user_birthdate'); $validator ->requirePresence('user_avatar', 'create') ->notEmpty('user_avatar'); $validator ->requirePresence('user_dni', 'create') ->notEmpty('user_dni') ->add('user_dni', 'validFormat',[ 'rule' => array('custom', '((([X-Z]{1})([-]?))?(\d{7,8})([-]?)([A-Z]{1}))'), 'message' => 'Please enter a valid DNI or NIE.' ]); $validator ->requirePresence('user_name', 'create') ->notEmpty('user_name'); $validator ->requirePresence('user_lastname', 'create') ->notEmpty('user_lastname'); $validator ->add('user_address', 'valid', ['rule' => 'numeric']) ->requirePresence('user_address', 'create') ->notEmpty('user_address'); $validator ->add('user_locality', 'valid', ['rule' => 'numeric']) ->requirePresence('user_locality', 'create') ->notEmpty('user_locality'); $validator ->requirePresence('user_postalcode', 'create') ->notEmpty('user_postalcode'); $validator ->requirePresence('user_phone', 'create') ->notEmpty('user_phone'); $validator ->add('last_conection', 'valid', ['rule' => 'datetime']) ->allowEmpty('last_conection'); $validator ->add('active', 'valid', ['rule' => 'boolean']) ->allowEmpty('active'); $validator ->allowEmpty('token'); return $validator; } Doctor TableModel Relationships: public function initialize(array $config) { parent<IP_ADDRESS>initialize($config); $this->table('doctors'); $this->displayField('id'); $this->primaryKey('id'); $this->hasOne('Users', [ 'foreignKey' => 'user_id', 'joinType' => 'INNER' ]); } Doctor view add: <?= $this->Form->create($doctor) ?> <fieldset> <legend><?= __('Add Doctor') ?></legend> <?php echo $this->Form->input('User.user_email'); echo $this->Form->input('User.user_username'); echo $this->Form->input('User.user_pass'); echo $this->Form->input('User.user_passconfirm'); echo $this->Form->input('User.user_birthdate'); echo $this->Form->input('User.user_avatar'); echo $this->Form->input('User.user_dni'); echo $this->Form->input('User.user_name'); echo $this->Form->input('User.user_lastname'); echo $this->Form->input('User.user_address'); echo $this->Form->input('User.country_id', ['options' => $countries]); echo $this->Form->input('User.user_locality'); echo $this->Form->input('User.user_postalcode'); echo $this->Form->input('User.user_phone'); echo $this->Form->input('User.rol_id', ['options' => $rols]); echo $this->Form->input('specialty'); ?> </fieldset> Doctor Controller add method: public function add() { $doctor = $this->Doctors->newEntity(); if ($this->request->is('post')) { $doctor = $this->Doctors->patchEntity($doctor, $this->request->data); if ($this->Doctors->save($doctor)) { $this->Flash->success(__('The doctor has been saved.')); return $this->redirect(['action' => 'index']); } else { $this->Flash->error(__('The doctor could not be saved. Please, try again.')); } } $this->set(compact('doctor')); $this->set('_serialize', ['doctor']); } Symptoms: User data are not validating User data are not saving Photos: User View Validation Working View image Doctor View Validation User not working View Image Thank you to all that try to help me!
9b1bf723c7ee559141a4aa2504a6033be05ee01351842bea5b00f8c63317b87e
['f599a202b5a648f3ab8949c8c05aa00e']
I'm trying to get a resource value for internazionalization based on the value of an foreach variable. My resource project is named Resources, I reference this on my main project. reference properties When i want to use it. only use something like this: Resources.resourceKey The Problem Now I need to use this but resourceKey is in a variable on a loop @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => Resources.item.Rating) </td> </tr> } This obviusly not working, in Resources has no exists any key named item My solution (Not working) Create a Resource Manager and try to get a string @{ System.Reflection.Assembly resourcesAssembly; resourcesAssembly = System.Reflection.Assembly.Load("Resources"); System.Resources.ResourceManager rm = new System.Resources.ResourceManager(resourcesAssembly.FullName, resourcesAssembly); } @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => rm.GetString(item.Rating)) </td> </tr> } What i'm doing wrong?? Really thnx for help
cc58dcc3535cbd8dd8313666ef4daf10144b81f407a6fd48d7b60b5ae95891f3
['f59ef6279cd245569ff3892c6240bdf9']
This function will return similar results as stated in the question and sorts the subsets and the complete array. getAllSubsets function from How to find all subsets of a set in JavaScript? function getUniqueSortedCombinations(inputArray){ const getAllSubsets = theArray => theArray.reduce((subsets, value) => subsets.concat(subsets.map(set => [...set,value])),[[]]); let subset = getAllSubsets(inputArray) subset.sort((a, b) => a.length - b.length || String(a).localeCompare(String(b))) return subset } console.log(getUniqueSortedCombinations([0,1,2,3]))
3dd49704ab93cf44da0732df4ce44009a6210156a74026b6d6bcf4f6d758e607
['f59ef6279cd245569ff3892c6240bdf9']
I have a Node.js API running express which receives a zipped file from an s3 bucket. I wish to send the file directly to the client-side without having to unzip or write the file to disk. The client script will unpack the zip file in this setup. How can you send a response with a zip file or buffer to then be unzipped by the client-side. Thanks in advance!
8ae7f2cba99e6aa46785ebdd154f2130ac4c803fc61019f9d939d07b26e08873
['f5a57b7dd1454892a4405c00d80c07a7']
I'm making an Android app that needs to be able to see local network devices (either names or ip's). Currently I can scan the network and find the local IP's of devices. However it takes so long the user sees a black screen loading for a couple minutes while it searches the network. Here is the code that I'm currently using: private ArrayList<String> scanSubNet(String subnet) { ArrayList<String> hosts = new ArrayList<String>(); InetAddress inetAddress = null; for (int i = 1; i < 100; i++) { try { inetAddress = InetAddress.getByName(subnet + String.valueOf(i)); if (inetAddress.isReachable(1000)) { hosts.add(inetAddress.getHostName()); Log.d("ERRORID", inetAddress.getHostName()); } } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return hosts; } There has to be a faster way to search for network for devices right?
0cb0b35c1fb42bccd79e9c6f29bc3d573a07b4b4d924f13b5df15c0aec601253
['f5a57b7dd1454892a4405c00d80c07a7']
Hey I'm trying to have the website I'm making send a cookie to the user then display a webpage. So I've found http://alexmarandon.com/articles/mochiweb_tutorial/ as the only real tutorial about how make a cookie but it seems to error out for me. My loop looks something like this (my make_cookie, get_cookie_value, render_ok and get_username are the same as his except I use 'mename' as the key instead of 'username') : loop(Req, DocRoot) -> "/" ++ Path = Req:get(path), try case dispatch(Req, valid_urls:urls()) of none -> case filelib:is_file(filename:join([DocRoot, Path])) of true -> %% If there's a static file, serve it Req:serve_file(Path, DocRoot); false -> %% Otherwise the page is not found case Req:get(method) of Method when Method =:= 'GET'; Method =:= 'HEAD' -> case Path of "response" -> QueryStringData = Req:parse_qs(), Username = get_username(Req, QueryStringData), Cookie = make_cookie(Username), FindCookie = get_cookie_value(Req,"mename","Not Found."), % render_ok(Req, [Cookie], greeting_dtl, [{username, Username}]), Req:respond({200, [{"Content-Type", "text/html"}], "<html><p>Webpage</p></hmtl>"}); _ -> Req:not_found() end end end; Response -> Response end catch Type:What -> Report = ["web request failed", {path, Path}, {type, Type}, {what, What}, {trace, erlang:get_stacktrace()}], error_logger:error_report(Report), %% NOTE: mustache templates need \ because they are not awesome. Req:respond({500, [{"Content-Type", "text/plain"}], "request failed, sorry\n"}) end. The error I get is: [error] "web request failed", path: "response", type: error, what: undef, trace: [{greeting_dtl,render,[[{username,"GET"}]],[]} The error seems to be coming from render_ok, but being new to Erlang-mochiweb I'm not sure on how to fix this.
82cf492e5bd10c6f698f9076e195f5e0eaec02208251f9463c62860240fd8de8
['f5aba96e6c8c44a69ff868bdc86526a1']
Try this rule: iptables -t nat -A PREROUTING -i eth0 -s ! 192.168.0.2 -p tcp --dport 80 -j DNAT --to 192.168.0.2:3128 iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -d 192.168.0.2 -j SNAT --to 192.168.0.1 iptables -A FORWARD -s <IP_ADDRESS>/24 -d 192.168.0.2 -i eth0 -o eth0 -p tcp --dport 3128 -j ACCEPT where: 192.168.0.2 - proxy server IP (Squid, etc); <IP_ADDRESS> - router IP (where started iptables); <IP_ADDRESS><IP_ADDRESS> -p tcp --dport 80 -j DNAT --to <IP_ADDRESS>:3128 iptables -t nat -A POSTROUTING -o eth0 -s <IP_ADDRESS>/24 -d <IP_ADDRESS> -j SNAT --to <IP_ADDRESS> iptables -A FORWARD -s 192.168.0.0/24 -d <IP_ADDRESS> -i eth0 -o eth0 -p tcp --dport 3128 -j ACCEPT where: <IP_ADDRESS><PHONE_NUMBER> -d 192.168.0.2 -j SNAT --to 192.168.0.1 iptables -A FORWARD -s <PHONE_NUMBER> -d 192.168.0.2 -i eth0 -o eth0 -p tcp --dport 3128 -j ACCEPT where: 192.168.0.2 - proxy server IP (Squid, etc); 192.168.0.1 - router IP (where started iptables); <PHONE_NUMBER> - your local network I could be wrong, check carefully.
f3992f79b8551fbfa4c66dfe2c78ecb2b800e21d013af1cd03cfdfcbbdb5770e
['f5aba96e6c8c44a69ff868bdc86526a1']
Немного переделал график из примера, таким образом - http://jsfiddle.net/52dst6fy/ $(function () { $('#container').highcharts({ chart: { type: 'heatmap', marginTop: 40, marginBottom: 80 }, title: { text: 'Sales per employee per weekday' }, xAxis: { "type": "datetime", "minTickInterval": 86400000 }, yAxis: { categories: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'], title: null }, colorAxis: { min: 0, minColor: '#000000', maxColor: Highcharts.getOptions().colors[0] }, legend: { align: 'right', layout: 'vertical', margin: 0, verticalAlign: 'top', y: 25, symbolHeight: 280 }, tooltip: { formatter: function () { return '<b>' + this.series.xAxis.categories[this.point.x] + '</b> sold <br><b>' + this.point.value + '</b> items on <br><b>' + this.series.yAxis.categories[this.point.y] + '</b>'; } }, series: [{ name: 'Sales per employee', borderWidth: 1, color: 'rgb(41, 182, 246)', data: [[1444534400000, 3, 5], [1442534400000, 3, 5], [1444534400000, 2, 200]], dataLabels: { enabled: true, color: '#000000' } }] }); }); Дело в том, что пропали цвета, нарастающие за счет увеличения данных (3я цифра, первое это время, 2я определяет день недели). Пытаюсь реализовать графки, похожий на это:
da02fd8909d51318fa1f634c20b4720efc3d6a948a19aab203117c0f31841b8e
['f5ae50dedd9a4e35a5f6e57de7a15b14']
How can I access a row in material-table (in editable mode) and integrate a timepicker from materialui? <MaterialTable title="" columns={columns} data={state.data} editable={{ onRowAdd: newData => new Promise(resolve => { setTimeout(() => { resolve(); setState(prevState => { const data = [...prevState.data]; data.push(newData); return { ...prevState, data }; }); }, 600); }), //onRowUpdate... //onRowDelete... }} /> fields to change (yellow):
c2d9aec8429fa1b2ca66437b5398db859fd9f3bf842cf31770e6e715b8cbd2d0
['f5ae50dedd9a4e35a5f6e57de7a15b14']
The error is due to the amount of data to download as it is described here: getting this net<IP_ADDRESS>ERR_EMPTY_RESPONSE error in browser The solution for my problems was creating a daemon thread. The response is sent directly after starting the background thread. from multiprocessing import Process @app.route('/downloadftp') @cross_origin() def get_all_ftp_data(): """creates a daemon thread for downloading all files while the response it sent directly after starting the background thread.""" daemon_process = Process( target=download_data_multiprocessing, daemon=True ) daemon_process.start() return Response(status=200) def download_data_multiprocessing(): """triggers download current data from ftp server""" # connect to sever # download for f in ftp.nlst(): if (f != '.' and f != '..' and "meteo" not in f): fhandle = open(f, 'wb') ftp.retrbinary('RETR ' + f, fhandle.write) ftp.quit()
67bca807b959d822254fe5766837c0140a994ea0432a8feed731e9b1964b0c91
['f5b4b8c43c02439b8368ec7e96dd7f9a']
As I said, the site is up and running fine with anonymous access for a while now. It is not an issue with the anonymous permission on a site or a list level. As an anonymous from a browser I can open and view the specific items. I want to do the same from a WCF service, using a server side code.
8570308e72c0ee318b375f10d878b5c901025893518d736b60d5a3ddc49296af
['f5b4b8c43c02439b8368ec7e96dd7f9a']
por ejemplo el text decoration debe ir en el estilo style='color:#838383; text-decoration:none;' pero no basta con eso, debes documentarte acerca de los estilos que Outlook acepta, te recomiendo https://litmus.com/ puedes testear tus correos antes de enviarlo, outlook, gmail, hotmail 2003, 2009 etc, es genial
bf451622299c1deeb5739d92e40db37fcd41ddc8d09a379436ef3ed6806dc6e7
['f5b6893fda8241d486e1bc5bdad34afe']
It follows the steps in an octave of music. Full step, full step, half step, full step, full step, full step, half step. The full steps the third year is leap year. The half steps the second year is leap year. Thus the leap years are in a 19 year cycle are as follows: 3, 6, 8, 11, 14, 17, 19. No trial and error, just know the scale.
b460de4f8ec8bcd95894874196140755410350248a9c45cbc25b838298732584
['f5b6893fda8241d486e1bc5bdad34afe']
Early returns to simplify a function and readability are usually good, but one responsibility for a function usually leads to more modular and readable code. If you have a condition that is not purely for an early return, chances are higher your function is breaching single responsibility principals (if you care about that concept).
447cd9fa2944cb957308202111dbb542c031f4c1350982664a237c7145a86517
['f5bfcd9fb0db4d329326c8d0113734f9']
When connected to my FM transmitter, I am able to hear audio from calls but they can hardly hear me. Similarly, if I want to use Google Assistant, I have to shout. I believe the issue is that a microphone on the transmitter is being used as opposed to the microphone on my phone, and this microphone is bad. However, this has always been an issue, even when the device was new 3 years ago. I can't seem to find info on the exact model of transmitter that I have, but this was the title on Amazon: Car FM Transmitter W 2.4A USB Charger, Nulaxy™ 2015 Newest Wireless Bluetooth FM Transmitter Car Kit for All Smartphones, Tablets, MP3 Players Sold by: DinoSonics It seems like there should be a setting for choosing which microphone to use when connected to a Bluetooth device, but this doesn't appear to be an option. For reference, I am currently using a Pixel 3, however the same issue was present with a Pixel 2, Droid Turbo 2, and Galaxy S5, obviously on many versions of Android. If this is the wrong board to ask this question or if any more information is needed, let me know.
cdb26d119ca52a8e4e564eb48b07e450001c99cc92646d60f232f3dcb95ef9ac
['f5bfcd9fb0db4d329326c8d0113734f9']
<PERSON> Yes. The total amount of code would even slightly increase because of duplicate imports in the several modules. But this is not an issue. What I want to have is multiple smaller modules that each handle one ORM model. I see no way of generating the respective code automatically.
aa00ff91729b812ae53880ba65123b48cd18b1dc289964178439df1ce658d01d
['f5e41a11f36c4b50b5818727f39b11db']
My form have two select in my view page like this <div class="row"> <div class="col-sm-6"> <div class="form-group"> <p>Main</p> <div class="top5"> <select name="main" id="mainClass_select" class="form-control"> <option value="-1">All</option> <% t(:main_skill_category).each_with_index do |main_one, index| %> <% if index == @main_skill_id %> <option value="<%= index %>" selected><%= main_one['name'] %></option> <% else %> <option value="<%= index %>"><%= main_one['name'] %></option> <% end %> <% end %> </select> </div> </div> </div> <div class="col-sm-6"> <div class="form-group"> <p>子類別</p> <div class="top5"> <select name="sub" id="subClass_select2" class="form-control" > <option value="-1">All</option> <% t(:sub_skill_category)[@main_skill_id].each_with_index do |sub_one, index| %> <% if index == @sub_skill_id %> <option value="<%= index %>" selected><%= sub_one['name'] %></option> <% else %> <option value="<%= index %>"><%= sub_one['name'] %></option> <% end %> <% end %> </select> </div> </div> </div> </div> I hope after user select main select, the sub select will change the option. (I have a yml files in my locales. example the English version: ) main_skill_category: [ {name: "IT、Software"}, {name: "Engineering、Science"}, {name: "Design、Creativity"}, {name: "Business、Marketing "}, {name: "General Affairs、Customer Services"}, {name: "Business、Accounting、Legal"}, {name: "Writing、Translation"}, {name: "Professional Advisory"} ] sub_skill_category: [ [ {name: "Programming", title: ""}, {name: "Program test / debug", title: ""}, {name: "E-commerce platform", title: ""}, {name: "Web development", title: ""}, {name: "Web planning", title: ""}, {name: "Web test", title: ""}, {name: "Web Applications", title: ""}, {name: "Mobile App", title: ""}, {name: "Software interface", title: ""}, {name: "Utility software", title: ""}, {name: "Entertainment and gaming applications", title: ""}, {name: "Scripting language (Scripting)", title: ""}, {name: "Plug-ins", title: ""}, {name: "IT project management", title: ""}, {name: "Internet telephony (VoIP)", title: ""}, {name: "Information systems architecture", title: ""}, {name: "Management information system (MIS)", title: ""}, {name: "Information system provisioning", title: ""}, {name: "Enterprise resource planning (ERP)", title: ""}, {name: "Other - IT / Software", title: ""} ], [ {name: "Data mining / analysis", title: ""}, {name: "CAD / CAM", title: ""}, {name: "Manufacturing engineering", title: ""}, {name: "Product development", title: ""}, {name: "Industrial engineering", title: ""}, {name: "Chemical engineering", title: ""}, {name: "Materials engineering", title: ""}, {name: "Electronics engineering", title: ""}, {name: "Mechanical engineering", title: ""}, {name: "Biological engineering", title: ""}, {name: "Mathematical statistics", title: ""}, {name: "Quality control analysis", title: ""}, {name: "Design engineering", title: ""}, {name: "Engineering project management", title: ""}, {name: "Mathematics", title: ""}, {name: "Physics", title: ""}, {name: "Chemistry", title: ""}, {name: "Other - Engineering / Science", title: ""} ], [ {name: "Graphics", title: ""}, {name: "Logo、 Corporate identity system", title: ""}, {name: "Visual design", title: ""}, {name: "Drawing", title: ""}, {name: "Printing design", title: ""}, {name: "Photography", title: ""}, {name: "Computer-aided design", title: ""}, {name: "3D Design", title: ""}, {name: "Audio effects", title: ""}, {name: "Video / Movie", title: ""}, {name: "Dubbing", title: ""}, {name: "Animation", title: ""}, {name: "Framework design", title: ""}, {name: "Website design", title: ""}, {name: "User interface design", title: ""}, {name: "Fashion design", title: ""}, {name: "Industrial esign", title: ""}, {name: "Other - Design / Creativity", title: ""} ], [ {name: "Promotions", title: ""}, {name: "E-mail and internet marketing", title: ""}, {name: "Telemarketing", title: ""}, {name: "Search engine optimization and marketing", title: ""}, {name: "Social media marketing", title: ""}, {name: "Customer / Media relations", title: ""}, {name: "Business planning / strategy", title: ""}, {name: "Market research", title: ""}, {name: "Sales", title: ""}, {name: "Other - Business / Marketing", title: ""} ], [ {name: "Typing and data entry", title: ""}, {name: "IT assistant", title: ""}, {name: "Sales assistant", title: ""}, {name: "Accounting assistant", title: ""}, {name: "Business correspondence", title: ""}, {name: "Transcription", title: ""}, {name: "On-line customer services", title: ""}, {name: "Field support / On-site services", title: ""}, {name: "Quotation / Order processing", title: ""}, {name: "Inventory processing", title: ""}, {name: "Other - General affairs / Customer services", title: ""} ], [ {name: "General accounting", title: ""}, {name: "Computer billing system", title: ""}, {name: "Salary", title: ""}, {name: "Financial services", title: ""}, {name: "Financial planning and forecasting", title: ""}, {name: "Financial statements", title: ""}, {name: "Procurement process", title: ""}, {name: "Legal", title: ""}, {name: "Intellectual property protection", title: ""}, {name: "Project management", title: ""}, {name: "Human resources", title: ""}, {name: "Recruitment", title: ""}, {name: "Actuary", title: ""}, {name: "Other - Business services", title: ""} ], [ {name: "Blog writing", title: ""}, {name: "Ghostwriting", title: ""}, {name: "Tweets writing", title: ""}, {name: "Creative writing", title: ""}, {name: "Editorial", title: ""}, {name: "On-line journalist", title: ""}, {name: "Technical writing", title: ""}, {name: "Literature review", title: ""}, {name: "Translation、interpretation、verbatim", title: ""}, {name: "Other - Writing / Translation", title: ""} ], [ {name: "Legal adviser", title: ""}, {name: "Travel consultant", title: ""}, {name: "Immigration consultant", title: ""}, {name: "Technical consultant", title: ""}, {name: "Culinary consultant", title: ""}, {name: "Language / Communication consultant", title: ""}, {name: "Marketing consultant", title: ""}, {name: "Overseas jobs consulting", title: ""}, {name: "Business consultant", title: ""}, {name: "Consultanting analysis", title: ""}, {name: "Service advisor", title: ""}, {name: "Other - Consultant", title: ""} ] ] But I am not good at javascript... please help me to let this done >"< (the controller is like this) def new @main_skill_id = params[:main].nil? ? -1 : params[:main].to_i @sub_skill_id = params[:sub].nil? ? -1 : params[:sub].to_i @project = Project.new end
7017d7a309414d32ab3dae398551e9a4fdcd81a045523e9dbd0180f13b5bdc32
['f5e41a11f36c4b50b5818727f39b11db']
I wrote a radio list with image animate. When it was hovered and checked, it can change to another image. it's works on all of the browsers but on IE its not work when I hover on it. I don't know if I wrote some css wrong or miss something about ie issue? the html is: <ul> <li> <input type="radio" id="f-option" name="gender"> <label for="f-option" class="gender female"><img src="images/52x42.png"></label> <div class="check"></div> </li> </ul> and my css is: .user-form ul li label.gender.female { background-image: url(../images/female.png); } .user-form input[type=radio]:checked ~ label.gender.female, .user-form input[type=radio]:hover ~ label.gender.female { background-image: url(../images/female-checked.png); } its works all of the browser but not work on ie can anybody help me fix it? The online demo is in this bottom of page: http://bestinthink.com/wg/buy-p1.html
34ec9a589376a8d22ed768613c92561610af7f04e2fc5f028d5a5914aedc3a9e
['f5e82ee5961943bf9b8ea806b0503b46']
you have to use a div to render summer not and populate a hidden text area with the summer note content before you submit the form, see the example bellow, <div class="panel-body no-padding"> <textarea style="display: none;" name="emailmessage" id="emailmessage"></textarea> <div class="editor-summernote" id="emailmessage_editor"></div> </div> then convert the div to render summer note editor as following $('.editor-summernote').summernote({ toolbar: [ ['headline', ['style']], ['style', ['bold', 'italic', 'underline', 'superscript', 'subscript', 'strikethrough', 'clear']], ['textsize', ['fontsize']], ['alignment', ['ul', 'ol', 'paragraph', 'lineheight']], ], height: 120 }); and before submit your form for server side processing, use jquery to populate the summer note content to a hidden text area, $("#btn-send-message").on("click",function(event) { var email_body = $('#emailmessage_editor').code(); $("#emailmessage").html(email_body); //populate text area }); at last you can get the data in your laravel controller by $request->input('emailmessage')
ed42b61794aabac8c1e80df271d023f899db3039f6c0c4d88c5af6666d2dc887
['f5e82ee5961943bf9b8ea806b0503b46']
You have a 1 to many relationships, in this case you donot need pivot table, gym_id is foreign key in the user table and you will define relations on the models. In gym model you will define a hasMany relationship to user model and in user model define belongsto relationship to gym model. (Refer to Laravel documentation). One of nice example for pivot table is Access Controller Models Such as User,Role and Permission..
d7ded55b1873a3043f57ee53faf501a34ade553812eec209120b835f7645b8bd
['f5f34ac0442a4bc18babea3286a4c96f']
I noticed a pattern. There is a class of notebooks (business notebooks I think), like Dell Latitude or Toshiba Tecra, that have inferior performance compared to notebooks that are cheaper- like Dell Inspiron or Toshiba Satellite, or Asus laptops. Why is that? The CPU and GPU are faster on cheaper laptops. The only notable difference I see between the two classes is the display resolution. Most of the "business" laptops come with higher screen res. But I don't think that justifies the double price. Is there something in these notebooks that makes them more valuable?
da3e2457233812fb301ec05d43ed2752477b79842d5dbf276b3f2a2a78e6c6e7
['f5f34ac0442a4bc18babea3286a4c96f']
thanks. Regarding graphic adapters, I see that ThinkPads have "NVIDIA Optimus 5400M", which according to notebookcheck "is based on consumer GeForce GT 630M / 540M chip but with lower clock rates" (btw Some Asus laptops ship with 710M-740M at half the price of the thinkPad). Anyway, I'm a little skeptic regarding "lowering clock rates increases reliability". Because it's the same chip...
7355333f71b98b7bea10a238d577b6a4b622f0879f6b7be62d0868a486e23a33
['f604dc88fe064b52a820c470ebb54383']
I have a text file in the following manner: <a href="https://en.wikipedia.org/wiki/Scotland" h="ID=SERP,5161.1">Scotland - Wikipedia <a href="https://www.visitscotland.com/" h="ID=SERP,5177.1">VisitScotland - Official Site <a href="https://www.bbc.co.uk/news/scotland" h="ID=SERP,5191.1">BBC Scotland News - Official Site <a href="https://www.lonelyplanet.com/scotland" h="ID=SERP,5207.1">Scotland travel - Lonely Planet From this text file, I want to extract the URLs i.e only the main domain like 'en.wikipedia.org','www.bbc.co.uk' etc into Links.txt And the Title i.e 'Scotland - Wikipedia','VisitScotland - Official Site' etc into Titles.txt I'm new to regex, tried using some regex function to extract but wasn't successful.
ec3e0d242ea940af99c86a07fddb9ead7b03447fba702254d2ce5c57bd1e3ede
['f604dc88fe064b52a820c470ebb54383']
JSON : {"results":{"opensearch:Query":{"#text":"","role":"request","searchTerms":"Rose","startPage":"1"},"opensearch:totalResults":"102325","opensearch:startIndex":"0","opensearch:itemsPerPage":"1","artistmatches":{"artist":[{"name":"Guns N' Roses","listeners":"3198315","mbid":"eeb1195b-f213-4ce1-b28c-8565211f8e43","url":"https://www.last.fm/music/Guns+N%27+Roses","streamable":"0","image":[{"#text":"https://lastfm-img2.akamaized.net/i/u/34s/7d102ebcf4184bb1ae2b851efcbceb30.png","size":"small"},{"#text":"https://lastfm-img2.akamaized.net/i/u/64s/7d102ebcf4184bb1ae2b851efcbceb30.png","size":"medium"},{"#text":"https://lastfm-img2.akamaized.net/i/u/174s/7d102ebcf4184bb1ae2b851efcbceb30.png","size":"large"},{"#text":"https://lastfm-img2.akamaized.net/i/u/300x300/7d102ebcf4184bb1ae2b851efcbceb30.png","size":"extralarge"},{"#text":"https://lastfm-img2.akamaized.net/i/u/300x300/7d102ebcf4184bb1ae2b851efcbceb30.png","size":"mega"}]}]},"@attr":{"for":"Rose"}}} I am unable to fetch the artist details using this JSON. I would like to know the format to use this JSON in Volley android. Code: final JsonArrayRequest jsonArrayRequest = new JsonArrayRequest(Request.Method.GET,url,null, new Response.Listener<JSONArray>() { @Override public void onResponse(JSONArray response) { for (int i = 0; i < response.length(); i++) { try { JSONObject object = response.getJSONObject(i); JSONObject obj1 = object.getJSONObject("results"); JSONObject obj2 = obj1.getJSONObject("artistmatches"); JSONArray m_jArry = obj2.getJSONArray("artist"); for (i = 0; i < m_jArry.length(); i++) { JSONObject obj4 = m_jArry.getJSONObject(i); String name=obj4.getString("name"); String mbid=obj4.getString("mbid"); String url=obj4.getString("url"); }
928c31e38af45d3f7bf50c6781bdf1c2bf989c971dafe04635e157029c669b74
['f60da4e1ceef4caf9d901026f45c1679']
While executing the query below, I'm getting the list of object with status as 'INVALID'., SELECT * FROM USER_OBJECTS WHERE STATUS='INVALID'; When I checked the status of the objects individually, they are in compiled state., Even after dropping those objects, they're still showing up when I execute the same query., Any clue, why it is behaving soo?
91c995159de2dd4bca9bf42d3ca2a5ad71264f32646074d15fe277b7468c3d71
['f60da4e1ceef4caf9d901026f45c1679']
I've used pandas to import a csv file as below: import pandas as pd csv_input = pd.read_csv('Accounts_Input.csv') but after importing, while checking the values it seems that it ignored the 0 from the values if it start with a 0 as below: input_file after_import <PHONE_NUMBER> 897456129 <PHONE_NUMBER> <PHONE_NUMBER> Can u guys suggest any way to avoid this?
782836eddbce8596ddf57a32f7f1c6c7bc738b027b9b48cdf4b826037890884c
['f619aad72d1c4cd998c32b366d7253ed']
You should specify which queue you are using for the input and for the established connection. For example, queue 0, with 192.168.0.2 as your gateway (assuming you are the gateway and the one that does the masquerade): iptables -I INPUT -s <IP_ADDRESS> -p tcp --dport 6767 -j NFQUEUE --queue-num 0 iptables -I OUTPUT -d <IP_ADDRESS><IP_ADDRESS> as your gateway (assuming you are the gateway and the one that does the masquerade): iptables -I INPUT -s 192.168.0.2 -p tcp --dport 6767 -j NFQUEUE --queue-num 0 iptables -I OUTPUT -d 192.168.0.2 -p tcp --sport 6767 -m conntrack --ctstate RELATED,ESTABLISHED -j NFQUEUE --queue-num 0 And please fix your code, seems like some code from the "main" has slipped into "poison_target"
bd491f2a715146bce0f53736c3731c969c0b8bf4283509decc1c46e1ac064ba4
['f619aad72d1c4cd998c32b366d7253ed']
You can use scapy for packet manipulation from scapy.all import * packet = IP(src="<IP_ADDRESS>", dst="<IP_ADDRESS>")/UDP(dport=4321, sport=123)/"payload" print str(packet) # output: 'E\x00\x00#\x00\x01\x00\x00@\x11t\xc4\x01\x01\x01\x01\x02\x02\x02\x02\x00{\x10\xe1\x00\x0f+?payload'
11b161cd834b2f51c5df403803ef7e2e71b8a1950a30350bedfb4b983a48b031
['f63244f46fef434aaabdfc1cbd0767a3']
My app is a sports app. In which the game should continue even in background, i have used nstimer for that. But I am not able to run the timer in background. whenever the app is in background the timer stops and when return it continues from same time from which it has left.
d3d73b0fb3b78259c9a7ea9c79dbac2d1577399b54a19ed1ba3e10cc5a095410
['f63244f46fef434aaabdfc1cbd0767a3']
I want write a textField value which is a user name to file named login.txt. My code: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; // the path to write file loginFilePath= [documentsDirectory stringByAppendingPathComponent:@"Login.txt"]; NSString *userName=[nameText text]; [userName writeToFile:loginFilePath atomically:YES]; I get Warning as "wrtieToFile:atomically:" is deprecated.
f1422fe77dde643f48cdff27e7345a6439a8632cc0b143fe71fd2cf2a406c65f
['f642aac4edba4aaab7f80f0d99e9d6ed']
How about instead of closing the question as off topic, find a similar question that was answered with constructive help about how to teach your self to "debug simple issue", "learn to program", "use the debugger" etc. and link to that one as a possible duplicate... the Kid actually gets help learning, doesn't' get his homework done, and the post eventually goes away as a duplicate.. everyone wins... soon the stock answers for these questions will be easy to find and actually quite helpful. I personally have been concerned about "rudeness" for a while, and not just on off topic close issues.
afbcd155f29c811d8ac6f4831da27cfdd75cc76dcadc61265e2c4f43cebc1a6f
['f642aac4edba4aaab7f80f0d99e9d6ed']
I am trying to standardize map export for some of my maps with ArcPy. In the ArcGIS interface, I would click FullExtent before exporting (File --> Export map), so that the full map is covered in the image file. With ArcPy, I have not understood how this works. Currently, I use arcpy.mapping.ExportToJPEG to export the maps. When I then look at these images, however, they only show part of the map. How can I make sure ArcPy centers the map first such that the full extent of the maps is shown?
15afc2be9266ac3a95b4eafe1104b9dc310c4ba2786ac01ba64c7c52ff8a4645
['f666cb9aad5d4e54ad3b0b738f3c42a8']
I had a similar problem. I had both two installations of Python27---the Ananaconda distribution and the other. Python27 folders appeared before the Anaconda ones in my search path, although Spyder was executed through the Anaconda executable. It turned out that making the Anaconda distribution folders first in the PYTHONPATH solved the problem. An easier solution--avoid multiple installations of Python27 if possible.
6ae4a339d8f74f02f73b5ba7c3818ff682bba9b3deb4171f4f06de3d7ca77544
['f666cb9aad5d4e54ad3b0b738f3c42a8']
You can stick the line you want executed at every startup in your .Rprofile file which should be in your home directory. I have 3.2.3 version of R and that worked; however I do get a warning message about using a non-http version of the site. Similarly to you, I was finding the original repository the system was using was failing to install the packages--not finding the package or downloading a file with too few bytes, perhaps because of a transient problem. You might want to consider not putting this in your .Rprofile file or commenting the line outin case this is a temporary workaround.
effb53a725b037a896c9f7118a45be497a0db2bb2f678909b4ed53efe6045d49
['f66a29252fe044eca669c94985e6f34b']
Find and write the output of the following C++ program code: Note: Assume all required header files are already included in the program. void Revert(int &Num, int Last=2) { Last=(Last%2==0)?Last+1:Last-1; for(int C=1; C<=Last; C++) Num+=C; } void main() { int A=20,B=4; Revert(A,B); cout<<A<<"&"<<B<<endl; B--; Revert(A,B); cout<<A<<"#"<<B<<endl; Revert(B); cout<<A<<"#"<<B<<endl; } Answer:35&4 38#3 38#9 In the first one why B is 4 and not 5.
2fc1a29902939351b50dd884c5a083e74a64635823c06582b6c5b9ed989f2a8a
['f66a29252fe044eca669c94985e6f34b']
What value does Firebase Auth Identifier store from Facebook Login If user is not registered with email but with Phone Number. My app provides facebook login but now when a user is carrying on with Facebook login my firebase auth stores the email address as an Identifiers but when someone login in my app via facebook login who had registered with phone number in facebook then my firebase auth is storing null value in Identifier. So what should I do to store a user's phone number from facebook as an identofier or facebook id as an identifier e.g <EMAIL_ADDRESS>
da56b76e2f93a89960968be2d7fcf60b40ffc466de12e0dbe2686fea84c6a8c2
['f6716446725c40d7aab21c4d03facfd9']
I am very new to Apache Spark and trying to connect to Presto from Apache Spark. Below is my Connection String, which giving the error. val jdbcDF = spark.read.format("jdbc").options(Map("url" -> "jdbc:presto://host:port/hive?user=username&SSL=true&SSLTrustStorePath=/path/certificatefile", "driver" -> "com.facebook.presto.jdbc.PrestoDriver", "dbtable" -> "tablename", "fetchSize" -> "10000", "partitionColumn" -> "columnname", "lowerBound" -> "1988", "upperBound" -> "2016", "numPartitions" -> "28")).load() I have first started start-master.sh within spark/sbin. I also tried setting jar and driver class path in spark-shell like this: ./spark-shell --driver-class-path com.facebook.presto.jdbc.PrestoDriver --jars /path/jar/file Still getting below error: java.sql.SQLException: Unsupported type JAVA_OBJECT at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.org$apache$spark$sql$execution$datasources$jdbc$JdbcUtils$$getCatalystType(JdbcUtils.scala:251) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$8.apply(JdbcUtils.scala:316) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$8.apply(JdbcUtils.scala:316) at scala.Option.getOrElse(Option.scala:121) at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.getSchema(JdbcUtils.scala:315) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:63) at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation$.getSchema(JDBCRelation.scala:210) at org.apache.spark.sql.execution.datasources.jdbc.JdbcRelationProvider.createRelation(JdbcRelationProvider.scala:35) at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:318) at org.apache.spark.sql.DataFrameReader.loadV1Source(DataFrameReader.scala:223) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:211) at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:167) Could someone please help me with that? Thanks
1072a3b405331c1175b1cb00df2f5e05cb035eedc2965c089d0604a3139b7385
['f6716446725c40d7aab21c4d03facfd9']
I am using pyspark script to read data from remote Hive through JDBC Driver. I have tried other method using enableHiveSupport, Hive-site.xml. but that technique is not possible for me due to some limitations(Access was blocked to launch yarn jobs from outside the cluster). Below is the only way I can connect to Hive. from pyspark.sql import SparkSession spark=SparkSession.builder \ .appName("hive") \ .config("spark.sql.hive.metastorePartitionPruning", "true") \ .config("hadoop.security.authentication" , "kerberos") \ .getOrCreate() jdbcdf=spark.read.format("jdbc").option("url","urlname")\ .option("driver","com.cloudera.hive.jdbc41.HS2Driver").option("user","username").option("dbtable","dbname.tablename").load() spark.sql("show tables from dbname").show() Giving me below error: py4j.protocol.Py4JJavaError: An error occurred while calling o31.sql. : org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException: Database 'vqaa' not found; Could someone please help how I can access remote db/tables using this method? Thanks
65da0a00f335da69912d559edf8e3b83722ec70348a08b0f5e4de52e515cd813
['f67302bb250349dfaa7b982337a4bc64']
Suppose that I run a fixed effect model $$y_{ij}=\beta_0+\beta_1x_{ij}+d_i+\epsilon_{ij}$$ where $d_i$ is the fixed effect model for group $i$. Now that I want to show the data, is it appropriate for me to show all $(x_{ij},y_{ij}-d_i)$ points so that all of them lie near one single line? Thanks a lot!
d171c01494ccee458c660c4ee4d4e0b91a44d6b371f34d53395841e73b182069
['f67302bb250349dfaa7b982337a4bc64']
a) Only after I had explained everything, did he stop blaming and did she stop crying. b) Only after I had explained everything, did he stop blaming and she stop crying. c) Only after I had explained everything, did he stop blaming and she stopped crying. d) Only after I had explained everything, did he stop blaming and was she satisfied. e) Only after I had explained everything, did he stop blaming and she was satisfied. Which ones are correct in grammar?
a8db14a0259e873287bbb7dd9eca776da0e5b484b5539b7628979147f3307340
['f675642b723c4ef4bff45b10bb6e1f83']
Use the openssh_keypair and authorized_key module to create and deploy the keys at the same time without saving it into your ansible host. - openssh_keypair: group: root owner: root path: /some/path/in/your/server register: ssh_key - name: Store public key into origin delegate_to: central_server_name authorized_key: key: "{{ssh_key.public_key}}" comment: "{{ansible_hostname}}" user: any_user_on_central
393103ea2db4da2c2ad252ee89b6d0c01d5ce59aab1b2a6768e35933819a4650
['f675642b723c4ef4bff45b10bb6e1f83']
There are a few problems i see with your code here. Correct me if i am wrong. Here you have declared your variables vno,hours and fee globally. So why do you need to declare them again in the methods (input and calculate)? Use the same globally declared variables. In this case your display method takes the vno, hours and fee which is declared globally and not the ones you declared in the methods. Try assigning a value to the global variables given and run the program to see what I mean. Also "input" method is to take values from the user. So why does it need a return statement at all? You can actually make it simpler by making sure that each of your method does only one thing at a time.
98870a2c6f99992c4ba6ff687d75f66842c2555502977dd0eb2688d41a87795d
['f67e2091c0c747ac9e4a0c39a01a9e1a']
Layout.js class Layout extends React.Component { render() { return ( <nav aria-label="breadcrumb"> <ol class="breadcrumb" style={{margin: 0}}> <li class="breadcrumb-item"><a href="/movies">영화</a></li> <li class="breadcrumb-item"><a href="/showtimes">예매</a></li> <li class="ml-auto"> </li> </ol> </nav> <script src="/static/js/sign_url.js"></script> ); } } sign_url.js if(getCookie("logged_in")=="true") { $(".breadcrumb > .ml-auto").html('<a href="/signout">signout</a>'); } else { $(".breadcrumb > .ml-auto").html('<div><a href="/signup">signup</a>&nbsp;/&nbsp;<a href="/signin">signin</a></div>'); } reload -> appear -> disappear I don't know why remove the html code in react.
d49d4c98a4b781e18524a5987eff1f48a281efc6088bf70960f96540874f87a7
['f67e2091c0c747ac9e4a0c39a01a9e1a']
you don't know "lstrip" click here, https://www.tutorialspoint.com/python/string_lstrip.htm use this code instead of "url.lstrip(host)" # -*- coding: utf-8 -*- from urllib.request import urlretrieve year = 2006 max_year = 2019 host = "http://data.wa.aemo.com.au/datafiles/outages/outages-" ending = ".csv" while year <= max_year: url = host + str(year) + ending print(url) file_name = "outages-" + str(year) + ending print(file_name) urlretrieve(url, file_name) print("Done") year += 1
2d581714cc770e6614b1dcfc9b85a14a538baf53b364a7fc172ea125e0915f8b
['f684531968384f5e9f279688a5437b9f']
We've been seeing an significant increase in the number of script errors reported in our app that uses the Realtime API. Specifically this started happening around 1/27/16 at ~6/7PM PST. Poking around a bit I believe I was able to track this back to the XHR error callback installed by the Realtime API. function EA(a) { a.onerror = function() { self.xc() } } In this handler self will always refer to window.self which seems like very much the wrong thing as there is never an xc function on the window object. While this doesn't appear to be causing any significantly bad behavior (although it may be contributing to further issues with re-connection), it would be great to have these errors handled. Is this something other people are seeing as well or a known issue? Is anyone using a workaround?
bca2606b84349ccc46467f38120f9a45af246e6034f898731cba5b51160e39a7
['f684531968384f5e9f279688a5437b9f']
There are a few ways to retrieve the user's email address. The easiest is to use the id_token returned on the user's access_token that you receive (#3 below). 1) You can use the UserInfo endpoint after including the 'profile' OAuth scope: https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=[token]. Making a dirty query to this API with your access token will return the user's email address. 2) As noted in a different answer, you can use the People.Get API. 3) (In my opinion the best option) Request and use the id_token (JWT) that can be returned along with a valid Google Access Token. For this you must include the 'https://www.googleapis.com/auth/userinfo.email' OAuth scope, and when making the call for Google Authorization, the 'response_type' param must be set to 'token id_token'. You can do this by editing the Realtime API to pass in 'response_type: "token id_token" along with the other params to gapi.auth.authorize. Once you have your id_token, it needs to be decoded. You can use the code below and just pass in the response object that you receive. The resulting decoded id_token will contain the user's email address. function decodeJWT(rawToken) { var decoded; if (rawToken && rawToken.id_token) { var jwt = rawToken.id_token; var parts = jwt.split('.'); try { decoded = JSON.parse(b64_to_utf8(parts[1])); } catch (err) { // Handle Error } } return decoded; } function b64_to_utf8(str) { var utf8; try { utf8 = decodeURIComponent(escape(window.atob(str))); } catch (err) { // Handle Error } return utf8; } Good luck!
29a8b8cb3974ff1173a9e10bf444d1acc97ff4f2d05c6e0465bd499c6579df42
['f687d6a50f8a40428976f1ae01a7ebc6']
Very contentiously: <PERSON>'s original paper is about the computability properties of something "non-Platonic" (factual, etc. rather than "in math world") - a human performing calculations. (See <PERSON> and <PERSON> historical work.) Consequently it isn't mathematics <PERSON> is doing, but how humans do mathematics. The generalization of this work, beyond what a human can actually do (in say, degree theory or recursion theory taken very generally) is then a branch of mathematics spawned by something "on the outside".
fe12b108af95a9bac3c88313c2bfa0eb26c9cd7306e38773e1a04f010b8492af
['f687d6a50f8a40428976f1ae01a7ebc6']
The accepted answer is a couple of years old, now, and only a select number of browsers still do not support TLS 1.2 by default and they only account for roughly ~5% of all web traffic. IE on Win XP and IE < 11 on newer versions are the biggest culprits. This link displays a matrix of browsers that support TLS 1.2. Chrome has supported it since version 30 (the current stable version is 64, I believe). Windows Server 2012 R2 still doesn't support the *RSA*GCM* suites (as I recently found out trying to enable them on our web servers) so Server 2016/Windows 10 and IIS 10 will be required to use the RSA-based AEAD ciphers. PCI compliance now requires disabling TLS 1.0, and it's only a small user base that still requires the use of TLS 1.0. So as of 2018, it is perfectly acceptable to make these changes so long as your server OS supports them.
4b58099e4b0b1f9cb8e8c83fe7ecde46792a2a0fcb1bb3c842821d9e55142b40
['f6bed841435b480ea462f2c57a716848']
Why doesnt work my mixin in new compass version? I want to set colors for navigationpoints. In the older compass verison everytihng works fine (0.12.6). I updated to the last Version and got the problemes. This is my mixin and some parts of the sass files: $basic: #f3f3f3; $basicHO: #eeeeee; $basicHL: #c3c3c3; $classPrefix: color_; $colorGroups: ( //class suffix Normal Hover Hightlight default $basic $basicHo $basicHL ); @mixin setColors($classSelPrefix:"."){ @each $group in $colorGroups { $colorClass: nth($group, 1); $colorNormal: nth($group, 2); $colorHover: nth($group, 3); $colorHighlight: nth($group, 4); $className: $classPrefix#{$colorClass}; #{$classSelPrefix}#{$className} { @content; } } } .exampleClass{ @include setColors("& > .") { border-bottom-color: $colorNormal; a{ border-color: $colorNormal; border-left: 3px solid $colorNormal; } } }
869220202f9b5dc06e675f0bc89c7167cd39ac0e39c3f867be12caf9b3580c78
['f6bed841435b480ea462f2c57a716848']
Okay i got some workaround for that. Just open the jquery.bxslider.js, row 1212 copy and enter the code and make some adjustments: el.goToNextFiveSlides = function(){ // if infiniteLoop is false and last page is showing, disregard call if (!slider.settings.infiniteLoop && slider.active.last) return; var pagerIndex = parseInt(slider.active.index) + 5; el.goToSlide(pagerIndex, 'next'); } function -> el.goToNextFiveSlides and +5 Now go to row 713 "Click next binding" and paste following code for var clickNextBind var clickNextBind = function(e){ // if auto show is running, stop it if (slider.settings.auto) el.stopAuto(); el.goToNextFiveSlides(); e.preventDefault(); } And just the same workaround for the "prev" function. If you also so want that the auto slide never stops remove the if statement if (slider.settings.auto) el.stopAuto();
246cc19b343c3277dc5be41a0d0c48205f49e2d7014ca23cd2d3e355489f17cf
['f6c76f3383864654b558a6bf817a723c']
Finally fixed the issue. Factory use was incorrect. This is the factory module .factory('Company', ['$resource', function ($resource) { return $resource('/companies/getCompany/:id', null, { save: { method: 'POST', url: '/companies/updateCompany' }, insert: { method: 'POST', url: '/companies/createNewCompany' } }); }]) And this is how the factory should be called Company.get({id: $routeParams.companyId}, function (data) { $scope.company = data; }); Now the correct data is shown everytime the page is loaded.
05f6267f8947284f35aa97ed788753a9124c884bdf5d06b9b0c165ea6c5f780a
['f6c76f3383864654b558a6bf817a723c']
Solved the issue. Just use Bower to download needed dependencies and add them to /static directory. Include in index.html <!DOCTYPE html> <html lang="en"> <script src="bower_components/angular/angular.min.js"></script> <script src="bower_components/angular-resource/angular-resource.min.js"></script> <script src="bower_components/angular-route/angular-route.min.js"></script> <script src="app/app.js"></script> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body ng-app="companyApp"> Hello, Spring! </body> </html>
1ed921bb45979f4bf5af1f014959be88a9199d552cac0df84911677b67ff2213
['f6dab2169e264c9c834ab2b2bbf7ec3a']
You should install usb drivers for your device on Windows, if you don't have nexus device or cyanogenmodOS. Then activate debug mode, then when you plug device in PC, choose on status bar connection mode(for Sony - "only charge", for LG - MTP mode, for some HTC devices - PTP), then check it. It helped me, i have 3 devices for connect to Studio.
d3c41588c8fb991167275f2d8af4ff83db9ced901f0da90729d5f7379fb66cf8
['f6dab2169e264c9c834ab2b2bbf7ec3a']
Add this before onCreate: private WebView mWebView; private ProgressBar mProgressBar; //new block private static final String TAG = MainActivity.class.getSimpleName(); public static final int INPUT_FILE_REQUEST_CODE = 1; public static final String EXTRA_FROM_NOTIFICATION = "EXTRA_FROM_NOTIFICATION"; private ValueCallback<Uri[]> mFilePathCallback; private String mCameraPhotoPath; // Storage Permissions private static final int REQUEST_EXTERNAL_STORAGE = 1; private static String[] PERMISSIONS_STORAGE = { Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA }; Add to mWebView.setWebChromeClient(new WebChromeClient() { this: public boolean onShowFileChooser(WebView webView, ValueCallback<Uri[]> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) { //verifyStoragePermissions(MainActivity.this); Log.e("111","onShowFileChooser"); if(mFilePathCallback != null) { mFilePathCallback.onReceiveValue(null); } mFilePathCallback = filePathCallback; Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(MainActivity.this.getPackageManager()) != null) { // Create the File where the photo should go File photoFile = null; try { photoFile = createImageFile(); takePictureIntent.putExtra("PhotoPath", mCameraPhotoPath); } catch (IOException ex) { // Error occurred while creating the File Log.e(TAG, "Unable to create Image File", ex); } // Continue only if the File was successfully created if (photoFile != null) { mCameraPhotoPath = "file:" + photoFile.getAbsolutePath(); takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(photoFile)); } else { takePictureIntent = null; } } Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT); contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE); contentSelectionIntent.setType("image/*"); Intent[] intentArray; if(takePictureIntent != null) { intentArray = new Intent[]{takePictureIntent}; } else { intentArray = new Intent[0]; } Intent chooserIntent = new Intent(Intent.ACTION_CHOOSER); chooserIntent.putExtra(Intent.EXTRA_INTENT, contentSelectionIntent); chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser"); chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray); startActivityForResult(chooserIntent, INPUT_FILE_REQUEST_CODE); return true; } And add this to class: @Override public void onActivityResult (int requestCode, int resultCode, Intent data) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (requestCode != INPUT_FILE_REQUEST_CODE || mFilePathCallback == null) { super.onActivityResult(requestCode, resultCode, data); return; } Uri[] results = null; // Check that the response is a good one if (resultCode == Activity.RESULT_OK) { if (data == null) { // If there is not data, then we may have taken a photo if (mCameraPhotoPath != null) { results = new Uri[]{Uri.parse(mCameraPhotoPath)}; } } else { String dataString = data.getDataString(); if (dataString != null) { results = new Uri[]{Uri.parse(dataString)}; } } } mFilePathCallback.onReceiveValue(results); mFilePathCallback = null; } else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { System.out.println("In KitKat Condition"); if (requestCode != FILECHOOSER_RESULTCODE || mUploadMessage == null) { System.out.println("In != Null"); super.onActivityResult(requestCode, resultCode, data); return; } if (requestCode == FILECHOOSER_RESULTCODE) { System.out.println("requestCode == FileChooser ResultCode"); if (null == this.mUploadMessage) { System.out.println("In null == this.mUploadMessage"); return; } Uri result = null; try { if (resultCode != RESULT_OK) { result = null; } else { //newcode // retrieve from the private variable if the intent is null result = data == null ? mCapturedImageURI : data.getData(); KitkatPath = Uri.parse("file://"+getPath(MainActivity.this, result)); System.out.println("KitkatPath== "+KitkatPath); System.out.println("result = "+result); } } catch (Exception e) { // Toast.makeText(getApplicationContext(), "activity :" + e, Toast.LENGTH_LONG).show(); e.printStackTrace(); } // mUploadMessage.onReceiveValue(result); mUploadMessage.onReceiveValue(KitkatPath); System.out.println("mUploadMessage = "+mUploadMessage); mUploadMessage = null; } } } Last thing, add to Manifest <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.CAMERA"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> It should work on lollipop and marshmallow
26a00e02e186b6e159a67bb7b13a9ebd64a95b354d5c9c4463d43e2a0d25ef19
['f6dbb4ef8c6f4de09fba0e4a650ab0b1']
What is currentDelayMs for video stream actually ? How currentDelayMs is calculated in webrtc-internals? Why it differs from Rtt? I tried to get an average of delay in video and audio from the graphs. Sometimes average delay is found about 2.25s. I want to know what it represents and how it is being calculated.
01f939133f8aba88530e4f379575c8890e82685372bbdcfd81a38d8fce4f1d02
['f6dbb4ef8c6f4de09fba0e4a650ab0b1']
Is there any standard for tolerable delay in audio and video communication for web ? I have noticed delay using my WebRTC application and want to compare it with the standard (if any). Wikipedia has mentioned following delays: Live audio : several hundred ms to a few seconds, Telephone Calls : 200ms, IP calls: min 20ms, max 150ms Computer audio: 500ms From book "Deploying QoS for Cisco IP and Next Generation Networks: The Definitive Guide" By <PERSON>, <PERSON>: Voice : 150ms one way Interactive video: 150ms (upto 200ms) live : 150ms video on demand : 150ms Multimedia conferencing and streaming: >400ms Which one should i compare with ? Interactive video, Multimedia conferencing or IP calls ?
49db6e3cd02050ed0cb1f1e295d417940fd1c75e475c905db22e3a36a6d23e04
['f6e5df0a4dff434fb6e4e89a32cb7bb3']
I have added jCarousel to the HTML Form which has multiple columns. For example: I have list of cars arranged first column and then it will have feature list of these cars in 8 columns which user can set using input fields. If I set the list of cars outside of jCarousel it will not lined-up with input fields since some feature text needs multiple lines and if I add it inside jCarousel DIV User will not be able to see the name of car on scrolling to next fetatures. Can anybody please help me to set first column static/fixed? so that if user clicks on button to scroll to next feature list of cars will be visible for all the feature. All suggestions are welcome
d512605eacdeab5f1a859ddc36097f036bd9ea4d4d1e1dfbcf83d8718d133a4e
['f6e5df0a4dff434fb6e4e89a32cb7bb3']
I have one daemon process written in perl which listens custom commands on port 8622. Now I want to write a client program which can call daemon process using telnet command. client program must grab the output and process further based on received output. I don't have any username password for telnet which is running on port 8622. Following is my code for client program #!/usr/bin/perl -wl use Net::Telnet; $port = 8622; $IP = '<IP_ADDRESS><IP_ADDRESS>Telnet; $port = 8622; $IP = '127.0.0.1'; $cmd = "CSDD"; #command to send $telnet = new Net<IP_ADDRESS>Telnet ( Timeout=>5, port=>$port, Errmode=>'die',Prompt => '/\$ $/i'); $telnet->open($IP); #$telnet->login('',''); print $telnet->cmd($cmd); $telnet->close; exit; Daemon process receives the command but it keeps running in infinite loop even there is no condition check for anything. Daemon process works correctly if I run telnet from command prompt. I hope I have explained correctly with my poor English. I very new to perl so please help me out. Thanks in advance :)
b800ef24a7a1c3e4a8fe0f631ad4b50a1538399f121380610a8b0bba1db14566
['f6eb53b69dc04b61baac9ae1810d5cef']
I got stuck with such kind of problem. I'm developing Django application hosted on Apache/mod_wsgi. I replaced the standard Django authentication with REMOTE_USER authentication according to: https://docs.djangoproject.com/en/1.8/howto/auth-remote-user/ I want to get valid user from Apache mod_auth_vas service (which I have ran on server), when user requests: mysite.my/login So, my wsgi.conf is like below and I get prompt for authenticate user on mysite.my/login: WSGIApplicationGroup %{GLOBAL} WSGIPythonHome /proj/tool/appl/portal/.venv WSGIScriptAlias / /proj/tool/appl/portal/portal/wsgi.py WSGIDaemonProcess portal python-path=/proj/tool/appl/portal/.venv/lib/python3.4/site-packages processes=1 threads=60 graceful-timeout=30 maximum-requests=1000 restart-interval=0 header-buffer-size=32768 WSGIProcessGroup portal WSGISocketPrefix /tmp/wsgi LogLevel debug ErrorLog "/proj/weblogs/backendlogs/portal/apache/server1/wsgi/error.log" CustomLog "/proj/weblogs/backendlogs/portal/apache/server1/wsgi/access.log" combined #Timeout 600 <Directory /proj/tool/appl/portal/portal> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> <Location "/login"> Order deny,allow Allow from all AllowOverride AuthConfig Limit FileInfo Indexes AuthType VAS AuthVASUseBasic on AuthName "[ Enter Windows Password ]" Require valid-user </Location> Prompt works okay: How prompt looks like Problem is that: After login on the url: mysite.my/login Django session.user is correct (AuthenticatedUser) and SESSION_KEY is not None value: urls.py from django.conf.urls import url urlpatterns = [ url(r'^index', views.index, name='index') url(r'^login', views.login, name='login'), ] views.py def login(request, node): user = request.user session_key = request.session.session_key return HttpResponse("User is: {}<br />" "SessionKey is: {}<br />" .format(user, session_key)) def index(request, node): user = request.user session_key = request.session.session_key return HttpResponse("User is: {}<br />" "SessionKey is: {}<br />" .format(user, session_key)) mysite.my/login result of login is like: Result at url /login User is: AuthenticatedUser SessionKey is: pobrdspueqwopyu4ch6e07ziipi6zn2k But after that when I go e.g. to mysite.my/index unexpectedly Django doesn't see the User nor session_key like (Lost SESSION?): mysite.my/index Result when go to another url than /login User is: SessionKey is: None I have no idea why it happens. I tried to diable cahching, read session in templates but everything didn't work. Still ehen I go to another site than mysite.my/login the session disappears. My settings.py: TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'OPTIONS': { 'context_processors': [ "django.contrib.auth.context_processors.auth", "django.template.context_processors.debug", "django.template.context_processors.i18n", "django.template.context_processors.media", "django.template.context_processors.static", "django.template.context_processors.tz", "django.contrib.messages.context_processors.messages", "django.core.context_processors.request", "django.template.context_processors.request", ], 'debug': DEBUG, 'loaders': [ 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', ] } } ] MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', # RemoteUser https://docs.djangoproject.com/en/1.8/howto/auth-remote-user/ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.RemoteUserMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', ) AUTHENTICATION_BACKENDS = [ "django.contrib.auth.backends.RemoteUserBackend" ] SESSION_ENGINE = "django.contrib.sessions.backends.db" # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'portal.wsgi.application' ROOT_URLCONF = 'portal.urls' INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'crispy_forms', ] My question is that: Why Django looses Session data when I go to another url site? When I run it locally by manage.py runserver Session works properly. Thanks in advance for help. If I can correct something in question please inform. It's a first time I ask here.
a7b8b3c8d4da82a743e468368f27ff30bdd06c76878de51b12342a84f208472e
['f6eb53b69dc04b61baac9ae1810d5cef']
For me worked solution based on: https://docs.djangoproject.com/pl/1.11/topics/auth/customizing/#extending-user Let me explain what I did with Groups extending default model with email alias: First of all I created my own django application let name it python manage.py startapp auth_custom Code section: In auth_custom/models.py I created object CustomGroup from django.contrib.auth.models import Group from django.db import models class CustomGroup(models.Model): """ Overwrites original Django Group. """ def __str__(self): return "{}".format(self.group.name) group = models.OneToOneField('auth.Group', unique=True) email_alias = models.EmailField(max_length=70, blank=True, default="") In auth_custom/admin.py: from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin from django.contrib.auth.models import Group class GroupInline(admin.StackedInline): model = CustomGroup can_delete = False verbose_name_plural = 'custom groups' class GroupAdmin(BaseGroupAdmin): inlines = (GroupInline, ) # Re-register GroupAdmin admin.site.unregister(Group) admin.site.register(Group, GroupAdmin) After making migrations I have such result in Django Admin view. Custom Group in Django Admin In order to access this custom field you must type: from django.contrib.auth.models import Group group = Group.objects.get(name="Admins") # example name email_alias = group.customgroup.email_alias If any mistakes please notify me, I'll correct this answere.
4107b45d5e5aeadc93bf16258dc48f2abf5ee57eedcefadc3da7a971cc34ef35
['f6f988e3b4bd40d18def5173d9bbbad7']
First-class continuations support allows you to express $P \lor \neg P$. The trick is based on the fact that not calling the continuation and exiting with some expression is equivalent to calling the continuation with that same expression. For more detailed view please see: http://www.cs.cmu.edu/~rwh/courses/logic/www-old/handouts/callcc.pdf
90496c93010603e780cf5ad1f2d452f91dc4e17b1bcde3a20721431415302340
['f6f988e3b4bd40d18def5173d9bbbad7']
The problem with your snippet is that [ H: ?P |- ?P ] will always match in this case. The first time it will match H : blah, and the second time it will match H : C -- as C and blah are convertible in Coq -- and the unfold will not change anything, thus aborting the repeat. I would write Ltac my_auto_unfold nam := repeat lazymatch goal with | [ H : nam |- _ ] => unfold nam in H end. Theorem g: blah -> blah -> blah. Proof. intros. my_auto_unfold blah. auto. Qed. You can even write Theorem g: blah -> blah -> blah. Proof. intros. match goal with | [ |- ?p] => my_auto_unfold p end. auto. Qed. if you prefer so.
f16560fe7b48c9d493d6c3447aea7ae8c85fb6905ca04c57041dd110be0c5aa7
['f70a0416f6a44451beed1a28d036ef95']
I'm trying to make a text-based rpg using javascript. I currently have a script that can run by itself; as in it's completely automated and receives no input from the player. But I want to make it so that I can take the value from a textfield when the user pushes the button. So for example, if the user enters attack into the textfield and presses the button, it'll go to a attack function. Pretty much what I'm trying to do is turn one of my Java applets into javascript. So first, here's the java applet code: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.Random; /** * * @author C.C */ public class slime extends javax.swing.JApplet { Random rng = new Random(); int choice; int player = 100; int king = 100; int slime = 50; /** * Initializes the applet slime */ @Override public void init() { initComponents(); choice = rng.nextInt(10)+1; if(choice >=7) { battle.append("You are the hero. You have 100 health." + "\n"); battle.append("You encountered a King Slime!" + "\n\n"); } else { battle.append("You are the hero. You have 100 health." + "\n"); battle.append("You encountered a slime!" + "\n\n"); } /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(slime.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(slime.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(slime.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(slime.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the applet */ try { java.awt.EventQueue.invokeAndWait(new Runnable() { public void run() { } }); } catch (Exception ex) { ex.printStackTrace(); } } /** * This method is called from within the init() method to initialize the * form. WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { jScrollPane1 = new javax.swing.JScrollPane(); battle = new javax.swing.JTextArea(); attack = new javax.swing.JButton(); heal = new javax.swing.JButton(); charge = new javax.swing.JButton(); run = new javax.swing.JButton(); battle.setColumns(20); battle.setRows(5); jScrollPane1.setViewportView(battle); attack.setText("Attack"); attack.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { attackActionPerformed(evt); } }); heal.setText("Heal"); heal.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { healActionPerformed(evt); } }); charge.setText("Charge"); charge.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { chargeActionPerformed(evt); } }); run.setText("Run"); run.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { runActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(heal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(attack, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(charge, javax.swing.GroupLayout.DEFAULT_SIZE, 170, Short.MAX_VALUE) .addComponent(run, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(attack) .addComponent(charge)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(heal) .addComponent(run)) .addContainerGap()) ); }// </editor-fold> private void attackActionPerformed(java.awt.event.ActionEvent evt) { int damage = rng.nextInt(10)+1; int damage2 = rng.nextInt(25)+10; int damage3 = rng.nextInt(20)+5; if(player <= 0) { battle.append("You have died" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } else { if(damage >=7) { battle.append("You did "+ String.valueOf(damage)+ " damage. It was a critcal hit!" + "\n"); if (choice >=7) { king = king-damage; battle.append("The King Slime has " + king + " health left!" + "\n"); if(king <=0) { battle.append("You have defeated the King Slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The King Slime hit you for " + String.valueOf(damage2) + " damage!" + "\n"); player = player-damage2; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } else { slime = slime-damage; battle.append("The slime has " + slime + " health left!" + "\n"); if(slime <=0) { battle.append("You have defeated the slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The slime hit you for " + String.valueOf(damage3) + " damage!" + "\n"); player = player-damage3; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } } else { battle.append("You did "+ String.valueOf(damage)+ " damage." + "\n"); if (choice >=7) { king = king-damage; battle.append("The King Slime has " + king + " health left!" + "\n"); if(king <=0) { battle.append("You have defeated the King Slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The Slime King hit you for " + String.valueOf(damage2) + " damage!" + "\n"); player = player-damage2; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } else { slime = slime-damage; battle.append("The slime has " + slime + " health left!" + "\n"); if(slime <=0) { battle.append("You have defeated the slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The slime hit you for " + String.valueOf(damage3) + " damage!" + "\n"); player = player-damage3; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } } } } private void healActionPerformed(java.awt.event.ActionEvent evt) { int heal = rng.nextInt(40)+20; int damage2 = rng.nextInt(25)+10; int damage3 = rng.nextInt(20)+5; if(player <= 0) { battle.append("You have died" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); } else { battle.append("You healed for " + heal + " health.\n"); player = player+heal; if (choice >=7) { battle.append("The King Slime has " + king + " health left!" + "\n"); battle.append("The King Slime hit you for " + String.valueOf(damage2) + " damage!" + "\n"); player = player-damage2; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } else { battle.append("The slime has " + slime + " health left!" + "\n"); battle.append("The slime hit you for " + String.valueOf(damage3) + " damage!" + "\n"); player = player-damage3; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } } } private void chargeActionPerformed(java.awt.event.ActionEvent evt) { int damage = rng.nextInt(30)+10; int damage2 = rng.nextInt(25)+10; int damage3 = rng.nextInt(20)+5; if(player <= 0) { battle.append("You have died" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } else { battle.append("You skip a turn to charge a more powerful attack!" +"\n"); if (choice >=7) { battle.append("The King Slime has " + king + " health left!" + "\n"); battle.append("The King Slime hit you for " + String.valueOf(damage2) + " damage!" + "\n"); player = player-damage2; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } else { battle.append("The slime has " + slime + " health left!" + "\n"); battle.append("The slime hit you for " + String.valueOf(damage3) + " damage!" + "\n"); player = player-damage3; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } if(player <=0) { battle.append("You have died" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } else { if (choice >=7) { battle.append("You unleash a powerful attack at the King Slime for " + damage + " damage.\n"); king = king-damage; battle.append("The King Slime has " + king + " health left!" + "\n"); if(king <=0) { battle.append("You have defeated the King Slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The King Slime hit you for " + String.valueOf(damage2) + " damage!" + "\n"); player = player-damage2; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } else { battle.append("You unleash a powerful attack at the slime for " + damage + " damage.\n"); slime = slime-damage; battle.append("The slime has " + slime + " health left!" + "\n"); if(slime <=0) { battle.append("You have defeated the slime!" + "\n\n"); attack.setEnabled(false); battle.setEnabled(false); charge.setEnabled(false); heal.setEnabled(false); } battle.append("The slime hit you for " + String.valueOf(damage3) + " damage!" + "\n"); player = player-damage3; if(player < 0) { player = 0; } battle.append("You have "+ String.valueOf(player) + " health left." + "\n\n"); } } } } private void runActionPerformed(java.awt.event.ActionEvent evt) { if (player==0) { battle.append("Running won't do you any good when you are dead. \n\n"); } else { battle.append("You can't run in this game you sissy.\n\n"); } } // Variables declaration - do not modify private javax.swing.JButton attack; private javax.swing.JTextArea battle; private javax.swing.JButton charge; private javax.swing.JButton heal; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton run; // End of variables declaration } Here is what my javascript file looks like currently: //Player Function var players = function(attack, health){ this.health = health; this.attack = attack; }; //Make Player Here var player = new players(50, 1000); //Monster Function var monsters = function(attack, health){ this.health = health; this.attack = attack; }; //Make Monsters Here var kingSlime = new monsters(100, 300); var slime = new monsters(25, 100); var <PERSON> = new monsters(50, 200); //Make String Names Here var names; //Make randomnumber Here var randomnumber = Math.floor(Math.random(10)*10); //Make selectedmonster Here var selectedmonster; if (randomnumber >= 0 && randomnumber < 3){ selectedmonster = <PERSON>; names = "King Slime"; } else if (randomnumber > 3 && randomnumber < 6){ selectedmonster = <PERSON>; names = "<PERSON>"; } else if (randomnumber > 6){ selectedmonster = slimeWarrior; names = "Slime Warrior"; } //Battle Script var <PERSON> = 1; var monsterdead = 0; var playerdead = 0; //player goes first, playerturn = 1 var playerturn = 1; var monsterturn = 0; while (battle == 1){ //Player's Turn while (playerturn == 1){ //Write Player Attack Script selectedmonster.health = selectedmonster.health - Math.ceil(Math.random(player.attack)*10); document.write(names + "'s Health is now " + selectedmonster.health+"<br>"); playerturn = 0; monsterturn = 1; } //Monster's Turn while (monsterturn == 1){ //Write Monster Attack Script player.health = player.health - Math.ceil(Math.random(selectedmonster.attack)*10); document.write("Player's Health is now " + player.health+"<br>"); playerturn = 1; monsterturn = 0; } //When Monster Dies if (selectedmonster.health < 0){ document.write("You beat the " + names + "!<br>"); monsterdead = 1; battle = 0; } //When Player Dies if (player.health < 0){ document.write("You have died.<br>"); playerdead = 1; battle = 0; } } So any idea as to how I can add player interaction in the javascript? Thanks.
5178787580ee05e69a0d8c6fad8f8fabffbbabf224dd633342c6b622ddd37f21
['f70a0416f6a44451beed1a28d036ef95']
I'm trying to post an image when in my javascript file with document.write(). The problem is that when I try it, the image always comes up broken. Here is the code. Am I writing the tag wrong? I've tested the images on non-javascript pages and they seem to show up fine. var replay = "yes"; var userChoice = prompt("Do you choose rock, paper or scissors?"); userChoice = userChoice.toLowerCase(); var computerChoice = Math.random(); if (computerChoice < 0.34) { computerChoice = "rock"; } else if (computerChoice <= 0.67) { computerChoice = "paper"; } else { computerChoice = "scissors"; } var compare = function (choice1, choice2) { if (choice1 === choice2) { document.write("The result is a tie!"); } if (choice1 === "rock") { if (choice2 === "scissors") { document.write('<img src="images\orna.jpg\">'); } else { document.write("Computer chose paper. Computer wins."); } } if (choice1 === "paper") { if (choice2 === "scissors") { document.write("Computer chose scissors. Computer wins."); } else { document.write("Computer chose rock. Player wins."); } } if (choice1 === "scissors") { if (choice2 === "paper") { document.write("Computer chose paper. Player wins."); } else { document.write("Computer chose scissors. Computer wins."); } } }; compare(userChoice, computerChoice);
5e7d1fa64ea99a4aa4856493fee7d61cb21c2748c43d17f56b684504c060f09d
['f70e41f9c0564d99a4d6ef697ed97a7e']
There are a couple of problems: 1) google.maps.event.addListener(mapObject, 'click', function(event) You haven't provided your map creation code, but the variable mapObject should be a map object... That doesn't fit with any of your other references to the map object map. 2) new google.maps.LatLng(event.latLng) You don't need to parse the event.LatLng value, it will already be a latitude/longitude value. Here is a working example, with the corrections noted above. The InfoBox will output undefined because content[0] is undefined, but that can be any valid text you want. <!DOCTYPE html> <html> <head> <style type="text/css"> html, body, #map_canvas { margin: 0; padding: 0; height: 100%; } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js"></script> <script type="text/javascript"> var map; function test() { var myOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); google.maps.event.addListener(map, 'click', function(event) { var invisibleMarker = new google.maps.Marker({ position: event.latLng, map: map }); var boxText = document.createElement("div"); boxText.style.cssText = "background: none; padding: 0;"; boxText.innerHTML = '<div style="margin: 0 0 20px 0;padding: 18px;background: white url(/media/images/map-marker-info-bg.gif) repeat-x top left;">' + content[0] + '</div>'; var myOptions = { content: boxText /*,latlng: event.latLng ,alignBottom: true ,pixelOffset: new google.maps.Size(-470, -20) ,boxStyle: { background: "transparent url('/media/images/map-marker-info-arrow.png') no-repeat bottom right" ,opacity: 1 ,width: "470px" } ,closeBoxMargin: "18px 18px 2px 2px" ,closeBoxURL: "/media/images/map-marker-info-close.gif" ,infoBoxClearance: new google.maps.Size(5, 5) ,enableEventPropagation: false*/ }; var ib = new InfoBox(myOptions); ib.open(map, invisibleMarker); }); } </script> </head> <body onload="test();"> <div id="map_canvas"></div> </body> </html>
5240ef341b499a4cd9499e766e1f7903bcbea58f51398c11bc4059c459c9f64e
['f70e41f9c0564d99a4d6ef697ed97a7e']
You can try switching based on file types. If you take the extension of the file: $ext = pathinfo($file, PATHINFO_EXTENSION); Then you can whitelist your images as so: if($ext != 'gif' && $ext != 'jpg' && $ext != 'png' && $ext != 'jpeg') { header ('Content-Disposition: attachment; filename="'.basename($file).'"'); } Or, alternatively whitelist your downloads: if($ext == 'rar') { header ('Content-Disposition: attachment; filename="'.basename($file).'"'); }
69fa5210d39a9d5c88991a57e26c7af5af3eb2fd23b3dbcd605cf898054f3aaa
['f71471d913534f51934f9fe3debcb867']
I am new to the world of cloud and have much to learn so forgive me if this is a simple and obvious question to ask. I am trying to deploy a WordPress website on the cloud. I am following this tutorial as a starting point WordPress Website with an External Amazon RDS Database to Elastic Beanstalk I created my database but the name I give it does not show up I have seen the answer from this question , it mentions that it sets the db to a default name and nothing more. I would like to know if there is a way to rename/give the database a name after creating it and if the issue is a bug. Thank you in advance for your help and guidance.
3af9a099271eaa6024605ba3984bd245324e85439ac4e08c55a5a5ba753d58b2
['f71471d913534f51934f9fe3debcb867']
I am making a dashboard with react, I want to have doughnut charts that display some information. I am following this tutorial that uses chartjs and I have ran into an unexpected problem. When I run my app, the dashboard does not display the doughnut chart, however if I add a Line graph or bar chart, they display as expected This is the dashboard when trying to rendering a doughnut chart, I have circled what I think is the canvas for the chart This is the code import React from 'react'; import {Pie, Doughnut} from 'react-chartjs-2'; const state = { labels: ['January', 'February', 'March', 'April', 'May'], datasets: [ { label: 'Rainfall', backgroundColor: [ '#B21F00', '#C9DE00', '#2FDE00', '#00A6B4', '#6800B4' ], hoverBackgroundColor: [ '#501800', '#4B5000', '#175000', '#003350', '#35014F' ], data: [65, 59, 80, 81, 56] } ] } export default class App extends React.Component { render() { return ( <div> <Doughnut data={state} options={{ width:"400", height:"400", responsive: true, maintainAspectRatio: true, title:{ display:true, text:'Average Rainfall per month', fontSize:20 }, legend:{ display:true, position:'right' } }} /> </div> ); } } I have looked at the following solution found on the following question, but it is still not working. Note that the pie chart is also not displaying correctly, only bar and line charts display correctly Can't resize react-chartjs-2 doughnut chart TL;DR: Chart-js in react not showing doughnut chart but other charts work.
c7cbe52aec7f236388aabb56566fb50a7dcc44aa57e0e001eb8f12283f5095f7
['f7186eb774694fd39e6e2bc081fc4166']
My Problem is Showing 3D Bar chart With not more than 10 values in one series. Coming to library what i have used is J4L charts for Graphical reports in my android application. So , when i want to show more series values , am unable to show them in chart only i can show 10 series values. Hope you people understood. if anyone used J4L charts in android please tell me how to show more series values . It is very Urgent to me. Hope you people understand. Thanking you well in advance
526528c9c8560a80d5ac8afbcdfa3883481fb9a4dbc3d6bd4763455f84135681
['f7186eb774694fd39e6e2bc081fc4166']
I have done lot of research in collecting several types of charts in android... these are some of them..... Java related charts J4L charts artful bits charts steema charts afreecharts android plot achart engine charts Using Javascript charts are build . Below i have mentioned them mcharts opengl fusion charts ... like this you can have many more building charts using javascript
a13df9a063bd8b40c72c1d0ffae1bcfb068384b54acc632852dfd1186b154014
['f71ad9ef5df243c896052037d7100c1e']
I am trying to exchange some data between android and other arm device via BLE, and large data was splitted into small fragments since the limitation of MTU. For robustness, one frame CAN ONLY be sended(by writeCharacteristic) when its previous frame has been confirmed(by onCharacteristicWrite). now here comes the issues: when android device finished sending the last frame and then received data from peer device(by onCharacteristicChanged), it seams onCharacteristicWrite comes later than onCharacteristicChanged(at least log says that) and here is my code. @Override public void onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (status != BluetoothGatt.GATT_SUCCESS) { stateProcessError(); // State = STATE_IDLE return; // Log.v("error occurs", "do something"); } Log.v("didsend", "State:" + State); processEvent(sp_event.DATA_SEND_CFM, null); } @Override public void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic) { Log.v("didrecv", "State:" + State); Object msg = constructRxMsg(characteristic.getValue()); processEvent(sp_event.DATA_RECV_CFM, msg); } private void stateSendAuthReq(sp_event event) { switch (event) { case DATA_IDLE: { SPTxMsgAuthReq msg = new SPTxMsgAuthReq(Mode); sendData(msg.getMsg()); } break; case DATA_SEND_CFM: State = sp_state.STATE_RECV_AUTH_RES; Log.v("sendReq", "change State"); break; default: Log.v("sendReq", "default"); this.stateProcessError(); break; } } private void stateRecvAuthRes(sp_event event, SPRxMsgAuthRes msg) { if (sp_event.DATA_RECV_CFM != event || null == msg) { this.stateProcessError(); return; } if (MSG_TYPE_AUTH_RES != msg.getType() || STATUS_AUTH_READY != msg.getStatus()) { Log.v("recvAuthRes", "incorrect param"); this.stateProcessError(); return; } State = sp_state.STATE_RECV_NONCE; } private void processEvent(sp_event event, Object msg) { switch (State) { case STATE_IDLE: this.stateSendAuthReq(event) break; case STATE_RECV_AUTH_RES: this.stateRecvAuthRes(event, (SPRxMsgAuthRes) msg); break; ...... } } Log shows the issue as this: 06-16 17:32:46.521 10300-10412/alps.ble.bt V/send: data:[-32, 3, 3, 1, 0] 06-16 17:32:46.621 10300-10406/alps.ble.bt V/didrecv: State:STATE_IDEL 06-16 17:32:46.621 10300-10406/alps.ble.bt V/constructRxMsg: data:[-31, 2, 3, 0] 06-16 17:32:46.621 10300-10406/alps.ble.bt V/error occurs: do something 06-16 17:32:46.621 10300-10406/alps.ble.bt V/didsend: State:STATE_IDLE And next is the log when no error: 06-16 16:30:<PHONE_NUMBER>/alps.ble.bt V/send: data:[-32, 3, 3, 1, 0] 06-16 16:30:<PHONE_NUMBER>/alps.ble.bt D/BluetoothGatt: onClientConnParamsChanged() - Device=68:68:28:40:12:8E interval=39 status=0 06-16 16:30:<PHONE_NUMBER>/alps.ble.bt V/didsend: State:STATE_IDLE 06-16 16:30:<PHONE_NUMBER>/alps.ble.bt V/didrecv: State:STATE_RECV_AUTH_RES 06-16 16:30:<PHONE_NUMBER>/alps.ble.bt V/constructRxMsg: data:[-31, 2, 3, 0] NOTE: code in peer device should be correct because everything was ok when I test on iOS instead of android. I hope enough info has been provided and any help will be appreciated, thank you!
223fa048e08695a178c95b53e9bb23dee3386360fd9a4d10ee12f6a1b742e9e0
['f71ad9ef5df243c896052037d7100c1e']
I am trying to establish a wifi connection between iPhone and another ARM device(as AP), and thanks to NEHotsportConfiguration added in iOS11, the connecting process becomes easy and quick and all I need is AP's ssid and password which will be transmitted via BLE, Of cause they must be encrypted. now here comes the question if it's possible to use WPS instead of transmitting password in air. I have read something and given my own answer No, so please correct me if have any mistakes, thank you.
dc12e4e9dd3fd7672f8cd5c5e95390f8f960b1f034b83be2ce6fd7d30c84a26e
['f72134eb1f294c2488f4faf0cbe374f5']
Got the solution, I used the following XAML to HTML converter in my silverlight project. Thanks // --------------------------------------------------------------------- // // Internal Methods // // --------------------------------------------------------------------- #region Internal Methods /// <summary> /// Main entry point for Xaml-to-Html converter. /// Converts a xaml string into html string. /// </summary> /// <param name="xamlString"> /// Xaml strinng to convert. /// </param> /// <returns> /// Html string produced from a source xaml. /// </returns> static StringBuilder htmlStringBuilder; public static string ConvertXamlToHtml(string xamlString) { xamlString = "<FlowDocument>" + xamlString + "</FlowDocument>"; XmlReader xamlReader; XmlWriter htmlWriter; XmlWriterSettings ws = new XmlWriterSettings(); xamlReader = XmlReader.Create(new StringReader(xamlString)); htmlStringBuilder = new StringBuilder(); htmlWriter = XmlWriter.Create(htmlStringBuilder,ws); if (!WriteFlowDocument(xamlReader, htmlWriter)) { return ""; } htmlWriter.Flush(); string htmlString = htmlStringBuilder.ToString(); return htmlString; } #endregion Internal Methods // --------------------------------------------------------------------- // // Private Methods // // --------------------------------------------------------------------- #region Private Methods /// <summary> /// Processes a root level element of XAML (normally it's FlowDocument element). /// </summary> /// <param name="xamlReader"> /// XmlReader for a source xaml. /// </param> /// <param name="htmlWriter"> /// XmlWriter producing resulting html /// </param> private static bool WriteFlowDocument(XmlReader xamlReader, XmlWriter htmlWriter) { if (!ReadNextToken(xamlReader)) { // Xaml content is empty - nothing to convert return false; } if (xamlReader.NodeType != XmlNodeType.Element || xamlReader.Name != "FlowDocument") { // Root FlowDocument elemet is missing return false; } // Create a buffer StringBuilder for collecting css properties for inline STYLE attributes // on every element level (it will be re-initialized on every level). StringBuilder inlineStyle = new StringBuilder(); htmlWriter.WriteStartElement("HTML"); htmlWriter.WriteStartElement("BODY"); WriteFormattingProperties(xamlReader, htmlWriter, inlineStyle); WriteElementContent(xamlReader, htmlWriter, inlineStyle); htmlWriter.WriteEndElement(); htmlWriter.WriteEndElement(); return true; } /// <summary> /// Reads attributes of the current xaml element and converts /// them into appropriate html attributes or css styles. /// </summary> /// <param name="xamlReader"> /// XmlReader which is expected to be at XmlNodeType.Element /// (opening element tag) position. /// The reader will remain at the same level after function complete. /// </param> /// <param name="htmlWriter"> /// XmlWriter for output html, which is expected to be in /// after WriteStartElement state. /// </param> /// <param name="inlineStyle"> /// String builder for collecting css properties for inline STYLE attribute. /// </param> private static void WriteFormattingProperties(XmlReader xamlReader, XmlWriter htmlWriter, StringBuilder inlineStyle) { Debug.Assert(xamlReader.NodeType == XmlNodeType.Element); // Clear string builder for the inline style inlineStyle.Remove(0, inlineStyle.Length); if (!xamlReader.HasAttributes) { return; } bool borderSet = false; while (xamlReader.MoveToNextAttribute()) { string css = null; switch (xamlReader.Name) { // Character fomatting properties // ------------------------------ case "Background": css = "background-color:" + ParseXamlColor(xamlReader.Value) + ";"; break; case "FontFamily": css = "font-family:" + xamlReader.Value + ";"; break; case "FontStyle": css = "font-style:" + xamlReader.Value.ToLower() + ";"; break; case "FontWeight": css = "font-weight:" + xamlReader.Value.ToLower() + ";"; break; case "FontStretch": break; case "FontSize": css = "font-size:" + xamlReader.Value + ";"; break; case "Foreground": css = "color:" + ParseXamlColor(xamlReader.Value) + ";"; break; case "TextDecorations": css = "text-decoration:underline;"; break; case "TextEffects": break; case "Emphasis": break; case "StandardLigatures": break; case "Variants": break; case "Capitals": break; case "Fraction": break; // Paragraph formatting properties // ------------------------------- case "Padding": css = "padding:" + ParseXamlThickness(xamlReader.Value) + ";"; break; case "Margin": css = "margin:" + ParseXamlThickness(xamlReader.Value) + ";"; break; case "BorderThickness": css = "border-width:" + ParseXamlThickness(xamlReader.Value) + ";"; borderSet = true; break; case "BorderBrush": css = "border-color:" + ParseXamlColor(xamlReader.Value) + ";"; borderSet = true; break; case "LineHeight": break; case "TextIndent": css = "text-indent:" + xamlReader.Value + ";"; break; case "TextAlignment": css = "text-align:" + xamlReader.Value + ";"; break; case "IsKeptTogether": break; case "IsKeptWithNext": break; case "ColumnBreakBefore": break; case "PageBreakBefore": break; case "FlowDirection": break; // Table attributes // ---------------- case "Width": css = "width:" + xamlReader.Value + ";"; break; case "ColumnSpan": htmlWriter.WriteAttributeString("COLSPAN", xamlReader.Value); break; case "RowSpan": htmlWriter.WriteAttributeString("ROWSPAN", xamlReader.Value); break; } if (css != null) { inlineStyle.Append(css); } } if (borderSet) { inlineStyle.Append("border-style:solid;mso-element:para-border-div;"); } // Return the xamlReader back to element level xamlReader.MoveToElement(); Debug.Assert(xamlReader.NodeType == XmlNodeType.Element); } private static string ParseXamlColor(string color) { if (color.StartsWith("#")) { // Remove transparancy value color = "#" + color.Substring(3); } return color; } private static string ParseXamlThickness(string thickness) { string[] values = thickness.Split(','); for (int i = 0; i < values.Length; i++) { double value; if (double.TryParse(values[i], out value)) { values[i] = Math.Ceiling(value).ToString(); } else { values[i] = "1"; } } string cssThickness; switch (values.Length) { case 1: cssThickness = thickness; break; case 2: cssThickness = values[1] + " " + values[0]; break; case 4: cssThickness = values[1] + " " + values[2] + " " + values[3] + " " + values[0]; break; default: cssThickness = values[0]; break; } return cssThickness; } /// <summary> /// Reads a content of current xaml element, converts it /// </summary> /// <param name="xamlReader"> /// XmlReader which is expected to be at XmlNodeType.Element /// (opening element tag) position. /// </param> /// <param name="htmlWriter"> /// May be null, in which case we are skipping the xaml element; /// witout producing any output to html. /// </param> /// <param name="inlineStyle"> /// StringBuilder used for collecting css properties for inline STYLE attribute. /// </param> private static void WriteElementContent(XmlReader xamlReader, XmlWriter htmlWriter, StringBuilder inlineStyle) { Debug.Assert(xamlReader.NodeType == XmlNodeType.Element); bool elementContentStarted = false; if (xamlReader.IsEmptyElement) { if (htmlWriter != null && !elementContentStarted && inlineStyle.Length > 0) { // Output STYLE attribute and clear inlineStyle buffer. htmlWriter.WriteAttributeString("STYLE", inlineStyle.ToString()); inlineStyle.Remove(0, inlineStyle.Length); } elementContentStarted = true; } else { while (ReadNextToken(xamlReader) && xamlReader.NodeType != XmlNodeType.EndElement) { switch (xamlReader.NodeType) { case XmlNodeType.Element: if (xamlReader.Name.Contains(".")) { AddComplexProperty(xamlReader, inlineStyle); } else { if (htmlWriter != null && !elementContentStarted && inlineStyle.Length > 0) { // Output STYLE attribute and clear inlineStyle buffer. htmlWriter.WriteAttributeString("STYLE", inlineStyle.ToString()); inlineStyle.Remove(0, inlineStyle.Length); } elementContentStarted = true; WriteElement(xamlReader, htmlWriter, inlineStyle); } Debug.Assert(xamlReader.NodeType == XmlNodeType.EndElement || xamlReader.NodeType == XmlNodeType.Element && xamlReader.IsEmptyElement); break; case XmlNodeType.Comment: if (htmlWriter != null) { if (!elementContentStarted && inlineStyle.Length > 0) { htmlWriter.WriteAttributeString("STYLE", inlineStyle.ToString()); } htmlWriter.WriteComment(xamlReader.Value); } elementContentStarted = true; break; case XmlNodeType.CDATA: case XmlNodeType.Text: case XmlNodeType.SignificantWhitespace: if (htmlWriter != null) { if (!elementContentStarted && inlineStyle.Length > 0) { htmlWriter.WriteAttributeString("STYLE", inlineStyle.ToString()); } htmlWriter.WriteString(xamlReader.Value); } elementContentStarted = true; break; } } Debug.Assert(xamlReader.NodeType == XmlNodeType.EndElement); } } /// <summary> /// Conberts an element notation of complex property into /// </summary> /// <param name="xamlReader"> /// On entry this XmlReader must be on Element start tag; /// on exit - on EndElement tag. /// </param> /// <param name="inlineStyle"> /// StringBuilder containing a value for STYLE attribute. /// </param> private static void AddComplexProperty(XmlReader xamlReader, StringBuilder inlineStyle) { Debug.Assert(xamlReader.NodeType == XmlNodeType.Element); if (inlineStyle != null && xamlReader.Name.EndsWith(".TextDecorations")) { inlineStyle.Append("text-decoration:underline;"); } // Skip the element representing the complex property WriteElementContent(xamlReader, /*htmlWriter:*/null, /*inlineStyle:*/null); } /// <summary> /// Converts a xaml element into an appropriate html element. /// </summary> /// <param name="xamlReader"> /// On entry this XmlReader must be on Element start tag; /// on exit - on EndElement tag. /// </param> /// <param name="htmlWriter"> /// May be null, in which case we are skipping xaml content /// without producing any html output /// </param> /// <param name="inlineStyle"> /// StringBuilder used for collecting css properties for inline STYLE attributes on every level. /// </param> private static void WriteElement(XmlReader xamlReader, XmlWriter htmlWriter, StringBuilder inlineStyle) { Debug.Assert(xamlReader.NodeType == XmlNodeType.Element); if (htmlWriter == null) { // Skipping mode; recurse into the xaml element without any output WriteElementContent(xamlReader, /*htmlWriter:*/null, null); } else { string htmlElementName = null; switch (xamlReader.Name) { case "Run": case "Span": htmlElementName = "SPAN"; break; case "InlineUIContainer": htmlElementName = "SPAN"; break; case "Bold": htmlElementName = "B"; break; case "Italic": htmlElementName = "I"; break; case "Paragraph": htmlElementName = "P"; break; case "BlockUIContainer": htmlElementName = "DIV"; break; case "Section": htmlElementName = "DIV"; break; case "Table": htmlElementName = "TABLE"; break; case "TableColumn": htmlElementName = "COL"; break; case "TableRowGroup": htmlElementName = "TBODY"; break; case "TableRow": htmlElementName = "TR"; break; case "TableCell": htmlElementName = "TD"; break; case "List": string marker = xamlReader.GetAttribute("MarkerStyle"); if (marker == null || marker == "None" || marker == "Disc" || marker == "Circle" || marker == "Square" || marker == "Box") { htmlElementName = "UL"; } else { htmlElementName = "OL"; } break; case "ListItem": htmlElementName = "LI"; break; default: htmlElementName = null; // Ignore the element break; } if (htmlWriter != null && htmlElementName != null) { htmlWriter.WriteStartElement(htmlElementName); WriteFormattingProperties(xamlReader, htmlWriter, inlineStyle); WriteElementContent(xamlReader, htmlWriter, inlineStyle); htmlWriter.WriteEndElement(); } else { // Skip this unrecognized xaml element WriteElementContent(xamlReader, /*htmlWriter:*/null, null); } } } // Reader advance helpers // ---------------------- /// <summary> /// Reads several items from xamlReader skipping all non-significant stuff. /// </summary> /// <param name="xamlReader"> /// XmlReader from tokens are being read. /// </param> /// <returns> /// True if new token is available; false if end of stream reached. /// </returns> private static bool ReadNextToken(XmlReader xamlReader) { while (xamlReader.Read()) { Debug.Assert(xamlReader.ReadState == ReadState.Interactive, "Reader is expected to be in Interactive state (" + xamlReader.ReadState + ")"); switch (xamlReader.NodeType) { case XmlNodeType.Element: case XmlNodeType.EndElement: case XmlNodeType.None: case XmlNodeType.CDATA: case XmlNodeType.Text: case XmlNodeType.SignificantWhitespace: return true; case XmlNodeType.Whitespace: if (xamlReader.XmlSpace == XmlSpace.Preserve) { return true; } // ignore insignificant whitespace break; case XmlNodeType.EndEntity: case XmlNodeType.EntityReference: // Implement entity reading //xamlReader.ResolveEntity(); //xamlReader.Read(); //ReadChildNodes( parent, parentBaseUri, xamlReader, positionInfo); break; // for now we ignore entities as insignificant stuff case XmlNodeType.Comment: return true; case XmlNodeType.ProcessingInstruction: case XmlNodeType.DocumentType: case XmlNodeType.XmlDeclaration: default: // Ignorable stuff break; } } return false; } #endregion Private Methods // --------------------------------------------------------------------- // // Private Fields // // --------------------------------------------------------------------- #region Private Fields #endregion Private Fields
2f92b647288c9a23ee82baccb2dab081a69baee97ac01d9955b770279664a27d
['f72134eb1f294c2488f4faf0cbe374f5']
I have created an application in silverlight containing a RichTextBox. Now, the problem is...I want the HTML of the data which is entered in RichTextBox. RichTextBox.xaml property gives me the xaml for the data in the RichTextBox. Now I want to convert this xaml into html. PS: I need to write the converter into SilverLight application itself. Not in another class library project. Please help, it will be very Helpful.
e3681f8faf56ecfb372c649aae1ed57314d1af75b249dee6893cde55c6fbc63c
['f728109b56a94044ba06ebeadec3c304']
Currently I have a batch file that calls a VBScript and executes the script and exits from that script into the command prompt window that I called the batch file from. I am wanting to return to the batch file from the VBScript and loop back into the beginning of the batch file and ask for the information from the user again and then go back into the script and repeat. I would also like to query the user as to whether they would like to quit or repeat after the VBscript has been run. Here is my batch file: @echo off C: cd C:\Users\Jared\Documents\Research\jared Set "File=basic.dat" Del "%File%" 2>NUL & If exist "%File%" ( Echo [+] File failed to delete: "%File%" >> "Report.txt" ) Set /P datafile=Please enter data file to be analyzed: Set /P filename=Please enter name for canvas file: mklink basic.dat %datafile% cscript Root_VBS_Script_1.vbs %filename% And here is my VBScript (Disregard the SendKeys method, I understand how unreliable it is and will modify this later to not use it): Set wshShell = CreateObject("Wscript.Shell") Set args = WScript.Arguments arg1 = args.Item(0) Dim filename filename = ""&arg1&"" WshShell.AppActivate "Command Prompt" WshShell.SendKeys "root -b" WshShell.SendKeys "~" WshShell.AppActivate "ROOT session" WshShell.SendKeys ".x analysis.C" WshShell.SendKeys "~" WshShell.SendKeys ".x double_gaus.C" WshShell.SendKeys "~" WshShell.AppActivate "ROOT session" WshShell.SendKeys "c1->SaveAs{(}"""&filename&"""{)}" WshShell.SendKeys "~" WshShell.SendKeys ".q" WshShell.SendKeys "~" WScript.Quit I have tried various ways of using the IF ERRORLEVEL command and keeping in mind that it must be in descending order when checked, but nothing is working.
977b446156d117234ceb387225894acb3096e46023835c81c84f4068a5ed934c
['f728109b56a94044ba06ebeadec3c304']
I am getting the following error with my code in a .vbs file: C:\...\Root_VBS_Script_1.vbs(19, 1) Microsoft VBScript runtime error: Invalid or unqualified reference 1 was unexpected at this time. The .vbs file is as follows: Set wshShell = CreateObject("Wscript.Shell") Set args = WScript.Arguments arg1 = args.Item(0) Dim filename filename = ""&arg1&"" WshShell.SendKeys "root -b" //opens root in batch mode WshShell.SendKeys "~" WshShell.AppActivate ROOT_session WshShell.SendKeys ".x analysis.C" wshShell.SendKeys "~" WshShell.SendKeys ".x double_gaus.C" WshShell.SendKeys "~" WshShell.AppActivate ROOT_session WshShell.SendKeys "c1->SaveAs("&filename&.pdf&")" WshShell.SendKeys "~" WshShell.SendKeys ".q" WshShell.SendKeys "~" WScript.Quit 1 I am using the send keys method to run a program called root (developed by CERN) out of a .vbs file called from a batch file. I am attaching the filename as a parameter when calling the .vbs file. I am uncertain as to why I am getting this error, but I do know that the send keys method opens root and works up until it is supposed to save c1 as the given filename and type. Can anyone help me resolve this error?
5cf7e2a6ec406b6e7dca1822e0947c5b731a8d948e385364acb6041535bf5eaf
['f7285678a18245528ec477ef341681af']
Sharepoint 2013. I am using wcf service to create items in list programmatically that contains DateTime value. This code falls with error "Invalid date/time value" on item[NewsFields.Date.InternalName] = DateTime.Now; Full code: public ServiceResult<bool> CreateNews() { try { using (var site = new SPSite(SPContext.Current.Site.ID)) using (var web = site.OpenWeb()) { web.AllowUnsafeUpdates = true; var list = web.GetList(Lists.LocalNewsList.ListUrl); var item = list.Items.Add(); item[NewsFields.Header.InternalName] = "Test"; item[NewsFields.Body.InternalName] = "Test"; item[NewsFields.FullBody.InternalName] = "Test"; item[NewsFields.Date.InternalName] = DateTime.Now; item.Update(); web.AllowUnsafeUpdates = false; return new ServiceResult<bool>(true); } } catch (Exception ex) { _logger.WriteLine("Error create test list item: {0}", ex.Message); _logger.WriteLine("Source: {0}", ex.Source); _logger.WriteLine("Stack trace: {0}", ex.StackTrace); return new ServiceResult<bool>(ex.Message); } }
eadfa33184a3713dfcc03b708589da74550df06268c7bd9cefeab380a484447a
['f7285678a18245528ec477ef341681af']
I have this liquidsoap script thath streaming an audio to icecast server out = output.icecast( host = "<IP_ADDRESS>", port = 8000, user = "dj", password = "test", name = "Test name", encoding = "UTF-8" ) wd = "C:/Users/Administrator/Desktop" pl = "#{wd}/dreamsoundstation" tech = "#{pl}/technical" set("log.file.path","#{tech}/liquidsoap.log") set("log.level", 3) promo_dir = "#{pl}/promo" ef = "#{pl}/efir" ni = "#{ef}/night" mo = "#{ef}/morning" da = "#{ef}/daytime" ev = "#{ef}/evening" mus_ni_dir = "#{ni}/music" mus_mo_dir = "#{mo}/music" mus_da_dir = "#{da}/music" mus_ev_dir = "#{ev}/music" jin_ni_dir = "#{ni}/jingles" jin_mo_dir = "#{mo}/jingles" jin_da_dir = "#{da}/jingles" jin_ev_dir = "#{ev}/jingles" mus_ni = playlist (reload = 360, "#{mus_ni_dir}") mus_mo = playlist (reload = 360, "#{mus_mo_dir}") mus_da = playlist (reload = 360, "#{mus_da_dir}") mus_ev = playlist (reload = 360, "#{mus_ev_dir}") jin_ni = playlist (reload = 360, "#{jin_ni_dir}") jin_mo = playlist (reload = 360, "#{jin_mo_dir}") jin_da = playlist (reload = 360, "#{jin_da_dir}") jin_ev = playlist (reload = 360, "#{jin_ev_dir}") promo = playlist (reload = 360, "#{promo_dir}") ins_ni = rotate (weights = [2, 1], [jin_ni, promo]) ins_mo = rotate (weights = [2, 1], [jin_mo, promo]) ins_da = rotate (weights = [2, 1], [jin_da, promo]) ins_ev = rotate (weights = [2, 1], [jin_ev, promo]) ni = rotate (weights = [3, 1], [mus_ni, ins_ni]) mo = rotate (weights = [3, 1], [mus_mo, ins_mo]) da = rotate (weights = [3, 1], [mus_da, ins_da]) ev = rotate (weights = [3, 1], [mus_ev, ins_ev]) radio = switch (track_sensitive = true, [ ({ 0h - 6h }, ni), ({ 6h - 12h }, mo), ({ 12h - 18h }, da), ({ 18h - 0h }, ev) ]) radio = crossfade(start_next=1., fade_out=1., fade_in=1., radio) out( %mp3(bitrate = 320, id3v2 = true), description = "MP3 320 Kbps", mount = "main", mksafe(radio) ) On my development machine that have real soundcard that works fine: mount point appears in icecast administration panel and i can hear an audio that plays in that mount. But production vds server (Windows Server 2013 Hyper-V virtualization) has no soundcard (even some virtually soundcard). That`s a sweety thing in Hyper-V. And when I execute this script mount point appears but there is no sound. Liquidsoap generate this logs 2015/06/20 00:47:07 >>> LOG START 2015/06/20 00:47:07 [protocols.external:3] Didn't find "ufetch". 2015/06/20 00:47:07 [protocols.external:3] Didn't find "wget". 2015/06/20 00:47:07 [main:3] Liquidsoap 1.0.1-win32 2015/06/20 00:47:07 [main:3] Using: graphics=[distributed with Ocaml] pcre=0.1.0 dtools=0.3.0 duppy=0.4.2 cry=0.2.2 mm=0.2.0 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.3 vorbis=0.6.1 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.1 aacplus=0.2.0 theora=0.3.0 schroedinger=0.1.0 gavl=0.1.4 ao=0.2.0 taglib=0.2.0 camomile=0.8.1 faad=0.3.0 yojson=1.0.2 2015/06/20 00:47:07 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master. 2015/06/20 00:47:07 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2015/06/20 00:47:07 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2015/06/20 00:47:07 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2015/06/20 00:47:07 [threads:3] Created thread "generic queue #1". 2015/06/20 00:47:07 [threads:3] Created thread "generic queue #2". 2015/06/20 00:47:07 [music:3] Loading playlist... 2015/06/20 00:47:07 [music:3] Playlist is a directory. 2015/06/20 00:47:07 [music:3] Successfully loaded a playlist of 31 tracks. 2015/06/20 00:47:07 [jingles:3] Loading playlist... 2015/06/20 00:47:07 [jingles:3] Playlist is a directory. 2015/06/20 00:47:07 [jingles:3] Got an empty list: keeping the old one. 2015/06/20 00:47:07 [promo:3] Loading playlist... 2015/06/20 00:47:07 [promo:3] Playlist is a directory. 2015/06/20 00:47:07 [promo:3] Got an empty list: keeping the old one. 2015/06/20 00:47:07 [music:3] Loading playlist... 2015/06/20 00:47:07 [music:3] Playlist is a directory. 2015/06/20 00:47:07 [music:3] Successfully loaded a playlist of 20 tracks. 2015/06/20 00:47:07 [jingles:3] Loading playlist... 2015/06/20 00:47:07 [jingles:3] Playlist is a directory. 2015/06/20 00:47:07 [jingles:3] Got an empty list: keeping the old one. 2015/06/20 00:47:07 [music:3] Loading playlist... 2015/06/20 00:47:07 [music:3] Playlist is a directory. 2015/06/20 00:47:07 [music:3] Successfully loaded a playlist of 41 tracks. 2015/06/20 00:47:07 [jingles:3] Loading playlist... 2015/06/20 00:47:07 [jingles:3] Playlist is a directory. 2015/06/20 00:47:07 [jingles:3] Got an empty list: keeping the old one. 2015/06/20 00:47:07 [music:3] Loading playlist... 2015/06/20 00:47:07 [music:3] Playlist is a directory. 2015/06/20 00:47:07 [music:3] Successfully loaded a playlist of 42 tracks. 2015/06/20 00:47:07 [jingles:3] Loading playlist... 2015/06/20 00:47:07 [jingles:3] Playlist is a directory. 2015/06/20 00:47:07 [jingles:3] Got an empty list: keeping the old one. 2015/06/20 00:47:07 [main:3] Connecting mount main for dj@<IP_ADDRESS>... 2015/06/20 00:47:07 [decoder:3] Method "MAD" accepted "C:/Users/Administrator/Desktop/dreamsoundstation/efir/evening/music/08 Never Strangers.mp3". 2015/06/20 00:47:07 [decoder:3] Method "MAD" accepted "C:/Users/Administrator/Desktop/dreamsoundstation/efir/daytime/music/07 - Smile when you smile.mp3". 2015/06/20 00:47:07 [decoder:3] Method "MAD" accepted "C:/Users/Administrator/Desktop/dreamsoundstation/efir/morning/music/05 - Pooma - January.mp3". 2015/06/20 00:47:07 [decoder:3] Method "MAD" accepted "C:/Users/Administrator/Desktop/dreamsoundstation/efir/night/music/01 Machine.mp3". 2015/06/20 00:47:07 [main:3] Connection setup was successful. 2015/06/20 00:47:07 [threads:3] Created thread "wallclock_main" (1 total). 2015/06/20 00:47:07 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock. 2015/06/20 00:47:07 [mksafe:3] Switch to safe_blank. 2015/06/20 00:55:27 [main:3] Shutdown started! 2015/06/20 00:55:27 [main:3] Waiting for threads to terminate... 2015/06/20 00:55:27 [main:3] Closing connection... 2015/06/20 00:55:27 [clock.wallclock_main:3] Streaming loop stopped. 2015/06/20 00:55:27 [threads:3] Thread "wallclock_main" terminated (0 remaining). 2015/06/20 00:55:27 [main:3] Cleaning downloaded files... 2015/06/20 00:55:27 >>> LOG END And I can not see nothing bad. Today I am streaming through Mixxx player with Asio4All. It works fine. But there no so powerfull functionality. So my question is can i use asio4all in liquidsoap? Or maybe i can use some virtual card (but after 15 minutes i don`t find any good solution)
ecc69b3348381883ff8c968604af7a0a12c2eeeecd0279e4536f14ab269e9aca
['f7330194c3f145ebac69eef936b47990']
To try and answer your question fully: You are right. As you can see here https://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html Thread.currentThread() returns a reference to the currently executing thread. Yes there is. Android: How do I stop Runnable? Because as you suggested in 1. you are interrupting the currently executing thread, which is the one the Bar context is in. Bar is causing it's own InterruptedException.
c71ef7a670c6c5d14fe73a0f6c39921822d77a53d8bc084b8b59ebbc4826e772
['f7330194c3f145ebac69eef936b47990']
Maybe I'm only being stupid right now, but I've been struggling really hard. I am writing a networking application that interacts with another library right now. The messages that this library produces are in the form Map<Path, Object>. These messages now need to be serialized. I do not know of what type these Object's are. They are only transferred between two objects that can handle them, but for this need to be serialized. I however struggle to understand how to do it. I've tried with Gson already but don't unterstand how to solve it. Code looks something like this: public interface Path extends Serializable{} public interface Network{ public Map<Path, Object> getSendMessages(); public void receiveMessage(Map<Path, Object> message); } public class Main { public static void main(String[] args) { Network nw1 = NetworkProvider.getNetwork(); Network nw2 = NetworkProvider.getNetwork(); //I don't know what these actually do with the messages. while(true) { Map<Path, Object> message = nw1.getSendMessages(); //__________What to do here?__________________ SerializedMessage serializedMessage = .... Map<Path, Object> deserializedMessage = .... //____________________________________________ nw2.receiveMessage(deserializedMessage); } } } }
4de750f3e2633ab5db259d0afc3476e0749b71bc5a7b9dbe065ac1a27c86fd3e
['f734108c942f4c9eb58138d2243c148d']
как передать объект в значении параметра при передаче GET-методом с помощью элемента <form>? необходимо получить https://example.com?token=123&obj={"name1":"value1"}&obj={"name2":"value2"} следующий способ не подходит: <form action="https://example.com"> <input type="hidden" name="token" value="123"> <input type="text" name="obj[name1]" value="value1"> <input type="text" name="obj[name2]" value="value2"> </form> результат https://example.com/?token=123&obj[name1]=value1&obj[name2]=value2
c403c4448259f71b48bdd022d2eb855f500ef3617f1511a99dfa30cdd4cee423
['f734108c942f4c9eb58138d2243c148d']
My speakers are connected over SPDIF and when I plug in headphones (front of case), the speaker volume goes to 100% and back to its normal volume when I remove the headphones. While the headphones are plugged in, the volume media keys change for the headphones but the speakers remain at 100%. So the system does switch to headphones but does not mute the speakers. I have spend several hours looking for a fix in pulseaudio, alsa and udev but only found either outdated or not applicable solutions. Is this a pulseaudio, alsa, kernel module or udev problem? Where can I see what exactly is happening? There don't seem to be default log files. How do I fix this?
f3a573c4267860136940f2b0abb433c4eb6f1f75a6e496db2ec3b315fad8d2ea
['f73f3e2e01104b3b840a4a658640a2c2']
@Krythic Same :) I do believe that it must contain some commonly used libraries (`libjpeg`, `zlib`) as these are mentioned in the WiiU's licence iirc. Probably a C and/or C++ compiler (after all Unity's IL2CPP needs to convert to /something/ and lots of useful libraries are C) Probably also some OpenGL based stuff too. I'm also fairly sure its Windows only, which is kinda sad.
53f2c482b2edc4c030b7073411d192535c1eab46a49ed170f10d36e0480c7a22
['f73f3e2e01104b3b840a4a658640a2c2']
Turns out, I didn't account for the fact that X11 has two buffers: primary and clipboard. My text from xterm was copied into primary buffer, while I needed it in clipboard buffer. I was able to fix the problem by installing parcellite package, launching it and configuring it to synchronize two buffers.
1ab2eae60056d5ccfe27de066a076d6dfb7ba26b58ff4bf705b0a8c032cf98c7
['f786b0983c4844e198b64aee440e1d58']
I recently purchased a web hosting plan with Godaddy. They use a program called cPanel to host the specified website (This is a Linux based machine). I recently added my website up to the file manager, but found I needed to change the document root. I got SSH working and went to the website directory folder and attempted to modify the root directory of my website. Upon completion of this I saved the file, but was met with a Permission Denied error. I did some more reading into how to change the file permissions to allow me to do so and have came up empty handed. Thank you for your time
0e15085a46195f8cb579c263e9de89f1b58518c77371781a784283e87bb5c4cd
['f786b0983c4844e198b64aee440e1d58']
I am attempting to ssh onto a CentOS 7.5 machine (<IP_ADDRESS>) via smart card technology. Now I can SSH using the master slot's x509 certificate with the matching private key to accomplish this, but this means that I must put the certificate's public key onto every machine that I wish to SSH onto. That is tedious if you ask me. Therefore I want to use a different public/private, specifically RSA keys, so that I can, at some time in the future, sign them with an RSA Certificate allowing for OpenSSH to trust the RSA Certificate and prevent the need to trust every single smart card's x509 Certificate. But for now I just want to SSH with this RSA key pair from the smart card. Therefore I began following the typical steps to generate keys and load them onto a smart card. ssh-keygen -f gofish ssh-keygen -f gofish.pub -e -m pem ykman piv import-key 9c gofish ykman piv generate-certificate 9c gofish.pem -s 'gofish543' ssh-keygen -D [opensc-pkcs11.so] -e Placed the output of the above command onto my target CentOS machine. ssh gofish543@<IP_ADDRESS> -I [opensc-pkcs11.so] With everything appearing to be working, I moved on over to Windows 10 to SSH with PuTTY. This is when everything falls apart. Using PuTTY-CAC for smart card SSH authentication it successfully loads my smart card's information into pageant, but when I go to ssh it fails with the error... PuTTY terminal presents the following... Using username "gofish543". Authenticating with public key "CAPI:5e084cb687f0c54adf8ddd733720db48407d3195" from agent Server refused public-key signature despite accepting key! gofish543@<IP_ADDRESS>'s password: With the sshd error log showing the following... debug1: matching key found: file /home/gofish543/.ssh/authorized_keys, line 1 RSA SHA256:Eor3aPxtNW6zrxLbq+1tB/urwql1CQB6EM8tFIx31+I^M debug1: restore_uid: 0/0^M debug3: mm_answer_keyallowed: key 0x55d310674760 is allowed^M debug3: mm_request_send entering: type 23^M debug3: mm_key_verify entering [preauth]^M debug3: mm_request_send entering: type 24 [preauth]^M debug3: mm_key_verify: waiting for MONITOR_ANS_KEYVERIFY [preauth]^M debug3: mm_request_receive_expect entering: type 25 [preauth]^M debug3: mm_request_receive entering [preauth]^M debug3: mm_request_receive entering^M debug3: monitor_read: checking request 24^M key_verify: invalid argument^M debug3: mm_answer_keyverify: key 0x55d310674710 signature unverified^M debug3: mm_request_send entering: type 25^M Failed publickey for gofish543 from <IP_ADDRESS> port 50051 ssh2: RSA SHA256:Eor3aPxtNW6zrxLbq+1tB/urwql1CQB6EM8tFIx31+I^M The Public, Private key authentication falls apart at the line key_verify: invalid argument. Searching for this problem yields zero applicable results. What can I do to fix this problem? As a side note, if I disclosed anything in the error logs that I should not have, like a private key or private key information, know that all these machines are on an internal network hosted on a laptop isolated from the internet. And these keys are going to be deleted in a week or two.
d404c88967563333fd816b5a094d1b5aff31bcd5411a50ad237f02465d88d5f6
['f7885db7e7d74a0fa0d9f8f1768c4b1c']
With Angular 2 and angular-cli, it's pretty straight forward. You dont need any gulp or custom script. Just build with angular-cli ng build --prod and it does nice job of treeshaking, minifying and producing a very small and optimum bundle. I've written a small post on this - to build and deploy Angular 2 app on Google AppEngine or Firebase.
5a6c5c4543a5bcc86f95a589856ac855b2f0591b7f9ece79c0dcb4e549ea4e63
['f7885db7e7d74a0fa0d9f8f1768c4b1c']
This should work. Tested it locally prefix = "004" prefix_len = len(prefix) + 1 # +1 for space end_line_prefix = "819" desired_value = "8041" with open("input.txt", "r") as rfile: for line in rfile: if not line.startswith(prefix): continue # if it doesnt start with 004, not interested val = line[prefix_len:len(line) - 1] # at the end we also have new line if val != desired_value: continue # if 004 doesnt have the value of our interest, skip while True: print("-> %s" % line) line = rfile.readline() if line.startswith(end_line_prefix): # if we reached the line starting with 819, we print and then break print("-> %s" % line) break rfile.close()
87036536e79212d53625aeba536e4029c1212e72e00219c0e7a5a892dd3cefcc
['f791dac64354453a9c8093dc4a1744b3']
I fixed this on Windows 10 by using the Troubleshoot compatibility tool. It has to do with an extra checkbox being enabled. Navigate to devenv.exe by right clicking Visual Studio from start, click properties, and select "Open File Location...". Right click on devenv.exe and select "Troubleshoot Compatibility". Click "Troubleshoot Program" Uncheck "it worked with older versions of windows" Click "Next" Click "Test the program" Confirm everything opens correctly Click "Next" Click "Yes, save these settings for this program"
0863ab204c279f4e6d88c7ec5bb2dcabfcc7be5d277d76c5aa3a84077232cff4
['f791dac64354453a9c8093dc4a1744b3']
I am currently trying to pass an object to my created directive below and the element property remains undefined even though the alias is matching the @input decorator. The onClick method is being hit correctly as well. import { Directive, Input, HostListener } from '@angular/core'; @Directive({ selector: '[nextFocus]' }) export class NextFocusDirective { @Input('nextFocus') element: any; @HostListener('click', ['$event']) public onClick($event: Event) { debugger; $($event.target).focus(); } } Here it where it is being used in the html: <button type="submit" class="btn btn-outline-success" ngbTooltip="Add" [nextFocus]="nextElement"> <i class="mdi mdi-plus"></i> </button> I have tried various syntaxes according to the angular docs and was unable to solve it. What am I missing that causes the element property to get correctly initialized?
386eb8888eae608c6ab56d48ab5153d59d56ba6d11ba7da78807da3513af070d
['f7c7253a7d274a10a222996fb202b5b2']
Thanks for your speedy response! I do have a few questions though. So I know energy is not quantized (E=hv). If you can have any frequency, you can have any energy. However, correct me if I'm wrong, but I thought that temperature would be distributed in a somewhat standard bell-curve: some outliers both above and below the average temperature, and the majority of lead atoms are close to the average temperature. What I am most confused about though is the frequency of light emitted by a particle vibrating at a specific frequency; would a particle vibrating at 5MHz emit light also at 5MHz?
b14b2571ac06f3b27abb09cbe787b651cc65498639bc4f3184fe4e4ce4dc2f72
['f7c7253a7d274a10a222996fb202b5b2']
A good example: man sa-update (spamassassin) EXIT CODES An exit code of 0 means an update was available, and was downloaded and installed successfully if --checkonly was not specified. An exit code of 1 means no fresh updates were available. An exit code of 2 means ... In this case, exit 1 is simply an informative code. However, if I would have written the code, I would not have chosen 1 since that usually mains failure.
7dffbdf9a23c20a1b5c817e94b2bb5fb869a783c70eecef720114e145ab6f773
['f7e7c91fc3564978b252fc6525ae6f71']
You can define a common trait for Both Row and Col classes: trait Element { val value : Int def init(value: Int): Element def +(other: Element) = init(value + other.value) } and then use case classes so that you take advantage of the companion object's apply method: case class Row(value: Int) extends Element { def init(v: Int) = Row(v) } case class Col(value: Int) extends Element { def init(v: Int) = Col(v) } So now you can add them like that: case class Pos(col: Element, row: Element) { def +(other: Pos): Pos = Pos(col + other.col, row + other.row) } val p1 = Pos(Col(1), Row(2)) val p2 = Pos(Col(1), Row(2)) p1 + p2 //res2: Pos = Pos(Col(2),Row(4)) However, this allows to create a position with only rows val p3 = Pos(Row(2), Row(3)) p1 + p3 //res3: Pos = Pos(Col(3),Row(5)) So a second step is to bound your Element type's + method. trait Element[T <: Element[_]] { val value : Int def init(value: Int): Element[T] def +(other: Element[T]) = init(value + other.value) } case class Row(value: Int) extends Element[Row] { def init(v: Int) = Row(v) } case class Col(value: Int) extends Element[Col] { def init(v: Int) = Col(v) } case class Pos(col: Element[Col], row: Element[Row]) { def +(other: Pos): Pos = Pos(col + other.col, row + other.row) } What you get is that now a row should only add elements of a row type and a Col should only add elements of a Col type. You can still add two positions: val p1 = Pos(Col(1), Row(2)) val p2 = Pos(Col(1), Row(2)) p1 + p2 //res0: Pos = Pos(Col(2),Row(4)) but this will not compile: val p3 = Pos(Row(2), Row(3))
c4000ce354abe30293dffb77f1810b2e43db1c24998fa79de494614a8600c047
['f7e7c91fc3564978b252fc6525ae6f71']
System: Amazon EC2 instance running Debian 5.0.1 with Apache 2 and PHP 5.2.6 I need to send encrypted files using a PHP script. I had been intending to do this with command line instructions from the script(e.g. exec()), but have discovered that there is a PHP extension for GnuPG. I installed it using the steps provided in this walkthrough, although I've used the newest versions of the packages mentioned (libgpg-error-1.10, gpgme-1.3.1 and gnupg-1.3.2). When I get to the 'make' step of the gnupg-1.3.2 installation I am told to run 'make test'. When I do, I get the following errors / warnings: PHP Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0 Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0 ===================================================================== PHP : /usr/bin/php PHP_SAPI : cli PHP_VERSION : 5.2.6-1+lenny13 ZEND_VERSION: 2.2.0 PHP_OS : Linux - Linux ip-10-235-58-131 <IP_ADDRESS>-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64 INI actual : /etc/php5/cli/php.ini More .INIs : /etc/php5/cli/conf.d/curl.ini,/etc/php5/cli/conf.d/gd.ini,/etc/php5/cli/conf.d/gnupg.ini,/etc/php5/cli/conf.d/mcrypt.ini,/etc/php5/cli/conf.d/mysql.ini,/etc/php5/cli/conf.d/mysqli.ini,/etc/php5/cli/conf.d/pdo.ini,/etc/php5/cli/conf.d/pdo_mysql.ini CWD : /var/apache2/sites/gnupg-1.3.2 Extra dirs : ===================================================================== Running selected tests. SKIP import a new key into the keyring [tests/gnupg_oo_0001_import.phpt] SKIP encrypt and decrypt a text [tests/gnupg_oo_encrypt.phpt] SKIP encryptsign and decryptverify a text [tests/gnupg_oo_encryptsign.phpt] SKIP export a key [tests/gnupg_oo_export.phpt] SKIP get keyinfo [tests/gnupg_oo_keyinfo.phpt] SKIP list signatures [tests/gnupg_oo_listsignatures.phpt] SKIP sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_oo_sign_clear.phpt] SKIP sign a text with mode SIG_MODE_DETACH [tests/gnupg_oo_sign_detach.phpt] SKIP sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_oo_sign_detach_nonarmor.phpt] SKIP sign a text with mode SIG_MODE_NORMAL [tests/gnupg_oo_sign_normal.phpt] SKIP sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_oo_sign_normal_noarmor.phpt] SKIP delete a key from the keyring [tests/gnupg_oo_zzz_deletekey.phpt] FAIL import a new key into the keyring [tests/gnupg_res_0001_import.phpt] FAIL encrypt and decrypt a text [tests/gnupg_res_encrypt.phpt] FAIL encryptsign and decryptverify a text [tests/gnupg_res_encryptsign.phpt] FAIL export a key [tests/gnupg_res_export.phpt] FAIL get keyinfo [tests/gnupg_res_keyinfo.phpt] FAIL list signatures [tests/gnupg_res_listsignatures.phpt] FAIL sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_res_sign_clear.phpt] FAIL sign a text with mode SIG_MODE_DETACH [tests/gnupg_res_sign_detach.phpt] FAIL sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_res_sign_detach_nonarmor.phpt] FAIL sign a text with mode SIG_MODE_NORMAL [tests/gnupg_res_sign_normal.phpt] FAIL sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_res_sign_normal_noarmor.phpt] FAIL delete a key from the keyring [tests/gnupg_res_zzz_deletekey.phpt] ===================================================================== Number of tests : 24 12 Tests skipped : 12 ( 50.0%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 12 ( 50.0%) (100.0%) Tests passed : 0 ( 0.0%) ( 0.0%) --------------------------------------------------------------------- Time taken : 1 seconds ===================================================================== ===================================================================== FAILED TEST SUMMARY --------------------------------------------------------------------- import a new key into the keyring [tests/gnupg_res_0001_import.phpt] encrypt and decrypt a text [tests/gnupg_res_encrypt.phpt] encryptsign and decryptverify a text [tests/gnupg_res_encryptsign.phpt] export a key [tests/gnupg_res_export.phpt] get keyinfo [tests/gnupg_res_keyinfo.phpt] list signatures [tests/gnupg_res_listsignatures.phpt] sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_res_sign_clear.phpt] sign a text with mode SIG_MODE_DETACH [tests/gnupg_res_sign_detach.phpt] sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_res_sign_detach_nonarmor.phpt] sign a text with mode SIG_MODE_NORMAL [tests/gnupg_res_sign_normal.phpt] sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_res_sign_normal_noarmor.phpt] delete a key from the keyring [tests/gnupg_res_zzz_deletekey.phpt] The list of libraries it says it can't load other than gnupg (curl, gd, mcrypt, mysql, mysqli, pdo & pdo_mysql) are all present in the extensions directory beside the gnupg.so file and they all show up in php_info(), but the gnupg extension doesn't show on that. Also, as you can see from the errors, all the gnupg functions which were tested failed. Does anyone have any suggestions?
05e3367bad893cf11d7b26f17af6c8e6c82bdf8afd8a4e904ccbeecac3e82c44
['f7eeb5812d3a4e228f0b2163e5ddd60e']
Assume you have a probability distribution $F$ over density functions $g$. Under what circumstances (if ever), is it possible to change the order of integration for the double integral $\int \int m g(m) dm dF(g)$, i.e. when is \begin{equation} \int \int m g(m) dm dF(g) = \int m \int g(m)dF(g)dm \end{equation} Essentially, I think I am looking for something like <PERSON>'s theorem for infinite-dimensional spaces. I would be grateful on any advice for a functional analysis book where to read up on this problem or ideally some theorem pertinent to the above question. In my application, I can assume that $F$ and $g$ are arbitrarily well-behaved, so even a quite restrictive statement would be sufficient for my purposes.
e1c2fc54e3f5741b793e193bdace67cd6760edf6cd4dfdaaf7e224ca2f884855
['f7eeb5812d3a4e228f0b2163e5ddd60e']
I have done everything that I could get off Google to correct the sound problem but none of them is working. My last install of Ubuntu had the sound working, but this one, I don't know why it is not. Pulseaudio/pavucontrol/driver manager/ unmuting alsamixer/ unmuting sound settings/ taking out the jack and plugging it again/ sound card problem -- all these possibilities I've already eliminated. I'm tired and frustrated. Please help, my AlsaInfo: http://pastebin.com/sDCs9brZ
fe41d9800beac330586068cab0b92ba6cc320c535396d79779a2678ef7889e68
['f7f6caf66d094cbc9713601c4c7793b5']
how can I start a connection to an oracle database using flask-sqlalchemy and cx-oracle by sending these parameters: alter session set nls_comp=linguistic; alter session set nls_sort=Latin_AI; In order to be able to make queries and sorts that do not distinguish, for example, between "<PERSON>" and "<PERSON>" That's how I usually make the connection: import os from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import config def create_app(config_name=(os.getenv('FLASK_CONFIG') or 'default')): app = Flask(__name__) app.config.from_object(config[config_name]) db.init_app(app) from commons import commons_bp from admin import admin_bp from inventario import inventario_bp from incidencias import incidencias_bp from inconformidades import inconformidades_bp with app.app_context(): app.register_blueprint(commons_bp) app.register_blueprint(admin_bp) app.register_blueprint(inventario_bp) app.register_blueprint(incidencias_bp) app.register_blueprint(inconformidades_bp) return app and the configuration: class DevelopmentConfig(Config): TESTING = True DEBUG = True SQLALCHEMY_ECHO = os.environ.get('SQLALCHEMY_ECHO') or False SQLALCHEMY_POOL_SIZE = None SQLALCHEMY_POOL_TIMEOUT = None SQLALCHEMY_BINDS = { 'adminapps': 'oracle://ADMINAPPS:ADMINAPPS@SERVIDOR53/ENTECO', 'incidencias': 'oracle://INCIDENCIAS:INCIDENCIAS@SERVIDOR53/ENTECO', 'incidencias': 'oracle://INCIDENCIAS:INCIDENCIAS@SERVIDOR53/ENTECO', 'inventario': 'oracle://INVENTARIO:INVENTARIO@SERVIDOR53/ENTECO', 'inconformidades': 'oracle://INCONFORMIDADES:INCONFORMIDADES@SERVIDOR53/ENTECO', 'documentacion': 'oracle://DOCUMENTACION:DOCUMENTACION@SERVIDOR53/ENTECO', 'auditoria': 'oracle://AUDITORIA:AUDITORIA@SERVIDOR53/ENTECO', 'navision': 'mssql+pyodbc://DB:DB.2020@SERVIDOR52', } I've tried among other things: 'adminapps': ['oracle://ADMINAPPS:ADMINAPPS@SERVIDOR53/ENTECO', 'alter session set "nls_comp"="linguistic"', 'alter session set "nls_sort"="Latin_AI"'], But I haven't been successful, I can't figure out how to do it, thank you for your answers!
e484e86102099f9cd2a18187d7d20cb0775b69a805b76d82ce634d5407c98310
['f7f6caf66d094cbc9713601c4c7793b5']
I have a piece of code using beautifoulsoup to scrape some specific urls from a web page and have them stored in a list, I try to filter the None values once and for all, I have used the following alternatives: 1 list_links = [link.get('data-href') for link in BSOBJ.find_all('a') if link is not None] 2 list_links = [link.get('data-href') for link in BSOBJ.find_all('a') if link != None] In both of them I still get the None values, after the list is created I delete them with this line: list_links = list(filter(None, list_links)) But I would like to know why I can't filter them with the previous codes and if there is a way to do it directly using list comprehension.
bb549e9d388c8e6631ae4229677bbd29da5a52b0e5b11c2ff4aa921b042914e2
['f805462cd1134cf187f0bc4d15c411b3']
It seems to me that your question is not clear enough, but I will try to help: I believe you are not limited with Angular as long as you don't plan to write pure static html for your news. You would need a backend in the language of your choice (maybe nodejs) that would store your news in a database, and you would retrieve them with Angular with 'ajax' requests. Updates of the angular app in that case would then be less frequent. I don't think however that building your app once you made a change should be an issue, you could compile it automatically on every git push for instance on your prod server.
a503081fc7d4ee8666654224fdd630ffa300e3af9896c5eaf9a5c0b23216e610
['f805462cd1134cf187f0bc4d15c411b3']
Try to include it directly in a component. I tried with the app component and it worked. You could create a separate component to execute this piece of code. import { Component, OnInit } from '@angular/core'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent implements OnInit { name = 'Angular'; ngOnInit(){ (function(d, sc, u) { var s = d.createElement(sc), p = d.getElementsByTagName(sc)[0]; s.type = 'text/javascript'; s.async = true; s.src = u + '?v=' + (+new Date()); p.parentNode.insertBefore(s,p); })(document, 'script', '//aff.bstatic.com/static/affiliate_base/js/flexiproduct.js'); } }
96c01b32166566c286e6f3a690fff321ba7f4e3b9088c10469621ca9912e5bd5
['f80ddd4aad094334b0521c9a1e49dc40']
I need help supporting back button with jquery ajax.load method. I have tried a couple of plugins but i cant get any of them to work. I am loading my content like this: $('.pagination a').click(function(){ var url = $(this).attr('href'); ajaxLoad(url,null,'.container'); return false; }); Note: ajaxLoad function executes the jquery load method. Many thanks for your help.
ab7111cec4aab2cae5e1d53456ec0acc084d4dbd3e657ab3d9bdb954a4075128
['f80ddd4aad094334b0521c9a1e49dc40']
I dont have any practical experience with rooting my phone. There is one thing that's been bugging me for a very long time: I need to be able to set a charging limit on my Pixel 2 since I dont feel like replacing the battery soon and destroying the water resistance. My question is: if I root and set a charging limit and unroot again, will this setting be erased? As I said, I am not too familiar with the risks of having my OS more vulnerable towards viruses, thus the only thing I want to do is to set the battery charging limit and then just go back to unroot. Thanks, <PERSON>
7ad59a3aa3c8632923a14a09b1e56237d22e49d5c6f834af50f17098f60c859c
['f810ab646ceb4b2c94417799dae6c1ed']
Issue: Same issue came on Xcode-11 and none of the above methods worked. Answer You need to check first the issue, where it is coming from. In my case it was due to all Pod libraries info.plist file was missing. (God knows how it got missed). Comment the "pod libraries" in "pod file" and run "pod install" Uncomment the "pod libraries" in "pod file" and run "pod install" again. and it worked.
e9975c5987d426be3b5b8d8ba22bfc7bde3644601dd2caf7aa257bcc5a62621e
['f810ab646ceb4b2c94417799dae6c1ed']
iOS 12, Xcode: 10, Swift-4 Getting error while uploading a large size image as a Base64String to server. Its working fine with small files ▿ some : AFError ▿ responseValidationFailed : 1 element ▿ reason : ResponseValidationFailureReason ▿ unacceptableStatusCode : 1 element - code : 413 I want to upload image as base64string only not as multi-part data. Can you please guide me through ?
7d12ba7056ac46bd7ff4c6d036ef20608d96a97abaeb4c0a9985dd6eb6af0634
['f819f6c0ae93487ea60fc2ce9a373969']
I am trying to install this library in Visual Studio 2019 https://github.com/alex-87/HyperGraphLib The instructions only show how to do so for linux/unix I was curious how I would do this for windows. I can download the .zip but where would I extract this and how do I get Visual Studio to install the library.
13b82ab69dfb05d2b1d858f0dd3dfd7132849c62c6cbb49adb604b0fa0ce524d
['f819f6c0ae93487ea60fc2ce9a373969']
Solution So instead of trying to handle this with JSON I just took an easier approach and created classes in java one for Nodes and another for an ArrayList of Nodes. Then I created various setters and getters in both and made a function for adding a node. This function would add an object of type Node to the ArrayList Object. It worked brilliantly and was exactly what I wanted.
1856fb57acf2766b6c9c86e7da7b9b6b2c5f0e3a0709f2e01a50ac9c1a793870
['f82dddf00abe4246a6bdc48bdc884741']
Try to add AuthConfig as a dependency : import {AuthHttp, AuthConfig} from 'angular2-jwt'; import {Http} from 'angular2/http' @App({ template: '<ion-nav [root]="rootPage"></ion-nav>', config: {}, // http://ionicframework.com/docs/v2/api/config/Config/ providers: [ provide(AuthHttp, { useFactory: (http) => { return new AuthHttp(new AuthConfig(), http); }, deps: [Http,AuthConfig] }), AuthHttp ] })
f6162c82b52b30747c5c13fcad271f9e9ba8a39c479c6d417f39502c2a9178c1
['f82dddf00abe4246a6bdc48bdc884741']
Indeed you have to declare a new FactoryBean in your @EnableJpaRepositories annotation: @Configuration @EnableJpaRepositories(value = "your_package", repositoryFactoryBeanClass = CustomFactoryBean.class) public class ConfigurationClass{} CustomFactoryBean.java: public class CustomFactoryBean<R extends JpaRepository<T, I>, T, I extends Serializable> extends JpaRepositoryFactoryBean<R, T, I>{ @Override protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) { return new SimpleJpaExecutorFactory(entityManager); } /** * Simple jpa executor factory * @param <T> * @param <I> */ private static class SimpleJpaExecutorFactory<T, I extends Serializable> extends JpaRepositoryFactory{ private EntityManager entityManager; /** * Simple jpa executor factory constructor * @param entityManager entity manager */ public SimpleJpaExecutorFactory(EntityManager entityManager) { super(entityManager); this.entityManager = entityManager; } @Override protected Object getTargetRepository(RepositoryMetadata metadata) { JpaEntityInformation entityInformation = getEntityInformation(metadata.getDomainType()); return new SomethingRepositoryImpl<T,I>(entityInformation, entityManager); } @Override protected Class getRepositoryBaseClass(RepositoryMetadata metadata) { return SomethingRepositoryImpl.class; } } } Then it will be your SimpleJpaRepository instance: SimpleJpaRepositoryImpl that will be used
fa47dd0a47c8db6cc85812f23dc008c82c54820ad4098403845fcad1ddac17b5
['f830edec97de41ffa40048ba5540d926']
I want to dynamically create a CanvasJS chart depending on N amount of objects from a JSON array. If a JSON array has 3 objects, the web page should be able to display 3 charts. <div class="container-fluid" id="spectraContainers"> </div> Through the id "spectraContainers", I have a javascript function that dynamically creates a new div with a unique id. In that same function, a new chart is created with its unique id. document.getElementById("chartContainers").innerHTML += '<div class="row"> <div id="chart_container_' + chartNumber + '" style="width: 100 %; height: 500px; ">Container </div></div>'; ... ... ... var chartContainerID = "chartcontainer_" + chartNumber; var chart = new CanvasJS.Chart(chartContainerID, { animationEnabled: true, zoomEnabled: true, theme: "light2", title: { text: chartTitle, }, axisX: { title: "x axis label", gridDashType: "dash", gridThickness: 2 }, axisY: { title: "y axis label", gridDashType: "dash", gridThickness: 2 }, dataPointMaxWidth: 20, dataPointWidth: 10, data: [{ type: "column", dataPoints: points }] }); chart.render(); I've verified that all values are valid. It seems like only ONE canvasJS chart (the third object from the json array) can be rendered in a page within this function. If I were to specifically generate a chart for index 0 or 1 in the json array, the specified index for the chart will be rendered. I know it's possible to render multiple canvasJs charts by manually creating a new chart variable for each uniqueID. However, I would like to dynamically generate N-amount of charts. I am pretty new to javascript and would appreciate any advice!!
bed709d9f3151ecf635706adfa529f18fff508f3f961e351d31ceb8c14b5a9ae
['f830edec97de41ffa40048ba5540d926']
I have 2 containers. Container 1 has Jenkins on a Linux container. Container 2 has .NET packages and other tools (MSBuild, Wix, Nuget, .NET framework 4.5, 4.6.2, KSign, etc) on a Windows container. I searched online and I don't think it's feasible to install the software packages on container 2 on a Linux container... If I'm running Jenkins on a Linux container, is it possible to create a windows container for my pipeline job? How would that work?
6f181ff48d155443e6a9d455702255d6c27195f2d0e3e63ee8c53a5d04bd88e3
['f86013c267854b4b90136ca1f2caad34']
<ItemTemplate> <asp:Label ID="lbldescription" runat="server" width="175px" Text='<%#Eval("description") %>'/> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtdescription" runat="server"></asp:TextBox> </EditItemTemplate> protected void gvManage_RowUpdating(object sender, GridViewUpdateEventArgs e) { string topicID = gvtopic.DataKeys[e.RowIndex].Values["topicID"].ToString(); TextBox description = (TextBox)gvtopic.Rows[e.RowIndex].FindControl("txtdescription"); string sql = "Update topic SET description=@description WHERE topicID= @topicID"; var cmd = new MySqlCommand(sql, con); con.Open(); cmd.Parameters.AddWithValue("@topicID",topicID); cmd.Parameters.AddWithValue("@description", description); cmd.ExecuteNonQuery(); con.Close(); gvtopic.EditIndex = -1; GVbind(); } I'm using the gridview to display the description and let users edit and update it. But the user's input(they enter at textbox) won't save to the database. No matter what the users type in the textbox, the text "System.Web.UI.WebControls.TextBox" will be saved.
cde60fc6dc64cc256330d02dac85d6235e0cb53572bc667aca8136114f2b6438
['f86013c267854b4b90136ca1f2caad34']
protected void loadCandidate() { con.Open(); MySqlCommand cmd = new MySqlCommand("select studentID ,name from candidate ", con); MySqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows == true) { GridView1.DataSource = dr; GridView1.DataBind(); } } Candidate database Voter database I'm using the gridview to display the candidate. I would like to display the gridview based on the faculty(now the gridview are displaying all candidate). When the voter login to thier account, if the voter belong to faculty MCLR, then the gridvire will only display the candidate belong to faculty MCLR, all other candidate belong to other faculty will not be shown.
637955f436855d1da1c07ed521c85dd47b1264dcaa4c7ac070e821a78d74020d
['f86b09ca19874b8b8312c2039959749d']
@KromStern I am using my Adobe Creative Cloud version of it, so its the CC edition. Actually, I found a workaround...so in Illustrator, I had to export the image at high (300 PPI) quality to a PNG file instead of saving it for the web...then I loaded it into Fireworks. In Fireworks, I used the Image Size button to use bilinear down-scaling of the image to whatever size I wanted it to be, and it came out really crisp! Crisper than saving for web...not sure why. Maybe it has to do with the way Windows Store Apps render images.
f652f92584721c509f0f4ad98087ec51568753fd553514dce040e82da2be1892
['f86b09ca19874b8b8312c2039959749d']
Thanks <PERSON>! My lisp skills are still pretty light, so I am still not sure about when I need to quote my variables. Do you have a recommendation for where I could see why this is so? My understanding was that the unquoted expression would evaluate to it's variable value, which would be void. Regardless, I will read a bit and post an answer later explaining the subtlety for future readers.
679aa3a255a4ea2b6f9f7f76aa5a6950877acf3d1e8d6ffe5e3beb863facb37e
['f876dcc463cf411d88dd6c71927fa55c']
The problem is that you are registering projeclist through parasails.registerPage function and then the ID of the DIV in the view ejs file is project-list. I faced the same problem and solved it by setting the same name in both, so it will be: parasails.registerPage('projectlist', { data: { }, ..... And in the view ejs file: <div id="projectlist" v-cloak> <div class="container">
1b92c8c335c8d54e4ba1ed89f7d000dc823aa580050c8baf24ee851d858716aa
['f876dcc463cf411d88dd6c71927fa55c']
I have a Nodejs server with some API endpoints. One of them requires client authentication through SSL certificates. That works fine if I go to this endpoint with Firefox or Chrome but not with a custom nodejs client. const https = require('https'); const fs = require('fs'); const options = { hostname: 'localhost', port: 1337, path: '/api/nodes_endpoint/json/20?data=eeeeeee', method: 'GET', key: fs.readFileSync('/home/jose/Escritorio/test.key'), cert: fs.readFileSync('/home/jose/Escritorio/test.cert'), rejectUnauthorized: false }; options.agent = new https.Agent(options); const req = https.request(options, (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }); req.on('error', (e) => { console.error(e); }); req.end(); After the server request the TLS renegotiation, the object that should contain the client certificate is NULL, so I suppose that the client is not handling correctly the TLS renegotiation.
0f93d8f7783286697f67260b37c8fed39bb5f10eb78c6742ec726a91a1aac185
['f87da5f0dc364681a0a7932e828d0086']
I think the ploblem is about the new kernel 3.8.0-34 with the proprietary driver of nvidia. I solved with a new istallation of ubuntu 12.04 without update the kernel and istall only driver raccomanded by <PERSON> (319.xx ). I don't know if there is a solution less complicated. with rescue mode I try but I don't solved.
4cd09f924f416825da68772ff39365a279e898d83dfa5458d1305925db469a3c
['f87da5f0dc364681a0a7932e828d0086']
Generally, it is often not a good idea to hardcode values. For example, take a look at this piece of code. It won't work correctly from 2021 onwards: if input_year <= 0 or input_year > 2020: print("don't you know your birthday??") Better do it like this: date = datetime.now() current_year = int(date.year) if input_year <= 0 or input_year > current_year: print("don't you know your birthday??") This will make your program work in future years without the need to change the value for the current year manually.
9ef680bedbe5b042765322e1caa44ea0facd45ee688dd0355c01e6f68b359075
['f880da0ee2fb4ce1b31e78e49535f59e']
I get an exception: WARN exceptions - Handler execution resulted in exception org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is org.apache.commons.fileupload.FileUploadBase$IOFileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:163) at org.springframework.web.multipart.commons.CommonsMultipartResolver.resolveMultipart(CommonsMultipartResolver.java:139) during file upload and I don't have an idea what can I repeat this in my aplication. Did you know some tool for this? Or maybe you have some tips for me?
153b41f443493cae7273af6583761d9fab735c69f016056bbb52cb612b6e6445
['f880da0ee2fb4ce1b31e78e49535f59e']
I'm trying to putExtra to Activity which will be launched after clicking on notification, but instead of value that I set I'm getting default value. This is my code in AlarmReceiver: Intent notifActiv = new Intent(context, NotificationActivity.class); notifActiv.putExtra("ID", id); PendingIntent pI = PendingIntent.getActivity(context, 0, notifActiv, 0); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder( context).setSmallIcon(R.drawable.ic_launcher) .setContentTitle(string).setTicker("You got meeting today!") .setContentText("Click here for more details"); mBuilder.setContentIntent(pI); mBuilder.setDefaults(NotificationCompat.DEFAULT_VIBRATE); mBuilder.setAutoCancel(true); NotificationManager notificationManager = (NotificationManager) context .getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(1, mBuilder.build()); And this is my NotificationActivity where I'm trying to get Extras: Intent intent = getIntent(); int id = intent.getIntExtra("ID", 0); Could you please tell my where I'm doing something wrong?
03f17b52cab8b8eddee75782fb117d666e3f4aaaeb5183029459cf11146ba354
['f88c8fea62f742d19ec8af6b36760b1d']
following code is used to specify device on which tf node is running on with tf.device('/gpu:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') i have already known: this post, tensorflow doc and xla demo what i want to know is: is there a way to specify XLA_GPU as the device on which tf node is running on with tf.device('/XLA_GPU:0'): a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a') executing the code above gives ValueError: Unknown attribute: 'device' in '/job:localhost/replica:0/task:0/device:/XLA_GPU:0' this is 100% reproducible on google colab.
1b89599f33a387e013ea35c617c28c55213d049720f178f78600e5b088137ecb
['f88c8fea62f742d19ec8af6b36760b1d']
I use a sata/usb converter to connect a Samsung drive to the rpi. It is often not recognized at system start. The drive is recognized without problems when I plug the USB into my ubuntu laptop. I suspect that the drive takes too long to start. Currently, I see no udev activity for it in the logs, no special file is created in /dev. I have tried: sudo service udev restart to no avail. The drive is totally not responding to the rpi at this time, but it has previously done so, sometimes only after reboot.
ddebd87471d0d673a2a1b7236d477b7f8c2244a4e0d68784916dcc3814f1c7e4
['f88ee50f8fde4cdb9ca4b416bf02b0c5']
It could be a DNS issue that can be solved by changing the DNS address to either Open DNS or Google DNS. May also require power cycling your PC and router. Check details here - www.pcappspot.com/fix-err-name-not-resolved/ One of my friend had this issue and later found out that his ISP put him through a safe browsing filter and everything worked fine after he asked the ISP to remove the filter from his IP.
21faf932b7b4de3b3762e6eda8eb9820f32fef5f6aaf0ef35eaf5ad0bf3b7164
['f88ee50f8fde4cdb9ca4b416bf02b0c5']
I have figured out the answer: The only monic factors of $x^p-1$ over $\mathbb{Z}/p^n\mathbb{Z}$ are those given above (i.e. either linear or degree $p-1$). Let $n > 1$, and suppose $x^p - 1 = f(x) g(x)$ in $(\mathbb{Z}/p^n\mathbb{Z})[x]$ with $f$ and $g$ monic. We must show that either $f$ or $g$ is linear, so suppose for the sake of contradiction that neither is. In that case, we can write $f(x) \equiv (x-1)^a \pmod p$ and $g(x) \equiv (x-1)^b \pmod p$ with $a, b > 1$, which means $f(1)$, $f'(1)$, $g(1)$, and $g'(1)$ are all divisible by $p$. This is a contradiction because $$p = \frac{d}{dx}(x^p-1)\big|_{x=1} = f(1)g'(1) + f'(1)g(1).$$
f4a51d2bcf7647b45f45f151b53fac0b8ef55d2fff2075a378f5fcf47698e592
['f8a65d3528a24e95ab68f75b7bf4be91']
<PERSON> Thanks for the insight, I'll change that. If it was due to electrolytes the slope of the line should remain constant though, correct? The slope of the line tends to change quite a bit between runs. I suppose it could be that I am generating new electrolytes between runs however.
8fc0552dc830168368273da1484f9473390d1f282cdf7e5975a1025b66874fa6
['f8a65d3528a24e95ab68f75b7bf4be91']
The way your image is at the moment, with that "distressed" look (all of the voids and hollows) in each letter, Will be nearly impossible for a plotter. If you did an image trace in illustrator, converting the artwork from raster to vector, there would be no possible way you would have less than 2000 anchor points per color. I went ahead and did the separations for you in Photoshop. View them in your channels panel. In my opinion, any screen printer that cannot produce transparencies for the screens from a separated Photoshop image, probably is not worth dealing with. If you were to bring this attached file to any local screen printer, these separations should be all you would need. Shirt_Rosan_flat SEPS
efad786e6d16dffc6358046328d1a4e6280a5e2e2593df6ebc2bd443abd04735
['f8ad4d0ce24f4587b4e38da8d9b972c5']
I am using Typeorm with Postgresql. I've been trying sequelize too, but finally I decided to use typeorm because the code is clean and maintainable, your code is elegant and easy to read, support multiple DBMs, decoratos, it's a great ORM. I am using it with Typescript and Express. I hope you can actually consider using it.
7f46c11994212ccceb91a0c89ff6988c455e32817cea796e196e83b9aa3bf58c
['f8ad4d0ce24f4587b4e38da8d9b972c5']
try this sudo journalctl --follow _SYSTEMD_UNIT=nginx.service and see what's going in the console when you make a request. Also you can try to set up the error logging to debug following these steps sudo nano /etc/nginx/nginx.conf find the line error_log change error level to debug logs/error.log debug; sudo service nginx restart .
97c4956b27c68ff2a099e270c9ad15757db07d77663fb969d972d23f15d397a5
['f8b26fa2030c4fc4888b7f0e9c8758c0']
I'm having an issue regarding my Mi Gaming Laptop 2019, and I hope somebody here could help me. The issue is with the battery. It charges slowly, to the point that it actually manages to lose charge while being plugged in! This happens if I launch some demanding games, I tested it on Kingdom Come Deliverance and RDR2. I don't think this is normal, so I brought it to the service center. They said they replaced the battery altogether, and it should work fine now, however nothing changed and the issue is still here! The power adapter is first party and has following output specs. Could it be that is just can't charge the laptop fast enough? 180 W 19.5 V 9.23 A What I already tried (and nothing worked): Replaced the battery. Replaced the power adapter and wire. Installed the driver package for this model from Xiaomi official site. Could you give some advice please? Thanks!
1816604ce02b151ce5cdd0b525fe1a72b9653bf80f7383731b14db375195f1ee
['f8b26fa2030c4fc4888b7f0e9c8758c0']
I'm learning CakePHP and I follow this tuto: http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.html I'm working with CakePHP 2.2.3. Well, I arrived where I have to add groups and users. But, I've not the name of my groups in my database... Can you help me? GroupesController: <?php class GroupesController extends AppController{ function add(){ if (!empty($this->data)) { if ($this->Groupe->save($this->data)) { $this->flash('Votre groupe a été sauvegardé.','/groupes'); } } } function beforeFilter(){ parent<IP_ADDRESS>beforeFilter(); $this->Auth->allow('*'); } } ?> Model: <?php class Groupe extends AppModel{ public $actsAs=array('Acl'=>array('type'=>'requester')); var $validate = array( 'nom' => array( 'rule' => array('minLength', 1) ) ); public function parentNode(){ return null; } } ?> View: <h1>Ajouter un groupe</h1> <?php echo $this->Form->create('groupes'); echo $this->Form->input('nom'); echo $this->Form->end('Sauvegarder le groupe'); ?>
b250ffa99127cf3aa9bfad3c911d9176adba17cc290fa349a9f10a37b8a2f594
['f8bf2cb3bbea4aa09475df5600f3e8c0']
I'm trying to run a simulation using an MPI cluster. It works well when I do not need extra packages. For example, I can get a liner model coefficients with multiple datasets running parallel. But when I try to do the same with quantile regression, I need to use the 'quantreg' package. So I use the following code. But the system quits by saying "there is no package called 'quantreg'. But all of the nodes have it. My admin took take of it. I tried using the .package='quantreg', but keep getting the same error. I really appreciate if someone can suggest some solution. I also tried clusterApply and clusterCall with no success. library("Rmpi") library("doMPI") mycluster <- startMPIcluster(count=12) registerDoMPI(mycluster) # Using parallel; you can check it with the nodename info trials<-50 output <- foreach(a=c(.3,.5,.7), .combine = data.frame) %dopar% { foreach( b=icount(trials) , .combine = data.frame) %dopar% { set.seed(b) x=matrix(runif(500),100,5) y=rnorm(100) betas<-quantreg<IP_ADDRESS>rq(y ~ x, tau = a)$coef result <- c(betas, Sys.info()[c ("nodename")]) } } The PBS script looks like this: #!/bin/bash #PBS -N AYParallel #PBS -l nodes=2:ppn=8 #PBS -l walltime=00:05:00 #PBS -q una # #PBS -j oe module load R module load mpi/mvapich2-x86_64 module load openmpi/3.0.0 cd $PBS_O_WORKDIR export OMP_NUM_THREADS=1 mpirun -np 1 R --file=test0.R
d4626b8ad36bad4762c6c2d94dd6206478718b5e4958019d2f9cea7528e8ab29
['f8bf2cb3bbea4aa09475df5600f3e8c0']
I have a data frame that looks like this: value=c(1,2,6,4,5,6) group=c(rep('A',3),rep('B',3)) mydata=data.frame(value,group) I want to retain all values in group A and all values less than 6 in group B. That is, I need to end up with something like this: value=c(1,2,6,4,5) group=c(rep('A',3),rep('B',2)) What I've done so far is to filter group A as is. Filter group B with value <6 and combine the two data frames into one. Is there a better way to do this using dplyr or any other function?
5456be636898dc9589f1335e19af6d569cff37a46ae6146f1a43c10fcb30e42c
['f8c512679b2a4975be836dfe1225769f']
Being charitable one can describe the author as "joking", not "explaining", since the real explanation in that test was that the user liked what the red button did and saw no need to explore others ;-) It doesn't really matter *why* red is good (if indeed it is) and anyway there's almost certainly an element of learned behaviour unrelated to cavefolk. Just A/B test it, assuming you have the means. I'm pretty sure I've seen examples cited where red won, and examples where users didn't respond differently to different colours.
5bacf370cb35db643563e8ada4ce3e9753bbdc4258b13afbf3e61faa813757eb
['f8c512679b2a4975be836dfe1225769f']
"When a scraper really wants to copy your content, what stops them from just registering an account?" - the same thing that stops a legitimate user from registering an account when *they* really want to see your content. Effort. Of course it's a different height of hurdle for a scraper relative to the baseline effort, than it is for a legitimate user. Someone scraping your site in particular will likely put in the effort. But it's enough to keep out (for example) Google's spiders, which is 90%+ of all web scraping :-) Ofc I know, Google respects robots.txt so login is irrelevant.
0579bc58f24b468e2ce24de229f6785668f568cec360b4493375ef8e6d21ca6b
['f8cb697d394f405abe31610d3eb7e304']
I'm trying to read multiple csv files from a directory by the following code, but it changes the size of each dataframe from 150000 to 150001, which causes problem when I test it with my trained dataset output which is of 150000 size. any body can fix this? since I'm a complete beginner to ML multiple suggestions and (explanation) would be appreciated... Note that dataFrame.iloc() did not worked in this scenario. # indir = ".//test" # os.chdir(indir) fileList = glb.glob("*.csv") # dfList = [] for filenames in fileList: print(filenames) df = pd.read_csv(filenames, header=None` df[0][0] = 0 df.iloc[0:] print(df.size) # dfList.append(df)
2d8f112e8ed148a734551400ca4ebeab1918a6d54aae08b4d930092180a40eea
['f8cb697d394f405abe31610d3eb7e304']
I'm trying to scrape a website, which loads its contents dynamically through javascript. I was able to request the source from which the data was loading but it returned the response in the json format, and within that json there is a field named 'results_html' which contains all the html that I need to query in order to get the desired data. I tried many solutions and read many related questions but nothing solved my problem. Below is the form of response I'm getting. response.body = b'{"success":true,"results_html":"\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/1200330\\/Strategic_Mind_Blitzkrieg\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"1200330\\" data-ds-itemkey=\\"App_1200330\\" data-ds-tagids=\\"[21725,4684,4026,1677,1741,17305,13276]\\" data-ds-crtrids=\\"[35230293,38088850]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:1200330,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/1200330\\/capsule_184x69.jpg?t=1601419049\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount\\" data-price-final=\\"1039\\"><div class=\\"discount_pct\\">-20%<\\/div><div class=\\"discount_prices\\"><div class=\\"discount_original_price\\">$12.99<\\/div><div class=\\"discount_final_price\\">$10.39<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Strategic Mind: Blitzkrieg<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Tactical RPG<\\/span><span class=\\"top_tag\\">, Wargame<\\/span><span class=\\"top_tag\\">, Difficult<\\/span><span class=\\"top_tag\\">, Turn-Based<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/228200\\/Company_of_Heroes\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"228200\\" data-ds-itemkey=\\"App_228200\\" data-ds-tagids=\\"[9,4150,1676,19,1678,3859,4182]\\" data-ds-crtrids=\\"[35920674,32528477]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:228200,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/228200\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"1999\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$19.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Company of Heroes<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, World War II<\\/span><span class=\\"top_tag\\">, RTS<\\/span><span class=\\"top_tag\\">, Action<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/40980\\/Stronghold_Legends_Steam_Edition\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"40980\\" data-ds-itemkey=\\"App_40980\\" data-ds-tagids=\\"[9,220585,599,4172,7332,4328,3859]\\" data-ds-crtrids=\\"[32942208]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:40980,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/40980\\/capsule_184x69.jpg?t=1601395216\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount\\" data-price-final=\\"230\\"><div class=\\"discount_pct\\">-67%<\\/div><div class=\\"discount_prices\\"><div class=\\"discount_original_price\\">$6.99<\\/div><div class=\\"discount_final_price\\">$2.30<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Stronghold Legends: Steam Edition<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Colony Sim<\\/span><span class=\\"top_tag\\">, Simulation<\\/span><span class=\\"top_tag\\">, Medieval<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/2630\\/Call_of_Duty_2\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"2630\\" data-ds-itemkey=\\"App_2630\\" data-ds-tagids=\\"[19,4150,1663,3859,4182,1774,1678]\\" data-ds-crtrids=\\"[31936442]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:2630,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/2630\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"999\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$9.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Call of Duty\xc2\xae 2<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span><span class=\\"platform_img mac\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Action<\\/span><span class=\\"top_tag\\">, World War II<\\/span><span class=\\"top_tag\\">, FPS<\\/span><span class=\\"top_tag\\">, Multiplayer<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/306660\\/Ultimate_General_Gettysburg\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"306660\\" data-ds-itemkey=\\"App_306660\\" data-ds-tagids=\\"[9,3987,599,1676,1708,4684,492]\\" data-ds-crtrids=\\"[37783362]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:306660,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/306660\\/capsule_184x69.jpg?t=1562054645\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"999\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$9.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Ultimate General: Gettysburg<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span><span class=\\"platform_img mac\\"><\\/span><span class=\\"platform_img linux\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Historical<\\/span><span class=\\"top_tag\\">, Simulation<\\/span><span class=\\"top_tag\\">, RTS<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/241260\\/Sherlock_Holmes_Crimes_and_Punishments\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"241260\\" data-ds-itemkey=\\"App_241260\\" data-ds-tagids=\\"[5613,21,5716,6378,8369,1664,1742]\\" data-ds-descids=\\"[5]\\" data-ds-crtrids=\\"[1205865,36390721,21394]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:241260,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/241260\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"2699\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$26.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Sherlock Holmes: Crimes and Punishments<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Detective<\\/span><span class=\\"top_tag\\">, Adventure<\\/span><span class=\\"top_tag\\">, Mystery<\\/span><span class=\\"top_tag\\">, Crime<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/261050\\/Total_War_ROME_II__Caesar_in_Gaul_Campaign_Pack\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"261050\\" data-ds-itemkey=\\"App_261050\\" data-ds-tagids=\\"[9,3987,6948,1741,1676,4364,1678]\\" data-ds-crtrids=\\"[32528477,32991376]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:261050,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/261050\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"1299\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$12.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Total War: ROME II - Caesar in Gaul Campaign Pack<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span><span class=\\"platform_img mac\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Historical<\\/span><span class=\\"top_tag\\">, Rome<\\/span><span class=\\"top_tag\\">, Turn-Based Strategy<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/201870\\/Assassins_Creed_Revelations\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"201870\\" data-ds-itemkey=\\"App_201870\\" data-ds-tagids=\\"[19,<PHONE_NUMBER>,4036,21,<PHONE_NUMBER>,4376,<PHONE_NUMBER>]\\" data-ds-crtrids=\\"[33075774,185907]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:201870,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/201870\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"1099\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$10.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Assassin\'s Creed\xc2\xae Revelations<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Action<\\/span><span class=\\"top_tag\\">, Open World<\\/span><span class=\\"top_tag\\">, Parkour<\\/span><span class=\\"top_tag\\">, Adventure<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/205610\\/Port_Royale_3\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"205610\\" data-ds-itemkey=\\"App_205610\\" data-ds-tagids=\\"[9,4202,599,4695,<PHONE_NUMBER>,12472,6910]\\" data-ds-crtrids=\\"[876623]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:205610,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/205610\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"1499\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$14.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Port Royale 3<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Trading<\\/span><span class=\\"top_tag\\">, Simulation<\\/span><span class=\\"top_tag\\">, Economy<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/322520\\/DYNASTY_WARRIORS_8_Empires\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"322520\\" data-ds-itemkey=\\"App_322520\\" data-ds-tagids=\\"[19,<PHONE_NUMBER>,4747,9,122,3987,<PHONE_NUMBER>]\\" data-ds-crtrids=\\"[33016879]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:322520,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/322520\\/capsule_184x69.jpg?t=1597910669\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"4999\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$49.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">DYNASTY WARRIORS 8 Empires<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Action<\\/span><span class=\\"top_tag\\">, Hack and Slash<\\/span><span class=\\"top_tag\\">, Character Customization<\\/span><span class=\\"top_tag\\">, Strategy<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/48720\\/Mount__Blade_With_Fire__Sword\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"48720\\" data-ds-itemkey=\\"App_48720\\" data-ds-tagids=\\"[122,<PHONE_NUMBER>,4172,19,9,3987,3859]\\" data-ds-crtrids=\\"[33089344]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:48720,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/48720\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"599\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$5.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Mount &amp; Blade: With Fire &amp; Sword<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">RPG<\\/span><span class=\\"top_tag\\">, Open World<\\/span><span class=\\"top_tag\\">, Medieval<\\/span><span class=\\"top_tag\\">, Action<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/853360\\/Total_War_THREE_KINGDOMS__Yellow_Turban_Rebellion\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"853360\\" data-ds-itemkey=\\"App_853360\\" data-ds-tagids=\\"[9,19,4667,3987]\\" data-ds-descids=\\"[2,5]\\" data-ds-crtrids=\\"[32528477,32991376]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:853360,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/853360\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"699\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$6.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Total War: THREE KINGDOMS - Yellow Turban Rebellion<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span><span class=\\"platform_img mac\\"><\\/span><span class=\\"platform_img linux\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Action<\\/span><span class=\\"top_tag\\">, Violent<\\/span><span class=\\"top_tag\\">, Historical<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/3910\\/Sid_Meiers_Civilization_III_Complete\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"3910\\" data-ds-itemkey=\\"App_3910\\" data-ds-tagids=\\"[9,1741,1677,<PHONE_NUMBER>,1670,3987,4182]\\" data-ds-crtrids=\\"[32844624,2428135,33339585]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:3910,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/3910\\/capsule_184x69.jpg?t=1569013660\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount\\" data-price-final=\\"99\\"><div class=\\"discount_pct\\">-75%<\\/div><div class=\\"discount_prices\\"><div class=\\"discount_original_price\\">$3.99<\\/div><div class=\\"discount_final_price\\">$0.99<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Sid Meier\'s Civilization\xc2\xae III Complete<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Turn-Based Strategy<\\/span><span class=\\"top_tag\\">, Turn-Based<\\/span><span class=\\"top_tag\\">, Classic<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/926580\\/Broken_Lines\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"926580\\" data-ds-itemkey=\\"App_926580\\" data-ds-tagids=\\"[1708,1676,9,4150,3987,1678,4168]\\" data-ds-descids=\\"[2,5]\\" data-ds-crtrids=\\"[35132473]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:926580,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/926580\\/capsule_184x69.jpg?t=<PHONE_NUMBER>\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"1140\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$11.40<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Broken Lines<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span><span class=\\"platform_img mac\\"><\\/span><span class=\\"platform_img linux\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Tactical<\\/span><span class=\\"top_tag\\">, RTS<\\/span><span class=\\"top_tag\\">, Strategy<\\/span><span class=\\"top_tag\\">, World War II<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t\\t<a href=\\"https:\\/\\/store.steampowered.com\\/app\\/73170\\/Darkest_Hour_A_Hearts_of_Iron_Game\\/?snr=1_241_4_historical_104_8\\" class=\\"tab_item \\" data-ds-appid=\\"73170\\" data-ds-itemkey=\\"App_73170\\" data-ds-tagids=\\"[9,4364,4150,3987,5382,599,4684]\\" data-ds-crtrids=\\"[4117016,6859167]\\" onmouseover=\\"GameHover( this, event, \'global_hover\', {&quot;type&quot;:&quot;app&quot;,&quot;id&quot;:73170,&quot;params&quot;:{&quot;bDisableHover&quot;:false},&quot;public&quot;:1,&quot;v6&quot;:1} );\\" onmouseout=\\"HideGameHover( this, event, \'global_hover\' )\\">\\r\\n\\t\\t<div class=\\"tab_item_cap\\">\\r\\n\\t\\t\\t<img class=\\"tab_item_cap_img\\" src=\\"https:\\/\\/steamcdn-a.akamaihd.net\\/steam\\/apps\\/73170\\/capsule_184x69.jpg?t=1589876931\\" >\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t\\t\\t<div class=\\"discount_block tab_item_discount no_discount\\" data-price-final=\\"549\\"><div class=\\"discount_prices\\"><div class=\\"discount_final_price\\">$5.49<\\/div><\\/div><\\/div>\\t\\t<div class=\\"tab_item_content\\">\\r\\n\\t\\t\\t<div class=\\"tab_item_name\\">Darkest Hour: A Hearts of Iron Game<\\/div>\\r\\n\\t\\t\\t<div class=\\"tab_item_details\\">\\r\\n\\t\\t\\t\\t<span class=\\"platform_img win\\"><\\/span>\\t\\t\\t\\t<div class=\\"tab_item_top_tags\\"><span class=\\"top_tag\\">Strategy<\\/span><span class=\\"top_tag\\">, Grand Strategy<\\/span><span class=\\"top_tag\\">, World War II<\\/span><span class=\\"top_tag\\">, Historical<\\/span><\\/div>\\r\\n\\t\\t\\t<\\/div>\\r\\n\\t\\t<\\/div>\\r\\n\\t\\t<div style=\\"clear: both;\\"><\\/div>\\r\\n\\t<\\/a>\\r\\n\\t","start":105,"pagesize":15,"total_count":1000}'
49fa4acc75235a80002db6cd34566410aea3a51559bd12ad31a6dd9f96a8728f
['f8cfa2348b86492fa91c04cdd5c89e96']
I am very much new to JavaFX, I started this week basing my knowledge solely off of small tutorials and sample projects learning the syntax. I have created a simple Table of Stock information that you can add and delete information in and would like to implement a login window to this program. I created the login window but am unsure of how to implement it in my main function properly. Main.java This contains my code for the stock application. package sample; import javafx.application.Application; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXMLLoader; import javafx.geometry.Insets; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.TextField; import javafx.scene.control.cell.PropertyValueFactory; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; public class Main extends Application { Stage window; TableView<Stock> table; TextField symbolInput, nameInput, openingPriceInput, closingPriceInput, changeInPriceInput; public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) throws Exception { window = primaryStage; window.setTitle("Stock Application"); //Symbol column TableColumn<Stock, String> symbolColumn = new TableColumn<>("Symbol"); symbolColumn.setMinWidth(100); symbolColumn.setCellValueFactory(new PropertyValueFactory<>("symbol")); //Name column TableColumn<Stock, String> nameColumn = new TableColumn<>("Name"); nameColumn.setMinWidth(100); nameColumn.setCellValueFactory(new PropertyValueFactory<>("name")); //Opening Price column TableColumn<Stock, Double> openingPriceColumn = new TableColumn<>("Opening Price"); openingPriceColumn.setMinWidth(100); openingPriceColumn.setCellValueFactory(new PropertyValueFactory<>("openingPrice")); //Closing Price column TableColumn<Stock, Double> closingPriceColumn = new TableColumn<>("Closing Price"); closingPriceColumn.setMinWidth(100); closingPriceColumn.setCellValueFactory(new PropertyValueFactory<>("closingPrice")); //Change in Price column TableColumn<Stock, Double> changeInPriceColumn = new TableColumn<>("Change in Price"); changeInPriceColumn.setMinWidth(100); changeInPriceColumn.setCellValueFactory(new PropertyValueFactory<>("changeInPrice")); //Symbol input symbolInput = new TextField(); symbolInput.setPromptText("Symbol"); symbolInput.setMinWidth(100); //Name input nameInput = new TextField(); nameInput.setPromptText("Name"); //Opening Price input openingPriceInput = new TextField(); openingPriceInput.setPromptText("Opening Price"); //Closing Price input closingPriceInput = new TextField(); closingPriceInput.setPromptText("Closing Price"); //Change in Price Input changeInPriceInput = new TextField(); closingPriceInput.setPromptText("Change in Price"); //Button Button addButton = new Button("Add"); addButton.setOnAction(e -> addButtonClicked()); Button deleteButton = new Button("Delete"); deleteButton.setOnAction(e -> deleteButtonClicked()); HBox hBox = new HBox(); hBox.setPadding(new Insets(10,10,10,10)); hBox.setSpacing(10); hBox.getChildren().addAll(symbolInput, nameInput, openingPriceInput, closingPriceInput, changeInPriceInput, addButton, deleteButton); table = new TableView<>(); table.setItems(getStock()); table.getColumns().addAll(symbolColumn, nameColumn, openingPriceColumn, closingPriceColumn, changeInPriceColumn); VBox vBox = new VBox(); vBox.getChildren().addAll(table, hBox); Scene scene = new Scene(vBox); window.setScene(scene); window.show(); } //Add button clicked public void addButtonClicked(){ Stock Stock = new Stock(); Stock.setSymbol(symbolInput.getText()); Stock.setName(nameInput.getText()); Stock.setOpeningPrice(Double.parseDouble(openingPriceInput.getText())); Stock.setClosingPrice(Double.parseDouble(closingPriceInput.getText())); Stock.setChangeInPrice(Double.parseDouble(changeInPriceInput.getText())); table.getItems().add(Stock); symbolInput.clear(); nameInput.clear(); openingPriceInput.clear(); closingPriceInput.clear(); changeInPriceInput.clear(); } //Delete button clicked public void deleteButtonClicked(){ ObservableList<Stock> StockSelected, allStocks; allStocks = table.getItems(); StockSelected = table.getSelectionModel().getSelectedItems(); StockSelected.forEach(allStocks<IP_ADDRESS>remove); } //Get all of the Stocks public ObservableList<Stock> getStock(){ ObservableList<Stock> stocks = FXCollections.observableArrayList(); stocks.add(new Stock("AMZN", "Amazon", 571, 576.4583, 5.4583)); stocks.add(new Stock("EBAY", "eBay", 24.10, 23.7318 , -0.3682)); stocks.add(new Stock("AAPL", "Apple Inc.", 103.91, 104.516, 0.606)); stocks.add(new Stock("SNEJF", "Sony Corp", 24.375, 24.375, 0.00)); stocks.add(new Stock("SBUX", "Starbucks", 58.32, 58.86, 0.54)); return stocks; } } Controller.java This contains the code for my login window. import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.TextField; import javafx.stage.Stage; public class Controller { @FXML private Label labelStatus; @FXML private TextField textUsername; @FXML private TextField textPassword; public void Login(ActionEvent event) throws Exception { if (textUsername.getText().equals("CS1113") && textPassword.getText().equals("Section011")) { labelStatus.setText("Login is Successful"); Stage primaryStage = new Stage(); Parent root = FXMLLoader.load(getClass().getResource("/sample/Main.fxml")); Scene scene = new Scene(root,400,400); primaryStage.setScene(scene); primaryStage.show(); } else { labelStatus.setText("Login failed!!"); } } } The accompanying FXML file. <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import javafx.geometry.Insets?> <?import javafx.scene.control.*?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <?import javafx.scene.layout.*?> <?import javafx.scene.layout.GridPane?> <?import javafx.scene.text.*?> <AnchorPane prefHeight="300.0" prefWidth="300.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="sample.Controller"> <children> <Button fx:id="buttonLogin" layoutX="113.0" layoutY="224.0" mnemonicParsing="false" text="Login"> <font> <Font size="18.0" fx:id="x1" /> </font> </Button> <TextField fx:id="textUsername" layoutX="50.0" layoutY="68.0" prefWidth="200.0" promptText="username" /> <PasswordField id="txtPassword" fx:id="textPassword" layoutX="50.0" layoutY="150.0" prefWidth="200.0" promptText="password" /> <Label fx:id="labelStatus" font="$x1" layoutX="14.0" layoutY="14.0" prefWidth="272.0" text="Status" textAlignment="LEFT" textFill="#cc0000" /> </children> </AnchorPane> I am sure there is an easier way to implement a large amount of my code or an easier way to implement some of the methods or functions I have created. Any help is greatly appreciated.
1bc670674ac63e4dace5bd76333005c9588162b92225bd20b149e9757cf6d15f
['f8cfa2348b86492fa91c04cdd5c89e96']
I'm required to implement methods into a simple program to familiarize myself with them in Java. My code so far is: import java.util.*; public class Lab5a { public static void main(String args[]) { double[] a = {1, 0, 0}; double[] b = {0, 1, 1}; double[] c = {1, 1, 1}; double[] d = {0, 0, 1}; double ab = Math.sqrt ( (a[0]-b[0])*(a[0]-b[0]) + (a[1]-b[1])*(a[1]-b[1]) + (a[2]-b[2])*(a[2]-b[2]) ); double ac = Math.sqrt ( (a[0]-c[0])*(a[0]-c[0]) + (a[1]-c[1])*(a[1]-c[1]) + (a[2]-c[2])*(a[2]-c[2]) ); double ad = Math.sqrt ( (a[0]-d[0])*(a[0]-d[0]) + (a[1]-d[1])*(a[1]-d[1]) + (a[2]-d[2])*(a[2]-d[2]) ); System.out.println("ab=" + ab + ", ac=" + ac + ", ad=" + ad); } } And my instructions are to: Next, copy the class to Lab5b.java, and replace the individual distance calculations by calls to a single public static method that computes the distance between two points passed in as parameters. Also, implement the method. Your method should have a signature something like the following: public static double distance(double[] a, double[] b) I am very much new to Java and am struggling to understand what exactly the statement means.
79a7097316c497d8b9a64c9278f4e02fa7359fd77a47c06c214e507ee5d1f5e9
['f8e2e7b9a8844375bf9dcda125b4c7e4']
I have a page that is a log online, with many fields...I want to make a button that saves the content of the fields in a txt file and automatically shows the download screen for the user... Ive tryed with : $arq = "test"; header('Content-type: text/plain'); header( 'Content-Length: ' . strlen( $arq ) ); header('Content-Disposition: attachment; filename="save.txt"'); print $arq; But i dont know why, it saves the html of the page too! I want only the content of my variable.. what im doing wrong? regards! <PERSON>
6e9493439a246634c299b139af5de36036d015f99c59daa09d1ce586e8f18cdf
['f8e2e7b9a8844375bf9dcda125b4c7e4']
Im starting in javascript and css... I want to do a simple div, appearing like a dialog, but i want that black screen behind, and the dialog modal, blocking the user to click somewhere not in div.. Ive searched in google, but im studing, and i want to know what is missing to the overlay...Someone could help me? my css: .insertscreen{ visibility: hidden; position: absolute; left: 25%; top: 25%; border:2px solid #0094ff; width: 50%; height: 50%; -webkit-border-top-left-radius:6px; -webkit-border-top-right-radius:6px; -moz-border-radius-topleft:6px; -moz-border-radius-topright:6px; border-top-left-radius:6px; border-top-right-radius:6px; font-size:12pt; /* or whatever */ background: -webkit-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -moz-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: -o-linear-gradient(top,#ffffff 0,#F2F2F2 100%); background: linear-gradient(to bottom,#ffffff 0,#F2F2F2 100%); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#F2F2F2,GradientType=0); }
48f6edfeb75941cc2ffc352164aa7d4a6d1e14bd155a3fc9ea73b744f3b4e320
['f8e7c3ef0fb04cd8ab0b5d0528d1df75']
When you are in "fullscreen-mode" on UWP the taskbar / window header always shows up, when you are touching the bottom / top of the display with your mouse cursor. In the UWP version of Rise of the Tomb Raider a small blue rectangle appears instead, that you have to click to show the taskbar / window header. How can I achieve a similar behaviour in my C#/XAML UWP game? Thanks!
f1c5642afc20370e8246c72377ae10d445051ed5723f5cd29eca70e6acf4cf71
['f8e7c3ef0fb04cd8ab0b5d0528d1df75']
This is how I finally implemented it based on <PERSON> answer: class MyGridView : GridView { protected override void PrepareContainerForItemOverride(DependencyObject element, object item) { (element as GridViewItem).PointerEntered += SelectItemOnEntered; (element as GridViewItem).AddHandler(PointerPressedEvent, new PointerEventHandler(SelectItemOnPressed), true); base.PrepareContainerForItemOverride(element, item); } private void SelectItemOnPressed(object sender, PointerRoutedEventArgs e) { (sender as GridViewItem).IsSelected = !(sender as GridViewItem).IsSelected; } private void SelectItemOnEntered(object sender, PointerRoutedEventArgs e) { if (e.Pointer.IsInContact) (sender as GridViewItem).IsSelected = !(sender as GridViewItem).IsSelected; } } I hope this helps everyone who wants to implement this selection mode.
6272647b56ec9066f3649d2310206be8bab71ce5a9d6696ecb912a068d472811
['f8f5490c3d3a4d109cac43548d3bc26e']
I have been a Linux user for a long time now mainly using Debian based systems. Recently I also bought a 15" MacBooK Pro with Retina Display and now, I am trying to install my lovely command line tools using Homebrew on it. I have been successful so far, until now that I tried to install aria2 which failed. Here's what happened: Akos-MacBook-Pro:tmp ako$ brew install aria2 ==> Downloading http://downloads.sourceforge.net/project/aria2/stable/aria2-1.18.0/aria2-1.18.0.tar.bz2 Already downloaded: /Library/Caches/Homebrew/aria2-1.18.0.tar.bz2 ==> ./configure --prefix=/usr/local/Cellar/aria2/1.18.0 --with-ca-bundle=/usr/local/share/ca-bundle.crt --without-appletls ==> make install fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: *** [LibgmpDHKeyExchange.lo] Error 1 make[1]: *** [install-recursive] Error 1 make: *** [install-recursive] Error 1 READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting Akos-MacBook-Pro:tmp ako$ I think the error has something to do with the certificates(crt file). Does anyone have any idea what is going wrong here?
8a6afe6379be6e215da3da7b77109b2968de61c2f7a20da0ac3a04525955fc5e
['f8f5490c3d3a4d109cac43548d3bc26e']
I want to install Xen on my PC, but I don't know where to start. Basic usages: Install two OSs (Linux, Ubuntu or Fedora), one for Database server, one for HTTP server (PHP). Install one Windows 7 for Windows programs. But my problem is I don't know which Linux distribution to use as my host OS. Which Linux is best suited for Xen? I googled it and I think OpenSuse is more friendly with Xen. And do I have to compile the Kernel? Thanks.
4bd25d5f229fe00c510eae2f452472e70f642e86515ed9f3d1457a21e8e781b6
['f90f14dd74464087842ecbe5ce248425']
First, you're not following Python convention: A class should be Capitalized (Pascal Case) and an attribute should be a lowercase : class Product(models.Model): name = models.CharField(max_length=700, null=True) price = models.FloatField(null=True) link = models.URLField(max_length=2000, null=True) image = models.ImageField(null=True) To answer the question, make sure you have done the followings: urls.py urlpatterns = [ # urls/path ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) settings.py MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' Template <img src="{{ product.image.url }}"> Model: image = models.ImageField(upload_to = 'product-img/', null=True) If the image is saved, you'll find it in folder media/product-img
cf0158735db97f9fb7bcec8659d8271903a4ea9a60bc69e7acd42eaa5b47cb8f
['f90f14dd74464087842ecbe5ce248425']
For newest Chartjs like 2.7.2 just put: borderWidth: 0 in the data var ctx = $('#progress-chart'); var data = { datasets: [{ data: [25, 50, 25], backgroundColor: ['red', 'green', 'blue'], borderWidth: 0, //this will hide border }], // These labels appear in the legend and in the tooltips when hovering different arcs labels: [ 'Red', 'Green', 'Blue' ] }; var progressChart = new Chart(ctx,{ type: 'pie', data: data, options: Chart.defaults.pie }); <div> <canvas id="progress-chart" width="500" height="250"> </canvas> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.min.js"> </script>
b5cb88c3495052a009232c210df3e0c7b1677290c728c7d2ea5f94d3d6335703
['f91304b5b7eb48d494a4af941eec8328']
Do you have the ability to alter the schema of your database? If so, I'd consider consolidating this into one table. Barring that, you may want to try a one-to-one relationship in Doctrine. Perhaps something like: class File { private $id; private $name; private $mime; private $content; } class Content { private $id; private $data; private $fileId; } If you map Content->fileId with a one-to-one relationship to File->id, then you can do things like: $file->getContent()->getData(); $file->getContent()->setData("something different"); Here's some more info on one-to-one mappings: http://docs.doctrine-project.org/en/2.0.x/reference/association-mapping.html#one-to-one-unidirectional
5e75f5ac2cb1df85540c8369ef57f9942d308861a6d29807fa92126ebda51527
['f91304b5b7eb48d494a4af941eec8328']
Try this: Sub ThisShouldWorkNow() x = 3 formula = "=Erfc(" + x + ")" Range("A1").Formula = formula End Sub Totally untested, since I don't have Excel on my Linux machine... But I think I'm getting the point across -- you need to use the .Formula property of the Range object. There's more information here: http://msdn.microsoft.com/en-us/library/office/gg192736.aspx
86a76ef738b88a59ed78fc960afe4b4e5f7740d34489a750559d2a2525eb5112
['f924e50afb354a74b83821ccecdbabd6']
We have a common.js file which contains the commonly used client/jquery related functions and validations. This common.js is included in the _Layout.cshtml. In this common.js file we have datepicker code, to maintain uniformity across application, as below, function OsDatepicker(id, date, maxdt, dDate) { var ctrl = "#" + id; var d = new Date(); var currYear = d.getFullYear(); if (date == 0) var yrrange = (parseInt(currYear) - 4) + ":" + (parseInt(currYear) + 2); else var yrrange = (parseInt(currYear) - 70) + ":" + (currYear); $(ctrl).datepicker({ dateFormat: 'dd/mm/yy', changeYear: true, autoSize: true, yearRange: yrrange, constrainInput: true, showOn: "both", buttonImage: '../../../Content/images/Calendar.png', buttonImageOnly: true, showanim: "slide", //defaultDate: dDate, //not working inline: true }); if (maxdt == 0) $(ctrl).datepicker("option", "maxDate", "+0d"); $(ctrl).datepicker("option","setDate", new Date(dDate)); //not working } The above function is called in the cshtml script as below, $(document).ready(function () { var dobDate = $("#Date_Of_Birth").val(); var jtDate = dobDate.split(" "); OsDatepicker('Date_Of_Birth', 1, 0, jtDate[0]); }); My razor code is as below, for Date of Birth <div style="width: 260px; float: left; height: 45px;"> <label class="field_title"> @Html.LabelFor(model => model.Date_Of_Birth)</label> <div class="form_input"> @Html.EditorFor(model => model.Date_Of_Birth) @Html.ValidationMessageFor(model => model.Date_Of_Birth) </div> </div> The markup of the above is as below, <input class="text-box single-line" id="Date_Of_Birth" name="Date_Of_Birth" type="text" value="<PHONE_NUMBER> 00:00:00" /> As you can see the model is fetching the date correctly, which also being passed to the OSDatepicker function correctly. On loading the form the DateofBirth textbox is blank, unable to crack this. Your suggestions would be helpful. Thanks in advance.
38afdf83bd2ffa27527938a459bb39a5e7c7b2081ec0eaf43d5de2310d378d93
['f924e50afb354a74b83821ccecdbabd6']
If the number of approval columns is fixed and the values in them is either 0 or 1, then some thing like this would help Select (fname_approval + lname_approval + mname_approval) from <table_name> This query would give you the total, say 3.. which would mean all have been approved as the number of columns is same as the total. If the total is less, it would mean you don't have all the approvals. You need to hard code the number of columns(which isn't a good idea). Hope this helps.
de4b1dea660d00e97fb4c7e5bd1094bd39a0f8da37ae888439d97bd8bd885156
['f92eaa90f94247e18789e5ffeda85a62']
<PERSON> I did try dbscan alone but the very big issue is that dbscan doesnt understand classifications by weight. Weight does not directly correlate with importance though: that is, I need to cluster high weights together and low weights together (and both are equally important), but almost always different clusters with different topologies overlap into one big cluster (So DBSCAN puts them together). Because of this, i have tried doing manually separating the values by weight and THEN doing DBSCAN but this is an extremely tedious for 1000s of iterations. What do you recommend I do?
65c39af720b9c699eef4cf7f1e48b91e6286f6ed26a62bccc6b848ea78905cd7
['f92eaa90f94247e18789e5ffeda85a62']
[!Hola, Soy nuevo en esto. Mi problema es quedesarrolle una appWeb en Django y al momento de subirla mi jefe me dice que la suba en este Cpanel (nunca eh subido una pagina web a Internet xd), investigando en internet vi que para subirlo necesito ese software "Setup Python App" en mi Cpanel (primera imagen ) Pero en el Cpanel que tengo solo tiene estas aplicaciones. Es posible instalar esa app que me falta?. Creo que tengo acceso a SSH pero no tengo idea de como instalar esa app. O de plano tengo que realizar todo denuevo y hacerla en PHP :C
499443bdd7d9d08c4c2df179e9990a0bafb93ad628d3564b47a6dd70140ae056
['f92ed33fb644423a8358af927dbf49e8']
For combined date and time representations you must use basic format for both date and time or extended format for both date and time representations to comply with ISO 8601. Examples of ISO 8601 compliant date and time representations: 2020-12-03T15:05:57+00:00 (extended) 2020-12-03T15:05:57Z (extended) 20201203T150557Z (basic) For maximum compatibility with various operating systems file naming requirements and ISO 8601 compliance I think the last example or something similar should work. Reference: https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
9ee76330106be579b1bc3379e5867e49e0e18619afe8314ca3362a9cd045de5f
['f92ed33fb644423a8358af927dbf49e8']
The problem with the accepted answer numpy.argsort(data)[len(data)//2] is that it only works for 1-dimensional arrays. For n-dimensional arrays we need to use a different solution which is based on the answer proposed by @Hagay. import numpy as np # Initialize random 2d array, a a = np.random.randint(0, 7, size=16).reshape(4,4) array([[3, 1, 3, 4], [5, 2, 1, 4], [4, 2, 4, 2], [6, 1, 0, 6]]) # Get the argmedians np.stack(np.nonzero(a == np.percentile(a,50,interpolation='nearest')), axis=1) array([[0, 0], [0, 2]]) # Initialize random 3d array, a a = np.random.randint(0, 10, size=27).reshape(3,3,3) array([[[3, 5, 3], [7, 4, 3], [8, 3, 0]], [[2, 6, 1], [7, 8, 8], [0, 6, 5]], [[0, 7, 8], [3, 1, 0], [9, 6, 7]]]) # Get the argmedians np.stack(np.nonzero(a == np.percentile(a,50,interpolation='nearest')), axis=1) array([[0, 0, 1], [1, 2, 2]])