qid
int64
1
74.7M
question
stringlengths
0
70k
date
stringlengths
10
10
metadata
list
response
stringlengths
0
115k
29,175
I'm trying to write a SQL Server script to iterate through .bak files in a directory and then restore them to our server. In doing so, I've created three temp tables: #Files to keep track of the file-list returned by running xp\_dirtree, #HeaderInfo to hold data returned when querying restore headeronly to get the data...
2012/11/23
[ "https://dba.stackexchange.com/questions/29175", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/15382/" ]
**First your first questions** 1. I would use tinyint for the `BYTE(1)` in this case they told us the possible values are 1 or 0. `BIT` may also work. You could also try `BIT`. But `uint64` is an unsigned 64 Byte integer. BIGINT is signed, so the max value is lower. So technically speaking a DECIMAL(20,0) or greater p...
654,953
I have often see ball grid array (BGA) chips, mostly those from CPUs or GPUs, being glued around in the corners with some red glue or to the perimeter with a translucent one. Having to manually solder BGA chips using hot air, should I glue the chips to the board before heating? In their answers to a quite similar que...
2023/02/21
[ "https://electronics.stackexchange.com/questions/654953", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/199752/" ]
To add on to the other excellent answers, and to answer your third question: the red glue you see is likely to be some kind of **corner staking** or **underfilling**. After soldering, an adhesive compound is added to mitigate in-the-field failure, particularly when packages are subjected to thermal or physical stresses...
68,783,622
Hi everyone i'm noob at this, <https://decisoesesolucoes.com/agencias/albergaria/consultores> In the url above, i want to count the number of 'consultor imobiliario' and 'Consultora Imobiliaria' , both the text has spaces, so why im using the normalize-space . [The text i want to get](https://i.stack.imgur.com/kkTGk...
2021/08/14
[ "https://Stackoverflow.com/questions/68783622", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16665895/" ]
**EDITED:** You are trying to find text-nodes that are both equal to have 2 different values. That wil never match anything. It is like saying give me all days in summer that are both 100% sunny and 100% rainy. Use `or` in stead of `and` like this: ``` "//*[text()[normalize-space() = 'consultor imobiliario' or norma...
56,444,790
Why do I need to bind () a function inside a constructor? ``` constructor (props){ super(props); this.funcao = this.funcao.bind(this); } ``` could not bind () without using a constructor?
2019/06/04
[ "https://Stackoverflow.com/questions/56444790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11599057/" ]
You don't have to bind the methods in the constructor, have a look at the the explanation below. ```js // Setup (mock) class MyValue { constructor(value) { this.value = value; } log() { console.log(this.value); } bindMethods() { this.log = this.log.bind(this); } } const value = ne...
34,624
I am about to upgrade the hard disk of my MacBook. (From 60GB to 320GB, which I know is below the limit of 500GB). I was both able to install an OS X on the new drive and also to transfer the old hard disks partition to the new one with a [sysresccd](http://www.sysresccd.org/Main_Page) (linux live disk) and `dd` (`dd ...
2009/07/01
[ "https://serverfault.com/questions/34624", "https://serverfault.com", "https://serverfault.com/users/1509/" ]
Just cleanly partition the new disk to any size you like and copy the data over with [Carbon Copy Cloner.](http://www.bombich.com/) It will be bootable and have the size you want. You can do that on a running system, and don't need any live cd's or anything, just an usb or firewire interface for the new/second harddi...
14,741,859
I have 2 tables: * **Table1** = names of gas stations (in pairs) * **Table2** = has co-ordinate information (longitude and latitude amongst other things) Example of **Table1**: ``` StationID1 StationID2 Name1 Name2 Lattitude1 Longitude1 Lattitude2 Longitude2 Distance ---------------------------------------...
2013/02/07
[ "https://Stackoverflow.com/questions/14741859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/668624/" ]
I think you can modify your UPDATE statement to reference the table alias in the UPDATE line. ``` update t1 set t1.[Lattitude1] = t2.[Lattitude] from table1 t1 left join table2 t2 on (t1.StationID1 = t2.IDInfo) ```
56,637,126
I'm testing a tableview the cell content in XCUItest. In my case, I don't know the order of the cell text, nor am I allowed to set an accessibility id for the text. How can I get the index of a cell given the text inside? [![enter image description here](https://i.stack.imgur.com/J6a9R.png)](https://i.stack.imgur.com...
2019/06/17
[ "https://Stackoverflow.com/questions/56637126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8234508/" ]
The most reliable way really is to add the index into the accessibility identifier. But, you can't. Can you change the accessibility identifier of the cell instead of the text ? Anyway, if you don't scroll your table view, you can handle it like that : ``` let idx = 0 for cell in table.cells.allElementsBoundByIndex {...
132,698
I used linear interpolation between points: ``` T = 1; w = 0.05; num = 1000; A = 1; pulse[x_] := A*(UnitStep[x + w*T/2] - UnitStep[x - w*T/2]) fun = Table[pulse[x] + 0.2*(RandomReal[] - 0.5), {x, -T/2, T/2, T/(num - 1)}]; funX = Table[i, {i, -T/2, T/2, T/(num - 1)}]; funINT = Interpolation[Transpose[{fun...
2016/12/03
[ "https://mathematica.stackexchange.com/questions/132698", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/19601/" ]
You could find a general symbolic Fourier coefficient for a linear polynomial and use the formula to integrate the interpolating function piecewise. If you're content with machine precision (double precision), then you can `Compile` it for really great speed. ``` (* Basic integral formulas *) ClearAll[cn0]; cn0[0][{t0...
13,003,257
If I have some kind of tree, and I need to find a specific node in that tree which is essentially null (the struct is not initialised / malloc'ed yet). If I want to return that very specific uninitialised struct place to be able to initialise it, would something like: ``` if (parentNode->childNode == NULL) return...
2012/10/21
[ "https://Stackoverflow.com/questions/13003257", "https://Stackoverflow.com", "https://Stackoverflow.com/users/680441/" ]
You can not return NULL. It will not be an identifiable location. What you can do however is: * `malloc` the node at the point where you find it and return the pointer returned by malloc, * you can `return &(parentNode->childNode)` (a pointer to the childNode pointer) which the caller of the function can use to set...
17,268,287
I am developing a website and currently I am stick in the registration process. When I ask users to register to my website, they need to choose the number of people that a team will have. When I select the number of people in the selection box, my website displays input fields according to the number of people that I s...
2013/06/24
[ "https://Stackoverflow.com/questions/17268287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2514936/" ]
Here is a [**Live demo**](http://jsfiddle.net/mplungjan/EyG6g/) You need to change your option click to the change event of the select. You can also drop the name and ID of the options: ``` $(function(){ $("#integrantes").on("change",function(){ $("#loscuatro").toggle(this.selectedIndex==1); // second option is...
3,935,641
How can I add a close button to a draggable/resizable div? I understand that I am essentially describing a dialog, but I have to be able to take advantage of a few of the properties of resizable/draggable (such as containment) that are not a part of dialog. Any ideas?
2010/10/14
[ "https://Stackoverflow.com/questions/3935641", "https://Stackoverflow.com", "https://Stackoverflow.com/users/476055/" ]
You can use multiple class names (a perfectly normal thing to do), but are only allowed one class attribute on your HTML element. Do this instead: ``` <a href="#" class="paren defaul">text</a> ```
511,515
We have a scenario One Main e-commerce website - currently attracting a lot of visitors. Three sub "brand specific" sites which will hang off this site - each of these sites will potentiall have the same level of traffic over time. The client requires order processing for each brand site to happen in one place (i.e....
2009/02/04
[ "https://Stackoverflow.com/questions/511515", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42446/" ]
Without having a more detailed understanding of how your application is to function it is difficult to provide you with clear direction. Your proposed implementation of having a central server (Publisher) supporting reads and writes, with a number of additional site specific servers (subscribers) for reads only, is ce...
67,359,673
I'm using *Entity Framework* and *Dynamic Linq Core* to perform some dynamic queries at run time. I have a question on how to write dynamic linq statements to output columns of counts where each column is a field item of another field. Say I have a table with 3 columns: ID, Gender, and Age (assuming they are only in t...
2021/05/02
[ "https://Stackoverflow.com/questions/67359673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11735492/" ]
let's say your query returns a list of object of the following class ``` public class Data { public string Gender { get; set;} public int Age { get; set;} public int Value { get; set;} } ``` ```cs Data results = //query result var resultsV2 = results.GroupBy(r => r.Gender); var list = new List<IDictionary...
2,436,542
I know that on MacOSX / PosiX systems, there is atomic-compare-and-swap for C/C++ code via g++. However, I don't need the compare -- I just want to atomically swap two values. Is there an atomic swap operation available? [Everythign I can find is atomic\_compare\_and\_swap ... and I just want to do the swap, without c...
2010/03/12
[ "https://Stackoverflow.com/questions/2436542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247265/" ]
the "lock xchg" intel assembly instruction probably achieves what you want but i dont think there is a GCC wrapper function to make it portable. Therefor your stuck using inline assembly(not portable) or using compare and swap and forcing the compare to be true(inneficient). Hope this helps :-)
45,888
I use tabs in C/C++ but want to convert those tabs to spaces when copying code that I'm going to paste into an external program. However, I want the original code to retain tabs. Additionally (if possible), I'd like to keep the tabs when copying/pasting within Emacs. I sort of adapted the code at [this link](https://e...
2018/11/10
[ "https://emacs.stackexchange.com/questions/45888", "https://emacs.stackexchange.com", "https://emacs.stackexchange.com/users/20317/" ]
It's not documented well enough, and possibly poorly named, but the `hideshow` function `hs-hide-level` will collapse all the blocks within the current block. That is, if your cursor is on the `class ...` line (or below it) in your example input, it will give you something very similar to your desired output. Since `hi...
53,242
How do I check if a partition is encrypted? In particular I would like to know how I check if `/home` and swap is encrypted.
2011/07/15
[ "https://askubuntu.com/questions/53242", "https://askubuntu.com", "https://askubuntu.com/users/19490/" ]
Regarding the standard home encryption provided by Ubuntu, you can ``` sudo ls -lA /home/username/ ``` and if you get something like ``` totale 0 lrwxrwxrwx 1 username username 56 2011-05-08 18:12 Access-Your-Private-Data.desktop -> /usr/share/ecryptfs-utils/ecryptfs-mount-private.desktop lrwxrwxrwx 1 username use...
105,877
So I'm making a game using love2d where the player will find himself in an zombie infested city but I don't want the city/map to be just the same all the time, so I want to create a random map/city generator, but I don't know where to start, I maybe can make my own but the result would probably be not what I wanted, as...
2015/08/19
[ "https://gamedev.stackexchange.com/questions/105877", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/70087/" ]
Like stated by Shiro in a comment , it's difficult to give a precise answer. I can suggest a possible starting point. Use random [voronoi](https://it.wikipedia.org/wiki/Diagramma_di_Voronoi) generation where , given a set of random points P , each point in space is weighted relative to the distance from the nearest p ...
46,287,904
I was reading about [value types](https://en.wikipedia.org/wiki/Value_type) and *values* and *objects* were mentioned as if they meant something different, so I assume they do. I then tried to do some research but without luck. I know that a value is an expression that cannot be evaluated further, but isn't an object j...
2017/09/18
[ "https://Stackoverflow.com/questions/46287904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
A **value** is a more abstract concept than an **object**. Like those mentioned in comments, the difference/relationship between a value and an object is similar to that between water and a cup. You need a container, which in this case is a cup, to hold the water, or it will leak. Likewise, you need an object to hold...
951,981
Expanding on [How can I make Windows 8 use the classic theme?](https://superuser.com/questions/513492/how-can-i-make-windows-8-use-the-classic-theme) and [Windows 10 TenForums: Windows Classic Look Theme in Windows 10](http://www.tenforums.com/customization/11432-windows-classic-look-theme-windows-10-a.html) -- how doe...
2015/08/06
[ "https://superuser.com/questions/951981", "https://superuser.com", "https://superuser.com/users/327566/" ]
Have a look at this thread: <http://forum.thinkpads.com/viewtopic.php?f=67&t=113024&p=777781&hilit=classictheme#p777781> They're discussing/testing how to modify windows binary files to "get back" to classic interface by "unusual" methods, rather than just turning colors into gray! But it appears to be very complex d...
10,569,321
In Spring WS, endpoints are typically annotated with the @Endpoint annotation. e.g. ``` @Endpoint public class HolidayEndpoint { ... } ``` My question is: is there any way to deifine schema-based endpoint (based on XML configuration)? Thanks...
2012/05/13
[ "https://Stackoverflow.com/questions/10569321", "https://Stackoverflow.com", "https://Stackoverflow.com/users/379814/" ]
In your spring-ws-servlet.xml configuration,add the following: ``` <?xml version="1.0" encoding="UTF-8"?> <beans> <context:annotation-config /> <sws:annotation-driven /> <sws:dynamic-wsdl id="holidayEndPoint" portTypeName="HolidayEndpoint" ............ ...... ``` More info can be had from here [Unable t...
40,012,211
The question reads "Just as it is possible to multiply by adding over and over, it is possible to divide by subtracting over and over. Write a program with a procedure to compute how many times a number N1 goes into another number N2. You will need a loop, and count for how many times that loop is executed". I am reall...
2016/10/13
[ "https://Stackoverflow.com/questions/40012211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7011413/" ]
Algorithm for positive N1,N2: 1. prepare `N1`, `N2` and set some `R` to -1 2. increment `R` 3. subtract `N1` from `N2` (update `N2` with result) 4. when result of subtraction is above or equal to zero, go to step 2. 5. `R` has result of integer division `N2`/`N1` Steps 2. to 4. can be written in x86 Assembly by singl...
4,468,310
suppose there is a tree with number of child nodes increasing from 2 to 4 then 8 and so on.how can we write recurrence relation for such a tree.
2010/12/17
[ "https://Stackoverflow.com/questions/4468310", "https://Stackoverflow.com", "https://Stackoverflow.com/users/531802/" ]
* using subtitution method- T(n)=2T(n/2)+n =2[2T(n/2^2)+n/2]+n =2^2T(n/2^2)+n+n =2^2[2T(n/2^3)+n/2^2]+n+n =2^3T(n/2^3)+n+n+n similarly subtituing k times-- we get T(n)=2^k T(n/2^k)+nk the recursion will terminate when n/2^k=1 k=log n base 2. thus T(n)=2^log n(base2)+n(log n) =n+nlogn thus the tight bound for...
34,686,217
``` ggplot(all, aes(x=area, y=nq)) + geom_point(size=0.5) + geom_abline(data = levelnew, aes(intercept=log10(exp(interceptmax)), slope=fslope)) + #shifted regression line scale_y_log10(labels = function(y) format(y, scientific = FALSE)) + scale_x_log10(labels = function(x) format(x, scientific = FALSE)) + f...
2016/01/08
[ "https://Stackoverflow.com/questions/34686217", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3942806/" ]
I don't have your data, so I made some up: ``` df <- data.frame(x=rnorm(100),y=rnorm(100),z=rep(letters[1:4],each=25)) ggplot(df,aes(x,y)) + geom_point() + theme_bw() + facet_wrap(~z) ``` [![enter image description here](https://i.stack.imgur.com/uCOR9.png)](https://i.stack.imgur.com/uCOR9.png) To add a vert...
6,117,315
I have three questions regarding SSL that I don't fully understand. 1. If I get it correctly, a server `A` submits a request to a certain CA. Then, it receives (after validation etc.) a digital certificate composed of a public key + identity + an encription of this information using the CA's private key. Later on, a ...
2011/05/24
[ "https://Stackoverflow.com/questions/6117315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/764420/" ]
An SSL identity is characterized by four parts: 1. A *private* key, which is not shared with anyone. 2. A *public* key, which you can share with anyone. The private and public key form a matched pair: anything you encrypt with one can be decrypted with the other, but you *cannot* decrypt something encrypted with the ...
10,017,027
I have a table transaction which has duplicates. i want to keep the record that had minimum id and delete all the duplicates based on four fields DATE, AMOUNT, REFNUMBER, PARENTFOLDERID. I wrote this query but i am not sure if this can be written in an efficient way. Do you think there is a better way? I am asking beca...
2012/04/04
[ "https://Stackoverflow.com/questions/10017027", "https://Stackoverflow.com", "https://Stackoverflow.com/users/510242/" ]
It would probably be more efficient to do something like ``` DELETE FROM transaction t1 WHERE EXISTS( SELECT 1 FROM transaction t2 WHERE t1.date = t2.date AND t1.refnumber = t2.refnumber AND t1.parentFolderId = t2.parentFolderId AN...
43,339,561
I want to select the number of rows which are greater than 3 by rownum function i\_e "(rownum>3)" for example if there are 25 rows and I want to retrieve the last 22 rows by rownum function. but when I write the ``` select * from test_table where rownum>3; ``` it retrieve no row. can any one help me to solve this p...
2017/04/11
[ "https://Stackoverflow.com/questions/43339561", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7677507/" ]
In RDBMS there is no first or last rows. What you calls "raws" , actually is set(sets), they can be ordered or not. `rownum` is a function, which is just enumerates result set, it makes sense only after set is calculated, to order your set of data (rows) you should do it in your query before `rownum` call, you must tel...
6,213,814
How to populate form with JSON data using data store? How are the textfields connected with store, model? ``` Ext.define('app.formStore', { extend: 'Ext.data.Model', fields: [ {name: 'naziv', type:'string'}, {name: 'oib', type:'int'}, {name: 'email', type:'string'} ] }); var myStore = Ext.create('Ext.data.St...
2011/06/02
[ "https://Stackoverflow.com/questions/6213814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/765628/" ]
The field names of your model and form **should match**. Then you can load the form using `loadRecord()`. For example: ``` var record = Ext.create('XYZ',{ name: 'Abc', email: 'abc@abc.com' }); formpanel.getForm().loadRecord(record); ``` or, get the values from already loaded store.
33,864,134
I'm developing an Android Application which is consists of a Navigation drawer and a Google Map. I have successfully developed my Navigation Drawer and connect my Map into it. The thing is I need my Map to Zoom to the current location. Here is the code I used in `MapsActivity.java`. ``` protected void onCreate(Bund...
2015/11/23
[ "https://Stackoverflow.com/questions/33864134", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
try this .. ``` map.animateCamera(CameraUpdateFactory.newLatLngZoom((sydney), 13.0f)); ``` you have not given by in float. so its not working.. try this..
32,739,103
I have a complex object and I'm trying to set the > > SelectedTransportation > > > property which I manually add in a mapping. The code properly populates the dropdownlist, but I can't figure out how to set SelectedTransportation properly. I've tried setting it during the mapping process and after mapping through...
2015/09/23
[ "https://Stackoverflow.com/questions/32739103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2855467/" ]
Your idea of creating a proxy is good imo, however, if you have access to ES6, why not looking into [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy)? I think it does what you want out-of-the-box. The MDN provides good examples on how do traps for value validation in a set...
5,100,229
So I have set up a mysql database that holds an image (more specifically a path to an image) and the images rank (starting at 0). I then created a web page that displays two images at random at a time. [Up till here everything works fine] I want my users to be able to click on one of the images that they like better an...
2011/02/24
[ "https://Stackoverflow.com/questions/5100229", "https://Stackoverflow.com", "https://Stackoverflow.com/users/518080/" ]
Well i wasn't able to solve why the Between function didn't work - but mysql doesn't allow BETWEEN on floating point numbers either. So i'm going to assume that it's a similar reason. I changed my code to merely create it's own between statement. ``` NSPredicate *longPredicate = nil; NSPredicate *latPredica...
357,141
I am struck in finding the solution for the below requirements Assume drop down#1 and drop down#2 selection box in the Magento2 admin UI grid filters. If we select option in one drop down#1 then we have to filter option in drop down#2 based on drop down#1 selection value. If anyone aware of the solution / any alterna...
2022/06/23
[ "https://magento.stackexchange.com/questions/357141", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/12392/" ]
The answer just a concept and i don't have enough time to provide full example, but hope this will help to understand a concept. **1. Custom Column Ui Component** You need to create a custom column element for your second filter and extend for example `Magento_Ui/js/grid/columns/select`. You still can use native temp...
34,798,757
I am working on an app written in Polymer. I have some CSS variables defined like this: ``` :root { --my-option-1: #ff8a80; --my-option-2: #4a148c; --my-option-3: #8c9eff; } ``` The user literally chooses "1", "2", or "3". I have a function that looks like this: ``` // The v parameter will be 1, 2, or 3 fun...
2016/01/14
[ "https://Stackoverflow.com/questions/34798757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1185425/" ]
You can use a constructor, I don't see a need for inheritance ``` function Config(key, name, icon, values, filterFn) { this.key = key; this.name = name; this.icon = icon; this.values = values; this.filterFn = filterFn; } var cfg = {}; // Don't want to repeat "someKey"? put it in a variable. var my...
16,637,051
I'm trying to make a number input. I've made so my textbox only accepts numbers via this code: ``` function isNumber(evt) { evt = (evt) ? evt : window.event; var charCode = (evt.which) ? evt.which : evt.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) { return false; } return...
2013/05/19
[ "https://Stackoverflow.com/questions/16637051", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1768788/" ]
For integers use ``` function numberWithSpaces(x) { return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " "); } ``` For floating point numbers you can use ``` function numberWithSpaces(x) { var parts = x.toString().split("."); parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, " "); return parts...
72,120,997
Let's say I have a data frame like this: ``` dat<- data.frame(ID= c("A","A","A","A","B","B", "B", "B"), test= rep(c("pre","post"),4), item= c(rep("item1",2), rep("item2",2), rep("item1",2), rep("item2",2)), answer= c("1_2_3_4", "1_2_3_4","2_4_3_1","4_3_2_1", "2_4_3_1","2_4_3_1",...
2022/05/05
[ "https://Stackoverflow.com/questions/72120997", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8061255/" ]
```r dat<- data.frame(ID= c("A","A","A","A","B","B", "B", "B"), test= rep(c("pre","post"),4), item= c(rep("item1",2), rep("item2",2), rep("item1",2), rep("item2",2)), answer= c("1_2_3_4", "1_2_3_4","2_4_3_1","4_3_2_1", "2_4_3_1","2_4_3_1","4_3_2_1","4_3_2_1")) library(data.table...
49,320,845
<https://colab.research.google.com/notebooks/io.ipynb#scrollTo=KHeruhacFpSU> In this notebook help it explains how to upload a file to drive and then download to Colaboratory but my files are already in drive. Where can I find the file ID ? ``` # Download the file we just uploaded. # # Replace the assignment below w...
2018/03/16
[ "https://Stackoverflow.com/questions/49320845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8833943/" ]
If the parameter is definitely unused, `[[maybe_unused]]` is not particularly useful, unnamed parameters and comments work just fine for that. `[[maybe_unused]]` is mostly useful for things that are *potentially* unused, like in ``` void fun(int i, int j) { assert(i < j); // j not used here anymore } ``` Th...
33,001,985
I have started using Webpack when developing usual web sites consisting of a number pages and of different pages types. I'm used to the RequireJs script loader that loads all dependencies on demand when needed. Just a small piece of javascript is downloaded when page loads. What I want to achieve is this: * A small i...
2015/10/07
[ "https://Stackoverflow.com/questions/33001985", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4886214/" ]
The solution to this problem is two-fold: 1. First you need to understand [how code-splitting works in webpack](https://webpack.github.io/docs/code-splitting.html) 2. Secondly, you need to use something like the `CommonsChunkPlugin` to generate that shared bundle. ### Code Splitting Before you start using webpack yo...
510,152
Quite often, the script I want to execute is not located in my current working directory and I don't really want to leave it. Is it a good practice to run scripts (BASH, Perl etc.) from another directory? Will they usually find all the stuff they need to run properly? If so, what is the best way to run a "distant" sc...
2012/11/24
[ "https://superuser.com/questions/510152", "https://superuser.com", "https://superuser.com/users/105968/" ]
sh /path/to/script will spawn a new shell and run she script independent of your current shell. The `source` (.) command will call all the commands in the script in the current shell. If the script happens to call `exit` for example, then you'll lose the current shell. Because of this it is usually safer to call script...
75,214
I copied 3.62 GB of data on to a re-writable DVD instead of erasing it. Now there is no data on the disc but it shows used space as 3.62 GB and 690 MB of free space. Now I am unable to erase my disc. What should I do to erase the disc and get the space back?
2009/11/25
[ "https://superuser.com/questions/75214", "https://superuser.com", "https://superuser.com/users/96938/" ]
You aren't supposed to format a DVD-RW. Use something like [CDBurnerXP](http://cdburnerxp.se/)'s erase function: ![alt text](https://i.stack.imgur.com/N3NwX.png)
150,258
Someone moved a very important page on my website into the trash, and I do not know who did it! It was not deleted permanently so I don't need to worry, in that sense. The revisions, when I restored it, show that someone edited it 3 days prior to today, so it could have been them, but I can't be sure. Does WP keep tr...
2014/06/20
[ "https://wordpress.stackexchange.com/questions/150258", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/15209/" ]
By default, no, WordPress doesn't keep track of who changes post statuses (at least that I can see). you can hook into `transition_post_status` and log the user id. ``` add_action( 'transition_post_status', 'wwm_transition_post_status', 10, 3 ); function wwm_transition_post_status( $new_status, $old_status, ...
28,958,290
We have recently switched over to React + Flux from Angular to build a rather complex business application. Taking the approach of having one container component that passes all state as properties down the component tree isn't a practical way to develop the app for us as the app makes use of large page-like modals. E...
2015/03/10
[ "https://Stackoverflow.com/questions/28958290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525096/" ]
It feels wrong to me that you are using `getInitialState()` to change the state of your store. You should at least be doing that in [`componentWillMount`](http://facebook.github.io/react/docs/component-specs.html#mounting-componentwillmount). I would trigger an action in `componentWillMount` and have the store handler...
35,281,379
I have ElasticSearch 2.2 running on a linux VM. I'm running ManifoldCF 2.3 on another VM in the same netowrk. Using ManifoldCF's browser UI I added the ElasticSearch output connector and when I save it I get an error in the connector status: ``` Name: Elastic Description: Elastic search Connection type: Elas...
2016/02/08
[ "https://Stackoverflow.com/questions/35281379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/151200/" ]
You are passing an `array` of strings to jQuery's `append` method. Simply join it first: ``` jQuery('.place').append(top.join('')); ``` When you call `toString()` on an array (which is what jQuery is doing here when you try to `append` an array of strings) it casts each array element to a string and puts a comma bet...
25,288
We have made a installation of Sitecore Experience Platform v9.3.0 (rev. 003498) (details below): * 2 servers as Content Management role * 2 servers as Content Delivery role * 2 servers as others roles (Processing, Reporting, Identity Server, XConnect, Identity Server, Marketing, Reference Data, Cortex) * 3 servers as...
2020/05/18
[ "https://sitecore.stackexchange.com/questions/25288", "https://sitecore.stackexchange.com", "https://sitecore.stackexchange.com/users/6980/" ]
It turns out to be that the device detection rule config in sitecore 9.3 doesn't include Content Management Role by default so by patching this role solves the problem. ``` <?xml version="1.0" encoding="utf-8" ?> <!-- Purpose: This include file configures the device detection rules component. --> <configuration xml...
33,307,860
I have a list of years, as follows: ``` year = ['2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013'] ``` I am trying to create a series of XML tags enclosed within another pre-existing tag, like so: ``` <intro> <exposures> <exposure year = "2005"></exposure> <exposure year = "2006...
2015/10/23
[ "https://Stackoverflow.com/questions/33307860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5199451/" ]
I suspect that the issue is this line: `exposure_tag = testsoup.new_tag('exposure', year = '')`. You have one tag and you are trying to append it to the same parent multiple times. Try this instead. ``` for x in year: exposure_tag = testsoup.new_tag('exposure', year = x) exp_tag.append(exposure_tag) in...
21,239
I'm setting up a projection map for a non-profit that will have images projected onto angular and unusually shaped walls. I use modul8 on my mac in the past, but this case is different. They use PC (in fact their whole show runs off of a laptop) and they want the ability to change the images based on the theme of the s...
2017/04/20
[ "https://avp.stackexchange.com/questions/21239", "https://avp.stackexchange.com", "https://avp.stackexchange.com/users/18709/" ]
It is certainly possible to use FCPX and AfterEffects as part of the same workflow. To do this effectively, you will need to use an intermediate codec that preserves image quality across successive generations. ProRes HQ 422 is a good baseline as an intermediate codec. There are higher quality ProRes codecs (XQ 4444) a...
6,262,319
I'm making a tool that can do some operations on a transition system and also need to visualise them. Though there isn't much documentation on the ruby-gem (this was the best I could get: <http://www.omninerd.com/articles/Automating_Data_Visualization_with_Ruby_and_Graphviz> ), I managed to make a graph from my trans...
2011/06/07
[ "https://Stackoverflow.com/questions/6262319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317275/" ]
I would try to add a node of shape `none` or `point` and draw the arrow from there. ``` @graph.add_node("Start", "shape" => "point", "label" => "" ) ``` And something like this in your loop ``` if cur_transition.from.name.nil? @graph.add_edge("Start", cur_transition.to.name) else @graph.add_edge(cur_trans...
74,240,319
I am trying to set my machines javac version to 11 from 18.0.2 and I'm doing the following steps 1. open ~/.zshenv 2. export JAVA\_HOME=$(/usr/libexec/java\_home -v11) 3. source ~/.zshenv When I check the version, I still get it as 18.0.2. Not sure what I am doing wrong here. Could someone please help me with this? B...
2022/10/28
[ "https://Stackoverflow.com/questions/74240319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6466023/" ]
What works like a charme for me is using jenv: <https://www.jenv.be/> With jenv you can also switch between different Java versions. Before using jenv, I relied on the Maven toolchains plugin: <https://maven.apache.org/plugins/maven-toolchains-plugin/> Thus, I actually never really worried about `JAVA_HOME` on MacOS...
33,068,428
Consider the following function for finding the second-to-last element of a list: ``` myButLast (x:xs) = if length xs > 1 then myButLast xs else x ``` This is an O(n^2) algorithm, because `length xs` is O(n) and is called O(n) times. What is the most elegant way to write this in Haskell such that `length` stops once...
2015/10/11
[ "https://Stackoverflow.com/questions/33068428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3154996/" ]
The easiest way is to avoid `length`: ``` myButLast (x : _ : []) = x -- base case myButLast (_ : xs) = myButLast xs ``` The definitive reference on patterns in Haskell is the language report: <https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-580003.17> GHC implements a few extensions describ...
7,756,437
Is that possible to get notification when Home button is pressed or Home Screen is launched? In [Android Overriding home key](https://stackoverflow.com/questions/5039500/android-overriding-home-key) thread i read that "it will be notified when the home screen is about to be launched". So is that possible, if yes how? ...
2011/10/13
[ "https://Stackoverflow.com/questions/7756437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/992888/" ]
> > Is that possible to get notification when Home button is pressed or Home Screen is launched? > > > Only by being a home screen.
2,347,497
> > Let $R$ be a ring. If $I\_1,\ldots, I\_k$ are ideals of $R$ and for all $i$: > > > $$I\_i + \bigcap\_{j\neq i} I\_j = R$$ > > > then for all $a\_1,\ldots,a\_k \in R$, there exists some $a \in R$ such that for all $i$, $a \equiv a\_i \pmod{I\_i}$ > > > I could prove this for $k=2$: for $a\_1,a\_2 \in R$, $a...
2017/07/05
[ "https://math.stackexchange.com/questions/2347497", "https://math.stackexchange.com", "https://math.stackexchange.com/users/360858/" ]
**Hint for the inductive step:** Suppose $I\_1,\dots, I\_k,I\_{k+1}$ are ideals in $R$ such that for any $1\le i \le k+1$, $$I\_i+\bigcap\_{\substack{1\le j \le k+1\\j\ne i}}I\_j=R. $$ Then, *a fortiori*, we have for any $1\le i \le k$, $$I\_i+\bigcap\_{\substack{1\le j \le k\\j\ne i}}I\_j=R. $$ So, given $a\_1, \d...
6,637,219
Let's say I accidentally evaluate an enormous variable--a list with a ba-jillion elements, or whatever. As they scroll down my screen and my computer crawls to a halt, is there a good way to interrupt this *without* killing my `*Python*` buffer? I'm using IPython via `python-mode.el` and `ipython.el` in emacs24 on Mac ...
2011/07/09
[ "https://Stackoverflow.com/questions/6637219", "https://Stackoverflow.com", "https://Stackoverflow.com/users/37772/" ]
Could you not just use the [DisplayAttribute](http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.displayattribute.aspx "DisplayAttribute")?
44,091,666
I set up my app to be able to send Apple Notifications using firebase and I verified that it works using the console. Now I want to do phone authentication which is built on top of APN. So I wrote this: ``` PhoneAuthProvider.provider().verifyPhoneNumber(phoneNumber) { verificationID, error in if error != nil { ...
2017/05/20
[ "https://Stackoverflow.com/questions/44091666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/666818/" ]
Tested with latest **Firebase iOS SDK i.e. 4.0.0** and **Xcode 8.3** Firstly , remove this key `FirebaseAppDelegateProxyEnabled` from info.plist. This is not needed. Now in **AppDelegate.swift** add following functions ``` import Firebase import UserNotifications @UIApplicationMain class AppDelegate: UIResponder, ...
50,488,521
I am looking for a solution to convert my string to `camelcaps` by the `dot` it contains. here is my string: `'sender.state'` I am expecting the result as : `'senderState'`; I tried this: `'sender.state'.replace(/\./g, '');` it removes the `.` but how to handle the `camel caps` stuff?
2018/05/23
[ "https://Stackoverflow.com/questions/50488521", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218349/" ]
You can pass a function to `.replace()`: ``` 'sender.state'.replace(/\.([a-z])/g, (match, letter) => letter.toUpperCase()); ```
51,094,339
I need to measure the execution time of a Python program having the following structure: ``` import numpy import pandas def func1(): code def func2(): code if __name__ == '__main__': func1() func2() ``` If I want to use "time.time()", where should I put them in the code? I want to get the executi...
2018/06/29
[ "https://Stackoverflow.com/questions/51094339", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9668218/" ]
In linux: you could run this file test.py using the time command > > time python3 test.py > > > After your program runs it will give you the following output: real 0m0.074s user 0m0.004s sys 0m0.000s [this link](https://stackoverflow.com/questions/556405/what-do-real-user-and-sys-mean-in-the-output-of-tim...
38,659,379
I've been experiencing an irritating issue that I cant get around. I am trying to `vagrant up` a centos7 system in this environment: * Windows 10 * Hyper-V (not anniversary update version) * Docker image "serveit/centos-7" or "bluefedora/hyperv-alpha-centos7" * OpenSSH installed, private key configured The contents ...
2016/07/29
[ "https://Stackoverflow.com/questions/38659379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2951942/" ]
Turns out, there is a known bug in Vagrant 1.8.5 (Will be fixed in 1.8.6): Details [here](https://github.com/mitchellh/vagrant/issues/7610) If you are using 1.8.5, you can download the updated version from PR [#7611](https://github.com/mitchellh/vagrant/pull/7611) using PowerShell: `[IO.File]::WriteAllLines("C:\Hash...
4,778,743
I created a wordpress blog (http://raptor.hk), but i am unable to set the right sidebar into correct position. i think i have missed something in CSS. the DIV is named "rightbar". I would like the DIV to be positioned right next to the content, within the white wrapper. Also, support of fluid layout (not moving on brow...
2011/01/24
[ "https://Stackoverflow.com/questions/4778743", "https://Stackoverflow.com", "https://Stackoverflow.com/users/188331/" ]
You can use the [Users API](http://code.google.com/appengine/docs/python/users/) to authenticate users - either using Google accounts, or OpenID. If you want sessions without user login, there are a number of libraries, such as [gaesessions](https://github.com/dound/gae-sessions).
36,967,907
i have a string array that contains 20 words. I made a function that take 1 random word from the array. But i want to know how can i return that word from array. Right now i am using void function, i had used char type but it wont work. Little help here ? Need to make word guessing game. CODE: ``` #include <iostrea...
2016/05/01
[ "https://Stackoverflow.com/questions/36967907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5058648/" ]
Make `random` return `string`. You also only need to seed the number generator once. Since you only want to get 1 random word from the array, you don't need a `for` loop. ``` string random(string names[]){ int randNum = 0; randNum = rand() % 20 + 1; return names[randNum]; } ``` Then, in the `main` functi...
24,587,704
So am trying to do some end to end testing in specflow using entity framework 6. I have code migrations enabled and my seed method written. I have a context factory to generate my context with a connection string that in influenced by a step definition. What I want to be able to do is in a Feature I want to create a ...
2014/07/05
[ "https://Stackoverflow.com/questions/24587704", "https://Stackoverflow.com", "https://Stackoverflow.com/users/109347/" ]
I personally see your bonus question as part of a potential overall approach. I dont see why `SEED` and `Migration` need to be so tightly coupled. A basic pattern that works with Multiple DBs. a) By default Use Context against a DB with No initializer ``` Database.SetInitializer(new ContextInitializerNone<MYDbCont...
9,272,270
Hi I've an input button like ``` <input id="btnDelete" type="button" value="Delete" name="btnDelete" runat="server" onclick="return confirm('Are you sure you wish to delete these records?');" /> and my serverside code is Private Sub btnDelete_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ...
2012/02/14
[ "https://Stackoverflow.com/questions/9272270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225264/" ]
USE [OnClientClick](http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx#Y570) for your client side javascript validation ``` <asp:BUTTON id="btnDelete" name="btnDelete" value="Delete" onclick="btnDelete_ServerClick" OnClientClick="return confirm('Are...
53,834,396
Assuming that I have a QPushButton named `button`, I successfully do the following to allow **click** event: ``` class UI(object): def setupUi(self, Dialog): # ... self.button.clicked.connect(self.do_something) def do_something(self): # Something here ``` My question is: how can I ca...
2018/12/18
[ "https://Stackoverflow.com/questions/53834396", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9923495/" ]
To get what you want there are many methods but before pointing it by observing your code I see that you have generated it with Qt Designer so that code should not be modified but create another class that uses that code so I will place the base code: ``` from PyQt5 import QtCore, QtWidgets class UI(object): def ...
62,910,520
I tried to run `flutter pub get` and I got this error: ``` Error on line 1, column 1 of pubspec.lock: Unexpected character ╷ 1 │ │ ^ ╵ pub upgrade failed (65; ╵) ```
2020/07/15
[ "https://Stackoverflow.com/questions/62910520", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13753831/" ]
The file pubspec.lock is a generated file, so you can delete it and then regenerate it. Delete **pubspec.lock**. Run the following command: ``` flutter pub get ``` or ``` flutter pub upgrade ``` Notes on [pub upgrade](https://dart.dev/tools/pub/cmd/pub-upgrade) (you could probably skip the delete step).
3,788,859
let's say I have two xml strings: String logToSearch = "<abc><number>123456789012</number></abc>" String logToSearch2 = "<abc><number xsi:type=\"soapenc:string\" /></abc>" String logToSearch3 = "<abc><number /></abc>"; I need a pattern which finds the number tag if the tag contains value, i.e. the match should be f...
2010/09/24
[ "https://Stackoverflow.com/questions/3788859", "https://Stackoverflow.com", "https://Stackoverflow.com/users/457493/" ]
This is absolutely the wrong way to parse XML. In fact, if you need more than just the basic example given here, there's provably no way to solve the more complex cases with regex. Use an easy XML parser, like [XOM](http://www.xom.nu). Now, using xpath, query for the elements and filter those without data. I can only ...
877,690
How does a 3D model handled unit wise ? When i have a random model that i want to fit in my view port i dunno if it is too big or not, if i need to translate it to be in the middle... I think a 3d object might have it's own origine.
2009/05/18
[ "https://Stackoverflow.com/questions/877690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2566/" ]
You need to find a bounding volume, a shape that encloses all the object's vertices, for your object that is easier to work with than the object itself. Spheres are often used for this. Either the artist can define the sphere as part of the model information or you can work it out at run time. Calculating the optimal s...
32,747,720
I have a table called Product. I need to select all product records that have the MAX ManufatureDate. Here is a sample of the table data: ``` Id ProductName ManufactureDate 1 Car 01-01-2015 2 Truck 05-01-2015 3 Computer 05-01-2015 4 Phone 02-01-2015 5 Chair ...
2015/09/23
[ "https://Stackoverflow.com/questions/32747720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5150565/" ]
``` select * from product where manufactureDate = (select max(manufactureDate) from product) ``` The inner select-statements selects the maximum date, the outer all products which have the date.
68,118,208
``` CREATE TABLE mydataset.newtable (transaction_id INT64, transaction_date DATE) PARTITION BY transaction_date AS SELECT transaction_id, transaction_date FROM mydataset.mytable ``` The docs don't specify whether the PARTITION BY clause supports "required".
2021/06/24
[ "https://Stackoverflow.com/questions/68118208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3381013/" ]
Solved it finally by displaying more logs on the error message. The key action is to update Gradle in my project level build.gradle file, I changed: ``` classpath 'com.android.tools.build:gradle:4.0.2' ``` To: ``` classpath 'com.android.tools.build:gradle:4.2.1' ```
29,808,109
So, I am trying to read in a text file using VB.NET and add the values of each line into a SQL Server database table. The code I have this far reads in the first line but keeps trying to read in the same line and fails. It adds the first, but like I stated it fails after the first one. I am quite sure the problem is in...
2015/04/22
[ "https://Stackoverflow.com/questions/29808109", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3889163/" ]
Do the selection of the friend ID in a subquery, then join that with `users`. ``` SELECT u.firstname, u.lastname FROM users as u JOIN (SELECT DISTINCT IF(friends.sender = 75, friends.recipient, friends.sender) AS friend FROM friends WHERE 75 in (sender, recipient)) AS f ON f.friend = u.id ```
2,937,395
I have a JavaScript class that has a method: ``` function someClass() { this.someMethod = someClass_someMethod; } function someClass_someMethod() { // make an AJAX request } ``` The problem is that `someClass_someMethod()` needs to return the value of the AJAX request. I'm using jQuery's `$.getJSON()` meth...
2010/05/30
[ "https://Stackoverflow.com/questions/2937395", "https://Stackoverflow.com", "https://Stackoverflow.com/users/193619/" ]
Make your special view its own UIWindow. Set the UIWindow's windowLevel to UIWindowLevelStatusBar. If it still isn't on top, you can use bringSubviewToFront: on the UIWindow (remember, a UIWindow is a UIView) to bring it to the top of that level.
276,080
Given all variables are in $\mathbb{R}$, and $\{ a, d\} \neq 0$, solve for $\theta$: $$a \sin^2 \theta + b \sin \theta + c + d \cos^2 \theta + e \cos \theta + f = 0$$ as posed in [this question](https://math.stackexchange.com/questions/4577312/solving-quadratic-function-of-sine-and-cosine#4577312). The straightforwa...
2022/11/15
[ "https://mathematica.stackexchange.com/questions/276080", "https://mathematica.stackexchange.com", "https://mathematica.stackexchange.com/users/9735/" ]
Mathematica has no trouble solving ``` eqn = a Sin[θ]^2 + b Sin[θ] + c + d Cos[θ]^2 + e Cos[θ] + f == 0; subs = {Sin[θ] -> sin, Cos[θ] -> cos}; solution = Solve[(eqn /. subs) && sin^2 + cos^2 == 1, {sin, cos}]; ``` though the solution is rather large, and may not be useful to you.
49,124,177
I have a class where written is a function creating my button: LoginButton.swift ``` func createButton() { let myButton: UIButton = { let button = UIButton() button.addTarget(self, action: #selector(Foo().buttonPressed(_:)), for: .touchUpInside) }() } ``` Now in my second class, Foo.swift, ...
2018/03/06
[ "https://Stackoverflow.com/questions/49124177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9449419/" ]
The action method is called in the target object. Thus, you have either to move `buttonPressed` to the class which contains `createButton` or to pass an instance of `Foo` as a target object. But note that a button is not the owner of its targets. So, if you just write: ``` button.addTarget(Foo(), action: #selector(bu...
32,173,907
I am new to Apache. I have 2 jboss (Jboss as 7.1.1) and apache httpd server. I am using mod\_cluster for load balancing. I wish to hide the jboss url from user and wish to show the user clean urls. for e.g. www.mydomain.com will be having my static website. subdomain.mydomain.com should go to mydomain.com:8080/my...
2015/08/24
[ "https://Stackoverflow.com/questions/32173907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2392795/" ]
You could roll your own without too much coding using `do.call`: ``` partial <- function(f, ...) { l <- list(...) function(...) { do.call(f, c(l, list(...))) } } ``` Basically `partial` returns a function that stores `f` as well as the originally provided arguments (stored in list `l`). When this function ...
22,162,560
How to make a button be at the bottom of div and at the center of it at the same time? ```css .Center { width: 200px; height: 200px; background: #0088cc; margin: auto; padding: 2%; position: absolute; top: 0; left: 0; bottom: 0; right: 0; } .btn-bot { position: absolute; bottom: ...
2014/03/04
[ "https://Stackoverflow.com/questions/22162560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2789810/" ]
Give the parent element… ``` display: table; text-align: center; ``` …and its child element… ``` display: table-cell; vertical-align: bottom; ``` This way you do not need to know the width of the child element in case it changes, thus requiring no negative margins or workarounds.
60,878,489
When I generate the production version of my PWA built with VueJS I got this error in Google Chrome after deploying it to my server: * `Uncaught SyntaxError: Unexpected token '<'` in app.21fde857.js:1 * `Uncaught SyntaxError: Unexpected token '<'` in chunk-vendors.d1f8f63f.js:1 I take a look in the Network tab of the...
2020/03/27
[ "https://Stackoverflow.com/questions/60878489", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12542704/" ]
Here is a solution that doesn't require hand-editing your dist assets. Simply add the following property to the exports of your vue.config.js: `publicPath: './'`
22,094,668
I have a database, I mapped it via Ado.net entity model, now I want to expose a single class from my model via WCF service. How can it be achieved?
2014/02/28
[ "https://Stackoverflow.com/questions/22094668", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2606389/" ]
Just use specifc CSS rules as: ``` .yellow:hover ~ #slider { background: yellow !important; } ``` [SEE jsFiddle](http://jsfiddle.net/GJQA5/1/)
30,546,943
``` <form id="jtable-edit-form" class="jtable-dialog-form jtable-edit-form"> <div class="jtable-input-field-container"> <div class="jtable-input-label">Type</div> <div class="jtable-input jtable-text-input"> <input class="" id="Edit-configType" type="text" name="configType"> </div> </div> <div class...
2015/05/30
[ "https://Stackoverflow.com/questions/30546943", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1993534/" ]
You can try this: ``` $( "div.jtable-input-label:contains('Key')" ) .closest( "div.jtable-input-field-container" ) .css( "display", "none" ); ```
33,904,005
I'm trying to modify elements of an array in a function. This works fine when kept in main but when I port it to a function it segfaults after accessing the first member of the array. The code below is just a reduced version of my actual code to show where I'm getting the segfault. ``` #include <stdio.h> #include <s...
2015/11/24
[ "https://Stackoverflow.com/questions/33904005", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5601548/" ]
`votersPtr[i]->id`, which is the same as `(*votersPtr[i]).id` should be `(*votersPtr)[i].id`.
397,446
I want to draw complete binary tree with some portion highlighted. I am able to draw the complete binary tree, but not able to highlight the specified portion. I want to draw the digram given below: [![enter image description here](https://i.stack.imgur.com/mj9OZ.jpg)](https://i.stack.imgur.com/mj9OZ.jpg) Till now I...
2017/10/22
[ "https://tex.stackexchange.com/questions/397446", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/142684/" ]
I think, in theory, that this should be possible by adding ``` tikz={\node[draw,circle,red,fit=()(!1)(!2)} ``` to the root of the node that you want to circle. Here `()` refers to the node and `(!1)` and `(!2)` its children. Unfortunately, this doesn't quite work because it gives: [![enter image description here](...
67,715,975
I have a website for a project that needs to summarize all of the budget categories in one column. For example I have a column which contains: Categories: Water,Electricity,Gas,Rentals,Hospital Fees,Medicine,Personal Care,Fitness, I want to select the sum of water,electricity,gas,rentals and name it as utility bi...
2021/05/27
[ "https://Stackoverflow.com/questions/67715975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16044580/" ]
You'd have some other table perhaps, or another column on this table, that maps the specific bills to a general group or category You would then run a query like (if you put the category group in the main table) ``` SELECT categorygroup, sum(amount) FROM bills GROUP BY categorygroup ``` Or (if you have a separate t...
381,278
Since I have osxfuse installed it would be nice if I could use it. There are a [lot of](https://apple.stackexchange.com/questions/73156/) (heavily) outdated [articles](https://apple.stackexchange.com/questions/140536/) here, saying that it is not [possible](https://apple.stackexchange.com/questions/128060/). Is this st...
2020/02/04
[ "https://apple.stackexchange.com/questions/381278", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/66939/" ]
> > **Update**: According to this [document in homebrew-core](https://github.com/Homebrew/homebrew-core/pull/64491) from November 2020, Homebrew maintainers no longer update or support macFUSE formulae, and Homebrew's continuous integration doesn't test them. macFUSE formulae will eventually be removed in the indeterm...
584,665
In Excel, if I have two lines in A1: ``` Hello World ``` but if I go over to A2 and type `=lower(A1)`, I get: ``` helloworld ``` How can I preserve the newline between *Hello* and *World*?
2013/04/18
[ "https://superuser.com/questions/584665", "https://superuser.com", "https://superuser.com/users/210559/" ]
Use `=lower(A1)` and then turn on `Wrap Text` for that cell.
49,572,567
I'm trying to filter a simple `HTML` table with the filter being determined by multiple radio buttons. The goal is to show/hide any rows that contain/don't contain the words in the filter. For example if I select "**yes**" on the "`auto`" filter and "**no**" on the "manually" filter it should look in the column named ...
2018/03/30
[ "https://Stackoverflow.com/questions/49572567", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8641691/" ]
Try this, I think this is what you want: ```js $(document).ready(function(){ $('input[type="radio"]').change(function () { var firstRow = 'name'; var auto = $('input[name="auto"]:checked').prop('value') || ''; var manually = $('input[name="manually"]:checked').prop('value') || ''; ...
13,726,429
I am trying to do a basic string replace using a regex expression, but the answers I have found do not seem to help - they are directly answering each persons unique requirement with little or no explanation. I am using `str = str.replace(/[^a-z0-9+]/g, '');` at the moment. But what I would like to do is allow all alp...
2012/12/05
[ "https://Stackoverflow.com/questions/13726429", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1359306/" ]
This should work : ``` str = str.replace(/[^a-z0-9-]/g, ''); ``` Everything between the indicates what your are looking for 1. `/` is here to delimit your pattern so you have one to start and one to end 2. `[]` indicates the pattern your are looking for on one specific character 3. `^` indicates that you want every...
5,223,716
I am trying to insensitive replace string, so I'm using str\_ireplace() but it does something I dont want and I have no clue how to overcome this problem. so this is my code: ``` $q = "pArty"; $str = "PARty all day long"; echo str_ireplace($q,'<b>' . $q . '</b>',$str); ``` The output will be like that: `"<b>pArty</...
2011/03/07
[ "https://Stackoverflow.com/questions/5223716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519002/" ]
You could do this with `preg_replace`, e.g.: ``` $q = preg_quote($q, '/'); // in case it has characters of significance to PCRE echo preg_replace('/' . $q . '/i', '<b>$0</b>', $str); ```
34,160
I'm making a malware software in my final thesis at the university. I won't use it ever, and it was made by educational and scientific purposes only. But my university will publish it, giving the opportunity for everyone to use it. If someone commit a crime with my software, can I get in trouble?
2018/12/07
[ "https://law.stackexchange.com/questions/34160", "https://law.stackexchange.com", "https://law.stackexchange.com/users/-1/" ]
> > my university will publish it, giving the opportunity for everyone to > use it. If someone commit a crime with my software, can I get in > trouble? > > > I would say "No" for three reasons. I will assume that you are in a jurisdiction of the U.S. or reasonably similar thereto. First, the malware code is par...
2,009,437
How can I get the @@IDENTITY for a specific table? I have been doing ``` select * from myTable ``` as I assume this sets the scope, from the same window SQL query window in SSMS I then run ``` select @@IDENTITY as identt ``` It returns identt as null which is not expected since myTable has many entrie in it a...
2010/01/05
[ "https://Stackoverflow.com/questions/2009437", "https://Stackoverflow.com", "https://Stackoverflow.com/users/127257/" ]
You can use [IDENT\_CURRENT](http://msdn.microsoft.com/en-us/library/ms175098.aspx) ``` IDENT_CURRENT( 'table_name' ) ``` Note that IDENT\_CURRENT returns the last identity value for the table **in any session and any scope**. This means, that if another identity value was inserted after your identity value then you...
14,225,659
I have found that one of the Microsoft Reporting controls (the Chart) is inadequate for my needs. Since these controls aren't extensible, I've extended the functionality of a WPF control and am saving the control as a graphic. Unfortunately, ReportViewer's image control doesn't support vector graphics, either. Therefor...
2013/01/08
[ "https://Stackoverflow.com/questions/14225659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1435756/" ]
My imperfect, but working solution is to use text item placeholders that match the background to mark the positions in the .RDLC report. After generating the PDF, these are identified by way of inheriting iTextSharp's LocationTextExtractionStrategy (as per [this entry by greenhat](https://stackoverflow.com/questions/45...
25,428,870
I'm trying to figure out how to write a decorator to check if the function was called with specific optional argument. This may not be the pythonic way of checking for arguments, but I'd like to know the solution using decorators regardless. Here is an example of what I'm looking for: ``` @require_arguments("N", "p") ...
2014/08/21
[ "https://Stackoverflow.com/questions/25428870", "https://Stackoverflow.com", "https://Stackoverflow.com/users/249341/" ]
Here you go: ``` def require_arguments(*reqargs): def decorator(func): def wrapper(*args, **kwargs): for arg in reqargs: if not arg in kwargs: raise TypeError("Missing %s" % arg) return func(*args, **kwargs) return wrapper return decor...
71,165,098
What is an appropriate way to solve the following example with swift? I know because of type erasure that you cannot assign `StructB` to `item2` in the constructor. In other languages like *Java* I would solve the problem by not having a generic class parameter `T` in the `Container` struct but let vars `item` and `it...
2022/02/17
[ "https://Stackoverflow.com/questions/71165098", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3477946/" ]
For the problem as described, the answer is very straightforward: ``` struct Container<T: ProtocolA> { var item: T var item2: StructB // This isn't T; you hard-coded it to StructB in init init(item: T) { self.item = item self.item2 = StructB() } } let container = Container(item: Stru...
44,386,174
``` class Node: def __init__(self, data = None, next = None): self.data = data self.next = next class LinkedList(Node): def __init__(self, l_size = 0, head = None, tail = None): Node.__init__(self) self.l_size = 0 self.head = head self.tail = tail def add(self, data): n = Node(data, ...
2017/06/06
[ "https://Stackoverflow.com/questions/44386174", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4982544/" ]
Simply aggregate your table per `user_id` and use `HAVING` to ensure both conditions are met for the user. ``` select user_id from settings group by user_id having count(case when token = 'language' and value = 'en' then 1 end) > 0 and count(case when token = 'newsletter' AND value = 1 then 1 end) > 0 ``` You can...
69,984,598
I tried using a lambda expression and `count_if()` to find the same string value in a `vector`, but it didn't work. The error message is: > > variable 'str' cannot be implicitly captured in a lambda with no capture-default specified > > > ```cpp std::vector<std::string> hello{"Mon","Tue", "Wes", "perfect","Sun"};...
2021/11/16
[ "https://Stackoverflow.com/questions/69984598", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16188928/" ]
@Steven The brackets `[]` of lambda functions, are called a *capture list*. They define the scope of variables that the lambda function uses. See [this reference](https://en.cppreference.com/w/cpp/language/lambda). When you use this formatting `[&]`, it means you can see all the variables (by reference) of the current...
11,573,562
In my current project, I am making a sticky-note type application in which the user can have multiple instances open of the same form. However, I was wondering if there was a way in C# where I can create a new instance of form1 however have the new form's title/text/heading to be form2. If this is achievable, I would ...
2012/07/20
[ "https://Stackoverflow.com/questions/11573562", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1539802/" ]
Try accessing the forms properties from the class: ``` MyForm newForm = new MyForm(); newForm.Show(); newForm.Text = "Form2"; ``` Or call a method from the current form to set the text: ``` // In MyForm public void SetTitle(string text) { this.Text = text; } // Call the Method MyForm newForm = new MyForm(); ne...
29,709,291
Chromecast session status returns undefined on Chrome mobile ios. The session exists and has other properties defined, like sessionID. On the desktop, the session status returns "connected", "disconnected", or "stopped" as expected. Is this a bug with Chrome ios? Is there another way to detect the session status?
2015/04/17
[ "https://Stackoverflow.com/questions/29709291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4634213/" ]
Here's one alternative using `ifelse` ``` > transform(df, NewSize=ifelse(Month==1, Size*Month1, ifelse(Month==2, Size*Month2, Size*Month3))) Orig Dest Month Size Month1 Month2 Month3 NewSize 1 A B 1 30 1.0 0.6 0.0 30 2 B A 1 20 0.2 1.0 1.0 4 3 ...
1,148,807
How would I solve this differential eqn $$xdy - ydx = (x^2 + y^2)^{1/2} dx$$ I tried bringing the sq root term to the left and it looked like a trigonometric substitution might do the trick, but apparently no. Any help would be appreciated.
2015/02/15
[ "https://math.stackexchange.com/questions/1148807", "https://math.stackexchange.com", "https://math.stackexchange.com/users/117251/" ]
$$x\frac{dy}{dx} - y = (x^2 + y^2)^{1/2} $$ is an ODE of the homogeneous kind. The usual method to solve it is to let $y(x)=x\:f(x)$ This leads to an ODE of the separable kind easy to solve. The final result is $y=c\:x^2-\frac{1}{4\:c}$
21,772,974
I am coding a PHP script, but I can't really seem to get it to work. I am testing out the basics, but I don't really understand what GET and POST means, what's the difference? All the definitions I've seen on the web make not much sense to me, what I've coded so far (but since I don't understand POST and GET, I don't k...
2014/02/14
[ "https://Stackoverflow.com/questions/21772974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3077765/" ]
$\_POST isn't working for you because you have the form method set to get. ``` <form name="mail_sub" method="post"> ``` There's plenty of better info online as to the difference between post and get so I won't go into that but this will fix the issue for you. Change your PHP as well. ``` if ( isset( $_POST['theirn...
39,350,744
I created a custom Lucene index in a Sitecore 8.1 environment like this: ```xml <?xml version="1.0"?> <configuration xmlns:x="http://www.sitecore.net/xmlconfig/"> <sitecore> <contentSearch> <configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch"> <indexes hin...
2016/09/06
[ "https://Stackoverflow.com/questions/39350744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6144330/" ]
After some research I came to the conclusion that to match all the requirements a custom crawler was the only solution. Blogged the code: <http://ggullentops.blogspot.be/2016/10/custom-sitecore-index-crawler.html> The main reason was that we really had to be able to set this per index - which is not possible with the ...
39,386,415
I wrote a piece of code to learn more about `Comparator` function of java collection. I have two sets having 3 elements in each. and i want to compare. I post my code below and output of counter variable. Can anyone explain why variable `i` gives this weird output ?? I could not understand flow. ``` public class TestP...
2016/09/08
[ "https://Stackoverflow.com/questions/39386415", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3042916/" ]
I'm not sure what you are finding strange. You have **two** TreeSet instances, each having its own `CompareID` instance serving as `Comparator`, and each `CompareID` instance maintains it's own counter. Therefore it's not a surprise to see each counter values (0,1,2,etc...) appearing twice. As for the order of appeara...
26,504,553
I have 5 imageviews and I am updating them based on value but the problem is for updating all of them I have redundant code for eacg image updation expect the specific imageView object. Here is example, I have such 5 methods to update each imageview which I guess is not optimal solution. ``` public void imageThird(i...
2014/10/22
[ "https://Stackoverflow.com/questions/26504553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4132634/" ]
I just tested it with a sample project. It works fine. There must be something wrong with your wiring up the cell. Here is my code. Only indicating changes from plain vanilla tab bar project template. ![enter image description here](https://i.stack.imgur.com/fAKkQ.png) ``` // FirstViewController.swift func tableVi...
1,787,006
I am working to integrate data from an external web service in the client side of my appliction. Someone asked me to test the condition when the service is unavailable or down. Anyone have any tips on how to block this site temporarily while we run the test to see how the service degrades? For those curious we are tes...
2009/11/24
[ "https://Stackoverflow.com/questions/1787006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10676/" ]
Create some Mock-Webservice class or interface (and [inject](http://martinfowler.com/articles/injection.html) [it](http://www.youtube.com/watch?v=hBVJbzAagfs)). In there, you could test the response of your system to webservice failures and also what happens, if a web-service request take longer than expected or actual...
56,761,464
I need to pick a random number from 31 to 359. ``` rand(31, 359); ``` I need the number is not part from this array of numbers: ``` $badNumbers = array(30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360); ``` How can I do this please? Thanks.
2019/06/25
[ "https://Stackoverflow.com/questions/56761464", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10296344/" ]
I would probably do this as it completes when one is found: ``` while(in_array($rand = rand(31, 359), $badNumbers)); echo $rand; ``` Here is another way using an array: ``` $good = array_diff(range(31, 359), $badNumbers); echo $good[array_rand($good)]; ``` Or randomize and choose one: ``` shuffle($good); echo a...
35,349
I'm making a game with target (orbit camera). I want to limit camera movements when in room. So that camera don't go through walls when moving around target and along the ground. What are common approaches? Any good links with tutorials? I use Unity3D, nevertheless I'm good with a general solution to the problem
2012/08/31
[ "https://gamedev.stackexchange.com/questions/35349", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/19462/" ]
Make a snake game with it. Make a shooter game with it. Make some simple well known games to start off. Once you've done this, you should be more confident with your engine, and making these games will give you ideas on where to keep going.
40,655,245
I'm trying to remove gray color outline of images. I saw that that outline means error because image tags don't have source properties. but if i add `src="image.jpg"`, hovering doesn't work. how to fix it? so confused.... this is my code ```css #item1 { background-image: url('cushion01.jpg'); height: 300px; ...
2016/11/17
[ "https://Stackoverflow.com/questions/40655245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6650139/" ]
Strange thing is that you are trying to set background to `<img>` tag. If I were you I'd use `<div>` instead. Then It would be very simple: HTML: ``` <div class= "secondary__item" style="width: 100%; height : 850px;"> <ul class="item-images"> <li class="item-image"><div class="item" id="item1" ><...
37,546,012
I trying to build a Simon game but I'm messing with CSS. [![simon game](https://i.stack.imgur.com/xWinG.jpg)](https://i.stack.imgur.com/xWinG.jpg) (source: [walmartimages.com](http://i5.walmartimages.com/dfw/dce07b8c-837a/k2-_c8eba155-7ff4-45e8-86ab-704862d4a446.v1.jpg)) I don't know my mistakes but inline-block ...
2016/05/31
[ "https://Stackoverflow.com/questions/37546012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3531612/" ]
Remove the position absolute: ```css body { text-align: center; } #box { width: 500px; height: 500px; border-radius: 100%; position: relative; margin: auto; background-color: #333; top: 10vh; box-shadow: 0px 0px 12px #222; } #box .pad { width: 240px; height: 240px; float: left...