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
59,629,988
I have one table(**1 cr records**) in Oracle 12g which is getting updated(from other/ETL source) everyday at 4:00 AM which is my user master table. I am using this table to authenticate my user. So simple way is get it from database but instead I am thinking to move/update the table into Redis everyday after ETL opera...
2020/01/07
[ "https://Stackoverflow.com/questions/59629988", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1944816/" ]
> > One way is write a scheduler/Cron job in Java which will run after ETL operation to copy table record and insert into Redis. > > > Oracle supports the stored procedures which can be written in Java <https://docs.oracle.com/cd/B19306_01/java.102/b14187/chfive.htm> In this case your code will be closer to data, ...
Since you already know the time of ETL update to your table, I do think whatever you have proposed is already optimal. But here's a different perspective on the same problem. See if this flavour suits. :) Oracle RAC supports reliable CQN (Continuous Query Notifications) termed in Oracle world as DCN. This can either b...
151,835
I have an Hp/Compaq laptop, intel, 2 processors, using 64 bit. I want to install Java 5 SDK, I see references to AMD 64 bit, I am assuming that is different from intel? Is there a Java 5 sdk for my environment?
2010/06/16
[ "https://serverfault.com/questions/151835", "https://serverfault.com", "https://serverfault.com/users/8160/" ]
You see AMD 64 because AMD developed a 64 bit architecture before Intel and thus the name amd64 stuck, but any binary labeled amd64 works on a Intel 64 bit processor. You can download the amd64 build of the JDK and install it on your laptop without problems for running software such as Tomcat or Eclipse, however a 32-...
I tried to install just the runtime environment, but in seems to be an error, since I cannot start Eclipse. When I run the command "eclipse -vm" I get "Access is denied". In fact, Java SE is not supported for Windows Server 2008 R2: <http://www.oracle.com/technetwork/java/javase/system-configurations-135212.html> So, w...
11,728,289
I have a testing FEST app which uses an AWT robot for simulating certain actions over a Swing interface. My problem is that it seems like moving the mouse pointer during the robot-test execution cancels some of the programatic actions, like pressing a column header. If you dont touch anything during execution, then cur...
2012/07/30
[ "https://Stackoverflow.com/questions/11728289", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1352530/" ]
Maybe you could disable the keyboard and mouse using the native terminal commands. I.e cmd.exe for Windows and terminal for Linux (depending if application has to be portable just [check os name](https://stackoverflow.com/questions/228477/how-do-i-programmatically-determine-operating-system-in-java) and then run the co...
If you are hardy to evolve with end-to-end tests using AWT robot, then try to separate tests to able to run only part that checks touched functionality while all bunch of end-to-end tests should run on build server. Here is result of end-to-end testing by AWT robot for Swing application that completes on head-less bui...
3,084,975
i noticed that in the following example, note the classes, i am using 960gs in case the classes css interfered **html** ``` <section id="main" class="container_12"> <div class="grid_12"> <article> ... ``` **css** ``` header, footer, section, article, nav, aside { display: block; } #main { background: #f...
2010/06/21
[ "https://Stackoverflow.com/questions/3084975", "https://Stackoverflow.com", "https://Stackoverflow.com/users/292291/" ]
From the [spec](http://www.whatwg.org/specs/web-apps/current-work/#the-section-element): > > The section element is not a generic container element. **When an element is needed for styling purposes** or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the s...
i found the answer, `grid_x` has `float: left` i need to clear it
5,158,069
I am wondering if Fastcgi supports unicode functions like wprintf. I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . How do I process them inside fastcgi main function. A call to mbstowcs fails. I meant that I was using the FastCGI Developers Kit librar...
2011/03/01
[ "https://Stackoverflow.com/questions/5158069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639811/" ]
Fastcgi is protocol not an API. So it depend on the library you are choosing. Yes see library <http://www.nongnu.org/fastcgipp/>
> > I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . > > > Unicode is not the only encoding that has bytes above 128 in it. In fact, most other encodings do. You need to find out which encoding is exactly used in your web application. In any case, I...
5,158,069
I am wondering if Fastcgi supports unicode functions like wprintf. I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . How do I process them inside fastcgi main function. A call to mbstowcs fails. I meant that I was using the FastCGI Developers Kit librar...
2011/03/01
[ "https://Stackoverflow.com/questions/5158069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639811/" ]
Fastcgi is protocol not an API. So it depend on the library you are choosing. Yes see library <http://www.nongnu.org/fastcgipp/>
FastCGI expects a byte stream, so your safest bet is UTF-8. That being said, the program should work with non-UTF-8 input; iconv is ideal for this. You can use wprintf, but only in the form of wsnprintf, after which buffer contents are converted to UTF-8 and then written to the correct FCGI stream.
5,158,069
I am wondering if Fastcgi supports unicode functions like wprintf. I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . How do I process them inside fastcgi main function. A call to mbstowcs fails. I meant that I was using the FastCGI Developers Kit librar...
2011/03/01
[ "https://Stackoverflow.com/questions/5158069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639811/" ]
If you need Unicode, use UTF-8 and not "wide" characters. They are much more suitable for the web.
> > I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . > > > Unicode is not the only encoding that has bytes above 128 in it. In fact, most other encodings do. You need to find out which encoding is exactly used in your web application. In any case, I...
5,158,069
I am wondering if Fastcgi supports unicode functions like wprintf. I receive a buffer via fread and get char\* that has unicode characters in it. I mean bytes with value above 128 . How do I process them inside fastcgi main function. A call to mbstowcs fails. I meant that I was using the FastCGI Developers Kit librar...
2011/03/01
[ "https://Stackoverflow.com/questions/5158069", "https://Stackoverflow.com", "https://Stackoverflow.com/users/639811/" ]
If you need Unicode, use UTF-8 and not "wide" characters. They are much more suitable for the web.
FastCGI expects a byte stream, so your safest bet is UTF-8. That being said, the program should work with non-UTF-8 input; iconv is ideal for this. You can use wprintf, but only in the form of wsnprintf, after which buffer contents are converted to UTF-8 and then written to the correct FCGI stream.
43,972,313
How do I get the actual Activity **instance** of the top current activity of a running Andoind application? Reason: I receive a OnMessageReceived Data payload from Firebase while my application is running in the foreground, and I need to finish() it. Note: there are tons of other info to get the ComponentName using g...
2017/05/15
[ "https://Stackoverflow.com/questions/43972313", "https://Stackoverflow.com", "https://Stackoverflow.com/users/919222/" ]
The better way would be to use a `Local Broad Cast` to inform your activity to finish itself. You just need to register a Broad Cast Receiver inside your activity and then send the broadcast in your FCM Messaging Service. Check [this page](https://developer.android.com/reference/android/support/v4/content/LocalBroad...
You can also use EventBus for the Same
49,516
Given that hubs are essentially the same as switches, as far as I know, except they share bandwidth between all connected devices, while switches do not, resulting in faster connections. I am simply wondering if there is any reasonable purpose for hubs in modern networks.
2018/03/30
[ "https://networkengineering.stackexchange.com/questions/49516", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/46197/" ]
For the most part, no. Hubs are also known as *repeaters* - meaning that they basically echo whatever is coming **in** to a given port **out** all other ports in the domain. The idea is (or, more properly, **was**) to replicate the behavior of a shared piece of coaxial cable, meaning that the individual hosts had to as...
Hubs are bad news, from both a network performance as well as a security point of view. As a network admin you may find it handy to have a hub or two sitting in the store for the day when you want to do a packet capture (which for some reason cannot be done in the usual way (span etc.)), but don't leave them running i...
49,516
Given that hubs are essentially the same as switches, as far as I know, except they share bandwidth between all connected devices, while switches do not, resulting in faster connections. I am simply wondering if there is any reasonable purpose for hubs in modern networks.
2018/03/30
[ "https://networkengineering.stackexchange.com/questions/49516", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/46197/" ]
For the most part, no. Hubs are also known as *repeaters* - meaning that they basically echo whatever is coming **in** to a given port **out** all other ports in the domain. The idea is (or, more properly, **was**) to replicate the behavior of a shared piece of coaxial cable, meaning that the individual hosts had to as...
In general, no, there's no reason to use a hub over a switch, but they do still have a purpose in some special cases. One case is if you need to capture traffic to a host but the host can't run a capture utility itself and the switch it connects to also can't do a capture or span port. In this case, you could connect a...
13,290
Hi guys so I am having an issue with the "generating pending image transforms" being stuck. I've seen the solution listed here <https://craftcms.com/support/stuck-tasks> telling me to go to the craft\_tasks table and fix the error. But I cannot for the life of me figure out how to get to this table. Where is it? No o...
2016/01/19
[ "https://craftcms.stackexchange.com/questions/13290", "https://craftcms.stackexchange.com", "https://craftcms.stackexchange.com/users/3737/" ]
I'll use myself as an example, so if something isn't right we'll know who to blame. First thing I do is set up an environment variable in my `craft/config/general.php` file like this: ``` ... '.dev' => array( 'devMode' => true, 'siteUrl' => 'http://mysite.dev/', 'environmentVariables' => array( 'b...
> > For example, **I want my images to be** in public\_html/media/images, but I want the url for images to be <http://mysite.com/images>. > > > When you configure an asset source you tell Craft where to find the images, not where you want them to be.
10,128,288
I can't seem to use mysqldump to dump a table that has been created as a MyISAM merge table. When I attempt to, it simply dumps a file that has the create table syntax in it (correct) but not any of the data within the underlying tables. Is this expected or a known bug? How can I replicate the behavior of mysqldump o...
2012/04/12
[ "https://Stackoverflow.com/questions/10128288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/831911/" ]
That should be expected. The MERGE table is just a mapping of MyISAM tables. You must dump the underlying tables. If you want some kind of emulation to mysqldump a MERGE table (for a Table called mydb.mymergetable whose storage engine is Mrg\_MyISAM) ``` USE mydb CREATE TABLE myhardtable LIKE mymergetable; ALTER TAB...
MySQL lists a number of common problems with MyISAM merge tables. Without more code I can't identify your specific problem, but this is a good place to start: <http://dev.mysql.com/doc/refman/5.1/en/merge-table-problems.html>
492,465
Well, I do know that for a single script the question is to just put the corresponding file in directory `/etc/rc.local`, right? But, what if this script depends on other files (i.e. a few scripts and a couple of text files)? What should I do in order to avoid making this certain folder a mess?
2012/10/25
[ "https://superuser.com/questions/492465", "https://superuser.com", "https://superuser.com/users/167519/" ]
If by **depends**, you mean it **uses and/or calls** them, that **should not matter**. You can just add a line to the end of the rc.local file as a command to call the main script and it **should just work**. There is an **alternative to rc.local**, atleast on desktop versions. You can use the **`Startup Applications...
If you have `cron` enabled (which you should) there is a special `@reboot` command which runs on startup. I am unsure of this works on cold boots though, but from what I can see it does. If it works, you just write a script, plonk it in some clean and organised directory, then call it through `cron`. See: [Here](http...
50,035,825
``` <button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal">Edit</button> <button type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal">Edit</button> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!-- Modal co...
2018/04/26
[ "https://Stackoverflow.com/questions/50035825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7939864/" ]
When using a `plugin`, add your gradle dependencies in `[projectFolder]/android/build.gradle`. At the bottom, below the android section, add a dependencies section like this: ``` android { compileSdkVersion 27 defaultConfig { minSdkVersion 16 testInstrumentationRunner "android.support.test.run...
You need to create a plugin package for that ``` flutter create --template=plugin hello ``` `--template=package` is for packages that contain only Dart code.
62,286,086
My data.frame `df1` looks like this: ``` A NA NA B NA NA C NA NA 1 2 3 4 5 6 7 8 9 ``` I want it to look like this: ``` A 1 A 2 A 3 B 4 B 5 B 6 C 7 C 8 C 9 ``` Any ideas?
2020/06/09
[ "https://Stackoverflow.com/questions/62286086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13503034/" ]
Suppose you have a data.frame like this: ```r df <- data.frame(matrix(c("A", NA, NA, "B", NA, NA, "C", NA, NA, 1:9), byrow = TRUE, nrow = 2)) > df X1 X2 X3 X4 X5 X6 X7 X8 X9 1 A <NA> <NA> B <NA> <NA> C <NA> <NA> 2 1 2 3 4 5 6 7 8 9 ``` Using `tidyr`: ``` df %>% t() %>% as...
An option with `na.locf` from `zoo` ``` library(zoo) na.locf(as.data.frame(t(df))) # V1 V2 #X1 A 1 #X2 A 2 #X3 A 3 #X4 B 4 #X5 B 5 #X6 B 6 #X7 C 7 #X8 C 8 #X9 C 9 ``` ### data ``` df <- data.frame(matrix(c("A", NA, NA, "B", NA, NA, "C", NA, NA, 1:9), byrow = TRUE, nrow = 2)) ```
19,462,340
I have a handheld device with android 4.2.2. Now, I want to know is it possible to know which java runtime environment is supported on that version, as android is java based. Actually I want to use java try with resource in my new developed app for android 4.2.2. So, I am interested to know is that working in there or...
2013/10/19
[ "https://Stackoverflow.com/questions/19462340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1372772/" ]
Android only support version of `Java 6` features of `Java 7` like `Switch-case` of string ,`try ressource management` or catch mutiple related exception in a simple catchfail.
it support java 1.7 but if you include google map then you have to use java 1.6.
1,440,908
I have the following XSLT: ``` <xsl:template match="/"> <div id="dokumentliste"> <xsl:variable name="alleNyheder" select="$currentPage//node" /> <xsl:for-each select="$alleNyheder"> <xsl:sort data-type="text" select="@createDate" order="descending" /> <xsl:if test="./data[@a...
2009/09/17
[ "https://Stackoverflow.com/questions/1440908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117099/" ]
First, you don't need to import or export typedefs. As long as they're in the header files that both sides use, you're good. You do need to import/export functions and class definitions. Presumably you use the same header files for both the importing and exporting code, so you could do some makefile magic to define a ...
1. typedefs do NOT need a dllimport/dllexport, it's just a definition 2. dllimport/dllexport are not standard, think of defining a macro for other platforms/compilers 3. also take care of the calling convention (cdecl,stdcall,...) used otherwise you'll run into problems (if you need to be interoperable with Visual basi...
311,890
An answer such as [this](https://stackoverflow.com/a/4824637/340947) does a good job explaining how to control passing *all* variables through to a command. I wanted to explore how to do this on a per-argument basis. Observe (this was tested in `zsh`): ``` $ program() { echo 1: $1 2: $2 3: $3; } $ run() { program "...
2016/09/23
[ "https://unix.stackexchange.com/questions/311890", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/12497/" ]
The difference between bash and zsh that matters here is in the way `run2` calls `run`, specifically the effect of leaving `$1` unquoted. * In zsh, `run $1` applies the “remove-if-empty” operator to `$1`, i.e. calls `run` with the first argument that was passed to `run2`, except that if the first argument to `run2` wa...
Welcome to the world of quoting and quoting surprises. The main issue is that `zsh` doesn't split on IFS characters by default. In that: it is different from all other shells. To test how quoting change the way shells work we need code that tests both quoted and unquoted versions of your code. Your code (adding ...
43,342,308
While trying to pass a table in as a parameter to a stored procedure via Dapper, I came across [this SO answer](https://stackoverflow.com/a/24633764/336648), which indicates that it is directly supported in Dapper. In .NET core however, [DataTable seems not to be implemented](https://github.com/dotnet/corefx/issues/86...
2017/04/11
[ "https://Stackoverflow.com/questions/43342308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/336648/" ]
For now, you will have to create a class that implements SqlMapper.IDynamicParameters for each table value type. **Modified example (not tested)** <http://todothinkofname.net/2016/05/30/Dapper-with-Net-core/> ``` public class ParameterTvp : SqlMapper.IDynamicParameters { private readonly IEnumerable<string...
You should be able to pass in an `IEnumerable<SqlDataRecord>`, [like this](https://stackoverflow.com/questions/39872989/datatable-class-in-asp-net-core). It's in System.Data, and it's not deprecated.
41,433
I am stuck with this problem. I posted an [earlier problem](https://math.stackexchange.com/questions/41257/find-remaining-vertices-of-a-square-given-2) with a square, where rotation with i of 90 degrees was possible. This one is a rhombus, how should I proceed? > > Given ABCD is a rhombus with AC = 2BD, and b = 3 + i...
2011/05/26
[ "https://math.stackexchange.com/questions/41433", "https://math.stackexchange.com", "https://math.stackexchange.com/users/11343/" ]
Since you're given opposite vertices and information about the lengths of the diagonals, it is probably useful to know some things about specific quadrilaterals. Kites—quadrilaterals where two consecutive sides are congruent and the other two (consecutive) sides are congruent—have perpendicular diagonals. Parallelogram...
Hint: What is true about all the sides of a rhombus?
41,433
I am stuck with this problem. I posted an [earlier problem](https://math.stackexchange.com/questions/41257/find-remaining-vertices-of-a-square-given-2) with a square, where rotation with i of 90 degrees was possible. This one is a rhombus, how should I proceed? > > Given ABCD is a rhombus with AC = 2BD, and b = 3 + i...
2011/05/26
[ "https://math.stackexchange.com/questions/41433", "https://math.stackexchange.com", "https://math.stackexchange.com/users/11343/" ]
Hint: The points $A,C$ are the points of intersection between the diagonal $AC$ and the circle centered at the mid point of $BD$ with radius $|\frac{AC}{2}|$. How do you express this information in terms of Cartesian equations?
Hint: What is true about all the sides of a rhombus?
41,433
I am stuck with this problem. I posted an [earlier problem](https://math.stackexchange.com/questions/41257/find-remaining-vertices-of-a-square-given-2) with a square, where rotation with i of 90 degrees was possible. This one is a rhombus, how should I proceed? > > Given ABCD is a rhombus with AC = 2BD, and b = 3 + i...
2011/05/26
[ "https://math.stackexchange.com/questions/41433", "https://math.stackexchange.com", "https://math.stackexchange.com/users/11343/" ]
Since you're given opposite vertices and information about the lengths of the diagonals, it is probably useful to know some things about specific quadrilaterals. Kites—quadrilaterals where two consecutive sides are congruent and the other two (consecutive) sides are congruent—have perpendicular diagonals. Parallelogram...
Hint: The points $A,C$ are the points of intersection between the diagonal $AC$ and the circle centered at the mid point of $BD$ with radius $|\frac{AC}{2}|$. How do you express this information in terms of Cartesian equations?
5,866,950
I like to call a stored PL/pgSQL function the same way as with `PERFORM` ignoring the results, but from plain SQL. How can i achive this? I'm currently using `SELECT` to execute the function, but this prints data on the console what i don't need. I thought about disabling client output for specific `SELECT` statements...
2011/05/03
[ "https://Stackoverflow.com/questions/5866950", "https://Stackoverflow.com", "https://Stackoverflow.com/users/296959/" ]
There is no such functionality in plain sql. What you can do though, is make the function not return anything.
Here is a dirty hack, i just came up with; background is, i need to call a function, but specify an UPDATE, not a SELECT ...maybe your background is the same... So I specified my UPDATE like this: ``` UPDATE sometable_doesnt_matter SET some_comlumn=some_comlumn WHERE (select my_function = 1); ``` And my function ...
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
I think the problem in your example is that you explicitly require that *both* your applications are granted the custom permission. This part requires, that the *com.example.thirdparty* app has the permission: ``` <receiver android:name="com.example.app.MyBroadcastReceiver" android:permission="com.example.app...
While it might be ambiguous for the user to see a permission request for the app which is declared in the same app, it is how android is designed to run since marshmallow. I think, on android's perspective, the behavior is as intended and correct.
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
As I understood you tried to do next thing (At least, that's how I was able to reproduce your problem): 1. You declare your new custom permission in first (lets call it F) application ``` <permission android:name="com.example.app.permission.CONTROL_EXAMPLE_APP" android:description="@string/control_description...
While it might be ambiguous for the user to see a permission request for the app which is declared in the same app, it is how android is designed to run since marshmallow. I think, on android's perspective, the behavior is as intended and correct.
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
I don't think it's completely true that a declared custom permission will not be automatically granted to the application. For when the custom permission has the protection level "normal" or "signature", then the permission is granted at install time. Otherwise, if the protection level is "dangerous", then it is a runt...
While it might be ambiguous for the user to see a permission request for the app which is declared in the same app, it is how android is designed to run since marshmallow. I think, on android's perspective, the behavior is as intended and correct.
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
I think the problem in your example is that you explicitly require that *both* your applications are granted the custom permission. This part requires, that the *com.example.thirdparty* app has the permission: ``` <receiver android:name="com.example.app.MyBroadcastReceiver" android:permission="com.example.app...
First add permissions in manifest file after ``` <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ```
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
As I understood you tried to do next thing (At least, that's how I was able to reproduce your problem): 1. You declare your new custom permission in first (lets call it F) application ``` <permission android:name="com.example.app.permission.CONTROL_EXAMPLE_APP" android:description="@string/control_description...
I think the problem in your example is that you explicitly require that *both* your applications are granted the custom permission. This part requires, that the *com.example.thirdparty* app has the permission: ``` <receiver android:name="com.example.app.MyBroadcastReceiver" android:permission="com.example.app...
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
As I understood you tried to do next thing (At least, that's how I was able to reproduce your problem): 1. You declare your new custom permission in first (lets call it F) application ``` <permission android:name="com.example.app.permission.CONTROL_EXAMPLE_APP" android:description="@string/control_description...
First add permissions in manifest file after ``` <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ```
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
I don't think it's completely true that a declared custom permission will not be automatically granted to the application. For when the custom permission has the protection level "normal" or "signature", then the permission is granted at install time. Otherwise, if the protection level is "dangerous", then it is a runt...
First add permissions in manifest file after ``` <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> ```
38,234,041
I am trying to use Retrofit library so I can make calls from my Android app to my Django REST API I have created. I have the following code written: *UserAPI.java* ``` public interface UserAPI { String BASE_URL = "http://www.example.com"; @GET("/json.json") Call<JsonObject> getUsers(); class Factor...
2016/07/06
[ "https://Stackoverflow.com/questions/38234041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2180140/" ]
As I understood you tried to do next thing (At least, that's how I was able to reproduce your problem): 1. You declare your new custom permission in first (lets call it F) application ``` <permission android:name="com.example.app.permission.CONTROL_EXAMPLE_APP" android:description="@string/control_description...
I don't think it's completely true that a declared custom permission will not be automatically granted to the application. For when the custom permission has the protection level "normal" or "signature", then the permission is granted at install time. Otherwise, if the protection level is "dangerous", then it is a runt...
63,833,593
I am trying to run a "local" web app on Google Colab using FastAPI / Uvicorn like some of the Flask app sample code I've seen but cannot get it to work. Has anyone been able to do this? Appreciate it. ### Installed FastAPI & Uvicorn successfully ``` !pip install FastAPI -q !pip install uvicorn -q ``` ### Sample app...
2020/09/10
[ "https://Stackoverflow.com/questions/63833593", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14255583/" ]
You can use **ngrok** to export a port as an external url. Basically, ngrok takes something available/hosted on your localhost and exposes it to the internet with a temporary public URL. First install the dependencies ``` !pip install fastapi nest-asyncio pyngrok uvicorn ``` Create your app ``` from fastapi import...
A simpler approach without having to use ngrok or nest-asyncio: ```py from fastapi import FastAPI from uvicorn import Config, Server app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"} config = Config(app) server = Server(config=config) await server.serve() ``` This won't do any ...
41,289,264
I am running into 'opaque tokens' as a solution to implementing global constants in Angular 2, for example here: [Define global constants in Angular 2](https://stackoverflow.com/questions/34986922/define-global-constants-in-angular-2/40287063#40287063) Despite reading the [docs](https://angular.io/docs/ts/latest/api/c...
2016/12/22
[ "https://Stackoverflow.com/questions/41289264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4977957/" ]
**update Angular4** In Angular4 `OpaqueToken` is deprecated and will be replaced by `InjectionToken`. InjectionToken allows to pass a generic type parameter. ```ts export let APP_CONFIG = new InjectionToken<MyConfig>("app.config"); ``` See also * <https://blog.thoughtram.io/angular/2016/05/23/opaque-tokens-in-angu...
> > What's an Opaque Token? What is it used for? > > > Opaque Token used for inject another provider(service) with same name. This allows you to avoid naming collisions. ```js const MY_HTTP_TOKEN: OpaqueToken = new OpaqueToken('Http'); providers: [ { provide: MY_HTTP_TOKEN, useClass: Http } ...
41,289,264
I am running into 'opaque tokens' as a solution to implementing global constants in Angular 2, for example here: [Define global constants in Angular 2](https://stackoverflow.com/questions/34986922/define-global-constants-in-angular-2/40287063#40287063) Despite reading the [docs](https://angular.io/docs/ts/latest/api/c...
2016/12/22
[ "https://Stackoverflow.com/questions/41289264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4977957/" ]
**update Angular4** In Angular4 `OpaqueToken` is deprecated and will be replaced by `InjectionToken`. InjectionToken allows to pass a generic type parameter. ```ts export let APP_CONFIG = new InjectionToken<MyConfig>("app.config"); ``` See also * <https://blog.thoughtram.io/angular/2016/05/23/opaque-tokens-in-angu...
I'm new to angular 2, but I want to try to interpret what I understood from <https://blog.thoughtram.io/angular/2016/05/23/opaque-tokens-in-angular-2.html> in a simple code. CMIIW. ``` ... const CONFIG_ONE = {title: 'My awesome app'}; let configOneToken = 'config'; //'config' is an example of string-type token const...
41,289,264
I am running into 'opaque tokens' as a solution to implementing global constants in Angular 2, for example here: [Define global constants in Angular 2](https://stackoverflow.com/questions/34986922/define-global-constants-in-angular-2/40287063#40287063) Despite reading the [docs](https://angular.io/docs/ts/latest/api/c...
2016/12/22
[ "https://Stackoverflow.com/questions/41289264", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4977957/" ]
**update Angular4** In Angular4 `OpaqueToken` is deprecated and will be replaced by `InjectionToken`. InjectionToken allows to pass a generic type parameter. ```ts export let APP_CONFIG = new InjectionToken<MyConfig>("app.config"); ``` See also * <https://blog.thoughtram.io/angular/2016/05/23/opaque-tokens-in-angu...
An Opaque Token is just a runtime class that is used as a unique identifier for injector providers. Lets say you have a value, 'secretId' that you want to use into a few services and components. You don't want to hard code this in your services and components, as it will change in the future. As well you want to writ...
12,946,243
I find an strange file named `values-sw580` in my Android contact code .I don't know what is this for and why it calls this way.Anyone know about it ?:) tell me please.thanx.
2012/10/18
[ "https://Stackoverflow.com/questions/12946243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1733751/" ]
You can find details of the new zf2 structure <http://akrabat.com/zend-framework-2/modules-in-zf2/> > > As we're using PHP 5.3, we expect that the classes within the src folder will be namespaced. By default, a module's main name is assumed > to be its main namespace, Simple in this case. In order to make > autoloa...
Modules are intended to be single-purpose, reusable containers of code. As such, they will contain everything they need to accomplish that task -- which may (or may not!) include controllers, models, public assets, configuration, view templates, and more. In order to keep the various pieces semantically grouped, each ...
52,250
Assalamu aleykum wa rahmatuLlahi wa barakatuh dear brothers. Help please with one hadith from Islamophobes: the Pre-lslamic Period of Ignorance there was a house called Dhu-l-Khalasa or Al-Ka`ba Al- Yamaniya or Al-Ka`ba Ash-Shamiya. The Prophet (ﷺ) said to me, "Won't you relieve me from Dhu-l- Khalasa?" So I set out wi...
2019/01/16
[ "https://islam.stackexchange.com/questions/52250", "https://islam.stackexchange.com", "https://islam.stackexchange.com/users/31529/" ]
First note that the hadith appears in Sahih al-Bukhari and therefore is considered as trustworthy by sunni scholars. Secondly if you open Sahih al-Bukhari and read the next hadith in the same section <https://sunnah.com/bukhari/64/382> you will realize that Jarir and his hundred or hundred fifty companions demolished ...
I don't know about thus report authenticity but taking women as war booty is part of Islam. Prophet SAW had a slave girl called Maria the Copt. A man does as he wishes with his property, it is allowed with the companions the right hand. remember Islam does not have to live up to disbelievers idea of what is good rather...
16,402,858
Consider the following scenario. You are building a class, in java, where the fundamental semantics of the class demand that no two instances of the class be equal in value unless they are in fact the same object (see instance-controlled classes in Effective Java by Joshua Bloch). In a sense this is like a very large...
2013/05/06
[ "https://Stackoverflow.com/questions/16402858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1431258/" ]
To reduce by 10%: ``` UPDATE Monsters SET HP = HP * 0.9 WHERE HP > 100000; ``` I'm sure you can figure out how to reduce by other percentages from here.
``` update monsters set monsters.hp = monsters.hp * x where monsters.hp > 100000; ```
16,402,858
Consider the following scenario. You are building a class, in java, where the fundamental semantics of the class demand that no two instances of the class be equal in value unless they are in fact the same object (see instance-controlled classes in Effective Java by Joshua Bloch). In a sense this is like a very large...
2013/05/06
[ "https://Stackoverflow.com/questions/16402858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1431258/" ]
``` update monsters set monsters.hp = monsters.hp * x where monsters.hp > 100000; ```
``` UPDATE MONSTERS SET HP = HP * (1-X) WHERE HP > 100,000 ``` Wrap that in a Procedure that takes x as an input variabll. You also may want to convert the limiting value (100,000) to another variable.
16,402,858
Consider the following scenario. You are building a class, in java, where the fundamental semantics of the class demand that no two instances of the class be equal in value unless they are in fact the same object (see instance-controlled classes in Effective Java by Joshua Bloch). In a sense this is like a very large...
2013/05/06
[ "https://Stackoverflow.com/questions/16402858", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1431258/" ]
To reduce by 10%: ``` UPDATE Monsters SET HP = HP * 0.9 WHERE HP > 100000; ``` I'm sure you can figure out how to reduce by other percentages from here.
``` UPDATE MONSTERS SET HP = HP * (1-X) WHERE HP > 100,000 ``` Wrap that in a Procedure that takes x as an input variabll. You also may want to convert the limiting value (100,000) to another variable.
2,503,907
I want to create a headline (h2) with an image at the right-most area of the bounding box. I have the layout almost right except I can't push the image a little bit to the right of the element's bounding box -- how would I tweak my css so it is displayed correctly? I'm trying to do something like this: ``` [{someHead...
2010/03/23
[ "https://Stackoverflow.com/questions/2503907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265838/" ]
I'm afraid I think you can't. You can use either `right` or a pixel value as the image's x-position but that pixel value will always be relative to the *left* corner of the bounding box. Adding padding won't help either, it will just extend the bounding box further. The only solution I know for this is either adding t...
You could ditch the background image and use an image instead. ``` <div class="primaryHeader" style="padding-right: 5px;"> <img src="../images/edit.png" alt="" style="float: right;" /> <h2>News</h2> </div> ```
2,503,907
I want to create a headline (h2) with an image at the right-most area of the bounding box. I have the layout almost right except I can't push the image a little bit to the right of the element's bounding box -- how would I tweak my css so it is displayed correctly? I'm trying to do something like this: ``` [{someHead...
2010/03/23
[ "https://Stackoverflow.com/questions/2503907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265838/" ]
I'm afraid I think you can't. You can use either `right` or a pixel value as the image's x-position but that pixel value will always be relative to the *left* corner of the bounding box. Adding padding won't help either, it will just extend the bounding box further. The only solution I know for this is either adding t...
Can you add padding pixels in the image itself?
2,503,907
I want to create a headline (h2) with an image at the right-most area of the bounding box. I have the layout almost right except I can't push the image a little bit to the right of the element's bounding box -- how would I tweak my css so it is displayed correctly? I'm trying to do something like this: ``` [{someHead...
2010/03/23
[ "https://Stackoverflow.com/questions/2503907", "https://Stackoverflow.com", "https://Stackoverflow.com/users/265838/" ]
I'm afraid I think you can't. You can use either `right` or a pixel value as the image's x-position but that pixel value will always be relative to the *left* corner of the bounding box. Adding padding won't help either, it will just extend the bounding box further. The only solution I know for this is either adding t...
You can look into [CSS3 background positioning](http://www.w3.org/TR/css3-background/#the-background-position). It works in all the modern browsers (not IE, of course).
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
First hit on the if block could be something like: ``` double dx = 0, dy = 0, dz = 0; whenToStop++; if (whenToStop < 60) { dz = -1.5; } else if (whenToStop < 65) { dx = -1.2; } else if (whenToStop < 124) { dz = +1.5; } else if (whenToStop < 129) { dx = -1.2; } else if (whenToStop < 188) { dz = -1.5; } else i...
in case you dont know, several if(){} makes the compiler check them in a reverse order, it checks the last if then the if before it then the one before it then so on unlike if(){}else if(){} if else makes the compiler check them in the written order, the first one in the code is the first one checked any way, this i...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
I'll elaborate on @MadProgrammer's suggestion: Create a structure to hold the limit and deltas for each condition: ``` class Entry { int upper_limit; double delta_x; double delta_y; double delta_z; } ``` Then fill a List of structures with the data: ``` ArrayList<Entry> entries; entries.add(new Entry(60, 0...
in case you dont know, several if(){} makes the compiler check them in a reverse order, it checks the last if then the if before it then the one before it then so on unlike if(){}else if(){} if else makes the compiler check them in the written order, the first one in the code is the first one checked any way, this i...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
My modified version of OldCurmudgeons code. Make it a complete function (I assume the player is of PlayerType): ``` void move(PlayerType player, int step) { double dx = 0, dy = 0, dz = 0; int cycle = step % 128; if (cycle < 60) { dz = -1.5; } else if (cycle < 64) { dx = -1.2; } else if ...
in case you dont know, several if(){} makes the compiler check them in a reverse order, it checks the last if then the if before it then the one before it then so on unlike if(){}else if(){} if else makes the compiler check them in the written order, the first one in the code is the first one checked any way, this i...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
Loop can be rewritten as: ``` public void checkBytes(byte byte0) { double d1e = mc.thePlayer.posX - byte0; double d3e = mc.thePlayer.posY - byte0; double d5e = mc.thePlayer.posZ - byte0; for(double d1 = mc.thePlayer.posX + byte0; d1 > d1e; d1 -= 1.0) { for(double d3 = mc.thePlayer.posY + byte0;...
in case you dont know, several if(){} makes the compiler check them in a reverse order, it checks the last if then the if before it then the one before it then so on unlike if(){}else if(){} if else makes the compiler check them in the written order, the first one in the code is the first one checked any way, this i...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
First hit on the if block could be something like: ``` double dx = 0, dy = 0, dz = 0; whenToStop++; if (whenToStop < 60) { dz = -1.5; } else if (whenToStop < 65) { dx = -1.2; } else if (whenToStop < 124) { dz = +1.5; } else if (whenToStop < 129) { dx = -1.2; } else if (whenToStop < 188) { dz = -1.5; } else i...
I'll elaborate on @MadProgrammer's suggestion: Create a structure to hold the limit and deltas for each condition: ``` class Entry { int upper_limit; double delta_x; double delta_y; double delta_z; } ``` Then fill a List of structures with the data: ``` ArrayList<Entry> entries; entries.add(new Entry(60, 0...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
First hit on the if block could be something like: ``` double dx = 0, dy = 0, dz = 0; whenToStop++; if (whenToStop < 60) { dz = -1.5; } else if (whenToStop < 65) { dx = -1.2; } else if (whenToStop < 124) { dz = +1.5; } else if (whenToStop < 129) { dx = -1.2; } else if (whenToStop < 188) { dz = -1.5; } else i...
My modified version of OldCurmudgeons code. Make it a complete function (I assume the player is of PlayerType): ``` void move(PlayerType player, int step) { double dx = 0, dy = 0, dz = 0; int cycle = step % 128; if (cycle < 60) { dz = -1.5; } else if (cycle < 64) { dx = -1.2; } else if ...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
First hit on the if block could be something like: ``` double dx = 0, dy = 0, dz = 0; whenToStop++; if (whenToStop < 60) { dz = -1.5; } else if (whenToStop < 65) { dx = -1.2; } else if (whenToStop < 124) { dz = +1.5; } else if (whenToStop < 129) { dx = -1.2; } else if (whenToStop < 188) { dz = -1.5; } else i...
Loop can be rewritten as: ``` public void checkBytes(byte byte0) { double d1e = mc.thePlayer.posX - byte0; double d3e = mc.thePlayer.posY - byte0; double d5e = mc.thePlayer.posZ - byte0; for(double d1 = mc.thePlayer.posX + byte0; d1 > d1e; d1 -= 1.0) { for(double d3 = mc.thePlayer.posY + byte0;...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
I'll elaborate on @MadProgrammer's suggestion: Create a structure to hold the limit and deltas for each condition: ``` class Entry { int upper_limit; double delta_x; double delta_y; double delta_z; } ``` Then fill a List of structures with the data: ``` ArrayList<Entry> entries; entries.add(new Entry(60, 0...
My modified version of OldCurmudgeons code. Make it a complete function (I assume the player is of PlayerType): ``` void move(PlayerType player, int step) { double dx = 0, dy = 0, dz = 0; int cycle = step % 128; if (cycle < 60) { dz = -1.5; } else if (cycle < 64) { dx = -1.2; } else if ...
18,667,151
I'm making a sort of "hack" or "mod" for Minecraft. It'll delete the blocks around you, and move forward, delete more, move forward, etc. After a certain amount of time it'll move to the side and head back. It's like the world is slowly deleting itself :D ``` if(Camb.nuker){ whenToStop++; byte byte0 = 3; i...
2013/09/06
[ "https://Stackoverflow.com/questions/18667151", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752188/" ]
I'll elaborate on @MadProgrammer's suggestion: Create a structure to hold the limit and deltas for each condition: ``` class Entry { int upper_limit; double delta_x; double delta_y; double delta_z; } ``` Then fill a List of structures with the data: ``` ArrayList<Entry> entries; entries.add(new Entry(60, 0...
Loop can be rewritten as: ``` public void checkBytes(byte byte0) { double d1e = mc.thePlayer.posX - byte0; double d3e = mc.thePlayer.posY - byte0; double d5e = mc.thePlayer.posZ - byte0; for(double d1 = mc.thePlayer.posX + byte0; d1 > d1e; d1 -= 1.0) { for(double d3 = mc.thePlayer.posY + byte0;...
57,891,591
I want to auto renew certificate via certbot, but not working, got error "ImportError: No module named cryptography" **# ./certbot-auto --dry-run** Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt: Traceback (most recent call last): File "/opt/eff.org/certbot/venv/bin/let...
2019/09/11
[ "https://Stackoverflow.com/questions/57891591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6107217/" ]
Successfully installedI got the exact same error message after I ran certbot-auto and it upgraded to the new version. Here's how I solve this in my case: ``` pip install cryptography cd /opt/eff.org/certbot/venv/lib64/python2.7 mv site-packages site-packages.sav ln -s dist-packages/ site-packages ``` It's bec...
I also ran into this same problem when trying to renew my certbot certificate on AWS EC2 instance. I started by installing cryptography, then getting the virtual environment to look in the right directory for it, then there was another package that it couldn't find, and all the responses from github are that they don't...
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Don't surround the entire thing in quotes. It is looking for where ad\_id is `'Bmw_m3_cool_565440282, test'` Use ``` SELECT * FROM my_table WHERE ad_id IN ('Bmw_m3_cool_565440282', 'test') ``` A quick fix would be to change: ``` //this $solr_id_arr_imploded = implode(", ", $solr_id_arr); //to this $solr_id_arr_im...
Simple switch to `', '` in `implode()`: ``` implode("', '", $solr_id_arr); ``` This, together with the hardcoded quotes in the SQL string will format them as separate items.
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Don't surround the entire thing in quotes. It is looking for where ad\_id is `'Bmw_m3_cool_565440282, test'` Use ``` SELECT * FROM my_table WHERE ad_id IN ('Bmw_m3_cool_565440282', 'test') ``` A quick fix would be to change: ``` //this $solr_id_arr_imploded = implode(", ", $solr_id_arr); //to this $solr_id_arr_im...
Previous answers will work fine. Just make sure the strings themselves do not contain quotes. If they do, escape each string before you do the implode().
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Don't surround the entire thing in quotes. It is looking for where ad\_id is `'Bmw_m3_cool_565440282, test'` Use ``` SELECT * FROM my_table WHERE ad_id IN ('Bmw_m3_cool_565440282', 'test') ``` A quick fix would be to change: ``` //this $solr_id_arr_imploded = implode(", ", $solr_id_arr); //to this $solr_id_arr_im...
If it were my code I'd write it like this: ``` $solr_id_arr_imploded = "'" . implode("', '", $solr_id_arr) . "'"; $query = "SELECT * FROM my_table WHERE ad_id IN ($solr_id_arr_imploded)"; $qry_result = mysql_query($query) or die(mysql_error()); ``` ...just because it keeps all the quoting work in one place. You migh...
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Don't surround the entire thing in quotes. It is looking for where ad\_id is `'Bmw_m3_cool_565440282, test'` Use ``` SELECT * FROM my_table WHERE ad_id IN ('Bmw_m3_cool_565440282', 'test') ``` A quick fix would be to change: ``` //this $solr_id_arr_imploded = implode(", ", $solr_id_arr); //to this $solr_id_arr_im...
**This one seems complicated but it's more safer and fastest one** ``` function escaped($str) { return mysql_escape_string($str); } $arrayOfIds = array_map("escaped", $solr_id_arr); $solr_id_arr_imploded = implode(", ", $arrayOfIds); $query = "SELECT * FROM my_table WHERE ad_id IN ('$solr_id_arr_imploded')"; $qry...
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**This one seems complicated but it's more safer and fastest one** ``` function escaped($str) { return mysql_escape_string($str); } $arrayOfIds = array_map("escaped", $solr_id_arr); $solr_id_arr_imploded = implode(", ", $arrayOfIds); $query = "SELECT * FROM my_table WHERE ad_id IN ('$solr_id_arr_imploded')"; $qry...
Simple switch to `', '` in `implode()`: ``` implode("', '", $solr_id_arr); ``` This, together with the hardcoded quotes in the SQL string will format them as separate items.
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**This one seems complicated but it's more safer and fastest one** ``` function escaped($str) { return mysql_escape_string($str); } $arrayOfIds = array_map("escaped", $solr_id_arr); $solr_id_arr_imploded = implode(", ", $arrayOfIds); $query = "SELECT * FROM my_table WHERE ad_id IN ('$solr_id_arr_imploded')"; $qry...
Previous answers will work fine. Just make sure the strings themselves do not contain quotes. If they do, escape each string before you do the implode().
2,184,235
I have an array of ID:s, and the ID:s are in this format: ``` Bmw_330ci_89492822 ``` So it's a string! Now, I have this code to find whatever is in that array, in MySQL: (`$solr_id_arr` is the array I mentioned above, it contains string ID:s) ex: `$solr_id_arr[0]` outputs `Bmw_330ci_89492822` ``` $solr_id_arr_im...
2010/02/02
[ "https://Stackoverflow.com/questions/2184235", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
**This one seems complicated but it's more safer and fastest one** ``` function escaped($str) { return mysql_escape_string($str); } $arrayOfIds = array_map("escaped", $solr_id_arr); $solr_id_arr_imploded = implode(", ", $arrayOfIds); $query = "SELECT * FROM my_table WHERE ad_id IN ('$solr_id_arr_imploded')"; $qry...
If it were my code I'd write it like this: ``` $solr_id_arr_imploded = "'" . implode("', '", $solr_id_arr) . "'"; $query = "SELECT * FROM my_table WHERE ad_id IN ($solr_id_arr_imploded)"; $qry_result = mysql_query($query) or die(mysql_error()); ``` ...just because it keeps all the quoting work in one place. You migh...
712,487
I'm in the situation that IMAP/SSL connections from my PC to all imap servers are failing on my PC. ([more details there](https://superuser.com/questions/710904/ssl-imap-doesnt-work-from-some-machines-ssl-handshake-failure-how-to-narr)) After experimenting, I have now established that: * On the Win7 64bit host, `imap...
2014/02/04
[ "https://superuser.com/questions/712487", "https://superuser.com", "https://superuser.com/users/50211/" ]
*Theory:* If only the bridged networking works, then a software component on the host OS is messing up the traffic. *Confirmed:* Uninstalling the AV software (ESET Smart Security 5) fixed the problem. (I then re-installed the newer version 7, and the problem has not reappeared.)
The "problem" is that using Network Address Translation in Microsoft Virtual PC is firewalling your VM. Did SSL connections to your VM ever work behind a NAT? It has always been like that with VPC. NAT is a quick and easy way to get Internet access, but it does not give you local networking. Use normal networking and ...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
Here's a solution updated for Swashbuckle.AspNetCore 5.3.2, integrated with IdentityServer4, with an API secured using a Bearer token. In `ConfigureServices()` method: ```cs services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); options.AddSecurityD...
If you don't want to add a token manually and you want the scopes to be selectable along with passing a clientId to the identity server you can add something like this. I have used implicit flow, but you can configure any flow using the following mechanism: ```cs options.AddSecurityDefinition("oauth2", new OpenApiSec...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
If you don't want to add a token manually and you want the scopes to be selectable along with passing a clientId to the identity server you can add something like this. I have used implicit flow, but you can configure any flow using the following mechanism: ```cs options.AddSecurityDefinition("oauth2", new OpenApiSec...
In Accept answer you have to manually append "bearer" with token, this will create new issues, Swagger can append "bearer" with token watch this following link [JWT Authentication and Swagger with .NET Core 3 and 5 YouTube video](https://youtu.be/nmwUfjtkaTM)
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
Here's a solution updated for Swashbuckle.AspNetCore 5.3.2, integrated with IdentityServer4, with an API secured using a Bearer token. In `ConfigureServices()` method: ```cs services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); options.AddSecurityD...
In Accept answer you have to manually append "bearer" with token, this will create new issues, Swagger can append "bearer" with token watch this following link [JWT Authentication and Swagger with .NET Core 3 and 5 YouTube video](https://youtu.be/nmwUfjtkaTM)
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
After some research, I eventually found the answer [here](https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/696) Before seeing this page, I knew that I should use `AddSecurityRequirement` after `AddSecurityDefinition` because of many samples, but it was a problem that the function parameters have change...
If anyone is using NSwag and has landed here after searching the solution, here is the link from the official documentation. [NSwag Enable JWT authentication](https://github.com/RicoSuter/NSwag/wiki/AspNetCore-Middleware#enable-jwt-authentication) PS: *I know the original question was for SwashBuckle, but Google show...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
In the accepted answer, "Bearer " is required to be written before the actual token. A similar approach in which typing **"Bearer " can be skipped** is the following: ```cs c.SwaggerDoc("v1", new OpenApiInfo { Title = "Example API", Version = "v1" }); c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { ...
If anyone is using NSwag and has landed here after searching the solution, here is the link from the official documentation. [NSwag Enable JWT authentication](https://github.com/RicoSuter/NSwag/wiki/AspNetCore-Middleware#enable-jwt-authentication) PS: *I know the original question was for SwashBuckle, but Google show...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
Here's a solution updated for Swashbuckle.AspNetCore 5.3.2, integrated with IdentityServer4, with an API secured using a Bearer token. In `ConfigureServices()` method: ```cs services.AddSwaggerGen(options => { options.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); options.AddSecurityD...
If anyone is using NSwag and has landed here after searching the solution, here is the link from the official documentation. [NSwag Enable JWT authentication](https://github.com/RicoSuter/NSwag/wiki/AspNetCore-Middleware#enable-jwt-authentication) PS: *I know the original question was for SwashBuckle, but Google show...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
If you are using Swagger 3.0 then it has build-in support for JWT authentication. You need to use ParameterLocation.Header, SecuritySchemeType.Http, bearer, and JWT in OpenApiSecurityScheme as shown below. After this, you **wouldn't need to specify token in Bearer {token} format**. Only specify the token and the secu...
In Accept answer you have to manually append "bearer" with token, this will create new issues, Swagger can append "bearer" with token watch this following link [JWT Authentication and Swagger with .NET Core 3 and 5 YouTube video](https://youtu.be/nmwUfjtkaTM)
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
If anyone is using NSwag and has landed here after searching the solution, here is the link from the official documentation. [NSwag Enable JWT authentication](https://github.com/RicoSuter/NSwag/wiki/AspNetCore-Middleware#enable-jwt-authentication) PS: *I know the original question was for SwashBuckle, but Google show...
In Accept answer you have to manually append "bearer" with token, this will create new issues, Swagger can append "bearer" with token watch this following link [JWT Authentication and Swagger with .NET Core 3 and 5 YouTube video](https://youtu.be/nmwUfjtkaTM)
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
If you are using Swagger 3.0 then it has build-in support for JWT authentication. You need to use ParameterLocation.Header, SecuritySchemeType.Http, bearer, and JWT in OpenApiSecurityScheme as shown below. After this, you **wouldn't need to specify token in Bearer {token} format**. Only specify the token and the secu...
In the accepted answer, "Bearer " is required to be written before the actual token. A similar approach in which typing **"Bearer " can be skipped** is the following: ```cs c.SwaggerDoc("v1", new OpenApiInfo { Title = "Example API", Version = "v1" }); c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme { ...
58,179,184
I want to have a subpage on my website that is password protected. There should be a list of 6-digit passwords that allow access to the site. However, I don't want the user to type in a username. He should only type in one of the 6-digit passwords. Any ideas, how I can accomplish this?
2019/10/01
[ "https://Stackoverflow.com/questions/58179184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2524457/" ]
If you are using Swagger 3.0 then it has build-in support for JWT authentication. You need to use ParameterLocation.Header, SecuritySchemeType.Http, bearer, and JWT in OpenApiSecurityScheme as shown below. After this, you **wouldn't need to specify token in Bearer {token} format**. Only specify the token and the secu...
If you don't want to add a token manually and you want the scopes to be selectable along with passing a clientId to the identity server you can add something like this. I have used implicit flow, but you can configure any flow using the following mechanism: ```cs options.AddSecurityDefinition("oauth2", new OpenApiSec...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
One core, with or without hyper-threading, can simulate any number of virtual cores, simply by timeslicing. However, this produces all kinds of problems because the operating systems expect that code running at the same time will actually interleave. Overprovisioning can lead to performance drops so great the system ca...
If you allocate 4 cores you get 4 cores in the VM. However almost all the time you're better off just allocating 1 because you add a lot of overhead every time you add another core. You can have a maximum of 5 cores in your case, if you go over that into the red area your virtual machine will become unstable. Virtual...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
If you allocate 4 cores you get 4 cores in the VM. However almost all the time you're better off just allocating 1 because you add a lot of overhead every time you add another core. You can have a maximum of 5 cores in your case, if you go over that into the red area your virtual machine will become unstable. Virtual...
The processor i7 3930K has VT-x. > > Intel® Virtualization Technology (VT-x) allows one hardware platform > to function as multiple “virtual” platforms. It offers improved > manageability by limiting downtime and maintaining productivity by > isolating computing activities into separate partitions. > > > That ...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
If you allocate 4 cores you get 4 cores in the VM. However almost all the time you're better off just allocating 1 because you add a lot of overhead every time you add another core. You can have a maximum of 5 cores in your case, if you go over that into the red area your virtual machine will become unstable. Virtual...
In my case, using 6 out of 8 CPUs in a 4 core 8 thread processor was faster in tests than 4 out of 8, despite VirtualBox cautioning that I may get degradation. So I think that VirtualBox prevents one from shooting oneself in the foot if one is a newbie and will complain about slowness, while as a superuser you may d...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
One core, with or without hyper-threading, can simulate any number of virtual cores, simply by timeslicing. However, this produces all kinds of problems because the operating systems expect that code running at the same time will actually interleave. Overprovisioning can lead to performance drops so great the system ca...
The processor i7 3930K has VT-x. > > Intel® Virtualization Technology (VT-x) allows one hardware platform > to function as multiple “virtual” platforms. It offers improved > manageability by limiting downtime and maintaining productivity by > isolating computing activities into separate partitions. > > > That ...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
One core, with or without hyper-threading, can simulate any number of virtual cores, simply by timeslicing. However, this produces all kinds of problems because the operating systems expect that code running at the same time will actually interleave. Overprovisioning can lead to performance drops so great the system ca...
In my case, using 6 out of 8 CPUs in a 4 core 8 thread processor was faster in tests than 4 out of 8, despite VirtualBox cautioning that I may get degradation. So I think that VirtualBox prevents one from shooting oneself in the foot if one is a newbie and will complain about slowness, while as a superuser you may d...
540,407
I have an Intel Core i7 3930K with 6 CPU cores. Now, I understand that every of that cores can handle 2 separate threads. That makes 12 virtual cores - which I can see using my system monitor (see screenshot below). But when I create a virtual machine using the VirtualBox software from Oracle, I suddenly can allocate ...
2013/01/23
[ "https://superuser.com/questions/540407", "https://superuser.com", "https://superuser.com/users/189848/" ]
In my case, using 6 out of 8 CPUs in a 4 core 8 thread processor was faster in tests than 4 out of 8, despite VirtualBox cautioning that I may get degradation. So I think that VirtualBox prevents one from shooting oneself in the foot if one is a newbie and will complain about slowness, while as a superuser you may d...
The processor i7 3930K has VT-x. > > Intel® Virtualization Technology (VT-x) allows one hardware platform > to function as multiple “virtual” platforms. It offers improved > manageability by limiting downtime and maintaining productivity by > isolating computing activities into separate partitions. > > > That ...
35,896,284
I have my AVD emulator running in Android Studio, and want to store a file on the emulated device. Using the push and pull buttons does not seem to store the device, while the console is not reporting any errors. Just dragging the file into the /mnt/sdcard folder or root or any other folder does not seem to store the ...
2016/03/09
[ "https://Stackoverflow.com/questions/35896284", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3095561/" ]
You can force refresh by killing and restarting the Android Debug Bridge process. ``` adb kill-server adb start-server ```
Reselecting the same device in the Device File Explorer also seems to do the trick! [Android Studio Dolphin Device File Explorer](https://i.stack.imgur.com/QcTXL.png)
543,256
I have the follow data set name a.txt with 9003 rows: ``` 571 43544000424023503222 572 43504442020202303202 573 40340440323043033204 574 40303445340343505242 ... ... 16078 50200000023322000202 16079 33233500320452300252 16080 04200330233532050502 16081 30200400323435434202 ``` I want to get a data file with v...
2019/09/23
[ "https://unix.stackexchange.com/questions/543256", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/362318/" ]
You don't need the `-` flag (left-align), the default alignment is right-align: ``` awk '{printf "%5s %s\n",$1,$2}' a.txt ```
You can use `printf`'s string length modifier to format the string right justified. `len` is the length of the spacing which precedes the first field. ``` awk '{len=5-length($1); printf "%-*.*s %s %s\n", len,len," ",$1,$2}' a.txt ```
4,573,875
I have a list li: ``` [ {name: "Tom", age: 10}, {name: "Mark", age: 5}, {name: "Pam", age: 7} ] ``` I want to get the index of the item that has a certain name. For example, if I ask for "Tom" it should give me: 0. "Pam" should give me 2.
2011/01/01
[ "https://Stackoverflow.com/questions/4573875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/559741/" ]
``` >>> from operator import itemgetter >>> map(itemgetter('name'), li).index('Tom') 0 >>> map(itemgetter('name'), li).index('Pam') 2 ``` If you need to look up a lot of these from the same list, creating a dict as done in Satoru.Logic's answer, is going to be a lot more efficent
You may index the dicts by `name` ``` people = [ {'name': "Tom", 'age': 10}, {'name': "Mark", 'age': 5} ] name_indexer = dict((p['name'], i) for i, p in enumerate(people)) name_indexer.get('Tom', -1) ```
18,402,004
Basically in my ASP.NET MVC4 project I'm trying to have my validationmessages as tooltips (which gets displayed when hovered over a certain image). Right now the error message is inserted into the image title - however I'd like to ONLY display the image when it has a title (when it doesn't have a title there is no erro...
2013/08/23
[ "https://Stackoverflow.com/questions/18402004", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2577209/" ]
Here is the pure CSS solution. **The CSS Code:** ``` img{display:none;} img[title]{display:block;} ``` Here is a **[WORKING DEMO](http://jsfiddle.net/KdUru/)** **The HTML:** ``` <img src="https://www.google.co.in/images/srpr/logo4w.png" /> <img src="https://www.google.co.in/images/srpr/logo4w.png" /> <img src="ht...
Only display images with a title? ``` $('img').filter(function(i, el){ return !$(el).prop('title'); // (empty/undefined titles evaluates as false) }).hide(); ``` Is this what you're asking for? Perhaps this css selector is enough (will only work in modern browsers): ``` img:not([title]) { display: none...
473,312
We store database backups encrypted with **PGP Command Line 9.7.0**. Files look like **2009.bak.pgp** Here's command line used to backup these files: ``` pgp --encrypt F:\2009.bak --recipient admin@company.mail --encrypt-to-self --input-cleanup off --temp-dir F:\TEMP\ -v ``` All of these backups were restored j...
2013/01/29
[ "https://serverfault.com/questions/473312", "https://serverfault.com", "https://serverfault.com/users/-1/" ]
Decompression happens after decryption, so it's theoretically possible to get GPG to write out the compressed data stream. I'm not sure there's a stock option to do that-- you'll probably have to hack around in the source. Once you've got the corrupt data stream, though, I'm [not sure you're going to have much hope](...
Contact a data recovery company, I've had great success with www.ESSDataRecovery.com (1.800.237.4200) and they give free estimates. They may be able to either recover the backup file or the original data, if you still have the media it was on. They've probably worked with corrupt PGP files before. Also get in touch wi...
93,914
I am trying to create a process via Lightning process builder. Basically it checks whether the opportunity belongs to a particular record type and if it is then sets the owner as a specific user. By default it appears and I have not added it to the above process. [![enter image description here](https://i.stack.imgu...
2015/09/27
[ "https://salesforce.stackexchange.com/questions/93914", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/7755/" ]
It is there to allow you to add an additional logic check. Other than being an empty spot on the page it is not doing anything. At this point you just have to "deal with it" as it is purely aesthetics...and cannot currently be removed
I think you are asking this because you cant activate this Process Builder. It is not the extra criteria that is the issue. As the others have said, this is aesthetic and should be ignored. The reason you cant activate it is you have no action if the first criteria is TRUE.
9,419,425
I have the following code: ``` void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& ioCounterStats, std::map <std::string, long long >& ioGaugeStats, bool iSwitch) { // Before getting the stats, clear the containers ...
2012/02/23
[ "https://Stackoverflow.com/questions/9419425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268822/" ]
You can't reassign a reference once it has been created. Instead every use of it will "refer" to the original assignment. Your first example is equivalent to: ``` ioCounterStats /*lStats*/ = ioGaugeStats; ```
Yes, it is completely valid. However, as you noted, it doesn't always do what you expected. Primary: REFERENCES ARE NOT POINTERS. THERE IS A BIGGER DIFFERENCE THAN . vs ->. As you noted, a pointer points to the address of an object (or null), and can be changed at any time. A reference, is a reference to a particula...
9,419,425
I have the following code: ``` void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& ioCounterStats, std::map <std::string, long long >& ioGaugeStats, bool iSwitch) { // Before getting the stats, clear the containers ...
2012/02/23
[ "https://Stackoverflow.com/questions/9419425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268822/" ]
You can't reassign a reference once it has been created. Instead every use of it will "refer" to the original assignment. Your first example is equivalent to: ``` ioCounterStats /*lStats*/ = ioGaugeStats; ```
You can't change which container a reference refers to after initialisation, but you can use the flag to control which one it is initialised to. If you want the lSwitch flag to control which container you refer to you can do so like this: ``` void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& i...
9,419,425
I have the following code: ``` void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& ioCounterStats, std::map <std::string, long long >& ioGaugeStats, bool iSwitch) { // Before getting the stats, clear the containers ...
2012/02/23
[ "https://Stackoverflow.com/questions/9419425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/268822/" ]
You can't change which container a reference refers to after initialisation, but you can use the flag to control which one it is initialised to. If you want the lSwitch flag to control which container you refer to you can do so like this: ``` void cStatisticDBSerializer::GetStats (std::map <std::string, long long >& i...
Yes, it is completely valid. However, as you noted, it doesn't always do what you expected. Primary: REFERENCES ARE NOT POINTERS. THERE IS A BIGGER DIFFERENCE THAN . vs ->. As you noted, a pointer points to the address of an object (or null), and can be changed at any time. A reference, is a reference to a particula...
6,211,551
I'm toying with the idea of a pet project.. I wanna make our coffee machine remote controlled by a web interface. The idea is to hit a "make me coffee button" and have it poll the router get the MAC address list to see who's in the office and send them a growl notification (we all use macs) asking if they'd like coff...
2011/06/02
[ "https://Stackoverflow.com/questions/6211551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/415286/" ]
Not as far as the client is concerned, no. The difference for the server is that you have the full power of PHP to do something with before initiating the download, which is not the case if Apache handles the download directly. It also means that the whole cruft of PHP needs to be loaded and executed before a download...
***If*** your "normal" download would supply *those exact headers*, then ***no***. However, a number of things could cause the server to decide to send different headers: * If **[gzip](http://en.wikipedia.org/wiki/Gzip#Other_uses)** is turned on (and browser accepts it) * If the [request](http://en.wikipedia.org/wiki...
6,211,551
I'm toying with the idea of a pet project.. I wanna make our coffee machine remote controlled by a web interface. The idea is to hit a "make me coffee button" and have it poll the router get the MAC address list to see who's in the office and send them a growl notification (we all use macs) asking if they'd like coff...
2011/06/02
[ "https://Stackoverflow.com/questions/6211551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/415286/" ]
Not as far as the client is concerned, no. The difference for the server is that you have the full power of PHP to do something with before initiating the download, which is not the case if Apache handles the download directly. It also means that the whole cruft of PHP needs to be loaded and executed before a download...
I would think this would also let you create a download for a resource that is normally forbidden for a user to directly access. It also seems like you could use this for a file that only exists in memory, without having to write it out to disk first.
6,211,551
I'm toying with the idea of a pet project.. I wanna make our coffee machine remote controlled by a web interface. The idea is to hit a "make me coffee button" and have it poll the router get the MAC address list to see who's in the office and send them a growl notification (we all use macs) asking if they'd like coff...
2011/06/02
[ "https://Stackoverflow.com/questions/6211551", "https://Stackoverflow.com", "https://Stackoverflow.com/users/415286/" ]
***If*** your "normal" download would supply *those exact headers*, then ***no***. However, a number of things could cause the server to decide to send different headers: * If **[gzip](http://en.wikipedia.org/wiki/Gzip#Other_uses)** is turned on (and browser accepts it) * If the [request](http://en.wikipedia.org/wiki...
I would think this would also let you create a download for a resource that is normally forbidden for a user to directly access. It also seems like you could use this for a file that only exists in memory, without having to write it out to disk first.
35,570,980
I have some code that generates a sidebar menu on my Wordpress site as below... ``` <ul> <?php if($post->post_parent) $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=1"); else $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=1...
2016/02/23
[ "https://Stackoverflow.com/questions/35570980", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1408126/" ]
You can do this through jquery ``` $(document).ready(function(){ $("ul").find("li").each(function(){ $(this).addClass("YourClass"); }) }) ```
Your can your Walker Class to simply extend the output of `wp_list_pages` modify your `$output` put the Class in `functions.php` ``` class NS_CS_Walker extends Walker_page { function start_el( &$output, $page, $depth, $args, $current_page ) { if ( $depth ) { $indent = str_repeat( "\t", $depth )...
108,191
**[EDIT 6-december-2020]** In my network I experience the same issue also in a raspberry pi v4, with the Raspberry OS image date December 2nd 2020 \*\* Original post \*\* I am using Raspbian Buster on a raspberry pi 3b v2 (and a raspberry pi 4b v1.2) and I followed the @Ingo answer in this [post](https://raspberrypi....
2020/02/09
[ "https://raspberrypi.stackexchange.com/questions/108191", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/104132/" ]
It appears that it was sufficient to add the `AllSlaveActive=1` option to the `02-bond0.netdev file` described in @Ingo answer. In this way the ARP packet sent back by the router through the wlan0 interface is forwarded to the bond0 one and the ARP table is always populated. In order to set this parameter the restart o...
According to the commands output you have given about the configuration, bonding looks good so far. That all interfaces have the same mac address is due to bonding and will not confuse the fritz box router. Quite contrary it ensures that it does not sense the change of an interface on the fly because the mac address do...
61,563,293
I set up a new Blazor.NET project in Visual Studio 2019 (preview 5) and add Azure AD B2C (AADB2C) and deploy it to an Azure Docker AppService. If I don't enable OAuth2 implicit flow in AADB2C, then I get the following error using an AADB2C V2 Sign-In-Flow: ``` error=unauthorized_client&error_description=AADB2C90057%...
2020/05/02
[ "https://Stackoverflow.com/questions/61563293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1480500/" ]
In the main component where you listen to changes formBuilder does not have any validations. Only in child components they are validated. If you listen changes in child components you might see form is not always valid. You can listen in child components and emit them to the main component using an `EventEmitter` or y...
The childs have their own forms and are not linked to the parent form os you need to pass the formgroups to the child components: ``` <form [formGroup]="form"> <child1 [form]="form.get('child1')></child1> <child2 [form]="form.get('child2')></child2> </form> ```
9,041,406
In Chrome and Safari, `$("body").scrollTop(1000)` goes where expected. In IE and FF, nothing happens. In IE and FF, `$(window).scrollTop(1000)` works, but they go to different places. It also works in Chrome and Safari, but they both go to a different place as well. They seems to be up to 300-500 pixels off. Is ther...
2012/01/27
[ "https://Stackoverflow.com/questions/9041406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673882/" ]
`$(jQuery.browser.webkit ? "body": "html").animate({ scrollTop: myTop }, myDur);` Webkit browsers (Chrome/Safari, both Mac and Win) use "body", others (FF/Opera/IE 7-9) use "html" Gotta love browser detection.
Try ``` $(document).scrollTop("..."); ```
9,041,406
In Chrome and Safari, `$("body").scrollTop(1000)` goes where expected. In IE and FF, nothing happens. In IE and FF, `$(window).scrollTop(1000)` works, but they go to different places. It also works in Chrome and Safari, but they both go to a different place as well. They seems to be up to 300-500 pixels off. Is ther...
2012/01/27
[ "https://Stackoverflow.com/questions/9041406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673882/" ]
Try ``` $(document).scrollTop("..."); ```
You need to apply `scrollTop` to either `body` or `html` depending on the browser, but there's no harm applying it to both. Since `.scrollTop()` applies to the *first* element in the set, but `.animate()` applies to all elements, you can do this: ``` $('body, html').animate({ scrollTop: 1000 }, 'fast'); ``` If you...
9,041,406
In Chrome and Safari, `$("body").scrollTop(1000)` goes where expected. In IE and FF, nothing happens. In IE and FF, `$(window).scrollTop(1000)` works, but they go to different places. It also works in Chrome and Safari, but they both go to a different place as well. They seems to be up to 300-500 pixels off. Is ther...
2012/01/27
[ "https://Stackoverflow.com/questions/9041406", "https://Stackoverflow.com", "https://Stackoverflow.com/users/673882/" ]
`$(jQuery.browser.webkit ? "body": "html").animate({ scrollTop: myTop }, myDur);` Webkit browsers (Chrome/Safari, both Mac and Win) use "body", others (FF/Opera/IE 7-9) use "html" Gotta love browser detection.
You need to apply `scrollTop` to either `body` or `html` depending on the browser, but there's no harm applying it to both. Since `.scrollTop()` applies to the *first* element in the set, but `.animate()` applies to all elements, you can do this: ``` $('body, html').animate({ scrollTop: 1000 }, 'fast'); ``` If you...
52,631,807
For my current project, I have an address lookup for the user to enter an address. In it's default state, its results are too ambiguous, and the lookup returns all locations even if it isn't actually an address (eg some of the locations in the list are an entire city or region). Adding `types: ['address']` to the quer...
2018/10/03
[ "https://Stackoverflow.com/questions/52631807", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7310247/" ]
So it turns out that it's only really in the UK that postcodes are tied to physical addresses at street level (you can literally give the house number and postcode as a complete and valid address), while in the rest of Europe a postcode represents a whole region, hence Google considers postcodes as regions throughout. ...
This came up as the top result for this question, but is massively outdated. So for anyone looking for a more in-depth search, set Google's Autocomplete to `geocode` and you can search by: * Street name * District * Town * City * Postcode Ace!
38,296,744
I am trying to display all the user\_name from my sql [![My sql stuff](https://i.stack.imgur.com/bvhvk.png)](https://i.stack.imgur.com/bvhvk.png) how can i make all the user\_name show up with line breaks after each name?" my code ``` <?php include_once 'dbconnect.php'; $res = mysql_query("SELECT 'user_name' FROM `...
2016/07/10
[ "https://Stackoverflow.com/questions/38296744", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5210340/" ]
This should be all over the internet. A simple google search is all. ``` SELECT user_name FROM users; ``` Make sure you have a connection first: ``` if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } ```
Usually when nothing is shown, this has to do with a false being printed out as nothing. Can you changing echo $row to echo "something awesome: ".$row;. If you see the "something awesome: " then you know your query doesn't return anything. Second of all, you **don't iterate** thought your results, you just echo one ro...
233,344
I am doing a study in which I am measuring a set of lengths using two different methods. I want to test how close the measurements given by the two methods are for corresponding lengths. Is there a way to do this? I know that a matched pairs t-test can give a p-value for the means being different, but how can I test ho...
2016/09/04
[ "https://stats.stackexchange.com/questions/233344", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/130011/" ]
I think you are mixing different tools and different goals. I summarize several techniques available for what I understand you want to do: * t-test for paired samples tests the hypothesis that both mesures have the same mean and gives a p-value about it. * Confidence intervals estimate an interval where the true diffe...
I believe the simplest way to answer your question would be to make a scatter plot with the following bivariate data for each measurement method you wish to test: x=actual length, y=measured length by (insert method here). If your method was perfect, there would indeed be a y=x least squares line with a sample correlat...
233,344
I am doing a study in which I am measuring a set of lengths using two different methods. I want to test how close the measurements given by the two methods are for corresponding lengths. Is there a way to do this? I know that a matched pairs t-test can give a p-value for the means being different, but how can I test ho...
2016/09/04
[ "https://stats.stackexchange.com/questions/233344", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/130011/" ]
I think you are mixing different tools and different goals. I summarize several techniques available for what I understand you want to do: * t-test for paired samples tests the hypothesis that both mesures have the same mean and gives a p-value about it. * Confidence intervals estimate an interval where the true diffe...
You are seeking to quantify the agreement of these two measurements (see [Wikipedia](https://en.wikipedia.org/wiki/Inter-rater_reliability) and/or [John Uebersax's site](http://www.john-uebersax.com/stat/agree.htm)). A simple measure of the agreement between two continuous variables would be [Lin's concordance coeffici...