qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
314,983
I know it makes little difference to a project but, assuming you use #defined header guards for your C++ code, what format do you use? e.g. assuming a header called `foo.hpp`: ``` #ifndef __FOO_HPP__ ... #ifndef INCLUDED_FOO_HPP ... #ifndef SOME_OTHER_FORMAT ``` I'm sold on the idea of upper-case #defines but cann...
2008/11/24
[ "https://Stackoverflow.com/questions/314983", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236/" ]
I use ``` #if !defined(FOO_HPP_INCLUDED) ``` I prefer the modern `defined` syntax because it allows || && operators, even if they aren't used here. Also ``` #ifndef __FOO_HPP__ ``` is technically illegal, as leading underscores are reserved.
I'd go with the filepath + the boost `_INCLUDED` suffix plus the nowadays widely supported `#pragma once` In alot editors (for me its sublime) you can also define some macros/snippets for this. Here is one that does it for you: ``` <snippet> <content><![CDATA[ #ifndef ${1:${TM_FILEPATH/(.*\/(include|src))*([^a-z...
10,811,439
I have the following struct: ``` typedef struct _chess { int **array; int size; struct _chess *parent; } chess; ``` and I have: ``` typedef struct _chess *Chess; ``` Now, I want to create an array of dynamic length to store pointers to the chess struct so I do the following: ``` Chess array [] = malloc(...
2012/05/30
[ "https://Stackoverflow.com/questions/10811439", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1249740/" ]
There's a lot of `typedef` going on here. Personally I'm against "hiding the asterisk", i.e. `typedef`:ing pointer types into something that doesn't look like a pointer. In C, pointers are quite important and really affect the code, there's a lot of difference between `foo` and `foo *`. Many of the answers are also co...
IMHO, this looks better: ``` Chess *array = malloc(size * sizeof(Chess)); // array of pointers of size `size` for ( int i =0; i < SOME_VALUE; ++i ) { array[i] = (Chess) malloc(sizeof(Chess)); } ```
7,227,163
I found that last word showed with double quotes. But why? ``` NSDictionary *guide2 = [NSDictionary dictionaryWithObjectsAndKeys:kArr, @"Kate", aArr, @"Ana-Lucia", kArr, @"John", nil]; NSArray *array = [guide2 allKeys]; NSLog(@"%@", [array description]); ``` output: ``` ( John, Kate, "Ana-Lucia" ) ```
2011/08/29
[ "https://Stackoverflow.com/questions/7227163", "https://Stackoverflow.com", "https://Stackoverflow.com/users/499825/" ]
You could use `python-gstreamer` for playing videos (this works for me on Linux, but it should also work on Windows). This requires [`python-gstreamer`](http://gstreamer.freedesktop.org/modules/gst-python.html) and [`python-gobject`](http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/2.24/), I would recommend you to u...
Make use of `tkvideoplayer` version>=2.0.0 library, which can help you to play, pause, seek, get metadata of the video etc. ``` pip install tkvideoplayer ``` Sample example: ```py import tkinter as tk from tkVideoPlayer import TkinterVideo root = tk.Tk() videoplayer = TkinterVideo(master=root, scaled=True) videop...
8,340,658
jQuery : ``` *cacheBoolean Default: true, false for dataType 'script' and 'jsonp' If set to false, it will force requested pages not to be cached by the browser. Setting cache to false also appends a query string parameter, "_=[TIMESTAMP]", to the URL.* ``` my question : *cached by the browser* **???** if i hav...
2011/12/01
[ "https://Stackoverflow.com/questions/8340658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/859154/" ]
jQuery itself does not perform any caching of the AJAX response. Setting `cache: false` serves only to trick the browser into ignoring its own cache by adding a timestamp to the requested URL. For example, running: ``` $.ajax('/ajax_handler.php', { cache: false }); ``` Will result in a request for `/ajax_handler.ph...
i think that "cached by the browser" means that if the browser (IE more than others...) intercept the same call twice, never calls the server and just returns whatever the server returned the last time. But if you clear the cache it goes away
45,626
Though originally posted as a comment [here](https://money.stackexchange.com/questions/28658/bond-prices-why-is-a-high-yield-sometimes-too-good-to-be-true#comment42640_28688), I don't see an answer. So please allow me to resurrect and broaden this question, to all investment-grade bonds: in other words, '[BBB- or highe...
2015/03/16
[ "https://money.stackexchange.com/questions/45626", "https://money.stackexchange.com", "https://money.stackexchange.com/users/-1/" ]
With bonds, it's more about yield to maturity (YTM) than about supply and demand. Or better said, YTM is what is demanded, not so much the credit rating of the issuer. YTM is a function of the price paid for the bond and the interest paid over the life of the bond. The interest is fixed (or at least pre-determined), so...
> > Why should the prices of these [highly rated bonds from pension funds, > mutual funds, etc. because of their investment mandates] bonds drop? > Isn't there always a demand for ... [investment-grade] bonds with more > than 10% coupon? > > > Beware of 2 assumptions in the questions: 1. Companies can have rat...
29,063
Most Atheists I have encountered fall into 2 categories: 1. New Atheists: People who don't believe in God and see religion as an evil to be eradicated given the harm it has caused humanity (i.e. followers of Richard Dawkins, Sam Harris, etc...). 2. "Don't care" atheists: People who don't believe and really don't care...
2015/10/26
[ "https://philosophy.stackexchange.com/questions/29063", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/13808/" ]
What you describe as broadly "atheist" is usually called religiously unaffiliated, and described as having or seeking no particular religion. This is much broader than atheism, which asserts denial of god(s), and covers agnostics, atheists, deists, humanists, etc. The views range from sympathetic to religion, but to no...
Believing in a religion will likely change your behaviour, completely unrelated to the question whether your religion is based on a correct or incorrect belief. That change may be positive or negative. Anybody, including an atheist, will appreciate if your behaviour changes in a positive way due to your religion. But i...
8,618,168
Is there an "IN" type function like the one used in sql that can be used in excel? For example, if i am writing an If statement in excel and I want it to check the contents of a cell for 5 different words can i write something like: ``` =If(A1=IN("word1","word2","word3","word4","word5"),"YES","NO") ```
2011/12/23
[ "https://Stackoverflow.com/questions/8618168", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1060293/" ]
You could use MATCH : ``` =MATCH(A1, {"word1","word2","word3","word4","word5"}, 0) ``` which will return the index of the matching item in the array list. The trailing 0 means it should be an exact match. It will return #N/A if it isn't there, so you can tag a `IF(ISNA(` onto the front to make it behave like your "...
I think an improvement on ``` =IF(OR(A1={"word1","word2","word3","word4","word5"}),"YES","NO") ``` would be to use ``` =IF(OR(A1={"word1","word2","word3","word4","word5"}),A1,"NO"); ``` which is more like the SQL's `IN` clause.
49,914,325
If I have a class that implements `Serializable` such as: ``` public class Foo implements Serializable { public String a; public String b; } ``` Is using `ObjectOutputStream` to serialize of the object deterministic?
2018/04/19
[ "https://Stackoverflow.com/questions/49914325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2317084/" ]
Using `apply` from base R, ``` apply(m2, 2, function(i) apply(m1, 1, function(j) min(j*i))) ``` which gives, > > > ``` > [,1] [,2] [,3] [,4] [,5] > [1,] 3 6 5 4 3 > [2,] 4 8 10 8 6 > [3,] 5 10 15 12 8 > [4,] 0 0 0 0 0 > [5,] 7 14 21 18 12 > ...
We use `expand.grid` to create all possible combinations of row and col pairs. We then use `mapply` to multiply all the row-column combination element wise and then select the `min` from it. ``` mat <- expand.grid(1:nrow(A),1:nrow(B)) mapply(function(x, y) min(matrix_A[x,] * matrix_B[, y]) , mat[,1], mat[,2]) #[1] 3...
17,386,453
This question have probably been asked here before but i dont know what it and how to properly name it. Heres my objective: Im trying to make multiple designs for separate pages. Example I have a homepage design but i also have a separate design for my login page and member are page. I usually use a header.pp and foot...
2013/06/30
[ "https://Stackoverflow.com/questions/17386453", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2535596/" ]
Surely just don't use your header and footer temps and make new ones instead, or make a new style sheet for any pages requiring a different design.
You are looking for **templates**. PHP is after all a webpage-template-language so it can be done very easy. I wrote a simple tutorial a while ago on how to do this on your own. <http://gustavsvalander.com/how-to-create-your-own-template-engine-using-php-files/> The function ------------ ``` <?php // Load a php-fil...
6,904,139
I'm using this tutorial to Fake my DbContext and test: <http://refactorthis.wordpress.com/2011/05/31/mock-faking-dbcontext-in-entity-framework-4-1-with-a-generic-repository/> But i have to change the FakeMainModuleContext implementation to use in my Controllers: ``` public class FakeQuestiona2011Context : IQuestiona2...
2011/08/01
[ "https://Stackoverflow.com/questions/6904139", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492460/" ]
Unfortunately you are not doing it right because that article is wrong. It pretends that `FakeContext` will make your code unit testable but it will not. Once you expose `IDbSet` or `IQueryable` to your controller and you fake the set with in memory collection you can never be sure that your unit test really tests your...
As Ladislav Mrnka mentioned, you should test Linq-to-Entity but not Linq-to-Object. I normally used Sql CE as testing DB and always recreate the database before each test. This may make test a little bit slow but so far I'm OK with the performance for my 100+ unit tests. First, change the connection string setting wit...
42,274,398
i am using `FCM` for push messages and handling all incoming push notification in onMessageReceived. Now the issue is with parsing nested json that comes inside this function `remoteMessage.getData()` I have following block coming as a push notification in device. content of data payload could be varied here it is dea...
2017/02/16
[ "https://Stackoverflow.com/questions/42274398", "https://Stackoverflow.com", "https://Stackoverflow.com/users/405383/" ]
try this code: ``` public void onMessageReceived(RemoteMessage remoteMessage) { Log.e("DATA",remoteMessage.getData().toString()); try { Map<String, String> params = remoteMessage.getData(); JSONObject object = new JSONObject(params); Log.e("JSON OBJECT", ...
Faced this issue when migrating from GCM to FCM. The following is working for my use case (and OP payload), so perhaps it will work for others. ``` JsonObject jsonObject = new JsonObject(); // com.google.gson.JsonObject JsonParser jsonParser = new JsonParser(); // com.google.gson.JsonParser Map<String, String> map = ...
15,731,115
I made a Java program that generate ASCII characters. Here the following code if you want to try: ``` import java.awt.*; import java.awt.event.*; import javax.swing.*; public class asciiTable implements ActionListener { private static JButton exebouton; private JTextArea ecran = new JTextArea(); private ...
2013/03/31
[ "https://Stackoverflow.com/questions/15731115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2117589/" ]
Swing is single threaded. You are performing a resource intensive action in the `EDT` preventing UI updates. Use one of Swing's [concurrency mechanisms](http://docs.oracle.com/javase/tutorial/uiswing/concurrency/) to handle this functionality such as a [SwingWorker](http://docs.oracle.com/javase/tutorial/uiswing/concur...
Consider to use a worker thread. After the thread finishes its work you can update the UI synchronously or asynchronously with the SwingUtilities.invokeAndWait() or SwingUtilities.invokeLater() method. The passed Runnable is executed in the UI thread, which enables you to update the UI in that thread.
6,916,989
In the Symfony2 documentation it gives the simple example of: ``` $client->request('POST', '/submit', array('name' => 'Fabien'), array('photo' => '/path/to/photo')); ``` To simulate a file upload. However in all my tests I am getting nothing in the $request object in the app and nothing in the `$_FILES` array. He...
2011/08/02
[ "https://Stackoverflow.com/questions/6916989", "https://Stackoverflow.com", "https://Stackoverflow.com/users/210409/" ]
This was an error in the documentation. Fixed [here](https://github.com/symfony/symfony-docs/commit/e6027eb): ``` use Symfony\Component\HttpFoundation\File\UploadedFile; $photo = new UploadedFile('/path/to/photo.jpg', 'photo.jpg', 'image/jpeg', 123); // or $photo = array('tmp_name' => '/path/to/photo.jpg', 'name' =>...
Here is a code which works with Symfony 2.3 (I didn't tried with another version): I created an `photo.jpg` image file and put it in `Acme\Bundle\Tests\uploads`. Here is an excerpt from `Acme\Bundle\Tests\Controller\AcmeTest.php`: ``` function testUpload() { // Open the page ... // Select the file from ...
556,388
I have been archiving mailboxes on our Exchange 2010 server and subsequently deleting large numbers of messages from nearly all mailboxes by setting retention periods on them. I would like to know how much of the database is now just whitespace so that I can gauge how much space will be freed up by defragging it using ...
2013/11/20
[ "https://serverfault.com/questions/556388", "https://serverfault.com", "https://serverfault.com/users/184167/" ]
The main difference is the route for 0.0.0.0/0 in the associated route table. A private subnet sets that route to a NAT gateway/instance. Private subnet instances only need a private ip and internet traffic is routed through the NAT in the public subnet. You could also have no route to 0.0.0.0/0 to make it a truly **p...
The distinction between "public" and "private" subnets in AWS VPC is determined only by whether the subnet has an Internet Gateway (IGW) attached to it. From [the AWS docs](https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html): > > If a subnet is associated with a route table that has a route to...
382,110
I added this script to my startup programs to change my touchpad settings on startup: ``` synclient TapButton2=2 TapButton3=3 ``` But this settings don't stay this way after startup. I changed my script to watch the results: ``` synclient TapButton2=2 TapButton3=3 synclient | grep TapButton > $HOME/tmp/touchpad.tx...
2013/11/25
[ "https://askubuntu.com/questions/382110", "https://askubuntu.com", "https://askubuntu.com/users/99330/" ]
I've got a simple solution... Just press the windows key and type 'startup'. You will see 'Startup applications' * click this and then click [ADD] * give it a name (like mousetap2) * enter the command in the box... i.e. ``` synclient TapButton2=2 TapButton3=3 ``` and that's it... It will run on startup and confi...
The best method that have worked for me is to add your changes into Xsession.d, so it will load automatically for all users when you log into X: (the file doesn't exists, so you can name it whatever you want. The numbers on the left means the order in which it will be executed in comparison with the other files.) ```...
57,747,206
I have json like this: ``` [ { "product_variants": [ { "id": 1669, "attributes": [ { "name": "size", "value": "XXS" }, { "name": "color", ...
2019/09/01
[ "https://Stackoverflow.com/questions/57747206", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3316855/" ]
You can create a dictionary and map all sizes with a value that will be used as the sorting key: ``` SORT_ORDER = {"S" : 0, "M" : 1, "L" : 2, "XL" : 3, "2XL" : 4, "3XL" : 5, "4XL" : 6, "5XL" : 7, "6XL" : 8} ``` Then you can perform sorting, based on the keys of those values: ``` productVariants = [{"product_variant...
you can use: ``` from pprint import pprint my_list = [ { "product_variants": [ { "id": 1669, "attributes": [ { "name": "size", "value": "XXS" }, { ...
62,164,311
I have my `User` struct declared like this. How can we decode an array using `JSONdecoder`? I get an error of **`typeMismatch(Swift.Dictionary<Swift.String, Any>, Swift.DecodingError.Context(codingPath: [], debugDescription: "Expected to decode Dictionary<String, Any> but found an array instead.", underlyingError: ni...
2020/06/03
[ "https://Stackoverflow.com/questions/62164311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13556327/" ]
The safe solution when using `fgets` would be something like this: ``` if (fgets(pass, sizeof(pass), stdin) != NULL){ int len = strlen(pass); if (len > 0 && pass[len-1] != '\n'){ int ch; while ((ch=getchar()) != '\n' && ch != EOF); } } ``` Or this: ``` if (fgets(pass, sizeof(pass), stdin...
You limited your input variable to 32 characters, so in order to stop it from doing that, simply make pass[32] bigger.
3,825,498
I just got a new desktop computer with Windows 7 Pro as the operating system. I installed Visual Studio 2008 on to this new computer and tried to open a previously existing ASP.NET 3.5 solution that displayed perfectly fine on my previous computer (this previous computer used the Windows XP operating system, IIS6, and ...
2010/09/29
[ "https://Stackoverflow.com/questions/3825498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/187453/" ]
Two things to check: 1. When using "~" in a file path, make sure that the current application deployment believes the root directory is the same as it was before. (I've run into this sometimes moving an app from the VS Development Server and IIS.) 2. Make sure that the user account that the server is running under has...
Instead of the "~" I was able to simply change the directory to a relative ".." So, what I originally had that gave me the problem was something like: "~/MasterPage/TheMainMasterPage.master" and this caused me to get the same error message. Changing it to "../MasterPage/TheMainMasterPage.master" fixed everything for me...
28,500,851
Here's my array (from Chrome console): ![array in Chrome console](https://i.stack.imgur.com/RjCE6.png) Here's the pertinent part of code: ``` console.log(hours); var data = JSON.stringify(hours); console.log(data); ``` In Chrome's console I get `[]` from the last line. I should get `{'Mon':{...}...}` Here is the ...
2015/02/13
[ "https://Stackoverflow.com/questions/28500851", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4536489/" ]
Here is the minimal amount of javascript to reproduce the issue ``` var test = []; test["11h30"] = "15h00" test["18h30"] = "21h30" console.log(test); console.log(JSON.stringify(test)); // outputs [] ``` The issue with the above is that, while javascript will be happy to let you late-bind new properties onto `Arr...
**Like all JavaScript objects, Arrays can have *properties* with string-based keys like the ones you're using. But only integer keys (or keys that can be cleanly converted to integers) are actually treated as *elements* of an Array**. This is why JSON isn't catching your properties, and it's also why your Arrays are al...
45,695
I've bought a bag of small dried and salted fish at my local Chinese market. My guess was that the thingies could be eaten right out of the box, but they are too bony and salty. I guess they need some kind of desalting and perhaps frying, but not sure what to try. From the back of the bag drawings and text (thanks ...
2014/07/18
[ "https://cooking.stackexchange.com/questions/45695", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/2882/" ]
Next time get the really really small ones. Those are best raw. The bigger ones usually are fried first before eating. Then the bones get crunchy and the saltiness is not as prominent. Others are used for stocks or garnishes, as said before.
Based on my russian experience, this is ready to go snack. Just bite it and drink beer. I know, my american friends usually scared to try "uncooked" fish, but salty dried fish is good. Also I would recommend you to try salty dried calamari or octopuses. Cheers!
119,850
:-) We would like to ask a question of general interest, as it might be the case in other studies. It is the first time I stumble upon this situation. In our research, we have used the wild-type of a microbial strain and mutants for about 7 distinct genes. They were all subjected to different treatments and assessed b...
2018/11/10
[ "https://academia.stackexchange.com/questions/119850", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/100535/" ]
It is really hard to judge a case like this. It could be anything from a wonderful academic training situation to extreme abuse. It would depend on a lot of things not stated here. What is the agreement between X and the professor, now and for the future? What does the professor actually do with the time freed by X? Is...
That sounds like a very unhealthy relationship. Some of the answers on this stack exchange, surprise me. The professor is not always right. It's not alright for the professor to sit back not do his/her job description and force all the work on their student. This doesn't sound right. Even if the student is a TA they ar...
64,738,707
Is there a way I can replace the 2nd character in a cell with an asterisk(`*`)? Something like this: ``` var name = publicWinners.getRange(i, 1); name.setValue( → 2nd character = "*" ← ); ``` I want to create a list of winners in a contest that can be posted publicly with the winners' personal information part...
2020/11/08
[ "https://Stackoverflow.com/questions/64738707", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14600385/" ]
Use [String.replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace) : ```js /*<ignore>*/console.config({maximize:true,timeStamps:false,autoScroll:false});/*</ignore>*/ const str = "John Doe"; const output = str.replace(/(.{1})./,"$1*"); console.info(output); ``` ```ht...
You can use the [`split()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split) and [`join()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join) methods to manipulate the string. ``` /** * Replace a character of a string with a new ...
28,059,865
I wonder why CSS' height can't resize a 'select' element in HTML. ``` <select> <option>One</option> <option>Two</option> </select> ``` and CSS: ``` select { height: 40px; } ``` Thanks in advance!
2015/01/21
[ "https://Stackoverflow.com/questions/28059865", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4460255/" ]
You should use line-height along with. Below fiddle shows you the same. <http://jsfiddle.net/pckh7spw/> ``` select { height: 40px; line-height: 40px; border: 1px solid #ccc; width: 200px; } ```
if any css overriding this class then use following class ``` select { height: 40px !important; line-height: 40px; border: 1px solid #ccc; width: 200px; } ```
43,191,342
I'm trying to set the index of a dataframe from one of the columns in my dataframe. The old index of this dataframe is essentially meaningless. [![enter image description here](https://i.stack.imgur.com/RAh5M.png)](https://i.stack.imgur.com/RAh5M.png) But when I use `set_index(['Name'])` I add a new column, which is...
2017/04/03
[ "https://Stackoverflow.com/questions/43191342", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2584721/" ]
You are not sending the csrf token in your API call, so thats the culprit. This should work for you. ``` $.ajax({ url: '/upload_ticket/', type : "POST", // http method dataType: 'json', data : { 'file' : $('#fileinput').val(), 'csrfmiddlewaretoken' : document.getElementsByName('csrfmiddlewaretoken')[...
``` function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie !== '') { var cookies = document.cookie.split(';'); for (var i = 0; i < cookies.length; i++) { var cookie = jQuery.trim(cookies[i]); // Does this cookie string begin with the na...
37,015,563
I have a class with two members - m1 is a string and m2 is a dictionary. I want to reset m2 by calling myA.m2.reset() equivalently to self.m2.clear(); and reset m1 by calling myA.m1.reset() equivalently to self.m1 = None. So how can I implement this reset method in class A? ``` class A(object): def __init__(sel...
2016/05/03
[ "https://Stackoverflow.com/questions/37015563", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5693581/" ]
EDIT: OP I'm very sorry - my suggestion to use descriptors seemed like a good idea, but it isn't going to be enable you to write code like `myA.m2.reset()` in a robust way. I'll keep this answer here for reference in case it gives you any ideas. --- This is a job for python [descriptors](https://docs.python.org/3/...
m1 and m2 are members of the class not instances of it.The members of the class cant call on functions of their containing class, the members can only call functions inside their instance. In sinpler context m1 shouldnt be calling myA.reset() .I'm pretty sure you can just call myA.m1.clear(). If you want reset to do it...
15,118,830
I started ZendSkeletonApplication via Composer. I will need for my project PRIVATE repository (Git). How to do it? Skeleton have now .git files so how I can work with my project for example on BitBucket? Regards
2013/02/27
[ "https://Stackoverflow.com/questions/15118830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/999468/" ]
The best way to create a ZF2 skeleton project from scratch is to use ZFTool (<http://framework.zend.com/manual/2.1/en/modules/zendtool.introduction.html>). Install it to /usr/local/bin (with executable permissions) and then you can do this: ``` $ zftool.phar create project project_name ``` This will give you a skele...
Once you forked the [ZendSkeletonApplication](https://github.com/zendframework/ZendSkeletonApplication), you can push the fork to a private repository in your Bitbucket account or on your own servers/network. You can deploy your own packages/modules on Bitbucket and even [require them via composer](http://getcomposer....
489,667
What is the etymology for the phrase, “God save the king?” All that I find is a trail back to the song. Yet it seems to me that there must be an origin that goes back into the language.
2019/03/14
[ "https://english.stackexchange.com/questions/489667", "https://english.stackexchange.com", "https://english.stackexchange.com/users/340149/" ]
It isn't incorrect (except that 'I' should always be in upper case). As a sentence on its own, it's probably better with 'saw', but you could say something like "While I was travelling I had seen some beautiful buildings, but the new art gallery in my home town was as fine as any of them".
This is NOT grammatical. The correct wording should be > > While I was travelling, I saw beautiful buildings. > > > This is because the use of "while" implies doing something at the same time in both clauses of the sentence. "Had been" implies that the buildings were seen before they were travelling. Please re...
15,552,590
I'm using a form that use the following script to calculate the item price including VAT: ``` function calculateTotaleIVA() { var tot = document.getElementById('totale').value; document.getElementById('totale_prodotto').value = Math.round(tot*121)/100; totale_prodotto.value = document.get...
2013/03/21
[ "https://Stackoverflow.com/questions/15552590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2195922/" ]
Use [toFixed](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Number/toFixed) ``` (Math.round(tot*121)/100).toFixed(2) ```
you can use `toFixed(2)` for that toFixed(No of digits) ``` (Math.round(tot*121)/100).toFixed(2); ``` [see here](http://www.w3schools.com/jsref/jsref_tofixed.asp)
13,137,030
I have this date format d-m-y on a string so that 01-01-12 is January, 1st of the year 2012. Now, I want to convert this to a date object in php, to sort a set of dates, which are stored as string in an array. Currently, I'm using strtotime and date ``` $keypoints[] = date('d-m-y', strtotime($date_str)); ``` But t...
2012/10/30
[ "https://Stackoverflow.com/questions/13137030", "https://Stackoverflow.com", "https://Stackoverflow.com/users/194794/" ]
PHP's strtotime() returns a unix timestamp, which is just a number. Have you considered storing these in your array and sorting like that? You would then convert back to a nice looking date when needed, for example for output.
From the PHP manual page, `strtotime` accepts "A date/time string. Valid formats are explained in [Date and Time Formats](http://www.php.net/manual/en/datetime.formats.php)". An alternative would be to use [`DateTime::createFromFormat`](http://php.net/manual/en/datetime.createfromformat.php).
11,949,670
I've made an upload mechanism and now I want to create a page that lets you view the files you uploaded. I want to show them in the browser however (I only have browser-supported files like images, PDF etc). My guess is that I can do this by only setting some headers and printing the bytes of the file. But as far as I...
2012/08/14
[ "https://Stackoverflow.com/questions/11949670", "https://Stackoverflow.com", "https://Stackoverflow.com/users/898423/" ]
Yes its MIME type. Find a list at <http://en.wikipedia.org/wiki/MIME_type>
You will have to read the contents of the file, print the appropriate headers and echo the contents. If the browser detects that it can display these file types it will display them else it will prompt the user to the save to the local system. The code will be something similar to the snippet specified below: ``` head...
70,586
In my party I have a warlock who is partial to illusion magic. At second level, he took the 'Misty Visions' invocation, with the intent of using Silent Image to keep the party shrouded in illusory fog during combat. His logic is that because the party knows it is an illusion, they are never hindered by it, but the enem...
2015/11/01
[ "https://rpg.stackexchange.com/questions/70586", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/8198/" ]
Cost ---- This is **not** without cost to the warlock; he has chosen to use one of his two invocations to get this thereby forgoing other choices. In addition, he uses an action to cast it and an action to move it; unless your battles are very static he would need to move it a lot. Remember, the most limited resource ...
The PhB 254 states: > > Physical interaction with the image reveals it to be an illusion, because things can pass through it. A creature that uses its action to examine the image can determine that it is an illusion with a successful Intelligence (Investigation) check against yo r spell save DC. If a > creature disc...
12,520
Can we call the [greatest integer function](http://mathworld.wolfram.com/FloorFunction.html) as a periodic function with no fundamental period or is it just non-periodic. Please explain your answer. --- To my understanding, if we consider $f(x) = [x]$ now, $f(3) = [3] = 3$ and $f(3+0.5) = [3.5] = 3$ So, can't we say...
2010/11/30
[ "https://math.stackexchange.com/questions/12520", "https://math.stackexchange.com", "https://math.stackexchange.com/users/2109/" ]
A function $f(x)$ is "periodic with period $c$", with $c\gt 0$, if $f(x+c) = f(x)$ for all values of $x$. In particular, $f(x+mc) = f(x)$ for all integers $m$, by using induction. A function is periodic if it is periodic with period $c$ for some $c\neq 0$. Every periodic function has lots of periods: if $c$ is a peri...
The answers so far do not catch the fact that the floor function has indeed some built in periodicity: The function $f(x):=\lfloor x\rfloor - x$ is in fact periodic and so can be developped into a Fourier series. "For all practical purposes" one has $$\lfloor x\rfloor =x-{1\over2} +{1\over\pi}\sum\_{k=1}^\infty{\sin(2\...
62,545
I’ve been studying Japanese for a while now and came across the following dialogue: > > A: 私のこと、知ってるんだ。(So you know about me then?) > > B: 知ってるも何も、有名人じゃないか。 > > > I'm not quite sure how to make sense of B's reply. I thought it would translate to something along the lines of "I don't really know anything but y...
2018/11/01
[ "https://japanese.stackexchange.com/questions/62545", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/31778/" ]
Look [here](https://hinative.com/ja/questions/29845) for example: > > > > > > 「~も何も」は1つの例を出して、他のものを類推させるときに使います。 > > > > > > 例 挨拶も何も > > > > > > > > > A: 「帰る前にあの人にあいさつしなきゃ」 > > > B: 「挨拶も何も、あの人もう帰っちゃったよ!」 > > > ⇒挨拶も、会うことも、話をすることもできない > > > > > > > 病気になってしまい、勉強も何もない。 > > > > > > > > > ⇒勉強も、遊びも、...
知ってるも何も carries the idea of "it's not even a question of knowing X" or "I know all about X!" In English, this might be one situation where we use the phrase "Of course": "Of course I know X." a quick search found this Q&A on a language blog <http://lang-8.com/1486973/journals/96618803197205736526647859648046157520...
95,402
I am confused in choosing one of the following approaches. ``` \documentclass{article} \usepackage{siunitx} %\sisetup{detect-all} \usepackage{amsmath} \parindent=0pt\relax \begin{document} The following calculation is a trivial example \[ \begin{aligned} q &=CV \\ &=\num{3e...
2013/01/26
[ "https://tex.stackexchange.com/questions/95402", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/19356/" ]
As you've noticed, the `aligned` environment is meant to be part of a larger displayed math environment (which is why you put it in between `\[` and `\]`), while the `align*` environment is a freestanding displayed math environment. For the use you made of them in your example, they're essentially equivalent. The `alig...
it makes no sense to compare `aligned` and `align*`. The first one is used if you want *one* equation number for several lines. This is the reason why `aligned` is used as part of `align` or a similar environment.
56,245,169
I was asked to separate access to a particular Jira project by component. e.g. user "a" can see issues created for component "a", but not component "b". conversely, user "b" can see issues created for component "b", but not component "a". I know that I can limit access to a particular project to one or more users, but...
2019/05/21
[ "https://Stackoverflow.com/questions/56245169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4760868/" ]
``` DateTime? dateTimeFromTimeStamp(dynamic data) { Timestamp? timestamp; if (data is Timestamp) { timestamp = data; } else if (data is Map) { timestamp = Timestamp(data['_seconds'], data['_nanoseconds']); } return timestamp?.toDate(); } Map<String, dynamic>? dateTimeToTimeStamp(DateTime? dateTime) ...
I have solved my problem by sending my timestamp as a String. ```dart "timestamp": DateTime.now().toString() ``` Since now my timestamp is in string now so I get the exact timestamp from JSON as a String. Now what I did was used a flutter plugin called `timeago` to convert it to time ago format for example: "10 m...
44,033,111
So I have an timer and multiple fragments. If the timer is running, there is no problem when switching between fragments. But when the timer finishes `onFinish()` and If the user is in another fragment at that time, the app crashes. Here are some of the log: 1) `E/RingtoneManager: Failed to open ringtone content://se...
2017/05/17
[ "https://Stackoverflow.com/questions/44033111", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6073708/" ]
I got the same error because I had misspelled 'firebase' as 'firebas' *firebas: { apiKey: "...", authDomain: "project.firebaseapp.com", databaseURL: "<https://project.firebaseio.com>", projectId: "project", storageBucket: "project.appspot.com", messagingSenderId: "..." }*
Make sure there is no gap between `firebase` and `:`. That is, it should be `firebase:`, not `firebase :`.
52,182,533
I am using the built in complex number class `std::complex` from the Standard C++ Library header. I applied a code in a HLS tools. The tool can not access a private member variable of that complex class. Is it possible to make it public or what can i do? ``` Error: /usrf01/prog/mentor/2015-16/RHELx86/QUESTA-SV-AFV_10...
2018/09/05
[ "https://Stackoverflow.com/questions/52182533", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9475755/" ]
You have to mock `matchRepositoryImpl.getFootballMatch("4328")` method like this: ``` Mockito.`when`(matchRepositoryImpl.getFootballMatch("4328")) .thenReturn(Observable.just(OBJECT_YOU_WANT_TO_BE_RETURNED)) ``` You can put this mock in `@Before` block, or in particular test.
I don't know if this can help you. But i let you some of my code when i have a Presenter and PresenterTest. **Presenter:** ``` ... private void loadRepos() { disposableManager.add(repoRepository.getTrendingRepos() .doOnSubscribe(__ -> viewModel.loadingUpdated().accept(true)) ...
22,095,667
Can I use LineID attribute for this? I hope I could use sink::set\_formatter to do this instead of using ``` __LINE__ ``` and ``` __FILE__ ``` in each log statement.
2014/02/28
[ "https://Stackoverflow.com/questions/22095667", "https://Stackoverflow.com", "https://Stackoverflow.com/users/531116/" ]
The solution shown by [Chris](https://stackoverflow.com/a/22770455/1224177) works, but if you want to customize the format or choose which information appears in each sink, you need to use mutable constant attributes: ```cpp logging::core::get()->add_global_attribute("File", attrs::mutable_constant<std::string>("")...
Another possibility is to add line and file attributes to each log record after they are created. This is possible since in newer releases. Attributes added later do not participate in filtering. Assuming severity\_logger identified with variable logger: ``` boost::log::record rec = logger.open_record(boost::log::ke...
277,202
Someone told me that he was using `componentDidMount` and `componentDidUpdate` in his `BaseWebPart` class, but looking at the documentation below I realized it shouldn't be possible since it's not a React Component. [BaseWebPart class](https://docs.microsoft.com/en-us/javascript/api/sp-webpart-base/basewebpart?view=sp...
2020/03/04
[ "https://sharepoint.stackexchange.com/questions/277202", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/89079/" ]
Below function can be used to get the query string parameters from URL: ``` function getUrlVars() { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) { vars[key] = value; }); return vars; } ``` You can use it like: ``` var mytext = getUr...
Per [this community post](https://stackoverflow.com/posts/901144), you can use [URLSearchParams](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams#Browser_compatibility) which is simple and has [decent (but not complete) browser support](https://caniuse.com/#feat=urlsearchparams). Assuming the value wa...
54,826,925
I have 3 layer callbacks like this : ```js app.post('/', (req, res) => { var filename = `outputs/${Date.now()}_output.json`; let trainInput = req.files.trainInput; let trainOutput = req.files.trainInput; let testInput = req.files.trainInput; //first trainInput.mv(`i...
2019/02/22
[ "https://Stackoverflow.com/questions/54826925", "https://Stackoverflow.com", "https://Stackoverflow.com/users/553779/" ]
You can use the following code to make you code look better and avoid callback hell ``` app.post('/', async (req, res) => { var filename = `outputs/${Date.now()}_output.json`; let trainInput = req.files.trainInput; let trainOutput = req.files.trainInput; let testInput = req.files.trainInput; try { ...
You can make the functions return a Promise I advice to make one function because you do the same thing 3 times. In this case I called the function 'save' but you can call it what ever you want. The first parameter is the file end the second the output filename. ```js function save(file, output) = return new Promise(...
73,976,821
I'm a beginner programmer in python and my lecturer wants us to make a program from scratch specifically w hard code. It was running well previously, but when I tried testing the program earlier, this part of the program started to run an error. It said it cannot run code on a closed file. Can anyone help point out wh...
2022/10/06
[ "https://Stackoverflow.com/questions/73976821", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20068676/" ]
So it seems like it is a problem with the newest `firebase-tools` version. After downgrading from `11.14.0` to `11.13.0` locally, it worked again (which I recognized thanks to [this comment](https://stackoverflow.com/a/73968883/9150652)). So to make it run in CI, I just installed `firebase-tools@11.13.0` as a dev-depe...
Per the error, your script is calling two GitHub Actions and one of these is calling `GET https://cloudfunctions.googleapis.com/v1/projects/{project}/locations/-/functions` to list the Functions in the Project. This method requires the (`cloudfunctions`) service to be enabled. * Either enable the service in the projec...
268,657
I've been searching around the internet to find out how to derive the reactance formula for capacitors and inductors. But I couldn't really find anything, so I thought why not make a post about it. I gave it a try myself though, but I could not get rid of the \$sin(\omega t)\$ in the numerator and the \$cos(\omega t)...
2016/11/10
[ "https://electronics.stackexchange.com/questions/268657", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/118358/" ]
The phasor approach is the easiest imo. You simply let V and I become a phasor. Then you replace all of the differential operators by algebraic expressions. Ive done the capacitor for you .![enter image description here](https://i.stack.imgur.com/q0Qzu.jpg) Note: in this form do not forget that both I and V are now ph...
Capacitor: I=C \* dv/dt d/dt=jw=s (shortcut Laplace transform) I=C \* sV C=I/sV 1/sC=V/I=Xc Inductor: V=L \* di/dt V=L \* sI L=V/sI sL=V/I=Xl
26,443,394
Good afternoon. Please tell me this question: What is the difference of different levels Drill Map in Microstrategy? (UP, DOWN, ACROSS) Particularly interested in ACROSS. What is it used? The manual says that this is the same as UP ... But then I do not believe it. Thanks in advance for an explanation.
2014/10/18
[ "https://Stackoverflow.com/questions/26443394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3932441/" ]
Optimistic locking means you want multiple threads to be able to edit the same user record. What's happening in your app is that two (or more) edits are happening to the same user record, and your app is correctly detecting that, and raising the suitable error. What you would typically do is handle the error: * For...
I created a very simple module to handle this when is possible to reload to fix the problem. Please note that this is a race condition and you are responsible of what you are saving to the db. ``` module StaleObjHandler def retry @staled_retries ||= 5 yield rescue ActiveRecord::StaleObjectError => e if...
212,695
The armoured trains need to be made viable without just removing other aspects of warfare. Tactical pure fusion nukes with a yield of under 75kt are common. The environment of the planet is earth like. There are a few areas that are just barren flat rock & a few very dense megalopolises. Rail infrastructure is plentifu...
2021/09/05
[ "https://worldbuilding.stackexchange.com/questions/212695", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/73451/" ]
Make the war over what's on the trains ====================================== They're fighting not for land or ideologies, but for things they can only easily move by rail. Perhaps they're carrying stocks of nuclear fuel or portable reactors, with all the heavy shielding that entails. Perhaps they're moving the nukes...
Justifying Warfare on the Ground ================================ It seems your setting is capable of fusion power, judging by your statement of: > > Tactical pure fusion nukes with a yield of under 75kt are common > > > So the first problem you need to solve is why is warfare being conducted on the ground and n...
1,057
Should you defend your blinds differently at different stages of a tournament? Meaning in the early stages should you defend a lot tighter and then get a bit looser as the tournament goes on. The further you go in a tournament the more important it becomes to steal blinds so people will raise/shove a lot lighter. Shou...
2013/01/23
[ "https://poker.stackexchange.com/questions/1057", "https://poker.stackexchange.com", "https://poker.stackexchange.com/users/745/" ]
**Basically it depends on some factors:** * the available statistics and notes to the opponents. * tournament stage * your stack * opponent's stack **General Big Blind behaviour:** * we tend to defend blinds against the "stealer", who is more loose/agressive than average * we tend to defend blinds in the late tourna...
In the early stages of a tournament, you want to survive the weeding out of the unfit. Hence, you tend not to defend, unless your hand is reasonably good. In the later stages of a tournament, you are playing against survivors. Hence you need to play "reasonable" blind hands that offer any hope, and fold only your wors...
17,888,758
I have a different scale ImageView on my real device (phone) and emulator. The emulator displays the image correctly but the real device(phone) doesn't. The image becomes smaller on the device (phone) screen. this is my java code : ``` ... rootView = (ViewGroup) inflater.inflate(R.layout.arabic_page, container, fal...
2013/07/26
[ "https://Stackoverflow.com/questions/17888758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2623854/" ]
JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation.
JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation. Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides its own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.
6,264,084
I've got this HTML that I'm trying to style: ``` <div id="menubar"> <menu id="menubarTransportControls">Foobar</menu> </div> ``` Can anyone explain why this CSS... ``` #menubar menu { width: auto; } ``` ...takes priority over... ``` #menubarTransportControls { width: 100%; } ``` I'm using IE7 with ...
2011/06/07
[ "https://Stackoverflow.com/questions/6264084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/473141/" ]
`#menubar menu` has higher specificity than `#menubarTransportControls`. To understand specificity: * The specs: <http://www.w3.org/TR/CSS21/cascade.html#specificity> * If you like Star Wars: <http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html> * Otherwise: <http://css-tricks.com/specifics-on-css-sp...
it's all about the priory. In css `id` is more powerful then `class & element` for example `id=100` ``` class=10 element=1 ``` so in your example : ``` #menubar menu = 100 + 1 = 101 ``` & ``` #menubarTransportControls = 100 = 100 ``` so which one is more powreful. for more check this <http://code.google.com...
26,782,499
I am using `<? foreach $posts as $post) ?>` to call out all my posts that are added to database. I actually want to call out 3 of the new added posts to database, not all 20. How can I do that? I have read most of the topics, but they didn't work as I tought. Thank you!
2014/11/06
[ "https://Stackoverflow.com/questions/26782499", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2851363/" ]
This query will do... ``` select * from posts order by id desc limit 3 //hoping posts is your table name ``` `order by id desc` will orde your posts in descending order `limit 3` will fetch the first 3 data after getting the data you can use `foreach` to display them hope this helps...
There's a few methods to limit `$posts`, but if you can't modify that for some crazy reason, you can use: ``` for ($i = 0; $i < 3; $i++) { if ($i == 0) $post = current($posts); else $post = next($posts); // Do stuff with $post } ```
43,013,269
So basically my program is supposed to create a button in a separate activity each time another button is clicked. However every time I add a button the previous button I added disappears (the buttons move across horizontally). ``` import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import andro...
2017/03/25
[ "https://Stackoverflow.com/questions/43013269", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7765391/" ]
Found the reason causing that. Just like to post a possible solution if anyone else is facing similar problems. It appears that my 'use block caret' box was checked. Go to file -> Editor -> General -> Appearance -> 'Use block caret' and uncheck it if it's checked. Otherwise, it might be the issue with the keymappin...
Check if Ideavim OR Vimware is running on the bottom right corner of your Pycharm window. Disable it you will be able to add a new line
34,504
Kind of a hard topic to search for, as architect turns up a lot about software architects instead. After 8 months of PHP self-study, I finally stumbled across the php|architect site. The length of time it took me to find it makes me suspicious of its quality. 3 related questions: * do professional PHP coders read/ca...
2011/01/07
[ "https://softwareengineering.stackexchange.com/questions/34504", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/9260/" ]
I have been into PHP development for over 5 years now & I really find the articles very relevant & helpful. It's clearly not aimed at PHP beginners but at the intermediate/expert programmer.
In the past I bought and read PHP Architect magazine thoroughly, then it become increasingly hard to physically find at bookstores and newsstand plus I moved away from core PHP development. Having said that I always found the articles useful and relevant at the time and would occasionally go back a few months to re-rea...
24,319,558
On upgrading to Django 1.7 I'm getting the following error message from `./manage.py` ``` $ ./manage.py Traceback (most recent call last): File "./manage.py", line 16, in <module> execute_from_command_line(sys.argv) File "/home/johnc/.virtualenvs/myproj-django1.7/local/lib/python2.7/site-packages/django/core/...
2014/06/20
[ "https://Stackoverflow.com/questions/24319558", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8331/" ]
Well, I created a `auth` app, and included it in `INSTALLED_APP` like `src.auth` (because it's in `src` folder) and got this error, because there is `django.contrib.auth` app also. So I renamed it like `authentication` and problem solved!
In case if you have added your app name in settings.py example as shown in figure than [IN settings.py](https://i.stack.imgur.com/YEGyV.png) Remove it and Try this worked for me. give it a try . This Worked Because settings.py assumes installing it twice and does not allow for migration
5,540
We're about to embark on a small Casino-type Flash game and I've been assigned the task of "UX Lead"... Our company is just beginning to integrate and define the concept of UX. Our projects are now starting with a "UX lead" to be the 'user advocate' at project meetings. I've read *A Project Guide to UX* and read an ab...
2010/08/03
[ "https://ux.stackexchange.com/questions/5540", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/-1/" ]
**Casino Interfaces** I'm not in the casino industry anymore, so I'd like to share a few tips. Enjoy. Casino games are a unique subset of the game industry. The audience for these games may be older. They want graphics that look and behave like classic games. **The interface must easily allow for purchasing credi...
Use game mechanics and behavioral effects to motivate your users. [Mental Notes](http://getmentalnotes.com) and Art of Game Design mentioned above are a good starting point.
16,681
I'm lucky enough to have been gifted two Trout by a neighbour... and have not had the pleasure of preparing fresh fish before (or at least not unprepared fish). I've attempted an internet search but haven't found a source that looks reliable to me.
2011/08/06
[ "https://cooking.stackexchange.com/questions/16681", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/1159/" ]
Here is a a basic video [tutorial](http://www.youtube.com/watch?v=XKKh6cnhzAY) so you can see the basic steps. The biggest traps when cleaning fish is failing to remove all the guts, leaving bones in the filet, and not removing all the scales from the fish. You can, if you choose, just gut the fish and cook whole stu...
Rinse the outside of the fish. While the fish is uncut, remove the scales. If you have a scaler you can use that, or you can go lightly with a grater or knife against the scales; or your fingernails in the direction of the scales (so you don't hurt yourself, but it'll take a while). Don't forget to scale the top and b...
10,462,063
> > NOTE: Andrew's response caused me to take yet another look. This feature is buried deep in a large application which has in internal timer. If that timer is *off* I get the wrong behavior described here. If the timer is *on* things work as expected. I don't know why that timer interacts with this table view, but, ...
2012/05/05
[ "https://Stackoverflow.com/questions/10462063", "https://Stackoverflow.com", "https://Stackoverflow.com/users/619754/" ]
I run on win 7 32 bit. * open CMD and run : ``` cd "C:\Program Files\Microsoft SQL Server\110\Shared" ``` * Then Run : ``` mofcomp sqlmgmproviderxpsp2up.mof ``` [![cmd command](https://i.stack.imgur.com/AsUH7.jpg)](https://i.stack.imgur.com/AsUH7.jpg) **If You run at win 64, the directory is different** Possib...
I got this error too and just for a laugh I decided to run my command line window in administrator mode. Funnily enough, it worked! Not knowing what your user privilege setup looks like I can't really say that this is a definitive fix for it though
21,131,578
I need to find exactly that td row which contains value priview '2' I know the td row first half id, but it is dynamic: `MovementNumber_M_*` (Where `*` can be from 1 to Milion) So need to search all rows from `MovementNumber_M_1` to `MovementNumber_M_9999` which contains `MovementNumber_M_*.value=2` and returning dir...
2014/01/15
[ "https://Stackoverflow.com/questions/21131578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2915214/" ]
This alerts the ID's of each row containing that value ``` var result = $('[id^="MovementNumber_M_"][value="2"]'); result.each(function(){ alert($(this).attr("id")); }); ``` <http://jsfiddle.net/q8QaG/> Update: This alerts the id of all inputs with the value of 2, even on input update ``` $("#button").click(f...
``` $('#TableID').find('td').filter(':contains("SOME_TEXT")'); ```
32,957,739
I try to understand what the following sed command will do: ``` sed ‘s/[[:digit:]]+\([[:digit:]]\)/0/g’ myfile ```
2015/10/05
[ "https://Stackoverflow.com/questions/32957739", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4482864/" ]
It is the **[`addition assignment`](http://www.w3schools.com/js/js_operators.asp)** operator (`+=`) to add a value to a variable. Depending of the current type of the defined value on a variable, it will read the current value add/concat another value into it and define on the same variable. For a `string`, you conca...
``` text += "The number is " + i; ``` is equivalent to ``` text = text + "The number is " + i; ```
32,113,118
I have a problem and I can't find solution. I'm using Razor and it is my VieModel class. ``` public class GroupToExport { public GroupToExport() { ToExport = false; } [DisplayName("Export")] public bool ToExport { get; set; } public Group Group { get; set; } } public class GroupsToEx...
2015/08/20
[ "https://Stackoverflow.com/questions/32113118", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3166192/" ]
You are using Incorrect syntax to Map the values back when they are posted, since the checked value of a checkbox is initialised to false by default, that is the reason why it is always false,use sysntax ``` @for(int i = 0; i < Model.ExportingGroups.Count(); i++) { <tr> ...
I found this works much better: Leave the foreach loop as is (do not user a counter) ``` @foreach (var item in Model.GroupToExport) { ``` Then use this Razor format to display a checkbox ``` @Html.CheckBox("Active", @item.ToExport) ``` Simple to use and does not make you change the typical foreach loop.
34,565
I'm thinking of getting a nice laptop [thin like Macbook Air, Actually I'm thinking of getting Macbook Air itself]. Question is, how well it will go with Ubuntu. Being ubuntu user for last 7 years, I cant think of moving away just for great hardware capabilities in AirBook. However, It would be great if Ubuntu 11.04 r...
2011/04/11
[ "https://askubuntu.com/questions/34565", "https://askubuntu.com", "https://askubuntu.com/users/14014/" ]
There is a good discussion on the [Apple Users section of ubuntuforums](http://ubuntuforums.org/showthread.php?t=1603365) which is definitely worth a read through and contains probably the most up to date guide and experiences which others have had. You could also look at: <http://ebsi4711.blogspot.com/2010/10/ubuntu-o...
I'm using Ubuntu on a Macbook Air 4,2 (mid 2011), and I'm not sure I'd do it again (buying an Air, despite the nice hardware). Setting up any Linux on an Air is really much hassle, since it cannot boot Linux off an USB stick (mac firmware problems). If you have an official apple superdrive, using the install CD is sup...
10,977,405
The first two elements of my `tuple`s are computated (see below), but I want them to be 3-`tuple`s rather than 2-`tuple`s with the last element being set to `1`. ``` from itertools import permutations if __name__ == '__main__': alphabet='abcdefghijklmnopqrstuvwxyz' print list(permutations(alphabet,2)) ``` [...
2012/06/11
[ "https://Stackoverflow.com/questions/10977405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1438003/" ]
Before `print a`, insert ``` a = [(x, y, 1) for x, y in a] ``` Or, replace ``` list(permutations([alphabet[i],alphabet[i+1]])) ``` with ``` [(alphabet[i], alphabet[i+1], 1), (alphabet[i+1], alphabet[i], 1)] ``` **EDIT**: with your new requirement, the easiest solution is ``` [(x, y, 1) for x, y in permutatio...
My current solution, in case anyone is still interested: ``` [x + (1,) for x in list(permutations(alphabet,2))+[(alpha, alpha) for alpha in alphabet]] ``` Would still be interested if there is a more efficient way of doing this though...
365,643
Say I have a data model, which looks like this: ``` public class DataCustomer { public virtual System.DateTime CreatedTime { get; set; } public virtual Guid Id { get; set; } public virtual string FirstName { get; set; } public virtual string Surname { get; set; } public virtual string FaxNumber{ g...
2018/02/09
[ "https://softwareengineering.stackexchange.com/questions/365643", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/65549/" ]
A domain model and the data model have a different view of the world and should be expressed in the code. The domain model should be modeled so that it aligns to the **business** view of the application while the data model is all about manipulating the domain model so that it's easy to be consumed by others for speci...
There is no reason why you **must** keep them the same, though it's *desirable*. Imaging you are storing the info in an array of strings. Your data model would differ completely from your domain model. Imaging your data model isn't yours (you are using a third-party API). Your business logic might differ from the bus...
65,028,370
I've been following [this](http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/) tutorial on rendering to an off-screen texture, but I'm having difficulty creating the render target. I've registered an error callback function and I'm getting a `GL_DEBUG_TYPE_OTHER` error back with a `GL_...
2020/11/26
[ "https://Stackoverflow.com/questions/65028370", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11058021/" ]
As per the GL spec, `GL_RGB` is not in the set of *required renderable formats*, so implementations are free to not support it. Try `GL_RGBA` instead.
Managed to get to the bottom of this. I'd actually fixed the bug in simplifying the example for the post. ```c glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1920, 1080, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); ``` Was actually getting the width and height from a helper function that from a platform layer, however...
39,834
Longitudinal axis (x) is the axis orthogonal to its lateral directions (y and z), but what is transverse direction? Is transverse just another term for lateral?
2021/01/20
[ "https://engineering.stackexchange.com/questions/39834", "https://engineering.stackexchange.com", "https://engineering.stackexchange.com/users/7336/" ]
The terms *lateral* and *transverse* often get mixed up, because they can refer to the same thing, although this is not necessary. To my understanding **any lateral is transverse** but the opposite is not necessarily true. **Transverse axis** is any axis perpendicular to the longitudinal axis **Lateral axis** (*to m...
1. "Transverse" is quite clear, it is an axis that makes 90 degrees to the reference axis. So, if the reference axis is x-axis, both the y and z axes are "transverse" to the x-axis. 2. "Lateral" has a few different meanings and usages: a) "The lateral distance...", means the horizontal distance between the referenced ...
1,150,633
I have the following JUnit test: ``` @Test public void testRunLocalhost() throws IOException, InterruptedException { // Start an AnnouncerThread final AnnouncerThread announcer = new AnnouncerThread(); announcer.start(); // Create the socket and listen on the right port. final DatagramSocket socke...
2009/07/19
[ "https://Stackoverflow.com/questions/1150633", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68507/" ]
It does appear to have something to do with the `assert` calls you're making right after allocating those three final variables. The PMD docs (<http://pmd.sourceforge.net/rules/controversial.html#DataflowAnomalyAnalysis>) say: > > UR - Anomaly: There is a reference to a variable that was not defined before > > >
That looks rather strange. Interestingly, it occurs for all three variables that are defined for objects allocated via 'new', which you then check for nullness. I would expect the result of 'new' to always be valid/not-null - otherwise an `OutOfMemoryException` should be thrown. Is that the issue, I wonder ?
64,189,069
My config is Google Pixel 128gb, android 10, Magisk 20.4 + 8.0.0 manager, have the mysterious problem! I need to use .bat script, who have some code `adb shell "sh sdcard/airplane.sh"` But it's not working! Got error `cmd: Failure calling service activity: Failed transaction (2147483646)` If I type it in cmd by...
2020/10/03
[ "https://Stackoverflow.com/questions/64189069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2689175/" ]
comment this line in `validator.js` (`\node_modules\jsonschema\lib\validator.js:111`): ```js if((typeof schema !== 'boolean' && typeof schema !== 'object') || schema === null){ throw new SchemaError('Expected `schema` to be an object or boolean'); } ```
In the runtime go to \node\_modules\jsonschema\lib\validator.js. Replace the code on line 106 with ```js if((typeof schema == 'boolean' && typeof schema == 'object') || schema === null){ ```
2,388,256
I have a web based (perl/MySQL) CRM system, and I need a section for HR to add details about disciplinary actions and salary. All this information that we store in the database needs to be encrypted so that we developers can't see it. I was thinking about using AES encryption, but what do I use as the key? If I use t...
2010/03/05
[ "https://Stackoverflow.com/questions/2388256", "https://Stackoverflow.com", "https://Stackoverflow.com/users/71062/" ]
GnuPG allows documents to be encrypted using multiple public keys, and decrypted using any one of the corresponding private keys. In this way, you could allow data to be encrypted using the public keys of the everyone in the HR department. Decryption could be performed by any one having one of the private keys. Decrypt...
Another approach is to use a single system-wide key stored in the database - perhaps with a unique id so that new keys can be added periodically. Using Counter Mode, the standard MySQL AES encryption can be used without directly exposing the cleartext to the database, and the size of the encrypted data will be exactly ...
2,098,069
Can someone look at the linked reference and explain to me the precise statements to run? [Oracle DBA's Guide: Creating a Large Index](http://download-west.oracle.com/docs/cd/B28359_01/server.111/b28310/indexes003.htm#i1006643) Here's what I came up with... ``` CREATE TEMPORARY TABLESPACE ts_tmp TEMPFILE 'E:\temp01...
2010/01/19
[ "https://Stackoverflow.com/questions/2098069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/203104/" ]
> > > ``` > CREATE TEMPORARY TABLESPACE ts_tmp > TEMPFILE 'E:\temp01.dbf' SIZE 10000M > REUSE AUTOEXTEND ON EXTENT MANAGEMENT LOCAL; > > ``` > > This creates a temporary tablespace (an area on disk where the intermediate sort results will be stored). An index is a sorted set of data, and sorting needs lots of s...
There is a small secret about oracle, table space, this one only increases in oracle, and will never decrease in size, what they are trying to do here is to avoid this situation, so it creates a temporary table space and use that table space to create the index and then drop it.
3,782
By default Kate inserts 2 spaces on Tab press but switches to real tabs starting from the fourth Tab level. Can I disable this and use spaces always, regardless to the depth? I want this because I use Kate to code Scala, and using space pairs instead of tabs is a convention there.
2010/11/05
[ "https://unix.stackexchange.com/questions/3782", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/2119/" ]
Adding to the present answers, an important thing to realize about how aliases work is that all the parameters you type after an aliased command will be used literally at the end. So there is no way to use alias for two commands (piped or not), out of which the first should interpret the parameters. To make it clear, h...
You don't have to do anything, actually; aliases do this automatically. For instance: ``` $ alias less="less -eirqM" $ less foo.txt ``` You will see foo.txt's first page, and `less` will quit at EOF (-e), searches will be case-insensitive (-i), etc.
57,977,349
Calling microsoft graph API <https://graph.microsoft.com/v1.0/subscribedSkus> fails with "code": "Authorization\_RequestDenied", "message": "Insufficient privileges to complete the operation.", This is happening if we create a new user in the tenant who is non admin. But while calling this with Admin user it works ...
2019/09/17
[ "https://Stackoverflow.com/questions/57977349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6393049/" ]
Let's say you want to search for a date `2019-01-03`. ``` SELECT id, group_id FROM membership WHERE '2019-01-03' BETWEEN in_group_begin AND IFNULL(in_group_end, CURRENT_DATE); ``` If you have another `users` table which stores details of users and `id` of that table is used in `membership` table using `id` f...
Assuming there is a table `users` from which you want the user's details returned, join it to your table `tablename` like this: ``` select u.*, t.group_id from users u inner join ( select id, group_id, in_group_begin, coalesce(in_group_end, current_date) in_group_end from tablename ) t on t.id = u.id an...
2,270,552
Im getting into Winsocks and is there any reference to tell me what a packet is. Like UDP/TCP Packets?
2010/02/16
[ "https://Stackoverflow.com/questions/2270552", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69467/" ]
Google is your friend here. If anything is available on the internet it is TCP/IP information. [This](http://en.wikipedia.org/wiki/Transmission_Control_Protocol) is as good a start as any. When you get really serious [this](http://www.kohala.com/start/tcpipiv1.html) is as close to a classic text as there is.
a packet is small piece of data witch can be transferable over a network. in it data is packed along with check sum for error checking. For UDP - you can say it is nothing but broadcasting of messages(Packets) with no acknowledgment. And For TCP/IP - It is protocol for transferring data over network
202,575
You should **believe** me You should **believe in** me Both of two are natural ? When i intend to say that you should trust me
2019/03/27
[ "https://ell.stackexchange.com/questions/202575", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/91634/" ]
I don't think we have a standard word to express that idea. It would depend on the body part and the image you want to convey when you describe it. These are my poor attempts at examples: > > Six long graceful toes extended from each of her feet. > > > Bushy black eyebrows sprouted wildly from above his deep brown...
Spawn and or spawned. Seraphim wings spawned forth from her back.
53,866,169
I have a JSON model, which I build from a Metadata set. So I created that JSON array and did the following: ```js var oModel = new JSONModel({ JSONDataSet: oJSONDataArray }); this._oFragment.setModel(oModel); ``` In my fragment, I have a table: ```xml <Table id="tableId" items="{ path:'/JSONDataSet' }"> <colum...
2018/12/20
[ "https://Stackoverflow.com/questions/53866169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9236137/" ]
> > List Binding is not bound against a list for ... > > > The above [error occurs only in ODataListBinding.js](https://github.com/SAP/openui5/blob/84de3414276401e2ff03b480b8ae074d31b1ee18/src/sap.ui.core/src/sap/ui/model/odata/v2/ODataListBinding.js#L981-L983) and is thrown when the module fails to find the entit...
If you take a look at the browser console, probably you have already an error telling you that "the template or factory function was not provided" or something similar. In the following code, there is something missing ``` <Table id="tableId" items="{ path:'/JSONDataSet' }"> <columns> ..... ...
461,417
I'm trying to run my junit tests using ant. The tests are kicked off using a JUnit 4 test suite. If I run this direct from Eclipse the tests complete without error. However if I run it from ant then many of the tests fail with this error repeated over and over until the junit task crashes. ``` [junit] java.util.z...
2009/01/20
[ "https://Stackoverflow.com/questions/461417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56679/" ]
It sounds like there is an issue with paths. Check following error source: * classpath: print out the classpath variable in a junit test, run it from eclipse and ant, so you can compare them * Check your project for absolute paths. Probably, ant uses other path prefixes than eclipse. Some more information would help...
If you are using Ubuntu or Debian, this will make JUnit (and some other libs) always available for Ant: ``` sudo apt-get install ant-optional ```
24,032,654
Given: I have the following two variables in Javascript: ``` var x = { dummy1: null dummy2: null }; // Return true var y = { dummy1: 99, dummy2: 0 } // Return false var y = ""; // Return false var y = { dummy1: null }; // Return ...
2014/06/04
[ "https://Stackoverflow.com/questions/24032654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There are probably better names for these functions, but this should do it: ``` function hasAllProperties(subItem, superItem) { // Prevent error from using Object.keys() on non-object var subObj = Object(subItem), superObj = Object(superItem); if (!(subItem && superItem)) { return false; } re...
Try this: ``` Object.keys(y).every(function (key) { return key in x; }); ```
751,432
> > An object mass $1 \, \rm kg$ hangs on a rope length $1 \, \rm m$. The object gets pushed with minimal horizontal velocity required to swing a full vertical circle, i.e.: keeping the rope stretched. > > > What time $t\_c$ does it take to complete that intact circle? > > > I added conclusion near end. I have ...
2023/02/22
[ "https://physics.stackexchange.com/questions/751432", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/359072/" ]
While I agree with the other answers regarding work required to initiate current, and no work done by the current, let me add another perspective. > > But, if there's no resistance when a current flows through a superconductor, doesn't that mean there's no energy lost as heat? ***That would seem to imply we're adding...
The [second law of thermodynamics](https://en.wikipedia.org/wiki/Second_law_of_thermodynamics) only says that no process can decrease the entropy of the universe (i.e. destroy entropy). An equivalent view is that no process can create exergy. From a field perspective, the divergence of entropy is always positive. Whil...
13,644,385
In my php project i have a javascript variable say "addText" which contains the following html content ``` <div class="foxcontainer" style="width:100% !important;"> <h2>FREE IN HOME CONSULTATION</h2> <ul class="fox_messages"> <li>Invalid field: Your name</li> <li>Invalid field: Your email</li> </ul> <form e...
2012/11/30
[ "https://Stackoverflow.com/questions/13644385", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1866141/" ]
``` if (addText.indexOf("Invalid field") != -1) { /* it's present */ } // OR with regex if (/Invalid field/.test(addText)) { /* it's present */ } // OR with case-insensitve regex: if (/Invalid field/i.test(addText)) { /* it's present */ } ```
you can use `strstr` , document @ <http://www.php.net/manual/en/function.strstr.php> Thanks
403,590
I've updated my repositories on synabtics the upgraded firefox to newer version, when I open it it crashes, while this I was having my hard drive plugged .. so I tried to reboot to fix Firefox crash .. From that point I can't login, tried many solutions as I can. Additional information could help you solving my problem...
2017/11/09
[ "https://unix.stackexchange.com/questions/403590", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/230614/" ]
First, the most important thing: *you can do it.* Windows configurability is catastrophic, so the best if you start with a Windows pendrive and you extend it with a secondary Linux partition and with a more intelligent bootloader. Thus, the required steps: 1. Get your Windows boot pendrive from anywhere. In the deta...
try [www.easy2boot.com](http://www.easy2boot.com) Unlimited Windows ISOs, linux ISOs, VHDs, WIMs, .IMA, linux+persistence, Secure boot UEFI, etc. The USB stick can be prepared using linux or Windows.
83,684
This is a follow-up on my previous question about a VBA macro for randomizing a draw from a table. It can be found here: [Randomizing Civilization 5 team choice](https://codereview.stackexchange.com/questions/83573/randomizing-civilization-5-team-choice) The code has been improved with the help I got earlier and I now...
2015/03/09
[ "https://codereview.stackexchange.com/questions/83684", "https://codereview.stackexchange.com", "https://codereview.stackexchange.com/users/67710/" ]
Your indentation is generally fine, except the `Draw` procedure isn't indented as it should; everything in a `Sub` block should be indented 1 level, so that this: ``` Next noOfPlayers End Sub ``` Becomes that: ``` Next noOfPlayers End Sub ``` I like that you have lots of small functions - that's very good! H...
First I'd like to say that this is a vast improvement over your original code. It's nice to see advice given on CR taken to heart and implemented. Well done. Now that it's easier to understand what the code is doing, let's talk about performance. As @Mat'sMug mentioned in his answer, the code has nested loops 4 levels...
30,613,119
I was having 2 version of Appium. One was installed on Windows/Program Files and Other version was .zip extract. I was not able to start the Appium server and got below error - ``` error: Couldn't start Appium REST http interface listener. Requested port is already in use. Please make sure there's no other instance ...
2015/06/03
[ "https://Stackoverflow.com/questions/30613119", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2417546/" ]
Go to Appium(Android windows) setting change to any port number and start server again. once server is started again change to original port.
appium -a 127.0.0.1 -p 4723 Here the port number is 4723. If the server is up in one port, you can try initializing the server in a different port. Use the command appium -a 127.0.0.1 -p (4724 or 4725 or any port number). It will work
23,952
> > [Genesis 5 (NIV)](http://www.biblegateway.com/passage/?search=Genesis%205) > > > And **Adam** lived one hundred and thirty years, and begot a son in > his own likeness, after his image, and named him Seth. After he begot > Seth, the days of Adam were eight hundred years; and **he had sons and > daughters**. S...
2013/12/20
[ "https://christianity.stackexchange.com/questions/23952", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/3889/" ]
**Noah's Lineage** Noah was definitely a significant figure, as it was he and his family alone who survived the flood. The purpose appears to be to show Noah's lineage from Adam. Adding in brothers and sisters at each level would be a bit tangential to that purpose. Enoch was certainly a man of note due to his close ...
I was just searching for some infos and found your question, which isn't answered as it seems. There are only 10 Names, because these are the names of the Firstborn. Adam being the first king of the Earth, as appointed by the Creator, handed down his right to the "Throne of Elohim" (literally that's what the throne o...
36,585,575
Let's say I have this array: ``` let reportStructure = [|(2, 1); (3, 2); (4, 2); (5, 3); (6, 4); (7, 3)|] ``` where the first `int` in a tuple reports to the second `int`. I can map that really easily with ``` let orgMap = Map.ofArray reporting ``` From there, I could easily get a list of all the ints that repo...
2016/04/12
[ "https://Stackoverflow.com/questions/36585575", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4351030/" ]
Since OCaml is close to F# and trying to find Topological sort in F# was not turning up anything useful I looked for OCaml code. I found [An Introduction to Objective Caml](http://www.cs.columbia.edu/~sedwards/classes/2011/w4115-fall/ocaml.pdf) which had a solution to your problem using Depth First Search and used it ...
I like f# puzzles, so I took a stab at this one. I hope that you enjoy. ``` let orgList = [(2, 1); (3, 2); (4, 2); (5, 3); (6, 4); (7, 3)] let orgMap = orgList |> List.fold (fun acc item -> let key = snd item match Map.tryFind key acc with | Some(value) -> let map' = Ma...
4,061
Who knows one hundred thirty? ----------------------------- *Please cite/link your sources, if possible. At some point at least twenty-four hours from now, I will:* * *Upvote all interesting answers.* * *Accept the best answer.* * *Go on to the next number.*
2010/11/21
[ "https://judaism.stackexchange.com/questions/4061", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/2/" ]
The weight in silver of each plate brought by the nesiim at the chanukas hamishkan
Number of words in *בריך שמיה* (Sort of Tikun for the 130 of Adam)
52,428,939
**Only TF native optimizers are supported in Eager mode** I'm getting this error with every optimiser I have tried in the following: ``` def create_model(): model = tf.keras.models.Sequential([tf.keras.layers.Dense(512,activation=tf.nn.relu, input_shape=(784,)), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(...
2018/09/20
[ "https://Stackoverflow.com/questions/52428939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9061457/" ]
This error occur to me when send Date object (for example timestamp in firebse) to React child components. If you send it as value of a child component parameter you would be sending a complex Object and you may get the same error as stated above. You must send that date as string value ``` <p>{timestamp.toS...
Had the same error but with a different scenario. I had my state as ``` this.state = { date: new Date() } ``` so when I was asking it in my Class Component I had ``` p>Date = {this.state.date}</p> ``` Instead of ``` p>Date = {this.state.date.toLocaleDateString()}</p> ```
1,236,986
i have code like : ``` <% if @photos.blank? %> No Pic <% else %> <center> <table> <tr> <% @photos.each do |c| %> <td> <%= image_tag(url_for({:action => 'image', :id => c.id}),:width =>'20%', :height =>'20%' ) %><br> <%= link_to "lihat" , {:action => 'show2', :id => c.id} -%> <%...
2009/08/06
[ "https://Stackoverflow.com/questions/1236986", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148641/" ]
There are a couple of ways you could solve the "5 photos on a row" problem, but I think that this is the most expressive: `group` the array of photos into rows of 5 and use nested `.each` loops: ``` rows = @photos.in_groups_of(5) rows.each do |row| <tr> row.each do |photo| <td> #display photo here </td...
It looks as though you've run into the problem I mentioned in my original answer: "Be aware that if you don't have 5 photos on your final row, `array#in_groups_of` will pad it with `nil` unless you specify an alternative default." Try this: ``` <tr> <% row.each do |photo| %> <td> <% if photo %> <%= image...
29,086,872
Hi I have 3 circles in android that show progress, are a custom element (ViewProgressbar) that inherit from relative layout. ``` <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center"> <com.theproject.ui.view.ViewProgr...
2015/03/16
[ "https://Stackoverflow.com/questions/29086872", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2853555/" ]
I'm not sure I have heard of "good practices" as far as scraping goes but you may be able to find some in the book [PHP Architect's Guide to Web Scraping with PHP](http://www.phparch.com/books/phparchitects-guide-to-web-scraping-with-php/). These are some guidelines I have used in my own projects: 1. Scraping is a sl...
You Should take a Symfony-Controller if you want to return a response, e.G a html output. if you only need the function for calculating or storing stuff in database, You should create a [Service](http://symfony.com/doc/current/book/service_container.html) class that represents the functionality of your Crawler, e.G `...
51,188,026
I try to delete attribute "disabled" in my input area or if I choose another radio button, will add "disabled" in my input. This code doesn't right work: ```js var radio_3 = document.getElementById("Radio3"); var input_long = document.getElementById("inputLong"); radio_3.addEventListener("change", function() { i...
2018/07/05
[ "https://Stackoverflow.com/questions/51188026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10005778/" ]
The `change` listener is only on `radio_1` (or, the `#radio_3` `input`) - the listener runs when the radio button is selected, but *not* when some *other* radio button is selected. Add a listener to *each* radio button instead: ```js var input_long = document.getElementById("inputLong"); const listener = (e) => { ...
The change event doesn't trigger when you click on radio 1 and 2. So you would need to register event handlers separately for them. In the snippet below, I have declared the event handler separately, and bound it to the radio buttons through separate calls to `addEventListener`. ```js var radio_1 = document.getElem...
31,921,893
I have subclassed a button such that I can get basically a button with rounded edges and an icon on the right side. Nearly got it right, only issue is that the icon is not centered vertically and cannot seem to figure out how I can influence the vertical alignment. The original image is rectangular and I am using Cre...
2015/08/10
[ "https://Stackoverflow.com/questions/31921893", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1209947/" ]
The most important thing here is primitives are way way cheaper than object wrappers, in both time and memory complexities. The pooling feature only becomes relevant if you have to use these primitives in contexts where Object references have to be used (i.e. they have to be wrapped/"boxed" into their object wrappers,...
I am not quite sure why you need `Short`. Anyways, as a thumb rule always remember that *primitives are always faster and cheaper when compared to their wrappers*. They aren't objects so many JIT optimizations can result in really fast code. Also, Wrappers don't contain cache for all possible values - for example `Inte...
6,742,686
Consider the following example: ([live demo here](http://jsfiddle.net/jESsA/)) HTML: ``` <div id="outer_wrapper"> <div class="wrapper"> <a><img src="http://img.brothersoft.com/icon/softimage/s/smiley.s_challenge-131939.jpeg" /></a> </div> <div class="wrapper"> <a><img src="http://assets.te...
2011/07/19
[ "https://Stackoverflow.com/questions/6742686", "https://Stackoverflow.com", "https://Stackoverflow.com/users/247243/" ]
You can try assigning a `vertical-align` attribute on the `img` tag. Vertical align is relative to the line box which means you need to set the line box as tall as the height of the `a` tag. So these changes are needed in your CSS markup: ``` #outer_wrapper { overflow: hidden; /* required when you float everything...
You could check this out: <http://www.brunildo.org/test/img_center.html>
8,556
> > The Lord sent fiery serpents among the people and they bit the people, so that many people of Israel died. So the people came to Moses and said, “We have sinned, because we have spoken against the Lord and you; intercede with the Lord, that He may remove the serpents from us.” And Moses interceded for the people. ...
2012/07/18
[ "https://christianity.stackexchange.com/questions/8556", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/1671/" ]
From John 3:14 we know it was a foreshadowing of Christ, but I think the desire for absolute certainty concerning any foreshadowing image or shadow of Messiah party misunderstands the concept of a shadow. A shadow is by definition an obscure and fuzzy outline of a real object. This is why we will find invariably numero...
Moses had to make the image of the fiery snake in bronze and put it on a standard and raise it up. My thoughts from the chapter in John are that the standard was possibly in the shape of a cross with the snake draped over it. The snake represents both Jesus the Christ and the sin he has taken on himself for us. When w...
23,713
I have time series $R$, which shows, how `something` changes at the regional level. I have several time series $U\_i$, which show, how `something` changes at a special unit $I$ level. There are many units in the region. $R$ has no missing data. Different $U\_i$ have their own missing periods. **I want to** forecast...
2017/10/12
[ "https://datascience.stackexchange.com/questions/23713", "https://datascience.stackexchange.com", "https://datascience.stackexchange.com/users/29931/" ]
Not a fully complete answer, but some inputs. 1. Your time series are correlated. 2. I assume that the measure you want to forecast for a region is an aggregation of units forecasts. To address the first point, I usually use Vector Autoregressive Model (VAR) that forecast all time-series at once (each one being expre...
Just a thought: Why wouldn't you do the training on the difference data for 1-250 and test using 251-300 to see if the underlying pattern actually is accurate. If that was the case, you can generalize from 1-300 to 301-365.
32,112,820
I have the following SQLDataSource: ``` <asp:SqlDataSource runat="server" ID="MySqlDataSource" ConnectionString='<%$ ConnectionStrings:RmaReportingConnectionString %>' SelectCommand="SELECT DISTINCT [Team] FROM [Locations] WHERE ([Team] IN (@Teams))"> <SelectParameters> <asp:Parameter Name="...
2015/08/20
[ "https://Stackoverflow.com/questions/32112820", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1315427/" ]
For variable height cells you need to implement tableView:heightForRowAtIndexPath:
`UITableView` has delegate method to set that, i.e. `tableView:heightForRowAtIndexPath:`.. If you ask for logical answer, I would say... Display you table as it is on view load.. take a flag which will check for button clicked in `tableView:heightForRowAtIndexPath:` .. keep it to 0 on `viewDidLoad` and load table. cha...
5,208,038
Let's say I'm given a `void*` memory address and I need to print the bits located in this memory address. How can I do this? In my processor memory addresses are 32bits as are memory values, also int are 32 bits. So I thought of doing this: ``` unsigned int value = *memory_address; ``` and then by simple arithmetic...
2011/03/06
[ "https://Stackoverflow.com/questions/5208038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/646544/" ]
``` int main() { int a = 0xFFFF; void * v = &a; // v points to a int * aPtr = (int *) v; // aPtr also points to a int b = *aPtr; // b gets the value aPtr points to, aka a or 0xFFFF int aBit = (b >> 3) & 1; // aBit now contains bit 3 of the original a value // toggle the bit if (aBit) { b &= ~(1 ...
How about: ``` bool isBit4Set = ((*someAddress) & 0x8 != 0); (*someAddress) |= 0x8; // Set bit 4 ```
1,214,876
This is probably a C++ 101 question: I'm curious what the guidelines are for using `size_t` and `offset_t`, e.g. what situations they are intended for, what situations they are not intended for, etc. I haven't done a lot of portable programming, so I have typically just used something like `int` or `unsigned int` for a...
2009/07/31
[ "https://Stackoverflow.com/questions/1214876", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18529/" ]
`offset_t` isn't mentioned at all in my copy of the C++ standard. `size_t` on the other hand, is meant simply to denote object or array sizes. A `size_t` is guaranteed to be big enough to store the size of any in-memory object, so it should be used for that.
Dragging an old one back up... offset\_t (which is a long long) is used by Solaris' llseek() system call, and is to be used anywhere you're likely to run into real 64-bit file offsets... meaning you're working with really **huge** files.
9,633,201
Can any body tell me what is error in the following paypal ipn response `Failed Response = HTTP/1.1 200 OK Date: Fri, 09 Mar 2012 10:47:38 GMT Server: Apache X-Frame-Options: SAMEORIGIN Set-Cookie: cwrClyrK4LoCV1fydGbAxiNL6iG=HsLFg9XOmQSJyuFKrL6PkJjTED9fh4Zde3UysJ1YnQ1xmilNeg-Y_zLU2wud8XLDahMpf5S7P120pyejIXzBLm%7chW7...
2012/03/09
[ "https://Stackoverflow.com/questions/9633201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1138131/" ]
[The IPN response of INVALID means that you have not provided the ***EXACT*** data, to the server the IPN was sent from, as what was sent to you by that server.](https://www.x.com/developers/community/blogs/ppmtsrobertg/securing-your-instant-payment-notification-ipn-script)
I had the same problem. My problem was: I sent a call from the Sandbox Instant Payment Notification (IPN) simulator to my real account. It always came back as `INVALID`. After trying to send it to the sandbox server, it worked! I think paypal works like this is for security reason. I hope my thing works when all creden...
54,830,384
In Laravel 5.7 I am using form request validation: ``` public function rules() { return [ 'age' => 'integer', 'title' => 'string|max:50' ]; } ``` If I submit a request to my API with this payload: ``` { "age": 24, "title": "" } ``` Laravel returns the error: ``` { "message": "The...
2019/02/22
[ "https://Stackoverflow.com/questions/54830384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/519497/" ]
You would need `nullable` to allow an empty string ``` public function rules() { return [ 'age' => 'integer', 'title' => 'nullable|string|max:50' ]; } ```
The accepted answer does not fix the issue when you have this rule: ```php return [ "title" => "sometimes|string", ]; ``` In this case, you need to specifiy the string is actually "nullable" (even if the `ConvertEmptyStringsToNull` middleware is active, tested on Laravel 8.77.1) So this one will allow to pass an...
4,221,712
I'm searching a space of vectors of length 12, with entries 0, 1, 2. For example, one such vector is 001122001122. I have about a thousand good vectors, and about a thousand bad vectors. For each bad vector I need to locate the closest good vector. Distance between two vectors is just the number of coordinates which...
2010/11/19
[ "https://Stackoverflow.com/questions/4221712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371435/" ]
3^12 isn't a very large search space. If speed is essential and generality of the algorithm is not, you could just map each vector to an int in the range 0..531440 and use it as an index into a precomputed table of "nearest good vectors". If you gave each entry in that table a 32-bit word (which is more than enough), ...
Assuming a packed representation for the vectors, one distance computation (comparing one good vector and one bad vector to yield the distance) can be completed in roughly 20 clock cycles or less. Hence a million such distance calculations can be done in 20 million cycles or (assuming a 2GHz cpu) 0.01 sec. Do these num...
4,878,932
For example ``` input{margin:0}body{margin:0;background:white} ``` would be shorter written like this ``` input,body{margin:0}body{background:white} ``` or this ``` input,body{margin:0}body{margin:0;padding:0} ``` would be shorter written like this ``` input,body{margin:0}body{padding:0} ``` **Conclusion** ...
2011/02/02
[ "https://Stackoverflow.com/questions/4878932", "https://Stackoverflow.com", "https://Stackoverflow.com/users/463304/" ]
If you use visual studio, you could install the [Web Essentials](http://visualstudiogallery.msdn.microsoft.com/6ed4c78f-a23e-49ad-b5fd-369af0c2107f) extension. It has experimental support for cleaning and merging CSS rules, but not exactly like you subscribed. It, for one, creates more whitespace, but it does combine c...
May be the wrong thing, but h[ttp://www.cleancss.com/](http://www.cleancss.com/)?
12,296,421
According to [here](http://api.jquery.com/remove/), jquery's remove function should work like so.. ``` $('div').remove('selector'); ``` Which I'm trying [in this example](http://jsfiddle.net/qwXSw/). *HTML:* ``` <div class="wrapper"> <p class="unwanted">This should be removed</p> <p class="retained">This ...
2012/09/06
[ "https://Stackoverflow.com/questions/12296421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/597264/" ]
You've misunderstood what the documentation is saying. It's not looking for elements that are descendants of the matched elements that match the selector, it's simply filtering down the set of already matched elements to those that match the selector, and then removing them. If you have this HTML: ``` <div class="wan...
try this ``` $(document).ready(function() { $('div').find('p.unwanted').attr('class', ''); }); ```
149,954
Is there a way to level up unarmed combat (punching)? I found a perk but I want to get better and level up!
2014/01/08
[ "https://gaming.stackexchange.com/questions/149954", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/65788/" ]
Go to riften and start the thieves guild stuff by working with the guy named brynyolf and doing his quests plant the ring and go to the ratway, in a room with an alchemy table and a lot of floor traps a guy runs up and starts punching you, no matter your race his gloves add 10 damage to your hand to hand.
Alternatively, look at applying one or more of the unarmed mods. <http://www.nexusmods.com/skyrim/mods/searchresults/?src_order=2&src_sort=0&src_view=1&src_tab=1&src_name=unarmed&page=1&pUp=1>
2,013,387
I'm having trouble accessing a class' variable. I have the functions below in the class. ``` class Profile { var $Heading; // ... function setPageTitle($title) { $this->Heading = $title; echo 'S: ' . $this->Heading; } function getPageTitle2() { echo 'G: ...
2010/01/06
[ "https://Stackoverflow.com/questions/2013387", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417012/" ]
If you have "G: S: test" it means you called getPageTitle2 before setPageTitle ! It looks normal then : I suggest first set then get.
you have to declare the Heading and title out of the function ... i dont know if you already did that see the order of calling the functions
17,122,081
Hello I am creating gaming trophy system and I am still learning pdo. I have two tables in my database First table ( games ) structure is ``` id, title, thumb, bronze, silver, gold, platinum ``` Second table ( trophies ) structure is ``` id, title, game_id ``` every trophy assigned to a game by ( game\_id ) c...
2013/06/15
[ "https://Stackoverflow.com/questions/17122081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1578920/" ]
You need to do that: ``` $sqlres=$db->query("SELECT thumb, title, id, SUM(bronze + silver + gold + platinum) AS total FROM games JOIN trophies ON games.id = trophies.game_id GROUP BY id DESC"); while($row=$sqlres->fetch_assoc()) { echo $row["thumb"]; } ``` In SQL when you do a join you need to specify the table ...
Try this: ``` $rows = $db->query("SELECT thumb, title, id, SUM(bronze + silver + gold + platinum) AS total FROM games JOIN trophies ON games.id = trophies.game_id GROUP BY id DESC"); foreach($rows as $r){ echo $r->thumb //etc. } ``` Your title sql error is because you have two tables with the same field name. Yo...