problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
Selenium Javascript generated HTML incomplete, even with document.body.innerHTML : <p>I am trying to get the HTML from a webpage that is modified by javascript after/while loading. I have followed the instructions in <a href="http://stanford.edu/~mgorkove/cgi-bin/rpython_tutorials/Scraping_a_Webpage_Rendered_by_Javascript_Using_Python.php" rel="nofollow noreferrer">this tutorial</a>. and I'm using command like this in my Python code after initially loading the page</p>
<pre><code>html = browser.execute_script("return document.body.innerHTML")
</code></pre>
<p>While this seems to get all of the HTML Selenium elements on other pages I've tried this on, it does not seem to work on <a href="https://www.azdot.gov/business/ContractsandSpecifications/PrequalifiedContractors/LegacyApplications/CNS/contractor_list.asp" rel="nofollow noreferrer">this page</a>. If you open that page and inspect the HTML you can see all of the HTML has loaded. I want to capture the elements below, but can't. By the way <a href="https://stackoverflow.com/questions/15623388/using-selenium-with-python-to-extract-javascript-generated-html-firebug">WebDriverWait</a> doesn't seem to work either...</p>
<pre><code><b>
<a href="contractor_list.asp?alpha=A">A&nbsp;</a>
<a href="contractor_list.asp?alpha=B">B&nbsp;</a>
<a href="contractor_list.asp?alpha=C">C&nbsp;</a>
<a href="contractor_list.asp?alpha=D">D&nbsp;</a>
...
</code></pre>
<p><strong>How can I get Selenium to expose those elements to me so I can access them? Or, should I be using a different tool for this?</strong></p>
| 0debug
|
void memory_region_sync_dirty_bitmap(MemoryRegion *mr)
{
AddressSpace *as;
FlatRange *fr;
QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) {
FlatView *view = as->current_map;
FOR_EACH_FLAT_RANGE(fr, view) {
if (fr->mr == mr) {
MEMORY_LISTENER_UPDATE_REGION(fr, as, Forward, log_sync);
}
}
}
}
| 1threat
|
What IDE is good to use for developing angularJS SPA with authentication form (windows 8.1) : <p>Im trying to create SPA with angularJS and sass what would be a good IDE to work with ?</p>
<p>Thanks</p>
| 0debug
|
Create a random quiz mode where every array part is only called once (Android Studio) : I'm a bit new to Android Studio and I want to make small quiz app. On the start screen there are two buttons. With the first button you just click through your questions and you can start at a specific question number if you want (this is already working). With the second button I wand to create a random mode BUT every question should only be asked once. So there should not be the possibility to get the same questions twice.
For that I created an Array:
public ArrayList<Integer> questionsDone = new ArrayList<>();
And got the lenght of the Question Array:
public int maxQuestions = QuestionLibrary.nQuestions.length;
then I have a function for updating the question:
private void updateQuestion(){
//RANDOM MODE
if (startNumber == -1) {
if (questionsDone.size() >= maxQuestions) {
finishQuiz();
} else {
nQuestionNumber = (int) (Math.random() * (maxQuestions));
do {
if (questionsDone.contains(nQuestionNumber)) {
nQuestionNumber = nQuestionNumber - 1;
if (nQuestionNumber == -1) {
nQuestionNumber = maxQuestions-1;
}
} else {
questionsDone.add(nQuestionNumber);
notDone = true;
}
} while (notDone = false);
}
}
nQuestionView.setText(nQuestionLibrary.getQuestion(nQuestionNumber));
nButtonChoice1.setText(nQuestionLibrary.getChoice1(nQuestionNumber));
nButtonChoice2.setText(nQuestionLibrary.getChoice2(nQuestionNumber));
nButtonChoice3.setText(nQuestionLibrary.getChoice3(nQuestionNumber));
So my idea was that when I start random mode, i pass the value "-1". If the size of the array (questions done) equals the number of the available questions the quiz should stop. If not, I just get a random number and multiply it with the number of questions. Then there is a do-while function which makes sure that if the questionsDone-Array already contains the number it will get a new number and after getting a number which is not in the array it will be stored in the array.
This is what the app does when I click on random mode:
It always shows a random question but sometimes one questions is asked twice and more. And suddenly it stops (the app is loading the result page) but the stop does not come with a pattern. When I have 7 questions, every questions is minimum asked once and sometimes it stops afer 15, sometimes after 20 questions and so on.
Does someone know why?
| 0debug
|
Replace string with variable for golang proxy : <p>I'm trying to use the http proxy code here </p>
<pre><code>proxyUrl := url.Parse(strings.Replace("%v", RandomProxyAddress()))
http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyUrl)}
</code></pre>
<p>Tells me there are too many arguments in the url.Parse</p>
<p>But when I try </p>
<pre><code>proxyUrl := url.Parse(RandomProxyAddress())
http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyUrl)}
</code></pre>
<p>I get <code>./main.go:138: multiple-value url.Parse() in single-value context</code></p>
<p>When I tried a string replace it also tells me too many varibles. Not sure how to get my proxy to work with the url.Parse</p>
| 0debug
|
What is the cardinality ratio between class and interface? : <p>What is the cardinality ratio between class and interface?</p>
<p>1.Many to one
2.one to many
3.one to one
4.many to many</p>
| 0debug
|
How do i launch another program install in my pc from a button in wpf : <p>i am trying to realise this application here .
i have a separate program that holds all the détails of my Customers
what i'm trying to do here is to create a button Inside my WPF application that will automatically launch the Customer program which is saved in my c\progam..... so on
can anyone help me
thanks in advance</p>
| 0debug
|
document.write('<script src="evil.js"></script>');
| 1threat
|
Handling newline characters in Rust - counting unique occurrences : I'm creating a compression/decompression library in Rust using Huffman encoding. One of the first steps is creating a data structure that contains all unique characters and the number of occurrences. I'm starting with just a simple text file, and having issues related to newline 'characters'.
My first attempt at solving this problem was constructing a `BTreeMap`, essentially a key-value pair of unique characters and their occurrences, respectively. Unfortunately, a newline 'character' is \n, which I think is not being handled corrected due to being two characters. I then converted the `BTreeMap` into a `Vec` to order by value, but that didn't solve the newline issue.
Here's my initial attempt at my `comp` binary package. Calling the binary is done using `cargo`, and my sample file is reproduced at the end of this question:
cargo run <text-file-in> <compressed-output-file>
`main.rs`:
extern crate comp;
use std::env;
use std::process;
use std::io::prelude::*;
use comp::Config;
fn main() {
// Collect command-line args into a vector of strings
let mut stderr = std::io::stderr();
let config = Config::new(env::args()).unwrap_or_else(|err| {
writeln!(&mut stderr, "Parsing error: {}", err).expect("Could not write to stderr");
process::exit(1)
});
println!("Filename In: {}", config.filename_in);
println!("Filename Out: {}", config.filename_out);
if let Err(e) = comp::run(config) {
writeln!(&mut stderr, "Application error: {}", e).expect("Could not write to stderr");
process::exit(1);
}
}
`lib.rs`:
use std::collections::btree_map::BTreeMap;
use std::error::Error;
use std::fs::File;
use std::io::Read;
use std::iter::FromIterator;
pub struct Config {
pub filename_in: String,
pub filename_out: String
}
impl Config {
pub fn new(mut args: std::env::Args) -> Result<Config, &'static str> {
args.next();
let filename_in = match args.next() {
Some(arg) => arg,
None => return Err("Didn't get a filename_in string"),
};
let filename_out = match args.next() {
Some(arg) => arg,
None => return Err("Didn't get a filename_out string"),
};
Ok(Config {
filename_in: filename_in,
filename_out: filename_out,
})
}
}
pub fn run(config: Config) -> Result<(), Box<Error>> {
let mut f = File::open(config.filename_in)?;
let mut contents = String::new();
f.read_to_string(&mut contents)?;
for line in contents.lines() {
println!("{}", line);
}
// Put unique occurrences into a BTreeMap
let mut count = BTreeMap::new();
for c in contents.chars() {
*count.entry(c).or_insert(0) += 1;
}
// Put contents into a Vec to order by value
let mut v = Vec::from_iter(count);
v.sort_by(|&(_, a), &(_, b)| b.cmp(&a));
// Print key-value pair of input file
println!("Number of occurrences of each character");
for &(key, value) in v.iter() {
println!("{}: {}", key, value);
}
Ok(())
}
Any criticism is welcome.
---
Sample text file, `poem.txt`:
I'm nobody! Who are you?
Are you nobody, too?
Then there's a pair of us — don't tell!
They'd banish us, you know.
How dreary to be somebody!
How public, like a frog
To tell your name the livelong day
To an admiring bog!
| 0debug
|
static void intel_hda_set_st_ctl(IntelHDAState *d, const IntelHDAReg *reg, uint32_t old)
{
bool output = reg->stream >= 4;
IntelHDAStream *st = d->st + reg->stream;
if (st->ctl & 0x01) {
dprint(d, 1, "st #%d: reset\n", reg->stream);
st->ctl = 0;
}
if ((st->ctl & 0x02) != (old & 0x02)) {
uint32_t stnr = (st->ctl >> 20) & 0x0f;
if (st->ctl & 0x02) {
dprint(d, 1, "st #%d: start %d (ring buf %d bytes)\n",
reg->stream, stnr, st->cbl);
intel_hda_parse_bdl(d, st);
intel_hda_notify_codecs(d, stnr, true, output);
} else {
dprint(d, 1, "st #%d: stop %d\n", reg->stream, stnr);
intel_hda_notify_codecs(d, stnr, false, output);
}
}
intel_hda_update_irq(d);
}
| 1threat
|
How to get the replication factor of C* cluster? : <p>I cant find it in cassandra.yaml, maybe nodetool can get me the configured replication factor of my cluster?</p>
<p>What is the default value of the replication factor?</p>
| 0debug
|
opposite of if condition : <p>I am trying to rewrite my if else statement so I skip the //do nothing part but I can't get my around to find the opposite of the if statement.</p>
<p>someone please help?!</p>
<pre><code>if (decision.equals("repay")){
String riskClass = null;
if (doc.hasItem("riskclass")){
riskClass = doc.getItemValueString("riskclass");
}
if ( (null == riskClass) || (riskClass.equals("")) || (riskClass.equals("repay")) ){
//do nothing
} else{
//do something
}
}
</code></pre>
| 0debug
|
static int qcow2_mark_dirty(BlockDriverState *bs)
{
BDRVQcowState *s = bs->opaque;
uint64_t val;
int ret;
assert(s->qcow_version >= 3);
if (s->incompatible_features & QCOW2_INCOMPAT_DIRTY) {
return 0;
}
val = cpu_to_be64(s->incompatible_features | QCOW2_INCOMPAT_DIRTY);
ret = bdrv_pwrite(bs->file, offsetof(QCowHeader, incompatible_features),
&val, sizeof(val));
if (ret < 0) {
return ret;
}
ret = bdrv_flush(bs->file);
if (ret < 0) {
return ret;
}
s->incompatible_features |= QCOW2_INCOMPAT_DIRTY;
return 0;
}
| 1threat
|
play notification sound from uri or from raw folder : > first of all i would say there are many ans related to this but i didn't get they match with my requirement
>
> i m letting user to choose sound from their phone storage and save path to db and when notification comes about to show and set sound i fetch sound from that notification id exist play chose sound or play default sound.... but this is not working at All...it playing no sound not chose nor default..
**google research says**
> many answers i found that were suggesting to play sound from raw folder but i don't get ans by which i save user selected sound to raw folder(of course programmatically) so i can play sound from raw folder..
**code**
private void showNotification(Context context, Things things) {
try {
NotificationManager mNotifyMgr =
(NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.icon)
//example for large icon
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.drawable.icon))
.setContentTitle(things.getTitle())
.setContentText(things.getThing()).setSubText(things.getNotification())
.setOngoing(false)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
.setAutoCancel(true);
Intent i = new Intent(context, HomeActivity.class);
PendingIntent pendingIntent =
PendingIntent.getActivity(
context,
0,
i,
PendingIntent.FLAG_ONE_SHOT
);
// example for blinking LED
mBuilder.setLights(0xFFb71c1c, 1000, 2000);
if (things.getRingtone() == null || things.getRingtone().equals("")) {
mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
} else {
Ringtone r = RingtoneManager.getRingtone(context, Uri.parse(things.getRingtone()));
r.play();
Toast.makeText(context, things.getRingtone(), Toast.LENGTH_SHORT).show();
}
//mBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
mBuilder.setContentIntent(pendingIntent);
mNotifyMgr.notify(12345, mBuilder.build());
} catch (Exception e) {
Log.d(getClass().getName(), "catch " + e.toString());
}
}
| 0debug
|
Creating a grid of tiles in bootstrap 3 : <p>I am working on a project and the user asked if they could have something like this.</p>
<p><a href="https://i.stack.imgur.com/Sq9Qr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sq9Qr.png" alt="enter image description here"></a></p>
<p>Grid lines are there as a guide.</p>
<p>I understand I could use columns but the item that's tripped me up is the longer image.</p>
<p>Is there a way to have a row that spans many rows?</p>
<p>Or is it best to have columns within columns and then seperate out each element?</p>
| 0debug
|
How to find city name with latitude and longitude in javascript? : I already searched in a lot of websites for a solution but no one of them worked.
since hours i am trying to get the **name of the city** by using the **latitude and longitude** values wich i will get from a input box to my x,y variables but no example worked :(
I also read in the google maps api but it was not usefull.
I already have an api key.
Do you maybe have any solution ??
This example i got from the website and tried but without success:
function myFunction() { var x='xxxxx'; var y='xxxxx'; //my coordinates
var geocoder = new google.maps.Geocoder;
var latlng = {lat: parseFloat(x), lng: parseFloat(y)};
geocoder.geocode({'location': latlng}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
// ...
} else {
window.alert('No results found');
}
} else {
window.alert('Geocoder failed due to: ' + status);
}
});
}
</script>
hope you will help me.
best regards
| 0debug
|
void i2c_end_transfer(I2CBus *bus)
{
I2CSlaveClass *sc;
I2CNode *node, *next;
if (QLIST_EMPTY(&bus->current_devs)) {
return;
}
QLIST_FOREACH_SAFE(node, &bus->current_devs, next, next) {
sc = I2C_SLAVE_GET_CLASS(node->elt);
if (sc->event) {
sc->event(node->elt, I2C_FINISH);
}
QLIST_REMOVE(node, next);
g_free(node);
}
bus->broadcast = false;
}
| 1threat
|
static int ds1225y_set_to_mode(ds1225y_t *NVRAM, nvram_open_mode mode, const char *filemode)
{
if (NVRAM->open_mode != mode)
{
if (NVRAM->file)
qemu_fclose(NVRAM->file);
NVRAM->file = qemu_fopen(NVRAM->filename, filemode);
NVRAM->open_mode = mode;
}
return (NVRAM->file != NULL);
}
| 1threat
|
How to use syntaxnet output : <p>I started playing with Syntaxnet two days ago and I'm wondering <strong>how to use/export</strong> the output (ascii tree or conll ) in a format that is easy to parse (ie : Json, XML, python graph).</p>
<p>Thanks for your help ! </p>
| 0debug
|
Pro/contra of using "else" if the then-clause exits the method anyways : <p>Which of these two is the "better" method and why?</p>
<pre><code>if(list.isEmpty()) {
return;
} else {
[...]
}
</code></pre>
<p>vs.</p>
<pre><code>if(list.isEmpty()) {
return;
}
[...]
</code></pre>
| 0debug
|
c++ : How to ask a file name and print char Array : <p>i am new in c++, i am working on a project, in case 1 i need to ask a file name from a user and if the file name is correct to it should print something like 6x5 character Array. I am totally confused that how to start. any single help will be appreciated.</p>
<pre><code>#include <iostream>
using namespace std;
int main(){
int x;
string file;
int temp;
cout << "Welcome to Urban Heat Island Model" << endl;
cout << "What would you like to do? " << endl;
cout << "1. Load land cover file " << endl;
cout << "2. Model Temperature Based on land cover" << endl;
cout << "3. Exit " << endl;
cin >> x;
switch (x){
case 1:
cout << "What is the name of the file to import? " << endl;
cin >> file;
break;
</code></pre>
| 0debug
|
int spapr_tce_dma_read(VIOsPAPRDevice *dev, uint64_t taddr, void *buf,
uint32_t size)
{
#ifdef DEBUG_TCE
fprintf(stderr, "spapr_tce_dma_write taddr=0x%llx size=0x%x\n",
(unsigned long long)taddr, size);
#endif
while (size) {
uint64_t tce;
uint32_t lsize;
uint64_t txaddr;
if (taddr >= dev->rtce_window_size) {
#ifdef DEBUG_TCE
fprintf(stderr, "spapr_tce_dma_read out of bounds\n");
#endif
return H_DEST_PARM;
tce = dev->rtce_table[taddr >> SPAPR_VIO_TCE_PAGE_SHIFT].tce;
lsize = MIN(size, ((~taddr) & SPAPR_VIO_TCE_PAGE_MASK) + 1);
if (!(tce & 1)) {
return H_DEST_PARM;
txaddr = (tce & ~SPAPR_VIO_TCE_PAGE_MASK) |
(taddr & SPAPR_VIO_TCE_PAGE_MASK);
#ifdef DEBUG_TCE
fprintf(stderr, " -> write to txaddr=0x%llx, size=0x%x\n",
(unsigned long long)txaddr, lsize);
#endif
cpu_physical_memory_read(txaddr, buf, lsize);
buf += lsize;
taddr += lsize;
size -= lsize;
return H_SUCCESS;
| 1threat
|
jQuery select element id from String : <p>Ok, So I am a little noob here and I think that my terminology might be wrong so please feel free to correct me (I need to learn).</p>
<p>I want to create a better user experience on an FAQ page and ask the user if the question was helpful. If not provide an Alternative. I am trying to add a class to a div that contains the question. </p>
<p>Here is a fiddle example: <a href="https://jsfiddle.net/u596vwwn/" rel="nofollow noreferrer">https://jsfiddle.net/u596vwwn/</a></p>
<p>Here is the jQuery:</p>
<pre><code> $(document).ready(function() {
$('.faq-question').click(function() {
var question = $(this).attr('href');
question = question.replace('#', '');
var questionData = document.getElementById(question).innerHTML;
document.getElementById(question).innerHTML = questionData + '<div class="row further-help">Did this answer your question? <span id="further-help-yes">Yes</span> | <span id="further-help-no">No</span></div>';
});
$('body').on('click', '#further-help-yes', function() {
$(this).parent('.further-help').fadeOut();
});
$('body').on('click', '#further-help-no', function() {
$(this).parent('.further-help').html('Please contact us <a href="#">here</a>.');
});
});
</code></pre>
<p>What I want, when the user clicks the link in the fiddle. The div container the question will then have a class added so that I can style it.</p>
<p>I tried getting the element like so: </p>
<pre><code> var questionContainer = document.getElementById(question);
</code></pre>
<p>and then add a class like so:</p>
<pre><code>questionContainer.addClass('selected-faq');
</code></pre>
<p>but it is not adding it. </p>
| 0debug
|
flutter get stuck at resolving dependencies for android : <p>I am using Android Studio for flutter </p>
<p>My flutter doctor says no issue found, when I run iOS app, it works but when app is requested to run as Android app, android studio just hangs up on Resolving dependencies.. what issue can be there? is it downloading something or any other issue?</p>
| 0debug
|
Javascript optgroup hiden dont working IExlorer : This code working in Opera, problem is IE end Android.
Use hiden() javascript. First Option use value Mazda (mark) second shows us 'opera': only all models MAZDA (is good). 'IE': Shows us all model and all optgroup. Maybe is in JS problem?
$(document).ready(function() {
$('#model optgroup').hide();enter code here
$('#Marka').change(function() {
var text = $(this).val();
$('#model optgroup').hide();
$('#model').val('');
$('#model optgroup[label="' + text + '"]').css({
'display': 'block'
});
});
});
function usun() {
document.getElementById("first").style.display = "none";
}
[https://jsfiddle.net/p051m5u6/][1]
[1]: https://jsfiddle.net/p051m5u6/
| 0debug
|
static always_inline int _pte_check (mmu_ctx_t *ctx, int is_64b,
target_ulong pte0, target_ulong pte1,
int h, int rw, int type)
{
target_ulong ptem, mmask;
int access, ret, pteh, ptev, pp;
access = 0;
ret = -1;
#if defined(TARGET_PPC64)
if (is_64b) {
ptev = pte64_is_valid(pte0);
pteh = (pte0 >> 1) & 1;
} else
#endif
{
ptev = pte_is_valid(pte0);
pteh = (pte0 >> 6) & 1;
}
if (ptev && h == pteh) {
#if defined(TARGET_PPC64)
if (is_64b) {
ptem = pte0 & PTE64_PTEM_MASK;
mmask = PTE64_CHECK_MASK;
pp = (pte1 & 0x00000003) | ((pte1 >> 61) & 0x00000004);
ctx->nx |= (pte1 >> 2) & 1;
ctx->nx |= (pte1 >> 3) & 1;
} else
#endif
{
ptem = pte0 & PTE_PTEM_MASK;
mmask = PTE_CHECK_MASK;
pp = pte1 & 0x00000003;
}
if (ptem == ctx->ptem) {
if (ctx->raddr != (target_ulong)-1) {
if ((ctx->raddr & mmask) != (pte1 & mmask)) {
if (loglevel != 0)
fprintf(logfile, "Bad RPN/WIMG/PP\n");
return -3;
}
}
access = pp_check(ctx->key, pp, ctx->nx);
ctx->raddr = pte1;
ctx->prot = access;
ret = check_prot(ctx->prot, rw, type);
if (ret == 0) {
#if defined (DEBUG_MMU)
if (loglevel != 0)
fprintf(logfile, "PTE access granted !\n");
#endif
} else {
#if defined (DEBUG_MMU)
if (loglevel != 0)
fprintf(logfile, "PTE access rejected\n");
#endif
}
}
}
return ret;
}
| 1threat
|
Not understanding this code : I wanted a way to exit my android app. hence I searched and found a piece of code which does that. But I am not able to understand the code and why it does what it does. Can anyone please explain? Here is the code:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
Thanks a lot!!
| 0debug
|
void apic_deliver_pic_intr(DeviceState *dev, int level)
{
APICCommonState *s = APIC_COMMON(dev);
if (level) {
apic_local_deliver(s, APIC_LVT_LINT0);
} else {
uint32_t lvt = s->lvt[APIC_LVT_LINT0];
switch ((lvt >> 8) & 7) {
case APIC_DM_FIXED:
if (!(lvt & APIC_LVT_LEVEL_TRIGGER))
break;
apic_reset_bit(s->irr, lvt & 0xff);
case APIC_DM_EXTINT:
cpu_reset_interrupt(CPU(s->cpu), CPU_INTERRUPT_HARD);
break;
}
}
}
| 1threat
|
Getting class name in SWIFT equivalent to Objective C [self class]? : <p>I am using the following syntax to debug my Objective C code, getting the class name. What is the equivalent in SWIFT?</p>
<pre><code>NSlog (@"Classe = %@",[self class]);
</code></pre>
| 0debug
|
static int epzs_motion_search(MpegEncContext * s,
int *mx_ptr, int *my_ptr,
int P[5][2], int pred_x, int pred_y,
int xmin, int ymin, int xmax, int ymax, uint8_t * ref_picture)
{
int best[2]={0, 0};
int d, dmin;
UINT8 *new_pic, *old_pic;
const int pic_stride= s->linesize;
const int pic_xy= (s->mb_y*pic_stride + s->mb_x)*16;
UINT16 *mv_penalty= s->mv_penalty[s->f_code] + MAX_MV;
int quant= s->qscale;
const int shift= 1+s->quarter_sample;
new_pic = s->new_picture[0] + pic_xy;
old_pic = ref_picture + pic_xy;
dmin = pix_abs16x16(new_pic, old_pic, pic_stride);
if(dmin<Z_THRESHOLD){
*mx_ptr= 0;
*my_ptr= 0;
return dmin;
}
if ((s->mb_y == 0 || s->first_slice_line || s->first_gob_line)) {
CHECK_MV(P[1][0]>>shift, P[1][1]>>shift)
}else{
CHECK_MV(P[4][0]>>shift, P[4][1]>>shift)
if(dmin<Z_THRESHOLD){
*mx_ptr= P[4][0]>>shift;
*my_ptr= P[4][1]>>shift;
return dmin;
}
CHECK_MV(P[1][0]>>shift, P[1][1]>>shift)
CHECK_MV(P[2][0]>>shift, P[2][1]>>shift)
CHECK_MV(P[3][0]>>shift, P[3][1]>>shift)
}
CHECK_MV(P[0][0]>>shift, P[0][1]>>shift)
if(s->me_method==ME_EPZS)
dmin= small_diamond_search(s, best, dmin, new_pic, old_pic, pic_stride,
pred_x, pred_y, mv_penalty, quant, xmin, ymin, xmax, ymax, shift);
else
dmin= snake_search(s, best, dmin, new_pic, old_pic, pic_stride,
pred_x, pred_y, mv_penalty, quant, xmin, ymin, xmax, ymax, shift);
*mx_ptr= best[0];
*my_ptr= best[1];
return dmin;
}
| 1threat
|
How to Configure login UI for IdentityServer4? : <p>Examples I find for IdentityServer4 use <a href="https://github.com/IdentityServer/IdentityServer4.Quickstart.UI" rel="noreferrer">MVC</a> for login UI. When a OpenIdConnect implicit client hits the 'authorization_endpoint' (example '<a href="http://localhost:5000/connect/authorize" rel="noreferrer">http://localhost:5000/connect/authorize</a>') it gets redirected to the <a href="https://github.com/IdentityServer/IdentityServer4.Quickstart.UI/blob/release/Quickstart/Account/AccountController.cs" rel="noreferrer">AccountController</a> Login action. How would you configure IdentityServer4 to use a different controller or UI for as the login page?</p>
| 0debug
|
Can we dynamically create a table in Oracle? : <p>First of all i want to say that the question i am going to ask is related to my project i.e student management system using Servlet and JSP using hibernate.
In my project i want to implement a functionality i.e. i will fetch the data from database of enrolled students of different streams together in a dynamic table on a JSP page and from there i will choose the 15 students of a particular stream by select the check box and using that selected students i want to create a batch means another table with a batch name. Means that one copy of that selected student will be added in the new table. This functionality will happen when administrator will click on create batch button.</p>
<p>Actually i am not able to implement this functionality. So if it is possible to implement then. Please Help!!</p>
<p>Note: I am using eclipse IDE and Oracle Database.</p>
| 0debug
|
How to implement complex arrays? : <p>For example, when <code>id</code> is equal to 1, an array is <code>['a', 'b']</code>, and when <code>id</code> is equal to 2, another array is <code>['c']</code>. The result of these two arrays is <code>[["a","b "],["c"]]</code></p>
<p><strong>I want the results as follows:</strong></p>
<pre><code>[["a","b"],["c"]]
</code></pre>
<p><strong>my code:</strong></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>var data = [{
id: 1,
name: 'a'
},
{
id: 1,
name: 'b'
},
{
id: 2,
name: 'c'
}
]</code></pre>
</div>
</div>
</p>
| 0debug
|
Tensorflow: loss decreasing, but accuracy stable : <p>My team is training a CNN in Tensorflow for binary classification of damaged/acceptable parts. We created our code by modifying the cifar10 example code. In my prior experience with Neural Networks, I always trained until the loss was very close to 0 (well below 1). However, we are now evaluating our model with a validation set during training (on a separate GPU), and it seems like the precision stopped increasing after about 6.7k steps, while the loss is still dropping steadily after over 40k steps. Is this due to overfitting? Should we expect to see another spike in accuracy once the loss is very close to zero? The current max accuracy is not acceptable. Should we kill it and keep tuning? What do you recommend? Here is our modified code and graphs of the training process.</p>
<p><a href="https://gist.github.com/justineyster/6226535a8ee3f567e759c2ff2ae3776b" rel="noreferrer">https://gist.github.com/justineyster/6226535a8ee3f567e759c2ff2ae3776b</a></p>
<p><a href="https://imgur.com/a/zMzGb" rel="noreferrer">Precision and Loss Images</a></p>
| 0debug
|
def remove_duplic_list(l):
temp = []
for x in l:
if x not in temp:
temp.append(x)
return temp
| 0debug
|
Bucket of Staging files after deploying an app engine : <p>After deploying a google app engine, at least 4 buckets are created in the google cloud storage:</p>
<ul>
<li>[project-id].appspot.com</li>
<li>staging.[project-id].appspot.com</li>
<li>artifacts.[project-id].appspot.com</li>
<li>vm-containers.[project-id].appspot.com</li>
</ul>
<p>What are they, and will they incur storage cost? Can they be safely deleted?</p>
| 0debug
|
How to give editext with label (in editext) as front of edittextbox : How to give editext with label (in editext) as front of edittextbox[enter image description here][1]
[1]: http://i.stack.imgur.com/lJ1Mb.jpg
| 0debug
|
Adding to one element in a list : If I have a=[1,2,3] and I want to add 1 to element [2] to get the output [1,2,4], how would I do that?
I assume I would use a for loop but not sure exactly how.
| 0debug
|
How to count the last 60s in moving window in golang? : <p>I want to know if how can I count the number of request based on the moving window in golang after 60s?</p>
| 0debug
|
static void virtio_blk_handle_write(VirtIOBlockReq *req, MultiReqBuffer *mrb)
{
BlockRequest *blkreq;
uint64_t sector;
sector = virtio_ldq_p(VIRTIO_DEVICE(req->dev), &req->out.sector);
trace_virtio_blk_handle_write(req, sector, req->qiov.size / 512);
if (!virtio_blk_sect_range_ok(req->dev, sector, req->qiov.size)) {
virtio_blk_req_complete(req, VIRTIO_BLK_S_IOERR);
virtio_blk_free_request(req);
return;
}
block_acct_start(bdrv_get_stats(req->dev->bs), &req->acct, req->qiov.size,
BLOCK_ACCT_WRITE);
if (mrb->num_writes == 32) {
virtio_submit_multiwrite(req->dev->bs, mrb);
}
blkreq = &mrb->blkreq[mrb->num_writes];
blkreq->sector = sector;
blkreq->nb_sectors = req->qiov.size / BDRV_SECTOR_SIZE;
blkreq->qiov = &req->qiov;
blkreq->cb = virtio_blk_rw_complete;
blkreq->opaque = req;
blkreq->error = 0;
mrb->num_writes++;
}
| 1threat
|
void ff_sws_init_swScale_altivec(SwsContext *c)
{
enum PixelFormat dstFormat = c->dstFormat;
if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC))
return;
c->hScale = hScale_altivec_real;
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat)) {
c->yuv2yuvX = yuv2yuvX_altivec_real;
}
if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf &&
(c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA ||
c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 ||
c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB)) {
c->yuv2packedX = ff_yuv2packedX_altivec;
}
}
| 1threat
|
ds1225y_t *ds1225y_init(target_phys_addr_t mem_base, const char *filename)
{
ds1225y_t *s;
int mem_index1, mem_index2;
s = qemu_mallocz(sizeof(ds1225y_t));
if (!s)
return NULL;
s->mem_base = mem_base;
s->capacity = 0x2000;
s->filename = filename;
mem_index1 = cpu_register_io_memory(0, nvram_read, nvram_write, s);
cpu_register_physical_memory(mem_base, s->capacity, mem_index1);
mem_index2 = cpu_register_io_memory(0, nvram_read, nvram_none, s);
cpu_register_physical_memory(mem_base + s->capacity, s->capacity, mem_index2);
return s;
}
| 1threat
|
Combine certain tuples in a list : I have this list with multiple tuples:
['ASA', 'TD', 'UDP', '255.255.255.255', '/80', 'to', '255.255.255', '/88']
How can I get this as the final result:
['ASA', 'TD', 'UDP', '255.255.255.255/80', 'to', '255.255.255/88']
| 0debug
|
Parse error, I believe there is no errors : what error can you see at the end of "b2"? I believe there is no error. The code if for haskell.
parse error (possibly incorrect indentation or mismatched brackets)
|
1 | let idPnumber a1 b2= take 3 a1 == take 3 b2
| ^
| 0debug
|
Swift not changing variable : <p>I am currently modifying this tutorial from <a href="https://www.simplifiedios.net/swift-php-mysql-tutorial/" rel="nofollow noreferrer">https://www.simplifiedios.net/swift-php-mysql-tutorial/</a> . The purpose of the program is to close a ViewController if the correct message is recieved and to display a UIAltertAction if an invalid message is recieved. Could there be something that i am missing that "notChangingVariable" is never changing?</p>
<pre><code> ...IBACTION...
var notChangingVariable: Int
notChangingVariable = 0
...othervariablesdeclared...
let task = URLSession.shared.dataTask(with: request as URLRequest){
data, response, error in
if(error != nil){
return;
}
//parsing the response
do{
//converting resonse to NSDictionary
let myJSON = try JSONSerialization.jsonObject(with: data!, options: .mutableContainers) as? NSDictionary
//parsing the json
if let parseJSON = myJSON{
var msg : String!
//getting the json response
msg = parseJSON["message"] as! String?
if(msg == "SameTeam"){
print(msg)
notChangingVariable = 1
print(notChangingVariable)
}
}
}catch{
print("error32 is \(error)")
}
}
task.resume()
print(notChangingVariable) //IS 0
...FURTHER USE notChangingVariable...
</code></pre>
| 0debug
|
HELLLLP urllib.request.urlopen Error : Hi I'm new to python and I'm using version 3.6.2
I can't seem to even code the most basic of lines, as seen below. I would love to know what I'm doing wrong.
>>> import urllib.request
>>> x = urllib.request.urlopen('https://www.google.com')
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in __init__
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
x = urllib.request.urlopen('https://www.google.com')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
| 0debug
|
static int vmstate_size(void *opaque, VMStateField *field)
{
int size = field->size;
if (field->flags & VMS_VBUFFER) {
size = *(int32_t *)(opaque+field->size_offset);
if (field->flags & VMS_MULTIPLY) {
size *= field->size;
}
}
return size;
}
| 1threat
|
static void pxb_dev_realize_common(PCIDevice *dev, bool pcie, Error **errp)
{
PXBDev *pxb = convert_to_pxb(dev);
DeviceState *ds, *bds = NULL;
PCIBus *bus;
const char *dev_name = NULL;
Error *local_err = NULL;
if (pxb->numa_node != NUMA_NODE_UNASSIGNED &&
pxb->numa_node >= nb_numa_nodes) {
error_setg(errp, "Illegal numa node %d", pxb->numa_node);
return;
}
if (dev->qdev.id && *dev->qdev.id) {
dev_name = dev->qdev.id;
}
ds = qdev_create(NULL, TYPE_PXB_HOST);
if (pcie) {
bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS);
} else {
bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS);
bds = qdev_create(BUS(bus), "pci-bridge");
bds->id = dev_name;
qdev_prop_set_uint8(bds, PCI_BRIDGE_DEV_PROP_CHASSIS_NR, pxb->bus_nr);
qdev_prop_set_bit(bds, PCI_BRIDGE_DEV_PROP_SHPC, false);
}
bus->parent_dev = dev;
bus->address_space_mem = dev->bus->address_space_mem;
bus->address_space_io = dev->bus->address_space_io;
bus->map_irq = pxb_map_irq_fn;
PCI_HOST_BRIDGE(ds)->bus = bus;
pxb_register_bus(dev, bus, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto err_register_bus;
}
qdev_init_nofail(ds);
if (bds) {
qdev_init_nofail(bds);
}
pci_word_test_and_set_mask(dev->config + PCI_STATUS,
PCI_STATUS_66MHZ | PCI_STATUS_FAST_BACK);
pci_config_set_class(dev->config, PCI_CLASS_BRIDGE_HOST);
pxb_dev_list = g_list_insert_sorted(pxb_dev_list, pxb, pxb_compare);
return;
err_register_bus:
object_unref(OBJECT(bds));
object_unparent(OBJECT(bus));
object_unref(OBJECT(ds));
}
| 1threat
|
int vfio_container_ioctl(AddressSpace *as, int32_t groupid,
int req, void *param)
{
switch (req) {
case VFIO_CHECK_EXTENSION:
case VFIO_IOMMU_SPAPR_TCE_GET_INFO:
case VFIO_EEH_PE_OP:
break;
default:
error_report("vfio: unsupported ioctl %X", req);
return -1;
}
return vfio_container_do_ioctl(as, groupid, req, param);
}
| 1threat
|
AngularJs is responsive then why do we apply responsive layout? why isn’t it default? : <p>I read that angularjs is responsive framework then when we use angular material for web page then why web page by default is not responsive?</p>
| 0debug
|
Enforcing Terms and condition Agreement in android : How to enforce terms and condition agreement in android ?
I want to do it like this http://www.droidbin.com/ . You can observe in the given link that upload appears only when checkbox is ticked else it invisible and initially it is invisible. Please follow up the link before commenting or answering so that the required thing is cleared.
| 0debug
|
static av_cold int init(AVFilterContext *ctx)
{
SendCmdContext *sendcmd = ctx->priv;
int ret, i, j;
if (sendcmd->commands_filename && sendcmd->commands_str) {
av_log(ctx, AV_LOG_ERROR,
"Only one of the filename or commands options must be specified\n");
return AVERROR(EINVAL);
}
if (sendcmd->commands_filename) {
uint8_t *file_buf, *buf;
size_t file_bufsize;
ret = av_file_map(sendcmd->commands_filename,
&file_buf, &file_bufsize, 0, ctx);
if (ret < 0)
return ret;
buf = av_malloc(file_bufsize + 1);
if (!buf) {
av_file_unmap(file_buf, file_bufsize);
return AVERROR(ENOMEM);
}
memcpy(buf, file_buf, file_bufsize);
buf[file_bufsize] = 0;
av_file_unmap(file_buf, file_bufsize);
sendcmd->commands_str = buf;
}
if ((ret = parse_intervals(&sendcmd->intervals, &sendcmd->nb_intervals,
sendcmd->commands_str, ctx)) < 0)
return ret;
if (sendcmd->nb_intervals == 0) {
av_log(ctx, AV_LOG_ERROR, "No commands\n");
return AVERROR(EINVAL);
}
qsort(sendcmd->intervals, sendcmd->nb_intervals, sizeof(Interval), cmp_intervals);
av_log(ctx, AV_LOG_DEBUG, "Parsed commands:\n");
for (i = 0; i < sendcmd->nb_intervals; i++) {
AVBPrint pbuf;
Interval *interval = &sendcmd->intervals[i];
av_log(ctx, AV_LOG_VERBOSE, "start_time:%f end_time:%f index:%d\n",
(double)interval->start_ts/1000000, (double)interval->end_ts/1000000, interval->index);
for (j = 0; j < interval->nb_commands; j++) {
Command *cmd = &interval->commands[j];
av_log(ctx, AV_LOG_VERBOSE,
" [%s] target:%s command:%s arg:%s index:%d\n",
make_command_flags_str(&pbuf, cmd->flags), cmd->target, cmd->command, cmd->arg, cmd->index);
}
}
return 0;
}
| 1threat
|
Python Personality Quiz, How to show one output instead of all of them : <p>I am trying to create a "Which television show would you be best in."
However, when it outputs which show you should be in- it says them all. How do I fix this?</p>
<p>I don't care if I took a long route to complete the code- I just want to know how to fix to say one answer. Thanks.</p>
<pre><code>def quiz():
print("Hello- what is your name?")
name = input("Name: ")
print("Hello " + str(name) + ", I will be asking you some questions today to find out what television show you'd be best in.")
print(" ")
print("Are you ready?")
print("Please answer with YES or NO: ")
response = input()
if response.lower() == 'yes':
print(" ")
print("Alrighty then.")
print(" ")
print("Do you prefer to: ")
print(" ")
print("Laugh")
print("Think")
print("Fight")
print(" ")
q1 = input("Choose carefully: ")
print(" ")
print("Type of Villain?")
print(" ")
print("Supernatural")
print("Humans")
print("Social Pressure")
print(" ")
q2 = input("Death by: ")
print(" ")
print("Genre: ")
print(" ")
print("Action")
print("Comedy")
print("Drama")
print("Horror")
print(" ")
q3 = input("What will you pick: ")
print(" ")
print("You like to dress: ")
print("Trendy")
print("Casual")
print("Eccentric")
print("Elegantly")
print("Whatever I can get my hands on")
q4 = input("Fasionably...: ")
print(" ")
print("What would you use to defend yourself in a bad situation: ")
print("My own intelligence")
print("Bow and Arrows")
print("My teeth")
print("A sword or something sharp")
print("Electronic Device")
print("What bad situation...")
print("A gun")
q5 = input("Incidentally enough- pick your poison: ")
print(" ")
print("Which superower seems the best to you: ")
print("Super Strength")
print("Hyper-Observance")
print("Advanced Intelligence")
print("Invisibility")
print("Teleportation")
print("Telepathy")
print("Immortality")
q6 = input("Power: ")
if q1.lower() == 'laugh' or '1':
if q2.lower() == 'humans' or '2':
if q3.lower() == 'action' or 'comedy' or '1' or '2':
if q4.lower() == 'casual' or '2':
if q5.lower() == 'my own intelligence' or 'intelligence' or 'my' or 'own' or '1':
if q6.lower() == 'hyper-observance' or 'hyper' or 'observance' or '2':
print("Your television show is... Psych!")
if q1.lower() == 'think':
if q2.lower() == 'humans':
if q3.lower() == 'drama' or '3' or 'action' or '1':
if q4.lower() == 'elegantly' or '4':
if q5.lower() == 'a sword or something sharp' or 'a' or 'sword' or 'or' or 'something' or 'sharp' or 'something sharp' or '4' or 'bow and arrows' or 'bow' or 'arrows' or '2':
if q6.lower() == 'advanced intelligenct' or 'intelligence' or '3':
print("Your television show is... Game of Thrones!")
if q1.lower() == 'think' or '2' or 'fight' or '3':
if q2.lower() == 'humans' or '2' or 'social pressure' or 'social' or 'pressure' or '3':
if q3.lower() == 'comedy' or '2' or 'drama' or '3' and q4.lower() == 'trendy' or '1':
if q5.lower() == 'my own intelligence' or 'my' or 'own' or 'intelligence' or '1' or 'electronic device' or 'electronic' or 'device' or '5' or 'what bad situation?' or 'what' or 'bad' or 'situation' or 'what bad situation' or '6':
if q6.lower() == 'advanced intelligence' or 'intelligence' or '3' or 'telepathy' or '6':
print("Your television show is... Gossip Girl!")
if q1.lower() == 'think' or '2' or 'fight' or '3':
if q2.lower() == 'humans' or '2' or 'supernatural' or '1':
if q3.lower() == 'action' or 'drama' or '1' or '3':
if q4.lower() == 'casual' or '2' or 'whatever i can get my hands on' or '5':
if q5.lower() == 'my own intelligence' or 'intelligence' or 'my' or 'own' or '1' or 'a gun':
if q6.lower() == 'super strength' or 'super' or 'strength' or '1' or 'invisibility' or '4':
print("Your television show is... The Walking Dead!")
if q1.lower() == 'think' or '2' or 'fight' or '3':
if q2.lower() == 'supernatural' or '1' or 'humans' or '2':
if q3.lower() == 'action' or '1' or 'horror' or '4':
if q4.lower() == 'whatever i can get my hands on' or '5':
if q5.lower() == 'my' or 'own' or 'intelligence' or 'my own intelligence' or '1':
if q6.lower() == 'teleportation' or '5':
print("Your television show is... Lost!")
if q1.lower() == 'laugh' or '1':
if q2.lower() == 'social pressure' or 'social' or 'pressure' or '3':
if q3.lower() == 'comedy' or '2' or 'drama' or '3':
if q4.lower() == 'trendy' or '1' or 'casual' or '2':
if q5.lower() == 'what bad situation' or 'what' or 'bad' or 'situation' or 'what bad situation?' or '6':
if q6.lower() == 'telepathy' or '6':
print("Your television show is... Friends!")
if q1.lower() == 'think' or '2' or 'fight' or '3':
if q2.lower() == 'humans' or '2':
if q3.lower() == 'drama' or '3' or 'horror' or '4':
if q4.lower() == 'casual' or '2':
if q5.lower() == 'my own intelligence' or 'intelligence' or '1' or 'a gun' or 'gun' or '7':
if q6.lower() == 'hyper observance' or 'hyper' or 'observance' or '2' or 'telepathy' or '6':
print("Your television show is... Criminal Minds!")
if q1.lower() == 'think' or '2' or 'fight' or '3':
if q2.lower() == 'supernatural' or '1':
if q3.lower() == 'horror' or '4':
if q4.lower == 'casual' or '2':
if q5.lower() == 'my own intelligence' or 'intelligence' or '1' or 'electronice device' or 'electronic' or 'device' or '5':
if q6.lower() == 'telekinesis' or '8':
print("Your television show is... Stranger Things")
if q1.lower() == 'fight' or '3':
if q2.lower() == 'supernatural' or '1' or 'humans' or '2':
if q3.lower() == 'action' or '1' or 'drama' or '3':
if q4.lower() == 'eccentric' or '3' or 'casual' or '2':
if q5.lower() == 'bow and arrows' or 'bow' or 'arrows' or '2':
if q6.lower() == 'super strength' or 'super' or 'strength' or '1':
print("Your television show is... Arrow!")
if q1.lower() == 'fight' or '3':
if q2.lower() == 'supernatural' or '1':
if q3.lower() == 'drama' or '3' or 'horror' or '4':
if q4.lower() == 'trendy' or '1':
if q5.lower() == 'my teeth' or 'teeth' or '3':
if q6.lower() == 'immortality' or '7':
print("Your television show is... Vampire Diaries!")
elif response.lower() == 'no':
print("Goodbye then.")
else:
print("Please come back when you're not such a child.")
</code></pre>
| 0debug
|
REIMPLEMENTING SPLIT FUNCTION IN C : How can i rewrite the following code into the one below but be able to can the delimiter on each call to the function. I am trying to split line into an array of char*
CODE 1:
```
char *split(const char *string)
{
char *words[MAX_LENGTH / 2];
char *word = (char *)calloc(MAX_WORD, sizeof(char));
memset(word, ' ', sizeof(char));
static int index = 0;
int line_index = 0;
int word_index =0;
while (string[line_index] != '\n')
{
const char c = string[line_index];
if (c == ' ')
{
word[word_index+ 1] = '\0';
memcpy(words+index,&word,sizeof(word));
index+=1;
if(word!=NULL)
{
free(word);
char *word = (char *)calloc(MAX_WORD,sizeof(char));
memset(word, ' ', sizeof(char));
}
++line_index;
word_index =0;
continue;
}
if (c == '\t')
continue;
if (c == '.')
continue;
if (c == ',')
continue;
word[word_index] = c;
++word_index;
++line_index;
}
index =0;
if(word!=NULL)
{
free(word);
}
return *words;
}
```
CODE 2:
```
char **split(char *string)
{
static char *words[MAX_LENGTH / 2];
static int index = 0;
// resetting words
for (int i = 0; i < sizeof(words) / sizeof(words[0]); i++)
{
words[i] = NULL;
}
const char *delimiter = " ";
char *ptr = strtok(string, delimiter);
while (ptr != NULL)
{
words[index] = ptr;
ptr = strtok(NULL, delimiter);
++index;
}
index = 0;
return words;
}
```
However i noticed that the memory of word+index is been reassigned to the same location thereby causing word duplication .
| 0debug
|
Visitor *visitor_input_test_init(TestInputVisitorData *data,
const char *json_string, ...)
{
Visitor *v;
va_list ap;
va_start(ap, json_string);
data->obj = qobject_from_jsonv(json_string, &ap);
va_end(ap);
g_assert(data->obj != NULL);
data->qiv = qmp_input_visitor_new(data->obj);
g_assert(data->qiv != NULL);
v = qmp_input_get_visitor(data->qiv);
g_assert(v != NULL);
return v;
}
| 1threat
|
Automatic page refresh once per day : <p>I want to refresh the page automatically once per day. I tried the following code:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><meta http-equiv="refresh" content="86400"></code></pre>
</div>
</div>
</p>
<p>and tried with some javascript code also.But nothing is working. So anybody guide me to do this.</p>
| 0debug
|
static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *restrict pixels,
int line_size)
{
int i;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
for(i=0;i<2;i++) {
pixels[0] = cm[block[0]];
pixels[1] = cm[block[1]];
pixels += line_size;
block += 8;
}
}
| 1threat
|
How to resolve modulus/division by zero error in python : <p>I am struggling to debug the following code, which throws a ZeroDivisionError:</p>
<pre><code>if num > 0:
return filter(lambda x: abs(num) % x == 0, range(1:abs(num))
else:
pass
</code></pre>
<p>The error message is: </p>
<pre><code>ZeroDivisionError: integer division or modulo by zero
</code></pre>
<p>The code is a bit ugly because I was getting this error before adding the if and abs() statements.</p>
<p>I am using python 3.6 per my schools requirement, and the task is to return factors of int <code>num</code> using a filter. </p>
| 0debug
|
Checking if command line arguments are empty/null : <p>If i am providing two arguments over the command line args[0] and args[1]. How do individually check if either of the arguments are empty/null? </p>
| 0debug
|
Cannot update xcode on AppStore : <p>I just upgraded from Sierra to High Sierra And I met this problem which is i cannot Update xcode. When i click on update it shows loading symbol on top starts animating and nothing happen.</p>
<p><a href="https://i.stack.imgur.com/gNLrS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/gNLrS.png" alt="enter image description here"></a></p>
<p>I tried this:</p>
<pre><code>sudo defaults delete /Library/Preferences/com.apple.SoftwareUpdate.plist RecommendedUpdates
sudo defaults delete /Library/Preferences/com.apple.SoftwareUpdate.plist DidRegisterLocalUpdates
sudo rm /Library/Updates
rm -rf ~/Library/Caches/com.apple.SoftwareUpdate/
</code></pre>
<p>Any help?</p>
| 0debug
|
How to arrange data zigzag way from one column. : All data in one column and needs to be arranged in zigzag way...
Data column
1
2
3
4
5
6
Final Output
1 2 3
4 5 6
Is this possible?
Many Thanks
| 0debug
|
utilize 100% discount voucher in stripe account : If we are using 100% discount voucher code and price gets 0 and needs to be processed via stripe how can we do it? Or via subscriptions that are free how to do it?
| 0debug
|
detect windows change at visual basic : How can i detect a window change (or form defocus)?
I have 1 picturebox, & 1 label (not visible) above the picturebox with text "UNAUTHORIZED COPY"
the question is: **how to make it visible if the window, or form gets defocused or when the user open another program.** But Focus is property for "controls" but not for forms, then there is not easy way.
Additionally my program already clear the clipboard when detect the printscreen key to avoid the most common snapshot from any windows user, i just want to add now this watermark text for use of third party screen capture software.
| 0debug
|
C/C++ Functions - How are prototypes allowed? : <p>Title.</p>
<p>Assuming(<em>because, as a beginner, I'm not sure</em>) a source code is read from top to bottom by the compiler. How does the compiler understand what actions are supposed to be performed when a function is called in the main function, if the said called function is not yet defined?</p>
<p>Thanks.</p>
| 0debug
|
Package signatures do not match the previously installed version : <p>This my project: <a href="https://github.com/kenpeter/my_hak_news" rel="noreferrer">https://github.com/kenpeter/my_hak_news</a>, which is a direct copy of <a href="https://github.com/grigio/HAgnostic-News" rel="noreferrer">https://github.com/grigio/HAgnostic-News</a>.</p>
<p>Git clone <a href="https://github.com/kenpeter/my_hak_news" rel="noreferrer">https://github.com/kenpeter/my_hak_news</a>, then run <code>react-native run-android</code></p>
<p>Got this error:</p>
<pre><code>* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.hagnosticnews signatures do not match the previously installed version; ignoring!
</code></pre>
<p>Relevant issue: <a href="https://github.com/grigio/HAgnostic-News/issues/1" rel="noreferrer">https://github.com/grigio/HAgnostic-News/issues/1</a>, I follow various ways, but not able to resolve this issue.</p>
| 0debug
|
Easy java for loop : This code prints yup to every second char(1,3,5,7,9..). Now I'm having a problem because I need also print a word for example " yap " to every fifth char(4,9,14,19...). So every tenth is yup yap etc... Appreciate if you have any hints or solution. Thank you for help!
for(int i = 0; i < word.length(); i++){
if( i % 2 != 0 && i > 0) {
System.out.print(word.charAt(i) + " yup");
System.out.println();
}
else{
System.out.println(word.charAt(i));
}
}
| 0debug
|
i am new in open cv. im trying to save the detected object into a new image.what will i do : import cv2
import numpy as np
tric_cascade = cv2.CascadeClassifier('cascade.xml')
img = cv2.imread('anthon18c.png')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
tric = tric_cascade.detectMultiScale(gray,1.01,7)
for (x,y,w,h) in tric:
img = cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
cv2.imshow('img', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
this is the code I copied from a tutorial.
| 0debug
|
make_setup_request (AVFormatContext *s, const char *host, int port,
int lower_transport, const char *real_challenge)
{
RTSPState *rt = s->priv_data;
int j, i, err;
RTSPStream *rtsp_st;
RTSPHeader reply1, *reply = &reply1;
char cmd[2048];
const char *trans_pref;
if (rt->server_type == RTSP_SERVER_REAL)
trans_pref = "x-pn-tng";
else
trans_pref = "RTP/AVP";
for(j = RTSP_RTP_PORT_MIN, i = 0; i < rt->nb_rtsp_streams; ++i) {
char transport[2048];
rtsp_st = rt->rtsp_streams[i];
if (lower_transport == RTSP_LOWER_TRANSPORT_UDP) {
char buf[256];
if (RTSP_RTP_PORT_MIN != 0) {
while(j <= RTSP_RTP_PORT_MAX) {
snprintf(buf, sizeof(buf), "rtp:
j += 2;
if (url_open(&rtsp_st->rtp_handle, buf, URL_RDWR) == 0) {
goto rtp_opened;
}
}
}
rtp_opened:
port = rtp_get_local_port(rtsp_st->rtp_handle);
snprintf(transport, sizeof(transport) - 1,
"%s/UDP;unicast;client_port=%d",
trans_pref, port);
if (rt->server_type == RTSP_SERVER_RTP)
av_strlcatf(transport, sizeof(transport), "-%d", port + 1);
}
else if (lower_transport == RTSP_LOWER_TRANSPORT_TCP) {
snprintf(transport, sizeof(transport) - 1,
"%s/TCP", trans_pref);
}
else if (lower_transport == RTSP_LOWER_TRANSPORT_UDP_MULTICAST) {
snprintf(transport, sizeof(transport) - 1,
"%s/UDP;multicast", trans_pref);
}
if (rt->server_type == RTSP_SERVER_REAL)
av_strlcat(transport, ";mode=play", sizeof(transport));
snprintf(cmd, sizeof(cmd),
"SETUP %s RTSP/1.0\r\n"
"Transport: %s\r\n",
rtsp_st->control_url, transport);
if (i == 0 && rt->server_type == RTSP_SERVER_REAL) {
char real_res[41], real_csum[9];
ff_rdt_calc_response_and_checksum(real_res, real_csum,
real_challenge);
av_strlcatf(cmd, sizeof(cmd),
"If-Match: %s\r\n"
"RealChallenge2: %s, sd=%s\r\n",
rt->session_id, real_res, real_csum);
}
rtsp_send_cmd(s, cmd, reply, NULL);
if (reply->status_code == 461 && i == 0) {
err = 1;
goto fail;
} else if (reply->status_code != RTSP_STATUS_OK ||
reply->nb_transports != 1) {
err = AVERROR_INVALIDDATA;
goto fail;
}
if (i > 0) {
if (reply->transports[0].lower_transport != rt->lower_transport) {
err = AVERROR_INVALIDDATA;
goto fail;
}
} else {
rt->lower_transport = reply->transports[0].lower_transport;
}
if (reply->transports[0].lower_transport != RTSP_LOWER_TRANSPORT_UDP &&
(lower_transport == RTSP_LOWER_TRANSPORT_UDP)) {
url_close(rtsp_st->rtp_handle);
rtsp_st->rtp_handle = NULL;
}
switch(reply->transports[0].lower_transport) {
case RTSP_LOWER_TRANSPORT_TCP:
rtsp_st->interleaved_min = reply->transports[0].interleaved_min;
rtsp_st->interleaved_max = reply->transports[0].interleaved_max;
break;
case RTSP_LOWER_TRANSPORT_UDP:
{
char url[1024];
snprintf(url, sizeof(url), "rtp:
host, reply->transports[0].server_port_min);
if (rtp_set_remote_url(rtsp_st->rtp_handle, url) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
}
break;
case RTSP_LOWER_TRANSPORT_UDP_MULTICAST:
{
char url[1024];
struct in_addr in;
in.s_addr = htonl(reply->transports[0].destination);
snprintf(url, sizeof(url), "rtp:
inet_ntoa(in),
reply->transports[0].port_min,
reply->transports[0].ttl);
if (url_open(&rtsp_st->rtp_handle, url, URL_RDWR) < 0) {
err = AVERROR_INVALIDDATA;
goto fail;
}
}
break;
}
if ((err = rtsp_open_transport_ctx(s, rtsp_st)))
goto fail;
}
if (rt->server_type == RTSP_SERVER_REAL)
rt->need_subscription = 1;
return 0;
fail:
for (i=0; i<rt->nb_rtsp_streams; i++) {
if (rt->rtsp_streams[i]->rtp_handle) {
url_close(rt->rtsp_streams[i]->rtp_handle);
rt->rtsp_streams[i]->rtp_handle = NULL;
}
}
return err;
}
| 1threat
|
R gsub stringi, stringr misunderstanding : I don't seem to understand gsub or stringr.
Example:
> a<- "a book"
> gsub(" ", ".", a)
[1] "a.book"
Okay. BUT:
> a<-"a.book"
> gsub(".", " ", a)
[1] " "
I would of expected
>"a book"
I'm replacing the full stop with a space.
Also: `srintr`: `str_replace(a, ".", " ")` returns:
`" .book"`
and `str_replace_all(a, ".", " ")` returns
`" "`
I can use `stringi`: `stri_replace(a, " ", fixed=".")`:
`"a book"`
I'm just wondering why gsub (and str_replace) don't act as I'd have expected. They work when replacing a space with another character, but not the other way around.
| 0debug
|
X axis with Python : Hello I have this code :
import numpy as np
import pylab as plt
a = np.array([1,2,3,4,5,6,7,8,9,10])
b = np.exp(a)
plt.plot(a,b,'.')
plt.show()
But the problem is that I don't want to see in the x axis 1,2,3,4,5,6,7,8,9,10 I would like to see 10^1, 10^2, 10^3,...,10^10
How can I do to do this ?
Thank you !
| 0debug
|
AVBitStreamFilterContext *av_bitstream_filter_init(const char *name){
AVBitStreamFilter *bsf= first_bitstream_filter;
while(bsf){
if(!strcmp(name, bsf->name)){
AVBitStreamFilterContext *bsfc= av_mallocz(sizeof(AVBitStreamFilterContext));
bsfc->filter= bsf;
bsfc->priv_data= av_mallocz(bsf->priv_data_size);
return bsfc;
}
bsf= bsf->next;
}
return NULL;
}
| 1threat
|
how to assign class of html element to a javascript variable : I am passing a javascript variable "name" to the following function.
function addCategory(name){
$("#myTable").append('<tr class=name><td>'+name+'</td><td><a onclick="" type="button" class="btn btn-xs" ><i class="glyphicon glyphicon-erase"></i></a></td></tr>');
$('#postcat')[0].reset();
}
now suppose the name variable contains the value "general". I want the class name to be general and not name. How should I do it?
| 0debug
|
multiple variables in list comprehension? : <p>I want to create a list of lists from a list of multi-field strings and wonder if it is possible to do so in a comprehension.</p>
<p>Input:</p>
<pre><code>inputs = ["1, foo, bar", "2, tom, jerry"]
</code></pre>
<p>Desired output:</p>
<pre><code>[[1, "foo", "bar"], [2, "tom", "jerry"]]
</code></pre>
<p>Splitting the string in a comprehension is easy:</p>
<pre><code>>>> [s.split(",") for s in inputs]
[['1', ' foo', ' bar'], ['2', ' tom', ' jerry']]
</code></pre>
<p>But I'm having trouble figuring out how to access the columns after the string has been split inside the comprehension, because it would seem to require a variable assignment. The following are not valid Python, but illustrate what I'm looking for:</p>
<pre><code>[[int(x), y.strip(), z.strip() for x,y,z = s.split(",")] for s in inputs]
or
[[int(v[0]), v[1].strip(), v[2].strip() for v = s.split(",")] for s in inputs]
</code></pre>
<p>Is there a way to assign variables inside a comprehension so that the output can be composed of functions of the variables? A loop is trivial, but generating a list by transforming inputs sure seems like a "comprehension-ish" task.</p>
<pre><code>outputs = []
for s in inputs:
x,y,z = s.split(",")
outputs.append([int(x), y.strip(), z.strip()])
</code></pre>
| 0debug
|
Removing the 1st element then 1st and 2nd element from a list of lists : <p>My aim is to remove the 1st element of a list and then the first and second element of a list etc. So a list entered like this: <code>[[1,1],[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[3,2],[3,3]]</code> will return a list like this: <code>[[1,2],[1,3],[2,3]</code>
I have tried many things but none work well</p>
| 0debug
|
Multiple contentEditable, unable to move carret to end of span with arrow keys : <p>I have multiple spans with content editable property set to true, like this: </p>
<pre><code><span contentEditable='true'> value</span><span contentEditable='true'> value</span><span contentEditable='true'> value</span>
</code></pre>
<p><a href="https://jsfiddle.net/du7g39cz/" rel="noreferrer">https://jsfiddle.net/du7g39cz/</a></p>
<p>Problem is that when I am using arrow keys to navigate around span element, i can not reach end of individual span as blur event gets called when carret reaches last symbol. </p>
<p>I can reproduce this behavior on all browsers apart MS Edge. </p>
<p>I must note that I wouldn't like to keep only one content editable parent, as this would easily let user to delete whole paragraph, intenion is to let user edit only one word at a time. </p>
| 0debug
|
PHP/cURL - Trying to get the text only from a specifc table row : Here is my code:
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$url = 'https://www.fibank.bg/bg/valutni-kursove/page/461';
$curl = curl_init();
curl_setopt($curl, CURLOPT_COOKIE, "ChosenSite=www; SportsDirect_AnonymousUserCurrency=GBP; language=en-GB");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSLVERSION, 3);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
curl_setopt($curl, CURLOPT_VERBOSE, true);
$str = curl_exec($curl);
curl_close($curl);
libxml_use_internal_errors(true);
$doc = new \DOMDocument();
$doc->loadHTML($str);
$xpath = new \DOMXpath($doc);
$value = $xpath->query('//td[em="GBP"]/parent::tr/td[last()]')->item(0)->nodeValue;
print_r($value);
With this code i am trying to parse the URL and get the line from the table which contains `GBP` and the get the text from the last `td`.
However my code seems to be not working.
Where is my mistake and how can i fix it?
Thanks in advance!
| 0debug
|
Git failed with a > fatal error. could not read Username for : <p>I've been struggling with that issue for a couple days now. </p>
<p>I'm unable to connect to my Git project (stored in VisualStudio.com) from a specific computer (it works on my second PC). Whenever I try to Sync or Clone my repository, VS2017 asks for my user credentials (twice) and the I get the following error : </p>
<blockquote>
<p>Error: cannot spawn askpass: No such file or directory Error
encountered while cloning the remote repository: Git failed with a
fatal error. could not read Username for
'https://.visualstudio.com': terminal prompts disabled</p>
</blockquote>
<p>Can't remember if I changed anything that could've caused that...</p>
| 0debug
|
Right way to handle navigation using BLoC : <p>Hello guys I'm using BLoC for app I'm currently developing but there some cases which I'm clueless like when you do login you fire API call and wait for result naturally I would send loading state and show loader but after
that finishes how to handle for example navigating to different screen.
I've currently have something like this</p>
<pre><code>typedef void LoginSuccessCallback();
class LoginBloc(){
LoginBloc(Api this.api,LoginSuccessCallback loginSuccesCallback){
_login.switchMap((ev) => api.login(ev.payload.email,ev.payload.password)).listen((_) => loginSuccessCallback);
}
}
</code></pre>
<p>But I'm sure there is much cleaner way for handling this I've tried to search some samples which have something similar but couldn't find anything.</p>
| 0debug
|
Resolve axios to a variable instead of doing everything in the callback : <p>So I am 99% sure this cannot be done, but humor me for a moment. Consider the two functions:</p>
<pre><code>function doAjaxCall(fieldTocheckAgainst, currentField, value) {
axios.get(
window.location.origin +
'/api/clinic/'+window.id+'/patient/'+window.secondId+'/field-validation',
{
params: {
field_to_check_against: fieldTocheckAgainst,
current_field: currentField,
value: moment(value).format('YYYY-MM-DD')
}
}
).then((result) => {
return result.data
});
}
async function resolveAjaxCall(fieldTocheckAgainst, currentField, value) {
const result = await doAjaxCall(fieldTocheckAgainst, currentField, value)
console.log(result);
}
</code></pre>
<p>I am attempting to resolve the axios ajax call into a variable based on what I saw <a href="https://stackoverflow.com/a/43371957/1270259">here</a> and it doesn't work. I get <code>undefined</code>.</p>
<p>I understand when it comes to callbacks, everything has to be done in the callback, but is there no way, with async and await to resolve the promise to a variable as I am attempting to do, to then use said variable else where?</p>
<p><strong>Or am I just going to be stuck with callbacks?</strong> </p>
| 0debug
|
How to create dynamic plots to display on Flask? : <p>I wish to create dynamic plots based on user input on a flask app. However I am getting the following error:
string argument expected, got 'bytes'</p>
<p>If I use io.BytesIO(), I am not getting this error, but I am not getting the plot on test.html</p>
<pre><code>from flask import Flask
from flask import render_template
import matplotlib.pyplot as plt
import io
import base64
app = Flask(__name__)
@app.route('/plot')
def build_plot():
img = io.StringIO()
y = [1,2,3,4,5]
x = [0,2,1,3,4]
plt.plot(x,y)
plt.savefig(img, format='png')
img.seek(0)
plot_url = base64.b64encode(img.getvalue())
return render_template('test.html', plot_url=plot_url)
if __name__ == '__main__':
app.debug = True
app.run()
</code></pre>
<p>Test.html</p>
<pre><code><!DOCTYPE html>
<html>
<title> Plot</title>
<body>
<img src="data:image/png;base64, {{ plot_url }}">
</body>
</html>
</code></pre>
| 0debug
|
static int gdb_handle_packet(GDBState *s, CPUState *env, const char *line_buf)
{
const char *p;
int ch, reg_size, type;
char buf[MAX_PACKET_LENGTH];
uint8_t mem_buf[MAX_PACKET_LENGTH];
uint8_t *registers;
target_ulong addr, len;
#ifdef DEBUG_GDB
printf("command='%s'\n", line_buf);
#endif
p = line_buf;
ch = *p++;
switch(ch) {
case '?':
snprintf(buf, sizeof(buf), "S%02x", SIGTRAP);
put_packet(s, buf);
cpu_breakpoint_remove_all(env);
cpu_watchpoint_remove_all(env);
break;
case 'c':
if (*p != '\0') {
addr = strtoull(p, (char **)&p, 16);
#if defined(TARGET_I386)
env->eip = addr;
#elif defined (TARGET_PPC)
env->nip = addr;
#elif defined (TARGET_SPARC)
env->pc = addr;
env->npc = addr + 4;
#elif defined (TARGET_ARM)
env->regs[15] = addr;
#elif defined (TARGET_SH4)
env->pc = addr;
#elif defined (TARGET_MIPS)
env->active_tc.PC = addr;
#elif defined (TARGET_CRIS)
env->pc = addr;
#endif
}
gdb_continue(s);
return RS_IDLE;
case 'C':
s->signal = strtoul(p, (char **)&p, 16);
gdb_continue(s);
return RS_IDLE;
case 'k':
fprintf(stderr, "\nQEMU: Terminated via GDBstub\n");
exit(0);
case 'D':
cpu_breakpoint_remove_all(env);
cpu_watchpoint_remove_all(env);
gdb_continue(s);
put_packet(s, "OK");
break;
case 's':
if (*p != '\0') {
addr = strtoull(p, (char **)&p, 16);
#if defined(TARGET_I386)
env->eip = addr;
#elif defined (TARGET_PPC)
env->nip = addr;
#elif defined (TARGET_SPARC)
env->pc = addr;
env->npc = addr + 4;
#elif defined (TARGET_ARM)
env->regs[15] = addr;
#elif defined (TARGET_SH4)
env->pc = addr;
#elif defined (TARGET_MIPS)
env->active_tc.PC = addr;
#elif defined (TARGET_CRIS)
env->pc = addr;
#endif
}
cpu_single_step(env, sstep_flags);
gdb_continue(s);
return RS_IDLE;
case 'F':
{
target_ulong ret;
target_ulong err;
ret = strtoull(p, (char **)&p, 16);
if (*p == ',') {
p++;
err = strtoull(p, (char **)&p, 16);
} else {
err = 0;
}
if (*p == ',')
p++;
type = *p;
if (gdb_current_syscall_cb)
gdb_current_syscall_cb(s->env, ret, err);
if (type == 'C') {
put_packet(s, "T02");
} else {
gdb_continue(s);
}
}
break;
case 'g':
len = 0;
for (addr = 0; addr < num_g_regs; addr++) {
reg_size = gdb_read_register(env, mem_buf + len, addr);
len += reg_size;
}
memtohex(buf, mem_buf, len);
put_packet(s, buf);
break;
case 'G':
registers = mem_buf;
len = strlen(p) / 2;
hextomem((uint8_t *)registers, p, len);
for (addr = 0; addr < num_g_regs && len > 0; addr++) {
reg_size = gdb_write_register(env, registers, addr);
len -= reg_size;
registers += reg_size;
}
put_packet(s, "OK");
break;
case 'm':
addr = strtoull(p, (char **)&p, 16);
if (*p == ',')
p++;
len = strtoull(p, NULL, 16);
if (cpu_memory_rw_debug(env, addr, mem_buf, len, 0) != 0) {
put_packet (s, "E14");
} else {
memtohex(buf, mem_buf, len);
put_packet(s, buf);
}
break;
case 'M':
addr = strtoull(p, (char **)&p, 16);
if (*p == ',')
p++;
len = strtoull(p, (char **)&p, 16);
if (*p == ':')
p++;
hextomem(mem_buf, p, len);
if (cpu_memory_rw_debug(env, addr, mem_buf, len, 1) != 0)
put_packet(s, "E14");
else
put_packet(s, "OK");
break;
case 'p':
if (!gdb_has_xml)
goto unknown_command;
addr = strtoull(p, (char **)&p, 16);
reg_size = gdb_read_register(env, mem_buf, addr);
if (reg_size) {
memtohex(buf, mem_buf, reg_size);
put_packet(s, buf);
} else {
put_packet(s, "E14");
}
break;
case 'P':
if (!gdb_has_xml)
goto unknown_command;
addr = strtoull(p, (char **)&p, 16);
if (*p == '=')
p++;
reg_size = strlen(p) / 2;
hextomem(mem_buf, p, reg_size);
gdb_write_register(env, mem_buf, addr);
put_packet(s, "OK");
break;
case 'Z':
type = strtoul(p, (char **)&p, 16);
if (*p == ',')
p++;
addr = strtoull(p, (char **)&p, 16);
if (*p == ',')
p++;
len = strtoull(p, (char **)&p, 16);
switch (type) {
case 0:
case 1:
if (cpu_breakpoint_insert(env, addr) < 0)
goto breakpoint_error;
put_packet(s, "OK");
break;
#ifndef CONFIG_USER_ONLY
case 2:
type = PAGE_WRITE;
goto insert_watchpoint;
case 3:
type = PAGE_READ;
goto insert_watchpoint;
case 4:
type = PAGE_READ | PAGE_WRITE;
insert_watchpoint:
if (cpu_watchpoint_insert(env, addr, type) < 0)
goto breakpoint_error;
put_packet(s, "OK");
break;
#endif
default:
put_packet(s, "");
break;
}
break;
breakpoint_error:
put_packet(s, "E22");
break;
case 'z':
type = strtoul(p, (char **)&p, 16);
if (*p == ',')
p++;
addr = strtoull(p, (char **)&p, 16);
if (*p == ',')
p++;
len = strtoull(p, (char **)&p, 16);
if (type == 0 || type == 1) {
cpu_breakpoint_remove(env, addr);
put_packet(s, "OK");
#ifndef CONFIG_USER_ONLY
} else if (type >= 2 || type <= 4) {
cpu_watchpoint_remove(env, addr);
put_packet(s, "OK");
#endif
} else {
put_packet(s, "");
}
break;
case 'q':
case 'Q':
if (!strcmp(p,"qemu.sstepbits")) {
snprintf(buf, sizeof(buf), "ENABLE=%x,NOIRQ=%x,NOTIMER=%x",
SSTEP_ENABLE,
SSTEP_NOIRQ,
SSTEP_NOTIMER);
put_packet(s, buf);
break;
} else if (strncmp(p,"qemu.sstep",10) == 0) {
p += 10;
if (*p != '=') {
snprintf(buf, sizeof(buf), "0x%x", sstep_flags);
put_packet(s, buf);
break;
}
p++;
type = strtoul(p, (char **)&p, 16);
sstep_flags = type;
put_packet(s, "OK");
break;
}
#ifdef CONFIG_LINUX_USER
else if (strncmp(p, "Offsets", 7) == 0) {
TaskState *ts = env->opaque;
snprintf(buf, sizeof(buf),
"Text=" TARGET_ABI_FMT_lx ";Data=" TARGET_ABI_FMT_lx
";Bss=" TARGET_ABI_FMT_lx,
ts->info->code_offset,
ts->info->data_offset,
ts->info->data_offset);
put_packet(s, buf);
break;
}
#endif
if (strncmp(p, "Supported", 9) == 0) {
sprintf(buf, "PacketSize=%x", MAX_PACKET_LENGTH);
#ifdef GDB_CORE_XML
strcat(buf, ";qXfer:features:read+");
#endif
put_packet(s, buf);
break;
}
#ifdef GDB_CORE_XML
if (strncmp(p, "Xfer:features:read:", 19) == 0) {
const char *xml;
target_ulong total_len;
gdb_has_xml = 1;
p += 19;
xml = get_feature_xml(env, p, &p);
if (!xml) {
sprintf(buf, "E00");
put_packet(s, buf);
break;
}
if (*p == ':')
p++;
addr = strtoul(p, (char **)&p, 16);
if (*p == ',')
p++;
len = strtoul(p, (char **)&p, 16);
total_len = strlen(xml);
if (addr > total_len) {
sprintf(buf, "E00");
put_packet(s, buf);
break;
}
if (len > (MAX_PACKET_LENGTH - 5) / 2)
len = (MAX_PACKET_LENGTH - 5) / 2;
if (len < total_len - addr) {
buf[0] = 'm';
len = memtox(buf + 1, xml + addr, len);
} else {
buf[0] = 'l';
len = memtox(buf + 1, xml + addr, total_len - addr);
}
put_packet_binary(s, buf, len + 1);
break;
}
#endif
goto unknown_command;
default:
unknown_command:
buf[0] = '\0';
put_packet(s, buf);
break;
}
return RS_IDLE;
}
| 1threat
|
How does Heroku billing dynos work exactly? : <p>I was trying to understand the Heroku pricing system.
Okay so the free account receives 1000 dyno/hour. What's the exact meaning of a dyno/hour? It depends on what? Requests per seconds? Number of users?
If i want to switch to the non sleeping offer, i'll have to pay 7$ per dyno. So the 1000 free dynos will cost me 7000$ per month?
How many users approximately does 1000 dyno/month support?
Thanks.</p>
| 0debug
|
Debugging Groovy scripted pipelines in Jenkins : <p>I'm developing Jenkins pipelines as Groovy scripts (scripted pipelines, not declarative), and having a real hard time. Jenkins is always very generic regarding syntax/semantic errors, outputting stacks like below:</p>
<pre><code>groovy.lang.MissingPropertyException: No such property: caughtError for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
at
</code></pre>
<p>So I have to figure where the error is completely by myself, inspecting line per line of code.
Is there a better way to debug it? What you guys use to do?</p>
| 0debug
|
int css_do_rsch(SubchDev *sch)
{
SCSW *s = &sch->curr_status.scsw;
PMCW *p = &sch->curr_status.pmcw;
int ret;
if (!(p->flags & (PMCW_FLAGS_MASK_DNV | PMCW_FLAGS_MASK_ENA))) {
ret = -ENODEV;
goto out;
}
if (s->ctrl & SCSW_STCTL_STATUS_PEND) {
ret = -EINPROGRESS;
goto out;
}
if (((s->ctrl & SCSW_CTRL_MASK_FCTL) != SCSW_FCTL_START_FUNC) ||
(s->ctrl & SCSW_ACTL_RESUME_PEND) ||
(!(s->ctrl & SCSW_ACTL_SUSP))) {
ret = -EINVAL;
goto out;
}
if (channel_subsys.chnmon_active) {
css_update_chnmon(sch);
}
s->ctrl |= SCSW_ACTL_RESUME_PEND;
do_subchannel_work(sch, NULL);
ret = 0;
out:
return ret;
}
| 1threat
|
How and where to add code to make a website responsive fit to all screen? : <h2>I have a quite dynamic file and trying to make this <a href="http://bunnymugsy.xyz" rel="nofollow">web</a> responsive, fit to all screen... can anybody help?</h2>
<p>I tried with skeleton css and also tried with different coding, but all failed. Since I started with Stacey Template in early time, it's quite tricky for me to handle it with basic knowledge of HTML&CSS.</p>
<p>Many thanks!</p>
| 0debug
|
Split a list into sublists based on a condition with Stream api : <p>I have a specific question. There are some similar questions but these are either with Python, not with Java, or the requirements are different even if the question sounds similar. </p>
<p>I have a list of values.</p>
<pre><code>List1 = {10, -2, 23, 5, -11, 287, 5, -99}
</code></pre>
<p>At the end of the day, I would like to split lists based on their values. I mean if the value is bigger than zero, it will be stay in the original list and the corresponding index in the negative values list will be set zero. If the value is smaller than zero, it will go to the negative values list and the negative values in the original list will be replaced with zero.</p>
<p>The resulting lists should be like that;</p>
<pre><code>List1 = {10, 0, 23, 5, 0, 287, 5, 0}
List2 = {0, -2, 0, 0, -11, 0, 0, -99}
</code></pre>
<p>Is there any way to solve this with Stream api in Java?</p>
| 0debug
|
Checkbox checked if boolean is true with Angular2 : <p>I would like to know how to make a checkbox checked if the value is true, and unchecked if false with <code>Angular2</code>.</p>
<pre><code>Adult <input type="checkbox" value="{{person.is_adult}}">
</code></pre>
<p>{{person.is_adult}} is a <code>boolean</code></p>
<p>Can someone please suggest anything? Thanks</p>
| 0debug
|
Is it possible to run a .NET Core app as Windows Service AND Linux deamon : <p>Is it possible to, using the same code, create an .NET Core application that can be run as a windows service and as a deamon on linux?</p>
<p>Do you have an example/proof of concept?</p>
| 0debug
|
powershell is detecting syntax error that's right : I'm watching this youtube tutorial on how to make a video game, and now we're converting it to exe, and this is my setup code to convert the game to exe (not the game's code itself):
import cx_Freeze
executables = [cx_Freeze.Executable("pygame sentdex.py")]
cx_Freeze.setup(
name="A bit racey",
options={"build_exe": {"packages":["pygame"],
"include_files":["car.png"]}} #if you have other included files put them here. like fonts.
executables = executables)
When I use windows power shell to try convert, this happens:
PS C:\Users\Damon Tattersfield\Desktop\video game\code\python codes> python setup.py build
File "setup.py", line 9
executables = executables)
^
SyntaxError: invalid syntax
PS C:\Users\Damon Tattersfield\Desktop\video game\code\python codes>
it keeps saying the e in executables is wrong, even though it works fine for the youtuber, and I've changed it to capitol e, removed, retyped it, but it's saying it's a syntax error, when I'm 99% sure it's not.
this is the youtubers link by the way: https://www.youtube.com/watch?list=PLQVvvaa0QuDdLkP8MrOXLe_rKuf6r80KO&v=EY6ZCPxqEtM
How do I fix?
thanks...
| 0debug
|
void ff_vc1dsp_init(DSPContext* dsp, AVCodecContext *avctx) {
dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;
dsp->vc1_h_overlap = vc1_h_overlap_c;
dsp->vc1_v_overlap = vc1_v_overlap_c;
dsp->vc1_loop_filter = vc1_loop_filter;
dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_c;
dsp->put_vc1_mspel_pixels_tab[ 1] = put_vc1_mspel_mc10_c;
dsp->put_vc1_mspel_pixels_tab[ 2] = put_vc1_mspel_mc20_c;
dsp->put_vc1_mspel_pixels_tab[ 3] = put_vc1_mspel_mc30_c;
dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_c;
dsp->put_vc1_mspel_pixels_tab[ 5] = put_vc1_mspel_mc11_c;
dsp->put_vc1_mspel_pixels_tab[ 6] = put_vc1_mspel_mc21_c;
dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_c;
dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_c;
dsp->put_vc1_mspel_pixels_tab[ 9] = put_vc1_mspel_mc12_c;
dsp->put_vc1_mspel_pixels_tab[10] = put_vc1_mspel_mc22_c;
dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_c;
dsp->put_vc1_mspel_pixels_tab[12] = put_vc1_mspel_mc03_c;
dsp->put_vc1_mspel_pixels_tab[13] = put_vc1_mspel_mc13_c;
dsp->put_vc1_mspel_pixels_tab[14] = put_vc1_mspel_mc23_c;
dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_c;
dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_c;
dsp->avg_vc1_mspel_pixels_tab[ 1] = avg_vc1_mspel_mc10_c;
dsp->avg_vc1_mspel_pixels_tab[ 2] = avg_vc1_mspel_mc20_c;
dsp->avg_vc1_mspel_pixels_tab[ 3] = avg_vc1_mspel_mc30_c;
dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_c;
dsp->avg_vc1_mspel_pixels_tab[ 5] = avg_vc1_mspel_mc11_c;
dsp->avg_vc1_mspel_pixels_tab[ 6] = avg_vc1_mspel_mc21_c;
dsp->avg_vc1_mspel_pixels_tab[ 7] = avg_vc1_mspel_mc31_c;
dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_c;
dsp->avg_vc1_mspel_pixels_tab[ 9] = avg_vc1_mspel_mc12_c;
dsp->avg_vc1_mspel_pixels_tab[10] = avg_vc1_mspel_mc22_c;
dsp->avg_vc1_mspel_pixels_tab[11] = avg_vc1_mspel_mc32_c;
dsp->avg_vc1_mspel_pixels_tab[12] = avg_vc1_mspel_mc03_c;
dsp->avg_vc1_mspel_pixels_tab[13] = avg_vc1_mspel_mc13_c;
dsp->avg_vc1_mspel_pixels_tab[14] = avg_vc1_mspel_mc23_c;
dsp->avg_vc1_mspel_pixels_tab[15] = avg_vc1_mspel_mc33_c;
}
| 1threat
|
If the blue part of a RGB value were set to 0, how many : If the blue part of a RGB value were set to 0, how many color choices do I still have available by changing the other components of the RGB value?
| 0debug
|
How can I use a pre-trained neural network with grayscale images? : <p>I have a dataset containing grayscale images and I want to train a state-of-the-art CNN on them. I'd very much like to fine-tune a pre-trained model (like the ones <a href="https://github.com/tensorflow/models/tree/master/research/slim#Pretrained" rel="noreferrer">here</a>).</p>
<p>The problem is that almost all models I can find the weights for have been trained on the ImageNet dataset, which contains RGB images.</p>
<p>I can't use one of those models because their input layer expects a batch of shape <code>(batch_size, height, width, 3)</code> or <code>(64, 224, 224, 3)</code> in my case, but my images batches are <code>(64, 224, 224)</code>.</p>
<p>Is there any way that I can use one of those models? I've thought of dropping the input layer after I've loaded the weights and adding my own (like we do for the top layers). Is this approach correct?</p>
| 0debug
|
selecting a single record from same multiple rows from single table : I have table
<pre>
ID companyName companyAddress brandId<br/>
1 Mian and sons 154 C 1<br/>
2 Mian and sons 154 C 2<br/>
3 Mian and sons 154 C 3<br/></pre>
and i get only one of three
for example
query = "select companyName from Company"; i using this query
<pre>companyName
Mian and sons </pre>
| 0debug
|
Angualr js , submit dynamic value for reactive form : In the below code i am trying to submit 3 values , rid , amount and reason on form submit .
<div class="row " *ngFor="let pendingrequest of pendingrequests" >
<form [formGroup]="pf" (ngSubmit)="onSubmit()">
<div class="col" >
<input type="hidden" formControlName="rid" name="requestid" value="{{pendingrequest.id}}" />
RNuo. : {{pendingrequest.id}}
</div>
<div class="row">
<div class="col">
<input type="number" formControlName="amount" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Amount">
</div><div class="col">
<input type="text" formControlName="reason" class="form-control" id="exampleInputPassword1" placeholder="Reason">
</div><div class="col">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
I am retreiving the value on the component as :
var rid = this.pf.get('rid').value ;
var amount = this.pf.get('amount').value ;
var reason = this.pf.get('reason').value ;
I am getting Amount and Reason properly but not the rid values , which is already known to the form . It need not to be submitted , thats why i kept the input type as "hidden" for rid.
Please let me know how to get this rid value at the component.
| 0debug
|
void OPPROTO op_divw (void)
{
if (unlikely(((int32_t)T0 == INT32_MIN && (int32_t)T1 == -1) ||
(int32_t)T1 == 0)) {
T0 = (int32_t)((-1) * ((uint32_t)T0 >> 31));
} else {
T0 = (int32_t)T0 / (int32_t)T1;
}
RETURN();
}
| 1threat
|
how to modify merge sort to be in place? : <p>I'm looking for an algorithm that modify merge sort to be in place sorting algorithm. I tried to change the indexes instead of splitting the array, but got stuck in the merging fhase.</p>
| 0debug
|
$_POST['id'] php?id= not working : <p>As I understand a php POST method can be passed through the url</p>
<p>File name: test.php</p>
<pre><code><?php
if(isset($_POST['id']{
echo'Great';
}else{
echo'Why ?';
}
?>
</code></pre>
<p>When I put manually in the browser /test.php?id=value it always returns the else statement</p>
<p>Why ?</p>
| 0debug
|
static void pflash_cfi02_realize(DeviceState *dev, Error **errp)
{
pflash_t *pfl = CFI_PFLASH02(dev);
uint32_t chip_len;
int ret;
Error *local_err = NULL;
chip_len = pfl->sector_len * pfl->nb_blocs;
#if 0
if (total_len != (8 * 1024 * 1024) && total_len != (16 * 1024 * 1024) &&
total_len != (32 * 1024 * 1024) && total_len != (64 * 1024 * 1024))
return NULL;
#endif
memory_region_init_rom_device(&pfl->orig_mem, OBJECT(pfl), pfl->be ?
&pflash_cfi02_ops_be : &pflash_cfi02_ops_le,
pfl, pfl->name, chip_len, &local_err);
if (local_err) {
error_propagate(errp, local_err);
return;
}
vmstate_register_ram(&pfl->orig_mem, DEVICE(pfl));
pfl->storage = memory_region_get_ram_ptr(&pfl->orig_mem);
pfl->chip_len = chip_len;
if (pfl->bs) {
ret = bdrv_read(pfl->bs, 0, pfl->storage, chip_len >> 9);
if (ret < 0) {
vmstate_unregister_ram(&pfl->orig_mem, DEVICE(pfl));
error_setg(errp, "failed to read the initial flash content");
return;
}
}
pflash_setup_mappings(pfl);
pfl->rom_mode = 1;
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &pfl->mem);
if (pfl->bs) {
pfl->ro = bdrv_is_read_only(pfl->bs);
} else {
pfl->ro = 0;
}
pfl->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, pflash_timer, pfl);
pfl->wcycle = 0;
pfl->cmd = 0;
pfl->status = 0;
pfl->cfi_len = 0x52;
pfl->cfi_table[0x10] = 'Q';
pfl->cfi_table[0x11] = 'R';
pfl->cfi_table[0x12] = 'Y';
pfl->cfi_table[0x13] = 0x02;
pfl->cfi_table[0x14] = 0x00;
pfl->cfi_table[0x15] = 0x31;
pfl->cfi_table[0x16] = 0x00;
pfl->cfi_table[0x17] = 0x00;
pfl->cfi_table[0x18] = 0x00;
pfl->cfi_table[0x19] = 0x00;
pfl->cfi_table[0x1A] = 0x00;
pfl->cfi_table[0x1B] = 0x27;
pfl->cfi_table[0x1C] = 0x36;
pfl->cfi_table[0x1D] = 0x00;
pfl->cfi_table[0x1E] = 0x00;
pfl->cfi_table[0x1F] = 0x07;
pfl->cfi_table[0x20] = 0x00;
pfl->cfi_table[0x21] = 0x09;
pfl->cfi_table[0x22] = 0x0C;
pfl->cfi_table[0x23] = 0x01;
pfl->cfi_table[0x24] = 0x00;
pfl->cfi_table[0x25] = 0x0A;
pfl->cfi_table[0x26] = 0x0D;
pfl->cfi_table[0x27] = ctz32(chip_len);
pfl->cfi_table[0x28] = 0x02;
pfl->cfi_table[0x29] = 0x00;
pfl->cfi_table[0x2A] = 0x00;
pfl->cfi_table[0x2B] = 0x00;
pfl->cfi_table[0x2C] = 0x01;
pfl->cfi_table[0x2D] = pfl->nb_blocs - 1;
pfl->cfi_table[0x2E] = (pfl->nb_blocs - 1) >> 8;
pfl->cfi_table[0x2F] = pfl->sector_len >> 8;
pfl->cfi_table[0x30] = pfl->sector_len >> 16;
pfl->cfi_table[0x31] = 'P';
pfl->cfi_table[0x32] = 'R';
pfl->cfi_table[0x33] = 'I';
pfl->cfi_table[0x34] = '1';
pfl->cfi_table[0x35] = '0';
pfl->cfi_table[0x36] = 0x00;
pfl->cfi_table[0x37] = 0x00;
pfl->cfi_table[0x38] = 0x00;
pfl->cfi_table[0x39] = 0x00;
pfl->cfi_table[0x3a] = 0x00;
pfl->cfi_table[0x3b] = 0x00;
pfl->cfi_table[0x3c] = 0x00;
}
| 1threat
|
Need recommendation for Audio/video player libraries in java : <p>I am working on a project where I need to create a Video/audio player in java that will allow a user to select a file they want to play and it to play that file. In the future, I am going to get the program to print the conversation of the audio/video file in real time, So i need to some how to create a video/audio player which has a elapsed time which I can be extract for the other component of the software.</p>
<p>I wondered if anyone could suggest some libraries for me to use or give me any advice they think could help me!</p>
<p>Thanks in advance!</p>
| 0debug
|
unsigned avutil_version(void)
{
av_assert0(AV_PIX_FMT_VDA_VLD == 81);
av_assert0(AV_SAMPLE_FMT_DBLP == 9);
av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
av_assert0(AV_PICTURE_TYPE_BI == 7);
av_assert0(LIBAVUTIL_VERSION_MICRO >= 100);
av_assert0(HAVE_MMX2 == HAVE_MMXEXT);
return LIBAVUTIL_VERSION_INT;
| 1threat
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.