problem
stringlengths 26
131k
| labels
class label 2
classes |
|---|---|
Can someone provide an example for this statement in java "a collection is eagerly constructed "? : <p>Collection is constructed when we add elements to it. Isn't it ?</p>
| 0debug
|
static void gic_update(gic_state *s)
{
int best_irq;
int best_prio;
int irq;
int level;
int cpu;
int cm;
for (cpu = 0; cpu < NUM_CPU(s); cpu++) {
cm = 1 << cpu;
s->current_pending[cpu] = 1023;
if (!s->enabled || !s->cpu_enabled[cpu]) {
qemu_irq_lower(s->parent_irq[cpu]);
return;
}
best_prio = 0x100;
best_irq = 1023;
for (irq = 0; irq < GIC_NIRQ; irq++) {
if (GIC_TEST_ENABLED(irq) && GIC_TEST_PENDING(irq, cm)) {
if (GIC_GET_PRIORITY(irq, cpu) < best_prio) {
best_prio = GIC_GET_PRIORITY(irq, cpu);
best_irq = irq;
}
}
}
level = 0;
if (best_prio <= s->priority_mask[cpu]) {
s->current_pending[cpu] = best_irq;
if (best_prio < s->running_priority[cpu]) {
DPRINTF("Raised pending IRQ %d\n", best_irq);
level = 1;
}
}
qemu_set_irq(s->parent_irq[cpu], level);
}
}
| 1threat
|
Instagram new logo css background : <p>Recently, Instagram logo has changed as you all know. I need vector logo but it is not possible, I mean gradients. Is there any css code for new logo? </p>
| 0debug
|
List.contains() fails while .equals() works : <p>I have an <code>ArrayList</code> of <code>Test</code> objects, which use a string as the equivalency check. I want to be able to use <code>List.contains()</code> to check whether or not the list contains an object that uses a certain string.</p>
<p>Simply:</p>
<pre><code>Test a = new Test("a");
a.equals("a"); // True
List<Test> test = new ArrayList<Test>();
test.add(a);
test.contains("a"); // False!
</code></pre>
<p>Equals and Hash function:</p>
<pre><code>@Override
public boolean equals(Object o) {
if (o == null) return false;
if (o == this) return true;
if (!(o instanceof Test)) {
return (o instanceof String) && (name.equals(o));
}
Test t = (Test)o;
return name.equals(t.GetName());
}
@Override
public int hashCode() {
return name.hashCode();
}
</code></pre>
<p>I read that to make sure <code>contains</code> works for a custom class, it needs to override <code>equals</code>. Thus it's super strange to me that while <code>equals</code> returns true, <code>contains</code> returns false.</p>
<p>How can I make this work?</p>
<p><a href="http://ideone.com/sXC06t">Full code</a></p>
| 0debug
|
Need to check if an object is empty in laravel : <p>I create a view by doing an eloquent query and then pass it over to Blade.</p>
<pre><code>@if($contacts != null)
//display contacts
@else
You dont have contacts
@endif
</code></pre>
<p>However it always assume that $contacts has something even if the query gives me nothing.</p>
<p>I did <code>dd($contacts)</code> and get: </p>
<pre><code>Collection {#247 ▼
#items: []
}
</code></pre>
<p>How do I check if it is empty?</p>
| 0debug
|
Cryptic NSInternalInconsistencyException when running unit tests in Xcode 9 GM : <p>I'm running my iOS app's unit tests on Xcode 9 GM, and a couple of them are failing with a weird NSInternalInconsistencyException, complaining that some test assertions cannot be reported, because the implicated tests have no associated XCTestRun object. I'm using OCMockito + OCHamcrest for mocking and call verification. </p>
<p>For demonstration purposes, let's say my app is called MyTestApp, and I have a test class FooTest (which inherits from XCTestCase). In -setUp, I create and wire together the various mock objects for the tests, and in -tearDown I set them to nil just in case.</p>
<p>Here's an example of the exception I'm getting: </p>
<pre>
2017-09-19 13:23:01.852729-0700 xctest[17006:5392130] *** Assertion failure in -[FooTest recordFailureWithDescription:inFile:atLine:expected:], /Library/Caches/com.apple.xbs/Sources/XCTest_Sim/XCTest-13201/Sources/XCTestFramework/Core/XCTestCase.m:308
/Users/fooUser/Workspaces/MyTestApp/tests/FooTest.mm:46: error: -[FooTest testSomething] : failed: caught "NSInternalInconsistencyException", "Unable to report test assertion failure 'Expected 1 matching invocation, but received 0' from /Users/fooUser/Workspaces/MyTestApp/tests/FooTest.mm:135 because it was raised inside test case -[FooTest testSomethingElse] which has no associated XCTestRun object. This may happen when test cases are constructed and invoked independently of standard XCTest infrastructure."
(
0 CoreFoundation 0x000000010255d1cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000101ebff41 objc_exception_throw + 48
2 CoreFoundation 0x0000000102562362 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000101827089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 XCTest 0x0000000101d96875 -[XCTestCase recordFailureWithDescription:inFile:atLine:expected:] + 518
5 MyAppUnitTests 0x000000011d7f2f5a -[HCXCTestFailureReporter executeHandlingOfFailure:] + 154
6 MyAppUnitTests 0x000000011d7f2b73 -[HCTestFailureReporter handleFailure:] + 67
7 MyAppUnitTests 0x000000011d64ec9a MKTFailTest + 217
8 MyAppUnitTests 0x000000011d64c3f4 -[MKTExactTimes verifyData:] + 254
9 MyAppUnitTests 0x000000011d64f2ba -[MKTBaseMockObject verifyInvocation:usingVerificationMode:] + 137
10 MyAppUnitTests 0x000000011d64f20b -[MKTBaseMockObject handlingVerifyOfInvocation:] + 115
11 MyAppUnitTests 0x000000011d64f15a -[MKTBaseMockObject forwardInvocation:] + 64
12 CoreFoundation 0x00000001024dfed8 ___forwarding___ + 760
13 CoreFoundation 0x00000001024dfb58 _CF_forwarding_prep_0 + 120
14 MyAppUnitTests 0x000000011c40b486 -[FooTest setUp] + 294
15 XCTest 0x0000000101d97b39 __24-[XCTestCase invokeTest]_block_invoke_3 + 31
16 XCTest 0x0000000101d97809 __24-[XCTestCase invokeTest]_block_invoke + 271
17 XCTest 0x0000000101ddff45 -[XCUITestContext performInScope:] + 183
18 XCTest 0x0000000101d976ef -[XCTestCase invokeTest] + 141
</pre>
<p>Several things of note:</p>
<ul>
<li> The unit tests are not initializing XCTestCase or any XCTest "infrastructure" classes outside of the XCTest framework.
<li> The remaining statements of the affected unit tests actually gets executed, up to the point of the exception.
<li> The implicated line of code looks like: <code>[verify(_mockTestObject) description];</code>
<li> The stack trace is lying about where the problem occurs - it says that it's in -setUp, but from what I can tell, OCMockito simply reports expectation failures at the beginning of the <i>next</i> unit test's run. The problem location (FooTest.mm:135) looks like the above verify() call.
</ul>
<p>In fact, all unit tests that fail with this exception fail because we're trying to verify that <code>-[NSObject description]</code> has been called on one mock object or another. Removing all instances of verifying that call makes the tests pass. </p>
<p>I searched on Google for other instances of this particular NSInternalInconsistencyException, and that didn't yield any results. I'm not sure in what way -[NSObject description] is different from any other method that may be called on a mock object - it's possible that the problem isn't really there either, but that it just manifests that way. I was also trying to find if there are any debug/diagnostic options I can turn on for XCTest so I could maybe get more verbose logging information about test execution, but I haven't found anything like that either.</p>
<p>Any ideas for where I should look next? Thanks a lot!</p>
| 0debug
|
How to make a Text box only accept whole numbers? VB : <p>I am trying to make a Battle Simulation and I need to make it so that text boxes only display and accept whole numbers. i.e 1, 5, 268. I want is so that and decimals will be rounded to the nearest whole number. I may just be acting silly but I cant think of a solution that will run, here is what I have got so far:</p>
<pre><code> If AttackerMP.Text = Decimal Then
AttackerMP.Text = Integer
End If
</code></pre>
| 0debug
|
Please explain this pseudocode involving getchar and putter : [photo of pseudocode that i don't understand][1]
Hi! I attached a photo of a piece of code that I don't completely understand. I know that getchar returns the next character from standard output and that put char puts the character on the standard output, but i don't fully understand what the EOF is and what this code is doing exactly. Also i don't get how you can add or subtract letters as it does in the if statement...
Thank you in advance!
[1]: https://i.stack.imgur.com/PUSHc.png
| 0debug
|
static uint64_t bw_io_read(void *opaque, target_phys_addr_t addr, unsigned size)
{
switch (size) {
case 1:
return cpu_inb(addr);
case 2:
return cpu_inw(addr);
case 4:
return cpu_inl(addr);
}
abort();
}
| 1threat
|
In Nest.js, how to get a service instance inside a decorator? : <p>In <code>CustomDecorator</code>, how to access a service instance defined in Nest.js?</p>
<pre><code>export const CustomDecorator = (): MethodDecorator => {
return (
target: Object,
propertyKey: string | symbol,
descriptor: PropertyDescriptor
) => {
// Here, is possibile to access a Nest.js service (i.e. TestService) instance?
return descriptor;
}
};
</code></pre>
| 0debug
|
How to close electron app via javascript? : <p>I am running an express app via electron.</p>
<p>Below is the main.js</p>
<pre><code> const electron = require("electron"),
app = electron.app,
BrowserWindow = electron.BrowserWindow;
let mainWindow;
function createWindow () {
mainWindow = new BrowserWindow({
width: 1200,
height: 800,
frame: false,
kiosk: true
});
mainWindow.loadURL(`file://${__dirname}/index.html`)
mainWindow.webContents.openDevTools();
mainWindow.on("closed", function () {
mainWindow = null;
})
}
app.on("ready", createWindow);
app.on("browser-window-created",function(e,window) {
window.setMenu(null);
});
app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});
app.on("activate", function () {
if (mainWindow === null) {
createWindow();
}
});
</code></pre>
<p>and below is a button in the view that upon click i would like it to close the app </p>
<pre><code><button id="close-btn"><i class="fa fa-cube" aria-hidden="true"></i>&nbsp; Close application</button>
</code></pre>
<p>Essentially I want to activate this part of the code once the button has been clicked</p>
<pre><code> app.on("window-all-closed", function () {
if (process.platform !== "darwin") {
app.quit();
}
});
</code></pre>
| 0debug
|
Best way to stream/logically replicate RDS Postgres data to kinesis : <p>Our primary datastore is an RDS Postgres database. It would be nice if we could stream all changes to that happen in Postgres to some sink - whether that's kinesis, elasticsearch or any other data store. </p>
<p>We use Postgres 9.5 which has support for 'logical replication'. However, all the extensions that tap into this stream are blocked on RDS. There's a tutorial for streaming the MySQL RDS flavor to kinesis - the postgres equivalent would be ideal. Is this possible currently?</p>
| 0debug
|
Can I force delete an AWS CloudFormation stack that is In Progress of Rollback : <p>An AWS CloudFormation rollback (e.g., UPDATE_ROLLBACK_IN_PROGRESS) has been in progress forever, like over an hour and a half. I want to delete the stack altogether or force stop any activity. Is this possible?</p>
<p>Thanks!</p>
| 0debug
|
static int coroutine_fn v9fs_mark_fids_unreclaim(V9fsPDU *pdu, V9fsPath *path)
{
int err;
V9fsState *s = pdu->s;
V9fsFidState *fidp, head_fid;
head_fid.next = s->fid_list;
for (fidp = s->fid_list; fidp; fidp = fidp->next) {
if (fidp->path.size != path->size) {
continue;
}
if (!memcmp(fidp->path.data, path->data, path->size)) {
fidp->flags |= FID_NON_RECLAIMABLE;
err = v9fs_reopen_fid(pdu, fidp);
if (err < 0) {
return -1;
}
if (err == 0) {
fidp = &head_fid;
}
}
}
return 0;
}
| 1threat
|
Where to learn android programming? : <p>I already know the basics of Java but where should you go to learn android app development. I want to learn how to make pro apps and one day make a 3D game. Where do/did you go to learn android development? And please don't say university. </p>
| 0debug
|
Is there a function to convert a int list to a list that shows the smallest-to-largest order of the list? : <p>I need a function that turns a list like
[10,5,2,3,7]
to a list like
[4,2,0,1,3]</p>
<p>Basically a list [0,1,2,3,4...] but arranged in the order that the original list has, smallest to biggest.</p>
<p>I have no idea where to even start on a function like this. I have Python 3.5.2.</p>
| 0debug
|
from math import tan, pi
def area_polygon(s,l):
area = s * (l ** 2) / (4 * tan(pi / s))
return area
| 0debug
|
How do I make a C++ (shared) library compatible with clang and GCC? : <p>I've written a fairly substantial C++11 library, and I'm planning to allow download of pre-compiled versions from my website.</p>
<p>So I've set up an automated build which compiles the library with clang and make it available for download, but this has exposed a problem: if I try to use the clang-compiled library with GCC I get undefined references (mainly related to <code>std::string</code>). I think this is related to the GCC dual-ABI changes in GCC 5.1 but I'm not sure how to fix it.</p>
<p>My question is, what flags should I set, or practices should I follow to make a C++ library compatible with both clang and GCC?</p>
<p>Or should I give up and compile two separate libraries? </p>
| 0debug
|
Excel VBA - A general how to... : I'm looking to figure out a way to take some data in a sheet and then carry it over to another sheet and change the formatting of it. In essence, I have a set employees, skills, branches and tiers. Rather than have a long list of each skill name and a separate row for each employee, I'd like to have (see 2nd image) the employee names listed under the skill name in a table.
Here is the spreadsheet with the data:
http://i.stack.imgur.com/8vqH8.png
And then I'd like to format the data like so in the second sheet using an update button:
http://i.stack.imgur.com/qDr2X.png
Any help would be greatly appreciated!
| 0debug
|
static void wiener_denoise(WMAVoiceContext *s, int fcb_type,
float *synth_pf, int size,
const float *lpcs)
{
int remainder, lim, n;
if (fcb_type != FCB_TYPE_SILENCE) {
float *tilted_lpcs = s->tilted_lpcs_pf,
*coeffs = s->denoise_coeffs_pf, tilt_mem = 0;
tilted_lpcs[0] = 1.0;
memcpy(&tilted_lpcs[1], lpcs, sizeof(lpcs[0]) * s->lsps);
memset(&tilted_lpcs[s->lsps + 1], 0,
sizeof(tilted_lpcs[0]) * (128 - s->lsps - 1));
ff_tilt_compensation(&tilt_mem, 0.7 * tilt_factor(lpcs, s->lsps),
tilted_lpcs, s->lsps + 2);
remainder = FFMIN(127 - size, size - 1);
calc_input_response(s, tilted_lpcs, fcb_type, coeffs, remainder);
memset(&synth_pf[size], 0, sizeof(synth_pf[0]) * (128 - size));
ff_rdft_calc(&s->rdft, synth_pf);
ff_rdft_calc(&s->rdft, coeffs);
synth_pf[0] *= coeffs[0];
synth_pf[1] *= coeffs[1];
for (n = 1; n < 128; n++) {
float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1];
synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1];
synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1];
}
ff_rdft_calc(&s->irdft, synth_pf);
}
if (s->denoise_filter_cache_size) {
lim = FFMIN(s->denoise_filter_cache_size, size);
for (n = 0; n < lim; n++)
synth_pf[n] += s->denoise_filter_cache[n];
s->denoise_filter_cache_size -= lim;
memmove(s->denoise_filter_cache, &s->denoise_filter_cache[size],
sizeof(s->denoise_filter_cache[0]) * s->denoise_filter_cache_size);
}
if (fcb_type != FCB_TYPE_SILENCE) {
lim = FFMIN(remainder, s->denoise_filter_cache_size);
for (n = 0; n < lim; n++)
s->denoise_filter_cache[n] += synth_pf[size + n];
if (lim < remainder) {
memcpy(&s->denoise_filter_cache[lim], &synth_pf[size + lim],
sizeof(s->denoise_filter_cache[0]) * (remainder - lim));
s->denoise_filter_cache_size = remainder;
}
}
}
| 1threat
|
int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
{
if (*spec <= '9' && *spec >= '0')
return strtol(spec, NULL, 0) == st->index;
else if (*spec == 'v' || *spec == 'a' || *spec == 's' || *spec == 'd' ||
*spec == 't') {
enum AVMediaType type;
switch (*spec++) {
case 'v': type = AVMEDIA_TYPE_VIDEO; break;
case 'a': type = AVMEDIA_TYPE_AUDIO; break;
case 's': type = AVMEDIA_TYPE_SUBTITLE; break;
case 'd': type = AVMEDIA_TYPE_DATA; break;
case 't': type = AVMEDIA_TYPE_ATTACHMENT; break;
default: av_assert0(0);
}
if (type != st->codec->codec_type)
return 0;
if (*spec++ == ':') {
int i, index = strtol(spec, NULL, 0);
for (i = 0; i < s->nb_streams; i++)
if (s->streams[i]->codec->codec_type == type && index-- == 0)
return i == st->index;
return 0;
}
return 1;
} else if (*spec == 'p' && *(spec + 1) == ':') {
int prog_id, i, j;
char *endptr;
spec += 2;
prog_id = strtol(spec, &endptr, 0);
for (i = 0; i < s->nb_programs; i++) {
if (s->programs[i]->id != prog_id)
continue;
if (*endptr++ == ':') {
int stream_idx = strtol(endptr, NULL, 0);
return stream_idx >= 0 &&
stream_idx < s->programs[i]->nb_stream_indexes &&
st->index == s->programs[i]->stream_index[stream_idx];
}
for (j = 0; j < s->programs[i]->nb_stream_indexes; j++)
if (st->index == s->programs[i]->stream_index[j])
return 1;
}
return 0;
} else if (*spec == '#') {
int sid;
char *endptr;
sid = strtol(spec + 1, &endptr, 0);
if (!*endptr)
return st->id == sid;
} else if (!*spec)
return 1;
av_log(s, AV_LOG_ERROR, "Invalid stream specifier: %s.\n", spec);
return AVERROR(EINVAL);
}
| 1threat
|
Dynamic form CodeIgniter, Attribute Form in Database : <p>I want ask something about Code Igniter Dynamic Form.</p>
<p>I want to make a Form. Every tag like input, text area, etc, and attribute like id, class, etc of that Form stored in database. No hard code in html/php. Only fetch the attribute and tag from database, the Controller will load from database and send to View. And automatically will display the Form like what I saved in database.</p>
<p>In this case, the future of this form will be increased or reduced without need to hard coding by the developer.</p>
<p>Anyone can tell me how to make like that. And give reference link to me, so i can learn it.</p>
| 0debug
|
Please decode for me this python string : I have some code that I would like to be decoded but I can not get it done all the steps comunicated here ["How to decode a python string"][1] but without success. Help me if it's not too much demanded. Thank you very much in advance.
Here is the code:
exec("import re;import base64");exec((lambda p,y:(lambda o,b,f:re.sub(o,b,f))(r"([0-9a-f]+)",lambda m:p(m,y),base64.b64decode("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z0nKQoJCQkJCQkxYSAoNjQoMTcpKT09MjoKCQkJCQkJCQk1ZlsxN1swXV09MTdbMV0KCQkJCQkJCSAgIAoJCWYzIDVmCgoxMWU9NWIoKTsgNjY9MTA5OyA3PTEwOTsgN2Q9MTA5OyA3Yj0xMDk7IDExOT0xMDkKMjk6IDdiPWMuMTUoMTFlWyI3YiJdKQoxMWQ6IDFiCjI5OiA2Nj1jLjE1KDExZVsiNjYiXSkKMTFkOiAxYgoyOTogNz1jLjE1KDExZVsiNyJdKQoxMWQ6IDFiCjI5OiA3ZD04MigxMWVbIjdkIl0pCjExZDogMWIKMjk6IDExOT1jLjE1KDExZVsiMTE5Il0pCjExZDogMWIKMjk6IGY0PWMuMTUoMTFlWyJmNCJdKQoxMWQ6IDFiCiAKMWEgN2Q9PTEwOSBhZCA2Nj09MTA5IGFkIDY0KDY2KTwxOiA3NigpCjQzIDdkPT0xOjY4KDY2KQo0MyA3ZD09MjoxZSg3LDY2LDExOSkKNDMgN2Q9PTM6NDcoKQo0MyA3ZD09NDo0MigpCgoyZS43MSg4Mig0Yi4zZlsxXSkp")))(lambda a,b:b[int("0x"+a.group(1),16)],"0|1|2|3|4|5|6|name|8|9|a|b|urllib|translatePath|description|f|quote_plus|link|icon|open|addLink|unquote_plus|split|splitparams|ext|plugin|if|pass|channel|xbmcgui|Player|str|xbmc|string|in|GetEncodeString|close|item_data|executebuiltin|thumbnailImage|special|try|START|write|path|addon_id|xbmcplugin|pairsofparams|30|def|else|f4mTester|m3u8|not|36|read|addDirectoryItem|keyboard|FILE|AddonTitle|CREATE_M3U_LIST|streamtype|none|argv|matches|41|Get_Local_File|elif|liz|List_M3U8|iconImage|Clear_History|os|cleanedparams|video|sys|home|display_name|join|HLSRETRY|50|addDir|ListItem|fanart_image|setProperty|paramstring|urllib2|compile|for|findall|http|get_params|addon_data|list|False|param|amp|dialog|Container|addons|len|COLOR|url|isFolder|Find_Out|Play|quit|listitem|open_url|OF|userdata|F4M|upper|endOfDirectory|chardet|Mozilla|ok|history|GetMenu|DialogProgress|n|DefaultFolder|response|site|m3u|mode|Dialog|append|encode|mpegts|int|handle|import|Safari|isfile|exists|like|True|choice|SetViewMode|AppleWebKit|isConfirmed|AppleWebkit|Agent|infoLabels|dodgerblue|Gecko|value|add_header|white|regex|strip|echoplayer|KHTML|field|INSTALLED|AAASTREAM|PlayMedia|Supported|req|red|installed|xbmcaddon|999|requires|yeslabel|file|tvaddons|line|User|HISTORY|HOME|encoding|or|w|makedirs|Keyboard|vers|urlopen|History|doModal|setInfo|getText|install|Request|Windows|Android|Version|nolabel|Refresh|be|Tester|Mobile|utf|png|decode|Please|browse|534|IML74K|detect|537|remove|EXTINF|fusion|URL|li|Chrome|stored|TESTER|Linux|clear|lower|Enter|Clear|yesno|Shani|files|https|L160L|Local|Would|Video|Title|range|Build|File|List|ts|play|u|Repo|2228|MORE|r|LIST|type|This|from|lime|DATA_FOLDER|ECHO|M3U8|return|fanart|plot|the|U|A|you|MKV|jpg|and|MP4|NOT|AVI|M3U|replace|MP3|f4m|YES|xml|all|ko|I|None|TS|LG|at|ag|i|B|NT|t|to|NO|kr|S|M|The|To|iconimage|re|dp|yellowgreen|except|params|_".split("|")))
When i change this :
exec("import re;import base64");exec((lambda p,y:...
to
exec("import re;import base64");print((lambda p,y:...
I have an error
I decode it with base64 and i have this code :
84 20,a2,1d,2e,c,56,48,11a,4b
2d = '19.4a.98'
3b = '[65 11c]f1 1e[/65]'
f4 = 20.d(48.2c.4e('28://4c/63/' + 2d , 'f4.fb'))
12 = 20.d(48.2c.4e('28://4c/63/' + 2d, '12.c2'))
61 = 1d.7e()
11b = 1d.77()
aa = 20.d(48.2c.4e('28://4c/6e/5c/' + 2d , '75.105'))
f0 = 20.d(48.2c.4e('28://4c/6e/5c/' + 2d))
6f = 20.d(48.2c.4e('28://4c/63/19.4a.33'))
ab = 20.d(48.2c.4e('28://4c'))
31 76():
1a 35 48.2c.87(f0):
48.af(f0)
1a 35 48.2c.86(aa):
f = 13(aa,'ae')
f.2b('#2a 6d 3a#')
f.24()
51('[65 11c]69 cd.............[/65]','3e',1,12,f4)
51('[65 11c]69 dc e2.............[/65]','3e',4,12,f4)
14('[65 91]9e: 10a, 100, f2, fd, ff, fa, 102 fc e9![/65]','3e',a3,12,f4)
14('[65 95]################aa###################[/65]','3e',a3,12,f4)
14('[65 a0]d6 b3[/65]','3e',3,12,f4)
b1 = 13(aa, "ea")
96 = 11a.57(ea'<11>(.+?)</11>')
58 a8 22 b1:
a6 = 96.59(a8)
58 66 22 a6:
1a 35 66 == "3e":
1a "7c" 22 66:
1a "34" 22 66:
18 = 66.16('.')[-1]
29:
18 = 18.16('?')[0]
11d: 1b
29:
18 = 18.16('%')[0]
11d: 1b
14('[65 11c]' + 18.70() + '[/65] - ' + 66,66,1,12,f4)
32:
51("[65 11c]eb[/65] - " + 66,66,1,12,f4)
32:
18 = 66.16('.')[-1]
29:
18 = 18.16('?')[0]
11d: 1b
29:
18 = 18.16('%')[0]
11d: 1b
14('[65 11c]' + 18.70() + '[/65] - ' + 66,66,1,12,f4)
20.26('62.8b(50)')
31 42():
66 = 61.c5(1, 3b, 'd9', '', 5e, 5e, ab)
1a '.7c' 22 66:
1a 35 '34' 22 66:
45(66)
32:
1e(66,66,12)
32:
1e(66,66,12)
31 47():
1a 48.2c.86(aa):
8a = 1d.7e().d7(3b, '[65 95]dd f9 88 112 d3 106 d0 75?[/65]','',a5='[65 ef]104[/65]',bc='[10f][65 a0]113[/65][/10f]')
1a 8a == 1:
48.ca(aa)
f = 13(aa,'ae')
f.2b('#2a 6d 3a#')
f.24()
20.26("62.bd")
31 68(66):
1a 66 == "3e":
21 =''
39 = 20.b0(21, 'd5 117 cd 118 69')
39.b4()
1a 39.8d():
21 = 39.b6().101(' ','')
1a 35 (21 == "") ad (21 == " "):
1a 35 ('5a://') ad ('da://') 22 21:
66 = "5a://" + 21
32: 66 = 21
32: 6a()
1a '.7c' 22 66:
1a 35 '34' 22 66:
45(66)
32:
1e(7,66,119)
32:
1e(7,66,119)
31 45(66):
5d = 3c(66)
a=13(aa).37()
b=a.101('<11>'+66+'</11>\78','\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
a=13(aa).37()
b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
14("[65 11c]69 117 e3[/65]" ,66, 2, 12, f4,'')
14("###########################################" ,66, a3, 12, f4,'')
58 1c 22 5d:
7 = 23(1c["4d"])
66 = 23(1c["66"])
66 = 66.101('\\ea','').101('\\111','').101('\ea','').101('\111','').101(' ','').101('34','34')
18 = 66.16('.')[-1]
29:
18 = 18.16('?')[0]
11d: 1b
29:
18 = 18.16('%')[0]
11d: 1b
14('[65 11c]' + 18.70() + '[/65] - ' + 7 ,66, 2, 12, f4,'')
31 3c(66):
1a 35 '5a' 22 66:
7a=13(66).37()
32:
7a = 6c(66)
7a = 7a.101('#9c:','#f8:')
7a = 7a.101('#cb:','#f8:')
40=11a.57('^#f8:-?[0-9]*(.*?),(.*?)\78(.*?)$',11a.108+11a.116+11a.f7+11a.115).59(7a)
ce = []
58 11e, 4d, 66 22 40:
25 = {"11e": 11e, "4d": 4d, "66": 66}
ce.7f(25)
5d = []
58 1c 22 ce:
25 = {"4d": 1c["4d"], "66": 1c["66"]}
40=11a.57(' (.+?)="(.+?)"',11a.108+11a.116+11a.f7+11a.115).59(1c["11e"])
58 9a, 93 22 40:
25[9a.97().d4().101('-', '11f')] = 93.97()
5d.7f(25)
f3 5d
31 23(1f):
29:
84 72
1f = 1f.c3(72.c8(1f)["ac"]).80("c1-8")
11d:
29:
1f = 1f.80("c1-8")
11d:
1b
f3 1f
31 1e(7,66,119):
1a "34" 22 66:
a=13(aa).37()
b=a.101('<11>'+66+'</11>\78','\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
a=13(aa).37()
b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
43 35 "7c" 22 66:
a=13(aa).37()
b=a.101('<11>'+66+'</11>\78','\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
a=13(aa).37()
b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
f= 13(aa, 7d='ae')
f.2b(1f(b))
f.24()
1a 35 '103'22 66:
1a '.34'22 66:
66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66
43 '.e4'22 66:
66 = 66.101('.e4','.34')
66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66
43 '.81'22 66:
66 = 66.101('.81','.34')
66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66
1a "19://" 22 66:
1a 35 48.2c.87(6f):
61.74('[65 a0]6f d1 fe 9b![/65]', "ed 11 a4 6f bf be a1. c4 b7 6f ee f6 d8 e7 10c 5a://cc.a7.10d")
6a()
66 = "9d("+66+")"
20.26(66)
6a()
1a '5a' 22 66:
66 = 66 + '|a9-8f=73/5.0 (d2; f7; ba 4.0.3; 107-114; 10b-db e1/c7) 8e/c6.30 (99, 88 92) bb/4.0 c0 85/c6.30'
44 = 1d.52(66, 46=12, 27=12)
20.1e ().e5(66, 44, 5e)
6a()
31 6c(66):
9f = 56.b8(66)
9f.94('a9-8f', '73/5.0 (b9 110 6.1) 8c/c9.36 (99, 88 92) cf/41.0.e8.0 85/c9.36')
7a = 56.b2(9f)
11=7a.37()
7a.24()
f3 11
31 14(7, 66, 7d, 119, f4, e=''):
44=1d.52(7, 46="79.c2", 27=119)
44.54('53', f4)
e6=4b.3f[0]+"?66="+c.10(66)+"&7d="+1f(7d)+"&7="+c.10(7)+"&e="+1f(e)+"&f4="+c.10(f4)
74=89
74=2e.38(83=82(4b.3f[1]),66=e6,6b=44,67=5e)
f3 74
31 51(7,66,7d,119,f4,e=''):
e6=4b.3f[0]+"?66="+c.10(66)+"&7d="+1f(7d)+"&7="+c.10(7)+"&119="+c.10(119)+"&e="+c.10(e)
74=89
44=1d.52(7, 46=119, 27=119)
44.b5( ec="de", 90={ "df": 7, 'f5': e } )
44.54('53', f4)
74=2e.38(83=82(4b.3f[1]),66=e6,6b=44,67=89)
f3 74
31 5b():
5f=[]
55=4b.3f[2]
1a 64(55)>=2:
11e=4b.3f[2]
49=11e.101('?','')
1a (11e[64(11e)-1]=='/'):
11e=11e[0:64(11e)-2]
2f=49.16('&')
5f={}
58 10e 22 e0(64(2f)):
17={}
17=2f[10e].16('=')
1a (64(17))==2:
5f[17[0]]=17[1]
f3 5f
11e=5b(); 66=109; 7=109; 7d=109; 7b=109; 119=109
29: 7b=c.15(11e["7b"])
11d: 1b
29: 66=c.15(11e["66"])
11d: 1b
29: 7=c.15(11e["7"])
11d: 1b
29: 7d=82(11e["7d"])
11d: 1b
29: 119=c.15(11e["119"])
11d: 1b
29: f4=c.15(11e["f4"])
11d: 1b
1a 7d==109 ad 66==109 ad 64(66)<1: 76()
43 7d==1:68(66)
43 7d==2:1e(7,66,119)
43 7d==3:47()
43 7d==4:42()
2e.71(82(4b.3f[1]))
Now I do not know what to do with this code. Please help me. Thanks
[1]: http://stackoverflow.com/questions/33217926/how-to-decode-a-python-string
| 0debug
|
static inline void RENAME(yuv2rgb555_1)(SwsContext *c, const uint16_t *buf0,
const uint16_t *ubuf0, const uint16_t *ubuf1,
const uint16_t *vbuf0, const uint16_t *vbuf1,
const uint16_t *abuf0, uint8_t *dest,
int dstW, int uvalpha, enum PixelFormat dstFormat,
int flags, int y)
{
x86_reg uv_off = c->uv_off << 1;
const uint16_t *buf1= buf0;
if (uvalpha < 2048) {
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1(%%REGBP, %5, %6)
"pxor %%mm7, %%mm7 \n\t"
#ifdef DITHER1XBPP
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither), "m"(uv_off)
);
} else {
__asm__ volatile(
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
"mov %4, %%"REG_b" \n\t"
"push %%"REG_BP" \n\t"
YSCALEYUV2RGB1b(%%REGBP, %5, %6)
"pxor %%mm7, %%mm7 \n\t"
#ifdef DITHER1XBPP
"paddusb "BLUE_DITHER"(%5), %%mm2 \n\t"
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
#endif
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
"pop %%"REG_BP" \n\t"
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
"a" (&c->redDither), "m"(uv_off)
);
}
}
| 1threat
|
How can we decrypt a password which has been encrypted first using md5 and then using sha1? : <p>Is it possible to decrypt a password which has been encrypted using md5 and then using sha1?</p>
<p>$newHPass = sha1(md5($password));</p>
| 0debug
|
static subpage_t *subpage_init(target_phys_addr_t base)
{
subpage_t *mmio;
mmio = g_malloc0(sizeof(subpage_t));
mmio->base = base;
memory_region_init_io(&mmio->iomem, &subpage_ops, mmio,
"subpage", TARGET_PAGE_SIZE);
mmio->iomem.subpage = true;
#if defined(DEBUG_SUBPAGE)
printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__,
mmio, base, TARGET_PAGE_SIZE, subpage_memory);
#endif
subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, phys_section_unassigned);
return mmio;
}
| 1threat
|
Upgrading React version and it's dependencies by reading package.json : <p>I have an existing project, which has <code>react@15</code> and all it's dependencies according to that. But now I have to upgrade to <code>react@16</code> along with it's dependencies. Now, the problem is - there are a lot of dependencies and it is very time consuming to identify version of each dependency.</p>
<p>So, I was wondering if there was a way where I could upgrade the versions of React and it's dependencies mentioned in <code>package.json</code>, without manually modifying the <code>package.json</code> file.</p>
| 0debug
|
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame)
{
int (*filter_frame)(AVFilterLink *, AVFrame *);
AVFilterContext *dstctx = link->dst;
AVFilterPad *dst = link->dstpad;
AVFrame *out = NULL;
int ret;
AVFilterCommand *cmd= link->dst->command_queue;
int64_t pts;
if (link->closed) {
av_frame_free(&frame);
return AVERROR_EOF;
}
if (!(filter_frame = dst->filter_frame))
filter_frame = default_filter_frame;
if (dst->needs_writable && !av_frame_is_writable(frame)) {
av_log(link->dst, AV_LOG_DEBUG, "Copying data in avfilter.\n");
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
out = ff_get_video_buffer(link, link->w, link->h);
break;
case AVMEDIA_TYPE_AUDIO:
out = ff_get_audio_buffer(link, frame->nb_samples);
break;
default:
ret = AVERROR(EINVAL);
goto fail;
}
if (!out) {
ret = AVERROR(ENOMEM);
goto fail;
}
ret = av_frame_copy_props(out, frame);
if (ret < 0)
goto fail;
switch (link->type) {
case AVMEDIA_TYPE_VIDEO:
av_image_copy(out->data, out->linesize, (const uint8_t **)frame->data, frame->linesize,
frame->format, frame->width, frame->height);
break;
case AVMEDIA_TYPE_AUDIO:
av_samples_copy(out->extended_data, frame->extended_data,
0, 0, frame->nb_samples,
av_get_channel_layout_nb_channels(frame->channel_layout),
frame->format);
break;
default:
ret = AVERROR(EINVAL);
goto fail;
}
av_frame_free(&frame);
} else
out = frame;
while(cmd && cmd->time <= out->pts * av_q2d(link->time_base)){
av_log(link->dst, AV_LOG_DEBUG,
"Processing command time:%f command:%s arg:%s\n",
cmd->time, cmd->command, cmd->arg);
avfilter_process_command(link->dst, cmd->command, cmd->arg, 0, 0, cmd->flags);
ff_command_queue_pop(link->dst);
cmd= link->dst->command_queue;
}
pts = out->pts;
if (dstctx->enable_str) {
int64_t pos = av_frame_get_pkt_pos(out);
dstctx->var_values[VAR_N] = link->frame_count;
dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base);
dstctx->var_values[VAR_W] = link->w;
dstctx->var_values[VAR_H] = link->h;
dstctx->var_values[VAR_POS] = pos == -1 ? NAN : pos;
dstctx->is_disabled = fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) < 0.5;
if (dstctx->is_disabled &&
(dstctx->filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC))
filter_frame = default_filter_frame;
}
ret = filter_frame(link, out);
link->frame_count++;
link->frame_requested = 0;
ff_update_link_current_pts(link, pts);
return ret;
fail:
av_frame_free(&out);
av_frame_free(&frame);
return ret;
}
| 1threat
|
uint32_t cpu_mips_get_random (CPUMIPSState *env)
{
static uint32_t seed = 1;
static uint32_t prev_idx = 0;
uint32_t idx;
do {
seed = 1103515245 * seed + 12345;
idx = (seed >> 16) % (env->tlb->nb_tlb - env->CP0_Wired) +
env->CP0_Wired;
} while (idx == prev_idx);
prev_idx = idx;
return idx;
}
| 1threat
|
UUID is same from different strings : <p>I have two different strings, but after parsing to UUID it's seem to be same</p>
<pre><code>public static void main(String[] args) {
try {
UUID t1 = UUID.fromString("38e1036d-7527-42a3-98ca-f2f19d3155db");
UUID t2 = UUID.fromString("123438e1036d-7527-42a3-98ca-f2f19d3155db");
System.out.println(t1.toString().equals(t2.toString()));
} catch (Exception e) {
e.printStackTrace();
}
}
</code></pre>
<p>Any idea why it is?</p>
| 0debug
|
static int64_t buffered_get_rate_limit(void *opaque)
{
QEMUFileBuffered *s = opaque;
return s->xfer_limit;
}
| 1threat
|
void ff_hevc_luma_mv_mvp_mode(HEVCContext *s, int x0, int y0, int nPbW,
int nPbH, int log2_cb_size, int part_idx,
int merge_idx, MvField *mv,
int mvp_lx_flag, int LX)
{
HEVCLocalContext *lc = s->HEVClc;
MvField *tab_mvf = s->ref->tab_mvf;
int isScaledFlag_L0 = 0;
int availableFlagLXA0 = 1;
int availableFlagLXB0 = 1;
int numMVPCandLX = 0;
int min_pu_width = s->sps->min_pu_width;
int xA0, yA0;
int is_available_a0;
int xA1, yA1;
int is_available_a1;
int xB0, yB0;
int is_available_b0;
int xB1, yB1;
int is_available_b1;
int xB2, yB2;
int is_available_b2;
Mv mvpcand_list[2] = { { 0 } };
Mv mxA;
Mv mxB;
int ref_idx_curr = 0;
int ref_idx = 0;
int pred_flag_index_l0;
int pred_flag_index_l1;
const int cand_bottom_left = lc->na.cand_bottom_left;
const int cand_left = lc->na.cand_left;
const int cand_up_left = lc->na.cand_up_left;
const int cand_up = lc->na.cand_up;
const int cand_up_right = lc->na.cand_up_right_sap;
ref_idx_curr = LX;
ref_idx = mv->ref_idx[LX];
pred_flag_index_l0 = LX;
pred_flag_index_l1 = !LX;
xA0 = x0 - 1;
yA0 = y0 + nPbH;
is_available_a0 = AVAILABLE(cand_bottom_left, A0) &&
yA0 < s->sps->height &&
PRED_BLOCK_AVAILABLE(A0);
xA1 = x0 - 1;
yA1 = y0 + nPbH - 1;
is_available_a1 = AVAILABLE(cand_left, A1);
if (is_available_a0 || is_available_a1)
isScaledFlag_L0 = 1;
if (is_available_a0) {
if (MP_MX(A0, pred_flag_index_l0, mxA)) {
goto b_candidates;
}
if (MP_MX(A0, pred_flag_index_l1, mxA)) {
goto b_candidates;
}
}
if (is_available_a1) {
if (MP_MX(A1, pred_flag_index_l0, mxA)) {
goto b_candidates;
}
if (MP_MX(A1, pred_flag_index_l1, mxA)) {
goto b_candidates;
}
}
if (is_available_a0) {
if (MP_MX_LT(A0, pred_flag_index_l0, mxA)) {
goto b_candidates;
}
if (MP_MX_LT(A0, pred_flag_index_l1, mxA)) {
goto b_candidates;
}
}
if (is_available_a1) {
if (MP_MX_LT(A1, pred_flag_index_l0, mxA)) {
goto b_candidates;
}
if (MP_MX_LT(A1, pred_flag_index_l1, mxA)) {
goto b_candidates;
}
}
availableFlagLXA0 = 0;
b_candidates:
xB0 = x0 + nPbW;
yB0 = y0 - 1;
is_available_b0 = AVAILABLE(cand_up_right, B0) &&
xB0 < s->sps->width &&
PRED_BLOCK_AVAILABLE(B0);
xB1 = x0 + nPbW - 1;
yB1 = y0 - 1;
is_available_b1 = AVAILABLE(cand_up, B1);
xB2 = x0 - 1;
yB2 = y0 - 1;
is_available_b2 = AVAILABLE(cand_up_left, B2);
if (is_available_b0) {
if (MP_MX(B0, pred_flag_index_l0, mxB)) {
goto scalef;
}
if (MP_MX(B0, pred_flag_index_l1, mxB)) {
goto scalef;
}
}
if (is_available_b1) {
if (MP_MX(B1, pred_flag_index_l0, mxB)) {
goto scalef;
}
if (MP_MX(B1, pred_flag_index_l1, mxB)) {
goto scalef;
}
}
if (is_available_b2) {
if (MP_MX(B2, pred_flag_index_l0, mxB)) {
goto scalef;
}
if (MP_MX(B2, pred_flag_index_l1, mxB)) {
goto scalef;
}
}
availableFlagLXB0 = 0;
scalef:
if (!isScaledFlag_L0) {
if (availableFlagLXB0) {
availableFlagLXA0 = 1;
mxA = mxB;
}
availableFlagLXB0 = 0;
if (is_available_b0) {
availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l0, mxB);
if (!availableFlagLXB0)
availableFlagLXB0 = MP_MX_LT(B0, pred_flag_index_l1, mxB);
}
if (is_available_b1 && !availableFlagLXB0) {
availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l0, mxB);
if (!availableFlagLXB0)
availableFlagLXB0 = MP_MX_LT(B1, pred_flag_index_l1, mxB);
}
if (is_available_b2 && !availableFlagLXB0) {
availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l0, mxB);
if (!availableFlagLXB0)
availableFlagLXB0 = MP_MX_LT(B2, pred_flag_index_l1, mxB);
}
}
if (availableFlagLXA0)
mvpcand_list[numMVPCandLX++] = mxA;
if (availableFlagLXB0 && (!availableFlagLXA0 || mxA.x != mxB.x || mxA.y != mxB.y))
mvpcand_list[numMVPCandLX++] = mxB;
if (numMVPCandLX < 2 && s->sh.slice_temporal_mvp_enabled_flag &&
mvp_lx_flag == numMVPCandLX) {
Mv mv_col;
int available_col = temporal_luma_motion_vector(s, x0, y0, nPbW,
nPbH, ref_idx,
&mv_col, LX);
if (available_col)
mvpcand_list[numMVPCandLX++] = mv_col;
}
mv->mv[LX] = mvpcand_list[mvp_lx_flag];
}
| 1threat
|
How do I undo mix phoenix.gen.html? : <p><code>mix phoenix.gen.html</code> generates a bunch of files. How do I do undo this generation? or do i have to do it by hand?</p>
| 0debug
|
Java - Splitting a string into individual letters : For a school project i need to encrypt a random Java String, for the beginning "test", with the Caesar-Code (Every letter of the alphabet is replaced with the one that is 3 places ahead, a -> c, b -> d and so on).
So my question is:
How can i make this happen using a jTextField (where the String to be encrypted is written) and a jButton to fire of the encyrption function ?
for me it is more important to know how i can convert the String to Individual letters than the enycrption itself because i think thats not that hard to get so i can possibly do that by myself.
Thx for help :)
| 0debug
|
Pandas: IndexingError: Unalignable boolean Series provided as indexer : <p>I'm trying to run what I think is simple code to eliminate any columns with all NaNs, but can't get this to work (<code>axis = 1</code> works just fine when eliminating rows):</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame({'a':[1,2,np.nan,np.nan], 'b':[4,np.nan,6,np.nan], 'c':[np.nan, 8,9,np.nan], 'd':[np.nan,np.nan,np.nan,np.nan]})
df = df[df.notnull().any(axis = 0)]
print df
</code></pre>
<p>Full error:</p>
<p><code>raise IndexingError('Unalignable boolean Series provided as 'pandas.core.indexing.IndexingError: Unalignable boolean Series provided as indexer (index of the boolean Series and of the indexed object do not match</code></p>
<p>Expected output:</p>
<pre><code> a b c
0 1.0 4.0 NaN
1 2.0 NaN 8.0
2 NaN 6.0 9.0
3 NaN NaN NaN
</code></pre>
| 0debug
|
static int dvvideo_init(AVCodecContext *avctx)
{
DVVideoContext *s = avctx->priv_data;
DSPContext dsp;
static int done=0;
int i, j;
if (!done) {
VLC dv_vlc;
uint16_t new_dv_vlc_bits[NB_DV_VLC*2];
uint8_t new_dv_vlc_len[NB_DV_VLC*2];
uint8_t new_dv_vlc_run[NB_DV_VLC*2];
int16_t new_dv_vlc_level[NB_DV_VLC*2];
done = 1;
dv_vlc_map = av_mallocz(DV_VLC_MAP_LEV_SIZE*DV_VLC_MAP_RUN_SIZE*sizeof(struct dv_vlc_pair));
if (!dv_vlc_map)
return -ENOMEM;
dv_anchor = av_malloc(12*27*sizeof(void*));
if (!dv_anchor) {
av_free(dv_vlc_map);
return -ENOMEM;
}
for (i=0; i<12*27; i++)
dv_anchor[i] = (void*)(size_t)i;
for (i=0, j=0; i<NB_DV_VLC; i++, j++) {
new_dv_vlc_bits[j] = dv_vlc_bits[i];
new_dv_vlc_len[j] = dv_vlc_len[i];
new_dv_vlc_run[j] = dv_vlc_run[i];
new_dv_vlc_level[j] = dv_vlc_level[i];
if (dv_vlc_level[i]) {
new_dv_vlc_bits[j] <<= 1;
new_dv_vlc_len[j]++;
j++;
new_dv_vlc_bits[j] = (dv_vlc_bits[i] << 1) | 1;
new_dv_vlc_len[j] = dv_vlc_len[i] + 1;
new_dv_vlc_run[j] = dv_vlc_run[i];
new_dv_vlc_level[j] = -dv_vlc_level[i];
}
}
init_vlc(&dv_vlc, TEX_VLC_BITS, j,
new_dv_vlc_len, 1, 1, new_dv_vlc_bits, 2, 2);
dv_rl_vlc = av_malloc(dv_vlc.table_size * sizeof(RL_VLC_ELEM));
if (!dv_rl_vlc) {
av_free(dv_anchor);
av_free(dv_vlc_map);
return -ENOMEM;
}
for(i = 0; i < dv_vlc.table_size; i++){
int code= dv_vlc.table[i][0];
int len = dv_vlc.table[i][1];
int level, run;
if(len<0){
run= 0;
level= code;
} else {
run= new_dv_vlc_run[code] + 1;
level= new_dv_vlc_level[code];
}
dv_rl_vlc[i].len = len;
dv_rl_vlc[i].level = level;
dv_rl_vlc[i].run = run;
}
free_vlc(&dv_vlc);
for (i = 0; i < NB_DV_VLC - 1; i++) {
if (dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE || dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE)
continue;
if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0)
continue;
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] <<
(!!dv_vlc_level[i]);
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] +
(!!dv_vlc_level[i]);
}
for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
#ifdef DV_CODEC_TINY_TARGET
for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) {
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
}
#else
for (j = 1; j < DV_VLC_MAP_LEV_SIZE/2; j++) {
if (dv_vlc_map[i][j].size == 0) {
dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc |
(dv_vlc_map[i-1][0].vlc << (dv_vlc_map[0][j].size));
dv_vlc_map[i][j].size = dv_vlc_map[i-1][0].size +
dv_vlc_map[0][j].size;
}
dv_vlc_map[i][((uint16_t)(-j))&0x1ff].vlc =
dv_vlc_map[i][j].vlc | 1;
dv_vlc_map[i][((uint16_t)(-j))&0x1ff].size =
dv_vlc_map[i][j].size;
}
#endif
}
}
dsputil_init(&dsp, avctx);
s->get_pixels = dsp.get_pixels;
s->fdct[0] = dsp.fdct;
s->idct_put[0] = dsp.idct_put;
for (i=0; i<64; i++)
s->dv_zigzag[0][i] = dsp.idct_permutation[ff_zigzag_direct[i]];
s->fdct[1] = dsp.fdct248;
s->idct_put[1] = simple_idct248_put;
memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
dv_build_unquantize_tables(s, dsp.idct_permutation);
if (dv_codec_profile(avctx))
avctx->pix_fmt = dv_codec_profile(avctx)->pix_fmt;
avctx->coded_frame = &s->picture;
return 0;
}
| 1threat
|
static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov)
{
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
uint64_t lba;
uint32_t num_sectors;
if (!is_sector_request_lun_aligned(sector_num, nb_sectors, iscsilun)) {
return -EINVAL;
}
if (bs->bl.max_transfer &&
nb_sectors << BDRV_SECTOR_BITS > bs->bl.max_transfer) {
error_report("iSCSI Error: Read of %d sectors exceeds max_xfer_len "
"of %" PRIu32 " bytes", nb_sectors, bs->bl.max_transfer);
return -EINVAL;
}
if (iscsilun->lbprz && nb_sectors >= ISCSI_CHECKALLOC_THRES &&
!iscsi_allocationmap_is_allocated(iscsilun, sector_num, nb_sectors)) {
int64_t ret;
int pnum;
BlockDriverState *file;
ret = iscsi_co_get_block_status(bs, sector_num,
BDRV_REQUEST_MAX_SECTORS, &pnum, &file);
if (ret < 0) {
return ret;
}
if (ret & BDRV_BLOCK_ZERO && pnum >= nb_sectors) {
qemu_iovec_memset(iov, 0, 0x00, iov->size);
return 0;
}
}
lba = sector_qemu2lun(sector_num, iscsilun);
num_sectors = sector_qemu2lun(nb_sectors, iscsilun);
iscsi_co_init_iscsitask(iscsilun, &iTask);
retry:
if (iscsilun->use_16_for_rw) {
iTask.task = iscsi_read16_task(iscsilun->iscsi, iscsilun->lun, lba,
num_sectors * iscsilun->block_size,
iscsilun->block_size, 0, 0, 0, 0, 0,
iscsi_co_generic_cb, &iTask);
} else {
iTask.task = iscsi_read10_task(iscsilun->iscsi, iscsilun->lun, lba,
num_sectors * iscsilun->block_size,
iscsilun->block_size,
0, 0, 0, 0, 0,
iscsi_co_generic_cb, &iTask);
}
if (iTask.task == NULL) {
return -ENOMEM;
}
scsi_task_set_iov_in(iTask.task, (struct scsi_iovec *) iov->iov, iov->niov);
while (!iTask.complete) {
iscsi_set_events(iscsilun);
qemu_coroutine_yield();
}
if (iTask.task != NULL) {
scsi_free_scsi_task(iTask.task);
iTask.task = NULL;
}
if (iTask.do_retry) {
iTask.complete = 0;
goto retry;
}
if (iTask.status != SCSI_STATUS_GOOD) {
return iTask.err_code;
}
return 0;
}
| 1threat
|
md-checkbox Angular materials styling : <p>Using Angular materials with Angular4, I cannot find a way to change checkbox color after checked.</p>
<p>The only way worked for me to modify styling at the initial view is:</p>
<pre><code>:host /deep/ .mat-checkbox-inner-container{
height:15px;
width:15px;
background-color: rgba(0, 255, 0, 0.87);
}
</code></pre>
<p>Trying to change styling after on checked, the following did not worked:</p>
<pre><code>:host /deep/ .mat-checkbox-checked {
background-color:yellow;
}
</code></pre>
<p>It actually applied after check, but in wrong element - did not apply at the inner container.</p>
<p>Something like <code>:host /deep/ .mat-checkbox-inner-container-checked</code> does not work as well.</p>
<p>Any help is welcome.</p>
| 0debug
|
static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index,
size_t elt_ofs, target_ulong page)
{
size_t vidx;
for (vidx = 0; vidx < CPU_VTLB_SIZE; ++vidx) {
CPUTLBEntry *vtlb = &env->tlb_v_table[mmu_idx][vidx];
target_ulong cmp = *(target_ulong *)((uintptr_t)vtlb + elt_ofs);
if (cmp == page) {
CPUTLBEntry tmptlb, *tlb = &env->tlb_table[mmu_idx][index];
CPUIOTLBEntry tmpio, *io = &env->iotlb[mmu_idx][index];
CPUIOTLBEntry *vio = &env->iotlb_v[mmu_idx][vidx];
tmptlb = *tlb; *tlb = *vtlb; *vtlb = tmptlb;
tmpio = *io; *io = *vio; *vio = tmpio;
return true;
}
}
return false;
}
| 1threat
|
How do you correctly use parallelshell with npm scripts? : <p>I am trying to use parallelshell with my node project on Windows to run two processes at the same time.</p>
<p>Here is the scripts section of my package.json file:</p>
<pre><code>"scripts": {
"start": "npm run watch:all",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server",
"scss": "node-sass -o css/ css/",
"watch:scss": "onchange \"css/*.scss\" -- npm run scss",
"watch:all": "parallelshell \"npm run watch:scss\" \"npm run lite\""
</code></pre>
<p>}</p>
<p>When I run the command <code>npm start</code> I get this error log:</p>
<pre><code>TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type string. Received type function
at normalizeSpawnArguments (child_process.js:420:11)
at spawn (child_process.js:522:38)
at C:\Users\Daniel\Documents\development\online_classes\coursera_uhk_web_dev\Bootstrap4\conFusion\node_modules\parallelshell\index.js:104:17
at Array.forEach (<anonymous>)
at Object.<anonymous> (C:\Users\Daniel\Documents\development\online_classes\coursera_uhk_web_dev\Bootstrap4\conFusion\node_modules\parallelshell\index.js:100:6)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! confusion@1.0.0 watch:all: `parallelshell "npm run watch:scss" "npm run lite"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the confusion@1.0.0 watch:all script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
</code></pre>
<p>Is there something wrong with my syntax? I can run the commands <code>npm run watch:scss</code> and <code>npm run lite</code> individually and they work fine, but I am not able to run the parallelshell command.</p>
<p>Thank you!</p>
| 0debug
|
void OPPROTO op_subfme_64 (void)
{
T0 = ~T0 + xer_ca - 1;
if (likely((uint64_t)T0 != (uint64_t)-1))
xer_ca = 1;
RETURN();
}
| 1threat
|
Nightwatch to select option from select box : <p>I am trying to use nightwatch.js to select an option from a select box.</p>
<p>I have the code:</p>
<pre><code> this.browser.click('select[name="month"]')
.pause(1000)
.click('option[value="3"]')
.click('select[name="day"]')
.pause(1000)
.click('option[value="6"]')
.click('select[name="year"]')
.pause(1000)
.click('option[value="1989"]');
</code></pre>
<p>It selects the correct month, year on the page but not the day. Here's the HTML for the select box for the day:</p>
<pre><code><select aria-label="Day" id="day" name="day" data-validatorGroup="bday" data-component="selectbox">
<option selected="selected" value="" aria-label="Date of birth">
Day</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
</code></pre>
<p>Does anyone know why its not selecting the proper day?</p>
| 0debug
|
int vnc_client_io_error(VncState *vs, int ret, int last_errno)
{
if (ret == 0 || ret == -1) {
if (ret == -1) {
switch (last_errno) {
case EINTR:
case EAGAIN:
#ifdef _WIN32
case WSAEWOULDBLOCK:
#endif
return 0;
default:
break;
}
}
VNC_DEBUG("Closing down client sock %d %d\n", ret, ret < 0 ? last_errno : 0);
qemu_set_fd_handler2(vs->csock, NULL, NULL, NULL, NULL);
closesocket(vs->csock);
qemu_del_timer(vs->timer);
qemu_free_timer(vs->timer);
if (vs->input.buffer) qemu_free(vs->input.buffer);
if (vs->output.buffer) qemu_free(vs->output.buffer);
#ifdef CONFIG_VNC_TLS
vnc_tls_client_cleanup(vs);
#endif
#ifdef CONFIG_VNC_SASL
vnc_sasl_client_cleanup(vs);
#endif
audio_del(vs);
VncState *p, *parent = NULL;
for (p = vs->vd->clients; p != NULL; p = p->next) {
if (p == vs) {
if (parent)
parent->next = p->next;
else
vs->vd->clients = p->next;
break;
}
parent = p;
}
if (!vs->vd->clients)
dcl->idle = 1;
qemu_free(vs->server.ds->data);
qemu_free(vs->server.ds);
qemu_free(vs->guest.ds);
qemu_free(vs);
return 0;
}
return ret;
}
| 1threat
|
static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, dc, diff, j, run;
int component;
RLTable *rl;
uint8_t * scantable = s->intra_scantable.permutated;
const uint16_t *quant_matrix;
const int qscale = s->qscale;
if (n < 4) {
quant_matrix = s->intra_matrix;
component = 0;
} else {
quant_matrix = s->chroma_intra_matrix;
component = (n & 1) + 1;
}
diff = decode_dc(&s->gb, component);
if (diff >= 0xffff)
return -1;
dc = s->last_dc[component];
dc += diff;
s->last_dc[component] = dc;
block[0] = dc << (3 - s->intra_dc_precision);
if (s->intra_vlc_format)
rl = &ff_rl_mpeg2;
else
rl = &ff_rl_mpeg1;
{
OPEN_READER(re, &s->gb);
for (;;) {
UPDATE_CACHE(re, &s->gb);
GET_RL_VLC(level, run, re, &s->gb, rl->rl_vlc[0], TEX_VLC_BITS, 2, 0);
if (level == 127) {
break;
} else if (level != 0) {
scantable += run;
j = *scantable;
level = (level * qscale * quant_matrix[j]) >> 4;
level = (level ^ SHOW_SBITS(re, &s->gb, 1)) - SHOW_SBITS(re, &s->gb, 1);
LAST_SKIP_BITS(re, &s->gb, 1);
} else {
run = SHOW_UBITS(re, &s->gb, 6) + 1; LAST_SKIP_BITS(re, &s->gb, 6);
UPDATE_CACHE(re, &s->gb);
level = SHOW_SBITS(re, &s->gb, 12); SKIP_BITS(re, &s->gb, 12);
scantable += run;
j = *scantable;
if (level < 0) {
level = (-level * qscale * quant_matrix[j]) >> 4;
level = -level;
} else {
level = (level * qscale * quant_matrix[j]) >> 4;
}
}
block[j] = level;
}
CLOSE_READER(re, &s->gb);
}
s->block_last_index[n] = scantable - s->intra_scantable.permutated;
return 0;
}
| 1threat
|
static void flush(AVCodecContext *avctx)
{
WmallDecodeCtx *s = avctx->priv_data;
s->packet_loss = 1;
s->packet_done = 0;
s->num_saved_bits = 0;
s->frame_offset = 0;
s->next_packet_start = 0;
s->cdlms[0][0].order = 0;
s->frame.nb_samples = 0;
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
}
| 1threat
|
How to select second colomn of every xts in list : I have a list containing 100 xts files of same dimensions. Now I want to select second column of every file.
I have used following code but this selects second row of every file
```
lapply(list,"["c,(2))
````
Plz suggest how to modify above code to select columns
| 0debug
|
Reverse the scale of the x axis in a plot : <p>I have created a plot in R and my own custom x and y axes. I would like the x axis to be displayed in a reverse order (1-0 by -.02). I have read numerous posts and threads that suggest using xlim and reverse range but I just can't seem to make it work. Once plotted I am also converting the axes labels to percentages by multiplying by 100 (as you will see in the code). Here is what I have so far;</p>
<pre><code>plot(roc.val, xlab = "Specificity (%)", ylab = "Sensitivity (%)", axes = FALSE)
axis(2, at = seq(0,1,by=.2), labels = paste(100*seq(0,1, by=.2)), tick = TRUE)
axis(1, at = seq(0,1,by=.2), labels = paste(100*seq(0,1, by=.2)), tick = TRUE)
</code></pre>
<p>How can I reverse the x axis scale so that the values begin at 100 and end at 0 with increments of 20?</p>
| 0debug
|
Running a node express server using webpack-dev-server : <p>I'm using webpack to run my react frontend successfully using the following config:</p>
<pre><code>{
name: 'client',
entry: './scripts/main.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /.jsx?$/,
loader: 'babel-loader',
exclude: /node_modules/,
query:{
presets: ['es2015', 'react', 'stage-2']
}
}
]
}
}
</code></pre>
<p>I'm trying to put up a node.js express backend as well, and would like to run that through webpack as well, so that I have a single server running both the backend and frontend, and because I want to use babel to transpile my javascript.</p>
<p>I made a quick testserver looking like this:</p>
<pre><code>var express = require('express');
console.log('test');
var app = express();
app.get('/', function(req, res){
res.send("Hello world from Express!!");
});
app.listen(3000, function(){
console.log('Example app listening on port 3000');
});
</code></pre>
<p>If I run this with <code>node index.js</code> and open my browser on <code>localhost:3000</code> it prints "Hello world from Express!!". So far so good. Then I tried creating a web-pack config for it:</p>
<pre><code>var fs = require('fs');
var nodeModules = {};
fs.readdirSync('node_modules')
.filter(function(x) {
return ['.bin'].indexOf(x) === -1;
})
.forEach(function(mod) {
nodeModules[mod] = 'commonjs ' + mod;
});
module.exports = [
{
name: 'server',
target: 'node',
entry: './index.js',
output: {
path: __dirname,
filename: 'bundle.js'
},
externals: nodeModules,
module: {
loaders: [
{
test: /\.js$/,
loaders: [
'babel-loader'
]
},
{
test: /\.json$/,
loader: 'json-loader'
}
]
}
}
</code></pre>
<p>When I run the command <code>webpack-dev-server</code> it starts up successfully (it seems). However, if I go to my browser on <code>localhost:3000</code> now, it just says that the webpage is not available, just as when the server is not running at all.</p>
<p>I'm very new to both node and webpack, so either I have made a small mistake somewhere, or I'm way off ;)</p>
| 0debug
|
How to get coordinates from database and show them on the map fast : I have a database which has lots of car locations(coordinates; lat,lng). I want to get the location of the cars just by giving the coordinates to server and get the locations very fast. The problem is that the number of cars is numerous and if there are millions of records in a table, when requesting with
select * from locations where (lat >= '$lat-10' and lat <= '$lat+10') and (lng >= '$lng-10' and lng <= '$lng+10')
it might be normal but it compares millions of coordinates with four conditions and it utilizes resources very much. So is there any algorithm to find the locations very fast? I thought whether it is a good idea to categorize the map of my country with squares and put each section to a separate table in order to find the locations fast. So if a user wants to find the location of a car just by giving her/his current coordinates, SQL will search only in the section(table) that the user currently is. But now the problem is that the number of tables will grow much, maybe 100,000 tables!!
How can I find the location of cars fast?
Thanks
| 0debug
|
How can I assign a variable to a Console.ReadLine(); response? : <p>I'm using C# and a console application to ask the user a question and receive their response using:
<code>Console.ReadLine();</code>
I know when you are reading a single key you can do this:
<code>ConsoleKeyInfo variableName = Console.ReadKey(true);</code>
But when I do that with Console.ReadLine();...
<code>ConsoleKeyInfo variableName = Console.ReadLine()</code></p>
<p>I get the following error message:
Cannot implicitly convert type 'string' to System.ConsoleKeyInfo"</p>
<p>So the question is, how can I assign a variable to a Console.ReadLine(); response that the user writes?</p>
| 0debug
|
int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt,
int has_alpha)
{
const PixFmtInfo *pf, *ps;
const AVPixFmtDescriptor *src_desc = &av_pix_fmt_descriptors[src_pix_fmt];
const AVPixFmtDescriptor *dst_desc = &av_pix_fmt_descriptors[dst_pix_fmt];
int loss;
ps = &pix_fmt_info[src_pix_fmt];
loss = 0;
pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth ||
((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE ||
dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) &&
(src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE ||
src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE)))
loss |= FF_LOSS_DEPTH;
if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
loss |= FF_LOSS_RESOLUTION;
switch(pf->color_type) {
case FF_COLOR_RGB:
if (ps->color_type != FF_COLOR_RGB &&
ps->color_type != FF_COLOR_GRAY)
loss |= FF_LOSS_COLORSPACE;
break;
case FF_COLOR_GRAY:
if (ps->color_type != FF_COLOR_GRAY)
loss |= FF_LOSS_COLORSPACE;
break;
case FF_COLOR_YUV:
if (ps->color_type != FF_COLOR_YUV)
loss |= FF_LOSS_COLORSPACE;
break;
case FF_COLOR_YUV_JPEG:
if (ps->color_type != FF_COLOR_YUV_JPEG &&
ps->color_type != FF_COLOR_YUV &&
ps->color_type != FF_COLOR_GRAY)
loss |= FF_LOSS_COLORSPACE;
break;
default:
if (ps->color_type != pf->color_type)
loss |= FF_LOSS_COLORSPACE;
break;
}
if (pf->color_type == FF_COLOR_GRAY &&
ps->color_type != FF_COLOR_GRAY)
loss |= FF_LOSS_CHROMA;
if (!pf->is_alpha && (ps->is_alpha && has_alpha))
loss |= FF_LOSS_ALPHA;
if (pf->pixel_type == FF_PIXEL_PALETTE &&
(ps->pixel_type != FF_PIXEL_PALETTE && ps->color_type != FF_COLOR_GRAY))
loss |= FF_LOSS_COLORQUANT;
return loss;
}
| 1threat
|
void ppc40x_core_reset (CPUState *env)
{
target_ulong dbsr;
printf("Reset PowerPC core\n");
cpu_ppc_reset(env);
dbsr = env->spr[SPR_40x_DBSR];
dbsr &= ~0x00000300;
dbsr |= 0x00000100;
env->spr[SPR_40x_DBSR] = dbsr;
cpu_loop_exit();
}
| 1threat
|
import re
def text_match(text):
patterns = 'ab*?'
if re.search(patterns, text):
return ('Found a match!')
else:
return ('Not matched!')
| 0debug
|
What is the difference between TF Learn (aka Scikit Flow) and TFLearn (aka TFLearn.org) : <p>There are two TFLearn projects</p>
<pre><code>TF Learn (aka Scikit Flow)
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/learn/python/learn
</code></pre>
<p>and</p>
<pre><code>TFLearn: Deep learning library featuring a higher-level API for TensorFlow.
https://github.com/tflearn/tflearn
</code></pre>
<p>what is the status of these projects, are they going to stay separate or they going to merged together?</p>
| 0debug
|
static int64_t mpegts_get_dts(AVFormatContext *s, int stream_index,
int64_t *ppos, int64_t pos_limit)
{
MpegTSContext *ts = s->priv_data;
int64_t pos;
int pos47 = ts->pos47_full % ts->raw_packet_size;
pos = ((*ppos + ts->raw_packet_size - 1 - pos47) / ts->raw_packet_size) * ts->raw_packet_size + pos47;
ff_read_frame_flush(s);
if (avio_seek(s->pb, pos, SEEK_SET) < 0)
return AV_NOPTS_VALUE;
while(pos < pos_limit) {
int ret;
AVPacket pkt;
av_init_packet(&pkt);
ret= av_read_frame(s, &pkt);
if(ret < 0)
return AV_NOPTS_VALUE;
av_free_packet(&pkt);
if(pkt.dts != AV_NOPTS_VALUE && pkt.pos >= 0){
ff_reduce_index(s, pkt.stream_index);
av_add_index_entry(s->streams[pkt.stream_index], pkt.pos, pkt.dts, 0, 0, AVINDEX_KEYFRAME );
if(pkt.stream_index == stream_index){
*ppos= pkt.pos;
return pkt.dts;
}
}
pos = pkt.pos;
}
return AV_NOPTS_VALUE;
}
| 1threat
|
How do I get "firebase login" to work from Google Cloud Shell : <p>I logged into Google Cloud Shell and found that that the Firebase CLI is already installed.</p>
<p>I then tried to run "firebase list" to see that it was working and was prompted to login.</p>
<p>"Visit this URL on any device to log in:"
<code><very long URL></code></p>
<p>I copy/pasted the URL into a browser and got the standard "Firebase CLI would like to:" prompt from Google but when I approved it by clicking the "Allow" button, it failed.</p>
<p>This is the error page that showed.</p>
<p>This site can’t be reached<br>
localhost refused to connect.<br>
Search Google for localhost 9005<br>
ERR_CONNECTION_REFUSED</p>
| 0debug
|
static void qdev_prop_cpy(DeviceState *dev, Property *props, void *src)
{
if (props->info->type == PROP_TYPE_BIT) {
bool *defval = src;
bit_prop_set(dev, props, *defval);
} else {
char *dst = qdev_get_prop_ptr(dev, props);
memcpy(dst, src, props->info->size);
}
}
| 1threat
|
if else statement return a string, error. : <p>why do i get an error, is it because im missing a return after the if checks? could i resolve it by setting one last return to null </p>
<pre><code>public static String whoWins(rockPaperScissors user, rockPaperScissors computer){
if(user == ROCK && computer == SCISSORSS){
return "user wins";
}
if(user == PAPER && computer == ROCK){
return " user wins";
}
if(user == SCISSORSS && computer == PAPER){
return "user wins";
}
if(computer == ROCK && user == SCISSORSS){
return "computer wins";
}
if(computer == PAPER && user == ROCK){
return "computer wins";
}
if (computer == SCISSORSS && user == PAPER){
return "computer wins";
}
}
</code></pre>
| 0debug
|
Can't figure out how to use odometer.js : I've figured out how to make it start at a number and smoothly transition to another number but can't figure out how to update numbers slowly, for example, the "Your heart has beaten approximately ... times in total" on https://you.regettingold.com/01/01/1900/. Link to [odometer][1]
[1]: http://github.hubspot.com/odometer/docs/welcome/
My attempt:
<div id="odometer" class="odometer">123</div>
<!-- Odometr includes -->
<script src="http://github.hubspot.com/odometer/odometer.js"></script>
<script>
setTimeout(function(){
$('.odometer').text(24000); //THIS IS THE TIME IT ROTATES TO
}, 1000);//THIS IS THE DURATION TIME IT TAKES TO GET THERE
</script>
| 0debug
|
static void stm32f2xx_usart_write(void *opaque, hwaddr addr,
uint64_t val64, unsigned int size)
{
STM32F2XXUsartState *s = opaque;
uint32_t value = val64;
unsigned char ch;
DB_PRINT("Write 0x%" PRIx32 ", 0x%"HWADDR_PRIx"\n", value, addr);
switch (addr) {
case USART_SR:
if (value <= 0x3FF) {
s->usart_sr = value;
} else {
s->usart_sr &= value;
}
if (!(s->usart_sr & USART_SR_RXNE)) {
qemu_set_irq(s->irq, 0);
}
return;
case USART_DR:
if (value < 0xF000) {
ch = value;
if (s->chr) {
qemu_chr_fe_write_all(s->chr, &ch, 1);
}
s->usart_sr |= USART_SR_TC;
s->usart_sr &= ~USART_SR_TXE;
}
return;
case USART_BRR:
s->usart_brr = value;
return;
case USART_CR1:
s->usart_cr1 = value;
if (s->usart_cr1 & USART_CR1_RXNEIE &&
s->usart_sr & USART_SR_RXNE) {
qemu_set_irq(s->irq, 1);
}
return;
case USART_CR2:
s->usart_cr2 = value;
return;
case USART_CR3:
s->usart_cr3 = value;
return;
case USART_GTPR:
s->usart_gtpr = value;
return;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad offset 0x%"HWADDR_PRIx"\n", __func__, addr);
}
}
| 1threat
|
static inline void RENAME(yuy2ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
{
#ifdef HAVE_MMXFIXME
#else
int i;
for(i=0; i<width; i++)
{
dstU[i]= (src1[4*i + 1] + src2[4*i + 1])>>1;
dstV[i]= (src1[4*i + 3] + src2[4*i + 3])>>1;
}
#endif
}
| 1threat
|
In Android Studio 2.0, Cannot find local variable of method in debug mode : <p>After Updating the android version 1.5 to 2.0 Preview4. Android studio Debugger unable to find the local variable defined in method definition. For reference, find the below screenshot.</p>
<p><a href="https://i.stack.imgur.com/U971h.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U971h.png" alt="enter image description here"></a></p>
| 0debug
|
Dividing 2 textfields in Swift 3 Xcode 8 : I have a quick (and probably very easy question) in Xcode 8. I have my view controller hooked up with my swift file within my Xcode project. I have 2 text fields (One to type in number of games played and another to type in number of points scored). When someone taps the calculate button I want the code to divide the number of games by the number of points scored and display the point per game average on a label. I have provided a screenshot of the view controller below. Can anyone help me? It is for a school project and I desperately need help.
Thank you,
Andrew
[Screenshot of viewcontroller][1]
[1]: https://i.stack.imgur.com/Z4bNj.png
| 0debug
|
static int ogg_write_header(AVFormatContext *s)
{
OGGContext *ogg = s->priv_data;
OGGStreamContext *oggstream = NULL;
int i, j;
if (ogg->pref_size)
av_log(s, AV_LOG_WARNING, "The pagesize option is deprecated\n");
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
unsigned serial_num = i;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
if (st->codec->codec_id == AV_CODEC_ID_OPUS)
avpriv_set_pts_info(st, 64, 1, 48000);
else
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
} else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
if (st->codec->codec_id != AV_CODEC_ID_VORBIS &&
st->codec->codec_id != AV_CODEC_ID_THEORA &&
st->codec->codec_id != AV_CODEC_ID_SPEEX &&
st->codec->codec_id != AV_CODEC_ID_FLAC &&
st->codec->codec_id != AV_CODEC_ID_OPUS) {
av_log(s, AV_LOG_ERROR, "Unsupported codec id in stream %d\n", i);
return -1;
}
if (!st->codec->extradata || !st->codec->extradata_size) {
av_log(s, AV_LOG_ERROR, "No extradata present\n");
return -1;
}
oggstream = av_mallocz(sizeof(*oggstream));
if (!oggstream)
return AVERROR(ENOMEM);
oggstream->page.stream_index = i;
if (!(s->flags & AVFMT_FLAG_BITEXACT))
do {
serial_num = av_get_random_seed();
for (j = 0; j < i; j++) {
OGGStreamContext *sc = s->streams[j]->priv_data;
if (serial_num == sc->serial_num)
break;
}
} while (j < i);
oggstream->serial_num = serial_num;
av_dict_copy(&st->metadata, s->metadata, AV_DICT_DONT_OVERWRITE);
st->priv_data = oggstream;
if (st->codec->codec_id == AV_CODEC_ID_FLAC) {
int err = ogg_build_flac_headers(st->codec, oggstream,
s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing FLAC headers\n");
av_freep(&st->priv_data);
return err;
}
} else if (st->codec->codec_id == AV_CODEC_ID_SPEEX) {
int err = ogg_build_speex_headers(st->codec, oggstream,
s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing Speex headers\n");
av_freep(&st->priv_data);
return err;
}
} else if (st->codec->codec_id == AV_CODEC_ID_OPUS) {
int err = ogg_build_opus_headers(st->codec, oggstream,
s->flags & AVFMT_FLAG_BITEXACT,
&st->metadata);
if (err) {
av_log(s, AV_LOG_ERROR, "Error writing Opus headers\n");
av_freep(&st->priv_data);
return err;
}
} else {
uint8_t *p;
const char *cstr = st->codec->codec_id == AV_CODEC_ID_VORBIS ? "vorbis" : "theora";
int header_type = st->codec->codec_id == AV_CODEC_ID_VORBIS ? 3 : 0x81;
int framing_bit = st->codec->codec_id == AV_CODEC_ID_VORBIS ? 1 : 0;
if (avpriv_split_xiph_headers(st->codec->extradata, st->codec->extradata_size,
st->codec->codec_id == AV_CODEC_ID_VORBIS ? 30 : 42,
oggstream->header, oggstream->header_len) < 0) {
av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");
av_freep(&st->priv_data);
return -1;
}
p = ogg_write_vorbiscomment(7, s->flags & AVFMT_FLAG_BITEXACT,
&oggstream->header_len[1], &st->metadata,
framing_bit);
oggstream->header[1] = p;
if (!p)
return AVERROR(ENOMEM);
bytestream_put_byte(&p, header_type);
bytestream_put_buffer(&p, cstr, 6);
if (st->codec->codec_id == AV_CODEC_ID_THEORA) {
oggstream->kfgshift = ((oggstream->header[0][40]&3)<<3)|(oggstream->header[0][41]>>5);
oggstream->vrev = oggstream->header[0][9];
av_log(s, AV_LOG_DEBUG, "theora kfgshift %d, vrev %d\n",
oggstream->kfgshift, oggstream->vrev);
}
}
}
for (j = 0; j < s->nb_streams; j++) {
OGGStreamContext *oggstream = s->streams[j]->priv_data;
ogg_buffer_data(s, s->streams[j], oggstream->header[0],
oggstream->header_len[0], 0, 1);
oggstream->page.flags |= 2;
ogg_buffer_page(s, oggstream);
}
for (j = 0; j < s->nb_streams; j++) {
AVStream *st = s->streams[j];
OGGStreamContext *oggstream = st->priv_data;
for (i = 1; i < 3; i++) {
if (oggstream->header_len[i])
ogg_buffer_data(s, st, oggstream->header[i],
oggstream->header_len[i], 0, 1);
}
ogg_buffer_page(s, oggstream);
}
oggstream->page.start_granule = AV_NOPTS_VALUE;
ogg_write_pages(s, 1);
return 0;
}
| 1threat
|
const QEMUSizedBuffer *qemu_buf_get(QEMUFile *f)
{
QEMUBuffer *p;
qemu_fflush(f);
p = f->opaque;
return p->qsb;
}
| 1threat
|
static void apply_motion_8x8(RoqContext *ri, int x, int y,
unsigned char mv, signed char mean_x, signed char mean_y)
{
int mx, my, i, j, hw;
unsigned char *pa, *pb;
mx = x + 8 - (mv >> 4) - mean_x;
my = y + 8 - (mv & 0xf) - mean_y;
pa = ri->current_frame.data[0] + (y * ri->y_stride) + x;
pb = ri->last_frame.data[0] + (my * ri->y_stride) + mx;
for(i = 0; i < 8; i++) {
pa[0] = pb[0];
pa[1] = pb[1];
pa[2] = pb[2];
pa[3] = pb[3];
pa[4] = pb[4];
pa[5] = pb[5];
pa[6] = pb[6];
pa[7] = pb[7];
pa += ri->y_stride;
pb += ri->y_stride;
}
#if 0
pa = ri->current_frame.data[1] + (y/2) * (ri->c_stride) + x/2;
pb = ri->last_frame.data[1] + (my/2) * (ri->c_stride) + (mx + 1)/2;
for(i = 0; i < 4; i++) {
pa[0] = pb[0];
pa[1] = pb[1];
pa[2] = pb[2];
pa[3] = pb[3];
pa += ri->c_stride;
pb += ri->c_stride;
}
pa = ri->current_frame.data[2] + (y/2) * (ri->c_stride) + x/2;
pb = ri->last_frame.data[2] + (my/2) * (ri->c_stride) + (mx + 1)/2;
for(i = 0; i < 4; i++) {
pa[0] = pb[0];
pa[1] = pb[1];
pa[2] = pb[2];
pa[3] = pb[3];
pa += ri->c_stride;
pb += ri->c_stride;
}
#else
hw = ri->c_stride;
pa = ri->current_frame.data[1] + (y * ri->y_stride)/4 + x/2;
pb = ri->last_frame.data[1] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
for(j = 0; j < 2; j++) {
for(i = 0; i < 4; i++) {
switch(((my & 0x01) << 1) | (mx & 0x01)) {
case 0:
pa[0] = pb[0];
pa[1] = pb[1];
pa[2] = pb[2];
pa[3] = pb[3];
break;
case 1:
pa[0] = avg2(pb[0], pb[1]);
pa[1] = avg2(pb[1], pb[2]);
pa[2] = avg2(pb[2], pb[3]);
pa[3] = avg2(pb[3], pb[4]);
break;
case 2:
pa[0] = avg2(pb[0], pb[hw]);
pa[1] = avg2(pb[1], pb[hw+1]);
pa[2] = avg2(pb[2], pb[hw+2]);
pa[3] = avg2(pb[3], pb[hw+3]);
break;
case 3:
pa[0] = avg4(pb[0], pb[1], pb[hw], pb[hw+1]);
pa[1] = avg4(pb[1], pb[2], pb[hw+1], pb[hw+2]);
pa[2] = avg4(pb[2], pb[3], pb[hw+2], pb[hw+3]);
pa[3] = avg4(pb[3], pb[4], pb[hw+3], pb[hw+4]);
break;
}
pa += ri->c_stride;
pb += ri->c_stride;
}
pa = ri->current_frame.data[2] + (y * ri->y_stride)/4 + x/2;
pb = ri->last_frame.data[2] + (my/2) * (ri->y_stride/2) + (mx + 1)/2;
}
#endif
}
| 1threat
|
C++ reading contents from file into a map : <p>I have a file that I want to read into a map.</p>
<pre><code>file.txt
temperature 55
water_level 2
rain 10
........
</code></pre>
<p>While I am aware that I could use the C function 'sscanf' to parse the data. I would prefer to do this in C++ (I am only getting used to the language) and read it into a map (with the first column as the keys and 2nd as the values).</p>
<p>I have attempted it as follows:</p>
<pre><code>#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <map>
using namespace std;
int main(){
const char *fileName="/home/bsxcto/Wedeman_NucPosSimulator/test/params.txt";
ifstream paramFile;
paramFile.open(fileName);
string line;
string key;
double value;
map <string, int> params; #### errors
while ( paramFile.good() ){
getline(paramFile, line);
istringstream ss(line);
ss >> key >> value; # set the variables
params[key] = value; # input them into the map
}
inFile.close();
return 0;
}
</code></pre>
<p>However it's on the initialisation of the map structure that I get a bunch of errors:</p>
<pre><code>Multiple markers at this line
- ‘value’ cannot appear in a constant-
expression
- ‘key’ cannot appear in a constant-expression
- template argument 2 is invalid
- template argument 1 is invalid
- template argument 4 is invalid
- template argument 3 is invalid
- invalid type in declaration before ‘;’ token
</code></pre>
<p>I have also tried 'map' and 'map', but they do not work either.
Can anyone help with this?</p>
| 0debug
|
Function.Function of Java 8 with multiple parameters : <p>I read many examples about how to easily define a lambda in Java 8. This lambda takes always one parameter like <code>f1</code>:</p>
<pre><code>Function<Integer,Integer> f1 = (x) -> Math.pow(x,2);
</code></pre>
<p>Of course, you can extend the body like <code>f2</code>: </p>
<pre><code>Function<Integer,Integer> f2 = (x) -> {if (x < 0) return 0;
else return Math.pow(x,2);};
</code></pre>
<p>But I cannot find a way to define a lambda with a variable number of paramters like <code>f3</code>:</p>
<pre><code>Function<Integer,Integer,Integer> f3 = (x,y) -> {return x + y};
</code></pre>
<p>or without parameter like <code>f4</code>:</p>
<pre><code>Function<Double> f4 = () -> {return Math.random()};
</code></pre>
<p>I am almost sure that you can define own functional interface (i.e., create a new file commonly) to develop <code>f3</code> and <code>f4</code>, but Is there some way to easily define them? </p>
| 0debug
|
App crashes on android 6.0 : I have been getting this this weird Force Close of my app when someone on android 6.0 tries to upload a photo on my app while the app works compeletly fine on Android Kitkat, here is my logcat
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: FATAL EXCEPTION: main
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: Process: com.ummahtalk.network, PID: 14882
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { dat=content://com.android.providers.media.documents/document/image:53790 flg=0x1 }} to activity {com.ummahtalk.network/com.ummahtalk.network.activities.posts.PublishActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=14882, uid=10166 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:3743)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:3786)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.-wrap16(ActivityThread.java)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5466)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=14882, uid=10166 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.os.Parcel.readException(Parcel.java:1620)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.content.ContentResolver.query(ContentResolver.java:493)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.content.ContentResolver.query(ContentResolver.java:435)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.ummahtalk.network.helpers.FilePath.getDataColumn(FilePath.java:117)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.ummahtalk.network.helpers.FilePath.getPath(FilePath.java:82)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.ummahtalk.network.activities.posts.PublishActivity.setImageUriValue(PublishActivity.java:468)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.ummahtalk.network.activities.posts.PublishActivity.onActivityResult(PublishActivity.java:238)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.Activity.dispatchActivityResult(Activity.java:6456)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.deliverResults(ActivityThread.java:3739)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.handleSendResult(ActivityThread.java:3786)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.-wrap16(ActivityThread.java)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5466)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-29 18:36:33.627 14882-14882/com.ummahtalk.network E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
| 0debug
|
How to set spring.main.allow-bean-definition-overriding to true in a Spring boot 2.1.0 starter configuration : <p>I maintain a spring-boot-starter that customizes the error attributes returned when, for instance, a unknown end point is called.
This is done by overriding the org.springframework.boot.web.servlet.error.ErrorAttributes bean.</p>
<p>Everything worked fine with 2.0.6, but <a href="https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.1-Release-Notes" rel="noreferrer">2.1.0 disables bean overriding by default</a>, making the starter now fail with the following message.</p>
<blockquote>
<p>Invalid bean definition with name 'errorAttributes' defined in class
path resource
[com/mycompany/springboot/starter/config/ErrorsConfig.class]: Cannot
register bean definition [Root bean: class [null]; scope=;
abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0;
autowireCandidate=true; primary=false;
factoryBeanName=com.mycompany.springboot.starter.config.ErrorsConfig;
factoryMethodName=errorAttributes; initMethodName=null;
destroyMethodName=(inferred); defined in class path resource
[com/mycompany/springboot/starter/config/ErrorsConfig.class]] for bean
'errorAttributes': There is already [Root bean: class [null]; scope=;
abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0;
autowireCandidate=true; primary=false;
factoryBeanName=org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;
factoryMethodName=errorAttributes; initMethodName=null;
destroyMethodName=(inferred); defined in class path resource
[org/springframework/boot/autoconfigure/web/servlet/error/ErrorMvcAutoConfiguration.class]]
bound</p>
</blockquote>
<p>As explained in documentation setting the spring.main.allow-bean-definition-overriding property to true fixes the problem.
My question is how to do that <strong>in the starter</strong> (I do not want the users of my starter to have to change their application.properties file, for something that is specific to my starter)?</p>
<p>I tried to a @PropertySource("classpath:/com/mycompany/starter/application.properties") annotation to my @Configuration with that property defined in that file, but it doesn't work.</p>
<p>What am I missing? Is there any way to allow my configuration overriding that bean?</p>
<p>Here is the (simplified) source code of the configuration:</p>
<pre><code>@Configuration
@PropertySource("classpath:/com/mycompany/starter/application.properties")
public class ErrorsConfig {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
@Bean
public ErrorAttributes errorAttributes() {
return new DefaultErrorAttributes() {
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> getErrorAttributes(WebRequest request, boolean includeStackTrace) {
Map<String, Object> errorAttributes = super.getErrorAttributes(request, includeStackTrace);
// CustomeError is a (simplified) bean of the error attributes we should return.
CustomError err = new CustomError("myErrorCode", (String) errorAttributes.get("error"));
return OBJECT_MAPPER.convertValue(err, Map.class);
}
};
}
}
</code></pre>
<p>and my resource file com/mycompany/starter/application.properties contains</p>
<blockquote>
<p>spring.main.allow-bean-definition-overriding=true</p>
</blockquote>
| 0debug
|
How to make sure list of parameters are updated before running a Jenkins pipeline? : <p>A Jenkins pipeline project is configured to fetch its <code>Jenkinsfile</code> from a Git repo:</p>
<p><a href="https://i.stack.imgur.com/SHxPB.png" rel="noreferrer"><img src="https://i.stack.imgur.com/SHxPB.png" alt="Pipeline Def"></a></p>
<p>If I change the list of parameters, for example, from:</p>
<pre><code>properties([
parameters([
string(name: 'FOO', description: 'Choose foo')
])
])
</code></pre>
<p>to:</p>
<pre><code>properties([
parameters([
string(name: 'FOO', description: 'Choose foo'),
string(name: 'BAR', description: 'Choose bar')
])
])
</code></pre>
<p>And run the build, the first run does not show the newly added <code>BAR</code> parameter:</p>
<p><a href="https://i.stack.imgur.com/DNsq4.png" rel="noreferrer"><img src="https://i.stack.imgur.com/DNsq4.png" alt="Parameter list not updated"></a></p>
<p>As the updated Jenkins file expects the <code>BAR</code> parameter to be present, this causes the first build after the change to fail as the user is not presented with an input to enter this value.</p>
<p>Is there a way to prevent this? To make sure the <code>Jenkinsfile</code> is up-to-date before showing the parameter entry page?</p>
| 0debug
|
please help me to find the error in my code...! : i been trying to update an entity, but the matter of fact i gotta update them all at update page, else it throws error:
**here's my code**
// to verify if user is an admin
<?php include "include/uni_header.php"?>
<?php
if (isset($_GET['update'])){
if ($_GET['update'] == null){
header("Location: error/error.php");
}else{
$hlp = $_GET['update'];
}
}else{
header("Location: error/error.php");
}
?>
<!-- mail -->
<div class="latest-albums">
<div class="container">
<h3 class="agileits_w3layouts_head"> <span>Update existing</span></h3>
<div class="wthree_latest_albums_grids gallery">
<div class="col-md-9 agile_mail_grid_left">
// here i am trying to fetch all value & putting them on the field
<?php
$sql = "select * from music where id=$hlp";
$getter = mysqli_query($connection, $sql);
while ($row=mysqli_fetch_assoc($getter)) {
$id = $row['id'];
$title = $row['title'];
$singer = $row['singer'];
$description = $row['description'];
$length = $row['length'];
$relese_date = $row['relese_date'];
$lyrics = $row['lyrics'];
$genere = $row['genere'];
$songs = $row['songs'];
$thumbnail = $row['thumbnail'];
$language = $row['language'];
$album_tag = $row['album_tag'];
$youtube_id = $row['youtube_id'];
$feature_tag = $row['feature_tag'];
}
?>
// trying to update
<?php
if (isset($_POST['submits'])){
$title = $_POST['name'];
$singer = $_POST['singer'];
$description = $_POST['description'];
$length = $_POST['length'];
$date = $_POST['release_date'];
$lyrics = $_POST['lyrics'];
$category = $_POST['cat'];
$language = $_POST['cat1'];
$youtube = substr($_POST['youtube'], 17);
$album = $_POST['album'];
//thumbnail
$p_image = $_FILES['images']['name'];
$post_image_temp = $_FILES['images']['tmp_name'];
move_uploaded_file($post_image_temp, "thumbnail/$p_image");
//songs
$upload_file = $_FILES['files']['name'];
$temps = $_FILES['files']['tmp_name'];
move_uploaded_file($temps, "songs/$upload_file");
//query
$query = "update music set title='{$title}', singer='{$singer}', description='{$description}', length='{$length}', relese_date='{$date}', lyrics='{$lyrics}', genere={$category}, songs='{$upload_file}', thumbnail='{$upload_file}', language={$language}, album_tag='{$album}', youtube_id='{$youtube}' where id={$hlp}";
$sender = mysqli_query($connection, $query);
echo "error".mysqli_error($connection);
}
?>
// pushing previously pulled value as user can see old values, it helps to update.
<form action="" method="post" enctype="multipart/form-data">
<label for="name">Enter Song Title</label>
<input type="text" name="name" placeholder="Name" value="<?php echo $title; ?>"><br>
<label for="email">Singer</label>
<input type="text" name="singer" placeholder="Singer" value="<?php echo $singer; ?>"><br>
<label for="description">Description</label>
<input type="text" name="description" placeholder="Description" value="<?php echo $description; ?>"><br>
<label for="length">Run Time</label>
<input type="text" name="length" placeholder="Run Time" value="<?php echo $length; ?>"><br>
<label for="images">Upload the song</label>
<input type="file" name="files" class="btn btn-default">
<label for="album">Album name</label>
<input type="text" name="album" placeholder="Album name" value="<?php echo $album_tag; ?>"><br>
<label for="youtube">Paste the Short URL only</label>
<input type="text" name="youtube" placeholder="ex: https://youtu.be/xxxxx" value="<?php echo $youtube_id; ?>"><br>
*This field only accepts SHORT URL <b>(open the song vid->share->copy link)</b>
<br><br>
<label for="country1">Choose Language</label>
<div class="btn-group">
<select id="country1" class="dropdown" name="cat1">
<?php
$sql1 = "select * from language where id=$language";
$getter1 = mysqli_query($connection,$sql1);
while ($r=mysqli_fetch_assoc($getter1)){
$language=$r['language'];
}
?>
<option class="dropdown-header" value=""><?php echo $language; ?></option>
<?php
$querys = "select * from language";
$sends = mysqli_query($connection, $querys);
while ($row = mysqli_fetch_assoc($sends)) {
$id = $row['id'];
$language = $row['language'];
echo "<option class='dropdown-item' value='{$id}'>{$language}</option>";
}
?>
</select>
</div>
<br><br>
<label for="release_date">Release Date</label>
<input type="date" autocomplete="off" name="release_date" id="date" placeholder="Relese Date" value="<?php echo $relese_date; ?>"><br>
<br>
<label>Upload A Thumbnail Picture</label>
<input type="file" name="images" class="btn btn-default">
<br>
<label>Post the lyrics</label>
<textarea name="lyrics" placeholder="Description of the book" id = "body"></textarea>
<br>
<label for="Genre">Choose Genre</label>
<div class="btn-group">
<select id="country" class="dropdown" name="cat">
<option class="dropdown-header" value=""><?php echo $genere; ?></option>
<?php
$querys = "select * from category";
$sends = mysqli_query($connection, $querys);
while ($row = mysqli_fetch_assoc($sends)) {
$id = $row['id'];
$category = $row['title'];
echo "<option class='dropdown-item' value='{$id}'>{$category}</option>";
}
?>
</select>
</div>
<br><br>
<input type="submit" value="Post Your Song Now" name="submits">
</form>
</div>
<div class="clearfix"> </div>
</div>
</div>
</div>
<!-- //mail -->
<?php include "include/about_footer.php"?>
as i am clicking **submits** it's throwing me an error like bellow:
**You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' album_tag='fefef222', youtube_id='' where id=19' at line 1**
please tell me where's my fault, i been trying to figure it out for a long.. please help....!
| 0debug
|
resetting conda channel priorities : <p>I am having issues with conda. After running commands such as:</p>
<pre><code>conda install -c /my_conda_channel numpy --offline --override-channels
</code></pre>
<p>the default conda channel has now become 'my_conda_channel' so that each subsequent package from this channel supercedes the default channel, which is not what I want. I did the former just for testing purposes.</p>
<p>How do I reset the channel behaviour?</p>
| 0debug
|
int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
int (*compare)(AVFormatContext *, AVPacket *, AVPacket *))
{
int ret;
AVPacketList **next_point, *this_pktl;
AVStream *st = s->streams[pkt->stream_index];
int chunked = s->max_chunk_size || s->max_chunk_duration;
this_pktl = av_mallocz(sizeof(AVPacketList));
if (!this_pktl)
return AVERROR(ENOMEM);
if ((pkt->flags & AV_PKT_FLAG_UNCODED_FRAME)) {
av_assert0(pkt->size == UNCODED_FRAME_PACKET_SIZE);
av_assert0(((AVFrame *)pkt->data)->buf);
}
if ((ret = av_packet_ref(&this_pktl->pkt, pkt)) < 0) {
av_free(this_pktl);
return ret;
}
if (s->streams[pkt->stream_index]->last_in_packet_buffer) {
next_point = &(st->last_in_packet_buffer->next);
} else {
next_point = &s->internal->packet_buffer;
}
if (chunked) {
uint64_t max= av_rescale_q_rnd(s->max_chunk_duration, AV_TIME_BASE_Q, st->time_base, AV_ROUND_UP);
st->interleaver_chunk_size += pkt->size;
st->interleaver_chunk_duration += pkt->duration;
if ( (s->max_chunk_size && st->interleaver_chunk_size > s->max_chunk_size)
|| (max && st->interleaver_chunk_duration > max)) {
st->interleaver_chunk_size = 0;
this_pktl->pkt.flags |= CHUNK_START;
if (max && st->interleaver_chunk_duration > max) {
int64_t syncoffset = (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)*max/2;
int64_t syncto = av_rescale(pkt->dts + syncoffset, 1, max)*max - syncoffset;
st->interleaver_chunk_duration += (pkt->dts - syncto)/8 - max;
} else
st->interleaver_chunk_duration = 0;
}
}
if (*next_point) {
if (chunked && !(this_pktl->pkt.flags & CHUNK_START))
goto next_non_null;
if (compare(s, &s->internal->packet_buffer_end->pkt, pkt)) {
while ( *next_point
&& ((chunked && !((*next_point)->pkt.flags&CHUNK_START))
|| !compare(s, &(*next_point)->pkt, pkt)))
next_point = &(*next_point)->next;
if (*next_point)
goto next_non_null;
} else {
next_point = &(s->internal->packet_buffer_end->next);
}
}
av_assert1(!*next_point);
s->internal->packet_buffer_end = this_pktl;
next_non_null:
this_pktl->next = *next_point;
s->streams[pkt->stream_index]->last_in_packet_buffer =
*next_point = this_pktl;
av_packet_unref(pkt);
return 0;
}
| 1threat
|
static void mcf_uart_do_tx(mcf_uart_state *s)
{
if (s->tx_enabled && (s->sr & MCF_UART_TxEMP) == 0) {
if (s->chr)
qemu_chr_fe_write(s->chr, (unsigned char *)&s->tb, 1);
s->sr |= MCF_UART_TxEMP;
}
if (s->tx_enabled) {
s->sr |= MCF_UART_TxRDY;
} else {
s->sr &= ~MCF_UART_TxRDY;
}
}
| 1threat
|
void aio_context_setup(AioContext *ctx)
{
}
| 1threat
|
How to solve in `block (2 levels) in <top (required)>' in Ruby : I am extracting a value from xml
And I am using that value to check if it exists in a PDF file
@reader = file('C:\Users\ecz560\Desktop\30004_Standard.pdf').parse_pdf
@xml = file('C:\Users\ecz560\Desktop\30004Standard.xml').parse_xmlDoc
@CustName = @xml.xpath("//Customer[RTLtr_Loancust='0163426']//RTLtr_CustomerName").map(&:text).to_s
page_index = 0
@reader.pages.each do |page|
page_index = page_index+1
if expect(page.text).to include @CustName
valid_text = "Given text is present in -- #{page_index}"
puts valid_text
end
end
But I am getting a error
./features/step_definitions/Letters/Test1_Letters.rb:370:in `block (2 levels) in <top (required)>'
./features/step_definitions/Letters/Test1_Letters.rb:368:in `each'
./features/step_definitions/Letters/Test1_Letters.rb:368:in `/^I validate the PDF content$/'
C:\Users\ecz560\Documents\GitHub\ATDD Local\features\FeatureFiles\Letters\Test1_Letters.feature:72:in `Then I validate the PDF content'
How can I resolve this ?
| 0debug
|
static void unassigned_mem_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
#ifdef DEBUG_UNASSIGNED
printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, val);
#endif
#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || defined(TARGET_MICROBLAZE)
cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);
#endif
}
| 1threat
|
Create Word Doc : <p>I have generated </p>
<p><a href="https://i.stack.imgur.com/4BOvX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4BOvX.jpg" alt="enter image description here"></a></p>
<p><a href="https://i.stack.imgur.com/EPy2Z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EPy2Z.jpg" alt="Directory"></a></p>
<p>How would I create a Word Document from the source with C#?</p>
| 0debug
|
sheets / excel look up value by "submission number" return "name" : I have one sheet, with values such as this:
**Sheet A**
[![enter image description here][1]][1]
another sheet with values like so:
**Sheet B**
[![enter image description here][2]][2]
What I would like to do is search in the **Sheet A** by "Submission Number", i.e. the values in cell `A`, I want to search there using the values in cell `B` of **Sheet B** and return the *Name* of the company, the value in **Sheet A**, cell `B`.
I was trying something like this but it didn't work:
=LOOKUP(B2, eligible.submissions!B2:B160,1,1)
So in the example above, for row `1` in **Sheet B** I want to use the value `724`, i.e. (**Sheet B**, column `B`, row 1), to look in the Column `A` of **Sheet A**, there I would find that `724` corresponds to "*Advice Business Development*", and accordingly I want my function to return me that value, the name.
Is this possible with Google sheets or excel?
Which function to use?
I was also trying something like this:
=LOOKUP(B2, SheetA!B2:B160,SheetA!B2)
[1]: http://i.stack.imgur.com/hghYX.png
[2]: http://i.stack.imgur.com/Ghi5H.png
| 0debug
|
Check For Internet Connectivity In Xcode : I am using Swift 3 and xCode 8. All the other scripts and stuff online to do this all raise a lot of errors. How would I in a simple way make the app check for an internet connection when it was launched and if it had one to continue and if it doesn't have a connection to show the user a popup saying so?
I am open to any suggestion. Thank you!
| 0debug
|
void ff_ac3_bit_alloc_calc_bap(int16_t *mask, int16_t *psd, int start, int end,
int snr_offset, int floor,
const uint8_t *bap_tab, uint8_t *bap)
{
int i, j, end1, v, address;
if (snr_offset == -960) {
memset(bap, 0, 256);
return;
}
i = start;
j = bin_to_band_tab[start];
do {
v = (FFMAX(mask[j] - snr_offset - floor, 0) & 0x1FE0) + floor;
end1 = FFMIN(band_start_tab[j] + ff_ac3_critical_band_size_tab[j], end);
for (; i < end1; i++) {
address = av_clip((psd[i] - v) >> 5, 0, 63);
bap[i] = bap_tab[address];
}
} while (end > band_start_tab[j++]);
}
| 1threat
|
Assign Lambda Function To Specific VPC ID in serverless.yml : <p>I am using Serverless framework to deploy a Python lambda function to AWS. In my <code>serverless.yml</code> file I have defined a function which I need to deploy to a VPC with specific ID as only that VPC has network connectivity needed to make some business related requests from the lambda function.</p>
<pre><code> customer_callback:
vpc:
subnetIds:
- subnet-something
handler: myservice/event_stream.customer_callback
</code></pre>
<p>In the documentation, the above example is what they mention as a way to attach the function to a VPC:</p>
<p><a href="https://serverless.com/framework/docs/providers/aws/guide/functions/" rel="noreferrer">https://serverless.com/framework/docs/providers/aws/guide/functions/</a></p>
<p>However, the function is not deployed to a VPC at all, e.g. I end up with:</p>
<p><a href="https://i.stack.imgur.com/zhZ87.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zhZ87.png" alt="enter image description here"></a></p>
<p>I have tried specifying VPC ID directly like this:</p>
<pre><code> customer_callback:
vpc:
id: vpc-something
handler: myservice/event_stream.customer_callback
</code></pre>
<p>But that does nothing as well. The documentation for this issue is basically non-existent and I tried searching a lot so I finally have to post here to ask for help.</p>
| 0debug
|
Using htmlentities & entquotes in sqli injection : Why do many people use htmlentities & ENT_QUOTES? The following code is a sample from one of the most viewed SQLI/PHP CRUD who teaches people. What is he trying to do? What is the purpose? Is it something worth studying for an hour or two? I am assuming it is not trying [https://stackoverflow.com/questions/4809608/how-to-prevent-sql-injection][1] (which can be found in that link). Thanks.
$firstname = htmlentities($_POST['firstname'], ENT_QUOTES);
$lastname = htmlentities($_POST['lastname'], ENT_QUOTES);
if ($stmt = $mysqli->prepare("UPDATE players SET firstname = ?, lastname = ?
WHERE id=?"))
{
$stmt->bind_param("ssi", $firstname, $lastname, $id);
$stmt->execute();
$stmt->close();
}
[1]: https://stackoverflow.com/questions/4809608/how-to-prevent-sql-injection
| 0debug
|
void aio_context_acquire(AioContext *ctx)
{
qemu_rec_mutex_lock(&ctx->lock);
}
| 1threat
|
void helper_booke206_tlbwe(CPUPPCState *env)
{
PowerPCCPU *cpu = ppc_env_get_cpu(env);
uint32_t tlbncfg, tlbn;
ppcmas_tlb_t *tlb;
uint32_t size_tlb, size_ps;
target_ulong mask;
switch (env->spr[SPR_BOOKE_MAS0] & MAS0_WQ_MASK) {
case MAS0_WQ_ALWAYS:
break;
case MAS0_WQ_COND:
if (0) {
return;
}
break;
case MAS0_WQ_CLR_RSRV:
return;
default:
return;
}
if (((env->spr[SPR_BOOKE_MAS0] & MAS0_ATSEL) == MAS0_ATSEL_LRAT) &&
!msr_gs) {
fprintf(stderr, "cpu: don't support LRAT setting yet\n");
return;
}
tlbn = (env->spr[SPR_BOOKE_MAS0] & MAS0_TLBSEL_MASK) >> MAS0_TLBSEL_SHIFT;
tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
tlb = booke206_cur_tlb(env);
if (!tlb) {
raise_exception_err_ra(env, POWERPC_EXCP_PROGRAM,
POWERPC_EXCP_INVAL |
POWERPC_EXCP_INVAL_INVAL, GETPC());
}
size_tlb = (env->spr[SPR_BOOKE_MAS1] & MAS1_TSIZE_MASK) >> MAS1_TSIZE_SHIFT;
size_ps = booke206_tlbnps(env, tlbn);
if ((env->spr[SPR_BOOKE_MAS1] & MAS1_VALID) && (tlbncfg & TLBnCFG_AVAIL) &&
!(size_ps & (1 << size_tlb))) {
raise_exception_err_ra(env, POWERPC_EXCP_PROGRAM,
POWERPC_EXCP_INVAL |
POWERPC_EXCP_INVAL_INVAL, GETPC());
}
if (msr_gs) {
cpu_abort(CPU(cpu), "missing HV implementation\n");
}
tlb->mas7_3 = ((uint64_t)env->spr[SPR_BOOKE_MAS7] << 32) |
env->spr[SPR_BOOKE_MAS3];
tlb->mas1 = env->spr[SPR_BOOKE_MAS1];
if ((env->spr[SPR_MMUCFG] & MMUCFG_MAVN) == MMUCFG_MAVN_V2) {
booke206_fixed_size_tlbn(env, tlbn, tlb);
} else {
if (!(tlbncfg & TLBnCFG_AVAIL)) {
tlb->mas1 &= ~MAS1_TSIZE_MASK;
tlb->mas1 |= (tlbncfg & TLBnCFG_MINSIZE) >> 12;
}
}
mask = ~(booke206_tlb_to_page_size(env, tlb) - 1);
mask |= MAS2_ACM | MAS2_VLE | MAS2_W | MAS2_I | MAS2_M | MAS2_G | MAS2_E;
if (!msr_cm) {
mask &= 0xffffffff;
}
tlb->mas2 = env->spr[SPR_BOOKE_MAS2] & mask;
if (!(tlbncfg & TLBnCFG_IPROT)) {
tlb->mas1 &= ~MAS1_IPROT;
}
if (booke206_tlb_to_page_size(env, tlb) == TARGET_PAGE_SIZE) {
tlb_flush_page(CPU(cpu), tlb->mas2 & MAS2_EPN_MASK);
} else {
tlb_flush(CPU(cpu));
}
}
| 1threat
|
Trying to parse on a hash of symbol in ruby : I try to downcase a parsed option to match only symbol in downcase format because when I match A UPPERCASE OR meltedCASE , my parser return me a nil value :(
Don't want to have a heavy hash like [:ens, :ENS, :eNS, :enS ... etc etc
opts.on("-i", "--instance [INSTANCE]", [:ens, :etu], "Selectionnez l'instance de Gitlab (etu, ens)") do |instance|
# puts instance.inspect
Options[:instance] = instance
end
| 0debug
|
static void ide_reset(IDEState *s)
{
if (s->is_cf)
s->mult_sectors = 0;
else
s->mult_sectors = MAX_MULT_SECTORS;
s->cur_drive = s;
s->select = 0xa0;
s->status = READY_STAT;
ide_set_signature(s);
s->end_transfer_func = ide_dummy_transfer_stop;
ide_dummy_transfer_stop(s);
s->media_changed = 0;
}
| 1threat
|
Django Rest Framework debug post and put requests : <p>I use DRF extension to se json list for model, and there i can debug with <code>debug-toolbar</code> that <code>GET</code> request, but how can i debug <code>POST</code> and <code>PUT</code> requests?</p>
<p>I have this for settings in debug mode:</p>
<pre><code>INSTALLED_APPS += ('debug_toolbar',)
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
DEBUG_TOOLBAR_PATCH_SETTINGS = False
INTERNAL_IPS = (
'127.0.0.1'
)
</code></pre>
<p>Now, when i try with <code>Intercept redirects</code> in debug-toolbar, it doesn't show me toolbar when i do <code>POST</code>.</p>
| 0debug
|
On function expressions - immediately self-invoking anonymous function : <p>I tried this and it works :</p>
<pre><code>a = function(){alert("Hello World")};
a();
</code></pre>
<p>However this not :</p>
<pre><code>function(){alert("Hello World")}();
</code></pre>
<p>It's strange for me because i though it's the same.</p>
| 0debug
|
What is the benefit of having user defined return type over predefined datatype for a method in C#? : <p>What is the benefit of having user defined like class,interface,struct name as return type over predefined datatype for a method?
It would be more helpful if someone give me an example. Thanks in advance.</p>
| 0debug
|
static void serial_update_parameters(SerialState *s)
{
int speed, parity, data_bits, stop_bits, frame_size;
QEMUSerialSetParams ssp;
if (s->divider == 0)
return;
frame_size = 1;
if (s->lcr & 0x08) {
frame_size++;
if (s->lcr & 0x10)
parity = 'E';
else
parity = 'O';
} else {
parity = 'N';
}
if (s->lcr & 0x04)
stop_bits = 2;
else
stop_bits = 1;
data_bits = (s->lcr & 0x03) + 5;
frame_size += data_bits + stop_bits;
speed = s->baudbase / s->divider;
ssp.speed = speed;
ssp.parity = parity;
ssp.data_bits = data_bits;
ssp.stop_bits = stop_bits;
s->char_transmit_time = (NANOSECONDS_PER_SECOND / speed) * frame_size;
qemu_chr_fe_ioctl(s->chr, CHR_IOCTL_SERIAL_SET_PARAMS, &ssp);
DPRINTF("speed=%d parity=%c data=%d stop=%d\n",
speed, parity, data_bits, stop_bits);
}
| 1threat
|
Unity: how to determine turret rotation direction if it has to be limited, and target "passed behind"? : Started some programming in Unity just for fun a couple days ago.
So far my game (pretty much top-down shooter) consists of player flying in an asteroid field, in which lurk enemy ships. Player can shoot down asteroids and enemies, and enemy ships have missile turrets that "track" player.
Everything works fine until I decided that enemy ships shouldn't be able to rotate their turrets all the 360-way.
Think of it as real-world battleship being unable to turn it's front turret (No.1) 180 degrees behind because turret No.2 is in the way.
Currently code for turret rotation is like this:
```
playerTarget = GameObject.FindGameObjectWithTag("Player");
chaseDirection = Quaternion.LookRotation(playerTarget.transform.position - transform.position);
newYaw = Mathf.Clamp(chaseDirection.eulerAngles.y, minYaw, maxYaw);
transform.rotation = Quaternion.Euler(0, newYaw, 0);
```
That works okay, until player flies BEHIND enemy ship. As soon as player gets into turret's "possible rotation angle", it just snaps past "dead zone" to new direction.
That looks ugly.
I thought about coding enemy to start rotating turret in counter-direction as soon as player passes "directly behind" the turret "forward facing" position. But the concept of how to do that eludes me.
Cause as soon as turret rotates just a bit from limit, it's able to turn "towards" player again, and gets stuck at limit again.
I think I am doing something very wrong and missing some easy and logical answer, but it eludes me for several hours already.
| 0debug
|
static void do_udp_write(void *arg, void *buf, int size) {
URLContext *h = arg;
UDPContext *s = h->priv_data;
int ret;
if (!(h->flags & AVIO_FLAG_NONBLOCK)) {
ret = ff_network_wait_fd(s->udp_fd, 1);
if (ret < 0) {
s->circular_buffer_error = ret;
return;
}
}
if (!s->is_connected) {
ret = sendto (s->udp_fd, buf, size, 0,
(struct sockaddr *) &s->dest_addr,
s->dest_addr_len);
} else
ret = send(s->udp_fd, buf, size, 0);
s->circular_buffer_error=ret;
}
| 1threat
|
static int handle_http(HTTPContext *c, long cur_time)
{
int len;
switch(c->state) {
case HTTPSTATE_WAIT_REQUEST:
if ((c->timeout - cur_time) < 0)
return -1;
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
if (!(c->poll_entry->revents & POLLIN))
return 0;
len = read(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);
if (len < 0) {
if (errno != EAGAIN && errno != EINTR)
return -1;
} else if (len == 0) {
return -1;
} else {
UINT8 *ptr;
c->buffer_ptr += len;
ptr = c->buffer_ptr;
if ((ptr >= c->buffer + 2 && !memcmp(ptr-2, "\n\n", 2)) ||
(ptr >= c->buffer + 4 && !memcmp(ptr-4, "\r\n\r\n", 4))) {
if (http_parse_request(c) < 0)
return -1;
} else if (ptr >= c->buffer_end) {
return -1;
}
}
break;
case HTTPSTATE_SEND_HEADER:
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
if (!(c->poll_entry->revents & POLLOUT))
return 0;
len = write(c->fd, c->buffer_ptr, c->buffer_end - c->buffer_ptr);
if (len < 0) {
if (errno != EAGAIN && errno != EINTR) {
return -1;
}
} else {
c->buffer_ptr += len;
if (c->stream)
c->stream->bytes_served += len;
c->data_count += len;
if (c->buffer_ptr >= c->buffer_end) {
if (c->http_error)
return -1;
c->state = HTTPSTATE_SEND_DATA_HEADER;
c->buffer_ptr = c->buffer_end = c->buffer;
}
}
break;
case HTTPSTATE_SEND_DATA:
case HTTPSTATE_SEND_DATA_HEADER:
case HTTPSTATE_SEND_DATA_TRAILER:
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
if (!(c->poll_entry->revents & POLLOUT))
return 0;
if (http_send_data(c, cur_time) < 0)
return -1;
break;
case HTTPSTATE_RECEIVE_DATA:
if (c->poll_entry->revents & (POLLERR | POLLHUP))
return -1;
if (!(c->poll_entry->revents & POLLIN))
return 0;
if (http_receive_data(c) < 0)
return -1;
break;
case HTTPSTATE_WAIT_FEED:
if (c->poll_entry->revents & (POLLIN | POLLERR | POLLHUP))
return -1;
break;
default:
return -1;
}
return 0;
}
| 1threat
|
static uint8_t lag_calc_zero_run(int8_t x)
{
return (x << 1) ^ (x >> 7);
}
| 1threat
|
PHP 5.6.10 - preg_match(): Compilation failed: invalid range in character class at offset 100 : <p>I've following regular expression configured in ZendFrame work routing </p>
<pre><code>'constraints' => array(
'controller' => '[a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'dashname' => '[a-zA-Z0-9_-\s]*',
'formatter' => '[a-zA-Z]*'
)
</code></pre>
<p>throwing error
<b>Warning</b>: preg_match(): Compilation failed: invalid range in character class at offset 100 in <b>app\vendor\zendframework\zendframework\library\Zend\Mvc\Router\Http\Segment.php</b> on line <b>370</b><br />
<br /></p>
<p>Issue seems to be with 'dashname' => '[a-zA-Z0-9_-\s]*',</p>
<p>Same code works in PHP 5.4 version but not in PHP5.6 version, Any help is appreciated.</p>
| 0debug
|
How to call a function continuously in background in php? : <p>I have created a function which check the expired allotments and then update the database. Currently, it is not running automatically. I have to call it again and again.</p>
<pre><code> function checkAndUpdate()
{
...
...
}
</code></pre>
<p>I want some ways to call this function continuously in background.</p>
<p>How to do it in php? </p>
| 0debug
|
Is there a better dependency injection pattern in golang? : <p>Given this code:</p>
<pre><code>package main
import (
"fmt"
)
type datstr string
type Guy interface {
SomeDumbGuy() string
}
func (d *datstr) SomeDumbGuy() string {
return "some guy"
}
func someConsumer(g Guy) {
fmt.Println("Hello, " + g.SomeDumbGuy())
}
func main() {
var d datstr
someConsumer(&d)
}
</code></pre>
<p>Is the wiring of components together that's done in <strong>main</strong> the right way to wire a dependency together? It seems like I'm over using this a bit in my code. Is there a common pattern better than this, or am I overthinking it?</p>
| 0debug
|
2 wordpress websites on one account? : <p>Currently I have one wordpress website installed into the root directory.</p>
<p>How to move it into any inner directory and install another website into the root?</p>
<p>Or maybe will it easier to export data and unistall the old website and install 2 ones? but again How?</p>
| 0debug
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.