text:
Q: What exactly is chflags opaque, nodump? I've gotten to grips with the chflags man page so far, even if it's rather uncommon for man pages. Nevertheless, I find 2 parameters very peculiar. What exactly does chflags opaque and nodump do?
Manpage

https://ss64.com/osx/chflags.html

A: The nodump file flag can still be used by macOS. Apparently, the opaque file flag has never been used by macOS or OS X since at least Snow Leopard.

Here is an example of the use of the nodump file flag.
Below is the output from the command ls -lO hi.txt bye.txt. Note bye.txt has the nodump flag.
-rw-r--r--  1 davidanderson  staff  nodump 8 Mar 20 12:13 bye.txt
-rw-r--r--  1 davidanderson  staff  -      9 Mar 20 12:13 hi.txt

Next, the command tar --nodump -cf mytarball hi.txt bye.txt is executed to create the archive file mytarball. Afterwards, if the command tar -tvf mytarball is entered, the contents of the archive will be printed. Below is the output.
-rw-r--r--  0 davidanderson staff       9 Mar 20 12:13 hi.txt

Note that the file bye.txt was omitted from the archive because of the nodump flag.

Here is an example of the use of the opaque file flag.

While I can provide an example, the example will not work with macOS. Instead the example will use the current version of FreeBSD.

The macOS operating system is derived from parts of BSD Unix. BSD implements two forms of unioning: the -o union option to the mount command and the mount_unionfs command. When testing various versions of OS X and macOS, I found Snow Leopard does implement the -o union option, while High Sierra and Big Sur ignore this option. All three versions do not include the mount_unionfs command. AFAIK, the opaque file flag is only used by this latter form of unioning. So to provide an example, I will turn to FreeBSD, which does include the mount_unionfs command.

The basic idea here is to allow modifications to be made to a read-only mount. In the following example, I will remove a directory containing a file, then create a new empty directory with the same name.

In this example, I have a DVD with two directories named dog and cat. The directory dog contains the file poodle and the directory cat contains the file siamese. After putting the DVD in the optical drive, I entered the following commands as root user to mount the DVD and view the contents. The current directory is the root user's home directory /root.
mkdir pets
mount -t cd9660 /dev/cd0 pets
ls -lRFo pets

Below is the sample output.

To allow modifications, I created and mounted the empty directory changes using the -t unionfs option. Also, I printed out the mounts to pets. The mount command actually uses the mount_unionfs command to perform the mount.
mkdir changes
mount -t unionfs changes pets
mount | grep pets

Below is sample output.

Next, I used the commands below remove the directory named dog and confirm the change.
rm -fr pets/dog
ls -lRFo pets
ls -lRFo changes

Below is a sample output. Note that the directory dog no longer appears in directory pets. Also, the directory changes appears to have only gained the empty directory cat.

However, a whiteout named dog was added to the directory changes and thus the directory pets. To see the whiteout, the -W option needs to be added to the ls command, as shown below.
ls -lRFoW pets
ls -lRFoW changes

Below is a sample output.

The whiteout dog masks the directory dog on the DVD. Next, I used the commands below to create a new empty directory named dog and show the changes.
mkdir pets/dog
ls -lRFoW pets
ls -lRFoW changes

Below is a sample output.

Here, the whiteout dog was replaced by the directory dog with the opaque file flag set. This directory masks the directory dog on the DVD. To demonstrate the need for the opaque file flag, I used the commands shown below to remove the opaque file flag and show the results.
chflags noopaque changes/dog
ls -lRFoW pets
ls -lRFoW changes

Below is a sample output.

Without the opaque file flag, the file poodle incorrectly appears in the pets/dog directory.
The final commands below just undo all the mounts and changes made in this example.
umount pets
umount pets
ls -lRFoW pets
ls -lRFoW changes
rmdir pets
rm -fr changes

Below is a sample output.

References
Unioning file systems: Architecture, features, and design choices
Union file systems: Implementations, part I
Wikipedia: macOS
Unionfs: document reasons for opaque directories
FreeBSD ls command
FreeBSD mount command
FreeBSD mount_unionfs command
Note: FreeBSD was executed by first downloading the virtual machine ready file named FreeBSD-12.2-RELEASE-amd64.vmdk.xz. This file was used to create a VirtualBox virtual machine with a 2013 iMac as host. This file should also be compatible with VMware Fusion Player.

A: Short answer: nothing particularly relevant on modern macOS.
Long answer: both of these flags relate to Unix features that you probably never use.

*

*The opaque flag relates to "union mounts" -- mounting one filesystem over another, so that you can see the files and folders of both mixed together in (what appears to be) a single folder tree. Setting the opaque flag on a folder makes it... well, opaque, so if there's also a folder by the same name in the other filesystem, you won't see its contents merged in. Union mounts don't seem to work at all in recent versions of macOS, making this flag completely irrelevant.

*The nodump flag tells the dump program (a backup utility) that the item doesn't need to be backed up. macOS doesn't even include the dump program (though you could probably add it through homebrew or something). You can tell the tar program to skip nodump files with its --nodump options, and I suppose other backup programs could also take this as a "don't back up" flag, but I don't know of any that do this. So again this is pretty irrelevant on macOS.

A: They are POSIX standard flags defined in stat.h and any unix program can read them with the stat call and the system writes and removes them in a standard pattern for compatibility with the dump and unionfs functionality.
/*
 * Definitions of flags stored in file flags word.
 *
 * Super-user and owner changeable flags.
 */
#define UF_SETTABLE 0x0000ffff  /* mask of owner changeable flags */
#define UF_NODUMP   0x00000001  /* do not dump file */
#define UF_IMMUTABLE    0x00000002  /* file may not be changed */
#define UF_APPEND   0x00000004  /* writes to file may only append */
#define UF_OPAQUE   0x00000008  /* directory is opaque wrt. union */
/*


text:
Q: Eventlet WSGI server logging won't stop Good morning,
We are facing a rather odd issue with Eventlet and WSGI server on Python. We are trying to stop it from logging these lines
(5757) accepted ('y.x.z.88', 52344)
(5757) accepted ('y.x.z.88', 52621)

We have tried the following settings in the WSGI server setup
wsgi.server(eventlet.listen(('1.2.3.4', 8000),
                                backlog=10000), hello_world, max_size=10000, log=None,log_output=False)

Can anyone tell us why log=None or log_output=False is not stopping the above lines?
Thanks for your help

A: Thomas.
It was still logging those messages because log_output check was not applied to them.
The issue is fixed in master and will be included in next PyPI release.
To get it right now, use:
pip install https://github.com/eventlet/eventlet/archive/61fc317c22a84201beabe892f61a30ae59206aba.zip
Have a good day.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Gigya API keeps browser login details I'm having issue in clearing logged in details. actually i'm running test suit where multiple test scenario are there. on each test scenario run i'm clearing the browser cookies and session related information by using
await browser.executeScript('window.localStorage.clear();'); await browser.executeScript('window.sessionStorage.clear();'); await browser.driver.manage().deleteAllCookies();
and i checked that cookies and session are getting cleared after every scenario i run. but the things is it's not cleared the browser logging details which i enter the earlier. for an example i  run the first test scenario in that i enter system logged in into the system but when it's got complete i cleared it out the all the stuff. but as soon as i start running second scenario it skipped the login step.
did some research and somethings found that, user is logged in or not this status comes from GIGYA . when we clear down the cookies and cache from browser setting it will logged out the user
now i'm looking the solution is how to clear it out.

A: Gigya session relays in a cookie named glt_<API-KEY> - if that cookie get deleted, the session is lost, and the Gigya Web SDK won't be able to proxy calls to the Gigya API to perform actions such as updating the profile.
The user data is not stored in any cookie, and therefore is not necessary to do that cleanup task, only the session token is stored in a cookie.


text:
Q: Show that a decimal with a repeating pattern represents a rational number?
Exercise 1.3.1 (Guide to Analysis, Hart, p.4) Consider a decimal of the form $x=0.a_1a_2...a_n$ with a repeating pattern of $n$ digits. Write $x = 0.a_1a_2 ... a_n$. Express $10^nx$ as a decimal. Then subtract $x$ and check that $10^nx - x$ is an integer. Deduce that $x$ is rational. Now extend the method to prove that all decimals with a repeating pattern represent rational numbers.

First question:  let $x= 0.33$, then $10^2*.33 - 0.33=33-0.33=32.67$ is not an integer. Now, it seems that I miss understood something. Can someone explains to me what he is saying.
Thanks in advance.

A: For example, let $x=0.14141414...$.
Then $100x=14.141414...$, so $100x-x=14,$ so $99x=14$ so $x=14/99$.
In general, if $x=0.\overline {a_1a_2\dots a_n}$, where the overline indicates it's repeated,
then $10^nx=a_1a_2...a_n.\overline{a_1a_2\dots a_n}$, so $10^nx-x=a_1a_2\dots a_n$, so $x=\dfrac{a_1a_2\dots a_n}{10^n-1} $ is rational.


text:
Q: galleria php script to load all pics in folder Hi am having trouble figuring this out as I'm fairly new to php got it to open the dir but now I'm having trouble with the getimagesize() function here is the code

<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Photo-Album Paul Bange Roofing</title>

<?php
$directory = "images";
$handle = openDir($directory);
while ($file = readDir($handle)) {
if ($file != "." && $file != ".." && !is_dir($file)) {
if (strstr($file, ".gif") ||
 strstr($file, ".png") ||
 strstr($file, ".jpg")) {
$directory_file = $directory . $file;
$info = getImageSize($directory_file);
echo "
\n";
}
}
}
closeDir($handle);
?>

and the error im getting is:

Warning: getimagesize(images20140509_135116.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /home4/downsys/public_html/galleria/paulbange/index.php on line 22

i get the same error for every pic its trying to load
you can see whats going on at www.allwhite.com/galleria/paulbange/index.php

A: Simple missing slash in the directory.  Change:
$directory_file = $directory . $file;

to
$directory_file = $directory .'/'. $file;


text:
Q: Example of using feature.forEachProperty() in Google Maps javascript v3? Can someone provide an example of forEachProperty()?
https://developers.google.com/maps/documentation/javascript/reference#Data.Feature

forEachProperty(callback:function(*, string))
Repeatedly invokes the given function, passing a property value and
  name on each invocation. The order of iteration through the properties
  is undefined.

Either my google search is flawed or there is not a single instance of it being used in code samples on the web.

A: Consider the geoJSON in this example
It gets loaded to the data layer with
map.data.loadGeoJson('https://storage.googleapis.com/maps-devrel/google.json');

Each letter of the word Google over Australia is a Feature. Each of these features has properties and geometry. For example, if you wanted to know the letter and color properties of each feature you'd do:
map.data.forEach(function(feature) {
    console.log(feature.getProperty('letter'), 'is' ,feature.getProperty('color'));
});

And the result would be
G is blue
o is red
o is yellow
g is blue
l is green
e is red

To get all the properties for a given feature, you would use Feature.forEachProperty()
map.data.forEach(function(feature) {
    console.log('>> ', feature.get('letter'), 'properties are: ');
    feature.forEachProperty(function(value,property) {
        console.log(property,':',value);
    });
});

And the result would be
>> G properties are:
letter : G
color : blue
rank : 7
ascii : 71
>> o properties are:
letter : o
color : red
rank : 15
ascii : 111
>> o properties are:
letter : o
color : yellow
rank : 15
ascii : 111
>> g properties are:
letter : g
color : blue
rank : 7
ascii : 103
>> l properties are:
letter : l
color : green
rank : 12
ascii : 108
>> e properties are:
letter : e
color : red
rank : 5
ascii : 101

Edit: As @mitja pointed out, the method is getProperty, not get. I was using an alias I had set myself for convenience.

A: //assumes that a geoJSON object is already loaded to a google map.data called map
this.LoadFeatureProperties=function(){ //iterate through all features of the loaded geoJSON
    map.data.forEach(function(feature){
        feature.forEachProperty(function(val,key){ //iterate through all properties of each feature
            //alert(key+"____"+val);  //-----------------debug only-------------
            //note function returns value and key in reverse order from key:value
            if(/^clickable|visible|zIndex|cursor|icon|shape|title|strokeColor|strokeOpacity|strokeWeight|fillColor|fillOpacity$/.test(key)){
                map.data.overrideStyle(feature, {[key]:val}); //key must be dereferenced ;( --> alternative is: var o={};o[key]=val;
            }
        });
    });
}


text:
Q: Cant get private key from certificate So, I having trouble to get the private key from the certificate. This is my first time working with certificates and I have tried to find a solution to this but I cant make i work. It's a console application and a need the key to sign a SOAP message/request.
Here is a code sample; (Let me know if you need anything more)
    public static X509Certificate2 FindCertificate(string issuedBy)
    {
        var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
        store.Open(OpenFlags.ReadOnly);

        //We gets the certificate from store
        var certificate = store.Certificates.Cast<X509Certificate2>().FirstOrDefault(c => c.Issuer.Contains($"CN={issuedBy}"));
        if (certificate.HasPrivateKey) // Result: True
        {
            //PrivateKey throws error: Keyset dosent exist
            var key = certificate.PrivateKey;

        }

        if (certificate == null)
        {
            throw new ArgumentException($"Could not find certificate issued by: '{issuedBy}'", nameof(issuedBy));
        }

        var expireDate = DateTime.Parse(certificate.GetExpirationDateString());

        if (expireDate < DateTime.Now)
        {
            throw new Exception($"Certificate has already expired: '{expireDate}'");
        }

        return certificate;
    }

A: An alternative to your own solution (so you don't have to run VS in administrator mode is to give your own user privileges to read the private key.

*

*Open the certificate manager for your machine certificates (type in "certificates" in Windows home menu search and choose "Manage computer certificates"

*Find the certificate and right click -> "All Tasks" -> "Manage Private Keys..."

*Click "Add..."

*Type in your username (and click "Check Names" to see if you typed it in correctly)

*Click "OK" and "OK"

Now you should be able to run your application (and VS) normally with access to the private key.

A: I was able to get it to work now just by start Visual Studio in Admin mode.


text:
Q: Getting a 404 when trying to access a url python/django Currently getting a 404 error for my application when I try to access the url /contato, and I am not sure why, can anyone help me?
Here is the error:
Page not found (404)

Request Method: GET

Request URL:    http://localhost:8002/contato

(...)
^contato/
(...)

Here is my code.
My main urls.py has:
from django.conf.urls import patterns, include, url

from django.conf import settings
from django.contrib import admin
urlpatterns = patterns('',
    url(r'^admin/password_reset/$', 'django.contrib.auth.views.password_reset', name='admin_password_reset'),
    url(r'^admin/password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
    url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
    url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),

    url(r'^admin/', include(admin.site.urls)),

    url(r'^perfil/', include('perfil.urls')),
    url(r'^contato/', include('contato.urls')),
    url(r'^$', 'views.index', name='index'),)

My contato.urls.py:
from django.conf.urls.defaults import patterns, url

urlpatterns = patterns('contato.views',
    url(r'^contato/$', 'contato', name="contato"),
)

my views.py in contato:
from django.shortcuts import render_to_response
from django.template import RequestContext

def contato(request):
render_to_response('contato/contato.html',locals(),context_instance=RequestContext(request),)

A: You don't have a match for the url "/contato". In your base urls.py, you point the prefix "/contato" to include contato.urls, and then in that file you have a single URL which is again "/contato": so the combined URL for that view is "/contato/contato".
If you just want the URL to match "contato", you should either get the included url to match just "^$", or (probably better) don't bother including the separate urls.py and match the view directly from the base file.


text:
Q: tutte's kirchhoff matrix and the matrix-tree theorem for digraphs In his books, Tutte tells often of how he and his friends in Cambridge introduced a theory of non-symmetric electricity. His tales are always amusing and enjoyable, but often lack precise references; it does not help, either, that he often published his articles in journals that have little or no internet visibility nowadays.
In particular, I am trying to track back his version of the Matrix-Tree Theorem for digraphs, which makes use of the so-called Kirchhoff matrix - basically, the diagonal matrix of the outdegrees minus the outgoing adjacency matrix, but I am incredibly stuck with his books (it is Theorem VI.27 of his "Graph Theory" book from 1984, for instance). But I cannot believe the theorem is so young. Concerning the Kirchhoff matrix itself, it seems to appear in "The dissection of equilateral triangles into equilateral triangles" from 1948. Maybe even earlier?
Can anybody help?

A: I have a copy of the two volumes "Selected Papers of W. T. Tutte" in which his (self-selected) best papers are reprinted with a short commentary preceding each paper.
He has the following things to say, the first quote relevant to the directed theorem, and the second to the original theorem.
Re: The dissection of equilateral triangles into equilateral triangles (1948)
".. we find a proof of the directed form of the Matrix-Tree theorem. Perhaps this is the most important theorem of the paper, though I did not realize it at the time."
Re: The dissection of rectangles into squares (1940)
"There seems to be some confusion as to where the Matrix-Tree theorem was first stated. Some say in the paper we are discussing. I think howeve [sic] that Kirchhoff stated it clearly enough in the terminology of his time."


text:
Q: Unexpected latency issues AWS-API Gateway I need help to troubleshoot AWS API gateway latency issues. We have same configuration and even data everything same but facing high latency issues in Non Prod. Actually we are using Nlb and VPC link for API Gateway . Please find same values here below.
We have copied the data from dev mongo to test environment to make sure the same volume of data is present in both the places. We hit /test/16 from both the environment, but experiencing very high latency in dev as compared to sandbox.
Test:
Request:/test/16
Status:200
Latency:213ms
Dev:
Request:/test/16
Status:200
Latency:4896ms

A: Have you checked your VPC logs to see the flow paths for the requests? If not, I suggest starting there.
As FYI, you can learn about VPC flow logs at https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#working-with-flow-logs.

A: What is behind the load balancer? Anything you are reaching for with DNS names or just IPs?
We had a similar problem at one point, looking in the monitoring of the load balancer(ELB) we found that the problem was downstreams.
The monitoring even showed that we got 504s in the load balancer.
In our case it was DNS caching that caused it, the target instances had been replaced and the DNS in some nginx instances, on the network path to the target, had not been updated.
The nginx instances had to be updated with dynamic DNS resolving. Since nginx default only resolved the target on startup.
With out knowing your architecture however, hard to say what can cause your problems. Here is another DNS story, with some debugging examples: https://srvaroa.github.io/kubernetes/migration/latency/dns/java/aws/microservices/2019/10/22/kubernetes-added-a-0-to-my-latency.html
Good luck.


text:
Q: Create a map of an object (not using underscore) I would like to do almost the exact same thing this user wants to do: Underscore.js: create a map out of list of objects using a key found in the object
Only...

*

*I don't want to use the underscore library or jQuery. Just plain old JS.

*I don't want my object key to be a string

So if I have an object like so -
var some_object_array = [{id: 1, val: 55}, {id: 2, val: 1}, {id: 3, val: 45}];

I want to convert this into -
var some_map = {1: {id: 1, val: 55}, 2: {id: 2, val: 1}, 3: {id: 3, val: 45}};

Also, I apologize if this is a silly questions. I'm new to JS and I've been trying to figure this out for the last two hours and keep getting the wrong result. I managed to return an object that looks like this:
{ '1': [ { id: 1, val: 55 } ],
  '2': [ { id: 2, val: 1 } ],
  '3': [ { id: 3, val: 45 } ] }

My code:
var some_object_array = [ {id: 1, val: 55},
                          {id: 2, val: 1},
                          {id: 3, val: 45}
                        ];

function groupBy(array, callback) {
  return array.reduce(function (result, item) {
    var key = callback(item);
    result[key] = item[key] || [];
    result[key].push(item);
    return result;
  }, {});
}

console.log(groupBy(some_object_array, function(i) { return i.id; }));

Not quite right. My inner objects are in arrays and my key is converted to a string.  Not surprising, but I just don't know how to modify my code.

A: You were over complicating things there,.
All you needed to do was just assign item to the result[key].

var some_object_array = [
  {id: 1, val: 55},
  {id: 2, val: 1},
  {id: 3, val: 45}
];

function groupBy(array, callback) {
  return array.reduce(function (result, item) {
    var key = callback(item);
    result[key] = item;
    return result;
  }, {});
}

var r = groupBy(some_object_array, function(i) { return i.id; });
console.log(r);
//now lets get item with id 2
console.log(r[2]);

A:

var objArr = [{id: 1, val: 55}, {id: 2, val: 1}, {id: 3, val: 45}];
var some_map = {1: {id: 1, val: 55}, 2: {id: 2, val: 1}, 3: {id: 3, val: 45}};

// Initialize empty object literal:
let objMap = {};

for (let i = 0; i < objArr.length; i++) {
  let key = objArr[i].id;
  objMap[key] = objArr[i];
}

console.log('Object Map:\n', objMap);
/* Object Map:
{
  "1": {
    "id": 1,
    "val": 55
  }, "2": {
    "id": 2,
    "val": 1
  }, "3": {
    "id": 3,
    "val": 45
  }
}
*/


text:
Q: After importing a module in ReactJS npm start wont compile I am using create-react-app to build a simple gallery based on reddit API using reddit.js
I used npm install --save reddit.js in the "C:....\reddit-gallery"
I wrote some basic code, and when using npm start to run it, I keep getting:

Failed to compile.
Error in ./src/App.js
C:....\reddit-gallery\src\App.js
18:9  error  'reddit' is not defined  no-undef

While coding it is recognizing the library, but when using npm it does not recognize any code from that library
The code:
import 'reddit.js';

class App extends Component {

constructor(props){
    super(props);

    this.state = {};

    this.loadSubreddit = this.loadSubreddit.bind(this);
}

loadSubreddit(subre){
    reddit.hot(subre)
        .then(response => {
            return response.json();
        }).then(json => {
            console.log(json)
    })

}

componentWillMount() {
    console.log('comp is mounting');
    this.loadSubreddit('cats');
}

A: This library is not prepared as module so you are not able to import it. You can only include it via <script> tag on the HTML page.


text:
Q: How do I get the live option chain? How do I get the live option chain (every minute or if possible, every second)? Also, I want to refresh my excel each time which contains this data (exported from Python) so that charts can be refreshed?
I have written this below code to fetch the end of day data:
#spot market inputs
s_ticker = "ITC"
start_date = date(2020,12,7)
end_date = date(2021,1,15)
expiry_date = date(2021,1,28)

#option market inputs
option_tick = 5
coverage = 100
atm_strike = 215
ce_type = "CE"
pe_type = "PE"

#special attributes
ce_strike = atm_strike
ce_strike_min = ce_strike - coverage
ce_strike_max = ce_strike + coverage
pe_strike = atm_strike
pe_strike_min = pe_strike - coverage
pe_strike_max = pe_strike + coverage

#data fetching
ce_df_exp = pd.DataFrame()
ce_strike_temp = ce_strike_min
while (ce_strike_temp < ce_strike_max):
    ce_df = get_history(symbol=s_ticker,
                            start=start_date,
                            end=end_date,
                            option_type=ce_type,
                            strike_price=ce_strike_temp,
                            expiry_date=expiry_date)
    temp1 = ce_df
    ce_df_exp = ce_df_exp.append(temp1.tail(1))
    temp1 = pd.DataFrame()
    ce_strike_temp = ce_strike_temp + option_tick
ce_df_exp

A: Try coding this way.
import requests
import json
import pandas as pd
from pandas.io.json import json_normalize

urlheader = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36",
    "authority": "www.nseindia.com",
    "scheme":"https"
}

expiry_dt = '28-Jan-2021'
url = 'https://www.nseindia.com/api/option-chain-indices?symbol=NIFTY'
data = requests.get(url, headers=urlheader).content
data2 = data.decode('utf-8')
df = json.loads(data2)
json_ce = eval("[data['CE'] for data in df['records']['data'] if 'CE' in data and data['expiryDate'] == '" + expiry_dt + "']")
df_ce = json_normalize(json_ce)
print('*** NIFTY Call Options Data with Expiry Date: '+ expiry_dt + ' *** \n', df_ce)
json_pe = eval("[data['CE'] for data in df['records']['data'] if 'PE' in data and data['expiryDate'] == '" + expiry_dt + "']")
df_pe = json_normalize(json_pe)
print('*** NIFTY Put Options Data with Expiry Date: '+ expiry_dt + ' *** \n', df_pe)


text:
Q: Runtime error 3144 I am using this code and once I run it I get runtime error 3144. I don't know where in the code needs to be changed or is not correct. Can you please help me to fix it?
CurrentDb.Execute "UPDATE WORKED_HOURS " & _
" set EMPLOYEE_ID=" & `enter code here`Me.cboEmployeeID & _
", SET FIRST_NAME='" & Me.FIRST_NAME & "'" & _
", SET LAST_NAME='" & Me.LAST_NAME & "'" & _
", Set WORK_ORDER_NO='" & Me.cboWorkOrderNo & "'" & _
", SET PROJECT_TITLE='" & Me.txtProjectTitle & "'" & _
", SET WORKED_DATE='" & Me.txtWorkedDate & "'" & _
", SET TIME_STARTED='" & Me.txtTimeStarted & "'" & _
", SET TIME_FINISHED='" & Me.txtTimeFinished & "'" & _
", SET WEEK_ENDING='" & Me.txtWeekEnding & "'" & _
" where EMPLOYEE_ID=" & Me.cboEmployeeID.Tag

A: You (also) need proper formatting of your date and time values.
A method is to apply this function. See in-line comments for usage:
' Converts a value of any type to its string representation.
' The function can be concatenated into an SQL expression as is
' without any delimiters or leading/trailing white-space.
'
' Examples:
'   SQL = "Select * From TableTest Where [Amount]>" & CSql(12.5) & "And [DueDate]<" & CSql(Date) & ""
'   SQL -> Select * From TableTest Where [Amount]> 12.5 And [DueDate]< #2016/01/30 00:00:00#
'
'   SQL = "Insert Into TableTest ( [Street] ) Values (" & CSql(" ") & ")"
'   SQL -> Insert Into TableTest ( [Street] ) Values ( Null )
'
' Trims text variables for leading/trailing Space and secures single quotes.
' Replaces zero length strings with Null.
' Formats date/time variables as safe string expressions.
' Uses Str to format decimal values to string expressions.
' Returns Null for values that cannot be expressed with a string expression.
'
' 2016-01-30. Gustav Brock, Cactus Data ApS, CPH.
'
Public Function CSql( _
    ByVal Value As Variant) _
    As String

    Const vbLongLong    As Integer = 20
    Const SqlNull       As String = " Null"

    Dim Sql             As String
    Dim LongLong        As Integer

    #If Win32 Then
        LongLong = vbLongLong
    #End If
    #If Win64 Then
        LongLong = VBA.vbLongLong
    #End If

    Select Case VarType(Value)
        Case vbEmpty            '    0  Empty (uninitialized).
            Sql = SqlNull
        Case vbNull             '    1  Null (no valid data).
            Sql = SqlNull
        Case vbInteger          '    2  Integer.
            Sql = Str(Value)
        Case vbLong             '    3  Long integer.
            Sql = Str(Value)
        Case vbSingle           '    4  Single-precision floating-point number.
            Sql = Str(Value)
        Case vbDouble           '    5  Double-precision floating-point number.
            Sql = Str(Value)
        Case vbCurrency         '    6  Currency.
            Sql = Str(Value)
        Case vbDate             '    7  Date.
            Sql = Format(Value, " \#yyyy\/mm\/dd hh\:nn\:ss\#")
        Case vbString           '    8  String.
            Sql = Replace(Trim(Value), "'", "''")
            If Sql = "" Then
                Sql = SqlNull
            Else
                Sql = " '" & Sql & "'"
            End If
        Case vbObject           '    9  Object.
            Sql = SqlNull
        Case vbError            '   10  Error.
            Sql = SqlNull
        Case vbBoolean          '   11  Boolean.
            Sql = Str(Abs(Value))
        Case vbVariant          '   12  Variant (used only with arrays of variants).
            Sql = SqlNull
        Case vbDataObject       '   13  A data access object.
            Sql = SqlNull
        Case vbDecimal          '   14  Decimal.
            Sql = Str(Value)
        Case vbByte             '   17  Byte.
            Sql = Str(Value)
        Case LongLong           '   20  LongLong integer (Valid on 64-bit platforms only).
            Sql = Str(Value)
        Case vbUserDefinedType  '   36  Variants that contain user-defined types.
            Sql = SqlNull
        Case vbArray            ' 8192  Array.
            Sql = SqlNull
        Case Else               '       Should not happen.
            Sql = SqlNull
    End Select

    CSql = Sql & " "

End Function

A: Update statements in practically every SQL dialect does not allow multiple SET commands but only one with multiple expressions separated by commas. Consider doing so and enclosing properly according to data type with quotes (strings), pound signs (dates) or nothing (integer):
CurrentDb.Execute "UPDATE WORKED_HOURS " _
         & "  SET EMPLOYEE_ID=" & Me.cboEmployeeID _
         & "  , FIRST_NAME='" & Me.FIRST_NAME & "'" _
         & "  , LAST_NAME='" & Me.LAST_NAME & "'" _
         & "  , WORK_ORDER_NO='" & Me.cboWorkOrderNo & "'" _
         & "  , PROJECT_TITLE='" & Me.txtProjectTitle & "'" _
         & "  , WORKED_DATE=#" & Me.txtWorkedDate & "#" _
         & "  , TIME_STARTED=#" & Me.txtTimeStarted & "#" _
         & "  , TIME_FINISHED=#" & Me.txtTimeFinished & "#" _
         & "  , WEEK_ENDING=#" & Me.txtWeekEnding & "#" _
         & "  WHERE EMPLOYEE_ID=" & Me.cboEmployeeID.Tag

But for best practices, consider a paramterized querydef which even avoids needed quotes or pound signs. Jet/ACE SQL allows parameter declaration with the PARAMETERS clause.
Dim qdef As querydef

strSQL = "PARAMETERS [EMPLOYEE_ID] Integer, [FIRST_NAME] Text(255)," _
          & " [LAST_NAME] Text(255), [WORK_ORDER_NO] Text(255)," _
          & " [PROJECT_TITLE] Text(255), [WORKED_DATE] Datetime," _
          & " [TIME_STARTED] Datetime, [TIME_FINISHED] Datetime," _
          & " [WEEK_ENDING] Datetime;"
          & " UPDATE WORKED_HOURS " _
          & " SET EMPLOYEE_ID = [EMPLOYEE_ID]" _
          & "  , FIRST_NAME = [FIRST_NAME]" _
          & "  , LAST_NAME = [LAST_NAME] " _
          & "  , WORK_ORDER_NO = [WORK_ORDER_NO] " _
          & "  , PROJECT_TITLE = [PROJECT_TITLE]" _
          & "  , WORKED_DATE = [WORKED_DATE]" _
          & "  , TIME_STARTED = [TIME_STARTED]" _
          & "  , TIME_FINISHED = [TIME_FINISHED]" _
          & "  , WEEK_ENDING = [WEEK_ENDING]" _
          & "  WHERE EMPLOYEE_ID = [EMPLOYEE_ID]"

Set qdef = Currentdb.CreateQueryDef("", strSQL)

qdef!EMPLOYEE_ID = Me.cboEmployeeID
qdef!FIRST_NAME =  Me.FIRST_NAME
qdef!LAST_NAME = Me.LAST_NAME
qdef!WORK_ORDER_NO = Me.cboWorkOrderNo
qdef!PROJECT_TITLE = Me.txtProjectTitle
qdef!WORKED_DATE = Me.txtWorkedDate
qdef!TIME_STARTED = Me.txtTimeStarted
qdef!TIME_FINISHED = Me.txtTimeFinished
qdef!WEEK_ENDING = Me.txtWeekEnding

qdef.Execute

Set qdef = Nothing


text:
Q: Как создать геттер в главном классе для другого класса в с++? Программу пишу на с++.
У меня есть класс библиотека и в этой библиотека есть поле типом другого класса.  В этом другом классе есть три переменные два интвых числа и третья указатель на динамическую память. В главном классе библиотека я не могу создать геттер на другой класс. Как мне его создать? Проект разбит на файлы.
Заголовок Book.h
#include"Date_of.h"
#include"Name_of_the_person.h"
#include"Reader.h"
using namespace std;

class Book
{
    Date_of publishing;
    char *name;
    Name_of_the_person writer;
    char *genre;
    double price;
    int rating;
    int id;
    int at_hands;
    int popularity_of_the_book;
    int time;
    Book *lib;
    int cnt;

public:
    Book();
    ~Book();
    //explicit operator int();
    template<typename T>
    friend T Check(T &n); //вот здесь у меня друг фукция, которую я также подключил до других классав. Чтобы она нормально заработала в сpp файле мне пришлось добавить template<typename T>.
    void Print_Book(Book &a);
    const char *getName()const;
    Date_of getPublishingDay()const; // здесь я создаю геттер, чтобы получить доступ до дня с другого класса
    Date_of getPublishingMonth()const; // здесь я создаю геттер, чтобы получить доступ до месяца который есть указатель на динамическую память
    Date_of getPublishingyear()const;
    Name_of_the_person getWriter()const;
    char getGenre()const;
    double getPrice()const;
    int getRating()const;
    int getId()const;
    int getAt_hands()const;
    int getPopularity_of_the_book()const;
    int getTime()const;
    /*int setName();
    Date_of setPublishing();
    Name_of_the_person setWriter();
    char setGenre();
    double setPrice();
    int setRating();
    int setId();
    int setAt_hands();
    int setPopularity_of_the_book();
    int setTime();*/

};

Сpp Book
#include "Book.h"

Book::Book()
{
    name = nullptr;
    genre = nullptr;
    price = 0;
    rating=id=at_hands=popularity_of_the_book=time=0;
    Book *lib = nullptr;
    cnt = 0;

}

Book::~Book()
{
}

//
//Book::operator int()
//{
//  return publishing.getDay();
//}

void Book::Print_Book(Book &a) {
    // not done
}

const char *Book::getName()const {
    if (name != nullptr)
        return name;
}

   Date_of Book::getPublishingDay()const {
      return  getDay(); // здесь не выходит сделать геттер

}

другой класс Date of.h
#pragma once
#include <iostream> // здесь мне пришлось подключить библиотека потому, что не видит в cpp file некоторых функций. Хотя я думал,что подтянет с заголовка библиотеки.
class Date_of
{
    int day;
    char *month;
    int year;
public:
    Date_of();
    ~Date_of();

    int getDay()const;
    const char *getMonth()const;
    int getYear()const;
    void setDay(int d);
    void setMonth(const char *m);
    void setYear(int y);
};

Data_of cpp file
#include "Date_of.h"

Date_of::Date_of()
{
    day = 0;
    month = nullptr;
    year = 0;
}

Date_of::~Date_of()
{
}

int Date_of::getDay()const {
    if (day)
        return day;
}

const char *Date_of::getMonth()const {
    if (month != nullptr)
        return month;
}

int Date_of::getYear()const {
    if (year)
        return year;
}

void Date_of::setDay(int d) {
    if (d)
        day = d;
}

void Date_of::setMonth(const char *m) {
    if (m)
        month = _strdup(m);
}

void Date_of::setYear(int y) {
    if (y)
        year = y;
}

Вся программа переделается со структур и там как вы все знаете точку поставил и можно обращаться до объекта другой структуры. В классах я так понимаю нельзя так делать(или я ошибаюсь?) и мне приходится писать сеттеры и геттеры чтобы для данных можно было обращаться. Другие файлы я не подключал, так как думаю, что для решения поставленных задача будет достаточно показного материала. Всех  с Наступающим Новым Годом и Рождеством Христовым!!!

A: Смотрите.  Для решения Вашей задачи есть два варианта (как минимум).
1) В классе Book можно написать всего один геттер для даты
Date_of getDateOf() const
{
    return publishing;
}

А потом где-то в коде будет
Book book;
...
int day = book.getDateOf().getDay(); // или другие методы класса Date_of

book.getDateOf() возвращает обьект класса Date_of для которого мы можем вызвать его методы.
2) В классе Book Вы можете написать
int getPublishingDay() const
{
    return publishing.getDay();
}
const char* getPublishingMonth() const
{
    return publishing.getMonth();
}
int getPublishingyear() const
{
    return publishing.getYear();
}

и возвращать день, месяц и год напрямую
Book book;
...
int day = book.getPublishingDay();

PS. В дополнение скажу, что Вы скорее всего хотели написать lib = nullptr; вместо Book *lib = nullptr; в конструкторе класса Book. Сейчас Вы создаете локальный lib в конструкторе и инициализируете его, вместо lib, который находится в обьекте.
PPS. И Вас с праздниками!


text:
Q: Socket-based communication is independent of a programming language used for implementing it. How is it possible?
I understand that Socket-based Communication is independent between programming languages. Which means, a socket program written in Java language can communicate to a program written in C or C++ socket
program. And I've see many similar questions like mine in Stack overflow and I appreciate those answers.
But I didn't get what I'm looking for. Can anyone answer this with example code as JAVA program as a Server and C++ program as Client which runs on different machine and how they communicate?

Thank You :)

A: Socket communication is basically sending a set of bits (data/packet as you would call at a higher level) from one port to another. Port is nothing but a file/IO stream that can listen to data or send data given the correct address. A valid address is a combination of valid IP address(depending on if you want local or remote communication) and port number.
To answer your question we basically are opening a file, writing or waiting to be written into from another application. So, file open, close, read, write has nothing to do with a programming language. Only thing that varies between different languages are the APIs or interfaces provided to achieve this purpose.
When you open a socket you mention about the protocol you want to use for this communication, it could be TCP/UDP based on the purpose of your application. The protocol decides how the packet/data being sent and received are ordered. Basically, trying to establish a common ground between the 2 parties trying to communicate.
Hope this answer helps!!


text:
Q: Javascript + RegEx: Inconsistent Switch case performance I'm a noob and need some assistance. I am working on a personal project: a text based game. I created a switch case to parse the user input. All but one of the cases works consistently. The case in question can be found here:
https://github.com/cornopaez/cornopaez.github.io/blob/dev/js/adventure-game/controller/controller.js#L386
For those who don't want to hit the link, the code looks like this (without all the extra logic):
var solve = /^solve mystery$/g;

switch (user_input) {
  //Some cases

  case (solve.test(input_string) ? input_string : ""):
    //game logic
    break;

  //Other cases including Default
}

In short, copy/paste "solve mystery" and calling the parser results in mixed results. The logic inside the case only runs every other time. All other cases with a similar setup (a var for the RegEx and a case with the ternary setup) work consistently, without any issues.
As I'm a noob, I know there's probably a better way to achieve the same results in a more succinct way.
Any ideas how to fix this bothersome bug?


text:
Q: Help with instructions for a login system I've been working with my last project from my 3 programming course, and right now I think I'm doing pretty well, basically all I gotta do is interact with Access tables, save, edit, create, etc...
That has been working out pretty well, but right now I'm stuck with my login system, I've created some methods where I encrypt the password, and then I send the password to a table called "security". The fields in the table are: username, password, email, type of account.
I can successfully insert all the respective data in it. Right now I am stuck with the validation. I need to create a system that will let me verify if the username exist (I did it successfully trying to insert the username again and if the username exists it will return an exception), but I don't know how to verify the password that is in the same line.
I was wondering if there is any instruction with which I can extract the information of each field from the username that I verified? please help me...
idk if I explain myself.. ?
ok thank your very much but do u know how can I retrieve it into a variable I have something like this  "select contra from Seguridad where usuaruio = @CLAVE"

A: You are going to want o read a record from the table where the username field is the value of the user name to be tested.   If no record found then insert the record.  If a record found then do other things.
How to do this in VB.Net I don't know.
The query created in code would like something like
"SELECT * from UserTable where UserNameField = "' & varUserName & "'"


text:
Q: Solr DataImportHandler logs into SQL but never fetches any data Hi I have copied my Solr config from a working windows server to a new one, and it can't seem to run an import.
They're both using win server 2008 and SQL 2008R2. This is the data import config:
<dataConfig>
  <dataSource type="JdbcDataSource"  name="ds1"
        driver="com.microsoft.sqlserver.jdbc.SQLServerDriver"
        url="jdbc:sqlserver://localhost;databaseName=DB"
        user="Solr"
        password="pwd"/>
  <document name="datas">
    <entity name="data" dataSource="ds1" pk="key"
    query="EXEC SOLR_COMPANY_SEARCH_DATA"
    deltaImportQuery="SELECT * FROM Company_Search_Data WHERE [key]='${dataimporter.delta.key}'"
    deltaQuery="SELECT [key] FROM Company_Search_Data WHERE modify_dt > '${dataimporter.last_index_time}'">
          <field column="WorkDesc_Comments" name="WorkDesc_Comments_Split" />
          <field column="WorkDesc_Comments" name="WorkDesc_Comments_Edge" />
    </entity>
  </document>
</dataConfig>

I can use MS SQL Profiler to watch the Solr user log in successfully, but then nothing. It doesn't seem to even try and execute the stored procedure. Any ideas why this would be working one server and not on another?
FTR the only thing in the tomcat catalina log is:
org.apache.solr.handler.dataimport.JdbcDataSource$1 call
INFO: Creating a connection for entity data with URL: jdbc:sqlserver://localhost;databaseName=CATLive

UPDATE:
Me and Yavar Husain from the Solr Mailing list both came up with the solution of replacing the MS JDBC Driver with an open source one - this seems to work, and means this must be a compatibility problem between the latest versions of Java, the DIH and the MS JDBC driver.
UPDATE 2:
Issues have been reported with Java 1.6.0_29 - which I am running!
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx

A: This looks to have been caused by a release of Java 1.6.0_29 - which I was running:
http://blogs.msdn.com/b/jdbcteam/archive/2011/11/07/supported-java-versions-november-2011.aspx

A: Seeing as the problem could only be with the JDBC drivers or their config, I have worked around this issue by replacing them with the jTDS Open Source JDBC driver. My config ended up like this when I got it working with that:
<dataConfig>
  <dataSource type="JdbcDataSource"
              driver="net.sourceforge.jtds.jdbc.Driver"
              url="jdbc:jtds:sqlserver://localhost;databaseName=DBName"
              user="Solr"
              password="password" name="ds1"/>
  <document>
    <entity dataSource="ds1" name="sometext"
            query="SELECT * FROM mytable">
    </entity>
  </document>
</dataConfig>

HTH someone - but I'm not marking this as the answer because I can't see why I can't use the MS drivers...

A: I guess you are missing this
url="jdbc:mysql://localhost/dbname"
dbname -> \SQL2008

A: I presume when you copied your Solr config to the new server you've taken the index file too. I suspect the problem is due to the fact that Solr has already indexed this data. Your query states that you only want to index files that have changes since the last index.
Does this make sense?

A: The issue appears to occur only on very specific releases of the java runtime, and affects applications beyond just solr.  This leads me to believe that the root cause is an incompatibility or bug between the Java runtime and Microsoft SQL Server JDBC drivers rather than being a Solr issue.
In my particular case we had two groups consisting of 3 servers each.  One group showed no symptoms of this problem, and the other group all exhibited issues.  All servers were running Solr 3.4.0, and the same release of SQL Server JDBC drivers 3.0.  All servers were also running JRE 1.6.0_20, but upon closer inspection it was identified that the problem servers were using a slightly newer package for 1.6.0_20 (a different RPM distributed via yum for CentOS).
By downgrading the problem servers to the exact version of java on the known-good servers the problem immediately went away.
Specifically,
working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-x86_64/java-1.6.0-openjdk-1.6.0.0-1.22.1.9.8.el5_6.x86_64.rpm.html
non-working:
http://pkgs.org/centos-5-rhel-5/centos-rhel-updates-x86_64/java-1.6.0-openjdk-src-1.6.0.0-1.23.1.9.10.el5_7.x86_64.rpm.html


text:
Q: adding array of map to java application I am pretty new to Java but I am trying to create a map of a room using an array however I do not know how to add it to my app class. Since the code is too long I will share the view class I have been trying to work with in order to add it to my application. I removed the code adding the other components to my application because of the length but the picture attached is the output I am getting.
output
Any help would be GREATLY appreciated. I have exhausted every option. Thanks.
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;

public class FloorBuilderView extends GridPane {
    private FloorPlan model;

    //component on window

    private Button buildingOverview;
    private Button roomTilesColor;
    private FloorPlan fp;
    private Button[][] buttons;

    private RadioButton exit;
    private RadioButton walls;
    private RadioButton roomTiles;
    private RadioButton selectRoom;

    private TextField floorSummary;
    private Label selectEdit;
    private Label floorLayoutLabel;
    private Label floorSummaryLabel;

    public FloorBuilderView(){
       // model = fp; // Store the model so that the update() method can access it
        fp = FloorPlan.floor1();
        fp = new FloorPlan(20, "Main Floor");
        int[][] tiles = {
                {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,1,1,1,0,1,1,1,1,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};
        for (int r=0; r<20; r++)
            for (int c=0; c<20; c++)
                fp.setWallAt(r,c,tiles[r][c]==1);

        setPadding(new Insets(10,10,10,10));

        //floorPlan = new Panel(new GridLayout(fp.size(), fp.size(), 0, 0));
        //buttons = new Button[fp.size()][fp.size()];

        update();

    }

    public void update() {
    }
}

A: If you are happy with swing and a JPanel, you could do something like that :
import javax.swing.JFrame;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;
import java.util.Arrays;
import java.awt.EventQueue;
import javax.swing.JFrame;

public class FloorPlaner extends JFrame implements MouseListener, KeyListener {
     protected BufferedImage wall;
     public int type=0;
     public int[][] tiles= {{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,1,1,1,1,0,1,1,1,1,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1},
                {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}};;

     public void mousePressed(MouseEvent m) {
     }

     public void mouseClicked(MouseEvent m) { //Mouse Clicked
         int mouseposx=(int) (m.getX()); //Mouse X
         int mouseposy=(int) (m.getY()); //Mouse Y
         if (m.getButton() == m.BUTTON1) {
             tiles[mouseposx / 20][mouseposy / 20] = type;
         }
     }
     public void mouseReleased(MouseEvent m) {
     }
     public void mouseEntered(MouseEvent m) {
     }
     public void mouseExited(MouseEvent m) {
     }
     public void keyTyped(KeyEvent e) {
     }
     public void keyReleased(KeyEvent e) {
         if (e.getKeyCode()==KeyEvent.VK_W) { //Lets build a wall !
             type=1;
         }
         if (e.getKeyCode()==KeyEvent.VK_E) { //Lets remove a wall !
             type=0;
         }

     }
     public void keyPressed(KeyEvent e) {
     }
     public FloorPlaner(){
          super("FloorPlaner");
          try {
          wall = ImageIO.read(new File ("wall.png")); //Load a wall
          } catch(IOException bug) { //Create a wall image
          wall=new BufferedImage(20, 20, BufferedImage.TYPE_INT_RGB);
          Graphics2D wg=wall.createGraphics();
          wg.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
          wg.setColor(Color.BLACK);
          wg.fillRect(0,0,20,20);
          System.out.println(bug);
          }

          requestFocus();
          addKeyListener(this);
          addMouseListener(this);

          setContentPane(new DrawingPane());

          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

          setSize(400, 400);

          setResizable(true);

          setVisible(true);

          while (true) {
              repaint();
              try {
              Thread.sleep(40); //25 FPS
              } catch(InterruptedException bug) {
              Thread.currentThread().interrupt();
              System.out.println(bug);
              }
          }
     }

     class DrawingPane extends JPanel { //Where you actually draw on
        public void paintComponent(Graphics g) { //Drawing method
           for (int x=0; x < tiles.length; x++) {
                for (int y=0; y < tiles[x].length; y++) {
                     if (tiles[x][y]==1) {
                         g.drawImage(wall,x*20,y*20,null);
                     }
                }
           }
        }
     }
     public static void main(String args[]) {
            new FloorPlaner(); //Start it
     }
}

Already tested with Ubuntu 16.04, should work with Windows and Java, too.
E and W keys toggle between Empty and Wall mode.
Create walls/delete some by clicking with the mouse !
Hope this base helps you...


text:
Q: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so I am new to mongodb. I just installed mongodb on our development (linux) server:
I got mongodb to work on my console and I could load and save data, but when I wanted to install the PHP driver and altered the php.ini I got this error: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so
I searched the internet about this and all I could find was about 32bit and 64bit differences between php and the so file but as far as I know the computer that all this is installed on is only 32bit so everything on it will be 32bit as far as I know.
I installed the driver using pecl install mongo
also tried to pecl download mongo phpize it and set something to -m32 found that somewhere on the Internet, then make it and still didn't work.
Below some more info you might need in order to be able to help me out here.
uname -m
i686
file /opt/lampp/bin/php-5.3.5
/opt/lampp/bin/php-5.3.5: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped
file /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so
/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
phpize --version
Configuring for:
PHP Api Version:         20100412
Zend Module Api No:      20100525
Zend Extension Api No:   220100525
Hope someone knows how to get this to work. I'm not quite a linux guru, know my way around a bit but please tell me exact steps to follow...
-mac-
--
also tried the bradly henk method on this page: http://us2.php.net/manual/en/mongo.installation.php but that didn't work either
just upgraded from 1.4.3 to 1.4.4 using pecl upgrade mongo. This didn't solve the problem. php version installed = 5.3.5 (lampp) and mongo version installed = MongoDB shell version: 2.4.6
The 1.4.4 version of the php driver should work for PHP Version: PHP 5.2.6 or newer, but then again the 1.4.3 version should also have worked on 5.2.6 or newer

A:
/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/mongo.so

phpize --version
Configuring for: PHP Api Version: 20100412
Zend Module Api No: 20100525
Zend Extension Api No: 220100525

Note the difference in the API Number here.
You seem to have multiple installations of PHP on your system.
You need to use the pecl (and phpize) tools that match the PHP version you want to load the module under.
I suspect you'll find the correct pecl binary under /opt/lampp/bin/pecl


text:
Q: Azure Devops Server: How to setup build pipeline to get git sources as a task instead of geting it automatically I'm trying to make some builds more efficient by spliting them into multiple agent steps. First step will build our entire product, with unit tests and all and create an artifact containing unit tests, and two or more subsequent steps will run different parts of the unit test suites.
So far so good, everything works fine but all build agent steps gets the git sources, even though it is only neccessary for the first step. That takes another 1½ minutes that could have made the build even more efficient, and takes away some of the points of making it even more efficient (multiple build agents per step will not improve performance much, since all of them gets the sources for 1½ minutes first).
I've found the "Don't sync sources" checkbox for the Get Sources step in the pipeline, and that makes it so that the build steps no longer gets sources. But I DO want to get sources for the first build step, so now I have to do that manually?
I've tried to mimic what the Get Sources step does (according to the logs) in a Command Line-task but I cant quite get it to work. I've also tried manually setting up the git repo other ways via command line, and for some configurations it works, but for some it doesn't.
It should work for normal branches, nested branches and PR-branches, but I feel like I'm missing something in the way git works to get the task to do proper work.
How do I setup a Get Sources step for Git in a proper way?

A: The easy way is to install the Git Repository Downloader extension from the marketplace and use it in the first task.

Another option is to use a Command Line task and rungit clone.
For authentication you have 2 options:

*

*Put the password in the command:

git clone https://username:password@dev.azure.com/organization/project/_git/repo

*Create a Personal Access Token and put it in the command:

git clone https://PAT@dev.azure.com/organization/project/_git/repo

A: If anyone else sees this question sometime, and want to know how do to it, this is what I ended up with in the end, to be able to accomodate Pull Reqest branches from our Policy builds. Run from a command line task in the pipeline:
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" clone --progress {REPOPATH} .
git -c http.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" fetch --force --progress origin +$(Build.SourceBranch):$(Build.SourceBranchName)
git checkout $(Build.SourceBranchName) --progress


text:
Q: Mysql syntax Error 1064 , at line 1720 Why i am getting this error?

This is the code.
,(1719, 'Emanant ', '(a.) Issuing or flowing forth; emanating; passing forth into an act, or making itself apparent by an effect; -- said of mental acts; as, an emanant volition.')
,(1720, 'Emanated ', '(imp. & p. p.) of Emanate')
,(1721, 'Emanating ', '(p. pr. & vb. n.) of Emanate')
,(1722, 'Emanate ', '(v. i.) To issue forth from a source; to flow out from more or less constantly; as, fragrance emanates from flowers.')
,(1723, 'Emanate ', '(v. i.) To proceed from, as a source or fountain; to take origin; to arise, to originate.')
,(1724, 'Emanate ', '(a.) Issuing forth; emanant.')


text:
Q: Float left in javascript I'm doing an assignment on java script and here were my task

b. (18 points) Function showRides(): Figure 2

*

*Create a function that will write the ride's names, pictures, & information to >the webpage.

*Remove the HTML that created this information from the rides page.

*Make sure the JavaScript writes this information to the correct spot – rides.html.

I have created the function in javascript and it works but for the life of me I cannot figure out to get my images to float left. Here is my code in java script:
document.write(" ");
            document.write("
Rhine River Cruise
");
            document.write("
Enjoy our fabulous landscaping and other wonderful sites on a relaxing and scenic cruise that showcases the beauty of the 100 acres of Busch Gardens.
");

And here is where I have called the function in my html:

Am I suppose to make another function in the java script to make it float left or would I have to change something in the html?

A: It sounds like you're looking for the cssFloat style property:
function floatLeft() {
    document.getElementById("rr").style.cssFloat = "left";
}

Alternatively, you could just set the style directly on the image tag:

document.write("");

Hope this helps! :)

A: Add the float:left property in your style attribute, to float it left.
Like this:
document.write(" ");


text:
Q: Convert MFC radio button into static text Is there any way to convert a MFC radio button into a plain CStatic text (i.e. remove the radio)? If so, how?
I've only been able to find out how to convert radio buttons to other types of buttons, but this isn't really what I need.

A: No, you can't convert it. What you can do is create both a radio button and a static in the same place. Use ShowWindow to make one of them visible and one of them invisible.


text:
Q: about the malloc in c pointers I am stuck with basics of pointers Here are my code
char *orderUp;

orderdup = malloc(10 * sizeof(char));

printf("enter string");
scanf("\n%s",orderdup);
printf("\n%s",orderdup);// gives scanned strings
printf("\n%s",*orderdup);// gives empty string

Here This program is running fine . I want to know that why in  printf statement giving the scanned string.I mean it should print the address but why it is printing string and last printf statement gives empty string.

A: *orderdup is of char type. You are using %s specifier to print a char data type while %s expects a char * data type. It will invoke undefined behavior. To print address use %p
printf("%p", (void*)orderdup);