_id
stringlengths
2
6
partition
stringclasses
3 values
text
stringlengths
4
46k
language
stringclasses
1 value
title
stringclasses
1 value
d4701
train
for (; i < grades.length; i++); <--- See the semi-colon at the end, basically this is executing all the code between the ) and the ;, which isn't much, meaning you could actually remove the loop with only a minor side effect to the code. Instead, you should be doing something more like... for (int i = 0; i < grades.len...
unknown
d4702
train
Inner template: <form #myForm="ngForm"> <input ngModel name="name" type="text" required /> <input ngModel name="email" type="email" required /> <input ngModel name="phone-number" type="text" required /> <button (click)="onSubmit(myForm)">Submit</button> </form> Innner .ts: onSubmit(form: NgForm) { console.l...
unknown
d4703
train
Are the dates in varchar2 type? Then, you can first convert it into timestamp format. Since it has timezone also, use the to_timestamp_tz function. SQL> select to_timestamp_tz('Sun Dec 29 11:55:29 EST 2013','Dy Mon dd hh24:mi:ss TZR yyyy') from dual; TO_TIMESTAMP_TZ('SUNDEC2911:55:29EST2013','DYMONDDHH24:MI:SSTZRYYYY'...
unknown
d4704
train
As you have discovered you cannot overlay reference types on top of value types. So to implement your union, you need to use either one or the other. Your structures must contain value types and so we conclude that you must use value types exclusively. So, how do you implement your character arrays as value types? By u...
unknown
d4705
train
Why are your modules not stored in directories? For example: / app.js lib --/logger ----/index.js then in app.js you can just require(./lib/logger)
unknown
d4706
train
Everyone has provided comments telling you what the problem is but if you are a beginner you probably don't understand why it's happening, so i'll explain that. Basicly, when opening a file with python, each new line (when you press the Enter Key) is represented by a "\n". As you read the file, it reads line by line, b...
unknown
d4707
train
Don't use relative paths for your URLs in the page. Start them all with a /. Change this: <img src="images/image1.jpg" class="card-img" alt="..."> to this: <img src="/images/image1.jpg" class="card-img" alt="..."> When the path does not start with a /, then the browser adds the path of the containing page URL to th...
unknown
d4708
train
You just have to replace the argument to an input function to take input from the user. So the code will be changed from obj = Circle(3) to obj = Circle(int(input("Please Enter Radius:"))) The int() before the input function is to convert the input from string to an integer. To know more about taking input from user,...
unknown
d4709
train
Please check data in column podate and validity. Any of this column is having string value. That is the reason why you are getting this error. A: Try to use MSSQL server ISDATE() function it returns 0 if a string isn't date and 1 if it is date and can be converted. Try to run following select and check incorrect stri...
unknown
d4710
train
Try something like this to do a force reload of the image. So every time the image is requested a new one will appear. Change your header like this. header("Location:../profile_images/".$image."?".rand(1,3000));
unknown
d4711
train
Create .jshintrc file in your home directory and set es5 to FALSE. { "es5" : false, // true: Allow ES5 syntax (ex: getters and setters) }
unknown
d4712
train
If your ethernet shield is a cheap clone, they are known to be faulty. You will be able to get a DHCP address by plugging it directly into your DHCP server, but you will not get an address if the shield is connected to a switch. You can fix this by soldering 2 x 100 Ohm resistors to the correct pins of the network sock...
unknown
d4713
train
According to the line in the file you're getting the error, PHP is failing to parse this line: protected $headersKeys = []; The only issue that is possible here is that your PHP version is too old and does not work with the [] array definer. You should update your PHP version to at least 5.4.
unknown
d4714
train
There are two ways of doing it. * *Create context variable and use this variable in file mask. *Directly use TalendDate.getDate() or any other date function in file mask. See both of them in component 1st approach, * *Create context variable named with dateFilter as string type. *Assign value to context....
unknown
d4715
train
extract 'location' from initial json, and then convert to DataFrame with open('Location History.json', encoding='utf-8') as data_file: data = json.loads(data_file.read()) pd.DataFrame(data['locations'])
unknown
d4716
train
CAST('2016-07-14' AS DATETIME) -- the CAST is not needed; '2016-07-14' works fine. (Especially since you are comparing against a DATE.) IN ( SELECT ... ) is inefficient. Change to a JOIN. On eds_stock, instead of INDEX(`Prime Item Nbr`) have these two: INDEX(`Prime Item Nbr`, `Date`) INDEX(`Prime Item Nbr`, `Curr T...
unknown
d4717
train
This is pretty simple. Follow these steps 1) Go to your target build setting 2) Click on Add Build Phase (at buttom right corner) and choose Add Run Script 3) In the Edit Text Box copy paste this script #!/bin/bash echo "Copy Box database schema into bundle" cp -fr ./Box.framework/Resources/BoxCoreDataStore.momd "${BU...
unknown
d4718
train
Compress the theme into a zip file, and just upload it via the Wordpress Dashboard.... Appearance -> Themes -> then click on "Add New" -> then click on "Upload Theme"
unknown
d4719
train
I figured out the answer. It works if I prepend the gem install command with CC='clang -fdeclspec'. Like this: CC='clang -fdeclspec' gem install sqlite3
unknown
d4720
train
There are two main issues. * *The call to minL in the addInput function doesn't have the right number of parameters. *minL doesn't return a boolean value when addInput expects it to. function minL(elem,event,nr){ var v = elem.value; if(v.length < nr ){ elem.classList.add("invalid"); } else i...
unknown
d4721
train
That's an Archimedean spiral curve. As the page says in polar coordinates the formula of the curve is r = aθ, usually the scalar a is 1 i.e. r = θ. Polar to cartesian conversion is x = r cos θ, y = r sin θ Hence x = θ cos θ, y = θ sin θ Varying θ from 0 to 6π would give the curve you've. When you vary the parameter θ...
unknown
d4722
train
As far as I know, Microsoft.Azure.Management.Resources.dll that implements the ARM API. We need to assign application to role, after that then we can use token in common. More information about how to assign application to role please refer to the article .This blog also has more detail steps to get AceessToken.
unknown
d4723
train
spring-boot-starter-web already includes Jackson. You should not override the managed version, otherwise the versions can be different between different Jackson libraries, causing ClassNotFoundException. Remove this from the pom: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-cor...
unknown
d4724
train
I am not familiar with Selenium, but getting the page source for a url is easy with HttpClient: string url = "https://www.instagram.com/" + _theUsername; using (var httpClient = new HttpClient()){ var response = await httpClient.GetStringAsync(url); Debug.WriteLine(response); } and response will have your page...
unknown
d4725
train
Move $.ajaxSetup({ data: window.csrf }); in document.ready(). And like other answers point out, if you want to send csrf-token, you have to use headers key in ajaxSetup. A: Here is the method binding the csrf token if you are using laravel In head of app.blade.php <!-- CSRF Token --> <meta name="csrf-tok...
unknown
d4726
train
This is a bug that was introduced in pandas 0.24.0, and fixed in 0.24.1. See https://github.com/pandas-dev/pandas/issues/24940
unknown
d4727
train
having done some research into this I can inform you that there are currently two version of Microsoft's Application Request Routing one for 32-bit architecture and the other for 64-bit. Although it does not say, I would presume that the Web Platform Installer version is only for 32-bit, in order to get a 64-bit specif...
unknown
d4728
train
It is because of your xml file path, be sure about that your path directory is true. I checked your code in my pc and worked well. Search your "haarcascade_frontalface_alt2.xml" file in your pc and copy it to your code. The same problem was also mentioned here
unknown
d4729
train
Ok, stupid mistake... When launching the app, I init my AVCaptureSession, add inputs, outputs, etc. And I was just calling start_new_record a bit too soon, just before commitConfiguration was called on my capture session. At least my code might be useful to some people. A: SWIFT 4 SOLUTION #1: I resolved this by call...
unknown
d4730
train
Because this: let User = { name, email }; is a shortform for: let User = { name: name, email: email, }; So it directly initializes both properties to the value that the variables name and email are holding. name is defined, it is the name of the page you are in, which you can easily check with: co...
unknown
d4731
train
Did you restage the app after un-binding? Changes to bindings don't take affect until after an app has been restaged. You can verify by running cf env app-name and seeing of the VCAP_SERVICES environment variable is still set.
unknown
d4732
train
The question is not very clear, but for my understanding, this is what you are looking for Firestore.instance.collection('save') .where('fav', arrayContains: 'abc@gmail.com').snapshots() A: The question is not very clear, but for my understanding, you want to find one e-mail in the array field. This array is containe...
unknown
d4733
train
It is not possible to either delete a dataset or change its datatype. From section 5.3.2 of the HDF5 manual: The datatype is set when the dataset is created and can never be changed. This is due to how space is assigned in an HDF5 file. While it's not possible to delete a dataset (for the same reasons), it can be "unl...
unknown
d4734
train
I think you are trying to do something like this. List<Integer> filters=new ArrayList<>(); filters.add(Place.TYPE_ESTABLISHMENT); AutocompleteFilter autocompleteFilter=AutocompleteFilter.create(filters); PendingResult<AutocompletePredictionBuffer> pendingResult=Places .GeoDataApi ...
unknown
d4735
train
You seem to be using the wrong API. The setContent() method and the options hash is part of the leaflet-sidebar library API, but not of sidebar-v2.
unknown
d4736
train
Reading various articles about this on the wide web, there seems to be very few guides for specific images, but this http://allyssabarnes.com/2013/07/22/how-to-block-your-images-from-being-pinned/ link shows: <meta name="pinterest" content="nopin" description="Enter your new description here" /> and <img src="your-ima...
unknown
d4737
train
Try out this, Change your code as below : scan_btn = findViewById(R.id.scan_btn); A: It does not affect your code. This is a new feature of Android studio that directly maps the widget from your XML to Java code. Your app may crash for any other reason A: Starting with API 26, findViewById uses inference for its ret...
unknown
d4738
train
I don't think the zip utility supports this sort of transformation. A workaround is to use a symbolic link: ln -s directory new_directory zip -r foo.zip new_directory rm new_directory If other archive formats are an option for you, then this would be a bit easier with a tar archive, since GNU tar has a --transform opt...
unknown
d4739
train
Apparently the dot is actually included in the key name, try: myObject['screeningField.displayName']
unknown
d4740
train
There is one immediate problem with the design as you describe it if you intend to block the thread waiting for messages - which is the use variable sized messages and a CR as the delimiter. I imagine that HalUARTReadDMA() is designed to block the calling thread until len bytes have been received so you clearly cannot...
unknown
d4741
train
_M_AMD64 appears to be specific to Visual Studio compilers. The question is confusing because it suggests that CMake is doing the pre-processing. It doesn't. You are using gcc. gcc doesn't appear to implement the Visual Studio specific pre-processor macros. You'll either have to alter the code to work with gcc or de...
unknown
d4742
train
Here's what I ended up with. It works because onTouchStart is always calld before onClick if it's a touch event and if not's then the custom logic gets called anyway. It also fires before the hover has happened. This preserves the :hover event. e.preventDefault() did not. let isVolumeBarVisible; const onTouchStartMute...
unknown
d4743
train
curl_setopt($ch, CURLOPT_POSTFIELDS, array('recipient'=>'123123', 'message'=>'assss')); I just change the above code to this: curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); where $postData is: $postData = 'recipient='.$recipient.'&message='.$message['message'] Alas!
unknown
d4744
train
const player = { currentChoice: null } const computer = { currentChoice: null } const choices = ["Lapis", "Papyrus", "Scalpellus"]; document.querySelector('#Lapis').onclick = setLapis document.querySelector('#Papyrus').onclick = setPapyrus document.querySelector('#Scalpellus').onclick = setScalpellus; function...
unknown
d4745
train
Figured it out - it's not a stacked graph I want, but a dodged graph with full overlap / no offset. position_dodge to the rescue! ggplot(x, aes(x = reorder(species, -age), y = age, fill = lifestage)) + geom_bar(stat="identity", position = position_dodge(width = 0), width = 2) + coord_flip()
unknown
d4746
train
Strictly speaking, this is a directed graph traversal not a directed tree. A simple algorithm, that ignores the edges but based on position, and gives the expect output is: >>> positions = [Node.objects.filter(position=i) for i in range(1,3+1)] >>> import itertools >>> list(itertools.product(positions)) [(<Node: A1>, ...
unknown
d4747
train
I guess you are looking for something like this : ## giving a vector x and a threshold .thresh ## returns the min index, where the cumulative sum of x > .thresh get_min_threshold <- function(x,.thresh) max(which(cumsum(x[order(x)]) < .thresh))+1 ## apply the function to each column of the data.frame lapply(ndx,get...
unknown
d4748
train
You're describing multitenancy - create one table for N 'tenants' instead of N identical (or nearly) tables, but partition it with a tenant_id column, and use that to filter results in SQL WHERE clauses. For example the generated code for findByUsername would be something like select * from person where username='foo' ...
unknown
d4749
train
Use query to find the current status of document with 'Id':x and the update the other document using UpdateExpression with "ADD" import boto3 from boto3.dynamodb.conditions import Key, Attr from datetime import datetime dynamodb = boto3.resource('dynamodb') table = dynamodb.Table('your_table_name') result = table.que...
unknown
d4750
train
The answer to my question turned out rather simple: dynamic pObj = JObject.Parse(obj).ToObject<ExpandoObject>(); I had to cast it as ExpandoObject not just dynamic. @Tsahi: this is not a design problem. My intention was to provide the server with parameters (filter) which is a quite common task for a clien...
unknown
d4751
train
Disclaimer: I work for Spotify Upon examination of the Android app's source code, it seems that launching the radio is done with an internal intent. In other words, via an unpublished URI scheme which is unpublished because it is subject to change between versions. I'm not sure if this is a feature which is planned for...
unknown
d4752
train
Use JSONObject for simple JSON and JSONArray for array of JSON. try { JSONParser parser = new JSONParser(); JSONObject data = (JSONObject) parser.parse( new FileReader("/config.json"));//path to the JSON file. JSONObject jsonObject = data.getJSONOb...
unknown
d4753
train
First, the user has to generate String token = FirebaseInstanceId.getInstance().getToken(); and then store it in firebase database with userId as key or you can subscribe the user to any topic by FirebaseMessaging.getInstance().subscribeToTopic("topic"); To send notification you have to hit this api https://fcm.google...
unknown
d4754
train
I tend to use png files rather than vector based graphics such as pdf or eps for this situation. The files are much smaller, although you lose resolution. If it's a more conventional scatterplot, then using semi-transparent colours also helps, as well as solving the over-plotting problem. For example, x <- rnorm(10000)...
unknown
d4755
train
So, by investigating about this question I got the following conclusions: * *QtWebView DOES support SVG elements in the HTML. I figure that this is true at least since Qt V4.7, since it is the one I'm presently using; *Still don't know why d3.min.js works and the "regular" d3.js doesn't; *D3.js doesn't have to be ...
unknown
d4756
train
For the one's that are interested: here is the final solution. (Big thanks to @Kintamasis ) * *Install Gulp / Gulp BrowserSync *Create a gulpfile.js in your themes' folder. var gulp = require('gulp'); var browserSync = require('browser-sync').create(); gulp.task('browser-sync', function() { ...
unknown
d4757
train
I got the answer: >>> re.findall(r'(?:abc.*\d+.tar.bz2|xyz\-ok.*.tar.bz2)', a) ['abc330b125.tar.bz2'] A: You can use this regex: re.findall(r"[\w-]+\.tar.bz2",a) result # ['abc330b125.tar.bz2', 'my-libs.tar.bz2'] If you want all filenames, you can do it: re.findall(r"[\w-]+\.tar.(bz2|gz)",a) result # ['abc330b125....
unknown
d4758
train
You are inflating your view inside onCreateView, but you don't pass it to the system. Instead you tell it to inflate its own (you return super). It doesn't make any sense. You should return your v view like so: public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saved...
unknown
d4759
train
Unity (or any IoC container framework) is basically a super-factory, creating objects and handing them to you. How is it supposed to create an instance of a static class? Refactor your design to use a non-static class. If necessary create a class that wraps the static class and delegates to it. EDIT: If you specificall...
unknown
d4760
train
This one-liner must certainly be possible to further simplify, but I haven't managed to come up with one that's readable. I'm sure you can improve it. def means = str.trim().split('\n')*.split(',').collect{it*.trim().collect{e -> new BigDecimal(e)}.withIndex()}.collect{e -> e.collect{ee->[(ee[1]): [ee[0]]].entrySet()}}...
unknown
d4761
train
This does belong on ServerFault. However. Stopping a service with net.exe actually does two things: * *Sends the stop command to the service. *Wait an amount of time (either 30s or 60s, IIRC) to see if the service has stopped. If it has, report success. Else, error. My guess it that net.exe stop splunk is hitti...
unknown
d4762
train
What I think you need to do is: if you are using the package https://github.com/fruitcake/laravel-cors you will have config/cors.php and there is where you should add 'exposed_headers' => ['_msg'], and you have to create the middleware as it's explained in the issue https://github.com/fruitcake/laravel-cors/issues/308#...
unknown
d4763
train
First, I would simplify the code a bit. The three var calculation in all three branches seem to be the same. So is the updating of #hours_left. You should be able to factor them out of the if. This will also reduce the number of if branches from 3 to 1 - if I am not missing something. As for the problem, I would look a...
unknown
d4764
train
Add this to your body http://www.redips.net/javascript/adding-table-rows-and-columns/ <button onclick="addRow()">Add Row</button> <button onclick="addCol()">Add Column</button> <button onclick="removeRow()">Remove Row</button> <button onclick="removeCol()">Remove Column</button> <script> var table = docume...
unknown
d4765
train
Well then just print the answer outside the loop. If I'm getting your doubt correctly. list_A = [] list_B = [] num_sells = 0 num_buys = 0 num_holds = 0 for x in range(10000): list_A.append(np.random.randint(0,10)) list_B.append(np.random.randint(0,10)) if list_A[x] > list_B[x]: num_buys += 1 ...
unknown
d4766
train
I found that loopback which is based on express have these generators, for anyone interested in this
unknown
d4767
train
The get() reads all documents from that collection. You need to use delete() to delete a document. Try refactoring the code as shown below: const deleteChat = async () => { const chatSnapShot = await db .collection("chats") .doc(router.query.id) .collection("messages") .get(); const deletePromises...
unknown
d4768
train
You could escalate your permissions much the same way installers do it. It will require user interaction, as that's the way the OS is designed (and rightly so) - you can't go around it. A: You cannot escalate permissions as such (at least I'd like to know about it, but doesn't seem possible as yet), but you need to ru...
unknown
d4769
train
You need to write a private validate function something like this. class Auction < ActiveRecord::Base validates :days,:presence => true, :numericality => { :greater_than_or_equal_to => 0, :only_integer => true } validates :hours,:presence => true, :numericality => { :greater_than_or_equal_to => 0, :only_integer =...
unknown
d4770
train
The problem is in the call to input.close() - this causes the underlying input stream to be closed. When the input stream being closed is System.in, bad things happen (namely, you can't read from stdin any more). You should be OK just eliminating this line. A: input.hasNextInt() This line throws the exception if...
unknown
d4771
train
By default, you can't make XHR requests across different domains. You'll need to dynamically generate script tags and use JSONP. Here's an article that seems to cover how to do it: http://cjihrig.com/blog/remote-ajax-calls-using-jsonp/ Also, it's important to note that this can cause security issues. A: I believe the ...
unknown
d4772
train
I think, unless you want to prefix all your paths in that template matching / with the variable I suggested to store the result of the marker insertion, one way to merge the existing code with my suggestion is to change the match from / to /* e.g. use <xsl:template match="/*"> <!-- div for text --> <div...
unknown
d4773
train
For a Table, you can simply use the ShowAllData method of its Autofilter object: activesheet.listobjects(1).autofilter.showalldata Note this won't error even if there is no filter currently applied. A: This expands on the answer from @Rory (the go-to-answer I look up every time I can't remember the syntax). It avoid...
unknown
d4774
train
As suggested by @DaveNottage, an anonymous thread with standard Post was my best solution so far. This is the function I've been using quite succesfully so far. I call it from the main program with the destination url, the params that will be sent as JSON and a Callback Procedure that will handle the HTTPResponse recei...
unknown
d4775
train
A custom type converter should work fine. Here's a quick example (thrown together -- not tested). Also, I added a "Length" property to the ICustomerAddresses so I knew how many to loop through: public class AddressConverter : TypeConverter<ICustomerAddresses, IList<Address>> { protected override IList<Address> Co...
unknown
d4776
train
Try below one $fix_d_table = TableRegistry::get('fixed_departures'); $f_dates_march = $fix_d_table ->find("all") ->where(['trek_id' => 3]) ->andWhere( function ($exp) { return $exp->or_([ 'date_from <=' => date('Y-m-d', strtotime("+10 days")), 'date_from >='...
unknown
d4777
train
I had these SDK included in project: * *AppLovin *Facebook *LeadBolt *MoPub *RevMob *Upsight *Vungle I have deleted all of them except Vungle. After that I received another message from Google. This time they warned me about Vungle version. I had to update Vungle SDK to version 3.3 or higher. Now my app is p...
unknown
d4778
train
Here is my updated answer with code snippet. the problems are: 1) missing <html><head> at top, 2) missing jquery package, 3) fonteselect.js and fontselect.css need to be called with https://, not http://. <html> <head> <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYG...
unknown
d4779
train
you need to do something like this: Get-AzureRmRedisCache -Name "isi$i" -ResourceGroupName "iaas101" | where { $_.ProvisioningState -eq 'Succeeded' } | Remove-AzureRmRedisCache -Force You filter with Where-Object. Alternatively you can do: $cache = Get-AzureRmRedisCache -Name "isi$i" -ResourceGroupName "iaas101" ...
unknown
d4780
train
The trouble is that CMake resets the contents of CMAKE_FIND_LIBRARY_SUFFIXES during the PROJECT statement, see the file Modules/CMakeGenericSystem.cmake in the installation of CMake. For example, this CMakeLists.txt cmake_minimum_required(VERSION 2.8.12) message("CMAKE_FIND_LIBRARY_SUFFIXES = ${CMAKE_FIND_LIBRARY_SUFF...
unknown
d4781
train
Not sure how the fact the data is from cube makes much difference, inside of tableau you're looking at a integer and returning a string shouldn't matter. If you want give this a try create a calculated field like this: ZN([Margin 1]) + ZN([Margin 2]) + ZN([Margin 3]) Then create your if statement based on the new calc...
unknown
d4782
train
You should never need to manually specify the ID when creating new instances; Rails will automatically create the auto-incrementing column to handle generating unique IDs for you. In this case, if you have tampered with the ID column and changed its type, the easiest way to reset this is to simply recreate the table.
unknown
d4783
train
You need to rename the index with the year: groups = df.groupby("year") fig, axes = plt.subplots(1, len(groups), sharey=True, figsize=(14,8)) for ax, (year, group) in zip(axes, groups): # The rename_axis function makes the difference group.set_index("forecast").rename_axis(year)["percent increase when left out...
unknown
d4784
train
You need to tell android that your app should become part of the chooser In the manifest you have to declare that you have an activity that can handle the relevant content <manifest ... > <application ... > <activity android:name=".MyDownloadActivity" ...> <intent-filter > <actio...
unknown
d4785
train
I suspect you're encountering output buffering, where it's waiting to get a certain number of bytes before it flushes. You can look at the unbuffer command if that is undesirable for you. A: As it turns out, Python detects whether or not you are using a tty, and increases its buffering when you are not. Several optio...
unknown
d4786
train
Using security="none" means that security is not applied to the URLs, so the statement of adding a Content Security Policy with Spring Security to URLs mapped with security="none" is contradictory. I'm guessing that you want to allow any user access to those URLs. If that is the case, you can easily use the permitAll e...
unknown
d4787
train
Try like below and confirm. driver.get("https://www.phptravels.net/") wait = WebDriverWait(driver,30) checkin = wait.until(EC.element_to_be_clickable((By.ID,"checkin"))) checkin.click() date = 15 select_date = wait.until(EC.element_to_be_clickable((By.XPATH,f"//div[@class='datepicker-days']//td[text()='{date}']"))) ...
unknown
d4788
train
The path refers to the name of the action you call from your HTML or jsp file. For eg - <html:form action="Name" name="nameForm" type="example.NameForm"> The corresponding action mapping will be something like - <action path="/Name" type="example.NameAction" name="nameForm" input="/index.jsp"> <forward name="succes...
unknown
d4789
train
Based upon what you are trying to do, And what the other members advised you already, It sounds like you did not correctly format your if...then and/or your select...case statements. The code below should do what you are trying to do. We use the SELECTINDEX property to find out which index element in the drop down is ...
unknown
d4790
train
I'm a moron and left off parens on name in the model.
unknown
d4791
train
As long as the script doesn't put part of itself into your code when you use it, you should be OK. IOW: If it is just some kind of tool you use to help build your real code (which is totally separate and entirely your own work), then you can liscense that stuff however you want. What you can't do is relicense somebody ...
unknown
d4792
train
You can't on your side. The index must be added to a local object only. You can't use an indexed view either. You can ask the other party to add an index for you to their table... Edit: Expanding John's answer... You could try: SELECT * FROM OPENQUERY(LinkedServer, 'CREATE INDEX etc;SELECT 0 AS foobar') A: I'm not ce...
unknown
d4793
train
That's because the default String Comparator uses lexicographical order -- i.e. character by character, as in a dictionary. Since "1" comes before "2", any String starting with "1" will precede any other starting with "2". You should use a custom comparator to implement Natural Sorting. A good example would be Alphanum...
unknown
d4794
train
I think zoo::rollapplyr should work here. Here's a simple n=2 window, MA <- function(X) { if (!is.matrix(X)) X <- matrix(X, nrow = 1) Hmisc::wtd.mean(X[,1], X[,2]) } df %>% group_by(product) %>% mutate(n2 = zoo::rollapplyr( cbind(price, weight), 2, MA, by.column = FALSE, partial = TRUE) ) %>% ...
unknown
d4795
train
I have fixed your script on http://jsfiddle.net/rwowf5j8/41/ Fixed and tested -- Issue was in the spelling in document.body.style.backround and there were some other tricks to do that easily so I fixed that.. <script> function getColour(value) { changeColour(value); } function changeColour(colour) { if (colour ==...
unknown
d4796
train
Your function do one, and only one, thing. So, in your case, it should find the smaller_root according to some variables. The return value of your function should be the root. In your case, it is possible that it returns None, which would indicate that there is no root for the solution. However, you are trying to make ...
unknown
d4797
train
for single line set shareBtn.titleLabel?.adjustsFontSizeToFitWidth = YES; instead of this factLabel.adjustsFontSizeToFitWidth = true; for multiple line us use actLabel.numberOfLines = 0; factLabel.lineBreakMode = NSLineBreakByWordWrapping; CGSize maximumLabelSize = CGSizeMake(factLabel.frame.size.width, CGFLOAT_MAX)...
unknown
d4798
train
Transform your object to a string like this let obj = { "Jenny" : [ "Second number must be smaller than first", "Signature must be filled !" ] }; let str = ""; Object.keys(obj).forEach(k => { str += k + ":\n"; str += obj[k].join(",\n"); }); console.log(str); A: Extract the data from ...
unknown
d4799
train
You have a list with two dictionaries. To filter the dictionaries you can try keep=[key1,key2] #keys you wanna keep newList = [] for item in mylist: d = dict((key,value) for key, value in item.iteritems() if key in keep) newlist.append(d) del mylist Also using funcy you can do a impo...
unknown
d4800
train
Try: ((TextBox)wsPlanInfo.FindControl("txtLearningPlanName")).Text It will search the Wizard Step's Control list for a textbox with that ID name. It then casts it as a TextBox and so you can then use the Text property. A: Removing disableSelection(document.body) in my javascript solved my problem. Note to self, post...
unknown