public abstract class AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl {
    
    private static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl theOneAndOnlyInstance;
    private Connection theUnbreakableEverlastingDatabaseLifeline;

    public static AbstractInventoryProductFactoryManagerSingletonServiceManagerFactoryExceptionHandlerResourceHandlerDatabaseConnectionHandlerImpl summonTheSingleton() {
        if (theOneAndOnlyInstance == null) {
            theOneAndOnlyInstance = new ConcreteImplementation();
        }
        return theOneAndOnlyInstance;
    }

    public abstract void initiateUnswervingDatabaseLinkWithCompulsiveRetriesAndUnyieldingTimeout();
    public abstract InventoryProduct concoctAndJumpstartBrandNewInventoryProductPostRigorousValidation();
    public abstract Service bootstrapAndEnrollNovelServicePostInfallibleAvailabilityCheck();
    public abstract void seizeAndChronicleExceptionWithStackTrackAndSignalDeveloper(Exception e);
    public abstract void manageAndFineTuneResourceConsumptionForPeakEfficiency(Resource resource);
    public abstract void launchDatabaseTransactionWithOptimumIsolationLevel();
    public abstract void ratifyDatabaseTransactionAndScourForPossibleConflicts();
    public abstract void revokeDatabaseTransactionInEventOfUnforeseenErrors();
    public abstract void safelySeverDatabaseConnectionAndLiberatePreciousResources();
}
By unknown, 2023-06-08 21:13:00
/**
 * Stringify a JSON object
 * @param {*} value JSON value to stringify
 * @returns {string} stringify JSON
 */
function stringify(value) {
    var result = {};
    try {
        result = JSON.stringify(value);
    } catch (e) {
        Logger.error('Error while trying to stringify ' + e);
        result = JSON.stringify(result);
    }
    return result;
}

Stringify a JSON object

By Ihor Did, 2023-04-12 19:36:08
case (RSel)
      4'b0000:begin
                R1e = 1'b0;   R2e = 1'b0;  R3e = 1'b0;  R4e = 1'b0;  
              end
      4'b0001:begin
                R1e = 1'b0;   R2e = 1'b0;  R3e = 1'b0;  R4e = 1'b1; 
              end
      4'b0010:begin
                R1e = 1'b0;   R2e = 1'b0;  R3e = 1'b1;  R4e = 1'b0; 
              end
      4'b0011:begin
                R1e = 1'b0;   R2e = 1'b0;  R3e = 1'b1;  R4e = 1'b1; 
              end
      4'b0100:begin
                R1e = 1'b0;   R2e = 1'b1;  R3e = 1'b0;  R4e = 1'b0;
              end
      4'b0101:begin
                R1e = 1'b0;   R2e = 1'b1;  R3e = 1'b0;  R4e = 1'b1;  
              end
      4'b0110:begin
                R1e = 1'b0;   R2e = 1'b1;  R3e = 1'b1;  R4e = 1'b0; 
              end
      4'b0111:begin
                R1e = 1'b0;   R2e = 1'b1;  R3e = 1'b1;  R4e = 1'b1;  
              end
      4'b1000:begin
                R1e = 1'b1;   R2e = 1'b0;  R3e = 1'b0;  R4e = 1'b0;  
              end
      4'b1001:begin
                R1e = 1'b1;   R2e = 1'b0;  R3e = 1'b0;  R4e = 1'b1;
              end
      4'b1010:begin
                R1e = 1'b1;   R2e = 1'b0;  R3e = 1'b1;  R4e = 1'b0; 
              end
      4'b1011:begin
                R1e = 1'b1;   R2e = 1'b0;  R3e = 1'b1;  R4e = 1'b1; 
              end
      4'b1100:begin
                R1e = 1'b1;   R2e = 1'b1;  R3e = 1'b0;  R4e = 1'b0; 
              end
      4'b1101:begin
                R1e = 1'b1;   R2e = 1'b1;  R3e = 1'b0;  R4e = 1'b1; 
              end
      4'b1110:begin
                R1e = 1'b1;   R2e = 1'b1;  R3e = 1'b1;  R4e = 1'b0; 
              end
      4'b1111:begin
                R1e = 1'b1;   R2e = 1'b1;  R3e = 1'b1;  R4e = 1'b1;
              end
     
    endcase
    
    case (TSel)
          4'b0000:begin
                    T1e = 1'b0;  T2e = 1'b0; T3e = 1'b0;  T4e = 1'b0;
                  end
          4'b0001:begin
                    T1e = 1'b0;  T2e = 1'b0; T3e = 1'b0;  T4e = 1'b1;
                  end
          4'b0010:begin
                    T1e = 1'b0;  T2e = 1'b0; T3e = 1'b1;  T4e = 1'b0;
                  end
          4'b0011:begin
                    T1e = 1'b0;  T2e = 1'b0; T3e = 1'b1;  T4e = 1'b1;
                  end
          4'b0100:begin
                    T1e = 1'b0;  T2e = 1'b1; T3e = 1'b0;  T4e = 1'b0;
                  end
          4'b0101:begin
                    T1e = 1'b0;  T2e = 1'b1; T3e = 1'b0;  T4e = 1'b1;
                  end
          4'b0110:begin
                    T1e = 1'b0;  T2e = 1'b1; T3e = 1'b1;  T4e = 1'b0;
                  end
          4'b0111:begin
                    T1e = 1'b0;  T2e = 1'b1; T3e = 1'b1;  T4e = 1'b1;
                  end
          4'b1000:begin
                    T1e = 1'b1;  T2e = 1'b0; T3e = 1'b0;  T4e = 1'b0;
                  end
          4'b1001:begin
                    T1e = 1'b1;  T2e = 1'b0; T3e = 1'b0;  T4e = 1'b1;
                  end
          4'b1010:begin
                    T1e = 1'b1;  T2e = 1'b0; T3e = 1'b1;  T4e = 1'b0;
                  end
          4'b1011:begin
                    T1e = 1'b1;  T2e = 1'b0; T3e = 1'b1;  T4e = 1'b1;
                  end
          4'b1100:begin
                    T1e = 1'b1;  T2e = 1'b1; T3e = 1'b0;  T4e = 1'b0;
                  end
          4'b1101:begin
                    T1e = 1'b1;  T2e = 1'b1; T3e = 1'b0;  T4e = 1'b1; 
                  end
          4'b1110:begin
                    T1e = 1'b1;  T2e = 1'b1; T3e = 1'b1;  T4e = 1'b0;
                  end
          4'b1111:begin
                    T1e = 1'b1;  T2e = 1'b1; T3e = 1'b1;  T4e = 1'b1;
                  end
        endcase

Just write assign {R1e, R2e, R3e, R4e} = Rsel assign {T1e, T2e, T3e, T4e} = Tsel

By dawidogg, 2023-04-01 16:40:34
		roots.push(resolver(Config.root, `${pageDir}${path.sep}${page}${path.sep}${page}.html`));
By Anonymous, 2023-04-01 10:39:37
var lightBox_ReplaceSelectsWithSpans = function()
{
	var selects = document.getElementsByTagName('select');
	for (var i = 0; i < selects.length; i++) {
		var select = selects[i];
		if (select.clientWidth == 0 || select.clientHeight == 0 || 
			select.nextSibling == null || select.nextSibling.className == 'selectReplacement') {
			continue;
		}
			
		var span = document.createElement('span');
		// this would be "- 3", but for that appears to shift the block that contains the span 
		//   one pixel down; instead we tolerate the span being 1px shorter than the select
		span.style.height = (select.clientHeight - 4) + 'px';
		span.style.width = (select.clientWidth - 6) + 'px';
		span.style.display = 'inline-block';
		span.style.border = '1px solid rgb(200, 210, 230)';
		span.style.padding = '1px 0 0 4px';
		span.style.fontFamily = 'Arial';
		span.style.fontSize = 'smaller';
		span.style.position = 'relative';
		span.style.top = '1px';
		span.className = 'selectReplacement';
		
		span.innerHTML = select.options[select.selectedIndex].innerHTML ;//+ 
			//'<img src="custom_drop.gif" alt="drop down" style="position: absolute; right: 1px; top: 1px;" />';
		
		select.cachedDisplay = select.style.display;
		select.style.display = 'none';
		select.parentNode.insertBefore(span, select.nextSibling);
	}
};
By Anonymous, 2023-03-29 16:59:15
const convertMenu = menus => {
    const menusAssinged = menus.filter(menu => menu.parentId == null).sort((a, b) => a.order - b.order).map(menu => {
        if (menus.some(element => element.parentId == menu.menuId)) {
            return {
                title: menu.title,
                icon: { icon: menu.icon },
                children: menus.filter(menuChil => menuChil.parentId == menu.menuId).sort((a, b) => a.order - b.order).map(menuChil => {

                    if (menuChil.pathRoute.includes(":")) {
                        const params = menuChil.pathRoute.split(":").pop()

                        return {
                            title: menuChil.title,
                            to: { name: menuChil.nameRoute, params: { [params]: "abc" } },
                        }
                    } else {
                        return {
                            title: menuChil.title,
                            to: menuChil.nameRoute,
                        }
                    }
                }),
            }
        } else {
            return {
                title: menu.title,
                icon: { icon: menu.icon },
                to: menu.nameRoute,
            }
        }
    })

    menusUser.value = menusAssinged
    localStorage.setItem('menus', JSON.stringify(menusAssinged))
}

when they exorcise the callbacks demon but they appear in functional

By Juan David Castro, 2023-03-16 15:34:29
var i = 0

for (var n in array) { 
    i+=1
    // ...
}
By PureJavascript, 2023-02-11 11:08:33
typedef signed int sint;
#define N 100
static int n = N;

inline int f(const int n, int& i, int* j, int t[2], int p=11)
{
    i*=i;
    (*j)--;
    
    if ( n<=0 )
    {
        cout << ::n << ">\n";
        return t[0];
    }
    else return f(n-1, i, j, t) + t[n];
}

int main()
{
    int n = 4;
    int x = 1U;
    sint y = 10;
    int (*fptr)(const int, int&, int*, int*, int) = f;

    int* t = new int[n];
    int& r = *(t+3);
    (*t) = 1;
    *(t+1) = 2;
    t[2] = 3;
    r = 4;

    int z = (*fptr)(5, x, &y, t, 12);    

    for(int i = 0; i < 2*n; i++)
    {
        if( i == n )
            continue;
        if( i > n )
            break;
        cout << t[i] << "\n";
    };
    cout << x << ", " << y << ", " << z << "\n";
    
    delete[] t;
}

This is what my professor gave as part of the final exam. The purpose of giving us this code was to get us used to seeing different ways the C++ syntax can be used and figure out what the output is.

By Anonymous, 2023-02-02 21:29:11
let True = true
let False = false

使用Python的 True 和 False 在javascript

By AD, 2023-01-31 10:16:17
cd /some/directory
rm -rf *

I regularly see these two lines in Bash scripts I don't understand but some programmers think you need a CD command before any command, and they also don't know that paths can be part of parameters (which explains why they use many CD commands)

By Meeeeee, 2023-01-25 16:50:10
this.unwatchBackdrop ? this.unwatchBackdrop() : this.noop();
...
private noop(): void {}
By Anonymous, 2023-01-19 12:36:09
   // Test read access of memory
   try
   {
      c = ( (char*) pvMemory )[0];
      c = ( (char*) pvMemory )[iNLen - 1];
   }

   catch( ... ) {
      return -1;
   }
By Anonymous, 2022-10-19 16:28:05
 public void updateCurrency() {
        LOGGER.info("Update currencies");
        var ok = false;

        try {
            getExchangeRatesMechanism(getExchangeRatesProcessor());
            ok = true;
        } catch (Exception exception) {
            LOGGER.error(exception.getMessage(), exception);
        }

        if (ok) {
            LOGGER.info("The currencies were updated successfully!");
        }
    }
By halogenUnit, 2022-09-29 13:31:58
if (string.Compare(json["result"].ToString(), "OK", true) == 0)
{
    if (string.Compare(json["list"][0]["result"].ToString(), "OK", true) == 0)
        return null;
        
    //omitted
}
By J@k3R, 2022-08-09 08:51:55
for (int i = 0;i < n / 2;i++)
    {
        while (num[a[p].id].n == 0 || num[num[a[p].id].nxt].n == 0)
        {
            p++;
        }
        printf("%d %d ", num[a[p].id].n, num[num[a[p].id].nxt].n);
        num[a[p].id].n = 0;
        num[num[a[p].id].nxt].n = 0;
        num[num[a[p].id].lst].nxt = num[num[a[p].id].nxt].nxt;
        num[num[num[a[p].id].nxt].nxt].lst = num[a[p].id].lst;
    }
By Anonymous, 2022-08-06 14:50:56