text:
Q: Impressora de etiqueta Argox: A_Prn_Text - Variable Is Error Segue a função:
function  A_Prn_Text     ( x,y,ori,font,typee,hor_factor,ver_factor:integer;mode:char;numeric:integer;data:String):integer;stdcall;external 'WINPPLA.DLL';

Segue o código:
while not DMRetaguarda.QConItem.eof do
begin
  for i := 1 to strtoint(edit5.text) do
    begin
      A_Prn_Text(200, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 1, 29))));
      if length(dmretaguarda.qconitemdescricao.asstring) > 29 then
        A_Prn_Text(180, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 30, 29))));
      A_Prn_Text(175, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('____________________________________')));
      A_Prn_Text(150, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('MARCA: '+copy(dmretaguarda.qconitemmarca.asstring, 1, 30))));
      A_Prn_Text(130, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('MODELO: '+copy(dmretaguarda.qconitemmodelo.asstring, 1, 30))));
      A_Prn_Text(110, 360, 0, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString('REF.: '+copy(dmretaguarda.qconitemreferencia.asstring, 1, 35))));
      loc12 := dmretaguarda.qconitemlocal1.asstring;
      if dmretaguarda.qconitemlocal2.asstring <> '' then
        loc12 := loc12 + ' e '+dmretaguarda.qconitemlocal2.asstring;
      A_Prn_Text(85, 360, 0, 9, 5, 1, 1, 'n', 2, PWideCHar(AnsiString('LOCAL: '+loc12)));
      A_Prn_Text(20, 180, 0, 9, 6, 0, 1, 'n', 2, PWideCHar(AnsiString('COD.: '+copy(dmretaguarda.qconitemcodigo.asstring, 7, 7))));
      A_Prn_Barcode(10, 360, 0, 'E', 0, 0, 60, 'A', 1, PWideCHar(AnsiString(dmretaguarda.qconitemcodigo.asstring)));
      A_Print_Out(1, 1, 1, 1);
    end;
  DMRetaguarda.QConItem.next;
end;

Esse codigo deveria imprimir de acordo com as minhas coordenadas, que a partir da query que está rodando vai atribuir os valores que digitei no meu formulário, porém ele está dando esse erro logo na primeira linha:

Alguém poderia me dizer o que pode ser isso?

A: while not DMRetaguarda.QConItem.eof do
begin
  for i := 1 to strtoint(edit5.text) do
    begin
      A_Prn_Text(200, 360, 1, 9, 5, 1, 1, 'n', 2, PWideChar(AnsiString(copy(dmretaguarda.qconitemdescricao.asstring, 1, 29))));
      end;
end;

Segundo minha função acima que pesquisei bastante, o problema é que só é permitido 1,2,3 e 4.
Eu apenas mudei a numeração do ori, da função:
function  A_Prn_Text     ( x,y,ori,font,typee,hor_factor,ver_factor:integer;mode:char;numeric:integer;data:String):integer;stdcall;external 'WINPPLA.DLL';

e funcionou :D


text:
Q: Unable to connect to localhost on my development machine I'm configuring a new Web development machine using the very complete and well-written guide published by Echo Software but I cannot connect to localhost after following/checking every step. My only changes were using PHPv7.0 instead of 5.6, and disabling MySQL strict mode because some third-party software I need to run requires looser rules.
I can ping 127.0.0.1, localhost and *.dev domains successfully (all three commands return the exact same output):
$ ping -c1 127.0.0.1
$ ping -c1 localhost
$ ping -c1 test.dev
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.092 ms

--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss

However I still cannot connect to any of those over HTTP (same results when using Safari Chrome or Firefox):
$ curl http://localhost
curl: (7) Failed to connect to localhost port 80: Connection refused

I have asserted that Apache, PHP, and dnsMasq are all running by running brew services list, and that all are properly configured:
$ brew services list
Name    Status              Plist
dnsmasq started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
httpd22 started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.httpd22.plist
mysql   started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.mysql.plist
php70   started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.php70.plist
$ apachectl -v
Server version: Apache/2.2.31 (Unix)
$ apachectl -t
Syntax OK
$ php -v
PHP 7.0.10 (cli) (built: Aug 21 2016 19:14:33) ( NTS )

I don't see port 8080 listed when I run a port scan on 127.0.0.1, but as I understand it is autoforwarded by pf.
I have already:

*

*Checked my /etc/hosts file: it has not been tampered with.

*Disabled my firewall: no change whatsoever.

*Double-checked every step from the guide.

*Followed the same guide twice just months ago: both machines are now happy.

*Read every similar question/answer I could find, but none helped.

*Looked for output in the Apache and PHP log files: nothing there either.

*Run out of hypothesis...

Any help would be greatly welcome!

Edit: I also have rbenv and docker/docker-compose setup on the machine, I hope that it's not conflicting because I need them both as well.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Chained select only show second box if can be populated I have a chained select which works fine but not all the values in SELECT 1 result in values in SELECT 2 so I would like to hide SELECT 2 unless it has something to show.
I am using this for my JS:
<script type="text/javascript">
    $(document).ready(function() {
        $(".select1").change(function() {
            var id=$(this).val();
            var dataString = 'id='+ id;
            $.ajax ({
                type: "POST",
                url: "ajax_load.php",
                data: dataString,
                cache: false,
                success: function(html) {
                    $(".select2").html(html);
                }
            });
        });
    });
</script>

and then I have set my second select to display:none so how can I make it so the second select appears and disappears depending on the value in box 1?
Thanks

A: /** Whenever changes happens in Select 1 hide Select 2. show select 2only if it has value **/
 $(document).ready(function() {
            $(".select1").change(function() {
                var id=$(this).val();
                var dataString = 'id='+ id;
                $.ajax ({
                    type: "POST",
                    url: "ajax_load.php",
                    data: dataString,
                    cache: false,
                    success: function(html) {
                        $(".select2").show();
                        $(".select2").html(html);
                    },
                    error : function() { $(".select2").hide();  }
                });
                var select2Length = $('.select2> option').length;
                if(select2Length > 0)
                  $(".select2").hide();
                else
                  $(".select2").show()
            });
        });

A: Try this:
<script type="text/javascript">
    $(document).ready(function () {
        $(".select2").hide();
        $(".select1").change(function () {
            var id = $(this).val();
            var dataString = 'id=' + id;
            $.ajax({
                type: "POST",
                url: "ajax_load.php",
                data: dataString,
                cache: false,
                beforeSend: function () {
                    $(".select2").hide();
                }
                success: function (html) {
                    $(".select2").show();
                    $(".select2").html(html);
                   var length = $('.select2 > option').length;
                   if(length>0){
                       $(".select2").show();
                   }else{
                       $(".select2").hide();
                   }
                }
            });
        });
    });
</script>


text:
Q: Cypress FX3 CyU3PToolChainInit Understanding help I don't understand the purpose of the CyU3PToolChainInit function that is written in assembly source code for the FXE. As for as I know it clears the BSS area and enters the main function, but how is this function generated? What is a tool chain? I mean I understand it's everything from a compiler to a link but what initialize it in a micro controller?
SDK API Manual
Programmer's Manual

A: I have done deeper research into the matter and have concluded that the CyU3PToolChainInit is a pre-written function by Cypress and the BSS area is cleared in assembly before initializing the full OS simply for efficiency. Moreover, memory heap is set in this function prior to RTOS initialization in order to prevent the OS using memory that may otherwise be required.


text:
Q: significant difference in mineral concentration between chemical analysis and values declared on packaging? I want to find out whether there was any significant difference in mineral concentration between chemical analysis and values declared on packaging.
After carrying out Shapiro-Wilk tests to assess the normality of the data obtained in the lab, results indicted that data was both parametric and non-parametric. I have carried out a sample t test to assess the parametric data. However, what non-parametric test would be suitable to find whether there was any significant difference in mineral concentration between chemical analysis and reference values?


text:
Q: C# sqlConnection class not accepting connection string when passing argument connection string dynamically I have a Windows Forms application using SQL Server. I have a connection string config entry (of type string) inside the properties.settings.default which contains value
Data Source=17*.20*.1**.1\\SQLEXPRESS;Database=myDemoDB;User Id=sa;Password=somepassword

If I use
SqlConnection sqlCon = new SqlConnection(Properties.Settings.Default.connectionString);
sqlCon.open();

this will throw an exception that network instance error, go here to view the error screenshot
screenshot of exception.jpg
If I use the connection string directly as the SqlConnection argument like this:
SqlConnection sqlCon = new SqlConnection("Data Source=17*.20*.1**.1\\SQLEXPRESS;Database=myDemoDB;User Id=sa;Password=somepassword");
sqlCon.open();

it throws the same exception.
SqlConnection sqlCon = new SqlConnection(@"Data Source=17*.20*.1**.1\SQLEXPRESS;Database=myDemoDB;User Id=sa;Password=somepassword");
sqlCon.open();

is also throwing the same exception.
But the below code works fine and connecting to database! I wonder what goes wrong here!
string a = "Data Source=17*.20*.1**.1\\SQLEXPRESS;Database=myDemoDB;User Id=sa;Password=somepassword";

SqlConnection sqlCon = new SqlConnection(a);
sqlCon.open();

Can anyone help me fix this bug? Because the connection string I want to specify from a text file for dynamic changes.

A: Connection strings that you put in configuration file differ from connection strings that you put in "regular" string literals in that the strings from configuration file do not need to be escaped.
Remove the second slash from the string in your configuration file to fix the problem:
connectionString="Source=17*.20*.1**.1\SQLEXPRESS;Database=myDemoDB;User Id=sa;Password=somepassword"
//                                    ^

Note that "verbatim" string literals (i.e. ones with @ prefix) do not require escaping of backslashes, so the connection string would look the same in the config file and in the program.


text:
Q: Lightning - dynamically creating force:inputField With the release of Spring '16 there appear to be significant improvements to the force:inputField components especially for the lookup fields.
We are trying to use them in our application, but are having issues generating them dynamically. In our use case the user may define a set of fields that they want displayed for their form. This means we need to generate a list of inputs based on a dynamic set of fields.
Here is a statically defined example of how we can show the Custom_Acccount_Lookup__c field.
<aura:attribute name="contact" type="Contact" default="{ 'sobjectType': 'Contact' }"/>
<force:inputField value="{!v.contact.Custom_Account_Lookup__c}"/>

However how can we generate this same code if the field we want displayed was user defined? The code below obviously doesn't work, but is it possible to achieve this some other way? We have also tried to generate the component in the controller but run into similar issues when passing in the value.
<aura:attribute name="contact" type="Contact" default="{ 'sobjectType': 'Contact' }"/>
<aura:attribute name="fieldToShow" type="String" default="Custom_Account_Lookup__c"/>

<force:inputField value="{!v.contact[v.fieldToShow]}"/>

We are starting to suspect that there is some pre-processing of the component code before it renders. Upon code inspection the component actually generated is a force:inputLookup which is not one that we can create but apparently Salesforce uses to display the lookup field.

A: I received the response below from Salesforce support. It looks like it's not currently possible. The reference link is a good read, but doesn't help us build a force:inputLookup or any of the other field types.
This is very disappointing because it means we are now going to have to code our own force:inputLookup from scratch when there's already an implementation there that just isn't exposed for us to use.
If anyone finds an alternative please let me know.

From Salesforce Support:
Looks like Dynamic Field Binding is not fully available yet. However when looking into the Dynamic Field Names in Aura, I came across this reference below.
Reference Link : http://opfocus.com/blog/dynamic-field-binding-in-salesforce-lightning-experience/
Edit (3/4/2016):
I've also created this entry in IdeaExchange. Please upvote it to better bring this issue to Salesforce's attention.
https://success.salesforce.com/ideaView?id=08730000000E1UKAA0

A: Dynamic binding is not possible in that manner because that array[element] syntax is not supported in expressions.
However, you can create the component dynamically in the controller. For instance:
myArrayOfFields.forEach(function(field){
  $A.createComponent(
    "force:inputField",
    {
      "value" : cmp.getReference("v.myObject." + field)
    },
    function(newField, status, errorMessage){
      //Add the new button to the body array
      if (status === "SUCCESS") {
        var body = cmp.get("v.body");
        body.push(newField);
        cmp.set("v.body", body);
      }
    })
  );
});

Even better and easier would be to use lightning:inputField like so:
<lightning:recordEditForm aura:id="recordViewForm"
                          recordId="XXXX00000000000000"
                          objectApiName="My_Object__c">
  <lightning:messages />
  <aura:iteration value="{!v.myArrayOfFields}" var="field">
     <lightning:inputField fieldName="{!field}" />
  </aura:iteration>
</lightning:recordEditForm>

https://developer.salesforce.com/docs/component-library/bundle/lightning:inputField/documentation


text:
Q: Zend Layout Placeholder? I am trying to create a sidebar in my layout that has the behavior of a placeholder. I want to be able to define the contents of this placeholder once per controller. So every controller can add custom content to the sidebar but without the need to define it in any view.
I am kind of confused on how to go about that with Zend_Layout. Any help?

A: I have tried something similar. Here is what you can do.
Place this type of code in the layout.phtml script file. Somewhere near the top. You don't have to but this way you 'know' what placeholders you're using. Doing this in the layout is also a good idea because you can wrap html divs are whatever here and not worry about it in the views. The views can just worry about the content. After this, you can add content to the placeholders from the controllers and the views.

$this->placeholder('blah');
$this->placeholder('sidebar');
$this->placeholder('blunk');

If you don't want to create them in your layout, then you can do it in the controller like so,

$this->view->placeholder( 'sidebar');

.
Now, you can either put content into it in the controller, or in the view script. Its a better idea to add the content in the view though.
In the layout you can then just echo the placeholders like so

echo $this->placeholder->( 'sidebar' );

All the views are executed BEFORE the layout is executed so any placeholders created by the views will be available to the layout to print out.
Also, controllers don't HAVE placeholders. Only views, and by extension layout, have placeholders like this so you have to declare them somewhere. Even if you declare them in the controller they still 'belong' to the view object.
I don't know if this helps at all but good luck. Tell me what you think.

A: How about adding a postDispatch() call to each controller?
public function postDispatch()
{
    // code to populate/activate your placeholder
    $this->view->placeholder('xxx');
}

This function will be called after your action completes. For more info, see Pre- and Post-Dispatch Hooks.

A: i have just implemented a solution to this that should work for most uses.
I store all of my placeholder.phtml files in the following dir:
/views/scripts/_placeholder
Within the placeholder i create directories for each Controller / Action that has a placeholder (as well as ROOT stuff). I then create a file for each placeholder.
e.g. Placeholder = sidebar. Controller = user / action = view
for the above we would store a file here:
views/scripts/_placeholder/user/view/sidebar.phtml
note: within the sidebar.phtml you will need to add : $this->placeholder("sidebar")->captureStart() and captureEnd();
if the plugin sees this file it will render it. If it doesnt find one then it wont.
Additionally the plugin will also look for the following and pull that in first:
views/scripts/_placeholder/sidebar.phtml
I can post the plugin if you want.
The only issue i have is i would like to now know if a placeholder has any data in it. That way i can create some layouts that are clever and will render what needs. DOes anyone know how to do this?


text:
Q: Can't Connect to Minecraft Server Ubuntu 18.04 I've been having an issue lately with Minecraft on my Ubuntu 18.04 machine. When I try to login to a server, I get a message saying the auth servers are down. However, I can confirm from Mojang's website and from friends that can connect to server that they are not down and the error is client side.
I've tried all the following solutions, but none have worked thus far:
sudo /var/lib/dpkg/info/ca-certificates-java.postinst configure
sudo apt-get install ca-certificates-java
sudo dpkg --purge --force-depends ca-certificates-java
sudo apt-get install --reinstall ca-certificates-java
sudo update-ca-certificates -f

A: I had a similar issues.
The problem with all the fixes i found was that i installed Minecraft via snap. sudo snap install minecraft and because snaps are self contained the java on my machine did not effected it.
What fixed it for me was installing the old launcher instead.

*

*Remove snap version sudo snap remove minecraft

*completely remove java 10 ( If Installed )

*Install Minecraft Via curl Script

A: Fixed!
After extensive research, I found the solution.
Download the tar.gz archive for Java 8 on the Oracle website, go to /etc/ssl/certs/java and delete "cacerts", extract the files from the tar.gz archive, navigate to jre/lib/security and move the cacerts file to /etc/ssl/certs/java.


text:
Q: Output video file of ffmpeg command video and audio doesn't match i'm trying to trim a video file using ffmpeg using this command
ffmpeg -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output.mp4 . The problem is when i open the output video, the audio starts normally but the video appears only 5 seconds after. I tried removing the -c copy option and output is accurate but the process is very slow. So my question is how to make output video/audio match when using -c copy option, or how to make the process faster when not using -c copy option. It's my first time using this so i don't know much about video/audio encoding, i am just trying to extract a video clip from a php script.

A: Usually when audio is ahead of video the -async switch auto-corrects the start of the audio stream when passed as -async 1. So try running
ffmpeg -async 1 -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output.mp4


text:
Q: CSS Display Flex. I cant get it to work Okay I have 3 divs The outside div is a column. All 3 div heights are dynamically generated by its contents.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ipsum ex, gravida vitae erat nec, ultricies sollicitudin magna. Nulla facilisi. Nulla gravida congue viverra. Vivamus maximus lacus dolor, sit amet vestibulum orci maximus tristique. Nam non metus nisl. Mauris gravida magna sed dolor venenatis malesuada. Sed in rutrum erat. Sed dictum est neque, sit amet consequat dolor dictum eget. Fusce sit amet dolor orci. Curabitur tempus vel erat ac dictum. Proin vel congue velit. Nam venenatis erat neque, at convallis mauris eleifend ultrices. In hac habitasse platea dictumst

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ipsum ex, gravida vitae erat nec, ultricies sollicitudin magna.

I have applied inline CSS for display Flex. Im working in Firefox, however I do have the cross browser CSS, but im just focused on getting it working here in Firefox and understanding this first.
The goal of what im trying to accomplish here is to make text 2 the exact same height as text 1.
Im new to this whole flex thing, im fairly certain im doing this completely wrong, ive been reading articles for a few hours and everything I try doesnt work. So im assuming im understanding this all wrong.
Im not sure if it matters, but this is being done within wordpress. Also everything is floating left
I apologize if this is trivial but im at a loss, and Stackoverflow never fails me. Any help would be greatly appreciated.

A: You are not far from what you wanted to do. Please notice that I removed the white spaces from your class names as white spaces are the separator for multiple classes. .1 and .2 are invalid class names.
You should use flex-direction: row; as you want the layout to be horizontally arranged. I used the flex shorthand property to reach the desired result, which stand for flex-grow, flex-shrink and flex-basis.

.outer
{
  display: flex;
  flex-wrap: row nowrap;
}

.text1, .text2
{
  flex: 1 0;
}

.text1
{
  background-color: gray;
}

.text2
{
  background-color: darkgray;
}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ipsum ex, gravida vitae erat nec, ultricies sollicitudin magna. Nulla facilisi. Nulla gravida congue viverra. Vivamus maximus lacus dolor, sit amet vestibulum orci maximus tristique. Nam non metus nisl. Mauris gravida magna sed dolor venenatis malesuada. Sed in rutrum erat. Sed dictum est neque, sit amet consequat dolor dictum eget. Fusce sit amet dolor orci. Curabitur tempus vel erat ac dictum. Proin vel congue velit. Nam venenatis erat neque, at convallis mauris eleifend ultrices. In hac habitasse platea dictumst

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ipsum ex, gravida vitae erat nec, ultricies sollicitudin magna.

Also it is not necessary to use float on flex elements. But it should have no effect what so ever, as of the w3c:

float and clear do not create floating or clearance of flex item, and
  do not take it out-of-flow.


text:
Q: Compile c++ file using external library from linux terminal I have the following files:
ex1.cpp    ex1.h
GLee.cpp   GLee.h

and I want to make it use the library (openmesh library) on the following path:

home/xyz/Downloads/OpenMesh-2.3/src/OpenMesh/

I'm trying to execute it with this:
g++ -Wall -o ex1 ex1.cpp GLee.cpp -L/..path../

but no luck, output is:
In file included from ex1.cpp:17:0:
ex1.h:28:38: fatal error: OpenMesh/Core/IO/MeshIO.hh: No such file or directory
compilation terminated.
what is the correct way of doing this?
Thanks!

A: You need to put -I path on the command line. So from the error, it looks like you would do:
g++ -Wall -o ex1 ex1.cpp GLee.cpp -I /home/xyz/Downloads/OpenMesh-2.3/src


text:
Q: Implement setter from java interface as kotlin property I have simple getter and setter for a boolean field in Java interface:
public interface Interface1 {
    void setValue1(boolean value);
    boolean getValue1();
}

When trying to implement that as a property in a class in Kotlin:
class Class1: Interface1 {
    var value1 = false
}

I get the compilation error:
Class 'Class1' is not abstract and does not implement abstract member public abstract fun setValue1(value: Boolean): Unit defined in com.example.Interface1.
So only the getter is overridden. Is it possible to fix that without implementing the both getter and setter manually, without kotlin "sugar"?

A: https://youtrack.jetbrains.com/issue/KT-6653 says

This is a rather deep issue, unfortunately. It's unlikely that we'll ever make it work the way you'd like

and this stance doesn't seem to have changed since 2015.


text:
Q: Kotlin kapt: generating code through annotation processors: cannot find symbol (of generated classes) in stubs I have a module with annotation processor which generates quite lot of classes I use throughout the project.
I used that module in one of my projects, though it was hell to make it work properly, it works as expected - I run build, it generates classes and everything's fine.
In new project, I use the same module (just copied code), the same config etc. but if I run build, in stubs it replaces all my "to be generated classes" references as Class<Any>, and build fails.
Workaround is that I use kaptKotlin task separately:
it generates code, and than I have to build again (kapt again is run there but no errors thrown) and only than it works.
But even in kaptKotlin task I get lot's of e: cannot find symbol in generated stubs (though code is generated).
I think that while running that tasks those should be ignored or something.
How can I correct that behavior?
Or how can I make it work through single "build" task, so kapt would in stubs reference "to be generated code" correctly and not replacing with Class<Any>?
P.S. using latest versions of Kotlin. Tried correctErrorTypes = true - no success.


text:
Q: ASUS: "Winflash does not support this BIOS update." I'm trying to flash a new BIOS/UEFI firmware on my ASUS UX330UA. It currently has firmware version 300.
Easy Flash 3 (inside the current firmware)
Using EZ Flash 3 (booting to setup), I can browse the folders on my USB key, but cannot see any files. Why can I only see directories, but not files?
Windows
I have already removed and re-installed the latest ATK, and also installed the latest version of Winflash from the Driver and Tools tab under Support.
When I run Winflash, I get the following error:

How can I flash the most up-to-date BIOS/UEFI firmware?

A: It appears certain versions of EZ Flash will not display any filenames unless their extension is .CAP or .ROM.
The file that I downloaded was named:
UX330UAK-AS.302
I made two copies of this file, namely:
UX330UAK-AS302.ROM
UX330UAK-AS302.CAP

Both of these copied files with "correct" extensions were then shown in EZ Flash 3, and I could successfully update the firmware.
Interestingly, it seems this is an unlisted bug - the version of EZ Flash 3 in the new firmware that I flashed showed all files, regardless of extension.
Regarding updating via Windows, I can only assume that Winflash needs to be updated to support the UX330, which is newer than the filestamps on the latest version at the time of writing.


text:
Q: I want to solve this without changing a column name in the database table. Is there any way to solve this? SQLSTATE[42S22]: Column not found: 1054 Unknown column 'notices.notice_category_id' in 'where clause' (SQL: select * from notices where notices.notice_category_id = 1 and notices.notice_category_id is not null and notices.deleted_at is null)
This is notices table migration
 public function up()
    {
        Schema::create('notices', function (Blueprint $table) {
            $table->id();
            $table->text('subject');
            $table->integer('category_id');
            $table->date('date');
            $table->timestamps();
        });
    }

notice category table

 public function up()
    {
        Schema::create('notice_categories', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->timestamps();
        });
    }

model for noitceCategory
  public function notices()
    {
        return $this->hasMany(Notice::class);
    }

notice model
 public function noticeCategory()
    {
        return $this->belongsTo(NoticeCategory::class);
    }

And I am trying to count using following code
$noticecategory->notices->count();

``
tell me if any other information are required

A: In NoticeCategory model define foreign key for notice table
public function notices()
{
    return $this->hasMany(Notice::class,'category_id');
}

If you don't provide foreign key argument then laravel assumes that the model_name_id will be the foreign key for that relation


text:
Q: Menu sub-items not showing on mobile (understrap theme) I'm building a website using understrap-child theme.
I've got a navbar with a lot of items and sub-items (up to three levels). I've set the navbar depht to 0 since, according to the documentation, it should allow all the sub items to show in the menu.
<!-- The WordPress Menu goes here -->
                <?php wp_nav_menu(
                    array(
                        'theme_location'  => 'primary',
                        'container_class' => 'collapse navbar-collapse',
                        'container_id'    => 'navbarNavDropdown',
                        'menu_class'      => 'navbar-nav ml-auto',
                        'fallback_cb'     => '',
                        'menu_id'         => 'main-menu',
                        'depth'           => 0,
                        'walker'          => new Understrap_WP_Bootstrap_Navwalker(),
                    )
                ); ?>

It seems to be working fine on the desktop version, but once I switch to mobile, I am only able to see the first sub-items and not all those that come after that. E.g. ABOUT (first item) --> ABOUT US (sub item) --> OUR ALLIANCES (sub-sub-item). in the mobile version nothing shows after "ABOUT US". Is there a way to solve this problem?
Any suggestion would be really appreciated!
THANK YOU!

A: try to put depth => 2 instead of 0.
may be then your problem will be solved.


text:
Q: How do I unnest an array inside a function? create or replace function pd.check(
    interval_ text[])

returns void as

$BODY$
BEGIN

EXECUTE '
drop table if exists check_;
create temp table check_
as
(
    select unnest(' || interval_ || ')
) ;
';
END;
$BODY$
LANGUAGE PLPGSQL volatile;

I am running it as
select pd.check(ARRAY['2','3','4']);

It gives me an error :

operator is not unique: unknown || text[]
HINT:  Could not choose a best candidate operator. You may need to add explicit type casts.

A: Assuming current Postgres 9.6, your function would work like this:
CREATE OR REPLACE FUNCTION pd.check(interval_ text[])
  RETURNS void AS
$func$
BEGIN
   EXECUTE '
      DROP TABLE IF EXISTS pg_temp.check_;
      CREATE TEMP TABLE check_  AS
      SELECT unnest($1)'
   USING $1;                                -- pass as value
END
$func$  LANGUAGE plpgsql;

Notes

*

*You could concatenate the parameter value as string, but then you need an explicit type cast (since concatenating an untyped string literal and text[]  is ambiguous to Postgres, it might produce text or text[], hence the error!) and escape special characters to make it work. quote_literal() does both: quote_literal(interval_). Still, don't.
Instead, pass the parameter as value, not as string. That's faster and safer and avoids any such error as you show.
Note that $1 in the command string refers to the first expression provided by the USING clause, not to the function parameter. The 2nd instance of $1 actually refers to the function parameter (different scope!).

*Note, that this superior way of passing values to DML statements works here because it's part of the included SELECT statement, but not for other utility commands. Details:

*

*"ERROR: there is no parameter $1" in "EXECUTE .. USING ..;" statement in plpgsql

*drop table check_; in a function is dangerous. Obviously you want to target the temporary table. But if that should not exist, the next available table of the same name in the search_path would be dropped. Potentially catastrophic damage. To target the temp table and no other, schema-qualify with the pseudo-name pg_temp.

*CREATE TABLE AS does not require parentheses around a following SELECT command.

*VOLATILE  is the default (and correct for this function), I omitted the noise.
In this particular case you would not need dynamic SQL. See @klin's answer. But EXECUTE is still a good choice for queries that have nothing to gain from plan caching.

A: You do not need a dynamic SQL (execute):
create or replace function pd.check(interval_ text[])
returns void as
$body$
begin
    drop table if exists check_;
    create temp table check_
    as select unnest(interval_);
end;
$body$
language plpgsql volatile;

Test:
select pd.check(array['2','3','4']);
select * from check_;

 unnest
--------
 2
 3
 4
(3 rows)

A: This is similar to the other answer, but you really shouldn't be using RETURNS VOID; you should be returning a set from the function itself.
CREATE OR REPLACE FUNCTION pd.check(
  intervals_ TEXT[] )
RETURNS TABLE ( pd_interval TEXT )
$f$
BEGIN
  RETURN QUERY SELECT UNNEST(intervals_);
END;
$f$ LANGUAGE plpgsql IMMUTABLE;

postgres=# select * from pd_check(ARRAY['1','2','3']);
 pd_interval
-------------
 1
 2
 3
(3 rows)

Other changes I made:

*

*You shouldn't name a column after a different data type than the column itself, hence changing interval_ to intervals_.

*The function is actually IMMUTABLE, not VOLATILE, as-is.


text:
Q: Is there a way to search document contents using a Unity Lens in 14.04 Trusty? In trusty 14.04, the out-of-the-box install gives you a Unity file and folder search which provides relevance-based search for recently used files (through Zeitgeist) augmented with entire filesystem search (through mlocate).
However, as far as I can tell, there is no full-text search available for all documents on the filesystem. The existing Unity search lens does not do full-text search of document contents; rather, only the document names themselves. There was a lens called "recoll-lens" which leveraged Recoll to do a full text search which was packaged up through 12.04 Precise (as other answers mentioned back in 2011, here, here), but there is no official backport of recoll-lens packaged for 14.04.
Does anyone know of a repository which contains recoll-lens for 14.04, or if there are any other full-text search Unity lenses which work for 14.04?
(While I realize that 14.04 is not the last stable point release, it is the last stable LTS release as of the moment that I'm asking this question (10/2015), and the Ubuntu installs that I manage are on a LTS-only policy for stability).

A: OK, so after more sleuthing, I've found that the recoll-lens package was renamed to unity-scope-recoll.
So, by running:
sudo add-apt-repository ppa:recoll-backports/recoll-1.15-on
sudo apt-get update
sudo apt-get install recoll unity-scope-recoll

As an aside:
I like to have my file content search results kept up to date with changes immediately(with an SSD drive this isn't a big performance issue), so I configured recoll to index immediately and to start up the indexer when I log in:
Recoll real time indexing screenshot


text:
Q: PHP elseif issue I'm trying to add col-lg-6 to one of the Divs when no content is being displayed for name3 and name4, but it keeps showing as col-lg-4.
<?php
$name3 = get_field('name3', $post->ID);
$name4 = get_field('name4', $post->ID);
?>

<?php if ($name3 == "" || $name4 == ""): ?>

    <?php elseif ($name3 == "" && $name4 == ""): ?>

        <?php else: ?>

            <?php endif; ?>

I've looked on here and other sites but I just can't figure it out. I know it's probably going to be something stupid and simple but I really need to sort this out now.

A: Currently when your second if could be valid, it goes anyway to the first one. To resolve it, swap their order.
Change :
<?php if($name3 == "" || $name4 == ""): ?>

<?php elseif($name3 == "" && $name4 == ""): ?>

<?php else: ?>

<?php endif; ?>

To :
<?php if($name3 == "" && $name4 == ""): ?>

<?php elseif($name3 == "" || $name4 == ""): ?>

<?php else: ?>

<?php endif; ?>

A: Simply reverse order of checks:
// if both are empty
<?php if($name3 == "" && $name4 == ""): ?>

// if one of them is empty
<?php elseif($name3 == "" || $name4 == ""): ?>

<?php else: ?>

<?php endif; ?>

otherwise first if () is true when one of variables is empty and if both are empty
also you can just change || (or) operator to xor operator in your first if ()


text:
Q: About canonical factors for Weierstass infinite products. I was reading the proof of below theorem (p.145 complex analysis Elias M.Stein):
 Given any sequence $\{a_n\}$ of complex numbers whit $|a_n| \to \infty $ as $n \to \infty $, there exists an entire function $f$ that vanishes at all $z=a_n$ and nowhere else.
 In the proof writer introduces canonical factors of degree k as: $E_k(z) = (1-z)e^{z+\frac{z^2}{2}+ \ldots +\frac{z^k}{k}}$ .
 My question: What is canonical about these factors?

A: In the proof of the theorem, we use products of $E_k(z\cdot z_k^{-1})$, where the $z_k$ are the prescribed zeros. So we want a function $E_k$ which is $0$ at $1$, which explains why the factor $1-z$ appears. Indeed, if we can find a function which vanishes at $1$, it will be possible for any point.
But we also want convergence of the product $\prod_kE_k(z\cdot z_k^{-1})$ (with different indexes if we want other multiplicities), so we have to find a function $f_k(z)$ in order to make $E_k(z)=(1-z)f_k(z)$ near $1$ as $k\to +\infty$. When $z$ is real, we have that $f_k$ is the exponential of the partial sum of order $k$ of the series of $-\log(1-z)$.
Actually, in order to ensure the convergence, we have use the result $|1-E_k(z)|\leqslant |z|^{k+1}$ when $|z|\leqslant 1$.


text:
Q: Using pickle to store cookies in a selenium browser session. Gmail opens with the intended account logged in, but account not showing up in googleauth I am using selenium undetected chrome for automating certain tasks. I need to log into multiple websites where I have signed up using my google account, so I want to login to my google account once and then use that account to login to other websites through "login with google" option.
This is the script I wrote to save cookies from google:
import pickle
import undetected_chromedriver as uc
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

if __name__ == '__main__':
    email = "MY_EMAIL"
    password = "MY_PASSWORD"

    browser = uc.Chrome(
        options=options,
    )
    browser.get('https://accounts.google.com/signin/v2/)

    browser.find_element(By.ID, 'identifierId').send_keys(email)

    browser.find_element(
        By.CSS_SELECTOR, '#identifierNext > div > button > span').click()

    password_selector = "#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input"

    WebDriverWait(browser, 50).until(
        EC.visibility_of_element_located((By.CSS_SELECTOR, password_selector)))

    browser.find_element(
        By.CSS_SELECTOR, password_selector).send_keys(password)

    browser.find_element(
        By.CSS_SELECTOR, '#passwordNext > div > button > span').click()

    time.sleep(50)

    cookies = browser.get_cookies()

    pickle.dump(cookies, open("cookies.pkl", "wb"))

Now to use the saved cookies:
import pickle
import undetected_chromedriver as uc
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time

if __name__ == '__main__':

    browser = uc.Chrome()
    browser.get('https://accounts.google.com/signin/v2')

    cookies = pickle.load(open("cookies.pkl", "rb"))

    for cookie in cookies:
        cookie['domain'] = ".google.com"

        try:
            browser.add_cookie(cookie)
        except Exception as e:
            print(e)

    #browser.get('https://mail.google.com/mail/u/0/#inbox')
    browser.get('https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2f')

    google_login = WebDriverWait(browser, 5000).until(
        EC.presence_of_element_located(( By.CLASS_NAME, 's-btn__google' ))
    )

    google_login.click()

    time.sleep(120)

Now, when I open gmail using browser.get('https://mail.google.com/mail/u/0/#inbox') it opens with my account already logged in, but any other website which uses google sign in option doesn't show my account logged in.
What do I need to do to make my account visible in google sign in option?
Thank you for your time...


text:
Q: Надо ли избавляться от всех ретурнов в node-js? Здравствуйте, я тут дипломную работу на ноджс пишу и возник такой вопрос: по идее всё должно быть неблокирующее, и функции должны вызываться исключительно по коллбэкам, или по событиям, но есть такие маленькие функции, типа посчитать сумму массива (условно), которые выполняются очень быстро и ради них не хочется распиливать одну большую, красивую, логичную функцию на цепочку коллбэков. Так и вот: можно ли такие функции маленькие оставлять с ретурнами, и ждать от них ответа, как буд-то они типа инлайновые?
A: Могу посоветовать погуглить про словам "Node.js is a cancer". Была такая провокационная статья, после которой все кинулись писать сервера для вычисления чисел Фибоначчи, мериться результатами и рассуждать, что правильнее. Вот, например https://github.com/glenjamin/node-fib
Если я правильно понял идею, суть в том, что при интенсивном потоке тяжелых (математических) запросов время, потраченное на вычисление ответа, становится не так уж важно. Все равно ответ вы будете вычислять долго. Гораздо важнее, чтобы клиенты получали ответ через одно и то же время, и именно для этого нужно использовать много асинхронных вызовов.


text:
Q: Docker namespaces preventing sqlite3 database access I have mouthful comments running inside a Docker container with namespaces enabled.
Mouthful loads on my web page, but I cannot post comments. In the Docker log I get the following error message as well as a 500 error in the dev tools console.
attempt to write a readonly database
[GIN] 2018/12/16 - 11:57:23 | 500 |    1.956915ms |        10.0.0.0 | POST     /v1/comments

Inside the mouthful container with namespaces enabled, I notice the config.json and database file are set as nobody user.
/app # ls -la /app/data
total 40
drwxr-xr-x    2 nobody   nobody        4096 Dec 15 21:48 .
drwxr-xr-x    1 root     root          4096 Aug 27 16:25 ..
-rw-r--r--    1 nobody   nobody        1460 Dec 16 11:55 config.json
-rw-r--r--    1 nobody   nobody       24576 Dec 15 21:48 mouthful.db

If I run mouthful with namespaces disabled (using --userns=host) mouthful runs OK and I am able to post comments.
Inside the container with namespaces disabled the files permissions are set as root.
/app # ls -la /app/data
total 40
drwxr-xr-x    2 root     root          4096 Dec 16 12:20 .
drwxr-xr-x    1 123000   123000        4096 Aug 27 16:25 ..
-rw-r--r--    1 root     root          1460 Dec 16 12:18 config.json
-rw-r--r--    1 root     root         24576 Dec 16 12:20 mouthful.db

The problem with this is the process on the host is also set as root.
ps au | grep [b]in/sh
root      8420  0.5  0.0   1560   516 pts/0    Ss+  12:24   0:00 /bin/sh

I believe this to be a security risk because it makes it easier for someone to gain root access to the host.

So, how can I get sqlite3 to work with Mouthful comments with Docker namespaces enabled?


text:
Q: HQL with case, sum e max I have a query that is giving problem, I believe the problem occurs because it does not allow to use the max function, inside the max function, am I correct?
How can I get around this? I need to add all values except for the last row.
The query:
"SELECT new project.domain.vo.MediaPagVo(" +
                    "a.nomeUsuario, " +
                    "a.cpfUsuario, " +
                    "a.cnpjUnidadeUsuario,        " +
                    "a.nomeUnidadeUsuario,        " +
                    "a.codigoGrupoUsuario,        " +
                    "a.grupo.id AS idGrupo,         " +
                    "CASE " +
                        "WHEN MAX(a.pre) - MIN(a.pre) > 0 " +
                        "THEN ((MAX(a.pre) - MIN(a.pre)) / SUM(CASE WHEN max(a.dtRequisicao) > a.dtRequisicao THEN a.valorTotal ELSE 0 END)) " +
                        "ELSE ((MAX(a.pos) - MIN(a.pos)) / SUM(CASE WHEN max(a.dtRequisicao) >= a.dtRequisicao THEN a.valorTotal ELSE 0 END)) " +
                    "END AS mediaConsumo, " +
                    "CASE " +
                        "WHEN MAX(a.pre) - MIN(a.pre) > 0 " +
                        "THEN " + Tipo.PRE.getValue() + " " +
                        "ELSE " + Tipo.POS.getValue() + " " +
                    "END AS tipoPag) " +
            "FROM " +
                    " Pagamento a " +
            "WHERE " +
                    "a.status = " + StatusPagamento.Concluido.getValue() + " AND " +
                    "a.dataRequisicao BETWEEN :inicio and :fim AND " +
                    "( :idGrupo IS NULL OR a.grupo.id = :idGrupo) " +
                   "GROUP BY " +
                    " a.nomeUsuario, a.cpfUsuario, a.cnpjUnidadeUsuario, a.nomeUnidadeUsuario, a.codigoGrupoUsuario, a.grupo.id, " +
            "HAVING (MAX(a.pos) - MIN(a.pos) > 0 OR MAX(a.pre) - MIN(a.pre) > 0) AND " +
                    "( :tipoConsumo IS NULL OR " +
                        ":tipoConsumo = " + Tipo.PRE.getValue() + " AND " +
                        "(MAX(a.pre) - MIN(a.pre) > 0) " +
                        "OR :tipoConsumo = " + Tipo.POS.getValue() + " AND " +
                        "(MAX(a.pos) - MIN(a.pos) > 0) ) ";

The error began to occur after I modified this section, adding the case inside the sum:
"CASE WHEN MAX(a.pre) - MIN(a.pre) > 0 " +
                        "THEN ((MAX(a.pre) - MIN(a.pre)) / SUM(CASE WHEN max(a.dtRequisicao) > a.dtRequisicao THEN a.valorTotal ELSE 0 END)) " +
                        "ELSE ((MAX(a.pos) - MIN(a.pos)) / SUM(CASE WHEN max(a.dtRequisicao) >= a.dtRequisicao THEN a.valorTotal ELSE 0 END)) " +
                    "END AS mediaPag, "

The error returned by java:
Could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
ORA-00937: not a single-group group function tips
My goal was to add up all the payments for that period, minus the last. Unfortunately, I could not just move the filter, since max (a.pre), max (a.pos) may be the last payment. Does anyone have any ideas?

A: Maybe it is also worth asking how to refactor this query. Is performance a problem? I mean instead of running one query you would run several smaller ones would the system be very slow.
For ex. get MIN MAX(a.pre) in a separate query, do the SUM(CASE WHEN in Java code and pass these values as parameters.
If you decide to refactor, it would be safe to first add some tests to see the behaviour of the old query with certain values. Then do the refactoring. And finally, re-run the tests you added to check that you didn't add any bug.


text:
Q: Receive File via SFTP/SSH and automatically forward to FTP on another server I'm currently in a situation where I receive flat files via FTP from my clients.  A couple of clients have insisted on the need to use SSH Private Key SFTP rather than regular FTP.
What I want to do is setup a web server (preferably in linux/unix but I guess I can do it on a windows server and purchase SFTP server software) that will do the following:

*

*Allow me to setup an SFTP directory for each client with unique user/pass.  Each directory also has to have the public/private key SSH "stuff" I'm a little new to this but I've googled it.

*Once the file is completely uploaded by the client, I want to kick off an event that ftp's that file via regular FTP to my Windows cloud.

*These files can be up to 10mb so the even that ftp's to the other server can't fire until the file is completely uploaded.
Has anyone set something like this up?  Any guidance would be appreciated.
Thanks!

A: In Linux, you can use incron to monitor the directory the files will be SFTP'd to and have it trigger your ftp job. It's kind of like cron except that instead of triggering jobs based on time, it does so based on filesystem modifications. In order to only trigger once the entire file has been written, I think you can use IN_CLOSE_WRITE in the inotify mask. Failing this, I suggest configuring events for each of the events individually to echo a message to a log file and see if you can identify one which reliably happens only at the end of the SFTP transfer.
If you're using RedHat, it's not in the standard distribution, but it is in EPEL.

A: On Windows you could use Titan FTP Server Enterprise Edition, which supports SFTP as well as allows you to define various types of events. When the event is triggered, you could kick off anything you need on a per folder/per account basis.
PS. AFAIK, when it comes to SFTP it is either password authentication or public key authentication (SSH key), but not both.

A: In your UNIX server, you can configure SSH to use a custom sftp server that instead of handling SFTP protocol itself, opens a new SSH connection to to the Windows SFTP server using password authentication and forwards the SFTP traffic there.
Writting the proxy is easy with the right tools, for instance, in Perl using the Net::OpenSSH module:
#!/usr/bin/perl
# this is the sftp-proxy-server

use Net::OpenSSH;
my $ssh = Net::OpenSSH->new($windows_server, $user, $passwd);
$ssh->system({ssh_opts => '-s'}, 'sftp');
$ssh->error and die $ssh->error;

You can instruct the SSH server to use that alternative SFTP server changing the configuration in /etc/ssh/sshd_config. For instance:
Subsystem sftp /usr/local/bin/sftp-proxy-server

A: Did you try apache FTP Serveur ?
I think you can do what you need with the ftplet API.
see :
http://mina.apache.org/ftpserver-project/index.html


text:
Q: Issues when compiling iOS 5 app with Google Analytics/GANTracker When trying to install Google Analytics and compile my iOS 5 project, i get the below error message:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_GANTracker", referenced from:
objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

and the code won't compile.
My build target is iOS 5, I'm linking the below libraries:
- libsqlite3.dylib
- libz.dylib
- libGoogleAnalytics.a
- CFNetwork
- and GANTracker.h
and putting:
#import "GANTracker.h"
#define kGANAccountId @"UA-XXXXXXX-X"
static const NSInteger kGANDispatchPeriodSec = 10;
@implementation AppDelegate
@synthesize window = _window;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[GANTracker sharedTracker] startTrackerWithAccountID:kGANAccountId
                                       dispatchPeriod:kGANDispatchPeriodSec
                                             delegate:nil];

NSError *error;
if (![[GANTracker sharedTracker] setCustomVariableAtIndex:1
                                                     name:@"iPhone1"
                                                    value:@"iv1"
                                                withError:&error]) {
    // Handle error here
}

if (![[GANTracker sharedTracker] trackEvent:@"my_category"
                                     action:@"my_action"
                                      label:@"my_label"
                                      value:-1
                                  withError:&error]) {
    // Handle error here
}

if (![[GANTracker sharedTracker] trackPageview:@"/app_entry_point"
                                     withError:&error]) {
    // Handle error here
}

Any I've followed everything in: http://code.google.com/mobile/articles/analytics_end_to_end.html
Am I missing a library or framework?
I'm using Xcode version 4.3.1

A: If you're still wondering what caused your issue, most likely your libGoogleAnalytics library is only compiled for one architecture (ARM) and not i386 (for simulator).
So how can one figure out which architectures are part of the binary? For this purpose otool can be used, e.g. the following command (on terminal):
otool libGoogleAnalytics.a -f
Gives me the following output (please note: I created a fat binary of the Google Analytics library myself):
Fat headers
fat_magic 0xcafebabe
nfat_arch 3
architecture 0
    cputype 7
    cpusubtype 3
    capabilities 0x0
    offset 68
    size 243208
    align 2^2 (4)
architecture 1
    cputype 12
    cpusubtype 6
    capabilities 0x0
    offset 243276
    size 231504
    align 2^2 (4)
architecture 2
    cputype 12
    cpusubtype 9
    capabilities 0x0
    offset 474780
    size 229552
    align 2^2 (4)
Archive : libGoogleAnalytics.a (architecture i386)
Archive : libGoogleAnalytics.a (architecture armv6)
Archive : libGoogleAnalytics.a (architecture armv7)

In the last 3 lines the supported architectures are shown. You can create your own "fat" binaries using the lipo command-line tool.

A: If GANTracker missing from your compile sources? Go to your project settings, then the build target of your application, then the build phases and make sure all of your dependencies are present in the appropriate sections.

A: I had the same problem and solved it by adding everything you added and also adding libGoogleAnalytics_NoThumb.a which you didn't mention. I found it here:
http://code.google.com/apis/analytics/docs/mobile/download.html

A: Just make sure that the CFNetwork.framework is listed under "Link Binary With Libraries" In your current target's "Build Phases".
That solved my problem.


text:
Q: Copiar un worksheet de un archivo de excel a otro Hola buenos días tengo el siguiente código.
from openpyxl import load_workbook
from openpyxl import Workbook

wP =load_workbook(r'C:\Users\Arrontec\Desktop\Automatizacion\Request1_2.xlsx')
wB =load_workbook(r'C:\Users\Arrontec\Desktop\Automatizacion\Request1_1.xlsx')

wPs = wP.get_sheet_by_name('Sheet1')
wBs = wB.get_sheet_by_name('here')

counter = 0
new_rows = []
for rrow in wPs.iter_rows():
    new_rows.append([])
    for cell in rrow:
        new_rows[counter].append(cell.value)
    counter +=1
for wrow in new_rows:
    wBs.append(wrow)

wB.save('Request1_1.xlsx')

Pero en este caso, al usar append lo agrega al final, como podría agregarlo al inicio del archivo.
Agredeceria muchísimo la ayuda, o alguna idea que me podrían dar. Llevo algún tiempo con este problema.

A: Antes de editar la pregunta lo que querias era copiar los datos de una hoja a otra, sustituyendo las celdas correspondientes y dejando el resto sin modificar (una especie de actualización de parte de una hoja con datos de otra). Si sigues queriendo hacer esto puedes hacerlo iterando sobre cada celda de la hoja origen y sustituyendo el valor de la celda correspondiente en la hoja destino usando las coordenadas de cada celda de origen:
from openpyxl import load_workbook

wP =load_workbook(r'C:\Users\Arrontec\Desktop\Automatizacion\Request1_2.xlsx')
wB =load_workbook(r'C:\Users\Arrontec\Desktop\Automatizacion\Request1_1.xlsx')

wPs = wP.get_sheet_by_name('Sheet1')
wBs = wB.get_sheet_by_name('here')

for rrow in wPs.iter_rows():
    for cell in rrow:
        wBs[cell.coordinate] = cell.value

wB.save('Request1_1a.xlsx')


text:
Q: ECharts from Baidu Does anyone know of an Echarts (http://echarts.baidu.com) example that:

*

*Only uses english characters

*Correctly imports all the necessary includes from a local directory structure

*Works

All the Echarts examples are presented very nicely but there are no examples that show how to deploy and run it locally (in English) that (and this is rather important) actually work.
From my many 'copy and paste' then edit efforts I just get endless file not found messages and mysterious characters all over the place (to be fair they are Chinese characters but I only see them as mysterious squiggles). I've also downloaded the github sampes and searched Google but with no success.
The library looks absolutely brilliant but I can't decipher it :(
A single .jsp page example in English (that works) would be great. Anyone know where I can find one?
Thanks

A: There is an example in their github that clearly explain the way of using the chart
i just test it, it's working very well
echart Example on github
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>ECharts</title>

A: Just incase devs are still looking for the english version of echarts, the cdn link below has links to the english version:
https://cdnjs.com/libraries/echarts
Works fine for me.

A: ECharts does offer an English version of their site, including examples and documentation, which I am guessing you did not see based on your question.
https://ecomfe.github.io/echarts/index-en.html
(At the time of this edit, they need to update their english docs to the 3.0 version of echarts).
https://ecomfe.github.io/echarts/doc/example-en.html
That being said, there are still times when you wish the entire .js and its default strings were in English, but Google Translate can help there.

A: If anyone is wondering. Someone did translate their entire .js to english, so that the buttons and controls appear in English. This guy also requested them to merge his 'English' version to master on github, but I guess they aren't interested yet.
I have tested his js file and it is in English. The link to the zip file is also included there. But just in case it can be found here - Download
https://github.com/ecomfe/echarts/issues/2321

A: I know there is already an accepted answer, but I thought I would add a link for people reading this question.
The new version of the echarts documentation (echarts 3.4.0 as of writing this) has been converted into english.
They have all the documentation including options, the api code, downloads, and many examples all in english (with a codepen type development area that you can test out your options and see the results in real time).
The entry page can be found here:
https://ecomfe.github.io/echarts-doc/public/en/
The library can be downloaded here:
https://ecomfe.github.io/echarts-doc/public/en/download.html
The getting started tutorial can be found here:
ecomfe.github.io/echarts-doc/public/en/tutorial.html
The multitude of options can be found here:
ecomfe.github.io/echarts-doc/public/en/option.html
A plethora of examples can be found here:
ecomfe.github.io/echarts-examples/public/index.html
An simple bar chart example and their codepen playground can be found here:
ecomfe.github.io/echarts-examples/public/editor.html?c=bar-tick-align
Below I have pasted their simple bar chart into the window for your viewing pleasure:

<!DOCTYPE html>

A: Here is an example that simply works. Just save it into an HTML file and render it into your browser. No need to download or configure anything else. It uses a remote script file, and no Chinese text:

<!doctype html>

     <title>ECharts Sample</title>

A: The data is displayed in Chinese,Code structure and framework in English.Ignore the specific data,try to put some data what you want to show.
demon in english:
http://echarts.baidu.com/echarts2/doc/example-en.html

A: If someone is using echarts-for-react, here is how I solved it
toolbox: {
  show: true,
  orient: 'vertical',
  feature: {
    dataView: { show: true, title: 'Data View', readOnly: false },
    restore: { show: true, title: 'Reset' },
    saveAsImage: { show: true, title: "Download" }
  },
}

the magic lies in the toolbox.feature.title


text:
Q: Build for Ionic project hangs in Visual studio Im using Visual Studio 2017 and starter menu template from Ionic. When i try to build the project (to deploy it to device or run in simulator for example) build process hangs. The green bar for build just keeps scrolling but nothing happens. Task Runner Explorer window shows that ionic-app-scripts build task finished.
Im running Visual Studio as Administrator on high end workstation, so im not quite sure what can be the problem. I also deleted all files from temp folder regarding visual studio, but that did not help.
I tried building for android and windows configurations.

Has anyone else ever experienced this kind of problem, or have any guides on what to try on next?

A: I found out what the problem was. It seems that ionic build task does not notify properly VS that it is finished, so VS build is waiting for it forever. I excluded that ionic build task from build process and run it manually before VS Build and everything works ok now.


text:
Q: Gaussian Processes with noisy observations In Gaussian Processes Regression, for noisy observations, noise are added to the diagnoal of covariance matrix (like the Equation 2.20: http://www.gaussianprocess.org/gpml/chapters/RW2.pdf), or expressed with a Kronecker delta.
How to understand this assumption?

A: Good question!
One way of think of this is based on kernels and how to combine them. Kernels are the frameworks we use to describe how observations are related to one another, hence are used to build the kernel in the first place, and a good description of them is in Chapter 4 of the book you are reading.
The Kernel Cookbook by David Duvenaud explains the effect of adding two kernels together via addition (he even gives pictures, yay!). Effectively when we add too kernels together we say that they both influence the relationships between observations but independently of one another. So we can ask what is adding a scalar multiplicand of the identity in terms of a kernel?
The answer - it says that each observation is completely independent of all others and there is a variance equal to the diagonal entries of the kernel, so in short each observation has i.i.d. gaussian noise associated with it!


text:
Q: Validation in a layered application I'm wondering what's the best way to do validation of database constraints (e.g. UNIQUE) in a ASP.NET MVC application, build with DDD in mind, where the underlying layers are Application Layer (application services), Domain Layer (domain model) and Infrastructure Layer (persistance logic, logging, etc.).
I've been looking through lots of DDD samples, but what many of them doesn't mention is how to do validation in the repository (I suppose that this is where this type of validation fits). If you know of any samples doing this, please share them it will be much appreciated.
More specific, I have two questions. How would you perform the actual validation? Would you explicitly check if a customer name already exists by querying the database, or would you try inserting it directly in the database and catching the error if any (seems messy)? I prefer the first one, and if choosing this, should it be done in the repository, or should it be the job of a application service?
When the error is detected, how would you pass it to ASP.NET MVC so the user can be informed nicely about the error? Preferably using the ModelStateDictionary so the error is easily highlighted on the form.
In the N-Lyered app by Microsoft Spain, they use the IValidatableObject interface and the most simple property validation is placed on the entity itself, such as:
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
    var validationResults = new List<ValidationResult>();

    if (String.IsNullOrWhiteSpace(this.FirstName))
        validationResults.Add(new ValidationResult(Messages.validation_CustomerFirstNameCannotBeNull, new string[] { "FirstName" }));

    return validationResults;
}

Before the entity is persisted, the Validate message is called to ensure that the properties are valid:
void SaveCustomer(Customer customer)
{
    var validator = EntityValidatorFactory.CreateValidator();

    if (validator.IsValid(customer)) //if customer is valid
    {
        _customerRepository.Add(customer);
        _customerRepository.UnitOfWork.Commit();
    }
    else
        throw new ApplicationValidationErrorsException(validator.GetInvalidMessages<Customer>(customer));
}

The ApplicationValidationErrorsException can then be catched in the MVC application and the validation error messages can be parsed and inserted into the ModelStateDictionary.
I could add all the validation logic into the SaveCustomer method, e.g. querying the database checking if a customer already exists using a given column (the UNIQUE one).
Maybe this is okay, but I would rather that the validator.IsValid (or something similar) would do this for me, or that validation is performed once again in the Infrastructure layer (if it belongs here, im not sure).
What do you think? How do you do it? I'm very interesting in gaining more insight into different validation techniques in layered applications.

Possible solution #1
In the case where the validation logic can't be done in the presentation layer (like Iulian Margarintescu suggests) and needs to be done in the service layer, how would you pass validation errors up to the presentation layer?
Microsoft has a suggestion here (see listing 5). What do you think about that approach?

A: You mention DDD, yet there is a lot more to DDD than entities and repositories. I assume you are familiar with Mr Eric Evans's book Domain Driven Design and i would strongly suggest you re-read the chapters about strategic design and bounded contexts. Also Mr Evans has a very nice talk called "What i've learned about DDD since the book" that you can find here. Talks about SOA, CQRS and event sourcing from Greg Young or Udi Dahan also contain a lot of information about DDD and applying DDD. I must warn you that you might discover things that will change the way you think about applying DDD.
Now for your question about validation - One approach might be to query the db (using an Ajax call that is directed to an app service) as soon as the user types something in the "name" field and try to suggest an alternative name if the one he entered already exists. When the user submits the form, try to insert the record in the db and handle any duplicate key exception (at the repository or app service level) . Since you are already checking for duplicates ahead of time the cases where you get an exception should be fairly rare so any decent "We are sorry, please retry" message should do since, unless you have A LOT of users they will probably never see it.
This post from Udi Dahan also has some information on approaching validation. Remember that this might be a constraint you are imposing on the business instead of a constraint that the business imposes on you - Maybe it provides more value for the business to allow customers with the same name to register, instead of rejecting them.
Also remember that DDD is a lot more about business than it is about technology. You can do DDD and deploy your app as a single assembly. Layers of client code on top of services on top of entities on top of repositories on top of databases have been abused so many times in the name of "good" design, without any reasons for why it is a good design.
I'm not sure this will answer your question(s) but i hope it will guide you to find the answers yourself.

A:
I'm wondering what's the best way to do validation of database constraints (e.g. UNIQUE)
and if choosing this, should it be done in the repository, or should it be the job of a application service?

It depends on what you are validating.
If it's an aggregate root creation you are trying to validate - then there is nothing more global than app itself that "holds" it. In this case, I apply validation directly in repository.
If it's an entity, it lives in aggregate root context. In this case I'm validating entity uniqueness in aggregate root itself against all the other entities in this particular aggregate root. Same goes for value objects in entities/roots.
P.s. repository is a service. Do not look at services as universal store for necessary but hard to name properly code. Naming matters. The same goes with names like "Helpers", "Managers", "Common", "Utilities", etc. - they are pretty much meaningless.
Also - you don't need to pollute your code base with pattern names: AllProducts > ProductRepository; OrderRegistrator > OrderService; order.isCompleted > IsOrderCompletedSpecification.IsSatisfiedBy.

More specific, I have two questions. How would you perform the actual validation? Would you explicitly check if a customer name already exists by querying the database, or would you try inserting it directly in the database and catching the error if any (seems messy)?

I would query the database. Although, if high performance is a concern and customer name availability is only thing that database should enforce - I would go with relying on database (1 less round trip).

When the error is detected, how would you pass it to ASP.NET MVC so the user can be informed nicely about the error? Preferably using the ModelStateDictionary so the error is easily highlighted on the form.

Usually it is not a good idea to use exceptions for controlling flow of application, but, since I want to enforce UI to show only available things that can be done, I'm just throwing exception in case validation fails. In UI layer, there's a handler that neatly picks it up and spits out in html.
Also - it is important to understand what is the scope of command (e.g. product ordering command might check 2 things - if customer ain't debtor and if product is in store). If command has multiple associated validations, those should be coupled together so UI would receive them simultaneously. Otherwise it would lead to annoying user experience (going through multiple errors while trying to order that damn product over and over again).


text:
Q: Programmatic formatting for Mathematica code - possible? It seems to be both an interesting programming challenge and a very useful practical application to have a Mathematica program which would allow one to pretty-print Mathematica code, so that it is easy to read and understand. Some of the desirable features of such a program:

*

*Works both on string and box level

*Covers many or most common cases for Mathematica code

*Is robust

*Is customizable

*Is extensible

Is this possible?

A: Update November 3, 2013
Finally, the formatter has been made much more robust by adding a custom function like MakeBoxes, names CodeFormatterMakeBoxes, to construct simplified box representation. This solves the main problem that the formatter does not currently support many boxes, since CodeFormatterMakeBoxes constructs the pure RowBox-based representation.
Also, added functions CodeFormatterPrint which prints definitions for a given function / symbol, and CodeFormatterSpelunk to make system spelunking easier.
Some things to try:
Import["https://raw.github.com/lshifr/CodeFormatter/master/CodeFormatter.m"]

and then
CodeFormatterPrint[RunThrough]

CodeFormatterSpelunk[RunThrough]

Basically, the difference is only that CodeFormatterPrint does retain long (fully-qualified) symbol names, while CodeFormatterSpelunk does not. Some more details on spelunking in my answer here.
Update 19th of June, 2013
Code formatter has been extended to support spaces in place of tabs, variable - width tabs and an overall offset.
This made it possible finally to start using it for code formatting here on SE - check this out!
Also, several other improvements and several bugs fixed.

Short answer
Yes.
Code formatter
While I will be most happy to see other answers to this question, and will hope that there will be better answers than this one, I am also glad to announce the alpha version of the Mathematica code formatter, which I was working on for some time.
The project
The code formatter lives here, and the specific file (package) can be downloaded using
this link. The code fomatter resides in a package CodeFormatter.m, and has currently two public functions: FullCodeFormat and FullCodeFormatCompact. Both take a piece of code converted to boxes, and return the box form of formatted code. The README file in the project contains the brief description of how to use them, and the  notebook which is included in the project contains many more examples.
Stealing from README, the typical way to use this is to define a helper function like this one:
prn = CellPrint[Cell[BoxData[#], "Input"]] &

and then, use it like:
prn@FullCodeFormat@MakeBoxes@
   Module[{a, b}, a = 1; Block[{c, d}, c = a + 1; d = b + 2]; b]

Screenshots
These are some screenshots of code pieces processed by FullCodeFormat.

Further plans/development
There are a number of things I plan to add to the formatter and /or develop based on it, such as

*

*Develop the palette to paste code to SE, based on the formatter (this will come out very soon)

*Support more boxes

*Refactor the code to eliminate the code duplication and better separate the DSL layer

*Add more ways to format code

I will start accepting pull requests soon, perhaps after I do the main code refactoring I currently plan. Meanwhile, please do fork me on GitHub if you are interested in playing with this.
Comments, suggestions, bug reports
All welcome. For bug reports, I have not decided yet what would be the best place to put them, but the Issues section on GitHub project repository seems appropriate.
A simplified bare-bones code formatting engine
Here, I will try to explain my approach, and provide a minimal functioning code-formatting "engine", which is a simplified version of the one I referred to above. The motivation for this section (and in fact, for placing the entire post here rather than on meta for example), is to make the code of the formatter accessible, and explain it in simple terms. This would allow you to fork the project and modify the formatter easier to suit your needs, should you wish to do so.
Design problems and choices
The main idea here is that while parsed expression is a bit too high-level for the formatting purposes, plus tries to evaluate all the time, the box-level is a bit too low-level, and the formatter based on that has a danger of not being robust.
Therefore, I take the box input, and create an intermediate inert Mathematica expression representation with preprocess and preformat (see below). The formatting procedure itself has two stages: the format proper - which only decides where to put new lines and tabs, and the tabification stage (tabify), which "executes" the tabification instructions given by format at the previous stage.
This architecture is because there is a certain impedance mismatch between the statement "I want to move this block of several lines of code one or more tabs to the right", and the actual way to achieve that with boxes (I suspect, this was one of the major obstacles for implementing code formatter - since I am sure, many people tried that). By separation of these two stages, it was possible to make this tabification abstraction reasonably robust. The final stage is post-formatting (postformat). It takes the result produced by format and tabify, and converts that back to boxes.
By using this 3-layer architecture, I am able to make high-level description of the actual formatting rules, in the definitions of format only, and the rest is taken care of by other layers. This makes the formatter both more robust (because, for example, the tabification engine is rather general and does not depend on specific formatting rules, including those I may wish to add later), and more easily extensible. In a sense, I implemented a very small DSL for code formatting.
Settings and preprocessing
Now, the code. First comes the only setting we will have here:
$maxLineLength = 70;

this defines the maximal length of line of code, and is used by the formatter to decide which long lines need dissection.
Next comes the pre-processing function, which serves to remove spaces and tabs possibly existing in the box expression:
ClearAll[preprocess];
preprocess[boxes_] :=
  boxes //.
      {RowBox[{("\t" | "\n") .., expr___}] :> expr} //.
      {
        s_String /; StringMatchQ[s, Whitespace] :> Sequence[],
            RowBox[{r_RowBox}] :> r
      };

Converting boxes to intermediate inert representation
Now, we will define the heads of our inert intermediate representation, to which we want to transform the original box expression:
ClearAll[$blocks, blockQ];
$blocks = {
   CompoundExpressionBlock, GeneralHeadBlock, GeneralBlock,
   StatementBlock, NewlineBlock, FinalTabBlock, GeneralSplitHeadBlock,
   SuppressedCompoundExpressionBlock, CommaSeparatedGeneralBlock
};

blockQ[block_Symbol] :=    MemberQ[$blocks, block];

The following function will translate the box expression into this intermediate language. It is very simplistic and misses many important cases - a more comprehensive one is in the code of the CodeFormatter` - but it illustrates the general structure. Note that is is recursive, moving from outside to inside.
ClearAll[preformat];

preformat[RowBox[elems : {PatternSequence[_, ";"] ..}]] :=
  SuppressedCompoundExpressionBlock @@ Map[
      Map[preformat, StatementBlock @@ DeleteCases[#, ";"]] &,
      Split[elems, # =!= ";" &]];

preformat[RowBox[elems : {PatternSequence[_, ";"] .., _}]] :=
  CompoundExpressionBlock @@ Map[
      Map[preformat, StatementBlock @@ DeleteCases[#, ";"]] &,
      Split[elems, # =!= ";" &]];

preformat[RowBox[elems : {PatternSequence[_, ","] .., _}]] :=
  CommaSeparatedGeneralBlock @@
    Map[preformat, DeleteCases[elems, ","]];

preformat[RowBox[elems_List]] /; ! FreeQ[elems, "\n" | "\t", 1] :=
  preformat[RowBox[DeleteCases[elems, "\n" | "\t"]]];

preformat[RowBox[{head_, "[", elems___, "]"}]] :=
  GeneralHeadBlock[preformat@head,
    Sequence @@ Map[preformat, {elems}]];

preformat[RowBox[elems_List]] :=
  GeneralBlock @@ Map[preformat, elems];

preformat[block_?blockQ[args_]] :=
  block @@ Map[preformat, {args}];

preformat[a_?AtomQ] := a;

preformat[expr_] :=
    Throw[{$Failed, expr}, preformat];

You can see that it treats only  few selected heads like CompoundExpression separately, plus has rules for general heads.
Formatting
Next will come two helper functions, used in formatting to determine whether or not a given line of code is too long and needs to be split. The first one, maxLen, determines the maximal length of the code line in an expression, accounting for the fact that it may already have been split into several lines.
Clear[maxLen];
maxLen[boxes : _RowBox ] :=
  Max@Replace[
      Split[Append[Cases[boxes, s_String, Infinity], "\n"], # =!= "\n" &],
      {s___, ("\t" | " ") ..., "\n"} :>
        Total[{s} /. {"\t" -> 4, ss_ :> StringLength[ss]}],
      {1}];

maxLen[expr_] :=
  With[ {boxes = postformat@expr},
       maxLen[boxes] /; MatchQ[boxes, _RowBox ]
   ];

maxLen[expr_] :=
  Throw[{$Failed, expr}, maxLen];

Note that maxLen uses not yet defined postformat, which is perhaps a bit stronger coupling between components than desirable, and is a design short-cut to be removed. The next one is a simple convenience function:
ClearAll[needSplitQ];
needSplitQ[expr_, currentTab_] :=
  maxLen[expr] > $maxLineLength - currentTab;

Now comes the main formatting function, format. All specific formatting rules are included here. It takes an intermediate inert expression as a first argument, and the current number of tabs inserted, as a second one. It is also essentially recursive, and processing an expression from outside to inside.
ClearAll[format];
format[expr_] :=  format[expr, 0];

format[TabBlock[expr_], currentTab_] :=
  TabBlock[format[expr, currentTab + 4]];

format[NewlineBlock[expr_, flag_], currentTab_] :=
  NewlineBlock[format[expr, currentTab], flag];

format[(ce : (CompoundExpressionBlock |
    SuppressedCompoundExpressionBlock))[elems__],
    currentTab_] :=
  With[ {formatted = Map[format[#, currentTab] &, {elems}]},
       (ce @@ Map[NewlineBlock[#, False] &, formatted]) /;
         !FreeQ[formatted, NewlineBlock]
  ];

format[StatementBlock[el_], currentTab_] :=
    StatementBlock[format[el, currentTab]];

format[expr : GeneralHeadBlock[head_, elems___], currentTab_] :=
  With[ {splitQ = needSplitQ[expr, currentTab]},
       GeneralSplitHeadBlock[
           format[head, currentTab],
           Sequence @@ Map[
               format[If[ splitQ,
                             TabBlock@NewlineBlock[#, False],
                             #
                         ],
                   currentTab] &,
               {elems}]] /; splitQ
   ];

(* For a generic block, it is not obvious that we have to tab, so we don't*)
format[expr : (block_?blockQ[elems___]), currentTab_] :=
  With[ {splitQ = needSplitQ[expr, currentTab]},
       block @@ Map[
           format[If[ splitQ,
                         NewlineBlock[#, False],
                         #
                     ], currentTab] &,
           {elems}]
   ];

format[a_?AtomQ, _] := a;

You can see that format uses two new block types: NewlineBlock and TabBlock, and the former also accepts a flag which can be True or False. This flag, when being set to True, forces the formatter to create a new line, while when being set to False, tells the formatter to propagate the new line request deeper into the expression. The TabBlock directive also accepts a similar flag. The reason that the flags are needed in this approach is that it is not straightforward to implement the abstraction such as "move this piece of code one tab to the right" on the box level, for example because each new line in the boxes must be tabbed separately.
In any case, format does only part of the job, because it only instructs what must be done. It has a companion, tabify, which actually executes the instructions of format:
ClearAll[tabify];
tabify[expr_] /; ! FreeQ[expr, TabBlock[_]] :=
    tabify[expr //. TabBlock[sub_] :> TabBlock[sub, True]];

tabify[(block_?blockQ /; ! MemberQ[{TabBlock, FinalTabBlock}, block])[
elems___]] :=
    block @@ Map[tabify, {elems}];

tabify[TabBlock[FinalTabBlock[el_, flag_], tflag_]] :=
  FinalTabBlock[tabify[TabBlock[el, tflag]], flag];

tabify[TabBlock[NewlineBlock[el_, flag_], _]] :=
  tabify[NewlineBlock[TabBlock[el, True], flag]];

tabify[TabBlock[t_TabBlock, flag_]] :=
  tabify[TabBlock[tabify[t], flag]];

tabify[TabBlock[(block_?blockQ /; ! MemberQ[{TabBlock}, block])[
     elems___], flag_]] :=
  FinalTabBlock[
    block @@ Map[tabify@TabBlock[#, False] &, {elems}],
    flag];

tabify[TabBlock[a_?AtomQ, flag_]] :=
  FinalTabBlock[a, flag];

tabify[expr_] :=  expr;

You can see that it introduces another tab-related block, FinalTabBlock - which is a block that signifies the need to tab a particular line by one tab, and is inert in the sense that once TabBlock is converted to FinalTabBlock, it does not any more actively influence the work of tabify.
Post-formatting
The final stage of the formatting procedure is to take the  expression  processed with format and tabify. We need one helper function which serves to prevent the addition of several new lines ("gaps" in the formatted code) , by determining whether or not the next line of code starts with a new line (if so, the NewlineBlock directive around it is ignored):
ClearAll[isNextNewline];
isNextNewline[_NewlineBlock] := True;

isNextNewline[block : (_?blockQ | TabBlock)[fst_, ___]] :=
  isNextNewline[fst];

isNextNewline[_] := False;

Here is finally the code for the inverse converter from the inert intermediate representation to boxes, postformat:
ClearAll[postformat];
postformat[GeneralBlock[elems__]] :=
  RowBox[postformat /@ {elems}];

postformat[CompoundExpressionBlock[elems__]] :=
  RowBox[Riffle[postformat /@ {elems}, ";"]];

postformat[SuppressedCompoundExpressionBlock[elems__]] :=
  RowBox[Append[Riffle[postformat /@ {elems}, ";"], ";"]];

postformat[GeneralHeadBlock[head_, elems___]] :=
  RowBox[{postformat@head, "[",
      Sequence @@ Riffle[postformat /@ {elems}, ","], "]"}];

postformat[GeneralSplitHeadBlock[head_, elems___]] :=
  With[ {formattedElems = postformat /@ {elems}},
       RowBox[{postformat@head, "[",
           Sequence @@ Riffle[Most[formattedElems], ","],
           Last[formattedElems], "]"}]
   ];

postformat[GeneralBlock[elems___]] :=
  RowBox[Riffle[postformat /@ {elems}, ","]];

postformat[StatementBlock[elem_]] :=
  postformat[elem];

postformat[NewlineBlock[elem_?isNextNewline, False]] :=
  postformat@elem;

postformat[CommaSeparatedGeneralBlock[elems__]] :=
  RowBox[Riffle[postformat /@ {elems}, ","]];

postformat[NewlineBlock[elem_, _]] :=
  RowBox[{"\n", postformat@elem}];

postformat[FinalTabBlock[expr_, True]] :=
  RowBox[{"\t", postformat@expr}];

postformat[FinalTabBlock[expr_, False]] :=
  postformat@expr;

postformat[a_?AtomQ] :=  a;

postformat[arg_] :=
  Throw[{$Failed, arg}, postformat];

It is also necessarily recursive, and the code should be pretty much self-documenting.
The final function
The function which brings it all together is very simple:
ClearAll[fullCodeFormat];
fullCodeFormat[boxes_] :=
  postformat@tabify@format@preformat@preprocess@boxes;

Examples and limitations
This very simplified version of the formatter is quite limited. However, it can handle a few not so trivial examples. Here is a rather non-trivial one to try:
prn@fullCodeFormat@MakeBoxes[
   Compile[{{data, _Real, 2}},
     Module[{means = Table[0., {maxIndex}], num = Table[0, {maxIndex}],
        ctr = 0, i = 0, index = 0, resultIndices = Table[0, {maxIndex}],
          indexHash = Table[0, {maxIndex}]},
      Do[index = IntegerPart[data[[i, 2]]];
       means[[index]] += data[[i, 1]];
       num[[index]]++;
       If[indexHash[[index]] == 0, indexHash[[index]] = 1;
       resultIndices[[++ctr]] = index];, {i, Length[data]}];
       resultIndices = Take[resultIndices, ctr];
       Transpose[{resultIndices,
       means[[resultIndices]] + num[[resultIndices]]}]],(*Module*)
       CompilationTarget -> "C", RuntimeOptions -> "Speed"]]

here is a screenshot of what you should see as a result (prn is defined as prn = CellPrint[Cell[BoxData[#], "Input"]] &):

Because of the way the final function is written, it is very easy to inspect what is happening in the intermediate stages. For example, you can only apply
format@preformat@preprocess@boxes

to see what format is doing.
This simplified formatter has a number of limitations, so don't expect it to work nicely on code involving e.g. function definitions through SetDelayed, some complex patterns, etc. The real code formatter in the CodeFormatter` package, while having the same core, has a number of additional rules to handle more cases.

A: It is worth mentioning GeneralUtilities`PrintDefinitions.
Use it like <<GeneralUtilities` then GeneralUtilities`PrintDefinitions@f to get a pretty-printed, formatted version of ??f in a new notebook (with pink background).
The function returns a handle to the created notebook. One should be able to programmatically extract the plain formatted code from there.

A: t = CreateTemporary[];
Save[t, mySymbol];
Import[t, "Text"]

applies some basic formatting to the definitions immediately and indirectly associated with mySymbol.


text:
Q: panic: runtime error: index out of range when building docker image with terraform-provider-docker in github action runner I am building docker images using Terraform's terraform-provider-docker in a giuhub hosted ubuntu runner.
This is the terraform configuration that builds the docker images:
resource "docker_registry_image" "images" {
  count = length(local.docker_images)

  name          = "${aws_ecr_repository.registries[count.index].repository_url}:${local.docker_registries[count.index].version}"
  keep_remotely = false

  build {
    context    = "${local.docker_images[count.index].context}:${replace(local.docker_image_build_trigger, "-", "")}"
    build_args = local.docker_images[count.index].build_args
  }

  depends_on = [aws_ecr_repository.registries, aws_secretsmanager_secret_version.secrets]
}

It was working until suddenly didn't. The previous change was unrelated to docker and now the provider is not responsing and throws this error:
Stack trace from the terraform-provider-docker_v***.***.0 plugin:

panic: runtime error: index out of range [5***] with length 5***

goroutine ***3 [running]:
github.com***terraform-providers***terraform-provider-docker***internal***provider.buildDockerRegistryImage({0xfbeca0, 0xc00007f***0}, 0xc000036780?, 0x***d?, {0xc000036780, 0x***d})
    github.com***terraform-providers***terraform-provider-docker***internal***provider***resource_docker_registry_image_funcs.go:***56 +0x***3
github.com***terraform-providers***terraform-provider-docker***internal***provider.resourceDockerRegistryImageCreate({0xfbeca0, 0xc00007f***0}, 0x0?, {0xce5***0?, 0xc0003c***f60})
    github.com***terraform-providers***terraform-provider-docker***internal***provider***resource_docker_registry_image_funcs.go:*** +0x***be
github.com***hashicorp***terraform-plugin-sdk***v***helper***schema.(*Resource).create(0xc000***3***8c0, {0xfbecd8, 0xc000***7a***70}, 0xd?, {0xce5***0, 0xc0003c***f60})
    github.com***hashicorp***terraform-plugin-sdk***v***@v***.***.0***helper***schema***resource.go:707 +0x***e
github.com***hashicorp***terraform-plugin-sdk***v***helper***schema.(*Resource).Apply(0xc000***3***8c0, {0xfbecd8, 0xc000***7a***70}, 0xc0003***c***70, 0xc000***7d***00, {0xce5***0, 0xc0003c***f60})
    github.com***hashicorp***terraform-plugin-sdk***v***@v***.***.0***helper***schema***resource.go:837 +0xa7a
github.com***hashicorp***terraform-plugin-sdk***v***helper***schema.(*GRPCProviderServer).ApplyResourceChange(0xc00000dda0, {0xfbecd8?, 0xc000***7a***50?}, 0xc000***30d***0)
    github.com***hashicorp***terraform-plugin-sdk***v***@v***.***.0***helper***schema***grpc_provider.go:***0*** +0xe3c
github.com***hashicorp***terraform-plugin-go***tfprotov5***tf5server.(*server).ApplyResourceChange(0xc000***8***d***0, {0xfbecd8?, 0xc00035b6***0?}, 0xc0005***05b0)
    github.com***hashicorp***terraform-plugin-go@v0.***.0***tfprotov5***tf5server***server.go:8***8 +0x57***
github.com***hashicorp***terraform-plugin-go***tfprotov5***internal***tfplugin5._Provider_ApplyResourceChange_Handler({0xe***e***80?, 0xc000***8***d***0}, {0xfbecd8, 0xc00035b6***0}, 0xc0005***05***0, 0x0)
    github.com***hashicorp***terraform-plugin-go@v0.***.0***tfprotov5***internal***tfplugin5***tfplugin5_grpc.pb.go:385 +0x***70
google.golang.org***grpc.(*Server).processUnaryRPC(0xc000000***e0, {0xfc***e90, 0xc000370***a0}, 0xc000***de360, 0xc00035b***0, 0x***55***d***0, 0x0)
    google.golang.org***grpc@v***.***8.0***server.go:***95 +0xb0b
google.golang.org***grpc.(*Server).handleStream(0xc000000***e0, {0xfc***e90, 0xc000370***a0}, 0xc000***de360, 0x0)
    google.golang.org***grpc@v***.***8.0***server.go:***636 +0xa***b
google.golang.org***grpc.(*Server).serveStreams.func***.***()
    google.golang.org***grpc@v***.***8.0***server.go:93*** +0x98
created by google.golang.org***grpc.(*Server).serveStreams.func***
    google.golang.org***grpc@v***.***8.0***server.go:930 +0x***8a

Error: The terraform-provider-docker_v***.***.0 plugin crashed!

I also tried to delete all the images and recreate the ECR registries but still getting this error.
Is it some sort of rate limit in the github action?

A: I think the issue is the context value after the path to the folder: "...:${replace(local.docker_image_build_trigger, "-", "")}". But I don't understand, it was working before.
I moved the trigger in the build_args and it seems working.


text:
Q: Only one image mouseover not working I have one mouseover on my website which is not working. the rest of them work fine. I am using the same codes for each and I am totally baffled why only one doesn't work. Can anyone help? Check my source code here: http://www.alanatashjian.com/gallery_index.html (it's the "gallery" button on the right side that is not mousing over correctly).
or here's the code for the head:

here's a successful mouseover example:

and here's my unsuccessful mouseover:

A: Hello just copy paste this code to your file

Telling you what was the problem your have two img tags with same id see

button_gallery

its in a gallery and links both so it will not work i just change button_gallery to button_gallery
If you have same id in two images then it will not work just change gallery anchor tag


text:
Q: What's the meaning of doing an && operation on two different operands one pointer to node and other an int type? I was going through a ques in which two nodes of a BST are swapped.We need to find that two nodes and swap it again to gain the original BST(http://www.geeksforgeeks.org/fix-two-swapped-nodes-of-bst/)
    While going through the code,in function correctBSTUtil()
if (*prev && root->data < (*prev)->data)

I can't figure out what's the meaning of doing an && operation on two different operands one pointer to node and other an int type
and when this condition will become true or false(an example will be helpful).
I tried to search but couldn't find much more about this.
Thanks for your suggestions!!!

A: It's a shorthand for
if (*prev != nullptr && root->data < (*prev)->data)

Note that prev seems to be a pointer to a pointer.

A: < operator takes precedence over && operator. (c language operator precedence)
if (*prev && root->data < (*prev)->data)

means
if (*prev && (root->data < (*prev)->data))

not
if ((*prev && root->data) < (*prev)->data)

So the code is doing logical and operation between *prev and root->data < (*prev)->data.
Also, 0 or NULL is considered as false in c language.
Since the code applies -> operator on *prev, prev seems to be a pointer to pointer, resulting in *prev being a pointer. It may be NULL, in which case it will be evaluated as false in conditional expression.
Note also that *prev must be the left side of && in this case so that if *prev is NULL the if condition is false already and the program won't evaluate root->data < (*prev)->data at all, preventing segmentation fault of trying to dereference a NULL pointer.


text:
Q: Unable to automate (AutoIT) in Ruby because of Watir error I've tried a few times now to run a Watir browser and then use the AutoIt ruby library (au3) to access a right click context menu but it wasn't working, turns out the au3 library is disappearing for some reason (I'm a little new to Ruby but when I require it again after the browser opens it comes back false for some reason:
irb(main):001:0> require "au3"
=> true
irb(main):002:0> require "watir-webdriver"
=> true
irb(main):003:0> browser = Watir::Browser.new :chrome
Starting ChromeDriver (v2.3) on port 9515
[4868:5640:1025/104947:ERROR:textfield.h(176)] NOT IMPLEMENTED
=> #<Watir::Browser:0x449008c8 url="about:blank" title="about:blank">
<to "https://github.com/lmmx/watir-paper-scanner/blob/master/bookworm.rb"
[WARNING:..\..\..\..\flash\platform\pepper\pep_module.cpp(63)] SANDBOXED
=> "https://github.com/lmmx/watir-paper-scanner/blob/master/bookworm.rb"
irb(main):005:0> require "au3"
=> false
irb(main):006:0>

I'm guessing that whatever's SANDBOXED is crucial to running au3? The browser still works fine... Will try and update the watir-related things, but I only installed it a week or 2 so it shouldn't be out of date already - anyone help me fix it?

A: The reason it's returning false is because you have already used
require "au3"

on the top line of your code, so when you require it again it's already there.


text:
Q: Create a bootable image of a Linux installation I have a system that is running out of space.( I hardly have 500MB left ) I want to make a bootable image of my Linux installation and install it onto a laptop which I intend to use as my primary machine. I have tried both Remastersys and Relinux. But they both make directories under /home directory and hence run out of space real quick.
Is there a way in which I can change the working directories of either of the them?
Or are there any alternatives? I've heard of clonezilla but I am not sure how relevant it is.

A: If there is no way to change their directories (I doubt), make them in some other place and put symlinks with needed names into your home. For example, if it creates ~/.foo, and you attached some external storage as /ext, make /ext/.foo and make symlink ~/.foo -> /ext/.foo. This will be enough for >99.9% of such tools.
Of course you shall have some external storage for this. If your laptop is modern enough, the simplest one is USB attached hard disk.
Many tools also allow to change their directories via environment variables, this should be described in their documentation.


text:
Q: How does register the file extension in vdproj,so that it will automatically open in the concern application I need to register the file extension in vdproj,so that when setup is installed by someone the file is opens into registered extension.
Say for example if my program exe is able to read text file with extension of .tet, so when i create any text file with extension .tet like sample.tet ,it should be open into my program exe not notepad.
Please suggest how to do that.