id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23507200 | I tried getch() but it won't echo on the screen so it does not work for me.
A: You can use getch() or getche(), both functions are in conio.h
The difference is that getche() echo the character and getch() not.
Here more about: https://www.c-lang.thiyagaraaj.com/archive/c-blog/use-of-getch-getche-and-getchar-in-c
A: M... | |
doc_23507201 | How can I get standard PowerBuilder icons like files with *.ico extension. F.e. Find! or Help! icon like on the picture.
A: They are embedded in the application. You need to use a tool which extracts icons from compiled applications or use a graphic capture tool and make them yourself.
A: If you click on the butto... | |
doc_23507202 | kwargs.setdefault('update_fields', kwargs.get('update_fields', []).append('status'))
It's either this or about 3 lines of code, surely python can do better than this!
A: get and setdefault are essentially two methods of doing the same thing; putting them together is repeating yourself. The only difference between ge... | |
doc_23507203 | Anyway, instead of having my query do delete, I am having it UPDATE. I am running a server on Ubuntu Desktop 12.04. When I run the following code, I var_dump the query to the page so I can see it. I then copy and pasted that query into phpMyAdmin, and it works fine.
However, when I just want to let the site run the ... | |
doc_23507204 | "SELECT GB.BTN,GUP.CUST_USERNAME,GUP.EMAIL from GBS_BTN GB,GBS_USER_BTN GUB,GBS_USER_PROFILE GUP WHERE GB.BTN=GUB.BTN AND GUB.CUST_UID=GUP.CUST_UID AND GB.ET_ID='" + strAccountID + "' ORDER BY CREATE_DATE DESC",oCin"
can some please tell me how to construct the above query to avoid sql injection?
A: Option 1: Use para... | |
doc_23507205 | i manage to get it working with fullscreen API
<img class="zoomE" src="{{ x }}" width="120" height="90" />
<script>
window.onload = () => {
// (A) GET ALL IMAGES
let all = document.getElementsByClassName("zoomE");
// (B) CLICK TO GO FULLSCREEN
if (all.length>0) { for (let i of all) {
i.onclick = () => {
... | |
doc_23507206 | where the query is like
SELECT TOP 1000
t1.*
,t2.*
,t3.*
FROM table t1
LEFT JOIN table t2 ON t1.attr1 = t2.attr1
LEFT JOIN table t3 ON t1.attr1 = t3.attr1
All three table have quite many attributes with attribute names that are duplicate amongst the different tables but not within the same table. Therefore I get... | |
doc_23507207 | I have the respond.src.js file in the same folder as index.html / style.css.
<head>
<meta charset="utf-8" />
<link href="style.css" rel="stylesheet"/>
<script src="respond.src.js"></script>
</head>
Any ideas if I am doing anything wrong here?
I am then simply just adding an iFrame.
<body>
<iframe src="http://ins... | |
doc_23507208 | Firstly, exist one way to get URL to reference theme?
And the second questions, how can make a directory path to reference theme?
Thanks for answer and help!
A: Template URI
To get the current active theme's directory URI, use get_template_directory_uri(). For example:
<?php
$directory_uri = get_template_directory_uri... | |
doc_23507209 | Would appreciate any help!
var pages = [
"www.facebook.com|Facebook",
"www.twitter.com|Twitter",
"www.google.co.uk|Google"
];
function url1_m1(pages, pattern) {
var URL = '' // variable ready to accept URL
for (var i = 0; i < pages[i].length; i++) {
// for each character in the chosen p... | |
doc_23507210 | :)
Here's the JS:
function getLocation(locationrouting)
{
var getLocation= newXMLHttpRequest(); // sending request
getLocation.open("GET", "/PP?PAGE=GETLOCATIONNAME&ROUTINGNUM=" + locationrouting, false);
getLocation.send(null); // getting location
var dv = document.getElementById("location_div");... | |
doc_23507211 | I am bit confused about when to use HTML5 in android.
I need to develop an application like a report viewer from web server.
In this case i also need to use some Android specific features like service, preferences, receivers, charts (with the help of third party library).
So i am little confused about what are the go... | |
doc_23507212 | library(bio3d)
# Import PDB file
pdb <- read.pdb( system.file("examples/1hel.pdb", package="bio3d") )
# Atom 1
sele.1 <- atom.select(pdb, "calpha", resno=43, verbose=TRUE)
# Atom 2
sele.2 <- atom.select(pdb, "calpha", resno=54, verbose=TRUE)
In this example I would like to draw a bond/tangent/line between atoms sel... | |
doc_23507213 | <template id="select-template">
<select data-bind="style: {width: size}, value: value, options: options, optionsText: 'optTxt', optionsValue: 'optId'"></select>
</template>
<template id="input-template">
<!--input type="text" data-bind="style: {width: size}, value: value" /-->
<input type="text" data-bind="... | |
doc_23507214 | This stores quotes as " so printing the output of the database to a page "naked" has never been a problem for XSS attacks etc.
However, I have been asked to have part of my application export certain values as pure data in .csv format and now it's full of said HTML entities.
It seems that I have two options:
*
... | |
doc_23507215 |
A: ini_set("session.gc_maxlifetime","600");
session_start();
A: session_start();
if( time() - $_SESSION['login_time'] > 600)
{
header("Location:login.php");
}
This will check if the session has been running for more than 600 seconds (10 minutes).
Of course first you have to store:
$_SESSION['login_time'] = ti... | |
doc_23507216 | HTML
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<bo... | |
doc_23507217 | Given
array A: ['hello', 'how', 'are', 'you']
array B: ['how', 'are', 'hello']
Will return matches for 'hello', 'how', and 'are'
There seems to be something for PHP, array_intersect() (Check if array contains elements having elements of another array), but nothing for JavaScript.
I would use in if the values were in... | |
doc_23507218 | Please check the class diagram.
Currently the data structure is like this.
Department.m
@implementation Department
- (id)initWithData:(NSDictionary*)data {
if (self = [super init]) {
self.name = data[@"name"];
self.isCollapsed = 0;
self.isSearchCollapsed = 1;
for (NSDictionary ... | |
doc_23507219 | import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup, FormBuilder, Validators, AbstractControl } from '@angular/forms';
import { Registration } from './registration.interface';
@Component({
moduleId: module.id,
selector: 'registration',
templateUrl: 'registration.component.html'
})
expo... | |
doc_23507220 | This is showing as 404.
Kindly help to solve this issue because if this path goes correct I can proceed to access data in min.js file. Kindly help me.
| |
doc_23507221 | 11:09:44 AM: Executing task 'DesktopLauncher.main()'...
Task :core:compileJava UP-TO-DATE
Task :core:processResources NO-SOURCE
Task :core:classes UP-TO-DATE
Task :core:jar UP-TO-DATE
Task :desktop:compileJava UP-TO-DATE
Task :desktop:processResources UP-TO-DATE
Task :desktop:classes UP-TO-DATE
Task :desktop:Desktop... | |
doc_23507222 | I use http://tablesorter.com/docs/ for a project.
Information
I have merged / colspaned two column headers into one. That means one sorting of the third column is missing.
jsFiddle
http://jsfiddle.net/RqN8a/18/
Question
Can I force to add the sorting of the last column back into the merged / colspaned header?
HTML (if ... | |
doc_23507223 |
Small cards in the top row are initially arranged horizontally but I am not able to reposition these cards in a way that the 4 small cards should be on the left side in 2 rows of 2 cards each and add a bigger card on the right side of the page. When I try to do that it appears like this
What I am trying to achieve he... | |
doc_23507224 | I'm understanding now what node.js is and as I understood it's like an apache that response sending an HTTP packet when a client request something. I added Node Express too and I made the MySQL implementation.
Now I made a page with ejs extension that contains a for cycle and the value of a variable taken from the DB. ... | |
doc_23507225 | [{
key1: "Hello",
key2: "There",
}, {
key1: "Goodbye",
key2: "See you",
},]
Note that keys aren't wrapped between " " so it isn't a valid JSON string. Therefore, I can't parse it to JSON/NSArray/NSDictionary without doing some processing.
Does any library/built-in-function exist that can convert this kind of s... | |
doc_23507226 | (define check (lambda (l t)
(cond ((null? t) ‘())
((equal? (car l) (car (tree-labels t))) (check l (cdr(tree-labels t))))
((and (not(null? l))(equal? (cadr l) (car (tree-labels t))) (check l (cdr(tree-labels t))))
(else (cons (car (tree-labels t)) (check l (cdr(tree-labels t)))) )))
A: It's a typo, you prob... | |
doc_23507227 | I send a request to a service (which uses Play framework) with the following parameters (parameter's name should be underscored by convention):
first_name=James&second_name=Parker
Moreover I have a model class in my codebase which looks like this.
public class User {
@Constraints.Required
private String firstNa... | |
doc_23507228 | However, this function only hides the input that is always visible, and does not show when other is selected. I don't know how to change this function.
jQuery('[id^="insurer_multi["]').each(function() {
var thisId = jQuery(this).attr('id');
var index = thisId.substring(thisId.indexOf('[') + 1, thisId.indexOf(']')... | |
doc_23507229 | public class Absence
{
#region Properties
/// <summary>
/// A unique id
/// </summary>
public int Id { get; set; }
/// <summary>
/// Day of the absence
/// </summary>
public int Day { get; set; }
/// <summary>
/// Month of the absence
/// </summary>
public int Mont... | |
doc_23507230 | I would like to script the execution of this programs and since I'm interested in the performance of the application, I would like to run them to get the basic information about the execution like CPU usage, time, memory, and the usual stuff for a basic profiler.
It's possible to do this starting from the executables o... | |
doc_23507231 | a=[]
while((((2**k)-1))<=upper):
#using filter() to generate the list
#in the form of 2^k-1
result=filter(lambda x: x==((1<<k)-1),prime)
a.append(list(result))
k+=1
Please help me and let me know if I am doing anything wrong. I am currently new to Python so I do not have much knowledge.
A: Using ... | |
doc_23507232 | unsubscribing on destroy does not seem to help either.
ngOnInit() {
let counter1 = 0, counter2 = 0;
console.log('MyBiraComponent ngOnInit');
let uk = this.us.get();
this.u = uk.map(person => {
console.log('line 47, Person Id: ', ++counter1);
return person.id;
}).flatMap(id => {
... | |
doc_23507233 |
A: There's no reason why you can't have both. Have you added the UIRefreshControl in the right way?
Here's working code from a project of mine:
var pullToRefreshControl : UIRefreshControl!
override func viewDidLoad() {
super.viewDidLoad()
self.setFooterView()
self.addPullToRefreshView()
... | |
doc_23507234 | protected void btn_Submit_Click(object sender, EventArgs e)
{
foreach (GridViewRow row in gvImage.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
bool isChecked = row.Cells[0].Controls.OfType<CheckBox>().FirstOrDefault().Check... | |
doc_23507235 |
A: Quote from http://social.technet.microsoft.com/wiki/contents/articles/how-to-create-a-x509-certificate-for-sql-azure-database-management-api.aspx :
When you make an API call, you can use the .cer file instead of .pfx file if the associated certificate is installed in the local certificate store. When the .cer is a... | |
doc_23507236 | array (size=8)
0 =>
array (size=2)
'date' => string '17/05/2016 00:00:00' (length=19)
'reason' => string 'DNA' (length=3)
1 =>
array (size=2)
'date' => string '10/05/2016 00:00:00' (length=19)
'reason' => string 'UTA' (length=3)
2 =>
array (size=2)
'date' => string '03... | |
doc_23507237 | This is the code (C++, QT):
Import STEP file and convert it in a OpenCascade object
QString pathFileName = "component.step" ;
STEPControl_Reader reader;
reader.ReadFile(pathFileName.toStdString().c_str());
reader.NbRootsForTransfer();
reader.TransferRoots();
TopoDS_Shape shape;
shape = reader.OneShape();
BRepTools::Cle... | |
doc_23507238 | $i = 0
$folder = Any-path
Get-ChildItem -Path $folder |ForEach-Object
{$extension = $_.Extension
$newName = $_.Directory.Name + '_{0:d3}{1}' -f $i, $extension
$i++
Rename-Item -Path $_.FullName -NewName $newName}
The problem is it renames every file in the directory, every time the script is triggered, which is inef... | |
doc_23507239 | (evil-leader/set-key
"f" 'find-file
"o" 'other-window
"b" 'switch-to-buffer
"k" 'kill-buffer
"1" 'delete-other-windows
"2" 'split-window-below
"3" 'split-window-right
"c" 'winner-undo
"w" 'enlarge-window-horizontally
"t" (lambda () (enlarge-window 5))
"d" 'ido-dired)
I've tried several variations... | |
doc_23507240 | $x = 996;
$x = mysql_query("SELECT aString FROM table1");
the variable x will stored as an int datatype with 996, then after the second line it will stored as a string datatype with the string from the query?
There wont be any casting errors?
A: There will be no errors, except that the second line won't give you a st... | |
doc_23507241 | Package.json:
"peerDependencies": {
"@angular/animations": "~14.2.4",
"@angular/common": "~14.2.4",
"@angular/compiler": "~14.2.4",
"@angular/core": "~14.2.4",
"@angular/forms": "~14.2.4",
"@angular/platform-browser": "~14.2.4",
"@angular/platform-browser-dynamic": "~14.2.4",
"@angula... | |
doc_23507242 | public class User
{
// Primary key
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Guid UserId { get; set; }
[Required]
public Int32 FailedPasswordAttemptCount { get; set; }
[Required]
public Language Language { get; set; }
}
public class Language
{
[Key, DatabaseGen... | |
doc_23507243 |
A: FWIW, '#' appears to work as a comment character.
It at least has the effect of removing unwanted environment declarations. It might be declaring others starting with a #, but... it still works.
EG
DATABASE_URL=postgres://mgregory:@localhost/mgregory
#DATABASE_URL=mysql://root:secret@localhost:3306/cm_central
r... | |
doc_23507244 | I have added a cancel button on my datepicker.
Everything is working, but I am having trouble with the attributed text for the cancel button not taking effect. What am I doing wrong?
Here is a code fragment
cell.field.attributedPlaceholder = NSAttributedString(string: "Cancel",
attributes: [.foregroundColor... | |
doc_23507245 | Ext.define('MyPanel', {
extend: 'Ext.panel.Panel',
layout: 'vbox',
initComponent: function() {
this.items = [
{
xtype: 'panel',
items: [
Ext.create('AddressBar')
]
... | |
doc_23507246 | public function add()
{
$post = $this->Posts->newEntity();
if ($this->request->is('post')) {
$post = $this->Posts->patchEntity($post, $this->request->getData());
if ($this->Posts->saveAll($post)) {
$this->Flash->success(__('The post has been saved.'));
return $this->redi... | |
doc_23507247 | _entity.WorkSet.AddObject( new WorkSet() { Name = "Something" } );
When I query the table after this I receive no results.
_entity.WorkSet.Count() == 0 // always true
That is, until I call SaveChanges. I understand why this is the way it works, but I want to know how I can see my changes in the entity before I persis... | |
doc_23507248 | The 2 setup are a domain controller and an RDP server both 2012 r2. I have then setup RDWeb. I can login to see the links for the resources, clicking on the links downloads the remote app and then it asks for credentials again.... I know it is an easy answer, what is it that I am missing?
Here are pictures of what i... | |
doc_23507249 | Now I want to change the uml:information owner for urn:uuid:00001 to cp:ioNEWONE. I know that it can be done directly by using INSERT DATA and DELETE DATA, but I'd like to use INSERT and DELETE along with WHERE clause, where inside the WHERE I will specify the uri -<urn:uuid:00001>. Is this possible?
This is my RDF f... | |
doc_23507250 | If I drag the chromeless window to my second monitor, the size changes to be bigger or smaller and the updates from the background thread no longer update the UI. If I drag it back to the original monitor, the size restores and the updates resume.
If I change the style to a ToolWindow, everything works correctly; the s... | |
doc_23507251 | I have a navigation list
<div class="nav-container">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="contact.php">Contact</a></li>
</ul>
</div>
I want to give a class to the anchor tag (not the 'li') when I click on it. So far I have:
$(".nav-container li a").click(function(){
... | |
doc_23507252 | int n = 0;
gets_s(r);
gets_s(word);
ind = r - 1;
while (ind = strstr(ind+1 , word))n++;
printf("%d\n", n);
This is a code that my friend sent me for an assignment. We have to find how many times a given word (word in code) appears in a sentence (r in code). Now I don't understand this part ind... | |
doc_23507253 | <ControlTemplate x:Key="ValidationTemplate" >
<Grid>
<AdornedElementPlaceholder Name="MyAdornedElement" />
<Path x:Name="path" Margin="-2,-2,0,0" Data="M 0,10 L 10,0 L 0,0 Z" Fill="{StaticResource BrushError}" StrokeThickness="2" Stroke="White"
Visibility="{Binding ElementName=MyAdo... | |
doc_23507254 | Whats a quick way to remove all *.log files from a folder using PHP?
thankyou
A: With system access
system("rm -rf *.log");
without
just loop through the directory doing a simple unlink if *.log was found.
A: Modify the logger to prepend date 2012-01-18 to the file, then create a function to check your log directory ... | |
doc_23507255 | Here's my code
var size = 3.8;
var particleMat2 = new THREE.PointsMaterial({
size: size,
map: new THREE.TextureLoader().load('/texture/particle.jpg'),
color: 0xffffff,
transparent: true,
blending: THREE.AdditiveBlending,
opacity: 0.1
});
var particleGeo2 = new THREE.IcosahedronBufferGeometry(2... | |
doc_23507256 | # RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC,OR]
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteCond %{HTTP_HOST} !hashstar\.com$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L,NE]
I had added this code to add www & https in the URL forcefully if it is not added. Th... | |
doc_23507257 | def Hash (string):
for x in range(0, len(string)):
if x == 0:
HashC = str(ord(string[x:x+1]))
else:
HashC = HashC+str(ord(string[x:x+1]))
print(HashC)
U = HashC
U = input("What do you want to hash? ")
Hash(U)
print(U)
The output with the print so show me wha... | |
doc_23507258 | Python parse dataframe element
Unfortunately, my data source has other conditions which need handled.
Current pattern is
pattern = r'([^\(]+)(\(([^,]*),(.*)\))?'
trans_field_attr = df['Data Type'].str.extract(pattern, expand=True).iloc[:, [0, 2, 3]]
This handles the (precision,scale) version perfectly e.g NUMBER(22,4... | |
doc_23507259 | For example, if the list is
['a1a','b1a','a10a','a5b','a2a'],
the sorted list should be
['a1a','a2a','a5b','a10a','b1a']
In general I want to treat each number (a sequence of digits) in the string as a special character, which is smaller than any letter and can be compared numerically to other numbers.
Is there any ... | |
doc_23507260 | | A | B | C |
-------------
| a | 1 | 1 |
| a | 4 | 1 |
| b | 2 | 1 |
| b | 6 | 3 |
| a | 4 | 6 |
| b | 2 | 7 |
I want to get the sum of B for different bands of C grouped by A. I can do it by making a new column per band in an inner query that has ones when I want to sum values and zeros where I don't like this:
SELE... | |
doc_23507261 | I have followed the advice of Daniel Pritchett in a similar thread and used the configuration he suggests at https://gist.github.com/dpritchett/c86f6b617d784f943096, and so have a spree_images_paperclip.rb file looking as such:-
Spree.config do |config|
attachment_config = {
s3_credentials: {
access_key_id: EN... | |
doc_23507262 | parameter integer PRECHARGE_CLOCKS = $ceil(PRECHARGE_NS / CLOCK_PERIOD_NS);
And then use the value in a comparion
if(InitPrechargeCounter < PRECHARGE_CLOCKS - 1)
But getting this error
Error (10174): Verilog HDL Unsupported Feature error at Ram.sv(23): system function "$ceil" is not supported for synthesis
Is there... | |
doc_23507263 | There is a azure availability test going to server every 10 minutes.
As this is a dev site there is no traffic to it other than me (at the odd time) and the availability test
I log to a variable internally the startup time and this shows that the site is not restarting
The first request via a browser when this starts h... | |
doc_23507264 |
A: You could use Apache or another web server. Set up an HTML web page with javascript. I recommend using jQuery as it makes making ajax calls so much easier. Have your javascript/ajax/jquery call your python script every x minutes/seconds.
Ensure your apache server is setup to run CGI scripts and ensure they are set ... | |
doc_23507265 | fn echo_loop(device: &str) {
let f = File::open(device).unwrap();
let read = BufReader::new(&f);
let mut writer = BufWriter::new(&f);
read.lines().for_each(|l: Result<String, Error>| match l {
Ok(line) => {
let _ = writer.write(line.as_bytes()).unwrap();
let _ = writer.f... | |
doc_23507266 | I chose MySQL as the main database, created a user table then quit with exit.
Then when I run my program I get this error :
OperationalError: (1045, u"Access denied for user 'root'@'localhost' (using password: YES)")
So I tried to access to the database and try to fix it but I just can't get access to MySQL.
I tried... | |
doc_23507267 | In my case I'm getting items from a list with around a 1000 items. I dynamically create a statement with all the IDs in nested OR-blocks for my CAML-query. I didn't worry about the big number of nested blocks as this is what MSDN states about the OR-element:
Occurrences: Minimum: 0, Maximum: Unbounded.
and:
This elemen... | |
doc_23507268 | cellTable.addColumn(qty, "Qty",Integer.toString(totalQty));
This is not i am looking for,Is there any way to set footer to cell table dynamically.Any help?
A: You need to implement a custom Header and add it to the column which should contain that footer.
For example:
public class QuantityFooter extends Header<Num... | |
doc_23507269 | (async function main() {
// Make a new RSS Parser
const parser = new Parser();
// Get all the items in the RSS feed
const feed = await parser.parseURL("https://imaginescan.com.br/feed"); // https://www.reddit.com/.rss
let items = [];
// Clean up the string and replace reserved characters
... | |
doc_23507270 | Before adding float: right, when this selection would happen, it would only surround a narrow area around the number creating an oval. After adding float: right, the clicked number is surrounded with a circle with plenty of space between the edge and the number, as it should be. However, the float is now affecting the ... | |
doc_23507271 | - name: Add a CKAN user
user:
name: ckan
comment: "CKAN User"
shell: /sbin/nologin
create_home: yes
home: /usr/lib/ckan
state: present
- name: chmod 755 /usr/lib/ckan
file:
path: /usr/lib/ckan
mode: u=rwX,g=rX,o=rX
recurse: yes
- name: Create Python virtual env
command: virt... | |
doc_23507272 | When I change the image to a simple red-square, I can see the notification, but the notification is not even red colored. How can I properly set the Notification image to desired image. Thank you.
As you can see the first notification, the icon is not proper.
Screenshot :
Code :
NotificationCompat.Builder mBuilder ... | |
doc_23507273 | vector<vector<int>> coinGroups;
In each step of my algorithm, I attempt to combine each (vector of int) with each other one. For a combine to pass and be added to the vector vector for the next loop iteration, it has to pass three criteria, two of which are super fast and not relevant here, but the one that is slow i... | |
doc_23507274 | After I filter the main data set for a given name, I am attempting to subtotal a particular filtered column (let's say column C), for example:
Sub CreateSheets()
Dim wsCurrent As Worksheet
Dim wsNew As Worksheet
Dim iLeft As Integer
Dim length As Long
Set wsCurrent = ActiveSheet
Application.Sc... | |
doc_23507275 | bool checkDuplicates( int array[], int n)
{
int i,j;
for( i = 0; i < n; i++ )
{
for( j = i+1; j < n; j++ )
{
if( array[i] == array[j] )
return true;
}
}
return false;
}
A: you can quicksort the array (n log(n)), then finding duplicates becomes line... | |
doc_23507276 | Since I am using winapi and there is a Handle that should be opened and closed, I should implement RAII on this code, the problem is the examples given in online forums (not to mention that I am not a native English speaker) and many books including Effective C++ are way over the head of a person who isn't finding any ... | |
doc_23507277 | import java.util.*;
class Loader
{
protected int BucketSize;
protected int bucket;
protected int price;
public void SetBucketSize(int b)
{
Scanner input = new Scanner(System.in);
System.out.println("What Bucket Size (1-5)?");
bucket = input.nextInt();
while (bu... | |
doc_23507278 | def findNode(self, start, name)
&
def findNodeByLineno(node, lineno, prevNode, nodeType=None)
The first function searches for a node given name, the latter one compares line numbers & node's type, if given.
My subconsciousness tells me that this a leaky interface design, but I cannot come up with a decision how to me... | |
doc_23507279 | {
ArrayList Sorting = new ArrayList();
Sorting.Add (lbNumbers.Text);
int[] items = new int[Sorting.Count];
Sorting.CopyTo(items);
Array.Sort(items);
lbNumbers.Items.Add(items);
}
A: Probably because when your numbers are represen... | |
doc_23507280 | How do I achieve the same thing for property myobject.myproperty.
UPDATE: Specific scenario.
I have an object from a third party library that defines a load of constant values used throughout its api
obj = {
CONST1 = 1;
CONST2 = 2;
CONST3 = 3;
// ...
}
I'm handling events that are called with these values and ... | |
doc_23507281 | I need to pinch zoom an element (specifically an image) in javascript (using Phonegap),but All the plugin that I've found seems to work only with iOS.
The plugins that I have tested are:
Hammer
iScroll
scripty2
jquery touchy
and the touchmove event of javascript.
These plugins do not work, or work in spurts, in Android... | |
doc_23507282 | {
"vehicles": [
{
"key": "1",
"plate": "BLANKET",
"assignee_key": "",
"assignee": {
"key": "",
"fname": "",
"mname": "",
"lname": ""
},
"year": "",
"make": "",
... | |
doc_23507283 | protected void Ok_Click(object sender, EventArgs e)
{
try
{
if (Page.IsValid)
{
int course_id = Convert.ToInt32(course.SelectedValue);
int passoutYear = Convert.ToInt32(passout.SelectedValue);
int currentBacklog = Convert.ToInt3... | |
doc_23507284 | What I have so far is below. It won't work though. It basically gives me junk output. The problem I think is that the perl script used a hex-based encryption. How do I go about decoding that? Can someone point me to where I went wrong?
/*
Test to decode perl-encrypted string.
NOTE: Not all code written by me. Function ... | |
doc_23507285 | structure(list(Year = c(2002, 2002, 2002, 2002, 2002, 2002, 2002,
2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002,
2002, 2002, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003,
2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003, 2003,
2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004, 2004... | |
doc_23507286 | [IDNum FirstName LastName test1Score test2Score test3Score......]
I need to print the test averages in the following format:
Test1: test1Avg
Test2: test2Avg
Test3: test3Avg
.
.
.
I'm struggling immensely to get the test averages to be unique (not all the first test's avg)
I'm running this awk statement, but... | |
doc_23507287 | My code is:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add(0, 0, 0, "Quit").setIcon(R.drawable.ic_launcher);
getMenuInflater().inflate(R.layout.menu, menu);
return true;
}
and in xml:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"... | |
doc_23507288 | from googleapiclient.discovery import build
service = build('translate', 'v2', developerKey='my_key')
translation = service.translations().list(
source='zh',
target='en',
q=text_for_translation).execute()
HttpError: HttpError 500 when requesting https://www.... | |
doc_23507289 | SELECT *
FROM table
WHERE date <= '2015-12-31 23:59:59' AND customer_id = 100
ORDER BY date DESC
LIMIT 1
A: You can use NOT EXISTS():
SELECT * FROM YourTable t
WHERE t.date <= '2015-12-31 23:59:59'
AND NOT EXISTS(SELECT 1 FROM YourTable s
WHERE t.customer_id = s.customer_id... | |
doc_23507290 |
A: No. You need VS 2010.
A: No, but you can download visual studio express which is free. That will allow you to create .Net 4.0 applications.
http://www.microsoft.com/express/Downloads/
A: No, you can not.
A: .NET Framework 4 is quite different from previous versions, and VS2008 doesn't support this. At least for... | |
doc_23507291 | this is my code. but did not work.
function decode_func(){
$json = file_get_contents('https://api.pray.zone/v2/times/today.json?city=jakarta');
$decoded_json = json_decode($json,true);
$results = $decoded_json['results'];
foreach($results as $result) {
$datetime = $result['datetime'];
f... | |
doc_23507292 | Most browsers don't change the Referer header when encountering a 3xx (301, 307, etc.) redirect code so I can't use that. So I'm wondering what the best way is to accomplish what I need? I have HTML, PHP, and if necessary JavaScript at my disposal.
Thanks,
Harry
P.S. I've done enough HTML, PHP, and JavaScript coding... | |
doc_23507293 | import socket
import concurrent.futures
def _scan(ip, port):
scanner = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
scanner.settimeout(1)
try:
scanner.connect((ip, port))
scanner.close()
return True
except:
return False
def portScan(ip, workers, portNum):
with ... | |
doc_23507294 | Am having issue posting date input to database. I have about five date field input in my application but i only get the date_of_birth posted, using the same concept the rest of the post not posting.
this shot indicate the value works but then on the DB is showing 0000-00-00
here is my code
html
<div class="... | |
doc_23507295 | Symbol's function definition is void: apropos-macrop
or
File mode specification error: (void-function apropos-macrop)
my css file (ending in .css) is in Fundamental. I just tried it on a 23.1.1 and CSS mode comes up and works fine.
Update: Traced problem to my autoloads. i.e., comment out autoloads
;(load "~/modes/aut... | |
doc_23507296 | Here is my xaml page setup:
<Page
...
<SplitView IsPaneOpen="True" DisplayMode="Inline" OpenPaneLength="300">
<SplitView.Pane>
<Grid>
<ToggleButton x:Name="Edit" IsEnabled="False" Checked="Edit_Checked" Unchecked="Edit_Unchecked"/>
</Grid>
</SplitView.Pane... | |
doc_23507297 |
*
*production usage
*development specific code and warnings with devtools integration.
When I was using webpack, I had:
module.exports = [
defaultUmdBuild("production"),
defaultUmdBuild("development"),
];
which outputs two files and then I have this entrypoint to my library:
'use strict';
if (process.env.NODE... | |
doc_23507298 | We want to stop validate to bootstrap style validations. It keeps us giving this error message.
Angular-auto-validate: invalid bs3 form structure elements must be wrapped by a form-group class
as per the plug-in documentation we added this few configurations but seems like we are doing something wrong.
validator.setVa... | |
doc_23507299 | Here are my classes. Beginning with a less important model class:
package de.mk_xappo.mockitoexample;
import java.io.Serializable;
public class SpecialData implements Serializable {
int someData_1;
int someData_2;
public int getSomeData_1() {
return someData_1;
}
public void setSomeData... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.