qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
74,546,731
So I'm trying to lexicographically sort this collection but with no success. The same unsorted collection is in the input and the output of the sort method. ``` class Person { private String privateName; private String lastName; public Person(String privateName, String lastName) { this.privateNam...
2022/11/23
[ "https://Stackoverflow.com/questions/74546731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16076953/" ]
Your problem is that you are converting your Collection/ArrayList to an array and then sort that Array. Sorting that Array will have no effect on the original ArrayList. If you want to sort your List you first need to declare it as a List, because Collections themself have no predefined order and therefor no sort met...
Plot twist The following ``` public static void main(String[] args) { Person[] peopleArray = { new Person("aaa", "hhh"), new Person("aaa", "aaa"), new Person("aaa", "uuu") }; Collection<Person> people = Arrays.asList(peo...
10,843,929
Really stuck with this question in my homework assignment. Everything works, but when there is a space (`' '`) in the `p`. I need to stop the process of creating `can`. For example, if I submit: ``` rankedVote("21 4", [('AB', '132'), ('C D', ''), ('EFG', ''), ('HJ K', '2 1')]) ``` I would like to have: ``` ['C D...
2012/06/01
[ "https://Stackoverflow.com/questions/10843929", "https://Stackoverflow.com", "https://Stackoverflow.com/users/138737/" ]
Managed arrays are different than pointers. A managed array requires the size of the array, and if you're trying to marshal a struct, it requires a fixed size to marshal directly. You can use the `SizeConst` parameter of the [`MarshalAs` attribute](http://msdn.microsoft.com/en-us/library/system.runtime.interopservices...
My guess is that it is: ``` [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public class IMAGE { public UInt32 x; public UInt32 y; public ref IntPtr data; }; ``` A very handy reference is the p/invoke [cheatsheet](http://khason.net/blog/pinvoke-cheat-sheet/).
57,846
It is not possible to prove being a human!!! There is no text to read. Checked adblocker, nothing blocked. Update: To repro: 1. Open question 2. Enter 'abc' 3. Click 'Post answer' 4. Get the expected error that message is too short 5. Click 'Post answer' again 6. Presented with 'empty' CAPTCHA Here is the HTML I ...
2010/07/21
[ "https://meta.stackexchange.com/questions/57846", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/15541/" ]
Some general pointers to debug this: 1. Check the JavaScript console for errors. 2. Is scripting allowed? 3. Try again after a few minutes; maybe there was a problem with the captcha provider 4. Are you behind a proxy? 5. I guess the captcha is embedded using an `iframe` or something like that. Check the source code o...
We can't reproduce this in any browser.
7,027,196
I want make an authentication system for my app along the lines of [SUAS](https://github.com/aht/suas), except instead of using SHA256 for hashing passwords I'd like to [use bcrypt](http://codahale.com/how-to-safely-store-a-password) or scrypt. Unfortunately both py-bcrypt and scrypt for python use native c, which is u...
2011/08/11
[ "https://Stackoverflow.com/questions/7027196", "https://Stackoverflow.com", "https://Stackoverflow.com/users/877300/" ]
Scrypt and BCrypt are both extremely processor-intensive (by design). Because of this, I very much doubt any pure-python implementation is going to be fast enough to be secure - that is, be able to hash using a sufficient number of rounds within a reasonable amount of time. I can personally attest to this, I've tried...
This [guy](http://groups.google.com/group/google-appengine-python/browse_thread/thread/36fe567ccece8e14) ported py-bcrypt to pure python so you can use it on GAE: <https://github.com/erlichmen/py-bcrypt>
10,953,401
I was thinking to do this server side, but what i was wanting to do was disable the telerik control called the "Editor." Located at the site: [telerick editor control](http://demos.telerik.com/aspnet-ajax/editor/examples/overview/defaultcs.aspx). My reasoning behind this was that I wanted to give a user the exact look...
2012/06/08
[ "https://Stackoverflow.com/questions/10953401", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1404049/" ]
Create an xml file per each icon you wan to show in the action bar in the 'drawable' directory like the one below: ``` <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/menuitem_bk"/> <item android:drawable="@drawab...
As a workaround you could always have different icons for your localization. There is nothing stopping you having: ``` /drawable-fr/ /drawable-us/ ``` On the other hand if you believe it is something to do with the Theme you are inheriting you could look through the source code for the DarkActionBar and then extend ...
15,942,952
I have written an app that performs some lengthy operations, such as web requests, in a background thread. My problem is that after a while the automatic screen lock turns the screen off and my operations are aborted. Is there a way to prevent the screen to be automatically turned off during these operations? Or is i...
2013/04/11
[ "https://Stackoverflow.com/questions/15942952", "https://Stackoverflow.com", "https://Stackoverflow.com/users/438906/" ]
The screen can be forced to stay on using the `UserIdleDetectionMode` property of the current `PhoneApplicationService`. To disable automatic screen lock: ``` PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; ``` To enable it again: ``` PhoneApplicationService.Current.UserIdleDet...
I know this question is about Windows Phone 8, but I had a hard time figuring out the way for Windows Phone 8.1 (Universal XAML Apps). Use: ``` var displayRequest = new Windows.System.Display.DisplayRequest(); displayRequest.RequestActive(); ``` > > Apps that show video or run for extended periods without user inp...
317,167
Let $f$ be continuous on $\mathbb{R}$ and $A$, a subset of the reals, be open. Prove that $f^{-1}(A) := \{x \in \mathbb{R}:f(x) \in A\}$ is open.
2013/02/28
[ "https://math.stackexchange.com/questions/317167", "https://math.stackexchange.com", "https://math.stackexchange.com/users/64416/" ]
Recall the definition of continuity: **DEF** A function $f:A\to \Bbb R$ is continuous at $a\in A$ if for every $\epsilon >0$ there exists a $\delta >0$ such that $$|x-a|<\delta\implies |f(x)-f(a)|<\epsilon$$ Put this in terms of open balls: **DEF** A function $f:A\to \Bbb R$ is continuous at $a\in A$ if for every ba...
Let $a$ is a point of $f^{-1}(A)$. By def. of $f^{-1}(A)$, $f(a)$ is an element of $A$. Since $A$ is open, there exists $r>0$ such that $B(f(a),r)\subset A$. Because $f$ is continous, there exists $\delta>0$ such that $$|x-a|<\delta \implies |f(x)-f(a)|<r$$ for all $x$. If you show that $B(a,\delta)\subset f^{-1}(A)$,...
408,554
I am currently using Monit to monitor Apache and restart it if its memory usage is too high. However, I'd also like to be able to monitor the individual apache2 subprocesses that are spawned, and kill any subprocess whose memory usage is too high over a period of a few minutes. How can I do that?
2012/07/17
[ "https://serverfault.com/questions/408554", "https://serverfault.com", "https://serverfault.com/users/103498/" ]
Monit's documentation suggests that you can natively monitor the total memory used by Apahce and its child processes, not any individual child process. However, you can check the return status of a script using the `check program` test: <http://mmonit.com/monit/documentation/monit.html#program_status_testing> So, yo...
I accepted cjc's answer above, but wanted to post exactly how I used his suggestion to solve this problem. Note that you will need to use at least Monit 5.3 to use Monit's "check program". I am running Debian. /usr/local/bin/monit\_check\_apache2\_children: ``` #!/usr/bin/env bash log_file=/path/to/monit_check_apach...
202,758
OK just before I start, I **do** know what does and doesn't constitute [valid housing](https://gaming.stackexchange.com/questions/22408/how-do-i-build-a-house-for-my-npcs) in Terraria. I'm also playing v1.2.4.1 What I'd like to know is does the "must have a door" requirement also mean "must be accessible", or can I cr...
2015/01/23
[ "https://gaming.stackexchange.com/questions/202758", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/77650/" ]
The structure does not have to be "accessible" with a door; as in you can create a switched active block entry way so that Blood Moon/Eclipse mobs can't get in. You can also create a double door entry way, where the outer door is the switched active blocks. Another way, would be to place a platform, container or decor...
I would say these are all valid if the requirements fit. But you need to remember that the need to teleport into there houses wich means that you have to leave the place. Second you need to think about monsters spawning in your house eg. Goblin Army. third how will you talk with those npcs ?
202,758
OK just before I start, I **do** know what does and doesn't constitute [valid housing](https://gaming.stackexchange.com/questions/22408/how-do-i-build-a-house-for-my-npcs) in Terraria. I'm also playing v1.2.4.1 What I'd like to know is does the "must have a door" requirement also mean "must be accessible", or can I cr...
2015/01/23
[ "https://gaming.stackexchange.com/questions/202758", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/77650/" ]
Assuming that all of those have walls and a light source, those would count as valid housing. The requirement is that it has a door, not that the door go anywhere. Also notable is that [wooden platforms count as doors for the housing rule](http://terraria.gamepedia.com/Guide:Base_defense_and_precautions#Reminder), so y...
I would say these are all valid if the requirements fit. But you need to remember that the need to teleport into there houses wich means that you have to leave the place. Second you need to think about monsters spawning in your house eg. Goblin Army. third how will you talk with those npcs ?
202,758
OK just before I start, I **do** know what does and doesn't constitute [valid housing](https://gaming.stackexchange.com/questions/22408/how-do-i-build-a-house-for-my-npcs) in Terraria. I'm also playing v1.2.4.1 What I'd like to know is does the "must have a door" requirement also mean "must be accessible", or can I cr...
2015/01/23
[ "https://gaming.stackexchange.com/questions/202758", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/77650/" ]
Assuming that all of those have walls and a light source, those would count as valid housing. The requirement is that it has a door, not that the door go anywhere. Also notable is that [wooden platforms count as doors for the housing rule](http://terraria.gamepedia.com/Guide:Base_defense_and_precautions#Reminder), so y...
The structure does not have to be "accessible" with a door; as in you can create a switched active block entry way so that Blood Moon/Eclipse mobs can't get in. You can also create a double door entry way, where the outer door is the switched active blocks. Another way, would be to place a platform, container or decor...
434,429
How much mass can you levitate with air? Take air hockey table for example, pressurised air is pushed through holes and they levitate a disk but how much mass is possible? I think it would probably depend on three things; the mass of the disk, the surface area of the disk and the air pressure. (Possibly on the size an...
2018/10/14
[ "https://physics.stackexchange.com/questions/434429", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/154711/" ]
This is a "how long is a piece of string" question - there isn't really any limit. Four of [these devices](http://www.movetechuk.com/hovairairskates.html) can levitate 240 tons. Use more than four, and you can levitate "thousands of tons" according to the manufacturer's website.
The table can be modeled as a porous medium (using Darcy's law) with a constant air pressure reservoir beneath it. The flow interaction between the puck and the table can be modeled as a aerodynamic lubrication flow, involving the same viscous flow equations as for hydrodynamic lubrication, but with a compressible flui...
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
It is because `$pdo->errorInfo()` refers to the last statement that was successfully executed. Since `$sql->execute()` returns false, then it cannot refer to that statement (either to nothing or to the query before). As to why `$sql->execute()` returns false, I don't know... either there is a problem with your `$param...
I Faced the similar problem , This occurs manly due to **error in query**, try to **run your query in php-myadmin** or any other query runner and **confirm** that your **query is working** fine. Even if our query syntax is correct other simple errors like leaving null or not mentioan a column that set as not null...
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
It is because `$pdo->errorInfo()` refers to the last statement that was successfully executed. Since `$sql->execute()` returns false, then it cannot refer to that statement (either to nothing or to the query before). As to why `$sql->execute()` returns false, I don't know... either there is a problem with your `$param...
I was getting this error at one time. I only got it on one server for all failures. A different server would report the error correctly for the same errors. That led me to believe it was a MySQL client configuration error. I never solved the specific error, but check your configurations.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
It is because `$pdo->errorInfo()` refers to the last statement that was successfully executed. Since `$sql->execute()` returns false, then it cannot refer to that statement (either to nothing or to the query before). As to why `$sql->execute()` returns false, I don't know... either there is a problem with your `$param...
Try to check $sql by print\_r() and copy your query then try resultant query in phpMyadmin. Hope will get the reason. There would be chance of irrelevant value.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
It is because `$pdo->errorInfo()` refers to the last statement that was successfully executed. Since `$sql->execute()` returns false, then it cannot refer to that statement (either to nothing or to the query before). As to why `$sql->execute()` returns false, I don't know... either there is a problem with your `$param...
From the php manual: PDO::ERR\_NONE (string) Corresponds to SQLSTATE '00000', meaning that the SQL statement was successfully issued with no errors or warnings. This constant is for your convenience when checking PDO::errorCode() or PDOStatement::errorCode() to determine if an error occurred. You will usually know if ...
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
I Faced the similar problem , This occurs manly due to **error in query**, try to **run your query in php-myadmin** or any other query runner and **confirm** that your **query is working** fine. Even if our query syntax is correct other simple errors like leaving null or not mentioan a column that set as not null...
I was getting this error at one time. I only got it on one server for all failures. A different server would report the error correctly for the same errors. That led me to believe it was a MySQL client configuration error. I never solved the specific error, but check your configurations.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
I Faced the similar problem , This occurs manly due to **error in query**, try to **run your query in php-myadmin** or any other query runner and **confirm** that your **query is working** fine. Even if our query syntax is correct other simple errors like leaving null or not mentioan a column that set as not null...
Try to check $sql by print\_r() and copy your query then try resultant query in phpMyadmin. Hope will get the reason. There would be chance of irrelevant value.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
I was getting this error at one time. I only got it on one server for all failures. A different server would report the error correctly for the same errors. That led me to believe it was a MySQL client configuration error. I never solved the specific error, but check your configurations.
Try to check $sql by print\_r() and copy your query then try resultant query in phpMyadmin. Hope will get the reason. There would be chance of irrelevant value.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
From the php manual: PDO::ERR\_NONE (string) Corresponds to SQLSTATE '00000', meaning that the SQL statement was successfully issued with no errors or warnings. This constant is for your convenience when checking PDO::errorCode() or PDOStatement::errorCode() to determine if an error occurred. You will usually know if ...
I was getting this error at one time. I only got it on one server for all failures. A different server would report the error correctly for the same errors. That led me to believe it was a MySQL client configuration error. I never solved the specific error, but check your configurations.
11,519,979
I'm trying to make a custom list for inquiries, where users will fill in some information such as "Name", "Reason" etc. When they've finished filling in the information and added the item, the administrator will then go through the item, and fill in some new columns that the user hasn't been able to fill in. I hope yo...
2012/07/17
[ "https://Stackoverflow.com/questions/11519979", "https://Stackoverflow.com", "https://Stackoverflow.com/users/744102/" ]
From the php manual: PDO::ERR\_NONE (string) Corresponds to SQLSTATE '00000', meaning that the SQL statement was successfully issued with no errors or warnings. This constant is for your convenience when checking PDO::errorCode() or PDOStatement::errorCode() to determine if an error occurred. You will usually know if ...
Try to check $sql by print\_r() and copy your query then try resultant query in phpMyadmin. Hope will get the reason. There would be chance of irrelevant value.
188,820
I need to change the response of Search Rest API in Magento 2. **Request**:`rest/V1/search?searchCriteria[requestName]=quick_search_container &searchCriteria[filterGroups][0][filters][0][field]=search_term &searchCriteria[filterGroups][0][filters][0][value]=t-shirt &searchCriteria[filterGroups][1][filters][1][field]=s...
2017/08/11
[ "https://magento.stackexchange.com/questions/188820", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/-1/" ]
The beautiful thing about Magento is that you can take reference from the its core code. For answering the question I will took the example of the product API call to filter product from the "color" attribute code. `rest/all/V1/products-render-info? searchCriteria[filterGroups][0][filters][0][field]=color& searchCrit...
According to this question [Magento2 Rest Api Search Criteria not working properly!](https://magento.stackexchange.com/questions/172767/magento2-rest-api-search-criteria-not-working-properly) you can add a "fields" parameter... Not used it, but from the answer I guess it works... **EDIT:** Actually, from what I can t...
188,820
I need to change the response of Search Rest API in Magento 2. **Request**:`rest/V1/search?searchCriteria[requestName]=quick_search_container &searchCriteria[filterGroups][0][filters][0][field]=search_term &searchCriteria[filterGroups][0][filters][0][value]=t-shirt &searchCriteria[filterGroups][1][filters][1][field]=s...
2017/08/11
[ "https://magento.stackexchange.com/questions/188820", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/-1/" ]
For get the product information in the `Search API` you have to use `searchCriteria` with `filters` in request URL. Use below API Request URL. **Request URL:** ``` http://localhost/magentosample230/rest/V1/products?searchCriteria[filter_groups][0][filters][0][field]=name&searchCriteria[filter_groups][0][filters][0][v...
According to this question [Magento2 Rest Api Search Criteria not working properly!](https://magento.stackexchange.com/questions/172767/magento2-rest-api-search-criteria-not-working-properly) you can add a "fields" parameter... Not used it, but from the answer I guess it works... **EDIT:** Actually, from what I can t...
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
See the section called **State List** in this bit of documentation...[Drawable Resources](http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList). You can define two different `Button` xml files one for the transparent 'default' state and another with the button as Red for your 'pressed' ...
I like the solution proposed by Konstantin Burov in the other issue: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color) You can actually manage more states than just pressed and normal. But it should solve the problem. ``` <sele...
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
See the section called **State List** in this bit of documentation...[Drawable Resources](http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList). You can define two different `Button` xml files one for the transparent 'default' state and another with the button as Red for your 'pressed' ...
``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:color="#FFFFFF" /> <item android:state_pressed="true" android:color="#000000" /> </selector> ```
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
See the section called **State List** in this bit of documentation...[Drawable Resources](http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList). You can define two different `Button` xml files one for the transparent 'default' state and another with the button as Red for your 'pressed' ...
You must set `@drawable` xml resource in `textColor` attributte Here is example: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color)
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
Yes, you can do it like that: layout/main\_layout.xml: ```xml ..... <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="bonjour !" android:textColor="@color/button_text_color" /> ..... ``` color/button\_text\_c...
You must set `@drawable` xml resource in `textColor` attributte Here is example: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color)
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
Yes, you can do it like that: layout/main\_layout.xml: ```xml ..... <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="bonjour !" android:textColor="@color/button_text_color" /> ..... ``` color/button\_text\_c...
I like the solution proposed by Konstantin Burov in the other issue: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color) You can actually manage more states than just pressed and normal. But it should solve the problem. ``` <sele...
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
I like the solution proposed by Konstantin Burov in the other issue: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color) You can actually manage more states than just pressed and normal. But it should solve the problem. ``` <sele...
You have to do it in your code. Try this: ``` mBtn = ((Button) findViewById( R.id.button1 )); mBtn.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { mBtn.setTextColor( Color.RED ); } }); ``` Declare: ``` private Button mBtn; ```
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
Yes, you can do it like that: layout/main\_layout.xml: ```xml ..... <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="bonjour !" android:textColor="@color/button_text_color" /> ..... ``` color/button\_text\_c...
See the section called **State List** in this bit of documentation...[Drawable Resources](http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList). You can define two different `Button` xml files one for the transparent 'default' state and another with the button as Red for your 'pressed' ...
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
Yes, you can do it like that: layout/main\_layout.xml: ```xml ..... <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="bonjour !" android:textColor="@color/button_text_color" /> ..... ``` color/button\_text\_c...
You have to do it in your code. Try this: ``` mBtn = ((Button) findViewById( R.id.button1 )); mBtn.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { mBtn.setTextColor( Color.RED ); } }); ``` Declare: ``` private Button mBtn; ```
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
I like the solution proposed by Konstantin Burov in the other issue: [Android customized button; changing text color](https://stackoverflow.com/questions/4692642/android-customized-button-changing-text-color) You can actually manage more states than just pressed and normal. But it should solve the problem. ``` <sele...
``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:color="#FFFFFF" /> <item android:state_pressed="true" android:color="#000000" /> </selector> ```
9,335,282
I build up my datagrid with bindnig source: ``` SqlDataAdapter adapter = new SqlDataAdapter(Datenbank.cmd); dataSet1.Tables.Clear(); adapter.Fill(dataSet1, "Table"); bs = new BindingSource(); bs.DataSource = dataSet1.Tables["Table"]; dataGridView1.DataSource = bs; ``` Now I sort grid ``` ...
2012/02/17
[ "https://Stackoverflow.com/questions/9335282", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1032703/" ]
You have to do it in your code. Try this: ``` mBtn = ((Button) findViewById( R.id.button1 )); mBtn.setOnClickListener( new OnClickListener() { @Override public void onClick(View v) { mBtn.setTextColor( Color.RED ); } }); ``` Declare: ``` private Button mBtn; ```
``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false" android:color="#FFFFFF" /> <item android:state_pressed="true" android:color="#000000" /> </selector> ```
72,662,360
So I'm super new to react. I have some code where I use fetch to get data from an API (that I created, structured like {'userData': {'overall': {'rank': '10', 'level': '99', 'xp': '200000000'}}}) and I display it on screen. It was working fine for hours and now all of a sudden without touching any code, it's broken. it...
2022/06/17
[ "https://Stackoverflow.com/questions/72662360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16367560/" ]
You need to first redirect to your application path in `CLI` ``` cd app_name ``` Try again `flutterfire` configure command after that.
You must make sure that in your pubspec.yaml the following lines are on the start of dependencies place, ex: ``` dependencies: flutter: sdk: flutter ```
72,662,360
So I'm super new to react. I have some code where I use fetch to get data from an API (that I created, structured like {'userData': {'overall': {'rank': '10', 'level': '99', 'xp': '200000000'}}}) and I display it on screen. It was working fine for hours and now all of a sudden without touching any code, it's broken. it...
2022/06/17
[ "https://Stackoverflow.com/questions/72662360", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16367560/" ]
You need to first redirect to your application path in `CLI` ``` cd app_name ``` Try again `flutterfire` configure command after that.
Make sure your pubspec.yaml file is well defined and correct. In my case, I had erased after dependencies ``` flutter: sdk: flutter ... ``` The correct format may be in flutter 3.3.0 [Flutter and the pubspec file](https://docs.flutter.dev/development/tools/pubspec) ``` name: myapp version: 1.0.0+1 publish_t...
24,054,662
Developing dictionary application for Android. There is a database in XML file. It is quite large(72MB) to parse with DOM parser. Trying to parse it with JDOM parser: ``` List<org.jdom2.Element> list = null; try { File db = new File(UnZip.DATABASE_PATH); InputStream stream = new FileInputStream(db); SAXBui...
2014/06/05
[ "https://Stackoverflow.com/questions/24054662", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2752399/" ]
JDOM, like DOM, XOM, and all other in-memory-xml-model libraries will represent the entire XML document in memory. If you consider that most XML documents are singe-byte-encoded (UTF-8 or ASCII) and that is then converted to 2-byte chars in Java/Android, it is normal for in-memory XML representations to take about twic...
Use the [XmlPullParser](http://developer.android.com/reference/org/xmlpull/v1/XmlPullParser.html) class, as DarkDarker suggested. Use either the setInput() that takes a Reader or the one that takes an InputStream and an encoding name (probably "UTF-8"). Then you can just use the parser to move through the document one ...
65,064,403
I have been trying to have my Python scripts operational on my Synology server. So far, I managed to install necessary libraries such as requests, bs4 and cython. That works. But I am stuck with numpy and pandas, which return the following error output. It is not pip-related (which is suggested in another question on ...
2020/11/29
[ "https://Stackoverflow.com/questions/65064403", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14133202/" ]
I assume the logic you want is more like this: ```c if((strcmp(usernameServer, username) == 0) && (strcmp(passwordServer, password) == 0)) ``` So testing if user AND password are both equal to the value you compare them to.
Comparing strings with `strcmp()`: > > This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached. > > > Returns: * <0 the first character that does not matc...
71,637,734
I was trying to solve a variance problem, but after the for loop **I can't the sum** values to finally dived by the numbers of items in the list. ``` lista = [1.86, 1.97, 2.05, 1.91, 1.80, 1.78] n = len(lista) #NUMBERS OF DATA IN THE LIST MA = sum(lista)/n #ARITHMETIC MEAN for x in lista: y = pow(x...
2022/03/27
[ "https://Stackoverflow.com/questions/71637734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18594968/" ]
You are just updating the value of y each time you run the loop so y will be a single element after it reached end of loop. What you are printing is : ``` sum(pow(1.78 - MA, 2)/2) ``` So either you store each value of y inside function in a array of simply do a thing ``` y=0 y = pow(x-ma, 2) y += y ```
I did it again and found the result, thanks Deepak Singh for your help, the asnwer is: ``` lista = [1.86, 1.97, 2.05, 1.91, 1.80, 1.78] n = len(lista) MA = sum(lista)/n y = 0 for x in lista: subts = pow(x - MA, 2) y = (y + subts) print("Varience:", y/n) ```
38,750,651
This is my `CustomObdRowAdapter.java` I added a "Select All" row at the top, when the user chooses it, all items in current listView should be checked, but how should I implement it in my customized row adapter? ``` private class ViewHolder{ CheckBox name; } @Override public View getView(final int position, View ...
2016/08/03
[ "https://Stackoverflow.com/questions/38750651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6094757/" ]
``` // select all for (int i = 0; i < adapter.getCount(); i++) { list.setItemChecked(i, true); } // unselect all for (int i = 0; i < adapter.getCount(); i++) { list.setItemChecked(i, false); } ``` you may need to call this from outside the adapter ``` getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPL...
``` boolean isAllTrue=false; @Override public View getView(final int position, View convertView, final ViewGroup parent) { ViewHolder holder = null; LayoutInflater settingInflater = LayoutInflater.from(getContext()); if (convertView == null) { convertView = settingInflater.inflate(R.layout.custom_row, parent, ...
66,010,937
I'm getting different `sysdate` results depending on the node. But how to figure out which are the problematic nodes?
2021/02/02
[ "https://Stackoverflow.com/questions/66010937", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15124130/" ]
Assuming you are able to connect via sqlplus or another tool and assuming you are using TNS names..... If the assumptions above are correct your TNS names will look somthing like the below ``` (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=sales1-server)(PORT=1521)) (ADDRESS=(PROTOCOL=tcp)(HOST=sales2-se...
This query tells you which node your session is using: ``` select * from v$instance; ``` You can use the undocumented `GV$` table function to run a query against all RAC instances to find out which ones have a bad clock. The function is a bit tricky because the cursor gets parsed on your instance but executed on all...
43,365,549
Currently, I have URL like > > **/recipes-detail/?recipe=(Slug of recipe)** > > > How Can I change this to > > **/recipes-detail/(Slug of recipe)** > > > Currently, I am fetching the recipe custom plugin.
2017/04/12
[ "https://Stackoverflow.com/questions/43365549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7562694/" ]
Change Permalink Settings to Post name
You can add to the .htaccess file a rewrite mode ``` RewriteRule ^recipes-detail/[a-z0-9]+(?:-[a-z0-9]+)*$/ ./recipes-detail/?recipe=$1 ``` Now if you use this address yourwebsite.com/recipes-detail/cake-of-chocolate will work exactly as you will be doing yourwebsite.com/recipes-detail/?recipe=cake-of-chocolate So...
33,126,644
I am running a Java test program to establish a connection to OrientDB and keep getting these exceptions when I run the code from within IntelliJ IDEA or OpenFire (xmpp server): > > java.lang.NoSuchMethodError: > com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/go...
2015/10/14
[ "https://Stackoverflow.com/questions/33126644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1837865/" ]
`NoSuchMethodError` happens because at runtime, Java tried to call a method on an object, and found it didn't exist, in particular: ``` com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder; ``` Of cou...
Please go to the below link and download the JAR file, <http://mvnrepository.com/artifact/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2> The problem is with the version which you are trying, the correct version is 1.4.2.
6,679,625
I'm working with a bunch of Python programmers who use vim and they make Python using TABs for indent. I use Emacs with python-mode which translates the tab key to 4 spaces (like it should, but never mind). Since I don't want to cause trouble I want to add something to my .emacs file (or whatever) to make indents using...
2011/07/13
[ "https://Stackoverflow.com/questions/6679625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/100981/" ]
You can define Python-specific settings in your `~/.emacs` with `python-mode-hook`. In order to use tabs for indentation, you could use: ``` (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t))) ``` Since `python.el` indents only 4 columns, by default, the above will use tabs when the indent is a mult...
probably need to do this in python mode: ``` (setq indent-tabs-mode t) ```
6,679,625
I'm working with a bunch of Python programmers who use vim and they make Python using TABs for indent. I use Emacs with python-mode which translates the tab key to 4 spaces (like it should, but never mind). Since I don't want to cause trouble I want to add something to my .emacs file (or whatever) to make indents using...
2011/07/13
[ "https://Stackoverflow.com/questions/6679625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/100981/" ]
probably need to do this in python mode: ``` (setq indent-tabs-mode t) ```
As the commenters to the post correctly said, using tabs for indentation is a bad idea, and using a non-standard tab width is even worse. Nonetheless, sometimes you have no choice if you want to collaborate. Depending on exactly how your colleagues have vim configured, you may need to *both* turn on `indent-tabs-mode`...
6,679,625
I'm working with a bunch of Python programmers who use vim and they make Python using TABs for indent. I use Emacs with python-mode which translates the tab key to 4 spaces (like it should, but never mind). Since I don't want to cause trouble I want to add something to my .emacs file (or whatever) to make indents using...
2011/07/13
[ "https://Stackoverflow.com/questions/6679625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/100981/" ]
You can define Python-specific settings in your `~/.emacs` with `python-mode-hook`. In order to use tabs for indentation, you could use: ``` (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode t))) ``` Since `python.el` indents only 4 columns, by default, the above will use tabs when the indent is a mult...
As the commenters to the post correctly said, using tabs for indentation is a bad idea, and using a non-standard tab width is even worse. Nonetheless, sometimes you have no choice if you want to collaborate. Depending on exactly how your colleagues have vim configured, you may need to *both* turn on `indent-tabs-mode`...
167,600
I recall this old sci fi movie where a android is looking for its' "father", it will self destruct if not found in 7 days. The father knows how to defuse the H-bomb in it. Then it goes on to save humanity
2017/08/20
[ "https://scifi.stackexchange.com/questions/167600", "https://scifi.stackexchange.com", "https://scifi.stackexchange.com/users/76426/" ]
Probable duplicate of this question; [Film about alien/android that molds facial features](https://scifi.stackexchange.com/questions/116042/film-about-alien-android-that-molds-facial-features/116050#116050). The Questor Tapes, created by Gene Rodenberry. Robert Foxworth stars as the android, who needs to find his fathe...
On the off chance you're confused about details (or someone else is looking for a film about an android looking for their creator while they have a bomb in them), I'm going to propose *[Eve of Destruction](https://en.wikipedia.org/wiki/Eve_of_Destruction_(film))*, a 1991 film about a gynoid named EVE VIII designed for ...
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
I found this from googling, so its validity may be questionable, but it came up fairly often. It seems that both underdog and top dog originated from dog fighting which went on in the 19th century. The losing dog ended up on the bottom, or **under** the winner, who was on **top**. My reference is [The Times of India]...
*Underdog* ---------- The "under dog" was the dog who lost a fight (as opposed to the winning "top dog"), and *underdog* has become idiomatic for the inferior person or party, or the one fighting a larger adversary. The OED says it originates in the US and their earliest citation is the British *Daily Telegraph* of 1...
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
I found this from googling, so its validity may be questionable, but it came up fairly often. It seems that both underdog and top dog originated from dog fighting which went on in the 19th century. The losing dog ended up on the bottom, or **under** the winner, who was on **top**. My reference is [The Times of India]...
The terms from my search, seem to come from the blood-sport of bear baiting in 16th Century England. The underdog would go for the bears middle section, most likely losing meanwhile the top-dog would go for the bear's jugular and be less at risk of being killed if the unconscious bear awoke and began reacting to the do...
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
I found this from googling, so its validity may be questionable, but it came up fairly often. It seems that both underdog and top dog originated from dog fighting which went on in the 19th century. The losing dog ended up on the bottom, or **under** the winner, who was on **top**. My reference is [The Times of India]...
Does it come from pioneer days of sawing trees by hand? Top dog was the one on top, and clean, underdog was the one in the pit below the felled tree sawing away getting covered in sawdust.
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
*Underdog* ---------- The "under dog" was the dog who lost a fight (as opposed to the winning "top dog"), and *underdog* has become idiomatic for the inferior person or party, or the one fighting a larger adversary. The OED says it originates in the US and their earliest citation is the British *Daily Telegraph* of 1...
The terms from my search, seem to come from the blood-sport of bear baiting in 16th Century England. The underdog would go for the bears middle section, most likely losing meanwhile the top-dog would go for the bear's jugular and be less at risk of being killed if the unconscious bear awoke and began reacting to the do...
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
*Underdog* ---------- The "under dog" was the dog who lost a fight (as opposed to the winning "top dog"), and *underdog* has become idiomatic for the inferior person or party, or the one fighting a larger adversary. The OED says it originates in the US and their earliest citation is the British *Daily Telegraph* of 1...
Does it come from pioneer days of sawing trees by hand? Top dog was the one on top, and clean, underdog was the one in the pit below the felled tree sawing away getting covered in sawdust.
45,816
What does the expression/idiom "feather your nest" mean? I see a lot of references to it but I can't seem to figure out its meaning.
2011/10/21
[ "https://english.stackexchange.com/questions/45816", "https://english.stackexchange.com", "https://english.stackexchange.com/users/4479/" ]
The terms from my search, seem to come from the blood-sport of bear baiting in 16th Century England. The underdog would go for the bears middle section, most likely losing meanwhile the top-dog would go for the bear's jugular and be less at risk of being killed if the unconscious bear awoke and began reacting to the do...
Does it come from pioneer days of sawing trees by hand? Top dog was the one on top, and clean, underdog was the one in the pit below the felled tree sawing away getting covered in sawdust.
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
I had the same problem but this seemed to work: ``` // Do upload if (! $this->upload->do_upload($image_name)) { // return errors return array('errors' => $this->upload->display_errors()); } $data = $this->upload->data(); $config_manip = array( 'image_library' => 'gd2', ...
Your error message suggest that it's not the loop that is the problem, but rather that the 2nd file is of a different filetype than the 1st. And that the underlying server don't have the needed libraries (http://www.libgd.org/Main\_Page) installed to handle that file type.
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Dont load image\_lib multiple times. Add image\_lib in autoload libs and change ``` $this->load->library('image_lib', $config); ``` to ``` $this->image_lib->initialize($config); ```
Your error message suggest that it's not the loop that is the problem, but rather that the 2nd file is of a different filetype than the 1st. And that the underlying server don't have the needed libraries (http://www.libgd.org/Main\_Page) installed to handle that file type.
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Here is a working code from my image gallery controller. This function uploads a batch of images, resizes them and saves them to database. ``` public function create_photo_batch() { $this->load->library('image_lib'); $this->load->library('upload'); // Get albums list for dropdown $this->data['albums'] = $this...
Your error message suggest that it's not the loop that is the problem, but rather that the 2nd file is of a different filetype than the 1st. And that the underlying server don't have the needed libraries (http://www.libgd.org/Main\_Page) installed to handle that file type.
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Dont load image\_lib multiple times. Add image\_lib in autoload libs and change ``` $this->load->library('image_lib', $config); ``` to ``` $this->image_lib->initialize($config); ```
I had the same problem but this seemed to work: ``` // Do upload if (! $this->upload->do_upload($image_name)) { // return errors return array('errors' => $this->upload->display_errors()); } $data = $this->upload->data(); $config_manip = array( 'image_library' => 'gd2', ...
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
I had the same problem but this seemed to work: ``` // Do upload if (! $this->upload->do_upload($image_name)) { // return errors return array('errors' => $this->upload->display_errors()); } $data = $this->upload->data(); $config_manip = array( 'image_library' => 'gd2', ...
Here is a working code from my image gallery controller. This function uploads a batch of images, resizes them and saves them to database. ``` public function create_photo_batch() { $this->load->library('image_lib'); $this->load->library('upload'); // Get albums list for dropdown $this->data['albums'] = $this...
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
I had the same problem but this seemed to work: ``` // Do upload if (! $this->upload->do_upload($image_name)) { // return errors return array('errors' => $this->upload->display_errors()); } $data = $this->upload->data(); $config_manip = array( 'image_library' => 'gd2', ...
``` $config['image_library'] = 'gd2'; $config['source_image'] = './assets/upload_images/A.jpg'; $config['create_thumb'] = FALSE; $config['maintain_ratio'] = TRUE; $config['width'] = 1600; $config['height'] = 900; $config['new_image'] = './assets/uploa...
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Dont load image\_lib multiple times. Add image\_lib in autoload libs and change ``` $this->load->library('image_lib', $config); ``` to ``` $this->image_lib->initialize($config); ```
Here is a working code from my image gallery controller. This function uploads a batch of images, resizes them and saves them to database. ``` public function create_photo_batch() { $this->load->library('image_lib'); $this->load->library('upload'); // Get albums list for dropdown $this->data['albums'] = $this...
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Dont load image\_lib multiple times. Add image\_lib in autoload libs and change ``` $this->load->library('image_lib', $config); ``` to ``` $this->image_lib->initialize($config); ```
``` $config['image_library'] = 'gd2'; $config['source_image'] = './assets/upload_images/A.jpg'; $config['create_thumb'] = FALSE; $config['maintain_ratio'] = TRUE; $config['width'] = 1600; $config['height'] = 900; $config['new_image'] = './assets/uploa...
5,012,734
i have a problem while uploading and resizing images in a loop. can anyone please provide me the working sample of code of codeigniter for uploading and resizing at the same time in a loop. I want to upload and resize images uploaded from the form. There will be more than 1 images so i have to upload them in loop. ...
2011/02/16
[ "https://Stackoverflow.com/questions/5012734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/318220/" ]
Here is a working code from my image gallery controller. This function uploads a batch of images, resizes them and saves them to database. ``` public function create_photo_batch() { $this->load->library('image_lib'); $this->load->library('upload'); // Get albums list for dropdown $this->data['albums'] = $this...
``` $config['image_library'] = 'gd2'; $config['source_image'] = './assets/upload_images/A.jpg'; $config['create_thumb'] = FALSE; $config['maintain_ratio'] = TRUE; $config['width'] = 1600; $config['height'] = 900; $config['new_image'] = './assets/uploa...
60,464,009
Say I insert three rows in cassandra in below order one by one `ID,firstname, lastname, websitename 1:fname1, lname1, site1 2:fname2, lname2, site2 3:fname3, lname3, site3` The column store stores columns together, like this: `1:fname1,2:fname2,3:fname3 1:lname1,2:lname2,3:lname3 1:site1,2:site2,3:site3` Does it me...
2020/02/29
[ "https://Stackoverflow.com/questions/60464009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3222249/" ]
Cassandra isn't a classical column store. It stores all inserted/updated data together, organized first by partition key, and then inside partition by clustering columns/primary keys. Data could be in different SSTables when you update them at different time point, but the compaction process will eventually try to merg...
Cassandra is basically a column-family database or row partitioned database along with column information not column based/columnar/column oriented database. When insert/fetch we need to mention partition(aka row key , aka primary key) column information. We can add any column at any point of time. Column-family store...
60,464,009
Say I insert three rows in cassandra in below order one by one `ID,firstname, lastname, websitename 1:fname1, lname1, site1 2:fname2, lname2, site2 3:fname3, lname3, site3` The column store stores columns together, like this: `1:fname1,2:fname2,3:fname3 1:lname1,2:lname2,3:lname3 1:site1,2:site2,3:site3` Does it me...
2020/02/29
[ "https://Stackoverflow.com/questions/60464009", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3222249/" ]
Cassandra is not a *column-oriented* database, it is a *partition-row* store, this means that the data in your example will be stored like this: ``` "YourTable" : { row1 : { "ID":1, "firstname":"fname1", "lastname":"lname1", "websitename":"site1", "timestamp":1582988571}, row2 : { "ID":2, "firstname":"fname2", ...
Cassandra is basically a column-family database or row partitioned database along with column information not column based/columnar/column oriented database. When insert/fetch we need to mention partition(aka row key , aka primary key) column information. We can add any column at any point of time. Column-family store...
43,962,188
[![]]]](https://i.stack.imgur.com/BYLKP.png)](https://i.stack.imgur.com/BYLKP.png) How do I remove the blue border around my circular button when I click it.
2017/05/14
[ "https://Stackoverflow.com/questions/43962188", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5204814/" ]
In this example I have changed the `border-color` from blue to `transparent` and added `outline:none;` on `:focus` (could also add not enabled) Hope this helps ```css button {width:50px; height:50px; background-image:url("http://www.rachelgallen.com/images/purpleflowers.jpg"); background-size:70% 70%; background-...
Use `outline` Property : ``` selector { outline:none; } ``` **Example :** ```css .btn { outline: none; } ``` ```html <button class="btn">Click Me!</button> ```
56,945,392
We have an Object key to a map - `Map<Student,List<Subject>>:` ``` class Student { String admitDate; //20190702 String name; ..... } ``` At a particular trigger, we would like to sort the map based on the admitdate(in Date) of the Student - and remove the earliest admit/s. The equals and hashcode of Student...
2019/07/09
[ "https://Stackoverflow.com/questions/56945392", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1483620/" ]
This error is because to interger value. integer cannot store null value if not set as null yes in database meaning if not set null mysql will check that need to be insert value but null value is not a interger type.
As xenon states, the default expectation is that you will either define integer fields as nullable within your database, or provide a valid numeric value upon saving. However, it is possible to override this behavior if you disable 'strict' mode in your database configuration file. /config/database.php ``` 'mysql' =...
27,414
In English there is no general rule about where to place adverbs. One could say, "Do you see Tom often?" just as easily as "Do you often see Tom?" Is the same true in French, or is there a preference to where you place adverbs in questions? That is to say, are both of these sentences equally correct? > > Vois-tu **p...
2017/10/04
[ "https://french.stackexchange.com/questions/27414", "https://french.stackexchange.com", "https://french.stackexchange.com/users/14833/" ]
That would be: > > *Vois-tu parfois Nicole?* > > > but the literary *vois-tu* is seldom used in spoken French. More usual usual ways would be: > > *Est-ce que tu vois parfois Nicole ?* > > > or > > *Est-ce que ça t'arrive (parfois) de voir Nicole ?* > > > You might put the adverb at the end but genera...
"vois-tu" is really too literary (though being the most correct form). Most French would say "tu vois" instead. "Vois-tu" is found only in books. For the rest, I really agree with the previous response by jiliagre.
38,863
I have [multiple IP addresses](https://serverfault.com/questions/868/multiple-ip-addresses-per-nic) configured to a NIC in Windows 2003/2008 Servers. This is done to get unique internal IPs to IIS websites, and there is a static NAT from each of these internal website addresses to corresponding public addresses. Each i...
2009/07/10
[ "https://serverfault.com/questions/38863", "https://serverfault.com", "https://serverfault.com/users/1387/" ]
The short answer is no, unless the application specifically supports it. Otherwise it's up to the IP stack to determine how things get sent out so doing something like putting a weight on one interface is what you have to do. A workaround for a browser would be to install a local proxy. [**WebScarab**](http://www.owas...
You can't do it from the web browser, but you can add a default route for a particular IP/subnet that uses the secondary IP. I know how to do this on Linux; no idea about windows, but I assume it will just be some call to "route add something"
56,922,293
I have a string `str1 = " 2*PI"` where PI is a global string `PI = "1*pi"` If I perform `eval(str1)` it tries to evaluate `1.*pi1.*pi`. How do I get it evaluate it as `2*(1*pi)` i.e 2 pi?
2019/07/07
[ "https://Stackoverflow.com/questions/56922293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5281266/" ]
`eval(str1)` returns `1.*pi1.*pi` because `eval(str1)` evaluates to `2*"1*pi"` and multiplication between a string and an integer results in a repetition of the string. Format the string directly into `str1` instead. ``` from math import pi PI = "1*pi" str1 = f"2*({PI})" # or for versions < Python-3.6: "2*({})".for...
Thanks evaluating first seems to have solved the problem. So I now have ``` from math import pi PI = eval("1*pi") str1 = "2*PI" eval(str1) ``` Which avoided any need for a replace
56,922,293
I have a string `str1 = " 2*PI"` where PI is a global string `PI = "1*pi"` If I perform `eval(str1)` it tries to evaluate `1.*pi1.*pi`. How do I get it evaluate it as `2*(1*pi)` i.e 2 pi?
2019/07/07
[ "https://Stackoverflow.com/questions/56922293", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5281266/" ]
what if you evaluated - eval() - the PI string first and the inserted the evaluated in to str1 as a str through the str() command and then evaluated str1 ``` from math import * PI = "1*pi" str1 = "2*PI" PI = str(eval(PI)) # Turns our PI string into a number str1 = str1.replace("PI",PI) # Sets our PI number in prin...
Thanks evaluating first seems to have solved the problem. So I now have ``` from math import pi PI = eval("1*pi") str1 = "2*PI" eval(str1) ``` Which avoided any need for a replace
16,284,590
I need to have endResult to be in descending order by ID and am not sure how that works with c# Linq. Any help would be great. ``` private void textBox6_Leave(object sender, EventArgs e) { DataClasses3DataContext db = new DataClasses3DataContext(); int matchedAdd = (from c in db.GetTable<prop>() ...
2013/04/29
[ "https://Stackoverflow.com/questions/16284590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/630737/" ]
``` dgvBRT.DataSource = endResult.OrderByDescending(x => x.ID); ``` ...there's not much else to say.
This may helps: ``` after.Concat(befor).OrderByDescending(i => i.ID); ```
7,926
How can i efficiently use my dual monitor setup along with the same keyboard and mouse with dual machines, (Home Gaming pc and work laptop) sometimes i need to work from home using my work laptop, but i don't want to disconnect all the Hdmi cables and connect new mouse or keyboard from my existing PC setup i am thin...
2017/08/15
[ "https://hardwarerecs.stackexchange.com/questions/7926", "https://hardwarerecs.stackexchange.com", "https://hardwarerecs.stackexchange.com/users/6808/" ]
It so happens that there is a software only way to do this. I was watching LinusTechTips and they were advertising this software on their end of video sponsor. The software is called [Synergy](https://symless.com/synergy). It actually works by creating some sort of local network and communicating over your own compu...
I'm having trouble finding anything that actually has all of the ports and connectors that (I think) you'll need, but I can explain how I would go about this. If you can get me specifics on what display outputs are available on your PC and laptop, as well as your monitor resolution and refresh rate, I'll take some time...
68,440,085
Here's what Im trying to do.. The images I save on the database are going to the correct path. But they don't show up in the site. ``` @blogs.route("/post/new", methods=['GET', 'POST']) def new_post(): if ('user' in session and session['user'] == params["username"]): form = PostForm() if form.valid...
2021/07/19
[ "https://Stackoverflow.com/questions/68440085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14292889/" ]
**Found a fix!!** I figured out that one can use the set keyword from python as a variable to store the post.img in it and then refer it inside the source. ``` {% set img_name = 'profile_pics/' + post.img %} <img src="{{url_for('static', filename = img_name)}}" alt="error"> ```
This would be the route function: ```py image_file = url_for('static', filename='profile_pics/' + post.img) return render_template('template.html', image_file=image_file) ``` and this is what it looks like in the template: ```html <img src="{{ image_file }}"> ``` The issue is probably that You are not really able...
4,615,213
I have a DOS batch file to run on a daily basis. Something similar like - ``` @ECHO ON SET COMMON_LIB=commons-io-1.3.1.jar; SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB% java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating PAUSE ``` When I run the batch file directly, i.e. double cliking on the .bat file, it ru...
2011/01/06
[ "https://Stackoverflow.com/questions/4615213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538058/" ]
you can only set the name anchor in the url basically yourpage.com/#/someurl/ it's not possible to change the whole url without reloading the whole page. To set the name anchor you need to do this: ``` location.hash='#/my/name/anchor/path'; ``` If you want to use it like that (to point to your page with name anchor...
``` window.location = "#newurl"; document.title = 'new title'; $('meta[name=description]').attr("content", "new description") ```
4,615,213
I have a DOS batch file to run on a daily basis. Something similar like - ``` @ECHO ON SET COMMON_LIB=commons-io-1.3.1.jar; SET AR_CLASS_PATH=%CLASSPATH%%COMMON_LIB% java -cp %AR_CLASS_PATH% -Xms128m -Xmx256m FileCreating PAUSE ``` When I run the batch file directly, i.e. double cliking on the .bat file, it ru...
2011/01/06
[ "https://Stackoverflow.com/questions/4615213", "https://Stackoverflow.com", "https://Stackoverflow.com/users/538058/" ]
you can only set the name anchor in the url basically yourpage.com/#/someurl/ it's not possible to change the whole url without reloading the whole page. To set the name anchor you need to do this: ``` location.hash='#/my/name/anchor/path'; ``` If you want to use it like that (to point to your page with name anchor...
Use javascript's native window function. ``` window.location.replace('http://www.google.com/') ```
18,526,131
I'm trying to launch `service` and then open `socket` to have connection with server. On button click I create new `Thread` and then start service. ``` Thread t = new Thread(){ public void run(){ mIntent= new Intent(MainActivity.this, ConnectonService.class); mIntent.putExtra("KEY1", "...
2013/08/30
[ "https://Stackoverflow.com/questions/18526131", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1262436/" ]
You can use IntentService for this. Just launch it normally with an Intent from the main thread. `onHandleIntent()` method gets executed in background thread. Put your socket-code in there. Here is an example code. ``` public class MyIntentService extends IntentService { public MyIntentService() { super("...
Move this code to your thread: ``` try { InetAddress serverAddr = InetAddress.getByName(SERVER_IP); socket = new Socket(serverAddr, SERVERPORT); Scanner scanner = new Scanner(socket.getInputStream()); message = scanner.nextLine(); } catch (IOException e) { e.printStackTrace(); } ``` Just as an ex...
1,487,587
My home network uses a `192.168.1.0/24` subnet, and when I `ping 192.168.1.137` I get a response saying the host is unavailable (as expected because I don't have any machines using that address) However, when I `ping 10.10.10.140` it: 1. gets a response, and 2. goes on forever. I thought `10.0.0.0/8` were all reserv...
2019/09/30
[ "https://superuser.com/questions/1487587", "https://superuser.com", "https://superuser.com/users/486488/" ]
> > I thought 10.0.0.0/8 were all reserved addresses and that any sort of traffic going to those addresses was dropped. > > > No. It's true that it's a special range, but it's reserved for *exactly the same purpose* as 192.168.0.0/16 – it is a private address block for LAN usage. (There is also a third block, 172....
You potentially could have a device on the network using that IP address that you are not aware of. The 10/8 range is not routable over the internet. I would take a look at your routes and see where its going.
1,487,587
My home network uses a `192.168.1.0/24` subnet, and when I `ping 192.168.1.137` I get a response saying the host is unavailable (as expected because I don't have any machines using that address) However, when I `ping 10.10.10.140` it: 1. gets a response, and 2. goes on forever. I thought `10.0.0.0/8` were all reserv...
2019/09/30
[ "https://superuser.com/questions/1487587", "https://superuser.com", "https://superuser.com/users/486488/" ]
These are three most likely possibilities: 1. Your ISP assigns its clients the `10.0.0.0/8` addresses. Your home router isn't advanced enough (nor needs to be) to limit routing private blocks upwards. 2. You have an additional routing device between your router and ISP, like a cable modem, which communicates with your...
You potentially could have a device on the network using that IP address that you are not aware of. The 10/8 range is not routable over the internet. I would take a look at your routes and see where its going.
1,487,587
My home network uses a `192.168.1.0/24` subnet, and when I `ping 192.168.1.137` I get a response saying the host is unavailable (as expected because I don't have any machines using that address) However, when I `ping 10.10.10.140` it: 1. gets a response, and 2. goes on forever. I thought `10.0.0.0/8` were all reserv...
2019/09/30
[ "https://superuser.com/questions/1487587", "https://superuser.com", "https://superuser.com/users/486488/" ]
> > I thought 10.0.0.0/8 were all reserved addresses and that any sort of traffic going to those addresses was dropped. > > > No. It's true that it's a special range, but it's reserved for *exactly the same purpose* as 192.168.0.0/16 – it is a private address block for LAN usage. (There is also a third block, 172....
These are three most likely possibilities: 1. Your ISP assigns its clients the `10.0.0.0/8` addresses. Your home router isn't advanced enough (nor needs to be) to limit routing private blocks upwards. 2. You have an additional routing device between your router and ISP, like a cable modem, which communicates with your...
10,895,951
I have created binary file using C codings. This is the structure of that binary file. ``` struct emp { int eid,eage; char name[20],city[20]; }record; ``` Using this 'C' Structure i created a binary file called "table1.txt" Now i want to show the contents of the file in a web page using php. How can i do this...
2012/06/05
[ "https://Stackoverflow.com/questions/10895951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1437138/" ]
\_POST is an associative array (a superglobal) You can access its content using the regular array syntax ``` $_POST['unu'] ``` instead of ``` $_POST('unu') ```
``` if(isset($_POST['unu'])) ``` Use square brackets
10,895,951
I have created binary file using C codings. This is the structure of that binary file. ``` struct emp { int eid,eage; char name[20],city[20]; }record; ``` Using this 'C' Structure i created a binary file called "table1.txt" Now i want to show the contents of the file in a web page using php. How can i do this...
2012/06/05
[ "https://Stackoverflow.com/questions/10895951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1437138/" ]
\_POST is an associative array (a superglobal) You can access its content using the regular array syntax ``` $_POST['unu'] ``` instead of ``` $_POST('unu') ```
post values are stored as array to acces them you need to write as ``` if(isset($_POST['unu'])){ echo "<tr>"; echo "<td>a mers</td>"; echo "</tr>"; } ```
65,673,101
``` var usedNumbers = [] var counter = 0 while(counter < 9){ var math = Math.floor(Math.random() * 9) if(math != usedNumbers){ usedNumbers[counter] = math counter++ } } console.log(usedNumbers) ``` i am really bad at explaining and really new to coding but i will do my best i want my p...
2021/01/11
[ "https://Stackoverflow.com/questions/65673101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660373/" ]
You could take a [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) and check only the `size` of it. ```js const numbers = new Set; while (numbers.size < 9) numbers.add(Math.floor(Math.random() * 9)); console.log(...numbers); ```
You can use the array method [.includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) ```js var usedNumbers = [] var counter = 0 while(counter < 9){ var math = Math.floor(Math.random() * 9) if(!usedNumbers.includes(math)){ usedNumbers[counter] = mat...
65,673,101
``` var usedNumbers = [] var counter = 0 while(counter < 9){ var math = Math.floor(Math.random() * 9) if(math != usedNumbers){ usedNumbers[counter] = math counter++ } } console.log(usedNumbers) ``` i am really bad at explaining and really new to coding but i will do my best i want my p...
2021/01/11
[ "https://Stackoverflow.com/questions/65673101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660373/" ]
You can use the array method [.includes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes) ```js var usedNumbers = [] var counter = 0 while(counter < 9){ var math = Math.floor(Math.random() * 9) if(!usedNumbers.includes(math)){ usedNumbers[counter] = mat...
Here is a functional and recursive way of doing it. ``` const saveNums = (currentNum, size, result) => { if (result.length >= size) { return result; } const newResult = result.includes(currentNum) ? result : [...result, currentNum]; return saveNums(Math.floor(Math.random() * size), size, newResult); }; c...
65,673,101
``` var usedNumbers = [] var counter = 0 while(counter < 9){ var math = Math.floor(Math.random() * 9) if(math != usedNumbers){ usedNumbers[counter] = math counter++ } } console.log(usedNumbers) ``` i am really bad at explaining and really new to coding but i will do my best i want my p...
2021/01/11
[ "https://Stackoverflow.com/questions/65673101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12660373/" ]
You could take a [`Set`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) and check only the `size` of it. ```js const numbers = new Set; while (numbers.size < 9) numbers.add(Math.floor(Math.random() * 9)); console.log(...numbers); ```
Here is a functional and recursive way of doing it. ``` const saveNums = (currentNum, size, result) => { if (result.length >= size) { return result; } const newResult = result.includes(currentNum) ? result : [...result, currentNum]; return saveNums(Math.floor(Math.random() * size), size, newResult); }; c...
18,750,850
I need to input a string, if the string is just a whole string and not with spaces, the codes is fine, if the input is a string with spaces, the string only copys the first set of strings and not the whole strings? I'm an noob, please help. ``` #include <stdio.h> #include <string.h> int main() { char again = 0; ...
2013/09/11
[ "https://Stackoverflow.com/questions/18750850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2770315/" ]
Your code stops reading at a space because **that's how `scanf` works** with the `%s` format. It reads a sequence of non-whitespace characters. If you're really using C++, then you'd be wise to switch to `std::string` and `std::getline`, which will read all input up to the end of the line. Your code doesn't appear to ...
You are allocating an array of 60 chars long (str). You can't expect to read a lot into it. Here are a few tips: * Don't use such buffers, they are dangerous. The C++ library provides you [std::string](http://en.cppreference.com/w/cpp/string/basic_string). * Never omit the curly braces `{}`. * There are an easier way ...
18,750,850
I need to input a string, if the string is just a whole string and not with spaces, the codes is fine, if the input is a string with spaces, the string only copys the first set of strings and not the whole strings? I'm an noob, please help. ``` #include <stdio.h> #include <string.h> int main() { char again = 0; ...
2013/09/11
[ "https://Stackoverflow.com/questions/18750850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2770315/" ]
Your code stops reading at a space because **that's how `scanf` works** with the `%s` format. It reads a sequence of non-whitespace characters. If you're really using C++, then you'd be wise to switch to `std::string` and `std::getline`, which will read all input up to the end of the line. Your code doesn't appear to ...
This code is a mess. * C++ features like `std::string` are not used at all. * You're mixing `printf/scanf` and `NSLog` for no reason. * Modifying `str` in the `if` branch makes no sense, as it won't be read later. * You probably want to use `i < strlen(str)` instead of `<=`, or you'll copy that terminating zero charac...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
See my answer for the **Android Studio environment**, [Mac and “PANIC: Missing emulator engine program for 'arm' CPU.”](https://stackoverflow.com/a/52161215/8034839). To solve this problem, you need to specify the `-kernel` path manually. i.e. ``` $ ~/Library/Android/sdk/emulator/emulator @Galaxy_Nexus_Jelly_Bean_A...
Just wanted to share my experience on this problem. Consulting each of the answers here, it didn't match my situation. Having a system image for Android API 22 causes this error and the weird thing is that all of the environment variables pointing to the correct directories. It doesn't make sense. @BuvinJ answer had s...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
I had the same problem. In my case it turned out I had installed another version of the sdk alongside the version provided by Android Studio. Changing my ANDROID\_SDK\_ROOT environment variable to the original value fixed it for me.
I installed Android SDK manager and Android SDK yestoday, and I get this error too when I tried to run the Android emulator immediately. But, right now this error disappear, I think restarting your system when the SDK has installed may solve this problem.
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
Another reason you can get this error is that Eclipse can't find the correct file. Check out where Eclipse is looking for your SDK files. You can do this on the command line. Below is an example for the windows command prompt for an avd I created and named 'SonyTabletS': ```none c:\Program Files (x86)\Android\android...
Update the following commands in command prompt in windows: 1. `android update sdk --no-ui --all` It update your SDK packages and it takes 3 minutes. 2. `android update sdk --no-ui --filter platform-tools,tools` It updates the platform tools and its packages. 3. `android update sdk --no-ui --all --filter extra-a...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
I updated my android SDK to the latest version (API 19). When I tried to run the emulator with phonegap 3, the build was successful but it ran the same issue. In the AVD manager there was an existent device, nevertheless, its parameters were all unknown. Surely this occurs because I uninstalled the old sdk version (AP...
For me Updating the **SDK Tools** fixed the errors. [![Screenshot of the errors and update progress](https://i.stack.imgur.com/zDrol.png)](https://i.stack.imgur.com/zDrol.png)
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
Here's my story. Under 'Actions' on the AVD manager, I viewed the details for the AVD which wasn't working. Scrolling down, I found the line: ``` image.sysdir.1: add-ons\addon-google_apis-google-16\images\armeabi-v7a\ ``` I then navigated to this file at: ``` C:\Users\XXXX\AppData\Local\Android\sdk\add-ons\addon-go...
Open AVD Manager in Administrator mode Select VM and click edit, click OK Start VM. **Editor's note**: By administrator mode, he meant Right-click > Run as administrator on windows platforms .
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
My story, Eclipse wanted a file called "`kernel-ranchu`" in the system image folder ( `/path/to/android-sdk-macosx/system-images/android-25/google_apis/arm64-v8a` ). > > emulator: ERROR: This AVD's configuration is missing a kernel file! > Please ensure the file "kernel-ranchu" is in the same location as your > sys...
Following the accepted answer by ChrLipp using Android Studio 1.2.2 in Ubuntu 14.04: * Install "ARM EABI v7a System Image" package from Android SDK manager. * Delete the non functional Virtual Device. * Add a new device with Application Binary Interface(ABI) as armeabi-v7a. * Boot into the new device. This worked for...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
The "ARM EABI v7a System Image" must be available. Install it via the Android SDK manager: ![Android SDK manager](https://i.stack.imgur.com/phTeI.jpg) Another hint (see [here](https://plus.google.com/u/0/108967384991768947849/posts/DSi3oAuNnS7)) - with * Android SDK Tools rev 17 or higher * Android 4.0.3 (API Level 1...
My story, Eclipse wanted a file called "`kernel-ranchu`" in the system image folder ( `/path/to/android-sdk-macosx/system-images/android-25/google_apis/arm64-v8a` ). > > emulator: ERROR: This AVD's configuration is missing a kernel file! > Please ensure the file "kernel-ranchu" is in the same location as your > sys...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
My story, Eclipse wanted a file called "`kernel-ranchu`" in the system image folder ( `/path/to/android-sdk-macosx/system-images/android-25/google_apis/arm64-v8a` ). > > emulator: ERROR: This AVD's configuration is missing a kernel file! > Please ensure the file "kernel-ranchu" is in the same location as your > sys...
For me Updating the **SDK Tools** fixed the errors. [![Screenshot of the errors and update progress](https://i.stack.imgur.com/zDrol.png)](https://i.stack.imgur.com/zDrol.png)
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
Open AVD Manager in Administrator mode Select VM and click edit, click OK Start VM. **Editor's note**: By administrator mode, he meant Right-click > Run as administrator on windows platforms .
Just wanted to share my experience on this problem. Consulting each of the answers here, it didn't match my situation. Having a system image for Android API 22 causes this error and the weird thing is that all of the environment variables pointing to the correct directories. It doesn't make sense. @BuvinJ answer had s...
9,712,606
All, I'm creating a side menu from a user defined menu in wordpress. I'm getting the menu options from the following code (since I know the menu id the user wants to display on the side): ``` $menu_items = wp_get_nav_menu_items($menu_id); $menu_items = (array)$menu_items; $output = '<div id="menu_options">'; $output ....
2012/03/15
[ "https://Stackoverflow.com/questions/9712606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1048676/" ]
If you know the kernel file is installed on your machine, then problem is getting emulator.exe to find it. My fix was based on the post by user2789389. I could launch the AVD from the AVD Manager, but not from the command line. So, using AVD Manager, I selected the avd I wanted to run and clicked "Details". That showe...
I tried what ChrLipp suggested, but that wasn't the problem, as the image was already installed. What I did was run: ``` android avd ``` to start the emulator manually. Then I stopped the emulator, and form that point on the ``` cca emulate android ``` app started working, without the "missing a kernel file" erro...
22,768,353
So I'm new to powershell. I've built a few scripts for fun but got stuck on one that I don't seem to be able to figure out. I'm trying to automate the clicking of the "Continue" button but don't know what to do. I have tried everything I can think of. Any ideas? ``` $username='username' $password='password' $ie = Ne...
2014/03/31
[ "https://Stackoverflow.com/questions/22768353", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3482032/" ]
The problem is that the object's Type is Image, not continue. The ClassName is continue. Try this line in that code and see if that works for you: ``` $Link=$ie.Document.getElementsByTagName("input") | where-object {$_.className -eq "continue"} ```
Try ``` $ie.Document.getElementByID('dado_form_3').submit() ```
2,553,922
This is what i want to do: ``` $line = 'blabla translate("test") blabla'; $line = preg_replace("/(.*?)translate\((.*?)\)(.*?)/","$1".translate("$2")."$3",$line); ``` So the result should be that translate("test") is replaced with the translation of "test". The problem is that translate("$2") passes the string "$2" ...
2010/03/31
[ "https://Stackoverflow.com/questions/2553922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/136391/" ]
preg\_replace\_callback is your friend ``` function translate($m) { $x = process $m[1]; return $x; } $line = preg_replace_callback("/translate\((.*?)\)/", 'translate', $line); ```
You can use the preg\_replace\_callback function as: ``` $line = 'blabla translate("test") blabla'; $line = preg_replace_callback("/(.*?)translate\((.*?)\)(.*?)/",fun,$line); function fun($matches) { return $matches[1].translate($matches[2]).$matches[3]; } ```
68,046,767
I'm new in python, please have a look on the code below ``` n = 5 m = 5 mat = [[0]*m]*n print(mat) i = 0 while(i < m): mat[0][i] = i i += 1 print(mat) ``` This code gives output like - ``` [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]...
2021/06/19
[ "https://Stackoverflow.com/questions/68046767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13275764/" ]
I have used SafetyNet API for accessing device's runtime env. I have kept signing certificate of app on server to verify its sha256 against what we get in the SafetyNet response. Below are the steps you can refer if applies to you too. 1. Get SHA256 fingerprint of signing X509Certificate MessageDigest md = MessageDig...
I think this can help you 1.Find AttestationStatement file in GG example. and add this function: ``` public String bytesToHex(byte[] bytes) { StringBuffer result = new StringBuffer(); for (byte b : bytes) result.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1)); return result.toString(); } `...
68,046,767
I'm new in python, please have a look on the code below ``` n = 5 m = 5 mat = [[0]*m]*n print(mat) i = 0 while(i < m): mat[0][i] = i i += 1 print(mat) ``` This code gives output like - ``` [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]...
2021/06/19
[ "https://Stackoverflow.com/questions/68046767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13275764/" ]
I have used SafetyNet API for accessing device's runtime env. I have kept signing certificate of app on server to verify its sha256 against what we get in the SafetyNet response. Below are the steps you can refer if applies to you too. 1. Get SHA256 fingerprint of signing X509Certificate MessageDigest md = MessageDig...
Check the code here as reference on how to do the validations: <https://github.com/Gralls/SafetyNetSample/blob/master/Server/src/main/java/pl/patryk/springer/safetynet/Main.kt> I just found it while searching for the same thing, and all credit goes to the person that owns the repo.
68,046,767
I'm new in python, please have a look on the code below ``` n = 5 m = 5 mat = [[0]*m]*n print(mat) i = 0 while(i < m): mat[0][i] = i i += 1 print(mat) ``` This code gives output like - ``` [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] [[0, 1, 2, 3, 4], [0, 1, 2, 3, 4]...
2021/06/19
[ "https://Stackoverflow.com/questions/68046767", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13275764/" ]
I have used SafetyNet API for accessing device's runtime env. I have kept signing certificate of app on server to verify its sha256 against what we get in the SafetyNet response. Below are the steps you can refer if applies to you too. 1. Get SHA256 fingerprint of signing X509Certificate MessageDigest md = MessageDig...
``` public class Starter { static String keystore_location = "C:\\Users\\<your_user>\\.android\\debug.keystore"; private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray(); public static String bytesToHex(byte[] bytes) { char[] hexChars = new char[bytes.length * 2]; for (int j = 0; j < bytes.len...