problem
stringlengths
26
131k
labels
class label
2 classes
Bundle size in bytes : <p><strong>Is there any way to know the bundle size in bytes?</strong> My point in asking this is I am saving parcelable object lists in my <code>bundle</code> on <code>onSaveInstanceState</code>. </p> <p>I need to check if the bundle size is reached it's size limit and prevent any more data to get saved, and to prevent <code>TransactionTooLarge</code> exception to occur.</p>
0debug
How can i fetch ID from multiple tag selected from database : [enter image description here][1] [1]: https://i.stack.imgur.com/euiSM.png Actully i have 3 tables "mail" , "tags" , "tag_assigned" I am using filter query of multiple tag selected mail list. For ex: From the screenshot i need to fetch mailid from this table where selected tags id "1" and "2". i want to return mail id 4 and 1 . how to get these ids from this table. I need sql query for this...Someone help me please
0debug
mBluetoothSocket.connect() prints a line : <p>I have been trying to find a solution for this, but not able to. So I am developing an POS app in Android and I need to print receipts for sales/purchase using a bluetooth printer.</p> <p>The printing, is working fine, per se, but whenever I call <strong>mBluetoothSocket.connect()</strong>, it prints out <strong>CONNECT "8869-XX-XXXXXX"</strong> on top of the print, which I don't want. I do not want to leave the connection open for long and I want the app to connect only when needed. How to achieve this? Any help guys. Find the code below.0 Thanks in advance.</p> <pre><code>package anil.com.andoirdbluetoothprint; import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; import java.util.Set; import java.util.UUID; import android.app.Activity; import android.app.ProgressDialog; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothSocket; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.util.Log; import android.view.View; import android.view.Window; import android.view.WindowManager; import android.widget.Button; import android.widget.Toast; public class MainActivity extends Activity implements Runnable { protected static final String TAG = "TAG"; private static final int REQUEST_CONNECT_DEVICE = 1; private static final int REQUEST_ENABLE_BT = 2; Button mScan, mPrint, mDisc; BluetoothAdapter mBluetoothAdapter; private UUID applicationUUID = UUID .fromString("00001101-0000-1000-8000-00805F9B34FB"); private ProgressDialog mBluetoothConnectProgressDialog; private BluetoothSocket mBluetoothSocket; BluetoothDevice mBluetoothDevice; @Override public void onCreate(Bundle mSavedInstanceState) { super.onCreate(mSavedInstanceState); setContentView(R.layout.activity_main); mScan = (Button) findViewById(R.id.Scan); mScan.setOnClickListener(new View.OnClickListener() { public void onClick(View mView) { mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (mBluetoothAdapter == null) { Toast.makeText(MainActivity.this, "Message1", Toast.LENGTH_SHORT).show(); } else { if (!mBluetoothAdapter.isEnabled()) { Intent enableBtIntent = new Intent( BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); } else { ListPairedDevices(); Intent connectIntent = new Intent(MainActivity.this, DeviceListActivity.class); startActivityForResult(connectIntent, REQUEST_CONNECT_DEVICE); } } } }); mPrint = (Button) findViewById(R.id.mPrint); mPrint.setOnClickListener(new View.OnClickListener() { public void onClick(View mView) { Thread t = new Thread() { public void run() { try { OutputStream os = mBluetoothSocket .getOutputStream(); String BILL = ""; // Before this line, it is printing "CONNECT 88C9-XX-XXXXXX" BILL = "Company Name \n"; BILL = BILL + "Address \n"; BILL = BILL + "--------------- \n"; BILL = BILL + "Item1 : Quantity \n"; BILL = BILL + "Rate : 100 $ \n"; BILL = BILL + "-----------------\n"; BILL = BILL + "Thank You \n"; os.write(BILL.getBytes()); //This is printer specific code you can comment ==== &gt; Start // Setting height int gs = 29; os.write(intToByteArray(gs)); int h = 104; os.write(intToByteArray(h)); int n = 162; os.write(intToByteArray(n)); // Setting Width int gs_width = 29; os.write(intToByteArray(gs_width)); int w = 119; os.write(intToByteArray(w)); int n_width = 2; os.write(intToByteArray(n_width)); } catch (Exception e) { Log.e("MainActivity", "Exe ", e); } } }; t.start(); } }); mDisc = (Button) findViewById(R.id.dis); mDisc.setOnClickListener(new View.OnClickListener() { public void onClick(View mView) { if (mBluetoothAdapter != null) mBluetoothAdapter.disable(); } }); }// onCreate @Override protected void onDestroy() { // TODO Auto-generated method stub super.onDestroy(); try { if (mBluetoothSocket != null) mBluetoothSocket.close(); } catch (Exception e) { Log.e("Tag", "Exe ", e); } } @Override public void onBackPressed() { try { if (mBluetoothSocket != null) mBluetoothSocket.close(); } catch (Exception e) { Log.e("Tag", "Exe ", e); } setResult(RESULT_CANCELED); finish(); } public void onActivityResult(int mRequestCode, int mResultCode, Intent mDataIntent) { super.onActivityResult(mRequestCode, mResultCode, mDataIntent); switch (mRequestCode) { case REQUEST_CONNECT_DEVICE: if (mResultCode == Activity.RESULT_OK) { Bundle mExtra = mDataIntent.getExtras(); String mDeviceAddress = mExtra.getString("DeviceAddress"); Log.v(TAG, "Coming incoming address " + mDeviceAddress); mBluetoothDevice = mBluetoothAdapter .getRemoteDevice(mDeviceAddress); mBluetoothConnectProgressDialog = ProgressDialog.show(this, "Connecting...", mBluetoothDevice.getName() + " : " + mBluetoothDevice.getAddress(), true, false); Thread mBlutoothConnectThread = new Thread(this); mBlutoothConnectThread.start(); // pairToDevice(mBluetoothDevice); This method is replaced by // progress dialog with thread } break; case REQUEST_ENABLE_BT: if (mResultCode == Activity.RESULT_OK) { ListPairedDevices(); Intent connectIntent = new Intent(MainActivity.this, DeviceListActivity.class); startActivityForResult(connectIntent, REQUEST_CONNECT_DEVICE); } else { Toast.makeText(MainActivity.this, "Message", Toast.LENGTH_SHORT).show(); } break; } } private void ListPairedDevices() { Set&lt;BluetoothDevice&gt; mPairedDevices = mBluetoothAdapter .getBondedDevices(); if (mPairedDevices.size() &gt; 0) { for (BluetoothDevice mDevice : mPairedDevices) { Log.v(TAG, "PairedDevices: " + mDevice.getName() + " " + mDevice.getAddress()); } } } public void run() { try { mBluetoothSocket = mBluetoothDevice .createRfcommSocketToServiceRecord(applicationUUID); mBluetoothAdapter.cancelDiscovery(); mBluetoothSocket.connect(); mHandler.sendEmptyMessage(0); } catch (IOException eConnectException) { Log.d(TAG, "CouldNotConnectToSocket", eConnectException); closeSocket(mBluetoothSocket); return; } } private void closeSocket(BluetoothSocket nOpenSocket) { try { nOpenSocket.close(); Log.d(TAG, "SocketClosed"); } catch (IOException ex) { Log.d(TAG, "CouldNotCloseSocket"); } } private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { mBluetoothConnectProgressDialog.dismiss(); Toast.makeText(MainActivity.this, "DeviceConnected", Toast.LENGTH_SHORT).show(); } }; public static byte intToByteArray(int value) { byte[] b = ByteBuffer.allocate(4).putInt(value).array(); for (int k = 0; k &lt; b.length; k++) { System.out.println("Selva [" + k + "] = " + "0x" + UnicodeFormatter.byteToHex(b[k])); } return b[3]; } public byte[] sel(int val) { ByteBuffer buffer = ByteBuffer.allocate(2); buffer.putInt(val); buffer.flip(); return buffer.array(); } } </code></pre>
0debug
ioapic_mem_read(void *opaque, target_phys_addr_t addr, unsigned int size) { IOAPICCommonState *s = opaque; int index; uint32_t val = 0; switch (addr & 0xff) { case IOAPIC_IOREGSEL: val = s->ioregsel; break; case IOAPIC_IOWIN: if (size != 4) { break; } switch (s->ioregsel) { case IOAPIC_REG_ID: val = s->id << IOAPIC_ID_SHIFT; break; case IOAPIC_REG_VER: val = IOAPIC_VERSION | ((IOAPIC_NUM_PINS - 1) << IOAPIC_VER_ENTRIES_SHIFT); break; case IOAPIC_REG_ARB: val = 0; break; default: index = (s->ioregsel - IOAPIC_REG_REDTBL_BASE) >> 1; if (index >= 0 && index < IOAPIC_NUM_PINS) { if (s->ioregsel & 1) { val = s->ioredtbl[index] >> 32; } else { val = s->ioredtbl[index] & 0xffffffff; } } } DPRINTF("read: %08x = %08x\n", s->ioregsel, val); break; } return val; }
1threat
App is running but doe not fetch data from json : I am learning json and not getting solution. I have tried updating my json file and xml file but no working. here is the code the errors I have faced in the code is written in the comment section below please help me through it. The app is running perfectly but does not fetch data from this link below https://api.myjson.com/bins/1hkm17 package com.taxsmart.jsonsimpleexample; import android.os.AsyncTask; import com.taxsmart.jsonsimpleexample.MainActivity; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class fetchData extends AsyncTask<Void,Void,Void> { String data =""; String dataParsed = ""; String singleParsed =""; @Override protected Void doInBackground(Void... voids) { try { URL url = new URL("https://api.myjson.com/bins/1hkm17"); HttpURLConnection httpURLConnection = (HttpURLConnection)url.openConnection(); InputStream inputStream = httpURLConnection.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); String line = ""; while(line != null){ line = bufferedReader.readLine(); data = data + line; } JSONArray JA = new JSONArray(data); for(int i =0 ;i <JA.length(); i++){ JSONObject JO = (JSONObject) JA.get(i); singleParsed = "Name" + JO.get("name") + "\n"+ "Password" + JO.get("Password") + "\n"+ "Contact" + JO.get("Contact") + "\n"+ "Country" + JO.get("Country") + "\n"; dataParsed = dataParsed + singleParsed +"\n" ; } } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (JSONException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); MainActivity.data.setText(this.dataParsed); } }
0debug
Why does conda create try to install weird packages? : <p>I am trying to install a new conda environment that will be totally separate from my other environments, so I run:</p> <pre><code>conda create --name foot35 python=3.5 </code></pre> <p>Anaconda then asks for my approval to install these NEW packages:</p> <pre><code>asn1crypto: 0.22.0-py35he3634b9_1 ca-certificates: 2017.08.26-h94faf87_0 cachecontrol: 0.12.3-py35h3f82863_0 certifi: 2017.7.27.1-py35hbab57cd_0 cffi: 1.10.0-py35h4132a7f_1 chardet: 3.0.4-py35h177e1b7_1 colorama: 0.3.9-py35h32a752f_0 cryptography: 2.0.3-py35h67a4558_1 distlib: 0.2.5-py35h12c42d7_0 html5lib: 0.999999999-py35h79d4e7f_0 idna: 2.6-py35h8dcb9ae_1 lockfile: 0.12.2-py35h667c6d9_0 msgpack-python: 0.4.8-py35hdef45cb_0 openssl: 1.0.2l-vc14hcac20b0_2 [vc14] packaging: 16.8-py35h5fb721f_1 pip: 9.0.1-py35h69293b5_3 progress: 1.3-py35ha84af61_0 pycparser: 2.18-py35h15a15da_1 pyopenssl: 17.2.0-py35hea705d1_0 pyparsing: 2.2.0-py35hcabcaab_1 pysocks: 1.6.7-py35hb30ac0d_1 python: 3.5.4-hedc2606_15 requests: 2.18.4-py35h54a615f_1 setuptools: 36.5.0-py35h21a22e4_0 six: 1.10.0-py35h06cf344_1 urllib3: 1.22-py35h8cc84eb_0 vc: 14-h2379b0c_1 vs2015_runtime: 14.0.25123-hd4c4e62_1 webencodings: 0.5.1-py35h5d527fb_1 wheel: 0.29.0-py35hdbcb6e6_1 win_inet_pton: 1.0.1-py35hbef1270_1 wincertstore: 0.2-py35hfebbdb8_0 </code></pre> <p>I don't know why it suggests these specific ones. I looked up <a href="https://pypi.python.org/pypi/lockfile/0.12.2" rel="noreferrer">lockfile</a> and its website says: </p> <blockquote> <p>Note: This package is deprecated.</p> </blockquote> <p><a href="https://i.imgur.com/cEjfYrQ.png" rel="noreferrer">Here</a> is a screenshot of my command prompt as additional information. </p> <p>I am trying to do a clean install that is unrelated/independent to the root environment. </p> <p>Why is conda trying to install these things and how do I fix it?</p>
0debug
@RestControllerAdvice vs @ControllerAdvice : <ul> <li>What are the major difference between @RestControllerAdvice and @ControllerAdvice ??</li> <li>Is it we should always use @RestControllerAdvice for rest services and @ControllerAdvice MVC ?</li> </ul>
0debug
static void ahci_pci_enable(AHCIQState *ahci) { uint8_t reg; start_ahci_device(ahci); switch (ahci->fingerprint) { case AHCI_INTEL_ICH9: reg = qpci_config_readb(ahci->dev, 0x92); reg |= 0x3F; qpci_config_writeb(ahci->dev, 0x92, reg); ASSERT_BIT_SET(qpci_config_readb(ahci->dev, 0x92), 0x3F); break; } }
1threat
Django - 'datetime.date' object has no attribute 'tzinfo' : <p>Here is my code that I use to make the datetime timezone aware. I tried to use the recommended approach from the Django docs. </p> <pre><code>tradeDay = day.trade_date + timedelta(hours=6) td1 = pytz.timezone("Europe/London").localize(tradeDay, is_dst=None) tradeDay = td1.astimezone(pytz.utc) </code></pre> <p>I get the tz_info error. How can I datetime a tz_info attribute? </p> <blockquote> <p>USE_TZ = True in settings.py</p> </blockquote>
0debug
How to enter an array lenght? : Sorry for stupid question, just started oop. Tried to enter the length of array using .lengh, but got mistake. Was exactly wrong? import java.util.*; public class Storage { public static int i = 0, size; static int[] number; public static void main (String[] args) { Scanner input = new Scanner(System.in); System.out.println("What is the value of array?"); number = new int [input.nextInt()]; System.out.println("Write the numbers:"); for (int i : number) { number[i] = input.nextInt(); } System.out.println("Array:"); System.out.println(Arrays.toString(number)); } }
0debug
Remove the data where certain words come in R : I have a dataframe called "companynames" which consist of about 9000 company names. I want to remove those company names from the data where these certain words come like stopwords <- c("Trade","Investment","Trading") Please help. Thanks in advance!
0debug
Find duplicates and delete all in notepad++ : <p>I have multiple email addresses. I need to find and delete all (including found one). Is this possible in notepad++?</p> <p>example:<code>epshetsky@test.com, rek4@test.com, rajesh1239@test.com, mohanraj@test.com, sam@test.com, nithin@test.com, midhunvintech@test.com, karthickgm27@test.com, rajesh1239@test.com, mohanraj@test.com, nithin@test.com,</code></p> <p>I need results back like</p> <p><code>epshetsky@test.com, rek4@test.com, sam@test.com, nithin@test.com, midhunvintech@test.com, karthickgm27@test.com,</code></p> <p>How to do in notepad++?</p>
0debug
Completely removing tests from angular4 : <p>I have built a really small application using angular4. I have the main app component, two subcomponents and one service. I feel like I dont need tests for such a small application and want to remove everything test related to make the project cleaner</p> <p>So my question is what are all the files I can remove from my project that are related to testing? I already deleted the spec files under my components but what next? Can i delete the src/test.ts, src/tsconfig.spec.js, protractor.conf.js, karma.conf.js, etc? Do i have to modify some configurations if i do delete this?</p> <p>Also on a side note does angular cli allow to create a new project without all this test related stuff?</p>
0debug
Difference between a server with http.createServer and a server using express in node js : <p>What's the difference between creating a server using http module and creating a server using express framework in node js? Thanks.</p>
0debug
static void quantize_and_encode_band_cost_SQUAD_mips(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, const float ROUNDING) { const float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - scale_idx + SCALE_ONE_POS - SCALE_DIV_512]; const float IQ = ff_aac_pow2sf_tab [POW_SF2_ZERO + scale_idx - SCALE_ONE_POS + SCALE_DIV_512]; int i; int qc1, qc2, qc3, qc4; uint8_t *p_bits = (uint8_t *)ff_aac_spectral_bits[cb-1]; uint16_t *p_codes = (uint16_t *)ff_aac_spectral_codes[cb-1]; float *p_vec = (float *)ff_aac_codebook_vectors[cb-1]; abs_pow34_v(s->scoefs, in, size); scaled = s->scoefs; for (i = 0; i < size; i += 4) { int curidx; int *in_int = (int *)&in[i]; int t0, t1, t2, t3, t4, t5, t6, t7; const float *vec; qc1 = scaled[i ] * Q34 + ROUND_STANDARD; qc2 = scaled[i+1] * Q34 + ROUND_STANDARD; qc3 = scaled[i+2] * Q34 + ROUND_STANDARD; qc4 = scaled[i+3] * Q34 + ROUND_STANDARD; __asm__ volatile ( ".set push \n\t" ".set noreorder \n\t" "slt %[qc1], $zero, %[qc1] \n\t" "slt %[qc2], $zero, %[qc2] \n\t" "slt %[qc3], $zero, %[qc3] \n\t" "slt %[qc4], $zero, %[qc4] \n\t" "lw %[t0], 0(%[in_int]) \n\t" "lw %[t1], 4(%[in_int]) \n\t" "lw %[t2], 8(%[in_int]) \n\t" "lw %[t3], 12(%[in_int]) \n\t" "srl %[t0], %[t0], 31 \n\t" "srl %[t1], %[t1], 31 \n\t" "srl %[t2], %[t2], 31 \n\t" "srl %[t3], %[t3], 31 \n\t" "subu %[t4], $zero, %[qc1] \n\t" "subu %[t5], $zero, %[qc2] \n\t" "subu %[t6], $zero, %[qc3] \n\t" "subu %[t7], $zero, %[qc4] \n\t" "movn %[qc1], %[t4], %[t0] \n\t" "movn %[qc2], %[t5], %[t1] \n\t" "movn %[qc3], %[t6], %[t2] \n\t" "movn %[qc4], %[t7], %[t3] \n\t" ".set pop \n\t" : [qc1]"+r"(qc1), [qc2]"+r"(qc2), [qc3]"+r"(qc3), [qc4]"+r"(qc4), [t0]"=&r"(t0), [t1]"=&r"(t1), [t2]"=&r"(t2), [t3]"=&r"(t3), [t4]"=&r"(t4), [t5]"=&r"(t5), [t6]"=&r"(t6), [t7]"=&r"(t7) : [in_int]"r"(in_int) : "memory" ); curidx = qc1; curidx *= 3; curidx += qc2; curidx *= 3; curidx += qc3; curidx *= 3; curidx += qc4; curidx += 40; put_bits(pb, p_bits[curidx], p_codes[curidx]); if (out) { vec = &p_vec[curidx*4]; out[i+0] = vec[0] * IQ; out[i+1] = vec[1] * IQ; out[i+2] = vec[2] * IQ; out[i+3] = vec[3] * IQ; } } }
1threat
MySQL select statement not working for `*` : <p>Trying to load the data from my SQL tables with the following statement</p> <pre><code>select `*` from `table_name` </code></pre> <p>Unfortunately, it throws an error in the MySQL <strong>5.6.33</strong> version and another side it works fine in the <strong>5.7.25</strong> version.</p> <p>I'm confused where it is the configuration thing or it is due to the version change because I'm not able to find out the clear documentation on the above thing.</p> <p>Also, what is the preferred way to write a select statement? Should I go with <strong>``</strong> or not.</p>
0debug
uint32_t HELPER(servc)(uint32_t r1, uint64_t r2) { if (sclp_service_call(env, r1, r2)) { return 3; } return 0; }
1threat
static int vp3_decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) { Vp3DecodeContext *s = avctx->priv_data; GetBitContext gb; static int counter = 0; init_get_bits(&gb, buf, buf_size * 8); if (s->theora && get_bits1(&gb)) { int ptype = get_bits(&gb, 7); skip_bits(&gb, 6*8); switch(ptype) { case 1: theora_decode_comments(avctx, gb); break; case 2: theora_decode_tables(avctx, gb); init_dequantizer(s); break; default: av_log(avctx, AV_LOG_ERROR, "Unknown Theora config packet: %d\n", ptype); } return buf_size; } s->keyframe = !get_bits1(&gb); if (!s->theora) skip_bits(&gb, 1); s->last_quality_index = s->quality_index; s->quality_index = get_bits(&gb, 6); if (s->theora >= 0x030200) skip_bits1(&gb); if (s->avctx->debug & FF_DEBUG_PICT_INFO) av_log(s->avctx, AV_LOG_INFO, " VP3 %sframe #%d: Q index = %d\n", s->keyframe?"key":"", counter, s->quality_index); counter++; if (s->quality_index != s->last_quality_index) init_dequantizer(s); if (s->keyframe) { if (!s->theora) { skip_bits(&gb, 4); skip_bits(&gb, 4); if (s->version) { s->version = get_bits(&gb, 5); if (counter == 1) av_log(s->avctx, AV_LOG_DEBUG, "VP version: %d\n", s->version); } } if (s->version || s->theora) { if (get_bits1(&gb)) av_log(s->avctx, AV_LOG_ERROR, "Warning, unsupported keyframe coding type?!\n"); skip_bits(&gb, 2); } if (s->last_frame.data[0] == s->golden_frame.data[0]) { if (s->golden_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); s->last_frame= s->golden_frame; } else { if (s->golden_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); if (s->last_frame.data[0]) avctx->release_buffer(avctx, &s->last_frame); } s->golden_frame.reference = 3; if(avctx->get_buffer(avctx, &s->golden_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n"); return -1; } memcpy(&s->current_frame, &s->golden_frame, sizeof(AVFrame)); if (!s->pixel_addresses_inited) { if (!s->flipped_image) vp3_calculate_pixel_addresses(s); else theora_calculate_pixel_addresses(s); } } else { s->current_frame.reference = 3; if(avctx->get_buffer(avctx, &s->current_frame) < 0) { av_log(s->avctx, AV_LOG_ERROR, "vp3: get_buffer() failed\n"); return -1; } } s->current_frame.qscale_table= s->qscale_table; s->current_frame.qstride= 0; init_frame(s, &gb); #if KEYFRAMES_ONLY if (!s->keyframe) { memcpy(s->current_frame.data[0], s->golden_frame.data[0], s->current_frame.linesize[0] * s->height); memcpy(s->current_frame.data[1], s->golden_frame.data[1], s->current_frame.linesize[1] * s->height / 2); memcpy(s->current_frame.data[2], s->golden_frame.data[2], s->current_frame.linesize[2] * s->height / 2); } else { #endif if (unpack_superblocks(s, &gb) || unpack_modes(s, &gb) || unpack_vectors(s, &gb) || unpack_dct_coeffs(s, &gb)) { av_log(s->avctx, AV_LOG_ERROR, " vp3: could not decode frame\n"); return -1; } reverse_dc_prediction(s, 0, s->fragment_width, s->fragment_height); render_fragments(s, 0, s->width, s->height, 0); if ((avctx->flags & CODEC_FLAG_GRAY) == 0) { reverse_dc_prediction(s, s->u_fragment_start, s->fragment_width / 2, s->fragment_height / 2); reverse_dc_prediction(s, s->v_fragment_start, s->fragment_width / 2, s->fragment_height / 2); render_fragments(s, s->u_fragment_start, s->width / 2, s->height / 2, 1); render_fragments(s, s->v_fragment_start, s->width / 2, s->height / 2, 2); } else { memset(s->current_frame.data[1], 0x80, s->width * s->height / 4); memset(s->current_frame.data[2], 0x80, s->width * s->height / 4); } #if KEYFRAMES_ONLY } #endif *data_size=sizeof(AVFrame); *(AVFrame*)data= s->current_frame; if ((s->last_frame.data[0]) && (s->last_frame.data[0] != s->golden_frame.data[0])) avctx->release_buffer(avctx, &s->last_frame); memcpy(&s->last_frame, &s->current_frame, sizeof(AVFrame)); s->current_frame.data[0]= NULL; return buf_size; }
1threat
static TCGv_i32 gen_get_asi(DisasContext *dc, int insn) { int asi; if (IS_IMM) { #ifdef TARGET_SPARC64 asi = dc->asi; #else gen_exception(dc, TT_ILL_INSN); asi = 0; #endif } else { asi = GET_FIELD(insn, 19, 26); } return tcg_const_i32(asi); }
1threat
How do you implement Horizontal-Scrolling in Android Studio with LibGDX? : right now I am trying to program an Android Game to further educate myself in App Developement. I want to program a game that is like the old "Warfare 1917" browser games. Right now I am stuck on the scrolling part. I am using Java and LibGDX. <br><br>I'll try to explain what I want to with a gif.<br><br> [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/rvZqA.gif I have searched and tried everything the hole day but I am not able to find any real solutions to this. I hope you can understand what I am trying to do.
0debug
void qdev_free(DeviceState *dev) { BusState *bus; if (dev->state == DEV_STATE_INITIALIZED) { while (dev->num_child_bus) { bus = QLIST_FIRST(&dev->child_bus); qbus_free(bus); } if (dev->info->vmsd) vmstate_unregister(dev->info->vmsd, dev); if (dev->info->exit) dev->info->exit(dev); if (dev->opts) qemu_opts_del(dev->opts); } qemu_unregister_reset(qdev_reset, dev); QLIST_REMOVE(dev, sibling); for (prop = dev->info->props; prop && prop->name; prop++) { if (prop->info->free) { prop->info->free(dev, prop); } } qemu_free(dev); }
1threat
Proper way to stop Akka Streams on condition : <p>I have been successfully using <a href="http://doc.akka.io/api/akka/2.4/?_ga=1.140568374.588201913.1464855311#akka.stream.scaladsl.FileIO$" rel="noreferrer">FileIO</a> to stream the contents of a file, compute some transformations for each line and aggregate/reduce the results. </p> <p>Now I have a pretty specific use case, where I would like to stop the stream when a condition is reached, so that it is not necessary to read the whole file but the process finishes as soon as possible. What is the recommended way to achieve this?</p>
0debug
static int encode_residual(FlacEncodeContext *ctx, int ch) { int i, n; int min_order, max_order, opt_order, precision, omethod; int min_porder, max_porder; FlacFrame *frame; FlacSubframe *sub; int32_t coefs[MAX_LPC_ORDER][MAX_LPC_ORDER]; int shift[MAX_LPC_ORDER]; int32_t *res, *smp; frame = &ctx->frame; sub = &frame->subframes[ch]; res = sub->residual; smp = sub->samples; n = frame->blocksize; for(i=1; i<n; i++) { if(smp[i] != smp[0]) break; } if(i == n) { sub->type = sub->type_code = FLAC_SUBFRAME_CONSTANT; res[0] = smp[0]; return sub->obits; } if(n < 5) { sub->type = sub->type_code = FLAC_SUBFRAME_VERBATIM; encode_residual_verbatim(res, smp, n); return sub->obits * n; } min_order = ctx->options.min_prediction_order; max_order = ctx->options.max_prediction_order; min_porder = ctx->options.min_partition_order; max_porder = ctx->options.max_partition_order; precision = ctx->options.lpc_coeff_precision; omethod = ctx->options.prediction_order_method; if(!ctx->options.use_lpc || max_order == 0 || (n <= max_order)) { uint32_t bits[MAX_FIXED_ORDER+1]; if(max_order > MAX_FIXED_ORDER) max_order = MAX_FIXED_ORDER; opt_order = 0; bits[0] = UINT32_MAX; for(i=min_order; i<=max_order; i++) { encode_residual_fixed(res, smp, n, i); bits[i] = calc_rice_params_fixed(&sub->rc, min_porder, max_porder, res, n, i, sub->obits); if(bits[i] < bits[opt_order]) { opt_order = i; } } sub->order = opt_order; sub->type = FLAC_SUBFRAME_FIXED; sub->type_code = sub->type | sub->order; if(sub->order != max_order) { encode_residual_fixed(res, smp, n, sub->order); return calc_rice_params_fixed(&sub->rc, min_porder, max_porder, res, n, sub->order, sub->obits); } return bits[sub->order]; } opt_order = ff_lpc_calc_coefs(&ctx->dsp, smp, n, max_order, precision, coefs, shift, ctx->options.use_lpc, omethod, MAX_LPC_SHIFT, 0); if(omethod == ORDER_METHOD_2LEVEL || omethod == ORDER_METHOD_4LEVEL || omethod == ORDER_METHOD_8LEVEL) { int levels = 1 << omethod; uint32_t bits[levels]; int order; int opt_index = levels-1; opt_order = max_order-1; bits[opt_index] = UINT32_MAX; for(i=levels-1; i>=0; i--) { order = min_order + (((max_order-min_order+1) * (i+1)) / levels)-1; if(order < 0) order = 0; encode_residual_lpc(res, smp, n, order+1, coefs[order], shift[order]); bits[i] = calc_rice_params_lpc(&sub->rc, min_porder, max_porder, res, n, order+1, sub->obits, precision); if(bits[i] < bits[opt_index]) { opt_index = i; opt_order = order; } } opt_order++; } else if(omethod == ORDER_METHOD_SEARCH) { uint32_t bits[MAX_LPC_ORDER]; opt_order = 0; bits[0] = UINT32_MAX; for(i=min_order-1; i<max_order; i++) { encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); bits[i] = calc_rice_params_lpc(&sub->rc, min_porder, max_porder, res, n, i+1, sub->obits, precision); if(bits[i] < bits[opt_order]) { opt_order = i; } } opt_order++; } else if(omethod == ORDER_METHOD_LOG) { uint32_t bits[MAX_LPC_ORDER]; int step; opt_order= min_order - 1 + (max_order-min_order)/3; memset(bits, -1, sizeof(bits)); for(step=16 ;step; step>>=1){ int last= opt_order; for(i=last-step; i<=last+step; i+= step){ if(i<min_order-1 || i>=max_order || bits[i] < UINT32_MAX) continue; encode_residual_lpc(res, smp, n, i+1, coefs[i], shift[i]); bits[i] = calc_rice_params_lpc(&sub->rc, min_porder, max_porder, res, n, i+1, sub->obits, precision); if(bits[i] < bits[opt_order]) opt_order= i; } } opt_order++; } sub->order = opt_order; sub->type = FLAC_SUBFRAME_LPC; sub->type_code = sub->type | (sub->order-1); sub->shift = shift[sub->order-1]; for(i=0; i<sub->order; i++) { sub->coefs[i] = coefs[sub->order-1][i]; } encode_residual_lpc(res, smp, n, sub->order, sub->coefs, sub->shift); return calc_rice_params_lpc(&sub->rc, min_porder, max_porder, res, n, sub->order, sub->obits, precision); }
1threat
how does 100% - 40 works in java? : how does 100% - 40 works in java ? ```java System.out.println(100% - 40); ``` please explain the steps taken by compiler takes for it to resolve. like I understand % is an operator which takes two operand to work but how it is accepting other operator like "-" minus in this case.
0debug
static void mch_update_pciexbar(MCHPCIState *mch) { PCIDevice *pci_dev = PCI_DEVICE(mch); BusState *bus = qdev_get_parent_bus(DEVICE(mch)); PCIExpressHost *pehb = PCIE_HOST_BRIDGE(bus->parent); uint64_t pciexbar; int enable; uint64_t addr; uint64_t addr_mask; uint32_t length; pciexbar = pci_get_quad(pci_dev->config + MCH_HOST_BRIDGE_PCIEXBAR); enable = pciexbar & MCH_HOST_BRIDGE_PCIEXBAREN; addr_mask = MCH_HOST_BRIDGE_PCIEXBAR_ADMSK; switch (pciexbar & MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_MASK) { case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_256M: length = 256 * 1024 * 1024; break; case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_128M: length = 128 * 1024 * 1024; addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_128ADMSK | MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK; break; case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_64M: length = 64 * 1024 * 1024; addr_mask |= MCH_HOST_BRIDGE_PCIEXBAR_64ADMSK; break; case MCH_HOST_BRIDGE_PCIEXBAR_LENGTH_RVD: default: enable = 0; length = 0; abort(); break; } addr = pciexbar & addr_mask; pcie_host_mmcfg_update(pehb, enable, addr, length); if (enable) { mch->pci_hole.begin = addr + length; } else { mch->pci_hole.begin = MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT; } }
1threat
static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s) { BlockDriverState *source = blk_bs(s->common.blk); int64_t sector_num, first_chunk; uint64_t delay_ns = 0; int nb_chunks = 1; int64_t end = s->bdev_length / BDRV_SECTOR_SIZE; int sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS; bool write_zeroes_ok = bdrv_can_write_zeroes_with_unmap(blk_bs(s->target)); sector_num = hbitmap_iter_next(&s->hbi); if (sector_num < 0) { bdrv_dirty_iter_init(s->dirty_bitmap, &s->hbi); sector_num = hbitmap_iter_next(&s->hbi); trace_mirror_restart_iter(s, bdrv_get_dirty_count(s->dirty_bitmap)); assert(sector_num >= 0); } first_chunk = sector_num / sectors_per_chunk; while (test_bit(first_chunk, s->in_flight_bitmap)) { trace_mirror_yield_in_flight(s, sector_num, s->in_flight); mirror_wait_for_io(s); } block_job_pause_point(&s->common); while (nb_chunks * sectors_per_chunk < (s->buf_size >> BDRV_SECTOR_BITS)) { int64_t hbitmap_next; int64_t next_sector = sector_num + nb_chunks * sectors_per_chunk; int64_t next_chunk = next_sector / sectors_per_chunk; if (next_sector >= end || !bdrv_get_dirty(source, s->dirty_bitmap, next_sector)) { break; } if (test_bit(next_chunk, s->in_flight_bitmap)) { break; } hbitmap_next = hbitmap_iter_next(&s->hbi); if (hbitmap_next > next_sector || hbitmap_next < 0) { bdrv_set_dirty_iter(&s->hbi, next_sector); hbitmap_next = hbitmap_iter_next(&s->hbi); } assert(hbitmap_next == next_sector); nb_chunks++; } bdrv_reset_dirty_bitmap(s->dirty_bitmap, sector_num, nb_chunks * sectors_per_chunk); bitmap_set(s->in_flight_bitmap, sector_num / sectors_per_chunk, nb_chunks); while (nb_chunks > 0 && sector_num < end) { int ret; int io_sectors, io_sectors_acct; BlockDriverState *file; enum MirrorMethod { MIRROR_METHOD_COPY, MIRROR_METHOD_ZERO, MIRROR_METHOD_DISCARD } mirror_method = MIRROR_METHOD_COPY; assert(!(sector_num % sectors_per_chunk)); ret = bdrv_get_block_status_above(source, NULL, sector_num, nb_chunks * sectors_per_chunk, &io_sectors, &file); if (ret < 0) { io_sectors = nb_chunks * sectors_per_chunk; } io_sectors -= io_sectors % sectors_per_chunk; if (io_sectors < sectors_per_chunk) { io_sectors = sectors_per_chunk; } else if (ret >= 0 && !(ret & BDRV_BLOCK_DATA)) { int64_t target_sector_num; int target_nb_sectors; bdrv_round_sectors_to_clusters(blk_bs(s->target), sector_num, io_sectors, &target_sector_num, &target_nb_sectors); if (target_sector_num == sector_num && target_nb_sectors == io_sectors) { mirror_method = ret & BDRV_BLOCK_ZERO ? MIRROR_METHOD_ZERO : MIRROR_METHOD_DISCARD; } } while (s->in_flight >= MAX_IN_FLIGHT) { trace_mirror_yield_in_flight(s, sector_num, s->in_flight); mirror_wait_for_io(s); } mirror_clip_sectors(s, sector_num, &io_sectors); switch (mirror_method) { case MIRROR_METHOD_COPY: io_sectors = mirror_do_read(s, sector_num, io_sectors); io_sectors_acct = io_sectors; break; case MIRROR_METHOD_ZERO: case MIRROR_METHOD_DISCARD: mirror_do_zero_or_discard(s, sector_num, io_sectors, mirror_method == MIRROR_METHOD_DISCARD); if (write_zeroes_ok) { io_sectors_acct = 0; } else { io_sectors_acct = io_sectors; } break; default: abort(); } assert(io_sectors); sector_num += io_sectors; nb_chunks -= DIV_ROUND_UP(io_sectors, sectors_per_chunk); if (s->common.speed) { delay_ns = ratelimit_calculate_delay(&s->limit, io_sectors_acct); } } return delay_ns; }
1threat
make program visual studio 2012 delete all after third /. file.txt with urls : http://www.exp.org/forum/member.php?1-Morrus&language=uk http://expl.com/forum/member.php/1-%D0%90%D0%B4%D0%BC%D0%B8%D0%BD?langid=5 output: http://www.exp.org/ http://expl.com/ need help with program visual studio 2012
0debug
static inline void RENAME(bgr16ToY)(uint8_t *dst, uint8_t *src, int width) { int i; for(i=0; i<width; i++) { int d= ((uint16_t*)src)[i]; int b= d&0x1F; int g= (d>>5)&0x3F; int r= (d>>11)&0x1F; dst[i]= ((2*RY*r + GY*g + 2*BY*b)>>(RGB2YUV_SHIFT-2)) + 16; } }
1threat
In requirements.txt, what does tilde equals (~=) mean? : <p>In the <code>requirements.txt</code> for a Python library I am using, one of the requirements is specified like:</p> <pre><code>mock-django~=0.6.10 </code></pre> <p>What does <code>~=</code> mean?</p>
0debug
static int test_vector_fmul(AVFloatDSPContext *fdsp, AVFloatDSPContext *cdsp, const float *v1, const float *v2) { LOCAL_ALIGNED(32, float, cdst, [LEN]); LOCAL_ALIGNED(32, float, odst, [LEN]); int ret; cdsp->vector_fmul(cdst, v1, v2, LEN); fdsp->vector_fmul(odst, v1, v2, LEN); if (ret = compare_floats(cdst, odst, LEN, FLT_EPSILON)) av_log(NULL, AV_LOG_ERROR, "vector_fmul failed\n"); return ret; }
1threat
looping over array Ruby cucumber : I am trying to write a test in Cucumber using Ruby. I have an array: contacts = Array.new(arg1, arg2, arg3, arg4) And I want to create a loop that will take that array and fill in a field with that array. Kind of like: while contacts.index[0] < contacts.index[3] fill_in('field', with: contacts) ... contacts +=1 end I can't seem to get this to work, it tells me I've got the wrong number of arguments ArgumentError: wrong number of arguments (4 for 0..2) Is there something blindingly obvious I'm missing? Thanks
0debug
Visual Studio UI Bugs - Storyboard : Visual Studio is so horrible!!! How do I get out of this jam (where I've opened the color editor and pressed Maximize)!!! I'm finding the color selector popover to be completely broken, the close button does not work. Also, it Will Not set the color when I enter a HEX value!!! [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/w4HW9.png
0debug
How to describe parameters in DRF Docs : <p>I'm using Django REST Framework v3.6 built-in interactive documentation <code>django_rest_framework.documentation</code> (<strong>not</strong> <code>django-rest-swagger</code>).</p> <p>Basically, I'm following <a href="http://www.django-rest-framework.org/topics/documenting-your-api/" rel="noreferrer">the official documentation</a> and use this in my URLset configuration:</p> <pre><code>from rest_framework.documentation import include_docs_urls urlpatterns = [ url(r"^", include_docs_urls(title="My API")), ... ] </code></pre> <p>Everything seems to work and I get a nice interactive documentation page, but I have a <code>ViewSet</code> with <code>lookup_field = "slug"</code> and one thing about the generated documentation bothers me:</p> <p><a href="https://i.stack.imgur.com/7ukbh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/7ukbh.png" alt="In &quot;Path parameters&quot;, the description for &quot;slug&quot; parameter is empty"></a></p> <p>I want to have some useful information it that description, like "an unique permanently-assigned alphanumeric ID" or something among those lines, but can't find any documentation where this data comes from.</p> <p>There is a workaround but I really don't want to <a href="http://www.django-rest-framework.org/api-guide/schemas/#explicit-schema-definition" rel="noreferrer">define all the schema explicitly</a>. I want to declare my classes with nice docstrings and have docs auto-generated. I've also found an suggestion to put <code>slug -- here goes the description</code> in the docstring but it doesn't seem work - the text just appears with the rest of the Markdown-formatted description.</p> <p>So... I wonder about two things:</p> <ol> <li>(A specific question) Where do I fill this path parameter description?</li> <li>(More generic version of the same question) What's the best way to learn how schemas are auto-generated from code?</li> </ol>
0debug
permssion denied if i want to conncet to aws servers : I launched two Ubuntu free-tier servers in different regions on AWS. I was ping one server to another server but it displayed one error message that was connection timed out.can you please fix the problem as soon as possible. This is the error : /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/ubuntu/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys Permission denied (publickey). 172.31.94.158 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 172.31.94.158 port 22: Connection timed out\r\n", "unreachable": true } I tried below commands 1.ssh-copy-id ubuntu@172.31.94.158 2.sudo ansible webserver -m ping
0debug
difference in the style of giving comments between C and C++ : Is there any difference between a commenting style between C(`/*..*/`) and C++(`//`)? **MISRA C says** > Rule 2.2 (required): Source code shall only use /* … */ style > comments. **MISRA C++ says** Rule 2.7.1 (required): The character sequence /* shall not be used with c style comments. Can any one explain me what could be the difference?
0debug
static int vmdk_read(BlockDriverState *bs, int64_t sector_num, uint8_t *buf, int nb_sectors) { BDRVVmdkState *s = bs->opaque; int index_in_cluster, n, ret; uint64_t cluster_offset; while (nb_sectors > 0) { cluster_offset = get_cluster_offset(bs, sector_num << 9, 0); index_in_cluster = sector_num % s->cluster_sectors; n = s->cluster_sectors - index_in_cluster; if (n > nb_sectors) n = nb_sectors; if (!cluster_offset) { if (s->hd->backing_hd) { if (!vmdk_is_cid_valid(bs)) return -1; ret = bdrv_read(s->hd->backing_hd, sector_num, buf, n); if (ret < 0) return -1; } else { memset(buf, 0, 512 * n); } } else { if(bdrv_pread(s->hd, cluster_offset + index_in_cluster * 512, buf, n * 512) != n * 512) return -1; } nb_sectors -= n; sector_num += n; buf += n * 512; } return 0; }
1threat
static void icp_pit_write(void *opaque, target_phys_addr_t offset, uint64_t value, unsigned size) { icp_pit_state *s = (icp_pit_state *)opaque; int n; n = offset >> 8; if (n > 3) { hw_error("sp804_write: Bad timer %d\n", n); } arm_timer_write(s->timer[n], offset & 0xff, value); }
1threat
What's the difference between && and || in JavaScript? : <p>Here's a perfect illustration I saw.</p> <p>&amp;&amp; </p> <pre><code>if (num &gt; 5 &amp;&amp; num &lt; 10) { return "Yes"; } return "No"; </code></pre> <p>||</p> <pre><code>if (num &gt; 10 || num &lt; 5) { return "No"; } return "Yes"; </code></pre> <p>What's the difference between these two?</p>
0debug
different output using perl to parse tab-delimited files : In the `perl` script below written in a `shell`, if I use the `tab-delimited` `numeric` file, I get the desired result of each line parsed accordingly. However, if I use the `alpha` file as input only the first line is parsed. It is the exact same script and the only difference between `alpha` and `numeric` is that in `alpha` the `NC_000023.11:g.41747805_41747806delinsTT` and `NC_000023.11:g.41750615C>A` in `numeric` is `NC_0000X.11:g.41747805_41747806delinsTT` and `NC_0000X.11:g.41750615C>A` in `alpha`. What am I missing? Thank you :). **numeric** Input Variant Errors Chromosomal Variant Coding Variant(s) NM_003924.3:c.*18_*19delGCinsAA NC_000023.11:g.41747805_41747806delinsTT LRG_513t1:c.*18_*19delinsAA NM NM_003924.3:c.013G>T NC_000023.11:g.41750615C>A LRG_513t1:c.13G>T perl perl -ne 'next if $. == 1; if(/.*del([A-Z]+)ins([A-Z]+).*NC_0+([^.]+)\..*g\.([0-9]+)_([0-9]+)/) # indel { print join("\t", $3, $4, $5, $1, $2), "\n"; } else { while (/\t*NC_(\d+)\.\S+g\.(\d+)(\S+)/g) { # conditional parse ($num1, $num2, $common) = ($1, $2, $3); $num3 = $num2; if ($common =~ /^([A-Z])>([A-Z])$/) { ($ch1, $ch2) = ($1, $2) } # SNP elsif ($common =~ /^del([A-Z])$/) { ($ch1, $ch2) = ($1, "-") } # deletion elsif ($common =~ /^ins([A-Z])$/) { ($ch1, $ch2) = ("-", $1) } # insertion elsif ($common =~ /^_(\d+)del([A-Z]+)$/) { ($num3, $ch1, $ch2) = ($1, $2, "-") } # multi deletion elsif ($common =~ /^_(\d+)ins([A-Z]+)$/) { ($num3, $ch1, $ch2) = ("-", $1, $2) } # multi insertion printf ("%d\t%d\t%d\t%s\t%s\n", $num1, $num2, $num3, $ch1, $ch2); # output map {undef} ($num1, $num2, $num3, $common, $ch1, $ch2); } }' numeric 23 41747805 41747806 GC AA 23 41750615 41750615 C A **alpha** Input Variant Errors Chromosomal Variant Coding Variant(s) NM_003924.3:c.*18_*19delGCinsAA NC_0000X.11:g.41747805_41747806delinsTT LRG_513t1:c.*18_*19delinsAA NM_003924.3:c.*18_*19delinsAA NM_003924.3:c.013G>T NC_0000X.11:g.41750615C>A LRG_513t1:c.13G>T NM_003924.3:c.13G>T **output using alpha:** X 41747805 41747806 GC AA
0debug
How can i Export a datatable to an excel sheet with userdefined row no of the excel sheet from c#? : how can,i Export a datatable to an excel sheet with userdefined row no of the excel sheet from c#?
0debug
React-Native Button Align Center : <p>I'm using native base button i want to align the button in the center of the screen i tried this:</p> <pre><code>&lt;Container style={{flex:1, flexDirection:'row', alignItems:'center', justifyContent:'center',}}&gt; &lt;Form style={{}}&gt; &lt;Item last&gt; &lt;Input placeholder='Username' style={{color:'white'}}/&gt; &lt;/Item&gt; &lt;Item last&gt; &lt;Input placeholder="Password" style={{color:'white'}} /&gt; &lt;/Item&gt; &lt;Button style={{width:170,backgroundColor:'#99004d',marginTop:20,}}&gt; &lt;Text style={{marginLeft:50}}&gt;Login&lt;/Text&gt; &lt;/Button&gt; &lt;Text style={{color:'white'}}&gt;{this.props.Name}&lt;/Text&gt; &lt;/Form&gt; &lt;/Container&gt; </code></pre> <p>But it reducing the size of input field the result I'm getting is following:</p> <p><a href="https://i.stack.imgur.com/Pn9qB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Pn9qB.png" alt="enter image description here"></a></p>
0debug
static int aacPlus_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { aacPlusAudioContext *s = avctx->priv_data; int32_t *input_buffer = (int32_t *)frame->data[0]; int ret; if ((ret = ff_alloc_packet2(avctx, pkt, s->max_output_bytes))) return ret; pkt->size = aacplusEncEncode(s->aacplus_handle, input_buffer, s->samples_input, pkt->data, pkt->size); *got_packet = 1; pkt->pts = frame->pts; return 0; }
1threat
matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, int size, int64_t pos, uint64_t cluster_time, int is_keyframe, int *ptrack, AVPacket **ppkt) { int res = 0; int track; AVPacket *pkt; uint8_t *origdata = data; int16_t block_time; uint32_t *lace_size = NULL; int n, flags, laces = 0; uint64_t num; if ((n = matroska_ebmlnum_uint(data, size, &num)) < 0) { av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n"); av_free(origdata); return res; } data += n; size -= n; track = matroska_find_track_by_num(matroska, num); if (ptrack) *ptrack = track; if (size <= 3 || track < 0 || track >= matroska->num_tracks) { av_log(matroska->ctx, AV_LOG_INFO, "Invalid stream %d or size %u\n", track, size); av_free(origdata); return res; } if(matroska->ctx->streams[ matroska->tracks[track]->stream_index ]->discard >= AVDISCARD_ALL){ av_free(origdata); return res; } block_time = (data[0] << 8) | data[1]; data += 2; size -= 2; flags = *data; data += 1; size -= 1; if (is_keyframe == -1) is_keyframe = flags & 1 ? PKT_FLAG_KEY : 0; switch ((flags & 0x06) >> 1) { case 0x0: laces = 1; lace_size = av_mallocz(sizeof(int)); lace_size[0] = size; break; case 0x1: case 0x2: case 0x3: if (size == 0) { res = -1; break; } laces = (*data) + 1; data += 1; size -= 1; lace_size = av_mallocz(laces * sizeof(int)); switch ((flags & 0x06) >> 1) { case 0x1: { uint8_t temp; uint32_t total = 0; for (n = 0; res == 0 && n < laces - 1; n++) { while (1) { if (size == 0) { res = -1; break; } temp = *data; lace_size[n] += temp; data += 1; size -= 1; if (temp != 0xff) break; } total += lace_size[n]; } lace_size[n] = size - total; break; } case 0x2: for (n = 0; n < laces; n++) lace_size[n] = size / laces; break; case 0x3: { uint32_t total; n = matroska_ebmlnum_uint(data, size, &num); if (n < 0) { av_log(matroska->ctx, AV_LOG_INFO, "EBML block data error\n"); break; } data += n; size -= n; total = lace_size[0] = num; for (n = 1; res == 0 && n < laces - 1; n++) { int64_t snum; int r; r = matroska_ebmlnum_sint (data, size, &snum); if (r < 0) { av_log(matroska->ctx, AV_LOG_INFO, "EBML block data error\n"); break; } data += r; size -= r; lace_size[n] = lace_size[n - 1] + snum; total += lace_size[n]; } lace_size[n] = size - total; break; } } break; } if (res == 0) { int real_v = matroska->tracks[track]->flags & MATROSKA_TRACK_REAL_V; for (n = 0; n < laces; n++) { uint64_t timecode = AV_NOPTS_VALUE; int slice, slices = 1; if (real_v) { slices = *data++ + 1; lace_size[n]--; } if (cluster_time != (uint64_t)-1 && n == 0) { if (cluster_time + block_time >= 0) timecode = (cluster_time + block_time) * matroska->time_scale; } for (slice=0; slice<slices; slice++) { int slice_size, slice_offset = 0; if (real_v) slice_offset = rv_offset(data, slice, slices); if (slice+1 == slices) slice_size = lace_size[n] - slice_offset; else slice_size = rv_offset(data, slice+1, slices) - slice_offset; pkt = av_mallocz(sizeof(AVPacket)); if (ppkt) *ppkt = pkt; if (av_new_packet(pkt, slice_size) < 0) { res = AVERROR_NOMEM; n = laces-1; break; } memcpy (pkt->data, data+slice_offset, slice_size); if (n == 0) pkt->flags = is_keyframe; pkt->stream_index = matroska->tracks[track]->stream_index; pkt->pts = timecode; pkt->pos = pos; matroska_queue_packet(matroska, pkt); } data += lace_size[n]; } } av_free(lace_size); av_free(origdata); return res; }
1threat
Grunt watch not running less after error correction : <p>I've got an issue with Grunt Watch currently not re-running tasks after compilation error correction.</p> <p>I get the error message, but then after correcting the error, grunt says the file has been changed, but no tasks are run after that point.</p> <p>Grunt file:</p> <pre><code>watch: { less: { files: ['public/assets/less/**/*.less'], tasks: ['css'], options: { atBegin: true, nospawn: true } }, scripts: { files: [ 'public/assets/js/homepage.js' ], tasks: ['jsApp'], options: { nospawn: true, } } }, </code></pre> <p>Error log:</p> <pre><code>&gt;&gt; ParseError: Unrecognised input in public/assets/less/template.less on line 114, column 31: &gt;&gt; 114 @media screen and (max-width: 767px) { &gt;&gt; 115 left: 0; Warning: Error compiling public/assets/less/main.less // ----- Corrected the file here, saved again ----- &gt;&gt; File "public/assets/less/template.less" changed. </code></pre> <p>End of file. Nothing after this point.</p>
0debug
how to call oracle stored proc in spark? : In my spark project , I am using spark-sql-2.4.1v. As part of my code , I need to call oracle stored procs in my spark job. > how to call oracle stored procs?
0debug
Hyperledger Composer vs Fabric : <p>Is only using Hyperledger Composer (Compared to Hyperledger Fabric) suitable for building a enterprise level application?</p> <p>Composer is great for building a simple app fast but it seems to be missing a lot of features that fabric has.</p>
0debug
'react-scripts' is not recognized as an internal or external command, operable program or batch file : <p>I am learning react. The version i installed is 16. I installed prop-types via npm after i got an error that 'react-scripts' is not recognized as an internal or external command, operable program or batch file."</p> <p>I've provided a screenshot below. I need help.<a href="https://i.stack.imgur.com/9TsdZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9TsdZ.png" alt="enter image description here"></a></p>
0debug
aws fargate docker container instances not able to get local hostname : <p>We have a part of our Java application that needs to determine what the local hostname is.</p> <p>But whenever we try to get them via </p> <pre><code>InetAddress.getLocalhost().getHostName() </code></pre> <p>we get:</p> <pre><code>org.quartz.JobExecutionException: java.net.UnknownHostException: 22e51fd8a6fb: 22e51fd8a6fb [See nested exception: java.net.UnknownHostException: 22e51fd8a6fb: 22e51fd8a6fb] </code></pre> <p>When we do this via ec2 instances, it seems to work fine. Is there some kind of limitation on fargate, or potentially some configuration that could be tweaked?</p>
0debug
static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s, const uint8_t * src) { uint8_t *dst; dst = s->vga.vram_ptr + (s->cirrus_blt_dstaddr & s->cirrus_addr_mask); if (blit_is_unsafe(s, false)) return 0; (*s->cirrus_rop) (s, dst, src, s->cirrus_blt_dstpitch, 0, s->cirrus_blt_width, s->cirrus_blt_height); cirrus_invalidate_region(s, s->cirrus_blt_dstaddr, s->cirrus_blt_dstpitch, s->cirrus_blt_width, s->cirrus_blt_height); return 1; }
1threat
static int omap2_intc_init(SysBusDevice *sbd) { DeviceState *dev = DEVICE(sbd); struct omap_intr_handler_s *s = OMAP_INTC(dev); if (!s->iclk) { hw_error("omap2-intc: iclk not connected\n"); } if (!s->fclk) { hw_error("omap2-intc: fclk not connected\n"); } s->level_only = 1; s->nbanks = 3; sysbus_init_irq(sbd, &s->parent_intr[0]); sysbus_init_irq(sbd, &s->parent_intr[1]); qdev_init_gpio_in(dev, omap_set_intr_noedge, s->nbanks * 32); memory_region_init_io(&s->mmio, OBJECT(s), &omap2_inth_mem_ops, s, "omap2-intc", 0x1000); sysbus_init_mmio(sbd, &s->mmio); return 0; }
1threat
static av_cold int v410_encode_close(AVCodecContext *avctx) { av_freep(&avctx->coded_frame); return 0; }
1threat
static int adts_write_packet(AVFormatContext *s, AVPacket *pkt) { ADTSContext *adts = s->priv_data; AVIOContext *pb = s->pb; uint8_t buf[ADTS_HEADER_SIZE]; if (!pkt->size) return 0; if (adts->write_adts) { ff_adts_write_frame_header(adts, buf, pkt->size, adts->pce_size); avio_write(pb, buf, ADTS_HEADER_SIZE); if (adts->pce_size) { avio_write(pb, adts->pce_data, adts->pce_size); adts->pce_size = 0; } } avio_write(pb, pkt->data, pkt->size); avio_flush(pb); return 0; }
1threat
What is difference between creating object using Object.create() and Object.assign()? : <p>Considering following code:</p> <pre><code>var obj1 = Object.create({}, {myProp: {value: 1}}); var obj2 = Object.assign({}, {myProp: 1}); </code></pre> <p>Is there any difference between <code>obj1</code> and <code>obj2</code> since each object has been created in a different way?</p>
0debug
Calling from a public class and from its public method, into 2d double array, my zeros before the fractional point change to number 9. What is this? : So I've been writing a program, to use it as a tool for quick calculations in an online game, and it also helps me a bit to revise C# for my final exam in IT. Here's my code: public class ConvertingToArrays { public static double[,] CountryVAT(double[,] vat) { vat = new double[20, 1]; string[,] convertTableToString = new string[20, 6]; convertTableToString = ReadFromFile.Input(convertTableToString); for (int i = 0; i < 20; i++) { for (int j = 0; j < 1; j++) { vat[i, j] = Convert.ToDouble(convertTableToString[i, 1]); } } return vat; } } With the string to double converting I had no problem, I tested it and it should not be the cause. class Program { public static void Main(string[] args) { double[,] vat = new double[20, 1]; vat = ConvertingToArrays.CountryVAT(vat); Console.WriteLine("Testing Convert to vat Method Call"); for (int i = 0; i < 20; i++) { for (int j = 0; j < 1; j++) { Console.Write(vat[i, j] + '\t'); } Console.WriteLine('\n'); } Console.ReadKey(); } } I'm reading from a .txt file a few numbers: 0,03; 0,05; 0,4; 0 And for some reason the output for these numbers are: 9,03; 9,05; 9,4; 9 I've tried to look it up on google but I found nothing, and I'm a bit angry that I can't solve it. It might be just one subtle and easy thing that I overlooked accidentally (please keep in mind that I have started learning to code by myself just 6 months before and I've practiced it only 10-12 hours a week). Can anyone help me out with a solution? If you need any more information or code snippets, I put it up ASAP.
0debug
How to call a C# static method from Jquery : I've seen some articles showing how to call a C# method from Javascript using Microsoft's [WebMethod] for a Web Forms application. I'd like to do the same with an MVC application. I have a C# static method that returns translated data: public static string Translate(string word) { return langRepo.Translate(word); } The above function works fine inside server-side code. However, I'd like to extend the same code to the client side. Ideally I would like to create a JQuery function like this: function Translate(word) { //call C# translate method and return result } And use it like this: "<hr /><h5>" + Translate(heading) + "</h5>"; How would I do this?
0debug
How to echo correctly a html line using php : <p>I want to print this using php:</p> <pre><code>&lt;input onfocusout="function("stringarg")" /&gt; </code></pre> <p>The ' are not printing properly.</p>
0debug
/bin/sh: py: command not found : I just installed Python3 and Komodo. I'm trying to run a simple script but am getting the error that the py: command not found. I'm completly new to both Komodo and Python so don't know where to look. I saw a another post with the same problem but not a solution that helped. I have Python3 installed and verified from terminal command. Any help is greatly appreciated!
0debug
static int read_ts(const char *s, int64_t *start, int *duration) { int64_t end; int hh1, mm1, ss1, ms1; int hh2, mm2, ss2, ms2; if (sscanf(s, "%u:%u:%u.%u,%u:%u:%u.%u", &hh1, &mm1, &ss1, &ms1, &hh2, &mm2, &ss2, &ms2) == 8) { end = (hh2*3600 + mm2*60 + ss2) * 100 + ms2; *start = (hh1*3600 + mm1*60 + ss1) * 100 + ms1; *duration = end - *start; return 0; } return -1; }
1threat
static int rv10_decode_packet(AVCodecContext *avctx, UINT8 *buf, int buf_size) { MpegEncContext *s = avctx->priv_data; int i, mb_count, mb_pos, left; init_get_bits(&s->gb, buf, buf_size); mb_count = rv10_decode_picture_header(s); if (mb_count < 0) { fprintf(stderr, "HEADER ERROR\n"); return -1; } if (s->mb_x >= s->mb_width || s->mb_y >= s->mb_height) { fprintf(stderr, "POS ERROR %d %d\n", s->mb_x, s->mb_y); return -1; } mb_pos = s->mb_y * s->mb_width + s->mb_x; left = s->mb_width * s->mb_height - mb_pos; if (mb_count > left) { fprintf(stderr, "COUNT ERROR\n"); return -1; } if (s->mb_x == 0 && s->mb_y == 0) { if(MPV_frame_start(s, avctx) < 0) return -1; } #ifdef DEBUG printf("qscale=%d\n", s->qscale); #endif s->y_dc_scale = 8; s->c_dc_scale = 8; s->rv10_first_dc_coded[0] = 0; s->rv10_first_dc_coded[1] = 0; s->rv10_first_dc_coded[2] = 0; if(s->mb_y==0) s->first_slice_line=1; s->block_wrap[0]= s->block_wrap[1]= s->block_wrap[2]= s->block_wrap[3]= s->mb_width*2 + 2; s->block_wrap[4]= s->block_wrap[5]= s->mb_width + 2; ff_init_block_index(s); for(i=0;i<mb_count;i++) { ff_update_block_index(s); #ifdef DEBUG printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y); #endif s->dsp.clear_blocks(s->block[0]); s->mv_dir = MV_DIR_FORWARD; s->mv_type = MV_TYPE_16X16; if (ff_h263_decode_mb(s, s->block) == SLICE_ERROR) { fprintf(stderr, "ERROR at MB %d %d\n", s->mb_x, s->mb_y); return -1; } MPV_decode_mb(s, s->block); if (++s->mb_x == s->mb_width) { s->mb_x = 0; s->mb_y++; ff_init_block_index(s); s->first_slice_line=0; } } return buf_size; }
1threat
static inline void RENAME(rgb16to15)(const uint8_t *src,uint8_t *dst,unsigned src_size) { register const uint8_t* s=src; register uint8_t* d=dst; register const uint8_t *end; const uint8_t *mm_end; end = s + src_size; #ifdef HAVE_MMX __asm __volatile(PREFETCH" %0"::"m"(*s)); __asm __volatile("movq %0, %%mm7"::"m"(mask15rg)); __asm __volatile("movq %0, %%mm6"::"m"(mask15b)); mm_end = end - 15; while(s<mm_end) { __asm __volatile( PREFETCH" 32%1\n\t" "movq %1, %%mm0\n\t" "movq 8%1, %%mm2\n\t" "movq %%mm0, %%mm1\n\t" "movq %%mm2, %%mm3\n\t" "psrlq $1, %%mm0\n\t" "psrlq $1, %%mm2\n\t" "pand %%mm7, %%mm0\n\t" "pand %%mm7, %%mm2\n\t" "pand %%mm6, %%mm1\n\t" "pand %%mm6, %%mm3\n\t" "por %%mm1, %%mm0\n\t" "por %%mm3, %%mm2\n\t" MOVNTQ" %%mm0, %0\n\t" MOVNTQ" %%mm2, 8%0" :"=m"(*d) :"m"(*s) ); d+=16; s+=16; } __asm __volatile(SFENCE:::"memory"); __asm __volatile(EMMS:::"memory"); #endif mm_end = end - 3; while(s < mm_end) { register uint32_t x= *((uint32_t *)s); *((uint32_t *)d) = ((x>>1)&0x7FE07FE0) | (x&0x001F001F); s+=4; d+=4; } if(s < end) { register uint16_t x= *((uint16_t *)s); *((uint16_t *)d) = ((x>>1)&0x7FE0) | (x&0x001F); s+=2; d+=2; } }
1threat
How to give a "Dashed Border" in flutter? : <p>I try to give dashed border in flutter but there is no option for dashed border in flutter. so any another way to create dashed border in futter.</p> <pre><code> new Container( decoration: new BoxDecoration( border: Border( left: BorderSide(color: Color(0XFFFF6D64), width: 2.0))), height: 20.0, margin: const EdgeInsets.only(left: 35.0), child: new Row( crossAxisAlignment: CrossAxisAlignment.start, children: &lt;Widget&gt;[ new DecoratedBox( decoration: new BoxDecoration( border: Border( left: BorderSide(color: Color(0XFFFF6D64), width: 2.0,style: BorderStyle.))), ) ], ), ), </code></pre>
0debug
Unknow css change border's color : <p>Select checkbox auto changes border's color after open select checkbox.</p> <p>I can't find any class change select checkbox color on Developer tool,how to solve the problem?</p> <p><a href="https://i.stack.imgur.com/sBqUM.jpg" rel="nofollow noreferrer">demo</a></p>
0debug
static struct omap_uwire_s *omap_uwire_init(MemoryRegion *system_memory, hwaddr base, qemu_irq txirq, qemu_irq rxirq, qemu_irq dma, omap_clk clk) { struct omap_uwire_s *s = (struct omap_uwire_s *) g_malloc0(sizeof(struct omap_uwire_s)); s->txirq = txirq; s->rxirq = rxirq; s->txdrq = dma; omap_uwire_reset(s); memory_region_init_io(&s->iomem, NULL, &omap_uwire_ops, s, "omap-uwire", 0x800); memory_region_add_subregion(system_memory, base, &s->iomem); return s; }
1threat
uint64_t helper_stl_c_raw(uint64_t t0, uint64_t t1) { uint64_t ret; if (t1 == env->lock) { stl_raw(t1, t0); ret = 0; } else ret = 1; env->lock = 1; return ret; }
1threat
A confusion i have about HTML "classes" : <p>Hello and thanks in advance. In HTML I know that a "class" will not really have an effect unless it is related to something in CSS or JS. At the same time, I find some "classes" that do affect the structure of a documents even without an associated CSS, such as "class="col-md-12" for example. Can someone explain why some classes work independent of CSS? And how to know them.</p>
0debug
static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx, const uint8_t *buf, int buf_size) { DVBSubContext *ctx = avctx->priv_data; DVBSubDisplayDefinition *display_def = ctx->display_definition; int dds_version, info_byte; if (buf_size < 5) return; info_byte = bytestream_get_byte(&buf); dds_version = info_byte >> 4; if (display_def && display_def->version == dds_version) return; if (!display_def) { display_def = av_mallocz(sizeof(*display_def)); ctx->display_definition = display_def; } if (!display_def) return; display_def->version = dds_version; display_def->x = 0; display_def->y = 0; display_def->width = bytestream_get_be16(&buf) + 1; display_def->height = bytestream_get_be16(&buf) + 1; if (buf_size < 13) return; if (info_byte & 1<<3) { display_def->x = bytestream_get_be16(&buf); display_def->y = bytestream_get_be16(&buf); display_def->width = bytestream_get_be16(&buf) - display_def->x + 1; display_def->height = bytestream_get_be16(&buf) - display_def->y + 1; } }
1threat
Add portions of string that contains X to list : <p>I'm trying to learn Python and I have one question.</p> <p>I want to take all html links from a webpage source file and append them to a list. For example I want to search the string for every instance of ../lyrics.*html and insert those instances in a list. The result would be a list of html links such as this:</p> <pre><code>["../lyrics/steviewonder/lovesinneedoflovetoday.html", "../lyrics/steviewonder/haveatalkwithgod.html", "../lyrics/steviewonder/villageghettoland.html"] </code></pre> <p>Help is much appreciated! Thank you!</p>
0debug
X86CPU *cpu_x86_init(const char *cpu_model) { X86CPU *cpu; CPUX86State *env; static int inited; cpu = X86_CPU(object_new(TYPE_X86_CPU)); env = &cpu->env; env->cpu_model_str = cpu_model; if (tcg_enabled() && !inited) { inited = 1; optimize_flags_init(); #ifndef CONFIG_USER_ONLY prev_debug_excp_handler = cpu_set_debug_excp_handler(breakpoint_handler); #endif } if (cpu_x86_register(cpu, cpu_model) < 0) { object_delete(OBJECT(cpu)); return NULL; } x86_cpu_realize(OBJECT(cpu), NULL); return cpu; }
1threat
Brew install chromedriver not working? : <p>I am using MacOS, when I tried to install chromedriver using homebrew</p> <pre><code>brew install chromedriver </code></pre> <p>I get:</p> <pre><code>Error: No available formula with the name "chromedriver" It was migrated from homebrew/core to caskroom/cask. You can access it again by running: brew tap caskroom/cask </code></pre> <p>I typed <code>brew tap caskroom/cask</code> but chromedriver is still not installed. Can someone please help me on this? Thanks!</p>
0debug
static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, const uint32_t *quant) { int coeff, i, n; int8_t ac; uint8_t dc = get_bits(gb, 8); if (dc == 255) coeff = get_bits(gb, 6); memset(block, 0, 64 * sizeof(DCTELEM)); while (coeff) { ac = get_sbits(gb, 2); if (ac == -2) break; PUT_COEFF(ac); } ALIGN(4); if (get_bits_count(gb) + (coeff << 2) >= gb->size_in_bits) while (coeff) { ac = get_sbits(gb, 4); if (ac == -8) break; PUT_COEFF(ac); } ALIGN(8); if (get_bits_count(gb) + (coeff << 3) >= gb->size_in_bits) while (coeff) { ac = get_sbits(gb, 8); PUT_COEFF(ac); } PUT_COEFF(dc); return 1; }
1threat
Auto-generate Javadoc comments in intelliJ? : <p>Is it possible to auto-generate Javadoc comments for each method in one class in IntelliJ IDEA?</p>
0debug
How can I filter sensitive parameters from the SQL portion of Rails 5 logs? : <p>Rails 5 offers parameter filtering, and I've specified <code>config.filter_parameters += ["my_token"]</code> in <code>application.rb</code>.</p> <p>Testing my app in dev (environment) mode, I see <code>my_token</code> is correctly filtered from the request lines of the log file:</p> <p><code>Started GET "/something?my_token=[FILTERED]"</code></p> <p>However, the SQL log lines immediately following still include the parameter's value in plain text ("SELECT stuff FROM things," etc., with <code>my_token</code> as a param).</p> <p>Does Rails 5 offer a way to filter this raw value from the SQL part of its log files?</p> <p>I've also run my app in production mode, and though the log files are more succinct, they still display the value unfiltered in D-type log lines for the generated SQL statements.</p> <p>I've specified no custom log settings--everything other than my filter parameter setting is by default.</p> <p>My own search showed no relevant discussion of this. Maybe I'm missing something?</p> <p>Thx!</p>
0debug
Document.importNode VS Node.cloneNode (real example) : <p><a href="https://www.w3.org/TR/dom/#dom-document-importnode" rel="noreferrer">Document.importNode in specification</a> </p> <p><a href="https://www.w3.org/TR/dom/#concept-node-clone" rel="noreferrer">Node.cloneNode in specification</a></p> <p>This two methods work equally. Please give me real example in which I can see the difference between this methods. </p>
0debug
What does this list contain? : <p>If there is a list like this: </p> <pre><code>lst = [('this', 4, 3), ('that', 9, 3), ('those', 2, 6)] </code></pre> <blockquote> <p><strong>What every element of this list is?</strong></p> </blockquote> <p>'this' - is a string</p> <p>4 - is an integer</p> <p>And this? ('this', 4, 3) </p>
0debug
Program not noticing when the string is equal to a specific string : <p>I've been trying to create a program that censors a word but I was having difficulty with that so I tried going back to some of the fundamental code and testing it and I am coming across an odd result.</p> <pre><code>import java.util.Scanner; public class TextCensor { public static void main(String[] args) { String input; Scanner keyboard = new Scanner(System.in); input = keyboard.nextLine(); int length = input.length() - 1; if (length + 1 &gt;= 3) { for (int i=0; i&lt;(length - 1); i=i+1 ) { char first = input.charAt(i); char second = input.charAt(i+1); char third = input.charAt(i+2); String censorCheck = "" + first + second + third; if (censorCheck == "tag") { System.out.println("success"); } else { System.out.println(censorCheck); } } } else { System.out.println(input); } } } </code></pre> <p>If I input the string "adtag" I will obtain the following output:</p> <pre><code>adt dta tag </code></pre> <p>yet "success" will never be printed despite the fact that I have printed a censorCheck that is equal to "tag".</p>
0debug
static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) { PCIDevice *pci_dev = (PCIDevice *)qdev; PCIDeviceInfo *info = container_of(base, PCIDeviceInfo, qdev); PCIBus *bus; int devfn, rc; if (info->is_express) { pci_dev->cap_present |= QEMU_PCI_CAP_EXPRESS; } bus = FROM_QBUS(PCIBus, qdev_get_parent_bus(qdev)); devfn = pci_dev->devfn; pci_dev = do_pci_register_device(pci_dev, bus, base->name, devfn, info->config_read, info->config_write); assert(pci_dev); rc = info->init(pci_dev); if (rc != 0) return rc; if (qdev->hotplugged) bus->hotplug(pci_dev, 1); return 0; }
1threat
static void apb_pci_config_write(void *opaque, target_phys_addr_t addr, uint64_t val, unsigned size) { APBState *s = opaque; val = qemu_bswap_len(val, size); APB_DPRINTF("%s: addr " TARGET_FMT_lx " val %" PRIx64 "\n", __func__, addr, val); pci_data_write(s->bus, addr, val, size); }
1threat
How to change SF Symbols' icon color in UIKit? : <p>In <code>SwiftUI</code>, you can change the icon's color using <code>foregroundColor</code> modifier. So I think there should be a way to change the color in <code>UIKit</code>. I looked up the documentation and didn't find anything related to it.</p> <p>Is it possible right now?</p> <pre class="lang-swift prettyprint-override"><code>let iconImage = UIImage(systemName: "chevron.right", withConfiguration: UIImage.SymbolConfiguration(pointSize: 16, weight: .regular, scale: .medium)) </code></pre>
0debug
Solution Architect reporting line , is it EA manager or Development manager? : <p>we are a big Telecom company , recently EA office established in our company and we have an internal debate whether the technical solution architecture should be part from Development team or EA team responsibility ? based on that , the solution architect reporting line needs to be decided.</p>
0debug
Selenium Error: java Script : Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (413, 63). Other element would receive the click: <div id="wait" width="100%" height="100%" class="wait" style="position: absolute; top: 0px; left: 0px; height: 666px; width: 1366px; display: block; cursor: wait;">...</div> (Session info: chrome=53.0.2785.143) (Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 94 milliseconds Build info: version: 'unknown', revision: 'c7b525d', time: '2016-09-01 14:52:30 -0700' System info: host: 'ICDVM', ip: '10.0.0.11', os.name: 'Windows Server 2012 R2', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_102' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\Users\ADMINI~1\AppData\Local\Temp\scoped_dir16420_7494}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=53.0.2785.143, platform=WIN8_1, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: e24f7435d75ad5ddbecb362090ddb0a3 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:631) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:284) at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84) at script.Script.main(Script.java:78)
0debug
React, how to access the DOM element in my render function from the same component : <p>I'm wondering what's the best practice for accessing the DOM elements inside my render function from the same component. Note that I will be rendering this component multiple times on a page.</p> <p>e.g. </p> <pre><code>var TodoItem = React.createClass({ ... render:function(){ function oneSecLater(){ setTimeout(function(){ //select the current className? this doesn't work, but it gives you an idea what I want. document.getElementsByClassName('name').style.backgroundColor = "red"; )}, 1000); } return( &lt;div className='name'&gt;{this.oneSecLater}&lt;/div&gt; ) }) </code></pre>
0debug
my wordpress css stopped working overnight : hi guys I am having a massive issue with wordpress at the moment.. last night and this morning, my website was working fine. Until earlier on my css stopped working properly. when you hover over some menu a nested under some li, a hover effect with a transition is supposed to happened. That stopped working... my owl carousel when the page load doesn't show up until the scroll function gets activated. I am suspecting that its a problem with my cache, but i even tried using Stackpath CDN to solve that and it didn't change anything. I urgently need help, i got a client complaining at the moment and I am truly lost as to what to do. on the customize menu, the controls for the hover colors dont work for the menu links either this is my website stylehercloset.co.uk and this is my javascript file: jQuery(document).ready(function(){ // owl caroussel jQuery(".owl-carousel").owlCarousel({ items:1, navRewind:true, center:true, autoplay:true, autoplayTimeout:3000 }); /* end of owl caroussel */ // adobe typekit try{ Typekit.load({ async: true }); } catch(e){} // end of typekit jQuery(window).scroll(function(){ if(window.pageYOffset > 394){ jQuery("#access").css({"position":"fixed", "z-index":"2", "left":"0px", "top":"0px", "border":"0px", "border-width":"1px", "border-bottom-style":"solid", "margin-top":"auto" /*"padding-top":"2.5em" */}); } if(window.pageYOffset < 394){ jQuery("#access").css({"position":"initial", "padding":"0px", "border-top":"1px", "border-bottom":"1px", "border-top-style":"solid", "border-bottom-style":"solid", "margin-top":"0.5em" }); } }); // end of scroll function // code for the footer area jQuery("#first,#second,#third,#fourth").addClass("col-xs col-sm-1 col-md-3 col-3"); jQuery("#footer-widget-area").addClass("row"); jQuery("#primary, #secondary").addClass("col-xs col-sm-3"); jQuery(".small-nav i").click(function(){ jQuery("div.menu").slideToggle("slow"); }); }); and this is the relevant css from my style.css: #access .menu ul a:hover { background-color: #40E0D0 !important; } and this is from my functions.php file function customizer_css(){ ?> <style type="text/css"> *h1 { <?php echo get_theme_mod('h1_font'); ?>; } * h2 { <?php echo get_theme_mod('h2_font'); ?>; } *h3 { <?php echo get_theme_mod('h3_font'); ?>; } *h4 { <?php echo get_theme_mod('h4_font'); ?>; } *h5 { <?php echo get_theme_mod('h5_font'); ?>; } * p { <?php echo get_theme_mod('p_font'); ?>; } *a { <?php echo get_theme_mod('a_font'); ?>; } #site-title { <?php echo get_theme_mod('title_position'); ?> font-size:<?php echo get_theme_mod('title_size'); ?>em !important; } #primary a, #secondary a { <?php echo get_theme_mod('widget_a_font'); ?>; } #small-menu, #access, #wrapper,#footer #colophon{ background-color:<?php echo get_theme_mod('website_colour') ?> !important; } #header-bg { background-image: url('<?php echo get_header_image(); ?>'); background-color: <?php echo get_theme_mod('header_colour'); ?> ; background-position: <?php echo get_theme_mod('header_bg_position_x_lg','0%'); ?> <?php echo get_theme_mod('header_bg_position_y_lg','0%'); ?> !important; } #main a, #footer-widget-area a { color: <?php echo get_theme_mod('link_colour'); ?> !important ; } .current_page_item a, #access .menu ul a:hover { background-color: <?php echo get_theme_mod('hover_colour'); ?> !important ; } #access .el:hover { color: <?php echo get_theme_mod('hover_colour'); ?> !important ; } h1#site-title a{ <?php echo get_theme_mod('title_font_style'); ?>; } @media screen and (max-width:767px) { #header-bg { background-position: <?php echo get_theme_mod('header_bg_position_x_xs','0%'); ?> <?php echo get_theme_mod('header_bg_position_y_xs','0%'); ?> !important; } #site-title { <?php echo get_theme_mod('title_position_xs'); ?> font-size:<?php echo get_theme_mod('title_size_xs'); ?>em !important; } } /* end of mobile size */ @media screen and (min-width:768px) and (max-width:991px){ #header-bg { background-position: <?php echo get_theme_mod('header_bg_position_x_sm','0%'); ?> <?php echo get_theme_mod('header_bg_position_y_sm','0%'); ?> !important; } #site-title { <?php echo get_theme_mod('title_position_sm'); ?> font-size:<?php echo get_theme_mod('title_size_sm'); ?>em !important; } } /* end of small*/ @media screen and (min-width:992px) and (max-width:1199px){ #header-bg { background-position: <?php echo get_theme_mod('header_bg_position_x_md','0%'); ?> <?php echo get_theme_mod('header_bg_position_y_md','0%'); ?> !important; } #site-title { <?php echo get_theme_mod('title_position_md'); ?> font-size:<?php echo get_theme_mod('title_size_md'); ?>em !important; } } // end of medium </style> <?php } //add actions add_action('wp_enqueue_scripts','style_n_scripts'); //theme customizer api add_action( 'customize_register', 'customizer_api' ); //theme support add_action('init', 'shc_theme_support'); // theme customizer css add_action( 'wp_head', 'customizer_css');
0debug
connection.query('SELECT * FROM users WHERE username = ' + input_string)
1threat
Change the FB login button text (react-native-fbsdk) : <p>I am using react-native-fbsdk. How can I change the fb login button text from 'Login with facebook' to 'Continue with fb'?</p> <p>The component looks like this, and I can't find a way to change it:</p> <pre><code>&lt;LoginButton style={styles.facebookbutton} readPermissions={["public_profile", 'email']} onLoginFinished={ (error, result) =&gt; { if (error) { console.log("login has error: " + result.error); } else if (result.isCancelled) { console.log("login is cancelled."); } else { AccessToken.getCurrentAccessToken().then( (data) =&gt; { console.log(data); console.log(data.accessToken.toString()); } ) } } } onLogoutFinished={() =&gt; alert("logout.")}/&gt; </code></pre>
0debug
int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end, const uint8_t *name, uint8_t *dst, int dst_size) { int namelen = strlen(name); int len; while (*data != AMF_DATA_TYPE_OBJECT && data < data_end) { len = ff_amf_tag_size(data, data_end); if (len < 0) len = data_end - data; data += len; } if (data_end - data < 3) return -1; data++; for (;;) { int size = bytestream_get_be16(&data); if (!size) break; if (size < 0 || size >= data_end - data) return -1; data += size; if (size == namelen && !memcmp(data-size, name, namelen)) { switch (*data++) { case AMF_DATA_TYPE_NUMBER: snprintf(dst, dst_size, "%g", av_int2double(AV_RB64(data))); break; case AMF_DATA_TYPE_BOOL: snprintf(dst, dst_size, "%s", *data ? "true" : "false"); break; case AMF_DATA_TYPE_STRING: len = bytestream_get_be16(&data); av_strlcpy(dst, data, FFMIN(len+1, dst_size)); break; default: return -1; } return 0; } len = ff_amf_tag_size(data, data_end); if (len < 0 || len >= data_end - data) return -1; data += len; } return -1; }
1threat
Need text/button input in pygame : <p>All I need right now is basic text fields and buttons for input in pygames. A text field as some simple structure that I can read into variables, and a button to call a function. </p> <p>First, I browsed around and found it was not a straight-forward process to create a text field in pygames. Eventually, by cobbling together <a href="https://stackoverflow.com/questions/46390231/how-to-create-a-text-input-box-with-pygame">this wall of code</a>, I became the proud father of one, somewhat broken text field. Then I looked into buttons, and found to some horror that implementing them is <a href="https://pythonprogramming.net/pygame-buttons-part-1-button-rectangle/" rel="nofollow noreferrer">even more complicated</a>. </p> <p><code>Surely PyGame has some sort of buttons module built in right? No.</code> </p> <p>Excuse me? I'm not trying to write a whole program just for one button, I just need the interface for a deeper simulation. That's all. </p> <p>So then I looked into Tkinter, which has very easy-to-understand commands for GUI input. But no, that was also <a href="https://stackoverflow.com/questions/42931818/how-to-embed-a-tkinter-window-into-a-pygame-game-gui?rq=1">not meant to be</a>. </p> <p><code>I don't believe you can embed tkinter in to pygame.</code></p> <p>So then I tried PGU, but found a stunning lack of any straight-forward examples of how to actually use it for what I need (simple text fields and buttons). When I tried looking for one, I found <a href="https://gamedev.stackexchange.com/questions/5785/are-there-any-good-ui-widget-toolkits-for-pygame">this piece of wisdom</a>.</p> <p><code>Are there any good, modern widget toolkits for Pygame? No. Every year someone makes a new Pygame UI library and then abandons it after a few versions</code></p> <p>So if that was true, how is anyone supposed to get anything done with this language? What exactly is the best practice for a simple textfield and simple button in a pygame environment?</p>
0debug
CSS display: block, animate H1.. jQuerry : How to slideDown h2 using jQuerry? html <body> <hr> <h2>Text</h2> script $(window).load(function(){ $("h2").slideDown(); }); not working
0debug
if x >2 and <5: gives me an invalid syntax error. I dont understand why? : <p>I am using python 3.6 and i have written the following code:</p> <pre><code>l=[1,2,3,4,6,7,8,9] a=0 for i in l: if i &gt;2 and &lt;5: l[a]=l[a]+1 a=a+1 print(l) </code></pre> <p>I dont understand why I get a syntax error.</p>
0debug
Simple Calculator: Addition wrong output : <p>I'm a beginner and I am trying to make a simple calculator in java. Everything works fine except for Addition has wrong output (e.g. 1+1 = 1.01.0). Here is a sample of my code</p> <pre><code>package Package; import java.util.Scanner; public class SimpleCalculator { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.println("Enter Equation:"); double num1 = input.nextDouble(); String oper = input.next(); String plus, minus, divide, modulus, multiply; plus = "+"; minus = "-"; divide = "/"; multiply = "*"; modulus = "%"; //Everything is the same but addition seems to have wrong output if (oper.equals(plus)) { double num2 = input.nextDouble(); System.out.println("= " + num1 + num2); } else if (oper.equals(minus)) { double num2 = input.nextDouble(); System.out.println(num1 - num2); </code></pre>
0debug
Error during Build of react js website getting error non exit code Error running command: Build script returned non-zero exit code: 1 : I have deployed my react js website code through netlify and getting a build error as follows: 10:37:15 AM: Build ready to start`enter code here` 10:37:16 AM: build-image version: 42bca793ccd33055023c56c4ca8510463a56d317 10:37:17 AM: buildbot version: 6bab8b64bbd90091082af19fedf16bf73d502e5e 10:37:17 AM: Fetching cached dependencies 10:37:17 AM: Failed to fetch cache, continuing with build 10:37:17 AM: Starting to prepare the repo for build 10:37:17 AM: No cached dependencies found. Cloning fresh repo 10:37:17 AM: git clone git@github.com:justtabhi/react-blog-exambunker 10:37:19 AM: Preparing Git Reference refs/heads/master 10:37:20 AM: Starting build script 10:37:20 AM: Installing dependencies 10:37:21 AM: Downloading and installing node v8.12.0... 10:37:21 AM: Downloading https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz... 10:37:21 AM: # 10:37:21 AM: 1.6% 10:37:22 AM: ############################# 10:37:22 AM: 40.8% 10:37:22 AM: ##################################### 10:37:22 AM: ################################### 100.0% 10:37:22 AM: Computing checksum with sha256sum 10:37:22 AM: Checksums matched! 10:37:24 AM: Now using node v8.12.0 (npm v6.4.1) 10:37:24 AM: Attempting ruby version 2.3.6, read from environment 10:37:25 AM: Using ruby version 2.3.6 10:37:26 AM: Using PHP version 5.6 10:37:26 AM: Started restoring cached node modules 10:37:26 AM: Finished restoring cached node modules 10:37:26 AM: Installing NPM modules using NPM version 6.4.1 10:37:53 AM: > uglifyjs-webpack-plugin@0.4.6 postinstall /opt/build/repo/node_modules/uglifyjs-webpack-plugin 10:37:53 AM: > node lib/post_install.js 10:37:55 AM: npm 10:37:55 AM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents): 10:37:55 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) 10:37:55 AM: added 1280 packages from 735 contributors and audited 12827 packages in 28.118s 10:37:55 AM: found 0 vulnerabilities 10:37:55 AM: NPM modules installed 10:37:55 AM: Started restoring cached go cache 10:37:55 AM: Finished restoring cached go cache 10:37:55 AM: unset GOOS; 10:37:55 AM: unset GOARCH; 10:37:55 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64'; 10:37:55 AM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}"; 10:37:55 AM: go version >&2; 10:37:55 AM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env'; 10:37:55 AM: go version go1.10 linux/amd64 10:37:55 AM: Installing missing commands 10:37:55 AM: Verify run directory 10:37:55 AM: Executing user command: npm run build 10:37:55 AM: > react-blog@0.1.0 build /opt/build/repo 10:37:55 AM: > react-scripts build`enter code here` 10:37:57 AM: Creating an optimized production build... 10:38:02 AM: Failed to compile. 10:38:02 AM: Failed to minify the code from this file: 10:38:02 AM: ./node_modules/indicative/builds/main.js:1:52673 10:38:02 AM: npm ERR! code ELIFECYCLE 10:38:02 AM: npm ERR! errno 1 10:38:02 AM: npm ERR! react-blog@0.1.0 build: `react-scripts build` 10:38:02 AM: npm ERR! Exit status 1 10:38:02 AM: npm ERR! 10:38:02 AM: npm ERR! Failed at the react-blog@0.1.0 build script. 10:38:02 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above. 10:38:02 AM: npm ERR! A complete log of this run can be found in: 10:38:02 AM: npm ERR! /opt/buildhome/.npm/_logs/2018-09-25T05_08_02_457Z- debug.log 10:38:02 AM: Caching artifacts 10:38:02 AM: Started saving node modules 10:38:02 AM: Finished saving node modules 10:38:02 AM: Started saving pip cache 10:38:02 AM: Finished saving pip cache 10:38:02 AM: Started saving emacs cask dependencies 10:38:02 AM: Finished saving emacs cask dependencies 10:38:02 AM: Started saving maven dependencies 10:38:02 AM: Finished saving maven dependencies 10:38:02 AM: Started saving boot dependencies 10:38:02 AM: Finished saving boot dependencies 10:38:02 AM: Started saving go dependencies 10:38:02 AM: Finished saving go dependencies 10:38:03 AM: Cached node version v8.12.0 10:38:03 AM: Error running command: Build script returned non-zero exit code: 1 10:38:03 AM: Failing build: Failed to build site 10:38:03 AM: failed during stage 'building site': Build script returned non-zero exit code: 1 10:38:03 AM: Finished processing build request in 46.262986678s please someone suggest what might have gone wrong here??
0debug
How do I change the parent class instance/attributes of a class object in Python? (Help Bob get married!) : I've used Python successfully for batch scripting with Excel for a few months, if not longer, but embarrassingly enough, I still haven't really understood object-oriented programming. Let's say I have the following code, except there are many more people/families (let's say, 50 families) and many more family attributes than just last name, address, and family size (let's say, 10 attributes). class Family(): def __init__(self, id, last_name, address, family_size): self.id = id self.last_name = last_name self.address = address self.family_size = family_size class Person(Family): def __init___(self, first_name, middle_name): super().__init__(id, last_name, address, family_size) self.id = id self.first_name = first_name self.middle_name = middle_name jones1 = Family(2, "Jones", 456 Main Street", 1) bob1 = Person(1, "Smith", "123 Main Street", 1, 1, "Bob", "James") alice1 = Person(2, "Jones", "456 Main Street", 1, 2, "Alice", "Mary") Now let's say I've instantiated two objects (people) named Bob and Alice. They are from two different families. However, let's say I want Bob and Alice to marry, which means that one of them abandons their own family and joins the family of the other. How do I do this, code-wise? I know I can type: bob1.last_name = "Jones" And now Bob has Alice's last name. But there must be easier ways than manually overwriting each class attribute. I feel like I'm missing something very simple regarding the family object (jones1), but how do I get Bob to be part of the Jones family?
0debug
Hello Joda time is not giving correct results for me : <p>am getting incorrect results whatever I do. Could anyone give me some advise please :).</p> <p>I posted the question before but I didn't get any answers and I would very happily want an answer. </p> <p>Here is the code of my program the is responsible for getting the time between two dates.</p> <p>I am getting a result but the problem is that it is incorrect and I have having trouble finding the problem.</p> <p>I have to Joda library in my project.</p> <pre><code>if (timerightnow.isSelected()) { DateFormat getdate = new SimpleDateFormat("dd/MM/yy HH:mm:ss"); Date getdate1 = new Date(); String datenow = getdate1.toString(); String monthnow = datenow.substring(4, 7); String daynow = datenow.substring(8,10); String hournow = datenow.substring(11,19); String yearnow = datenow.substring(25, 29); if (monthnow.equalsIgnoreCase("jan")) monthnow = "01"; if (monthnow.equalsIgnoreCase("feb")) monthnow = "02"; if (monthnow.equalsIgnoreCase("mar")) monthnow = "03"; if (monthnow.equalsIgnoreCase("apr")) monthnow = "04"; if (monthnow.equalsIgnoreCase("may")) monthnow = "05"; if (monthnow.equalsIgnoreCase("jun")) monthnow = "06"; if (monthnow.equalsIgnoreCase("jul")) monthnow = "07"; if (monthnow.equalsIgnoreCase("agu")) monthnow = "08"; if (monthnow.equalsIgnoreCase("sep")) monthnow = "09"; if (monthnow.equalsIgnoreCase("oct")) monthnow = "10"; if (monthnow.equalsIgnoreCase("nov")) monthnow = "11"; if (monthnow.equalsIgnoreCase("dec")) monthnow = "12"; String timenow = monthnow + "/" + daynow + "/" + yearnow + " " + hournow; String timetotext = timeto.getText(); SimpleDateFormat date = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date datestart = null; Date dateend = null; try { datestart = date.parse(timenow); dateend = date.parse(timetotext); DateTime datestartdaytime = new DateTime(datestart); DateTime dateenddaytime = new DateTime(dateend); JOptionPane.showMessageDialog(null, datestartdaytime + "\n" + dateenddaytime); int monthoutput = Months.monthsBetween(datestartdaytime, dateenddaytime).getMonths(); int daysoutput = Days.daysBetween(datestartdaytime, datestartdaytime).getDays() % 30; int hoursoutput = Hours.hoursBetween(datestartdaytime, datestartdaytime).getHours() % 24; int minutsoutput = Minutes.minutesBetween(datestartdaytime, dateenddaytime).getMinutes() % 60; int secondsoutput = Seconds.secondsBetween(datestartdaytime, dateenddaytime).getSeconds() % 60; answer.setText(monthoutput + "Months" + daysoutput + "Days" + hoursoutput + "Hours" + minutsoutput + "Minutes" + secondsoutput + "Seconds"); </code></pre> <p>Thanks a lot :)</p>
0debug
pandas read_table columns issue : I can't seem to figure out how to display all columns in this .data file. I can only display two separate columns when I'd like to display all ten. I've attached an image with what I've tried. I've been looking over for the documentation, but nothing seems to fit. I've also attached an image with how I'd like the data to display in jupyter notebook. Any help would be appreciated. Thanks [how I'd like to display the data][1] [what I've tried so far][2] [1]: https://i.stack.imgur.com/W2cIW.jpg [2]: https://i.stack.imgur.com/hbiku.png
0debug
I can't find a way to fetch my generated e-sign from docusign : I have created an e-sign on docuSign website and generated an integrator key through website.But i can't find a way to fetch my generated e-sign from docusign back to my local machine. Has someone done this before. Please help me asap.
0debug
Docker scale with deterministic port binding : <p>I would like to scale a <code>wildfly</code> container having exposed multiple ports with deterministic results.</p> <p><strong>docker-compose.yml</strong></p> <pre><code>version: '3' services: wildfly-server: build: context: . dockerfile: Dockerfile args: admin_user: admin admin_password: admin deploy: resources: limits: memory: 1.5G cpus: "1.5" restart: always ports: - "8000-8099:8080" - "8100-8199:9990" - "8200-8299:8787" expose: - "8080" - "9990" - "8787" </code></pre> <p><strong>Dockerfile</strong></p> <pre><code>FROM jboss/wildfly:16.0.0.Final # DOCKER ENV VARIABLES ENV WILDFLY_HOME /opt/jboss/wildfly ENV STANDALONE_DIR ${WILDFLY_HOME}/standalone ENV DEPLOYMENT_DIR ${STANDALONE_DIR}/deployments ENV CONFIGURATION_DIR ${STANDALONE_DIR}/configuration RUN ${WILDFLY_HOME}/bin/add-user.sh ${admin_user} ${admin_password} --silent # OPENING DEBUG PORT RUN rm ${WILDFLY_HOME}/bin/standalone.conf ADD standalone.conf ${WILDFLY_HOME}/bin/ # SET JAVA ENV VARS RUN rm ${CONFIGURATION_DIR}/standalone.xml ADD standalone.xml ${CONFIGURATION_DIR}/ </code></pre> <p><strong>Command to start</strong></p> <pre><code>docker-compose up --build --force-recreate --scale wildfly-server=10 </code></pre> <p>It almost works as I want to, but there is some port discrepancy. When I create the containers, I want them to have incremental ports for each container to be exposed as follows:</p> <pre><code>machine_1 8001, 8101, 82001 machine_2 8002, 8102, 82002 machine_3 8003, 8103, 82003 </code></pre> <p>But what I get as a result is not deterministic and looks like this:</p> <pre><code>machine_1 8001, 8102, 82003 machine_2 8002, 8101, 82001 machine_3 8003, 8103, 82002 </code></pre> <p>The problem is that every time I run the compose up command, the ports are different for each container.</p> <p>Example output:</p> <pre><code>CONTAINER ID COMMAND CREATED STATUS PORTS NAMES 0232f24fbca4 "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8028-&gt;8080/tcp, 0.0.0.0:8231-&gt;8787/tcp, 0.0.0.0:8126-&gt;9990/tcp wildfly-server_7 13a6a365a552 "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8031-&gt;8080/tcp, 0.0.0.0:8230-&gt;8787/tcp, 0.0.0.0:8131-&gt;9990/tcp wildfly-server_10 bf8260d9874d "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8029-&gt;8080/tcp, 0.0.0.0:8228-&gt;8787/tcp, 0.0.0.0:8129-&gt;9990/tcp wildfly-server_6 3d58f2e9bdfe "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8030-&gt;8080/tcp, 0.0.0.0:8229-&gt;8787/tcp, 0.0.0.0:8130-&gt;9990/tcp wildfly-server_9 7824a73a09f5 "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8027-&gt;8080/tcp, 0.0.0.0:8227-&gt;8787/tcp, 0.0.0.0:8128-&gt;9990/tcp wildfly-server_3 85425462259d "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8024-&gt;8080/tcp, 0.0.0.0:8224-&gt;8787/tcp, 0.0.0.0:8124-&gt;9990/tcp wildfly-server_2 5be5bbe8e577 "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8026-&gt;8080/tcp, 0.0.0.0:8226-&gt;8787/tcp, 0.0.0.0:8127-&gt;9990/tcp wildfly-server_8 2512fc0643a3 "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8023-&gt;8080/tcp, 0.0.0.0:8223-&gt;8787/tcp, 0.0.0.0:8123-&gt;9990/tcp wildfly-server_5 b156de688dcb "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8025-&gt;8080/tcp, 0.0.0.0:8225-&gt;8787/tcp, 0.0.0.0:8125-&gt;9990/tcp wildfly-server_4 3e9401552b0a "/opt/jboss/wildfly/…" 5 minutes ago Up 5 minutes 0.0.0.0:8022-&gt;8080/tcp, 0.0.0.0:8222-&gt;8787/tcp, 0.0.0.0:8122-&gt;9990/tcp wildfly-server_1 </code></pre> <p><strong><em>Question</em></strong></p> <p>Is there any way to make the port distribution deterministic? Like disable parallel running to have serial checks on the available ports or any other method? The only alternative I found is to have a <code>yml</code> template and generate all the necessary files (like 10 if I need 10 containers etc). Are there any alternative solutions?</p>
0debug
google map not working in release, android : <p>I have a question about my google map, It's working on simulators and when I'm loading app on my phone using USB, but it doesn't work after uploading it on alfa-test. It's showing me empty map</p>
0debug
How to add a character into a string? (VBA) : I have a column of product numbers that are all formatted like "MK444LLA" -- same number and letter pattern, same character count. I need to insert a / into each cell so they all end up like so: "MK444LL/A". I'm thinking I just need a solution for the first row, which I can then apply to the entire column.
0debug
static void kmvc_decode_intra_8x8(KmvcContext * ctx, const uint8_t * src, int w, int h) { BitBuf bb; int res, val; int i, j; int bx, by; int l0x, l1x, l0y, l1y; int mx, my; kmvc_init_getbits(bb, src); for (by = 0; by < h; by += 8) for (bx = 0; bx < w; bx += 8) { kmvc_getbit(bb, src, res); if (!res) { val = *src++; for (i = 0; i < 64; i++) BLK(ctx->cur, bx + (i & 0x7), by + (i >> 3)) = val; } else { for (i = 0; i < 4; i++) { l0x = bx + (i & 1) * 4; l0y = by + (i & 2) * 2; kmvc_getbit(bb, src, res); if (!res) { kmvc_getbit(bb, src, res); if (!res) { val = *src++; for (j = 0; j < 16; j++) BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = val; } else { val = *src++; mx = val & 0xF; my = val >> 4; for (j = 0; j < 16; j++) BLK(ctx->cur, l0x + (j & 3), l0y + (j >> 2)) = BLK(ctx->cur, l0x + (j & 3) - mx, l0y + (j >> 2) - my); } } else { for (j = 0; j < 4; j++) { l1x = l0x + (j & 1) * 2; l1y = l0y + (j & 2); kmvc_getbit(bb, src, res); if (!res) { kmvc_getbit(bb, src, res); if (!res) { val = *src++; BLK(ctx->cur, l1x, l1y) = val; BLK(ctx->cur, l1x + 1, l1y) = val; BLK(ctx->cur, l1x, l1y + 1) = val; BLK(ctx->cur, l1x + 1, l1y + 1) = val; } else { val = *src++; mx = val & 0xF; my = val >> 4; BLK(ctx->cur, l1x, l1y) = BLK(ctx->cur, l1x - mx, l1y - my); BLK(ctx->cur, l1x + 1, l1y) = BLK(ctx->cur, l1x + 1 - mx, l1y - my); BLK(ctx->cur, l1x, l1y + 1) = BLK(ctx->cur, l1x - mx, l1y + 1 - my); BLK(ctx->cur, l1x + 1, l1y + 1) = BLK(ctx->cur, l1x + 1 - mx, l1y + 1 - my); } } else { BLK(ctx->cur, l1x, l1y) = *src++; BLK(ctx->cur, l1x + 1, l1y) = *src++; BLK(ctx->cur, l1x, l1y + 1) = *src++; BLK(ctx->cur, l1x + 1, l1y + 1) = *src++; } } } } } } }
1threat
i cant find -XX:MaxDirectMemorySize=512g : i cant find -XX:MaxDirectMemorySize=512g for change it to -XX:MaxDirectMemorySize=2g for install orientdb. please help me
0debug
angular2-jwt No provider for AuthConfig : <p>I am struggling with the angular2-jwt documentation for rc5 </p> <p>Here is my NgModule</p> <pre><code>import { AuthHttp } from 'angular2-jwt'; @NgModule({ imports: [ BrowserModule, routing, HttpModule, FormsModule, ], declarations: [ AppComponent, LoginComponent, NavbarComponent, DashboardComponent, ModelsComponent ], providers: [AuthGuard, ModelService, AuthHttp ], bootstrap: [ AppComponent ] }) export class AppModule { } </code></pre> <p>Here Is my service </p> <pre><code>import { Injectable } from '@angular/core'; import {Http} from '@angular/http'; import 'rxjs/add/operator/map'; import { Model } from './model'; import { AuthHttp } from 'angular2-jwt'; import {Observable} from "rxjs/Rx"; @Injectable() export class ModelService { private _url = "http://127.0.0.1:8050/test/model"; constructor(private _http: Http,private _authHttp: AuthHttp){ //this.jwt = localStorage.getItem('id_token'); } getPollModles(){ return Observable.interval(5000).switchMap(() =&gt; this._authHttp.get(this._url)).map(res =&gt; res.json()); } } </code></pre> <p>How do I get angular2_jwt working with rc5 ? </p> <p>When I add my service to the construtor I get the below erorr.</p> <pre><code>constructor(private route: ActivatedRoute, public router: Router, private modelService: ModelService) core.umd.js:5995EXCEPTION: Uncaught (in promise): Error: Error in ./ModelsComponent class ModelsComponent_Host - inline template:0:0 caused by: No provider for AuthConfig! </code></pre>
0debug