macos – Macbook Air system fails and fsck does not work

My macbook air 13 (mid 2013) cannot boot correctly. It stops at the Apple logo loading screen.
After getting into the single user mode, here is the error I got by runningfsck -fy (didn’t find any information about the error code):
enter image description here

After running the command mount -uw /, I got this and the process just hangs there:enter image description here

I think because of some failed system files or potentially damaged hard drive, the system cannot boot or mount the main drive (macintosh HD). I also tried to re-install the OS in the recover mode and it was just stuck during the initial process (seems related to the mounting problem). I also used the diskutil repairVolume command, but the process went on for 10 hours without any results (guess it’s also stuck).
Any ideas about how to solve this problem? Is there a way to force formating the main drive without mounting it?

c++ – OpenGL obj loader fails to work

#pragma once
#include <glm/glm.hpp>
#include <iostream>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <algorithm>

#include "Loader.h"
#include "RawModel.h"

// Include AssImp
#include <assimp/Importer.hpp>      // C++ importer interface
#include <assimp/scene.h>           // Output data structure
#include <assimp/postprocess.h>     // Post processing flags



class OBJLoader
{
public:
    static RawModel* load_obj(
        const char* filename, 
        Loader* loader
    )
    {
        std::ifstream in(filename, std::ios::in);
        if (!in)
            std::cout << "Failed to open: " << filename << std::endl;

        // the mesh data
        std::vector<glm::vec3> vertices;
        std::vector<glm::vec2> textures;
        std::vector<glm::vec3> normals;

        // the final vertex/textures/normals data!!!!!
        std::vector<glm::vec3> vertices2;
        std::vector<glm::vec2> textures2;
        std::vector<glm::vec3> normals2;

        // the mesh indices data
        std::vector<unsigned int> vertices_indices; // the vertex indices
        std::vector<int> textures_indices;
        std::vector<int> normals_indices;

        std::string line = "";
        while (std::getline(in, line))
        {
            if (line.substr(0, 2) == "v ")
            {
                std::istringstream s(line.substr(2));
                glm::vec3 vertex;
                s >> vertex.x; s >> vertex.y; s >> vertex.z;
                vertices.push_back(vertex);
            }
            else if (line.substr(0, 2) == "vt")
            {
                std::istringstream s(line.substr(2));
                glm::vec2 texture;
                s >> texture.x; s >> texture.y;
                textures.push_back(texture);
            }
            else if (line.substr(0, 2) == "vn")
            {
                std::istringstream s(line.substr(2));
                glm::vec3 normal;
                s >> normal.x; s >> normal.y; s >> normal.z;
                normals.push_back(normal);
            }
            else if (line.substr(0, 1) == "f")
            {
                std::istringstream s(line.substr(2));
                std::string temp;

                while (s >> temp) {                 
                    std::replace(temp.begin(), temp.end(), '/', ' ');
                    std::istringstream ss(temp);
                    unsigned int indice, texture, normal;
                    ss >> v_index; ss >> texture_index; ss >> normal_index;
                    //std::cout << v_index<< " " << texture_index<< " " << normal_index<< std::endl;

                    vertices_indices.push_back((unsigned int) v_index);
                    textures_indices.push_back((int) texture_index);
                    normals_indices.push_back((int)normal_index);
;               }
                
            }
        }

        for (unsigned int i = 0; i < vertices_indices.size(); i++)
        {
            vertices2.push_back(vertices(vertices_indices(i) - 1));
            normals2.push_back(normals(normals_indices(i) - 1));
            textures2.push_back(textures(textures_indices(i) - 1));
        }

        return loader->loadtoVAO(
            vertices2, vertices2.size() * sizeof(glm::vec3),
            textures2, textures2.size() * sizeof(glm::vec2),
            vertices_indices, vertices_indices.size() * sizeof(unsigned int)
        );
    }
    static RawModel* loadAssImp(
        const char* path,
        Loader* loader
    ) {

        Assimp::Importer importer;
        std::vector<unsigned int> indices;
        std::vector<glm::vec3> vertices;
        std::vector<glm::vec2> uvs;
        std::vector<glm::vec3> normals;

        const aiScene* scene = importer.ReadFile(path, 0/*aiProcess_JoinIdenticalVertices | aiProcess_SortByPType*/);
        if (!scene) {
            fprintf(stderr, importer.GetErrorString());
            getchar();
        }
        const aiMesh* mesh = scene->mMeshes(0); // In this simple example code we always use the 1rst mesh (in OBJ files there is often only one anyway)

        // Fill vertices positions
        vertices.reserve(mesh->mNumVertices);
        for (unsigned int i = 0; i < mesh->mNumVertices; i++) {
            aiVector3D pos = mesh->mVertices(i);
            vertices.push_back(glm::vec3(pos.x, pos.y, pos.z));
        }

        // Fill vertices texture coordinates
        uvs.reserve(mesh->mNumVertices);
        for (unsigned int i = 0; i < mesh->mNumVertices; i++) {
            aiVector3D UVW = mesh->mTextureCoords(0)(i); // Assume only 1 set of UV coords; AssImp supports 8 UV sets.
            uvs.push_back(glm::vec2(UVW.x, UVW.y));
        }

        // Fill vertices normals
        normals.reserve(mesh->mNumVertices);
        for (unsigned int i = 0; i < mesh->mNumVertices; i++) {
            aiVector3D n = mesh->mNormals(i);
            normals.push_back(glm::vec3(n.x, n.y, n.z));
        }


        // Fill face indices
        indices.reserve(3 * mesh->mNumFaces);
        for (unsigned int i = 0; i < mesh->mNumFaces; i++) {
            // Assume the model has only triangles.
            indices.push_back(mesh->mFaces(i).mIndices(0));
            indices.push_back(mesh->mFaces(i).mIndices(1));
            indices.push_back(mesh->mFaces(i).mIndices(2));
        }


        // The "scene" pointer will be deleted automatically by "importer"
        return loader->loadtoVAO(
            vertices, vertices.size() * sizeof(glm::vec3),
            uvs, uvs.size() * sizeof(glm::vec2),
            indices, indices.size() * sizeof(unsigned int)
        );
    }
};


There are two methods, my own obj loader and the one provided by assimp.

I don’t know why it does not work, all the data seems correct, I also use assimp ( check last method ) to compare the results of my obj loader and the results of assimp, they are exactly the same but when I send my data to the drawing part, it fails to work correctly, but if I send the data generated by assimp, everything is fine.

So the drawing part works, everything it’s ok ( it works perfectly with assimp ), the model does not look right at all…

Can anyone try replicate this? I am just using GLM for vectors, you can throw out the assimp part, thank you!

bugs – AuthorTools function fails to restore a corrupted file

I tried to open my corrupted nb file using the “parse and load the entire notebook into memory” and received a message saying there is a syntax error:

enter image description here

I then used the AuthorTools restore based on previous posts, and Mathematica just opened a blank document for me. So I am wondering if I was doing something wrong. If not are there other avenues to recover the file?

banach spaces – $C[0,1]$ fails the property (K)

Recall that a Banach space $X$ has the property (K) if every $w^{*}$-convergent sequence in $X^{*}$ admits a convex block subsequence which converges with respect to the Mackey topology. The property (K) was invented by S. Kwapien to provide an alternative approach to some results of N. Kalton and A. Pelczynski on subspaces of $L_{1}(0,1)$. A. Pelczynski noted that $L_{1}(mu)$($mu$ is a finite measure) has the property (K). Further, Schur spaces, Grothendieck spaces and strongly weakly compactly generated spaces enjoy the property (K). It was known that $c_{0}$ and $C(0,1)$ fail the property (K). But it seems not easy to check that $C(0,1)$ fails the property (K).

Question. How to check that $C(0,1)$ fails the property (K)?

Thanks.

updating – Update to Drupal 8.9.6 by composer fails

I’v installed Drupal 8 by composer. Everything worked fine, but when I tried to update core from 8.9.1 to 8.9.5 in ended up in 8.9.4.

Today I tried to update from 8.9.4. to 8.9.6 by changing composer.json to demand v 8.9.6 at least.

The result was following error message:

Your requirements could not be resolved to an installable set of packages.
Problem 1

  • Installation request for symfony/http-kernel (locked at v3.4.41) -> satisfiable by symfony/http-kernel(v3.4.41).
    > – drupal/core-recommended 8.9.6 requires symfony/http-kernel v3.4.44 -> satisfiable by symfony/http-kernel(v3.4.44).
    > – drupal/core-recommended 8.9.x-dev requires symfony/http-kernel v3.4.44 -> satisfiable by symfony/http-kernel(v3.4.44).
    > – Conclusion: don’t install symfony/http-kernel v3.4.44
    > – Installation request for drupal/core-recommended ^8.9.6 -> satisfiable by drupal/core-recommended(8.9.6, 8.9.x-dev).

I’m stuck, since I don’t know what locks symphony/http-kernel to v3.4.41.

I’m still pretty new with composer and would be glad if anybody could help me. Thanks a lot.

Updating core with Composer, differences, and why –with-dependencies fails

I’m a Drupal novice and have been playing around with it for the last few months. It seems like every ‘how-to’ article tells you a different way and a reason not to do it the other way.

I am a sysadmin for some developers and don’t plan on getting too far in over my head but want to successfully support Drupal with Core and Module updates as needed for security.

I set up some Drupal instances on a test vm and have some questions here with my guesses on the answers and would appreciate confirmation and perhaps a little guidance.

Recently I installed Drupal 8 using Composer with the below command and it installed 8.8.5:

composer create-project drupal/recommended-project

composer.json has this:

"drupal/core-composer-scaffold": "^8.8",
"drupal/core-recommended": "^8.8",

(Q1) Later I ran this and it didn’t update Core at all despite 8.9.5 being available:

composer update drupal/core-recommended –with-dependencies

(A1) I assume this is because drupal/core-recommended has dependencies that aren’t updated by this command so it didn’t update anything. I don’t get why the “with dependencies” flag didn’t force it to update them though.

(Q2) I reverted to a vm snapshot back to 8.8.5 and tried this and it updated Core to 8.8.8:

composer update drupal/*

(A2) I assume because Core >8.8.8 has unmet dependencies so it stopped at 8.8.8.

(Q3) I reverted back to the 8.8.5 snapshot and tried this and it updated Core to 8.9.5:

composer update

(A3) because this updates everything along with all dependencies, but how is this different from Q1 above?

This says a workaround for the dependency problem is to specify each dependency along with Core. (eg: composer update drupal/core “symfony/*” –with-dependencies). There are a number of dependencies showing as ‘prohibits’ so this would be a pretty long command. So why do it this way and not just use “composer update”? Isn’t it more or less the same thing?

I’m guessing it really depends on each use case but what is the general best practice? I don’t expect our Drupal instance to have a lot of modules because I’m told the developers plan on doing a lot of the work on the front end.

centos7 – Connecting to samba share fails

I have setted up a cluster in mirror of 2 nodes with glusterfs(7.7), everything is working properly, no fails in all the logfiles, CTDB is ok, samba is working properly…but can’t connect from a windows client :-(. Firewall is disabled! Somebody an idea? Checked for samba(4.10.4) bugs but nothing special what could be a block.

DateTime conversion fails when the datetime has seconds

This seems to be most discussed, but I could not arrive at a solution yet. I have a date format and have to add a month to it (DATEADD should not be used as my date is string initially) and finally should convert it as date. 103 format converts but it does not give seconds.
Below is the code I tried

    Declare @time_info nvarchar(max)
Declare @format_time_info nvarchar(max)
Declare @time_info_final nvarchar(max)
Declare @time_detail datetime
SET @time_info='30/1/2020 20:34:16 6 300'

Select @format_time_info =  (Select REPLACE(@time_info,('/'+SUBSTRING( @time_info, 
CHARINDEX('/', @time_info) + 1, 
LEN(@time_info) - CHARINDEX('/', @time_info) - CHARINDEX('/', REVERSE(@time_info)))+'/'),
(CONCAT('/',(convert(varchar,(convert(int,(SUBSTRING( @time_info, 
CHARINDEX('/', @time_info) + 1, 
LEN(@time_info) - CHARINDEX('/', @time_info) - CHARINDEX('/', REVERSE(@time_info)))+1))))),'/')))) 

Select @time_info_final =(Select left(@format_time_info, charindex(' ', @format_time_info, charindex(' ', @format_time_info)+1)-1))
 Select @time_detail =  CONVERT(datetime, @time_info_final,103)-- Cast(@time_info_final as datetime)-- Convert(datetime,Cast(@time_info_final as datetime2),210) --
Print @time_info_final
 Print @time_detail

This throws the common exception

python – wxPython GUI Code fails on different DPI/Resolution Settings

I use wxPython for a project to code a connection to a Database with an UI. My problem is that it needs to look good on different DPI and Resolution configurations, and this is giving me a headache.

In this code exampel i tried to extract a much positions/sizing stuff i do in my Code (so expect weird stuff) to give a discussion base for what i need to change to make my UI DPI scaling resistent.

Here is my example code:

import wx
import wx.adv

class Mywin(wx.Frame):
    def __init__(self,parent,title):
        wx.Frame.__init__(self, parent, wx.ID_ANY, title,size= (600,-1))
        
        self.SetSize(800,500)

        sizer_1 = wx.BoxSizer(wx.VERTICAL)        
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Order ID'), 0, wx.ALL , 5)
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Status'), 0, wx.ALL , 5)
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Creator'), 0, wx.ALL , 5)
        sizer_1.Add((-1, 5))
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Comment'), 0, wx.ALL , 5)
        sizer_1.Add((-1, 40))
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Customer ID'), 0, wx.ALL , 5)
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Customer Name'), 0, wx.ALL , 5)        
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Contact Person'), 0, wx.ALL , 5)
        sizer_1.Add((-1, 21))
        sizer_1.Add(wx.StaticText(self, size=(125,-1), label='Inquiry Date'), 0, wx.ALL , 5)


        ctrl_height = 25
        stati = ("Test", "Example")
        
        tc_order_id = wx.TextCtrl(self, -1, size=(100, ctrl_height),style=wx.TE_PROCESS_ENTER)
        cb_status = wx.ComboBox(self,size=(100, ctrl_height), choices=stati, style=wx.CB_READONLY)        
        cb_creator = wx.ComboBox(self,size=(100, ctrl_height), choices=stati, style=wx.CB_READONLY)
        tc_comment = wx.TextCtrl(self, id=-1, value='', size=(300,55), style=wx.TE_MULTILINE|wx.SUNKEN_BORDER)        
        tc_customer_id = wx.TextCtrl(self, -1, size=(80, ctrl_height),style=wx.TE_PROCESS_ENTER)                             
        tc_customer_name = wx.TextCtrl(self, -1, size=(300, ctrl_height),style=wx.TE_READONLY)        
        tc_contact_id = wx.TextCtrl(self, -1, size=(80, ctrl_height),style=wx.TE_PROCESS_ENTER)
        
        calender_style = wx.adv.DP_DROPDOWN | wx.adv.DP_SHOWCENTURY | wx.adv.DP_ALLOWNONE
        tc_order_date = wx.adv.GenericDatePickerCtrl(self, size=(90,ctrl_height), style = calender_style)
        
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_2.Add(tc_order_id, 0)
        sizer_2.Add(cb_status,0, wx.TOP , 3)
        sizer_2.Add(cb_creator, wx.TOP , 2)
        sizer_2.Add(tc_comment, 0, wx.TOP, 9)
        sizer_2.Add(tc_customer_id, 0, wx.TOP, 4)
        sizer_2.Add(tc_customer_name, 0, wx.TOP, 4)
        sizer_2.Add(tc_contact_id, 0, wx.TOP, 4)
        sizer_2.Add(tc_order_date, 0, wx.TOP, 20)
        
        mainsizer = wx.BoxSizer(wx.HORIZONTAL)
        mainsizer.Add(sizer_1)
        mainsizer.Add(sizer_2)
        
        self.SetSizer(mainsizer)
        
        self.Centre()
        self.Show()
        self.Layout()


demo = wx.App()
Mywin(None,'Example Code')
demo.MainLoop()