text:
Q: Android GUI using Eclipse I've been using XML to create my UI and I know this question may sound silly but it is not.
How do you create a UI using the Android plugin for Eclipse?
(Is there  a step by step tutorial somewhere or can someone give me step by step instructions)
Does the class name have to be the same as my view name?

A: Android plugin comes with handy visual editor where you can drag and drop views and widgets easily. And you don't have to name the xml files similar to your activity class because you will use setContentView() inside the activity to specify its view

A: This may not quite be what you are looking for but I would check out DroidDraw.  Makes doing Android GUIs more friendly.  There is a tutorial at http://www.droiddraw.org/tutorial1.html

A: Here's some (new!) overview documentation for the Eclipse plugin; see the "Canvas and Outline View" section in particular:
   http://developer.android.com/guide/developing/tools/adt.html

A: I would advise you to create a rough sketch of whatever you're going to design first. Once you had a rough sketch/draft in your head,it becomes much easier to design the real thing.
Here are some UI guidelines :
http://developer.android.com/guide/practices/ui_guidelines/index.html
And if you're looking for tutorials :
http://www.youtube.com/watch?v=maYFI5O6P-8&feature=relmfu


text:
Q: Error when trying to add a variant in Shopify I am trying to add a variant to the existing Product id.
Below is the JSON request which i had done. However i am getting an error
{"errors":{"variant":"expected Array to be a Hash"}}

JSON Request.
{"variant": [{"product_id": 10065509898,"title": "XS\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_XS","position": 1,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "XS","option3": null,"taxable": true,"barcode": "800123054849","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true},{"product_id": 10065509898,"title": "S\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_S","position": 2,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "S","option3": null,"taxable": true,"barcode": "800123054856","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true},{"product_id": 10065509898,"title": "M\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_M","position": 3,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "M","option3": null,"taxable": true,"barcode": "800123054863","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true},{"product_id": 10065509898,"title": "L\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_L","position": 4,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "L","option3": null,"taxable": true,"barcode": "800123054870","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true},{"product_id": 10065509898,"title": "XL\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_XL","position": 5,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "XL","option3": null,"taxable": true,"barcode": "800123054887","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true},{"product_id": 10065509898,"title": "XXL\/ BROWN","price": 49.05,"sku": "BA1015_BROWN_XXL","position": 6,"grams": 0,"inventory_policy": "deny","compare_at_price": null,"fulfillment_service": "manual","inventory_management": "shopify","option1": "BROWN","option2": "XXL","option3": null,"taxable": true,"barcode": "800123054894","inventory_quantity": 0,"old_inventory_quantity": 0,"inventory_quantity_adjustment": 1,"weight": 1,"weight_unit": "lb","requires_shipping": true}]}

What am i doing wrong?

A: It's because you are sending an array of variants. You have to add each variant separately:
POST /admin/products/{product_id}/variants.json
{
    "variant": {
        "option1": "BROWN",
        "price": "49.05",
        "sku": "BA1015_BROWN_XS"
     }
}

You can pass an array of variants only when you are creating a new product.

redpajama_set_name: RedPajamaStackExchange


text:
Q: React Widgets + Redux-Form editable dropdown I am using Redux-form and pulling in data to initilise my multi-select(dropdown) box. Here is the example of this from the redux-form site - https://redux-form.com/6.0.0-rc.1/examples/react-widgets/ they use react-widgets as an add-on.
The example allows you to select a favorite color, and it will list the selections available. Here is my codesandbox of this example - https://codesandbox.io/s/7z5q82np51
I want to be able to add my own option/value in the box if I don't want to choose a pre-populated value. There is a duplicate/similar question on stackoverflow - Editable combo box in Redux-Form but I cant get the solution to work - so don't think its relevant anymore (old version maybe).
If somebody can see how this is done or see the proposed solution and get it to work on my codesandbox example? Any solution with redux-form welcome to get desired result of having a mulitiselect thats also editable to create my own value.
import React from 'react'
import { Field, reduxForm } from 'redux-form'
import DropdownList from 'react-widgets/lib/DropdownList'
import SelectList from 'react-widgets/lib/SelectList'
import Multiselect from 'react-widgets/lib/Multiselect'
import 'react-widgets/dist/css/react-widgets.css'

const colors = [{ color: 'Red', value: 'ff0000' },
{ color: 'Green', value: '00ff00' },
{ color: 'Blue', value: '0000ff' }]

const MaterialUiForm = props => {
  const { handleSubmit, pristine, reset, submitting } = props
  return (
    <form onSubmit={handleSubmit}>

        Favorite Color
        <Field
          name="favoriteColor"
          component={DropdownList}
          data={colors}
          valueField="value"
          textField="color" />

        <button type="submit" disabled={pristine || submitting}>Submit</button>

    </form>
  )
}

export default reduxForm({
  form: "MaterialUiForm", // a unique identifier for this form
})(MaterialUiForm);

A: https://codesandbox.io/s/2vmmkmomk0
Using react-select and the creatable component I was able to merge the two.


text:
Q: Trick Plug-in Into Using Library I created a plain old JAR with some fancy test classes I want to use to make testing more easy and fun.
Everybody knows Eclipse plug-ins aren't for unit testing and Tycho doesn't allow it, but we already managed a setup where we can test plug-ins using Surefire exactly the same way we test pure Maven projects. Using <pomDependencies>consider</pomDependencies> in the config of the  target-platform-configuration allows for adding plain old Maven dependencies, so the Tycho build already works with the new fancy test classes.
Not Eclipse though. Plug-ins are missing the library "Maven Depdencies", and even adding it via the "Java Build Path" in the settings does nothing. I can add the project with the test classes there, but that would mean checking it from SVN and adding it to every workspace (I have 100, and I can't rule out that other people are working here, too).
On the other hand I can't just add it to the Manifest.MF because that would mean the test library would be shipped to our customers (which fancy or not is a bad idea). And I don't know how Tycho feels about optional dependencies, it's probably not a fan (and I feel like this would be bad style).
So how can I trick a plug-in in Eclipse into accepting a dependency that is not in the final plug-in?


text:
Q: ICS file opened using Microsoft Outlook Desktop 2016's Calendar not honoring new lines in the Description body As title states, when the ICS file below is opened using Microsoft Outlook Desktop 2016's calendar, the second to last new line (the "\n" before "lectus") in the Description body is not honored.  The word "lectus" remains on the same line as the text before it when the event is opened in Outlook's calendar.  This is obviously a contrived example but we are encountering this issue with other files.  The new lines are working fine, however, when using outlook web, yahoo calendar, and google calendar.  The file below is valid according to https://icalendar.org/validator.html.
Is anyone aware of a bug in Outlook 2016 desktop or am I missing something in the formatting of the file?
Thanks in advance.
BEGIN:VCALENDAR
PRODID:-//ABCD Corp//NONSGML My Product//EN
VERSION:2.0
BEGIN:VEVENT
DESCRIPTION:Lorem ipsum dolor sit amett consectetur adipiscing elit just
  Curabitur neque proiin\nUteauctor nibhiid quammmaximus rutrumn Sed egete
 Donec sit amet ultrices justoe suspendisse nec crase  integmalesuddanullo
 consequaturna\nlectus\n
DTEND;VALUE=DATE:20220305
DTSTAMP:20220125T202911Z
DTSTART;VALUE=DATE:20220301
SEQUENCE:0
SUMMARY:Praesent in mauris eu tortor
UID:bac16d57-4606-4093-951a-1022b0587183
END:VEVENT
END:VCALENDAR

I included a snapshot below of what I'm talking about.  Notice the word "lectus" does not start on a new line.

A: The validators are not perfect or all encompassing.  Try check against as many as you can. eg http://ical-validator.herokuapp.com/?wicket:interface=:1::::  says

! CRLF should be used for newlines Related RFC 5545 section:
3.1

CRLF is  \r\n    (not \n\r)
https://developer.mozilla.org/en-US/docs/Glossary/CRLF


text:
Q: Meteor Cordova plugin fails at building : use -source 7 or higher to enable diamond operator I have developed a plugin for Cordova. All was fine with my environment development. Now I try to use it in a fresh Meteor Cordova project and I have this errors popping up.
How to fix this ? I don't have any IDE for java to fix this like in this question in a Cordova project.
While running Cordova app for platform Android with options --emulator:
   Error: Command failed:
   /Users/vikti/dev/cordova-mapbox-test/.meteor/local/cordova-build/platforms/android/cordova/run
   --emulator
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.
   Note: Some input files use or override a deprecated API.
   Note: Recompile with -Xlint:deprecation for details.

   /Users/vikti/dev/cordova-mapbox-test/.meteor/local/cordova-build/platforms/android/src/com/telerik/plugins/mapbox/CDVMapbox.java:523:
   error: diamond operator is not supported in -source 1.6
   ArrayList<String> ids = new ArrayList<>();
   ^
   (use -source 7 or higher to enable diamond operator)

   /Users/vikti/dev/cordova-mapbox-test/.meteor/local/cordova-build/platforms/android/src/com/telerik/plugins/mapbox/MapController.java:84:
   error: diamond operator is not supported in -source 1.6
   private ArrayList<String> _offlineRegionsNames = new
   ArrayList<>();
   ^
   (use -source 7 or higher to enable diamond operator)

   /Users/vikti/dev/cordova-mapbox-test/.meteor/local/cordova-build/platforms/android/src/com/telerik/plugins/mapbox/MapController.java:498:
   error: multi-catch statement is not supported in -source 1.6
   } catch (SVGParseException | IOException e) {
   ^
   (use -source 7 or higher to enable multi-catch statement)

   /Users/vikti/dev/cordova-mapbox-test/.meteor/local/cordova-build/platforms/android/src/com/telerik/plugins/mapbox/MapsManager.java:22:
   error: diamond operator is not supported in -source 1.6
   private static SparseArray<Map> _maps = new
   SparseArray<>();
   ^


text:
Q: apache2 multiple subdomains I have two virtual hosts setup, subdomains, in Apache2 on a Debian server.  The ip is 104.130.6.104.  When the ip is entered in the browser, apache returns the files for blog.goaltilt.com.  I want it to return the files for www.goaltilt.com.  I've searched for an hour for the answer.  Can someone help me understand how to force apache to resolve the ip to the my chosen subdomain?
goaltilt.com.conf is:
<VirtualHost *:80>
    ServerName goaltilt.com
    ServerAlias www.goaltilt.com
    ServerAdmin robert@goaltilt.com
    DocumentRoot /var/www/goaltilt.com/public_html
</VirtualHost>

blog.goaltilt.com.conf is:
<VirtualHost *:80>
    ServerName blog.goaltilt.com
    ServerAdmin robert@goaltilt.com
    DocumentRoot /var/www/blog.goaltilt.com/public_html
</VirtualHost>

A: I figured out that I had disabled the 000-default.conf file so the server was resolving to the first virtual host in sites-available.  I modified the 000-default.conf file to ensure it went to the primary site and then enabled it and restarted apache to get it running.  Now the 000-default.conf file resolves the 104.130.6.104 IP to the correct virtual host.  Thanks for your help Alvin.  Your answer helped me figure out what to look for in the documentation.

A: Normally a hostname should be mapped using DNS, so based on your comments you are using IP not names. Since that is the case, you'll need to modify your hosts file, or if you happen to be a network admin, you could add a cname.
On windows you would modify the file C:\Windows\System32\drivers\etc\hosts and add something like this to the file:
192.168.20.24  blog.goaltilt.com

Then when you enter in your Browser on that Windows machine http://blog.goaltilt.com, it will send that hostname to your Apache server (above example shows '192.168.20.24' as the server address) and resolve appropriately.
On Linux, you would need to modify the /etc/hosts files and use the same format.


text:
Q: Regular Expression allowing only 0-24 float point numbers I'm creating WPF TextBox extension control which must allow the following inputs only by using regular expression:

*

*Number must be within 0 and 24 (0 <= number <= 24)

*must allow only max two digits after floating point, e.g: 0.5, 0.55, 23.2, 23.55

It's pretty hard for me to find out which regular expression will allow to pass that range. I've started with:
^[0-9]*(?:\.[0-9]*)?$

But it does not quite match my requirements. So I'm asking for a help to get this regular expression.

A: try this pattern:
^24(?:\\.00?)?|(?:2[0-3]|1?[0-9])(?:\\.[0-9]{1,2})?$

A: Why do you want to get an headache using regex? Simply parse the text, check the range of the values and the number of decimals :
bool IsValid(string text) {
    decimal candidate;
    if(decimal.TryParse(text, out candidate)){

        if(
            candidate >= 0 && // Check lower bound
            candidate <= 24 && // CHeck higher bound
            Math.Round(candidate, 2) == candidate // Check number of decimals
        ) {
            return true;
        }

    }
     return false;
}

Moreover, you will avoid globalization issues (using ., , depending on the culture) by letting the system handle this.


text:
Q: Bug or i do a mistake with inboxsdk "presending" event When i use the inboxSDK with the newGmail I face an issue that the "event" did not get the composeView like the other events.
sdk.Compose.registerComposeViewHandler(function (composeView) {
        composeView.on("presending", function (event) {
    // Only get event.cancel();
    });
}

Did i do something wrong or it's a bug with the new Gmail UI ?

A: As of the documentation the presending callbacks event object only has the cancel method attached. And actually that is no problem at all since you already have the composeView availbale from the registerComposeViewHandlers scope. Just access that composeView object.
sdk.Compose.registerComposeViewHandler(function (composeView ) {
    composeView.on("presending", function (event) {
        console.log(composeView);
    });
}

If the presending event triggers you can just use event.cancel() to stop the sending, do whatever you wanna do on the composeView like you would for example in the registerComposeViewHandler callback and when you're done do composeView.send() to finally send the email. Just make sure to have a condition for the cancel event so you actually be able to send at one point and not get stuck in the presend event forever.


text:
Q: How to make uglify and grunt index all imports and generate one single file I have just started using grunt and I want it to use combine all files and uglify them.
But my issues is that it combines and uglifys, but it doesn't remove import statements. (I'm using uglify and concat)
What I want -
// File.js
import something from './something.js';
something.someFunction("hello world");

and
// something.js
export default {
   someFunction: function(msg){console.log(msg)}
}

to
// all.js
var something = {
  someFunction: function(msg){
     console.log(msg)
  }
}
something.someFunction("hello world");

Compressing is not an issue.

A: If you want to combine the source code into one file, you can use rollup.js to help you.

*

*download Node.js to get npm

*update npm: npm install -g npm

*npm install -g rollup

*

*check: rollup -v
And then, running the below command will work as you expected.

rollup --format es --input file.js -o all.js

You can generate by rollup.config.js also.

rollup -c

// rollup.config.js
const AUTHOR = ""
const OutputFileName = `bundle` // in your case is `all`.js
const banner = `// Copyright (c) ..., all right reserved.`
const footer = `// powered by ${AUTHOR}`

export default {
  input: './index.js', // in your case is `File.js`
  output: [
    {
      file: `./${OutputFileName}.js`,
      format: 'es', // amd, umd, iife, cjs, ...
      //  Option
      // banner,
      // footer
    },
    { // You can generate different formats at once.
      file: `./${OutputFileName}_cjs.js`,
      format: 'cjs',
      banner,
      footer,
    },
  ]
}

For compress

*

*get uglifyjs: npm install uglify-js -g

*uglifyjs all.js -m -c -o all.min.js


text:
Q: Allocating the results of Reverse Geocoding to a global variable I am using Swift 4 and Xcode 9.3.1. I'm including screenshots of the code.
I am new to mobile development/ programming in general and have been thinking about how to phrase this. So this is the best I can explain it:
I am building an app that gets the user's location in order to send assistance through to them. The app gets the user's coordinates, and displays a TextView with their address information. So pretty straight forward mapKit/coreLocation functionality.  So far, so good: Getting the coordinates with startUpdatingLocation() works fine, and I've used Reverse Geocoder to get the street name & locality.  But they-- meaning the decoded street and locality strings-- only print out if I call them within the closure, not outside it. I've understood (correctly or incorrectly?) that variables that need to be available for multiple functions within a class should to be declared globally at the top. However I can't figure out how to extract the information from this closure in order to use it elsewhere.
I've been googling and reading through questions in stackOverflow and I feel like something really simple is missing but can't figure out what. Things I've tried unsuccessfully so far:
1_ Defining global variables as empty strings at the beginning of the class
and using the variable names inside the closure where the geocoding reverse method happens, in an attempt to store the resulting strings, but when I try to print the variables outside the closure, the global variable is still and empty string ("").
[global variables declared at the top][1]
2_Defining an empty, global array of strings and appending the information from inside the closure to the global array. Still got an empty array outside the closure. (so same as 1)
3_Create a function --func decodedString()-- to return the data as a String, so I can use it by declaring
*let streetLocation : String = decodedString()*

However when I declare that function like this :
var street = ""
var locality = ""

// Get the street address from the coordinates
    func deocodedString() -> String {
        let geocoder = CLGeocoder()
        geocoder.reverseGeocodeLocation(location) { placemarks, error in
        if let placemark = placemarks?.first {
        self.street = placemark.name!
        self.locality = placemark.locality!
        let string = "\(self.street), \(self.locality)"
        return string
        }
    }
}

I get an error of:  Unexpected non-void return value in void function
unexpected no void return value in void function
Lastly, if I pass the information straight into a TextView within the closure by using the code below, my textView updates successfully-- but I can't format the strings, which I need to do in order to make them look like the design instructions I'm following (aka some bold text, some regular text, and some different sizes of text):
CLGeocoder().reverseGeocodeLocation(location) { placemarks, error in
    if let placemark = placemarks?.first {
        self.street = placemark.name!
        self.locality = placemark.locality!
        let string = "\(self.street), \(self.locality)"
        self.addressTextView.text = string
    }
}

So that's why I can't just pass it through with the textView.text = string approach.
I'd appreciate some help...I have been looking though StackOverFlow, youtube and other tutorial places but I can't figure out what I'm missing, or why my function declaration generates an error. I have already destroyed and reversed my code several times over last 24 hs without getting an independent string that I can apply formatting to before passing it into the textView and I'm at a loss as to how else to approach it.

A: When you call this function the reverseGeocodeLocation runs in the background thread. So if you want to return the address in this method you should use escaping closure.
    func getaddress(_ position:CLLocationCoordinate2D,completion:@escaping (String)->()) {
     let geocoder = CLGeocoder()
        geocoder.reverseGeocodeLocation(location) { placemarks, error in
        if let placemark = placemarks?.first {
        let street = placemark.name!
        let locality = placemark.locality!
        let string = "\(street), \(locality)"
        completion(string)
        }
    }
    }

   self.getaddress(position.target) { address in
        print(address)
        self.addressTextView.text = address
   }

A: I had a problem with google geocoder to update the label on the map screen.
So I did this, first, create
swift file name: GoogleAPI just call it as you like.
class GoogleAPI {

    static let sharedInstance = GoogleAPI()

    private init() { }

    var addressValue = ""

    public func geocoding(lat: Double, long: Double) {
        Alamofire.request("https://maps.googleapis.com/maps/api/geocode/json?latlng=\(lat),\(long)&key=YOUR_GOOGLE_KEY").responseJSON { (response) in
            if response.result.isSuccess {
                let dataJSON : JSON = JSON(response.result.value!)
                self.geocoding(json: dataJSON)
            } else {
                print("Error \(response.result.error!)")
            }
        }
    }

    fileprivate func geocoding(json: JSON) {
        let json = json["results"]
        let address = json[1]["formatted_address"].stringValue
        addressValue = address
        print("pin address \(addressValue)")
    }
}

This is an API call to Google to fetch all from a response and parse the only street.
After that go to your View Controller with a map where is the pin, map etc..
Set up a pin, marker to be draggable. [marker1.isDraggable = true]
Then add this function

mapView(_ mapView: GMSMapView, didEndDragging marker: GMSMarker)

and add call from above like this :
func mapView(_ mapView: GMSMapView, didEndDragging marker: GMSMarker) {
    GoogleAPI.sharedInstance.geocoding(lat: marker.position.latitude, long: marker.position.longitude)
    DispatchQueue.main.async {
        self.txtSearch.text = GoogleAPI.sharedInstance.addressValue
    }
}

txtSearch is my search text field.
yea I know, that can be done better, but no time. this is working.
Swift 4.2


text:
Q: pass current browser url address to bean I want to send the browser url address to bean,I found this
HttpServletRequest requestObj = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
String url = requestObj.getRequestURL();

I did not get the right browser address,so I will use javasript window.location to get the browser address,but how can I send this to back bean?Every answers will be helpful,any ideas?

A: Use
FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap().get("referer")

in the back bean, you can have the request url. This bothers me for a long long time, hope this will help someone.


text:
Q: SSIS export to excel Using SSMS I created an export a query to Excel and saved it as a DTSX package. Imported this DTSX package into a BIDS project to make it run hourly and export a excel file with timestamp appended to it, dynamic name using expressions. When I run from BIDS, package executes successfully and creates the excel file without a problem. I have enabled DelayedValidation flag.
I can double click on the DTSX file, run the package and it creates the excel file without a problem. When I configure as a SQL Job, it fails with the below error
Any guidance is much appreciated
Microsoft (R) SQL Server Execute Package Utility  Version 10.50.2500.0 for 32-bit  Copyright (C) Microsoft Corporation 2010. All rights reserved.
    Started:  2:53:03 PM
    Error: 2012-09-21 14:53:05.54
    Code: 0xC0202009
    Source: Export MyExportQuery to Excel Destination - Query [73]
    Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E37.  End Error
    Error: 2012-09-21 14:53:05.54
    Code: 0xC02020E8
    Source: Export MyExportQuery to Excel Destination - Query [73]
    Description: Opening a rowset for "Query" failed. Check that the object exists in the database.  End Error
    Error: 2012-09-21 14:53:05.54
    Code: 0xC004701A
    Source: Export MyExportQuery to Excel SSIS.Pipeline
    Description: component "Destination - Query" (73) failed the pre-execute phase and returned error code 0xC02020E8.  End Error
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started:  2:53:03 PM
    Finished: 2:53:05 PM
    Elapsed:  2.282 seconds.  The package execution failed.  The step failed.

EDIT:
SSIS is configured to run in 32 bit mode

A: Most of the problems arise due to these situations:

*

*Data source connection or File access issue (when the user running the sql agent doesn't have the right permissions to the db or to the destination file).

*Package protection level (pwd are sensitive data, and sometimes are not copied depending on the protection level).

*64bit issue (this a common one on XL exports. Since there's no Jet Driver for 64bit systems, when running on a 64bit OS you need to either use the 32bit DTEXEC in your sql job or set the "Use 32bit runtime" option, it's on the "Execution options" tab when you're creating a SSIS job step, check the image on link below for seeing it).
32Bit runtime option image
For information on this topic, have a look at this article, it has detailed information on situations when ssis packages run on BIDS but not on SQL jobs..
How do I troubleshoot SSIS packages failed execution in a SQL Agent job?
Hope this helps you..
Kind regards,

A: When you configure a SQL Server Agent job with a job step type of SQL Server Integration Services Package, the job invokes the dtexec utility. However, the version of the dtexec utility that the job invokes depends on what versions of SQL Server and SQL Server Agent have been installed and are running on the 64-bit computer. [MSDN]
To run a package in 32-bit mode from a 64-bit version of SQL Server Agent, select Use 32 bit runtime on the Execution options tab of the New Job Step dialog box.


text:
Q: How to multiply user input by a decimal number in python? Hello I am having trouble with using strings and integers during multiplication. If there is something I do not think I have done anything fundamentally wrong but then again, it's not working so I probably have done!
This is my code as of now.
    #This is where I ask the user for input for a value
UI = print (float(input("Enter your value here: ")))
#Here I have numbers that I need to multiply the input by
FRT = (float(0.290949)
SRM = (float(0.281913)
#Here is the multiplication but this is where the issue occurrs
QV = (float("FRT"*"UI"))
SV = (float("SRM"*"UI"))

Both of these lines at the end have issues, I have tried using different set ups with using the numbers instead of defining them as FRT and SRM and using integer before float etc, but with these lines they both give the error "could not convert string to float "FRT""

A: There are quite a few issues with your code
First of all, you have not closed your parenthesis on lines 4 and 5
Secondly, you're trying to call variables by strings. That isn't how it works
QV = (float("FRT"*"UI"))

should be
QV = (float(FRI * UI))

Lastly, input already displays text, so you don't need to print anything, and since print returns None, UI will always be None.
UI = print (float(input("Enter your value here: ")))

should be
UI = float(input("Enter your value here: "))

So, the complete debugged code should be:
#This is where I ask the user for input for a value
UI = float(input("Enter your value here: "))
#Here I have numbers that I need to multiply the input by
FRT = (float(0.290949))
SRM = (float(0.281913))
#Here is the multiplication but this is where the issue occurrs
QV = (float(FRT*UI))
SV = (float(SRM*UI))

A: "FRT" is a string, made of the letters F, R & T. If you want to refer to the variable FRT, do not use quotation marks. QV = (float("FRT"*"UI")) is trying to first multiply the string "FRT" by the string "UI", and then convert the result to a float. Since string multiplication is not defined, you get an error.
In your current code, I am unsure of what UI is, since you did not make it equal to a number but to the result of a print(). Your first line should be replaced by
UI = float(input("Enter your value here: "))
print(UI)

Then, QV = FRT * UI will do what you want, since both FRT and UI are floats. The parentheses around each operation are not needed.

A:     #This is where I ask the user for input for a value
UI = print (float(input("Enter your value here: ")))

Above won't do what you want, print doesn't return anything
UI = float(input("..."))
print(UI)

If using python 2.7 us raw_input, not input
#Here I have numbers that I need to multiply the input by
FRT = (float(0.290949)
SRM = (float(0.281913)

You just need:
FRT = 0.290949

No need to convert a float into a float
#Here is the multiplication but this is where the issue occurrs
QV = (float("FRT"*"UI"))
SV = (float("SRM"*"UI"))

You are multiplying strings above, do this:
QV = FRT * UI

A: What do you want your output as ?
The error your making is that the two strings are variables, so remove the quotes off the variable so your code should look like this :
#This is where I ask the user for input for a value
UI = print (float(input("Enter your value here: ")))
#Here I have numbers that I need to multiply the input by
FRT = (float(0.290949)
SRM = (float(0.281913)
#Remove the quotes from the variables below and you get this
QV = (float(FRT*UI))
SV = (float(SRM*UI))


text:
Q: how to update bootstrap-select's max-options depending on another select list A user selects in two select-lists number of rows and cols to setup a grid, let's say 2x3. In a third select-list the user can only select a maximum of 6, not more.
The max of 6 depends on choice before 2x3. I don't get the value of 6 into the selectpicker's data-max-options attribute. Is this even possible to update this attribute depending on two other inputs?
Using snapappointments's bootstrap-select from Github would be fine. But fallback to plain jquery is ok to get it run. Maybe data-max-options attribute isn't to be updated during script run, have read this in other questions but unfortunately I'm not that much experienced with that so any hint highly appreciated.
<select class="grid rows">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
</select>
<select class="grid cols">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
</select>
<input type="text" id="max" title="just demo" />
<select id="grid" size="10" multiple="multiple" class="selectpicker show-tick" data-max-options="2">
    <option>01</option>
    <option>02</option>
    <option>03</option>
    <option>04</option>
    <option>05</option>
    <option>06</option>
    <option>07</option>
    <option>08</option>
    <option>09</option>
    <option>10</option>
</select>
<script type="text/javascript">
    $(".grid").change(function (event) {
        var rows = $(".grid.rows option:selected").val();
        var cols = $(".grid.cols option:selected").val();
        var grid = rows * cols;
        if (grid == 0) {
            $('#max').val('');
        } else {
            $('#max').val(grid);
        }
        console.log("number" + grid);
    });
    // $('#grid').data('max-options', 6); // this works, but not inside above function
</script>

https://jsfiddle.net/statjsfd/6zfxh4go/4/

A: You have to 'refresh' the selectpicker instance after the attribute change.

$(".grid").change(function(event) {
  var rows = $(".grid.rows option:selected").val();
  var cols = $(".grid.cols option:selected").val();
  var grid = rows * cols;
  if (grid == 0) {
    $('#max').val('');
  } else {
    $('#max').val(grid);
  }
  console.log("number" + grid);

  // The trick is to 'refresh' the selectpicker instance
  $('#grid').data('max-options', grid).selectpicker('refresh');;

});
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/css/bootstrap-select.min.css" rel="stylesheet" />
<script src="https://cdn.jsdelivr.net/npm/bootstrap-select@1.13.9/dist/js/bootstrap-select.min.js"></script>

<select class="grid rows">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
</select>
<select class="grid cols">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
</select>
<input type="text" id="max" title="just demo" />
<select id="grid" size="10" multiple="multiple" class="selectpicker show-tick" data-max-options="2">
  <option>01</option>
  <option>02</option>
  <option>03</option>
  <option>04</option>
  <option>05</option>
  <option>06</option>
  <option>07</option>
  <option>08</option>
  <option>09</option>
  <option>10</option>
</select>

A: jQuery changes hyphenated words to camelCase (jquery get HTML 5 Data Attributes with hyphens and Case Sensitivity) so you may have to use something a bit different (this is what worked for me)
$("#id").selectpicker('deselectAll').data('maxOptions',count).selectpicker('refresh').selectpicker('val', selectedItems);

This includes some other selectpicker methods as I needed to:
1) make sure no options were selected
2) set the max-options count (again, note in the code it is 'maxOptions')
3) refresh the selectpicker
4) set the selectedItems as active
Using this allowed selecting various options in my code that changed 'count' - if set to 1, then selectpicker acts as if it has no 'multiple' - if set to any other number, then that is the maximum.
Worked great once all the things were set in place.  Hopes this helps!


text:
Q: Not getting a callback on socket disconnect in gcdasyncsocket ios I am facing this problem for many days..i do not get a callback on socket disconnect although i have used socketdiddisconnect method but it gets callback only in some cases like when i write to input stream..I am using mac os sierra and running code on xcode 8.3.2 with iphone 5s 10.3.2..any help would be appreciated.
Here is my some methods that i implemented in my class...
#for socket creation
-(void)start
{

    NSLog(@"PROVO...");
    _tcpSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()];

    NSError *error = nil;
    NSString *hostname = @"192.168.11.254";
    uint16_t port = 8080;

    if (![_tcpSocket connectToHost:hostname onPort:port withTimeout:5.0 error:&error])
    {
        NSLog(@"Unable to connect to due to invalid configuration: %@", error);
    }
    else
    {
       // _isSocketConnected = YES;
        NSLog(@"Connecting...");
    }
//    while (true) {
//        if ([_tcpSocket isDisconnected]) {
//            [NSThread sleepForTimeInterval:2];
//            [self start];
//        }
//    }

}

#for writing data to stream
-(void)writeOut:(NSString *)s second:(NSString *)cmd
{
    if (s == nil) {
        return;
    }
    _packDict = [[NSMutableDictionary alloc]init];

    [_packDict setValue:s forKey:cmd];

    //[[[TcpPacketClass sharedInstance]delegatesArray]count];

    NSLog(@"Writing out the following:");
    NSLog(@"%@", s);
    NSData *requestData = [s dataUsingEncoding:NSUTF8StringEncoding];

    if (self.tcpSocket!=nil&&[_tcpSocket isConnected]) {
        NSLog(@"Data write successfully");
        [_tcpSocket writeData:requestData withTimeout:-1.0 tag:0];
    }
    if ([_tcpSocket isConnected]) {
        [_tcpSocket readDataWithTimeout:-1 buffer:[NSMutableData data] bufferOffset:0 maxLength:0 tag:0];
    }

    // [NSThread sleepForTimeInterval:2];

}
#get called when socket created
- (void)socket:(GCDAsyncSocket *)sock didConnectToHost:(NSString *)host port:(UInt16)port
{

    NSLog(@"socket:didConnectToHost:%@ port:%hu", host, port);
    _isSocketConnected = YES;
    NSString *zeroIndex;
   // [[AppLoading sharedInstance] setDeviceDateTimeApiCall];

    if (_packDict.count >0) {
        NSArray *keys = [_packDict allKeys];
      zeroIndex =  [keys objectAtIndex:0];
    }
    NSString *packStr= [_packDict objectForKey:zeroIndex];
    NSData *requestData = [packStr dataUsingEncoding:NSUTF8StringEncoding];

    [sock writeData:requestData withTimeout:3.0 tag:0];
    NSLog(@"packet sent successfully");
    //  [_packDict removeAllObjects];

    //[_tcpSocket readDataToLength:sizeof(uint64_t) withTimeout:-1.0 tag:0];
    dispatch_queue_t alwaysReadQueue = dispatch_queue_create("com.cocoaasyncsocket.alwaysReadQueue", NULL);

    dispatch_async(alwaysReadQueue, ^{
        while(![_tcpSocket isDisconnected]) {
            [NSThread sleepForTimeInterval:5];
            [_tcpSocket readDataWithTimeout:-1 tag:0];
        }
    });
       // [sock readDataWithTimeout:-1 tag:0];

}

- (void)socket:(GCDAsyncSocket *)sock didWriteDataWithTag:(long)tag
{

    NSLog(@"hello its me:");
//    if (_tcpSocket.writeStream==nil) {
//        NSLog(@"write stream closed");
//        [_tcpSocket setDelegate:nil];
//        [_tcpSocket disconnect];
//        [self start];
//    }
    if ([_tcpSocket isDisconnected]) {
        NSLog(@"read stream closed");
//        [_tcpSocket setDelegate:nil];
//        [_tcpSocket disconnect];
        [self start];
    }
    //[_tcpSocket readDataWithTimeout:-1 buffer:[NSMutableData data] bufferOffset:0 maxLength:0 tag:0];

}

- (void)socketDidDisconnect:(GCDAsyncSocket *)sock withError:(NSError *)err
{

    NSLog(@"socketDidDisconnect:withError: \"%@\"", err);
    [_tcpSocket setDelegate:nil];
    [_tcpSocket disconnect];
    [NSThread sleepForTimeInterval:2];
    [self start];

}


text:
Q: Adding pre compiled headers in Xcode 4 Objective-C This question is related to this:
Constants in Objective-C
I would like to add pre compiled headers to my project to store app constants. I want to this as an alternative to having a constants.h file and importing it wherever it's needed. Is my thinking correct here?
On the above thread a guy mentioned modifying "YourAppNameHere-Prefix.pch".. I'm not sure this is a good approach.
How exactly can I create my own *.pch file and add it to my Xcode project so I can store application level constants?
I have tried googling/searching here for this but I'm just getting Objective-C++ and Clang stuff.. I'm not sure this is relevant.
Cheers,
Conor

A: My answer probably not just in time, and especially for Xcode 6  but i hope i'll help other, who already want's to create it's own constant.h file and set it on all of project objects.
So

*

*Create constant.h file by NSObject.
Put all of constants you need in .h file before @interface:
#import <...>

#define kSomeFirstConstant 1 //where 1 is an integer value
#define kSomeSecondConstant 2 //where 2 is an integer value

@interface Constant: NSObject

*Create precompiled header file .pch (eg: precompiledFile.pch)

*Put #import "constant.h" in .pch file right between #define and #endif:
#define ..._pch

#import "constant.h"

#endif

*Configure prefix name and some other options in Project navigator, Building Settings of your project target:
Apple LLVM 6.0 Language
Increase sharing of Precompiled headers - NO
Precompile prefix header - YES
Prefix Header - TargetName/precompiledFile.pch (eg: MyTarget/precompiledFile.pch)
After that, run building process and all of your constant in constant.h file will be accessible in all of your project objects.
Also read this: http://qualitycoding.org/precompiled-headers/


text:
Q: Tag Editor- $(...).jsonTagEditor is not a function I just tried to implement the json tag editor to create a tag editor.
I want to implement it in a bigger laravel project. Therefore I included jQuery, as well as the js and css file from the json tag editor. It's all loading fine, which I figured out under the network tab.
Now I have:
an input element:
<input id="keywords" class="form-control" name="keywords"
                                           autofocus>

and on top of the page I have:
$().ready(function(){
     $('#keywords').jsonTagEditor();
});

But i get an error saying
Uncaught TypeError: $(...).jsonTagEditor is not a function...
As I said, the files are loaded as I can see in the network tab...
Any ideas what the problem could be?
Again to make everything clear, I'm using laravel, so the files are all included in the master-layout file and I'm trying to use it in a document that extends this master template. But shouldn't change anything as I'm already using some other plugins that work fine that way.
Any ideas?

A: After some discussion in chat, the problem turns out to be the suspected re-import and re-initialization of jQuery. The Laravel framework has it's own import of jQuery that happens via require(), and that was the happening after the plugin in question was imported.
Moving the plugin import to the end of the  worked around that, but in addition the plugin (as of this writing) has a bug and must be initialized with an empty object passed in (or probably any other value):
$("#keywords").jsonTagEditor({});

A: You are missing document and just to be certain that the element is accessible, place your script before the ending '' tag so that it loads your page content first.
$(document).ready(function(){
    $('#keywords').jsonTagEditor();
});

A: You forgot to write document
Instead of this
$().ready(function(){});

Use this
$(document).ready( () => {});

The => means, that you use newest standarts of JS
Or you can just use this alternative jQuery tagEditor


text: Q: Is there a way to Launch The updater.exe file of Guitar pro 6 when running in Wine? I have downloaded the windows version of Guitar Pro 6 and it runs in Wine, However when I try to enter my License key, I get the error message "Can't open Updater" and then when I click ok the program shuts down. I have tried to run Guitar pro updater as a separate file but this also fails to open. Has anybody had this problem? if so How did you cure it?


text:
Q: Encrypting connection strings for a web farm in Release Management I am on Visual Studio/Release Management 2013.4.  Has anyone written a tool for the toolbox to encrypt web.config files for a web farm?  I know you can do it manually with aspnet_regiis.exe but was just wondering if someone had worked out a good process for using it within Microsoft Release Management.  Thanks!

A: It sounds like you've already found a perfect solution. The Release Management toolbox is fully user-extensible. Go ahead and make a custom action that calls aspnet_regiis.exe with the appropriate command line parameters and you're all set.
I've done this for customers that need config files to be encrypted, it works wonderfully.


text:
Q: SQL UPDATE WHERE CASE I know my SQL knowledge is weak. Unfortunately I found out I know less than I had perviously thought.
I wrote an UPDATE command to use in a simple HTML settings page using a form. (There is some browser side validation and also more server side validation of the form data before the data reaches the UPDATE SQL).
My goal is to updated 1 column in 2 rows. Nothing else. But I was wrong. It updated the two target rows with the values expected. The SQL also NULLed the column of all values in all the other rows.
My question 1: What caused this in my SQL??
My question 2: Is there a better way of performing this update??
<cfquery datasource="OurDBLocation" name="changeValues">
    UPDATE sometable
    SET rowvalueB = CASE
    WHEN rowvalueA = 'A123' THEN #val(FORM.a123value)#
    WHEN rowvalueB = 'A456' THEN #val(FORM.a456value)#
    END
    OUTPUT INSERTED.*
    WHERE rowvalueA IN ('A123','A456')
</cfquery>

NOTE: This is an internal form accessible only to developers with VPN access to our code base. We use Lucee (aka ColdFusion) on the back end for those that do not understand the #val(FORM.a123value)#

A: EDIT: 2020-10-07
Per latest comments, if you want to reduce the number of UPDATEs, especially when it's not changing the value but still resulting in a write, you could use a CTE to filter only the rows you need to update and then work with just those.
<cfquery datasource="OurDBLocation" name="changeValues">
; WITH cte AS (
    SELECT rowvalueB
    FROM sometable
    WHERE rowvalueA = 'A123'
        OR ( rowvalueA = 'A456' AND rowvalueB = 'A456' )
)
UPDATE cte
SET rowvalueB =
        CASE
            WHEN rowvalueA = 'A123' THEN <cfqueryparam value="#val(FORM.a123value)#" cfsqltype="cf_sql_integer">
            ELSE <cfqueryparam value="#val(FORM.a456value)#" cfsqltype="cf_sql_integer">
        END
    OUTPUT INSERTED.*
;
</cfquery>

CTE UPDATEs are pretty awesome, if they are available in your flavor of SQL (and by marking tsql, I'm guessing you're SQL Server). Test it to make sure it works for your case. I don't know why a cfquery wouldn't run a CTE UPDATE properly, but I'm not able to test it right now.
In explanation of what is happening:
;WITH cte AS.. creates the named CTE data set. Also see https://www.sqlshack.com/sql-server-common-table-expressions-cte/
SELECT... defines the data that makes up the CTE. Since you want to filter for rowvalueA IN (A123,A456) but then update different values, I simplified the WHERE statement. You'll only update with FORM.a456 value when both rowvalueB AND rowvalueA = 'A456'. So the CTE filters out all rows where rowvalueA=A456 but rowvalueB is something other than A456. Those would be the records that were getting reset to NULL originally.
Then you use a normal UPDATE statement to update the CTE, which will pipe up to the actual rows from the table. Since you're still using a conditional value in the update, we have to use the CASE...WHEN... but the rows have already been filtered and simplified. We only need to check if rowvalueA=A123.
Also note that when I mentioned validation on the client, I wasn't saying to not do it. I was simply pointing out that client-side validation is trivial to bypass, so shouldn't be relied on for any sort of validation that is intended for anything more than client display or ease of use.
========== ORIGINAL ANSWER =======================
If I correctly understand your intent, your query appears to be mostly correct. You are only updating rowdataB in your table. But you aren't giving a default value if your WHEN conditions aren't met, so NULL is assigned to it.
<cfquery datasource="OurDBLocation" name="changeValues">
    UPDATE sometable
    SET rowvalueB =
        CASE
            WHEN rowvalueA = 'A123' THEN <cfqueryparam value="#val(FORM.a123value)#" cfsqltype="cf_sql_integer">
            WHEN rowvalueB = 'A456' THEN <cfqueryparam value="#val(FORM.a456value)#" cfsqltype="cf_sql_integer">
            ELSE rowvalueB
        END
    OUTPUT INSERTED.*
    WHERE rowvalueA IN ('A123','A456')
</cfquery>

This just reassigns the value of rowvalueB back to itself if none of your WHEN conditions in your CASE are met. Because of the WHERE clause, it will ignore any other row.
I think this might add the row to your OUTPUT INSERTED.* if rowvalueA is 'A456', since it will match in your WHERE clause but not in your WHEN clause. If that's not what you're after, you might want to change your WHERE.


text:
Q: add-teamuser with script doesn't works I try to add user with owner role to a team group.
In UPN.UserPrincipalName I have 2 users
And in GroupID just one groupID (both are in string)
foreach($user in $UPN.UserPrincipalName)
        {
            Add-TeamUser -GroupId $GroupID -User $user -role owner
        }

That's the error I have :
Add-TeamUser : Error occurred while executing Add-TeamUser
Code: UnknownError
Message: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">

Bad Request - Invalid URL

HTTP Error 400. The request URL is invalid.

InnerError:
  RequestId: jkdbsferu-sd1-4rt0-45fc-jdsfifsae435
  DateTimeStamp: 2021-06-01T11:45:16
HttpStatusCode: UnknownError
At C:\Tools\Scripts\Semestre1-1.ps1:70 char:13
+             Add-TeamUser -GroupId $GroupID -User $user -role owner
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-TeamUser], ApiException
    + FullyQualifiedErrorId : Microsoft.TeamsCmdlets.PowerShell.Custom.ErrorHandling.ApiException,Microsoft.TeamsCmdlets.Po
   werShell.Custom.AddTeamUser

But I try like, it works  :
$GroupID = "jkdbsferu-sd1-4rt0-45fc-jdsfifsae435"
$user = "user@domain.com"
Connect-MicrosoftTeams
Add-TeamUser -GroupId $GroupID -User $user -role owner

Any help ?

A: Ok, I think I found your issue, I've never seen the source of a foreach be the property of an object:
foreach($user in $UPN) { Add-TeamUser -GroupId $GroupID -User $user.UserPrincipalName -Role Owner }

A: I found the issue ...
do{
        Start-Sleep -Seconds 20
        $GroupID = get-team -DisplayName $team.Fullname | Select-Object GroupID
        $GroupID | Out-File -encoding UTF8 'C:\Tools\Scripts\groupID.csv'
        Write-Host $j
        $j++
    }
    until($GroupID)

So I'm sure the GroupID is created and synchronized
And I put GroupId.GroupID (to be sure)
Add-TeamUser -GroupId $GroupID.GroupID -User $owner -role owner
And it works !
Thanks guys for the help


text:
Q: How to convert multiple columns in one column in pandas? I have the following dataframe:
   route1  route2
1    19.0    51.0
2    47.0    46.0
3    56.0    37.0
4    43.0     2.0

I would like to have the following output.
     edge    route
1    19.0   route1
2    47.0   route1
3    56.0   route1
4    43.0   route1
5    51.0   route2
6    46.0   route2
7    37.0   route2
8     2.0   route2

How can I do that? I checked that Pandas: Multiple columns into one column but it doesnt help that much with the new column routes that I want to create.
Thank you in advance!

A: Use melt:
>>> df.melt(var_name='route', value_name='edge')
    route   edge
0  route1   19.0
1  route1   47.0
2  route1   56.0
3  route1   43.0
4  route2   51.0
5  route2   46.0
6  route2   37.0
7  route2    2.0

If you have some columns to protect, use id_vars=['col1', 'col2', ...] to not flatten them.


text:
Q: $\prod$ and factorial $\prod_{i=0}^{j-1}(j-i+1)$ is $=$ to $(j+1)!$ or $\le$?
I think it is $=$, but if it's not, please put an explanation.

A: $$
\prod_{i=0}^{j-1}(j-i+1)=(j+1)\cdot j\cdot (j-1)\cdots 3\cdot 2=(j+1)!
$$

A: \begin{align}
\prod_{i=0}^{j-1} (j-i+1) & = (j+1)\cdot j\cdot (j-1)\cdots(j-(j-2)+1)\cdot (j-(j-1)+1)\\
& = 2\cdots (j+1)=(j+1)!
\end{align}

A: Set $j-i+1=t$
$i=0\implies t=j+1$
$i=j-1\implies t=?$
$$\prod_{i=0}^{j-1}(j-i+1)=\prod_{t=j+1}^2t=\prod_{t=2}^{j+1}t=?$$


text:
Q: Wicket - position of div tag changes on applying setOutputMarkupPlaceholderTag true I have a div tag in my html page which acts as a placeholder for a panel.
In my java code, whenever I apply setOutputMarkupPlaceholderTag(true) on the panel, the position of my div tag in the html automatically changes to top-left, whereas the original position of my div was bottom-right as I set in my CSS stylesheet.
What should I do ?

A: Why do you want to set the flag to true by calling Component.setOutputMarkupPlaceholderTag(true)?
After all, it seems that setting the flag modifies a style information of the enclosing  block tag.
Can you provide the actually produced html code? Press  in your browser to see the html source code.
Maybe it will look like
<div id="something" class="xy">
    ...
</div>

As I see, you have three options after inspecting the produced div tag:
a) Don't set the flag Component.setOutputMarkupPlaceholderTag(true). You can control the visibility of your panel implementation by an override
@Override
protected void onConfigure() {
    super.onConfigure();

    boolean visible = ...; // evaluate the state
    setVisible(visible);
}

Check http://wicket.apache.org/apidocs/1.5/ for further details of the Component class. (A Panel is a Component.)
b) Modify the style information produced by Wicket by something like:
panel.add(new AttributeModifier("class", "styledPanel");

or more conservative:
panel.add(new AttributeAppender("class", "styledPanel");

You might but have to update the "style" information.
c) Update your CSS stylesheet by reflecting the style information produced by Wicket for this div tag.
Actually, a combination of b) and c) will lead you to the goal. You have to check the produced html code of your panel in the browser.
As far as I am concerned, I would prefer solution a).


text:
Q: Y-axis starts from '32' in main window First of all, here is first question of mine, it marked as duplicate(whereas it was not): https://stackoverflow.com/questions/43167650/setting-ovals-center-as-mouse-coordinates
I spent my last 9-10 hours to fix it.
I will not copy the whole question(I already shared link), but I will tell you more detail.
My window is 512x512.
When I click upper-left of window, x-axis was around 1-2, y-axis was around 30-35. So, checked low side of window, it was around 510 for y-axis, it's normal.
Here's what I've made:
public class Quadtree implements MouseListener{

    int x=256,y=256;
    JFrame frame=new JFrame();
    JPanel thePanel = new JPanel(){
        @Override
         protected void paintComponent(Graphics g)
           {
              super.paintComponent(g);
              drawCenteredCircle((Graphics2D) g,x,y,30);

    }

};

public void drawCenteredCircle(Graphics2D g, int x, int y, int r) {
      x = x-(r/2);
      y = y-(r/2);
      g.fillOval(x,y,r,r);
    }
public static void main(String[] args) {
    new Quadtree();
}
    public void mouseClicked(MouseEvent e) {
    //  Point p=e.getPoint();
        x=e.getX();
        System.out.println(x);
        y=e.getY();
        System.out.println(y);
        thePanel.repaint();
}
    public Quadtree(){

        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(thePanel);
         frame.setLocationRelativeTo(null);
         frame.setSize(512,512);

        frame.addMouseListener(this);
        frame.setVisible(true);
        frame.setResizable(false);
        frame.setTitle("Quadtree");

    }
}

But somehow, in this code which is below, I set oval's y-axis as 0, but it works fine.
public void drawCenteredCircle(Graphics2D g, int x, int y, int r) {
      x = x-(r/2);
      y = y-(r/2);
      g.fillOval(x,0,r,r);
    }

Output is:

But when I make mouse click(explained in first sample), circle appears under the mouse.
Any idea to fix it?

A:
Y-axis starts from '32' in main window

frame.addMouseListener(this);

The frame has a titlebar and border. Don't add the MouseListener to the frame.
Instead add the MouseListener to the panel. Then the mouse point will be relative to the panel, not the frame.


text:
Q: i want to know the rule of using indefinite articles and when you don't have to use them I am writing an essay on economics. I said something like, there are four economic systems, the first one is traditional economy.
should i say, the first one is (a)traditional economy or it is just fine the way I said it?

A: "The rule" is that singular countable content nouns that don't have another determiner get the article "a" or "an".
But applying this rule in practice means deciding when something is a noun (and not a participle etc) when it is countable and singular (tricky since one of the main ways to decide if it is countable is to check if it has singular article). And it is tricky to decide if another determiner should have been used instead.
In your particular example, the problem is using the word "economy" — Is this meant to be countable or not? — tricky because it could be either.   If you realise that you are listing systems and not economies, you will find it much easier to phase this. You have got into difficulties because the first one isn't "traditional economy", but "traditional economic system". You will understand that these are particular determined systems, so should have "The" as their determiner.

There are four economic systems. The first one is the traditional economic system.


text:
Q: Group similar numbers of a vector Let's say that I have the following vector:
c(4, 5, 5, 8, 12, 12, 12, 13, 15, 15, 18, 19, 20, 23, 37, 37, 37, 37, 37, 41)
and I would like to "group" its elements according to their value: numbers that differ <=3 should be considered to belong to the same group.
In this case I would like, for each number appearing in the vector, to get all the numbers that are close to it.
For example,
4  -->  c(4,5,5,8)
5  -->  c(4,5,5,8)
8  -->  c(5,8)
12 -->  c(12,12,12,13,15,15)

etc
Possibly, it could be useful to get also their index...
Is there any smart way to achieve this?

A: You can use this little function:
similar <- function(vec, val, bound = 3, index = F) {
    close.index <- which(abs(vec - val) <= bound)
    if (index) return(close.index)
    return(vec[close.index])
}

x <- c(4, 5, 5, 8, 12, 12, 12, 13, 15, 15, 18, 19, 20, 23, 37, 37, 37, 37, 37, 41)
similar(x, 5)
# [1] 4 5 5 8
similar(x, 5, index = T)
# [1] 1 2 3 4
similar(x, 5, bound = 7)
# [1]  4  5  5  8 12 12 12

A: Perhaps not the most elegant version, but does this do what you wanted to have?
x <- c(4, 5, 5, 8, 12, 12, 12, 13, 15, 15, 18, 19, 20, 23, 37, 37, 37, 37, 37, 41)
vals <- unique(x)
# print indices
for (i in 1:length(vals)) print(which((x >= vals[i] - 3) & (x <= vals[i] + 3)))
# print values
for (i in 1:length(vals)) print(x[which((x >= vals[i] - 3) & (x <= vals[i] + 3))])

[1] 1 2 3
[1] 1 2 3 4
[1] 2 3 4
[1]  5  6  7  8  9 10
[1]  5  6  7  8  9 10
[1]  5  6  7  8  9 10 11
[1]  9 10 11 12 13
[1] 11 12 13
[1] 11 12 13 14
[1] 13 14
[1] 15 16 17 18 19
[1] 20

[1] 4 5 5
[1] 4 5 5 8
[1] 5 5 8
[1] 12 12 12 13 15 15
[1] 12 12 12 13 15 15
[1] 12 12 12 13 15 15 18
[1] 15 15 18 19 20
[1] 18 19 20
[1] 18 19 20 23
[1] 20 23
[1] 37 37 37 37 37
[1] 41

it is indeed a little bit more elegant to use abs.
for (i in 1:length(vals)) print(which(abs(x-vals[i]) <= 3))
for (i in 1:length(vals)) print(x[which(abs(x-vals[i]) <= 3)])

A: Here is a short solution giving you all the group as a list:
x = c(4, 5, 5, 8, 12, 12, 12, 13, 15, 15, 18, 19, 20, 23, 37, 37, 37, 37, 37, 41)

m = unique(x)
setNames(apply(abs(outer(m,m,'-')), 2, function(u) m[u<=3]),m)

#$`4`
#[1] 4 5

#$`5`
#[1] 4 5 8

#$`8`
#[1] 5 8

#$`12`
#[1] 12 13 15

#$`13`
#[1] 12 13 15

#$`15`
#[1] 12 13 15 18

#$`18`
#[1] 15 18 19 20

#$`19`
#[1] 18 19 20

#$`20`
#[1] 18 19 20 23

#$`23`
#[1] 20 23

#$`37`
#[1] 37

#$`41`
#[1] 41

For the index, the same concept can be applied easily:
setNames(apply(abs(outer(m,m,'-')), 2, function(u) which(x %in% m[u<=3])),m)

A: It might be helpful to create lists with the numbers as "keys":
data <- c(4, 5, 5, 8, 12, 12, 12, 13, 15, 15, 18, 19, 20, 23, 37, 37, 37, 37, 37, 41)
uniques <- unique(data)

myGroups <- lapply(
  uniques,
  function(n) Filter(
    function(x) abs(x - n) <= 3,
    data
  )
)
names(myGroups) <- uniques

myIndices <- lapply(
  uniques,
  function(n) which(abs(data - n) <= 3)
)
names(myIndices) <- uniques

Then, to access the group and indices for '12', say:
> myGroups[['12']]
[1] 12 12 12 13 15 15
> myIndices[['12']]
[1]  5  6  7  8  9 10


text:
Q: The application expliintent(process.com.nakool) has stopped unexpectly ,please try again..force close I used this code on android 2.2,but while running this code .I am getting the error as "The application expliintent(process.com.nakool) has stopped unexpectly ,please try again..force close.
When i comment the statement "b.setOnClickListener(this);" .the code is processing successfully..Dont know why I am getting error on this line..pls guide me
enter code here
public void onCreate(Bundle savedInstanceState) {

    Button b=(Button)findViewById(R.id.button1);
    b.setOnClickListener(this);

    i=new Intent(this,activitynew.class);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
}
public void onClick(View v)
{}}

A: Looking at your code it looks like you are trying to findViewById before you have set the content of this activity by calling setContentView(R.layout.main). That means that findViewById return null, and your app coloses due to nullPointerException (b is null...).
Make sure you call setContentView before you try any findViewById.


text:
Q: Prevent Django form inserting javascript that is loaded in head of page I build an application with Django (version 2.2.1). All templates extend a base template, which loads jQuery as follows:
    <script type="text/javascript" src="{% static 'admin/js/vendor/jquery/jquery.min.js' %}"></script>

In one template, the combination of an autocompleting input field from django-autocomplete-light (version 3.4.1) and a datepicker from django-bootstrap-datepicker-plus (version 3.0.5) caused the date picker not to work, due to the bootstrap datepicker not being able to initialize jQuery.
It turns out that I stumbled upon the same problem as mentioned in this question.
The problem is that the template contains a form, which contains a ModelSelect2 widget. This widget causes the form to load jQuery again, as can be seen in its media property:
@property
def media(self):
    """Return JS/CSS resources for the widget."""
    extra = '' if settings.DEBUG else '.min'
    i18n_name = self._get_language_code()
    i18n_file = (
        '%s%s.js' % (I18N_PATH, i18n_name),
    ) if i18n_name else ()

    return forms.Media(
        js=(
            'admin/js/vendor/jquery/jquery%s.js' % extra,
            'autocomplete_light/jquery.init.js',
            'vendor/select2/dist/js/select2.full%s.js' % extra,
        ) + i18n_file + (
            'autocomplete_light/autocomplete.init.js',
            'autocomplete_light/forward.js',
            'autocomplete_light/select2.js',
            'autocomplete_light/jquery.post-setup.js',
        ),
        css={...}, # omitted, because irrelevant for this question.
    )

My question: is it somehow possible to prevent this double loading a javascript file?
I guess that a form must be able to render itself without knowing what else has been rendered in front of it. So is it then somehow possible to inform a Form about any javascript that has already been included in the template so that a Form.media() can exclude javascript that is already loaded outside the form?
Oh sweet irony: while reviewing this question I stumbled upon this question and now I discovered that in a newer version of django-autocomplete-light jQuery has been removed from the media, solving my problem... Nevertheless, I am still interested in an answer to this question, because the problem might occur again with a different combination of widgets provided by external packages.

A: Usually that's why sometimes you would have {% block js %} in the base of the template.
how to organize JS files in Django?


text:
Q: javascript adding/deleting to/from text file I'm trying to use jquery, ajax and PHP to add characters to a text file. The POST ajax call returns successful, but the PHP function is not executed. Does anyone see my error? Workaround?
<html>
<head>
<title>AjaxSend</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script>
$(function() {

$(".update_button").click(function() {
    {
        $.ajax({
        type: "POST",
        url: "changetext.php",
        cache: false,
        success: function(html){
            alert('You were successful');
            }
        });
    } return false;
});

});
</script>
</head>
<body>

<button class="update_button">Put File</button>

</body>
</html>

PHP:
<?php

file_put_contents('test.txt','Text to be added');

?>

A: 1. Check if the file is there, but doesn't get updated
Try to apply FILE_APPEND as third parameter to file_put_contents()
2. Check your permissions.
Make sure you have write access in the directory you write test.txt to. Given your presented code, this would most probably be the root directory in which your PHP script is stored.
3. Update permissions and pick a directory to write to
Create a directory (right there where your script changetext.php is stored at). Give it any name, for example: output
Then set the directory's permissions to 777 and change changetext.php to this:
file_put_contents('output/test.txt','Text to be added', FILE_APPEND);


text:
Q: Pnotify - javascript is working, css not I found this cool little thing called pnotify, which provides really nice notifying alerts via javascript and bootstrap or jquery css but particulary css is not working for me.
I have this code:

<head>

    <title>pNotify test</title>

<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
<!-- jQuery UI -->
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/smoothness/jquery-ui.css" media="all" rel="stylesheet" type="text/css" />
<!-- Bootstrap -->
<link href="includes/bootstrap/css/bootstrap.css" id="bootstrap-css" rel="stylesheet" type="text/css" />
<link href="includes/bootstrap/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="includes/bootstrap/js/bootstrap.min.js"></script>
<!-- Pnotify -->
<script type="text/javascript" src="jquery.pnotify.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.pnotify.default.css">

function show_stack_info() {
var modal_overlay;
if (typeof info_box != "undefined") {
    info_box.pnotify_display();
    return;
}
info_box = $.pnotify({
    title: "Pines Notify Stacks",
    text: "Stacks are used to position notices and determine where new notices will go when they're created. Each notice that's placed into a stack will be positioned related to the other notices in that stack. There is no limit to the number of stacks, and no limit to the number of notices in each stack.",
    type: "info",
    icon: "picon picon-object-order-raise",
    delay: 20000,
    history: false,
    stack: false,
    before_open: function(pnotify) {
        // Position this notice in the center of the screen.
        pnotify.css({
            "top": ($(window).height() / 2) - (pnotify.height() / 2),
            "left": ($(window).width() / 2) - (pnotify.width() / 2)
        });
        // Make a modal screen overlay.
        if (modal_overlay) modal_overlay.fadeIn("fast");
        else modal_overlay = $("<div />", {
            "class": "ui-widget-overlay",
            "css": {
                "display": "none",
                "position": "fixed",
                "top": "0",
                "bottom": "0",
                "right": "0",
                "left": "0"
            }
        }).appendTo("body").fadeIn("fast");
    },
    before_close: function() {
        modal_overlay.fadeOut("fast");
    }
});

</head>

<body>

<button class="btn source" onclick="$.pnotify({
                    title: 'Oh No!',
                    text: 'Something terrible happened.',
                    type: 'error'
                });">Regular Error</button>

<button class="btn source" style="margin-left: 10px;" onclick="show_stack_info();">What are stacks?</button>

</body>

I really have no idea why the javascript is working but no css at all is working. Can someone help?

A: You need to set the style. If you are using jquery do this:
 delay: 20000,
 history: false,
 stack: false,
 styling: 'jqueryui'

A: You cannot use space in the name of your class (if it's a single class).
Try renaming btn source to btn_source.
See Which characters are valid in CSS class names/selectors?
However, as Nimoi pointed out in the comment, it's fine if it's two classes. See How to assign multiple classes to an HTML container?.


text:
Q: ios screen show like this when using local_auth but it's fine on android Flutter I use local auth package Flutter, i have a button for log out and when the screen navigate to the login page again the touch id verification show immediately but not in the proper way I think, can you help to get me now how to solve this? thank you
enter image description here


text:
Q: Dynamic Average Orders Per Day Counter By Date - Including Today() I feel like this is just going to keep getting more and more complex, and this is the only place I can get real help.
Thanks to the guys that helped me on my previous question, I am now working with this formula:
{=COUNTA(A2:INDEX(A:A, MATCH(1E+99, A:A)))/SUM(1/COUNTIF(A2:INDEX(A:A, MATCH(1E+99, A:A)), A2:INDEX(A:A, MATCH(1E+99, A:A))))}  'PRESS (CTRL + SHIFT + ENTER)'

DATA:
         A            B
1 |  ORDER DATE     TODAY
2 |  12/01/2019    =TODAY()
3 |  12/01/2019
4 |  12/01/2019
5 |  15/01/2019
6 |  16/01/2019
7 |  22/01/2019
8 |
9 |
10|

RESULT:
1.5

This formula works great, but if I don't receive an order for the next 50 days, the result will stay 1.5 until my next date entry. How would I implement =TODAY() into the formula, so that the result will change every day - even if I never get an order again?
Thank you


text:
Q: Como asignar a un mismo elemento, dos animaciones CSS3 Estoy intentando hacer una animación de un div que los primeros 2 segundos aparezca y se posicione en el centro de la pagina y una vez terminado esta animación, que ejecute una segunda animación que consista en rotar este div 360 grados infinitamente.
El problema que tengo es que no encuentro ni se como definir dos tipos de Animaciones en un mismo elemento (o que se accione una cuando la primera se ha terminado).

.bloqueAlargado {
   width: 100px;
   height: 400px;
   background-color: blue;
   font-weight: bold;
   position: relative;
   -webkit-animation-name: mymove2 2s; /*Animacion 1*/
   animation-name: mymove2 ;
   animation-duration: 2s;
   left : 36em;
   animation-name: rotacion;  /*Animacion 2*/
   animation-duration: 4s;
   animation-iteration-count: infinite;
}

    @-webkit-keyframes mymove2 {
            from {left: 0em;}
            to {left: 36em;}
    }

    /* Standard syntax */
    @keyframes mymove2 {
            from {left: 0em;}
            to {left: 36em;}
    }

    /* Safari 4.0 - 8.0 */
    @-webkit-keyframes rotacion {
        0% {
            transform: rotate(0deg);

        }
        100% {
            transform: rotate(-360deg);

        }

    }

    @keyframes rotacion {
        0% {
                transform: rotate(0deg);

        }
        100% {
                transform: rotate(-360deg);

        }
    }
<!DOCTYPE html>

    <link rel="stylesheet" type="text/css" href="main.css">
    <title>TRANSICIONES</title>

Animacion Basica

A: Si quieres que ambas animaciones se ejecuten en simultaneo, debes declararlas separadas por coma.
animation: rotacion 1s, mymove2 3s;

Ejemplo:

.bloqueAlargado {
  width: 100px;
  height: 400px;
  background-color: blue;
  font-weight: bold;
  position: relative;
  left: 36em;
  animation: rotacion 4s infinite, mymove2 2s infinite;
}
@-webkit-keyframes mymove2 {
  from {
    left: 0em;
  }
  to {
    left: 36em;
  }
}
/* Standard syntax */

@keyframes mymove2 {
  from {
    left: 0em;
  }
  to {
    left: 36em;
  }
}
/* Safari 4.0 - 8.0 */

@-webkit-keyframes rotacion {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
@keyframes rotacion {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="main.css">
  <title>TRANSICIONES</title>

Animacion Basica

Luego si quieres cargarlas en secuencia, es mas complicado. Debes coordinar los keyframe para que ocupen el tiempo correcto: Donde das la mitad del tiempo total a una de las animaciones y la otra mitad a la otra usando los porcentajes.
@keyframes mymove2 {
  0% {
    left: 0em;
  }
  50% { /* el primer 50% del tiempo esta animacion no hace nada */
    left: 0em;
  }
  100% {
    left: 36em;
  }
}

@keyframes rotacion {
  0% {
    transform: rotate(0deg);
  }
  50% { /* el ultimo 50% del tiempo esta animacion no hace nada */
    transform: rotate(-360deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

Ejemplo:

.bloqueAlargado {
  width: 100px;
  height: 400px;
  background-color: blue;
  font-weight: bold;
  position: relative;
  left: 36em;
  animation: rotacion 4s infinite, mymove2 4s infinite;
}

@keyframes mymove2 {
  0% {
    left: 0em;
  }
  50% {
    left: 0em;
  }
  100% {
    left: 36em;
  }
}

@keyframes rotacion {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-360deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}
<!DOCTYPE html>

  <link rel="stylesheet" type="text/css" href="main.css">
  <title>TRANSICIONES</title>

Animacion Basica

EDICION:

... o que se accione una cuando la primera se ha terminado

En cuanto a eso, para activar una cuando termina la otra se requiere javascript. Si no quieres usarlo, fíjate en la solucion arriba que usa keyframes coordinados.


text:
Q: Katalon Studio to manage dependencies in Gradle I try to use build.gradle file in Katalon Studio project to declare dependencies. Project is to make requests to the Gmail API.
dependencies {
    compile 'com.google.api-client:google-api-client:1.23.0'
    compile 'com.google.oauth-client:google-oauth-client-jetty:1.23.0'
    compile 'com.google.apis:google-api-services-gmail:v1-rev83-1.23.0'
}

When I try to import classes in a new keyword, I get following error:

Groovy:unable to resolve class com.google.api.services.gmail.Gmail


text:
Q: Settings are inconsistent on whether descriptions end in periods or not On the user settings page (your Meta SE one is here) the smaller-font descriptions sometimes end in periods and sometimes don't. This guidance says "Don't use periods in interface copy unless it's a full sentence or description.", and while the non-period descriptions are indeed sentence fragments, they're still descriptions. Additionally, the way that these settings and descriptions are arranged similarly to each other means I think it would be nice if the periods were the same as well. Could it be standardized one way or another?
Here is a list of settings or setting-adjacent things from "Email Settings" or "Preferences"

Name
Description
Has period

Enable new editor
When you flip this switch, you will be opting into a beta test for our new text editor.
Yes

Enable keyboard shortcuts
When enabled, press ? for help
No

Hide left navigation
When you flip this switch, the left navigation will no longer be pinned to the left of the page on Q&A sites.
Yes

Hide hot network questions
When you flip this switch, you will no longer see Hot Network Questions in the right sidebar on Q&A sites.
Yes

Enable advertisements
You have earned the reduce ads privilege. If you'd prefer, you can re-enable them here.
Yes

Stack Overflow never sells or shares your activity data with third parties.
We use your on-site activity to show you more relevant content. For example, we might show you questions based on the tags you usually browse, or show you job listings in your current location.
Yes

Use my on-site activity to show more relevant content (recommended)
If you opt-out, existing recommendations will be discarded within 24 hours.
Yes

Promotional
Get emails to find out what's going on when you're not on Stack Overflow. You can turn them off whenever you want.
Yes

Features & Announcements
New products and feature updates, as well as occasional company announcements
No

Promotional emails from other Stack Overflow systems
Stack Overflow maintains separate Sales and Marketing platforms for business-related emails to promote our paid products to potential business customers. Unsubscribing from all promotional emails using the toggle at the top of this section will sync your unsubscribe request with any matching email addresses in these systems.
Yes

Invitations
Invitations to participate in surveys, usability tests, and more. Only a few per year.
Yes

Tips & Reminders
Timely advice and reminders to help you make the most of our features
No

Inbox
Answers to your questions, comments, chat notifications, and more
No

Community Milestones
Notifications about bounties, reputation and more. Hint: sometimes involves swag.
Yes

Community Digests
Our best community content of the week
No

Question Subscriptions
New questions that match your criteria
No

Stop sending me tag notifications
We want to keep in touch, but only in ways that you find helpful.
Yes

Stop sending me community digests
We want to keep in touch, but only in ways that you find helpful.
Yes


text:
Q: How can I apply a background image to a text input without losing the default border in Firefox and WebKit browsers? For some reason most modern browsers will stop applying their default input border style to text boxes if you give them a background image. Instead you get that ugly inset style. From what I can tell there's no CSS way to apply the default browser style either.
IE 8 doesn't have this problem. Chrome 2 and Firefox 3.5 do and I assume other browsers as well. From what I've read online IE 7 has the same problem, but that post didn't have a solution.
Here's an example:

  <input type="text" class="pictureInput" />

  <input type="text">

In Chrome 2 it looks like this: http://www.screencast.com/users/jadeonly/folders/Snagit/media/d4ee9819-c92a-4bc2-b84e-e3a4ed6843b6
And in Firefox 3.5: http://www.screencast.com/users/jadeonly/folders/Snagit/media/d70dd690-9273-45fb-9893-14b38202ddcc
Update: JS Solution: I'm still hoping to find a pure CSS-on-the-input solution, but here's the workaround I'll use for now. Please note this is pasted right out of my app so isn't a nice, stand alone example like above. I've just included the relevant parts out of my large web app. You should be able to get the idea. The HTML is the input with the "link" class. The large vertical background position is because it's a sprite. Tested in IE6, IE7, IE8, FF2, FF3.5, Opera 9.6, Opera 10, Chrome 2, Safari 4. I need to tweak the background position a couple pixels in some browsers still:
JS:
 $$('input.link').each(function(el) {
   new Element('span',{'class':'linkIcon'}).setText(' ').injectBefore(el);
   if (window.gecko) el.setStyle('padding', '2px 2px 2px 19px');
 });

CSS:
input.link { padding-left: 19px; }
span.linkIcon { z-index: 2; width: 19px; height: 19px; position: absolute; background-image: url(img/fields.gif); background-position: 1px -179px; background-repeat: no-repeat; }

Update: CSS Close Enough Solution: Based on the suggestion from kRON here's the CSS to make the inputs match FF and IE in Vista which makes a good choice if you decide to give up on pure defaults and enforce one style. I have modified his slightly and added the "blueish" effects:
CSS:
input[type=text], select, textarea {
    border-top: 1px #acaeb4 solid;
    border-left: 1px #dde1e7 solid;
    border-right: 1px #dde1e7 solid;
    border-bottom: 1px #e3e9ef solid;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    padding: 2px;
}
input[type=text]:hover, select:hover, textarea:hover, input[type=text]:focus, select:focus, textarea:focus {
    border-top: 1px #5794bf solid;
    border-left: 1px #c5daed solid;
    border-right: 1px #b7d5ea solid;
    border-bottom: 1px #c7e2f1 solid;
}
select { border: 1px; }

A: This is the CSS that I use that can provide the default look back:
input, select, textarea {
    border-top: 1px #acaeb4 solid;
    border-left: 1px #dde1e7 solid;
    border-right: 1px #dde1e7 solid;
    border-bottom: 2px #f1f4f7 solid;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
}

You could also apply :active and give the controls that blueish hue once they're selected.

A: Update!
Ok, here is a workaround that I think is cross-browser compatible. The only issue would be that the default style differs by a few pixels so this might need some tweaking.

            <input type="text" class="pictureInput" />

        <input type="text">

By using absolute-relative positioning you can make the absolute div (containing the image) act absolute in relation to its parent which all browsers I know about (not counting sub-IE6 versions, IE6+ are fine) can handle. User scaling might be an issue, but this is how it is with workarounds.
On the upside, you don't have to change the styles on your inputs at all (except for text-indent, but you'd do that anyway I hope).
On the downside, it's not the prettiest workaround.

Old!
I know this is not what you want, but you could do something like this to at least make all the input borders consistent.
input {
    border-color:#aaa;
    border-width:1px;
}

I haven't tried it in all browsers, but since you aren't setting the border-style it might use the native style but with another size (though you can skip that too). I think the key is to just set the border-color to something so that all input fields will use the same border-color and leave the rest up to the browser.

A: When you change border or background style on text inputs They revert back to the very basic rendering mode. Text inputs that are os-style are usually overlays (like flash is) which are rendered on top of the document.
I do not believe there is a pure CSS fix to your problem. Best thing to do - in my opinion - is to pick a style that you like and emulate it with CSS. So that no matter what browser you're in, the inputs will look the same. You can still have hover effects and the like. OS X style glow effects might be tricky, but I'm sure it is doable.
@Alex Morales: Your solution is redundant. border: 0; is ignored in favor of border: 1px solid #abadb3; and results in unnecessary bytes transferred across the wire.

A: I had a text background image, and this was also annoying me. So I put a relative
 round the <input> and then added the image absolutely positioned over the <input>.
Then of course I needed a little more Javascript to hide the image if it was clicked, or if the input got the focus by tabbing, or by being clicked around the edges of the image.
With a bit of fiddling this looked pretty good with IE8, Firefox, Chrome, and Opera, but it's a horrible kludge and it would be nice if the browsers fixed it.


text:
Q: Material UI TablePagination prop Can anyone please help me what is the actual below warning and how to solve it?
Warning: Failed prop type: Material-UI: the page prop of a TablePagination is out of range (0 to 0, but the page is 10)
I expected a clear console.


text:
Q: Error in Calculator: TypeError: 'float' object is not callable I have learning Python to do my final project. I have begun doing a simple calculator. The code is almost finished but I have an error.
Program give me result fine, but when I try to do another operation program gives me this issue:

TypeError: 'float' object is not callable

Program shows menu to choose the operator. After that, asks user the value of number1 and number2 and checks if the value is a number by the function def numero1() and def numero2()
Please could you help me to solve it?
The program code is the following:
import os #Importamos librerias que se usan en el programa
import sys
import time

def menu(): #Funcion para crear el menu
    os.system('cls')
    print ("********** Menu de la calculadora **********")
    print ("\t1 - Sumar")
    print ("\t2 - Restar")
    print ("\t3 - Multiplicar")
    print ("\t4 - Dividir")
    print ("\t9 - Salir")

def numero1(): #Funcion para introduir un numero como primer valor
     while True:
        try:
            numero1 = float(input("Inserta el primer valor: "))
        except ValueError:
            print("Introduce un número")
        else:
            return numero1

def numero2(): #Funcion para introducir un numero como segundo valor
    while True:
        try:
            numero2 = float(input("Inserta el segundo valor: "))
        except ValueError:
            print("Introduce un número")
        else:
            return numero2

#Definimos 2 variables que vamos a usar
operador = 0
i = 1

#Mientas que la variable i sea mayor que cero se ejecuta el bucle (SIEMPRE)
while i > 0 :
    # Mostramos el menu
    menu()
    #Preguntamos que operacion quiere realizar
    operador = input("¿Que operación quieres realizar?: ")
    while operador != "1" and operador != "2" and operador != "3" and operador != "4" and operador != "9":
        os.system('cls')
        menu()
        print("Introduce un operador correcto")
        operador = input("¿Que operación quieres realizar?: ")

    if operador == "9": #Si es 9 cerramos el programa
        os.system('cls')
        print("SALIENDO.")
        time.sleep(1)
        os.system('cls')
        print("SALIENDO..")
        time.sleep(1)
        os.system('cls')
        print("SALIENDO...")
        time.sleep(1)
        sys.exit()

    #Realizamos una operacion u otra
    if operador == "1":
        numero1 = numero1()
        numero2 = numero2()
        resultado = numero1 + numero2
    elif operador == "2":
        numero1 = numero1()
        numero2 = numero2()
        resultado = numero1 - numero2
    elif operador == "3":
        numero1 = numero1()
        numero2 = numero2()
        resultado = numero1 * numero2
    elif operador == "4":
        numero1 = numero1()
        numero2 = numero2()
        resultado = numero1 / numero2

    #Mostramos el resultado en pantalla y preguntamos si realizamos otra operación
    print("El resultado es: ",resultado)
    salir =(input("Pulsa cualquier tecla para realizar otra operación o 9 para salir..."))
    if salir == "9":
        os.system('cls')
        print("SALIENDO.")
        time.sleep(1)
        os.system('cls')
        print("SALIENDO..")
        time.sleep(1)
        os.system('cls')
        print("SALIENDO...")
        time.sleep(1)
        sys.exit()

A: You should not use variable names that are identical to function names. One will overwrite the other. If you do numero1 = numero1(), then numero1 in that scope will permanently become a floating point number, and the function object will no longer be accessible.
Change your variables names so that none of them are numero1 or numero2.


text:
Q: how to add an INDENTED line at the beginning of each method in many files? I want to add a tracing line to each method in many C# files (see example below), and I want to do this automatically, of course.
My approach would be to use regex to match lines starting with public or private, don't have ; (exclude members), have parentheses (exclude class definitions), up to opening {, all this spanning multiple lines, and add my line after this.
sed would be my natural choice, but unfortunately it is less suited for matching over multiple lines.
I almost don't know perl but I managed the following:
perl -0777 -i.original -pe 's/((private|public)[^;]*?\)\s*?{)/\1\nActivityLoggers.traceMethod();/igs' testFile.cs

This works fine but I'd like to add the line indented. Assuming that the { is always on a separate line I could just reuse it replacing the { with my text, but here my not knowing perl blocks me. Would appreciate any help.
As a bonus, you could help exclude constructors :)
EXAMPLE:
Make this
public partial class AClass : BClass
{
    private static string name;
    private void Method1(int i, string s)
    {
        doSomethng();
    }
    public void Method2
                   (int i, string s)
    {
        doSomethngElse();
    }
 }

into this
public partial class AClass : BClass
{
    private static string name;
    private void Method1(int i, string s)
    {
        ActivityLoggers.traceMethod();
        doSomethng();
    }
    public void Method2
                   (int i, string s)
    {
        ActivityLoggers.traceMethod();
        doSomethngElse();
    }
 }

( In case you're wandering I do fetch the calling method and class names in traceMethod() using StackTrace :) )

A: to work off of what you posted, use this pattern
((private|public)[^;]*?\)\s*?{)(?=\R+(\s+))

and replace with
$1\n$3ActivityLoggers.traceMethod()

Demo

A: With sed :
sed '/\(private\|public\)[^;]*/, /\}/ {
        /\(^[ \t]*\)\([^(]*();\)/ s//\1ActivityLoggers.traceMethod();\n\1\2\n/;
}' sourcefile

/\(private\|public\)[^;]*/, /\}/ defines a pattern space with a range of lines between private|public  and next line containing a } (= the end of method block)
In each block that match, we search for the pattern method and apply the substitution, adding the new line using groups

A: This might work for you (GNU sed):
sed -r ':a;/^\s*(public|private)/,/^\s*\{\s*$/{/^\s*\{\s*$/!b;n;/^\s*(public|private)/ba;h;s/\S.*/ActivityLoggers.traceMethod();/p;g}' file

This looks for the range starting with public or private and ending with a { on a line by itsself. It then reads the next line and if this begins with public or private loops. Otherwise it copies the line and replaces everything from the indent by the required string and prints this. It then  retrieves the copied line and prints that.

A: With GNU awk for multi-char RS and gensub():
$ gawk -v RS='^$' -v ORS= '{print gensub(/((private|public)[^;)]+\)\s*{)(\s*)/,"\\1\\3ActivityLoggers.traceMethod();\\3","g")}' file
public partial class AClass : BClass
{
    private static string name;
    private void Method1(int i, string s)
    {
        ActivityLoggers.traceMethod();
        doSomethng();
    }
    public void Method2
                   (int i, string s)
    {
        ActivityLoggers.traceMethod();
        doSomethngElse();
    }
}