text:
Q: Side-by-side rgl plots with R Markdown I am trying to get two 3D scatter plots, drawn with the rgl package, side-by-side in an R Markdown document. For example:
mfrow3d(nr = 1, nc = 2, sharedMouse = TRUE)
plot3d(mtcars[, 1:3], type = "s")
plot3d(mtcars[, 4:6], type = "s")
rglwidget()

This works perfectly when run directly in the console but when knit to an HTML document using R Markdown, it seems as if only the second plot is rendered.
I tried adding knit_hooks$set(webgl = hook_webgl) and setting the chunk option webgl = TRUE, but that did not help either.
Any suggestions would be appreciated.
This is my output from sessionInfo():
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
 [1] rgl_0.96.0           tidyr_0.6.0          dplyr_0.5.0          smacof_1.8-13
 [5] emojifont_0.3.3      gridExtra_2.2.1      knitr_1.14           MASS_7.3-45
 [9] shinydashboard_0.5.1 shiny_0.13.2         RColorBrewer_1.1-2   ggplot2_2.1.0

loaded via a namespace (and not attached):
 [1] gtools_3.5.0        splines_3.3.1       lattice_0.20-33     colorspace_1.2-6
 [5] htmltools_0.3.5     yaml_2.1.13         base64enc_0.1-3     chron_2.3-47
 [9] survival_2.39-4     DBI_0.5             foreign_0.8-66      plyr_1.8.4
[13] stringr_1.1.0       munsell_0.4.3       gtable_0.2.0        htmlwidgets_0.7
[17] evaluate_0.9        latticeExtra_0.6-28 httpuv_1.3.3        proto_0.3-10
[21] Rcpp_0.12.6         acepack_1.3-3.3     xtable_1.8-2        polynom_1.3-8
[25] scales_0.4.0        formatR_1.4         showtext_0.4-4      gdata_2.17.0
[29] jsonlite_1.0        Hmisc_3.17-4        sysfonts_0.5        mime_0.5
[33] weights_0.85        digest_0.6.10       stringi_1.1.1       showtextdb_1.0
[37] grid_3.3.1          tools_3.3.1         magrittr_1.5        tibble_1.2
[41] Formula_1.2-1       mice_2.25           cluster_2.0.4       Matrix_1.2-6
[45] rsconnect_0.4.3     data.table_1.9.6    nnls_1.4            assertthat_0.1
[49] rmarkdown_1.0.9013  R6_2.1.3            rpart_4.1-10        nnet_7.3-12

A: There seems to be at least one, and more like two bugs in play here. Modifying your code a bit, this:
```{r echo=T}
library(rgl)
library(rglwidget)
library(knitr)
knit_hooks$set(webgl = hook_webgl)

mfrow3d(nr = 2, nc = 2, sharedMouse = T)
plot3d(mtcars[, 1:3], type = "s",)
plot3d(mtcars[, 4:6], type = "s")
plot3d(mtcars[, 1:3], type = "s")
plot3d(mtcars[, 4:6], type = "s")
rglwidget()
```

produces this in a briefly visible device window:

but this in the R-Studio preview window:

And this in the html file loaded into the Chrome browser:

So only the first one works, and markdown seems to break it.
I would say you should probably just avoid composing multiple rgl plots in markdown until this (these) bugs get fixed. Might be hard as it seems to be some weird interaction between the various graphics devices and the library.
Update
Looks like D (?) fixed the issue per his answer, but there seems to be another issue in play too. Posting this as information.

A: This was a bug in the conversion of the bounding box decoration to Javascript code.  The bounds from the first plot carried over to the second one.  Since they were calculated from unrelated quantities, you got weird boxes resulting.  The bug is now fixed in version 0.96.1516, currently only on R-forge.
By the way, with current rgl you don't need hook_webgl or library(rglwidgets).  Just use library(rgl) and call rglwidget() if you want to insert a plot.  (There's a way to automatically insert plots without the rglwidget() call, but I don't recommend it.)
So your document could look like this:
```{r echo=TRUE}
library(rgl)
mfrow3d(nr = 1, nc = 2, sharedMouse = TRUE)
plot3d(mtcars[, 1:3], type = "s",)
plot3d(mtcars[, 4:6], type = "s")
rglwidget()
```

This produces the picture below in rgl 0.96.1516:


text:
Q: ALSA: Relation between period size of speaker and mic I have audio conferencing device which has a mic and speaker. Both mic and speaker having same sampling rate set by snd_pcm_hw_params_set_rate_near() say 8000 Hz. Do I need to set period size and number of periods to be same for both (for two such devices communicate each other) ?
Or can I choose a different period/period size for speaker than the one configured for mic ?
How do I decide on which period and period size to use ?
I am using snd_pcm_hw_params_set_period_size_near() and snd_pcm_hw_params_set_periods_near() APIs to set period size and period for both speaker and mic.
(I am new to ALSA).

A: What period sized and buffer sizes are supported depends on the driver, but if it's the same device, it's likely that the playback and capture devices support the same parameters.
Whether the parameters need to be the same depends on how your application accesses these devices. As far as the driver is concerned, these devices work independently.
What buffer/period sizes to use depends on how you want to balance latency, power usage, and over/underrun safety.
Latency is directly proportional with the buffer size on playback devices or the period siz on capture devices.
Power usage is increased slightly by shorter periods.
Xrun safety is increased by larger buffers, and a little by shorter periods.

redpajama_set_name: RedPajamaStackExchange


text:
Q: oracle stored procedure - printing varchar2 output variable I execute a stored proc as follows:
var myOutput varchar2

exec myproc(:myOutput)

print myOutput

However, this does not work.
I get an error message saying:
Bind Variable "myOutput" is NOT DECLARED

When I use a refcurser rather than a varchar2 in other procs, this works. What am I doing wrong?
Thanks!

A: So you have a procedure like this:
CREATE OR REPLACE PROCEDURE bark ( woof IN OUT VARCHAR2 )
IS
BEGIN
  woof := 'Woof!';
END bark;

Then you run:
SQL> var myOutput VARCHAR2(10)
SQL> exec bark(:myOutput);

PL/SQL procedure successfully completed.

SQL> print myOutput

MYOUTPUT
--------------------------------
Woof!

Is this similiar to what you are trying to do?

A: Is that exactly what you're running?  If so, I think the problem is you're not specifying the size of your myOutput variable.  You need to do this (adjusting the length as appropriate to your needs):
SQL> var myOutput varchar2(40)

It's in the documentation.


text:
Q: this dynamic sql is working fine from sql command prompt but if executed from sql file then always returns 0, why? delimiter //

drop procedure if exists usp_validateUserLogin;

create procedure usp_validateUserLogin(in t varchar(255),
in username varchar(255),
in password varchar(255),out count int)
BEGIN
   set @r=0;
   set @tbl=concat('select count(*) into @r from ',t);
   set @tbl2=concat(@tbl,' where @tbl.username=username and @tbl.password=password');
   prepare pstmt from @tbl2;
   execute pstmt;
   set count=@r;
END//

delimiter ;

above code is written in a file and i am executing it from sql command prompt and compiles with no error. when i call this stored procedure it returns every time a zero, although there is only one record which matches input parameter.
if i execute same statements from sql command prompt itself then its working correctly.

A:    set @tbl=concat('select count(*) into @r from ',t, ' t ');
   set @tbl2=concat(@tbl,' where t.username=', username, ' and t.password=', password');

and this question could had been avoided if you had printed the sql statement before try to execute it...


text:
Q: Understanding LSTMs - layers data dimensions I am not understanding how LSTM layers are fed with data.
LSTM layers requires three dimensions (x,y,z).
I do have a dataset of time series: 2900 rows in total, which should conceptually divided into groups of 23 consecutive rows where each row is described by 178 features.
Conceptually every 23 rows I have a new sequence 23 rows long regarding a new patient.
Are the following statements right?

*

*x samples = # of bunches of sequences 23 rows long - namely len(dataframe)/23

*y time steps = length of the each sequence - by domain assumption 23 here.

*z feature size = # of columns for each row - 178 in this case.

Therefore x*y = "# of rows in the dataset"
Assuming this is correct, what's a batch size while training a model in this case?
Might be the number of samples considered in an epoch while training?
Therefore by having x(# of samples) equal to 200, it makes no sense to set a batch_size greater than 200, because that's my upper limit - I don't have more data to train on.

A: I interpret your description as saying that your total dataset is of 2900 data samples. Where each data sample has 23 time slots, each with a vector of 178 dimensions.
If that the case the input_shape for your model should be defined as (23, 178). The batch size is simple the number of samples (out of the 2900) that will be used for a training / test / prediction run.
Try the following:
from keras.models import Sequential
from keras.layers import Dense, LSTM

model = Sequential()
model.add(LSTM(64, input_shape=(23,178)))
model.compile(loss='mse', optimizer='sgd')
model.summary()

print model.input

This is just a simplistic model that outputs a single 64-wide vector for each sample. You will see that the expected model.input is:
Tensor("lstm_3_input:0", shape=(?, 23, 178), dtype=float32)

The batch_size is unset in the input shape which means that the model can be used to train / predict batches of different sizes.


text:
Q: Citation for Silverlight 4 backward compatibility? I have a strong impression that the Silverlight 4 client runtime will run a Silverlight 3 application perfectly well, but for the life of me I can't find a definitive statement from Microsoft to that effect.
Can anyone provide a reference?

A: There are quite a few citations. Here's one from Tim Heuer, the Silverlight PM.
http://timheuer.com/blog/archive/2010/04/15/silverlight-4-breaking-changes-backward-compatibility.aspx

Yes, this is the situation we refer to
  as backward compatibility.  What this
  means is that existing compiled XAPs
  under previous versions should
  continue to work as-is even if your
  users have a later version of
  Silverlight installed on their
  machine.

And from a Microsoft website, in a section that seems like it doesn't really apply (but it does):
http://msdn.microsoft.com/en-us/library/cc265156(VS.95).aspx

...each major version of the
  Silverlight plug-in. Each version is
  backward compatible with the previous
  versions.

And another:
http://support.microsoft.com/gp/lifean45

Microsoft will continue to support all
  versions of Silverlight by shipping
  updates to the latest version of both
  Silverlight runtime and Silverlight
  SDK. Updates and new versions of the
  Silverlight runtime are backward
  compatible with web applications built
  in previous versions of Silverlight
  and will include the latest security
  enhancements, performance
  improvements, and product fixes.


text:
Q: GetFireTimeAfter method of ITrigger returning a date which is part of HolidayCalender For existing daily schedule on which I am adding holiday calendar for particular dates for which trigger should not be fired,
Below code is for adding calendar to schedule,
    ISchedulerFactory sf = new StdSchedulerFactory(config);
    Instance = sf.GetScheduler();
    HolidayCalendar cal = new HolidayCalendar();
    cal.AddExcludedDate(new DateTime(2017, 11, 24));
    cal.AddExcludedDate(new DateTime(2017, 11, 25));
    Instance.AddCalendar("Cal", cal, false,true);

Now, I am associating this existing calendar with trigger,
var trigger1 = Instance.GetTriggersOfJob(new JobKey(jc.Name)).First().GetTriggerBuilder().ModifiedByCalendar("Cal").Build();

At last I am printing all the dates on which trigger will be fired,
while (startTimeUTC < DateTime.Parse("11-21-2017").AddDays(8))
{
  var nextFireTime = trigger1.GetFireTimeAfter(startTimeUTC);
  Console.WriteLine(" :  " + nextFireTime);
  if (nextFireTime == null) break;
  startTimeUTC = (DateTimeOffset)nextFireTime;
}

But in output I am getting dates 24-11-2017 and 25-11-2017 along with other dates. As I have added dates 24-11-2017 and 25-11-2017 as holiday it should not be returned by GetFireTimeAfter() method.
Anything I am missing?

A: The method GetFireTimeAfter does not check if the returned fire time matches an excluded date from the trigger associated calendar.
An alternate method you can use to list the real fire times, while taking into account a given calendar, is:
var fireTimes = TriggerUtils.ComputeFireTimes((IOperableTrigger)trigger1, cal, 30);


text:
Q: Can you dispose of multiple objects within a Using block? How to take care of multiple objects getting disposed off in a Using statement?
Sample code
using(MyClass obj = new MyClass())
{
    MyOtherClass objOC= new MyOtherClass()
    TextReader objTR = new StringReader(...);
    // other code
}

MyClass obj will be be disposed at the end of the Using block, but then what about
MyOtherClass objOC and TextReader objTR. As far as I know it they wont get disposed, so should I be having a nested Using block there, like this below? I will need a real wide screen monitor if the number of objects increase
Is this below correct?
using(MyClass obj = new MyClass())
{
    using (MyOtherClass objOC= new MyOtherClass())
    {
        using (TextReader objTR = new StringReader(...))
        {
           //code using all three objects
        }
    }
    // other code using just `MyClass obj`
}

MyClass & MyOtherClass both implement IDisposable

A: Yes, your code is correct. Here's a couple other things you might want to be aware of...
You can declare multiple objects of the same type in a single using statement. From the documentation:
using (Font font3 = new Font("Arial", 10.0f),
            font4 = new Font("Arial", 10.0f))
{
    // Use font3 and font4.
}

For using multiple objects of different types you can nest using the one-line syntax to save space:
using (MyClass obj = new MyClass())
using (MyOtherClass objOC= new MyOtherClass())
using (TextReader objTR = new StringReader(...))
{
    // code using all three objects
}

A: Yes, if you want to gurantee the Dispose(..) call on all of them you have to enclose them inside using statment like in second example.
Or you can declare multiple objects inside single using statement. It's a matter of coding style and code flow.


text:
Q: How can I get Compiz to work in a VirtualBox VM Is there any way to get Compiz'z fancy graphics to work in a VirtualBox VM.
...and would it be too slow via a virtual video-card?...
Is it possible to actually hook into the Host's own physical video card? .. or maybe use a second dedicated physical video card?
UPDATE
JanC's method works fine for me.
I had already installed virtualbox-guest-addition ... (I'm using Lucid)
To uninstall this VirutalBox Addon pack, run its installer with  uninstall added to the end of the command line.  (the other packages JanC mentioned seems to replace its functionality)... In my case the command was:
sudo VBoxLinuxAdditions-x86.run uninstall

A: In the VM configuration, go to the "Display" section, in the "Video" tab make sure "Enable 3D acceleration" is checked.
After installing Ubuntu inside the VM and starting it for the first time, install the 3 packages that start with virtualbox-ose-guest- inside the VM, then reboot Ubuntu inside the VM.  (BTW: you don't want the package named virtualbox-guest-additions.)
If I do that, I can run Compiz without problems (Unity doesn't work though!).

A: If you got 11.10+, I think you should move to VMware because Unity and Compiz works 100% there. Make sure you enable 'Accelerate 3D graphics' from Display settings in the VM.


text:
Q: ExecuteNonQuery requires an open Connection I get the error

ExecuteNonQuery kräver en öppen och tillgänglig Connection.
  Anslutningens aktuella status är stängd.

When trying to run my code. I thought I opened  and closed the connection accordingly
string connetionString = null;
                SqlConnection connection;
                SqlCommand command;
                SqlDataAdapter adpter = new SqlDataAdapter();
                DataSet ds = new DataSet();
                XmlReader xmlFile;
                string sql = null;

        connetionString = "Data Source=tsrv2062;Initial Catalog=Bums;User ID=BumsUser;Password=2tusen7Bums";

        connection = new SqlConnection(connetionString);

        xmlFile = XmlReader.Create("navetout.xml", new XmlReaderSettings());
        ds.ReadXml(xmlFile);

        connection.Open();

        DateTime datum = DateTime.Now;

        SqlCommand command1 = new SqlCommand("UPDATE Seamen SET FirstName = @FirstName, LastName = @LastName, NationalRegistrationCountyCode = @NationalRegistrationCountyCode, NationalRegistrationMunicipalityCode = @NationalRegistrationMunicipalityCode, CitizenshipCode = @CitizenshipCode, LastChangedDate = @LastChangedDate WHERE PersonalIdentityNumber = @PersonalIdentityNumber", connection);

        for (int i = 0; i < PersonalIdentityNumber.Count; i++)
        {

            var personnummer = PersonalIdentityNumber[i];
            var fornamn = FirstName[i];
            var efternamn = LastName[i];
            var lankod = LanKod[i];
            var kommunkod = Kommunkod[i];
            //var utdelAdress2 = UtdelAdress2[i];
            //var postNr = PostNr[i];
            //var postOrt = PostOrt[i];
            //var fodelselanKod = FodelselanKod[i];
            //var fodelseforsamling = Fodelseforsamling[i];
            var medborgarskapslandKod = MedborgarskapslandKod[i];
            // var medborgarskapsdatum = Medborgarskapsdatum[i];

            command1.Parameters.Clear();
            command1.Parameters.AddWithValue("@PersonalIdentityNumber", personnummer);
            command1.Parameters.AddWithValue("@FirstName", fornamn);
            command1.Parameters.AddWithValue("@LastName", efternamn);
            command1.Parameters.AddWithValue("@NationalRegistrationCountyCode", lankod);
            command1.Parameters.AddWithValue("@NationalRegistrationMunicipalityCode", kommunkod);
            //command1.Parameters.AddWithValue("@NationalRegistrationDistributionAddress2", utdelAdress2);
            //command1.Parameters.AddWithValue("@NationalRegistrationPostCode", postNr);
            //command1.Parameters.AddWithValue("@NationalRegistrationCity", postOrt);
            //command1.Parameters.AddWithValue("@BirthCountyCode", fodelselanKod);
            //command1.Parameters.AddWithValue("@BirthParish", fodelseforsamling);
            command1.Parameters.AddWithValue("@CitizenshipCode", medborgarskapslandKod);
            // command1.Parameters.AddWithValue("@CitizenshipDate", medborgarskapsdatum);
            command1.Parameters.AddWithValue("@LastChangedDate", datum);

            command1.ExecuteNonQuery();

            Console.WriteLine(personnummer);

        connection.Close();
        Console.WriteLine("Done");

Can anyone find what's wrong?

A: Your connection.Close() appears to be in a loop, because you forgot a closing brace. Only the first iteration succeeds, and the second one fails due to closed connection.
However, do not rush to add the brace and consider it fixed. This would not be a good way of addressing the problem, because a different issue would remain - you would need to deal with closing the connection on an exception.
C# provides a solution to this - it's the using construct. You should fix it like this:
using(var connection = new SqlConnection(connetionString)) {
    connection.Open();
    ... // Rest of your code; Do not call connection.Close()
}

Since connection is enclosed in using, the program will close it automatically upon exiting the using block. It will do so upon normal exit, but also upon exiting on an exception, so you do not have to worry about catching, closing, and re-throwing.

A: Adding the true advice of dasblinkenlight put your closing connections out of for loop  and at the end of for loop put a command1.parameters.clear (You have to clear old parameters)

A: The code snippet you have posted is missing a close brace for the for loop - it should be immediately following the Console.WriteLine(personnummer); but if it is not then the following line which closes the connection will be inside the for loop and the connection will be closed following the first iteration, causing the error on the second iteration.


text:
Q: Responsive checkbox align label with new line I need some help with the style of this checkbox, when I resize the window to adjust to mobile, the text label makes a line break, and checkbox just stills in his original position, how can I make to adjust the box align closer to his label? Thanks in advance.

    <input type="checkbox" class="custom-control-input" id="customCheck1" (change)="termsAndConditions($event.target)">
    Acepto los Términos y condiciones

CSS of container

.wrapper {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  padding: 20px;
}

#formContent {
  -webkit-border-radius: 10px 10px 10px 10px;
  border-radius: 10px 10px 10px 10px;
  background: #fff;
  width: 90%;
  max-width: 450px;
  position: relative;
  -webkit-box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
  box-shadow: 0 30px 60px 0 rgba(0,0,0,0.3);
  text-align: center;
}

 Iniciar sesión

 Crear cuenta

    <router-outlet></router-outlet>

A: The code you shared and the behavior are different, here is what you can look into:
fiddle to play around
here is how it looks for mobile screen.

.custom-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px;
  border: 1px solid red;
}

  <input type="checkbox" class="custom-control-input" id="customCheck1" (change)="termsAndConditions($event.target)">
  Acepto los Términos y condiciones

A: The solution for now is by using @media and limit max-width of label, this is compatible with the text-align: center of the container

@media screen and (max-width: 345px) {
  .custom-control-label{
    max-width: 120px;
  }
}


text:
Q: Inconsistent Out-of-bag error estimates I keep getting different out-of-bag error estimates from the caret package, depending on how the estimates are computed. I can't seem to nail down exactly where the discrepancy is coming from.
Consider a simple random forest model using the built-in mtcars dataset:
set.seed(100)
tc <- caret::trainControl( method="oob" )
m <- caret::train( mpg ~ ., data=mtcars, method="rf", trControl=tc )
# Random Forest

# 32 samples
# 10 predictors

# No pre-processing
# Resampling results across tuning parameters:

#   mtry  RMSE      Rsquared
#    2    2.429726  0.8322324
#    6    2.301918  0.8494180
#   10    2.429676  0.8322394

# RMSE was used to select the optimal model using  the smallest value.
# The final value used for the model was mtry = 6.

A print out of the model reports that mtry = 6 was the best meta-parameter value and the associated error estimates are RMSE = 2.301918 and R^2 = 0.8494180. My understanding is that these error estimates are computed over out-of-bag examples in the data due to trainControl( method="oob" ) setting. Is this correct?
If I now apply the oob() function from $modelInfo to the best model (as captured by $finalModel), I would expect to get the same performance estimates as the mtry=6 entry in the table above, but I don't:
m$modelInfo$oob( m$finalModel )
#      RMSE  Rsquared
# 2.3485040 0.8432614

Furthermore, if I now compute predict( m$finalModel ), it should return out-of-bag predictions, since newdata parameter is omitted. However, this results in yet another estimate of OOB error when passed to postResample:
caret::postResample( predict(m$finalModel), mtcars$mpg )
#      RMSE  Rsquared       MAE
# 2.3485040 0.8468821 1.8463368

(Notice that although RMSE agrees with the oob() call above, R^2 has a different value.)
While I appreciate that the values are in the same "ballpark", I don't understand where the discrepancy comes from. Does anybody have any insight?

A: It seems to be impossible to get to the tuning resamples if you use oob as a method, unless you write a custom method that saves away the fit objects during tuning.
  library(caret)
  # Copy all model structure info from existing model type
  cust.mdl <- getModelInfo("rf", regex=FALSE)[[1]]

  # Override fit function so that we can save the iteration
  cust.mdl$fit <- function(x=x, y=y, wts=wts, param=param, lev=lev, last=last, classProbs=classProbs, ...) {
    # Dont save the final pass (dont train the final model across the entire training set)
    if(last == TRUE) return(NULL)
    # Fit the model
    fit.obj <- getModelInfo("rf", regex=FALSE)[[1]]$fit(x, y, wts, param, lev, last, classProbs, ...)

    # Create an object with data to save and save it
    fit.data <- list(resample=rownames(x),
                   mdl=fit.obj,
                   #x, y, wts,
                   param=param, lev=lev, last=last, classProbs=classProbs,
                   other=list(...))

    # Create a string representing the tuning params
    param.str <- paste(lapply(1:ncol(param), function(x) {
                       paste0(names(param)[x], param[1,x])
                       }), collapse="-")

    save(fit.data, file=paste0("rf_model_", param.str, ".RData"))
  return (fit.obj)
}

set.seed(100)
tc <- trainControl( method="oob")
m <- train( mpg ~ ., data=mtcars, method=cust.mdl, trControl=tc)

The final fit object returns oob errors from each tuning iteration
m$results
>
         RMSE  Rsquared mtry
    1 2.417379 0.8339331    2
    2 2.394624 0.8370448    6
    3 2.455534 0.8286495   1

So now if I fetch the fit object from the tuning iteration corresponding to mtry=6, I can recreate those errors
load("rf_model_mtry6.RData")

# using same oob() function that is used for final predictions
m$modelInfo$oob(fit.data$mdl)
>
     RMSE  Rsquared
2.3946242 0.8370448


text:
Q: How to validate FromDate and Todate in SSRS reports I want to validate From date is cannot greater than To date in SSRS Reports.

A: Without providing a list of dates the user can select from a report Dataset, there is no way to do this in SSRS.  If having a FromDate after your ToDate will somehow cause issues in your datasets (surely they would just return blank?) you will need to add your validation there.


text:
Q: Javascript linked list implementation and pointers I have implemented a linked list in 2 ways in Javascript, but when doing so, I got really confused about what is really happening.
I was trying to create a mental image about what is being created, and what is pointing to what memory address (based on what I have learned about passing by reference), but I can't do it.

*

*Are both implementations correct?

*They seem to be doing the same thing, but do they behave in different ways under the hood?

*In option 1, for the prepend() method, I am creating a new object in memory, where "next" property is pointing to the existing memory address of "head" property, but "head" property is now pointing to the new object. Maybe it's a stupid question, but isn't this going in circles? Why does this work?

The differences are between the append() and prepend() methods.
Option 1:
class myLinkedList {
    constructor(value) {
    this.head = {
      value: value,
      next: null
    }
    this.tail = this.head;
  }

  append(element){
    this.tail.next = {
      value: element,
      next: null
    }
    this.tail = this.tail.next;
  }

  prepend(element) {
    const newObj = {
      value: element,
      next: this.head
    }
    this.head = newObj;
  }
}

const linkedList = new myLinkedList(1);
linkedList.append(2);
linkedList.prepend(0);

Option 2:
class myLinkedList {
    constructor(value) {
    this.head = {
      value: value,
      next: null
    }
    this.tail = this.head;
  }

  append(element){
    const newNode = {
      value: element,
      next: null
    }
    this.tail.next = newNode;
    this.tail = newNode;
  }

  prepend(element) {
    const newNode = {
      value: element,
      next: null
    }
    newNode.next = this.head;
    this.head = newNode;
  }
}

const linkedList = new myLinkedList(1);
linkedList.append(2);
linkedList.prepend(0);

A: You clarified your question in the comments.
The answer has to do with variable binding vs values.
JavaScript has internal representations for values like strings, numbers, user defined objects, and so on.  That representation is the same whether or not the value is named foo, or is buried deep in some data structure.
Programs have variables.  At any moment in time, a given variable is bound to a given value.  This gives programmers a way to tell JavaScript what should happen to the values that they are bound to.
Assignment is binding values to things.  When we assign to a variable, it is no longer bound to whatever old value it has been bound to.  That old value may still exist in some data structure, or may become garbage to be cleaned up.  But it is no longer associated with that variable.
And so here is what the sample code that you gave actually does.
-- Create a value and bind it to head.
let head = {
    value: 2,
    next: null
};
/* CURRENT BINDING:
 *
 *    head ----> {value:2, next:null}
 */

-- Create a value and bind it to newObj
let newObj = {
    value: 1,
    next: head
};
/* CURRENT BINDING:
 *
 *  newObj ----> {value:1, next:
 *    head ---->     {value:2, next:null}
 *               }
 */

-- Bind the variable head to the value newObj is bound to.
head = newObj;
/* CURRENT BINDING:
 *
 * head,newObj
 *         ----> {value:1, next:
 *                   {value:2, next:null}
 *               }
 */

-- And see that it worked.
console.log(head)

Does that clarify your model of how programs represent data enough to understand why this code doesn't create a circular reference?
But if you're curious, it is possible to create circular references.
let foo = {value:1}:
foo['next'] = foo;
console.log(foo);

How did that work, isn't assignment just binding values to things?  Well, yes.  But if the thing that it is bound to is somewhere in a data structure, then that data structure had to get changed to allow it to be bound.
What happens after you create circular references varies by language. In JavaScript, at some point after it is bound to nothing, the garbage collector will clean it up.  In Python, it takes on a life of its own and you leak memory.  And so on.


text:
Q: scroll bar in pageblocktable in visualforce page I am using a "pageblocktable" to display a list of data in my application. My problem here is that the list contains more than hundred rows of data. My question is, is it possible to add a scroll bar to the table and set the number of rows that are visible or set the height to the table?
Or If a scroll bar is is not possible can pagination be added to the visualforce page is it possible?

A: Pagination is definitely possible. You can use the standard set controller or the newer OFFSET feature in SOQL to do this.
Check this out.
http://www.redpointsolutions.com/add-pagination-to-your-visualforce-pages-using-the-soql-offset-clause


text:
Q: ANSI C What am I doing wrong with fwrite and the fread? I have the following code in which I attempt to write some data to a file on first execution, and then on second execution reads the file and prints the data to the screen.
In the first execution it writes the data to the screen exactly as it is in the code (test_data), and the file is created as expected.
The problem is when I read the file back and write what I have read to the screen it is just the plain contents of the file that I would see in any text editor, and not the original data. I have no idea what I'm doing wrong.
I'm pretty sure line 67 is at fault, something to do with the way I am printing it to the screen, but I'm very new to C and not used to juggling formats of data.
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

int main ()
{

    FILE * pdataFile = NULL;
    const char * datafilename = "data.bin";
    const char * _WRITE = "wb";
    const char * _READ  = "rb";
    uint8_t data[32];
    int idx;
    unsigned long dataFileLen;
    char dataBuffer;

    char test_data[] = "ahFlup1r2PWO1zySK9SBcPIQC5DcCw1mq7JrObea8lDWH&FcLbi7EzBu7ow56KbJ";
    char * pos = test_data;

    pdataFile = fopen(datafilename, _READ);
    if (pdataFile == NULL) {
        printf("No existing file named: %s .\n", datafilename);

        /******** Print Contents of data Array ********/
        printf("Random data: ");

        for (idx = 0; idx < 32; ++idx) {
            sscanf(pos, "%2hhx", &data[idx]);
            pos += 2 * sizeof(char);
            printf("%02x", data[idx]);
        };

        printf("\n"); // new line

        /******** Save data to File ********/
        pdataFile = fopen(datafilename, _WRITE);
        if (pdataFile == NULL) {
            printf("Error opening file %s for writing. End Program\n", datafilename);
        } else {
            fwrite (test_data, sizeof(char), sizeof(test_data), pdataFile);

            if (ferror (pdataFile))
                printf("Error writing file %s.", datafilename);

            fclose (pdataFile);
        };

    } else {
        fseek(pdataFile, 0, SEEK_END);
        dataFileLen = ftell(pdataFile);
        fseek(pdataFile, 0, SEEK_SET);

        char *dataBuffer = malloc((dataFileLen+1)*sizeof(unsigned char));

        fread(dataBuffer, dataFileLen, 1, pdataFile);

        if (ferror (pdataFile))
            {
                printf("Error reading file contents: %s.", datafilename);

            }else{
            printf("data read from file: ");
            for(idx = 0; idx<dataFileLen; ++idx){
                printf("%2hhx", ((char *)dataBuffer)[idx]);
            };
        };

        printf("\n"); // new line

        fclose (pdataFile);

    };

    return 0;
};

UPDATE I'm expecting to see the following:
On first execution
Random data: ahFlup1r2PWO1zySK9SBcPIQC5DcCw1mq7JrObea8lDWH&FcLbi7EzBu7ow56KbJ
On second execution
data read from file: ahFlup1r2PWO1zySK9SBcPIQC5DcCw1mq7JrObea8lDWH&FcLbi7EzBu7ow56KbJ
Second Update Even with the answers posted here I am still getting:
Seed read from file: 6168466c757031723250574f317a79534b39534263504951433544634377266d71374a724f626561286c4457482646634c626937457a4275376f7735264b624a00
The program is compiled in GCC and should compile from the code here.

A: You are probably writing the contents of the wrong array to the file.
Try writing data instead of test_data.
You will also likely want leading zeros on the values you print when reading the file (just as you already have when you initially print the scanned data).


text:
Q: Should I be passing S_ variables into functions - PHP I am building a little website as a project on the side and am having a go at mvc.
I have built a request class, and a router class.
Simple enough question, but I have read all over the place that globals are bad for such whatever reason, so should I be passing in, $_GET, $_POST, $_SERVER etc into my request class, or just referencing them from inside the request class.
new Request($_GET, $_POST, $_SERVER);

or
new Request();

Thanks.

A: One of the main aspects of OOP is abstraction.
So the class should not know about your Global Variables.
What if you change the key of your GET.
The first Method is the most common way.


text:
Q: What is the reason behind instable type traits? I was debugging a failing clang build today. That build essentially broke, because a is_default_constructible evaluated to false. I reduced the issue to a minimal case after several hours of bisecting the issue:
#include <type_traits>
#include <string>

namespace A {
    // This has been extracted from an old (outdated(?))
    // implementation of an optional type

    struct empty_t {};

    template<class T>
    struct o
    {
    public:
        template<class... U,
                 typename std::enable_if<
                     std::is_constructible<T, U...>::value,
                     bool
                     >::type = false
                 >
        o(empty_t, U&&... u) { }
    };

}

struct B
{
    struct Foo
    {
        //Foo () {};   // uncomment this line and it works
        bool x = true; // comment this line and it works
    };

    std::string c; // comment this line and it works, also change to int
    A::o<Foo> r;   // comment this line and it works

    static const bool b;
};

static_assert(
    std::is_default_constructible<B::Foo>::value,
    "not constructible!");

The example above compiles fine with g++ 6.3 and 7.0. It fails with clang++ 4.0.0 and 3.9.1 - the static assertion fails only in that very specific construction, but it still broke our build. As you can try for yourself, some minimal changes fix the issue (e.g. commenting one of the mentioned lines). The result looks somewhat arbitrary.
What I'd like to know is, whether that apparent bug in clang is actually a bug or some undefined behavior. How well defined is that part of the language, actually?
I would also appreciate any advice on how to debug such issues: Is there a good way to get some info out of clang on why exactly it believes that Foo is not default constructible?
Finally, if anyone of you has access to a (standard compliant) third C++ implementation and could report on the results, that would be very nice.

A: Default data member initializers of the nested class are not instantiated until the outer class is complete (i.e., at the semi-colon of the outer class's definition).  That leads to strange consequences when using type traits to query the nested class when it's complete (i.e., after its definition) but before the outer class is complete.
You can work around this by moving Foo outside B.


text:
Q: how can I add new query to gridview? I have a list of data and I want to use that data to search in a table.The query works fine but it doesn't keep previously data.Is there any solution for it?
here's the code:
foreach (string Id in LstID)
{
    GdEmp.DataSource = employee.ShowData(Id);
    GdEmp.DataBind();

}

here's the query:
public class Employee
{
    public string family { get; set; }
    public string name { get; set; }
    ....

public List<Employee> ShowData(string Id)
    {
        try
        {
            var Query = from P in Bank.employee
                where P.Id == Id
                select new Employee
                {
                    family = P.Family,
                    name= P.Name,
                    ...
                };
            return Query.ToList();

        }
     }

A: You need a function that takes in the list of Id's you want to show and returns a list with the corresponding information, instead of getting them one by one.
GdEmp.DataSource = employee.ShowAllData(LstID);
GdEmp.DataBind();

Use this function:
public List<Employee> ShowAllData(List<string> LstID)
{
        var q = from P in Bank.employee
                where LstID.Contains(P.Id)
                select new Employee
                {
                       family = P.Family,
                       name   = P.Name,
                       ...
               };
        return q.ToList();
}


text:
Q: Best Practices to create a configuration kind of list in SharePoint Online we use to have a parameter list in our SharePoint environment, which contains Key value Pair for various configuration parameter, which we cache and use them  to improve the performance of our site.
Is there a way to implement the same in SharePoint Online.

A: I don't know how you cache it but you can use Web.AllProperties (https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.web.allproperties.aspx)
using (ClientContext cc = new ClientContext(siteUrl))
{
    cc.Credentials = new SharePointOnlineCredentials(userName, password);
    cc.Site.RootWeb.AllProperties["key"] = "value";
}


text:
Q: Having trouble iterating through Javascript objects I've been running into a problem with accessing data in a JS object. The code that gathers the data (from a Firebase database) is as follows:
var get_user_data = function() {
    ...
    snapshot.forEach(function(child){
        var key = child.key;
        var value = child.val();
        user_char[key] = value;
        console.log(key, value);
    });
    store_user_char(user_char);
}

var store_user_char = function(user_char) {
    char_obj = user_char;
    console.log(char_obj);
    for(var key in char_obj){
        if(char_obj.hasOwnProperty(key)){
            console.log(key);
        }
}

Which should (in theory) create JS object from the Firebase database and while it is writing the data to user_char, it will print each key:object pair into the console. Afterwards, when store_user_char() executes it should also print out each key from before.
The first console.log() outputs each key:object pair successfully as it writes into user_char. The second console.log() outputs the object successfully and I can even click and edit all the elements inside and looks like this in the Firefox console:

However the third console.log() never executes, and trying to get any data from char_obj by accessing a key like so:
char_obj['KSxpjEvkCOL6ugGkxqn']

does nothing and returns undefined. Oddly enough, clicking on the objects manually in Firefox allows me to parse each child element so I know the data is being stored somewhere.
The only thing I can think of is that the request from the database might take to long to return the data, but even then the store_user_char() function should execute after the data has been stored into user_char so I'm incredibly confused as to why my code can't seem to iterate through the object.
I feel as though I'm missing something about JS objects which is the reason for why my code can't find the data, but I've been coming up blank in trying to figure out whats going on, and how I can access the data.
Any help on the matter would be greatly appreciated!
EDIT: Full def of get_user_data is as follows:
// Global variables
var user_email;
var user_char = {};
var uid;

var get_user_data = function() {
    // Authenticate current user
    var user = firebase.auth().currentUser;

    // Get User Email and char list
    if (user != null) {
        user_email = user.email;
        uid = firebase.auth().currentUser.uid;
        var getChar = firebase.database().ref('/users/' + uid + '/chars/').orderByKey();
        getChar.on('value', function(snapshot){
            snapshot.forEach(function(child){
                var key = child.key;
                var value = child.val();
                user_char[key] = value;
            });
        });
        store_user_char(user_char);
    }
}

A: getChar.on('value', function(snapshot){
    snapshot.forEach(function(child){
        var key = child.key;
        var value = child.val();
        user_char[key] = value;
    });
});

will be called asynchronously, put function call store_user_char(user_char); inside callback of getChar and your problem will be solved.
Like:
getChar.on('value', function(snapshot){
        snapshot.forEach(function(child){
            var key = child.key;
            var value = child.val();
            user_char[key] = value;
        });
       store_user_char(user_char);
    });


text:
Q: Where are logs of git-daemon saved? (Git on windows using Cygwin) I am running git-daemon as a windows service. (using Create Process)
The command used in service is:
git daemon --reuseaddr --base-path=/data/test_work/ --export-all \
    --verbose --enable=receive-pack

Where do I see the logs of git daemon?
Note: there is no file at /var/logs.

A: If you still need and want to do it, I have found a way to do that: just create a bash script with execution permissions and tell the daemon to log its stuff into one or two files (if you want to log stderr separately):
#!/bin/bash

# Git daemon launchd startup command.

GIT_RO_USER="git-ro" # The user which has read only access to the repositories.

GIT_REP_BASE_PATH="/path/to/GitRepositories" # The repositories base path.

GIT_LOG_FILE="/var/log/git.log" # The git daemon log file. The user which runs the script must have the right write permissions

/path/to/git daemon --reuseaddr --verbose --user=$GIT_RO_USER --base-path=$GIT_REP_BASE_PATH $GIT_REP_BASE_PATH >> $GIT_LOG_FILE 2>&1

# Or if you like to keep the error log separated, uncomment the following lines and comment the previous one:
#GIT_ERR_LOG_FILE="/var/log/git_err.log" # The error log file
#/path/to/git daemon --reuseaddr --verbose --user=$GIT_RO_USER --base-path=$GIT_REP_BASE_PATH $GIT_REP_BASE_PATH >> $GIT_LOG_FILE 2>> $GIT_ERR_LOG_FILE

Where /path/to/git is the path to the git command. I use it with launchd on my OS X machine cause I have noticed that you can't setup StandardOutPath and StandardErrorPath keys for the daemon using a .plist file.
Hope it helps you too!

A:
Where do I see the logs of git daemon?

Git 2.17 (Q1 2018) can help, since the log from "git daemon" can be redirected with a new option; one relevant use case is to send the log to standard error (instead of syslog) when running it from inetd.
See commit 0c591ca (04 Feb 2018) by Lucas Werkmeister (lucaswerkmeister).
Helped-by: Ævar Arnfjörð Bjarmason (avar), Junio C Hamano (gitster), and Eric Sunshine (sunshineco).
(Merged by Junio C Hamano -- gitster -- in commit c2bd43d, 21 Feb 2018)

daemon: add --log-destination=(stderr|syslog|none)
This new option can be used to override the implicit --syslog of --inetd, or to disable all logging. (While --detach also implies --syslog, --log-destination=stderr with --detach is useless since --detach disassociates the process from the original stderr.) --syslog is retained as an alias for --log-destination=syslog.
--log-destination always overrides implicit --syslog regardless of
  option order.
  This is different than the "last one wins" logic that
  applies to some implicit options elsewhere in Git, but should hopefully
  be less confusing.
  (I also don't know if all implicit options in Git follow "last one wins".)
The combination of --inetd with --log-destination=stderr is useful, for
  instance, when running git daemon as an instanced systemd service
  (with associated socket unit).
  In this case, log messages sent via syslog are received by the journal daemon, but run the risk of being processed at a time when the git daemon process has already exited (especially if the process was very short-lived, e.g. due to client error), so that the journal daemon can no longer read its cgroup and
  attach the message to the correct systemd unit (see systemd/systemd issue 2913). Logging to stderr instead can solve this problem, because systemd can connect stderr directly to the journal daemon, which then already
  knows which unit is associated with this stream.

Git 2.18 (Q2 2018) make things more robust, since the recent introduction of "--log-destination" option to "git daemon" did not work well when the daemon was run under "--inetd" mode.

daemon.c: fix condition for redirecting stderr
Since the --log-destination option was added in 0c591ca ("daemon: add
  --log-destination=(stderr|syslog|none)", 2018-02-04, Git 2.17) with the explicit goal of allowing logging to stderr when running in inetd mode, we should not always redirect stderr to /dev/null in inetd mode, but rather only when stderr is not being used for logging.


text:
Q: Row reduce of a matrix mod 2 So I have two matrices, E and I I stack them together horizontally and perform a different kind of row reduce than the one we know (Echelon). In this row reduce, starting with the first column on the left-hand side, we find the first row with a 1 in that column and add it modulo 2 (0 + 0 = 1 + 1 =0, 0 + 1 = 1 + 0 = 1) to each of the succeeding rows with a 1 in that
column. We then eliminate this first row with a 1 in the first column. The procedure is repeated by finding the first row with a 1 in the
second column, adding it to each succeeding row with a 1 in the second
column and then eliminating the first row with a 1 in the second column.
This is continued until we obtain a row in which the columns of E
are all 0's.
import numpy
E = numpy.random.random_integers(0, 100, (5, 3))
I = numpy.eye(5)

EstackI = numpy.hstack((E,I))
EstackI = EstackI%2

matrix = EstackI

def addRowsMod2(first, second):
    return [((x + y) % 2) for x, y in zip(first, second)]

numColsE = E.shape[1]  # the number of columns in E

def rowReduceStep(col, matrix):
    selectedRow = -1
    numRows = len(matrix)
    for rowIndex in range(numRows):
        row = list(matrix[rowIndex])
        if row[col] == 1:
            selectedRow = rowIndex
            break

    if selectedRow != -1:
        for i in range(selectedRow + 1, numRows):
            if matrix[i][col] == 1:
                matrix[i] = addRowsMod2(matrix[i], matrix[selectedRow])

    newMatrix = []
    for i in range(numRows):
        if i != selectedRow:
            newMatrix += [matrix[i]]
    return (newMatrix, selectedRow)

for col in range(numColsE):
    result = rowReduceStep(col, matrix)
    matrix = result[0]

finalMat = matrix

Above is my code, I do end up with an output with 0's in E and a combination of 0's and 1's in I. However, I know this isn't the right result (this is just a part of my huge project, I go on to use the locations of 1's in I later and the matrix size is actually much larger (63 x 90) my text has a printout for 2 lines of this large matrix and that is how I know this isn't working right. Any help will be appreciated. )


text:
Q: How did Hook find Gold in Season 2 and Emma in Season 3? In Season 2 of Once Upon a Time, Hook leaves Storybrooke using his ship in order to find Gold and take revenge on him.  He finds Gold in Neal's apartment building in New York City, and stabs him with his hook coated with the poison Dreamshade.  And in Season 3, Hook uses a magic bean to go from the Enchanted Forest to the real world, in order to tell Emma that her family needs her help to fight the Wicked Witch.  He finds Emma in her apartment in New York City and tries to persuade her to come back to Storybrooke with him.
My question is, how did Hook find Gold in Season 2, and how did he find Emma in Season 3?
I remember that during Season 2, the creators said that the first question would be answered in future, but was it ever answered, either in the show or by the creators? What about the second question?


text:
Q: What is the difference between Null Nan and None in python I am stuck at a point in python where dataset has None values and It was working fine when there was nan in the dataset, Now it's saying argument 1 has unexpected type 'float'.
   a = NaN
    if (a is None):
        print('a is None')
    elif(a is NaN):
        print('a is NaN')
    elif(a is None):
        print('a is Null')


text:
Q: jQuery Autocomplete Combobox doesn't have a mouse out / tab out event Here is the link that solved one issue: Jquery ui Autocomplete Combobox - changed not firing
That works great, thanks to Drixson Osena for that answer.
Does this UI control have a similar mouse-out or tab-out event?  We can get by with its existing functionality if it doesn't but it would enhance our app if it does.
Here is the existing code:
//district
    $('#project-locationSearch-dist').combobox({
        select: function (event, ui) {
            var districtVal = $('#project-locationSearch-dist').val();
            var returnedSFN = $('#project-locationSearch').val();
            GetSPNsByDistrict(districtVal);
            GetPIDsByDistrict(districtVal);
        }
    });

Works great now that we have select: working.  The last 2 function calls populate 2 other jQuery Autocomplete controls.  For those, when users enter in a known value in either and tabs/mouses out we need to fire another event.
Because the search event is always going to be fired, the idea is why use a Search button?  On select or tab/mouse out, just fire the event that way.
Thanks.


text:
Q: $z_n=n\left\{1-\cos\left(\frac{\theta}{n}\right)-i\sin\left(\frac{\theta}{n}\right)\right\}$ converges or diverges.
Question: Find out if the sequence $$z_n=n\left\{1-\cos\left(\frac{\theta}{n}\right)-i\sin\left(\frac{\theta}{n}\right)\right\},\hspace{0.2 cm}\theta\text{ fixed},$$ converges or diverges. If it converges find out its limit.

Solution: $\forall n\in\mathbb{N}$, $z_n$ can be written as $$z_n=n\left\{1-\cos\left(\frac{\theta}{n}\right)\right\}+i\left\{-n\sin \left(\frac{\theta}{n}\right)\right\},$$ which implies that $x_n:=\Re(z_n)=n\left\{1-\cos\left(\frac{\theta}{n}\right)\right\}$ and $y_n:=\Im(z_n)=-n\sin \left(\frac{\theta}{n}\right), \forall n\in\mathbb{N}.$
Now $$\lim_{n\to\infty}x_n=\lim_{n\to\infty}n\left\{1-\cos\left(\frac{\theta}{n}\right)\right\}=\lim_{n\to\infty}\frac{1-\cos\left(\frac{\theta}{n}\right)}{\frac{1}{n}}=\lim_{n\to\infty} \frac{\sin\frac{\theta}{n}\left(-\frac{\theta}{n^2}\right)}{-\frac{1}{n^2}}=0,$$ and
$$\lim_{n\to\infty}y_n=\lim_{n\to\infty}-n\sin \left(\frac{\theta}{n}\right)=-\lim_{n\to\infty}\frac{\sin\left(\frac{\theta}{n}\right)}{\frac{1}{n}}=-\lim_{n\to\infty}\frac{\cos\frac{\theta}{n}\left(-\frac{\theta}{n^2}\right)}{-\frac{1}{n^2}}=-\theta.$$
Therefore, since, both $(x_n)_{n\ge 1}$ and $(y_n)_{n\ge 1}$ are convergent sequences, implies that $(z_n)_{n\ge 1}$ is also convergent and $$\lim_{n\to\infty}z_n=\lim_{n\to\infty}x_n+i\lim_{n\to\infty}y_n=0+i(-\theta)=-i\theta.$$
Is this solution correct and rigorous enough? What are the other ways to solve this problem?

A: Note that\begin{align}
z_n & = n\left(1-\cos\left(\frac{\theta}{n}\right)-i\sin\left(\frac{\theta}{n}\right)\right) \\
 & = 2n\sin\left(\frac{\theta}{2n}\right)\left(\sin\left(\frac{\theta}{2n}\right)-i\cos\left(\frac{\theta}{2n}\right)\right) \\
 & = -i\theta\dfrac{\sin\left(\theta/2n\right)}{\left(\theta/2n\right)}\exp\left(\frac{i\theta}{2n}\right)
\end{align}
Hence $$\lim_{n\to\infty}z_n=-i\theta .$$

A: \begin{align}
\lim_{n\to \infty}z_n & =\lim_{n\to \infty} n\left(1-\cos\left(\frac{\theta}{n}\right)-i\sin\left(\frac{\theta}{n}\right)\right) \\
 & = \lim_{n\to \infty} \frac{\left(1-\cos\left(\frac{\theta}{n}\right)-i\sin\left(\frac{\theta}{n}\right)\right)}{\frac{1}{n}} \\
 & = \lim_{t\to 0} \frac{\left(1-\cos\left({t\theta}\right)-i\sin\left({t\theta}\right)\right)}{t}\\
& =\lim_{t\to 0} {\left(\theta\sin\left({t\theta}\right)-i\theta\cos\left({t\theta}\right)\right)}\text{ (via L'Hospital's Rule)}\notag\\
& =-i\theta
\end{align}


text:
Q: Menu Bar of Angular Application (menu with user wise right) sometimes shows extra icons and sometimes doesn't I am working on angular app in which we have to maintain user rights. Issue is that sometimes side menu show icons (which are basically routes to different pages) and sometimes side menu do not show icons that must be there.
Let's say I have three or more Ids with different screen rights. When I open browser for the first time and Login with one Id menu is generated just fine and there is no less or no more icons (routes to pages). I logout and Login with different Id then either of the following happens:
1. Side menu have icons from the previous user rights
2. Or it shows icons for both of user.
I have been searching the web for this issue but found nothing or I would say I couldn't reach any solution. Please help me its my first project.
User Rights are fetched from database and are rendered with for loop in html in angular.


text:
Q: "Actual and formal argument lists differ in length" error in android studio Complete Error
mContentsViewModel = new ViewModelProvider(getActivity()).get(ContentsViewModel.class);
                             ^
constructor ViewModelProvider.ViewModelProvider(ViewModelStoreOwner,Factory) is not applicable
  (actual and formal argument lists differ in length)
constructor ViewModelProvider.ViewModelProvider(ViewModelStore,Factory) is not applicable
  (actual and formal argument lists differ in length)**

Error cause: this in below line:

mContentsViewModel = new ViewModelProvider(this).get(ContentsViewModel.class);

Check image for clear understanding

A: the way you have it there, it is perceived by compiler as wrong arguments passed to constructor. Without longer explanation, try this:
mContentsViewModel = ViewModelProvider.of(this).get(ContentsViewModel.class);


text:
Q: pandas read csv giving creating incorrect columns I am using pandas to read a csv file
import pandas as pd
data = pd.read_csv('file_name.csv', "ISO-8859-1")

Op:
col1,col2,col3
"sample1","sample2","sample3"

but the DF is just creating 1 column instead of the 5 it is supposed to create. I checked the csv and its fine.
Any suggestions on why this could be happening will be useful.


text:
Q: Remove all disabled attribute with button click I have a form with about 30 fields. Some are input number fields, some are input text fields, and others are textareas, some even use a currency component fields. Here are some examples of the fields:
<NumberFormat
    value={this.state.tax}
    displayType={'input'}
    isNumericString={true}
    thousandSeparator={true}
    decimalScale={2}
    prefix={'$'}
    className="phone validate"
    name="Sales Tax"
    disabled
/>

<div className={`${styles.singleField} ${styles.smallField}`}>

        Options

    <select name="OptionList" value={this.state.OptionList} className="phone validate" disabled>
        <option value="One">One</option>
        <option value="Two">Two</option>
        <option value="Three">Three</option>
    </select>

<div className={`${styles.singleField} ${styles.largeField}`}>

        Product

    <input
        value={this.state.product}
        type="text"
        className="phone validate"
        name="Detailed Description"
        maxLength={45}
        disabled
    />

I want to create a button that says edit form that will then remove all disabled tag from the form to allow the user to edit the form. Here is what I have. All of the fields have the className validation I'm hoping I can grab them by that.
<button onClick={this.editForm.bind(this)} className={styles.btn}>Edit Form</button>

    async editForm(event) {
        event.preventDefault();
        console.log('Trigger to edit form');

        //Code here to remove disabled attirubutes
    }

A: You'll want to use React's state management for this. I'm not sure if this is inside of a class component or a functional component but here's how you can achieve what you're looking for.
Also the React documentation covers State and Lifecycles I would recommend reading through these.
Class Component CodePen:
class YourComponent extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      inputsDisabled: true
    }
  }
  render() {
    return (
      ...yourcodehere
      <button onClick={() => this.setState({ inputsDisabled: false })}>Click Me</button>
      <input disabled={this.state.inputsDisabled} />
    )
  }
}

Functional Component:
const YourComponent = () => {
  const [inputsDisabled, setInputsDisabled] = React.useState(false)
    return (
      ...yourcodehere
      <button onClick={() => this.setState({ inputsDisabled: false })}>Click Me</button>
      <input disabled={inputsDisabled} />
    )
  }
}


text:
Q: Importing number into variable name in python First of all, i am somewhat new to python coding, so this might seem like a stupid question.
Problem: I am trying to create a script that allows me to import a number into (variable?operator?) names, in order to run my python script from a bash script.
Ideally i wanted to do the following (i know the syntax is wrong, but it is from my first try and captures what i would want it to do):
replica_number = 2 #2 is only for testing. It will later be exchanged with an imported number from a bash script over many different data sheets.
t_r+replica number = md.load(data_path+'potein_+replica_number+_centered.xtc', top = data_path+'potein_+replica_number+_first.gro')[1:]
What i want this to do is to automatically create the variables named t_r2 and import the files called protein_2_centered.xtc and protein_2_first.gro. However when i do this i get: SyntaxError: can't assign to operator
Does anyone know how to get around this problem, or do i just have to make a separate script for every replica?

A: What you need is either a list or a dictionary.
you can keep all your results in a list (without keeping the replica_number):
t_r_list = []
t_r_list.append(md.load(...)[1:]) #  Run this line for each t_r you want to load

or if you want to keep the replica_number, you can use a dict:
t_r_dict = {}
t_r_dict[replica_number] = md.load(...)[1:]

You might want to read a tutorial on these data structures and how to use them, it will greatly help you on your journey with python later on and is the basis of the basis when it comes to working with data in python.

A: when the name of the attributes or variables is dynamic, we can use, for example, the new way Python uses for fomat Strings (f'') and then the setattr method:
The settattr method is this, is part of the builtins library:
def setattr(x, y, v): # real signature unknown; restored from __doc__
     """ Sets the named attribute on the given object to the specified value."""

Here what you can do with variables
replica_number = 2
variable_name = f't_r{replica_number }'

and then check and set the aatribute:
 if not hasattr(YOUR_OBJECT, variable_name ):
            raise ValueError

setattr(YOUR_OBJECT, variable_name , THE_VALUE)

A: Use a dictionary for such kind of operations:
replica_number = md.load(...)[1:]
your_dict = {t_r : replica_number}

And access it through
your_dict[t_r]


text:
Q: Как в SSIS выдать данные в выходной буфер несколькими порциями? Есть legacy проект, сделанный на платформе SQL Server Integration Services. Он занимается загрузкой данных из стороннего источника в БД аналитического слоя. Протокол организован таким образом, что в случае неудачной загрузки из источника все эти же данные предлагаются к загрузке в следующий раз. Из-за ошибки со строкой подключения загрузка данных не работала год - и теперь для удержания всех выходных данных в памяти этой самой памяти не хватает.
Теперь вопрос: можно ли данные, подготовленные внутри Script Component, отправить наружу в несколько приемов, без накопления буферных гигабайт в памяти? Сейчас код компонента, если его упростить выглядит примерно так:
public override void CreateNewOutputRows()
{
  var datasource = Enumerable.Repeat(new { a = 5, b = 42 }, 2000000); // Для примера, на самом деле эти данные приходят по WCF
  foreach (var obj in datasource) {
    SomeNamedOutputBuffer.AddRow(); // Вот тут на одной из итераций заканчивается память
    SomeNamedOutputBuffer.A = obj.a;
    SomeNamedOutputBuffer.B = obj.b;
  }
  SomeNamedOutputBuffer.SetEndOfRowset();
}

A: Буфер в SSIS обрабатывается автоматически, и при нехватке памяти записывается на диск либо переходит к получателю сам, поэтому код в вопросе - рабочий.
Сообщение о нехватке памяти для буферов еще не означает что скрипт из-за нее и вылетел, а проблема - в другом месте.

К примеру, у меня проблема была в тайм-ауте из-за закрытого порта.

A: Script Source - сначала прочитает все данные, а затем долго будет их закидывать в буфер вывода. Уточнение - как пишет Microsoft про Source Component строки передаются следующему компоненту Data Flow при заполнении буфера, и это не связано с командой SetEndOfRowset.
Основной вопрос для вас - позволит ли WCF повторно прочитать данные, если в первый раз обработка упала. Если да - возможны следующие варианты:

*

*Предположим, что SSIS гигабайты таки прожует. У него есть собственный механизм своппинга буферов на диск, за счет значительного падения производительности. Я бы оценил объем данных, по опыту буфер SSIS - это объем данных * 1.2-1.5, и превышение своппинга над доступной памятью. Если превышение больше 10 раз - своппинг лучше не применять. Важно - на диске должно быть место для своппинга, по умолчанию это temp директория пользователя под которым работает пакет.

*Вытаскивать данные в script source частями. Может, ваш WCF это позволит, или выкачать данные и сохранить их в некотором виде на диск, а затем написать новый Script и читать их порциями.

Если WCF даст вам прочитать данные только 1 раз - то модификация 2 подхода выше - сохранить данные на диск, а затем читать.


text:
Q: xajax and codeigniter - blank page and xajax request URI error I am unfortunately getting a blank page when trying to run a site locally. There are other people running it locally just fine, so I am wondering if it could be something to do with my LAMP environment.
When I attempt to load the site, it's nothing but a blank page. I've ran php index.php in console and the error I get is the following "xajax Error: xajax failed to automatically identify your Request URI.Please set the Request URI explicitly when you instantiate the xajax object.". I'm not quite sure how to handle this in CodeIgniter and or at all to be honest.

A: I think it's a problem with LAMP configuration: check codeigniter folder permissions (add write permission to "logs" folder.

A: Thanks for your answer. I actually figured out what the problem was, it was like you said a problem with my LAMP configuration. Unfortunately XAMPP (which is what I am using and or was), the newest version uses PHP 5.3. Xajax doesn't support PHP 5.3 and this was causing the problems. After I went to an older version all was well!


text:
Q: What is actually the real meaning and significance of torque? If we have a rigid body translating with constant velocity v. not being acted upon by an external torque about a point O but having a net external torque about point P. Then will the body rotate ? Ofcourse the velocity with which it is translating may change.
What will happen if these forces are applied at centre if mass ?
What is the significance of torque actually we call it rotational analogue of force or a twist to the object but how as it is always with respect to a reference point ? Why was it defined this way what is the physical intuition behind it??

A:
What is the significance of torque actually we call it a rotational analogue of force or a twist to the object but how as it is always with respect to a reference point? Why was it defined this way what is the physical intuition behind it??

Torque has two forms really.

*

*One is the idea of a force couple (or pure torque $\vec{\tau}$) having no net force. This will cause rotation about the center of mass. If the center of mass moved it would have linear momentum, and this requires a net force to acquire. There is no point of application of pure torque. It is applied to the entire rigid body.

*The other is an equipollent torque, which represents a force at a distance. This is calculated by $\vec{M} = \vec{r} \times \vec{F}$. The line of action of the force is described by this torque vector. The location of the force is back-calculated by $\vec{r} = \frac{\vec{F} \times \vec{M}}{\| \vec{F} \|^2}$ (where $\times$ is the vector cross product).

*In reality both can be present making the torque applied on a point described as $\vec{M}_A =  \vec{M}_B + \vec{r}_{B/A} \times \vec{F}$.
The intuition here is that equipollent torque is a force at a distance, and a pure torque is a zero force at infinity.
This is enitirely analogous to motion where linear velocity $\vec{v}$ describes a rotation at some distance and a pure translation is equivalent to a body rotating about infinity with zero angular velocity. Remember what is the rule for finding the velocity of a point if we know the motion of another point $\vec{v}_A = \vec{v}_B + \vec{r}_{B/A} \times \vec{\omega}$.
This is the same law is with torques

If we have a rigid body translating with constant velocity $v$ not being acted upon by an external torque about a point O but having a net external torque about point P. Then will the body rotate?

*

*An applied torque does not have a point of application. In the case above the net torque will make the body accumulate angular momentum. The net torque about the center of mass equals the rate of change of angular momentum at the center of mass.

What will happen if these forces are applied at the center of mass ?

What forces? Your question talks about torques and not forces. In the absense of net forces linear momentun remains unchanged and the center of mass will continue to move with $\vec{v}$.
If the net torque about the center of mass is zero (line of action of forces through center of mass) then the body will translate. This means that every part of the body will have the same linear velocity and the angular velocity is zero.


text:
Q: Listview Selection HI,
I need to select a single item(cell) in a listview

A: You cannot select 'subitems' in a ListView.  If you want to be able to select 'cells', you'll have to use a gridview.

A: I developed a third-party component called Better ListView, that allows selecting sub-items with arrow keys.
It is also possible to label edit sub-items, use icons in them and such.
If you need to use sub-items as cells extensively, the grid-like controls are the best choice for you, since these are better designed for matrices, instead of lists.

A: If it isn't possible to select a single cell but it is possible to REFER to a single cell's value. The link below has an answer for that(getting of a value for a cell).
http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.selecteditems.aspx
     // Uses the SelectedItems property to retrieve and tally the price
     // of the selected menu items.

private void ListView1_SelectedIndexChanged_UsingItems(
    object sender, System.EventArgs e)
{

    ListView.SelectedListViewItemCollection breakfast =
        this.ListView1.SelectedItems;

    double price = 0.0;
    foreach ( ListViewItem item in breakfast )
    {
        price += Double.Parse(item.SubItems[1].Text);
    }

    // Output the price to TextBox1.
    TextBox1.Text = price.ToString();
}

A: The following code causes all the items in a list view to not be selected, then it causes item #2 to be selected. I'm sure you can easily adapt this code to your problem. By the way, list view items use zero-based indexing; therefore, item #2 is actually the third item in the list view.
        for (int i = 0; i < listView1.Items.Count; i++)
        {
            listView1.Items[i].Selected = false;
        }

        // select item #2
        listView1.Items[2].Selected = true;


text:
Q: Spring Service @Transactional doesn't rollback transaction Mybatis SqlSession The goal is to rollback all/any transactions in case of failure. But this doesn't work as expected.
We use Spring MVC + JMS + Service + Mybatis. In the logs, the JMS is set to rollback, but the row is inserted and not rollback. Would like to know what I'm missing or doing wrong?
The @Transactional tag was added recently. So not sure if it works as expected.
Code:
Service Class:
@Transactional(value = "transactionManager", propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class DataExchangeLogic implements DataExchangeService {

private DataExchDao dataExchDao;

...

    @Override
    public void save(DataExch dataExch) throws ValidationException {
        if (dataExch.getId() != null && dataExch.getId() > 0) {
            this.dataExchDao.update(dataExch);
        } else {
            //LOGGER.debug("in insert::");
            this.dataExchDao.create(dataExch);
            //Empty exception throw to test rollback
            throw new RuntimeException();
        }
    }
}

DAO:
public interface DataExchDaoMybatis
extends NotificationDao {

void create(DataExch dataExch);

}

Spring Context
<bean id="dataExchLogic"  class="com.abc.service.logic.DataExchLogic">
        <property name="dataExchDao" ref="dataExchDao" />
</bean>

EAR/WAR project Spring Context
<!-- Transaction Manager -->
    <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" />

<tx:annotation-driven transaction-manager="transactionManager" />

Logs:
[31mWARN [0;39m [36mo.s.j.l.DefaultMessageListenerContainer[0;39m # Setup of JMS message listener invoker failed for destination 'queue://REQUEST?priority=1&timeToLive=500000' - trying to recover. Cause: Transaction rolled back because it has been marked as rollback-only
org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:720)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:240)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1142)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
    at java.lang.Thread.run(Thread.java:745)
[34mINFO [0;39m [36mo.s.j.l.DefaultMessageListenerContainer[0;39m # Successfully refreshed JMS Connection
[39mDEBUG[0;39m [36mo.s.j.l.DefaultMessageListenerContainer[0;39m # Received message of type [class com.ibm.ws.sib.api.jms.impl.JmsTextMessageImpl] from consumer [com.ibm.ws.sib.api.jms.impl.JmsQueueReceiverImpl@6ca01c74] of transactional session [com.ibm.ws.sib.api.jms.impl.JmsQueueSessionImpl@3ac3b63]
Creating a new SqlSession
Registering transaction synchronization for SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@206ee277]
JDBC Connection [com.ibm.ws.rsadapter.jdbc.WSJdbcConnection@19b89f0c] will be managed by Spring
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create!selectKey[0;39m # ==>  Preparing: SELECT ID.NEXTVAL FROM DUAL
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create!selectKey[0;39m # ==> Parameters:
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create!selectKey[0;39m # <==      Total: 1
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create[0;39m # ==>  Preparing: INSERT INTO TABLE ( COL1, COL2, COL N) VALUES ( ?, CURRENT_TIMESTAMP, ?, ?, ?, ?, ?, ?)
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create[0;39m # ==> Parameters: 468(Integer), SYSTEM(String), 2017-03-01 00:00:00.0(Timestamp), 2017-03-16 00:00:00.0(Timestamp), true(Boolean), test 112(String), ALL(String)
[39mDEBUG[0;39m [36mg.c.i.q.d.m.N.create[0;39m # <==    Updates: 1
Releasing transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@206ee277]
Transaction synchronization deregistering SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@206ee277]
Transaction synchronization closing SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@206ee277]

EDIT 1:
Controller code:
@ResourceMapping(value = "addNewDEURL")
    public void addNewDE(@ModelAttribute(value = "dataObject") final DataExch dataExch,
                                   final BindingResult bindingResult, final ResourceResponse response) {
        if (!bindingResult.hasErrors()) {

            try {
                dataExchangeService.save(dataExch);
            } catch (final ValidationException e) {
                logger.error("A validation exception occurred.", e);
            }
        } else {
            logger.error(bindingResult.getAllErrors().get(0)
                .getDefaultMessage());
        }
    }

DAO changed:
public class DataExchDaoMybatis extends BaseDaoImpl implements DataExchDao {

public void create(DataExch dataExch) {
        doSimpleInsert("insertDE", dataExch);
    }
}

BaseDaoImpl:
public void doSimpleInsert(String queryId, Object o) {
        SqlSession sqlSession = sqlSessionFactory.openSession();
        sqlSession.insert(queryId, o);
}

A: Please put transactionManager configuration and tx:annotation-driven into root spring context

Rule: Root context can see all the beans which Spring created. Child context(any Web Context) can see only its own beans.
In this particular case tx:annotation-driven looks for beans with @Transactional annotation in Web context. It cannot find any because you defined dataExchLogic in root context. That's why you didn't have any transactional behavior.

@EnableTransactionManagement and  only looks for @Transactional on beans in the same application context they are defined in. This means that, if you put annotation driven configuration in a WebApplicationContext for a DispatcherServlet, it only checks for @Transactional beans in your controllers, and not your services. See Section 21.2, "The DispatcherServlet" for more information.

Solution implies to move tx:annotation-driven to the root context because Root Context can find any bean defined either in root or in any web context.

A: Quoting from spring documentation:

You can place the @Transactional annotation before an interface
  definition, a method on an interface, a class definition, or a public
  method on a class. However, the mere presence of the @Transactional
  annotation is not enough to activate the transactional behavior. The
  @Transactional annotation is simply metadata that can be consumed by
  some runtime infrastructure that is @Transactional-aware and that can
  use the metadata to configure the appropriate beans with transactional
  behavior. In the preceding example, the
  element switches on the transactional behavior.

Which means,
void create(DataExch dataExch);
should be
public void create(DataExch dataExch);
@Transactional annotation behavior is not exhibited if it is not applied on a public method.
EDIT:
Since my answer was downvoted, to support my answer and to shed some light on the transactional behavior when a Transactional annotated method calls a method without annotation, take a look at this:
@Transactional method calling another method without @Transactional anotation? specifically the answer by Arun P Johny

A: I think of two possibilities.
    1) Your DAO class is starting a new transaction.
    2) Your DAO class is not participating in the transaction.
I dont see any other reason why the data should be updated to the database. Can you add below property to log4j to see how many transactions are being started.
log4j.logger.org.springframework.transaction.interceptor = trace

Also syosut the below transaction status in Service and DAO method to see if the transaction is active.
TransactionSynchronizationManager.isActualTransactionActive()

Let us know what happens.


text:
Q: Adding percentage to a price field incl. currency code I'm trying to add 10% to a price field via javascript and so far i haven't been able to, and was hoping you guys would be able to help.
The field incl. currency code etc.
I did try something in this direction:

But that didn't work ;(
The price field shows up like the following.
48,300.00 ISK

After adding the 10% to the price, it should say in this example:
53,130.00 ISK

Any ideas are welcome, and i would really appreciate help on this matter as i do think it's fairly simple but i'm not very well into Javascripting.

A: var x = $("#cashamount").html(); // Fetching the value
var xSplit = x.split(" "); // Splitting the currency and ammount and storing it in array.

var intAmmt = +xSplit[0].replace(/,/g , ""); // Removing comma and Making it a integer
var newAmmt = intAmmt*1.1; // Incrementing by 10%
var y = newAmmt.toLocaleString() + " " + xSplit[1]; // Adding the currency sign with a space
$("#cashamount").html(y); // Setting the html;

So you can create a function for this:
function updateVal(elem){
    var x = elem.html(); // Fethching the value
    var xSplit = x.split(" "); // Splitting the currency and ammount and storing it in array.

    var intAmmt = +xSplit[0].replace(/,/g , ""); // Removing comma and Making it a integer
    var newAmmt = intAmmt*1.1; // Incrementing by 10%
    var y = newAmmt.toLocaleString() + " " + xSplit[1]; // Adding the currency sign with a space
    elem.html(y); // Setting the html;
}

and use it as:
$(document).ready(function(){
   updateVal($("#cashamount"))
});

A: First this: (solution below)

The .val() method is primarily used to get the values of form elements
  such as input, select and textarea. In the case of elements, the
  .val() method returns an array containing each selected option; if no
  option is selected, it returns null, jQuery docs
The .text() method cannot be used on form inputs or scripts. To set or
  get the text value of input or textarea elements, use the .val()
  method. To get the value of a script element, use the .html() method,
  jQuery docs

So, one solution would be next:
var Total = $("#cashamount");
var totalNumber = Number(Total.text().replace(/[^0-9\.]+/g,""));
Total.text((totalNumber * 1.1).toFixed(2));
//Add currency to this

Here's JsFiddle