instruction
stringlengths
0
30k
|html|webrtc|video-streaming|
I am writing a program that embeds Deno however Deno has a lot of dependencies that are using static versions which conflict with the dependencies I have in my main project. To get around this I'm wondering if it's possible to compartmentalize my Deno integration into a seperate crate in my workspace that builds a dynamic rust library that statically contains all of its own dependencies. I'd then consume the dynamic library dynamically from my main application. I know that Rust doesn't have a stable ABI but an rlib compiled on the same version of Rust as the a consumer is compatible - but given the library will live within the same workspace and built as a prerequisite to the main binary - I assume that's fine. Is this possible and would this resolve my issues? Is `crate-type` `rlib` the correct way to do this or would it be `lib`?
Can I compartmentalize dependencies of a crate within a local dynamic rlib?
|rust|
Checkmarx CxSuite is a unique source code analysis solution that provides tools for identifying, tracking, and repairing technical and logical flaws in the source code, such as security vulnerabilities, compliance issues, and business logic problems. Without needing to build or compile a software project's source code, CxSuite builds a logical graph of the code's elements and flows. CxSuite then queries this internal code graph. CxSuite comes with an extensive list of hundreds of preconfigured queries for known security vulnerabilities for each programming language. Using the CxSuite Auditor tool, you can configure your own additional queries for security, QA, and business logic purposes. [Technical Document][1] — Broken link (404) as of 2024-03-12. [1]: https://www.checkmarx.com/knowledge/technical-documents/
From what it looks like this your trying to put this at the bottom of your page, if that's the case it might be easiest to put in your CSS the attribute position and assign it to absolute and then in the attribute bottom to 0px <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> .wave { position: absolute; bottom: 0px; } .background { position: absolute; bottom: 0px; } <!-- language: lang-html --> <body> <div class="background" style="background-color:blue; width: 100%; height:40px" > </div> <div class="wave" style="background-color:orange; width: 100%; height:10px" > </div> </body> <!-- end snippet --> hope this helps!
I have a dataframe which includes the following variables: `covid alert date`, `vax dose 1` to `vax dose 5` (these are vaccine brands), `date dose 1` to `date dose 5` (these are the vaccination dates). The dataset includes all covid vaccines they have ever received however I really only want to keep the vaccine brands and dates that fall before their `covid alert date`. Is there a way to look at the `covid alert date` for each row and only keep the vaccine brands and dates that fall before that date? Anything after that date can be changed to NA. ``` sample_data <- tibble(`covid alert date` = as.Date(c('2022-01-01','2022-02-01','2022-03-01','2022-04-01','2022-05-01','2022-06-01','2022-07-01','2022-08-01','2022-09-01','2022-10-01')), `vax dose 1` = c("Astrazeneca", "Moderna", "Pfizer", "Astrazeneca", "Moderna", "Pfizer", "Astrazeneca", "Moderna", "Pfizer", "Astrazeneca"), `date dose 1` = as.Date(c('2021-01-01','2021-02-01','2021-03-01','2023-04-01','2023-05-01','2021-06-01','2021-07-01','2021-08-01','2023-09-01','2023-10-01')), `vax dose 2` = c("Astrazeneca", "Moderna", "Pfizer", "Astrazeneca", "Moderna", "Pfizer", NA, NA, NA, NA), `date dose 2` = as.Date(c('2021-04-01','2021-03-01','2021-05-01','2023-06-01','2023-07-01', '2021-08-01', NA, NA, NA, NA)), `vax dose 3` = c("Pfizer", "Moderna", "Pfizer", "Moderna", NA, NA, NA, NA, NA, NA), `date dose 3` = as.Date(c('2022-04-01','2021-12-01','2021-12-01','2023-12-01', NA, NA, NA, NA, NA, NA)), `vax dose 4` = c("Pfizer", "Moderna", NA, NA, NA, NA, NA, NA, NA, NA), `date dose 4` = as.Date(c('2022-12-01','2022-12-01', NA, NA, NA, NA, NA, NA, NA, NA)), `vax dose 5` = c("Moderna", NA, NA, NA, NA, NA, NA, NA, NA, NA), `date dose 5` = as.Date(c('2023-11-01', NA, NA, NA, NA, NA, NA, NA, NA, NA))) ``` I am very new to using R so any assistance is greatly appreciated. I have included some sample data above. Thanks in advance.
https://docs.coqui.ai/en/latest/tutorial_for_nervous_beginners.html TTS demo in winodw Excute ``` set CUDA_VISIBLE_DEVICES=0 & python train.py ``` this is error message ``` RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase. This probably means that you are not using fork to start your child processes and you have forgotten to use the proper idiom in the main module: if __name__ == '__main__': freeze_support() ... The "freeze_support()" line can be omitted if the program is not going to be frozen to produce an executable. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main exitcode = _main(fd, parent_sentinel) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main prepare(preparation_data) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare _fixup_main_from_path(data['init_main_from_path']) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path main_content = runpy.run_path(main_path, File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 268, in run_path return _run_module_code(code, init_globals, run_name, File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\dzj05\Desktop\1\tts.py", line 84, in <module> trainer.fit() File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\site-packages\trainer\trainer.py", line 1860, in fit remove_experiment_folder(self.output_path) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\site-packages\trainer\generic_utils.py", line 77, in remove_experiment_folder fs.rm(experiment_path, recursive=True) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\site-packages\fsspec\implementations\local.py", line 172, in rm shutil.rmtree(p) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 749, in rmtree return _rmtree_unsafe(path, onerror) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 627, in _rmtree_unsafe onerror(os.unlink, fullname, sys.exc_info()) File "C:\Users\dzj05\AppData\Local\Programs\Python\Python39\lib\shutil.py", line 625, in _rmtree_unsafe os.unlink(fullname) PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:/Users/dzj05/Desktop/1/run-February-26-2024_10+28PM-0000000\\trainer_0_log.txt' ``` but i don't use C:/Users/dzj05/Desktop/1/run-February-26-2024_10+28PM-0000000\\trainer_0_log.txt create a folder is also like this
use tts demo but prompt file occupation
|text-to-speech|coqui|
null
def function1(dd:pd.DataFrame): if dd.pipe(len)<2: return dd.assign(tdiff='off',accum=0) else: dd1=dd.assign(tdiff=1,accum=range(0,dd.pipe(len))) dd1.loc[dd.index.min(),'tdiff']=pd.NA return dd1 col1=df1.state.ne(1).cumsum() df1.assign(col1=col1).groupby(['state',col1],as_index=False).apply(function1) : timestamp state tdiff accum 0 2020-01-01 00:00:00 0 off NaN 1 2020-01-01 00:00:01 0 off NaN 2 2020-01-01 00:00:02 0 off NaN 3 2020-01-01 00:00:03 1 NaN NaN 4 2020-01-01 00:00:04 1 1 1.0 5 2020-01-01 00:00:05 1 1 2.0 6 2020-01-01 00:00:06 1 1 3.0 7 2020-01-01 00:00:07 0 off NaN 8 2020-01-01 00:00:08 0 off NaN 9 2020-01-01 00:00:09 0 off NaN 10 2020-01-01 00:00:10 0 off NaN 11 2020-01-01 00:00:11 1 NaN NaN 12 2020-01-01 00:00:12 1 1 1.0 13 2020-01-01 00:00:13 1 1 2.0 14 2020-01-01 00:00:14 1 1 3.0 15 2020-01-01 00:00:15 1 1 4.0 16 2020-01-01 00:00:16 1 1 5.0 17 2020-01-01 00:00:17 0 off NaN 18 2020-01-01 00:00:18 0 off NaN 19 2020-01-01 00:00:19 0 off NaN 20 2020-01-01 00:00:20 0 off NaN
{"Voters":[{"Id":44729,"DisplayName":"genpfault"},{"Id":1974224,"DisplayName":"Cristik"},{"Id":466862,"DisplayName":"Mark Rotteveel"}],"SiteSpecificCloseReasonIds":[13]}
I want to fetch the child user ID based on the parent ID. I have found a solution https://stackoverflow.com/questions/45444391/how-to-count-members-in-15-level-deep-for-each-level-in-php but am getting some errors. I have created a class - ``` <?php Class Team extends Database { private $dbConnection; function __construct($db) { $this->dbConnection = $db; } public function getDownline($id, $depth=5) { $stack = array($id); for($i=1; $i<=$depth; $i++) { // create an array of levels, each holding an array of child ids for that level $stack[$i] = $this->getChildren($stack[$i-1]); } return $stack; } public function countLevel($level) { // expects an array of child ids settype($level, 'array'); return sizeof($level); } private function getChildren($parent_ids = array()) { $result = array(); $placeholders = str_repeat('?,', count($parent_ids) - 1). '?'; $sql="select id from users where pid in ($placeholders)"; $stmt=$this->dbConnection->prepare($sql); $stmt->execute(array($parent_ids)); while($row=$stmt->fetch()) { $results[] = $row->id; } return $results; } } ``` I am using the class like this - ``` $id = 4; $depth = 2; // get the counts of his downline, only 2 deep. $downline_array = $getTeam->getDownline($id, $depth=2); ``` I am getting errors - In line $placeholders = str_repeat('?,', count($parent_ids) - 1). '?'; > Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be > of type Countable|array, int given in and second > Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter > number: number of bound variables does not match number of tokens in line $sql="select id from users where pid in ($placeholders)"; $stmt=$this->dbConnection->prepare($sql); I want to fetch the child user ID in 5 levels . PHP VERSION 8.1
This question is a continuation of my previous one about https://stackoverflow.com/questions/78218233/re-binding-the-selectinput-of-a-datatable-after-being-updated. So, I made quite some progress on this app and I have reached a result that perfectly fits my needs. The app correctly updates the target database and the selectInputs as well as the filter are intuitive and user-friendly enought for what I seek. There is however one issue, not a critical one but still rather annoying. When the "Update Data" button is clicked on and the underlying data is updated, the displayed datatable acts as if there where no category selected in the filter and returns an empty table. This issue is fixed the moment a modification is made on the filtered categories through the filter button and it doesn't stop the database to be correctly updated, but this is not an expected behaviour. What is weird is that it seems to be caused by the the virtualSelectInput filter and not the fact that the underlying is filtered, because when I filter it directly in the code, it works just fine. Well aside from the fact that when doing the latter options, if the "Update Data" button is clicked on while no SelectInput has been changed, it will not trigger any update after that even if a SelectInput was later on changed to another value, whereas it works as intended as long as a SelectInput has been changed vefore each time the "Update Data" button has been triggered. I suspect those two issues to be related one way or another. Is there something that I missed or mishandled ? Below are the records of the issues : [![First Issue][1]][1] * Issue where the DataTable is empty after an update, but display the change after resetting the filters [![Normal Behaviour][2]][2] * Without the virtualSelectInput acting as a filter (expected behaviour) [![Issue 2][3]][3] * Without the virtualSelectInput acting as a filter, but without changing a SelectInput before updating a first time (cannot update a change after that) **Here are the commands to create the dummy database used for the app :** ``` ### Initialize the two MySQL Databases used in the code # The Databases are not important in themselves but are handy to test and tinker what I need CREATE TABLE Z_TEST (ID INT PRIMARY KEY NOT NULL, Divinite VARCHAR(20), ID_pantheon INT); CREATE TABLE Z_TEST2 (id_pantheon INT PRIMARY KEY NOT NULL, nom_pantheon VARCHAR(20)), id_parent INT; INSERT INTO Z_TEST VALUES (1, "Quetzalcoatl", 5), (2, "Odin", 1), (3, "Ra", 3), (4, "Zeus", 1), (5, "Tiamat", 4), (6, "Isis", 0), (7, "Hades", 0), (8, "Thot", 0), (9, "Thor", 0), (10, "Persephone", 0), (11, "Amatsu", 0); INSERT INTO Z_TEST2 VALUES (0, Non Défini", NULL), (1, "Grec", NULL), (2, "Egyptien", NULL), (3, "Nordique", NULL), (4, "Sumerien", NULL), (5, "Azteque", NULL), (6, "Japonais", NULL) (7, "Mineure", 1), (8, "Majeure", 1), (9, "Mineure", 2), (10, "Majeure", 2), (11, "Mineure", 3), (12, "Majeure", 3); ### Display each Database and their join SELECT * FROM Z_TEST; SELECT * FROM Z_TEST2; SELECT ID, Divinite, Z_TEST.ID_pantheon, nom_pantheon FROM Z_TEST LEFT JOIN Z_TEST2 ON Z_TEST.ID_pantheon = Z_TEST2.id_pantheon; ``` **Here is the code used to create the app :** ``` ### Libraries { library(shiny) # used to create the Shiny App library(bslib) # used to create the framework of the Shiny App library(shinyWidgets) # used to create various widgets library(RMySQL) # used to access the Database library(lares) # used to import logins for the Database library(tidyverse) # used for many things (mainly data manipulation) library(DT) # used for creating interactive DataTable } ### JS Module # Allows the use of arrow keys to move from cell to celle and the Enter key to confirm an edit # Also unbinds the Select Input ids when "Update Data" is clicked (Essential) js <- c( "table.on('key', function(e, datatable, key, cell, originalEvent){", " var targetName = originalEvent.target.localName;", " if(key == 13 && targetName == 'body'){", " $(cell.node()).trigger('dblclick.dt');", " }", "});", "table.on('keydown', function(e){", " var keys = [9,13,37,38,39,40];", " if(e.target.localName == 'input' && keys.indexOf(e.keyCode) > -1){", " $(e.target).trigger('blur');", " }", "});", "table.on('key-focus', function(e, datatable, cell, originalEvent){", " var targetName = originalEvent.target.localName;", " var type = originalEvent.type;", " if(type == 'keydown' && targetName == 'input'){", " if([9,37,38,39,40].indexOf(originalEvent.keyCode) > -1){", " $(cell.node()).trigger('dblclick.dt');", " }", " }", "});", "$('#updateButton').on('click', function() {", " Shiny.unbindAll(table.table().node());", "});" ) ### Queries QDisplay <- " SELECT ID, Divinite, Z_TEST.ID_pantheon AS ID_Panth, PT1.id_parent AS ID_Panth_parent, PT1.nom_pantheon AS Pantheon, PT2.nom_pantheon AS Panth_parent FROM Z_TEST LEFT JOIN Z_TEST2 AS PT1 ON Z_TEST.ID_pantheon = PT1.id_pantheon LEFT JOIN Z_TEST2 AS PT2 ON PT2.id_pantheon = PT1.id_parent; " QGetID <- " SELECT id_pantheon AS ID_Panth FROM Z_TEST2 WHERE nom_pantheon = '%s' " QGetIDIfParent <- " SELECT PT1.id_pantheon AS ID_Panth FROM Z_TEST2 AS PT1 LEFT JOIN Z_TEST2 AS PT2 ON PT2.id_pantheon = PT1.id_parent WHERE PT1.nom_pantheon = '%s'AND PT2.nom_pantheon = '%s' " QEdit <- " UPDATE Z_TEST SET ID_pantheon = %d WHERE ID = %d " QRef <- " SELECT PT1.id_pantheon AS ID_Panth, PT1.nom_pantheon AS Panth_nom, PT1.id_parent AS ID_Panth_parent, PT2.nom_pantheon AS Panth_nom_parent FROM Z_TEST2 AS PT1 LEFT JOIN Z_TEST2 AS PT2 ON PT2.id_pantheon = PT1.id_parent " ### Database Connection mydbGetQuery <- function(Query) { DB <- dbConnect ( MySQL(), dbname = get_creds("dummy_db")$dbname, host = get_creds("dummy_db")$host, user = get_creds("dummy_db")$user, password = get_creds("dummy_db")$password ) data <- dbGetQuery(DB, Query) dbDisconnect(DB) return(data) } ### Useful functions # Create levels to choose from in the Select Input factorOptions <- function(factor_levels) { optionList <- "" for (i in factor_levels) { optionList <- paste0(optionList, '<option value="', i, '">', i, '</option>\n')} return(optionList) } # Create the Select Input with ID and corresponding entry from the joined table mySelectInput <- function(id_list, selected_factors, factor_levels) { select_input <- paste0('<select id="single_select_', id_list, '"style="width: 100%;">\n', sprintf('<option value="%s" selected>%s</option>\n', selected_factors, selected_factors), factorOptions(factor_levels), '</select>') return(select_input) } # Get the reference levels for the Select Input and Filter dt_panth_ref <- mydbGetQuery(QRef) %>% as_tibble() %>% mutate(unique_libelle = ifelse(is.na(Panth_nom_parent), Panth_nom, paste0(Panth_nom_parent, " / ", Panth_nom)), Categorie = ifelse(is.na(Panth_nom_parent), Panth_nom, Panth_nom_parent)) # Preset options for the displayed table displayTable <- function(data) { displayed_table <- datatable( data = data , selection = 'none', escape = FALSE, rownames = FALSE, editable = list(target = 'cell', disable = list(columns = c(0:6))), callback = JS(js), extensions = "KeyTable", options = list( # dom = "iftp", # columnDefs = list(list(visible = FALSE, targets = c(0:1, 6:8))), keys = TRUE, pageLength = 15, preDrawCallback = JS('function(){Shiny.unbindAll(this.api().table().node());}'), drawCallback = JS('function(){Shiny.bindAll(this.api().table().node());}') ) ) return(displayed_table) } ### Shiny App ui <- page_sidebar( sidebar = card_body( virtualSelectInput( inputId = "idFilter", label = "Filtre :", choices = prepare_choices( dt_panth_ref, label = Panth_nom, value = ID_Panth, group_by = Categorie ), multiple = TRUE, selected = 0:12, width = "100%", dropboxWrapper = "body" ), br(), actionButton("updateButton", "Update Data") ), card(DTOutput("interactiveTable")) ) server <- function(input, output, session) { # Fetch the underlying data panth_data <- reactiveVal() observe(panth_data(mydbGetQuery(QDisplay) %>% as_tibble() %>% replace_na(list(Pantheon = "Non Défini")) %>% mutate(unique_libelle = ifelse(is.na(Panth_parent), Pantheon, paste0(Panth_parent, " / ", Pantheon))) %>% filter(ID_Panth %in% input$idFilter) )) # Initialize the DataTable output$interactiveTable <- renderDT({ filt_panth <- panth_data() %>% filter(ID_Panth %in% input$idFilter) if (nrow(filt_panth) > 0) { displayTable(data = filt_panth %>% mutate(Select_Pantheon = mySelectInput(ID, unique_libelle, dt_panth_ref %>% pull(unique_libelle)))) } else { displayTable(data = filt_panth %>% mutate(Select_Pantheon = NA)) } }) observeEvent(input$updateButton, { rows_filtered <- input$interactiveTable_rows_all rows_displayed <- rows_filtered[1:min(length(rows_filtered), input$interactiveTable_state$length)] # Fetch the corresponding ID of the selected gamme and update the database for (h in panth_data()$ID[rows_displayed]) { h_input <- as.character(input[[paste0("single_select_", h)]]) current_h <- filter(panth_data(), ID == h)$unique_libelle # print(paste0("h : ", h, " (", class(h), ")")) # print(paste0("h_input : ", h_input, " (", class(h_input), ")")) # print(paste0("current_h : ", current_h, " (", class(current_h), ")")) # print("") if (h_input != current_h) { split_input <- str_split(h_input, " / ")[[1]] if (length(split_input) == 1) { i <- mydbGetQuery(sprintf(QGetID, split_input))$ID_Panth } else { i <- mydbGetQuery(sprintf(QGetIDIfParent, split_input[2], split_input[1]))$ID_Panth } mydbGetQuery(sprintf(QEdit, i, h)) } } # print("---") # Update the underlying data observe( panth_data(mydbGetQuery(QDisplay) %>% as_tibble() %>% replace_na(list(Pantheon = "Non Défini")) %>% mutate(unique_libelle = ifelse(is.na(Panth_parent), Pantheon, paste0(Panth_parent, " / ", Pantheon))) %>% filter(ID_Panth %in% input$input$idFilter) )) }) session$onSessionEnded(function() {stopApp()}) } shinyApp(ui, server) ``` # Important Note : You must edit the "mydbGetQuery" function by replacing the credentials inside with either the one associated with your MySQL database in your config.yml file (if you intend to use lares) or directly with the plain-text credentials (simplest option) [1]: https://i.stack.imgur.com/VapAB.gif [2]: https://i.stack.imgur.com/aGE8m.gif [3]: https://i.stack.imgur.com/l0wzS.gif
DataTable not diplaying correctly after being updated
|r|shiny|dt|shiny-reactivity|shinywidgets|
in way of optimization i decide to init push in other process, its works well in android 10 and higher but push isnt showen in lower versions of android i need it works well in all android versions this is my manifest code ``` <receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND" android:process=":pushprocess" tools:node="replace"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </receiver> <service android:name="FirebaseMessagingService" android:exported="false" tools:node="replace" android:process=":pushprocess"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service> ```
Further digging into the documentation there is an attribute 'autoalign' which I need to set to false when creating the TableView
I got it to work! Go to https://build.docker.com/accounts/YourAccountName/builders Define a new builder there. Then try the create again with the name of the builder you just defined!
There Some doubts about used RDBMS. I will offer a solution without using regexp. ``` select id,words ,string_agg(w,'-' order by rn) newWords from( select * ,row_number()over(partition by id order by (select null)) rn ,count(*)over(partition by id order by (select null)) cnt from(select *,string_to_table(words,'-') w from test )t )t2 where rn>3 and rn<=(cnt-2) group by id,words ``` or (using ordinality) ``` select id,words ,string_agg(w,'-' order by wn) newWords from( select * ,ordinality wn ,count(*)over(partition by id order by (select null)) cnt from(select * from test cross join string_to_table(words,'-') with ordinality as w )t )t2 where wn>3 and wn<=(cnt-2) group by id,words ``` Output is |id| words| newwords| |-:|:-----------------|:-----------| |1| GLOBE-WORLD-AIRPORT-Azerbaijan-country-SECRET-ABORT| Azerbaijan-country| |2| GLOBE-WORLD-AIRPORT-Azerbaijan-country-SECRET| Azerbaijan| from test data |id| words| |-:|:---------| |1| GLOBE-WORLD-AIRPORT-Azerbaijan-country-SECRET-ABORT| |2| GLOBE-WORLD-AIRPORT-Azerbaijan-country-SECRET| |3| GLOBE-WORLD-AIRPORT-Azerbaijan-country| |4| GLOBE-WORLD-AIRPORT-Azerbaijan| |5| GLOBE-WORLD-AIRPORT| |6| GLOBE-WORLD| string_to_table actual from postgresql 14.
I am trying to call a function included in the C standard library (namely, `puts`, but it shouldn't matter) from an assembly program. Creating an object file from the assembly code works but the linking stage does not. As I am a complete beginner on assembly programming I am basically unable to even interpret the error messages. Any help or explanation on what is going wrong would be really appreciated! I loosely followed this [tutorial](https://cs.lmu.edu/~ray/notes/nasmtutorial/), but having code identical to it still doesn't work. My expectation is that I would get an executable file, but in reality I don't get past the linking stage. My code: (`file.asm`) ``` global main extern puts section .text main: mov rdi, msg call puts ret msg: db "Hello, world!", 0 ``` Commands and errors: ``` $ nasm -felf64 file.asm $ gcc file.o /usr/bin/ld: warning: file.o: missing .note.GNU-stack section implies executable stack /usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker /usr/bin/ld: file.o: warning: relocation in read-only section `.text' /usr/bin/ld: file.o: relocation R_X86_64_PC32 against symbol `puts@@GLIBC_2.2.5' can not be used when making a PIE object; recompile with -fPIE /usr/bin/ld: final link failed: bad value collect2: error: ld returned 1 exit status $ ``` I have tried searching for help on this on the internet but I see no difference from what I am already doing.
|c|assembly|x86-64|nasm|linker-errors|
I am using azure-devops-migration-tools to migrate from TFS 2017 to Azure Devops SERVER 2022. I have some questions. 1) Validation - Not all Test plans are migrated. Trying to come up with a way of quickly verifying all the Test Plans and Test Suite have been migrated. A Query in the source shows more test plans / suites than in the destination. However, the number of test plans / suites visible in the "Tests" app of TFS does appear to match. Can't really tell with Test suites because there are so many. Since there is limited to no filtering capabilities I am wondering which Test Plans / Suites get skipped and if there is a way to identify them in the source before the migration. 2) We ran into an issue in one migration where test suites were not completely migrated because of being associated with test cases which had INACTIVE test configurations. We made all the test configurations ACTIVE on the source in hopes of getting a complete migration, but the test configurations were not updated and remained INACTIVE on the target. Do Test Plans, Suites, Configurations get updated like work items do? Just trying to come up with a best practice for Test "objects" so I can validate what was migrated. Also an understanding of what will definitely not be migrated because it is not possible. This is so I can set Product Team expectations and be able to quantitatively analyze the results and be confident I migrated all that is possible to migrate.
azure-devops-migration-tools and having difficulty validating results and it is not updating previously migrated Test Configurations
|azure-devops-migration-tools|
null
my task is to create drag and drop interface, where user drags an element, which changes its appearance during that short amount of time - till it is dropped in its destination. I would like to do it with native Web API. I have found the event called "dragstart" in [MDN Documentation][1]. And prepared this [fiddle][2] to demonstrate the behaviour. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const source = document.getElementById("draggable"); source.addEventListener("dragstart", (event) => { event.target.classList.add("dragging"); }); source.addEventListener("dragend", (event) => { event.target.classList.remove("dragging"); }); <!-- language: lang-css --> body { /* Prevent the user from selecting text in the example */ user-select: none; } #container { width: 400px; height: 20px; background: blueviolet; padding: 10px; } #draggable { text-align: center; background: white; } .dragging { width: 422px; color: red; font-weight: 700; } <!-- language: lang-html --> <div id="container"> <div id="draggable" draggable="true">Drag me</div> </div> <div class="dropzone"></div> <!-- end snippet --> However the result is not sufficient. In my task I need the default element to persist its appearance and change only the dragged minimised version of it - ideally it should be narrower and show a little different content than the default element. If you knew any source, where this task is resolved (anyhow), I'd be glad for your reply. [1]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dragstart_event [2]: https://jsfiddle.net/xL2wy0uv/2/
I'm currently confused about windows and states. Suppose I have a program that counts user access data every minute and needs to do sum statistics in each window. Assume that at this time, I configure checkpoint for the fault tolerance of the program. The checkpoint configuration is to trigger every 30 seconds. Then when the time is 01:00, the program hangs. In theory, it can only be restored to the state data at 00:30, but there is no trigger window at 00:30. After calculation, we get the kafka offset data at 00:30 and the window data at 00:00. Is there any problem with my understanding? here is my program,flink version is 1.14: [flink graph][1] build stream config is config.getDelayMaxDuration() = 60000,config.getAggregateWindowMillisecond()=60000 SingleOutputStreamOperator<BaseResult> wordCountSampleStream = subStream.assignTimestampsAndWatermarks( WatermarkStrategy.<MetricEvent>forBoundedOutOfOrderness(config.getDelayMaxDuration()) .withTimestampAssigner(new MetricEventTimestampAssigner()) .withIdleness(config.getWindowIdlenessTime()) ).setParallelism(CommonJobConfig.getParallelismOfSubJob("WORD_COUNT_SAMPLE_TEST")) .flatMap(new WordCountToResultFlatMapFunction(config)).setParallelism(CommonJobConfig.getParallelismOfSubJob("WORD_COUNT_SAMPLE_TEST")) .keyBy(new BaseResultKeySelector()) .window(TumblingEventTimeWindows.of(Time.milliseconds(config.getAggregateWindowMillisecond()))) .apply(new WordCountWindowFunction(config)).setParallelism(CommonJobConfig.getParallelismOfSubJob("WORD_COUNT_SAMPLE_TEST")); wordCountSampleStream.addSink(sink).setParallelism(CommonJobConfig.getParallelismOfSubJob("WORD_COUNT_SAMPLE_TEST")); window apply function: public class WordCountWindowFunction extends RichWindowFunction<BaseResult, BaseResult, String, TimeWindow> { private StreamingConfig config; private Logger logger = LoggerFactory.getLogger(WordCountWindowFunction.class); public WordCountWindowFunction(StreamingConfig config) { this.config = config; } @Override public void close() throws Exception { super.close(); } @Override public void apply(String s, TimeWindow window, Iterable<BaseResult> input, Collector<BaseResult> out) throws Exception { WordCountEventPortrait result = new WordCountEventPortrait(); long curWindowTimestamp = window.getStart() / config.getAggregateWindowMillisecond() * config.getAggregateWindowMillisecond(); result.setDatasource("word_count_test"); result.setTimeSlot(curWindowTimestamp); for (BaseResult sub : input) { logger.info("in window cur sub is {} ", sub); WordCountEventPortrait curInvoke = (WordCountEventPortrait) sub; result.setTotalCount(result.getTotalCount() + curInvoke.getTotalCount()); result.setWord(curInvoke.getWord()); } logger.info("out window result is {} ", result); out.collect(result); } } sink function: public class ClickHouseRichSinkFunction extends RichSinkFunction<BaseResult> implements CheckpointedFunction { private ConcurrentHashMap<String, SinkBatchInsertHelper<BaseResult>> tempResult = new ConcurrentHashMap<>(); private ClickHouseDataSource dataSource; private Logger logger = LoggerFactory.getLogger(ClickHouseRichSinkFunction.class); @Override public void snapshotState(FunctionSnapshotContext context) throws Exception { for (Map.Entry<String, SinkBatchInsertHelper<BaseResult>> helper : tempResult.entrySet()) { helper.getValue().insertAllTempData(); } } @Override public void initializeState(FunctionInitializationContext context) throws Exception { } @Override public void open(Configuration parameters) throws Exception { Properties properties = new Properties(); properties.setProperty("user", CommonJobConfig.CLICKHOUSE_USER); properties.setProperty("password", CommonJobConfig.CLICKHOUSE_PASSWORD); dataSource = new ClickHouseDataSource(CommonJobConfig.CLICKHOUSE_JDBC_URL, properties); } @Override public void close() { AtomicInteger totalCount = new AtomicInteger(); tempResult.values().forEach(it -> { totalCount.addAndGet(it.getTempList().size()); batchSaveBaseResult(it.getTempList()); it.getTempList().clear(); }); } @Override public void invoke(BaseResult value, Context context) { tempResult.compute(value.getDatasource(), (datasource, baseResults) -> { if (baseResults == null) { baseResults = new SinkBatchInsertHelper<>(CommonJobConfig.COMMON_BATCH_INSERT_COUNT, needToInsert -> batchSaveBaseResult(needToInsert), CommonJobConfig.BATCH_INSERT_INTERVAL_MS); } baseResults.tempInsertSingle(value); return baseResults; }); } private void batchSaveBaseResult(List<BaseResult> list) { if (list.isEmpty()) { return; } String sql = list.get(0).getPreparedSQL(); try { try (PreparedStatement ps = dataSource.getConnection().prepareStatement(sql)) { for (BaseResult curResult : list) { curResult.addParamsToPreparedStatement(ps); ps.addBatch(); } ps.executeBatch(); } } catch (SQLException error) { log.error("has exception during batch insert,datasource is {} ", list.get(0).getDatasource(), error); } } } batch insert helper: public class SinkBatchInsertHelper<T> { private List<T> waitToInsert; private ReentrantLock lock; private int bulkActions; private AtomicInteger tempActions; private Consumer<List<T>> consumer; private AtomicLong lastSendTimestamp; private long sendInterval; private Logger logger = LoggerFactory.getLogger(SinkBatchInsertHelper.class); public SinkBatchInsertHelper(int bulkActions, Consumer<List<T>> consumer, long sendInterval) { this.waitToInsert = new ArrayList<>(); this.lock = new ReentrantLock(); this.bulkActions = bulkActions; this.tempActions = new AtomicInteger(0); this.consumer = consumer; this.sendInterval = sendInterval; this.lastSendTimestamp = new AtomicLong(0); } public void tempInsertSingle(T data) { lock.lock(); try { waitToInsert.add(data); if (tempActions.incrementAndGet() >= bulkActions || ((System.currentTimeMillis() - lastSendTimestamp.get()) >= sendInterval)) { batchInsert(); } } finally { lastSendTimestamp.set(System.currentTimeMillis()); lock.unlock(); } } public long insertAllTempData() { lock.lock(); try { long result = tempActions.get(); if (tempActions.get() > 0) { batchInsert(); } return result; } finally { lock.unlock(); } } private void batchInsert() { for(T t: waitToInsert){ logger.info("batch insert data:{}", t); } consumer.accept(waitToInsert); waitToInsert.clear(); tempActions.set(0); } public int getTempActions() { return tempActions.get(); } public List<T> getTempList() { lock.lock(); try { return waitToInsert; } finally { lock.unlock(); } } } The resulting phenomenon is: Suppose I cancel the task at 00:31:30, then when I restart the task, the statistics at 00:31:00 will be less than expected. I found out by printing records that it was because when the sink wrote the data at 00:30:00, the kafka consumer had actually consumed the data after 00:31:00, but this part of the data was not written to ck. , it was not replayed in the window when restarting, so this part of the data was lost. The statistics will not return to normal until 00:32:00. [1]: https://i.stack.imgur.com/03630.png
I want to be able to measure any code snippet time complexity. Is there a general rule or step by step approach to measure any big o (besides dominant term, removing constants and factors)? What math skills should I have, if so, what are the prerequisites for those skills? Here is one of those: ``` int fun(int n) { int count = 0; for (i = n; i > 0; i /= 2) { for (j = 0; j < i; j++) { count += 1; } } return count; } ``` I've read many algorithms books, but they're mathy and not beginner-friendly.
How to find big o of dependent loops and recursive functions?
|algorithm|time-complexity|big-o|complexity-theory|
null
The `cy.stub()` command uses Sinon under the hood, so the first thing you need is the [sinon types](https://www.npmjs.com/package/@types/sinon): ```js npm install --save @types/sinon ``` and add in **tsconfig.json** ```js { "compilerOptions": { ... "types": ["cypress", "@testing-library/cypress", "node", "@types/sinon/index.d.ts"] ``` Then in the test you can solve #1 wrappedMethod with a cast, and #2 `.as()` by reversing the chaining order ```js cy.window().then((win) => { cy.stub(win, 'open') .as('open') .callsFake((url, target) => { expect(target).to.be.undefined; return (win.open as sinon.SinonStub).wrappedMethod.call(win, url, '_self') }) }) ```
I am using an old shader used for a character model from the Unity asset store that has depreciated. The asset has been made free and some people have put out some updated versions but no one has put out a shader that works in VR without enabling the multipass. I have looked at Unity's guide for amending shaders for VR: [text](https://docs.unity3d.com/2023.1/Documentation/Manual/SinglePassInstancing.html) I have tied to follow this guide with my little to none experience with Shaders but I cannot get it to work. Can anyone help me to update the shader so it works? Any help would be greatly appreciated. The shader code is below: ``` Shader "MCS/Volund Variants/Standard Character (Specular, Surface)" { Properties { _Color("Color", Color) = (1,1,1,1) _MainTex("Albedo", 2D) = "white" {} _AlphaTex("Alpha", 2D) = "white" {} _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5 _Glossiness("Smoothness", Range(0.0, 1.0)) = 0.5 _SpecColor("Specular", Color) = (0.2,0.2,0.2) _SpecGlossMap("Specular", 2D) = "white" {} _BumpScale("Scale", Float) = 1.0 _BumpMap("Normal Map", 2D) = "bump" {} _Parallax ("Height Scale", Range (0.005, 0.08)) = 0.02 _ParallaxMap ("Height Map", 2D) = "black" {} _OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0 _OcclusionMap("Occlusion", 2D) = "white" {} _EmissionColor("Color", Color) = (0,0,0) _EmissionMap("Emission", 2D) = "white" {} _DetailMask("Detail Mask", 2D) = "white" {} _DetailAlbedoMap("Detail Albedo x2", 2D) = "grey" {} _DetailNormalMapScale("Scale", Float) = 1.0 _DetailNormalMap("Normal Map", 2D) = "bump" {} [Enum(UV0,0,UV1,1)] _UVSec ("UV Set for secondary textures", Float) = 0 // UI-only data [HideInInspector] _EmissionScaleUI("Scale", Float) = 0.0 [HideInInspector] _EmissionColorUI("Color", Color) = (1,1,1) // Blending state [HideInInspector] _Mode ("__mode", Float) = 0.0 [HideInInspector] _SrcBlend ("__src", Float) = 1.0 [HideInInspector] _DstBlend ("__dst", Float) = 0.0 [HideInInspector] _ZWrite ("__zw", Float) = 1.0 // Volund properties [HideInInspector] _CullMode ("__cullmode", Float) = 2.0 [HideInInspector] _SmoothnessInAlbedo ("__smoothnessinalbedo", Float) = 0.0 _SmoothnessTweak1("Smoothness Scale", Range(0.0, 4.0)) = 1.0 _SmoothnessTweak2("Smoothness Bias", Range(-1.0, 1.0)) = 0.0 _SpecularMapColorTweak("Specular Color Tweak", Color) = (1,1,1,1) _PlaneReflectionBumpScale("Plane Reflection Bump Scale", Range(0.0, 1.0)) = 0.4 _PlaneReflectionBumpClamp("Plane Reflection Bump Clamp", Range(0.0, 0.15)) = 0.05 } CGINCLUDE #define UNITY_SETUP_BRDF_INPUT SpecularSetup #define USE_SMOOTHNESS_TWEAK ENDCG SubShader { Tags { "RenderType"="Opaque" "PerformanceChecks"="False" } LOD 300 // ------------------------------------------------------------------ // Base forward pass (directional light, emission, lightmaps, ...) Pass { Name "FORWARD" Tags { "LightMode" = "ForwardBase" } Blend [_SrcBlend] [_DstBlend] ZWrite [_ZWrite] Cull [_CullMode] CGPROGRAM #pragma target 3.0 //#pragma only_renderers d3d11 d3d9 opengl glcore // ------------------------------------- #pragma shader_feature _NORMALMAP #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON #pragma shader_feature _EMISSION #pragma shader_feature _SPECGLOSSMAP #pragma shader_feature ___ _DETAIL_MULX2 #pragma shader_feature _AlphaTex; // Volund variants #pragma shader_feature SMOOTHNESS_IN_ALBEDO #pragma multi_compile_fwdbase nolightmap #pragma multi_compile_fog #pragma vertex vertForwardBase #pragma fragment fragForwardBase #include "Volund_UnityStandardCore.cginc" ENDCG } // ------------------------------------------------------------------ // Additive forward pass (one light per pass) Pass { Name "FORWARD_DELTA" Tags { "LightMode" = "ForwardAdd" } Blend [_SrcBlend] One Fog { Color (0,0,0,0) } // in additive pass fog should be black ZWrite Off ZTest LEqual Cull [_CullMode] CGPROGRAM #pragma target 3.0 //#pragma only_renderers d3d11 d3d9 opengl glcore // ------------------------------------- #pragma shader_feature _NORMALMAP #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON #pragma shader_feature _SPECGLOSSMAP #pragma shader_feature ___ _DETAIL_MULX2 // Volund variants #pragma shader_feature SMOOTHNESS_IN_ALBEDO #pragma multi_compile_fwdadd_fullshadows #pragma multi_compile_fog #pragma vertex vertForwardAdd #pragma fragment fragForwardAdd #include "Volund_UnityStandardCore.cginc" ENDCG } // ------------------------------------------------------------------ // Shadow rendering pass Pass { Name "ShadowCaster" Tags { "LightMode" = "ShadowCaster" } ZWrite On ZTest LEqual Cull [_CullMode] CGPROGRAM #pragma target 3.0 //#pragma only_renderers d3d11 d3d9 opengl glcore // ------------------------------------- #pragma shader_feature _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON #pragma multi_compile_shadowcaster #pragma vertex vertShadowCaster #pragma fragment fragShadowCaster #include "UnityStandardShadow.cginc" ENDCG } } FallBack "Morph3D/Volund Variants/Standard Character (Legacy)" CustomEditor "VolundMultiStandardShaderGUI" } ```
UNITY_VERTEX_INPUT_INSTANCE_ID use in custom shader
|c#|unity-game-engine|shader|mcs|
null
`idx.get_level_values` seems to be the fastest. However, since MultiIndexes are iterables, an easy way would be to use [`zip`](https://docs.python.org/3/library/functions.html#zip): ``` out = list(zip(*idx)) ``` Output: `[('A', 'A', 'B', 'B'), ('C', 'D', 'C', 'D')]` As lists: ``` out = list(map(list, zip(*idx))) # [['A', 'A', 'B', 'B'], ['C', 'D', 'C', 'D']] ``` #### timings Tested on 20 levels, ~1M rows: ``` # list(zip(*idx)) 733 ms ± 17.6 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) # [idx.get_level_values(i) for i in range(len(idx[0]))] 175 ms ± 3.59 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) # list(map(idx.get_level_values, range(idx.nlevels))) 175 ms ± 969 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) # [[x for x in idx.get_level_values(level)] for level in range(idx.nlevels)] 1.15 s ± 15.1 ms per loop (mean ± std. dev. of 7 runs, 1 loop each) ```
{"Voters":[{"Id":12265927,"DisplayName":"Puteri"},{"Id":466862,"DisplayName":"Mark Rotteveel"},{"Id":354577,"DisplayName":"Chris"}],"SiteSpecificCloseReasonIds":[18]}
I'm working on a blog in Astro, and I'm trying to render the markdown from the blog post to HTML in using @astropub/md? **Sample markdown blog post** ```md --- title: Sample image meta: description: This is a simple post to say hello to the world. pubDate: 2024-03-28 --- ![an image](./images/mountain.jpeg) ``` **Blog overview Astro template** ```html --- import { getCollection } from "astro:content"; import { Markdown } from "@astropub/md"; const allPosts = await getCollection("posts"); --- <ul> { allPosts.map((post: any) => ( <li> <a href={`/blog/${post.slug}/`}>{post.data.title}</a> <Markdown of={post.body} /> </li> )) } </ul> ``` **The issue** The image is only loading on the single blog post, not in the blog overview. It's almost as if Vite isn't parsing images loaded through @astropub/md's <Markdown /> component. Blog overview (doesn't load): The `src` of the `img` tag is: `./images/mountain.jpeg` [enter image description here](https://i.stack.imgur.com/n0koj.png) Blog post (works fine): The `src` of the `img` tag is: `/_image?href=...` [enter image description here](https://i.stack.imgur.com/hL3tt.jpg)
null
VSCode happily supports this starting in January 2024 (version 1.86). See https://code.visualstudio.com/updates/v1_86#_review-multiple-files-in-diff-editor. Note the `...` menu with the "Inline View" toggle item seems to be missing though for "multi diff". So to get inline view you need to add ` "diffEditor.renderSideBySide": false` to your settings.
The reason for the error was I put the following code inside the for loop. After moving the code outside the loop, the only thing I changed was the code from: ``` $d = DateTime::createFromFormat("Y-m",$current_date); ``` to: ``` $d = DateTime::createFromFormat("Y-m-d",$current_date); ```
null
You create a `Proxy` with two parameters: * **target**: the original object which you want to proxy * **handler**: an object that defines which operations will be intercepted and how to redefine intercepted operations. The objects entries are called "traps". This is analogous to the concept of _traps_ in operating systems. It can contain the following traps: * `getPrototypeOf()` * `setPrototypeOf()` * `isExtensible()` * `preventExtensions()` * `getOwnPropertyDescriptor()` * `defineProperty()` * `has()` * `get()` * `set()` * `deleteProperty()` * `ownKeys()`
null
|cookies|proxy|reverse-proxy|http-proxy|forward-proxy|
So i have managed to store my image on firebase storage from my node js backend and storing the link to that image in my database also but when I try to go to the URL where my image is stored I get the error in the image attached so looked it up and tried changing my rules for my storage to allow read from all but still get that error does anyone know why as I want to display this image on the client side of my app but it doesn't work right now as access isn't allowed do you need to give the token to access it or is there anyway that the rules can be modified that any user can view (so read) but only authed can write? error message image: [![enter image description here][1]][1] error message: > Anonymous caller does not have storage.objects.get access to the > Google Cloud Storage object. Permission 'storage.objects.get' denied > on resource (or it may not exist). storage rules: rules_version = '2'; // Craft rules based on data in your Firestore database // allow write: if firestore.get( // /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin; service firebase.storage { match /b/{bucket}/o { match /{allPaths=**} { allow read; } } } server side code to upload the image (this works) async function uploadProfilePicture(path) { console.log("inside profile pciture func path = ", path); const bucket = admin.storage().bucket(); const uploadedFile = await bucket.upload(path); console.log("uploaded file = ", uploadedFile); const [metadata] = await uploadedFile[0].getMetadata(); console.log("upload file metadata = ", metadata); const downloadUrl = uploadedFile[0].getSignedUrl({ action: "read", expires: "01-01-2028", }); console.log("download url = ", downloadUrl[0]); return metadata.selfLink; } client side to view the profile pic: return ( <div className="bg-gray-100 p-4"> {medallionProfile.lastName}</h2> <img style={{height: '300px', width: 'auto'}} src={medallionProfile.profilePicture}></img> </div> ); [1]: https://i.stack.imgur.com/Mpr7u.png
You can do this, and I have managed to do it successfully. But it takes some effort. Here are some things I would suggest keeping in mind. 1) Figure out the Image format that you are extracting from. If you do a binwalk on `bzImage`, you'll see compressed images at various locations. 2) manually extract the kernel `vmlinux` from the `bzImage`. You'll need to figure out exactly what compression was used so you can recompress it later 3) while you can use `vmlinux-to-elf` to create an ELF file that contains symbols, you should only use that as a reference for debugging/analysis with Binary Ninja, Ghidra, IDA etc... Don't try to modify the resulting elf file and packing it back up. 4) modify the extracted vmlinux in the tool of your choice, patch asm etc... 5) when you're done, save the binary, compress it again with exactly the same options as the original, and replace the data in the original `bzImage` file. For step `2`, I would recommend looking at the kernel sources to determine specific flags for compression, and make sure that you can uncompress and recompress without making any changes to the file. The recompressed file should be identical to the original compressed version. Probably not the answer you were looking for, but hopefully helpful to someone in the future. I may at some point do a writeup with examples since it's pretty fun and interesting.
You can delete a endpoint using the python azure ml sdk from azureml.core import Workspace, Webservice service = Webservice(workspace=ws, name='your-service-name') service.delete() Then if you want to re create you can re deploy the model from azureml.core.model import InferenceConfig from azureml.core.webservice import AciWebservice from azureml.core.model import Model service_name = 'my-custom-env-service' inference_config = InferenceConfig(entry_script='score.py', environment=environment) aci_config = AciWebservice.deploy_configuration(cpu_cores=1, memory_gb=1) service = Model.deploy(workspace=ws, name=service_name, models=[model], inference_config=inference_config, deployment_config=aci_config, overwrite=True) service.wait_for_deployment(show_output=True)
When you change the display of graph type to "Report" type, a different real time log window appears where _Total is replaced (continuously) by a real number.
I am porting some code that defined tty_ldisc_ops.ioctl() as: ```` static int ...ldisc_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) ```` But the current spec (https://docs.kernel.org/driver-api/tty/tty_ldisc.html#id3) is: ```` static int ...ldisc_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) ```` What happened to the "file" argument? I looked for change logs and source.
Was there a previous version of tty_ldisc_ops.ioctl() that also required a file argument?
|tty|ioctl|
I am working on a web api that consumes Spotify API and I can't make the call for the search endpoint. It's my first time making an API consumes other and also my first time using stack overflow, so I really dont know how to explain to you guys but I will pass part of the code that I think its important ``` @RestController @RequestMapping("/spotify/api") public class SearchController { private final AuthSpotifyClient authSpotifyClient; private final SearchClient searchClient; public SearchController(AuthSpotifyClient authSpotifyClient, SearchClient searchClient) { this.authSpotifyClient = authSpotifyClient; this.searchClient = searchClient; } @GetMapping("/search") public ResponseEntity<SearchResponse> search(@RequestBody String q, @RequestBody String type){ var request = new LoginRequest( "confidential", "confidential", "confidential" ); var token = authSpotifyClient.login(request).getAcessToken(); var response = searchClient.search("Bearer " + token, q, type); return ResponseEntity.ok(response); } } @FeignClient( name = "SearchClient", url = "https://api.spotify.com/v1/search?" ) public interface SearchClient { @GetMapping("?q={q}&type={type}") SearchResponse search(@RequestHeader("Authorization") String authorization, @PathVariable String q, @PathVariable String type); } ``` When I run it the endpoint returns 400 Bad Request
After following this doc https://github.com/Azure/azure-search-vector-samples/blob/main/demo-python/code/azure-search-vector-python-sample.ipynb I am trying to upload documents that are stored in a json format. When trying to run this command search_client = SearchClient(endpoint=service_endpoint, index_name=index_name, credential=credential) result = search_client.upload_documents(documents) print(f"Uploaded {len(documents)} documents") I am running into this issue Message: The request is invalid. Details: A null value was found with the expected type 'search.documentFields[Nullable=False]'. The expected type 'search.documentFields[Nullable=False]' does not allow null values. Tried the public doc https://github.com/Azure/azure-search-vector-samples/blob/main/demo-python/code/azure-search-vector-python-sample.ipynb
- `tempArray will have more items in it, both longer and shorter pause` You don't have to keep maintaining the list. - ***Assuming*** there are no more than two consecutive square brackets (eg. `[[[`) in the document, otherwise, additional code would be needed to handle it. - The code replaces all instances in Word doc. ```vbscript Option Explicit Sub ReplaceBracket() Dim aTxt, sRepTxt As String, i As Long aTxt = Array("\[\[([!\[\]]@)\]\]", "\[([!\[\]]@)\]\]", "\[\[([!\[\]]@)\]", "||([!\[\]]@)||") For i = 0 To UBound(aTxt) sRepTxt = IIf(i = UBound(aTxt), "[[\1]]", "||\1||") With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchByte = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Text = aTxt(i) .Replacement.Text = sRepTxt .Execute Replace:=wdReplaceAll End With Next End Sub ``` [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/Pmt7f.png
{"Voters":[{"Id":2852165,"DisplayName":"SHR"}],"DeleteType":1}
|python|computer-vision|face-detection|
I have a monorepo with the following directory structure ``` backend/ frontend/ .vscode/ extensions.json ``` However, I would like to conditionally recommend an extension for the `frontend` project, when someone works on that. Is that possible? If yes, how? I have tried creating a `.vscode/extension.json` but VSCode doesn't seem to pick up that directory.
Is there a way to specify recommended VSCode extensions for a subproject in a monorepo?
|visual-studio-code|vscode-extensions|
null
I got caught up on the Class being Bluetooth. It turns out my bluetooth headset stored the battery info in a device in the System Class. I found a way to filter to find the right device basically like Lockzsmith. Like for a jabra device you might do this: Get-PnpDevice -FriendlyName '*jabra*' | Select-Object Class,FriendlyName,@{L="Battery";E={(Get-PnpDeviceProperty -DeviceID $_.PNPDeviceID -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2').Data}}
null
Dafny is a programming language with built-in specification and verification constructs.
null
Supabase auth sessions are stored client-side, so in theory clearing local storage without calling your logout API endpoint should suffice. However the downside is that if the user is logged in on multiple devices, this will only log them out on the current one. Ideally yes, you would have the Supabase client on your frontend. Any alternative would be a bit hacky, such as interacting with the users table directly rather than auth sessions.
I concur with the point mentioned by @eliasah. You can implement checkpointing to improve the performance of the long lineage that is created. Additionally I would suggest you containerize the `List[(DataFrame, Seq[String], String)]` into a case class so that there is readability, type safety as the compiler will catch any attempt to use the value of wrong type. ```scala case class JoinInfo(df: DataFrame, joinCols: Seq[String], joinType: String) /** * Join the dataframes based on the joinInfos provided and return the resulting dataframe * @param baseDf The base dataframe to join with * @param joinInfos The list of dataframes to join with the base dataframe * @param shouldCheckpoint Whether to checkpoint the resulting dataframe * @return The resulting dataframe after joining all the dataframes */ def joinDataframes(baseDf: DataFrame, joinInfos: List[JoinInfo], shouldCheckpoint: Boolean = false): DataFrame = { joinInfos.foldLeft(baseDf) { case (currentDf, JoinInfo(df, joinCols, joinType)) => val joinedDf = currentDf.join(df, joinCols, joinType) if (shouldCheckpoint && spark.sparkContext.getCheckpointDir.isDefined) { joinedDf.checkpoint() } else { joinedDf } } } ``` This is comparatively scalable as well, since if you want to add an extra parameter you can do so by modifying the case class instead of adjusting the elements. You can now use it on the data as below: ```scala val tableA = // data val tableB = // data val tableC = // data val joinInfos = List( JoinInfo(tableB, Seq("id", "name"), "inner"), JoinInfo(tableC, Seq("id"), "inner") ) val joinedDf = joinDataframes(tableA, joinInfos, shouldCheckpoint = true) ``` Here, you are performing the checkpoint when it is enabled in your session. When `checkpoint` is performed on an RDD or DataFrame, Spark saves the data to a checkpoint directory on disk and uses this saved version for future actions. This means that the next time an action is performed on the RDD or DataFrame, Spark doesn't need to compute the entire lineage, but only the transformations that were applied after the checkpoint.
Find information about third-party cookie blocking in Chromium-based browsers at https://developers.google.com/privacy-sandbox/3pcd.
null
[![picture of the white space][1]][1] I want to make the white space around flex items smaller. This is essentially a parent flex box with child flex boxes. Here's my code: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> .contain { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; } .modal { width: 50vw; height: 50%; margin:30px; padding: 1rem; background-color: aqua; border: 1px solid black; border-top: 15px solid black; color: black; overflow: scroll; overflow-x: hidden; display: flex; flex-direction: column; text-align: left; } .parent-box { display: flex; width: 70%; height: 50vh; margin-left:auto; margin-right:auto; margin-bottom:10px; margin-top:10px; overflow: scroll; overflow-x: hidden; justify-content: space-between; align-items: center; flex-direction: column; font-size: 30px; text-align: center; background-color: #7d7d7d; color: #000000; font-weight: bold; } <!-- language: lang-html --> <div class="parent-box"> <div class="contain"> <div class="modal"> <h2>Plans For The Site</h2> <p><span class="date">~12-03-24 00:57~</span><br><span class=body>so, in order, i want to get this little blog thing working and looking the way i want, create the gifs and pictures for the background and buttons, create a font and add it, add some little music effects to everything, add some content to the different pages, add a little gir cursor, and then i think ill put the link up on my socials. once i get to the point of putting it up on my socials, ill subscirbe and get a domain name that i like... before that im just gonna keep working on the free subscription unless i run out of space. eta with the way im working looks to be about a week- 3 weeks, esp with the clothing im working on.</span> </div> </div> <div class="contain"> <div class="modal"> <h2>Plans For The Site</h2> <p><span class="date">~11-03-24 01:38~</span><br><span class=body>Just got the website front page done superficially, need to create the gifs and pictures and background, and need to figure out how to format this blog better than it is atm... make take a day or so... going to bed right now though</span></p> </div> </div> </div> <!-- end snippet --> I've tried using margins in all three CSS styles, but it seems to do nothing. I'm just trying to make the gray space at the top smaller and responsive. [1]: https://i.stack.imgur.com/OsWrx.png
Calling search endpoint for Spotify API in java
|java|spring-boot|api|spotify|webapi|
null
Firstly, I'm so sorry if this is a dupplicated question. let's say I have a simple python code named decorator.py with decorator here: ```python `def decorator(func): def wrapper(): print("Before function.") val = func() print("After function.") return val return wrapper() # <- please pay attention to this line` @decorator def hello(): print("hello!") @decorator def good_bye(): print("good_bye!") @decorator def thank_you(): print("thank_you!") @decorator def thanks_a_lot(): print("thanks_a_lot!") ``` the result after running the code ``` Before function. hello! After function. Before function. good_bye! After function. Before function. thank_you! After function. Before function. thanks_a_lot! After function. [Finished in 46ms] ``` this mean, return wrapper() calls all my functions? what is the difference between wrapper() and wrapper in this case. I appreciate for your explaination. I'm tring to run on debug mode to find out, but still got nothing, I hope I'll get a detail explaination
different between "return func" and "return func()"
|python-3.x|function|variables|scope|python-decorators|
null
I am learning about design patterns in Python and wanted to combine the abstract factory with the delegation pattern (to gain deeper insights into how the pattern works). However, I am getting a weird recursion error when combining the two patterns, which I do not understand. The error is: [Previous line repeated 987 more times] File "c:\Users\jenny\Documents\design_pattern\creational\abstract_factory.py", line 60, in __getattribute__ def __getattribute__(self, name: str): RecursionError: maximum recursion depth exceeded The code is: from abc import abstractmethod class ITechnique: #abstract product def display(self): pass def turn_on(self): print("I am on!") def turn_off(self): print("I am off!") class Laptop(ITechnique): #concrete product def display(self): print("I'am a Laptop") class Smartphone(ITechnique): #concrete product def display(self): print("I'am a Smartphone") class Tablet(ITechnique): #concrete product def display(self): print("I'm a tablet!") class IFactory: @abstractmethod def get_hardware(): pass class SmartphoneFactory(IFactory): def get_hardware(self): return Smartphone() class LaptopFactory(IFactory): def get_hardware(self): return Laptop() class TabletFactory(IFactory): def get_hardware(self): return Tablet() class Client(): def __init__(self, factory: IFactory) -> None: self._hardware = factory.get_hardware() def __getattribute__(self, name: str): return getattr(self._hardware, name) if __name__ == "__main__": client_with_laptop = Client(LaptopFactory()) client_with_laptop.display() client_with_tablet = Client(TabletFactory()) client_with_tablet.display() client_with_smartphone = Client(SmartphoneFactory()) client_with_smartphone.display() When I access the attribute _hardware and remove the get_attribute section (so, basically, when I remove the delegation pattern), everything works as expected. See below the modified code section, which works: class Client(): def __init__(self, factory: IFactory) -> None: self._hardware = factory.get_hardware() if __name__ == "__main__": client_with_laptop = Client(LaptopFactory()) client_with_laptop._hardware.display() client_with_tablet = Client(TabletFactory()) client_with_tablet._hardware.display() client_with_smartphone = Client(SmartphoneFactory()) client_with_smartphone._hardware.display() Can anybody help me explain why the recursion error occurs or how to fix it. My objective was (1) to have varying devices depending on the factory used in client and (2) to be able to call the methods from the `_hardware` without typing `client._hardware` all the time but calling it directly from the client object, e.g. `client.display()`. It is not whether this is, in reality, a useful approach or not; I simply want to understand the pattern - and the occurring error - better. :-)
How can I render images from markdown to HTML in Astro using @astropub/md?
|vite|astrojs|astro|
null
Here is the complete content of my .pro file (I have specified to add the network module): ``` QT += quick virtualkeyboard network # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 CONFIG += c++14 SOURCES += \ main.cpp RESOURCES += qml.qrc \ resources/icon.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target ``` However, when I use the QNetwork module in my QML file like this: ``` import QtNetwork 2.15 ``` I am pointed out with the issue: ``` QML module not found (QNetwork) Import paths:E:/Qt/5.15.2/msvc2019/qml For qmake projects, use the QML_IMPORT_PATH variable to add import paths. For Qbs projects, declare and set a qmllmportPaths property in your product to add import paths. For qmlproject projects, use the importPaths property to add import paths. For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt. For qmlRegister.. calls, make sure that you define the Module URl as a string literal. ``` I checked folder '**E:\Qt\5.15.2\msvc2019**', and indeed, I did not find any files related to the QNetwork module. What is going on? How should I use this module? I have tried various solutions found online, but many of them are aimed at Visual Studio IDE. In reality, I am using **Windows 10 22H2 with QT 5.15, MSVC2019 32bit** compiler, and my Integrated Development Environment (IDE) is **QT Creator**.
class app : Application(), androidx.work.Configuration.Provider { override val workManagerConfiguration: androidx.work.Configuration get() = androidx.work.Configuration.Builder().setJobSchedulerJobIdRange(....).build()
I want to launch the touchpanel calibration program from within my application I'm developing. I am able to launch **MultiDigiMon** from regular cmd but I can't get it to work in the elevated Embarcadero IDE using `system("start C:\\Windows\\System32\\MultiDigiMon.exe -touch");` command. Any ideas what may be the cause of this problem?
Start a program from System32 in C++ Builder 11
|touch|c++builder|calibration|
Its because of the `*` which is a quantifier that allows for zero occurrences, meaning it can also match empty strings, change it to `+` which is quantifier for one or more occurrences of the preceding element <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> const stringPattern = "[a-zA-Z0-9]+"; const stringRegex = new RegExp(stringPattern, "g"); const str = "there are 33 states and 7 union territory in india."; const matches = str.match(stringRegex); console.log({ matches }); <!-- end snippet -->
null
null
null
null
It appears you are handling the provider context wrong, instead of storing the context in a variable and using it later, consider using a callback or a notifier to trigger changes in your provider, something like this: import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import './providers/socket_data_provider.dart'; import 'package:wineasy/screens/test.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MultiProvider( providers: [ ChangeNotifierProvider(create: (context) => SocketDataProvider()), ], child: MaterialApp( debugShowCheckedModeBanner: false, theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.red), useMaterial3: true, ), home: const Scaffold( body: Test(), ), ), ); } } and in you socketDataProvider: class SocketDataProvider extends ChangeNotifier { // Your socket data void initializeSocket() { // Setup your socket connection here // On receiving data, call setSocketData } void setSocketData(dynamic orders) { // Update your data notifyListeners(); } } and to get the SocketData simply use: final socketData = Provider.of<SocketDataProvider>(context);
I got caught up on the Class being Bluetooth. It turns out my bluetooth headset stored the battery info in a device in the System Class. I found a way to filter to find the right device basically like Lockzsmith. Like for a jabra device you might do this: Get-PnpDevice -FriendlyName '*jabra*' | Select-Object Class,FriendlyName,@{L="Battery";E={(Get-PnpDeviceProperty -DeviceID $_.PNPDeviceID -KeyName '{104EA319-6EE2-4701-BD47-8DDBF425BBE5} 2').Data}}
So, i wanted to make a website to change the font of the text that you enter in, basically like lingojam.com. I did make it but for some reason only some fonts are working and i have no idea why, can anyone help? sorry for the bad code, i am new to javascript, svelte, html etc ``` <script> let fonts = {1:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':'ᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢᴀʙᴄᴅᴇғɢʜɪᴊᴋʟᴍɴᴏᴘǫʀsᴛᴜᴠᴡxʏᴢ'}, 2:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':'ᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻᵃᵇᶜᵈᵉᶠᵍʰᶦʲᵏˡᵐⁿᵒᵖᵠʳˢᵗᵘᵛʷˣʸᶻ'}, 3:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':'ℂℍℕℙℚℝℤ'}, 4:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':''}, 5:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':''}, 6:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':''}, 7:{'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ':''} } function changeFont(text) { let output = ''; for (const font in fonts) { const alphabet = Object.keys(fonts[font])[0]; const transformedText = text.split('\n').map(line => line.split('').map(char => (alphabet.includes(char) ? fonts[font][alphabet][alphabet.indexOf(char)] : char) ).join('') ).join('\n'); output += transformedText + '\n\n'; } return output; } let newText = 'Feliz, Navidad.' let orignalText = 'Feliz, Navidad.' function changeInputText() { newText = changeFont(orignalText) console.log(newText) } </script> ``` The output it gives is this: ғᴇʟɪᴢ, ɴᴀᴠɪᴅᴀᴅ. ᶠᵉˡᶦᶻ, ⁿᵃᵛᶦᵈᵃᵈ. �, �. �, �. �, �. �, �. �, �. As you can see, The first to lines are correct but other are weird and look corrupted. Its self explanatory, i expected the converter to convert the text into different fonts correctly but instead only 2 fonts were correct and others were looking weird and corrupted.
Solution: #include <sys/wait.h> #include <sys/mman.h> #include <stdlib.h> #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <time.h> #include <semaphore.h> #include "macros.h" #define SHM_NAME "/shm111" #define MUTEX "/mutex" #define FULL "/full" #define EMPTY "/empty" #define N 10 typedef struct{ int B[N]; int head; int tail; } STRUCT_BUFFER; void put(int, STRUCT_BUFFER*, sem_t*, sem_t*, sem_t*); int get(STRUCT_BUFFER*, sem_t*, sem_t*, sem_t*); int main(){ int ret_value, mem_fd; pid_t pid; sem_t * mutex; sem_t * full; sem_t * empty; STRUCT_BUFFER *buf; // Creating shared memory area SYSC(mem_fd, shm_open(SHM_NAME, O_CREAT | O_EXCL | O_RDWR, 0666), "in shm_open"); SYSC(ret_value, ftruncate(mem_fd, sizeof(STRUCT_BUFFER)), "in ftruncate"); // Memory mapping SYSCN(buf, (STRUCT_BUFFER*)mmap(NULL, sizeof(STRUCT_BUFFER), PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, 0), "in mmap"); buf->head = 0; buf->tail = 0; // Closing fd SYSC(ret_value, close(mem_fd), "in close"); // Creating semaphores mutex = sem_open(MUTEX, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 1); if(mutex == SEM_FAILED) { perror("In sem_open"); exit(EXIT_FAILURE); } full = sem_open(FULL, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, N); if(full == SEM_FAILED) { perror("In sem_open"); exit(EXIT_FAILURE); } empty = sem_open(EMPTY, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, 0); if(empty == SEM_FAILED) { perror("In sem_open"); exit(EXIT_FAILURE); } // Creating a new process SYSC(pid, fork(), "in fork"); if(!pid) { // Consumer code printf("Consumer %d starts\n",getpid()); int toGet; while(1) { toGet = get(buf, mutex, full, empty); printf("Consumer %d consumed %d\n", getpid(), toGet); // If termination token if(toGet == -1) { put(toGet, buf, mutex, full, empty); break; } } sleep(1); printf("Consumer %d ends\n",getpid()); exit(EXIT_SUCCESS); } else { // Producer code printf("Producer %d starts\n",getpid()); int toPut; int exitToken = -1; // Production for(int i = 0 ; i < N ; i++) { toPut = i + 1; put(toPut, buf, mutex, full, empty); printf("Producer %d produced %d. Cycle:%d\n", getpid(), toPut, i); sleep(1); } // Termination token put(exitToken, buf, mutex, full, empty); printf("Producer %d produced termination token\n", getpid()); sleep(1); // Wait SYSC(ret_value, wait(NULL), "in wait"); // Closing semaphores sem_close(mutex); sem_close(empty); sem_close(full); sem_unlink(MUTEX); sem_unlink(FULL); sem_unlink(EMPTY); // Closing shared memory munmap(buf, sizeof(STRUCT_BUFFER)); printf("Producer %d ends\n",getpid()); exit(EXIT_SUCCESS); } } void put(int toPut, STRUCT_BUFFER* buf, sem_t * mutex, sem_t * full, sem_t * empty) { sem_wait(full); sem_wait(mutex); // Critical section buf->B[buf->tail] = toPut; buf->tail = ((buf->tail) + 1) % N; sem_post(mutex); sem_post(empty); } int get(STRUCT_BUFFER* buf, sem_t * mutex, sem_t * full, sem_t * empty) { sem_wait(empty); sem_wait(mutex); // Critical section int toGet; toGet = buf->B[buf->head]; buf->head = ((buf->head + 1) % N); sem_post(mutex); sem_post(full); return toGet; }
Previously, Visual Studio Code was correctly applying formatting on save as specified in a _.clang-format_ file. However, recently (sometime in the last month or so) this broke on a case-sensitive file system. The following is what is getting printed in the output console when I try to format the file _myCamelCaseFile.c_: > Formatting failed: > > c:\Users\JeffG\\.vscode\extensions\ms-vscode.cpptools-1.19.6-win32-x64/bin/../LLVM/bin/clang-format.exe > "-style={ BasedOnStyle: LLVM }" -fallback-style=LLVM -sort-includes=0 > --Wno-error=unknown -assume-filename=\\\\CaseSensitiveFS\some\path\mycamelcasefile.c \\\\CaseSensitiveFS\SOME\PATH\MYCAMELCASEFILE.C The generated formatting command is converting the full path (other than the remote server) to uppercase. Correcting the casing on the uppercase path fixes the command (note that the lowercase path is also incorrect, but it doesn't seem to matter). How can I configure the clang-format command line to prevent modifying the path casing?
**UPDATE: 2023** You will need `s3fs` to be installed as that's what pandas uses now. This will most probably be a permission issue with either your IAM configuration or the way you're calling `boto3` not configured properly. Also depends if it's running locally, on an ec2 etc. **OLD ANSWER** Pandas uses `boto` (not `boto3`) inside `read_csv`. You might be able to install boto and have it work correctly. There's [some troubles](https://github.com/pydata/pandas/issues/11915) with boto and python 3.4.4 / python3.5.1. If you're on those platforms, and until those are fixed, you can use boto 3 as import boto3 import pandas as pd s3 = boto3.client('s3') obj = s3.get_object(Bucket='bucket', Key='key') df = pd.read_csv(obj['Body']) That `obj` had a `.read` method (which returns a stream of bytes), which is enough for pandas.