This file contains hidden or 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
| use std::fs; | |
| fn main() { | |
| let s = fs::read_to_string("address.txt").unwrap(); | |
| } |
This file contains hidden or 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
| use std::path::PathBuf; | |
| use clap::{Parser, Subcommand}; | |
| #[derive(Parser)] | |
| #[command(author, version, about, long_about = None)] | |
| struct Cli { | |
| /// Optional name to operate on | |
| name: Option<String>, |
This file contains hidden or 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
| TRY. | |
| cl_salv_table=>factory( IMPORTING | |
| r_salv_table = DATA(salv_table) | |
| CHANGING | |
| t_table = mt_data ). | |
| mt_fields = cl_salv_controller_metadata=>get_lvc_fieldcatalog( | |
| r_columns = salv_table->get_columns( ) " ALV Filter | |
| r_aggregations = salv_table->get_aggregations( ) ). " ALV Aggregations |
This file contains hidden or 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
| REPORT SADL_ALV_IDA_TEST_CDS_VIEW. | |
| parameters : p_cds AS CHECKBOX DEFAULT abap_true. | |
| parameters : p_set_c as checkbox. | |
| end-of-selection. | |
| cl_fpm_ida_test_data_generator=>generate_data_set_demo( ). | |
| if p_cds eq abap_true. | |
| data(alv) = cl_salv_gui_table_ida=>CREATE_FOR_CDS_VIEW( IV_CDS_VIEW_NAME = 'SFPM_IDA_TEST_CDS_EVENT' ). |
This file contains hidden or 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
| **Please use the pattern Z_BC_PROGRAM_HEAD to create the program head** | |
| REPORT yrs_zip. | |
| DATA(z) = NEW cl_abap_zip( ). | |
| DATA(d) = cl_bcs_convert=>string_to_xstring( | |
| iv_string = |Hallo zusammen\n| " Input data | |
| ). | |
| z->add( |
This file contains hidden or 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
| with open("products.json", "r") as read_file: | |
| x = read_file.read() | |
| print(x) |
This file contains hidden or 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
| LOOP AT demo INTO DATA(address) | |
| GROUP BY ( city = address-city count = GROUP SIZE ) | |
| INTO DATA(city_group). | |
| * APPEND value #( city = city-city count = city-count ) TO result. | |
| APPEND city_group TO result. | |
| ENDLOOP. | |
| result = VALUE #( FOR GROUPS city_group OF address IN demo | |
| GROUP BY ( city = address-city | |
| count = GROUP SIZE ) |
This file contains hidden or 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
| void *iter = NULL; | |
| struct fy_node_pair *n; | |
| while( ( n = fy_node_mapping_iterate( mapping, &iter ) ) ) | |
| { | |
| const char *key = fy_node_get_scalar0( fy_node_pair_key( n ) ); | |
| struct fy_node *value = fy_node_pair_key( n ); | |
| } |
This file contains hidden or 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
| char *path = create_config_name( name ); | |
| struct fy_document * doc = fy_document_build_from_file( NULL, path ); |
This file contains hidden or 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
| char *create_config_name( const char *name ) | |
| { | |
| char *p1 = getenv( "HOME" ); | |
| char *p2 = "/."; | |
| int len = strlen( p1 ) + strlen( p2 ) + strlen( name ) + 1; | |
| char *p3 = malloc( len ); | |
| assert( p3 ); | |
| strcpy( p3, p1 ); | |
| strcat( p3, p2 ); | |
| strcat( p3, name ); |
NewerOlder