id stringlengths 3 6 | prompt stringlengths 100 55.1k | response_j stringlengths 30 18.4k |
|---|---|---|
257589 | Matt Ridley in [Rational Optimist](https://en.wikipedia.org/wiki/The_Rational_Optimist:_How_Prosperity_Evolves) says that countries are prosperous when divided due to competition among government. Countries are backward when united.
According to this theory, China advanced after dividing. Sung is after chaos that follo... | Ridley's argument as presented above is very simplistic. Fragmentation may sometimes lead to prosperity, but only if a number of other conditions are fulfilled. To my mind, these other conditions are more important and more interesting than the number of countries in the world, which seems incidental and arbitrary. Doe... |
257615 | I am losing my mind, but I cannot see what I am doing wrong here, but each time this macro is run I keep on getting a blank row between the column headers and the actual data. The data that is being returned is correct, but I cannot get see why I am getting an extra line at the top!
Can I have a fresh pair of eyes, pl... | >
>
> >
> >
> > >
> > > Can I have a fresh pair of eyes, please!
> > >
> > >
> > >
> >
> >
> >
>
>
>
Maybe because you a missing the worksheetname before `Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select`?
After the code executes this line
`ThisWorkbook.Worksheets.Add After:=Worksheets(Worksheet... |
257815 | I'm trying to stop certain fields being changed by the user. However I don't know what columns those fields will be in, only what value they will initially contain.
My current approach is this:
```
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim columnHeaderRange As Range
Set s... | Further to my comments
**EXAMPLE 1**
Create a sheet called `List`, which will store your values. The best part about this method is that you do not have to amend the code every time you want to add/delete items from your list.
See Screenshot

And ... |
258012 | seems like a very, common & frustrating topic... but my wifi is at a super slow crawl. I am getting speeds slower than dial-up modems, which gets maddening when you are trying develop a website.
**TEMPORARY SOLUTION**
After trying -EVERY- solution below, nothing worked. So I used Timeshift and rolled back my machine t... | So It just depends on you what you want, I can only suggest because your system specs are OK, You can have any type of ubuntu flavour you want, Let me give you a brief Idea
You can find alternatives of ubuntu I.e ubuntu flavours [here](https://ubuntu.com/download/flavours)
---
Lubuntu
=======
A good Linux distro, I... |
258043 | Right now I'm using an N-Channel MOSFET. I am inputting a 2V pk-pk square wave into the gate, the drain is connected to a bare wire (that is connected to nothing) and the source is connected to ground. For some reason there's a voltage reading in the drain of my MOSFET. Is this normal? | If you see just the "edges" (positive/negative peaks at the times when there are rising/falling edges at the input signal) it can be explained by the capacitance between gate and drain. |
258951 | after a lot of help yesterday, I came up against a known error in asp.net4 beta - I upgraded to VS2012 RC Express (4.5), and now I'm getting an internal server error, and I can't see why. I'm creating a web API:
**Model**
```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using S... | You might want to add a global error handler to your project. It can trap and log any odd errors that are happening in background threads. This S/O article talks about some solid approaches. They will save you lots of time in any project: [ASP.NET MVC Error Logging in Both Global.asax and Error.aspx](https://stackoverf... |
259148 | SQl 2008 Reporting Services (SP1, CU4) installed on Windows 2008 R2. Service account is configured to use Network Service. Port 80 is open in the Firewall. Continue to get "HTTP Error 503. The service is unavailable." error no matter what i try. Need advice on what else I can check or where I can look for any errors wi... | Restarting the SSRS service solved the issue for me.
Environment: SSRS2016, Window Server 2012 R2 Standard |
259378 | Right now I need to keep changing the line below. Is there a programmatic way to check if I am running the site locally vs. on production ?
The closest I got was this post but it seems to be referring to Silverlight and I am just calling from an asp.net site.
[Silverlight application cannot accesss WCF services on o... | Is this for an ASP.NET application? If so, consider using VS2010's [Web.config Transformation](http://msdn.microsoft.com/en-us/library/dd465326.aspx), which can alter your web.config based on your build type (Release, Debug, etc).
---
[Here's a better introductory tutorial](http://www.codeguru.com/csharp/.net/net_asp... |
259614 | im creating a webapplication which connects to a database and uses a ODBC connector im using the following code to do this
```
private void SetupConnection()
{
conn.ConnectionString =
ConfigurationManager.ConnectionStrings["live"].ConnectionString;
OdbcDataAdapter da =
new OdbcDataAdapter("S... | ```
private void SetupConnection()
{
conn.ConnectionString =
ConfigurationManager.ConnectionStrings["ZenLive"].ConnectionString;
bool success = false;
while(!success)
{
try
{
OdbcDataAdapter da =
new OdbcDataAdapter("SELECT * FROM MTD_FIGURE_VIEW1 '... |
259759 | I am trying to plot a 3d wireframe plot from a csv file. Data in format first column x is CPU in percentage (range from 10-90%), second column y memory (range from 10-80%), in percentage and last column drop rate in percentage(range from 10-70%).
Sample data
```
10,10,30
10,20,10
10,30,5
10,40,30
20,10,4
20,20,30
20,3... | The problem is that you are expecting too much from `zip`. `zip` is a Python function that generates tuples from iterables. Python tuples are not numpy data structures and therefore cannot respond to an ndim request. If you want to acccess the data points associated with `x`, `y`, and `z` as ndarrays then you want to d... |
259811 | What do I need to do to change the RPCNFSDCOUNT setting without a full service restart?
I need to reload the NFS configuration without restarting the service. The RPCNFSDCOUNT thread count is too low for the workload but I cannot get the management to agree on a schedule for a change window.
A normal service can freq... | And after an obvious mental lapse, I remembered the /proc filesystem. /proc/fs/nfsd, specifically, controls the runtime settings of the nfsd service.
In my case, this meant `echo '32' > /proc/fs/nfsd/threads` sets the number of threads to 32. |
259907 | I'm learning some more PHP and after PHP itself to work, I can't seem to get it to validate any form field correctly. My goal is to check if the firstname field is empty, and if it is, it will give a message in a red color. The message in the red works, but only because the echo script is being called by the form submi... | Found solution!
Looks, like this is some adb or Genymotion bug.
To solve this, you must manually connect adb to running Genymotion Device
In first, you need to know Androids internal IP. You can find it in window title of Genymotion device.
Next:
1. cd to your Android SDK dir
2. cd to platform-tools
3. ./adb connect 1... |
260143 | Tech Stack: Java 1.6, JAXB, Spring 3, JAX-RS (RESTEasy), XSD
Hello,
I am using Spring with JAX-RS to create RestFul Webservice.
Everything is working fine except that the generated responses contain the setters info e.g.
```
{
...
"setName": true,
"setId": true,
"setAddress": true,
"setAge": ... | Use a `row-fluid` to nest a 12-column layout in your `span9`
```
<div class="span9">
<div class="row-fluid">
<div class="span6">
</div>
<div class="span6">
</div>
</div>
</div>
``` |
260579 | I have a lazy load module which needs to expose providers, so I am using the `forRoot` convention and returning the following code:
```
@NgModule({
imports: [RouterModule.forChild([
{path: "", component: LazyComponent},
])],
declarations: [LazyComponent],
})
export class LazyModule {
static forRoot() {
... | When you import a `LazyModule` in your `AppModule` imports array it is not "lazy" anymore. A lazy module should only be referenced in a dedicated `RoutingModule`.
So if I understood you correctly you would like to share a Service between your LazyModules?
If so remove `LazyModule` from `AppModule` and create a Shared... |
260644 | Hoping someone can shed some light on my problem. I followed the tutorial found here <http://msdn.microsoft.com/en-us/library/ms171925(v=VS.100).aspx#Y3500> and cannot get this to work.
My code is as follows:
```
namespace CityCollectionCSharp
{
public partial class frmSwitch : Form
{
public frmSw... | ` ` is a HTML entity. When doing `.text()`, all HTML entities are decoded to their character values.
Instead of comparing using the entity, compare using the actual raw character:
```
var x = td.text();
if (x == '\xa0') { // Non-breakable space is char 0xa0 (160 dec)
x = '';
}
```
Or you can also create the ... |
261065 | I use PostgreSQL 9.4.1
My query:
```
copy(select * from city) to 'C:\\temp\\city.csv'
copy(select * from city) to E'C:\\temp\\city.csv'
```
>
> ERROR: relative path not allowed for COPY to file
> \*\*\*\*\*\*\*\*\*\* Error \*\*\*\*\*\*\*\*\*\*
>
>
> ERROR: relative path not allowed for COPY to file SQL state: ... | As with [this case](http://www.postgresql.org/message-id/CFF47E56EA077241B1FFF390344B5FC10ACB1C0C@webmail.begavalley.nsw.gov.au), it seems likely that you are attempting to use `copy` from a computer other than the one which hosts your database. `copy` does I/O from the database host machine's local file system only. I... |
261073 | I am trying to over-ride Google Maps driving directions zoom. Yes, I have seen another question here on stackoverflow that is identical; however, that solution is not working for me.
Here is where I call a new DirectionsRenderer, and I define preserveViewport: true;
```
var dr = new google.maps.DirectionsRenderer({
... | I had the same issues initially with ROR on Windows. (Everyone suggested me to move to LINUX/UNIX)
Still I managed to install it on Windows. Rather than installing the Heroku Toolbet (which breaks ruby and rails which is already installed) install the heroku gem along with foreman gem.
>
> gem install heroku
>
>
>... |
263074 | ```
\documentclass[]{article}
\usepackage[utf8x]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{graphicx}
\usepackage{floatrow}
\usepackage{subfig}
\usepackage{microtype}
\usepackage{braket}
\usepackage{physics}
\usepackage{bm}
\usepackage{scalefn... | With `{NiceTabular}` of `nicematrix`.
```
\documentclass{article}
\usepackage{nicematrix,tikz}
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{% <---- BEWARE
\node[shape=circle,draw,inner sep=2pt] (char) {#1};}}
\begin{document}
\begin{NiceTabular}{ccc}[cell-space-limits=1mm]
\CodeBefore
\begin{tikzpicture}
... |
263326 | I am very new to iOS development and am writing an app with multiple views, each view having a tableview.
For every view, I need to read a separate JSON URL and then display the results. All the tutorials that I have been checking for this read the data in ViewController.m, but since I have a separate URL for each vie... | I could solve my problem by making my filter bean SessionScoped. I also don't bind the currently selected rows to my backing bean anymore. I get the selected rows using:
```java
public void tableSelection (AjaxBehaviorEvent event) {
UIExtendedDataTable dataTable= (UIExtendedDataTable) event.getComponent();
for... |
263409 | I want to align the red surface to the center of the page, how can i do that?
```
@Composable
fun Screen() {
Row(
modifier = Modifier.fillMaxSize(),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Surface(
color = Color... | If your blue view has a static size, just add `Spacer` of the same size on the other side.
```
Row(
modifier = Modifier.fillMaxSize(),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
val blueViewWidth = 100.dp
Spacer(Modifier.width(blueViewWidth))
... |
263554 | I am trying to use cdk-virtual-viewpoint in my chat application. Sadly, it doesn't render anything. When I try to use the normal "ngfor" it works fine. But when I use cdkVirtualfor it does not display anything. Please refer to the code below for more details.
```
chatbox.component.ts---
<cdk-virtual-scroll-viewport i... | One quick option is to apply [`numpy.flatnonzero`](https://numpy.org/doc/stable/reference/generated/numpy.flatnonzero.html) to each row:
```
import numpy as np
df.apply(np.flatnonzero, axis=1)
0 [0, 1]
1 [0]
2 [1]
3 [0, 1, 2, 5, 7, 8]
dtype: object
```
If you c... |
263572 | I am trying build a dictionary of Expressions that have different input parameter types. I am trying to store the type of the parameter because later down the road I plan to use Reflection to discover a method on the type. Here is the code that creates the dictionary and a generic Add function I created to add entries ... | Looking closely at your code, the expression you generate has some problems. See my explanation at the top of [this answer](https://stackoverflow.com/questions/5744764/linq-to-sql-throwing-a-stackoverflowexception/5751931#5751931) to explain one of them, it's the same issue here. You're creating a new lambda where the ... |
263740 | I have a web view which request one web page, now that web has some action events which may reply to IOS app as HTML or json. So how would the app will come to know the response type sent. So that the response is handled within the app.
Reading of static HTML content in webview using its delegate is what i have tried... | **Method 1**
First, You need to set and handle the `UIWebView` delegate methods in your `UIViewController`
Then, in `webView: shouldStartLoadWithRequest: navigationType:` method, use the following
```
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNav... |
263880 | ```
import networkx as nx #@UnresolvedImport
from networkx.algorithms import bipartite #@UnresolvedImport
from operator import itemgetter
from random import choice
corpus = open('/home/abehl/Desktop/Corpus/songs.wx', 'r')
ALPHA = 1.5
EPSILON = 0.5
song_nodes = []
word_nodes = []
edges = zip(song_nodes, word_nod... | A Python program is executed from top to bottom, so you need to define the function before you use it. A common alternative is putting all the code that is automatically executed in a `main` function, and adding at the bottom of the file:
```
if __name__ == '__main__':
main()
```
This has the additional advantag... |
263984 | Everything should be fine but its not. No console errors, nothing. Result of my object is displayed correctly in console and my marker is set up correctly if I manually type in coordinates.
However if I pass the data to LatLng with my object, zero results.
This in console returns "46.00,45.00":
```
var data = jQuer... | You're just passing one argument with `data[0].coords` as string, when you need to pass 2 arguments as numbers, as specified in the [documentation](https://developers.google.com/maps/documentation/javascript/reference#LatLng):
```
LatLng(lat:number, lng:number, noWrap?:boolean)
```
You'll need to split up the `coord... |
264066 | I build an Angular 2 application and bundle it with webpack.
At the moment, my application is still small but the webpack task already takes around 10 seconds.
Is it possible to optimize my webpack config or the TypeSript compilation options to improve the compilation and packaging duration ?
This is the webpack confi... | One great way I've personally done that has sped up the Webpack build process is implementing DLLs within your build.
Webpack works by analyzing your code for `require`s and `import`s, and then builds a table from these statements of all of your module dependencies and links to where those files can be found.
The DLL... |
264212 | I just set up SSH on my freeNAS server. However every time I connect I get kicked out right away. I get the following message:
```
Connection to (my server name) closed by remote host.
```
Anybody knows why this happens?
This is the server log for SSH services:
```
Oct 9 09:35:52 sshd[2389]: Did not receive ident... | It could happen because
* the server only accepts a SSH protocol version your client doesn't provide,
* the server only allows asymmetric authentication (RSA,DSA) and you provided no key
Try to set the verbose flag on your client. It should give you some hints. Otherwise check the server log. |
264373 | I have the following class defined:
```
<TypeConverter(GetType(ExpandableObjectConverter))>
<DataContract()>
Public Class Vector3
<DataMember()> Public Property X As Double
<DataMember()> Public Property Y As Double
<DataMember()> Public Property Z As Double
Public Overrides Function ToString() As String... | Although I appreciate Rivers' answer I am really looking for a solution that ignores all expandable object converters automatically (like the DataContractJsonSerializer does) rather than building a custom JsonConverter for each offending class.
I have found the following two solutions:
1. Use the built in DataContrac... |
266120 | So I am just tinkering with Lua after hearing that it was more versatile than python, so I tried to make a countdown to one year, in the form of DDD:HR:MN:SC. If anyone could give me an example it would be much appreciated! | You can use [`os.date`](https://www.lua.org/manual/5.3/manual.html#pdf-os.date) to retreive the current date as a table, then just build the difference by subtracting component-wise like this:
```lua
local function print_remaining(target)
local current = os.date("*t")
print(string.format("%i years, %i months and... |
266301 | I am on a website...it has jquery and is sending some requests using javascript out to a php page.
Is their any way to see what data it is sending out from my computer and/or which URLs it is talking to?
I am using firefox and can load software if their is any needed.
EDIT - I have downloaded firebug and have the p... | Use Firebug browser addon, it will show you background XHR requests. |
266320 | I have created a consumable in app purchase in iTunes connect as shown in the following figure.
[](https://i.stack.imgur.com/msces.png)
After that I created a sandbox user and I verified that appid.
When I try to check the products using the followi... | The status of your in-app purchases needs to be in the "Ready to Submit" stage before you can test in Sandbox. A common thing to miss is the preview image, for testing, you can upload anything you want so the meta-data is complete. Also, you need to make sure you have the "Paid Applications" agreement signed - it's not... |
267043 | I am getting an error while trying to pragmatically remove products from some categories.
Error:
>
> Fatal error: Uncaught TypeError: Argument 3 passed to
> Mage\_Catalog\_Model\_Resource\_Abstract::\_canUpdateAttribute() must be of
> the type array, null given, called in
> /xxx/public\_html/app/code/core/Mage/Ea... | **Using Custom Module (Recommended)**
Create a simple module and add a helper class then call it in your phtml file.
You can use Category's `CollectionFactory` class and select all attributes by using a `star (*)` symbol in `addAttributeToSelect` method. You can try this code example in your helper class.
```
protec... |
267590 | I'm trying to set my own **stopword list** for MySQL (5.1.54) fulltext index, but encountered problems with configuration. I tried the following steps:
1. I did set system variable in */etc/mysql/my.cnf* by adding line:
```
ft_stopword_file = "/home/buli/stopwords.txt"
```
2. I created file */home/buli/stopwords.t... | Are you running MySQL on a distro that uses AppArmor, chroot etc. to secure it?
For AppArmor you have to update /etc/apparmor.d/usr.sbin.mysqld (or similar), for chroot you have to copy the file.
Best thing is to put the stopword file below the data directory and give a realtive path only. |
268776 | First of all, sorry because I am so new at C# and I decided to make this question because I have been choked in this for hours.
I have an GUI that works with Google Cloud Speech services and make a Speech-to-Text operation. I share with you the whole method that runs when a button is clicked:
```
private async Task... | The problem is that you're using `Task.Run`, which means your code will be running on a thread-pool thread.
Instead of calling `Task.Run()`, just move that code into a separate async method:
```
async Task DisplayResponses(IAsyncEnumerator<StreamingRecognizeResponse> responses)
{
while (await responses.MoveNext(d... |
269300 | I have the following method which takes in GPS coordinates as strings and converts them to doubles with a maximum of 6 decimal points. Now I'm trying to randomize the decimal points starting from the first decimal.
```
public void randomizeCoordinate(String latString, String lonString)
{
double lat = Double.parseD... | ```
Random rand = new Random();
double x = ...;
x = ((int)(x*10) + rand.nextDouble()*2 - 1)/10.0;
```
Multiply by 10 and truncate to get the digits including the first decimal, add a random number between -1 and 1, scale back.
Note that your doubles will not have just 6 decimal digits; these numbers aren't decimal ... |
269791 | I'm new to Razor and I'm getting this error when trying to loop through a list of objects.
[](https://i.stack.imgur.com/NytxU.png)
This is my View:
```
@page
@model QuizModel
@{
ViewData["Title"] = "Quiz Page";
}
<div class="text-center">
<... | Why not implementing the code like that?
```
app.post('/', function(req, res){
stub.PostWorkflowResults(
{
workflow_id: "my-custom-workflow",
inputs: [
{
data: {
image: {
url: req.body.input // guessing that your input is a url
... |
270379 | here is the code and it returns "IGNORE HIM!" when the size is odd
```
#include <set>
std::set<char> s;
int main(){
char c;
while(std::cin>>c)s.insert(c);
std::cout<<(s.size()&1?"IGNORE HIM!":"CHAT WITH HER!");
return 0;
}
``` | You've already noticed the pattern, i.e. `set.size()&1` is true when the size is odd.
Doing a bitwise-and (`&`) on a number will set all the bits to 0, except for the last bit, if it's 1. The last bit is only 1 when the number is odd.
e.g.
```
101100 // even
& 000001
= 000000 // false
101101 // odd
& 000001
... |
270507 | I want to include the YAMM!3 CSS library in my Drupal 8 site. To that end, I wrote a custom module following the instructions in [this answer](https://drupal.stackexchange.com/a/224911/1441). Although that answer is in regards to a php library, I thought it would also work for a CSS library.
This is the `composer.jso... | **Fundamentals**
To bind a CSS library into your Drupal installation, it should be defined and exposed via a \*.libraries.yaml file.
For example (taken from core's classy theme):
```
book-navigation:
version: VERSION
css:
component:
css/components/book-navigation.css: {}
```
defines that there is a l... |
270687 | i need little help in writing the MYSQL Query.
i want to retreive the data from 3 tables, but i want to retreive the data from 3rd table only if the count() value is equals to 1.
please see the below query.
```
SELECT count(orderdetails.orderId) as total,gadgets.*,orders.* FROM orders
JOIN orderdetails ON orders.ord... | Just add a Simple Condition in Join, and it would work (Of course you have make it `Left Join`).
```
SELECT count(orderdetails.orderId) as total,gadgets.*,orders.* FROM orders
JOIN orderdetails ON orders.orderId = orderdetails.orderId
LEFT JOIN gadgets ON gadgets.gadgetId = orders.gadgetId
and total=1 --Simple Logic... |
271079 | I am trying to get round a silly firewall issue. I am trying to chain ssh access to git through a proxy ssh:
~/git-chain:
```
#!/bin/bash
ssh hosticangetto ssh $*
# End
```
And then:
```
$ export GIT_SSH=~/git-chain
$ git clone ssh://git@somerepostore.com/somerepo.git
E, [2012-02-07T12:50:21.434913 #28359] ERROR ... | Add these lines to your `~/.ssh/config` (or create that file with these lines if it doesn't already exist):
```
Host somerepostore.com
ProxyCommand ssh -W %h:%p hosticangetto
```
Then unset GIT\_SSH.
This tells ssh to ssh using hosticangetto as a proxy. This is better than your solution because in your solutio... |
271577 | I have a list of dataframes like these:
```
library(plyr)
mt_list <- dlply(mtcars, .(cyl), data.frame)
names(mt_list) <- c("four", "six", "eight")
```
I want to create a nested latex table using the stargazer package. By nested, I mean I want to combine three dataframes within a single table and give each of the thr... | Not exactly what you are looking for but should be a good start.
```
stargazer(mt_list,type='text',summary=FALSE,
title=c('Six','Four','Eight'))
##
## Six
## =========================================================
## mpg cyl disp hp drat wt qsec vs am gear carb
## ----------------------------... |
271720 | This is my xhtml code containing a datatable using row expansion. Using primefaces 4.0, jsf mozarra 2.2.4
```
<p:dataTable id="myTable" value="#{myBean.lazyModel}" var="dd"
rowKey="#{dd.hashCode()}" paginator="true"
selection="#{myBean.myModel.selectedRecords}" rows="#{myBean.pageSize}"
paginatorPosition=... | I had the same problem. Do you use this datatable in a dialog?
Try set `dynamic=false` in parent dialog.
Dynamic dialog may override your ajax request |
271895 | The official display has a 5 pin header marked "GPIO".
One pin is marked "5V" and appears to be a power output. However, it is not connected directly to the 5V rail of the board which is available on the "PWR OUT" USB connector. Instead it is connected to the collector pin of Q2. What is the intended purpose of this p... | The I2C ports are duplicated because older models do not have an I2C port on the DSI connector:
>
> The DSI connector on Model A/B boards does not have the I2C connections required to talk to the touchscreen controller and DSI controller. This can be worked around by using the additional set of jumpers provided with ... |
272044 | I installed Proxmox 5.4 and this is how it setup my logical volumes:
```none
--- Logical volume ---
LV Path /dev/pve/swap
LV Name swap
VG Name pve
LV UUID AmJwba-alii-Uqkw-XHAy-ka2g-EIeQ-l7jlw3
LV Write Access read/write
LV Creation host, ... | The `data` LV appears to be a [thinpool LV](https://pve.proxmox.com/wiki/Storage:_LVM_Thin). It's an additional layer between the VG and the final LV. It allows additional features (eg: overprovisionning or also efficient copy-on-write where performances don't decrease the more additional snapshots are made).
There's ... |
272402 | I am fairly new to C++ programming, so please bear with me. I am writing a small application in visual studio that would be used to communicate with an FTDI module (UM232H high speed USB module). FTDI provides the D2XX drivers for this module and is readily available on their website. Right now the program I have is ve... | Maybe it is bit later for an answer.
I got same error with old outdated ftd2xx.lib file.
Afetr adding new ftd2xx.lib, ftd2xx.dll and ftd2xx.h files, cleaning and rebuilding the project a problem was solved. |
273305 | I get a syntax error in the following code:
```
if value[0] == "ta" or "su":
num_var = len(value)
i = 0
while value[i][0] != "-" and i <= num_var:
if i == 0 and value[0][0].isdigit():
f3["var_%s" %i] = VARFD[[value[0].split("/")[1]]
else:
... | Gii actually checks every table to see if there are join tables (see `ModelCode::isRelationTable()` in gii/generators/model). It detects a table as a join table if:
* The table has 2 columns
* Both columns are foreign keys
* The foreign keys point to different tables
Gii then creates a many-to-many relationship betwe... |
273676 | Dears,
I am at very pressed situation :-(
I started to learn Javascript some months ago and I have written some pages for amusements of my invalid niece to her birthday this Friday. Separate pages are OK. But I feel calamitous that I am still unable to set php including. I have two earlier websites with php code that... | 1. If your app reuses the data of manufactures and colors in other places. It makes sense to put these two data in the global store (redux). Otherwise, don't store it in the local state of your component.
2. Use Promise
Promise.all(getManufactures(), getColors()).then([manufactures, colors] => {
getCars(manufactures,... |
273824 | I have Date\_time field with yyyy-mm-dd hh:mm:ss format in my database. I had stored 8 days data in my database. Now i want data at every 15 minute. what is the solution for it? please help me...
I have Date\_time field with yyyy-mm-dd hh:mm:ss format in my database. I had stored 8 days data in my database. Now i want... | Finally found :
```
exec('/usr/local/bin/convert '.$source_img.' -font '.$font_location.' -pointsize 14 -draw "gravity south fill black text 0,12 \'some text\' fill white text 1,11 \'some text\' " '.$output_img);
``` |
273991 | I have a table with the following columns: name - course1 - course2 - course3. Two rows look like this:
```
John - physics - math - art
Sara - math - chemistry - psychology
```
Now John has been expelled from the math class and I want to replace "math" with "none" on his row.
When I look for a solution I find thing... | In this case, I think there is no other way besides evaluating each column, like this:
```
update
my_table
set
course1 = if(course1 = 'math', 'none', course1),
course2 = if(course2 = 'math', 'none', course2),
course3 = if(course3 = 'math', 'none', course3)
where
name = 'John';
``` |
274251 | After update of chromedriver to version 2.46 my tasts fail to initialize.
I got message like this:
```
Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 44269
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access b... | This error message...
```
Starting ChromeDriver 2.46.628402 (536cd7adbad73a3783fdc2cab92ab2ba7ec361e1) on port 44269
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Failed to invoke configuration method com.personal.CustomTe... |
274353 | *Sorry for being such a novice.*
For this question I used C language, and the libraries stdlio.h and stdlib.h.
---
Question
--------
So a question is asking me to:
1. Open a text file named 'numbers.txt' in read mode. This text file
has 6 integers in it.
2. Read the 6 integers from that text file using a loop.
3. ... | In your word counting code, you are using the variable `content` which holds all of the users inputted lines in a list of lists. In your letter counting code, you use the variable `line` which is just the last line the user entered. Since that line must be "." to leave the loop it never has any letters thus you always ... |
274403 | I would like to read a text file into an array of strings using System.IO.File.ReadAllLines. However, ReadAllLines strips out some odd characters in the file that I would like to keep, such as chr(187). I've tried some different encoding options, but that doesn't help and I don't see an option for "no encoding."
I can... | There's no such concept as "no encoding". You *must* find out the right encoding, otherwise you can't possibly interpret the data correctly.
When you say "chr(187)" what Unicode character do you mean?
Some encodings you might want to try:
* Encoding.Default - the system default encoding
* Encoding.GetEncoding(28591)... |
275535 | I want build a form using a block module in `Drupal 8`. I am aware of building the forms in `Drupal` 7 but the same seems to be different in Drupal 8.
Request anyone who has worked on drupal8 custom forms as block to help me. | Your question is very vague, as I don't know how much you already know about modules, forms and blocks in Drupal 8. So here is a small guide what to do, further information on how to do stuff in detail would be overkill for this answer.
**1. Create a new module and enable it**
Look here: [Naming and placing your Drup... |
275778 | [](https://i.stack.imgur.com/epmU3.png)[](https://i.stack.imgur.com/XIRn1.png)CSS: This suppose to be at the left of the first navigation which is the clothing
```
#nav {
width:95%;
font-family: Taho... | I would use an array variant to keep it simple. What you need to create is a multivalue field, rather than a string with semicolons in it.
```
Dim checkListValues as Variant
'turn this into a variant array
checkListValues = split("")
'add the values currently selected and remove the blank
checkListValues = FullTri... |
276270 | I want to backup some filesystem folders from a client to an external server. My goal is to have a secure backup on the external server even if the client gets compromised/hacked in any way.
I am considering the following techniques (prio in that order):
* rsync
* aws S3
* sFTP
* HTTPs
AFAIK rsync and sFTP transmit ... | The way that I handle this is to move control of the data to the *backups* destination. For the purposes of this description, *production* is your production (main) machine and *backups* is the backup server. This does require that you have a *backups* server rather than just a data repository, though.
* Remove ssh eq... |
276275 | I have a dialog where users allocate product on an order to various available lots of product.

So basically if there are 100 units on a line item of an order, the user would have to allocate this quantity out to the available lots of product in a wa... | Keep in mind that the user interface for returns doesn't have to be a modified version of the interface you show above. Maybe a specialized returns interface would be a better way to go? |
276394 | Python 3
Consider the following two code samples.
Two questions:
1: What is the difference between the two approaches? For what benefit would I implement A versus B?
2: In sample A, is the self variable prefix required?
Sample A:
```
class DoSomething():
self.dispatcher = {
'SaveToS3': self.savetos3,
... | 1. In Sample A, `dispatcher` is shared among all instances of the class, and so modifying it will modify `self.dispatcher` for every `DoSomething`. With Sample B, on the other hand, each instance gets a separate `self.dispatcher`, and modifying one will leave all of the others alone. Sample A also lets you access `DoSo... |
276676 | Now I have this:
```
$data = array();
$query = mysql_query("SELECT * FROM users WHERE username = '{$username}'");
while ($row = mysql_fetch_row($query)) {
$data[] = $row;
}
```
Now `$data[0] = array('Joe','Sally','3 5'); $data[1] = array('Joe','alice','30 65');`
Access `$data[0][0] = 'Joe'` or `$data[1][0] = 'Joe... | try this
```
$data = array();
$query = mysql_query("SELECT * FROM users WHERE username = '{$username}'");
while ($row = mysql_fetch_row($query)) {
$data[] = $row;
}
$json=json_encode(array("userlist" => $data));
echo $json;
``` |
277012 | I have a csv file with each row containing lists of adjectives.
For example, the first 2 rows are as follows:
```
["happy","sad","colorful"]
["horrible","sad","cheerful","happy"]
```
I want to extract all the data from this file to get a list containing each adjective only one.
(Here, it would be a list as follows ... | Supposing that "memory is not important" and that one liner is what you are looking for:
```
from itertools import chain
from csv import reader
print(list(set(chain(*reader(open('file.csv'))))))
```
having 'file.csv' content like this:
```
happy, sad, colorful
horrible, sad, cheerful, happy
```
**OUTPUT:**
['ho... |
277116 | I'm trying to make a `RecurrenceTable` with conditionals in Mathematica, and the recursive stuff is working right, but it won't evaluate it completely.
```
In:= RecurrenceTable[{x[n] == If[Mod[n, 2] == 0, x[n - 1], y[n - 1]],
y[n] == If[Mod[n, 2] == 0, R x[n - 1] (1 - x[n - 1]), y[n - 1]],
x[1] == x0, ... | Typically, you should use [`Piecewise`](http://reference.wolfram.com/mathematica/ref/Piecewise.html) for mathematical functions, and reserve `If` for programming flow.
You can convert many `If` statements using [`PiecewiseExpand`](http://reference.wolfram.com/mathematica/ref/PiecewiseExpand.html):
```
If[Mod[n, 2] ==... |
277117 | I'm new to python programming and I'm having trouble selecting an option. I have created a menu for example I have :
Instructions
Catering
Packages
add
When the user selects i, c, a or p each menu will come up. However, if the user selects 'p' before 'a' then I need to set a prompt to select a first..
```
INSTRUC... | One way to do this, is to make the SwitchViewController a custom container controller, and add either the table view or map view as its child. Here is an example that I've used before that has the same set up as your storyboard (my ContainerViewController is your SwitchViewController, and my controllers with the identi... |
277292 | I am developing REST api using Spring Boot. I've a controller which accepts POST requests.
>
> <http://localhost:8085/carride/end-ride>
>
>
>
In the above request i want to access the parameter `ride_transection_id` for finding particular transection object and also some other value as well.
So basically i have 3... | You can use any of them but every way is designed for a certain use.
Path variable:
is used when you need to access an entity using a certain field for example i want to access an order and this order is defined by id so to access this order i need the following request `Get /order/{id}`
Request Parameter:
when you w... |
277420 | I just installed Moblin Operating System. It's using GRUB2. On my Ubuntu 8.04 GRUB 0.97 was being used in which i was using the **default saved** option comfortably. I found that with GRUB2 i should not edit /boot/grub/menu.lst directly *but I did* :) because my Moblin does not contain any **/etc/default/grub** where t... | The correct syntax for enabling `savedefault` in `/etc/default/grub` (GRUB 2) is with the lines:
```
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
```
and *not* with the line `DEFAULT=save` that the enquirer suggested.
After adding the two lines above to `/etc/default/grub`, one has to update GRUB's configuration, as a ... |
277941 | I have a .net core project with pipeline (YAML, multi-stage) pipeline set up in Azure DevOps. We have a bunch of unit tests that we execute at pipeline run time - everything is fine.
However - we would like to dig more deeper into our code coverage. So we have configured our task like this
```
- task: DotNetCoreCLI@2... | You could use the [dotnet-reportgenerator-globaltool](https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/) package to generate the HTML Code Coverage Report.
Here is an example:
```
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '$(Parameters.TestProjects)'
arg... |
279313 | I'm not exactly sure how to ask this question really, and I'm no where close to finding an answer, so I hope someone can help me.
I'm writing a Python app that connects to a remote host and receives back byte data, which I unpack using Python's built-in struct module. My problem is with the strings, as they include m... | There's no built-in functionality for decoding a string like this, since it is really its own custom codec. You simply need to split up the string on those control characters and decode it accordingly.
Here's a (very slow) example of such a function that handles latin1 and shift-JIS:
```
latin1 = "latin-1"
japanese =... |
279803 | I have a list of hostnames / IP addresses, and my script takes the each item from the text file and stores them in the `nodes` variable as a list.
I want to ping each host and output the results to a text file. I can do it with a single host, but am having trouble understanding how to iterate through the list.
I have... | You can iterate directly through your list of nodes like so:
```
with open(args.filename) as f:
lines = f.readlines()
nodes = [x.strip() for x in lines]
with open('output.txt', 'w') as f:
for node in nodes:
# Opens the ping program
ping = subprocess.run(
["ping", "-c 1", node],... |
280131 | net core web api application. I have configured swagger for my web api app. I am doing authentication and authorization from swagger and I do not have webapp or SPA. Now I want to do authorization based on groups. When I saw JWT token I saw hasgroups: true rather than group ids. This is changed If more than 5 groups ar... | * `Ctrl`+`H`
* Find what: `^(\d+)\.(\d+)\.`
* Replace with: `$1-$2`
* **CHECK** *Wrap around*
* **CHECK** *Regular expression*
* **UNCHECK** `. matches newline`
* `Replace all`
**Explanation:**
```
^ # beginning of line
(\d+) # group 1, 1 or more digits
\. # a dot
(\d+) # group 2, 1 or more digits
\.... |
280335 | Since a lot of days, maybe, months, ago, one of my servers is crashing, almost everyday. Sometimes, more then once a day.![alt text][1]
That is worrying me a lot.
My lot at /vars/log/messages is full of lines like these below:
```
Oct 8 13:36:25 host kernel: Firewall: *TCP_IN Blocked* IN=eth1 OUT= MAC=00:30:48:63:3... | It looks like someone is trying to connect via telnet (DPT=23) and SQL(DPT=1434) ports, these REALLY should not be exposed to the internet. I would completly filter them at the firewall. That should at least clean up your logs if the server keeps crashing you can try and see if it is something else. |
280942 | I have a weird problem with this method. It's called, when i edit a EditTextPreference, only when i change the value, and on a MultiSelectListPreference only the first time i change.
This is my fragment code.
```
public class PrefFragment extends PreferenceFragment implements OnSharedPreferenceChangeListener {
@Ov... | Move `unregisterOnSharedPreferenceChangeListener` from `onPause()` to `onStop()`. |
280974 | How do I set the color of the text of a label?
```
myLabel.setText("Text Color: Red");
myLabel.???
```
Can I have two seperate colors in one label?
For example here:
The `"Text Color:"` to be black and the `"Red"` to be red. | You can set the color of a JLabel by altering the foreground category:
```
JLabel title = new JLabel("I love stackoverflow!", JLabel.CENTER);
title.setForeground(Color.white);
```
As far as I know, the simplest way to create the two-color label you want is to simply make two labels, and make sure they get placed ne... |
281186 | I followed the commands mentioned on this page...
<https://www.elastic.co/guide/en/cloud-on-k8s/current/index.html>
elastic service is stared successfully. But I do not see external-ip
```
# /usr/local/bin/kubectl --kubeconfig="wzone2.yaml" get service
NAME TYPE CLUSTER-IP EXTERNAL-... | ClusterIP services are only available from inside the cluster. To make it visible from the outside you would need to change it to LoadBalancer type, and have an implementation of that available (read: be running on a cloud provider or use MetalLB). |
281621 | I have a photo gallery on my site with 1M photos in it. There are 2 search tables associated with it. Table #1 contains a list of words used in the photos. Table #2 contains a list of what words match up with what photos. Table #2 is 7M rows. I am testing partitioning this 7M row table because I have another set of tab... | To get your query working with efficient indexing is probably a good idea before you dive into the partitioning project. Here's your query refactored to use `JOIN`:
```
SELECT m.pic_id
FROM wordlist w
JOIN wordmatch m ON w.word_id = m.word_id
WHERE w.word_text LIKE 'bacon%'
```
This query can use a compound i... |
281756 | this must be possible via PowerShell as it can be done from Central Administration. I have a task to modify just the public URL of an existing alternate access mapping (AAM).
```
PS U:\> $aam = Get-SPAlternateURL -WebApplication http://mysite
PS U:\> $aam
IncomingUrl Zone PublicUrl
----------- ... | You need to do this in three steps as the IncomingURL and PublicURL are equal. Start by removing what you have on the internet zone (1) and build your url-structure starting with the PublicURL (2). When that's done - set a new URL for the IncomingURL (3).
```
#(1)
Remove-SPAlternateURL -WebApplication http://mysite -Z... |
282619 | [HyperSpace](http://codepen.io/noahblon/pen/GKflw) is neat demo that (I think) only uses css.
But when I copy the html and css to my directory, [it doesn't work](http://www.phillipsenn.com/LR/WinnerWinnerChickenDinner/HyperSpace/HyperSpace.htm).
Q: What am I missing? | The CodePen demo is set to apply [-prefix-free](http://leaverou.github.io/prefixfree/), which basically adds the prefixes when necessary.

Either you add -prefix-free to your project (which I don't recommend) or add the prefixes when nece... |
282897 | I am trying to build a query to get data per hour for a particular day(or today).
I have a device data table that
```
# Name Type
1 : idPrimary -- int(11)
2 : inputDate -- varchar(32)
3 : input1 -- varchar(11)
4 : input2 ... | Well, this is hideous, but. Try this query :)
```
select * from (select substr(inputDate, 1, 13) as hours, input1 from deviceData order by inputDate desc) t GROUP BY hours;
```
I might ve messed up with sorting direction, though/ |
284465 | I am a Maya user and I am currently writting an Auto-Rig.
I created different Classes for each major tasks of the tool. (ex: Class\_UI, Class\_Arms\_Rig, etc..)
The problem I have is that I can't call a method from "Class\_Joints" (the class that will generates every needed Joints) with my "Class\_UI"
Here are the co... | Two things i would recommend you do. I dont use Maya but i have built apps with multiple different GUIs.
1. Every GUI I've used when it comes to buttons is the first argument is a reference to self, and then there is usually 1 or 2 more arguments passed in. Some pass the reference to the button itself while others pas... |
284548 | I am interested in creating new rows is SAS that are conditional on specific variables.
Suppose these are the names of the columns RecordID, ItemName, ItemCount, ItemX, ItemY, ItemZ.
ItemX, ItemY, and ItemZ are numeric variables that can be equal to or greater than 0.
When ItemX, ItemY, and/or ItemZ holds a valu... | Pretty easy:
```
data want(keep=ItemName ItemCount);
set have;
array items[3] itemx itemy itemz;
format ItemName $32. ItemCount best.;
do i=1 to 3;
if items[i] > 0 then do;
ItemName = vname(items[i]);
ItemCount = items[i];
output;
end;
end;
run;
```
Create an array of the item variables. Loo... |
284825 | ```
import pandas as pd
dfs = pd.HDFStore('xxxxx.h5')
```
throws this error:
`"ImportError: HDFStore requires PyTables, "No module named tables" problem importing"`
I tried to install PyTables, which Requires Cython.
I have Cython 0.21 installed, but it is throwing an error stating that Cython should be greater tha... | Simply updating `pytables` with:
```
pip install --upgrade tables
```
worked for me. |
284927 | [This answer](https://aviation.stackexchange.com/a/47132) made me wonder if engines are stopped automatically after an emergency landing as soon as one of the exit doors are opened.
>
> (...) if the engine is still running, you're about to run forward into the area where you're at risk of being sucked into the runnin... | There is no automatic shutdown. However, shutting down the engines is part of the evacuation checklist done by the flight crew.
It's happened before that the controls link was severed and an engine could not be shutdown, such as in [Qantas Flight 32](https://en.wikipedia.org/wiki/Qantas_Flight_32).
>
> Upon landing,... |
285159 | I have this
```
USAGE="Usage: -f [file name] -c [column] -v [value] ."
while getopts ":f:c:v: " OPTIONS; do
case $OPTIONS in
f ) file=$OPTARG;;
c ) column=$OPTARG;;
v ) value=$OPTARG;;
h ) echo $USAGE;;
\? ) echo $USAGE
exit 1;;
... | You can't do this in the loop. Check the values of the variables after the loop and print `$USAGE` if they are empty or the values are wrong (not an integer, for example). |
285288 | I'm writing a utility Mac OS X app that basically acts as a web server accepting incoming HTTP requests (think of it as a mock REST API server). I want to be able to support HTTPS, but ideally I'd like to remove the requirement for my users to have to purchase their own SSL certificates.
I've been thinking a little o... | This won't work - but for nontechnical reasons.
Distributing an SSL certificate to your users along with its associated key will violate the issuance terms of your SSL certificate provider, and they will revoke the certificate when they discover what you have done. (This happened, for example, [when Pivotal tried to o... |
285926 | **Background on the machine I'm having a problem with:**
The machine was inherited and appears to be circa 2003 (there's a date stamp on the power supply which leads me to this conclusion). I've got it set up as a Skype terminal for my 2-year-old to keep in touch with her grandparents and other members of the family -... | I had all manner of problems on an older machine trying to use my iPod over USB through a cheap USB 2.0 PCI card I had. In the end, I chucked it and bought a more expensive one, and all the problems went away. I'd suggest trying that. I can't imagine that a USB 2.0 PCI card will cost much these days, but do what I did ... |
285959 | I want to have custom colors according to the mouse events (mouse enter, exit, pressed, etc). So to accomplish this, I wrote the code below. It is fine for everything, except in the case of the mouse pressed event, which does nothing.
It only works if I override the color in the `UIManager` like this `UIManager.put("B... | The problem is caused by the fact that a JButton has its content area filled by default and that the Metal L&F will automatically fill it with its internal chosen color when button is pressed.
Best thing to do, is to extend JButton to create your own button, disable content area filled, and paint yourself the backgrou... |
286384 | that is the code i connect to untrusted server but i always get this error i put the code in the using statement but it is not working return empty string
also tried and see the link of this issue before but it is not working
```
private String requestAndResponse(String url)
{
string responseValue = stri... | The first `using` block is disposing your response. Move your code after this block into the `using` statement. |
286513 | Im using <https://trezor.io/> to send signed transactions
I have succesfully send transactions to:
* Truffle development network
* Ropsten
Right now im using a private local go-ethereum node, the invocation of the signed transaction is exactly the same code as for truffle and ropsten and i get `Invalid sender` whe... | Below, I use `cut` to bin the data and then `table` to count instances of each bin.
```
data.frame(cut(q4$prop, breaks = c(0, 0.1, 0.2, 0.3)) %>% table)
```
produces
```
# . Freq
# 1 (0,0.1] 341
# 2 (0.1,0.2] 13
# 3 (0.2,0.3] 2
``` |
286763 | Been fighting with this on and off for 48 hours now; I'm still getting undefined reference errors when attempting to link a dynamic library with its dependency - despite all exports existing, and the library being found successfully.
Scenario:
* libmemory (C++) - exports functions with `extern "C"`
* libstring (C) - ... | I don't think you need a custom directive to fire the `$http` call to fetch the results whenever your input value changes.Instead you can do as below
```
<input type="text" ng-model="header.search"
typeahead-on-select="searchClicked($item)"
uib-typeahead="state as state.data.name for state in suggestions($vie... |
286819 | There is a RestFull method that return a List of Menu objects
```
public ResponseEntity<List<Menu>> getMenus() {
..
}
```
But I don't know how to get them from the RestTemplate, getting the class from ResponseEntity>
```
ResponseEntity<List<Menu>> response = restTemplate
.exchange("http://127.0.0.... | Try use `ParameterizedTypeReference`
```
ResponseEntity<List<Menu>> response = restTemplate
.exchange("URI", HttpMethod.GET, entity, new ParameterizedTypeReference<List<Menu>>() {
});
``` |
286887 | I am making a search engine for songs using tags, and I have trouble building the SQL query that will list all the songs that match with the tags.
The database looks like this:
<http://i.imgur.com/5zmfAz8.png>
Songs have many Tags through an intermediate table(SongTags).
Let's have a population as example:
**Tags**... | To understand why your code didn't work, you should understand what's `flashvars` parameter and how it's working.
Adobe said about that [here](https://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html), for example :
>
> The FlashVars parameter of the HTML <OBJECT> tag sends variables into the top level o... |
288351 | make\_shared allocates single block for object and reference counter. So there is an obvious performance benefit using such technique.
I made simple experiment in VS2012 and I was looking for 'evidence':
```
std::shared_ptr<Test> sp2 = std::make_shared<Test>();
std::shared_ptr<Test> sp(new Test());
// Test is a simp... | If you read [cppreference's page for `make_shared`](http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared), they say:
>
> This function allocates memory for the `T` object and for the `shared_ptr`'s control block with a single memory allocation. In contrast, the declaration `std::shared_ptr<T> p(new T(Args..... |
288377 | I am a beginner and my question is not a homework. I want to write a C++ code in Linux to copy a large (40GiG) binary file.
My code has to meet the following conditions:
* the speed should be the same as copying with the OS
* amount of RAM should be assumed to be 4GiG
Currently, I use:
>
> sendfile (write\_fd, rea... | The best answer is that you should try it yourself and run some benchmarks.
However, to give you a hint, I quote the man page for [sendfile()](http://man7.org/linux/man-pages/man2/sendfile.2.html):
>
> Because this copying is done within the kernel, sendfile() is more efficient than the combination of read(2) and wr... |
288568 | This may turn out to be a bit embarassing, but here it is. It is probably not true that the ascending and descending central series (\*) of a nilpotent group have the same terms. (Or at least one of MacLane-Birkhoff, Rotman and Jacobson would have mentioned it.) However, I have been unable to find an example where they... | It's false even if $m=2$. Try the product of a group of order $2$ and a dihedral group of order $8$. The center has order $4$ and the quotient by the center is abelian. The commutator subgroup has order $2$. |
288594 | I want to fill an array with values. The **keys** of this array should be **readable dates** in the format 'YEAR-MONTH-DAY'. Starting point is '2010-5-25'.
The process should abort on the current date. Obviously, all dates should be valid dates.
I thought about doing this loop. But it seems that PHP is not able to che... | Simply you can try using `strtotime()`. Example:
```
$values = array();
$oldDate = strtotime('2010-05-25');
while($oldDate <= time()){
$values[date('Y-m-d', $oldDate)] = 'Your value';
$oldDate += 86400;
//Other codes
}
``` |
289100 | I learned that numbers can be converted into strings with `sprintf`:
```
int main()
{
int n;
char s[32];
printf("n=");
scanf("%d",&n);
sprintf(s,"%d",n); //HERE
puts(s);
return 0;
}
```
Is it possible to convert a string into a number with a similar command, without checking if each c... | Yes. You can use [`strtol`](http://linux.die.net/man/3/strtol) function.
```
long int strtol(const char * restrict nptr, char ** restrict endptr, int base);
```
The `strtol` convert the initial portion of the string pointed to by `nptr` to `long int` representation.
Better to not use `atoi`. It tells noting whe... |
289562 | I have a Layout with a searchbar on the top, a listview and then a bottom navigation view. The problem is, the last item of the listview hides behind the bottom navigation view.
Here is the code of the layout:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/ap... | The Python 3.7 environment does not yet have support for Google Cloud Endpoints, unfortunately. I would recommend you stick with the flex environment for the time being. |
289716 | >
> **Possible Duplicate:**
>
> [escape method is not supported by view page in admin area or backend of site in zend framework?](https://stackoverflow.com/questions/11135434/escape-method-is-not-supported-by-view-page-in-admin-area-or-backend-of-site-in)
>
>
>
I have installed zend framework properly on my lo... | `escape()` is not a php function.
If you want to use ZF's view helper Zend\_View\_Helper\_Escape, you need to call it on the view object:
`<?php echo $this->escape($this->username);?>` |
289912 | I'm asked to implement a program that generates a random number of jelly beans in a jar, prompt the user to make a guess on how many jelly beans are in the jar, and count how many times the user tried to guess before getting it right.
That's my problem right there -- getting the program to count how many times the use... | Have a counter variable that you increment on each loop in the while loop. Something like this:
```
int num_guesses = 0;
do {
System.out.print("Enter your guess: ");//prompt user to quess and read in
guess = scan.nextInt();
num_guesses++; // increment the number of guesses
if(guess < numOfJellyBeans) //if the qu... |
290076 | I am using this simple method of finding a user in the current domain, that works for all users that 'exist' but I can't find any way to determine if the user does not exist.
```
string userLDAP = @"MYDOMAIN/username";
string path = "WinNT://" + userLDAP ;
DirectoryEntry root = new DirectoryEntry(path, null, null, Aut... | It's better to use DirectorySearcher for this purpose...
```
string userName = "TargetUserName";
using (DirectorySearcher searcher = new DirectorySearcher("GC://yourdomain.com"))
{
searcher.Filter = string.Format("(&(objectClass=user)(sAMAccountName={0}))", userName);
using (... |
290158 | I wan't to limit the number of append that happen in Jquery whenever I click the button
```
function standardRoom() {
var flag = 0
if ($('select#selectBoxStandard option').length > 1 ) {
flag++
$('#selectBoxStandard').find("option:nth-last-child(-n+" + $('#selectBoxStandard').val() + ")").remove();
... | Everytime you call standardRoom function the `flag` variable is reset to 0, so it will always keeps adding the elements. Make sure you store that variable somewhere more global where you don't need to reset it:
```
var flag = 0;
function standardRoom() {
if ($('select#selectBoxStandard option').length > 1... |
290484 | I want to use [jquery autocomplete](http://jqueryui.com/autocomplete/) jquery plugin, I test below code but nothing happend, I check, the file added correctly and there is not js error.
```
function imodbdev_form_alter(&$form,$form_state,$form_id){
if($form_id='movie_node_form'){
drupal_add_library('system', '... | Yes, jQuery UI is available in drupal core.
To include libraries like that you need to call the [drupal\_add\_library()](https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_library/7) function to load the required js & css.
For exmaple:
```
drupal_add_library('system', 'drupal.autocomplete');
... |
290790 | I'm learning to code in React from [Tyler Mcginnis' React course](https://tylermcginnis.com/courses/react/) (which I strongly recommend btw) and I decided to develop my own project, a university administration website, which can be displayed in different languages.
So far, I have developed the Login page, please **not... | You can also get several documents by their id using:
```
Firestore.instance.collection('tournaments')..where(FieldPath.documentId, whereIn: myIdList).snapshots()
```
where myIdList is a List
Enjoy |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.