This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isOnlineSubscription: Subscription; | |
ngOnInit() { | |
... | |
this.checkIfBackToOnline(); | |
} | |
ngOnDestroy() { | |
... | |
this.isOnlineSubscription.unsubscribe(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.senoritadev.bookstore.configuration.documentation; | |
import io.swagger.v3.oas.models.Components; | |
import io.swagger.v3.oas.models.OpenAPI; | |
import io.swagger.v3.oas.models.info.Contact; | |
import io.swagger.v3.oas.models.info.Info; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
@Configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.senoritadev.bookstore.rest; | |
import com.senoritadev.bookstore.model.BookInfo; | |
import com.senoritadev.bookstore.service.BookService; | |
import io.swagger.v3.oas.annotations.Operation; | |
import io.swagger.v3.oas.annotations.Parameter; | |
import io.swagger.v3.oas.annotations.enums.ParameterIn; | |
import io.swagger.v3.oas.annotations.media.Content; | |
import io.swagger.v3.oas.annotations.media.Schema; | |
import io.swagger.v3.oas.annotations.responses.ApiResponse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isHttpProgressEvent(event: HttpEvent<unknown>): event is HttpProgressEvent { | |
return ( | |
event.type === HttpEventType.DownloadProgress || | |
event.type === HttpEventType.UploadProgress | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
startUpload(): void { | |
const filesToUpload = []; | |
this.files.forEach(f => { | |
const uuid = UtilService.generateUUID(); | |
filesToUpload.push({ | |
'name': f.name, | |
'size': f.size, | |
'uuid': uuid | |
}); | |
this.fileUUIDList.push(uuid); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uploadFile(fileInfo: any): Observable<any> { | |
const headers: HttpHeaders = new HttpHeaders({ | |
'Accept': 'application/json', | |
'Content-Type': fileInfo.file.type, | |
'X-Meta-Strategy': '1', | |
'X-File-Size-Sig': fileInfo.signature | |
}); | |
return this.http.put(fileInfo.url, fileInfo.file, { | |
headers: headers, | |
reportProgress: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void shellSort(int arr[]) { | |
for (int i = arr.length / 2; i > 0; i /= 2) { | |
for (int j = i; j < arr.length; j += 1) { | |
int value = array[j]; | |
int k; | |
for (k = j; k >= i && array[k - i] > temp; k -= i) { | |
array[k] = array[k - i]; | |
} | |
array[k] = value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void heapSort(int arr[]) { | |
for (int i = arr.length / 2 - 1; i >= 0; i--) { | |
heapify(arr, i); | |
} | |
for (int i = arr.length - 1; i >= 0; i--) { | |
int temp = arr[0]; | |
arr[0] = arr[i]; | |
arr[i] = temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void bucketSort(float[] arr, int bucketCount) { | |
if (bucketCount <= 0) { | |
return; | |
} | |
List<Float>[] bucket = new ArrayList[bucketCount]; | |
for (int i = 0; i < bucketCount; i++) { | |
bucket[i] = new ArrayList<Float>(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void radixSort(int array[]) { | |
int max = array[0]; | |
for (int i = 1; i < array.length; i++) { | |
if (array[i] > max) { | |
max = array[i]; | |
} | |
} | |
for (int i = 1; max / i > 0; i *= 10) { | |
countingSort(array, i); |
NewerOlder