text:
Q: Audio Tag Autoplay Not working in mobile i am using this code and when i see the controls i see the autoplay is not working.
<audio autoplay="true" src="music/lathe_di_chadar.mp3" type="audio/mp3" loop></audio>
and its not working in the mobile devices and very well working in website.
Can anyone tell me the problem in this?.
Thanks and well Appreciated

A: There is no way to get autoplay working in mobile browsers. (This is not allowed)
But some tricks do this thing.
Click on the links below to view some tricks
Autoplay audio on mobile safari
iOS-Specific Considerations | Loop Attribute

A: Now, it's2020
Note that (for the below reason?) Chrome has changed their autoplay policy (see https://developers.google.com/web/updates/2017/09/autoplay-policy-changes ) so you now must either:

*

*resume() the audio context after some (any) user interaction with the page

*or be "highly ranked" (ie trust Chrome not to stop audio by default based on user's and world's behavior)

*or (as far as I get it) user must be on origin A then click a link to same origin A and that new page of A can autoplay things.

You can play a sound using the AudioContext API and taking the source from any ArrayBuffer (ie: from a XMLHttpRequestor a File)
    window.addEventListener('load', function () {
        var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
        var source = audioCtx.createBufferSource();
        var xhr = new XMLHttpRequest();
        xhr.open('GET', 'audio-autoplay.wav');
        xhr.responseType = 'arraybuffer';
        xhr.addEventListener('load', function (r) {
            audioCtx.decodeAudioData(
                    xhr.response,
                    function (buffer) {
                        source.buffer = buffer;
                        source.connect(audioCtx.destination);
                        source.loop = false;
                    });
            source.start(0);
        });
        xhr.send();
    });

Live example
Works on Chrome and Firefox both mobile and Desktop
Important notes
It's worth mentioning, IMO, that this "trick" can actually be considered as a browser bug, and might no longer work at any time if browser decide that this breaks user experience/becomes a widely-used annoyance (like ads).
It's also worth mentioning that, at least on my mobile and FF 54, the sound will still be played, even if your mobile is muted...
It's also also worth mentionning that user might set the autoplay behavior to fit their wishes and needs either through the browser's usual options or through the more-advanced about:config page (autoplay behavior is set by Firefox's media.autoplay.enabled and media.block-autoplay-until-in-foreground preferences).
So forcing the audio autoplay is a bad UX idea no matter how you do it.

A: I have a lot of experience with this problem.  It also applies to Javascript audio that loads before the user has had a chance to interact with the page.
HOWEVER, once a user clicks absolutely anything, it's game on.  I personally recommend a full-page entrance overlay right on the front page: "Click to enter my awesome site!"  If the user enters the page at all, they are doomed to hear whatever sounds you want to throw at them! :D

A: I think this method work today both FF & Chrome. This seams as best solution from @Xenos mention above.


text:
Q: Count first vote from email if user votes multiple times So we use a Microsoft Form that links all data to an excel file where we get all votes from the form.
The problem I'm having is that I need to be able to count the number of votes for each song on this current day. If there is are multiple votes from a user only the first vote should be counted.
How should I do this?
I've tried this:
=ANTAL.OMF(Table1[Jeg stemmer på];E3;Table1[Starttid];">="&IDAG();Table1[Finde Duplicate];1)

A: It turned out to be an error after removing some old entries.
In my find duplicate column it should have been:
=ANTAL.OMF($J$16:$J16;[@Email])

but there was
 =ANTAL.OMF($J$16:$J1106;[@Email])

redpajama_set_name: RedPajamaStackExchange


text:
Q: Flex Serialization for inbuilt components like...HBox, VBox, Panel, Canvas, DataGrid Here is the problem...I'm working on a flex application(actionscript)...
I have a Panel in my application which contains 2 buttons and 3 canvas components at certain posstions...now I want to store the current state of panel in some file or database...and afterwards I want to load the same panel again in my application when I come back and run the application...
so I tried to convert whole panel into ByteArray object using its readObject() and writeObject() methods...but when I read the ByteArray and add the panel in my application using addChild() method it doesn't add anything and there was no error or fault...
writeObject creates ByteArray that I am able to print but when i get it back and add child, I am not able to get the panel and it's children...
if anyone can help...it would be appreciated...thanks in advance...
Here is the example code...explaining what i want to do...

<mx:Script>
    <![CDATA[
        import mx.controls.Alert;
        import mx.rpc.events.ResultEvent;
        import mx.collections.ArrayCollection;

    [Bindable] private var photoFeed:ArrayCollection;

    var buffer:ByteArray;

    private function init():void{

        addEventListener(KeyboardEvent.KEY_DOWN, keyHandler);
        searchTerms.setFocus();
        buffer = new ByteArray();
    }

    private function keyHandler(event:KeyboardEvent):void{
        if(event.charCode == 13){

                    myButton.label = "Exit";

            try{
                buffer.writeObject(myData);

            }catch(error:Error){
                Alert.show(error.toString(),"Encoding Error");
            }

            removeChild(myData);
            reloadButton.visible = true;
            Alert.show("HBox is deleted","Alert");
        }
    }

    private function reloadHBox():void{

        Alert.show("Trying to load Hbox","Alert");
        try{
            buffer.position = 0;
            var obj:HBox = buffer.readObject() as HBox;

        }catch(error:Error){
            Alert.show(error.toString(),"Decoding Error");
        }

        addChild(obj);

        Alert.show("Hbox is reloaded","Alert");
    }

    ]]>
</mx:Script>

<mx:Button id="reloadButton" label="Reload HBox" visible="false" click="reloadHBox()"/>

<mx:HBox width="100%" id="myData">
    <mx:Label text="Hi Rashmin here..."/>
    <mx:TextInput id="searchTerms" name="searchTerms" text="Hello How are you?"/>
    <mx:Button id="myButton" label="Enter"/>
</mx:HBox>

I want to regenerate the HBox so need some help...

A: Creative idea, but I'm not surprised it doesn't work.  Can you share some code?
That said, I'd just write up an algorithm to save the state (x, y coordinates / height width etc... ) and reset that info when you load it.

A: You could create an object that stores your panel position
 private var positions:Object;
 positions = { panel1Position: new Point( panel1X , panel1Y)
                          //etc.... };

Set some default values to start with and your components would get their positions from your positions object.
  private function init():void
  {
     panel1.x = positions.panel1Position.x;
     //etc...
  }

To save your values, use a SharedObject
 var objectName:String = "Put some identifier here";
 var sharedObject:SharedObject = SharedObject.getLocal( objectName , '/' );
 sharedObject.data.positions = positions;

To retrieve your values, you just need
 var sharedObject = SharedObject.getLocal( "the identifier you've set above" , '/' );
 positions = sharedObject.data.positions;

You can then update your components x & y values. Anyway, this is the general idea, for more info check the SharedObject class:
http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/
You can apply the same principle with your panel states, if you can identify each state with an integer for instance, save the state integer in your sharedObject.


text:
Q: Aptana PHP HTML keeps giving "parsing errors exists" I really enjoy working with Aptana for PHP and HTML. However something that bugs me is that I keep getting "Code formating completed. But parsings errors exists." errors after a while and I am almost certain that my file doesn't have parse errors...
Here is an example that will make Aptana's parser choke:

            Description	Details

            File Number:	<? echo $FileNumber ?>

As soon as one removes the inline php from the table it works again and can parse the file like this:

            Description	Details

            File Number:	Inline php removed


text: Q: Android SHH tunneling through school Wi-Fi Ok so I'll try my best to explain the situation at hand here. My school recently got a new web filter that blocks literally, everything. I can't use Google Drive or anything that I need anymore. Our school has Wi-Fi. What I'm wanting to do is SSH tunnel from my phone (Android). I have a SSH client on my phone and a SSH server set up already. I've also set up Firefox to handle SOCKS proxy for tunneling. Here's my problem. Almost all ports are blocked via the schools Wi-Fi. My SSH client won't connect through the WiFi because I guess that client uses a port that's blocked by the school. They DO NOT block port 22(SSH). So that makes me guess that my SSH client app uses a different port. Please help me as to what I can do to circumvent this problem of not being able to SSH into my server through school wifi. Thanks!


text:
Q: How to avoid PKIX path building failed, issue while downloading Cucumber in Eclipse Facing issue in downloading the Cucumber Plugin into Eclipse. Tried both in Marketplace and through URL.
Getting error as displayed below,
Unable to read repository at https://cucumber.github.io/cucumber-eclipse-update-site-snapshot/content.xml.
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
error in eclipse

A: The error in general means that your client code (eclipse) failed to validate SSL certificate that is provided by a server (marketplace). Ususally JRE is distributed with all major CA certs in truststore.
So on could experience issues when they work in corporate networks. In such case corporations often overtake ssl traffic repacking it with their own keys.
If that's the case, you can:

*

*Use JRE that is provided by corporation. It should already have all the set up for handling MTM traffic

*Ask your network admin to provide you root cert and install it manually
If that's not the case and in some reason you have no world's major CA certs in your trust store you can add server certificates one-by-one as soon as they are needed.
To do that you should open that https in browser, click "lock" icon next to your address bar and download the cert (particular steps may differ from browser to browser). Then install that cert to your trust store.
Here you can find the advice on how to install cert manually: https://stackoverflow.com/a/373307/8343843


text:
Q: Loop through files and find and replace columns I have a VBA script below that loops through files in a folder. I would like to find and replce any "$" with "" (nothing) in columns I and J.
When I run this script it appears to run, but there are no changes within the files. Not too sure where the issue is. Any help would be appreciated.
Thanks!
Sub LoopAllExcelFilesInFolder()

Dim wb As Workbook
Dim myPath As String
Dim myFile As String
Dim myExtension As String
Dim FldrPicker As FileDialog

'Optimize Macro Speed
  Application.ScreenUpdating = False
  Application.EnableEvents = False
  Application.Calculation = xlCalculationManual

'Retrieve Target Folder Path From User
  Set FldrPicker = Application.FileDialog(msoFileDialogFolderPicker)

    With FldrPicker
      .Title = "Select A Target Folder"
      .AllowMultiSelect = False
        If .Show <> -1 Then GoTo NextCode
        myPath = .SelectedItems(1) & "\"
    End With

'In Case of Cancel
NextCode:
  myPath = myPath
  If myPath = "" Then GoTo ResetSettings

'Target File Extension (must include wildcard "*")
  myExtension = "*.xls*"

'Target Path with Ending Extention
  myFile = Dir(myPath & myExtension)

'Loop through each Excel file in folder
  Do While myFile <> ""
    'Set variable equal to opened workbook
      Set wb = Workbooks.Open(Filename:=myPath & myFile)

    'Ensure Workbook has opened before moving on to next line of code
      DoEvents

    'Find and replace col I and J
       wb.Worksheets(1).Range("I:J").Replace What:="$", Replacement:=""

    'Save and Close Workbook
      wb.Close SaveChanges:=True

    'Ensure Workbook has closed before moving on to next line of code
      DoEvents

    'Get next file name
      myFile = Dir
  Loop

'Message Box when tasks are completed
  MsgBox "Task Complete!"

ResetSettings:
  'Reset Macro Optimization Settings
    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True

End Sub

*Edit - I have found it will work with .xlsx files, but not with .csv. I would need it to work with csv, so any suggestions would be great.

A: Try something like this:
Sub LoopAllExcelFilesInFolder()

    Dim wb As Workbook
    Dim myPath As String
    Dim myFile As String, ext

    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual

    With Application.FileDialog(msoFileDialogFolderPicker)
        .Title = "Select A Target Folder"
        .AllowMultiSelect = False
        If .Show = -1 Then myPath = .SelectedItems(1)
    End With

    If myPath <> "" Then
        myPath = myPath & "\"
        For Each ext In Array("*.xls*", "*.csv") 'loop different extension patterns
            myFile = Dir(myPath & ext)
            Do While myFile <> ""
                'Debug.Print myFile
                Set wb = Workbooks.Open(Filename:=myPath & myFile)
                wb.Worksheets(1).Range("I:J").Replace _
                   What:="$", Replacement:="", LookAt:=xlPart
                wb.Close SaveChanges:=True
                myFile = Dir()
            Loop
        Next ext
    End If

    Application.EnableEvents = True
    Application.Calculation = xlCalculationAutomatic
    Application.ScreenUpdating = True

End Sub

Note - where possible you should avoid use of Goto for flow control.  You only really need Goto for handling runtime errors (or maybe for breaking out of nested loops).


text:
Q: why don't we deallocate memory after allocating memory for object in heap in C++? #include<iostream>
using namespace std;

class car
{
    string name;
    int num;

    public:
    car(string a, int n)
    {
        cout << "Constructor called" << endl;
        this->name = a;
        this->num = n;
    }

    void enter()
    {
        cin >> name;
        cin >> num;
    }

    void display()
    {
        cout << "Name: " << name << endl;
        cout << "Num: " << num << endl;
    }
};

int main()
{
    // Using new keyword
    car *p = new car("Honda", 2017);
    p->display();
}

why don't we deallocate space for 'car *p'? If we don't deallocate memory space on the heap, won't there be a memory leak?
I am a newbie trying to learn c++. I had read that I always had to deallocate space after allocating on heap... I found this code online

A: Most operating systems will free all memory associated with a program when it ends, so in this case, delete p; can be extraneous.
This gets a bit more uncertain the lower level you go, especially in embedded systems. Best to get in the practice of using delete everytime you use new.
Or don't use new/delete at all when possible.
In your case it is certainly not necessary to use dynamic memory allocation. You could simply write:
int main() {
    car p("Honda", 2017);
    p.display();
}

If you insisted on using dynamic memory allocation, you might use a smart pointer which will take care of the deallocation for you.
#include <memory>

// car class stuff

int main() {
    std::unique_ptr<car> p = std::make_unique<car>("Honda", 2017);
    p->display();
}

An aside on your car class: accustom yourself to using member initializer lists in your constructors.
    car(string a, int n)
    {
        cout << "Constructor called" << endl;
        this->name = a;
        this->num = n;
    }

Becomes:
    car(string a, int n) : name(a), num(n)
    {
        cout << "Constructor called" << endl;
    }


text:
Q: Add Indicator on top of TabBar in Flutter Like this one:

Below code will add Indicator bottom of TabBar:
  DefaultTabController(
    length: 2,
    child : new TabBar(
      labelColor: Colors.purple,
      indicatorColor: Colors.purple,
      indicatorSize: TabBarIndicatorSize.label,
      unselectedLabelColor: Colors.black,
    tabs: [
        new Tab(icon: Icon(Icons.chrome_reader_mode),),
        new Tab(icon: Icon(Icons.clear_all),),
    ]),
  );

But I need Indicator on top of TabBar. I don't think it's a great idea to build a custom tab bar because, I don't want to do lot of works for this simple thing.

A: There is a simple hack and that is to use indicator property and add UnderlineTabIndicator() and that class has named parameter called insets and as the value I added EdgeInsets.fromLTRB(50.0, 0.0, 50.0, 40.0),

Left: 50.0, // make indicator small by 50.0 from left
Top:  0.0,
Right:  50.0, // make indicator small by 50.0 from right
Bottom:  40.0 // pushed indicator to top by 40.0 from bottom

like below:
const textStyle = TextStyle(
    fontSize: 12.0,
    color: Colors.white,
    fontFamily: 'OpenSans',
    fontWeight: FontWeight.w600);

//.....
new TabBar(
  controller: controller,
  labelColor: Color(0xFF343434),
  labelStyle: textStyle.copyWith(
      fontSize: 20.0,
      color: Color(0xFFc9c9c9),
      fontWeight: FontWeight.w700),
  indicator: UnderlineTabIndicator(
    borderSide: BorderSide(color: Color(0xDD613896), width: 8.0),
    insets: EdgeInsets.fromLTRB(50.0, 0.0, 50.0, 40.0),
  ),
  unselectedLabelColor: Color(0xFFc9c9c9),
  unselectedLabelStyle: textStyle.copyWith(
      fontSize: 20.0,
      color: Color(0xFFc9c9c9),
      fontWeight: FontWeight.w700),
  tabs: [
    new Tab(
      text: 'LOGIN',
    ),
    new Tab(
      text: 'SIGNUP',
    ),
  ],
),

Also you can create a custom indicator extending Decoration

A: Another option is to define a new Decoration for the indicator: property of the TabBar widget, in this way you're not bound to the TabBar height (as with using insets: EdgeInsets.fromLTRB(50.0, 0.0, 50.0, 40.0),), but you can't create an indicator smaller than the tab itself.
here the code:
TabBar(
  indicator: BoxDecoration(
    border: Border(
      top: BorderSide(
        color: Theme.of(context).accentColor,
        width: 3.0
      ),
    ),
  ),
),

A: You have to create a custom TabController for this. I found a simple example of Flutter TabBar Here. You can check it in detail here.


text:
Q: retrieve data from xml and display it in html I am working on XML for first time and would highly appreciate help to solve my problem. I have tried few things but it didn't work to retrieve data from XML.
I have XML of following type
<?xml version="1.0" encoding="utf-8" ?>
<search>
  <criterias>
    <criteria operator="EqualTo" xmlpath="//Title/TitleKey">
      <value1>1</value1>
    </criteria>
    <criteria operator="EqualTo" xmlpath="//Title/SubTitleKey">
      <value1>1</value1>
    </criteria>
    <freecriteria operator="EqualTo" xmlpath="//UseMaxRowsToReturn">
      <value1>1</value1>
    </freecriteria>
    <criteria operator="Contains" xmlpath="//Title/TitleReference" >
      <value1>001</value1>
      <desc>Title referenece</desc></criteria>
    <criteria operator="Contains"  xmlpath="//Title/TitleFamily/TitleReference">
      <value1>Title number</value1>
    </criteria>
  </criterias>
</search>

I want retrieve value which is ' 001' which is in XML. I want put them as a hyperlink in HTML. In short I want display it in the HTML page. I have created XSL file but it didn't retrieve the value. I am trying x-query for e.g

Search

                {
                  for $x in doc("Titlesearch.xml")//Title/TitleReference
                  order by $x/TitleReference
                  return
{data($x/TitleReference)}. Title: {data
                      ($x/@Title)}

                 }

but it is not generating any result, not even a html

I have used below xslt too.
    enter code here

                      Application Search

                       Title Reference
                        Title Family

               <xsl:value-of select="//Title/TitleReference"/>
               <xsl:value-of select="="//Title/TitleFamily/TitleReference"/>

          </xsl:for-each>

                   </xsl:template>
                 </xsl:stylesheet>

A: Your XPath syntax does not at all match the XML you are using as the input document. The attributes xmlpath are just strings, they do not imply any sort of XPath. The XPath's that you need should navigate the source document.
As your XPath's do not match your XML document at all, it is hard to know what you are trying to achieve exactly. However, for example, perhaps you may actually be trying to do something like the following:

Search

        {
            for $x in doc("Titlesearch.xml")/search/criterias/criteria[@operator eq "Contains"][@xmlpath eq "//Title/TitleReference"]
            order by $x/value1
            return

                    Title: {$x/value1/text()}

        }

Also I would note that depending on the XQuery processor you are using, you may need to provide an absolute URI in the argument to doc, which locates your Titlesearch.xml, e.g.
doc("file:/some/path/on/your/computer/Titlesearch.xml")

A: You need an XSLT processor to run your XSL. Have a look at the following depending where you want to run the processor:

*

*client-side: Saxon Client Edition ;

*server-side: Saxon 9.x or Xalan.


text:
Q: How to repeat reading the value from the BLE device only when the value updated (python on MacOS)? As title, now I can get values from the BLE device, as the following codes shown:
class RobotDelegate(object):
...

def peripheral_didDiscoverCharacteristicsForService_error_(self, peripheral, service, error):
for characteristic in self.service.characteristics():
   if characteristic.UUID() == blebee_characteristic:
        self.characteristic = characteristic
        print ("self.characteristic.value = ", self.characteristic.value())
...

delegate = RobotDelegate()
manager = CBCentralManager.alloc()
manager.initWithDelegate_queue_options_(delegate, None, None)

AppHelper.runConsoleEventLoop()

And I can read the value from my BLE device only one time... Actually, the BLE device can continuously update the value when someone touch, so I like to know how should I do to achieve this? Thanks.

A: I would recommend to use the Observer Pattern. An Example can be found here. In your case a BLE device would be a 'Subject' and notifies each time, when the value changes.


text:
Q: How to I set the value of http headers in a mule FunctionalTestCase I have a flow that need to access to a specific header 'REMOTE_USER' from the HTTP request:
 <flow name="http" >
      <http:inbound-endpoint exchange-pattern="request-response" host="127.0.0.1" port="8501"/>
      <logger message="#[message.inboundProperties.get('http.headers').get('REMOTE_USER')]" level="ERROR" />
...

I would like to write a unit test with that set this header and test the flow.
@Test
public void testSend() throws Exception{
  MuleClient client = muleContext.getClient();
  HashMap<String, Object> headers = new HashMap<String, Object>();
  headers.put("REMOTE_USER", "test");
  Map<String, Object> properties = new HashMap<String, Object>();
  properties.put("http.headers", headers);
  MuleMessage result = client.send("http://localhost:8501", "test", properties);
  assertNotNull(result.getPayloadAsString());
}

Is there a way to test this?

A: To add in HTTP header use message-properties with scope outbound:
 <message-properties-transformer  doc:name="REMOTE_USER">
            <add-message-property key="REMOTE_USER" value="abcdxyz"/>
 </message-properties-transformer>

To test in Functional Test:
public class XYZTest extends FunctionalTestCase {

 @Test
 public void testXyz(){
        HttpClient hc = new DefaultHttpClient();
        HttpPost post = new HttpPost();
        post.set.....
         .......

      org.apache.http.HttpResponse response = hc.execute(post);
      assertNotNull(response.getFirstHeader("REMOTE_USER"));
  }
}


text:
Q: javascript validate birthday im trying to validate birth numbers with a simple script but this script returns true even tho i type in a month over 12 and day over 31, so what have i missed?
var as = /^[0-9]{6}[-+][0-9]{4}$/;
var pn=document.forms.kontakt.pnr.value;
if (as.test(pn)) {
  var year = pn.substr(0,2);
  var month = pn.substr(2,2);
  var day = pn.substr(4,2);
  if (month <= 13 && day <= 32) {
    return true;
  }
} else {
  alert ("Fyll i korrekt personnummer xxxxxx-xxxx");
  kontakt.pnr.style.background = "red";
  return false;
}

A: The if/else statement is fine, the problem is probably in your substr or regex.
I would console.log your "month" and "day" variables to narrow down your bug.

A: var as = /^[0-9]{6}-[0-9]{4}$/;
var pn = document.forms.kontakt.pnr.value;
if (as.test(pn)) {
var year  = pn.substr(0,2);
var month = pn.substr(2,2);
var day   = pn.substr(4,2);
if (month > 12 || day > 31) {
alert("Fyll i korrekt personnummer");  siffror
kontakt.pnr.style.background = "red";
return false;
}
else {
return true;
 }
 }
 else {
alert("Fyll i personnummer i formatet xxxxxx-xxxx");
kontakt.pnr.style.background = "red";
return false;
 }

This was the solution for me!


text:
Q: Change base class of existing derivated class At the moment I'm writing an application which shows level measurement data into some graphs. Always I have date/time on x-axis and data on th y-axis. I use Qwt for this and modified QwtPlotPicker class to show proper time labels. I did this by derivation and redefining a member function:
class myQwtPlotPicker : public QwtPlotPicker {
Q_OBJECT

public:
  explicit myQwtPlotPicker( QWidget* canvas, bool DateScale = false );
  explicit myQwtPlotPicker( int xAxis, int yAxis, QWidget* canvas, bool DateScale = false );
  explicit myQwtPlotPicker( int xAxis, int yAxis, RubberBand rubberBand, DisplayMode trackerMode, QWidget* canvas, bool DateScale = false );
  virtual ~myQwtPlotPicker() {};

protected:
  virtual QwtText trackerTextF( const QPointF &position ) const {
    ... redefinition of the label text ...
  }

};

As you can see I also added a new parameter DateScale which turns date labels on or off. This works perfectly, but there is a class QwtPlotZommer which is derivated from QwtPlotPicker:
class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker { };

Now, the problem is, how do I get the class QwtPlotZommer to derive from myQwtPlotPicker and not from QwtPlotPicker?
Or course I could edit the Qwt sources, but there has to be a proper way of doing this.
I hope there is a proper way to do this. I would be glad, if someone could help me with this.

A: Try multiple inheritance:
class myQwtPlotZoomer : public QwtPlotZoomer, public QwtPlotPicker { };

A: There's no way to change class hierarchy at runtime in C++.

A: I guess that you should reconsider your design - you cannot and should not change the inheritance hierarchy of some library class.
Did you look at some examples to see how the classes you mentioned are intended to be used?  Perhaps you should ask a new question to find out how to solve the problem you are actually facing (i.e. how to create a zoomable plot in qwt if I understand you correctly)

A: You have to overload QwtPlotZoomer reimplementing trackerTextF(). If you also have a use case of a standalone QwtPlotPicker - not being a QwtPlotZoomer - you have to do it twice:
class YourPicker: public QwtPlotPicker ...
class YourZoomer: public QwtPlotZoomer ...
As your implementation is a one-liner I don't see a problem in writing it twice, but if you want to avoid that, you have to put the code to some other class, that is called in both overloaded methods.


text:
Q: Select all post and its comments for a specific user i have a common situation here. I want to select all posts and its comments for a specific user. For example:
 1)

   Post:
     1(PostId), SomeTitle, SomeText
     2(PostId), SomeTitle, SomeText
   Comments:
     1, 1(PostId), CommentTitle, CommentText, UserId(1 - from another table)
     2, 1(PostId), CommentTitle, CommentText, UserId(1 - from another table)
     3, 2(PostId), CommentTitle, CommentText, UserId(2 - from another table)
     4, 2(PostId), CommentTitle, CommentText, UserId(2 - from another table)

I want to select, for example, first post in one result set and its comments in another result set by user id. In short, i would like to select all user commented posts and its comments. Can anyone help me? I was thinking to create a SP with userId and postId as parameters, but i had issues.

A: This selects all posts
SELECT * FROM Post WHERE PostID IN (SELECT PostID FROM Comments WHERE UserID = 1);

This select all posts and comments:
SELECT * FROM Post AS P, Comments AS C WHERE C.PostID = P.PostID AND C.UserID = 1 group by C.CommentId;

(Not tested, but should work)

A: SELECT p.SomeTitle, p.SomeText, c.CommentTitle, c.CommentText, c.UserID
FROM post AS p
LEFT JOIN Comments AS c
        ON c.PostId = p.PostId

if you want to add information about the use who commented from another table (let's call it userTable), you can add this:
LEFT JOIN userTable AS uT
       ON uT.UserId = c.UserId

This code should return you ALL the posts even these with no comments + the ones with comments associated with their respective posts


text:
Q: Unable to setup the drizzle vue plugin with the vuejs 2 I have setup the drizzle with vuejs 2 using official documentation here.
When I try running the project with yarn serve I am getting the following errors

For the fix, I tried installing all the packages. Unfortunately it didn't work for me

A: The solution to this is pretty simple.

*

*Install the packages
yarn add -D buffer process stream-browserify os-browserify stream-http https-browserify url

*Configure the webpack in the vue.config.js file
resolve: {
 fallback: {
   http: require.resolve("stream-http"),
   https: require.resolve("https-browserify"),
   crypto: require.resolve("crypto-browserify"),
   stream: require.resolve("stream-browserify"),
   os: require.resolve("os-browserify/browser"),
   url: require.resolve("url"),
   assert: require.resolve("assert"),
 },
},

*Start the vuejs dev server
yarn serve


text:
Q: How to take difference of two columns multiple times without writing a loop in a data frame My data looks like this
ID   A_w B_w C_w  A_b  B_b  C_b
 1    3   4   6   0.5  0.2  0.9
 2    6   5   7   1.4  3.2  7.6
 3   12   11  27  5.4  3.2  6.1

My want to add new columns like A_c = A_w - A_b(same for B_c and C_c). The most straightforward way is probably to write a loop, but I wonder whether it could be done using apply or lapply. As you can see, the variable names have patterns. Additionally, it is always the difference between dataframe[, x] and dataframe[, x+3].
As a novice in R, I found R documentation is not very helpful. For example, if I didn't accidentally see .SD is used to represent the subset in lapply, I will never know about its existence because it is not mentioned in the R documentation or any other online tutorials. Actually, stack overflow is the only place I see people ask about .SD. Any suggestions to deal with situations like this will be appreciated!

A: An idea via base R, using sapply over the unique names (before _). Then use Reduce to subtract the columns matching the unique names, i.e
m1 <- sapply(unique(sub('_.*', '', names(df[-1]))), function(i)
                                               Reduce(`-`, df[grepl(i, names(df))]))

#tidy and bind with original df,
cbind(df, setNames(data.frame(m1), paste0(colnames(m1), '_c')))

Or avoid cbind and do it directly as @lmo proposes,
baseNames <- unique(sub('_.*', '', names(df[-1])))
df[paste(baseNames, "c", sep="_")] <- sapply(baseNames, function(i)
                                                     Reduce(`-`, df[grepl(i, names(df))]))

Vectorized Solution
Since you mention that Additionally, it is always the difference between dataframe[, x] and dataframe[, x+3], then a fully vectorized way would be (keeping baseNames from before),
m1 <- matrix(seq(ncol(df)-1)+1, ncol = 2)
df[paste(baseNames, "c", sep="_")] <- df[m1[,1]] - df[m1[,2]]

All of the above give,

  ID A_w B_w C_w A_b B_b C_b A_c B_c  C_c
1  1   3   4   6 0.5 0.2 0.9 2.5 3.8  5.1
2  2   6   5   7 1.4 3.2 7.6 4.6 1.8 -0.6
3  3  12  11  27 5.4 3.2 6.1 6.6 7.8 20.9

A: using tidyr and dplyr you can do this:
library(tidyr)
library(dplyr)
df1 <- read.table(text="ID   A_w B_w C_w  A_b  B_b  C_b
1    3   4   6   0.5  0.2  0.9
2    6   5   7   1.4  3.2  7.6
3   12   11  27  5.4  3.2  6.1",header=T,stringsAsFactors=F)

df1 %>% gather(var,val,-ID) %>%
  separate(var,c("var1","var2")) %>%
  spread(var2,val) %>%
  mutate(c=w-b) %>%
  gather(var2,val,-ID,-var1) %>%
  unite(var,c("var1","var2")) %>%
  spread(var,val)

  ID A_b A_c A_w B_b B_c B_w C_b  C_c C_w
1  1 0.5 2.5   3 0.2 3.8   4 0.9  5.1   6
2  2 1.4 4.6   6 3.2 1.8   5 7.6 -0.6   7
3  3 5.4 6.6  12 3.2 7.8  11 6.1 20.9  27


text:
Q: How to quit/exit from file included in the terminal What can I do within a file "example.jl" to exit/return from a call to  include() in the command line
julia> include("example.jl")

without existing julia itself. quit() will just terminate julia itself.
Edit: For me this would be useful while interactively developing code, for example to include a test file and return from the execution to the julia prompt when a certain condition is met or do only compile the tests I am currently working on without reorganizing the code to much.

A: I'm not quite sure what you're looking to do, but it sounds like you might be better off writing your code as a function, and use a return to exit. You could even call the function in the include.

A: Kristoffer will not love it, but
stop(text="Stop.") = throw(StopException(text))

struct StopException{T}
    S::T
end

function Base.showerror(io::IO, ex::StopException, bt; backtrace=true)
    Base.with_output_color(get(io, :color, false) ? :green : :nothing, io) do io
        showerror(io, ex.S)
    end
end

will give a nice, less alarming message than just throwing an error.
julia> stop("Stopped. Reason: Converged.")
ERROR: "Stopped. Reason: Converged."

Source: https://discourse.julialang.org/t/a-julia-equivalent-to-rs-stop/36568/12

A: You have a latent need for a debugging workflow in Julia.  If you use Revise.jl and Rebugger.jl you can do exactly what you are asking for.
You can put in a breakpoint and step into code that is in an included file.
If you include a file from the julia prompt that you want tracked by Revise.jl, you need to use includet(.
The keyboard shortcuts in Rebugger let you iterate and inspect variables and modify code and rerun it from within an included file with real values.
Revise lets you reload functions and modules without needing to restart a julia session to pick up the changes.
https://timholy.github.io/Rebugger.jl/stable/
https://timholy.github.io/Revise.jl/stable/
The combination is very powerful and is described deeply by Tim Holy.
https://www.youtube.com/watch?v=SU0SmQnnGys
https://youtu.be/KuM0AGaN09s?t=515
Note that there are some limitations with Revise, such as it doesn't reset global variables, so if you are using some global count or something, it won't reset it for the next run through or when you go back into it.  Also it isn't great with runtests.jl and the Test package.  So as you develop with Revise, when you are done, you move it into your runtests.jl.
Also the Juno IDE (Atom + uber-juno package) has good support for code inspection and running line by line and the debugging has gotten some good support lately.  I've used Rebugger from the julia prompt more than from the Juno IDE.
Hope that helps.

A: @DanielArndt is right.
It's just create a dummy function in your include file and put all the code inside (except other functions and variable declaration part that will be place before). So you can use return where you wish. The variables that only are used in the local context can stay inside dummy function. Then it's just call the new function in the end.
Suppose that the previous code  is:
function func1(...)
....
end

function func2(...)
....
end

var1 = valor1
var2 = valor2
localVar = valor3
1st code part
# I want exit here!
2nd code part

Your code will look like this:
var1 = valor1
var2 = valor2

function func1(...)
....
end

function func2(...)
....
end

function dummy()
  localVar = valor3
  1st code part
  return  # it's the last running line!
  2nd code part
end

dummy()

Other possibility is placing the top variables inside a function with a global prefix.
function dummy()
  global var1 = valor1
  global var2 = valor2
  ...
end

That global variables can be used inside auxiliary function (static scope) and outside in the REPL
Another variant only declares the variables and its posterior use is free
function dummy()
  global var1, var2
  ...
end


text:
Q: Cómo calcular la cantidad de ceros en un data frame? En el data frame "mi_df", las columnas 7 a 30 tienen valores aleatorios. Necesito calcular cuántas veces aparece el cero en cada FILA.
Quizás funciona algo como:

mi_df$cant_ceros <- apply(mi.df[ ,7:30],1, ...)

pero no se como indicar que cuente la cantidad de ceros dentro de apply (matriz, 1, FUNCTION)


text:
Q: Printing 0 as hex in operator<< Here is a code sample that I am using to print the contents of a uint8_t vector in hex format.
#include <iostream>
#include <iomanip>
#include <cstdint>
#include <vector>

std::ostream& operator<<(std::ostream& o, const std::vector<uint8_t>& packet) {
    std::ios_base::fmtflags oldFlags = o.flags();
    std::streamsize oldPrec  = o.precision();
    char oldFill  = o.fill();

    o << std::showbase // show the 0x prefix
      << std::internal // fill between the prefix and the number
      << std::setfill('0'); // fill with 0s

    for (std::size_t i = 0; i < packet.size(); ++i) {
        o << std::setw(4) << std::hex << (int) packet[i] << " ";
    }

    o.flags(oldFlags);
    o.precision(oldPrec);
    o.fill(oldFill);

    return o;
}

int main() {
    std::vector<uint8_t> packet{0x81, 0x55, 0x00};
    std::cout << packet << "\n";
}

This prints the following:

0x81 0x55 0000

I want that last 0000 to show up as 0x00. How can I achieve this?
PS: I looked at couple of questions regarding printing 0x00 but answers on those questions prints 0000 for me as well.


text:
Q: Shell script to recursively find and list largest files, ask confirmation to remove them and, if confirmed, remove them I want to write a shell script that recursively finds the largest files with .log extension and lists them out. It has to further ask for the confirmation to remove them. If confirmed, it has to delete that file. I'm new to shell scripting and the closest I got to was this:
#!/bin/bash
cd /
find . -name "*.log" -type f -exec du -sh {} + | sort -rh | head -n 10
This lists out top 10 .log files(largest file first). But, I've no clue how to continue from here. How do I parse this list and ask for the confirmation for removing each file and proceed accordingly?
please help

A: Try
rm -i $(find . -name "*.log" -type f -exec du -sh {} + | sort -rh | head -n 10)

Basically, taking the output of your find command and using it with "rm -i"  The "rm -i" forces the rm command to be interactive.  It will prompt you if you want to remove a file.
Hope this helps.

A: If you make use of the printf function within find, you can easily list all files and sort them according to their size:
find . -iname '*log' -printf "%s %p\0" | sort -z -k1rn

We use here the \0 as a line terminator to avoid any issues with possible "funny" filenames. This output can now be piped to a simple while loop that does the queries:
find . -iname '*log' -printf "%s %p\0" | sort -z -k1rn \
    | while read -r -d  $'\0' size file; do
         echo "size: $size"
         echo "file: $file"
         while true; do
            read -p "Do you wish to delete this file (y/n) or quit (q)?" ynq
            case "$ynq" in
                [Yy]* ) rm "$file" ;;
                [Nn]* ) continue   ;;
                [Qq]* ) exit       ;;
                * ) echo "Please answer yes/no or quit.";;
            esac
         done
      done


text:
Q: randomized jQuery.sortable, is dropped item in the correct spot? I am building this as a self check for online students. The real content is ordering historic events.
Right now I have an ordered list that is randomized and then turned into a sortable list. I even have it set up so that when any item is dropped, it checks to see if the whole thing is in the correct order. See the jsfiddle:
http://jsfiddle.net/kking/ptgxedhh/2/
    var ul = document.querySelector('ul');
for (var i = ul.children.length; i >= 0; i--) {
    ul.appendChild(ul.children[Math.random() * i | 0]);
}
var correctOrder = ["one", "two", "three", "four", "five", "six"];
$("#sortable").sortable({
    stop: function (event, ui) {
        console.log("item dropped");
        var order = $(this).sortable('toArray');
        console.log(order);
        for (i = 0; i < correctOrder.length; i++) {
            if (correctOrder[i] == order[i]) {
                console.log(i + " correct!");
            } else {
                console.log(i + " incorrect!");
                break;
            }
        }
    }
});
$("#sortable").disableSelection();

What I need it to do next, is check to see if the last dropped item is in the correct spot. I don't have any clue where to start, other then I know it belongs in the stop function. I'm not sure if it's better to use my arrays, and ask if the item dropped is in the same position as the correctOrder array.. or some other method. To be truthful, I'm not sure how I would even get the array position of that dropped item.
Any help or pointers is appreciated!

A: You can can the dropped index with ui.item.index().

$(document).ready(function () {
    var ul = document.querySelector('ul');
    for (var i = ul.children.length; i >= 0; i--) {
        ul.appendChild(ul.children[Math.random() * i | 0]);
    }
    var correctOrder = ["one", "two", "three", "four", "five", "six"];
    $("#sortable").sortable({
        stop: function (event, ui) {
            console.log("item dropped");
            var order = $(this).sortable('toArray');

            var droppedIndex = ui.item.index();
            if (order[droppedIndex] === correctOrder[droppedIndex]) {
                alert('Correct!');
            } else {
               alert('Incorrect.');
            }

            for (i = 0; i < correctOrder.length; i++) {
                if (correctOrder[i] === order[i]) {
                    console.log(i + " correct!");
                } else {
                    console.log(i + " incorrect!");
                    break;
                }
            }
        }
    });
    $("#sortable").disableSelection();
});
 ul {
     list-style-type: none;
     margin: 0;
     padding: 0;
     margin-bottom: 10px;
 }
 li {
     margin: 5px;
     padding: 5px;
     width: 150px;
 }

<link href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="stylesheet"/>

1

2

3

4

5

6


text:
Q: What can be said about the sets $A$ and $B$ if $A \Delta B = A$? Is this question just asking what $A$ and $B$ are?
Like, $A = (A – B) \cup (B – A)$?
Or should I be writing a proof of some sort?

A: $A \Delta B = A$ iff $B=\emptyset$. $\Delta$ forms a commutative group where each element is self-inverse and the neutral element is $\emptyset$.
And in such a group: $a+b=a\implies 0= a+a =a+ a+b = 0+b = b$
Or low level: if $x \in B$ then either $x \in A$ and then $x \notin A \Delta B=A$ contradiction or $x \notin A$ and then $x \in A \Delta B =A$ also contradiction. So no $x \in B$ can exist.


text:
Q: How do I add Google Analytics to a large Windows Phone 8.1 project I have a Windows Phone 8.1 Project that does something similar to youtube. (The windows phone version). Now I want to integrate Google analytics to it, I saw an article on visual studio magazine on how to do it for page views, events, and exception. The challenge is, this project has a lot of pages and views, a lot of events, and handled exceptions (try catch block). Is there a fast way to put this Google Analytics sdk codes instead of writing in the code on each page, event or exception one after the other (I mean that would be tedious)

A: You have a few options.
1) build your own SDK based on measurement protocol
https://developers.google.com/analytics/devguides/collection/protocol/v1/
https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters
2) try to use some unofficial SDK like:
https://googleanalyticssdk.codeplex.com/
https://googleanalyticssdk.codeplex.com/documentation

A: First, choose the right 3rd party SDK, because there is no official one, of course. I would recommend https://googleanalyticssdk.codeplex.com/.
To make things easier, you can hook into the Frame`s navigated event to easily log page views for every page, an exaple (but using AppInsights)
    /// <summary>
    /// Handles application navigation
    /// Reports current View to analytics
    /// </summary>
    /// <param name="sender">Frame</param>
    /// <param name="e">NavigationEventArgs</param>
    private void FrameNavigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
    {
        try
        {
            var viewName =
                e.Uri.ToString().Replace("//", "/").Replace("/Views/", "").Split('.').First().Replace("View", "");
            AnalyticsHelper.TrackPageView(viewName);
        }
        catch (Exception ex)
        {
            AnalyticsHelper.TrackException("FrameNavigatedTelemetry", ex, e.Uri != null ? e.Uri.ToString() : "");
        }
    }

Or if you have a common base ViewModel for all your ViewModels you can put reporting there. But events, exceptions, you will have to do it manually.


text:
Q: What to do when a new user makes a post with a helpful link Today I failed a test when reviewing late answers from new users. The user made a post with a single link and I didn't do anything with it.
The answer was useful, but it should have been a comment because it was only a hyperlink. Since new users can't write comments, it was the best thing he could do to help the questioner.
So I'd like to know what to do at posts like that one. Should I post the answer as a comment, and flag the question as "not an answer"? Or Should I just flag it and an operator will post it as a comment? Anyway I think, the user who posted the answer will lose something, because his help will appear with the name of somebody else.

A: As @daniel said in the comments, you should tell them that they should summarize the article while keeping the original source. If they fail to do this, report it as as Not A Answer, or change it yourself.

A: As the popup comes when anyone is about to write an answer, we can give there bold headlines if possible to make the answer more explanatory.
Even after that the user fails to provide sufficient information then we can edit that answer to add some description in it.


text:
Q: Replace newline character with ',' in Notepad or BBEdit or using Unix command `tr`? I have to replace the newline character with ',' for using in some oracle command but in a single command. I can't figure out how to do it.
Input:
R1
R2
R3
R4

Required Output:
'R1','R2','R3','R4'

A: In BBedit, you would use a grep like these for find:
(R[0-9]+)\r

and replace:
'\1',

A: Using tr:
cat data.txt | tr '\n' ','

If you need the quotes, you could pipe to sed:
cat data.txt | tr '\n' ',' | sed "s/,/','/g"

… which gets you pretty close:
R1','R2','R3','R4','

A: Using sed:
 sed -n '1h;1!H;${ g; s/\n/,/g; s/\([^,]*\)/'\''\1'\''/gp}' input

A: Here's one way using sed:
sed ":a;N;\$!ba;s/\n/','/g;s/^\|$/'/g" file

Results:
'R1','R2','R3','R4'

A: The requirement to replace newlines does not match your sample output.  To replace newlines with ,, you can do tr \\n ,, but this gives you output with a trailing comma that does not have a trailing newline.  Also, it does not quote your input.  Perhaps you are looking for:
paste -s -d, input

Or, if you do actually want the fields to be quoted:
< input sed "s/^\|$/'/g" | paste -s -d,

In the above, your input file is named input.  The final command can also be written:
sed "s/^\|$/'/g" input | paste -s -d,


text:
Q: Window is being skipped when alt-tabbing I frequently alt tab between two windows with other windows running in the background. When I hold alt, then press and release tab, the windows should look like the numbers below, where windows 1 and 2 are the windows I am currently using, and 3 and 4 are background windows. The bolded number indicates the window is being selected:
1 2 3 4
2 1 3 4
1 2 3 4
2 1 3 4
That is, I should be switching between windows 1 and 2 only
However, occasionally, the windows get shown as below:
1 2 3 4
As in, the 2nd window was skipped over and the 3rd window was directly selected. I have tested with multiple different applications as windows 1 and 2, and I have not found a pattern as to when this bug occurs.
This issue only started recently, and I suspect that it may be related to the recent "alt tab to show edge tabs" Windows update.
Has anyone experienced the same problem, and are there any solutions?
Edit: current OS build is 19042.630, Alt-tab to show tabs in Edge is off

A: Alt-Tab is currently bugged in Windows 10 20H2, even if you disable the Edge Tabbing, it will alt-tab you to a window you didn't want to. You can go back to the legacy alt-tab while waiting for a fix from Microsoft. Here's a howto:

*

*Regedit Path: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer

*Create DWORD (32 bit) AltTabSettings

*Change value of AltTabSettings to "1"


text:
Q: TFSPreview.com and Azure continuous deployment for multiple solutions in TFS I recently tried out Microsoft's TFS-in-the-cloud service (TFSPreview.com) and felt the TFS team finally 'gets it'. TFSPreview.com might switch us from GIT+bug tracker+powershell as the integrated workflow actually works (continuous deployment is GREAT!).
Well, almost. Our "one project" test on TFSPreview.com works great for continuous deployment but our 'real' source controls looks like
Root
\--Solution1
   \--ProjectA(IIS)
   \--ProjectB(IIS)
\--Solution2
   \--ProjectC(AzureWebRoleProject)

Question: How can I express the following to TFSPreview.com/Azure's portal/VS2012?

*

*Everything in root must be version controlled in TFS

*But only ProjectC should be enrolled in Azure's continuous deployment

Continuous deployment currently tries to deploy the entire root to Azure and sure enough, fails. On a side note, it would be nice if they enabled continuous deployment for GIT for Azure Cloud services too (not just for Azure Web sites as right now)
Thanks
Sid

A: This is something that has actually been discussed via the online forums at the TFS Deployment to Windows Azure forums.
Specifically, a MS representative has indicated that this is currently not supported (see Continuous deployment with multiple cloud projects in solution), but is something that they need to provide a solution for.

A: Here is a possible workaround that will make you feel like bathing.
Root
\--Solution2
   \--ProjectC

Root-Branch
\--Solution2
   \--ProjectC
\--Solution1
   \--ProjectA
   \--ProjectB

*

*Only the main branch (Root) appears to be deployed on check-in.

*Merge to Root when you want to deploy.

*Never merge Solution1 back to Root.


text:
Q: Apt output showing unneeded stuff Ubuntu Server 22.04.1 LTS x86_64
On every install using apt it will output this, how do i "hide" it? by hiding i mean find the source of this output and uninstall it? or find the package that checks after every run.
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

A: Actually apt doesn't know any options to suppress output to the terminal while running.
You could use apt-get instead, which apt is build on top on. apt-get knows the option -q which suppresses most but not all output. The option --qq suppresses all output, which is not recommended for all cases, see man apt-get for details on that.
Alternatively, you can configure unattended-upgrades, which enables systems, especially server systems, to upgrade without user interaction automatically. A step-by-step guide can be found e.g. at the Digital Ocean community tutorials or at the Ubuntu community Wiki.


text:
Q: zf2 Album with doctrine I installed doctrine and this is working with zfcUser. Now I want install the module Album and I getting the follwoing error:
A 404 error occurred
Page not found.
The requested controller could not be mapped to an existing controller class.
Controller:
album/album(resolves to invalid controller class or alias: album/album)
No Exception available
Can somebody provide my an solution?
The setup is comming from: http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/

A: It sounds like you may not have loaded the module in your /config/application.config.php
Should look something like this;
<?php
return array(
// This should be an array of module namespaces used in the application.
'modules' => array(
'Application',
'DoctrineModule',
'DoctrineORMModule',
'Album',

),

// etc ...

BTW, I am new to ZF2 and doctrine also - I found this example of the album module using doctrine that actually works and it was a great help to get started ( https://github.com/shanethehat/zf2-doctrine-tutorial )


text:
Q: Can't use BloomAI locally So I just finished installing Bloom's model from Huggingface & I tried to run it in my notebook.
Here's the code:
from transformers import AutoTokenizer, AutoModel
model_path = "D:/bloom"
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path)

and I get this error:
DefaultCPUAllocator: not enough memory: you tried to allocate xxx bytes

So then I went on to google searching and found this article:
https://towardsdatascience.com/run-bloom-the-largest-open-access-ai-model-on-your-desktop-computer-f48e1e2a9a32
However, I get this error:
TypeError: build_alibi_tensor() missing 1 required positional argument: 'device'

How to run Bloom locally?

A: I had that problem (and others beyond it) because I was using a more recent version of the transformers library than the one used in the article you linked.  Try using transformers version 4.20.0 as the article mentions.


text:
Q: How do I return the data from S3 bucket in node? I would like main() to return the data instead of just console logging it as shown below. How do I do it?
async function main() {
  // Load the AWS SDK for Node.js
  var AWS = require("aws-sdk");
  // Set the region
  AWS.config.update({ region: "REGION" });

  // Create S3 service object
  s3 = new AWS.S3({ apiVersion: "2006-03-01" });

  // Call S3 to list the buckets
  s3.listBuckets(function (err, data) {
    if (err) {
      console.log("Error", err);
    } else {
      console.log(data);
    }
  });
}
main();

A: Try awaiting the listBuckets function.
Change
s3.listBuckets(function (err, data) {
  if (err) {
    console.log("Error", err);
  } else {
    console.log(data);
  }
});

to
return await s3.listBuckets();

If that doesn't work, you can always just construct a manual Promise and resolve it with the data.
async function main() {
  // Load the AWS SDK for Node.js
  var AWS = require("aws-sdk");
  // Set the region
  AWS.config.update({ region: "REGION" });

  // Create S3 service object
  s3 = new AWS.S3({ apiVersion: "2006-03-01" });

  return await new Promise((resolve, reject) => {
    // Call S3 to list the buckets
    s3.listBuckets(function (err, data) {
      if (err) {
        reject(err);
      } else {
        resolve(data);
      }
    });
  });
}
main();


text:
Q: Recover raw Databases from corrupted MySQL 8 + Windows Server Implementation I have a (Virtualized/Hyper-V) MySQL 8 (8.0.16.0) DB server whose installation has become corrupt and will no longer start the service, or report any errors as to why it won't start (this is a virtual Windows 2008R2 server).
So I went and created a brand-new, duplicate, VM from scratch, installed (the same version of) MySQL on it, and am now trying to figure out how to get the tables from the old server into the new one.
If I simply copy the entire Data folder over, as is the process described in virtually every article I've found on the subject, the new instance also won't start (exactly like the old one won't) but if I then copy a pristine MySQL.ibd file (from the clean installation) into the migrated Data folder, the service will, once-again, start normally, but none of the copied Databases/Tables will exist in it.
All I want/need to do is get the shiny, new, clean, MySQL to see and incorporate all of the old databases from their original files, but after more than a day of reading many guides on how to do this (from here and elsewhere), I have not been able to find a solution that works.
So here I am, asking again, in 2020, for MySQL 8(.0.16.0), on Windows 2008R2, what exactly do I need to do in order to fully recover these tables into a new server when some elements of the base structure are corrupt/invalid?
Thanks!

A: Well, after three days of fighting with this, I have found a means of recovering at least some of the data:
With a lot of searching, I was able to locate an old virtual machine in the archives that still had a working copy of MySQL (5.x) that contained a version of one of the databases that I need to recover. From that resource I was able to generate all of the appropriate CREATE statements for all of the associated Schemas and Tables. So then, armed with my fresh server, and a new installation of MySQL, and all of the CREATE statements, I was finally able to regenerate all of the schemas and (empty) tables that this customer uses. So, upon shutting down the MySQL server service, and copying only the specific directories for that customer's databases into the new Data folder, then re-starting the service, the databases were, miraculously, fully restored!
IDK if it matters or not, but all of the schemas this particular customer had were MyISAM tables; I haven't yet tried this technique with any InnoDB tables, but this, at least, is progress, of a sort! Also, I don't know that I'll be able to find legacy functioning VM's for all of the schemas that I need to recover (and that are up to date/accurate!) so there's still a lot of work ahead...
I find it stunning that there's no simple tool for analysing a backed-up raw MySQL Data folder and then integrating the contents thereof onto an active server. You'd think that such a tool would have tremendous value for innumerable people in situations like this!?
Anyway, back into the archives!


text:
Q: making setTimeout work with queue.js I am attempting to execute a chunk of code that is resource intensive to the point it locks the browser while executing.  As a workaround, I am trying to use mbostock's queue.js library in conjunction with setTimeout to rate-limit the execution such that the lockup is not noticed by the user.  The calls must be made in a specific order but need to have a breathing period in between (currently I'm using 25ms).
I am having trouble figuring out how to link things together.
Specifically, there seems to be an issue with the availability of the 'param' variable inside the setTimeout function scope.  When this code executes, param ends up being the same instance for every iteration, not a different instance, as expected.
var q = queue(1);
var waitParamInits = [];
var keys = Object.keys(attr.customParams);

for (var i=0; i < keys.length; i++) {
    var param = attr.customParams[keys[i]];
    var wait = function(callback) {
        setTimeout(function() {
            if (!param.initializeParm()) {
                handleError('Error initializing parameter: ' + param, false);
            }
        }, 25, param);
    };
    waitParamInits.push(wait);
}

waitParamInits.forEach(function(t) {q.defer(t); });
q.awaitAll(function(error, results) {
    console.log('finished with wait params');
});

A: The key here was to use bind(), which cleaned up the code quite a bit in the process.  Also, a very important point, is to know that in order for awaitAll() to work correctly, the callback() function that gets passed in by default by the queue.js library MUST be called in order for awaitAll() to know when things are complete.
var q = queue(1);
var waitParamInits = [];
var keys = Object.keys(attr.customParams);

for (var i=0; i < keys.length; i++) {
    var param = attr.customParams[keys[i]];
    var wait = function(x, callback) { // add the 'x' var to params - 'callback' must be last!
        return setTimeout(function() { // return the setTimeout function
            // bind(), used below in push(), gives us access to 'x' in this scope
            if (!param[x].initializeParm()) {
                handleError('Error initializing parameter: ' + param, false);
            callback(null, 'done with ' + x); // queue.js REQUIRES that the callback it passes in must execute
            }
        }, 25); // remove the 'param' arg
    };
    waitParamInits.push(wait.bind(this, x)); // use bind() to introduce the correct parameter per iteration of the for loop
}

waitParamInits.forEach(function(t) {q.defer(t); });
q.awaitAll(function(error, results) {
    console.log('finished with wait params');
});


text:
Q: How to run a task ONLY on modified file with Gulp watch I have the current gulp task which I use in a gulpfile. Path are from a config.json and everything works perfectly:
//Some more code and vars...

gulp.task('watch', function() {
    gulp.watch([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], ['imagemin-cfg']);
})

//Some more code ...

gulp.task('imagemin-cfg', function () {
    return gulp.src([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], {read: false})
        .pipe(imagemin({
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngcrush()]
        }))
        .pipe(gulp.dest(buildType))
        .pipe(connect.reload());
});

But I still have an issue, the number of images in my project is huge and this task takes ages. I'm looking for a way to run my task ONLY on modified files. If I had an image or modify it, imagemin() will only run on this image, and not on all.
Once again everything is working perfectly fine, but the run time is really long.
Thanks.

A: Incremental builds are supported natively in Gulp without any plugins since version 4.0. Here is the example taken from the project README:
const paths = {
  ...
  images: {
    src: 'src/images/**/*.{jpg,jpeg,png}',
    dest: 'build/img/'
  }
}

function images() {
  return gulp.src(paths.images.src, {since: gulp.lastRun(images)})
    .pipe(imagemin())
    .pipe(gulp.dest(paths.images.dest));
}

function watch() {
  gulp.watch(paths.images.src, images);
}

A: "gulp-changed" is not a best solution for doing this, because it watch only modified filed in "buildType" folder.
Try gulp-cached instead.

A: Another option is to used the gulp.watch on("change") option.
gulp
  .watch([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"])
  .on("change", function(path) {
      gulp
        .src(path)
        .pipe(imagemin({
            progressive: true,
            svgoPlugins: [{removeViewBox: false}],
            use: [pngcrush()]
        }))
        .pipe(gulp.dest(buildType))
        .pipe(connect.reload());
  });

A: May I suggest gulp-newy in which you can manipulate the path and  filename in your own function. Then, just use the function as the callback to the newy(). This gives you complete control of the files you would like to compare.
This will allow 1:1 or many to 1 compares.
newy(function(projectDir, srcFile, absSrcFile) {
  // do whatever you want to here.
  // construct your absolute path, change filename suffix, etc.
  // then return /foo/bar/filename.suffix as the file to compare against
}

A: No need for plugins, this can be achieved with just gulp.watch.
With gulp.watch, you can target the changed file like this.
gulp.watch(["src/**/*"], function (obj) {
 return gulp.src(obj.path, {"base": "src/"})
 .pipe(gulp.dest("dest"));
});

Edit: for Gulp v4.0.2 - Now fixed:
const { watch, src, dest } = require('gulp');

var watcher = watch(["src/**/*"]);
watcher.on('change', function(fileName){
    return src(fileName, {base: 'src/'})
        .pipe(dest('dest'));
});

A: Yeah, gulp-changed does exactly that:
var changed = require('gulp-changed');

gulp.task('imagemin-cfg', function () {
return gulp.src([config.path.devfolder+"/**/*.png", config.path.devfolder+"/**/*.jpg", config.path.devfolder+"/**/*.gif", config.path.devfolder+"/**/*.jpeg"], {read: false})
    .pipe(changed(buildType))
    .pipe(imagemin({
        progressive: true,
        svgoPlugins: [{removeViewBox: false}],
        use: [pngcrush()]
    }))
    .pipe(gulp.dest(buildType))
    .pipe(connect.reload());
});

A: Here's a real-world example I use all the time to do this without the need for any additional packages. I use this to minify, rename and compile any .js file in the js directory. Compiled files are saved to a dist directory with .min appended before the extension.
// Compile JS
var compileJS = function( file ) {
    var currentDirectory = process.cwd() + '/';
    var modifiedFile = file.path.replace( currentDirectory, '' );

    gulp.src( modifiedFile )
        .pipe( uglify() )
        .pipe( rename( {
            suffix: ".min"
        } ) )
        .pipe( livereload() )
        .pipe( gulp.dest( 'dist' ) );
};

// Watch for changes
gulp.watch( 'js/*.js', [ 'js' ] ).on( "change", compileJS );

The above answers seemed partially incomplete and a little unclear to me, hopefully this is helpful for anyone else looking for a basic example.

A: In the task or callback, you'll have an event parameter, which has a type property, which will tell you if the file was added, deleted or changed. Best bet is to make use of that in a conditional on your task.
gulp.watch('path to watch', function(event){
  if(event.type === 'changed') {
    gulp.start('your:task');
  }
};

A: Define the main task so that it accepts a parameter for the .src() input pattern. Define a wrapper function to pass a default src value for the task so that you can still call it directly like gulp images:
const imageFilePattern = '/src/path/to/input';

function images() {
  getImagesTask(imageFilePattern);
}

function imagesTask(src) {
  return gulp.src(src)
    .pipe(imagemin())
    .pipe(gulp.dest('dest'));
}

Now you can easily define the watch task to only process changed files:
function watch() {
  return gulp.watch(imageFilePattern).on("change", imagesTask);
}

A: I found my solution for a similar issue with on change event using changedFilePath variable. (gulp v4.0.2)
I have .js for each .cshtml page in .net core. and I want to minify them all in a single folder with the same name on change.
"use strict";
var gulp = require("gulp"),
  jsmin = require("gulp-terser"),
  rename = require('gulp-rename'),
  changedFilePath = '';

/* Gulp to minify JS files */
gulp.task("minify-js", function () {
  return gulp.src(changedFilePath)
    .pipe(jsmin())
    .pipe(rename(function (path) {
      path.basename = path.basename.replace('.cshtml', '.min').toLowerCase();
    }))
    .pipe(gulp.dest("wwwroot/bundle/dist/js/pages"));
});

gulp.task('default', function () {
  gulp.watch("Views/**/*.cshtml.js").on('change', function (filepath) {
    changedFilePath = filepath;
    gulp.series('minify-js')();
    return
  });
});


text:
Q: How can I add a classpath entry as a publish/export dependency in an Eclipse dynamic web project? I successfully created a project using Wicket quickstart and turned it into an Eclipse dynamic web project by running

mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0

I imported the project to Eclipse without any issues, but got this warning for each JAR:

Classpath entry M2_REPO/**.jar will not be exported or published.
  Runtime ClassNotFoundExceptions may result.

I can fix this by using right click → QuickFix on each warning and selecting "Mark the associated raw classpath entry as a publish/export dependency," but this takes a lot of time and would not be possible if there were a lot of dependencies.
There must be a way to have Maven do this for me; what is it?
EDIT: I've found out that using m2eclipse core + Maven Integration for WTP (from m2eclipse extras) resolves my issues.
I'm still interested in how to achieve this without m2eclipse, though, just out of curiosity :p

A: The two Maven plugins needed to work with web projects in Eclipse are available from the Eclipse Marketplace.
Maven Integration for Eclipse (included in the Java version of Eclipse)
Maven Integration for Eclipse WTP


text:
Q: I want to make call in viewdidLoad I want to make call to any  number as soon as viewdidload is called ?

A: This might help you: http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/PhoneLinks.html
Basically, they say that you can place a call using a URL object, like so:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:1-408-555-5555"]];
Unfortunately, that's about as much control as you get at the moment. Happy coding.


text:
Q: presentModalViewController not taking full screen Landscape only app.  On my main window xib, I've got a UIView.  I'm loading a UIScrollview programatically into that UIView which works just fine.  On that scrollview, I've got a button that brings up a "detail" screen (a separate view controller), via a presentModalViewController call:
    LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:nil];
self.learnitView = learnit;
[self presentModalViewController:learnit animated:YES];
[learnit release];

The action's being called but the modal view doesn't take up the whole screen when the scrollview is a subview.  Instead, it's popping into the parent scrollview and flipping the orientation, etc.  Not the desired behavior.
Any guidance on how to make the modal view full screen when the call is from scrollview which is a subview of a container UIView on the main xib?

A: Thanks for all the comments.  Found a tip somewhere on overriding presentModalViewController and bubbling up in a loop until the main controller's reached (in my case, HomeViewController).  Worked like a champ.
- (void) presentModalViewController:(UIViewController *)screen animated:(BOOL)animated {
    UIResponder *responder = self;
    while (responder && ![responder isKindOfClass:[HomeViewController class]]) {
        responder = [responder nextResponder];
    }
    [(UIViewController *)responder presentModalViewController:screen animated:YES];
}

I'm overriding in the .m file of the UIScrollview that contains the button that makes the call.

A: Try adding subview, rather than presentModelViewController as:
LearnITViewController *tempView = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:[NSBundle mainBundle]];
self.learnITViewController = tempView;
[tempView release];
[self.view addSubview:mainMenuView.view];

And add This too
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);//or left
}

A: LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:nil];
self.learnitView = learnit;
[self.learnitView setsetWantsFullScreenLayout:YES];

or
self.learnitView.wantsFullScreenLayout = YES;
[self presentModalViewController:learnit animated:YES];
[learnit release];

A: Instead of self add UIViewController in superview.
LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:nil];
self.learnitView = learnit;
[self.view.superview presentModalViewController:learnit animated:YES];
[learnit release];


text:
Q: Gnome app windows not showing on Ubuntu 16.04 I was trying to replace an old qt version that was installed in my ubuntu installation with no success. Now I've simply given up. In the process I had added the Bionic sources to my apt sources list file and it deleted/added a lot of things.
When I started my gnome desktop it took some time more than usual and showed the desktop. But as you can see in the pictures below, gnome apps like the terminal, file manager etc. are not being displayed properly and instead I can just see a black window. Even the system tray at the bottom is messed up with artifacts.
I've now removed the Bionic sources and reinstalled ubuntu-gnome-desktop yet nothing has changed. Can someone tell me what's going on and how do I fix it?
https://pasteboard.co/IkMFTU6.jpg

A: I am afraid you did some unsupported actions on your system. While a technical expert may salvage such mistakes, the easiest approach to revert to a correctly working system will be to reinstall your system.


text:
Q: Error 4004 , with Silverlight 4 WCF RIA with Remote Database While I am trying to use WCF RIA to load data for silverlight app but getting an error
as bellow.
Message: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query
I am using remote database , it authenticate the user properly , connect to database but data binding failed.The code :
    public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

 void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            // create a context to the WCF RIA service and call the RIA service method
            // to get the list of all customers.
            var context = new ExpertIssueTracker.Web.ITDomainContext();
            dataGrid1.ItemsSource = context.IT_USERs;
            context.Load(context.GetIT_USERQuery());
        }

I tried fiddler but could not figured out the exact reason .Do we have any specific issue while connecting to remote hosted database ?

A: Ok i got it ,the issue was with shared hosting .They were running on .Net4 beta .


text:
Q: Only numeric characters from string on struts property I am new to struts, so I apologise for any incorrect terms etc.
I have an attribute that is pushed into a file. attr.additionalNumber this is a phone number with whitespace and a plus symbol e.g. +123 4567 890.
I have tried
<s:property value="%{attr.additionalNumber.replaceAll('\^[a-zA-Z]', '')}" />
but this returns a null string, not sure how to return 1234567890? Any help would be greatly appreciated.


text:
Q: About short circuit in power supplies Does the constant current mode in power supplies correspond to short circuit?

A: The constant current and constant voltage modes are actually voltage set and current limited modes. if you set it to 5V and 1A, then the power supply will operate such that the voltage is held at 5V as long as the current is less than 1A, but will reduce the voltage if the current exceeds 1A.
Imagine you connect a variable resistor to the output of such a supply, and keep the resistance at 1k. The power supply has a voltage of 5V across it, and draws a current of 5mA - well within the current limit, so the current limit controller does nothing. Now you slowly reduce your variable resistance, and watch the current rise - as long as current <1A the current limiter does nothing.
Say you reach 5.0 Ohms, and the current has just climbed to 1A.
Now if you decrease the resistance a little further, the current will  increase a little beyond 1A, and the current controller will start to reduce the voltage till the current comes back to 1A. So if you reduce R to 4.95ohms, the current will rise to 5V/4.95 Ohms=1.01A, at which point the current control will keep decreasing the voltage till current reaches 1A. This voltage will be 4.95V.
If you dead short the output, the output current will remain 1A, and the voltage will be 1A times the resistance of the shorting wire.

A: Does the constant current mode in power supplies correspond to short circuit?
That depends on what you consider "corresponding to".
A power supply with current limit feature is basically a constant voltage or constant current supply whichever results in less.  The intent is for it to be used as a constant voltage supply.  The current limit feature is to prevent damage when the load tries to draw more than the rated current.  The current regulation is usually not as good or accurate as the voltage regulation, since these supply isn't intended for constant current operation when used normally.
A short circuit is certainly one case of the load trying to draw too much.  However, it is not the only case.  A resistive load, for example, can still exceed the current limit but is not a short.
For example, consider a 12 V 1 A supply with current limiting.  If you connect a 12 Ω resistor, it draws 1 A, and all is fine, although right on the edge.  If you connect a second 12 Ω resistor in parallel, then the combination will try to draw 2 A.  The supply won't let it, and goes into current limit mode instead.  Usually the current limit is set a little higher than the maximum current spec.  Let's say the supply actually puts out 1.1 A when in current limit condition.  You have a total of 6 Ω connected to it, so the output voltage will drop to 6.6 V, which is what it takes to not exceed 1.1 A.  No short was needed to make this happen.


text:
Q: "Duplicate implicit target name": how to use a subtitle name more than once? How do I use the same subsection title in multiple sections of sphinx/rst?
I didn't think this was an odd use case.  I just want to iterate through the same subsection titles for each section.
############
TITLE OF ALL
############

-------
CHAPTER
-------

SENARIO ONE
===========

Description
-----------

SENARIO TWO
===========

Description
-----------

Generates this error:
design_spec.rst:19: (INFO/1) Duplicate implicit target name: "description"

Surely I'm not expected to come up with unique subsection titles throughout the whole document.  What did I miss?
It's complaining about the implicit target name generated by the titles not being unique.  What can I do about that?

A: You can avoid the info if you define an explicit target name for the second (and third ...) section "Description" like this:
...

Description
-----------

SENARIO TWO
===========

.. _description2:

Description
-----------

...

This additionally gives you the benefit of having a known anchor if you want to jump there (like mypage#description2).
Don't miss the blank line between _description and the following section title.


text:
Q: Why dask delayed do nothing? I am using dask to process files line by line. However, dask seems that do not do anything. My code logic is as follows:
import dask
from dask import delayed
from time import sleep

@dask.delayed
def inc(x):
    sleep(1)
    print(x)

def test():
    for i in range(5):
        delayed(inc)(i)

dask.compute(test())

However, no any outputs in console. Why?

A: Your function test does not return anything.
Perhaps you meant to do something like
def test():
    out = []
    for i in range(5):
        out.append(inc(i))
    return out

(note that you already decorated inc with delayed, there is no need to call delayed(inc) again)


text:
Q: jQuery .slideUp() .slideToggle() in internet explorer produces the reverse effects of what was expected I am using the .slideUp() and .slideToggle to show and hide two divs based on the value selected in a radio button collection.
It works fine in Firefox, Safari and Chrome, but internet explorer is producing the reverse effect than what I was expecting.
Here is my Javascript
    function TogglePaypal() {
        $("#bank").slideUp(250, function() {
            $("#paypal").slideToggle();
        });
    }
    function ToggleBank() {
        $("#paypal").slideUp(250, function() {
            $("#bank").slideToggle();
        });
    }

And here is what I am doing in my HTML,
 <%=Html.RadioButton("PaymentMethod", "PayPal", true, new { onchange = "TogglePaypal();" })%>

PayPal

<%=Html.RadioButton("PaymentMethod", "Bank Account", false, new { onchange = "ToggleBank();" })%>

Bank Account

What I am expecting (and what is infact happening in firefox, chrome and safari) is that the paypal radio button is initially checked and the paypal div is displayed, when the bank radio button is selected the paypal div slides up and the bank div slides down (and vice versa).
What is happening in internet explorer is, the paypal button is initially selected, and the paypal div is displayed, but when i select the bank radio button, nothing happens, then when i click back to the paypal button, the paypal div slides up and the bank div slides down, and from there on I get the opposite div displayed to what is selected.
Why would internet explorer be producing different results to the other main browsers?
Any ideas would be greatly appreciated.

A: Ok, I managed to sort it out by changing all my slide calls to .slideToggle();
    function ToggleBank() {
        $("#paypal").slideToggle();
        $("#bank").slideToggle();
    }

A: I think it's because IE doesn't register the Change event on radio buttons until AFTER focus moves away from it. (i.e., when you click back on Paypal button, THEN it registers the change event for the Bank option because it lost focus).
Often people will use the Click event instead of Change for checkboxes/radio buttons because of this behavior difference.


text:
Q: Auto-increment column based on value of other column Looking for the best, simplest way to populate a revision level column in a Oracle 12c database table.
Example, when DESIGN1 is created, a row is inserted into table DESIGN_REVISIONS.
  DESIGN_NUM  REVISION  COMMENT
> DESIGN1     0         New Design

If a change is made to DESIGN1, then another row is inserted into the DESIGN_REVISIONS table.
  DESIGN_NUM  REVISION  COMMENT
  DESIGN1     0         New Design
> DESIGN1     1         Widget width increased

DESIGN2, DESIGN3, etc. will also start at revision 0.
Is there a way to define a primary key on DESIGN_NUM and REVISION and make REVISION an auto-increment or identity column that will automatically go to the next value for a given DESIGN_NUM, or do I have to use a sub-query in my insert query to count the existing revisions to calculate the next revision number?

A: Try below steps:
Create table with Default revision value 0
 create table test2
 (
   d_num varchar2(100),
   revision number DEFAULT 0
 );

Create Row level Trigger on table as shown below. As and when the row is inserted, revision value will be calculated and inserted into table by trigger.
create or replace TRIGGER test2_rev
before INSERT ON test2
REFERENCING FOR EACH ROW
declare
cnt number;

BEGIN
  cnt:=0;
  select count(*) into cnt from test2 where d_num=: NEW.d_num;

  if (cnt >0) then

   SELECT max(revision)+1
   INTO   :NEW.revision
   FROM   test2
   where d_num=: NEW.d_num group by d_num  ;

  end if;
END;


text:
Q: Highcharts line chart with multi colored areas I'm trying to create a line chart in highcharts with multi-colored areas. I have some timed data I'm trying to render that also has a status on each result. When the status is a certain color I'd like to change the color of the area beneath the line graph.
Like so:

Here's a sample of some of my data:
{"GmtDateTime": "2013-07-31 12:20:15", "Speed": 40.068, "StatusCode": "1"},
{"GmtDateTime": "2013-07-31 12:30:11", "Speed": 41.823, "StatusCode": "2"},
{"GmtDateTime": "2013-07-31 12:40:15", "Speed": 41.987, "StatusCode": "1"},
{"GmtDateTime": "2013-07-31 12:50:11", "Speed": 40.192, "StatusCode": "3"},
{"GmtDateTime": "2013-07-31 13:00:12", "Speed": 40.877, "StatusCode": "3"},
{"GmtDateTime": "2013-07-31 13:10:12", "Speed": 40.364, "StatusCode": "2"},
{"GmtDateTime": "2013-07-31 13:20:15", "Speed": 44.331, "StatusCode": "1"},
{"GmtDateTime": "2013-07-31 13:30:14", "Speed": 42.89, "StatusCode": "1"},

The x-axis is "GMTDatetime", the y-axis is "Speed", and the range color is "StatusCode".
Thanks in advance!

A: Highcharts use timestamps (time in miliseconds) not dates as you have. In series / data objects should have x/y parameter, not i.e "Speed". As a results your json should looks like:
{y: Date.UTC(2012,12,2), y: 42.89, "StatusCode": "1"}

Date.UTC allows ot return time in miliseconds.
In case when you need to have different color of part chart, you need to use additional serie.
EDIT:
Example:
http://jsfiddle.net/D4sbc/


text:
Q: How to make MSBuild Command Line ignore non ClickOnce applications during publishing? In my Solution, I have three executables which two of them should not be distributed through ClickOnce and not have those files generated. They are internal console applications that are distributed to specific ends. The third is a normal ClickOnce Application distributed to my final users.
Following this question and this tip on a blog, I managed to remove the ClickOnce from those apps and build correctly from Visual Studio.
But a problem happens in my Continous Integration, performed with MSBuild Command Line. In the final steps of publishing, MSBuild throws errors because it didn't found the other two executable's manifests, so my Build fails. Also, when I check the publish output, it created folders in "Application Files" for those two applications containing the ".exe" and ".config" files (which is also undesired, since they will be automatically uploaded and they shouldn't be).
Is there a parameter or another way to make MSBuild ignore just the publishing step of those projects without Clickonce?
Thanks.

A: you can use a custom target to achieve it. edit your project(csproj) file (right click project node -> unload project -> edit xxx.csproj) and add the following code on it.
<PropertyGroup>
    <!-- the folder of the project to build -->
    <ProjLocation>D:\Project\Msbuild\ConsoleApplication3\ConsoleApplication1</ProjLocation>
    <ProjLocationDebugDir>$(ProjLocation)\bin\Debug</ProjLocationDebugDir>
    <ProjPublishLocation>$(ProjLocationDebugDir)\app.publish</ProjPublishLocation>
    <!-- This is the web-folder, which provides the artefacts for click-once. After this
         build the project is actually deployed on the server -->
    <DeploymentFolder>D:\server\releases\</DeploymentFolder>
  </PropertyGroup>
  <Target Name="Test" DependsOnTargets="Clean">
    <Message Text="Publish-Build started for build no $(ApplicationRevision)" />
    <MSBuild Projects="$(ProjLocation)\$(ProjectName).csproj"
        Properties="$(DefaultBuildProperties)"
        Targets="Publish"/>
    <ItemGroup>
      <SetupFiles Include="$(ProjPublishLocation)\*.*"/>
      <UpdateFiles Include="$(ProjPublishLocation)\Application Files\**\*.*"/>
    </ItemGroup>
    <Copy SourceFiles="@(SetupFiles)" DestinationFolder="$(DeploymentFolder)\" />
    <Copy SourceFiles="@(UpdateFiles)" DestinationFolder="$(DeploymentFolder)\Application Files\%(RecursiveDir)"/>
  </Target>

  <Target Name="Clean">
    <Message Text="Clean project" />
    <MSBuild Projects="$(ProjLocation)\$(ProjectName).csproj"
    Properties="$(DefaultBuildProperties)"
    Targets="Clean"/>
  </Target>

Then, you can use the following msbuild command line.
msbuild /t:test

Here is a demo for your reference, please check the project named consoleapplication1 https://1drv.ms/u/s!AlvaNEnglADDgQRMB1LK4mo9KVXO

A: I solved my problem by going in "BUILD" -> "CONFIGURATION MANAGER" and remove the other executables from actual configurations. Then created new configurations to build the other executables when needed in my solution.
My CI tasks where altered to set the Configuration property for each project, like this:
PROJECT A -> "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /target:clean;build;publish /property:Configuration=ProjectA_Release;"
PROJECT B -> "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /target:clean;build;publish /property:Configuration=ProjectB_Release;"
And so on...
That way I could separate the files to publish and not get wrong stuff mixed in a single build.


text:
Q: How to change selectively the post-note comma in a citation using biblatex? I'm using biblatex for my citations and references. In some citations I'd like to change the comma for any other symbol that I want. How can I do this?
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
citestyle=authoryear-comp,
bibstyle=authoryear,
giveninits=true,
maxcitenames=2
]{biblatex}

%References
\begin{filecontents*}{references22.bib}
@Article{Ho_1899,
  author   = {Ho, Lionel and Dreyfus, J. and Boyer, J. and Lowe, T. and Bustamante, H. and Duker, P.},
  title    = {Example article},
  year     = {1899}
}
\end{filecontents*}

\addbibresource{references22.bib}
\begin{document}

\textcite[some words]{Ho_1899}\\
\parencite[some words]{Ho_1899}\par%
%
In the next 2 citations, I'd like to change the comma for ~-~ and "."\par
%
\textcite[~-~some words]{Ho_1899}\\
\parencite[. Some words]{Ho_1899}\par
%
Expected result\par
%
Ho et al. (1899~-~some words)\\
(Ho et al. 1899. Some words)

\end{document}

A: The command that controls the punctuation before the postnote is called \postnotedelim. You can redefine it as you see fit. If you only want to change the punctuation locally for the next cite command, it is best to wrap the redefinition into \AtNextCite. It may come in handy to define a new command for that to avoid having to type that much.
If there is a rule/an algorithm behind the changes to the punctuation, it might be possible to automate the changes. Starting with the next biblatex release postnotedelim will be a context-sensitive delimiter (https://github.com/plk/biblatex/pull/869), which means that it will be very simple to define different delimiters for \parencite and \textcite.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear-comp]{biblatex}

\addbibresource{biblatex-examples.bib}

\newcommand*{\SetNextPostnoteDelim}[1]{%
  \AtNextCite{\renewcommand*{\postnotedelim}{#1}}}

\begin{document}
\textcite[some words 01]{sigfridsson}

\parencite[some words 02]{sigfridsson}

% \AtNextCite applies only to the next citation
\AtNextCite{\renewcommand*{\postnotedelim}{\addspace\textendash\space}}
\textcite[some words 03]{sigfridsson}

\parencite[some words 04]{sigfridsson}

\AtNextCite{\renewcommand*{\postnotedelim}{\addperiod\space}}
\parencite[Some words 05]{sigfridsson}

\textcite[some words 06]{sigfridsson}

% \AtNextCite packed up in a handy command
\SetNextPostnoteDelim{\addspace\textendash\space}
\textcite[some words 03']{sigfridsson}

\parencite[some words 04']{sigfridsson}

\SetNextPostnoteDelim{\addperiod\space}
\parencite[Some words 05']{sigfridsson}

\textcite[some words 06']{sigfridsson}

% a simple \renewcommand applies from now until the next change
\renewcommand*{\postnotedelim}{\addspace\textendash\space}
\textcite[some words 07]{sigfridsson}

\parencite[some words 08]{sigfridsson}

\renewcommand*{\postnotedelim}{\addperiod\space}
\parencite[Some words 09]{sigfridsson}

\textcite[Some words 10]{sigfridsson}

% manual approach: provide the punctuation in the postnote
\renewcommand*{\postnotedelim}{}
\textcite[~-~some words 11]{sigfridsson}

\parencite[. Some words 12]{sigfridsson}
\end{document}

A: This answer is something that many people would imagine as a solution and thus it is here (I will not delete) in order to demonstrate possible problems of such a definition. So, please the last part labeled "moewe's example" in order to understand why this method should be avoided
Section 1:
A hack, but it will break the ability of adding a second optional argument in your \textcite and \parencite comands (if they can "afford" one second argument):
Edit: (both codes) Changed in order to not break (redefine) the original commands' behavior but to use another command name in order to help the discussion with @moewe untill delete the answer.
For @moewe: I also suppose no comma will be added in the second (the mandatory) argument of these two new commands and would like to know what would be the problem in such a definition.
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
citestyle=authoryear-comp,
bibstyle=authoryear,
giveninits=true,
maxcitenames=2,
]{biblatex}

%References
\begin{filecontents*}{references22.bib}
@Article{Ho_1899,
  author   = {Ho, Lionel and Dreyfus, J. and Boyer, J. and Lowe, T. and Bustamante, H. and Duker, P.},
  title    = {Example article},
  year     = {1899}
}
\end{filecontents*}

\newcommand\mytextcite[2][]{\citeauthor{#2}(\citeyear{#2}#1)}
\newcommand\myparencite[2][]{(\cite{#2}#1)}
\addbibresource{references22.bib}
\begin{document}
\mytextcite[some words]{Ho_1899}\\
\myparencite[some words]{Ho_1899}\par%
%
In the next 2 citations, I'd like to change the comma for ~-~ and "."\par
%
\mytextcite[~-~some words]{Ho_1899}\\
\myparencite[. Some words]{Ho_1899}\par
%
Expected result\par
%
Ho et al. (1899~-~some words)\\
(Ho et al. 1899. Some words)

\end{document}

PS: You have to add comma manually in the above code's first two citations.
Section 2:
Code that will work for the two first citations too:
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
citestyle=authoryear-comp,
bibstyle=authoryear,
giveninits=true,
maxcitenames=2,
]{biblatex}

%References
\begin{filecontents*}{references22.bib}
@Article{Ho_1899,
  author   = {Ho, Lionel and Dreyfus, J. and Boyer, J. and Lowe, T. and Bustamante, H. and Duker, P.},
  title    = {Example article},
  year     = {1899}
}
\end{filecontents*}
\def\mydelim{,~}
\newcommand\mytextcite[2][]{\citeauthor{#2}(\citeyear{#2}\mydelim#1)}
\newcommand\myparencite[2][]{(\cite{#2}\mydelim#1)}
\addbibresource{references22.bib}
\begin{document}
\mytextcite[some words]{Ho_1899}\\
\myparencite[some words]{Ho_1899}\par%
%
In the next 2 citations, I'd like to change the comma for ~-~ and "."\par
%

\def\mydelim{~.~}
\mytextcite[some words]{Ho_1899}\\
\def\mydelim{.~}
\myparencite[Some words]{Ho_1899}\par
%
Expected result\par
%
Ho et al. (1899~-~some words)\\
(Ho et al. 1899. Some words)

\end{document}

The given result for these examples are the expected results:

moewe's example: (read his last comment too)
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[style=authoryear-ibid]{biblatex}

\addbibresource{biblatex-examples.bib}

\def\mydelim{,~}
\newcommand\mytextcite[2][]{\citeauthor{#2}(\citeyear{#2}\mydelim#1)}

\begin{document}
\cite{sigfridsson} \cite{sigfridsson}

\mytextcite{nussbaum} \mytextcite{nussbaum} % no "ibid"

\cite{sigfridsson} % incorrect "ibid."

\citereset
\cite{sigfridsson} \cite{sigfridsson}

\textcite{nussbaum} \textcite{nussbaum} % correct "ibid"

\cite{sigfridsson} % no "ibid."
\end{document}


text:
Q: Azure DevOps AzureCLI task with scriptPath option failed to authenticate to create Azure Container Instance We are using YAML pipelines in Azure DevOps.
One of the tasks in the pipeline is AzureCLI that creates ACI container.
The image we build and push in the previous steps of the pipeline.
When we run this task from external script it fails with the message:
The image '***.azurecr.io/image:1.0' in container group '***' is not accessible.
Please check the image and registry credential.
When we change script type to inlineScript it works correctly.
Following is the form that doesn't work(scriptPath).
- task: AzureCLI@1
  displayName: 'Run tests'
  inputs:
    azureSubscription: $(AZURE_SUBSCRIPTION)
    scriptType: 'bash'
    scriptLocation: 'scriptPath'
    scriptPath: 'run_tests.sh'

Here is the form that works(inlineScript)
- task: AzureCLI@1
    displayName: 'Run tests'
    inputs:
      azureSubscription: '$(AZURE_SUBSCRIPTION)'
      scriptLocation: 'inlineScript'
      inlineScript: 'az container create -g *** --registry-login-server ***.azurecr.io --registry-username *** --registry-password *** --image image -n test --cpu 1 --memory 8 --restart-policy Never --command-line "dotnet test.dll -n testApp -c 1000"'

The script will be longer than one line.
Any clue how to create azure container instances from external script file (scriptLocation: 'scriptPath') ?

A: I created container instance in both ways (script and inline). Here is my configuration:
build definition:

steps:
- task: replacetokens@3
  inputs:
    targetFiles: 'stackoverflow/12-container-instance/create-container-instance.sh'
    encoding: 'auto'
    writeBOM: true
    actionOnMissing: 'warn'
    keepToken: false
    tokenPrefix: '#{'
    tokenSuffix: '}#'
    useLegacyPattern: false
    enableTelemetry: true
- task: AzureCLI@2
  displayName: 'Run tests 1'
  inputs:
    azureSubscription: '$(AzureSubscription)'
    scriptType: 'bash'
    scriptLocation: 'scriptPath'
    scriptPath: 'stackoverflow/12-container-instance/create-container-instance.sh'

- task: AzureCLI@2
  displayName: 'Run tests 2'
  inputs:
    azureSubscription: '$(AzureSubscription)'
    scriptType: 'bash'
    scriptLocation: 'inlineScript'
    inlineScript: 'az container create -g TheCodeManual --name myapp2 --image $(Image) --registry-password $(RegistryPassword) --registry-user $(RegistryUser)'

and create-container-instance.sh file
az container create -g TheCodeManual --name myapp1 --image #{Image}# --registry-password #{RegistryPassword}# --registry-user #{RegistryUser}#

I used token replace task to do not expose sensitive data in source control.
However, both ways work for me.
What I noticed I don't use --registry-login-server ***.azurecr.io but instead of this I provide full path to image like here:
az container create -g MyResourceGroup --name myapp --image myAcrRegistry.azurecr.io/myimage:latest --registry-password password --registry-user userName