qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
59,893,950
I'm doing training of Mule4. In WT-5 of module 4 I have to add API from exchange. But I cannot find mule--> manage API option. Don't know what to do. Really appreciate the help. :)
2020/01/24
[ "https://Stackoverflow.com/questions/59893950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11089070/" ]
First declare in your constructor from ActivatedRoute from '@angular/router'; ``` constructor ( private route: ActivatedRoute ){} ``` Then by using this code you will get your query params ``` this.route.queryParams.subscribe(params =>{ let Id = params ["Id"]; } ```
Import Router in component. ``` import { Router } from '@angular/router'; ``` pass it in constructor ``` private router : Router ``` Now this will give router parameter ``` this.router.url; ```
59,893,950
I'm doing training of Mule4. In WT-5 of module 4 I have to add API from exchange. But I cannot find mule--> manage API option. Don't know what to do. Really appreciate the help. :)
2020/01/24
[ "https://Stackoverflow.com/questions/59893950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11089070/" ]
You need to unsubscribe from anything you subscribe to to prevent memory leaks. ``` paramsSubscription$: Subscription; id: string; constructor(private route: ActivatedRoute, private router: Router) {} ngOnInit() { this.paramsSubscription$ = this.route.paramMap.subscribe( (params: ParamMap) => { this.id ...
Import Router in component. ``` import { Router } from '@angular/router'; ``` pass it in constructor ``` private router : Router ``` Now this will give router parameter ``` this.router.url; ```
59,893,950
I'm doing training of Mule4. In WT-5 of module 4 I have to add API from exchange. But I cannot find mule--> manage API option. Don't know what to do. Really appreciate the help. :)
2020/01/24
[ "https://Stackoverflow.com/questions/59893950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11089070/" ]
First declare in your constructor from ActivatedRoute from '@angular/router'; ``` constructor ( private route: ActivatedRoute ){} ``` Then by using this code you will get your query params ``` this.route.queryParams.subscribe(params =>{ let Id = params ["Id"]; } ```
``` this.route.params.forEach((params: Params) => { const id = +params['id']; // more stuff }); ```
59,893,950
I'm doing training of Mule4. In WT-5 of module 4 I have to add API from exchange. But I cannot find mule--> manage API option. Don't know what to do. Really appreciate the help. :)
2020/01/24
[ "https://Stackoverflow.com/questions/59893950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11089070/" ]
You need to unsubscribe from anything you subscribe to to prevent memory leaks. ``` paramsSubscription$: Subscription; id: string; constructor(private route: ActivatedRoute, private router: Router) {} ngOnInit() { this.paramsSubscription$ = this.route.paramMap.subscribe( (params: ParamMap) => { this.id ...
``` this.route.params.forEach((params: Params) => { const id = +params['id']; // more stuff }); ```
69,170,261
I use this code to find closest number in array, but this method also return number below target number. So if target is 5 and array have 4 a 7 it will return 4. How can i change this code to show clostest number above target. ``` public static int findClosest(Integer[] arr, int target) { int idx = 0; ...
2021/09/13
[ "https://Stackoverflow.com/questions/69170261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8960535/" ]
Just fix the code according to your requirement: find the minimal number of those above the target. Also it would make sense to check for `null` values in the input array. ```java public static Integer findClosestAbove(Integer[] arr, int target) { Integer min = null; for (Integer x : arr) { if (x != n...
Here's one way to do it (requires importing java.util package) - sort the array in ascending order, then find the first higher element, if it exists. A higher value may not exist in the array, so that error has to be handled. ``` public static int findClosestHigher(Integer[] arr, int target) throws NoSuchElementExcept...
69,170,261
I use this code to find closest number in array, but this method also return number below target number. So if target is 5 and array have 4 a 7 it will return 4. How can i change this code to show clostest number above target. ``` public static int findClosest(Integer[] arr, int target) { int idx = 0; ...
2021/09/13
[ "https://Stackoverflow.com/questions/69170261", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8960535/" ]
Just fix the code according to your requirement: find the minimal number of those above the target. Also it would make sense to check for `null` values in the input array. ```java public static Integer findClosestAbove(Integer[] arr, int target) { Integer min = null; for (Integer x : arr) { if (x != n...
One alternative is the method below: ``` public static int findClosest(Integer[] arr, int target) { int temp = Integer.MAX_VALUE; for(int i: arr){ if(i > target && i < temp){ temp = i; } } return temp; } ``` The way this code works is that it star...
141,586
The "correct" way to write a set without a specific element is as follows: $S \setminus \{s\}$ But in some contexts this is cumbersome to write/type or read, and it detracts from the flow of the writing. Is it acceptable to just use $S \setminus s$? **Edit:** By "cumbersome" i mean they look bad when you're trying to...
2012/05/06
[ "https://math.stackexchange.com/questions/141586", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27373/" ]
If you have to write this many times in a piece of text, and there is no possibility of confusion of $s$ being an actual set of elements you are removing, it is okay to first write one sentence reminding the reader of this abuse of notation ("In the following, we write $S\setminus s$ to mean $S \setminus \{s\}$") and t...
To answer your question, no, that is not acceptable; readers will be puzzled, or confused, and perhaps annoyed. If you the braces really bother you, you can define a new operator. Say something like "We define $S\dot-x$ to be an abbreviation for $S\setminus\{x\}$". People might raise an eyebrow at that, but not as muc...
141,586
The "correct" way to write a set without a specific element is as follows: $S \setminus \{s\}$ But in some contexts this is cumbersome to write/type or read, and it detracts from the flow of the writing. Is it acceptable to just use $S \setminus s$? **Edit:** By "cumbersome" i mean they look bad when you're trying to...
2012/05/06
[ "https://math.stackexchange.com/questions/141586", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27373/" ]
If you have to write this many times in a piece of text, and there is no possibility of confusion of $s$ being an actual set of elements you are removing, it is okay to first write one sentence reminding the reader of this abuse of notation ("In the following, we write $S\setminus s$ to mean $S \setminus \{s\}$") and t...
It really depends on the context. For *a lot* of mathematics, I would agree with [Brian M. Scott](https://math.stackexchange.com/questions/141586/using-setminus-notation-with-set-elements#comment326117_141588): in stuff like elementary real/complex analysis (and similar some basic constructions in algebra), one almos...
141,586
The "correct" way to write a set without a specific element is as follows: $S \setminus \{s\}$ But in some contexts this is cumbersome to write/type or read, and it detracts from the flow of the writing. Is it acceptable to just use $S \setminus s$? **Edit:** By "cumbersome" i mean they look bad when you're trying to...
2012/05/06
[ "https://math.stackexchange.com/questions/141586", "https://math.stackexchange.com", "https://math.stackexchange.com/users/27373/" ]
It really depends on the context. For *a lot* of mathematics, I would agree with [Brian M. Scott](https://math.stackexchange.com/questions/141586/using-setminus-notation-with-set-elements#comment326117_141588): in stuff like elementary real/complex analysis (and similar some basic constructions in algebra), one almos...
To answer your question, no, that is not acceptable; readers will be puzzled, or confused, and perhaps annoyed. If you the braces really bother you, you can define a new operator. Say something like "We define $S\dot-x$ to be an abbreviation for $S\setminus\{x\}$". People might raise an eyebrow at that, but not as muc...
786,079
Question: does AD send a user's access token across the network? Research: The following two passages contradict themselves--given that TGTs are transmitted across the network by design. From the 5th Edition of Active Directory by Oreilly: > > Most importantly, the user's access token is stored in the TGT. The > ...
2016/06/24
[ "https://serverfault.com/questions/786079", "https://serverfault.com", "https://serverfault.com/users/327341/" ]
Those descriptions are a bit vague. There are two tokens. A process Access Token, and a Kerberos token. The process token is specific to the local computer. "In Windows implementation, the application server derives the authorization data (PAC) and requests Windows OS to generate an access token." <https://blogs.msd...
yellow, the information from the 2008 AD Resource kit is correct, Access tokens are created by local systems and then attached to threads that user is running. there is some very good information here: <https://msdn.microsoft.com/en-us/library/windows/desktop/aa374909(v=vs.85).aspx> and here <https://technet.micros...
23,364,582
So I am attempting to use the Android SQLite Asset Helper to pre-package a database with my application and I have run into an issue. Here's a little bit of information to get started: * Using Android Studio (gradle) * I have modified build.grade to include `compile 'com.readystatesoftware.sqliteasset:sqliteassethelpe...
2014/04/29
[ "https://Stackoverflow.com/questions/23364582", "https://Stackoverflow.com", "https://Stackoverflow.com/users/433866/" ]
You can choose 2 variants 1.) JS (imho the best) ``` $(window).load(function() { //call the equalize height function equalHeight($("div.left, div.middle, div.right")); //equalize function function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(th...
you have a few options without using `float`: 1. `display:table;` on parent and `display:table-cell` on child. **[DEMO](http://codepen.io/gc-nomade/pen/fJjCc)** 2. `display:flex` on parent . **[DEMO](http://codepen.io/gc-nomade/pen/DqbwH)** 3. And the old but still solid technique of the faux-column : **[DEMO](http://...
39,852,042
I have a `select` element and a `button`. When the option from the select element is changed, it evokes some function: ``` <select id="mySel" onchange="someFunction();"> <option value="1">Option 1</option> <option value="2">Option 2</option> ... </select> <input type="button" value="Click" onclick="docu...
2016/10/04
[ "https://Stackoverflow.com/questions/39852042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
change your button html. ``` <input type="button" value="Click" onclick="document.getElementById('mySel').selectedIndex = 0;someFunction();"/> ``` Or manually trigger change event as per mentioned links in comments.
Use this you'll get what you want. ```js function someFunction(select){ console.log('reached here'); } ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script> <select id="mySel" onchange="someFunction();"> <option value="1">Option 1</option> <option value=...
39,852,042
I have a `select` element and a `button`. When the option from the select element is changed, it evokes some function: ``` <select id="mySel" onchange="someFunction();"> <option value="1">Option 1</option> <option value="2">Option 2</option> ... </select> <input type="button" value="Click" onclick="docu...
2016/10/04
[ "https://Stackoverflow.com/questions/39852042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can add an event-listener when the DOM loads, sou you'll get the event callback every time it's fired "programatically" and no "event calls" inside the respective element tags, bringing you a cleaner code. Run this example, hope it helps: ```js // Wait for WINDOW LOAD window.onload = function() { // - Bind on...
change your button html. ``` <input type="button" value="Click" onclick="document.getElementById('mySel').selectedIndex = 0;someFunction();"/> ``` Or manually trigger change event as per mentioned links in comments.
39,852,042
I have a `select` element and a `button`. When the option from the select element is changed, it evokes some function: ``` <select id="mySel" onchange="someFunction();"> <option value="1">Option 1</option> <option value="2">Option 2</option> ... </select> <input type="button" value="Click" onclick="docu...
2016/10/04
[ "https://Stackoverflow.com/questions/39852042", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
You can add an event-listener when the DOM loads, sou you'll get the event callback every time it's fired "programatically" and no "event calls" inside the respective element tags, bringing you a cleaner code. Run this example, hope it helps: ```js // Wait for WINDOW LOAD window.onload = function() { // - Bind on...
Use this you'll get what you want. ```js function someFunction(select){ console.log('reached here'); } ``` ```html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.3/jquery.min.js"></script> <select id="mySel" onchange="someFunction();"> <option value="1">Option 1</option> <option value=...
52,628,683
I'm stuck at the point where can't align the text vertically and breaking two words apart in the middle of each circle. For instance word "Classic Collection" needs to be broken down like below, aligned vertically and centred in the circle. ``` Classic Collection ``` Wondering if someone could help me out to fini...
2018/10/03
[ "https://Stackoverflow.com/questions/52628683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1445513/" ]
Remove the no-wrapping code ``` text-overflow: ellipsis; white-space: nowrap; ``` from the span and use flexbox ```css body { background-color: #f7f7f7; } #coll_container .coll_item { display: inline-block; color: #333; list-style: none; border-radius: 50%; transition: 0.3s; width: 105px; ...
Remove ``` white-space: nowrap; ``` That stops the text from wrapping around. Fiddle [here](http://jsfiddle.net/67vhq4gd/)
52,628,683
I'm stuck at the point where can't align the text vertically and breaking two words apart in the middle of each circle. For instance word "Classic Collection" needs to be broken down like below, aligned vertically and centred in the circle. ``` Classic Collection ``` Wondering if someone could help me out to fini...
2018/10/03
[ "https://Stackoverflow.com/questions/52628683", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1445513/" ]
Remove the no-wrapping code ``` text-overflow: ellipsis; white-space: nowrap; ``` from the span and use flexbox ```css body { background-color: #f7f7f7; } #coll_container .coll_item { display: inline-block; color: #333; list-style: none; border-radius: 50%; transition: 0.3s; width: 105px; ...
I think you can do smth like this: ``` #coll_container .coll_item a span { display: flex; align-items: center; justify-content: center; font-weight: 600; border-radius: 50%; width: 95px; height: 95px; padding:2px; border: solid 3px #fff;} ```
1,493,888
> > **Possible Duplicate:** > > [Perl's AUTOLOAD in Python (**getattr** on a module)](https://stackoverflow.com/questions/1024455/perls-autoload-in-python-getattr-on-a-module) > > > I'm coming from a PHP background and attempting to learn Python, and I want to be sure to do things the "Python way" instead of h...
2009/09/29
[ "https://Stackoverflow.com/questions/1493888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175126/" ]
In Python, people usually avoid auto imports, just because it is not worth the effort. You may slightly remove startup costs, but otherwise, there is no (or should be no) significant effect. If you have modules that are expensive to import and do a lot of stuff that doesn't need to be done, rather rewrite the module th...
If you are learning Python and want to do things the Python way, then just import the modules. It's *very* unusual to find autoimports in Python code.
1,493,888
> > **Possible Duplicate:** > > [Perl's AUTOLOAD in Python (**getattr** on a module)](https://stackoverflow.com/questions/1024455/perls-autoload-in-python-getattr-on-a-module) > > > I'm coming from a PHP background and attempting to learn Python, and I want to be sure to do things the "Python way" instead of h...
2009/09/29
[ "https://Stackoverflow.com/questions/1493888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175126/" ]
Imports serve at least two other important purposes besides making the modules or contents of the modules available: 1. They serve as a sort of declaration of intent -- "this module uses services from this other module" or "this module uses services belonging to a certain class" -- e.g. if you are doing a security rev...
In Python, people usually avoid auto imports, just because it is not worth the effort. You may slightly remove startup costs, but otherwise, there is no (or should be no) significant effect. If you have modules that are expensive to import and do a lot of stuff that doesn't need to be done, rather rewrite the module th...
1,493,888
> > **Possible Duplicate:** > > [Perl's AUTOLOAD in Python (**getattr** on a module)](https://stackoverflow.com/questions/1024455/perls-autoload-in-python-getattr-on-a-module) > > > I'm coming from a PHP background and attempting to learn Python, and I want to be sure to do things the "Python way" instead of h...
2009/09/29
[ "https://Stackoverflow.com/questions/1493888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175126/" ]
In Python, people usually avoid auto imports, just because it is not worth the effort. You may slightly remove startup costs, but otherwise, there is no (or should be no) significant effect. If you have modules that are expensive to import and do a lot of stuff that doesn't need to be done, rather rewrite the module th...
You could auto-import the modules, but the most I have ever needed to import was about 10, and that is after I tacked features on top of the original program. You won't be importing a lot, and the names are very easy to remember.
1,493,888
> > **Possible Duplicate:** > > [Perl's AUTOLOAD in Python (**getattr** on a module)](https://stackoverflow.com/questions/1024455/perls-autoload-in-python-getattr-on-a-module) > > > I'm coming from a PHP background and attempting to learn Python, and I want to be sure to do things the "Python way" instead of h...
2009/09/29
[ "https://Stackoverflow.com/questions/1493888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175126/" ]
Imports serve at least two other important purposes besides making the modules or contents of the modules available: 1. They serve as a sort of declaration of intent -- "this module uses services from this other module" or "this module uses services belonging to a certain class" -- e.g. if you are doing a security rev...
If you are learning Python and want to do things the Python way, then just import the modules. It's *very* unusual to find autoimports in Python code.
1,493,888
> > **Possible Duplicate:** > > [Perl's AUTOLOAD in Python (**getattr** on a module)](https://stackoverflow.com/questions/1024455/perls-autoload-in-python-getattr-on-a-module) > > > I'm coming from a PHP background and attempting to learn Python, and I want to be sure to do things the "Python way" instead of h...
2009/09/29
[ "https://Stackoverflow.com/questions/1493888", "https://Stackoverflow.com", "https://Stackoverflow.com/users/175126/" ]
Imports serve at least two other important purposes besides making the modules or contents of the modules available: 1. They serve as a sort of declaration of intent -- "this module uses services from this other module" or "this module uses services belonging to a certain class" -- e.g. if you are doing a security rev...
You could auto-import the modules, but the most I have ever needed to import was about 10, and that is after I tacked features on top of the original program. You won't be importing a lot, and the names are very easy to remember.
64,507,365
I haven't been able to find anything on how this tag works. Why should I use the {% javascript %} instead of HTML script tag? Is there any difference? I've checked the Shopify [cheatsheet](https://www.shopify.com/partners/shopify-cheat-sheet) which describes every other tag, as well as sifted through several pages of g...
2020/10/23
[ "https://Stackoverflow.com/questions/64507365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9440171/" ]
If you are adding the `{% javascript %}` tag in a theme `section` context then: > > Sections can bundle their own script and style assets using the `javascript` and `stylesheet` tags. You should only need to use this for sections that are meant to be reused or installed on multiple themes or shops. > > > > > The...
It is simply a convenience for you. It offers you no special capabilities. It nice because to the less than stellar technical person, someone who might get a little Liquid but not much else, it is pretty clear that the stuff inside the tag is likely Javascript. They recommend you only use these tags if your section is ...
17,956,033
I tried to check if the subtype of Set that keySet() method of HashMap returns, and check if it is instance of HashSet, but it's not. Since I have a large set of keys and use keys.contains() heavily, so if it's not type of HashSet, the method can be expensive to use, and it did slow my program a lot. So do you know w...
2013/07/30
[ "https://Stackoverflow.com/questions/17956033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1570058/" ]
You can use two CSS classes to style the rows. ``` tr.own:hover { background: green; } tr.not:hover { background: red; } ``` <http://jsfiddle.net/6TYBb/215/>
How is this table generated? You could add different classes to the table rows to indicate which hover style you wish to use. Example: <http://jsfiddle.net/BkmaW/> ``` tr:hover { color: red; } tr.true:hover { color: green } ``` edit: removed "!important", had added it without reason.
17,956,033
I tried to check if the subtype of Set that keySet() method of HashMap returns, and check if it is instance of HashSet, but it's not. Since I have a large set of keys and use keys.contains() heavily, so if it's not type of HashSet, the method can be expensive to use, and it did slow my program a lot. So do you know w...
2013/07/30
[ "https://Stackoverflow.com/questions/17956033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1570058/" ]
You can use two CSS classes to style the rows. ``` tr.own:hover { background: green; } tr.not:hover { background: red; } ``` <http://jsfiddle.net/6TYBb/215/>
Simplest way: <http://jsfiddle.net/9gmrG/> Sub Class out the td so you have owned and not owned. Then trigger them on hover. ``` tr:hover{ background-color: #ccc; } tr:hover td.owned{ background-color: green; } tr:hover td.notowned{ background-color: red; } ```
48,502,148
I'm trying to push an object into an array named "contactBook" which is then stored into the local storage and i get the following error - This is the error description for all solutions(from research) that didn't work - > > Uncaught TypeError: Cannot read property 'push' of null > > > I have tried several solu...
2018/01/29
[ "https://Stackoverflow.com/questions/48502148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7879004/" ]
The problem is in the SendMessage function. The "wparam" argument is the index of the column you want to retrieve ``` int index = 2; SendMessage(hwnd, LVM_GETCOLUMNW, index, lpRemoteBuffer); ```
Thanks to Laurijssen, here is the working code: ``` [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)] struct LV_COLUMN { public System.Int32 mask; public System.Int32 fmt; public System.Int32 cx; public System.IntPtr pszText; public System.Int32 cch...
47,044,765
Code (lots of it, sorry): ``` #nea practice def re_election(): print("A re-election is needed") choice = int(input("Which test vote file would you like to use: ")) correct_choices = [1, 2] while choice not in correct_choices: choice = int(input("Error, try again: ")) if choice == 1: filename = "Test1_V...
2017/10/31
[ "https://Stackoverflow.com/questions/47044765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8849391/" ]
You can accomplish this by centering with flexbox CSS like so: ```css html, body { height: 100%; } body { background-color: black; display: flex; margin: 0; } video { margin: auto; width: 100%; } ``` ```html <video controls> <source src="https://www.w3schools.com/html/mov_bbb.mp4"> </video> ```
Have a look [at how bootstrap achieves this.](https://github.com/twbs/bootstrap/blob/7085988f06954413ac2c72fed23e30a38ecd6dff/scss/utilities/_embed.scss) They use a wrapping div to control the dimensions and set the video to be absolutely positioned with 100% width and height. It's a bit more flexible than Jon's soluti...
34,521,500
I was trying to implement a NODE JS get method where I could encode in the url parameters and send back responses like in Server Sent Events. For example, when I used: ``` curl -D- 'http://localhost:8030/update' ``` The server would return a message, and then keep the connection opened to return more messages (like ...
2015/12/30
[ "https://Stackoverflow.com/questions/34521500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4305344/" ]
You can't use a single HTTP request to listen for multiple event data. If you are really stuck with HTTP (i.e. WebSocket or WebRTC is not an option) then the technique you are looking for is called [long polling](https://en.wikipedia.org/wiki/Push_technology). This basically works this way: * Client sends request to s...
In general, http endpoints in Express aren't supposed to do things like that. If you want live event data, the best way is to use a web socket. That being said, [this thread](https://stackoverflow.com/questions/18857693/does-express-js-support-sending-unbuffered-progressively-flushed-responses) has an example on how t...
34,521,500
I was trying to implement a NODE JS get method where I could encode in the url parameters and send back responses like in Server Sent Events. For example, when I used: ``` curl -D- 'http://localhost:8030/update' ``` The server would return a message, and then keep the connection opened to return more messages (like ...
2015/12/30
[ "https://Stackoverflow.com/questions/34521500", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4305344/" ]
You can't use a single HTTP request to listen for multiple event data. If you are really stuck with HTTP (i.e. WebSocket or WebRTC is not an option) then the technique you are looking for is called [long polling](https://en.wikipedia.org/wiki/Push_technology). This basically works this way: * Client sends request to s...
socket.io or Webrtc is the best choice
31,745,522
I am trying to connect my c# application to visualFoxPro database. After getting data from foxpro table I will put it in SQL Server on realtime basis. In each table of Foxpro there is unique fields (for example `UID` and `station` in given snapshot), which is not readable. I Don't know it is encrypted or it is some f...
2015/07/31
[ "https://Stackoverflow.com/questions/31745522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2416140/" ]
``` class UserRepository : IUserRepository { ChatAppDBContext _db = new ChatAppDBContext(); public Login GetByUsernameAndPassword(LogIn login) { var userResult = _db.Users.FirstOrDefault(u => u.Email == login.Email & u.Password == login.UserPassword); if (userResult == null) ...
@Oluwafemi is correct. You just need to create a user "view model" to return. ``` class UserRepository : IUserRepository { ChatAppDBContext _db = new ChatAppDBContext(); public UserModel GetByUsernameAndPassword(LogIn login) { return _db.Users .Where(u => u.Email == login.E...
19,329,829
I am trying to parse an XML dump of Wikipedia to find certain links on each page using the Haskell Parsec library. Links are denoted by double brackets: `texttext[[link]]texttext`. To simplify the scenario as much as possible, let's say I am looking for the first link not enclosed in double curly braces (which can be n...
2013/10/12
[ "https://Stackoverflow.com/questions/19329829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2648842/" ]
Here's a more direct version that doesn't use a custom lexer. It does use `try` though, and I don't see how to avoid it here. The problem is that it seems we need a non-committing look ahead to distinguish double brackets from single brackets; `try` is for non-committing look ahead. The high level approach is that sam...
My solution does not use `try`, but is relatively complicated: I used your question as an excuse to learn how to create a lexer in Parsec without using [`makeTokenParser`](http://hackage.haskell.org/package/parsec-3.1.3/docs/Text-Parsec-Token.html#v%3amakeTokenParser) :D I avoid `try` because the only look ahead happe...
48,182,290
this autogenerated service (by NSwagStudio) needs an API\_BASE\_URL (InjectionToken) value in order to perform http requests how and where i can inject it? ``` /* tslint:disable */ //---------------------- // <auto-generated> // Generated using the NSwag toolchain v11.12.16.0 (NJsonSchema v9.10.19.0 (Newtonsoft.Js...
2018/01/10
[ "https://Stackoverflow.com/questions/48182290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820422/" ]
On the parent module create a provider for API\_BASE\_URL ``` export function getBaseUrl(): string { return AppConsts.baseUrl; } @NgModule({ declarations: [AppComponent], imports: [BrowserModule], providers: [{ provide: API_BASE_URL, useFactory: getBaseUrl }], bootstrap: [AppComponent] }) export class AppM...
THe best practice to put all constants in environment.ts and environment.prod.ts. Just create a new property their and import in your service. Your code will look like this: ``` // environment.ts export const environment = { production: false, API_BASE_URL: "baseUrlOfApiForDevelopment", }; // environment.prod.ts ...
48,182,290
this autogenerated service (by NSwagStudio) needs an API\_BASE\_URL (InjectionToken) value in order to perform http requests how and where i can inject it? ``` /* tslint:disable */ //---------------------- // <auto-generated> // Generated using the NSwag toolchain v11.12.16.0 (NJsonSchema v9.10.19.0 (Newtonsoft.Js...
2018/01/10
[ "https://Stackoverflow.com/questions/48182290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820422/" ]
As mentioned above, best is to put this in your environment settings then Angular will replace the appropriate base url depending on the environment you're in, e.g. in dev: ``` export const environment = { production: false, apiRoot: "https://localhost:1234", }; ``` Then you can just use useValue in your pr...
THe best practice to put all constants in environment.ts and environment.prod.ts. Just create a new property their and import in your service. Your code will look like this: ``` // environment.ts export const environment = { production: false, API_BASE_URL: "baseUrlOfApiForDevelopment", }; // environment.prod.ts ...
61,949,154
Following is my code which is **working fine if numberOfItemsInSection is greater than 1** but **if numberOfItemsInSection is equal to 1 it should display single cell but it is not happening**, for numberOfItemsInSection equals 1 noting is displayed and cellForItemAt is not called Also initial numberOfItemsInSection i...
2020/05/22
[ "https://Stackoverflow.com/questions/61949154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4153589/" ]
If the problem is `alert-error` not working you can use this after have the import statement of your message : ``` from django.contrib.messages import constants as messages MESSAGE_TAGS = { messages.ERROR: 'danger' } ``` Reference -> <https://docs.djangoproject.com/en/3.0/ref/contrib/messages/#message-tags>
@Sowjanya R Bhat The method you suggest can be hardcoded but I need to know, why isn't it implementing red alert my default. Your suggestion works however ``` <main role="main" class="container" > {% if messages %} {% for message in messages %} {% if message.tags == "error"%} <div class="alert aler...
61,949,154
Following is my code which is **working fine if numberOfItemsInSection is greater than 1** but **if numberOfItemsInSection is equal to 1 it should display single cell but it is not happening**, for numberOfItemsInSection equals 1 noting is displayed and cellForItemAt is not called Also initial numberOfItemsInSection i...
2020/05/22
[ "https://Stackoverflow.com/questions/61949154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4153589/" ]
If the problem is `alert-error` not working you can use this after have the import statement of your message : ``` from django.contrib.messages import constants as messages MESSAGE_TAGS = { messages.ERROR: 'danger' } ``` Reference -> <https://docs.djangoproject.com/en/3.0/ref/contrib/messages/#message-tags>
``` In your HTML: <script> setTimeout(function () { $('#flash').fadeOut('fast'); },5000); </script> <div id="flash"> {% if messages %} {% for message in messages %} <div class="alert alert-{{ message.tags}} m-0" role="alert"> <strong...
61,949,154
Following is my code which is **working fine if numberOfItemsInSection is greater than 1** but **if numberOfItemsInSection is equal to 1 it should display single cell but it is not happening**, for numberOfItemsInSection equals 1 noting is displayed and cellForItemAt is not called Also initial numberOfItemsInSection i...
2020/05/22
[ "https://Stackoverflow.com/questions/61949154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4153589/" ]
If the problem is `alert-error` not working you can use this after have the import statement of your message : ``` from django.contrib.messages import constants as messages MESSAGE_TAGS = { messages.ERROR: 'danger' } ``` Reference -> <https://docs.djangoproject.com/en/3.0/ref/contrib/messages/#message-tags>
just use `messages.warning` instead, it would at least show a color.
61,949,154
Following is my code which is **working fine if numberOfItemsInSection is greater than 1** but **if numberOfItemsInSection is equal to 1 it should display single cell but it is not happening**, for numberOfItemsInSection equals 1 noting is displayed and cellForItemAt is not called Also initial numberOfItemsInSection i...
2020/05/22
[ "https://Stackoverflow.com/questions/61949154", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4153589/" ]
If the problem is `alert-error` not working you can use this after have the import statement of your message : ``` from django.contrib.messages import constants as messages MESSAGE_TAGS = { messages.ERROR: 'danger' } ``` Reference -> <https://docs.djangoproject.com/en/3.0/ref/contrib/messages/#message-tags>
This is because `alert-error` is not a bootstrap class. The according class is named `alert-danger`. Generally the tags line up nicely between bootstrap and django, this is why your code works. But as you see "error" != "danger". To fix the issue **replace** ``` <div class="alert alert-{{ message.tags }}"> {{ me...
5,158,148
So when I declare a variable outside the scope of any function, it becomes a property of the window object. But what about when I declare a variable inside the scope of a function? For example, in the following code I can treat x as a property of window, i.e., window.x, but what about y? Is it ever the property of an o...
2011/03/01
[ "https://Stackoverflow.com/questions/5158148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/629474/" ]
It becomes a property of the Variable object associated with the function call. In practice, this is the same thing as the function call's Activation object. I don't believe that the Variable object is accessible to running JavaScript code, though; it's more of an implementation detail than something you can take adva...
See following example (I have copy from other question-answer) very nice: ``` // a globally-scoped variable var a=1; // global scope function one(){ alert(a); } // local scope function two(a){ alert(a); } // local scope again function three(){ var a = 3; alert(a); } // Intermediate: no such thing as ...
5,158,148
So when I declare a variable outside the scope of any function, it becomes a property of the window object. But what about when I declare a variable inside the scope of a function? For example, in the following code I can treat x as a property of window, i.e., window.x, but what about y? Is it ever the property of an o...
2011/03/01
[ "https://Stackoverflow.com/questions/5158148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/629474/" ]
It becomes a property of the Variable object associated with the function call. In practice, this is the same thing as the function call's Activation object. I don't believe that the Variable object is accessible to running JavaScript code, though; it's more of an implementation detail than something you can take adva...
In order to declare a JS variable a property of an object you need to either use the new Object(); method or the {} syntax. ``` var variableName = new Object(); var variableName = {myFirstProperty:1,myNextProperty:'hi',etc}; ``` Then you can assign child objects or properties to said variable object ``` variableNa...
5,158,148
So when I declare a variable outside the scope of any function, it becomes a property of the window object. But what about when I declare a variable inside the scope of a function? For example, in the following code I can treat x as a property of window, i.e., window.x, but what about y? Is it ever the property of an o...
2011/03/01
[ "https://Stackoverflow.com/questions/5158148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/629474/" ]
In order to declare a JS variable a property of an object you need to either use the new Object(); method or the {} syntax. ``` var variableName = new Object(); var variableName = {myFirstProperty:1,myNextProperty:'hi',etc}; ``` Then you can assign child objects or properties to said variable object ``` variableNa...
See following example (I have copy from other question-answer) very nice: ``` // a globally-scoped variable var a=1; // global scope function one(){ alert(a); } // local scope function two(a){ alert(a); } // local scope again function three(){ var a = 3; alert(a); } // Intermediate: no such thing as ...
148,801
I'm currently taking my algorithms class, and I learnt that Big theta is defined as follows: > > $f(n) = \Theta(g(n))$ if there exist constants $c\_1, c\_2, n\_0 > 0$ such that $0 ≀ c\_1g(n) ≀ f(n) ≀ c\_2g(n)$ for all $n β‰₯ n\_0$. > > > So if our $f(n)$ and $g(n)$ are of the same order, say $n$ and $2n$, we can ea...
2022/01/30
[ "https://cs.stackexchange.com/questions/148801", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/147666/" ]
Because it's very important to use correct conditions for variables, let me firstly (for non-negative case) formally write definition for $\Theta$: $$\Theta(g)=\Big\{f\colon \exists C\_1>0,\exists C\_2>0, \exists N\in\mathbb{N}, \forall n \gt N, C\_1 g(n)\leqslant f(n) \leqslant C\_2 g(n)\Big\}$$ Now to obtain $f\not...
Big Theta is one possible formalization of the concept of two functions being of the same order. > > There will exist constants $c\_1$ and $c\_2$ such that $c\_1(n^2)$ is less than $n$, and $c\_2(n^2)$ is more than $n$. > > > In fact, such a constant $c\_1 > 0$ does not exist: if $n \ge 1/c\_1$ then $c\_1 n^2 \ge...
148,801
I'm currently taking my algorithms class, and I learnt that Big theta is defined as follows: > > $f(n) = \Theta(g(n))$ if there exist constants $c\_1, c\_2, n\_0 > 0$ such that $0 ≀ c\_1g(n) ≀ f(n) ≀ c\_2g(n)$ for all $n β‰₯ n\_0$. > > > So if our $f(n)$ and $g(n)$ are of the same order, say $n$ and $2n$, we can ea...
2022/01/30
[ "https://cs.stackexchange.com/questions/148801", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/147666/" ]
$f(n)=O(g(n))$ alone does not imply $f(n)=\Theta(g(n))$. [$3n-2\ne\Theta(n^2)$] $f(n)=\Omega(g(n))$ alone does not imply $f(n)=\Theta(g(n))$. [$3n-2\ne\Theta(\sqrt n)$] $f(n)=O(g(n))$ and $f(n)=\Omega(g(n))$ together imply $f(n)=\Theta(g(n))$. [$3n-2=\Theta(n)$]
Big Theta is one possible formalization of the concept of two functions being of the same order. > > There will exist constants $c\_1$ and $c\_2$ such that $c\_1(n^2)$ is less than $n$, and $c\_2(n^2)$ is more than $n$. > > > In fact, such a constant $c\_1 > 0$ does not exist: if $n \ge 1/c\_1$ then $c\_1 n^2 \ge...
26,697,133
I'm using the following CSS to attempt to style a text box (aka label) in iAd Producer's iBooks Author widget builder. I'm building from the blank template, not HTML. Here's the (very basic!) CSS code that's causing issues: ``` .title { font-family: Times New Roman; font-weight: bold; font-style: italic; ...
2014/11/02
[ "https://Stackoverflow.com/questions/26697133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2366114/" ]
You should use streams to do that. See this example : ``` #include <fstream> #include <iomanip> #include <sstream> #include <iostream> for(unsigned long int i = 0; i < nbr_Accounts; ++i) { std::ostringstream oss; oss << std::setw(10) << std::setfill('0') << i; std::string filename = oss.str() + std::string(".tx...
Here is what I used with the help of Chaduchon: ``` double num_of_accounts() { unsigned long int number_of_accounts = 0; unsigned long int count = 0; ofstream ifile; string filename = "00"; ostringstream oss; bool found; do { ostringstream oss; oss << setw(10) << setfill('...
36,074,529
I am trying to make a tool to analyse GPX files using OpenStreetMap data for identification of locations. I have successfully extracted all the waypoints from the GPX files and created as a MultiPoint object, and extracted OpenStreetMap border relation (border data) with overpass wrapper. The problem is taking relation...
2016/03/18
[ "https://Stackoverflow.com/questions/36074529", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6079832/" ]
[pyosmium](http://osmcode.org/pyosmium/) can help if you want to go straight from osm files to shapely data. It's a library to read osm files, and has helper classes to create WKB (well-known binary) format objects from areas, which you can then load into shapely. ``` import osmium import shapely.wkb wkbfab = osmium....
linemerge didn't do the job. Converting each way segment to polygon with `polygons.append(line.buffer(meter2deg(1.0)))` and than `cascade_union(polygons)` worked.
18,631,038
I have this peculiar problem with running a Processing application in IntelliJ IDEA. I want to save a large image and to do this I run in to the following exception: > > Exception in thread "Animation Thread" java.lang.OutOfMemoryError: Java heap space > at java.awt.image.DataBufferInt.(DataBufferInt.java:75) > at ...
2013/09/05
[ "https://Stackoverflow.com/questions/18631038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1176091/" ]
Changing vmoptions file adjusts the memory used by IntelliJ, but what you're having here is a shortage of memory of JRE that is launched by IntelliJ to execute your application. You need to adjust the memory setting in VM options part of the Run/Debug configuration, for example: ![enter image description here](https:/...
IntelliJ shows you the amount used and the current size of the heap. You are trying to set the maximum which it does not show. You can attach VisualVM to IntellIJ to see the maximum by running `jvisualvm`
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
The result of pointer subtraction is in *elements* and not in bytes. Thus the first expression evaluates to `1` by definition. This aside, you really ought to use parentheses in macros: ``` #define my_sizeof(x) ((&x + 1) - &x) #define my_sizeof(x) ((char *)(&x + 1) - (char *)&x) ``` Otherwise attempting to use `my_...
# define my\_sizeof(x) ((&x + 1) - &x) &x gives the address of your variable and incrementing it with one (&x + 1), will give the address, where another variable of type x could be stored. Now if we do arithmetic over these addresses like ((&x + 1) - &x), then it will tell that within ((&x + 1) - &x) address range 1 v...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
``` #define my_sizeof(x) ((&x + 1) - &x) ``` `&x` gives the address of the variable (lets say double x) declared in the program and incrementing it with 1 gives the address where the next variable of the type x can be stored (here `addr_of(x) + 8`, for the size of a double is 8Byte). The difference gives the result ...
# define my\_sizeof(x) ((&x + 1) - &x) &x gives the address of your variable and incrementing it with one (&x + 1), will give the address, where another variable of type x could be stored. Now if we do arithmetic over these addresses like ((&x + 1) - &x), then it will tell that within ((&x + 1) - &x) address range 1 v...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
The `sizeof` operator is part of the C (and C++) language specification, and is implemented inside the compiler (the front-end). There is no way to implement it with other C constructs (unless you use GCC extensions like [typeof](http://gcc.gnu.org/onlinedocs/gcc/Typeof.html)) because it can accept either types or expr...
``` #include<bits/stdc++.h> using namespace std; //#define mySizeOf(T) (char*)(&T + 1) - (char*)(&T) template<class T> size_t mySizeOf(T) { T temp1; return (char*)(&temp1 + 1) - (char*)(&temp1); } int main() { int num = 5; long numl = 10; long long numll = 100; ...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
> > > ``` > #define my_sizeof(x) ((char *)(&x + 1) - (char *)&x) > > ``` > > This `my_sizeof()` macro will not work in the following cases: 1. `sizeof 1` - 4 byte (for a platform with 4-byte `int`) `my_sizeof(1)` - won't compile at all. 2. `sizeof (int)` - 4 byte(for a platform with 4-byte `int`) `my_sizeo...
This will work for both literals and variables. ``` #define my_sizeof(x) (char*) (&(((__typeof__(x) *)0)[1])) - (char *)(&(((__typeof__(x) *)0)[0])) ```
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
The result of pointer subtraction is in *elements* and not in bytes. Thus the first expression evaluates to `1` by definition. This aside, you really ought to use parentheses in macros: ``` #define my_sizeof(x) ((&x + 1) - &x) #define my_sizeof(x) ((char *)(&x + 1) - (char *)&x) ``` Otherwise attempting to use `my_...
``` #define my_sizeof(x) ((&x + 1) - &x) ``` `&x` gives the address of the variable (lets say double x) declared in the program and incrementing it with 1 gives the address where the next variable of the type x can be stored (here `addr_of(x) + 8`, for the size of a double is 8Byte). The difference gives the result ...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
``` #define my_sizeof(x) ((&x + 1) - &x) ``` * This is basically (difference of two memory values) / (size of the data type). * It gives you the number in which how many number of elements of type x can be stored. And that is 1. You can fit one full x element in this memory space. * When we typecast it to some other ...
I searched this yesterday, and I found this macro: ``` #define mysizeof(X) ((X*)0+1) ``` Which expands X only once (no error as double evaluation of expression like x++), and it works fine until now.
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
The result of pointer subtraction is in *elements* and not in bytes. Thus the first expression evaluates to `1` by definition. This aside, you really ought to use parentheses in macros: ``` #define my_sizeof(x) ((&x + 1) - &x) #define my_sizeof(x) ((char *)(&x + 1) - (char *)&x) ``` Otherwise attempting to use `my_...
> > But it always ended up in giving the result as '1' for either of the data type > > > Yes, that's how pointer arithmetic works. It works in units of the type being pointed to. So casting to `char *` works units of `char`, which is what you want.
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
> > But it always ended up in giving the result as '1' for either of the data type > > > Yes, that's how pointer arithmetic works. It works in units of the type being pointed to. So casting to `char *` works units of `char`, which is what you want.
``` #define my_sizeof(x) ((&x + 1) - &x) ``` * This is basically (difference of two memory values) / (size of the data type). * It gives you the number in which how many number of elements of type x can be stored. And that is 1. You can fit one full x element in this memory space. * When we typecast it to some other ...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
I searched this yesterday, and I found this macro: ``` #define mysizeof(X) ((X*)0+1) ``` Which expands X only once (no error as double evaluation of expression like x++), and it works fine until now.
# define my\_sizeof(x) ((&x + 1) - &x) &x gives the address of your variable and incrementing it with one (&x + 1), will give the address, where another variable of type x could be stored. Now if we do arithmetic over these addresses like ((&x + 1) - &x), then it will tell that within ((&x + 1) - &x) address range 1 v...
14,171,133
Is it possible to do completely smooth scrolling in Flash (ActionScript 3)? In the following test I am creating a bitmap consisting of random noise, then moving it to the left periodically. I have no heavy tasks running in the background. What I am looking for is smoothness that would be on par with my Amiga 500 from 1...
2013/01/05
[ "https://Stackoverflow.com/questions/14171133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8005/" ]
The `sizeof` operator is part of the C (and C++) language specification, and is implemented inside the compiler (the front-end). There is no way to implement it with other C constructs (unless you use GCC extensions like [typeof](http://gcc.gnu.org/onlinedocs/gcc/Typeof.html)) because it can accept either types or expr...
This will work for both literals and variables. ``` #define my_sizeof(x) (char*) (&(((__typeof__(x) *)0)[1])) - (char *)(&(((__typeof__(x) *)0)[0])) ```
39,218,428
Why we have to use a reference in argument of copy constructor instead of a pointer? This questions was asked in an interview. I replied the following points: 1. References can not be NULL. 2. If we use pointer, then it would not be a copy constructor. 3. The standard specifies so (section 12.8.2). But the intervie...
2016/08/30
[ "https://Stackoverflow.com/questions/39218428", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1652295/" ]
Seems that I always have to start the region before I retrieve it. However, if I don't want entities to be created in the frontend I can [start shard region as a proxy](http://doc.akka.io/docs/akka/current/scala/cluster-sharding.html#Proxy_Only_Mode)
I found that a lot of people reference the documentation without pointing exactly where, so here is the link to the documentation, the closest point to the [answer](https://doc.akka.io/docs/akka/current/cluster-sharding.html?language=scala#Proxy_Only_Mode) . Quoting the documentation > > Messages to the entities are...
27,970,227
I have a homepage and in this homepage I include my connexion.html that I connect. But I have this error : 'str' object has no attribute 'visible\_fields' **my homepage HTML :** ``` {% extends "base.html" %} /* There are a css link of Bootstrap :bootstrap.min.css <form method="POST" action="{% url 'connexion' %}" >...
2015/01/15
[ "https://Stackoverflow.com/questions/27970227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4385232/" ]
Views don't work like that. You can't include a template and expect it to somehow call a view. A template doesn't have its own view, and templates generally don't know or care which views they're called from. Including "connexion.html" just renders it with the current template context, and in this case that doesn't ha...
In locals(), there are form and all variables; The error is in bootstrap|form in connexion.html but I dont know where
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
The use case is kind of problematic, because as soon as you print the matches, you lose the information about where exactly the separator was. But if that's acceptable, try piping to `xargs -r0`. ```sh grep -zPo '(?<=X(.))(.|\n)+(?=\1)' file | xargs -r0 ``` These options are GNU extensions, but then so is `grep -z` ...
`awk` doesn't support backreferences within regexp definition. Workarounds: ```sh $ grep -zPo '(?s)(?<=X(.)).+(?=\1)' ip.txt | tr '\0' '\n' this is the first match this is the second match # with ripgrep, which supports multiline matching $ rg -NoUP '(?s)(?<=X(.)).+(?=\1)' ip.txt this is the first match this is the ...
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
`awk` doesn't support backreferences within regexp definition. Workarounds: ```sh $ grep -zPo '(?s)(?<=X(.)).+(?=\1)' ip.txt | tr '\0' '\n' this is the first match this is the second match # with ripgrep, which supports multiline matching $ rg -NoUP '(?s)(?<=X(.)).+(?=\1)' ip.txt this is the first match this is the ...
GNU `grep -z` terminates input/output records with null characters (useful in conjunction with other tools such as `sort -z`). pcregrep will not do that: ``` pcregrep -Mo2 '(?s)X(.)(.+?)\1' file ``` `-o*number*` used instead of lookarounds. `?` lazy quantifier added (in case `\1` occurs later).
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
The use case is kind of problematic, because as soon as you print the matches, you lose the information about where exactly the separator was. But if that's acceptable, try piping to `xargs -r0`. ```sh grep -zPo '(?<=X(.))(.|\n)+(?=\1)' file | xargs -r0 ``` These options are GNU extensions, but then so is `grep -z` ...
With GNU awk for multi-char RS, RT, and gensub() and without having to read the whole file into memory: ``` $ awk -v RS='X.' 'NR>1{print "<" gensub(end".*","",1) ">"} {end=substr(RT,2,1)}' file <this is the first match> <this is the second match> ``` Obviously I added the "<" and ">" so you could see where each outp...
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
The use case is kind of problematic, because as soon as you print the matches, you lose the information about where exactly the separator was. But if that's acceptable, try piping to `xargs -r0`. ```sh grep -zPo '(?<=X(.))(.|\n)+(?=\1)' file | xargs -r0 ``` These options are GNU extensions, but then so is `grep -z` ...
Here is another gnu-awk solution making use of `RS` and `RT`: ```sh awk -v RS='X.' 'ch != "" && n=index($0, ch) { print substr($0, 1, n-1) } RT { ch = substr(RT, 2, 1) }' file ``` ``` this is the first match this is the second match ```
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
The use case is kind of problematic, because as soon as you print the matches, you lose the information about where exactly the separator was. But if that's acceptable, try piping to `xargs -r0`. ```sh grep -zPo '(?<=X(.))(.|\n)+(?=\1)' file | xargs -r0 ``` These options are GNU extensions, but then so is `grep -z` ...
GNU `grep -z` terminates input/output records with null characters (useful in conjunction with other tools such as `sort -z`). pcregrep will not do that: ``` pcregrep -Mo2 '(?s)X(.)(.+?)\1' file ``` `-o*number*` used instead of lookarounds. `?` lazy quantifier added (in case `\1` occurs later).
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
With GNU awk for multi-char RS, RT, and gensub() and without having to read the whole file into memory: ``` $ awk -v RS='X.' 'NR>1{print "<" gensub(end".*","",1) ">"} {end=substr(RT,2,1)}' file <this is the first match> <this is the second match> ``` Obviously I added the "<" and ">" so you could see where each outp...
GNU `grep -z` terminates input/output records with null characters (useful in conjunction with other tools such as `sort -z`). pcregrep will not do that: ``` pcregrep -Mo2 '(?s)X(.)(.+?)\1' file ``` `-o*number*` used instead of lookarounds. `?` lazy quantifier added (in case `\1` occurs later).
64,968,578
In my WordPress v5.5.3, I have two forms with same input fields in a single page: ``` <form id="one" method="post"> <input name="name" type="text" value="My Name"> <input name="movie" type="hidden" value="1"> <button type="submit" name="submitone">Submit</button> </form> <form id="two" method="post"> ...
2020/11/23
[ "https://Stackoverflow.com/questions/64968578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3725816/" ]
Here is another gnu-awk solution making use of `RS` and `RT`: ```sh awk -v RS='X.' 'ch != "" && n=index($0, ch) { print substr($0, 1, n-1) } RT { ch = substr(RT, 2, 1) }' file ``` ``` this is the first match this is the second match ```
GNU `grep -z` terminates input/output records with null characters (useful in conjunction with other tools such as `sort -z`). pcregrep will not do that: ``` pcregrep -Mo2 '(?s)X(.)(.+?)\1' file ``` `-o*number*` used instead of lookarounds. `?` lazy quantifier added (in case `\1` occurs later).
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
Since you can get a needle in next to it, I would try a very small amount of super glue on the needle. Put it in, let is sit for a long time, and then you may be able to get it to come out. I'd also consider abrading away the plastic top of the header with a dremel and an diamond disk so that I could get down to the ...
Knocking the header onto something solid like the edge of a table can also work. Face the header with the wire in it downwards and hit the edge of the table so that the connection with the stuck wire is hanging just over the edge. Don't hit it so hard that you break the board but as much as you feel is safe. It might n...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
My best luck with removing broken wires from breadboards and headers of this nature is to just use the tip of a jeweler's screwdriver, or the tip of one of the ends of my pair of diagonal cutters to just drag the wire out. You may nick up the header's plastic a little bit, but it is definitely easier to do this before ...
I used a dental pick to nudge the wire up about an 1/16 of inch and then used needle nose pliers to pull the wire out. It took some time to nudge the wire up but eventually worked.
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
1. Generously tin a piece of wire 2. Insert the wire into the socket with the stuck pin 3. Reflow the solder to join the pin to the wire 4. Use the wire to extract the pin. Be careful not to solder the pin into the socket!
Knocking the header onto something solid like the edge of a table can also work. Face the header with the wire in it downwards and hit the edge of the table so that the connection with the stuck wire is hanging just over the edge. Don't hit it so hard that you break the board but as much as you feel is safe. It might n...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
My best luck with removing broken wires from breadboards and headers of this nature is to just use the tip of a jeweler's screwdriver, or the tip of one of the ends of my pair of diagonal cutters to just drag the wire out. You may nick up the header's plastic a little bit, but it is definitely easier to do this before ...
My standard technique for removing a broken pin or wire from that style of header is to simply pry the plastic body of the header off of the pins. You will notice that that the header body is actually easily removed if you pry gently at one end, then the other. Rock the body away from the board. Flush-cutting wire cut...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
My best luck with removing broken wires from breadboards and headers of this nature is to just use the tip of a jeweler's screwdriver, or the tip of one of the ends of my pair of diagonal cutters to just drag the wire out. You may nick up the header's plastic a little bit, but it is definitely easier to do this before ...
Since you can get a needle in next to it, I would try a very small amount of super glue on the needle. Put it in, let is sit for a long time, and then you may be able to get it to come out. I'd also consider abrading away the plastic top of the header with a dremel and an diamond disk so that I could get down to the ...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
My standard technique for removing a broken pin or wire from that style of header is to simply pry the plastic body of the header off of the pins. You will notice that that the header body is actually easily removed if you pry gently at one end, then the other. Rock the body away from the board. Flush-cutting wire cut...
I used a dental pick to nudge the wire up about an 1/16 of inch and then used needle nose pliers to pull the wire out. It took some time to nudge the wire up but eventually worked.
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
This happened to me today, I was using a wire from the cat-5 cable as I could not find any place to buy single core 22 gauge wires here. I might had damaged the wire core while stripping it with a cutter. It just broke off and got stuck inside the GND pin on my Arduino Uno. First thing I did was google, which took me ...
I use the smallest drill that I have (#60) in a pin vise and very carefully twist the vise and bit into the header hole along side the broken pin. When it feels like the drill has bit into something solid (not plastic), I carefully pull the vise and drill bit up out of the hole and the broken pin usually comes along. A...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
$0.02 worth The metal part of the female connector (in which the wire is stuck) looks like a tuning fork. You don't see the fork, because it's surrounded by the black plastic. The fork should be in-plane with the connector. Try to make a hole in the plastic on the side of the connector. Perhaps, you could make the hol...
Since you can get a needle in next to it, I would try a very small amount of super glue on the needle. Put it in, let is sit for a long time, and then you may be able to get it to come out. I'd also consider abrading away the plastic top of the header with a dremel and an diamond disk so that I could get down to the ...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
My standard technique for removing a broken pin or wire from that style of header is to simply pry the plastic body of the header off of the pins. You will notice that that the header body is actually easily removed if you pry gently at one end, then the other. Rock the body away from the board. Flush-cutting wire cut...
This happened to me today, I was using a wire from the cat-5 cable as I could not find any place to buy single core 22 gauge wires here. I might had damaged the wire core while stripping it with a cutter. It just broke off and got stuck inside the GND pin on my Arduino Uno. First thing I did was google, which took me ...
57,111
I'm working with an Arduino, and one of the stripped portions of the wire broke off at some point and managed to get pretty wedged into the 5V pin slot. Obviously, this wouldn't matter as much for a GPIO pin, but I sort of need to use the +5V port. Tweezers are out of the question; I've tried both non and slanted-tip....
2013/02/05
[ "https://electronics.stackexchange.com/questions/57111", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/6846/" ]
1. Generously tin a piece of wire 2. Insert the wire into the socket with the stuck pin 3. Reflow the solder to join the pin to the wire 4. Use the wire to extract the pin. Be careful not to solder the pin into the socket!
My best luck with removing broken wires from breadboards and headers of this nature is to just use the tip of a jeweler's screwdriver, or the tip of one of the ends of my pair of diagonal cutters to just drag the wire out. You may nick up the header's plastic a little bit, but it is definitely easier to do this before ...
36,358,707
I'm trying to create a hashmap in a **static** function in a fragment. But I get an error creating the hashmap saying my function cannot be static. Can you tell me how can I do to **keep my function static** and keeping my hashmap inside? My fragment : ``` public class AddMatriceResult extends Fragment { private...
2016/04/01
[ "https://Stackoverflow.com/questions/36358707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3748285/" ]
Add a static variable to your class: ``` private static Activity activity; ``` In your onCreate(): ``` @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activity = getActivity(); } ``` Then you can write: ``` public static void Result() { if (AddMatri...
`this` in Java is a pointer to instance, to itself, so it can't be used with static fields, as `this` might not exists when you call static method. For accessing static fields it's a good practice to call it from ClassName: `ClassName.myMap.put(a, b);` Your method can't access `this` pointer, you need to pass it to ...
30,201
In the high level TvZ games as soon as mutas come out, terran starts building missile turrets all over the map. Approx, 3-4 per expansion and 5-6 in the main, so that is about 75\*9 = 675 minerals ( assuming one expansion ), also there will be some PFs etc. Then how come no one gets this research which is just 100/100....
2011/09/12
[ "https://gaming.stackexchange.com/questions/30201", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/3501/" ]
Generally-speaking, neither [Hi-Sec Auto Tracking](http://wiki.teamliquid.net/starcraft2/Hi-Sec_Auto_Tracking) nor turret spam are the best reactions to mutas. Throwing a turret or two on your mineral line works if you expect continued aerial harassment, but **the reaction most pro players have to an opponent going mas...
It's not true that no one researches Hi-Sec Auto Tracking; the caster "TotalBiscuit" is an advocate of that upgrade. (That said, you can find the streams of his games by searching for "I Suck at Starcraft Live", so take that for what it's worth.) I usually research it too, fairly early; I find it especially useful wh...
106,386
I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... ``` <?php /** * This file controls the layout of your homepage * * @package WordPress * @subpackage Pytheas WordPress Theme * Template Name: Cust...
2013/07/13
[ "https://wordpress.stackexchange.com/questions/106386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14569/" ]
Try the following code. Based on these two Q&A's (not tested): * [How to add Custom Blog Options to new blog setup form?](https://wordpress.stackexchange.com/q/50235/12615) * [Programmatically set page\_on\_front](https://wordpress.stackexchange.com/q/96066/12615) ``` add_action( 'wpmu_new_blog', 'process_extra_field...
1) To set Your first page you can add new page as `home.php` in your directory. Wordpress by default take `home.php` as its first page if it is declared. 2) Go to settings->Reading->Front page display. You can set here your front page which will display when your site open.
106,386
I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... ``` <?php /** * This file controls the layout of your homepage * * @package WordPress * @subpackage Pytheas WordPress Theme * Template Name: Cust...
2013/07/13
[ "https://wordpress.stackexchange.com/questions/106386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14569/" ]
Wordpress provides a function [update\_option](https://developer.wordpress.org/reference/functions/update_option/) to set static page programmatically by default when a new blog is created in network multisite. ``` function my_new_blog_settings($blog_id, $user_id) { // set static front page in general settings ...
1) To set Your first page you can add new page as `home.php` in your directory. Wordpress by default take `home.php` as its first page if it is declared. 2) Go to settings->Reading->Front page display. You can set here your front page which will display when your site open.
106,386
I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... ``` <?php /** * This file controls the layout of your homepage * * @package WordPress * @subpackage Pytheas WordPress Theme * Template Name: Cust...
2013/07/13
[ "https://wordpress.stackexchange.com/questions/106386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14569/" ]
Be carefull, wpmu\_new\_blog is deprecated. Use wp\_insert\_site instead. To give a proper overview, the question can now be answered as follow: ``` function process_extra_field_on_blog_signup( $new_site ) { $blog_id = $new_site->blog_id; switch_to_blog($blog_id); $homepage = get_page_by_title( 'Sample Pag...
1) To set Your first page you can add new page as `home.php` in your directory. Wordpress by default take `home.php` as its first page if it is declared. 2) Go to settings->Reading->Front page display. You can set here your front page which will display when your site open.
106,386
I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... ``` <?php /** * This file controls the layout of your homepage * * @package WordPress * @subpackage Pytheas WordPress Theme * Template Name: Cust...
2013/07/13
[ "https://wordpress.stackexchange.com/questions/106386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14569/" ]
Try the following code. Based on these two Q&A's (not tested): * [How to add Custom Blog Options to new blog setup form?](https://wordpress.stackexchange.com/q/50235/12615) * [Programmatically set page\_on\_front](https://wordpress.stackexchange.com/q/96066/12615) ``` add_action( 'wpmu_new_blog', 'process_extra_field...
Wordpress provides a function [update\_option](https://developer.wordpress.org/reference/functions/update_option/) to set static page programmatically by default when a new blog is created in network multisite. ``` function my_new_blog_settings($blog_id, $user_id) { // set static front page in general settings ...
106,386
I've added a page template that is my new home page and I would like to be able simply list the last 5 blog entries. My home page currently looks like... ``` <?php /** * This file controls the layout of your homepage * * @package WordPress * @subpackage Pytheas WordPress Theme * Template Name: Cust...
2013/07/13
[ "https://wordpress.stackexchange.com/questions/106386", "https://wordpress.stackexchange.com", "https://wordpress.stackexchange.com/users/14569/" ]
Try the following code. Based on these two Q&A's (not tested): * [How to add Custom Blog Options to new blog setup form?](https://wordpress.stackexchange.com/q/50235/12615) * [Programmatically set page\_on\_front](https://wordpress.stackexchange.com/q/96066/12615) ``` add_action( 'wpmu_new_blog', 'process_extra_field...
Be carefull, wpmu\_new\_blog is deprecated. Use wp\_insert\_site instead. To give a proper overview, the question can now be answered as follow: ``` function process_extra_field_on_blog_signup( $new_site ) { $blog_id = $new_site->blog_id; switch_to_blog($blog_id); $homepage = get_page_by_title( 'Sample Pag...
69,978,237
I'm trying to setup a project which should run e2e selenium based tests written in python inside a pipeline running on Gitlab CI. The goal is to use pytest-docker in order to use a docker-compose file to launch the needed applications before we can run the tests (This is just to justify why I'm using dind service and d...
2021/11/15
[ "https://Stackoverflow.com/questions/69978237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17420105/" ]
No, no such thing. You can implement your own, e.g. ``` interface Birthday { Optional<LocalDate> fullDate(); Year year(); } class UnknownBirthday implements Birthday { private final Year year; // ctor @Override public Year year() { return year; } @Override public Optional...
One option is to exploit the `TemporalAccessor` interface. Nearly all of the date and time classes of java.time implement this interface and certainly those classes that you would use for your uncertain birthdays. Declare a variable a `TemporalAccessor`, and you may assign a `Year` or a `LocalDate` or some other type t...
69,978,237
I'm trying to setup a project which should run e2e selenium based tests written in python inside a pipeline running on Gitlab CI. The goal is to use pytest-docker in order to use a docker-compose file to launch the needed applications before we can run the tests (This is just to justify why I'm using dind service and d...
2021/11/15
[ "https://Stackoverflow.com/questions/69978237", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17420105/" ]
No, no such thing. You can implement your own, e.g. ``` interface Birthday { Optional<LocalDate> fullDate(); Year year(); } class UnknownBirthday implements Birthday { private final Year year; // ctor @Override public Year year() { return year; } @Override public Optional...
[Joda Time library](http://joda-time.sourceforge.net/apidocs/org/joda/time/Partial.html) has `Partial` class which can be used to create dates with unknown month / day etc. > > Partial is an immutable partial datetime supporting any set of > datetime fields. > > > A Partial instance can be used to hold any combinat...
219,416
I have an issue with a SharePoint 2010 workflow. The workflow is a 2010 workflow but is held on SharePoint 2013. Through research, I found an issue relating to workflows migrated from SharePoint 2010 or when admins have upgraded designer 2010 to 2013. This is not the case. Here is a pic of the error;- [![enter im...
2017/06/28
[ "https://sharepoint.stackexchange.com/questions/219416", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/57662/" ]
This happens to me every once in a while. Most often deleting everything from here: > > C:\Users\UserName\AppData\Local\Microsoft\WebsiteCache > > > And all the cache from here: > > C:\Users\UserName\AppData\Roaming\Microsoft\Web Server Extensions\Cache > > > And restarting SharePoint Designer, solves the p...
Found the Solution Somewhere along the line the file has become corrupted and SharePoint designer is not able to open it from the shortcut on the left hand navigation pane. However if you go to;- 1. All Files 2. Workflows 3. Click the workflow name 4. Click the workflow name.xmol [![resolution screen shot](https:/...
219,416
I have an issue with a SharePoint 2010 workflow. The workflow is a 2010 workflow but is held on SharePoint 2013. Through research, I found an issue relating to workflows migrated from SharePoint 2010 or when admins have upgraded designer 2010 to 2013. This is not the case. Here is a pic of the error;- [![enter im...
2017/06/28
[ "https://sharepoint.stackexchange.com/questions/219416", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/57662/" ]
This happens to me every once in a while. Most often deleting everything from here: > > C:\Users\UserName\AppData\Local\Microsoft\WebsiteCache > > > And all the cache from here: > > C:\Users\UserName\AppData\Roaming\Microsoft\Web Server Extensions\Cache > > > And restarting SharePoint Designer, solves the p...
Hello today the **problem** also occurred to me. Why I don't know yet but I found out that when I open the designer from a **HTTPS** SharePoint Site the problem occurs but **not with HTTP**. The only thing I did recently was to create an HTTPS certificate on my SharePoint WebApplication Server (SharePoint 2016) for a n...
219,416
I have an issue with a SharePoint 2010 workflow. The workflow is a 2010 workflow but is held on SharePoint 2013. Through research, I found an issue relating to workflows migrated from SharePoint 2010 or when admins have upgraded designer 2010 to 2013. This is not the case. Here is a pic of the error;- [![enter im...
2017/06/28
[ "https://sharepoint.stackexchange.com/questions/219416", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/57662/" ]
Found the Solution Somewhere along the line the file has become corrupted and SharePoint designer is not able to open it from the shortcut on the left hand navigation pane. However if you go to;- 1. All Files 2. Workflows 3. Click the workflow name 4. Click the workflow name.xmol [![resolution screen shot](https:/...
Hello today the **problem** also occurred to me. Why I don't know yet but I found out that when I open the designer from a **HTTPS** SharePoint Site the problem occurs but **not with HTTP**. The only thing I did recently was to create an HTTPS certificate on my SharePoint WebApplication Server (SharePoint 2016) for a n...
19,519,623
Can any one please confirm if "Can Non-Consumable Apple Hosted Content be Free". I have read on lot of places including on StackOverflow that Non-Consumable cannot be free but i am looking for official apple guideline reference that states so. None of the previous answers provides any link to apple guidelines or refer...
2013/10/22
[ "https://Stackoverflow.com/questions/19519623", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1052048/" ]
It was not possible before. It is possible now. ~~I think since iOS7, but if I am wrong please someone correct me.~~ It was around the time iOS7 was launched, but it is not iOS7 related anyhow. Here you can see an screenshot I just took from itunes connect, while adding a new non-consumable item. You can see that it le...
Non consumable can be free- I think you're confusing consumable with non-consumable. Consumable would be something the user can buy more than once, like +10,000 gold in a game, non-consumable would be something the user only has to buy once, like removing ads. Non-consumable *CAN* be free. Also, instead of posting a q...
20,842,447
I have the following HTML ``` <div class="test"> <img src="... .png"> </div> ``` and this CSS rule: ``` .test { background: red; } ``` By default `div`s have `100%` width. Is it possible to set `.test`'s width to the image width that is inside of `.test` only by using CSS? That means that the red area will b...
2013/12/30
[ "https://Stackoverflow.com/questions/20842447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1420197/" ]
Change the `display` property for the container: ``` .test { display:inline-block; } ``` The demo <http://jsfiddle.net/3KtS6/5/>
use `display:inline-block;` ``` .test { background: red; display:inline-block; } ``` <http://jsfiddle.net/3KtS6/3/>
20,842,447
I have the following HTML ``` <div class="test"> <img src="... .png"> </div> ``` and this CSS rule: ``` .test { background: red; } ``` By default `div`s have `100%` width. Is it possible to set `.test`'s width to the image width that is inside of `.test` only by using CSS? That means that the red area will b...
2013/12/30
[ "https://Stackoverflow.com/questions/20842447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1420197/" ]
Change the `display` property for the container: ``` .test { display:inline-block; } ``` The demo <http://jsfiddle.net/3KtS6/5/>
How about setting the background of the `image` to red: <http://jsfiddle.net/3KtS6/2/> ?
20,842,447
I have the following HTML ``` <div class="test"> <img src="... .png"> </div> ``` and this CSS rule: ``` .test { background: red; } ``` By default `div`s have `100%` width. Is it possible to set `.test`'s width to the image width that is inside of `.test` only by using CSS? That means that the red area will b...
2013/12/30
[ "https://Stackoverflow.com/questions/20842447", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1420197/" ]
use `display:inline-block;` ``` .test { background: red; display:inline-block; } ``` <http://jsfiddle.net/3KtS6/3/>
How about setting the background of the `image` to red: <http://jsfiddle.net/3KtS6/2/> ?
3,165,589
I need to enable a mailing list on a website and I was considering to use Simplenews module for it. I have to send approximately 1500 e-mails per month. I was considering if it is a huge emails amount for drupal and simplenews module and I should use another service, or not. thanks
2010/07/02
[ "https://Stackoverflow.com/questions/3165589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257022/" ]
**Edit II: The Edit Wars** - I've just read what SimpleNews provides and see that it *is* a newsletter sender. Skip the next edit and go straight onto the last block. --- **Edit: The Phantom Edit** - My answer is in the understanding that by mailing list, you meant newsletter. I see now that you could just mean a for...
1500 is well within the range of what Drupal can handle.
3,165,589
I need to enable a mailing list on a website and I was considering to use Simplenews module for it. I have to send approximately 1500 e-mails per month. I was considering if it is a huge emails amount for drupal and simplenews module and I should use another service, or not. thanks
2010/07/02
[ "https://Stackoverflow.com/questions/3165589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257022/" ]
**Edit II: The Edit Wars** - I've just read what SimpleNews provides and see that it *is* a newsletter sender. Skip the next edit and go straight onto the last block. --- **Edit: The Phantom Edit** - My answer is in the understanding that by mailing list, you meant newsletter. I see now that you could just mean a for...
1500 emails is not that many (assuming you meen total emails, not emails which are then sent to 100,000 users), simplenews looks like it is activly maintained and has a large userbase, so shouldn't be a problem. Just as an asside, SO is probably not the best place to ask for module reviews try using [drupal modules](h...
3,165,589
I need to enable a mailing list on a website and I was considering to use Simplenews module for it. I have to send approximately 1500 e-mails per month. I was considering if it is a huge emails amount for drupal and simplenews module and I should use another service, or not. thanks
2010/07/02
[ "https://Stackoverflow.com/questions/3165589", "https://Stackoverflow.com", "https://Stackoverflow.com/users/257022/" ]
1500 emails is not that many (assuming you meen total emails, not emails which are then sent to 100,000 users), simplenews looks like it is activly maintained and has a large userbase, so shouldn't be a problem. Just as an asside, SO is probably not the best place to ask for module reviews try using [drupal modules](h...
1500 is well within the range of what Drupal can handle.
66,247,886
My lambda function needs more time to execute so when I increase it ``` const postReader_NewPost = new lambda.Function(this, 'PostReader_NewPost', { code: lambda.Code.fromAsset('lambda'), runtime: lambda.Runtime.PYTHON_2_7, handler: 'PostReader_NewPost.handler', timeout: Duration.seconds(30...
2021/02/17
[ "https://Stackoverflow.com/questions/66247886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007157/" ]
This way always works for me: [aws-examples](https://github.com/aws-samples/aws-cdk-examples/blob/master/typescript/lambda-cron/index.ts) Import core and then use Duration as `core.Duration`. I'm not sure if it will help, but it looks like your core import is being taken from aws-dynamodb this way. If this solves it...
import {Duration} from "@aws-cdk/core"; Add timeout variable in api.constructs file timeout:Duration.seconds(30)
66,247,886
My lambda function needs more time to execute so when I increase it ``` const postReader_NewPost = new lambda.Function(this, 'PostReader_NewPost', { code: lambda.Code.fromAsset('lambda'), runtime: lambda.Runtime.PYTHON_2_7, handler: 'PostReader_NewPost.handler', timeout: Duration.seconds(30...
2021/02/17
[ "https://Stackoverflow.com/questions/66247886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007157/" ]
This way always works for me: [aws-examples](https://github.com/aws-samples/aws-cdk-examples/blob/master/typescript/lambda-cron/index.ts) Import core and then use Duration as `core.Duration`. I'm not sure if it will help, but it looks like your core import is being taken from aws-dynamodb this way. If this solves it...
You are using different versions of @ aws-cdk / core and @ aws-cdk / aws-lambda.
66,247,886
My lambda function needs more time to execute so when I increase it ``` const postReader_NewPost = new lambda.Function(this, 'PostReader_NewPost', { code: lambda.Code.fromAsset('lambda'), runtime: lambda.Runtime.PYTHON_2_7, handler: 'PostReader_NewPost.handler', timeout: Duration.seconds(30...
2021/02/17
[ "https://Stackoverflow.com/questions/66247886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007157/" ]
Through npm ls I found that I don't have same version of different aws cdk libraries ``` npm ls cdk_polly_website@0.1.0 C:\Users\amuham210\Documents\GitHub\cdk_polly_website +-- @aws-cdk/assert@1.88.0 +-- @aws-cdk/aws-apigateway@1.89.0 +-- @aws-cdk/aws-dynamodb@1.89.0 +-- @aws-cdk/aws-iam@1.89.0 +-- @aws-cdk/aws-lambd...
import {Duration} from "@aws-cdk/core"; Add timeout variable in api.constructs file timeout:Duration.seconds(30)
66,247,886
My lambda function needs more time to execute so when I increase it ``` const postReader_NewPost = new lambda.Function(this, 'PostReader_NewPost', { code: lambda.Code.fromAsset('lambda'), runtime: lambda.Runtime.PYTHON_2_7, handler: 'PostReader_NewPost.handler', timeout: Duration.seconds(30...
2021/02/17
[ "https://Stackoverflow.com/questions/66247886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007157/" ]
Through npm ls I found that I don't have same version of different aws cdk libraries ``` npm ls cdk_polly_website@0.1.0 C:\Users\amuham210\Documents\GitHub\cdk_polly_website +-- @aws-cdk/assert@1.88.0 +-- @aws-cdk/aws-apigateway@1.89.0 +-- @aws-cdk/aws-dynamodb@1.89.0 +-- @aws-cdk/aws-iam@1.89.0 +-- @aws-cdk/aws-lambd...
You are using different versions of @ aws-cdk / core and @ aws-cdk / aws-lambda.
66,247,886
My lambda function needs more time to execute so when I increase it ``` const postReader_NewPost = new lambda.Function(this, 'PostReader_NewPost', { code: lambda.Code.fromAsset('lambda'), runtime: lambda.Runtime.PYTHON_2_7, handler: 'PostReader_NewPost.handler', timeout: Duration.seconds(30...
2021/02/17
[ "https://Stackoverflow.com/questions/66247886", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13007157/" ]
You are using different versions of @ aws-cdk / core and @ aws-cdk / aws-lambda.
import {Duration} from "@aws-cdk/core"; Add timeout variable in api.constructs file timeout:Duration.seconds(30)
3,397
I have recently started learning Esperanto because I thought it would be an interesting exercise to compare and contrast it with the natural languages I speak. Anyone who has done even light research on Esperanto know its two main selling points are its claim that [it's easy to learn](http://www.esperanto-usa.org/node/...
2013/03/18
[ "https://linguistics.stackexchange.com/questions/3397", "https://linguistics.stackexchange.com", "https://linguistics.stackexchange.com/users/1055/" ]
The claim about Esperanto having [propedeutic](http://en.wiktionary.org/wiki/propaedeutic) properties for French learners comes from the EKPAROLI project, you can find a somewhat outdated but [detailed report](http://web.archive.org/web/20031204061223/http://www.education.monash.edu.au/projects/esperanto/Ekrep97.htm) a...
(Apologies, I'm writing this comment in a way so that even passersby who have zero knowledge of Esperanto can make more sense of it) As for the research, honestly there's quite a few very easily findable online, especially via Wikipedia reference links on various pages related to Esperanto. The "open library" has a fe...
2,019,390
For a **locally compact abelian** (LCA) group $G$ let $\hat{G}$ denotes the dual group (the group of characters on $G$). Now with the compact open topology $\hat{G}$ becomes a LCA group. I need to prove the following - 1) $\hat{\mathbb{Z}} \cong \mathbb{S}^1$ 2) $\hat{\mathbb{S}}^1 \cong \mathbb{Z}$ 3) $\hat{\mathb...
2016/11/18
[ "https://math.stackexchange.com/questions/2019390", "https://math.stackexchange.com", "https://math.stackexchange.com/users/299735/" ]
This is very basic. The first isomorphism is almost tautological: $\hat{\mathbb{Z}}$ is the group of (continuous) homomorphisms $\mathbb{Z}\to\mathbb{S}^1$ and this is algebraically and topologically isomorphic to $\mathbb{S}^1$. If you already know Pontryagin duality, then the second statement is again obvious. Witho...
The characters groups of elementary groups should be described in any book about Pontrjagin duality. For instance, in [DPS, Ex. 3.1.7] or [Pon, Β§ 36]. The following quotations are from [DPS] [![enter image description here](https://i.stack.imgur.com/RTLNO.png)](https://i.stack.imgur.com/RTLNO.png) [![enter image descr...
64,366,504
I have records that relate to the location of an RFID tagged asset within a building. The records have start and end timestamps and the location where the asset was between those 2 timestamps. ```html <table> <tr> <td>ZONEID</td> <td>MACADDRESS</td> <td>START_TS</td> <td>END_TS</td> </tr> <tr> ...
2020/10/15
[ "https://Stackoverflow.com/questions/64366504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14371648/" ]
I just had a similiar error: ``` ════════ Exception caught by widgets library ═══════════════════════════════════ The following StackOverflowError was thrown building Container: Stack Overflow The relevant error-causing widget was Container lib/widgets/profile_wiget.dart:9 When the exception was thrown, this was the ...
If you are using Hive (<https://pub.dev/packages/hive>), it could come from the fact that you used the wrong type `T` when calling `await Hive.openBox<T>("boxName")`. (Took me so long to figure out, so hopefully this can save you some time, maybe even to future me lol)