qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
51,552,712
I am working in an angular 4 project ,In this I have a mega menu .What I want to do is when I clicked on a menu inside the mega menu I want to close it . In my case it always open even after I clicked on a specific menu ,but closed if I remove the mouse focus in it . Stackblitz : <https://stackblitz.com/edit/angular-...
2018/07/27
[ "https://Stackoverflow.com/questions/51552712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9956391/" ]
Docker images are an [open and documented](https://github.com/opencontainers/image-spec) "application packaging" format. There are countless ways to inspect the image contents, including all of the python source code shipped inside of them. Running applications inside of a container provides isolation from the applica...
I know that´s been more than 3 years, but... looking for the same kind of solution I think that including compiled python code -not your source code- inside the container would be a challenging trial for someone trying to access your valuable source code. If you run `pyinstaller --onefile yourscript.py` you will get a...
51,552,712
I am working in an angular 4 project ,In this I have a mega menu .What I want to do is when I clicked on a menu inside the mega menu I want to close it . In my case it always open even after I clicked on a specific menu ,but closed if I remove the mouse focus in it . Stackblitz : <https://stackblitz.com/edit/angular-...
2018/07/27
[ "https://Stackoverflow.com/questions/51552712", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9956391/" ]
I know that´s been more than 3 years, but... looking for the same kind of solution I think that including compiled python code -not your source code- inside the container would be a challenging trial for someone trying to access your valuable source code. If you run `pyinstaller --onefile yourscript.py` you will get a...
I think it could be a solution as using a "container" to protect our code from the person we wouldn't let them access. the problem is docker is not a secure container. As the root of the host machine has the most powerful control of the Docker container, we don't have any method to protect the root from accessing insid...
1,076,032
Can someone explain the concept of sessions in ASP.NET? How do I use them, and how do cookies fit in?
2009/07/02
[ "https://Stackoverflow.com/questions/1076032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Session is a per-user object for persisting state between HTTP requests. It is good for storing information that you will need on the server to properly serve requests back to the user (e.g. user name, email, etc.). ASP.NET places a cookie on the client's machine that contains a GUID (in the case of cookieless session...
* [ASP.NET State Management Overview](http://msdn.microsoft.com/en-us/library/75x4ha6s.aspx) "Use ASP.NET session state to store and retrieve values for a user." + [Session State Overview](http://msdn.microsoft.com/en-us/library/ms178581.aspx) - [Background](http://msdn.microsoft.com/en-us/library/ms178581.asp...
1,076,032
Can someone explain the concept of sessions in ASP.NET? How do I use them, and how do cookies fit in?
2009/07/02
[ "https://Stackoverflow.com/questions/1076032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Session is a per-user object for persisting state between HTTP requests. It is good for storing information that you will need on the server to properly serve requests back to the user (e.g. user name, email, etc.). ASP.NET places a cookie on the client's machine that contains a GUID (in the case of cookieless session...
Sounds like you're pretty new to ASP.NET. Rather than posting vague questions here, I would suggest you head over to [http://www.ASP.net](http://asp.net) and check out their tutorials. They've got a lot of walkthroughs and articles that will give you a good overview of how ASP.NET state works.
1,076,032
Can someone explain the concept of sessions in ASP.NET? How do I use them, and how do cookies fit in?
2009/07/02
[ "https://Stackoverflow.com/questions/1076032", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Session is a per-user object for persisting state between HTTP requests. It is good for storing information that you will need on the server to properly serve requests back to the user (e.g. user name, email, etc.). ASP.NET places a cookie on the client's machine that contains a GUID (in the case of cookieless session...
A question like this makes me want to point you over to a post I did a while back ([Should I Use a Framework While Learning Web Development](https://stackoverflow.com/questions/1052080/should-i-use-a-framework-while-learning-web-development/1052127#1052127)) which will give you a heads up to other areas you might want ...
8,082,915
I have a repeating pattern in my code where a model has a related model (one-to-many) which tracks its history/status. This related model can have many objects representing a point-in-time snapshot of the model's state. For example: ``` class Profile(models.Model): pass class Subscription(models.Model): prof...
2011/11/10
[ "https://Stackoverflow.com/questions/8082915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/126617/" ]
Those relationship status changes aren't currently available via the Facebook API, thus the comments attached to them are not either. Having this available via the API has been requested hundreds of times, I don't know why they don't have it.
This info can be accessed. Relationship status updates can be seen with the following permissions: `user_relationships` and `read_stream`. To extract the exact story(and associated comments) however you'll have to parse through the result, and a relationship update looks like this: ``` { "id": "10000xxxxxxxxxx_2yyy...
9,383,151
Here's my situation: * I have on my server mysqld running. * telnet localhost 3306 gives access * telnet 127.0.0.1 3306 gives access * telnet my\_host\_name 3306 doesn't give access * telnet ip\_of\_my\_host\_name 3306 doesn't give access * I checked the port: 3306 is open. My Firewall doesn't block this port In the ...
2012/02/21
[ "https://Stackoverflow.com/questions/9383151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525406/" ]
Your problem seems to be something related to the binding address of the mysql daemon. You can have a look [here](https://serverfault.com/questions/139323/mysql-bind-to-more-than-one-ip-address) to get additional information about binding to several addresses (*localhost* and the *public IP* address).
Check <https://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_skip-networking>. Many distributions have this setting as default. In your my.cnf, look for: ``` skip-networking ``` and comment that line out.
9,383,151
Here's my situation: * I have on my server mysqld running. * telnet localhost 3306 gives access * telnet 127.0.0.1 3306 gives access * telnet my\_host\_name 3306 doesn't give access * telnet ip\_of\_my\_host\_name 3306 doesn't give access * I checked the port: 3306 is open. My Firewall doesn't block this port In the ...
2012/02/21
[ "https://Stackoverflow.com/questions/9383151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525406/" ]
Your problem seems to be something related to the binding address of the mysql daemon. You can have a look [here](https://serverfault.com/questions/139323/mysql-bind-to-more-than-one-ip-address) to get additional information about binding to several addresses (*localhost* and the *public IP* address).
If you just installed MySQL, remote access is disabled by default. If that's the case, you need to edit the configuration to allow it and restart mysqld. There are several instruction sets on how to do this, [such as this one](http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html).
9,383,151
Here's my situation: * I have on my server mysqld running. * telnet localhost 3306 gives access * telnet 127.0.0.1 3306 gives access * telnet my\_host\_name 3306 doesn't give access * telnet ip\_of\_my\_host\_name 3306 doesn't give access * I checked the port: 3306 is open. My Firewall doesn't block this port In the ...
2012/02/21
[ "https://Stackoverflow.com/questions/9383151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/525406/" ]
Your problem seems to be something related to the binding address of the mysql daemon. You can have a look [here](https://serverfault.com/questions/139323/mysql-bind-to-more-than-one-ip-address) to get additional information about binding to several addresses (*localhost* and the *public IP* address).
Since you can connect to localhost, we know that you have the bind-address setting configured. Look in your my.cnf (or my.ini) file for the following line: ``` bind-address = 127.0.0.1 ``` The above line lets you connect ONLY to the local address. MySQL binds itself to the loopback IP, and nothing else. To be able...
49,291,716
I'm going crazy being unable to align some elements to the centre of a Bootstrap row. The only thing that seems to work is positioning some elements as absolute relative to the row, but I would like to avoid this as it would be an issue adjusting the horizontal gaps between objects when it comes to responsiveness. Cou...
2018/03/15
[ "https://Stackoverflow.com/questions/49291716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6612655/" ]
You can call goToSlide() on your click event- ``` class MyPage { @ViewChild(Slides) slides: Slides; goToSlide() { this.slides.slideTo(2, 500); } } ```
I would say that there are 2 options 1. simply you need make another array when user selects one. and just use the array in template. 2. when user selects one, save the index number. and add condition in ngFor like below : I hope this would be helpfule ``` <ion-slide *ngFor="let img of images.imageUrl | slice:index...
49,291,716
I'm going crazy being unable to align some elements to the centre of a Bootstrap row. The only thing that seems to work is positioning some elements as absolute relative to the row, but I would like to avoid this as it would be an issue adjusting the horizontal gaps between objects when it comes to responsiveness. Cou...
2018/03/15
[ "https://Stackoverflow.com/questions/49291716", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6612655/" ]
You can call goToSlide() on your click event- ``` class MyPage { @ViewChild(Slides) slides: Slides; goToSlide() { this.slides.slideTo(2, 500); } } ```
> > Need to start loop \*ngFor from given array index > > > ``` <ion-slides zoom="true"> <ion-slide *ngFor="let img of images.imageUrl | slice:index "> <div class="swiper-zoom-container"> <img style="max-width: 95%;" [src]="img.url" (click)="downloadicon()"/> </div> ...
45,292,361
I have a table like this: 01-Jul-17      100 02-Jul-17      100 03-Jul-17      300 04-Jul-17      300 05-Jul-17      500 06-Jul-17      500 07-Jul-17      300 08-Jul-17      400 09-Jul-17      100 10-Jul-17      100 What I want to output is (in this order) by eliminating the continuous du...
2017/07/25
[ "https://Stackoverflow.com/questions/45292361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6074577/" ]
Since clockpicker's author didn't expose mindate interface, i can only write the script below by myself. But min datetime won't reflect in the UI( can still select time past 10AM from second clockpicker, but the value won't change). And the question which we can select datetimepicker2 first has not yet been considered....
Try this: ``` $("#datetimepicker1").on("dp.change", function (e) { $('#datetimepicker2').data("DateTimePicker").minDate(e.date); }); $("#datetimepicker2").on("dp.change", function (e) { $('#datetimepicker1').data("DateTimePicker").maxDate(e.date); }); ```
377,512
I'm attempting to plot geodesics in curved spacetime (e.g. the Schwarzschild metric) starting from the Lagrangian $$ L = \frac{1}{2} g\_{\alpha \beta} \dot{x}^\alpha \dot{x}^\beta $$ using the Euler Lagrange equations: $$ \frac{\partial L}{\partial x^\alpha} = \frac{d}{d \lambda} \frac{\partial L}{\partial \dot{x}^\a...
2018/01/02
[ "https://physics.stackexchange.com/questions/377512", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/112817/" ]
The Lagrangian does not depend explicitly on the "time" parameter you use to define $\dot{x}$. So, the Hamiltonian function is conserved along the solutions of the E.L. equation. In this case, the Hamiltonian function coincides with the Lagrangian one which, in turn, is the Lorenzian squared norm of the tangent vector....
I am not sure to have understood what you asked... But the geodesics equation is only one, given the levi-Civita connection. It changes just a bit if you do not use *proper time* (or an affine parameter) by which you have that $\dot{x}^{\mu}$ is the four velocity s.t. $(\dot{x},\dot{x})=1$ (signature $(+,-,-,-)$). Here...
59,402,498
I am not sure if it makes sense but will it be possible to add a line break between the start of the plot and the X-axis. For e.g. ``` { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "width": {"step": 10}, "height": 120, "data": {"url": "data/cars.json"}, "mark": "area", "encoding": { ...
2019/12/19
[ "https://Stackoverflow.com/questions/59402498", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639536/" ]
One way to do this is by adding a `scale.domain` argument: ``` { "$schema": "https://vega.github.io/schema/vega-lite/v4.json", "width": {"step": 10}, "height": 120, "data": {"url": "data/cars.json"}, "mark": "area", "encoding": { "x": {"field": "Name", "type": "nominal", "scale": {"round": false}}, ...
Another way to do something similar, adding it as another answer to make it convenient for others. `offset` property of [axis](https://vega.github.io/vega-lite/docs/axis.html) shifts the axis line by fixed pixels, independent of the data. Using `offset` adds a gap between the `x` and `y` axis lines though. ``` { "$...
2,111
[This chart](http://research.stlouisfed.org/fred2/series/EXCRESNS) at the St. Louis Fed has a lot of people worried about future inflation, because it represents idle money that, when lent out, could eventually flood the world with 10 - 12 trillion new dollars. But my father says that it has already been lent out in th...
2010/06/20
[ "https://money.stackexchange.com/questions/2111", "https://money.stackexchange.com", "https://money.stackexchange.com/users/723/" ]
Two kinds of lending going on. The first occurs when the Federal Reserve purchases government securities. This creates reserves at the Federal Reserve in another bank. The second kind of lending comes when this bank lends out the money. This is the multiplier effect. The reason for the excess reserves now is that ba...
Many terms a'blending here. "Reserves" in yankee are merely deposits at the Fed by lending institutions, from bankers to brokers. "Treasuries" are loans borrowed by the US gov't itself, not its monetary authority, the Federal Reserve. The Fed borrows with the cash (zero coupon perpetuities) or "reserves" (deposits) (...
39,882,793
I am studying about coding and I got a question to control airplane mode in iphone programmatically For android phone, we can use usb connection and adb to send unix command to control airplane mode. Is there any possibility to control airplane mode by unix command and lighting cable connection? I was checking [io...
2016/10/05
[ "https://Stackoverflow.com/questions/39882793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/807779/" ]
No, you just can't do that. An app has to adopt to the current network state, not control it.
You would need to access the private API and this would mean, you can't upload the app to the `App Store` because it is not allowed to use the private API in productive mode.
33,505,144
I've got small problem in understanding "in" operator in JavaScript. Why can't I go to the `if` block in example below? How do I do it? ``` var ar = []; var a = 4; ar.push(a); if (a in ar){ console.log("in if"); } console.log(ar); console.log(a); console.log(typeof(ar[0])); console.log(typeof(a)); ```
2015/11/03
[ "https://Stackoverflow.com/questions/33505144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3281720/" ]
The `in` operator tests whether the given property name exists in an object, it doesn't search the values. `a in ar` will be true if `ar[a]` exists. In your example, `ar[0]` exists, but `ar[4]` doesn't, so `a in ar` is false. To search values in an array, use the `indexOf` function. It returns the array index of the f...
That's because the `in` operator is looking for property names, not property values. It works fine for arrays, but you need to specify the index of the item, not the value: ```js var ar = []; var index = 4; var value = 5; ar[index] = value; if (index in ar){ console.log("in if"); } ```
33,505,144
I've got small problem in understanding "in" operator in JavaScript. Why can't I go to the `if` block in example below? How do I do it? ``` var ar = []; var a = 4; ar.push(a); if (a in ar){ console.log("in if"); } console.log(ar); console.log(a); console.log(typeof(ar[0])); console.log(typeof(a)); ```
2015/11/03
[ "https://Stackoverflow.com/questions/33505144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3281720/" ]
The `in` operator tests whether the given property name exists in an object, it doesn't search the values. `a in ar` will be true if `ar[a]` exists. In your example, `ar[0]` exists, but `ar[4]` doesn't, so `a in ar` is false. To search values in an array, use the `indexOf` function. It returns the array index of the f...
If you are using in with Array you should use index/key and not the value. Below will have the if condition true. Ex: ``` var ar = []; var a = 4; ar.push(a); if(0 in ar){ console.log("in if"); } ``` You can use property name when working with object. Ex: ``` var student = {name: "John", lastName: "Cena", age: ...
33,505,144
I've got small problem in understanding "in" operator in JavaScript. Why can't I go to the `if` block in example below? How do I do it? ``` var ar = []; var a = 4; ar.push(a); if (a in ar){ console.log("in if"); } console.log(ar); console.log(a); console.log(typeof(ar[0])); console.log(typeof(a)); ```
2015/11/03
[ "https://Stackoverflow.com/questions/33505144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3281720/" ]
The `in` operator tests whether the given property name exists in an object, it doesn't search the values. `a in ar` will be true if `ar[a]` exists. In your example, `ar[0]` exists, but `ar[4]` doesn't, so `a in ar` is false. To search values in an array, use the `indexOf` function. It returns the array index of the f...
Imagine an object and an array that looks like this: ``` var obj = { foo: "bar" }; var arr = ["bar"]; ``` You would access the `obj`'s `bar` value by invoking the corresponding key on that object, i.e. ``` obj.foo // "bar" ``` An alternative way of doing this would be to use the array syntax: ``` obj["foo"] // "...
62,778
![enter image description here](https://i.stack.imgur.com/LZGDa.jpg)Can any one help me out. I have an assignment rule on case object in sandbox as well as in production.Now we have added two rule entries to the same rule based on the profile user in sandbox .Now can i move this rule into production Using change sets.A...
2015/01/08
[ "https://salesforce.stackexchange.com/questions/62778", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/10926/" ]
**In JavaScript Function:** ``` document.getElementById("oImg").src='{!URLFOR($Resource.YOUR_RESOURCE_NAME)}'; ``` --- **VF CODE** ``` <div id="imgid"> <img src="" id="oImg"/> </div> ```
You can try this: ``` <apex:form> <apex:inputCheckbox onclick="showImage()" /> <script> function showImage() { document.getElementById('shw').innerHTML = '<img src="{!Resource.ImageName}" />'; } </script> <div id="shw"> </div> </apex:form> ```
52,916,797
I'm in the feasibility stage of a project and wanted to know whether the following was doable using `Machine Vision`: If I wanted to see if two files were **identical**, I would use a hashing function of sorts (e.g. `sha1` or `md5`) on the files and store the results in a database. However, if I have two images wher...
2018/10/21
[ "https://Stackoverflow.com/questions/52916797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925574/" ]
If your enumeration will never stop producing results, it would be better to require the developer to be explicit about what is the maximum amount to be generated, so that you remove the risk of an infinite loop when the developer uses a `for each` syntax with your enumerable. e.g. ``` IEnumerable<T> ProvideCopies<T>(...
Yes, I think it is bad practice indeed. Thread will not be able to process any other code paths. And this can put lot of burden on the processor.
22,209,410
I have [this](http://dl.dropboxusercontent.com/s/kif6wdoq5txebcr/download?dl=1) file, and I have absolutely no idea what kind of file it is. When I open it in Notepad++ it reads as ``` ð X döS ``` **or** [![](https://i.stack.imgur.com/SDdon.png)](https://i.stack.imgur.com/SDdon.png) (source: [gyazo.c...
2014/03/05
[ "https://Stackoverflow.com/questions/22209410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3341554/" ]
you might want to try using netmq (<https://github.com/zeromq/netmq>), is a 100% C# port of zeromq and might be easier to use then calling pinvoke.
Is libzmq.dll next to your executable in the build output directory ? The clrzmq NuGet package includes a PowerShell install script to set the build action for the libzmq.dll so it is always copied to the output directory. If you added the NuGet package on the Mac then the PowerShell script will not be run. So you wil...
22,209,410
I have [this](http://dl.dropboxusercontent.com/s/kif6wdoq5txebcr/download?dl=1) file, and I have absolutely no idea what kind of file it is. When I open it in Notepad++ it reads as ``` ð X döS ``` **or** [![](https://i.stack.imgur.com/SDdon.png)](https://i.stack.imgur.com/SDdon.png) (source: [gyazo.c...
2014/03/05
[ "https://Stackoverflow.com/questions/22209410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3341554/" ]
if you're still looking for a solution... You can use clrzmq4 and add statically linked libzmq and libsodium as native libraries to your xamarin solution. Ensure you use the very latest version of clrzmq4,we just got it running today...
Is libzmq.dll next to your executable in the build output directory ? The clrzmq NuGet package includes a PowerShell install script to set the build action for the libzmq.dll so it is always copied to the output directory. If you added the NuGet package on the Mac then the PowerShell script will not be run. So you wil...
22,209,410
I have [this](http://dl.dropboxusercontent.com/s/kif6wdoq5txebcr/download?dl=1) file, and I have absolutely no idea what kind of file it is. When I open it in Notepad++ it reads as ``` ð X döS ``` **or** [![](https://i.stack.imgur.com/SDdon.png)](https://i.stack.imgur.com/SDdon.png) (source: [gyazo.c...
2014/03/05
[ "https://Stackoverflow.com/questions/22209410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3341554/" ]
you might want to try using netmq (<https://github.com/zeromq/netmq>), is a 100% C# port of zeromq and might be easier to use then calling pinvoke.
Have you created a dllmap in your config? ``` <configuration> <dllmap dll="libzmq.dll" target="/usr/local/Cellar/zeromq/4.0.4/lib/libzmq.dylib"/> </configuration> ```
22,209,410
I have [this](http://dl.dropboxusercontent.com/s/kif6wdoq5txebcr/download?dl=1) file, and I have absolutely no idea what kind of file it is. When I open it in Notepad++ it reads as ``` ð X döS ``` **or** [![](https://i.stack.imgur.com/SDdon.png)](https://i.stack.imgur.com/SDdon.png) (source: [gyazo.c...
2014/03/05
[ "https://Stackoverflow.com/questions/22209410", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3341554/" ]
if you're still looking for a solution... You can use clrzmq4 and add statically linked libzmq and libsodium as native libraries to your xamarin solution. Ensure you use the very latest version of clrzmq4,we just got it running today...
Have you created a dllmap in your config? ``` <configuration> <dllmap dll="libzmq.dll" target="/usr/local/Cellar/zeromq/4.0.4/lib/libzmq.dylib"/> </configuration> ```
15,016,531
As part of my android application development study, I developed a simple SOS application by accessing LED Flash light. Every thing working fine and LED blinking at the interval of 1/2 seconds. But When user press the back button in phone, the application get quit and after 1/2 second a "Crash/Force Close" message comi...
2013/02/22
[ "https://Stackoverflow.com/questions/15016531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1070609/" ]
May be because u didn't cancel your timer.. Try this ``` @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(event.getAction() == KeyEvent.ACTION_DOWN) { if( keyCode == KeyEvent.KEYCODE_BACK ) { mTimer.cancel(); } ...
Call `purge();` method after calling `cancel();` . Why? When calling the cancel method, the timer just stops working. But it didn't close. We have to close it manually before the application closes like calling `db.close();` in sqlite. Try this. I think this is only for Timer. I don't know about TimerTask. ``` mTimer....
25,650,627
I have a search page where the user should be able to search authors based on their id (GORM generated id, not a property in my domain class) or their name. The search page works fine when I search on the author’s name but when trying to search on their id, I get the error below. Message: ``` java.lang.String cannot...
2014/09/03
[ "https://Stackoverflow.com/questions/25650627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2597565/" ]
Replace this: ``` eq("id", "%${params.id}%") ``` with ``` eq("id", params.long('id')) ``` `params.long('id')` tries to safely convert the parameter to a `Long`, i.e. it will return `null` if the conversion cannot be performed rather than throwing an exception.
The exception you get is quite informative. You're trying to pass `java.lang.String` in place where `java.lang.Long` is required. Pass `params.id` without converting it to string: ``` eq("id", params.id) // if params.id is java.lang.Long // or eq("id", params.id.toLong()) // if params.id is java.lang.String ``` You'...
23,787
It seems to be a well-established fact that sharkskin was used as sandpaper. This includes the use of the skin of rays and dog sharks. My question is: * A. how far back does this practice go? * B. were any other fish types outside of the shark family ever used for this?
2015/08/03
[ "https://history.stackexchange.com/questions/23787", "https://history.stackexchange.com", "https://history.stackexchange.com/users/8756/" ]
A) The earliest documentation I've found regarding the use of sharkskin as sandpaper goes back to [the British Empire in the mid 18th century](https://anthonyhaycabinetmaker.wordpress.com/2012/02/26/yes-virginia-there-really-is-sandpaper-in-1775/). Sharkskin was [apparently only used to finish very fine work](http://ww...
One thing I should clear up up-front: While sometimes classified together, Sharks (and the related Rays) **are not** really fish. They in fact are less related to fish than we humans are. For instance, they don't have bones like we and fish do. There are numerous other physical differences too, but more importantly for...
23,787
It seems to be a well-established fact that sharkskin was used as sandpaper. This includes the use of the skin of rays and dog sharks. My question is: * A. how far back does this practice go? * B. were any other fish types outside of the shark family ever used for this?
2015/08/03
[ "https://history.stackexchange.com/questions/23787", "https://history.stackexchange.com", "https://history.stackexchange.com/users/8756/" ]
A) The earliest documentation I've found regarding the use of sharkskin as sandpaper goes back to [the British Empire in the mid 18th century](https://anthonyhaycabinetmaker.wordpress.com/2012/02/26/yes-virginia-there-really-is-sandpaper-in-1775/). Sharkskin was [apparently only used to finish very fine work](http://ww...
The practice goes back at least to the early centuries of the common era, since the [Mishna](https://en.wikipedia.org/wiki/Mishnah) ([Kelim 16:1](http://learn.conservativeyeshiva.org/kelim-16-1-htm/)) mentions "rubbing with fish skin" as the typical way of finishing wooden utensils. Doesn't say anything about whether i...
71,890,220
``` # Get the content type of a URL def get_url_type(url: str) -> str: r = urlopen(url) header = r.headers return header.get_content_type() ``` Would the following only fetch the headers or would it fetch the whole document? I'm using this to check if it is or not an html page, to avoid downloading (big) files...
2022/04/16
[ "https://Stackoverflow.com/questions/71890220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/661424/" ]
It appears that only the headers and a bit of the body is retrieved in the `urlopen()` call, and the rest is gotten upon the `read()`. In testing this with something like wireshark, you can see that even if you call `urllib.urlopen('VeryLargeFile')` you still only receive headers and a few packets of body initially. ...
I've check out urllib source code, it's lazily evaluated. <https://github.com/python/cpython/blob/1169b0b3ca1812b97382ee16a2fad4b0e7506eaf/Lib/http/client.py#L311> Firstly it will only read header. And it will only read body when you call `read` in the response object
71,890,220
``` # Get the content type of a URL def get_url_type(url: str) -> str: r = urlopen(url) header = r.headers return header.get_content_type() ``` Would the following only fetch the headers or would it fetch the whole document? I'm using this to check if it is or not an html page, to avoid downloading (big) files...
2022/04/16
[ "https://Stackoverflow.com/questions/71890220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/661424/" ]
It appears that only the headers and a bit of the body is retrieved in the `urlopen()` call, and the rest is gotten upon the `read()`. In testing this with something like wireshark, you can see that even if you call `urllib.urlopen('VeryLargeFile')` you still only receive headers and a few packets of body initially. ...
``` import requests url = 'http://www.google.com' %timeit -n 25 requests.head(url).headers %timeit -n 25 requests.request('HEAD', url).headers %timeit -n 25 requests.get(url).headers ``` Output: ``` 185 ms ± 13.4 ms per loop (mean ± std. dev. of 7 runs, 25 loops each) 171 ms ± 18.6 ms per loop (mean ± std. dev. of ...
23,691,965
I am trying to some some urls throught javascript where some replacement of urls needs to be done. I have a textarea with some URLs example given below: ``` http://mywebsite.com/preview.aspx?mode=desktop&url=http://mywebsite.com/post.aspx?id=44&content=1 http://mywebsite.com/preview.aspx?mode=desktop&url=http://mywebs...
2014/05/16
[ "https://Stackoverflow.com/questions/23691965", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3643194/" ]
I believe that your biggest issue is that your regex syntax is incorrect. Try this: Imagine that `var s` is equal the the value of your textarea. ``` s.replace(/http\:\/\/mywebsite\.com\/preview.aspx\?mode\=desktop\&url\=/g, ''); ``` The issue you were having was improper delimiters and unescaped reserved symbols. ...
try this. ``` var string = document.getElementById('textareaidhere'); string.replace(/http:\/\/mywebsite\.com\/preview\.aspxmode=desktop&url=/g, ''); ``` [JSFiddle here](http://jsfiddle.net/J8nEc/)
13,607,128
I have a list of ID's, comma separated stored as string. 123,456,789 I was previously using something like this to pull data for each row in the database where each ID was present: ``` SELECT id, name FROM line_item WHERE id IN (123,456,789) ``` However, I want to only determine the ID's where they do not exist in...
2012/11/28
[ "https://Stackoverflow.com/questions/13607128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/410991/" ]
You can create additional table populated with desired `id` values, and use query with LEFT JOIN and WHERE clauses - ``` CREATE TABLE temp_table(id INT); INSERT INTO temp_table VALUES(123),(456),(789); SELECT t1.id FROM temp_table t1 LEFT JOIN line_item t2 ON t1.id = t2.id WHERE t2.id IS NULL; ``` Another var...
`NOT IN` will take the values in the parentheses and cause the query to, as you said, give you all other ids. I do not know if there is a way to do this with several numbers simultaneously - but this is how you could do it with one: ``` SELECT id, name, description FROM line_item WHERE 1 NOT IN (SELECT id FROM line_i...
13,607,128
I have a list of ID's, comma separated stored as string. 123,456,789 I was previously using something like this to pull data for each row in the database where each ID was present: ``` SELECT id, name FROM line_item WHERE id IN (123,456,789) ``` However, I want to only determine the ID's where they do not exist in...
2012/11/28
[ "https://Stackoverflow.com/questions/13607128", "https://Stackoverflow.com", "https://Stackoverflow.com/users/410991/" ]
You can create additional table populated with desired `id` values, and use query with LEFT JOIN and WHERE clauses - ``` CREATE TABLE temp_table(id INT); INSERT INTO temp_table VALUES(123),(456),(789); SELECT t1.id FROM temp_table t1 LEFT JOIN line_item t2 ON t1.id = t2.id WHERE t2.id IS NULL; ``` Another var...
On Postgresql you can use the `generate_series(i,j)` function. For example to find the non-existent integers in the `id` column you can write: ``` select i from generate_series( (select min(id) from line_item),(select max(id) from line_item) ) as i where i not in (select id from line_item); ``` If you want to ...
45,264,494
I have C++11 app, that uses multiple threads. Each thread can read or write database, eg. doing `INSERT, UPDATE, DELETE, SELECT`. I have enabled serialized mode for SQLite, so connection can be shared between threads. However, I dont know, how to run queries. Can I just run single query and create statement via `sqli...
2017/07/23
[ "https://Stackoverflow.com/questions/45264494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1130231/" ]
With the: ``` class MyClass { private: MyClass(); }; ``` You are deleting a default constructor. If you want to call a default constructor then (declare or) define or don't define one but don't delete it. Your derived class default constructor will call the base class default constructor: ``` #include <string>...
``` class ICommand { private: ICommand() = default; public: const std::string name; ICommand(const std::string& name) : name(name) { } virtual ~ICommand() = default; virtual void callMe() = 0; virtual void callMe2() = 0; }; ```
58,729,913
I'm attempting to allocate space for 100 doubles, check if the allocation was successful, and then deallocate the space. After that I'd like to use the original allocated space to write 100 random numbers to it and then sort them using `qsort`. Here's the code I have to far ``` #include <stdio.h> #include <stdlib.h> ...
2019/11/06
[ "https://Stackoverflow.com/questions/58729913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12278933/" ]
This looks more like a bug in the latest DB Navigator plugin version than a project configuration issue. It has nothing to do with a specific project, as I initially thought, because I get the same annoying messages for any project. I've tried recreating the project, removing any reference to db navigator from project'...
If you install the "Database Navigator" plugin, disable it.
58,729,913
I'm attempting to allocate space for 100 doubles, check if the allocation was successful, and then deallocate the space. After that I'd like to use the original allocated space to write 100 random numbers to it and then sort them using `qsort`. Here's the code I have to far ``` #include <stdio.h> #include <stdlib.h> ...
2019/11/06
[ "https://Stackoverflow.com/questions/58729913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12278933/" ]
You can upgrade Database Navigator version to v3.2.0564.0
If you install the "Database Navigator" plugin, disable it.
58,729,913
I'm attempting to allocate space for 100 doubles, check if the allocation was successful, and then deallocate the space. After that I'd like to use the original allocated space to write 100 random numbers to it and then sort them using `qsort`. Here's the code I have to far ``` #include <stdio.h> #include <stdlib.h> ...
2019/11/06
[ "https://Stackoverflow.com/questions/58729913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12278933/" ]
I've logged this as a bug at: <https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006619499-DB-Navigator-Following-file-associations-have-been-restored-ext-They-are-registered-as-DDL-file-types-in-project-Project-Name->
If you install the "Database Navigator" plugin, disable it.
58,729,913
I'm attempting to allocate space for 100 doubles, check if the allocation was successful, and then deallocate the space. After that I'd like to use the original allocated space to write 100 random numbers to it and then sort them using `qsort`. Here's the code I have to far ``` #include <stdio.h> #include <stdlib.h> ...
2019/11/06
[ "https://Stackoverflow.com/questions/58729913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12278933/" ]
This looks more like a bug in the latest DB Navigator plugin version than a project configuration issue. It has nothing to do with a specific project, as I initially thought, because I get the same annoying messages for any project. I've tried recreating the project, removing any reference to db navigator from project'...
I've logged this as a bug at: <https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006619499-DB-Navigator-Following-file-associations-have-been-restored-ext-They-are-registered-as-DDL-file-types-in-project-Project-Name->
58,729,913
I'm attempting to allocate space for 100 doubles, check if the allocation was successful, and then deallocate the space. After that I'd like to use the original allocated space to write 100 random numbers to it and then sort them using `qsort`. Here's the code I have to far ``` #include <stdio.h> #include <stdlib.h> ...
2019/11/06
[ "https://Stackoverflow.com/questions/58729913", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12278933/" ]
You can upgrade Database Navigator version to v3.2.0564.0
I've logged this as a bug at: <https://intellij-support.jetbrains.com/hc/en-us/community/posts/360006619499-DB-Navigator-Following-file-associations-have-been-restored-ext-They-are-registered-as-DDL-file-types-in-project-Project-Name->
18,624,839
I'm working on an internal application which has to create a task in AutoTask via SOAP API. The application is written in Python and we use suds for SOAP communication and the code something like this: ``` url = AUTOTASK_API_URL t = HttpAuthenticated(username=AUTOTASK_API_USERNAME, password=AUTOTASK_API_PASSWORD) clie...
2013/09/04
[ "https://Stackoverflow.com/questions/18624839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2647167/" ]
The best choice here would be to redesign/restructure your code to handle asynchronous loading of Sizzle and return your result via a callback function. This is how javascript is designed. It does NOT have a "good" way of loading remote resources synchronously. The only way I know of to load a remote resource like a J...
why aren't you just including sizzle as an on-page script requirement. Just stick ``` <script src="sizzle.js"></script> ``` somewhere in the head and it'll get loaded before your other script runs. To do this dynamically, just append the script to the head. <http://jsfiddle.net/nQePg> has a demonstrator that shows y...
18,624,839
I'm working on an internal application which has to create a task in AutoTask via SOAP API. The application is written in Python and we use suds for SOAP communication and the code something like this: ``` url = AUTOTASK_API_URL t = HttpAuthenticated(username=AUTOTASK_API_USERNAME, password=AUTOTASK_API_PASSWORD) clie...
2013/09/04
[ "https://Stackoverflow.com/questions/18624839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2647167/" ]
It's a bit slow, but I think I found a solution: ``` webdriver.By.sizzle = function(selector) { driver.executeScript("return typeof Sizzle==='undefined'").then(function(noSizzle) { if(noSizzle) driver.executeScript(fs.readFileSync('sizzle.min.js', {encoding: 'utf8'})); }); return new webdriver.By.j...
why aren't you just including sizzle as an on-page script requirement. Just stick ``` <script src="sizzle.js"></script> ``` somewhere in the head and it'll get loaded before your other script runs. To do this dynamically, just append the script to the head. <http://jsfiddle.net/nQePg> has a demonstrator that shows y...
18,624,839
I'm working on an internal application which has to create a task in AutoTask via SOAP API. The application is written in Python and we use suds for SOAP communication and the code something like this: ``` url = AUTOTASK_API_URL t = HttpAuthenticated(username=AUTOTASK_API_USERNAME, password=AUTOTASK_API_PASSWORD) clie...
2013/09/04
[ "https://Stackoverflow.com/questions/18624839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2647167/" ]
The best choice here would be to redesign/restructure your code to handle asynchronous loading of Sizzle and return your result via a callback function. This is how javascript is designed. It does NOT have a "good" way of loading remote resources synchronously. The only way I know of to load a remote resource like a J...
It's a bit slow, but I think I found a solution: ``` webdriver.By.sizzle = function(selector) { driver.executeScript("return typeof Sizzle==='undefined'").then(function(noSizzle) { if(noSizzle) driver.executeScript(fs.readFileSync('sizzle.min.js', {encoding: 'utf8'})); }); return new webdriver.By.j...
29,504,337
When customer submits email via contact form 7, how do I check if email already exists in my database and change notification message to "Your email already exists in our database" So far I have tried using before\_send hook, but when I click submit, the page just hangs and no confirmation message. Below is the funct...
2015/04/08
[ "https://Stackoverflow.com/questions/29504337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3590820/" ]
I've added a filter on validation: ``` add_filter( 'wpcf7_validate', 'email_already_in_db', 10, 2 ); function email_already_in_db ( $result, $tags ) { // retrieve the posted email $form = WPCF7_Submission::get_instance(); $email = $form->get_posted_data('your-email'); // if already in database, inval...
Here is a solution that is working for me with the plugin [Advanced Contact form 7 DB](https://wordpress.org/plugins/advanced-cf7-db/) ```php function email_already_in_db ( $result, $tags ) { // Retrieve the posted form $form = WPCF7_Submission::get_instance(); $form_posted_data = $form->get_posted_data()...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
You really do need to define what you mean by faith. People mean vastly different things when they talk about this topic all the time, and any refusal to pin down what they specifically mean is usually just an attempt at leaving wiggle room to avoid confronting hard truths or even move goal posts. Here is my best take...
I think there is a continuum of trustworthiness for knowledge. I've heard the term "faith," as used by Christians, fall in many places along this continuum. At one extreme you have faith meaning a rigid belief that is supported mostly on the basis of authority. "The Bible says ... ." On the other extreme you have faith...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
As religions themselves mature, we may be reaching a point where one can reasonably manage their own faith, seeking between genuine options without being coerced. But we are not there yet. Historically we can see in every era that 'faiths' have been constructed by power structures and tuned for the advantages of certa...
Short answer: despising faith generally is a sign of emotional immaturity, and a blindness to the nature of ones own belief. A truth as old (at least) as Socrates is that wisdom is knowing you know virtually nothing. Faith (not specific to Christian, or even religious faith) is recognizing a lack of knowledge, and de...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
I will be writing this answer from the frank, blunt perspective of someone who is inclusive and accepting of all peoples and belief systems, but who tries to analyze my own personal pattern-matching. I would not say that faith is a sign of weakness, nor do I think it is seen as one. Rather, it implies the existence of...
I think there is a continuum of trustworthiness for knowledge. I've heard the term "faith," as used by Christians, fall in many places along this continuum. At one extreme you have faith meaning a rigid belief that is supported mostly on the basis of authority. "The Bible says ... ." On the other extreme you have faith...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
Short answer: despising faith generally is a sign of emotional immaturity, and a blindness to the nature of ones own belief. A truth as old (at least) as Socrates is that wisdom is knowing you know virtually nothing. Faith (not specific to Christian, or even religious faith) is recognizing a lack of knowledge, and de...
Don't hate me for being honest, i'm trying to answer the actual question. I'll confess, I would probably discount you after that revelation. Despise is too strong, but I would lose respect for you. Why? I was thinking about it, and I found a few concepts that might explain why. **Association** Faith and open-mindedne...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
Of course faith opens up an additional domain of consciousness with many creative and fantastic ideas like gods, incarnation, sacrifices, superhuman power etc. That's similar to creative ideas in art or literature. In addition, faith provides answers to several existential questions which otherwise had to be left wit...
Short answer: despising faith generally is a sign of emotional immaturity, and a blindness to the nature of ones own belief. A truth as old (at least) as Socrates is that wisdom is knowing you know virtually nothing. Faith (not specific to Christian, or even religious faith) is recognizing a lack of knowledge, and de...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
History may help us understand better... One reason is that the most powerful empire in recent memory, the British Empire, was explicitly Christian. When anti-imperial forces (think Ghandi) became more popular in the mid-20th Century, they reasonably associated being Christian with unjust authority. Also, since the 1...
(A little bit late in the game, but here's an additional perspective) It's not really about being Christian perse, that makes people assume that you are weak, but about being Christian in a Christian majority culture or location. Most religious people (I don't have the exact stats, but I'd wager it's above 99%) foll...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
I should know better than to jump into this fray. But I can't help myself since this is something I've wondered about myself. Here are the reasons I've collected over the years. Often times I don't remember where I first learned of these reasons, I'm going to leave this un-cited. 1. **How do you distinguish faith from...
As you said, there are deep unanswered mysteries and people people need some kind of an answer at the risk of losing their mind. While eventually everyone needs answers to maintain sanity. Some people have slightly greater tolerance for these unanswered questions than others. Some people seek the answer in science and ...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
There are already some excellent answers which cover most of what I want to say, but I can't resist jumping in as well... I'm going to refer to "me" as an (hopefully) relevant example of someone with the reaction you describe. When you say you consider faith an unexplored opportunity, that's certainly not enough to d...
I should know better than to jump into this fray. But I can't help myself since this is something I've wondered about myself. Here are the reasons I've collected over the years. Often times I don't remember where I first learned of these reasons, I'm going to leave this un-cited. 1. **How do you distinguish faith from...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
I think there is a continuum of trustworthiness for knowledge. I've heard the term "faith," as used by Christians, fall in many places along this continuum. At one extreme you have faith meaning a rigid belief that is supported mostly on the basis of authority. "The Bible says ... ." On the other extreme you have faith...
My previous answer has been tagged for deletion by someone. No surprises there (although it is based on formal study of religion and world political history in Sri Lanka as well as Canada - Quebec, and experiences/readings/discussions in the Middle East, USA, UK, Africa, Malaysia, Singapore, India, etc). **The point o...
50,288
Hope this is the right place to put this question! I am a person of faith (more specific, a Christian) and most of the time people consider me somehow **inferior** for my belief. I am not antisocial, not sick, nor crazy, but rather rational (even if apparently this is in contradiction with "faith"). I feel that many t...
2018/03/30
[ "https://philosophy.stackexchange.com/questions/50288", "https://philosophy.stackexchange.com", "https://philosophy.stackexchange.com/users/31446/" ]
I will say a number of things on this, all of them just my own opinion really, and unfortunately that's all anyone can really offer on this kind of question: * I don't think your interpretation of others' disdain can be necessarily interpreted as always meaning 'weakness' on your part. This is just your subjective pro...
If somebody thinks we live in a new age of reason, you need to check out the facts: 84% of the world’s population identifies with **Faith** in a religious group. > > According to 2015 figures, Christians form the biggest religious group by some margin, with 2.3 billion adherents or 31.2% of the total world populatio...
9,831,950
I am getting the strangest error, when trying to parse a string as a calendar. It seems that it messes up the Date object which I use to set the result calendar's time. The error is pretty inconsistent (or I see no logic in it). Can anyone point out what I might be doing wrong ? ``` public class caltest{ public static...
2012/03/22
[ "https://Stackoverflow.com/questions/9831950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1261560/" ]
You're using `YYYY` in your format specifier, which is *week year* (as of Java 7, I believe). You want `yyyy`, which is just "year". (See the [`SimpleDateFormat` documentation](http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html).) I suspect the rest of the date was out because you tried to also s...
Use this: ``` public static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); ``` It's lower case `y` for year, not upper case `Y`. With that, the result is: ``` Wed Mar 11 12:00:12 EST 1992 Thu Mar 11 12:00:12 EST 1993 Fri Mar 11 12:00:12 EST 1994 Sat Mar 11 12:00:12 EST 1995 ``` See ...
25,720,326
I am trying to connect multiple server connection in application/config/database.php file actually I am trying to master slave database in CodeIgniter here is my database.php ----------------------- ``` $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default']['usern...
2014/09/08
[ "https://Stackoverflow.com/questions/25720326", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3786343/" ]
Go in php.ini file. Check that the property mysql.default\_socket have valid directory. I think you can't make and single mysql connection. What is your OS?
Thanks, Following codes are helpfull for me <https://gist.github.com/fideloper/3137896>
11,261,294
I'm using a system which consists of many complex XSL transforms which each work on large XML files. A proprietary program compiles the XSLT on each of the XML files, before passing the XML files to our databases. The XSL transforms almost always involve C# functions within `<msxsl>` tags, many which are repeated betw...
2012/06/29
[ "https://Stackoverflow.com/questions/11261294", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1146721/" ]
**I. Here is how to do it**: > > File: C:\temp\delete\c#script.xsl > > > ``` <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:cs="urn:my-scripts-csharp"> <msxsl:script language="C#" implements-prefix="cs"> <![CDATA[ ...
You can reference code in external assemblies using : <http://msdn.microsoft.com/en-us/library/ms256188.aspx> - that could provide a way of moving your code to an external location
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
> > A year ago it were actually working fine, Does anyone have any idea, what's going wrong here inside my docker-compose file now. > > > Seems like you pulled the fresh image, where in the new image you should specify Postgres user password. You can look into Dockerhub, the image is **update** **one month ago** ...
@Adiii yes, you are nearly right, so I have to explicitly mentioned the environment also for the `postgres` image but with no `db` parent tag. So here, I am explicitly mentioning the `docker-compose.yaml` config to help others for better understanding, also now I am using recent stable `postgres` image version `12-alp...
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
> > A year ago it were actually working fine, Does anyone have any idea, what's going wrong here inside my docker-compose file now. > > > Seems like you pulled the fresh image, where in the new image you should specify Postgres user password. You can look into Dockerhub, the image is **update** **one month ago** ...
Adding on ArifMustafa's answer, This worked for me. ``` postgres: image: 'postgres:12-alpine' environment: POSTGRES_PASSWORD: mypassword expose: - 5432 volumes: - postgres_data:/var/lib/postgres/data/ volumes: postgres_data: ```
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
> > A year ago it were actually working fine, Does anyone have any idea, what's going wrong here inside my docker-compose file now. > > > Seems like you pulled the fresh image, where in the new image you should specify Postgres user password. You can look into Dockerhub, the image is **update** **one month ago** ...
In my case there was an error about the POSTGRES\_PASSWORD (in docker-compose.yml) and the DATABASE settings for PASSWORD in the project\_level settings.py file. After providing a password in docker-compose.yml ``` db: # For the PostgreSQL database image: postgres:11 environment: - POSTGRES_PASSWORD...
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
> > A year ago it were actually working fine, Does anyone have any idea, what's going wrong here inside my docker-compose file now. > > > Seems like you pulled the fresh image, where in the new image you should specify Postgres user password. You can look into Dockerhub, the image is **update** **one month ago** ...
To resolve the error when using the command, ``` docker pull postgres ``` You must specify POSTGRES\_PASSWORD to a non-empty value for the superuser. For example, "-e POSTGRES\_PASSWORD=password" on "docker run". or POSTGRES\_HOST\_AUTH\_METHOD=trust use this which is not recommended. You may also use "POSTGRES\_HO...
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
@Adiii yes, you are nearly right, so I have to explicitly mentioned the environment also for the `postgres` image but with no `db` parent tag. So here, I am explicitly mentioning the `docker-compose.yaml` config to help others for better understanding, also now I am using recent stable `postgres` image version `12-alp...
Adding on ArifMustafa's answer, This worked for me. ``` postgres: image: 'postgres:12-alpine' environment: POSTGRES_PASSWORD: mypassword expose: - 5432 volumes: - postgres_data:/var/lib/postgres/data/ volumes: postgres_data: ```
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
@Adiii yes, you are nearly right, so I have to explicitly mentioned the environment also for the `postgres` image but with no `db` parent tag. So here, I am explicitly mentioning the `docker-compose.yaml` config to help others for better understanding, also now I am using recent stable `postgres` image version `12-alp...
To resolve the error when using the command, ``` docker pull postgres ``` You must specify POSTGRES\_PASSWORD to a non-empty value for the superuser. For example, "-e POSTGRES\_PASSWORD=password" on "docker run". or POSTGRES\_HOST\_AUTH\_METHOD=trust use this which is not recommended. You may also use "POSTGRES\_HO...
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
In my case there was an error about the POSTGRES\_PASSWORD (in docker-compose.yml) and the DATABASE settings for PASSWORD in the project\_level settings.py file. After providing a password in docker-compose.yml ``` db: # For the PostgreSQL database image: postgres:11 environment: - POSTGRES_PASSWORD...
Adding on ArifMustafa's answer, This worked for me. ``` postgres: image: 'postgres:12-alpine' environment: POSTGRES_PASSWORD: mypassword expose: - 5432 volumes: - postgres_data:/var/lib/postgres/data/ volumes: postgres_data: ```
63,262,620
I am trying to implement role based authorization on my rest apis. I have been able to successfully implement and run the project but there are some things that I am confused about. CustomeUserDetailsService.java: ``` @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { ...
2020/08/05
[ "https://Stackoverflow.com/questions/63262620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13249323/" ]
In my case there was an error about the POSTGRES\_PASSWORD (in docker-compose.yml) and the DATABASE settings for PASSWORD in the project\_level settings.py file. After providing a password in docker-compose.yml ``` db: # For the PostgreSQL database image: postgres:11 environment: - POSTGRES_PASSWORD...
To resolve the error when using the command, ``` docker pull postgres ``` You must specify POSTGRES\_PASSWORD to a non-empty value for the superuser. For example, "-e POSTGRES\_PASSWORD=password" on "docker run". or POSTGRES\_HOST\_AUTH\_METHOD=trust use this which is not recommended. You may also use "POSTGRES\_HO...
21,725,652
``` <?php $sub="test"; $msg="testing mail code"; $to1="a......k@gmail.com"; //my active gmail id..i can receive mail here with same code. $to2="xyz@abc.com";//i set this invalid id dont get mail with same code because id not existed. $to=$to1.','.$to2; if(mail($to, $sub, $msg)) { ...
2014/02/12
[ "https://Stackoverflow.com/questions/21725652", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3300358/" ]
You can use the command `ls -l | grep ^-` Here is full list options for `ls` command. ``` Option Description -a Displays all files. -b Displays nonprinting characters in octal. -c Displays files by file timestamp. -C Displays files in a columnar format (default) -d Displays only directories. -f Interprets each...
If you've `sed` binary in your Android device, then do: ``` ls -l | sed '/^d/ d' ``` It will delete all lines starting with `d` from the output of `ls -l` ([Source](https://stackoverflow.com/questions/8206280/delete-all-lines-beginning-with-a-from-a-file)). Why? Because all directories in the output starts with `d`...
60,290,124
I currently have a simple for-loop with 5 iterations that creates 'brick' game objects, adds them into the 'bricks' array and laying them out across the x axis of my javaFX scene. currently, as you can see on the Gameobj parameters; they are all blue. However, I want to have one of these bricks set as yellow on a rando...
2020/02/18
[ "https://Stackoverflow.com/questions/60290124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10810332/" ]
Pick a random number in the range `[0, 5)` before the loop, and then set the color to yellow if the loop index matches that number: ``` Random random = new Random(); int yellowBrick = random.nextInt(5); for (int i = 0; i < 5; i++) { Color color = i == yellowBrick ? Color.YELLOW : Color.BLUE; GameObj brick = ne...
You can call `GameObj brick = new GameObj(i*100, 100, BRICK_WIDTH, BRICK_HEIGHT, Color.BLUE);`. For example: You can call `int random = ThreadLocalRandom.current().nextInt(0, 5)` outside the for-loop. And then use this inside the for-loop: ``` if (random != i) { GameObj brick = new GameObj(i*100, 100, BRICK_WIDTH, ...
7,377,399
I'm trying create a text area in a div with the id of "body". I call the function with an onClick event, but when I click it, all that is created is *object HTMLTextAreaElement*. How can I get this to work? ``` function opentextarea() { var input = document.createElement('TEXTAREA'); input.setAttribute('name',...
2011/09/11
[ "https://Stackoverflow.com/questions/7377399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788661/" ]
``` var div = document.getElementById("yourDivElement"); var input = document.createElement("textarea"); var button = document.createElement("button"); input.name = "post"; input.maxLength = "5000"; input.cols = "80"; input.rows = "40"; div.appendChild(input); //appendChild div.appendChild(button); ``` If you don't n...
Try ``` document.getElementById("body").appendChild(input); document.getElementById("body").appendChild(button); ```
7,377,399
I'm trying create a text area in a div with the id of "body". I call the function with an onClick event, but when I click it, all that is created is *object HTMLTextAreaElement*. How can I get this to work? ``` function opentextarea() { var input = document.createElement('TEXTAREA'); input.setAttribute('name',...
2011/09/11
[ "https://Stackoverflow.com/questions/7377399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788661/" ]
You better assign the attributes directly, from what I remember IE got problems with `setAttribute`. The code can be changed to this in order to achieve what you want: ```js function opentextarea() { var input = document.createElement('textarea'); input.name = 'post'; input.maxLength = 5000; input....
Try ``` document.getElementById("body").appendChild(input); document.getElementById("body").appendChild(button); ```
7,377,399
I'm trying create a text area in a div with the id of "body". I call the function with an onClick event, but when I click it, all that is created is *object HTMLTextAreaElement*. How can I get this to work? ``` function opentextarea() { var input = document.createElement('TEXTAREA'); input.setAttribute('name',...
2011/09/11
[ "https://Stackoverflow.com/questions/7377399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/788661/" ]
``` var div = document.getElementById("yourDivElement"); var input = document.createElement("textarea"); var button = document.createElement("button"); input.name = "post"; input.maxLength = "5000"; input.cols = "80"; input.rows = "40"; div.appendChild(input); //appendChild div.appendChild(button); ``` If you don't n...
You better assign the attributes directly, from what I remember IE got problems with `setAttribute`. The code can be changed to this in order to achieve what you want: ```js function opentextarea() { var input = document.createElement('textarea'); input.name = 'post'; input.maxLength = 5000; input....
3,456,802
Here is my code: ``` #include <gtk/gtk.h> static int counter = 0; static PangoLayout* layout; static GdkGC* gc1; static GdkGC* gc2; //**/static GMutex* mu; static gboolean on_expose_event(GtkWidget* widget, GdkEventExpose* event) { gchar the_string[20]; //**/g_mutex_lock(mu); gdk_draw_rectangle(GDK_DRAW...
2010/08/11
[ "https://Stackoverflow.com/questions/3456802", "https://Stackoverflow.com", "https://Stackoverflow.com/users/417024/" ]
Most likely, you need to surround your gdk\_window\_invalidate\_rect() call with gdk\_threads\_enter()/gdk\_threads\_leave() pair. Read the [gdk threads](http://library.gnome.org/devel/gdk/stable/gdk-Threads.html) for more information about gtk and threads. Look at the example there.
You should use `g_timeout_add` with your callback and *NOT* use a second thread that is messing with the UI.
12,211,822
I have read the API and examples, but am unable to understand how to populate a tableview. Let us say I have a two column String array (String[][]) with "name, value"-pairs. I now simply want to create a tableview which shows the data in two columns, displaying the name in the first and value in the second column for ...
2012/08/31
[ "https://Stackoverflow.com/questions/12211822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/992687/" ]
Cell Value Factory ================== For each column in your table, you set/create a **Cell Value Factory**. Each row has a corresponding object in `tableview.getItems()`. To determine how this object is displayed across the columns, each column uses its own Cell Value Factory. The factories take in the object and re...
Yeah, it was simple you dummy. Create a Row-class: ``` Row(String fName, String fValue){ this.fieldName = new SimpleStringProperty(fName); this.fieldValue = new SimpleStringProperty(fValue); } ``` For each row in the String-array you create a row-object which you add to an observableList. ``` private Observ...
12,211,822
I have read the API and examples, but am unable to understand how to populate a tableview. Let us say I have a two column String array (String[][]) with "name, value"-pairs. I now simply want to create a tableview which shows the data in two columns, displaying the name in the first and value in the second column for ...
2012/08/31
[ "https://Stackoverflow.com/questions/12211822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/992687/" ]
Yeah, it was simple you dummy. Create a Row-class: ``` Row(String fName, String fValue){ this.fieldName = new SimpleStringProperty(fName); this.fieldValue = new SimpleStringProperty(fValue); } ``` For each row in the String-array you create a row-object which you add to an observableList. ``` private Observ...
You can also try this with map without knowing how many columns you'll add to the table! so you can use the map key as the tableview header ``` TableView<Map<String, String>> tableView = new TableView<>(); ArrayList<Map<String, String>> valuesArray = new ArrayList<>(); for(Object object : filter.getEntities()) { Ma...
12,211,822
I have read the API and examples, but am unable to understand how to populate a tableview. Let us say I have a two column String array (String[][]) with "name, value"-pairs. I now simply want to create a tableview which shows the data in two columns, displaying the name in the first and value in the second column for ...
2012/08/31
[ "https://Stackoverflow.com/questions/12211822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/992687/" ]
Cell Value Factory ================== For each column in your table, you set/create a **Cell Value Factory**. Each row has a corresponding object in `tableview.getItems()`. To determine how this object is displayed across the columns, each column uses its own Cell Value Factory. The factories take in the object and re...
You can also try this with map without knowing how many columns you'll add to the table! so you can use the map key as the tableview header ``` TableView<Map<String, String>> tableView = new TableView<>(); ArrayList<Map<String, String>> valuesArray = new ArrayList<>(); for(Object object : filter.getEntities()) { Ma...
153,539
I use FME a lot for manipulation of spatial data, and would like to leverage it's Python library, fmeobjects in PyQgis. If I run the following in my standard Python IDE it works fine: ``` import sys sys.path.append("C:\\Program Files (x86)\\fme\\fmeobjects\\python27") import fmeobjects ``` But the exact same code...
2015/07/07
[ "https://gis.stackexchange.com/questions/153539", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/30014/" ]
2016 update! Been trying to get this to work myself and thought I'd put what I've researched so far. This is done on Windows 10. For Linux users - try [this](https://knowledge.safe.com/questions/21273/run-fmeobjects-on-linux.html) if you're encountering problems. Warning: For those wanting to integrate FME 2016 into p...
In Windows QGIS has its own Python version. By default if you instal libraries (ex. `pip install name_of_library`) it will be installed only in your pure Python version not for QGIS. Here is a guide, I think it may be helpful: <http://quantumofgis.blogspot.be/2014/11/qgis-standalone-and-python-modules.html>
153,539
I use FME a lot for manipulation of spatial data, and would like to leverage it's Python library, fmeobjects in PyQgis. If I run the following in my standard Python IDE it works fine: ``` import sys sys.path.append("C:\\Program Files (x86)\\fme\\fmeobjects\\python27") import fmeobjects ``` But the exact same code...
2015/07/07
[ "https://gis.stackexchange.com/questions/153539", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/30014/" ]
2016 update! Been trying to get this to work myself and thought I'd put what I've researched so far. This is done on Windows 10. For Linux users - try [this](https://knowledge.safe.com/questions/21273/run-fmeobjects-on-linux.html) if you're encountering problems. Warning: For those wanting to integrate FME 2016 into p...
Try copying the fmeobjects.pyd to QGIS site. From: \fmeobjects\python27\fmeobjects.pyd To: \Lib\site-packages\fmeobjects.pyd
15,314,758
I'm getting the following error : > > cannot find symbol, symbol: variable values, locations variable planet of type Map< String,Double > > > > on this line `Double[] Total = new Double [planet.values];` Here is my code : ``` public static void main(String[] args) { Map<String, Double> planet = new HashMa...
2013/03/09
[ "https://Stackoverflow.com/questions/15314758", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2152229/" ]
Map doesn't have any public field named `value`. So `planet.value` is invalid. If you want to initialize an array which has a length equal to the size of the map, use `size()`: ``` Double[] total = new Double[planet.size()]; ``` Also, please respect tha Java naming conventions. Variables start with a lowercase lette...
Just change it to `planet.values()` instead of 'planet.values', you are trying to access the field not calling the method. So this will be your code: ``` Collection<Double> values = planet.values(); Double[] total = values.toArray(new Double[values.size()]); ``` By the way, an array's `toString()` method does not r...
29,218,481
I was told to add a tag being generated in Joomla. I just need to add the onload=... between the body tags. Is there a way to add the onload=... by itself or must it be part of the tag? Thanks!
2015/03/23
[ "https://Stackoverflow.com/questions/29218481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183528/" ]
The team is working on a port of Angular Material for 2.0, and you can find the source code [here](https://github.com/angular/angular/tree/master/modules/angular2_material). I created a quick demo showing how to use it together with Angular 2: ``` import {Component, View, bootstrap} from 'angular2/angular2'; import ...
Current version of angular-material will not work with angular 2.0, but i am sure there will be new branch(or version) which will be compatible with angualar 2.0.
29,218,481
I was told to add a tag being generated in Joomla. I just need to add the onload=... between the body tags. Is there a way to add the onload=... by itself or must it be part of the tag? Thanks!
2015/03/23
[ "https://Stackoverflow.com/questions/29218481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183528/" ]
Current version of angular-material will not work with angular 2.0, but i am sure there will be new branch(or version) which will be compatible with angualar 2.0.
I know this question is old, but I did discover today they have a link in the angular/material README that points to a repository they created specifically for the angular2 target of angular/material: <https://github.com/angular/material2> It's still in alpha0. As a suggestion, perhaps it might help to use something ...
29,218,481
I was told to add a tag being generated in Joomla. I just need to add the onload=... between the body tags. Is there a way to add the onload=... by itself or must it be part of the tag? Thanks!
2015/03/23
[ "https://Stackoverflow.com/questions/29218481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183528/" ]
The team is working on a port of Angular Material for 2.0, and you can find the source code [here](https://github.com/angular/angular/tree/master/modules/angular2_material). I created a quick demo showing how to use it together with Angular 2: ``` import {Component, View, bootstrap} from 'angular2/angular2'; import ...
I know this question is old, but I did discover today they have a link in the angular/material README that points to a repository they created specifically for the angular2 target of angular/material: <https://github.com/angular/material2> It's still in alpha0. As a suggestion, perhaps it might help to use something ...
71,829,399
1. This is my pojo class. ``` public class Payload { private Clob paylaod; public Clob getPaylaod() { return paylaod; } public void setPaylaod(Clob paylaod) { this.paylaod = paylaod; } } ``` 2. This is my entity class. ``` @Entity @Table(name ="ORDER") @Data @Getter @Setter @AllArgsConstructor @NoArgsCo...
2022/04/11
[ "https://Stackoverflow.com/questions/71829399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7505643/" ]
You're running a native query and not a JPA query and that's why the return type of getDetailsById(String requestId) is Object[] and not Clob or Model. Let's say your entity has 4 columns then object[0] will return the first column, object[1] will return the second column, and so on. I'd suggest not to take away good ...
I think the return type of your method getDetailsById() is Payload instead of Clob, change that and try to run. that might work.
71,829,399
1. This is my pojo class. ``` public class Payload { private Clob paylaod; public Clob getPaylaod() { return paylaod; } public void setPaylaod(Clob paylaod) { this.paylaod = paylaod; } } ``` 2. This is my entity class. ``` @Entity @Table(name ="ORDER") @Data @Getter @Setter @AllArgsConstructor @NoArgsCo...
2022/04/11
[ "https://Stackoverflow.com/questions/71829399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7505643/" ]
You're running a native query and not a JPA query and that's why the return type of getDetailsById(String requestId) is Object[] and not Clob or Model. Let's say your entity has 4 columns then object[0] will return the first column, object[1] will return the second column, and so on. I'd suggest not to take away good ...
Because there's no relation between the payload Entity and the Model entity ,Model entity have a CLOB type payload NOT an entity,so what you can do is add a relation between the two Entities as follows , so you can request the Payload with the specific request\_id ,since here it will hold the request\_id as a foreign k...
13,587,522
I receive the JSON response from Twitter Search but how can I loop through them? ``` protected void BtnSearchClick(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http:/...
2012/11/27
[ "https://Stackoverflow.com/questions/13587522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239588/" ]
I would make use of `dynamic` keyword ``` using (WebClient wc = new WebClient()) { var json = wc.DownloadString("http://search.twitter.com/search.json?&q=felipe&rpp=40"); dynamic obj = JsonConvert.DeserializeObject(json); foreach (var result in obj.results) { Console.WriteLine("{0} - {1}:\n{2...
A strongly typed way.. ``` public class MyTwitterClass { public List<CustomObject> data {get; set;} } public class CustomObject { public string id {get; set;} public string name {get; set;} } ``` Then you should be able to do: ``` string someJson= @"{""data"":[{""id"":""1"",""name"":""name1""}, ...
13,587,522
I receive the JSON response from Twitter Search but how can I loop through them? ``` protected void BtnSearchClick(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http:/...
2012/11/27
[ "https://Stackoverflow.com/questions/13587522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239588/" ]
I would make use of `dynamic` keyword ``` using (WebClient wc = new WebClient()) { var json = wc.DownloadString("http://search.twitter.com/search.json?&q=felipe&rpp=40"); dynamic obj = JsonConvert.DeserializeObject(json); foreach (var result in obj.results) { Console.WriteLine("{0} - {1}:\n{2...
The below example should help you, where "result" is the returned JSON ``` dynamic stuff = JsonConvert.DeserializeObject(result); foreach (JObject item in stuff) { foreach (JProperty trend in item["user"]) { if (trend.Name == "name") { ...
13,587,522
I receive the JSON response from Twitter Search but how can I loop through them? ``` protected void BtnSearchClick(object sender, EventArgs e) { StringBuilder sb = new StringBuilder(); byte[] buf = new byte[8192]; HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http:/...
2012/11/27
[ "https://Stackoverflow.com/questions/13587522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/239588/" ]
A strongly typed way.. ``` public class MyTwitterClass { public List<CustomObject> data {get; set;} } public class CustomObject { public string id {get; set;} public string name {get; set;} } ``` Then you should be able to do: ``` string someJson= @"{""data"":[{""id"":""1"",""name"":""name1""}, ...
The below example should help you, where "result" is the returned JSON ``` dynamic stuff = JsonConvert.DeserializeObject(result); foreach (JObject item in stuff) { foreach (JProperty trend in item["user"]) { if (trend.Name == "name") { ...
37,896,070
I have created a cordova app using ionic, When i open my app from coldstart, It first loads the splash screen, then there are a few seconds when the screen is white as my index.html file loads and then the app UI is loaded and displayed. This takes approximately 10 seconds on a Moto X which is too long since my app c...
2016/06/18
[ "https://Stackoverflow.com/questions/37896070", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4479807/" ]
There is a lot of information about this topic, I'll try to list some that might be of interest. **About Cordova startup time**: * Kerri Shotts, the author of PhoneGap for Enterprise gave [quite a good answer here](https://stackoverflow.com/questions/23925297/how-fast-typical-phonegap-app-can-be-started-tips-to-speed-...
Building with the production flag will minify and compress all of Ionic's outputs, as well as removing any unnecessary outputs and logging that are used for development. ``` ionic build --prod ``` > > "This will minify your app’s code as Ionic’s source and also remove > any debugging capabilities from the APK. Thi...
2,710,050
We have a REST API that works great. We're refactoring and deciding how to internally handle errors by the users of our API. For example the user needs to specify the "movie" url parameter which should take the value of "1984", "Crash", or "Avatar". First we check to see if it has a valid value. What would be the b...
2010/04/25
[ "https://Stackoverflow.com/questions/2710050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/303396/" ]
Neither. The key is that passing a bad parameter isn't that exceptional a condition. Exceptions are thrown for exceptional circumstances. (That's the reason to not use them here, not the performance.) You should be using something like Spring's DataValidation API for binding parameters that are passed in. A client o...
I will assume that you are doing input validation here and in this case, your database will do a query for a safe string and it won't find the record since it don't exist in your database, ok? If you are using any MVC framework the Model should throw already a RecordNotFound exception no? If you are always expecting...
2,710,050
We have a REST API that works great. We're refactoring and deciding how to internally handle errors by the users of our API. For example the user needs to specify the "movie" url parameter which should take the value of "1984", "Crash", or "Avatar". First we check to see if it has a valid value. What would be the b...
2010/04/25
[ "https://Stackoverflow.com/questions/2710050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/303396/" ]
Neither. The key is that passing a bad parameter isn't that exceptional a condition. Exceptions are thrown for exceptional circumstances. (That's the reason to not use them here, not the performance.) You should be using something like Spring's DataValidation API for binding parameters that are passed in. A client o...
If a invalid request came in (e.g. validation error) you should show 400 status code (bad request). Internally I would also create an exception hierachy which maps to the HTTP Rest domain (see status codes for error cases). Examples (simplified and being unchecked exceptions): ``` class RESTBaseException extends Ru...
2,710,050
We have a REST API that works great. We're refactoring and deciding how to internally handle errors by the users of our API. For example the user needs to specify the "movie" url parameter which should take the value of "1984", "Crash", or "Avatar". First we check to see if it has a valid value. What would be the b...
2010/04/25
[ "https://Stackoverflow.com/questions/2710050", "https://Stackoverflow.com", "https://Stackoverflow.com/users/303396/" ]
If a invalid request came in (e.g. validation error) you should show 400 status code (bad request). Internally I would also create an exception hierachy which maps to the HTTP Rest domain (see status codes for error cases). Examples (simplified and being unchecked exceptions): ``` class RESTBaseException extends Ru...
I will assume that you are doing input validation here and in this case, your database will do a query for a safe string and it won't find the record since it don't exist in your database, ok? If you are using any MVC framework the Model should throw already a RecordNotFound exception no? If you are always expecting...
25,696
People on this site frequently ask about how much water they should drink while doing strenuous outdoor activities such as hiking and running. How broad is the safety range for water consumption in order to avoid both dehydration and [hyponatremia](https://en.wikipedia.org/wiki/Hyponatremia)?
2020/12/01
[ "https://outdoors.stackexchange.com/questions/25696", "https://outdoors.stackexchange.com", "https://outdoors.stackexchange.com/users/-1/" ]
The range of safety is extremely wide. It's not dangerous to get thirsty, nor do you increase your risk of heat stroke by drinking less water. Drinking very large amounts of water causes a danger of hyponatremia, but only if you distrust your body's sensations and force yourself to drink vast amounts of water because s...
Practical checks: Watch your pee, both frequency and colour. If your pee is clear, and you are peeing often, you are at no risk of dehydration. May be drinking a bit too much. If your pee is clear to pale yellow, and you peeing at reasonable interval, this is optimum. If you pee is dark yellow, strong smell, then y...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
Summarizing other answers I think that: * **Inmutability facilitates correctness** (structs can be passed by reference and you know nothing will be destroyed by a faulty/malicious client) and code simplicity * **Mutability facilitates homogeneity**: Spring and other frameworks create an object with no arguments, set o...
From Java 7 you can have immutable beans, the best of both worlds. Use the annotation @ConstructorProperties on your constructor. ``` public class Person { private final String name; private final Place birthPlace; @ConstructorProperties({"name", "birthPlace"}) public Person(String name, Place birthPl...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
### Prefer JavaBeans When * you have to interact with environments that expect them * you have lots of properties for which it would be inconvenient to do all initialization on instantiation * you have state that is expensive or impossible to copy for some reason but requires mutation * you think at some point you may...
Summarizing other answers I think that: * **Inmutability facilitates correctness** (structs can be passed by reference and you know nothing will be destroyed by a faulty/malicious client) and code simplicity * **Mutability facilitates homogeneity**: Spring and other frameworks create an object with no arguments, set o...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
### Prefer JavaBeans When * you have to interact with environments that expect them * you have lots of properties for which it would be inconvenient to do all initialization on instantiation * you have state that is expensive or impossible to copy for some reason but requires mutation * you think at some point you may...
From Java 7 you can have immutable beans, the best of both worlds. Use the annotation @ConstructorProperties on your constructor. ``` public class Person { private final String name; private final Place birthPlace; @ConstructorProperties({"name", "birthPlace"}) public Person(String name, Place birthPl...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
### Prefer JavaBeans When * you have to interact with environments that expect them * you have lots of properties for which it would be inconvenient to do all initialization on instantiation * you have state that is expensive or impossible to copy for some reason but requires mutation * you think at some point you may...
I don't think immutable objects will get all that popular, to be honest. I do see the advantages, but frameworks like Hibernate and Spring are currently very much in vogue (and for a good reason too), and they really work best with beans. So I don't think immutability is bad, but it would certainly limit your integra...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
### Prefer JavaBeans When * you have to interact with environments that expect them * you have lots of properties for which it would be inconvenient to do all initialization on instantiation * you have state that is expensive or impossible to copy for some reason but requires mutation * you think at some point you may...
I was surprised that the word *Thread* did not appear anywhere in this discussion. One of the main benefits of immutable classes is that they are inherently more thread safe due to no mutable, shared state. Not only does this make your coding easier, it'll also give you two performance benefits as a side effect: * L...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
I was surprised that the word *Thread* did not appear anywhere in this discussion. One of the main benefits of immutable classes is that they are inherently more thread safe due to no mutable, shared state. Not only does this make your coding easier, it'll also give you two performance benefits as a side effect: * L...
Immutable in terms of programming in Java : Something that once created should never have change of state , both expected or unexpected! This technique is useful in defensive programming where another entity cannot induce change in the state. Examples where you don't expect change : External systems(single or multi t...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
Well it depends on what you're trying to do. If your working with a persistent layer, and you fetch some row from the database into a POJO, and you want to change a property and save it back, using JavaBean style would be better, especially if you have a lot of properties. Consider that your person, has a lot of field...
From Java 7 you can have immutable beans, the best of both worlds. Use the annotation @ConstructorProperties on your constructor. ``` public class Person { private final String name; private final Place birthPlace; @ConstructorProperties({"name", "birthPlace"}) public Person(String name, Place birthPl...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
Summarizing other answers I think that: * **Inmutability facilitates correctness** (structs can be passed by reference and you know nothing will be destroyed by a faulty/malicious client) and code simplicity * **Mutability facilitates homogeneity**: Spring and other frameworks create an object with no arguments, set o...
I don't think immutable objects will get all that popular, to be honest. I do see the advantages, but frameworks like Hibernate and Spring are currently very much in vogue (and for a good reason too), and they really work best with beans. So I don't think immutability is bad, but it would certainly limit your integra...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
Summarizing other answers I think that: * **Inmutability facilitates correctness** (structs can be passed by reference and you know nothing will be destroyed by a faulty/malicious client) and code simplicity * **Mutability facilitates homogeneity**: Spring and other frameworks create an object with no arguments, set o...
Immutable in terms of programming in Java : Something that once created should never have change of state , both expected or unexpected! This technique is useful in defensive programming where another entity cannot induce change in the state. Examples where you don't expect change : External systems(single or multi t...
3,511,120
I have implemented a few Java applications now, only desktop applications so far. I prefer to use immutable objects for passing the data around in the application instead of using objects with mutators (setters *and getters*), also called JavaBeans. But in the Java world, it seems to be much more common to use JavaBea...
2010/08/18
[ "https://Stackoverflow.com/questions/3511120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/213269/" ]
From Java 7 you can have immutable beans, the best of both worlds. Use the annotation @ConstructorProperties on your constructor. ``` public class Person { private final String name; private final Place birthPlace; @ConstructorProperties({"name", "birthPlace"}) public Person(String name, Place birthPl...
Immutable in terms of programming in Java : Something that once created should never have change of state , both expected or unexpected! This technique is useful in defensive programming where another entity cannot induce change in the state. Examples where you don't expect change : External systems(single or multi t...