working on it ...

Filters

Explore Public Snippets

Sort by

Found 18k snippets matching: problem

    public by micurs modified Mar 4, 2014  6865862  353  9  18

    Typescript: passing a class member function as parameter to another function

    Typescript introduces the class construct and the concept of member functions. However if you try to pass a instance member function as parameter to another function the binding with the instance is lost. To solve this problem you can use the capability of javascript (and Typescript) to support closures on anonymous function (or lambda expressio
    ///<reference path='../types/node.d.ts'/>
    ///<reference path='../types/underscore.d.ts'/>
    
    import _ = require("underscore");
    
    class SomePeople {
      values : string[] = [ 'John', 'Mary', 'Peter'];
    
      out() {
        _.each( this.values, (v) => process.stdout.write( v + '\n') );
      }
    }
    // This function accept a function it will execute internally
    function outSomething( outFunc : () => any ) {
      outFunc();
    }
    
    var crowd = new SomePeople();
    
    // This won't work since the actual crowd instance binding will be lost
    outSomething( crowd.out );
    
    // This will work: the closure within the lambda expression retain the
    // crowd instance and its data
    outSomething( () => crowd.out() );
        

    public by cghersi modified Jul 27, 2013  338777  1  6  0

    ASP.NET Performance monitors

    The following XML file can be used to create a new user defined Data Collector Set in the Performance Monitor Tool for Windows servers. It checks the most important performance counters for the right execution of ASP.NET Web applications. The performance counters taken into account are those reported in this article: http://mvolo.com/fix-the-3-hi
    <?xml version="1.0" encoding="UTF-16"?>
    <DataCollectorSet>
    	<Status>0</Status>
    	<Duration>600</Duration>
    	<Description>Genera un rapporto con informazioni dettagliate sullo stato delle risorse hardware locali, sui tempi di risposta del sistema e sui processi eseguiti nel computer locale. Tali informazioni consentono di identificare le possibili cause dei problemi di prestazioni. Per eseguire questo Insieme agenti di raccolta dati, è necessario essere almeno membri del gruppo Administrators locale o di un gruppo equivalente.</Description>
    	<DescriptionUnresolved>Genera un rapporto con informazioni dettagliate sullo stato delle risorse hardware locali, sui tempi di risposta del sistema e sui processi eseguiti nel computer locale. Tali informazioni consentono di identificare le possibili cause dei problemi di prestazioni. Per eseguire questo Insieme agenti di raccolta dati, è necessario essere almeno membri del gruppo Administrators locale o di un gruppo equivalente.</DescriptionUnresolved>
    	<DisplayName>
    	</DisplayName>
    	<DisplayNameUnresolved>
    	</DisplayNameUnresolved>
    	<SchedulesEnabled>-1</SchedulesEnabled>
    	<Keyword>CPU</Keyword>
    	<Keyword>Memory</Keyword>
    	<Keyword>Disk</Keyword>
    	<Keyword>Network</Keyword>
    	<Keyword>Performance</Keyword>
    	<LatestOutputLocation>C:\PerfLogs\Admin\ASP.NET\ZIOJ-PC_20130727-000002</LatestOutputLocation>
    	<Name>ASP.NET</Name>
    	<OutputLocation>C:\PerfLogs\Admin\ASP.NET\ZIOJ-PC_20130727-000003</OutputLocation>
    	<RootPath>%systemdrive%\PerfLogs\Admin\ASP.NET</RootPath>
    	<Segment>0</Segment>
    	<SegmentMaxDuration>0</SegmentMaxDuration>
    	<SegmentMaxSize>0</SegmentMaxSize>
    	<SerialNumber>3</SerialNumber>
    	<Server>
    	</Server>
    	<Subdirectory>
    	</Subdirectory>
    	<SubdirectoryFormat>3</SubdirectoryFormat>
    	<SubdirectoryFormatPattern>yyyyMMdd\-NNNNNN</SubdirectoryFormatPattern>
    	<Task>
    	</Task>
    	<TaskRunAsSelf>0</TaskRunAsSelf>
    	<TaskArguments>
    	</TaskArguments>
    	<TaskUserTextArguments>
    	</TaskUserTextArguments>
    	<UserAccount>SYSTEM</UserAccount>
    	<Security>O:BAG:S-1-5-21-2577573897-3235701343-559641010-513D:AI(A;;FA;;;SY)(A;;FA;;;BA)(A;;FR;;;LU)(A;;0x1301ff;;;S-1-5-80-2661322625-712705077-2999183737-3043590567-590698655)(A;ID;FA;;;SY)(A;ID;FA;;;BA)(A;ID;0x1200ab;;;LU)(A;ID;FR;;;AU)(A;ID;FR;;;LS)(A;ID;FR;;;NS)</Security>
    	<StopOnCompletion>0</StopOnCompletion>
    	<TraceDataCollector>
    		<DataCollectorType>1</DataCollectorType>
    		<Name>NT Kernel</Name>
    		<FileName>NtKernel</FileName>
    		<FileNameFormat>0</FileNameFormat>
    		<FileNameFormatPattern>
    		</FileNameFormatPattern>
    		<LogAppend>0</LogAppend>
    		<LogCircular>0</LogCircular>
    		<LogOverwrite>0</LogOverwrite>
    		<LatestOutputLocation>C:\PerfLogs\Admin\ASP.NET\ZIOJ-PC_20130727-000002\NtKernel.etl</LatestOutputLocation>
    		<Guid>{00000000-0000-0000-0000-000000000000}</Guid>
    		<BufferSize>64</BufferSize>
    		<BuffersLost>0</BuffersLost>
    		<BuffersWritten>0</BuffersWritten>
    		<ClockType>1</ClockType>
    		<EventsLost>0</EventsLost>
    		<ExtendedModes>0</ExtendedModes>
    		<FlushTimer>0</FlushTimer>
    		<FreeBuffers>0</FreeBuffers>
    		<MaximumBuffers>200</MaximumBuffers>
    		<MinimumBuffers>0</MinimumBuffers>
    		<NumberOfBuffers>0</NumberOfBuffers>
    		<PreallocateFile>0</PreallocateFile>
    		<ProcessMode>0</ProcessMode>
    		<RealTimeBuffersLost>0</RealTimeBuffersLost>
    		<SessionName>NT Kernel Logger</SessionName>
    		<SessionThreadId>0</SessionThreadId>
    		<StreamMode>1</StreamMode>
    		<TraceDataProvider>
    			<DisplayName>{9E814AAD-3204-11D2-9A82-006008A86939}</DisplayName>
    			<FilterEnabled>0</FilterEnabled>
    			<FilterType>0</FilterType>
    			<Level>
    				<Description>Gli eventi fino a questo livello sono attivati</Description>
    				<ValueMapType>1</ValueMapType>
    				<Value>0</Value>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x0</Value>
    				</ValueMapItem>
    			</Level>
    			<KeywordsAny>
    				<Description>Gli eventi con almeno una delle parole chiave specificate sono attivati</Description>
    				<ValueMapType>2</ValueMapType>
    				<Value>0x10303</Value>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x1</Value>
    				</ValueMapItem>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x2</Value>
    				</ValueMapItem>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x100</Value>
    				</ValueMapItem>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x200</Value>
    				</ValueMapItem>
    				<ValueMapItem>
    					<Key>
    					</Key>
    					<Description>
    					</Description>
    					<Enabled>-1</Enabled>
    					<Value>0x10000</Value>
    				</ValueMapItem>
    			</KeywordsAny>
    			<KeywordsAll>
    				<Description>Gli eventi con tutte le parole chiave specificate sono attivati</Description>
    				<ValueMapType>2</ValueMapType>
    				<Value>0x0</Value>
    			</KeywordsAll>
    			<Properties>
    				<Description>I campi dati aggiuntivi specificati verranno raccolti con ogni evento</Description>
    				<ValueMapType>2</ValueMapType>
    				<Value>0</Value>
    			</Properties>
    			<Guid>{9E814AAD-3204-11D2-9A82-006008A86939}</Guid>
    		</TraceDataProvider>
    	</TraceDataCollector>
    	<PerformanceCounterDataCollector>
    		<DataCollectorType>0</DataCollectorType>
    		<Name>Performance Counter</Name>
    		<FileName>Performance Counter</FileName>
    		<FileNameFormat>1</FileNameFormat>
    		<FileNameFormatPattern>yyyyMMdd</FileNameFormatPattern>
    		<LogAppend>-1</LogAppend>
    		<LogCircular>0</LogCircular>
    		<LogOverwrite>0</LogOverwrite>
    		<LatestOutputLocation>C:\PerfLogs\Admin\ASP.NET\ZIOJ-PC_20130727-000002\Performance Counter20130727.csv</LatestOutputLocation>
    		<DataSourceName>
    		</DataSourceName>
    		<SampleInterval>1</SampleInterval>
    		<SegmentMaxRecords>0</SegmentMaxRecords>
    		<LogFileFormat>0</LogFileFormat>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\% Managed Processor Time (estimated)</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Viewstate MAC Validation Failure</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors During Compilation</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors During Execution</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors During Preprocessing</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors Unhandled During Execution</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors Unhandled During Execution/Sec</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Audit Failure Events Raised</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Error Events Raised</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Error Events Raised/Sec</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Infrastructure Error Events Raised</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Infrastructure Error Events Raised/Sec</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Request Error Events Raised</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Request Error Events Raised/Sec</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors Total</Counter>
    		<Counter>\ASP.NET Apps v4.0.30319(__Total__)\Errors Total/Sec</Counter>
    		<Counter>\ASP.NET v4.0.30319\Error Events Raised</Counter>
    		<Counter>\ASP.NET v4.0.30319\Infrastructure Error Events Raised</Counter>
    		<Counter>\ASP.NET v4.0.30319\Request Error Events Raised</Counter>
    		<Counter>\.NET CLR Exceptions\*</Counter>
    		<Counter>\.NET CLR Memory(_Global_)\% Time in GC</Counter>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\% Tempo processore gestito (stimato)</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errore di convalida MAC ViewState</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errori di compilazione</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errori di esecuzione.</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errori di pre-elaborazione</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errori non gestiti durante l'esecuzione</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Errori non gestiti durante l'esecuzione/sec</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore di controllo generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore generati/sec</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore infrastruttura generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore infrastruttura generati/sec</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore richiesta generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Eventi errore richiesta generati/sec</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Totale errori</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET Apps v4.0.30319(__Total__)\Totale errori/sec</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET v4.0.30319\Eventi errore generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET v4.0.30319\Eventi errore infrastruttura generati</CounterDisplayName>
    		<CounterDisplayName>\ASP.NET v4.0.30319\Eventi errore richiesta generati</CounterDisplayName>
    		<CounterDisplayName>\Eccezioni CLR .NET\*</CounterDisplayName>
    		<CounterDisplayName>\Memoria CLR .NET(_Global_)\Percentuale tempo in GC</CounterDisplayName>
    	</PerformanceCounterDataCollector>
    	<DataManager>
    		<Enabled>-1</Enabled>
    		<CheckBeforeRunning>-1</CheckBeforeRunning>
    		<MinFreeDisk>200</MinFreeDisk>
    		<MaxSize>1024</MaxSize>
    		<MaxFolderCount>100</MaxFolderCount>
    		<ResourcePolicy>0</ResourcePolicy>
    		<ReportFileName>report.html</ReportFileName>
    		<RuleTargetFileName>report.xml</RuleTargetFileName>
    		<EventsFileName>
    		</EventsFileName>
    		<Rules>
    			<Logging level="15" file="rules.log">
    			</Logging>
    			<Import file="%systemroot%\pla\rules\Rules.System.Common.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.Summary.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.Performance.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.CPU.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.Network.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.Disk.xml">
    			</Import>
    			<Import file="%systemroot%\pla\rules\Rules.System.Memory.xml">
    			</Import>
    		</Rules>
    		<ReportSchema>
    			<Report name="systemPerformance" version="1" threshold="100">
    				<Import file="%systemroot%\pla\reports\Report.System.Common.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.Summary.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.Performance.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.CPU.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.Network.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.Disk.xml">
    				</Import>
    				<Import file="%systemroot%\pla\reports\Report.System.Memory.xml">
    				</Import>
    			</Report>
    		</ReportSchema>
    		<FolderAction>
    			<Size>0</Size>
    			<Age>1</Age>
    			<Actions>3</Actions>
    			<SendCabTo>
    			</SendCabTo>
    		</FolderAction>
    		<FolderAction>
    			<Size>0</Size>
    			<Age>56</Age>
    			<Actions>8</Actions>
    			<SendCabTo>
    			</SendCabTo>
    		</FolderAction>
    		<FolderAction>
    			<Size>0</Size>
    			<Age>168</Age>
    			<Actions>26</Actions>
    			<SendCabTo>
    			</SendCabTo>
    		</FolderAction>
    	</DataManager>
    	<Value name="PerformanceMonitorView" type="document">
    		<OBJECT ID="DISystemMonitor" CLASSID="CLSID:C4D2D8E0-D1DD-11CE-940F-008029004347">
    			<PARAM NAME="CounterCount" VALUE="4">
    			</PARAM>
    			<PARAM NAME="Counter00001.Path" VALUE="\Processor(_Total)\% Processor Time">
    			</PARAM>
    			<PARAM NAME="Counter00001.Color" VALUE="255">
    			</PARAM>
    			<PARAM NAME="Counter00001.Width" VALUE="2">
    			</PARAM>
    			<PARAM NAME="Counter00001.LineStyle" VALUE="0">
    			</PARAM>
    			<PARAM NAME="Counter00001.ScaleFactor" VALUE="0">
    			</PARAM>
    			<PARAM NAME="Counter00001.Show" VALUE="1">
    			</PARAM>
    			<PARAM NAME="Counter00001.Selected" VALUE="1">
    			</PARAM>
    			<PARAM NAME="Counter00002.Path" VALUE="\Memory\Pages/sec">
    			</PARAM>
    			<PARAM NAME="Counter00002.Color" VALUE="65280">
    			</PARAM>
    			<PARAM NAME="Counter00002.Width" VALUE="1">
    			</PARAM>
    			<PARAM NAME="Counter00003.Path" VALUE="\PhysicalDisk(_Total)\Avg. Disk sec/Read">
    			</PARAM>
    			<PARAM NAME="Counter00003.Color" VALUE="16711680">
    			</PARAM>
    			<PARAM NAME="Counter00003.Width" VALUE="1">
    			</PARAM>
    			<PARAM NAME="Counter00004.Path" VALUE="\PhysicalDisk(_Total)\Avg. Disk sec/Write">
    			</PARAM>
    			<PARAM NAME="Counter00004.Color" VALUE="55295">
    			</PARAM>
    			<PARAM NAME="Counter00004.Width" VALUE="1">
    			</PARAM>
    		</OBJECT>
    	</Value>
    </DataCollectorSet>
    

    public by godie007 modified Dec 19, 2013  213165  2  4  0

    solucion problema de 3x3 con regla de crammer determinante por el metodo de cofactores

    solucion problema de 3x3 con regla de crammer determinante por el metodo de cofactores: determinante.java
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    /**
     *
     * @author Godie007
     */
    public class Esayo {
    
        private static double[][] matrizX = new double[3][3];
        private static double[][] matrizZ = new double[3][3];
        private static double[][] matrizY = new double[3][3];
        private static double[][] matrizP = new double[3][3];
    
        /**
    	 * metodo que retorna un vector con el valor de la incognitas del sistema de
    	 * ecuaciones.
    	 * 
    	 * @return un vector con el valor de las incognitas.
    	 */
    	public double[] resolver() {
    
    		double sol[] = new double[resultados.length];
    		// convierte una matriz de 3x4 en 4 matrices de 3x3
    		for (int i = 0; i < matrizP.length; i++) {
    			for (int j = 0; j < matrizP[0].length; j++) {
    				// matriz 3x3 principal
    				System.arraycopy(coeficientes[i], 0, matrizP[i], 0,matrizP[0].length);
    				// matriz 3x3 X
    				matrizX[i][j] = j == 0 ? coeficientes[i][coeficientes.length]: coeficientes[i][j];
    				// matriz 3x3 Y
    				matrizY[i][j] = j == 1 ? coeficientes[i][coeficientes.length]: coeficientes[i][j];
    				// matriz 3x3 Z
    				matrizZ[i][j] = j == 2 ? coeficientes[i][coeficientes.length]: coeficientes[i][j];
    			}
    		}
    		// calculamos los determinantes P,X,Y,Z
    		double p = determinante(matrizP, 0, 0, 0);
    		double dx = determinante(matrizX, 0, 0, 0);
    		double dy = determinante(matrizY, 0, 0, 0);
    		double dz = determinante(matrizZ, 0, 0, 0);
    		// encontramos el valor a las incognitas
    		sol[0] = dx / p;
    		sol[1] = dy / p;
    		sol[2] = dz / p;
    		return sol;
    	}
    
        /**
    	 * metodo que calcula el determinante de una matriz de manera recursiva por
    	 * el metodo de cofactores.
    	 * 
    	 * @return el determinante.
    	 */
    
    	public double determinante(double matriz[][], int contador, int fila,int columna) {
    		double resultado = 0;
    		if (fila == -1 && columna == -1) {
    			//calcular terces cofactor cofactor
    			resultado = matriz[0][contador]* (matriz[1][1 + fila] * matriz[2][2 + columna] - matriz[2][1 + fila]* matriz[1][2 + columna]);
    			return resultado;
    		}
    		if (fila == -1 && columna == 0) {
    			//calcular segundo cofactor con signo invertido
    			resultado = -1* matriz[0][contador]* (matriz[1][1 + fila] * matriz[2][2 + columna] - matriz[2][1 + fila]* matriz[1][2 + columna]);
    			resultado += determinante(matriz, 2, fila, columna - 1);
    		}
    		if (fila == 0 && columna == 0) {
    			//calcular primer cofactor
    			resultado = matriz[0][contador]* (matriz[1][1 + fila] * matriz[2][2 + columna] - matriz[2][1 + fila]* matriz[1][2 + columna]);
    			resultado += determinante(matriz, 1, fila - 1, 0);
    		}
    		return resultado;
    	}
    }
    
    
    

    public by passh modified Oct 13, 2016  3474  15  4  0

    doctrine:mapping:convert type [ enum , set, varbinary, etc ] problem solved

    doctrine fails to load mysql tables if they have enum values or tables with no primary keys , this is the code solves it
    # Doctrine Configuration
    doctrine:
        dbal:
            driver:   pdo_mysql
            host:     "%database_host%"
            port:     "%database_port%"
            dbname:   "%database_name%"
            user:     "%database_user%"
            password: "%database_password%"
            charset:  UTF8
            # if using pdo_sqlite as your database driver:
            #   1. add the path in parameters.yml
            #     e.g. database_path: "%kernel.root_dir%/data/data.db3"
            #   2. Uncomment database_path in parameters.yml.dist
            #   3. Uncomment next line:
            #     path:     "%database_path%"
            schema_filter: ~^(?!hesk_active_sessions|hesk_tags|hesk_tickets_tags)~ 
            
            mapping_types:
             enum: string
             set: string
             varbinary: string
             tinyblob: text
                                           

    public by wassim modified Jan 19, 2015  2512  7  5  0

    ANDORID IMAGE LOADER PROBLEM (imageloader must be init with configuration before using)

    ANDROID: init IMAGE LOADER ANDROID EXCEPTION (imageloader must be init with configuration before using)
    imageLoader.init(ImageLoaderConfiguration.createDefault(CustomMapMarker.this));

    public by rioxshen modified Aug 19, 2014  1799  6  6  1

    [LeetCode] Partition Problem

    Partition a list around the value x.
    public class Solution {
        public ListNode partition(ListNode head, int x) {
            if (head == null || head.next == null) return head;
            
            ListNode leftDummy = new ListNode(Integer.MIN_VALUE);
            ListNode rightDummy = new ListNode(Integer.MIN_VALUE);
            ListNode left = leftDummy;
            ListNode right = rightDummy;
            
            while (head != null) {
                if (head.val < x) {
                    left.next = head;
                    left = left.next;
                } else {
                    right.next = head;
                    right = right.next;
                }
                head = head.next;
            }
            
            left.next = rightDummy.next;
            right.next = null;
            
            return leftDummy.next;
        }
    }

    public by alinros modified Oct 16, 2015  1760  0  5  1

    Problem and errors with Gmail! Go using any mobile

    Various Gmail problems are known to every account user now. There are a large Gmail Phone Number of individuals who are used to have problems in their account while operating their Gmail accounts via their desktop or mobile.
    For More Information: http://gmail-phone-number.com/

    public by DinhoPutz modified Feb 5, 2019  34  0  3  0

    An array of integers that returns colors

    Given an array with and objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not supposed to use the library's sort function for this
    /*
    Given an array with and objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.
    Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively.
    Note: You are not supposed to use the library's sort function for this problem.
    
    Example:
    
    Input: [2,0,2,1,1,0]
    Output: [0,0,1,1,2,2]
    Follow up:
    
    A rather straight forward solution is a two-pass algorithm using counting sort.
    First, iterate the array counting number of 0's, 1's, and 2's, then overwrite array with total number of 0's, then 1's and followed by 2's.
    Could you come up with a one-pass algorithm using only constant space?
    */
    #include<iostream>
    #include<vector>
    #include<map>
    #include<algorithm>
    using namespace std;
    class Solution {
    public:
    	static void sortColors(vector<int>&& nums) {
    		map <int, int> m_int;
    		for (const auto& num : nums) {
    			m_int[num]++;
    		}
    		nums.clear();
    		for (auto& m : m_int) {
    			for (int i = 0;i < m.second;++i) {
    				cout << m.first<<" ";
    				nums.push_back(m.first);
    			}
    		}
    
    	}
    };
    int main() {
    	Solution::sortColors({ 2,0,2,1,1,0 });
    }

    public by cghersi modified May 23, 2014  21867  168  9  4

    How to run unit tests created with MS Visual Studio without installing Visual Studio

    Do you want to run your unit tests on your staging server? Surely you don't want to make your staging environment "dirty" by installing Visual Studio. I'm also not comfortable with installing the Test Agent. And perhaps you don't have the resources to use Visual Studio Online Continuous Integration stuff... It's not a problem of licenses. We don
    1) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow (copy all content of the folder):
    Extensions (folder)
    ActivateApplication.exe
    EntityFramework.dll
    extension.vsixmanifest
    Microsoft.TeamFoundation.TestPlatform.Client.dll
    Microsoft.TestTools.Cpp.targets
    Microsoft.VisualStudio.MSTest.TestWindow.dll
    Microsoft.VisualStudio.TestPlatform.BuildTasks.dll
    Microsoft.VisualStudio.TestPlatform.Client.dll
    Microsoft.VisualStudio.TestPlatform.Common.dll
    Microsoft.VisualStudio.TestPlatform.Core.dll
    Microsoft.VisualStudio.TestPlatform.Fakes.dll
    Microsoft.VisualStudio.TestPlatform.ObjectModel.dll
    Microsoft.VisualStudio.TestPlatform.TestExecutor.Core.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.AppContainer.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.dll
    Microsoft.VisualStudio.TestPlatform.Utilities.PhoneAppContainer.dll
    Microsoft.VisualStudio.TestWindow.Core.dll
    Microsoft.VisualStudio.TestWindow.CppUnitTestExtension.dll
    Microsoft.VisualStudio.TestWindow.dll
    Microsoft.VisualStudio.TestWindow.Interfaces.dll
    Microsoft.VisualStudio.TestWindow.pkgdef
    Microsoft.VisualStudio.TestWindow.VSTest.dll
    msdia120typelib_clr0200.dll
    TestWindowProvideCodeBase.pkgdef
    vstest.console.exe
    vstest.console.exe.config
    vstest.discoveryengine.exe
    vstest.discoveryengine.exe.config
    vstest.discoveryengine.x86.exe
    vstest.discoveryengine.x86.exe.config
    vstest.executionengine.clr20.exe
    vstest.executionengine.clr20.exe.config
    vstest.executionengine.exe
    vstest.executionengine.exe.config
    vstest.executionengine.x86.clr20.exe
    vstest.executionengine.x86.clr20.exe.config
    vstest.executionengine.x86.exe
    vstest.executionengine.x86.exe.config
    
    2) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC:
    vcvarsall.bat (put this file into a sufolder named "vc")
    
    3) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies:
    Microsoft.VisualStudio.QualityTools.Sqm.dll
    
    4) From C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0:
    Microsoft.VisualStudio.QualityTools.ExecutionCommon.dll
    
    5) For these files you need to use copy command from a DOS prompt, and then copy from c:/tmp to your staging folder: 
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Resource\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Resource.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Common\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Common.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.Tips.UnitTest.ObjectModel.dll c:\tmp
    copy C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.QualityTools.UnitTestFramework\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll c:\tmp
    

    public by marceloviana modified Nov 10, 2016  2704  1  4  0

    Resolver problema de acentuação no python

    
    import sys 
    reload(sys)
    sys.setdefaultencoding('utf-8')
    
    • Public Snippets
    • Channels Snippets