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
24,545,942
I have a Java application that accepts the user input for the configuration file path.I want this input configuration file path to be passed to my spring applicationContext.xml so that I can create the bean of datasource with the dburl,dbusername and dbpasswd which will be used in further classes of my application. Is...
2014/07/03
[ "https://Stackoverflow.com/questions/24545942", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3754763/" ]
I agree there so many messages, but I had this below file with my, while developing plugin and I look for the type of `Input parameter first` I got this file from <http://patrickverbeeten.com/Blog/2008/01/25/CRM-40-Plug-in-message-input-parameters> But I have tried to update this file somewhat for CRM 2011: Please d...
If I understand your question correct you can just do the following: ``` if (context.InputParameters.Contains("Target")) { // Do something with Target } else if (context.InputParameters.Contains(“Relationship”)) { // Do something with Relationship } ``` If you want to confirm that Target is of Entity (I think ...
9,942,871
I was reading **Struts2 in Action**, and it said that if an interceptor **B** fires after interceptor **A**, and **B** determines that control should not be allowed to go to Action (as there might be validation errors as done by **DefaultWorkFLowInterceptor**). It then returns "input"..and the page is rendered to the u...
2012/03/30
[ "https://Stackoverflow.com/questions/9942871", "https://Stackoverflow.com", "https://Stackoverflow.com/users/443259/" ]
Even if you change the result string, its too late since the result has already been rendered to the client (UI). Interceptor calling occurs in reverse order so that any post processing work can be done like cleaning up any resources or writing any critical information. If you are interested to change the result you ...
I was under the impression that an interceptor calls another interceptor (and therefore, the string returned by an interceptor is received by its preceding one, which it can modify). Actually, an interceptor calls the invoke method of the **ActionInvocation** class which, in turn calls the next interceptor. This also m...
32,973,937
I have an input file in XML format and it is well formed, with accents well written. The file is created with a PHP script that works fine. But when i read the XML File and write it in another XML using a Java program, it puts strange characters instead of the characters with accents. This is the method that reads the...
2015/10/06
[ "https://Stackoverflow.com/questions/32973937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2988946/" ]
Probably you are reading the file with UTF-8 charset. Special chars are not part of the UTF-8 charset. Change from UTF-8 to UTF-16 Something like ``` InputStream in = ... InputSource is = new InputSource(new InputStreamReader(in, "utf-16")); ``` --- As Jordi correctly said there are no special chars outside of ut...
When you read the file use encoding utf-8 is best ``` BufferedReader rd = new BufferedReader(new InputStreamReader(is, "utf-8")); ``` In writing also use utf-8 ``` OutputStreamWriter writer = new OutputStreamWriter( new FileOutputStream(filePath, true), "utf-8"); ``` This worked for me. When read file in vi edi...
32,973,937
I have an input file in XML format and it is well formed, with accents well written. The file is created with a PHP script that works fine. But when i read the XML File and write it in another XML using a Java program, it puts strange characters instead of the characters with accents. This is the method that reads the...
2015/10/06
[ "https://Stackoverflow.com/questions/32973937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2988946/" ]
Works for me using Chaserset ISO 8859-1. Syntax in kotlin: ``` val inputStream : InputStream = FileInputStream(filePath) val json = inputStream.bufferedReader(Charsets.ISO_8859_1).use { it.readText()} ```
When you read the file use encoding utf-8 is best ``` BufferedReader rd = new BufferedReader(new InputStreamReader(is, "utf-8")); ``` In writing also use utf-8 ``` OutputStreamWriter writer = new OutputStreamWriter( new FileOutputStream(filePath, true), "utf-8"); ``` This worked for me. When read file in vi edi...
53,645,150
trying to get last parameters for further processing, but not able to separate them.
2018/12/06
[ "https://Stackoverflow.com/questions/53645150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7572710/" ]
it is because you are not initializaing cells array. Just inititalize it to proper size , then it should not be a problem. For example: ``` cells = new Node[5][5]; ```
Just try `ArrayList<ArrayList<Node>>` if you don't know the size of array. ``` private ArrayList<ArrayList<Node>> nodes = new ArrayList<>(); for(int i=0;i<rows;i++){ ArrayList<Node> n = new ArrayList<>(); for(int j=0 ; j<cols;j++){ Node node = new Node(i,j,rows,cols); //throws exception th...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
**Update 2022;** the `csrf_token()` method will **never** create a *new* token, and it simply loads *existing* CSRF-token from current-session (if any, and returns it). But this *tricks* you into thinking it works, because Laravel increases the life-time of the *existing* CSRF-token, and that each time a request to a ...
I have a simple solution that: * Doesn't require you to extend the session lifetime. * Works with multiple tabs open. * Also works if the session did time out because the device was turned off. in /routes/web.php: ``` $router->get('csrf-token', function() { return request()->session()->token(); }); ``` This sim...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
I have a simple solution that: * Doesn't require you to extend the session lifetime. * Works with multiple tabs open. * Also works if the session did time out because the device was turned off. in /routes/web.php: ``` $router->get('csrf-token', function() { return request()->session()->token(); }); ``` This sim...
I think the best option is to take the lifetime configuration of the config/session.php file, then the lifetime value multiplied by 60 \* 1000 in the javascript code. Use helper function config() provided by laravel, it might look like this: ``` <script type="text/javascript"> var timeout = ({{config('session.life...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
Increase the `lifetime` of your sessions. You can do so by editing the `config/session.php` file in your laravel configuration. ``` /* |-------------------------------------------------------------------------- | Session Lifetime |-------------------------------------------------------------------------- | | Here you ...
Circum-navigating the token is generally accepted as a terrible approach but there are problems with using js timers mentioned above too. js seetTimeout/setInterval is unreliable when the browser tab is either not it focus, minimised or in the case of many users, thier laptop/device is sleeping/closed etc. A better ro...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
a short and fast way.... for handling ajax requests,when token expire : add this script to the end of master layout or your document ``` $(window).load(function(){ $.ajaxSetup({ statusCode: { 419: function(){ location.reload(); } } }); }); ``` ...
I think the best option is to take the lifetime configuration of the config/session.php file, then the lifetime value multiplied by 60 \* 1000 in the javascript code. Use helper function config() provided by laravel, it might look like this: ``` <script type="text/javascript"> var timeout = ({{config('session.life...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
try this in your main layout file ``` @guest <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <meta http-equiv="refresh" content="{{config('session.lifetime') * 60}}"> @endguest `...
You may try [Caffeine for Laravel package](https://github.com/GeneaLabs/laravel-caffeine) it set an interval then it refresh the token like suggested in some answers also it will be added automatically in every form having csrf token
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
**Update 2022;** the `csrf_token()` method will **never** create a *new* token, and it simply loads *existing* CSRF-token from current-session (if any, and returns it). But this *tricks* you into thinking it works, because Laravel increases the life-time of the *existing* CSRF-token, and that each time a request to a ...
You may try [Caffeine for Laravel package](https://github.com/GeneaLabs/laravel-caffeine) it set an interval then it refresh the token like suggested in some answers also it will be added automatically in every form having csrf token
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
I think the answer by @UX Labs is misleading. And then the comment from @jfadich seems completely incorrect. For Laravel 5.4 in May 2017, I solved the problem this way: Here Is an Answer That Works ---------------------------- In `web.php`: ``` Route::post('keep-token-alive', function() { return 'Token must hav...
Best way to handle this Exception is with `App\Exceptions\Handler.php`. ```php public function render($request, Exception $e) { if ($e instanceof \Illuminate\Session\TokenMismatchException) { return Redirect::back()->withErrors(['session' => 'Désolé, votre session semble avoir expiré. ...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
Best way to handle this Exception is with `App\Exceptions\Handler.php`. ```php public function render($request, Exception $e) { if ($e instanceof \Illuminate\Session\TokenMismatchException) { return Redirect::back()->withErrors(['session' => 'Désolé, votre session semble avoir expiré. ...
You may try [Caffeine for Laravel package](https://github.com/GeneaLabs/laravel-caffeine) it set an interval then it refresh the token like suggested in some answers also it will be added automatically in every form having csrf token
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
**Update 2022;** the `csrf_token()` method will **never** create a *new* token, and it simply loads *existing* CSRF-token from current-session (if any, and returns it). But this *tricks* you into thinking it works, because Laravel increases the life-time of the *existing* CSRF-token, and that each time a request to a ...
I think the answer by @UX Labs is misleading. And then the comment from @jfadich seems completely incorrect. For Laravel 5.4 in May 2017, I solved the problem this way: Here Is an Answer That Works ---------------------------- In `web.php`: ``` Route::post('keep-token-alive', function() { return 'Token must hav...
31,449,434
What is the best way to handle expired tokens in laravel 5. I mean I have a page and it has some links which perform ajax requests. They work fine when the page is loaded but when I wait for sometime then I get a TOKEN MISMATCH error. Now, I have to refresh the page to make it work again. BUT, I don't want to refre...
2015/07/16
[ "https://Stackoverflow.com/questions/31449434", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364300/" ]
try this in your main layout file ``` @guest <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> <meta http-equiv="refresh" content="{{config('session.lifetime') * 60}}"> @endguest `...
Circum-navigating the token is generally accepted as a terrible approach but there are problems with using js timers mentioned above too. js seetTimeout/setInterval is unreliable when the browser tab is either not it focus, minimised or in the case of many users, thier laptop/device is sleeping/closed etc. A better ro...
50,250,474
**Problem:** I'm looking for a way to create complex snippets. At our company we have larger functions which almost seem boilerplate-ish, and I feel can be made much easier. **Desired solution:** I want to create something, similar to how snippets work, but suitable for more complex generation of code. For instance, s...
2018/05/09
[ "https://Stackoverflow.com/questions/50250474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9763789/" ]
Still you have selected the answer I would like to answer on your last desire that you want this to work in a proper way that WordPress do. Please check **wp\_footer** is called before **body** tag closed or not. Action Hook **wp\_enqueue\_scripts** will called in **wp\_footer** function. Please try once and let me kno...
You can get css file from below code: ``` <?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array...
50,250,474
**Problem:** I'm looking for a way to create complex snippets. At our company we have larger functions which almost seem boilerplate-ish, and I feel can be made much easier. **Desired solution:** I want to create something, similar to how snippets work, but suitable for more complex generation of code. For instance, s...
2018/05/09
[ "https://Stackoverflow.com/questions/50250474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9763789/" ]
You can get css file from below code: ``` <?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array...
Wrap with add\_action and this might work `<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_register_style('css-ui',get_template_directory_uri().'/assets/css/style.css' ); wp_enqueue_style('css-ui' ); }`
50,250,474
**Problem:** I'm looking for a way to create complex snippets. At our company we have larger functions which almost seem boilerplate-ish, and I feel can be made much easier. **Desired solution:** I want to create something, similar to how snippets work, but suitable for more complex generation of code. For instance, s...
2018/05/09
[ "https://Stackoverflow.com/questions/50250474", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9763789/" ]
Still you have selected the answer I would like to answer on your last desire that you want this to work in a proper way that WordPress do. Please check **wp\_footer** is called before **body** tag closed or not. Action Hook **wp\_enqueue\_scripts** will called in **wp\_footer** function. Please try once and let me kno...
Wrap with add\_action and this might work `<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_register_style('css-ui',get_template_directory_uri().'/assets/css/style.css' ); wp_enqueue_style('css-ui' ); }`
17,591,618
I have a string like below that comes as a response. I want this string to format so every parameter come one after another. Like if i get this string ``` string str1 = @"testmode=0<br>MessageReceived=Your order dispached and will be delived<br>Messagecount1 <br>could not access file: Error=Not enough credit send.";...
2013/07/11
[ "https://Stackoverflow.com/questions/17591618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357261/" ]
try something like ``` string formatted = str1.Replace("<br>",Environment.NewLine); ``` This will just replace the `<br>` tags with a newline.
Not the best one, but what about: ``` MessageBox.Show(string.Join(Environment.NewLine, str1.Split(new string[]{"<br>", ":"}, StringSplitOptions.None))); ```
17,591,618
I have a string like below that comes as a response. I want this string to format so every parameter come one after another. Like if i get this string ``` string str1 = @"testmode=0<br>MessageReceived=Your order dispached and will be delived<br>Messagecount1 <br>could not access file: Error=Not enough credit send.";...
2013/07/11
[ "https://Stackoverflow.com/questions/17591618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357261/" ]
try something like ``` string formatted = str1.Replace("<br>",Environment.NewLine); ``` This will just replace the `<br>` tags with a newline.
try ``` MessageBox.Show(str1.Replace(@"<br>", Environment.NewLine)); ``` I'm not sure regarding the line break after `could not access file:` How do you know you have to break line there?
17,591,618
I have a string like below that comes as a response. I want this string to format so every parameter come one after another. Like if i get this string ``` string str1 = @"testmode=0<br>MessageReceived=Your order dispached and will be delived<br>Messagecount1 <br>could not access file: Error=Not enough credit send.";...
2013/07/11
[ "https://Stackoverflow.com/questions/17591618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357261/" ]
try something like ``` string formatted = str1.Replace("<br>",Environment.NewLine); ``` This will just replace the `<br>` tags with a newline.
Maybe try this using Replace to change br into newline. Put after your code this line: ``` str1.Replace("<br>", "\n"); ```
17,591,618
I have a string like below that comes as a response. I want this string to format so every parameter come one after another. Like if i get this string ``` string str1 = @"testmode=0<br>MessageReceived=Your order dispached and will be delived<br>Messagecount1 <br>could not access file: Error=Not enough credit send.";...
2013/07/11
[ "https://Stackoverflow.com/questions/17591618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357261/" ]
try ``` MessageBox.Show(str1.Replace(@"<br>", Environment.NewLine)); ``` I'm not sure regarding the line break after `could not access file:` How do you know you have to break line there?
Not the best one, but what about: ``` MessageBox.Show(string.Join(Environment.NewLine, str1.Split(new string[]{"<br>", ":"}, StringSplitOptions.None))); ```
17,591,618
I have a string like below that comes as a response. I want this string to format so every parameter come one after another. Like if i get this string ``` string str1 = @"testmode=0<br>MessageReceived=Your order dispached and will be delived<br>Messagecount1 <br>could not access file: Error=Not enough credit send.";...
2013/07/11
[ "https://Stackoverflow.com/questions/17591618", "https://Stackoverflow.com", "https://Stackoverflow.com/users/357261/" ]
Maybe try this using Replace to change br into newline. Put after your code this line: ``` str1.Replace("<br>", "\n"); ```
Not the best one, but what about: ``` MessageBox.Show(string.Join(Environment.NewLine, str1.Split(new string[]{"<br>", ":"}, StringSplitOptions.None))); ```
18,064,716
So, I have a file like ``` <root> <transaction ts="1"> <abc><def></def></abc> </transaction> <transaction ts="2"> <abc><def></def></abc> </transaction> </root> ``` So, I have a condition which says if ts="2" then do something ... Now the problem is when it finds ts="1" it still scans through tags < ...
2013/08/05
[ "https://Stackoverflow.com/questions/18064716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2601010/" ]
A SAX parser must scan thru all sub trees (like your "< abc>< def>< /def>< /abc>") to know where the next element starts. No way to get around it, which is also the reason why you cannot parallelize a XML Parser for a single XML document. The only two ways of tuning I can think of in your case: 1) If you have many XM...
> > Is there a way when the condition doesn`t match the parsing breaks and > look for the next transaction tag directly? > > > No. You'll have to write the SAX parser to know when to skip looking at the tags in the bad transaction block. That said, you'll probably find switching to [STAX](http://docs.oracle.com/c...
18,064,716
So, I have a file like ``` <root> <transaction ts="1"> <abc><def></def></abc> </transaction> <transaction ts="2"> <abc><def></def></abc> </transaction> </root> ``` So, I have a condition which says if ts="2" then do something ... Now the problem is when it finds ts="1" it still scans through tags < ...
2013/08/05
[ "https://Stackoverflow.com/questions/18064716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2601010/" ]
A SAX parser must scan thru all sub trees (like your "< abc>< def>< /def>< /abc>") to know where the next element starts. No way to get around it, which is also the reason why you cannot parallelize a XML Parser for a single XML document. The only two ways of tuning I can think of in your case: 1) If you have many XM...
The sax parser calls your callbacks always for each XML element. You can solve your question by setting a field `isIgnoreCurrentTransaction`, once you detect the condition to ignore. Then in your other sax callbacks you check for `isIgnoreCurrentTransaction` amd simply do nothing in that case.
18,064,716
So, I have a file like ``` <root> <transaction ts="1"> <abc><def></def></abc> </transaction> <transaction ts="2"> <abc><def></def></abc> </transaction> </root> ``` So, I have a condition which says if ts="2" then do something ... Now the problem is when it finds ts="1" it still scans through tags < ...
2013/08/05
[ "https://Stackoverflow.com/questions/18064716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2601010/" ]
A SAX parser must scan thru all sub trees (like your "< abc>< def>< /def>< /abc>") to know where the next element starts. No way to get around it, which is also the reason why you cannot parallelize a XML Parser for a single XML document. The only two ways of tuning I can think of in your case: 1) If you have many XM...
You can use a control flag in your SAX implementation which is raised when you detect your condition on a certain tag and lower the flag again once you exit the tag. You can use that flag to skip any processing when the parser runs through the children of the tag you are not interested in. Note however that your examp...
14,941,954
I have frames of a Video with 30FPS in my C# code and I want to broadcast it in local host so all other applications can use it. I though because it is a video and there is no concern if any packet lost and no need to connect/accept from clients, UDP is a good choose. But there are number of problems here. * If I us...
2013/02/18
[ "https://Stackoverflow.com/questions/14941954", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1913051/" ]
I experiment Multicast in an industrial environment, it's a good choice **over a not staturated reliable network**. In **local host**, *shared memory* may be a good choice because you may build a **circular queue of frames** and flip from one to the next only with a single mutex to protect a pointer assignment (writte...
Use live555 <http://www.live555.com/> for streaming in combination with your favorite compressor - ffmpeg.
71,153,291
I would like to retrieve all products of chosen parent category.Product model have hasmany relation to product\_category\_mapping table. If product have subcategory result like, ``` "MAinCatergory":[ { id="", name:"Drinks", "ChildCategory":[ { "id":1, ...
2022/02/17
[ "https://Stackoverflow.com/questions/71153291", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6085744/" ]
Something like this might suffice. ``` App\Models\Category::with('children', 'product_category.product')->get() ``` Suggestion, try implement pivot many to many relation instead this product\_category\_mapping, then model relation would change a bit. For pivot relation, you need to modify the Category model ``` pu...
in your product model add like this: ``` public function product_categorys(){ return $this->hasMany('App\Models\ProductCategoryMapping','product_id'); } ``` and in controller you can get inside your function like this `Product::with('product_categorys')->get();`
2,376,305
I am trying to evaluate the following Fourier transform $$F(x,n) = \int\_{-\infty}^{\infty}\frac{\mathrm{e}^{\mathrm{i}tx}} {(\,t - \mathrm{i}\,)^{n/2}}\,\mathrm{d}t\,,\quad \forall\ x \in \mathbb{R}^{+}\,,\ n\in \mathbb{N}. $$ For even $n$, we can use the contour integral on the complex plane $t$ where [the contour]...
2017/07/30
[ "https://math.stackexchange.com/questions/2376305", "https://math.stackexchange.com", "https://math.stackexchange.com/users/64809/" ]
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \new...
It stays related to $\Gamma(s)$ and its properties. For $x > 0$ and $n > 0$ $$F(x) =\int\_{-\infty}^\infty \frac{e^{itx}}{(t-i)^{n/2}} dt=e^{-x}\int\_{-\infty-i}^{\infty-i} \frac{e^{itx}}{t^{n/2}} dt=e^{-x}x^{n/2-1}\int\_{-\infty-ix}^{\infty-ix} \frac{e^{i\tau}}{\tau^{n/2}} d\tau$$ $$ =F(1) e^{1-x}x^{n/2-1}$$ For $x < ...
2,376,305
I am trying to evaluate the following Fourier transform $$F(x,n) = \int\_{-\infty}^{\infty}\frac{\mathrm{e}^{\mathrm{i}tx}} {(\,t - \mathrm{i}\,)^{n/2}}\,\mathrm{d}t\,,\quad \forall\ x \in \mathbb{R}^{+}\,,\ n\in \mathbb{N}. $$ For even $n$, we can use the contour integral on the complex plane $t$ where [the contour]...
2017/07/30
[ "https://math.stackexchange.com/questions/2376305", "https://math.stackexchange.com", "https://math.stackexchange.com/users/64809/" ]
We extend the original integral on $\frac n2$ by a complex number $\Re z>0$. $$F(x,z) := \int\_{-\infty}^{\infty}\frac{\mathrm{e}^{\mathrm{i}tx}} {\left(t - \mathrm{i}\right)^z}\,\mathrm{d}t\,,\quad \forall\ x \in \mathbb{R}^{+}\,,\ \Re z\in(0,\infty).$$ We have to make the extension to make use of the contour integra...
It stays related to $\Gamma(s)$ and its properties. For $x > 0$ and $n > 0$ $$F(x) =\int\_{-\infty}^\infty \frac{e^{itx}}{(t-i)^{n/2}} dt=e^{-x}\int\_{-\infty-i}^{\infty-i} \frac{e^{itx}}{t^{n/2}} dt=e^{-x}x^{n/2-1}\int\_{-\infty-ix}^{\infty-ix} \frac{e^{i\tau}}{\tau^{n/2}} d\tau$$ $$ =F(1) e^{1-x}x^{n/2-1}$$ For $x < ...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
While - as joan already put it - it's not possible to shut the RPi completely down and/or start it up by its own hardware, your "at least" demand of turning off WiFi and the HDD could be accomplished with only minor hardware hacking. Joans solution however provides higher savings with respect to electrical energy since...
You could use power outlet timer, plug the Pi into that and set it to power up every morning. I think the shutdown command has a schedule flag.
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
Why do you want to shut down the Pi? The Pi itself uses so little power (<5W) that it is not worthwhile unless you are running on batteries. The B+ uses even less. EDIT 2016-06-18 The following comment is no longer correct. `halt` `shutdown` and `poweroff` all perform a orderly shutdown of the OS. Having said that `h...
I don't know if this is still relevant to anyone, but this is how I solved it: In our Company we have tons of Displays that just Display Information, and I was looking, just like the person that asked this question, to reduce the energy my Raspberry Pi's use at night (since no one really needs them at night). I modifi...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
You could check out the Witty Pi from [UUGear](http://www.uugear.com/store/) as a simple extension to the Raspi. Will do proper startup and shutdown of system, includes real-time clock.
Why do you want to shut down the Pi? The Pi itself uses so little power (<5W) that it is not worthwhile unless you are running on batteries. The B+ uses even less. EDIT 2016-06-18 The following comment is no longer correct. `halt` `shutdown` and `poweroff` all perform a orderly shutdown of the OS. Having said that `h...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
You could check out the Witty Pi from [UUGear](http://www.uugear.com/store/) as a simple extension to the Raspi. Will do proper startup and shutdown of system, includes real-time clock.
I know this is "sorta" cheating, but I found an old laptop for under $20, and I use it to power my Pi. It also runs Linux and has WOL for it's ethernet, so I can simply login to the pi and shut it down, then log in to the laptop and shut it down. Then all i have to do is run etherwake AA:BB:CC... (the hardware address ...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
Why do you want to shut down the Pi? The Pi itself uses so little power (<5W) that it is not worthwhile unless you are running on batteries. The B+ uses even less. EDIT 2016-06-18 The following comment is no longer correct. `halt` `shutdown` and `poweroff` all perform a orderly shutdown of the OS. Having said that `h...
While - as joan already put it - it's not possible to shut the RPi completely down and/or start it up by its own hardware, your "at least" demand of turning off WiFi and the HDD could be accomplished with only minor hardware hacking. Joans solution however provides higher savings with respect to electrical energy since...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
You could check out the Witty Pi from [UUGear](http://www.uugear.com/store/) as a simple extension to the Raspi. Will do proper startup and shutdown of system, includes real-time clock.
I don't know if this is still relevant to anyone, but this is how I solved it: In our Company we have tons of Displays that just Display Information, and I was looking, just like the person that asked this question, to reduce the energy my Raspberry Pi's use at night (since no one really needs them at night). I modifi...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
The Raspberry Pi doesn't have the hardware needed to shut-down/start-up like a regular desktop PC. The simplest, and possibly most reliable, solution would be to use a timer switch to switch the power to the Pi on and off. If doing so I'd add a cron job on the Pi to do a software shutdown several minutes before the ti...
I know this is "sorta" cheating, but I found an old laptop for under $20, and I use it to power my Pi. It also runs Linux and has WOL for it's ethernet, so I can simply login to the pi and shut it down, then log in to the laptop and shut it down. Then all i have to do is run etherwake AA:BB:CC... (the hardware address ...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
The Raspberry Pi doesn't have the hardware needed to shut-down/start-up like a regular desktop PC. The simplest, and possibly most reliable, solution would be to use a timer switch to switch the power to the Pi on and off. If doing so I'd add a cron job on the Pi to do a software shutdown several minutes before the ti...
While - as joan already put it - it's not possible to shut the RPi completely down and/or start it up by its own hardware, your "at least" demand of turning off WiFi and the HDD could be accomplished with only minor hardware hacking. Joans solution however provides higher savings with respect to electrical energy since...
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
The Raspberry Pi doesn't have the hardware needed to shut-down/start-up like a regular desktop PC. The simplest, and possibly most reliable, solution would be to use a timer switch to switch the power to the Pi on and off. If doing so I'd add a cron job on the Pi to do a software shutdown several minutes before the ti...
You could use power outlet timer, plug the Pi into that and set it to power up every morning. I think the shutdown command has a schedule flag.
23,720
I want my raspberryPi to shut down during the night and wake up in the morning. I.e., at 10pm raspberry should shutdown or at least turn of the WiFi and the HDD. At 10am every day my raspberry should wake up or at least turn on the WiFi and the HDD. **How can I do this?** Edit: How can I set a timer to turn of th...
2014/10/06
[ "https://raspberrypi.stackexchange.com/questions/23720", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/17915/" ]
I know this is "sorta" cheating, but I found an old laptop for under $20, and I use it to power my Pi. It also runs Linux and has WOL for it's ethernet, so I can simply login to the pi and shut it down, then log in to the laptop and shut it down. Then all i have to do is run etherwake AA:BB:CC... (the hardware address ...
You could use power outlet timer, plug the Pi into that and set it to power up every morning. I think the shutdown command has a schedule flag.
61,666,498
This question is about code styling in Nestjs. This framework suggests file naming lowercase letters and across the dot. Example: file user.service.ts ``` export class UserService { } ``` another file ``` import { UserService } from './user.service' ``` In most cases every file contains one class. I find it con...
2020/05/07
[ "https://Stackoverflow.com/questions/61666498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11586849/" ]
This is a very opinionated question which deserves an opinionated answer. File Names ========== The file names are separated as they are for several reasons. 1) it's how Angular does it and Nest is inspired by Angular 2) it means that OSs that treat uppercase and lowercase file names as the same do not get confuse...
I came a cross this old question, and I think it worths providing this answer for next visitors. Like `@Jay McDoiel` mentioned, this is a very opinionated choice. Either way is correct. **However, I found out that NestJS library used hyphen-separated `user-role.service.ts` file naming as its convention.** Check out ...
14,403,498
I have a simple Hibernate query like: ``` from MyEntity where name = ? ``` Nothing fancy, but it's called many times in a fairly big transaction (lasts one second, may load dozens or hundreds of entities). Profiler shows that a lot of time is spent in: ``` org.hibernate.internal.SessionImpl.autoFlushIfRequired(Sess...
2013/01/18
[ "https://Stackoverflow.com/questions/14403498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/277683/" ]
By default hibernate flushes before issuing a query during a session (FlushMode.AUTO), and chews up lots of CPU time doing it. It is particularly painful if you have a session where many queries and updates run alternately. If the query is likely to select back data that you have inserted/updated/deleted during the c...
Hibernate changed its flush logic in version 3.3. Now it will always flush, even if set to `FlushMode.MANUAL`, if it detects you are querying a table for which there are dirty entities. Some workarounds I can think of: * Reorder operations to not query dirty tables and set `FlushMode.COMMIT` or lower. * Detach entit...
29,535,125
My project needs both accessors. * Access Value using Key (Simple) * Access Key using Value (Bit tricky) Value too will be unique in my project --- Please suggest the better container to use and how ? I would like to use either the STL or BOOST.
2015/04/09
[ "https://Stackoverflow.com/questions/29535125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1312193/" ]
What you're looking for is called a [bidirectional map](https://en.wikipedia.org/wiki/Bidirectional_map). There isn't one in the STL, but you can take a look at [Boost.Bimap](http://www.boost.org/doc/libs/1_55_0/libs/bimap/doc/html/) for another implementation. If you want to implement it yourself, you can simply use...
If you want the either way access, ie *key->value and value->key*, chances are that your design doesn't need an associative container like a `map` Try a `vector` of [std::pair](http://en.cppreference.com/w/cpp/utility/pair). On a side note, if you need to store more than two values, you can use [std::tuple](http://en...
29,535,125
My project needs both accessors. * Access Value using Key (Simple) * Access Key using Value (Bit tricky) Value too will be unique in my project --- Please suggest the better container to use and how ? I would like to use either the STL or BOOST.
2015/04/09
[ "https://Stackoverflow.com/questions/29535125", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1312193/" ]
That's what I used in my project two days ago. ``` #include <boost/bimap.hpp> class ClientManager { typedef boost::bimap< boost::bimaps::set_of<int>, boost::bimaps::set_of<int> > ConnectedUsers; // User Id, Instance Id ConnectedUsers m_connectedUsers; public: int getUserId(int instanceI...
If you want the either way access, ie *key->value and value->key*, chances are that your design doesn't need an associative container like a `map` Try a `vector` of [std::pair](http://en.cppreference.com/w/cpp/utility/pair). On a side note, if you need to store more than two values, you can use [std::tuple](http://en...
44,519,722
Please, I was using **log4j** input of logstash, it was allowing me to **skip log parsing** (grok ...). ``` `input { log4j { mode => "server" host => "0.0.0.0" port => 8090 } }` ``` Elastic now, in version [5.4.1](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-log4j.htm...
2017/06/13
[ "https://Stackoverflow.com/questions/44519722", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5164226/" ]
The log4j [socket appender](https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/net/SocketAppender.html) does not use a layout. It sends the data in a structured format such that grok is not required. To achieve a similar result you could configure log4j to write the data to log files in a structured format....
You can use `logstash-logback-encoder`, it provides a `LogstashSocketAppender`, which implement SocketAppender, and using RSysLog to send log in json format to elasticsearch.
64,299,118
I'm trying to make a generic stack and queue class that uses the generic node class. It has `empty()`, `pop()`, `peek()`, `push()`, and a `search()` method. I know there is a built-in `Stack` class and stack `search` method but we have to make it by using the `Node` class. I am unsure of how to make the `search` metho...
2020/10/10
[ "https://Stackoverflow.com/questions/64299118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14270806/" ]
`str.split(" ")` does the exact same thing in both cases. It creates an anonymous list of the split strings. In the second case you have the minor overhead of assigning it to a variable and then fetching the value of the variable. Its wasted time if you don't need to keep the object for other reasons. But this is a tri...
Look my friend, if you want to actually reduce the amount of time in the code in general,loop on a tuple instead of list but assigning the result in a variable then using the variable is not the best approach is you just reserved a memory location just to store the value but sometimes you can do that just for the sake ...
7,517,887
I have been using DDD for a while know so I am comfortable with the idea of aggregates. At first I did have troubles wrapping my head around not using/persisting references to other root aggregates but I think I'm on board... so: * Storing a root aggregate as a one document.... check * Using denormalized references co...
2011/09/22
[ "https://Stackoverflow.com/questions/7517887", "https://Stackoverflow.com", "https://Stackoverflow.com/users/285874/" ]
In DDD there are at least two valid points of view. Some ppl link root aggregates only by ID or another valid key and second is using platform specific references to other objects. Both has it's own pros and cons. With NoSql solutions like RavenDb, it's probably better to use first approach, because second is just tec...
You are going explicitly against the recommended design here, why *do* you want a Product property refering to another aggregate? What does it gives you?
1,151,461
I'm looking to take a whole system backup and store it on S3. Something that could be good enough to restore my entire system. But I've been told that using dd/rsync to capture the root directory will save a lot of extraneous files that I wouldn't need to restore the system. In the event that I had to reply on this ba...
2019/06/16
[ "https://askubuntu.com/questions/1151461", "https://askubuntu.com", "https://askubuntu.com/users/510490/" ]
You might look at a combination of `Backups` (Déjà Dup) for your /home, and `Timeshift` for the system stuff. Otherwise, use `Macrium Reflect` to clone your entire disk/partition. The closest thing to a Windows-like restore point is by using `Timeshift`. I use it to save snapshots to an external USB hard drive. Althou...
From: [Bash script to backkup/clone Ubuntu to another partition](https://askubuntu.com/questions/1028604/bash-script-to-backkup-clone-ubuntu-to-another-partition/1028605#1028605) ``` rsync -haxAX --stats --delete --info=progress2 --info=name0 --inplace \ /* "$TargetMnt" ...
123,071
As a follow up to [my recent question](https://tex.stackexchange.com/questions/123002/problem-with-custom-vertical-alignment-and-or-length-of-lines-rules-in-tabular-e): Now I'd like to put some color on to that line/rule. In the MWE below, `\arrayrulecolor{blue}\mycline{1-1}` throws an error (`undefined control sequenc...
2013/07/08
[ "https://tex.stackexchange.com/questions/123071", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/27721/" ]
Your MWE generates an unknown option error for mdfamed with the version I have, so I removed that and loaded `colortbl` which otherwise wasn't loaded. Since `colortbl` redefines `\cline` The patch in the previous answer didn't match and you need a modified one. ![enter image description here](https://i.stack.imgur.com...
To understand the error related to `mdframed` I want to provide a small answer. Options are separated by commas, so your input ``` \usepackage[framemethod=TikZ, xcolor=RGB,table]{mdframed} ``` is passing the options to `mdframed`: 1. `framemethod=TikZ` == known 2. `xcolor=RGB` == known 3. `table`== unknown If you...
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
The difference between "载体" and "媒介" in Chinese is equivalent to the difference between "Carrier" and "Medium" in English. So, you pretty much can figure this out immediately after I told you that, if your English is well enough.
Usually they are the same thing. FYI,if 载体carrier is something, Media媒介 is everything. whole meaning on media: <http://www.businessdictionary.com/definition/media.html> carrier, mostly means practical channel like radio, newspaper, internet,etc. So in this point the meaning are the same, means of communication, as r...
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
Very interesting! Both semantics and syntax mixed up in here. 載體 is a noun. It is the thing which moves a to b; definitely a new sounding word, yet I found one example from 1965! In biology, such as virology or genetic technology, 載體 is a "vector", so we have words like 病毒載體 viral vector, for which there is a Chinese...
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
The difference between "载体" and "媒介" in Chinese is equivalent to the difference between "Carrier" and "Medium" in English. So, you pretty much can figure this out immediately after I told you that, if your English is well enough.
just like English, Chinese language's words and expressions are used in circumstances and may link to different aspects as the context changes. 载体 is more related to carrier, bearing something on it, holder of something, while 媒介 is more related to medium, pipe, conducting something, or the intermediate interface betw...
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
The difference between "载体" and "媒介" in Chinese is equivalent to the difference between "Carrier" and "Medium" in English. So, you pretty much can figure this out immediately after I told you that, if your English is well enough.
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
The difference between "载体" and "媒介" in Chinese is equivalent to the difference between "Carrier" and "Medium" in English. So, you pretty much can figure this out immediately after I told you that, if your English is well enough.
I think 媒介 refers to the environment. Say A and B are both in the air/space/water/etc, here the air/space/water/etc is 媒介. If A gives B something through C, then C is 载体.
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
Usually they are the same thing. FYI,if 载体carrier is something, Media媒介 is everything. whole meaning on media: <http://www.businessdictionary.com/definition/media.html> carrier, mostly means practical channel like radio, newspaper, internet,etc. So in this point the meaning are the same, means of communication, as r...
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
The difference between "载体" and "媒介" in Chinese is equivalent to the difference between "Carrier" and "Medium" in English. So, you pretty much can figure this out immediately after I told you that, if your English is well enough.
Very interesting! Both semantics and syntax mixed up in here. 載體 is a noun. It is the thing which moves a to b; definitely a new sounding word, yet I found one example from 1965! In biology, such as virology or genetic technology, 載體 is a "vector", so we have words like 病毒載體 viral vector, for which there is a Chinese...
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
just like English, Chinese language's words and expressions are used in circumstances and may link to different aspects as the context changes. 载体 is more related to carrier, bearing something on it, holder of something, while 媒介 is more related to medium, pipe, conducting something, or the intermediate interface betw...
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
I think 媒介 refers to the environment. Say A and B are both in the air/space/water/etc, here the air/space/water/etc is 媒介. If A gives B something through C, then C is 载体.
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
12,951
They both mean medium, so they are probably the same. Are they?
2015/04/07
[ "https://chinese.stackexchange.com/questions/12951", "https://chinese.stackexchange.com", "https://chinese.stackexchange.com/users/8119/" ]
They have different meanings but in practical they are used interchangeable especially about mass media. 載體, from its sense, it is holder and container. 媒介, it is an agent that allows two or more parties interact.
这可能有习惯用语的成分在里面,通常: * 声音以空气为媒介传递,而较少说声音以空气为载体。 * 通灵师(从事迷信活动并获得报酬的人)的肉体可以作为现世(the alive world)与彼岸(the dead world)联系的媒介,而较少说通灵师的肉体是某载体。 * 信息传输以电磁波或光波为载体,而较少说信息传输以电磁波为媒介。 * 磁带作为信息的载体,而较少说磁带作为信息的媒介。 * 蜜蜂充当了花粉授粉的媒介,而较少说蜜蜂充当了授粉的载体。 可以认为,载体是一种媒介物,因此媒介的范畴通常要宽泛一些,但考虑到一些习惯用法因此实际上并不绝对。
32,138,637
When writing code like this, why is the y axis inverted, meaning positive values make an object go down while negative values make it go up? ``` animation.update(); if(up){ dy -=1.1; } else{ dy +=1.1; } if(dy>14)dy = 14; if(dy<-14)dy = -14; y += dy*2; dy = 0; } pub...
2015/08/21
[ "https://Stackoverflow.com/questions/32138637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5162815/" ]
Please note that the origin `(0,0)` in Android screen is situated at **top-left** corner of the screen. Thus, when you add values to `y axis` the object go towards bottom and when subtract values the object goes upwards. In Android devices: ``` Origin | V *------------------------------- | ----> X axis ...
This is the common way, in which computer displays are addressed. It stems probably from that video memory is mapped to screen row-by-row from the top left corner, which in turn most likely comes from the fact that this way electron beam swept the screen in old CRT displays. You can change the coordinate system to be ...
67,990,201
I have one ugly text file that looks like this: ``` 2020-06-13 ---------------------------------------- |Order |Warehouse|Stock|Price|Vendor| |--------------------------------------| |31434 |WA12 |200 |160 |AS12 | |31435 |WA11 |26 |12 |AS11 | |31436 |WA13 |202 |161 |AS16 | ---------...
2021/06/15
[ "https://Stackoverflow.com/questions/67990201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16235371/" ]
This data is really tricky as you said, So, we have to pay logic another way around: raw\_data as provided: ---------------------- ``` $ cat weired_data ---------------------------------------- |Order |Warehouse|Stock|Price|Vendor| |--------------------------------------| |31434 |WA12 |200 |160 |AS12 | |...
Maybe this will work for you. ``` import pandas as pd import re file = open('weird_data.txt', 'r').read() ###Removing strange characters### to_replace = ['\n', '--------------------------------------', ' '] for char in to_replace: file = file.replace(char, '') file = file.replace('--', '') ###Removing column n...
10,331
We have recently upgraded from 4.4 to 4.7.3 and are now experiencing an issue with one of our profiles. It seems that the civi will no longer use the postURL we are passing to it in an html form. I don't see any release notes saying this was removed and I am kind of at a loss of what could be causing this. Any suggest...
2016/03/10
[ "https://civicrm.stackexchange.com/questions/10331", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/2965/" ]
I assume you're talking about a profile where you've copied the HTML Snippet and pasted it onto another site. If so, you should be aware that the necessary code does change periodically between major versions. Thankfully, the answer is pretty straightforward: just generate the HTML Snippet all over again. Go to **Admi...
I couldn't get the postURL to work on HTML snippets either, but setting a redirect URL in the actual profile settings worked ok.
18,920,687
I have below code to encrypt and decrypt the message in c#. when i am trying to run it is giving an exception ie "The data to be decrypted exceeds the maximum for this modulus of 256 bytes" ``` public static void Main(string[] args) { X509Certificate2 cert = new X509Certificate2(@"C:\Data\ABC-rsa-public-k...
2013/09/20
[ "https://Stackoverflow.com/questions/18920687", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2791316/" ]
Several problems: 1. RSA by default only encrypts one block. It's not suitable for long messages. You shouldn't encrypt the message itself with RSA. Generate a random AES key and encrypt the key with RSA and the actual message with AES. 2. You must use a binary safe encoding such as Hex or Base64 for the ciphertext. U...
RSA should not be used to encrypt this kind of data. You should be encrypting your data with a symmetric key like AES, then encrypting the symmetric key with RSA.
8,364,277
When I press an image on the screen, it calls the powerButton.OnClickListener() like it's supposed to and, after a few seconds of buffering, the stream plays just fine. However, the folks would like a brief toast popup to display to notify the user "Radio Stream Connecting, Please Wait..." This is where the problem is...
2011/12/03
[ "https://Stackoverflow.com/questions/8364277", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1020924/" ]
That's because the toast won't show until you return from the onClick because that is the UI thread. I You won't do that until after the buffering is started. I think to get the effect you want, you check the AsynchTask to do the buffering in a background thread and return right away from the onClick. As a matter of ...
Try using an [AsyncTask](http://developer.android.com/reference/android/os/AsyncTask.html) where the first thing the AsyncTask does is display the toast before falling into the buffering procedure.
33,211,659
I am wondering how Laravel implement eloquent syntax so that the first where clause can be called statically with `User::where()` ``` User::where('id', 23)->where('email', $email)->first(); ``` Do they have a `public static function where()` and a `public function where()`
2015/10/19
[ "https://Stackoverflow.com/questions/33211659", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45066/" ]
Calling `where` on an Eloquent model does involve a little bit of magic that occurs behind the scenes. Firstly, take the example of: ``` User::where(’name’, ‘Joe’)->first; ``` There’s no static `where` method that exists on the `Model` class that the `User` class extends. What happens, is that the PHP magic method...
Well let's find out. When we open a model it extends `Model` so let's open that class. In the class `Model` we find 2 "magic" methods called `__call()` and `__callStatic()` *`__call()` is triggered when invoking inaccessible methods in an object context.* *`__callStatic()` is triggered when invoking inaccessible met...
10,537,184
I wrote some service which uses BroadcastReceiver to capture one of media buttons ("play button" from a headset), and it works perfectly on android 2.3.x (HTC Nexus One or HTC Desire) When I tried to run in on Android 4.0.3 (Samsung Nexus S) it doesn't work (my application doesn't receive intent "android.intent.action...
2012/05/10
[ "https://Stackoverflow.com/questions/10537184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1387438/" ]
Make sure that you have an activity in your app, and that the user runs this activity before attempting to press that button. Until then, your `<receiver>` [will not receive any broadcasts](http://commonsware.com/blog/2011/07/13/boot-completed-regression-confirmed.html). --- **UPDATE** On Android 4.0 and higher, it ...
If you just want your app to be the default but don't need to do anything with the button presses you can use the following method. Add this to the manifest file (in the "Application" node): ``` <receiver android:name="BroadcastReceiver"> <intent-filter> <action android:name="android.intent.ac...
54,936,022
I am not exactly sure how to phrase this question properly. However, it goes something like this. Suppose that we have some macros that work similar to `defun` in Common Lisp and are built on top of that. I made a declaration with one of such macros, and it compiled just fine. However, when I made a call at the REP...
2019/02/28
[ "https://Stackoverflow.com/questions/54936022", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5969463/" ]
Use the `MACROEXPAND` function to see what your macro call is expanding into. ``` (pprint (macroexpand '(my-defun ...))) ```
You can use something such as the macroexpand-1 function and i'll explain why that's better than a normal macro expansion: ``` CL-USER> (defmacro our-when(test &body body) `(if ,test (progn ,@body))) OUR-WHEN CL-USER> (macroexpand-1 '(our-when(> 2 1)(format t "Hello World"))) (IF (> 2 1) (PROGN ((FORMAT T...
20,961,689
I have the following CustomAdapter: ``` package com.test.testing; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android....
2014/01/07
[ "https://Stackoverflow.com/questions/20961689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837722/" ]
No, C++ has no operator similar to `[:]` in Fortran. Depending on whether you are storing things in row major or column major order, this can be done in similar ways however. Firstly, arrays aren't really first class citizens in C++. It's much easier to work with either `std::array` (for small `M, N` as these are sta...
You can only take the last dimension ``` int A[3][5]; int * x = A[2]; int y = x[3]; ``` To get `A[?][3]` - you would need a loop
20,961,689
I have the following CustomAdapter: ``` package com.test.testing; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android....
2014/01/07
[ "https://Stackoverflow.com/questions/20961689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837722/" ]
No, C++ has no operator similar to `[:]` in Fortran. Depending on whether you are storing things in row major or column major order, this can be done in similar ways however. Firstly, arrays aren't really first class citizens in C++. It's much easier to work with either `std::array` (for small `M, N` as these are sta...
A 2D array is just an array of arrays. So `int A[10][20]` declares an array of size 10, each of whose elements is an array of size 20, each of whose elements is an `int`. The expression `A[3]` has type "array of 20 ints", and you can use it as such. It will decay into an `int *` pointing to the first element of the r...
20,961,689
I have the following CustomAdapter: ``` package com.test.testing; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android....
2014/01/07
[ "https://Stackoverflow.com/questions/20961689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837722/" ]
No, C++ has no operator similar to `[:]` in Fortran. Depending on whether you are storing things in row major or column major order, this can be done in similar ways however. Firstly, arrays aren't really first class citizens in C++. It's much easier to work with either `std::array` (for small `M, N` as these are sta...
if you define int A[5][10] , then A will have 5 \* 10 \* sizeof(int) continue space, , in this case , A[3][:] would be in 31'th location to 40'th location in this array !! ``` int* p = &(A[30]) ; ``` \*(p+0) to \*(p+9) will be A[3][0] to A[3][9] , you can directly access each element of A by the pointer p . Edit :...
20,961,689
I have the following CustomAdapter: ``` package com.test.testing; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Locale; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android....
2014/01/07
[ "https://Stackoverflow.com/questions/20961689", "https://Stackoverflow.com", "https://Stackoverflow.com/users/837722/" ]
No, C++ has no operator similar to `[:]` in Fortran. Depending on whether you are storing things in row major or column major order, this can be done in similar ways however. Firstly, arrays aren't really first class citizens in C++. It's much easier to work with either `std::array` (for small `M, N` as these are sta...
Not with regular arrays. `std::valarray` supports `std::slice`, which does allow for row access (stride = 1) and column access (stride=row width)
54,375,227
I have a JSON file that I'd like to get values from and display. I tried to use a ternary operator but I couldn't seem to get the output I wanted since I have multiple variables. Here's what I tried: ``` //If there's a word, display its character / reading. Otherwise, just display the reading return `${json.data[0].wo...
2019/01/26
[ "https://Stackoverflow.com/questions/54375227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4838705/" ]
Placeholders don't work recursively in String templates. Write a clearer code. If you insist in using a compact ternary code: ``` json.data[0].word ? `${json.data[0].word} (${json.data[0].reading})` : `${json.data[0].reading}` ``` Your external placeholder is unnecessary.
There is a much easier way to go about this. First I would create a variable that contained the resulting evaluation, and simply returned a literal of that result. Then I would split up the nested ternaries into a set of nested if statements that are much easier to understand and modify in the future. Take a look at t...
121,292
In *Star Trek III: The Search for Spock*, Spock's father (Sarek) told Kirk to bring Dr. McCoy to Vulcan. At the time Enterprise was all busted up and being decommissioned. Kirk told Sarek that it would be difficult and Sarek basically just told Kirk to figure it out. Why didn't Spock's father help? He was an Ambassa...
2016/03/06
[ "https://scifi.stackexchange.com/questions/121292", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
The issue is not about bringing McCoy to Vulcan. The real issue is about bringing Spock from Genesis to Vulcan. =============================================================================================================== It's certainly a minor issue to bring McCoy to Vulcan. Rather, the point of much of the film is...
What Sarek actually said was that Kirk had to bring both McCoy *and* Spock to Vulcan: > > [The two see footage of Spock mind-melding with McCoy] > > > Kirk: Bones!... > > > Sarek: One alive, one not. Yet both in pain. > > > Kirk: What must I do? > > > Sarek: You must bring them to Mount Selaya -- on Vulcan. O...
121,292
In *Star Trek III: The Search for Spock*, Spock's father (Sarek) told Kirk to bring Dr. McCoy to Vulcan. At the time Enterprise was all busted up and being decommissioned. Kirk told Sarek that it would be difficult and Sarek basically just told Kirk to figure it out. Why didn't Spock's father help? He was an Ambassa...
2016/03/06
[ "https://scifi.stackexchange.com/questions/121292", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/-1/" ]
The issue is not about bringing McCoy to Vulcan. The real issue is about bringing Spock from Genesis to Vulcan. =============================================================================================================== It's certainly a minor issue to bring McCoy to Vulcan. Rather, the point of much of the film is...
Kirk, et. al. still had to go to the Genesis planet to retrieve Spock's body so it could be brought to Vulcan. Sarek was not going to Genesis.
2,370,177
Developers are sometimes scathing of mult-tier Enterprise web applications... 'Enterprise' is viewed by some as synonymous with slow, bloated and resource-hungry. Do frameworks such as Hibernate actually bring in a non-trivial impact on performance compared to writing your own DAOs or other less abstracted approaches?...
2010/03/03
[ "https://Stackoverflow.com/questions/2370177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197229/" ]
With proper usage you are likely to improve performance rather than decrease it. In most cases you'll get comparable performance and when there're problems you'll have much more time to troubleshoot them. PS Remember to use proper tools with Hibernate like [Hibernate profiler](http://hibernateprofiler.com/). They can ...
It depends a lot on what you're doing. Generally your users won't notice a difference on the front-end but there are a few things to watch out for: * ORM mappers aren't great at doing batch updates or handling large results sets. * If you have a complex set of relationships your ORM mapper might slow things down becau...
2,370,177
Developers are sometimes scathing of mult-tier Enterprise web applications... 'Enterprise' is viewed by some as synonymous with slow, bloated and resource-hungry. Do frameworks such as Hibernate actually bring in a non-trivial impact on performance compared to writing your own DAOs or other less abstracted approaches?...
2010/03/03
[ "https://Stackoverflow.com/questions/2370177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197229/" ]
With proper usage you are likely to improve performance rather than decrease it. In most cases you'll get comparable performance and when there're problems you'll have much more time to troubleshoot them. PS Remember to use proper tools with Hibernate like [Hibernate profiler](http://hibernateprofiler.com/). They can ...
That really depends on what you are doing or more exactly how you use the framework. Also, with today's hardware capabilities what is an issue today might not count in a few months. Not sure if you ask this because there is an application requirement which says that performance is important or you are just wondering, ...
2,370,177
Developers are sometimes scathing of mult-tier Enterprise web applications... 'Enterprise' is viewed by some as synonymous with slow, bloated and resource-hungry. Do frameworks such as Hibernate actually bring in a non-trivial impact on performance compared to writing your own DAOs or other less abstracted approaches?...
2010/03/03
[ "https://Stackoverflow.com/questions/2370177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197229/" ]
With proper usage you are likely to improve performance rather than decrease it. In most cases you'll get comparable performance and when there're problems you'll have much more time to troubleshoot them. PS Remember to use proper tools with Hibernate like [Hibernate profiler](http://hibernateprofiler.com/). They can ...
> > By non-trivial I suppose the question is "does the user notice pages load slower as a result". > > > For most CRUD applications, it's the contrary actually. Properly used and tuned, Hibernate will generate better SQL than most developers (sorry to say that but it's true) and features like lazy-loading, first l...
2,370,177
Developers are sometimes scathing of mult-tier Enterprise web applications... 'Enterprise' is viewed by some as synonymous with slow, bloated and resource-hungry. Do frameworks such as Hibernate actually bring in a non-trivial impact on performance compared to writing your own DAOs or other less abstracted approaches?...
2010/03/03
[ "https://Stackoverflow.com/questions/2370177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197229/" ]
That really depends on what you are doing or more exactly how you use the framework. Also, with today's hardware capabilities what is an issue today might not count in a few months. Not sure if you ask this because there is an application requirement which says that performance is important or you are just wondering, ...
It depends a lot on what you're doing. Generally your users won't notice a difference on the front-end but there are a few things to watch out for: * ORM mappers aren't great at doing batch updates or handling large results sets. * If you have a complex set of relationships your ORM mapper might slow things down becau...
2,370,177
Developers are sometimes scathing of mult-tier Enterprise web applications... 'Enterprise' is viewed by some as synonymous with slow, bloated and resource-hungry. Do frameworks such as Hibernate actually bring in a non-trivial impact on performance compared to writing your own DAOs or other less abstracted approaches?...
2010/03/03
[ "https://Stackoverflow.com/questions/2370177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197229/" ]
> > By non-trivial I suppose the question is "does the user notice pages load slower as a result". > > > For most CRUD applications, it's the contrary actually. Properly used and tuned, Hibernate will generate better SQL than most developers (sorry to say that but it's true) and features like lazy-loading, first l...
It depends a lot on what you're doing. Generally your users won't notice a difference on the front-end but there are a few things to watch out for: * ORM mappers aren't great at doing batch updates or handling large results sets. * If you have a complex set of relationships your ORM mapper might slow things down becau...
11,228,711
I have a table with a form below it. You can fill out the form, but hitting the 'Undo' button will revert any entered information to what it was before edits were made. I would like to assert the text that is manually entered so I can confirm the 'Undo' button is reverting the fields. The 'value' attribute does not ch...
2012/06/27
[ "https://Stackoverflow.com/questions/11228711", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1467348/" ]
Use the `apply` method: ``` app[fn_name].apply(app, fn_args); ``` <https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/apply>
Use `function.apply()`. ``` app[fn_name].apply(app, fn_args); ``` The first arguument is the context (`this`) inside the function, and the second is the array whose items should be passed as arguments.
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
Why compiling? You should be able to install the package: ``` sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-7 -y ``` Verify using: ``` gcc-7 --version ``` See [How to install gcc-7 or clang 4.0?](https://askubuntu.com/questions/859256/how-to-install-gcc-7-or-clang-4-0)
`crt1.o` is generally provided as part of the `libdevc` dependency (or something similar). I would suggest running `sudo apt search libc` or some similar variant with `lib6c`, `libdev`, `libc-dev` etc. Installing those fixed a similar issue I had recently. Failing that, run `find / -iname ctri.o` and add the folder it...
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
Why compiling? You should be able to install the package: ``` sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-7 -y ``` Verify using: ``` gcc-7 --version ``` See [How to install gcc-7 or clang 4.0?](https://askubuntu.com/questions/859256/how-to-install-gcc-7-or-clang-4-0)
run the following ``` sudo apt install aptitude sudo aptitude install gcc-7 g++-7 ``` or ``` sudo apt install aptitude && sudo aptitude install golang gcc-7 g++-7 ```
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
Why compiling? You should be able to install the package: ``` sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update sudo apt install g++-7 -y ``` Verify using: ``` gcc-7 --version ``` See [How to install gcc-7 or clang 4.0?](https://askubuntu.com/questions/859256/how-to-install-gcc-7-or-clang-4-0)
As you can see [here](https://packages.ubuntu.com/search?keywords=g%2B%2B), `g++` is just a package in the default ubuntu package repository (for ubuntu 18.04, 20.04 and 22.04 and others). So it's actually enough to just run this. ``` sudo apt update sudo apt install g++ ``` Afterwards you can check with: ``` g++ ...
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
run the following ``` sudo apt install aptitude sudo aptitude install gcc-7 g++-7 ``` or ``` sudo apt install aptitude && sudo aptitude install golang gcc-7 g++-7 ```
`crt1.o` is generally provided as part of the `libdevc` dependency (or something similar). I would suggest running `sudo apt search libc` or some similar variant with `lib6c`, `libdev`, `libc-dev` etc. Installing those fixed a similar issue I had recently. Failing that, run `find / -iname ctri.o` and add the folder it...
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
`crt1.o` is generally provided as part of the `libdevc` dependency (or something similar). I would suggest running `sudo apt search libc` or some similar variant with `lib6c`, `libdev`, `libc-dev` etc. Installing those fixed a similar issue I had recently. Failing that, run `find / -iname ctri.o` and add the folder it...
As you can see [here](https://packages.ubuntu.com/search?keywords=g%2B%2B), `g++` is just a package in the default ubuntu package repository (for ubuntu 18.04, 20.04 and 22.04 and others). So it's actually enough to just run this. ``` sudo apt update sudo apt install g++ ``` Afterwards you can check with: ``` g++ ...
50,729,551
I am generating multi Data entry Line using ASP MVC , however looking at the HTML source after generating by MVC, I've just noticed those HTML elements has a duplicated ID , even with the same html type it is look something wrong ? is that normal behavior in MVC and how to avoid it ? , I need really to have it unique,...
2018/06/06
[ "https://Stackoverflow.com/questions/50729551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3767719/" ]
run the following ``` sudo apt install aptitude sudo aptitude install gcc-7 g++-7 ``` or ``` sudo apt install aptitude && sudo aptitude install golang gcc-7 g++-7 ```
As you can see [here](https://packages.ubuntu.com/search?keywords=g%2B%2B), `g++` is just a package in the default ubuntu package repository (for ubuntu 18.04, 20.04 and 22.04 and others). So it's actually enough to just run this. ``` sudo apt update sudo apt install g++ ``` Afterwards you can check with: ``` g++ ...
2,063,619
I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: ``` <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte>...
2010/01/14
[ "https://Stackoverflow.com/questions/2063619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250665/" ]
I think you're looking for a [conditional deep-copy](http://www.dpawson.co.uk/xsl/sect2/N8367.html#d11679e58). Here's the code in the link above rewritten for your situation: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:templa...
Try something like this: ``` <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/Articles"> <LIST> <xsl:for-each select="Article[1]/Bullettext"> <ITEM> <xsl:value-of select="." /> </ITEM>...
2,063,619
I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: ``` <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte>...
2010/01/14
[ "https://Stackoverflow.com/questions/2063619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250665/" ]
From your comment in response to Rubens Farias's answer (and really, that's something you should edit your question to include), it seems that you want a generic way to transform any group of adjacent `BulletText` elements into a list. That gets us to two questions: how do we find such groups, and having found them, ho...
Try something like this: ``` <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/Articles"> <LIST> <xsl:for-each select="Article[1]/Bullettext"> <ITEM> <xsl:value-of select="." /> </ITEM>...
2,063,619
I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: ``` <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte>...
2010/01/14
[ "https://Stackoverflow.com/questions/2063619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250665/" ]
Grouping Siblings with Three Templates -------------------------------------- Although there are currently several working answers to this question, you can actually group siblings very easily with three templates and the identity. First, you need a template that will just remove all of the nodes and set its priority...
Try something like this: ``` <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/Articles"> <LIST> <xsl:for-each select="Article[1]/Bullettext"> <ITEM> <xsl:value-of select="." /> </ITEM>...
2,063,619
I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: ``` <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte>...
2010/01/14
[ "https://Stackoverflow.com/questions/2063619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250665/" ]
From your comment in response to Rubens Farias's answer (and really, that's something you should edit your question to include), it seems that you want a generic way to transform any group of adjacent `BulletText` elements into a list. That gets us to two questions: how do we find such groups, and having found them, ho...
I think you're looking for a [conditional deep-copy](http://www.dpawson.co.uk/xsl/sect2/N8367.html#d11679e58). Here's the code in the link above rewritten for your situation: ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:templa...
2,063,619
I'm new in this XSLT-thing and I can't figure out how to this: This is a snippet from the xml i start with: ``` <Article> <Bullettext>10,00 </Bullettext> <Bullettext>8,00 </Bullettext> </Article> <Article> <something>some text</something> </Article> <Article> <Corpsdetexte>Bulgaria</Corpsdetexte>...
2010/01/14
[ "https://Stackoverflow.com/questions/2063619", "https://Stackoverflow.com", "https://Stackoverflow.com/users/250665/" ]
From your comment in response to Rubens Farias's answer (and really, that's something you should edit your question to include), it seems that you want a generic way to transform any group of adjacent `BulletText` elements into a list. That gets us to two questions: how do we find such groups, and having found them, ho...
Grouping Siblings with Three Templates -------------------------------------- Although there are currently several working answers to this question, you can actually group siblings very easily with three templates and the identity. First, you need a template that will just remove all of the nodes and set its priority...
46,318,086
I am working on an web application which has a query form to give search criteria. Once the query criteria is filled out in the form and searched, a table loads below the search form. Now this table is not formed by usual *tr* and *td* tags but is made up of several script tags like- ``` <TABLE> <THEAD>...</THEAD> <T...
2017/09/20
[ "https://Stackoverflow.com/questions/46318086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8639262/" ]
RSA (or any other asymmetric encryption scheme) does not work that way. You always encrypt using the public key and decrypt using the private key. What you probably want is to apply a *digital signature* to your licence instead of encrypting it. Such a signature is created using the private key and can be verified in ...
Example: let's say you have a license like this: ``` <license> <hardwareId>someValue</hardwareId> <serial>123456789</serial> <feature1 enabled="true" someOtherFeatureParameter="42"/> </license> ``` you can put this into a normal xml file, stored somewhere in a known path on the machine (your installation directo...
46,318,086
I am working on an web application which has a query form to give search criteria. Once the query criteria is filled out in the form and searched, a table loads below the search form. Now this table is not formed by usual *tr* and *td* tags but is made up of several script tags like- ``` <TABLE> <THEAD>...</THEAD> <T...
2017/09/20
[ "https://Stackoverflow.com/questions/46318086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8639262/" ]
RSA (or any other asymmetric encryption scheme) does not work that way. You always encrypt using the public key and decrypt using the private key. What you probably want is to apply a *digital signature* to your licence instead of encrypting it. Such a signature is created using the private key and can be verified in ...
The public key can only encrypt, you cant figure out the actual context of the files. However you can implement an encryption within the clients-application, and every clie,t makes his own private and public key. then the app send a request for the servers publickey, and sent its own publickey (possibly encrypted) to...
48,411,212
I require solving a large set of (independent) *Ax*=*b* linear problems. This cannot be parallelized (or more specifically, this is within each processor's responsibility anyway). The *Ax*=*b* sets are small (say 10x10 at most) but are dense (Usually all terms are non-zero) and both A matrices and RHS vectors are comp...
2018/01/23
[ "https://Stackoverflow.com/questions/48411212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4182862/" ]
Try using `MERGE` instead of `INSERT`. `MERGE` allows you to output a column you didn't insert, such as an identifier on your temp table. Using this method, you can build another temporary table that maps your temp table to the inserted rows (named `@TempIdTable` in the sample below). First, give `#TempTable` its own...
As you said, FirstName and LastName are not unique. This means you cannot use a `trigger` because there can be the same FirstName + LastName so you cannot join on them. But you can do the inverse thing: first `update` your temp table `ExternalID` (I suggest you to use `sequence` object and just do `update #t set Exte...
48,411,212
I require solving a large set of (independent) *Ax*=*b* linear problems. This cannot be parallelized (or more specifically, this is within each processor's responsibility anyway). The *Ax*=*b* sets are small (say 10x10 at most) but are dense (Usually all terms are non-zero) and both A matrices and RHS vectors are comp...
2018/01/23
[ "https://Stackoverflow.com/questions/48411212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4182862/" ]
Try using `MERGE` instead of `INSERT`. `MERGE` allows you to output a column you didn't insert, such as an identifier on your temp table. Using this method, you can build another temporary table that maps your temp table to the inserted rows (named `@TempIdTable` in the sample below). First, give `#TempTable` its own...
We need a unique column for able to make the comparison at the update operation after the insert. That's why we are using ExternalID column temporarily. ExternalID updated by row\_nubmber. ``` ;WITH CTE AS ( SELECT *, RN = ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) FROM @TempTable ) UPDATE CTE SET ExternalID = RN ...
48,411,212
I require solving a large set of (independent) *Ax*=*b* linear problems. This cannot be parallelized (or more specifically, this is within each processor's responsibility anyway). The *Ax*=*b* sets are small (say 10x10 at most) but are dense (Usually all terms are non-zero) and both A matrices and RHS vectors are comp...
2018/01/23
[ "https://Stackoverflow.com/questions/48411212", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4182862/" ]
Try using `MERGE` instead of `INSERT`. `MERGE` allows you to output a column you didn't insert, such as an identifier on your temp table. Using this method, you can build another temporary table that maps your temp table to the inserted rows (named `@TempIdTable` in the sample below). First, give `#TempTable` its own...
One way to do this is by duplicating the data into a second temp table like so: ``` SELECT * INTO #TEMPTABLE FROM (VALUES (1, 'Adam'), (2, 'Kate'), (3, 'Jess')) AS X (Id, Name) SELECT TOP 0 CAST(NULL AS INT) AS IdentityValue, * INTO #NEWTEMPTABLE FROM #TEMPTABLE CREATE TABLE #TABLEFORINSERT ( IdentityColumn INT ...
26,345,318
Building my first web-app and want to understand SQL injection better (<https://github.com/astaxie/build-web-application-with-golang/blob/master/en/eBook/09.4.md>). How much protection against SQL injection do I get from just always using the 'database/sql' library and constructing queries using '?' instead of concatt...
2014/10/13
[ "https://Stackoverflow.com/questions/26345318", "https://Stackoverflow.com", "https://Stackoverflow.com/users/830610/" ]
As long as you're using [Prepare](http://golang.org/pkg/database/sql/#DB.Prepare) or [Query](http://golang.org/pkg/database/sql/#DB.Query), you're safe. ``` // this is safe db.Query("SELECT name FROM users WHERE age=?", req.FormValue("age")) // this allows sql injection. db.Query("SELECT name FROM users WHERE age=" + ...
I agree with @Oneonone's answer. If you are retrieving data, do something like: ``` db.Query("SELECT name FROM users WHERE age=?", req.FormValue("age")) ``` If you have to insert a lot of data safely, using the same query, this is where Prepare comes handy. you can do something like this: ``` tx, err := db.Begin()...
72,107,707
I'm trying to update a boolean value onclick without any luck. ```js const myDropdownMenu = document.getElementById("dropdownMenu"); const openNav = document.getElementById("openNav"); const closeNav = document.getElementById("closeNav"); let mobileMenu = false; function toggleMenu() { mobileMenu = !mobileMenu; } ...
2022/05/04
[ "https://Stackoverflow.com/questions/72107707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19029622/" ]
Are you sure that you add `avatar1.png` in `assets/images` folder and also add below line in `pubspec.yaml` ``` flutter: assets: - assets/images/ ```
Maybe it's because the size of the image
72,107,707
I'm trying to update a boolean value onclick without any luck. ```js const myDropdownMenu = document.getElementById("dropdownMenu"); const openNav = document.getElementById("openNav"); const closeNav = document.getElementById("closeNav"); let mobileMenu = false; function toggleMenu() { mobileMenu = !mobileMenu; } ...
2022/05/04
[ "https://Stackoverflow.com/questions/72107707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19029622/" ]
I have a similar issue and this is how I solved it `icon: Image.assets('images/avatar1.png')`
Maybe it's because the size of the image
72,107,707
I'm trying to update a boolean value onclick without any luck. ```js const myDropdownMenu = document.getElementById("dropdownMenu"); const openNav = document.getElementById("openNav"); const closeNav = document.getElementById("closeNav"); let mobileMenu = false; function toggleMenu() { mobileMenu = !mobileMenu; } ...
2022/05/04
[ "https://Stackoverflow.com/questions/72107707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/19029622/" ]
Are you sure that you add `avatar1.png` in `assets/images` folder and also add below line in `pubspec.yaml` ``` flutter: assets: - assets/images/ ```
I have a similar issue and this is how I solved it `icon: Image.assets('images/avatar1.png')`