qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
15,285,068
I can open a password-protected Excel file with this: ``` import sys import win32com.client xlApp = win32com.client.Dispatch("Excel.Application") print "Excel library version:", xlApp.Version filename, password = sys.argv[1:3] xlwb = xlApp.Workbooks.Open(filename, Password=password) # xlwb = xlApp.Workbooks.Open(filen...
2013/03/08
[ "https://Stackoverflow.com/questions/15285068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1479269/" ]
Assuming the starting cell is given as (StartRow, StartCol) and the ending cell is given as (EndRow, EndCol), I found the following worked for me: ``` # Get the content in the rectangular selection region # content is a tuple of tuples content = xlws.Range(xlws.Cells(StartRow, StartCol), xlws.Cells(EndRow, EndCol)).Va...
Adding to @Maurice answer to get all the cells in the sheet without having to specify the range ``` wb = xw.Book(PATH, password='somestring') sheet = wb.sheets[0] #get first sheet #sheet.used_range.address returns string of used range df = sheet[sheet.used_range.address].options(pd.DataFrame, index=False, header=True...
1,307
Many here are probably aware of Alon's recent super-linear lower bounds for $\epsilon$-nets in a natural geometric setting [[PDF]](http://www.tau.ac.il/~nogaa/PDFS/epsnet3.pdf). I would like to know what, if anything, such a lower bound implies about the approximability of the associated Set Cover/Hitting Set problems....
2010/09/14
[ "https://cstheory.stackexchange.com/questions/1307", "https://cstheory.stackexchange.com", "https://cstheory.stackexchange.com/users/196/" ]
If a range space has $\epsilon$-net of size $f(1/\epsilon)$, then the integrality gap of the fractional hitting set (or set cover) is $f(1/\epsilon)/(1/\epsilon)$. See the work by Philip Long ([here](http://www.phillong.info/publications/intprog.pdf) [The Even etal. work is later than this work, and rediscover some of ...
I'm not sure it does imply anything. The main results flow in the other direction i.e by the [Bronnimann/Goodrich](http://www.cs.jhu.edu/~goodrich/cgc/pubs/cover.ps.gz) or [Even/Rawitz/Shahar](http://www.eng.tau.ac.il/~guy/Papers/VC.pdf) constructions, a linear sized net implies a constant factor approximation for the ...
45,133,172
I've been stuggeling with this problem now for days: Installting Laravel passport. I did all accoring to the tutorial. What I did ``` composer require laravel/passport ``` Added `Laravel\Passport\PassportServiceProvider::class,` to the `config/app.php` run `php artisan migrate` and then `php artisan passport:insta...
2017/07/16
[ "https://Stackoverflow.com/questions/45133172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6615718/" ]
What I have done to do solve the problem! Inside `\vendor\laravel\passport\src\PassportServiceProvider.php` if deleted the ``` if ($this->app->runningInConsole()) { ``` in line 37. After uploading this to my webspace if could have full use of `laravel:passport` Thanks for all the other help!
I guess you have problem that passport not installed, if you are working via FTP do these steps: 1. Upload your code without vendor and composer.lock 2. Make sure that .env exist or fill 'key' in app.php 3. Run composer dumpautoload 4. Run this command composer update --no-scripts 5. Try to run php artisan just to lis...
14,806,771
I wanted to create a paragraph on which if a user hovers the mouse, it should display an alert box. But the code that I typed did not work. As soon as the mouse entered the *page* the box displayed. I only want it to display when the mouse is on the *paragraph*. The code was : ``` <html> <script src="jquery.js" type="...
2013/02/11
[ "https://Stackoverflow.com/questions/14806771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2060348/" ]
[Working example on jsFiddle](http://jsfiddle.net/htmled/caVay/). Try this: ``` $('#p1').hover( alert("you have entered p1 ."); ); ``` or: ``` $('#p1').hover( function() { alert("you have entered p1 ."); }, function() { alert('you have exited p1 .'); } ); ```
You have two errors in your script: 1. 'document' the quotes not to be there 2. missing function in hover so it should be: ``` $(document).ready(function(){ // <----removed the quotes $('#p1').hover(function(){ //<------added the function here. alert("you have entered p1 .") }); }); ```
63,796,383
I have a setting in which I would like to dynamically change a buttons disabled state. Currently the logic I have looks as follows: ```rb <% if @has_attachment_file_sent %> <% if current_user.id != @offer.user_id %> <%= link_to send_signature_requests_path, remote: true, method: :post, ...
2020/09/08
[ "https://Stackoverflow.com/questions/63796383", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13541811/" ]
First place your html in a partial and wrap the content in div, assume that the partial's name is 'buttons.html.erb' \_buttons.html.erb ``` <% if @has_attachment_file_sent %> <% if current_user.id != @offer.user_id %> <%= link_to send_signature_requests_path, remote: true, method: :post,...
create the file `show.js.erb` and in your controller just leave it as `format.js` without curly braces. create a partial with ``` <button class="button is-info is-fullwidth m-t-10 m-b-10" disabled="<%= disabled ? “disabled” : “” %>”>Send request</button> ``` And add a div in original file, wrap rendering of the p...
3,918,735
Now to convert this strings to date time object in Python or django? ``` 2010-08-17T19:00:00Z 2010-08-17T18:30:00Z 2010-08-17T17:05:00Z 2010-08-17T14:30:00Z 2010-08-10T22:20:00Z 2010-08-10T21:20:00Z 2010-08-10T20:25:00Z 2010-08-10T19:30:00Z 2010-08-10T19:00:00Z 2010-08-10T18:30:00Z 2010-08-10T17:30:00Z 2010-08-10T17:0...
2010/10/12
[ "https://Stackoverflow.com/questions/3918735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/375373/" ]
Use slicing to remove "Z" before supplying the string for conversion ``` datestr=datetime.strptime( datetime[:-1], "%Y-%m-%dT%H:%M:%S" ) >>> test = "2010-08-17T19:00:00Z" >>> test[:-1] '2010-08-17T19:00:00' ```
Those seem to be [ISO 8601 dates](http://en.wikipedia.org/wiki/ISO_8601). If your timezone is always the same, just remove the last letter before parsing it with strptime (e.g by slicing). The Z indicates the timezone, so be sure that you are taking that into account when converting it to a datetime of a different tim...
28,912,735
While I try to run the following mysqli call ``` $strSQL3=mysqli_query($connection," alter table mark_list add column 'mark' int(2) " ) or die(mysqli_error($connection)); ``` returns error ``` You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax t...
2015/03/07
[ "https://Stackoverflow.com/questions/28912735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3856434/" ]
Single quotes (`'`) denote string literals. Object names (such as columns), are not strings - juts lose the quotes: ``` $strSQL3 = mysqli_query($connection ,"alter table mark_list add column mark int(2)" ) or die(mysqli_error($connection)); ```
Simply you need to remove the quotes near `'`mark ``` $strSQL3=mysqli_query($connection," alter table mark_list add column mark int(2) " ) or die(mysqli_error($connection)); ```
52,077,076
I am iterating loop over Div and in that div assigning encoded array as value to hidden field and want to get value of that hidden field in each loop but getting undefiened ```js var port_ofAir = null; $(".sublocation_div").find('.sublocation').each(function(index,value1){ port_ofAir = $(this).find(".port_arr").v...
2018/08/29
[ "https://Stackoverflow.com/questions/52077076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7596840/" ]
With C++20 and concept, you may use `requires`: ``` void notify_exit() requires has_member_function_notify_exit<Queue, void>::value; ```
Instantiating a template causes the member instantiation of all the declarations it contains. The declaration you provide is simply ill-formed at that point. Furthermore, SFINAE doesn't apply here, since we aren't resolving overloads when the class template is instantiated. You need to make the member into something w...
217,447
Can I install Mac OS on my PC through VMware. I'm using Ubuntu 12.04 LTS as a host operating system.
2012/11/15
[ "https://askubuntu.com/questions/217447", "https://askubuntu.com", "https://askubuntu.com/users/63113/" ]
Run `update-alternatives --config java` and make sure you configure it correctly. Run `java -version` in a terminal and see the output. From freemind web: <http://freemind.sourceforge.net/wiki/index.php/Download> Freemind may not work with OpenJDK. I would recommend installing Sun/Oracle JRE/JDK. A simple way of in...
I had this problem in Ubuntu 15.04 with the newest Oracle Java 8 (with no other JDK installed). I found the problem in the java-wrappers file which determines the available Java installations: In file `/usr/lib/java-wrappers/jvm-list.sh`, I added `/usr/lib/jvm/java-8-oracle` on line 35: ``` __jvm_oracle8="/usr/lib/jv...
58,863,756
I have a simple grid where the left pane acts as the table of contents and the right pane is the content. How do I get the content in the left pane to stay where it is (fixed?) while the user scrolls through the content, so that it is always in view. Here is a js fiddle illustrating the problem and my code is below as ...
2019/11/14
[ "https://Stackoverflow.com/questions/58863756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3131132/" ]
You Component hierarchy seems good, I would like to add one thing to keep things together, like for steps you can create an Array inside a main component state like this ``` class Main extends React.Component{ state = { ...OTHER_STATE_PROPERTIES, activeStep: 0 | 1| 2, steps: [{ name: 'ste...
Save all form data to your states (even completed steps like current step). For validating your given data you should arrange a handleChange function for each field.
5,294,509
I am new to TFS. At my job I mapped the TFS projects to local directories, performed a get, and everything works as I expected. When I edit files on my local copy, source control automatically checks them out for editing and tracks the files with pending changes via the pending changes window. Then I just check them in...
2011/03/14
[ "https://Stackoverflow.com/questions/5294509", "https://Stackoverflow.com", "https://Stackoverflow.com/users/498624/" ]
I found one of my projects actually wasn't added to the source control at all - somehow that had been missed and so any changes to that project would not get checked out. I right-clicked on the solution node, clicked "add to source control" it warned me that some projects were already being tracked and I elected to ign...
Install 2 things: 1. **Team Explorer for VS2013** (<http://www.microsoft.com/en-us/download/details.aspx?id=40776>) 2. **Install VS TFS Power tools** (<https://visualstudiogallery.msdn.microsoft.com/f017b10c-02b4-4d6d-9845-58a06545627f>) That's it
20,090,181
I need to open some webpages using open-uri in ruby and then parse the content of those pages using Nokogori. I just did: ``` require 'open-uri' content_file = open(user_input_url) ``` This worked for: `http://www.google.co.in` and `http://google.co.in` but fails when user give inputs like `www.google.co.in` or `g...
2013/11/20
[ "https://Stackoverflow.com/questions/20090181", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1039932/" ]
Prepend the scheme if not present and then use `URI` which will check the URL validity: ``` require 'uri' url = 'www.google.com/a/b?c=d#e' url.prepend "http://" unless url.start_with?('http://', 'https://') url = URI(url) # it will raise error if the url is not valid open url ``` Unfortunately, an "object oriented"...
You need to prepend `http` to the urls, without an explicit scheme the uri could be anything, e.g. a local file. A uri is not necessarily an http url. You can check either by using the `URI` class or by using a regex: ``` user_input_url = URI.parse(user_input_url).scheme ? user_input_url : "http://#{user_inpu...
17,433,261
I have a class that implements a few buttons and counters, when I press a button I need some text in a TextView to be set to something else. It isn't anything crazy, which is why I can't understand why it doesn't work. The button onClick method that works: ``` public class Main extends Activity{ @Override pro...
2013/07/02
[ "https://Stackoverflow.com/questions/17433261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2387054/" ]
Without brackets only the next statement is affected whereas with brackets everything inside the brackets is affected. To add brackets to the loop and have it work exactly the same, just add them around the next statement: ``` function range(upto) { var result = []; for (var i = 0; i <= upto; i++) { r...
Bracket allow you to add more statement into one block. if I modify bit to show result ``` function range(upto) { var result = []; for (var i = 0; i <= upto; i++) { result[i] = i; result[i] = result[i]*2 } return result; } console.log(range(15)); ``` Result will be ``` [2,4,6,8,10,12,14,16,18,20,...
2,426,160
Currently I use a `HashMap<Class, Set<Entry>>`, which may contain several millions of short-lived and long-lived objects. (`Entry` is a wrapper class around an `Object` and an integer, which is a duplicate count). I figured: these `Object`s are all stored in the JVM's Heap. Then my question popped in my mind; instead ...
2010/03/11
[ "https://Stackoverflow.com/questions/2426160", "https://Stackoverflow.com", "https://Stackoverflow.com/users/252704/" ]
No. Basically, each object knows its class, but a class does not know all its objects - it's not necessary for the way the JRE works and would only be useless overhead. Why do you need to know all instances of those classes anyway? Maybe there's a better way to solve your actual problem.
The map contains only pointers to the objects on the heap. I do not think you can do better then that,
9,397,295
Is `(function_exists('ob_gzhandler') && ini_get('zlib.output_compression'))` enough ? I want to check if the host is serving compressed pages within one of the pages :)
2012/02/22
[ "https://Stackoverflow.com/questions/9397295", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1209030/" ]
For PHP, they'll do fine. However, if your referring to compression of pages back to clients, you'll also need to check it's enabled in apache (assuming your using apache you'll need the mod\_gzip.c OR mod\_deflate.c modules). For instance: `# httpd -l` (apache 2) Ive also seen mention of needing to implement .htacc...
you can do this programmatically from php: ``` if (count(array_intersect(['mod_deflate', 'mod_gzip'], apache_get_modules())) > 0) { echo 'compression enabled'; } ``` This is of course not super reliable, because there might be other compression modules...
56,792,880
I'm new to Python, but I have set up an python script for searching some specific Values in 2 different excel sheets printing out matches (in excel). Problem is, that our work machines are heavily locked down and without admin privileges, we can't really install anything (we can download though). Is there any version ...
2019/06/27
[ "https://Stackoverflow.com/questions/56792880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11438622/" ]
As @Angew mentioned, you have a bug in your code and he suggested a fix. The following topic is helpful to understand uninitalized values: [What happens to a declared, uninitialized variable in C? Does it have a value?](https://stackoverflow.com/questions/1597405/what-happens-to-a-declared-uninitialized-variable-in-c-d...
Here's an explanation of scope from [Tutorials Point](https://www.tutorialspoint.com/cplusplus/cpp_variable_scope.htm) (annotations in square brackets): > > A scope is a region of the program and broadly speaking there are three places, where variables can be declared − > > > 1. Inside a function or a block which i...
50,358,231
I was hoping I can get help with a problem I am having. I'm using the php get meta tags function to see if a tag exist on a list of websites, the problem occurs when ever there is a domain without HTTP. Ideally I would want to add the HTTP if it doesn't exist, and also I would need a work around if the domain has H...
2018/05/15
[ "https://Stackoverflow.com/questions/50358231", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2217947/" ]
You could use `parse_url()` to check if the element `scheme` exists or not. If not, you could add it: ``` $urls = array( 'https://www.smilesbycarroll.com/', 'https://hurstbournedentalcare.com/', 'https://www.dentalhc.com/', 'https://www.springhurstdentistry.com/', 'https://www.smilesbycarroll.com/'...
you know whats funny, I thought it was because it had http but I put error\_reporting(0); in my original code and it worked as I wanted it to haha.
1,163,248
Obviously, "Hello World" doesn't require a separated, modular front-end and back-end. But any sort of Enterprise-grade project does. Assuming some sort of spectrum between these points, at which stage should an application be (conceptually, or at a design level) multi-layered? When a database, or some external resourc...
2009/07/22
[ "https://Stackoverflow.com/questions/1163248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/92995/" ]
> > when a database, or some external resource is introduced. > > > but also: > > always (except for the most trivial of apps) separate AT LEAST presentation tier and application tier > > > see: > > <http://en.wikipedia.org/wiki/Multitier_architecture> > > >
Thinking of it in terms of layers is a little limiting. It's what you see in whitepapers about a product, but it's not how products really work. They have "boxes" that depend on each other in various ways, and you can make it look like they fit into layers but you can do this in several different configurations, depend...
208,140
I am trying to delete all the files with a space in their names. I am using following command. But it is giving me an error Command : `ls | egrep '. ' | xargs rm` Here if I am using only `ls | egrep '. '` command it is giving me all the file name with spaces in the filenames. But when I am trying to pass the output t...
2015/06/07
[ "https://unix.stackexchange.com/questions/208140", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/118444/" ]
From `man xargs` > > xargs reads items from the standard input, **delimited by blanks** (which > can be protected with double or single quotes or a backslash) or > newlines, and executes the command (default is /bin/echo) one or more > times with any initial-arguments followed by items read from standard > input....
You can use: ``` find . -name '* *' -delete ```
67,391,237
Basically, I have : * An array giving indexes "I", e.g. (1, 2), * And a list of the same length giving the corresponding number of repetitions "N", e.g. [1, 3] And I want to create an array containing the indexes I repeated N times, i.e. (1, 2, 2, 2) here, where 1 is repeated one time and 2 is repeated 3 times. The ...
2021/05/04
[ "https://Stackoverflow.com/questions/67391237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15835738/" ]
Not sure about prettier, but you could solve it completely with list comprehension: ``` [x for i,l in zip(list_index, list_no_repetition) for x in [i]*l] ```
Hello this is the alternative that I propose: ``` import numpy as np list_index = np.arange(2) list_no_repetition = [1, 3] result = np.array([]) for i in range(len(list_index)): tempA=np.empty(list_no_repetition[i]) tempA.fill(list_index[i]) result = np.concatenate([result, tempA]) result ```
4,562,678
In C++, I have a base class A, a sub class B. Both have the virtual method Visit. I would like to redefine 'Visit' in B, but B need to access the 'Visit' function of each A (and all subclass to). I have something like that, but it tell me that B cannot access the protected member of A! But B is a A too :-P So, what c...
2010/12/30
[ "https://Stackoverflow.com/questions/4562678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/346113/" ]
You may access a protected member using your own object but you may not access a protected member using an alternative object unless it is also of your class (not simply the base class). There is a workaround, just as there is a workaround with friendship not being inherited. In any case with this example: ``` class...
A virtual function's essence is exactly which you are escaping from. Here ``` foreach (A * in the Childs) { a-> Visit (...); } ``` all `a` will call it's corresponding Visit function. It is unnecessary to publicly derive from A, you should use protected. In `A` the Visit function is not virtual, and make a prote...
1,410,511
Background: I've got a new eclipse installation and have installed the m2eclipse plugin. After startup m2eclipse generates the message: > > Eclipse is running in a JRE, but a JDK > is required > > > Following the instructions from [here](http://blog.dawouds.com/2008/11/eclipse-is-running-in-jre-but-jdk-is.html) ...
2009/09/11
[ "https://Stackoverflow.com/questions/1410511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/111313/" ]
My issue was that -vm "C:\Program Files\Java\jdk1.7.0\_67\jre\bin\javaw.exe" the path was in quotes, when i removed the quotes it worked: -vm C:\Program Files\Java\jdk1.7.0\_67\jre\bin\javaw.exe
I solve this question. When you create a Maven Project in Eclipse maybe the text file encoding in this project's properties and the `project.build.sourceEncoding` in the `pom.xml` was not the same. When you build this project it would report "Unable to locate the Javac Compiler in:..." error, too. For example, my tex...
27,706,201
i want to equal two table column value(dynamic) in where clause, my code is like this ``` array('table1.column1' => 'table2.column2') ``` it shows the sql query like this ``` where `table1`.`column1` = 'table2.column2' ``` but i want to like this: ``` where `table1`.`column1` = `table2`.`column2` ``` i just w...
2014/12/30
[ "https://Stackoverflow.com/questions/27706201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557878/" ]
When I have to draw text, I usually need to center the text in a bounding rectangle. ``` /** * This method centers a <code>String</code> in * a bounding <code>Rectangle</code>. * @param g - The <code>Graphics</code> instance. * @param r - The bounding <code>Rectangle</code>. * @param s - The <code>String</code> ...
I did create a function to keep the text in center of the image ``` private static void setTextCenter(Graphics2D graphics2DImage, String string, BufferedImage bgImage) { int stringWidthLength = (int) graphics2DImage.getFontMetrics().getStringBounds(string, gr...
24,891,476
This is a function for building a binary tree, where the parameters are a list of integers(list) and an empty vector for the tree to be written to(tree). I'm sure it is a very simple error, but for some reason I am overlooking what is causing this to loop. Thanks for the help. ``` void buildTree(vector<int> list, vect...
2014/07/22
[ "https://Stackoverflow.com/questions/24891476", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3461666/" ]
The problem is that you are comparing the value (i.e. `list[i]`) to an *index* (i.e. `source`) rather than using `tree[source]`: ``` else if(list[i] < tree[source]) { source = 2*source; } else if(list[i] > tree[source]) { source = 2*source+1; } ``` In addition, your program does not specify what happens when...
Some problems with your code: -you are receiving the vectors by value, in all the calls to the function the vectors would be copied, and for this, outside the function you could not access to the written `vector tree` and be paying a performance hit. -i am assuming you are using an empty tree (if not erase lines `i...
22,244,182
I have a `Java Application`. I use `Netbeans 7.4` IDE. I want to host some `web service methods` within this application so that other clients can get data provided by this application using web service. I don't want to host this web servis on any web server, i want to host this only within the application itself `l...
2014/03/07
[ "https://Stackoverflow.com/questions/22244182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/739228/" ]
The answer accourding to my needs is already [here](https://stackoverflow.com/questions/5595028/add-a-web-service-to-a-already-available-java-project) I see that I just need to add new java class and add xml annoitions like @WebService and @WebMethod to make the class a web service. Then i just need to add following l...
Well it depends on what you mean by "self-hosting". The easiest way to do this is to use an embedded Jetty server in your application. This is typically frowned upon though as it ties up one port for each web service, and if you're going to have more than a handful, it's quickly going to become difficult to manage, as ...
353,553
What would be the simplest way to do this?
2013/04/07
[ "https://math.stackexchange.com/questions/353553", "https://math.stackexchange.com", "https://math.stackexchange.com/users/68740/" ]
First, let $z:=x-16$, then this is the same as $\sqrt{16+z}$ at $z=0$. Use the binomial series: $$(1+x)^\alpha=\sum\_{n\ge 0}\binom\alpha n x^n$$ Now we have $$(16+z)^{1/2}=4\cdot\left(1+\frac z{16}\right)^{1/2}=\\ =4\cdot\sum\_{n\ge 0} \binom{1/2}n\frac{z^n}{16^n}\,.$$
note that $f(x)=2^0x^{1/2}$, $f'(x)=-2^1 x^{-1/2}$, $f''(x)=\frac{2^2}{3} x^{-3/2}$,$f'''(x)=-\frac{2^3}{15}x^{-5/2}$ $\cdots$ Then just plug these into the normal formula for a taylor series expansion ![formla for taylor series](https://i.stack.imgur.com/8vtoU.png) here your $a=16$. Then see what patterns you can f...
59,650,139
looking for workflow solution. We need something like ad-hoc sharing workflow <https://docs.bit.dev/docs/workflows/projects> with one addition - before the component publishing could happen only after the code review. let me try to describe the short scenario: * there is a repo with the shared components * there are s...
2020/01/08
[ "https://Stackoverflow.com/questions/59650139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/390161/" ]
While a PR-like feature is still not available in Bit, you can use Git's PR workflow to set up a code review process for components with some automation. > > **Note** this flow can work regardless of the specific workflow your team implements. In this answer, I'll focus on the ad-hock flow, as your team uses. > > >...
as Itay says, you can use the [GitHub integration on bit.dev](https://blog.bitsrc.io/announcing-auto-github-prs-for-component-version-bumping-74e7768bcd8a). But if you want, I create demos projects that show how to use GitHub or Azure CI to integrate the project with Bit, and export new components when code our push...
20,947,359
Chrome allows us to disable the same origin policy, so we can test cross origin requests. I would like to know if there any possibility to do the same thing in IE
2014/01/06
[ "https://Stackoverflow.com/questions/20947359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1014186/" ]
On my computer I am using internet explorer 11 version I also have the same problem. I have done following steps to solve my problem. **Step 1** : Allow Cross domain Access > > > ``` > (Press) Alt -> Tools -> Internet Options -> Security (Tab) -> > Custom Level -> Miscellaneous -> Access data sources across dom...
As decribed at <https://www.webdavsystem.com/ajax/programming/cross_origin_requests/> In FireFox, Safari, Chrome, Edge and IE 10+: To enable cross-origin requests in FireFox, Safari, Chrome and IE 10 and later your server must attach the following headers to all responses: ``` Access-Control-Allow-Origin: http://web...
31,517,228
I am trying to write a program in VBA at the moment which is to be run in Excel. I am quite stuck right now because I am not very familiar with VBA and doing a search doesn't come up with my specific problem. I have a column in Excel which has 20,000+ hostnames for PC's on our network. What I need to do is be able to...
2015/07/20
[ "https://Stackoverflow.com/questions/31517228", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3795599/" ]
Here's a method that allows you to hide cells from the HTML/PDF output by editing the cell metadata only. Versions I'm using: `$ jupyter notebook --version` 4.1.0 `$ jupyter nbconvert --version` 4.2.0 1. Download the ipython notebook extension templates by following install instructions on Github: pip install <ht...
In case anyone finds excluding all code cells helpful (which is not what is asked here), you can add this flag `nbconvert --TemplateExporter.exclude_code_cell=True`
17,467,331
Big thanks in advance. I want to set up a phantomjs Highcharts export server. It should accept json options as input and output jpeg image files. Here is what I do: 1. I download server side js code from this repo: <https://github.com/highslide-software/highcharts.com/tree/master/exporting-server/phantomjs> 2. I dow...
2013/07/04
[ "https://Stackoverflow.com/questions/17467331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1633867/" ]
I got that same error when I tried to send in a JSON string that was longer than what my server hosting the highcharts exporter WAR file would accept. Check your message length parameter in your server. Make sure it is long enough to hold the request sent. Now, since you do not mention what export server you are using ...
This is because the Phantoms HTTP server which is started by ``` phantomjs highcharts-convert.js -host ... -port ... ``` expects the parameters send in JSON format. Please read, the [documentation](http://docs.highcharts.com/#render-charts-on-the-server), parapgraph *'start as a webserver'* Out of curiosity... wha...
4,627,697
I'm putting together a universal app and I have the icons in my project, but I keep getting a warning from the compiler in regards to Icon.png. I followed the instructions at <http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html> but still get the above error. I've tried doing the following: Putting the ico...
2011/01/07
[ "https://Stackoverflow.com/questions/4627697", "https://Stackoverflow.com", "https://Stackoverflow.com/users/272502/" ]
I had the exact same problem. When you build and archive, click show in finder, show the contents of the package of the archive and check if all the files are showing up. For me, the archive was missing Icon.png file for some reason. The archive utility has a bug. I moved the icons out of the resource folder, cleaned a...
This solution worked for me: <http://vawlog.vawidea.com/en/2010/11/icon-specified-in-the-infoplist-not-found-under-the-top-level-app-wrapper-iconpng/>
744,089
So currently my desktop looks like this: [![panel isn't working](https://i.stack.imgur.com/GMHn8.png)](https://i.stack.imgur.com/GMHn8.png) If I use `Ctrl` + `Alt` + `F2` then login and use startx things seem to work perfectly fine but obviously I don't want to have to do this everytime. If I have lightdm running and...
2016/03/10
[ "https://askubuntu.com/questions/744089", "https://askubuntu.com", "https://askubuntu.com/users/496443/" ]
In File Manager go to: ``` ~/.cache/sessions/. ``` A couple of `xfce4*` files are there, delete them, reboot.
So, it looks like a video driver issue. But before we troubleshoot that have you attempted to reinstall unity? **Reinstall unity** Just to make sure no processes are running we should do the following: `ALT`+`PrtSc`+`E`. Now go towards the `CTR`+`ALT`+`F2` you used and try the following: `sudo apt-get update && su...
17,968,565
I am creating a dynamic form using following code, ``` function createForm() { var f = document.createElement("form"); f.setAttribute('method',"post"); f.setAttribute('action',"./Upload"); f.setAttribute('name',"initiateForm"); f.acceptCharset="UTF-8"; var name = document.createElement("input...
2013/07/31
[ "https://Stackoverflow.com/questions/17968565", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2261259/" ]
You need to append the new created form to the document, because it was not there on page load. Try this: ``` function createForm() { var f = document.createElement("form"); f.setAttribute('method',"post"); f.setAttribute('action',"./Upload"); f.setAttribute('name',"initiateForm"); f.acceptCharse...
I had similar error just resolved the same. If you have just used `<form></form>` tag and trying to submit then it gives error in older version of mozill while it works in newer version and other browsers. The form tag should be under `<html><body>` tag. e.g. `<html><body><form></form></body></html>`
4,191,324
How do you make sure that you always have a releasable build? I'm on a Scrum team that is running into the following problem: At the end of the Sprint, the team presents its finished user stories to the Product Owner. The PO will typically accept several user stories but reject one or two. At this point, the team no l...
2010/11/16
[ "https://Stackoverflow.com/questions/4191324", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128807/" ]
As you suggest, one way to approach this is to consider rejection from the outset. Requiring that every user story can be enabled or disabled through a configuration directive guarantees a releasable build without the rejected stories. If you are really serious about excluding the rejected stories, a configuration di...
> > How do you make sure that you always have a releasable build? > > > I think there are 2 aspects to your question. One is version control plus release management strategies, and the other is how to handle 'Undone' work. As far as the version control part goes, your solution is simpler than you think. With svn ...
6,088,735
It seems that when I run the following code: ``` #include <stdio.h> #include <stdlib.h> int main(int argc, char* argv) { int i=0; setvbuf(stdout, NULL, _IOLBF,0); while (1) printf("%d ",i++); return 0; } ``` it prints in chunks of 1024 chars, no matter the **size** I define for setvbu...
2011/05/22
[ "https://Stackoverflow.com/questions/6088735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/359644/" ]
I don't know how you identified `1024` but it's probably `BUFSIZ`. `BUFSIZ` is defined in `stdio.h`. > > If buf is NULL, then the stdio library > automatically allocates a buffer for > use with stream (unless we select > unbuffered I/O). > > > **EDIT** Here's something `glibc` says: > > Macro: int BUFSIZ > ...
The size probably doesn't have much effect for a NULL buf pointer. However, you are still requesting buffered output with `_IOLBF` Try `_IONBF` instead. <http://en.wikipedia.org/wiki/Setvbuf>
69,663,301
I am quite new to the docker topics and I have a question of connecting container services with traditional ones. Currently I am thinking of replacing an traditional grafana installation (directly on a linux server) with a grafana docker container. In grafana I have to connect to different data sources like a mysql i...
2021/10/21
[ "https://Stackoverflow.com/questions/69663301", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17211682/" ]
I fixed mine by moving the project directory to the same drive. My project was stored in E:\ so, I moved it to C:. My answer is almost the same as rvr93's answer but I did not add anything to the environment variables.
Create a directory in the same drive as your project and add [PUB\_CACHE](https://dart.dev/tools/pub/environment-variables) environment variable. Run `flutter pub get`. This worked for me.
9,190,792
Suppose portlet X is deployed to Liferay and has a friendly URL mapped. Suppose a user enters the Liferay Portal via a the mapped URL but the portlet is not present in the portal - it's deployed but not added to the page. My problem is that when the user uses the mapped URL nothing happens - the portal gives no visual...
2012/02/08
[ "https://Stackoverflow.com/questions/9190792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1000918/" ]
AFAIK, there is no *natual* way to make that happen. A portlet **need not** always be installed on a page. So, the behaviour is quite normal. One rather *hacky* solution I could think of: 1. Get hold of the `ThemeDisplay` object in a JSP using `<liferay-theme:defineObjects />` which would expose the implicit object `...
It would be better if we try this, ``` ThemeDisplay themeDisplay = request.getAttribute(WebKeys.THEME_DISPLAY); Layout layout = LayoutLocalServiceUtil.getLayout(themeDisplay.getLayout().getPlid()); LayoutTypePortlet layoutTypePortlet = (LayoutTypePortlet)layout.getLayoutType(); List allPortletIds = layoutTypePortlet...
10,292,001
I have a container that has a % width and height, so it scales depending on external factors. I would like the font inside the container to be a constant size relative to the size of containers. Is there any good way to do this using CSS? The `font-size: x%` would only scale the font according to the original font size...
2012/04/24
[ "https://Stackoverflow.com/questions/10292001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60893/" ]
You may be able to do this with CSS3 using calculations, however it would most likely be safer to use JavaScript. Here is an example: <http://jsfiddle.net/8TrTU/> Using JS you can change the height of the text, then simply bind this same calculation to a resize event, during resize so it scales while the user is mak...
It **cannot** be accomplished with css [font-size](https://developer.mozilla.org/en/CSS/font-size) Assuming that "external factors" you are referring to could be picked up by media queries, you could use them - adjustments will likely have to be limited to a set of predefined sizes.
45,612
Cancer works by making cells split and reproduce at an accelerated rate, slowly and painfully killing the afflicted. Its true weapon lies in its ability to surpass the immunity system. As far as I can tell, no matter how the cells of an alien work, there is no way to make them immune to this. So I must ask, is the ba...
2016/06/28
[ "https://worldbuilding.stackexchange.com/questions/45612", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/11049/" ]
Cancer is typically caused by improper [DNA repair](https://en.wikipedia.org/wiki/DNA_repair). The gist of it is that cellular DNA becomes damaged in such a way that a repair to the DNA of the cell fails to restore the original DNA, and also corrupts it in such a way that other cellular mechanics to encourage programme...
Adding to the answers of @celtschk and @Anne: They both say that cancer is an inevitable consequence of having a multi-cellular organism. One can imagine that other species have more cancer or less cancer than us, but they *will* have cancer. Of course, as medical science gets better, we get better at detecting cance...
1,741,820
What are the differences between the assignment operators `=` and `<-` in R? I know that operators are slightly different, as this example shows ``` x <- y <- 5 x = y = 5 x = y <- 5 x <- y = 5 # Error in (x <- y) = 5 : could not find function "<-<-" ``` But is this the only difference?
2009/11/16
[ "https://Stackoverflow.com/questions/1741820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/203420/" ]
Google's R style guide simplifies the issue by prohibiting the "=" for assignment. Not a bad choice. <https://google.github.io/styleguide/Rguide.xml> The R manual goes into nice detail on all 5 assignment operators. <http://stat.ethz.ch/R-manual/R-patched/library/base/html/assignOps.html>
This may also add to understanding of the difference between those two operators: ``` df <- data.frame( a = rnorm(10), b <- rnorm(10) ) ``` For the first element R has assigned values and proper name, while the name of the second element looks a bit strange. ``` str(df) # 'data.frame': 10 obs. of 2 var...
22,008,822
I encountered a strange behavior of mongo and I would like to clarify it a bit... My request is simple as that: I would like to get a size of single document in collection. I found two possible solutions: * Object.bsonsize - some javascript method that should return a size in bytes * db.collection.stats() - where...
2014/02/25
[ "https://Stackoverflow.com/questions/22008822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1949763/" ]
**MAXIMUM DOCUMENT SIZE 16 MiB ([source](https://docs.mongodb.com/manual/core/document/#document-size-limit))** --- **If you have version >=4.4 (`$bsonSize` [source](https://docs.mongodb.com/upcoming/reference/operator/aggregation/bsonSize/))** ``` db.users.aggregate([ { "$project": { "size_bytes": { "$b...
Method `Object.bsonsize()` is available only in legacy `mongo` shell. In new `mongosh` you have to use package [bson](https://github.com/mongodb/js-bson) or [mongocompat snippets](https://github.com/mongodb-labs/mongosh-snippets/tree/main/snippets/mongocompat) ``` const BSON = require("bson"); BSON.calculateObjectSiz...
43,908,131
Can somebody tell me what I am doing wrong please? can't seem to get the expected output, i.e. ignore whitespace and only upper/lowercase a-z characters regardless of the number of whitespace characters my code: ``` var sentence = "dancing sentence"; var charSentence = sentence.ToCharArray(); var rs = ""; for (var i ...
2017/05/11
[ "https://Stackoverflow.com/questions/43908131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3849777/" ]
Linq version ``` var sentence = "dancing sentence"; int i = 0; string result = string.Concat(sentence.Select(x => { i += x == ' ' ? 0 : 1; return i % 2 != 0 ? char.ToUpper(x) : char.ToLower(x); })); ``` **Sidenote:** please replace `charSentence[i].ToString().ToUpper()` with `char.ToUpper(charSentence[i])`
Thanks @Dmitry Bychenko. Best Approach. But i thought as per the OP's (might be a fresher...) mindset, what could be the solution. Here i have the code as another solution. Lengthy code. I myself don't like but still representing ``` class Program { static void Main(string[] args) { var sentence = "da...
1,285,690
I am little confused when I set this polynomial to zero what does the result mean? Does the parabola have a minimum point at $4$?
2015/05/17
[ "https://math.stackexchange.com/questions/1285690", "https://math.stackexchange.com", "https://math.stackexchange.com/users/184004/" ]
You have \begin{align} y=\left(x-4\right)^2.\tag{1} \end{align} What we could also do is write it as \begin{align} y&=\left(x-4\right)\left(x-4\right)\\ &=x^2-4x-4x+16\\ &=x^2-8x+16.\tag{2} \end{align} Now, we'll stop and take a look at $\left(2\right)$ for a bit. Notice I have set it $=$ to another variable $y$. I've ...
What it means is that it just barely touches the x-axis. And as that is the only real root the equation can have it means it doesn't move past or through the x-axis and that it therefore is the minimum point of the parabola.
58,679,774
I'm using **Retrofit 2 and OkHttp3** to data from server and I get error while using **Min\_SDK 17** and my device's API is **17** also I tried this answer :[How to fix Expected Android API level 21+ but was 19 in Android](https://stackoverflow.com/questions/56818660/how-to-fix-expected-android-api-level-21-but-was-1...
2019/11/03
[ "https://Stackoverflow.com/questions/58679774", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11567530/" ]
The problem is that you have added `OkHttp` dependency twice. In your `build.gradle` you have: ``` dependencies { ... implementation "com.squareup.okhttp3:okhttp:3.11.0" ... implementation "com.squareup.okhttp3:okhttp:3.13.1" } ``` Starting with version 3.13.0 they removed support for Android < 5. ...
In your gradle file you have: `implementation "com.squareup.okhttp3:okhttp:3.11.0"` The docs say: <https://square.github.io/okhttp/> > > OkHttp works on Android 5.0+ (API level 21+) and on Java 8+. > > > The OkHttp 3.12.x branch supports Android 2.3+ (API level 9+) and Java 7+. These platforms lack support fo...
41,652,029
There are many questions on stackoverflow asking about the error from symfony forms which states that the form's **view data** must an instance of the `data_class` option. e.g: [this one](https://stackoverflow.com/questions/29187899/the-forms-view-data-is-expected-to-be-an-instance-of-class-my-but-is-an) Now the who...
2017/01/14
[ "https://Stackoverflow.com/questions/41652029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2268997/" ]
The question you mentioned is about having a **SINGLE** entity expected, but **ARRAY** of entities actual. So expectations about **VIEW** entity transformation result were failed. That means that **VIEW** data does not **represent** the **ENTITY** being instance of **data\_class**. So you either can perform further tr...
I think you're not missing anything here. If you check the source code of `Form::getData()` you'll see `return $this->modelData;` there. So basically you're right. It is required that 'model data' is instance of 'data\_class'. Transformers are responsible to transform 'model data' to 'view data' and back. For exampl...
7,237,789
I want to show a car's speeds on iPhone in real time. What can I use? Wouldn't using gps to calculate the car's speed take many seconds?
2011/08/30
[ "https://Stackoverflow.com/questions/7237789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917725/" ]
``` (db.table.field1==x)&(db.table.field2==y) ``` See the book section on [logical operators](http://web2py.com/book/default/chapter/06#Logical-Operators).
For a more advanced version, you can append a query to a list and use python's reduce function. ``` queries=[] if arg1 == "x": queries.append(db.table.field == x) if arg2 == "y": queries.append(db.table.otherfield == y) # many conditions here.... query = reduce(lambda a,b:(a&b),queries) db(query).select() ```
33,998,688
I'm creating a WebView based Android app that enables the user to login onto a mobile operator. When I run the app the WebView opens the website but I get a message that the WebView doesn't allow cookies. I've tried various codes that I found here but none of them worked. Can anyone help me? Here is the code I'm using:...
2015/11/30
[ "https://Stackoverflow.com/questions/33998688", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1892622/" ]
You have to enable javascript and then getting instance of cookie manager accept cookie By using javascriptenable cookie gets stored > > webView.getSettings().setJavaScriptEnabled(true); > CookieManager.getInstance().setAcceptCookie(true); > > >
@Darko. `CookieManager.getInstance()` is the CookieManager instance for your entire application. Hence, you enable or disable cookies for all the webviews in your application. Normally it should work if your webview is already initialized: <http://developer.android.com/reference/android/webkit/CookieManager.html#getI...
63,951,583
I tried to implement the following line of code in python script for a telegram bot building using telebot. ``` @bot.message_handler(func=lambda msg:True if msg.text.startswith('/test')) def test_start(message): msg=bot.send_message(message.chat.id,'This feature is under developement') ``` Above code gives me a ...
2020/09/18
[ "https://Stackoverflow.com/questions/63951583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12856596/" ]
Because ternary operator has a specific syntax, that has to be followed: ``` <value if True> if <condition> else <value if False> ``` What you did in the first sample is: ``` <value if True> if <condition> ``` Also you don't have to do it like you did ``` True if msg.text.startswith('/test') else False ``` `.s...
I think you are looking for something like that: ``` @bot.message_handler(func=lambda msg: True == msg.text.startswith("/test")) def starts_with_test(message): args = message.text.split(' '); for arg in args: bot.send_message(message.chat.id, "arg = " + arg) ``` It will handle only commands that star...
53,822,430
Im searching for an easy way to find which percentage of the data is within certain intervals using python. Consider an array X of float values. I'd like to do something similar to quantiles: ``` X.quantile(np.linspace(0,1,11)) ``` But instead, I'd like to know which percentage of values are within -10 and 10, for ...
2018/12/17
[ "https://Stackoverflow.com/questions/53822430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2926257/" ]
A simple solution is to use `np.histogram`: ``` import numpy as np X = np.arange(20) values = [5, 13] # these are your a and b freq = np.histogram(X, bins=[-np.inf] + values + [np.inf])[0]/X.size print(freq) >> array([0.25, 0.4 , 0.35]) ```
***Setup*** ``` a = np.linspace(-15,15,1000) ``` --- No builtin method exists, but quite simple to define your own using `np.count_nonzero` and `size`. In general: ``` c = (a > -10) & (a < 10) np.count_nonzero(c) / a.size ``` You can wrap this in a function for convenience and to allow for cases where you want c...
88,665
Witness: ``` $ ps f PID TTY STAT TIME COMMAND 31509 pts/3 Ss 0:01 -bash 27266 pts/3 S+ 0:00 \_ mysql -uroot -p 25210 pts/10 Ss+ 0:00 /bin/bash 24444 pts/4 Ss 0:00 -bash 29111 pts/4 S+ 0:00 \_ tmux attach 4833 pts/5 Ss+ 0:00 -bash 9046 pts/6 Ss 0:00 -bash 17749...
2013/08/29
[ "https://unix.stackexchange.com/questions/88665", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/9760/" ]
`ps` does not hide the password. Applications like mysql overwrite arguments list that they got. Please note, that there is a small time frame (possible extendible by high system load), where the arguments are visible to other applications until they are overwritten. [Hiding the process](https://unix.stackexchange.com/...
The **mysql** program replaces the password from the command line with `x` in [this line of code](http://bazaar.launchpad.net/~mysql/mysql-server/5.5/view/head:/client/mysql.cc#L1734): ``` while (*argument) *argument++= 'x'; // Destroy argument ```
2,602,133
I want to replace the first context of > > web/style/clients.html > > > with the java String.replaceFirst method so I can get: > > ${pageContext.request.contextPath}/style/clients.html > > > I tried ``` String test = "web/style/clients.html".replaceFirst("^.*?/", "hello/"); ``` And this give me: > ...
2010/04/08
[ "https://Stackoverflow.com/questions/2602133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/128237/" ]
My hunch is that it is blowing up as $ is a special character. From [the documentation](http://java.sun.com/javase/6/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)) > > Note that backslashes () and dollar > signs ($) in the replacement string > may cause the results to be different > than if it...
`String test = "web/style/clients.html".replaceFirst("^.*?/", "\\${pageContext.request.contextPath}/");` should do the trick. $ is used for backreferencing in regexes
10,158,495
I have something here: ``` String b = "Test"; String a[] = b; ``` How to solve this problem? Why is wrong? I want to enter values from another string. But how?
2012/04/15
[ "https://Stackoverflow.com/questions/10158495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1333938/" ]
Change your code to ``` | v UILabel *label = (UILabel *)[self.view viewWithTag:71]; ``` `UIViewController` does not have `viewWithTag:`, `UIView` does
viewwithTag is a method on UIView not on UIViewController. You'll probably have to call it like this: ``` UILabel *label = (UILabel *)[self.view viewWithTag:71]; ```
56,154,654
I'm trying to evaluate an ANN. I get the accuracies if I use `n_jobs = 1`, however, when I use `n_jobs = - 1` I get the following error. `BrokenProcessPool: A task has failed to un-serialize. Please ensure that the arguments of the function are all picklable.` I have tried using other numbers but it only works if I u...
2019/05/15
[ "https://Stackoverflow.com/questions/56154654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11493381/" ]
This always happens when using multiprocessing in an iPython console in Spyder. A workaround is to run the script from the command line instead.
If you use Spyder IDE simply switch to external terminal in settings (run>execute in an external system terminal).
13,252,186
I'm trying to summarize the difference between an "old" and "new" state of the codebase. * I could just do "git log", but sadly the commit messages aren't always sufficient. * I could do "git diff", but I'd like to see some explanations to the differences I'm seeing, or at least commit hashes to save for later * I cou...
2012/11/06
[ "https://Stackoverflow.com/questions/13252186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/278042/" ]
You could write a small script which does something like ``` git blame before > before git blame after > after diff -u before after ``` :) See `man 1 git` re: `GIT_EXTERNAL_DIFF`.
I worked on a tool (python-based) to do exactly this... even counting for deleted lines doing something *close* to a reverse annotate (a reverse annotate is not exactly what is required because it will show the last revision where a line was *present*, it won't actually point to the revision where the line was deleted ...
60,558,610
Is there a way to know when all the widgets are built in Flutter including FutureBuilder widgets. `WidgetsBinding.instance.addPostFrameCallback` is called when build is done, but before FutureBuilder is built. I have a List inside a FutureBuilder whose data is fetched from the server. There is another Text widget outs...
2020/03/06
[ "https://Stackoverflow.com/questions/60558610", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12972851/" ]
Just use `WidgetsBinding.instance.addPostFrameCallback` in your futurebuilder when has data and connection is done ``` FutureBuilder<List<Object>>( future: _listFuture, builder: (context, AsyncSnapshot snapshot) { if(snapshot.hasData && snapshot.connectionState == ConnectionState.done){ WidgetsB...
There are many ways. If you intend to do this without using state management, you could use ValueNotifier. ``` ValueNotifier<int> total = ValueNotifier(0); FutureBuilder()..future.then((snapshot) { total.value = snapshot.total; }); ValueListenableBuilder( valueListenable...
43,194,500
I want give some style to each row of the following UI. It shows simply a list of songs searched in my app but all the rows shown in a the same page without any kind of separation or a kind of line between each row. My idea is to differentiate each song or each row. If there is a nice style or Theme that separate each ...
2017/04/03
[ "https://Stackoverflow.com/questions/43194500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I would advise you tu use a [listvew](/questions/tagged/listvew "show questions tagged 'listvew'") not only the design would be better but, as you said, you want to show a LIST of songs. You can still add images to the listview and add automatically a clicklistener to each of the items
Create List dynamically ----------------------- You can use `RecyclerView` to achieve this (It's better than `ListView`, as it reuse the cells while scrolling and other improvements over `ListView`). The easy way to use it, is using android studio to create a Fragment with dummy data and you need then to change the d...
36,108,377
I want to count the number of times a word is being repeated in the review string I am reading the csv file and storing it in a python dataframe using the below line ``` reviews = pd.read_csv("amazon_baby.csv") ``` The code in the below lines work when I apply it to a single review. ``` print reviews["review"][1]...
2016/03/19
[ "https://Stackoverflow.com/questions/36108377", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2861976/" ]
You're trying to split the entire review column of the data frame (which is the Series mentioned in the error message). What you want to do is apply a function to each row of the data frame, which you can do by calling [apply](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.apply.html) on the dat...
pandas 0.20.3 has **pandas.Series.str.split()** which acts on every string of the series and does the split. So you can simply split and then count the number of splits made ``` len(reviews['review'].str.split('disappointed')) - 1 ``` [pandas.Series.str.split](https://pandas.pydata.org/pandas-docs/stable/generated/p...
62,809
Imagine a scenario where a country around the size of New Zealand (in GDP, population, military strength and other areas) decides that it wants to take control of or at least destroy a much larger country (think Russia, USA or China). The following rules apply: * Neither country can call on other countries for help *...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62809", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29989/" ]
How about trickery and guile? A clever, ruthless, well-resourced small country might pull this off by tricking the larger country into welcoming (even begging) the smaller country to come in and help them survive the horrible plague-X, when no other country can/will. Plague-X was, of course, artificially created/weap...
What is the nationality of the people in the big country? If there is a huge population from that small country it could be that the big country fails to mobilize because it needs to be paranoid about its own citizens and the guerrilla warfare has already begun. The small country can have naval or aerial overpower. If...
14,825,896
Can anybody knows, How to Change Combobox Background Color while Clicked(ComboBox is Open) in WPF?
2013/02/12
[ "https://Stackoverflow.com/questions/14825896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2063564/" ]
Here's a slightly naive approach: ``` <ComboBox ItemsSource="{x:Static Fonts.SystemFontFamilies}" Width="100" > <ComboBox.Style> <Style TargetType="ComboBox"> <Setter Property="Background" Value="Green" /> <Style.Triggers> <Trigger Property="IsDropDownOpen" Value="True"> <Sett...
Okay, to answer your question for code behind: Add Items to your Combo box: ``` foreach (String tag in tags) { ComboBoxItem item = new ComboBoxItem(); item.Content = tag; cbTags.Items.Add(item); } ``` Then you can modify the items background color: ``` ((ComboBox)o).Background = GetBrushByRGB(r, g, b);...
177,292
I get the category by calling the method from the repository: ``` $category = $this->_categoryRepository->get($id); ``` But I have multiple Store views, one for each language. I saw that the get method takes the store ID as second parameter. The problem is I only have the store view code. How can I get the category ...
2017/06/02
[ "https://magento.stackexchange.com/questions/177292", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/42667/" ]
You need to use Magento 2's dependency injection system. It means in your block class in \_\_construct() method, inject Magento\Store\Model\StoreManagerInterface class as an object. Then you'll be able to get store view id. You need to do something like the following in your block class: ``` protected $storeManager; ...
Please try this code- ``` $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); $storeid = $storeManager->getStore()->getStoreId(); $storecode = $storeManager->getStore()->getCode(); ```
9,718,116
I'd like some help improving the efficiency of my circular buffer code. I had a look around stackoverflow and found that (nearly) all of the topics on circular buffers are about the uses of such a buffer or the basic implementation of a circular buffer. I really need information about how to make it super efficient. ...
2012/03/15
[ "https://Stackoverflow.com/questions/9718116", "https://Stackoverflow.com", "https://Stackoverflow.com/users/989108/" ]
As "Oli Charlesworth" suggested - you'd be able to simplify things if your buffer size is a power of 2. I'd like to write the read/write function bodies, so that the intent is more clear. ``` #define BUFF_SIZE (4U) #define BUFF_SIZE_MASK (BUFF_SIZE-1U) struct buffer { float buff[BUFF_SIZE]; unsigned writeInde...
If you can make your buffer size a power-of-2, then the check against zero can be replaced with unconditional bit-masking. On most processors, this should be faster.
218,861
I already have 6 workflows running in one of my Document Library. If I am adding a new Workflow, it is throwing error as - "The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator". I have gone through many articles on this. All ...
2017/06/21
[ "https://sharepoint.stackexchange.com/questions/218861", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/67552/" ]
We have to consider the `Created By` and `Modified By` columns also as lookup columns. Then the total will be 8 in your case and reaches maximum limit.
Remember that you are hitting the **list view** threshold, an actual SharePoint list can hold a lot of columns. But it is weird that you hit limit at 8 columns, as Microsoft states that 12 is the default in Office 365. Sounds like they either lowered it, or you might want to give them a call Do you really need to sh...
68,402,612
I am trying to import a CSV file to a new table in MySql. The file has 1 million rows but MySql is only importing 847 rows. 1. I tried saving the CSV file and importing various formats, utf-8, windows-1205, etc. 2. The CSV file has an INDEX column with sequential numbers that can be used as a primary key. 3. There are...
2021/07/16
[ "https://Stackoverflow.com/questions/68402612", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6108740/" ]
UPDATE: I tried importing with MSSQL (Using SSMS) and that not only gave me an error but told me what the problem was! I wasn't allocating enough space for the char fields as some values had long strings of text. All I did in SSMS was change it to VARCHAR(max) and SSMS imported all million rows. This might have been a...
[![enter image description here](https://i.stack.imgur.com/2sxFa.jpg)](https://i.stack.imgur.com/2sxFa.jpg) Do not use command line, it need set up environment parameter to allow you import from local csv file. Instead use import wizard is much easier for me. [![enter image description here](https://i.stack.imgur.com...
16,801,396
Basically, when should I use Emacs Lisp's `function` procedure? I haven't found any examples in which there's a difference in behavior if you pass functions as arguments `'like-this` or `#'like-this`. In fact, if I evaluate `(eq 'goto-char #'goto-char)` it returns `t`. The Emacs Lisp code that I've come across *rarely...
2013/05/28
[ "https://Stackoverflow.com/questions/16801396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/600510/" ]
`function` (aka `#'`) is used to quote functions, whereas `quote` (aka `'`) is used to quote data. Now, in Emacs-Lisp a symbol whose function cell is a function is itself a function, so `#'symbol` is just the same as `'symbol` in practice (tho the intention is different, the first making it clear that one is not just t...
In elisp `#'` is (in effect) purely about byte-compilation (*edit: and since Emacs 24, also lexical closures*); but you'll also probably never need to use it. `#'...` is short-hand for `(function ...)` which is simply a variant of `'...` / `(quote ...)` that also hints to the byte-compiler that it can compile the quot...
37,953,733
I have the following code in php ``` $test = "\151\163\142\156"; echo utf8_decode($test); var_dump($test); ``` and i get the following result: ``` isbn string(4) "isbn" ``` I get some text from a txt file that has the \151\163\142\156 text ``` $all_text = file_get_contents('test.txt'); var_dump($all_text); ```...
2016/06/21
[ "https://Stackoverflow.com/questions/37953733", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2160063/" ]
You need to use resolve in the parent state as $stateparams only contains params registered with that state. ``` state({ name: 'parent', url: '/parent', templateUrl: 'app/parent.html', controller: 'parentController', controllerAs: 'vm', resolve: { regionsCountriesInfo: ['$stateParams', ...
i think each child create isolated varibles , did you try to repass it to child in routing ?
10,612,842
I have 5 occurence of UL on a single page. So , when i mouse-over one image then the same effect runs of every instance of UL(i.e. it changes the HTML of all 5 occurences). I want to execute the script on individual UL so that the effect runs on the respective UL where i mouse-hover instead of all of them. Live code...
2012/05/16
[ "https://Stackoverflow.com/questions/10612842", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1389498/" ]
Your groupId and artifactId are reversed.
After installing maven 3 from a repository and added maven3 home in /etc/environment what I forgot to do is to reboot my machine, after that it worked. My /etc/environment now looks like: ``` M3_HOME="/home/edward/java/apache/maven-3.0.4" MAVEN_HOME="/home/edward/java/apache/maven-3.0.4" M3="home/edward/java/apache/...
17,278,331
Two possibilities come into my mind: * `NUMBER(4)` * `DATE` Pro `NUMBER(4)`: * No duplicate entries possible if specified as UNIQUE * Easy arithmetic (add one, subtract one) Con `NUMBER(4)`: * No Validation (e.g. negative numbers) Pro `DATE`: * Validation Con `DATE`: * Duplicate entries are possible ('2013-06-...
2013/06/24
[ "https://Stackoverflow.com/questions/17278331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/237483/" ]
You can restrict a `date` column to only have one entry per year if you want to, with a function-based index: ``` create unique index uq_yr on <table> (trunc(<column>, 'YYYY')); ``` Trying to insert two dates in the same year would give you an ORA-00001 error. Of course, if you don't want the rest of the date then i...
You've quite well summed up the pros/cons. Provided that you name clearly your field so that it's easy to understand that it contains a year information, I would go with a `NUMBER(4)` for simplicity & storing no more or less than what is necessary. And even if there is no validation, IMO negative years are valid :)
43,868,364
Hi I'm newbie in JSON and Ajax and my question is probably quite stupid but when learning, also the stupid questions are fundamental. I need to pass two parameters via Ajax (giorno and periodo), for example 'giorno' = 2017-05-10 and 'periodo' = 2: ``` $.ajax({ type:'POST', data: JSON.stringify({ giorno: ...
2017/05/09
[ "https://Stackoverflow.com/questions/43868364", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7929767/" ]
``` $.post( "http://www.rinnovipatenti.com/index2.php?a=prenotazione", { giorno: $('#dataselezionata').val(), periodo: $('input:radio[name=periodo]:checked').val() } ); ``` you do not need to stringify your JSON on PHP side you just use ``` $giorno = $_POST['giorno']; $periodo = $_POST['periodo']; `...
When you send `application/json` payload to php to access that payload use: ``` $json = json_decode(file_get_contents('php://input'), TRUE); ``` As mentioned in other comments and answers if you stay with `$.ajax` default form encoding and don't json stringify the data then use `$_POST`
42,649,047
I am new to Java (Android Studio), I need to create class and inside this class a method that load anything and after it finish loading, it invoke event on the main instance, which communicate with the main instance, for example in Xcode Swift IOS you can define method with completeHandler: ``` public static func getT...
2017/03/07
[ "https://Stackoverflow.com/questions/42649047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7564643/" ]
You have copied the code from [Running Windows Service Application without installing it](https://stackoverflow.com/a/21722847), but it was broken by design and you altered it incorrectly. The thought behind it, is that you have a `ServiceBase`-inheriting class containing a public method that performs the actual serv...
Start with changing your code a bit : ``` static void Main(string[] args) { #if DEBUG // If you are currently in debug mode ClientService service = new ClientService (); // create your service's instance service.Start(args); // start this service Console.ReadLine(); // wait for user input ( enter key ) #el...
5,371,761
I installed Postgres on Windows 7, it only asks me for password not for username so what's the default. It is said here: > > When Postgres is installed in your account, there is a default user with the same name as the account (login) name > > > It's not crystal clear. Is it the username of my computer account?
2011/03/20
[ "https://Stackoverflow.com/questions/5371761", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310291/" ]
I don't know what installer have you used but when I install it the username is clearly indicated: ![Postres' setup, password step](https://i.stack.imgur.com/ZZMvt.png)
"postgres" is the default user name
43,774,930
``` def highscore(): var = input("Please enter your nickname ") ### And then i want this to be saved within the txt file on my desktop. self.highscoreList.sort() #Sorterar listan man har med highscores (behövs ju inte om den redan är sorterad) if playerScore > self.highscoreList[0]: #Om spelarens poäng...
2017/05/04
[ "https://Stackoverflow.com/questions/43774930", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7661363/" ]
In Python 3, the canonical way to write to a file is e.g., ``` with open("output.txt", "w") as output_file: print("my output", file=output_file) ``` Note that I opened the file inside an `with` block, so that it is automatically closed, and that I printed to the file by supplying a keyword argument `file` to Pyt...
``` use this try: fil = open("/Volumes/Melinas SSD/Users/Melina/Desktop/Python/melinas.txt", "w") except: print('the file cannot be opened') for highscore in self.highscoreList: print('hello') file.write(highscore) file.write("hej") ```
160,497
I'm using subversion (TortoiseSVN) and I want to remove the .svn folders from my project for deployment, is there an automated way of doing this using subversion or do I have to create a custom script for this?
2008/10/02
[ "https://Stackoverflow.com/questions/160497", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1368/" ]
public static: yes FileZilla has filename filtering. Look under View -> Filename Filters. I checked in v3.1.1 I think most FTP clients have it now.
Do `svn export <url>` to export a clean copy without .svn folders.
51,710,663
Scenario 1: * R1 = 02/08/2018 - 20/08/2018 * R2 = 06/08/2018 - 29/08/2018 ``` R1 |--------------| R2 |---------------------| ``` Scenario 2: * R1 = 02/08/2018 - 20/08/2018 * R2 = 31/08/2018 - 16/09/2018 ``` R1 |--------------| R2 |---------------------| ``` There are two dif...
2018/08/06
[ "https://Stackoverflow.com/questions/51710663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6460739/" ]
You can create [ranges of `LocalDate` instances in Groovy 2.5](http://groovy-lang.org/groovy-dev-kit.html#_ranges_code_upto_code_and_code_downto_code). Ranges (which extend Iterables) have an [`intersect` method](http://docs.groovy-lang.org/docs/latest/html/groovy-jdk/java/lang/Iterable.html#intersect(java.lang.Iterabl...
The [Answer by bdkosher](https://stackoverflow.com/a/51710748/642706) looks correct, taking advantage of a nifty feature in Groovy. `org.threeten.extra.LocalDateRange` =================================== If doing much work with date-ranges, you may find helpful the [`LocalDateRange`](http://www.threeten.org/threeten-...
83,719
As far as I was aware, although Princess Leia was Force sensitive, she hadn't undergone any training to put these powers to use and/or couldn't use any Force powers. > > However, when part of the ship she's on is attacked, she is blown into space. She then uses (I assume) the Force to keep herself alive while in spa...
2017/12/15
[ "https://movies.stackexchange.com/questions/83719", "https://movies.stackexchange.com", "https://movies.stackexchange.com/users/16624/" ]
**Short answer:** We don't know **Long answer:** That scene was more of tribute to Carrie Fisher's joke about her wishful death. From [vanityfair](https://www.vanityfair.com/hollywood/2017/12/star-wars-the-last-jedi-does-leia-die-carrie-fisher-in-episode-ix): > > The image can’t help but recall the late Fisher’s fam...
So I have an outrageously hidden possibility. What if Ben, as he didn't take the shot at the main bay of the ship, was taken aback that someone else did and used his own force powers to secure Leia and escort her safely back to the ship, untouched? It seems as if ideas of Leia having a last-ditch highly force sensitive...
66,501,438
So I want to have a function for my game engine that I am writing in java, where it will return an object of type `T`. My code for the function goes like: ``` public <T> T getComponent(Class<T> tClass) { for(Component component : components) { if(component.getClass() == tClass) ...
2021/03/06
[ "https://Stackoverflow.com/questions/66501438", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15281497/" ]
Use reshaping like this, `set_index` with Name and Key creating a multiIndex, then `unstack` the inner most index level to create columns: ``` df.set_index(['Name','Key'])['Val'].unstack() ``` Output: ``` Key A B Name David 1.0 NaN John 3.0 NaN Nat NaN 4.0 Roe NaN 2.0 ```
``` import pandas as pd data = {"Id": ["DA0445EA", "DA0445EA", "DA0445EA", "DA0445EA", "DA0445EA"], "Port" : [1,1,1,1,1], "Lane" :[None,None,None,None,None], "Key" : ["start", "start","case","case_start","end"], "Val":[0.1,0.1,0.3,0.4,0.5] } df = pd.DataFrame(data,columns=['Id',...
24,979
I want to use a laptop which doesn’t save any data, history, passwords anywhere in it. All state information should be destroyed once it is turned off or rebooted, without removing my ability to use the OS or specific applications such as Explorer or some remote desktop apps like Radmin. I am used to Windows OS, but I ...
2012/12/04
[ "https://security.stackexchange.com/questions/24979", "https://security.stackexchange.com", "https://security.stackexchange.com/users/16766/" ]
Jeff's answer covers more than I know about, but I can add a few side notes; There is the issue of page files and other non-volatile virtual memory. The general approach is to use an encrypted swap, with a key read from `/dev/random` on boot. On that note, you could just use full disk encryption, and have a 'panic' k...
This is an old question, sorry. But in the context of unattended college computer lab and classroom machines, we used a product called [Deep Freeze](http://www.faronics.com/products/deep-freeze/) that undid any changes on reboot. It supports both Windows and Mac, and whenever we would get a call that someone had instal...
27,435,837
I'm running a node.js server on heroku using the express.js framework. Here is what my server looks like: ``` var express = require('express'); var app = express(); app.use(express.static(__dirname + '/static')); var port = process.env.PORT || 8000; app.listen(port); ``` My index.html file has the following javas...
2014/12/12
[ "https://Stackoverflow.com/questions/27435837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4166838/" ]
Try Placing your files in the public folder and use the path like this""
Don't use "\_\_dirname" Only using ``` app.use(express.static('static')); ```
410,673
From my understanding, clustering algorithms require complete data. Based on this, if there are missing values in my dataset I have two options: 1. Impute missing information using some sort of imputation method 2. Get rid of observations that contain missing values Sometimes I believe neither approach is appropriate...
2019/05/29
[ "https://stats.stackexchange.com/questions/410673", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/172728/" ]
Some clustering algorithms rely on the [Expectation-Maximisation](https://stats.stackexchange.com/questions/72774/numerical-example-to-understand-expectation-maximization) (EM) algorithm and its variants, e.g. k-means (deterministic- partition clustering), Gaussian mixture models (probabilistic, model-based clustering)...
Say feature `X1` may be missing. If `X1` is categorical, you could add a `missing` level and proceed. If `X1` is continuous, you could set it to the mean value of non-missing `X1`’s and create a categorical variable `X1_missing` that is True only when `X1` is missing. This assumes a clustering algorithm that can handl...
56,381,044
Planning to Migrate the Websphere from 7.0 to 9 and 8.5 to 9. Can anyone help me getting the detailed Process Migration here is "In place". (Migration will be done on the same servers, where the old Installation are in) if at all any migration tools need to be used, please provide the clear info on them. any docum...
2019/05/30
[ "https://Stackoverflow.com/questions/56381044", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11578878/" ]
Could you please share your PDF document, The issue may be with the PDF document containing different media types.
Just resolved it. Change the Content-Type to 'application/pdf' and in the body, send through the contents of the PDF, it doesn't seem to work with just the path.
6,902,284
I have a class that is handling printing the various messages into the console, lets call this class ConsoleMessages.java. This class is public and abstract and all its methods are public and static. I want to make an interface to this class (lets call it PrintMessages). I mean so, that ConsoleMessages.java will impl...
2011/08/01
[ "https://Stackoverflow.com/questions/6902284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/861467/" ]
* Create the `PrintMessages` interface with the methods you desire. * Make `ConsoleMessages` a class that implements that interface. Change all methods from static to non static. * Enforce `ConsoleMessages` instantiation as a [singleton](http://es.wikipedia.org/wiki/Singleton). This can be achieved in many ways, either...
There is really no strong arguement against static methods in interface. Nothing bad would happen. An interface can have static fields and static member classes though, therefore static methods can be attached through them, albeit with one extra indirection. ``` interface MyService static public class Factory ...
608,786
I am trying to create a script that will count down to 0 from what ever number I give it. Below is my script and basically nothing happens, no error message, I merely get the standard command line prompt back. ``` #!/bin/bash #countdown #counts down to 0 from whatever number you give it #displaying a number each secon...
2015/04/13
[ "https://askubuntu.com/questions/608786", "https://askubuntu.com", "https://askubuntu.com/users/388100/" ]
``` #!/bin/bash printf "Type an integer number: " && read NUM if [ $NUM -gt 0 ] then while [ $NUM -ge 0 ] do if [ -f /usr/bin/banner ] then /usr/bin/banner "$NUM" else echo $NUM fi NUM=$(($NUM-1)) sleep 2 done fi ``` output: ``` :~$ ./countdown.sh...
**Improved and commented code:** ``` #!/bin/bash num=${1:-undefined} # If $1 (the first argument passed to the script) is set, then num=$1, else num=undefined. cmd=$(which {banner,echo} | head -1 | xargs basename) # If banner is installed, then cmd=baner, else cmd=echo. until [[ "$n...
24,474,197
I am looking for a very basic example of establishing a data channel using WebRTC. The `peer_connection` examples given are for audio/video and I am not able to run them to understand the code flow and write code for data channel on my own. I have done this using JavaScript for browser, now want to do the same for nati...
2014/06/29
[ "https://Stackoverflow.com/questions/24474197", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3136200/" ]
have you tried the glob module? ``` import os, glob def globit(srchDir): srchDir = os.path.join(srchDir, "*") for file in glob.glob(srchDir): print file globit(file) if __name__ == '__main__': dir = r'C:\working' globit(dir) ```
Generators are better solutions as they do lazy computations here is one example of implementation. ``` import os import fnmatch #this may or may not be implemented def list_dir(path): for name in os.listdir(path): yield os.path.join(path, name) #modify this to take some pattern as input def os_walker(...
1,711,566
I am currently extracting data for a research, and I want to automatically copy the data to multiple sheets when a condition is fulfilled, as the data keeps being updated over time. I am aware that this question may be similar to an [earlier question](https://superuser.com/questions/1343583/copy-data-from-one-sheet-to-...
2022/03/18
[ "https://superuser.com/questions/1711566", "https://superuser.com", "https://superuser.com/users/1677995/" ]
That doesn't say "Windows Server" – it says "**Window** Server". A window server is the OS component which handles the display of application windows on your screen – such as their stacking order, positioning, focus (i.e. delivering input to the right window), and composing individual windows into the single final ima...
### I am tempted to just `rm -r` everything in the `SkyLight.framework` directory I don't think you want to do that. > > WindowServer is a core part of macOS, and a liaison of sorts between > your applications and your display. If you see something on your Mac’s > display, WindowServer put it there. Every window you...
16,410,340
I am learning structure padding and packing in C. I have this doubt, as I have read padding will depend on architecture, so does it affect inter machine communication?, ie. if data created on one machine is getting read on other machine. How this problem is avoided in this scenario.
2013/05/07
[ "https://Stackoverflow.com/questions/16410340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2333014/" ]
`#pragma pack` is supported by most compilers that I know of. This can allow the programmer to specify their desired padding method for structs. <http://msdn.microsoft.com/en-us/library/2e70t5y1%28v=vs.80%29.aspx> <http://gcc.gnu.org/onlinedocs/gcc/Structure_002dPacking-Pragmas.html> <http://clang.llvm.org/docs/User...
In C/C++ a structures are used as data pack. It doesn't provide any data encapsulation or data hiding features (C++ case is an exception due to its semantic similarity with classes). Because of the alignment requirements of various data types, every member of structure should be naturally aligned. The members of struc...
37,028,529
Am I still following the Builder pattern with the implementation below? What's confusing me is the protected constructor in the class "myClass". My first thought when it comes to the builder pattern is to hide the object that the builder is supposed to construct. But here we don't. I can't understand if this is just ba...
2016/05/04
[ "https://Stackoverflow.com/questions/37028529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2565146/" ]
The constructor is `protected` in order to restrict the possibilty of creating new instances of `myClass` outside the protected scope. This looks a bit strange because usually a builder uses `private` constructor to totally avoid the creation of the instance by the client code without using the builder. If you really...
Different than builder implementations that I've seen (not saying it wouldn't work though). The protected constructor confuses me as well. How would this get called unless you've created another class which extended `myClass`? At which point your builder might function differently for the extended class. I'm used to u...
822,247
I'm considering developing an app for Google App Engine, which should not get too much traffic. I'd really rather not pay to exceed the free quotas. However, it seems like it would be quite easy to cause a denial of service attack by overloading the app and exceeding the quotas. Are there any methods to prevent or make...
2009/05/04
[ "https://Stackoverflow.com/questions/822247", "https://Stackoverflow.com", "https://Stackoverflow.com/users/83871/" ]
There are no built-in tools to prevent DoS. If you are writing Google Apps using java then you can use the `service.FloodFilter` filter. The following piece of code will execute before any of your Servlets do. ``` package service; import java.io.IOException; import java.util.HashMap; import java.util.Map; import jav...
It's always possible to use a service that provides Denial of Service protection features in front of an App Engine application. For example, Cloudflare provides a well respected service <https://www.cloudflare.com/waf/>, and there are others. It's my understanding (disclaimer: I haven't used the service personally) th...
21,980,073
Maybe I'm using git-submodules not on purpose, but if there's any other git feature which satisfies my case, would be nice to find it. After cloning repository, I want submodule to be in master branch, I'll never store any additional files inside of chef-starter submodule. ``` git clone git@github.com:holms/vagrant-s...
2014/02/24
[ "https://Stackoverflow.com/questions/21980073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/310662/" ]
The submodule has a detached head because a submodule means "check out a specific commit from the submodule's repository". The `master` branch may have moved forward (it may point to a commit that descends from commit `0b6a803`), so Git checks out the specific revision instead of checking out a branch. `git-submodule`...
To ensure my submodules stay synced and undetached, I have the following in a batch file. It relies on adopting the policy of syncing to the submodule's master branch - for me this isn't a problem, I just fork the submodule and ensure it has a master. I find it's much easier to keep track of things with this approach. ...
14,174,673
I'm trying to set URL Scheme for my app. I read this [tutorial](http://mobiledevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html) and it works perfectly when I call `myapp://test` from an other app or from Safari app and Mail app (iOS native apps). But how can I do in order to open my ap...
2013/01/05
[ "https://Stackoverflow.com/questions/14174673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820433/" ]
It's seems to be not possible. It's just possible with the iOS native apps for the moment :)
You can set a secret key like `myapp://test`. You can do this under your project settings -> URL type. In there you need to define your secret key. When entering this key into your safari browser your app is being opened automaticly.
17,831,193
I need to make a plot with only points and tried something like ``` plot(x,y) ``` where `x` and `y` are vectors: collection of points. I do not want matlab to connect these points itself. I want to plot as if plotted with ``` for loop plot;hold on; end ``` I tried ``` plot(x,y,'.'); ``` But this gave me too...
2013/07/24
[ "https://Stackoverflow.com/questions/17831193", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2178841/" ]
You're almost there, just change the MarkerSize property: ``` plot(x,y,'.','MarkerSize',1) ```
You may try this piece of code that avoid using loops. The plot created does not have lines but markers of different colors corresponding to each column of matrices `x` and `y`. ``` %some data (matrix) x = repmat((2:10)',1,6); y = bsxfun(@times, x, 1:6); set(0,'DefaultAxesColorOrder', jet(6)); %set the default matlab...
16,373,134
I'm currently working (a repo is [here](https://github.com/wishi/blogdev/blob/master/js/example1.js)) on a Hypertree graph, which I want to use from the [JavaScript InfoVis Toolkit](http://philogb.github.io/jit/docs.html). The issue is as follows: I added the specific events to the Hypertree, which are `onClick` and `o...
2013/05/04
[ "https://Stackoverflow.com/questions/16373134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/59300/" ]
Try this `Query` for `MYSQL` ``` select distinct greatest(t1.A, t1.B), least(t1.A, t1.B) from your_table t1 , your_table t2 where t1.B=t2.A and t1.A=t2.B ``` **[SQL Fiddle](http://www.sqlfiddle.com/#!2/96eba/8)** **[Refer my Answer. Only the inner Query](https://stackoverflow.com/questions/16342712/sql-query-how-to...
in your query add one more where condition - leftparam<=rightparam. it will eliminate all duplicate reversed pairs. 80|100 ok, 100|80 removed.
60,888,188
I try to get a specific substring out of a string as often as it apears in Python. The substring will be different every time, but the structure will be the same. Example: ``` [{u'style': u'opacity:0.58800001;fill:#0000ff;fill-opacity:1; stroke:none;stroke-width:3.47952747; stroke-linecap:round;stroke-linejoin:round;...
2020/03/27
[ "https://Stackoverflow.com/questions/60888188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13135805/" ]
You can use [`.flatMap()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap) and [`Set()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) for this: ```js let data = [ { winner: 'Alishah', loser: 'Bob', loser_points: 3 }, { wi...
Using map and filter ```js let array = [ { winner: 'Alishah', loser: 'Bob', loser_points: 3 }, { winner: 'Maria', loser: 'Xu Jin', loser_points: 1 }, { winner: 'Elise', loser: 'Bob', loser_points: 2 }, { winner: 'Elise', loser: 'Maria', loser_points: 4 }, { winner: 'Alishah', loser: 'Maria', lo...
3,952,539
I'm developing a project for doing **Content Based Image Retrieval** where front end will be in java. The main issue is about choosing tool for performing image processing. Since Matlab provides a lot of functionality for doing CBIR. But the main problem about using Matlab is that you need to have Matlab installed on ...
2010/10/17
[ "https://Stackoverflow.com/questions/3952539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1150236/" ]
[Java image utilities](http://sourceforge.net/projects/jiu/) library: A Java library for loading, editing, analyzing and saving pixel image files. It supports various file formats. Provides demo applications for the command line. It has AWT GUI toolkit too.
I think [OpenCV](http://sourceforge.net/projects/opencv/) is one of the best libraries out there for image processing but [Java Advanced Imaging](http://java.sun.com/javase/technologies/desktop/media/jai/) is also quite good but doesn't has as much features and examples. Color similarity would be simple in JAI but shap...
35,478,969
error: `02-18 10:10:24.260: E/AndroidRuntime(5769): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.opencv.samples.facedetect/activity.CameraTest}: android.view.InflateException: Binary XML file line #33: Error inflating class fragment` Application with face detection camera. * Have a user prof...
2016/02/18
[ "https://Stackoverflow.com/questions/35478969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1860870/" ]
Given: ``` IDictionary<string, object> dict = new Dictionary<string, object>() { { "1", new Dictionary<string, object>() { { "name", "John" }, { "score", 5 } } }, { "2", new Dictionary<string, object>() { { "name", "Pete" }, { "score...
``` IEnumerable<User> OrderByScore(IDictionary<string,object> firebaseList) { return from user in firebaseList.Values.Cast<IDictionary<string,object>>() let name = (string) user["name"] let score = int.Parse(user["score"].ToString()) orderby score descending select new User { Name =...
23,866
When you enter a search into [google ngrams](https://books.google.com/ngrams), the graph shows the words/strings down the right hand side. What if you could pick search terms such that reading the right hand side of the graph, from top to bottom, makes an actual sentence... **Challenge** What is the longest sentence ...
2015/11/09
[ "https://puzzling.stackexchange.com/questions/23866", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/9444/" ]
13: Just modifying a previous answer yields higher results: [A,new,man,through,life,without,true,love,today,normally,allows,medicinal,marijuana](https://books.google.com/ngrams/graph?content=A%2Cnew%2Cman%2Cthrough%2Clife%2Cwithout%2Ctrue%2Clove%2Ctoday%2Cnormally%2Callows%2Cmedicinal&year_start=1800&year_end=1972&corp...
10 points --------- A somewhat morbid sentence, perhaps from a proponent of eugenics: *[A new man without true love requires severe anesthesia perfunctorily](https://books.google.com/ngrams/graph?content=A%2Cnew%2Cman%2Cwithout%2Ctrue%2Clove%2Crequires%2Csevere%2Canesthesia%2Cperfunctorily&year_start=1800&year_end=19...
244,796
I have access to a data node in a Hadoop cluster, and I'd like to find out the identity of the name nodes for the same cluster. Is there a way to do this?
2011/03/08
[ "https://serverfault.com/questions/244796", "https://serverfault.com", "https://serverfault.com/users/1713/" ]
Try the Dedicated Administrator Connection (DAC).
Can you get into SSMS? If so, have you tried running sp\_who2? that should show you what SPID's are eating up the most CPU.
76,128
This is essentially a repeat of [this question](https://wordpress.stackexchange.com/questions/70519/shared-members-between-two-different-wordpress-installations-with-different-data), but it has not been answered. I am trying to create an SSO system between two separate WordPress installs that are on different servers ...
2012/12/14
[ "https://wordpress.stackexchange.com/questions/76128", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/6556/" ]
The main thing I didn't like about most of these solutions is that it was blinking on alot of screens, and if you clicked on **Featured Image** it would revert back to showing all images. After some searching I think found a permanent solution (Thanks to [Ünsal Korkmaz](http://unsalkorkmaz.com/how-to-lock-uploads-to-sh...
This is my solutions to set `dateFilter` to current month, though it triggers AJAX twice. ``` .on('content:render:browse', function(a, b) { var filter = a.toolbar.secondary.get('dateFilter'); if (filter.model) { filter.model.set(filter.filters[1].props); } }) ```
738,989
I opened an Excel file from Internet Explorer, worked on it for 2 hours and saved it. But now I can't find the file. The file was really important. Is there any way I can retrieve it? I'm using Windows 7 Ultimate.
2014/04/08
[ "https://superuser.com/questions/738989", "https://superuser.com", "https://superuser.com/users/313846/" ]
My solution was arrived at indirectly. I noticed that MKV files contained a "date" that couldn't be changed by normal means so that the file would reflect when I got it, as shown in the file properties. In desperation I changed the column in windows file explorer from just "date" to "date created" and then set the view...
This is caused by the **Windows Search** service. You could just disable the service by setting the *Windows Search* service to *Disabled* and manually stopping the service (right-click on the service and select *Stop*). Microsoft puts the service there to supposedly speed up Windows (yeah OK, whatever). You can also ...
28,994
UPDATE June 21, 2012: --------------------- I purchased a Ferric Chloride, Positive Developer, and positive PCB boards from [MG Chemicals](http://www.mgchemicals.com) and used the photo-etching process. The results were OUTSTANDING! You don't need their sparge tank or exposure kit. I simply exposed my pcb underneath a...
2012/03/30
[ "https://electronics.stackexchange.com/questions/28994", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/8970/" ]
PCBs are first designed with a schematic. You can find a large amount of options for schematic editors for the question [Good tools for drawing schematics](https://electronics.stackexchange.com/questions/1024/good-tools-for-drawing-schematics). Once you get the schematic drawn you will need to "transfer" the schematic...
Last I checked, the most cost-effective place to get small-run PCBS is <http://batchpcb.com/> by the people behind SparkFun. However, you will be waiting a while (for me it was about a month from upload to delivery.)
11,938
I'm updating my resume, and have realized that many programming skills are very brief and abbreviated. My old resumes would list them in a bulleted list, however due to all the new technologies I'm adding, this leads to a rather long list of very short items, with a lot of whitespace to the right of the section. I am...
2013/05/23
[ "https://workplace.stackexchange.com/questions/11938", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/316/" ]
I'm no hero when it comes to CVs, but there's a lot of .Net tech in that list. I'd list those in one line. That way you make most of the space available. You could opt to use some kind of matrix style. I'd still make some kind of distinction between the MS tech and the other techniques. Something like: --- .Net tech...
I want to add that you need to remember that your CV has two audiences: * Recruiters/HR who don't know how the technology is being used, and are possibly just looking for some key buzzwords. * Technical leads who do know how the technology is used, and aren't going to be impressed with just a list of buzzwords, or se...
76,449
Inspired by [this](https://softwareengineering.stackexchange.com/questions/76415/i-want-to-make-some-programmer-friends-but-dont-know-where-to-really-look) question, I have looked into user groups within my area in England, and there does not seem to be one at all for a few hundred miles. I would like to look into the ...
2011/05/15
[ "https://softwareengineering.stackexchange.com/questions/76449", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/24364/" ]
I see from your profile that you're based in Warrington. What type of user group were you looking for .NET, Java, SQL ... general? There's a nice group in Manchester that you might be interested in: <http://www.nxtgenug.net/Region.aspx?RegionID=11> In my experience, user groups derive their focus out of what the co-or...
> > What is the purpose of a user group? > Is it to simply network or are there > expectations for presentations, > informal learning, etc? > > > It is for what ever you want it to be. I help run [Scottish Developers](http://scottishdevelopers.com) and we have a wide scope. We run evening talks, book clubs, gee...