_id
stringlengths
2
6
text
stringlengths
4
46k
title
stringclasses
1 value
d7401
You may do bool increase(const std::vector<std::vector<int>>& v, std::vector<std::size_t>& it) { for (std::size_t i = 0, size = it.size(); i != size; ++i) { const std::size_t index = size - 1 - i; ++it[index]; if (it[index] >= v[index].size()) { it[index] = 0; } else { ...
d7402
Here are a few methods on how to center an HTML element: * *The oldest trick in the book: .form { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) } This works by moving the form element 50% to the left and 50% to the top of the container and move's it back 50% of its width ...
d7403
Let's build this gradually, and start with a simple substitution that prepends a newline (\r) to any sequence of comment prefixes (!): :%substitute/!\+.*$/\r&/ This leaves behind trailing whitespace. We can match that as well, and use a capture group (\(...\)) for the actual comment. This removes the whitespace: :%sub...
d7404
to remove lines which starts with alphabets after IP word and also delete that line which do not starts with 192.168.180 after IP word awk approach: awk '$4!~/^[[:alpha:]]/ && $4~/^192\.168\.180/' file space is a default field separator in awk. $4!~/^[[:alpha:]]/:     $4 - fourth field     !~ - not matches     /^[...
d7405
Unfortunately, I don't have enough karma to comment, so I'll do the best I can to provide a solution here. Have you made sure to run 'rails generate devise:install' before attempting to generate the devise model? Also make sure that you ran 'bundle install' before you attempt either of installing Devise or generating a...
d7406
Instead of using SelectedRows property of the DataGridview you can use as follows dataGridView1.Rows[1].DefaultCellStyle.ForeColor = Color.Red; Because SelectedRows property will return rows when row(s) has been selected by the User only, if no rows are selected then your code will throw exception. EDIT : For your dou...
d7407
The solution to to make a list of the indexes that match and populate it in your for loop. then after the for loop is done, print out the results List<Integer> foundIndexes = new ArrayList<>(); for (x = 0; x < v; x++) { if (c[x] == xx) { foundIndexes.add(x); } } //now we looped through whole array i...
d7408
you can use the parameter quotechar data = pd.read_csv("a.txt", delim_whitespace=True, header=None,quotechar="~") print(data.head()) a.txt abc def xyz "abc xyz" def Output 0 1 2 0 abc def xyz 1 "abc xyz" def there are qoutes left this way. A: Try via numpy's genfromtxt() method: import numpy as...
d7409
NSMutableArray *imagename = [[NSMutableArray alloc] initWithObjects:@"http://4cing.com/mobile_app/uploads/pageicon/6.jpg", nil]; UIImageView *imgDescView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 200, 200)]; imgDescView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL: ...
d7410
Based on feedback from cYrixmorten, I moved the Async execute call to the onCreateOptionsMenu. Here is the modified code. Modified onCreateView: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.review_fragment_gridvi...
d7411
ABRecord is an opaque C type. It is not an object in the sense of Objective-C. That means you can not extend it, you can not add a category on it, you can not message it. The only thing you can do is call functions described in ABRecord Reference with the ABRecord as a parameter. You could do two things to be able to k...
d7412
According to the docs, linprog finds the minimum, while your proposed solution is the maximum.
d7413
Since .spotlight-box is absolutely positioned, its parent needs to be relatively positioned if you want it to sit properly inside the parent: .spotlight-container { position: relative; } Fiddle: http://jsfiddle.net/ctdu9bzk/4/
d7414
It seems that you did not configured the URI with the credentials to connect to the database. You can find the description of the configuration file at http://docs.tryton.org/projects/server/en/latest/topics/configuration.html#uri Once you have a configuration file, you must run the command like this: python3 ./trytond...
d7415
You can check that by imply calling getImageData() or even just fillRect() right after your drawImage() call. If the returned ImageData is empty, or if there is no rect drawn over your video frame, then, yes, it might be async, which would be a terrible bug that you should report right away. var canvas = document.cre...
d7416
This was fixed when I instead decided to add the data into some other cells, and then create a Macro that ran in order to grab the information from the cells and place them in the form fields.
d7417
thanks for the this, helped me get started with uploading a video to parse, I figure out your issue, you just didn't put the parse file in your parseobject. basically you never sent the video File inputFile = new File(uri.toString()); FileInputStream fis = new FileInputStream(inputFile); ByteArrayOutputStream bos= new ...
d7418
The bit you're missing is that is that an unsuccessful match resets the position. $ perl -Mv5.14 -e'$_ = "abc"; /./g; /x/g; say $& if /./g;' a Unless you also use /c, that is. $ perl -Mv5.14 -e'$_ = "abc"; /./gc; /x/gc; say $& if /./gc;' b A: When your match fails, In the link to Mastering Perl that you prov...
d7419
NullReferenceException is thrown when you try to access member of a variable set to null. MissingReferenceException is thrown when you try to access a GameObject that has been destroyed by some logic in your code.
d7420
Just pass $BUILD_NUMBER as a parameter to your remote shell script when you fill out the Command field in your build step. For example: Remote shell script contents: echo "Build number is $1" Command field contents: "/path/to/myshellscript $BUILD_NUMBER" A: Just in case somebody is still puzzling over this issue, a...
d7421
I suggest this new library Printy Just released version 1.2.0 as a cross-platform library. Check it out: Printy on github It is based on flags so you can do stuff like from printy import printy # with global flags, this will apply a bold (B) red (r) color and an underline (U) to the whole text printy("Hello world", "r...
d7422
var head = document.getElementsByTagName('head')[0], script = document.createElement('script'); script.innerHTML = 'alert("hello");'; head.appendChild(script); A: You may be able to use document.write. I don't know if you can use that for javascript, but I recommend that the server should pass codes plus an eleme...
d7423
The way I've done it is by... 1) wrapping my component in a js file import MyWidgit from './MyWidgit.vue'; // eslint-disable-next-line import/prefer-default-export export const mount = (el, props) => new window.Vue({ el, render: h => h(Filter, {props}) }); 2) using rollup to generate the code (I think it'...
d7424
Just do plt.bar([row[0] for row in votes_count], [row[1] for row in votes_count]) A: If you know pandas , it will be very easy. votes=pd.DataFrame(data=votes,columns=['List']) votes.List.hist()
d7425
The only solution that I managed to work out, which is not handy nor elegant but somehow works is such query: "query": { "bool": { "should": [ { "nested": { "path": "authors", "query": { "multi_match": { ...
d7426
That means something went wrong in the python-for-android build step, but there are tons of problems that would give that error. Could you set the buildozer token log_level = 2 in your buildozer.spec and try it again (by default it will be 1). This will get buildozer to print much more information about the build proce...
d7427
* *Copying the token is not easy as you will store it in local storage of browser. It will be more secure than stealing cookie. *You can add one more claim : Mac Address. Then on each request compare the Mac Address of Request with Mac of Claim. *Use a long random string, it should be enough. I would recommend 25 ch...
d7428
Since data is being extracted from file names as well, I'll leave the first use of grep as is $ # this won't depend on knowing how many matches are found per line $ # this would also work if there are different number of matches per line $ grep '!' encutkpoint_calculations/* | perl -lne 'print join " ", /\d+(?:\.\d+)?/...
d7429
Not in Simple MAPI. If you were using Outlook Object Model or Extended MAPI, you could set a special MAPI property on the message before sending it to disable TNEF format.
d7430
Call dialog.dismiss() before password = input.getText().toString() and add dialog.dismiss() inside setNegativeButton's OnClickListener too.
d7431
My simple explanation of what props.children does is that it is used to display whatever you include between the opening and closing tags when invoking a component. change your function component to function Item(props) { return ( <div> {props.children} <div> ); } Reference : ...
d7432
You're doing a switch over a String, right? That's why you can, of course, add cases, that won't really happen (like "Not available to execute"). Why don't you just change your possible Strings to an enum and make obj.style return a constant from that enum? This is how you can restict those Strings. fun style(): XYZVal...
d7433
The palindrome_below definition is an instance method on Fixnum. An instance method is a function that can be called on an instance of a class (in contrast to a class method, which is called on the class itself). Given this code, any instance of Fixnum will have access to palindrome_below method whereinself refers to ...
d7434
My process to do such a transition was gradual, I had a similar Grunt configuration. These are my notes & steps in-order to transition to Webpack stack. The longest step was to refactor the code so it will use ES6 imports/exports (yeah, I know you have said that it is not a phase that you wanna make, but it is importan...
d7435
"Not recognized" is normally the way terminals politely tell you they don't know what you typed means. If you can use Git from a command line, then it's installed properly. You can use where git or which git depending on your command line to find the path of the functioning Git (if those don't work, please specify your...
d7436
First of all try with post method instead of get. A: Please add name property to your input element as <input type="date" name="date" placeholder="Choisir une date"> You should get the value for date param in your controller method now. The name property should match with your controller method parameter name. A: <f...
d7437
You can use iptables: iptables -A FORWARD -p tcp -i eth0 -s localhost -d x.x.x.x --dport 3306 -j ACCEPT where x.x.x.x is the mysql server ip address, and eth0 is the interface you use. A: It seems like you are asking if you are on a Linux machine you want to query to localhost and have that query forwarded to a SQL S...
d7438
I've stumbled upon the same issue and found the answer here : http://social.msdn.microsoft.com/Forums/windowsapps/en-US/7fcf8bb8-16e5-4be8-afd3-a21e565657d8/drag-and-drop-gridview-items-and-disabled-scrollbar It appears that with a GridView you can't initiate the drag horizontally, you have to do it vertically and it'...
d7439
I have solved the problem - I just delted the web.config File in laravels /public-Folder. Now, Laravel and RDWeb works - I hope I don't have further problems. Thank you for your answers.
d7440
Drag it to the Applications folder (as the green arrow suggests), and then run it from that folder rather than from the disk image.
d7441
The problem with a Raycast is: It only checks one single ray direction. That makes no sense in your use case. You probably want to use Physics2D.OverlapCollider Gets a list of all Colliders that overlap the given Collider. and do e.g. // Reference via the Inspector public LineRenderer theLine; // configure via the In...
d7442
Actually, Apple does all this automatically, just name your NIB files: MyViewController~iphone.xib // iPhone MyViewController~ipad.xib // iPad and load your view controller with the smallest amount of code: [[MyViewController alloc] initWithNibName:nil bundle:nil]; // Apple will take care of everything A: Your inter...
d7443
Basically the problem is, as I understand, that you're trying to open your .html template directly from IDEA. Which means you're not using the thymeleaf engine to render it - you're just opening the template itself and not the resulting page. If you open the source code of this page using your browser's dev tools, you ...
d7444
For each country div add style="display:none", e.g.: This will hide the div but will keep default country selection.
d7445
You need to use track by as the error suggests. If you don't have a unique key to use you can use $index. ng-repeat='talent in talents.data | testFilter:filterInput track by $index' Here is a working example with your code: http://jsfiddle.net/hwT4P/
d7446
Put them side to side (in html structure) and use the adjacent sibling selector + Something like this html <input type="checkbox" id="box1" /> <label for="box1">checkbox #1</label> css input[type="checkbox"]{ position:absolute; visibility:hidden; z-index:-1; } input[type="checkbox"]:checked + label{ c...
d7447
The problem is the naming of the userControl in its owning Window. I named as: Name="UserCtrlSimulator" instead of: x:Name="UserCtrlSimulator" You can find the bug and a more useful error message by removing the reference of that badly named object (remove any reference to the object named without the "x:"). I can't ...
d7448
Fixed by updating Express to version 4.9. Edit: Turns out I've been doing it wrong, as noted in the documentation.
d7449
* *always test your code to https://shellcheck.net on errors (you have too much do statements) *bash can't compute floating numbers itself, use bc [1] instead *to do arithmetic substitution, use $(( )) *to do arithmetic, without arithmetic substitution, use (( )) form *UPPER CASE variables are reserved for system,...
d7450
Welcome to SO. Why do you not want the error? If you just don't want to see the error, then you could always just throw it away with 2>/dev/null, but PLEASE don't do that. Not every error is the one you expect, and this is a debugging nightmare. You could write it to a log with 2>$logpath and then build in logic to rea...
d7451
Search, don't categorise. You can display the control as a simple text box, and when the user types in a few characters, you could pop up an autocomplete-like dropdown to select the final value. Here's a link to the jQuery plugin for autocomplete. A: I really wouldn't have a 30,000 element drop-down. The GUI is suppos...
d7452
formGroup expects a FormGroup instance means that you did not create an instance for the FormGroup defined in your template which is signupForm so you have to create an instance for signupForm like this: this.signupForm = new FormGroup({ // form controls // arg1 - intial state/value of this control // arg2 - sing...
d7453
true == [] is false simply because true is not equal to []. ![] evaluates to false, so true == ![] is false. Also, true == !![] is true.
d7454
The answer is simple! : (\[+|$) Because the only empty string you need to capture is the last of the string. A: Here's a different approach. import re def ismatch(match): return '' if match is None else match.group() one = 'this is the first string [with brackets]' two = 'this is the second string without bracket...
d7455
You can turn your numbers into strings and then sort them. Afterwards if one number is a pre-number all numbers that start with it will follow and once a number does not start with it anymore you found all. Example_List=[112,34533344,11234543,98] list_s = sorted(str(i) for i in Example_List) result = [] for i in range...
d7456
if you want to search in listed directories (not in scope of your app) then you need a MANAGE_EXTERNAL_STORAGE permission. some doc in HERE
d7457
If someone else has the same problem the reason was because I had installed SSIS 2017 but was using SSMS 18.x , if you have SSIS 2017 use SSMS 17.x and such with other versions
d7458
Magento has helper classes for those kind of methods. So make your extensions and add your methods and you can then later call them like follows Mage::helper('yourextension/yourhelper')->yourMethod(); Or you can make a library class out of your common methods.
d7459
## React createtableselect prevent creating element not in option ## ''' import CreatableSelect from 'react-select/creatable'; const createOption = (label, dataId) => ({ label, value: dataId, }); const levelOptions = ([{ "name": "Course1", "id": 1 }, { "name": "Course2", "id": 2 }...
d7460
Your question isn't very clear, but I'm guessing this is what you want. Use enumerate() to iterate through brand_search along with the indexes. When you find a match, get the corresponding element of value_search. for i, item in enumerate(brand_search): if item in brand: value = value_search[i] prin...
d7461
Every time I run the app, and then re-run it, it saves the same items into the NSUserDefaults even if it is already there. Yes, because that's exactly what your code does: defaults.setObject(existingArr, forKey: "D") But what is existingArr? It's the defaults you've just loaded before: if var existingArr = NSUserDefa...
d7462
Vanilla Javascript document.querySelector('#parallax-bg1 #bg1-1').style.left = `0-(${scrolled}*.4))px` Jquery $('#parallax-bg1 #bg1-1').css('left',(0-(scrolled*.4))+'px'); //parent
d7463
require 'date' Time.now.to_datetime.rfc3339
d7464
The streaming buffer is a queue, and the extraction worker processes rows in order. The extraction workers take from the queue either when it reaches a certain volume of data or when a certain amount of time has elapsed in order to write sufficiently large chunks of data to managed storage. The underlying storage forma...
d7465
From your comments, I can understand that you are looking for a value matching the key that the user inputs. You can simply check for it without any splits and for loops like: var xboxConverter = { "1": "Up", "2": "Down", "3": "Down Foward", "4": "Backward", "5": "Standing", "6": "Forward", "7": "Up Bac...
d7466
smallURL:([NSString stringWithFormat:@"bundle://%@", [visuel lpath]]) A: If lpath is of type NSString then you should use %@. It is used every time you need to convert a Cocoa object (or any other descendant of NSObject) into its string representation. smallURL:(@"bundle://%@", [visuel lpath])
d7467
My understanding is that destroy() is fired and that should remove the content script, but if I look in the debugger in dev tools, the script is still listed after I disable. I can remove the listeners and the observers when handling the detach event, but my understanding was that the content script is removed ...
d7468
Mostly it's a problem with to big association filters. Disable the auto created filters and reenable them one by one, to find the problem filter. This will help you if your filter is not to big: filter :foo, as: :select, collection: Foo.pluck(:name, :id) (but works only for rails > 4.0, you can build a similar thing b...
d7469
Found this and it seems to do the trick if anyone else was interested: http://www.redips.net/javascript/drag-and-drop-table-content/
d7470
Because I had simmilar problems and needed a lot of time to fix it, I will summarize the important facts for getting it running: * *Install doxygen AND graphviz *Add the bin directory of graphviz to your windows path variable (e.g. C:\Program Files (x86)\Graphviz2.38\bin) *In the Settings.ini located in the graphv...
d7471
Apparently the issue was caused by the fact that an old version of the translation jsons was cached in the dist folder of my Angular project. Once I deleted it it all went fine.
d7472
So you want to react to some events happening in the UI. First things first: if you want, in reaction, to change only your view/layout, you do not need ICommand and a simple event handler will do the trick. If you expect to change the underlying data (your view model) in reaction to that event, you can use an ICommand ...
d7473
simply make the bot an admin in the targeted group, then the bot will be able to read messages from the group, thus you'll get the id Or disable privacy mode from BotFather, check the link below: https://core.telegram.org/bots#privacy-mode
d7474
check this out ./app >> /home/user/logs/debug.log 2> >( while read line; do echo "$(date): ${line}"; done > /home/user/logs/debug.err )
d7475
1a) For Eclipse you can either configure the usual WebToolsPlatform (WTP) to do hot deployments. 1b) You can install the JBoss Tools from http://www.jboss.org/tools which might some things smoother. You can think of it as an extension of WTP. 1c) Use a small Ant-Skript to do the same as 2) 2) Simply copy your war file...
d7476
So the way fold works is that it accepts a list of function aliases on how to fold the next element in. if you don't provide it with a starting value, it uses the first element as the starting value. Quoting the documentation (emphasis mine): The call fold!(fun)(range, seed) first assigns seed to an internal variable ...
d7477
You can change your setChart method to this: func setChart(dataPoints: [String], values: [Double]) { chartView.noDataText = "You need to provide data for the chart." var dataEntries: [ChartDataEntry] = [] for i in 0..<dataPoints.count { let dataEntry = ChartDataEntry(x: Double(i)+0.5, y: values[i...
d7478
Broadly speaking, the advantage of splitting it up into more parts is that you can optimize your processor use. If the dataset is split into 3 parts, one per processor, and they take the following time: Split A - 10 min Split B - 20 min Split C - 12 min You can see immediately that two of your processors are going to b...
d7479
Auto execution/installation of a downloaded file are disabled in every main stream Operating systems, be it windows, android, etc.
d7480
Try changing Navigation view like this <android.support.design.widget.NavigationView android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="start" app:menu="@menu/menu" /> A: DrawerLayout must contains 2 children (not more than 2). Can ...
d7481
My aim to to create a plain text string, replacing the image based on its title, so I'd have a string like: Text Before HAMBURGER Text After An option is to use an XPath query to select the text/titles that you want, and output their respective values. $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitiona...
d7482
array_splice get first argument by reference, so don't assign result to the same variable name $newString. array_splice($newString, $wstawwloowo, 0, $inserted); it's enough. A: $article = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lectus urna, tempor nec dui eget, ullamcorper interdum ex. Sed v...
d7483
You must have specified if the path to the directory is absolute or relative. If it is absolute, you can check with -e to see if it exists and with -d if the input given it is a directory or not. if ( -e $dir and -d $dir) { print "\nyour folder exists"; } If the path is relative, then you must create the absolute ...
d7484
The functionalities you are asking for are provided by the PaymentKit library.
d7485
I guess, you have Vrapper or a different plug-in installed that provides these key bindings. If you don't want to have these features, try to uninstall them (select Help -> About from the menu, then click on Installation Details button on the bottom of the About dialog, where you can look for any possible culprits, and...
d7486
I found a solution, In the Filter function You have to use just the Column you need and Filter with this Formula: COUNT(CONTAINS([Column1], "25")) < 2 After that you just create a new calculation that you put in the Filter, the calculation uses then this Formula: CONTAINS([Column1], "Santiego")
d7487
Raise an exception. Not only is it the appropriate way to signal an error, it's also more useful for debugging. The traceback includes the line which did the method call but also additional lines, line numbers, function names, etc. which are more useful for debugging than just a variable name. Example: class A: def...
d7488
I believe your problem is this line: df.index.name = 'Facility' All this would do is name the existing df index (which looks like 0, 1, 2, 3...) "Facility," rather than taking the existing Facility column and making it the index. To do that, you'd want: df = df.set_index('Facility') I found this discrepancy by adding a...
d7489
You should set user_logger.propagate = False. logging.propagate docs If this evaluates to false, logging messages are not passed to the handlers of ancestor loggers. So, your root logger will not send any data to stderr. This example outputs nothing import io import logging stream_handler = logging.StreamHandler() s...
d7490
Your javascript function is returning an object literal, not a JSON string. Probably you need to do the parallel in Java, which would be to return an instance of a class that contains a property named speech, which a getter and setter for speech, and with the value of speech set to "hello lambda java". AWS will proba...
d7491
Use a TextInputEditText instead of a EditText <com.google.android.material.textfield.TextInputLayout ...> <com.google.android.material.textfield.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" .../> </com.google.android.material.textfiel...
d7492
It is not possible to maintain the format of the text in <textarea> as you requested. You can achieve maintaining new lines (basically text is wrapped), if some exists in the text. You have to use "wrap=Hard". https://www.w3schools.com/tags/att_textarea_wrap.asp Also refer stackoverflow answers, which has more explana...
d7493
it seems cannot be done for now. when consumeing the topic, consumers would get all tags A: Tags are only stored in messages, there is no global place to store all tags of a topic, so only consumers can specify tags for filtering and consumption A: You can't! Since there are no ways to save all tags in the broker. Ac...
d7494
You want to filter the list based on the country column. us_movies = [movie for movie in movies if movie[6] == 'USA'] You can also transform the line into just the title if you like. us_movie_titles = [movie[0] for movie in movies if movie[6] == 'USA'] If you want a corresponding list of match predicate results, th...
d7495
The preprocessorOptions.*.additionalData parameter will only work if there are already loaded/imported css to prepend to, so basically using both options of importing directly into your main.ts file for the bulk and any other preprocessing can be defined in the vite.config.js file. Th documentation at https://vitejs.d...
d7496
1) Do not omit server side validation. MVC has some capabilities built in to do some of that for you on the server side, but it's a good idea to test that it's working. Normally this just tests for type, length, range, and some other basic validation. Any complex validation should be done by you. Either way TEST IT...
d7497
If you wrote the Apache startup-script yourself, you can include a check if the database instance is already running. You can include a simple wait-loop: MYSQL_OK=1 while ["$MYSQL_OK" -ne 0] ; do echo "SELECT version();" | mysql -utestuser -ptestpassword testdb MYSQL_OK=$? sleep 5 done Obivously you have to c...
d7498
I never saw a single .gitignore file that prevented me from adding and committing the file in question. However I do remember removing that file from commit using Tortoise. In any case, I solved the issue by renaming the file, adding it, and committing it, and later on, giving the file its former name.
d7499
I solved the issue !!! The problem was't with site location, it was because the permalinks are in Hebrew language. I added the following condition to wp-config file if (isset($_SERVER['UNENCODED_URL'])) { $_SERVER['REQUEST_URI'] = $_SERVER['UNENCODED_URL']; } according to this link: Wordpress Hebrew permalinks F...
d7500
As the resource is read only [...] No, it is not : the fill() method proceed to writes through the following : random_numbers.push_back(std::rand()); // write to random_numbers So the shared mutex really is necessary to synchronize your access to the vector.